[
  {
    "path": ".eslintignore",
    "content": "test/lib\ndemo\ndist\ntest/.eslintrc.js\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "/* @flow */\n\nmodule.exports = {\n  extends: \"@krakenjs/eslint-config-grumbler/eslintrc-browser\",\n\n  globals: {\n    __ZOID__: true,\n    __POST_ROBOT__: true,\n  },\n\n  rules: {\n    \"react/display-name\": \"off\",\n    \"react/prop-types\": \"off\",\n  },\n\n  overrides: [\n    {\n      files: [\"test/**/*\"],\n      rules: {\n        \"max-lines\": \"off\",\n        \"compat/compat\": \"off\",\n      },\n    },\n  ],\n};\n"
  },
  {
    "path": ".flowconfig",
    "content": "[ignore]\n.*/node_modules/babel-plugin-flow-runtime\n.*/node_modules/flow-runtime\n.*/node_modules/npm\n.*/node_modules/jsonlint\n.*/node_modules/resolve\n.*/dist/module\n[include]\n[libs]\nflow-typed\nsrc/declarations.js\nnode_modules/@krakenjs/post-robot/src/declarations.js\n[options]\nmodule.name_mapper='^src\\(.*\\)$' -> '<PROJECT_ROOT>/src/\\1'\nexperimental.const_params=false"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "# Owner for everything in the repo\n*       @krakenjs/checkout-sdk\n"
  },
  {
    "path": ".github/workflows/main.yml",
    "content": "name: build\n\non:\n  push:\n    branches:\n      - main\n  pull_request: {}\njobs:\n  main:\n    runs-on: ubuntu-latest\n    steps:\n      - name: ⬇️ Checkout repo\n        uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n\n      - name: ⎔ Setup node\n        uses: actions/setup-node@v2\n        with:\n          node-version: \"16\"\n          registry-url: \"https://registry.npmjs.org\"\n\n      - name: 📥 Download deps\n        uses: bahmutov/npm-install@v1\n        with:\n          useLockFile: false\n\n      - name: 👕 Lint commit messages\n        uses: wagoid/commitlint-github-action@v4\n\n      - name: ▶️ Run build and test script\n        run: npm run build\n\n      - name: ⬆️ Upload karma coverage report\n        uses: codecov/codecov-action@v2\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "name: publish to npm\non: workflow_dispatch\njobs:\n  main:\n    runs-on: ubuntu-latest\n    steps:\n      - name: ⬇️ Checkout repo\n        uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n\n      - name: ⎔ Setup node\n        # sets up the .npmrc file to publish to npm\n        uses: actions/setup-node@v2\n        with:\n          node-version: \"16\"\n          registry-url: \"https://registry.npmjs.org\"\n\n      - name: 📥 Download deps\n        uses: bahmutov/npm-install@v1\n        with:\n          useLockFile: false\n\n      - name: Configure git user\n        run: |\n          git config --global user.email ${{ github.actor }}@users.noreply.github.com\n          git config --global user.name ${{ github.actor }}\n\n      - name: Publish to npm (main branch)\n        if: github.ref_name == 'main'\n        run: npm run release\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.KRAKENJS_PAYPAL_SDK_NPM_AUTH_TOKEN }}\n\n      - name: Publish alpha to npm (non-main branch)\n        if: github.ref_name != 'main'\n        run: npm run release:alpha\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.KRAKENJS_PAYPAL_SDK_NPM_AUTH_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directory\n# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git\nnode_modules\n\n#IDE\n.idea/*\n\n.DS_Store\n\npackage-lock.json\n"
  },
  {
    "path": ".husky/.gitignore",
    "content": "_\n"
  },
  {
    "path": ".husky/commit-msg",
    "content": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpx --no -- commitlint --edit \"$1\"\n"
  },
  {
    "path": ".husky/pre-commit",
    "content": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpx lint-staged\n"
  },
  {
    "path": ".npmrc",
    "content": "registry=https://registry.npmjs.org/\npackage-lock=false\nsave=false\n"
  },
  {
    "path": ".prettierignore",
    "content": "build\ndist\ncoverage\nflow-typed\ntest/lib/\nCHANGELOG.md\n"
  },
  {
    "path": ".prettierrc.json",
    "content": "{}\n"
  },
  {
    "path": "AUTHORS.md",
    "content": "Daniel Brain <dbrain@paypal.com>\nAnurag Sinha <anusinha@paypal.com>\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n\n### [10.5.1](https://github.com/krakenjs/zoid/compare/v10.5.0...v10.5.1) (2026-03-23)\n\n## [10.5.0](https://github.com/krakenjs/zoid/compare/v10.4.0...v10.5.0) (2026-01-07)\n\n\n### Features\n\n* add support for publishing alpha branches to npm ([#474](https://github.com/krakenjs/zoid/issues/474)) ([90c0b73](https://github.com/krakenjs/zoid/commit/90c0b73b2e658b5931f644cf8ae1f2871bc8f829))\n\n## [10.4.0](https://github.com/krakenjs/zoid/compare/v10.3.3...v10.4.0) (2024-12-19)\n\n\n### Features\n\n* add getExtensions method to extend zoid component instance ([#468](https://github.com/krakenjs/zoid/issues/468)) ([44d2d24](https://github.com/krakenjs/zoid/commit/44d2d242dc60765a015821b7b3153fdfa18d7c00))\n* support additional properties to be added to zoid component from the client ([#464](https://github.com/krakenjs/zoid/issues/464)) ([d2f3f09](https://github.com/krakenjs/zoid/commit/d2f3f0992ae9947e709d20875a666aedce645e3c))\n\n\n### Bug Fixes\n\n* commit flow-typed to fix ci ([#457](https://github.com/krakenjs/zoid/issues/457)) ([e4da223](https://github.com/krakenjs/zoid/commit/e4da22308b286fb2212af543574a1e66de7c70d1))\n* resolve the promise when component is closed/destroyed ([#455](https://github.com/krakenjs/zoid/issues/455)) ([b42cc03](https://github.com/krakenjs/zoid/commit/b42cc038ec0019165848aa95ebffa652960e61d7))\n* skip failing test ([#466](https://github.com/krakenjs/zoid/issues/466)) ([a70f250](https://github.com/krakenjs/zoid/commit/a70f250501cdfeba253a36afcdc8937afc2c42ee))\n\n### [10.3.3](https://github.com/krakenjs/zoid/compare/v10.3.2...v10.3.3) (2023-11-02)\n\n\n### Bug Fixes\n\n* **initChild:** setName is applied in popup context ([#444](https://github.com/krakenjs/zoid/issues/444)) ([b26b8cb](https://github.com/krakenjs/zoid/commit/b26b8cba89324710beecbc09b99551ccf6630e32))\n\n### [10.3.2](https://github.com/krakenjs/zoid/compare/v10.3.1...v10.3.2) (2023-10-30)\n\n\n### Bug Fixes\n\n* reduce frequency of iframe removed error ([#429](https://github.com/krakenjs/zoid/issues/429)) ([fd2ec05](https://github.com/krakenjs/zoid/commit/fd2ec05cab35143abc287649f6868ace4eb5626e))\n* **venmo:** window name ([#443](https://github.com/krakenjs/zoid/issues/443)) ([02bcaab](https://github.com/krakenjs/zoid/commit/02bcaab83512d5339c921fe240f5929b4580e97d))\n\n### [10.3.1](https://github.com/krakenjs/zoid/compare/v10.3.0...v10.3.1) (2023-06-13)\n\n\n### Bug Fixes\n\n* **prop:** trusted domain ([#440](https://github.com/krakenjs/zoid/issues/440)) ([081d0d5](https://github.com/krakenjs/zoid/commit/081d0d5a77bbd496284ef9e138f353a4386b6ee8))\n\n## [10.3.0](https://github.com/krakenjs/zoid/compare/v10.2.4...v10.3.0) (2023-06-12)\n\n\n### Features\n\n* **venmo:** allow trusted domains ([#439](https://github.com/krakenjs/zoid/issues/439)) ([5f3bf00](https://github.com/krakenjs/zoid/commit/5f3bf00a08715154ff110023f0a1b862d560670e))\n\n\n* **docs:** update npm badge ([#437](https://github.com/krakenjs/zoid/issues/437)) ([2ef6fdb](https://github.com/krakenjs/zoid/commit/2ef6fdb4efeeecdbbe446623cf45650499d598fa))\n\n### [10.2.4](https://github.com/krakenjs/zoid/compare/v10.2.3...v10.2.4) (2023-05-22)\n\n### [10.2.3](https://github.com/krakenjs/zoid/compare/v10.2.2...v10.2.3) (2023-05-03)\n\n### [10.2.2](https://github.com/krakenjs/zoid/compare/v10.2.1...v10.2.2) (2023-05-01)\n\n\n### Bug Fixes\n\n* reduce frequency of \"Detected iframe close\" error ([#426](https://github.com/krakenjs/zoid/issues/426)) ([5343277](https://github.com/krakenjs/zoid/commit/53432775742a56aad8377c84258ec8d7a17d0450))\n\n### [10.2.1](https://github.com/krakenjs/zoid/compare/v10.2.0...v10.2.1) (2023-04-25)\n\n\n### Bug Fixes\n\n* only throw errors for major version changes ([#425](https://github.com/krakenjs/zoid/issues/425)) ([57e8989](https://github.com/krakenjs/zoid/commit/57e8989fedf94ea1e1084827acc21fedfad6e267))\n\n## [10.2.0](https://github.com/krakenjs/zoid/compare/v10.1.0...v10.2.0) (2023-04-24)\n\n\n### Features\n\n* upgrade to grumbler scripts 8 ([#414](https://github.com/krakenjs/zoid/issues/414)) ([b857e89](https://github.com/krakenjs/zoid/commit/b857e8930e76ebae77d755f5e9e0f5ac432a5790))\n\n\n### Bug Fixes\n\n* avoid throwing errors if container is no longer in page ([#424](https://github.com/krakenjs/zoid/issues/424)) ([e2825bb](https://github.com/krakenjs/zoid/commit/e2825bb5e08eadde14e8fc7b6b76d9069c5a3daf))\n\n\n* **docs:** update github actions badge url ([#419](https://github.com/krakenjs/zoid/issues/419)) ([31d59fb](https://github.com/krakenjs/zoid/commit/31d59fbd1c89697e3773a5f043a506c95ee009a5))\n* fix typos in parent-props and xprops docs ([#408](https://github.com/krakenjs/zoid/issues/408)) ([2fe2858](https://github.com/krakenjs/zoid/commit/2fe28584d75f9f740ec7a6d162b8d775c9cf39a0))\n* remove token from publish action ([#422](https://github.com/krakenjs/zoid/issues/422)) ([3c6fa18](https://github.com/krakenjs/zoid/commit/3c6fa180c564b248d0e1b2ed66a2eaef8e2527e6))\n* update babel config ([#418](https://github.com/krakenjs/zoid/issues/418)) ([2657252](https://github.com/krakenjs/zoid/commit/2657252085d401d64740fc3c8b372f085705bbf6))\n* use prettier ([#401](https://github.com/krakenjs/zoid/issues/401)) ([3974c52](https://github.com/krakenjs/zoid/commit/3974c52a880e8b7a72201c9ad205b576611e7c65))\n\n## [10.1.0](https://github.com/krakenjs/zoid/compare/v10.0.0...v10.1.0) (2022-05-03)\n\n\n### Features\n\n* add events on prerender start and finish ([#403](https://github.com/krakenjs/zoid/issues/403)) ([c603048](https://github.com/krakenjs/zoid/commit/c6030488dcbb4bb182b630acf722b6a8bbafc5dd))\n\n\n* move devDependencies to [@krakenjs](https://github.com/krakenjs) scope ([#400](https://github.com/krakenjs/zoid/issues/400)) ([a085f40](https://github.com/krakenjs/zoid/commit/a085f408ff4f20d95f22ab5b44acb490038c33d7))\n\n## [10.0.0](https://github.com/krakenjs/zoid/compare/v9.0.87...v10.0.0) (2022-03-01)\n\n\n### ⚠ BREAKING CHANGES\n\n* move to krakenjs scope (#395)\n\n* fix build badge ([eb8677a](https://github.com/krakenjs/zoid/commit/eb8677a3c41f8ad52158ad946573d0df9a47538d))\n* move to krakenjs scope ([#395](https://github.com/krakenjs/zoid/issues/395)) ([c10ac41](https://github.com/krakenjs/zoid/commit/c10ac415ce6a2174c7ef08f2451da95bb9795888))\n* standardize configs ([7504244](https://github.com/krakenjs/zoid/commit/7504244fe9c856a74e210008ed5fac00d2bf114d))\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to zoid\n\nWe are always looking for ways to make our modules better. Adding features and fixing bugs allows everyone who depends\non this code to create better, more stable applications.\nFeel free to raise a pull request to us. Our team would review your proposed modifications and, if appropriate, merge\nyour changes into our code. Ideas and other comments are also welcome.\n\n## Getting Started\n\n1. Create your own [fork](https://help.github.com/articles/fork-a-repo) of this [repository](../../fork).\n\n```bash\n# Clone it\n$ git clone git@github.com:me/zoid.git\n\n# Change directory\n$ cd zoid\n\n# Add the upstream repo\n$ git remote add upstream git://github.com/krakenjs/zoid.git\n\n# Get the latest upstream changes\n$ git pull upstream\n\n# Install dependencies\n$ npm install\n\n# Run scripts to verify installation\n$ npm test\n$ npm run-script lint\n$ npm run-script cover\n```\n\n## Making Changes\n\n1. Make sure that your changes adhere to the current coding conventions used throughout the project, indentation, accurate comments, etc.\n2. Lint your code regularly and ensure it passes prior to submitting a PR:\n   `$ npm run lint`.\n3. Ensure existing tests pass (`$ npm test`) and include test cases which fail without your change and succeed with it.\n\n## Submitting Changes\n\n1. Ensure that no errors are generated by ESLint.\n2. Commit your changes in logical chunks, i.e. keep your changes small per single commit.\n3. Locally merge (or rebase) the upstream branch into your topic branch: `$ git pull upstream && git merge`.\n4. Push your topic branch up to your fork: `$ git push origin <topic-branch-name>`.\n5. Open a [Pull Request](https://help.github.com/articles/using-pull-requests) with a clear title and description.\n\nIf you have any questions about contributing, please feel free to contact us by posting your questions on GitHub.\n\nCopyright 2016, PayPal under [the Apache 2.0 license](LICENSE.txt).\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2017 PayPal\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\"><img width=\"45%\" alt=\"zoid\" src=\"https://cdn.rawgit.com/krakenjs/zoid/main/zoid.png\"></p>\n\n---\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n[![npm version][version-badge]][package]\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/krakenjs/zoid/main.yml?branch=main&logo=github&style=flat-square\n[build]: https://github.com/krakenjs/zoid/actions/workflows/main.yml?query=workflow:build\n[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/zoid.svg?style=flat-square\n[coverage]: https://codecov.io/github/krakenjs/zoid/\n[version-badge]: https://img.shields.io/npm/v/@krakenjs/zoid.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@krakenjs/zoid\n\nA cross-domain component toolkit, supporting:\n\n- Render an iframe or popup on a different domain, and pass down props, including objects and functions\n- Call callbacks natively from the child window without worrying about post-messaging or cross-domain restrictions\n- Create and expose components to share functionality from your site to others!\n- Render your component directly as a React, Vue or Angular component!\n\nIt's 'data-down, actions up' style components, but 100% cross-domain using iframes and popups!\n\n---\n\n### [API Docs](./docs/api/index.md)\n\nPublic options and methods supported by zoid\n\n### [Demos](http://krakenjs.com/zoid/demo/index.htm)\n\nWorking demos of different zoid patterns\n\n### [Demo App](https://github.com/krakenjs/zoid-demo)\n\nForkable demo app with build, test, publishing and demos pre-configured.\n\n### [Example](./docs/example.md)\n\nA full example of a cross-domain component using zoid\n\n---\n\n### Quick example\n\nDefine a component to be put on both the parent and child pages:\n\n```javascript\nvar MyLoginComponent = zoid.create({\n  tag: \"my-login-component\",\n  url: \"http://www.my-site.com/my-login-component\",\n});\n```\n\nRender the component on the parent page:\n\n```javascript\n<div id=\"container\"></div>\n\n<script src=\"script-where-my-login-component-is-defined.js\"></script>\n<script>\n    MyLoginComponent({\n\n        prefilledEmail: 'foo@bar.com',\n\n        onLogin: function(email) {\n            console.log('User logged in with email:', email);\n        }\n\n    }).render('#container');\n</script>\n```\n\nImplement the component in the iframe:\n\n```javascript\n<input type=\"text\" id=\"email\" />\n<input type=\"password\" id=\"password\" />\n<button id=\"login\">Log In</button>\n\n<script src=\"script-where-my-login-component-is-defined.js\"></script>\n<script>\n    var email = document.querySelector('#email');\n    var password = document.querySelector('#password');\n    var button = document.querySelector('#login');\n\n    email.value = window.xprops.prefilledEmail;\n\n    function validUser (email, password) {\n      return email && password;\n    }\n\n    button.addEventListener('click', function() {\n        if (validUser(email.value, password.value)) {\n            window.xprops.onLogin(email.value);\n        }\n    });\n</script>\n```\n\n### Useful Links\n\n- [Introducing zoid](https://medium.com/@bluepnume/introducing-zoid-seamless-cross-domain-web-components-from-paypal-c0144f3e82bf#.ikbg9r1ml)\n- [Turn your web-app into a cross-domain component with five lines of code](https://medium.com/@bluepnume/turn-your-web-app-into-a-cross-domain-component-with-5-lines-of-code-ced01e6795f9#.w8ea7h6ky)\n- [A full example of how to implement and use a zoid](./docs/example.md)\n- [Building PayPal's Button with zoid](https://medium.com/@bluepnume/less-is-more-reducing-thousands-of-paypal-buttons-into-a-single-iframe-using-zoid-d902d71d8875#.o3ib7y58n)\n- [PayPal Checkout - zoid powered Button and Checkout components](https://github.com/paypal/paypal-checkout)\n- [Post-Robot - the cross-domain messaging library which powers zoid](https://github.com/krakenjs/post-robot)\n- [Implementing Zoid video tutorial](https://www.youtube.com/watch?v=UpXavGv7FaI)\n\n#### Framework Specific\n\n- [Build a cross-domain React component](https://medium.com/@bluepnume/creating-a-cross-domain-react-component-with-zoid-fbcccc4778fd#.73jnwv44c)\n- [Introducing support for cross-domain Glimmer components, with zoid](https://medium.com/@bluepnume/introducing-support-for-cross-domain-glimmer-components-with-zoid-21287c9f91f1)\n\n## Rationale\n\n**Writing cross domain components is tricky.**\n\nConsider this: I own `foo.com`, you own `bar.com`, and I have some functionality I want to share on your page.\nI could just give you some javascript to load in your page. But then:\n\n- What if I've written a component in React, but you're using some other framework?\n- What if I have secure form fields, or secure data I don't want your site to spy on?\n- What if I need to make secure calls to my back-end, without resorting to CORS?\n\n**What about an iframe?**\n\nYou could just use a vanilla iframe for all of this. But:\n\n- You have to pass data down in the url, or with a post-message.\n- You need to set up post-message listeners to get events back up from the child.\n- You need to deal with error cases, like if your iframe fails to load or doesn't respond to a post-message.\n- You need to think carefully about how to expose all this functionality behind a simple, clear interface.\n\n**zoid solves all of these problems.**\n\n- You pass data and callbacks down as a javascript object\n- zoid renders the component and passes down the data\n- The child calls your callbacks when it's ready\n\nIt will even automatically generate React and Angular bindings, so people can drop-in your component anywhere and not\nworry about iframes or post-messages.\n\n## FAQ\n\n- **Do I need to use a particular framework like React to use zoid?**\n\n  No, zoid is framework agnostic. You can:\n\n  - Use it with vanilla javascript.\n  - Use it with any framework of your choice.\n  - Use it with React or Angular and take advantage of the automatic bindings on the parent page\n\n- **Why write another ui / component library?**\n\n  This isn't designed to replace libraries like React, which are responsible for rendering same-domain components. In fact, the only\n  real rendering zoid does is iframes and popups; the rest is up to you! You can build your components using any framework,\n  library or pattern you want, then use zoid to expose your components cross-domain. It should play nicely with any other framework!\n\n- **Aren't iframes really slow?**\n\n  Yes, but there are a few things to bear in mind here:\n\n  - zoid isn't designed for building components for your own site. For that you should use native component libraries\n    like React, which render quickly onto your page. Use zoid to share functionality with other sites, that you can't\n    share native-javascript components with\n\n  - zoid also provides mechanisms for pre-rendering html and css into iframes and popups, so you can at least render a\n    loading spinner, or maybe something more advanced, while the new window loads its content.\n\n- **I don't want to bother with popups, can I get zoid with just the iframe support?**\n\n  You can indeed. There's an `zoid.frame.js` and `zoid.frame.min.js` in the `dist/` folder. There's a lot of\n  magic that's needed to make popups work with IE, and that's all trimmed out.\n\n- **Can I contribute?**\n\n  By all means! But please raise an issue first if it's more than a small change, to discuss the feasibility.\n\n- **Is this different to [react-frame-component](https://github.com/ryanseddon/react-frame-component)?**\n\n  Yes. `react-frame-component` allows you to render html into a sandboxed iframe on the same domain. `zoid` is geared\n  around sharing functionality from one domain to another, in a cross-domain iframe.\n\n## Browser Support\n\n- Internet Explorer 9+\n- Chrome 27+\n- Firefox 30+\n- Safari 5.1+\n- Opera 23+\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\n## How is Zoid secure?\n\nZoid uses [Post Robot](https://github.com/krakenjs/post-robot) to do [post messaging](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) between multiple domains.\nZoid helps secure messaging through iframe sandboxing, domain validation, and data protection.\n\n- **Iframe sandboxing** is a default browser feature that blocks others from accessing the data of your iframe instance.\n- **Domain Validation** checks the domain of the connection made to the Zoid child component, if requested. If domains don’t match accepted domains the connect fails. This is to stop access to secure components.\n- **Data Protection** is the way Zoid manages checking domains of where the data was sent from to help protect against malicious data being injected through events.\n\n## Things Zoid does NOT protect against\n\n- **Clickjacking** cannot be avoided. Even though the data is secure, the click is happening outside the scope of Zoid, therefore, Zoid cannot validate those actions. To learn more about **clickjacking** read [this](https://en.wikipedia.org/wiki/Clickjacking).\n\n## Contact us\n\nWe take security very seriously and ask that you follow the following process.\nIf you think you may have found a security bug we ask that you privately send the details to DL-PP-Kraken-Js@paypal.com. Please make sure to use a descriptive title in the email.\n\n## Expectations\n\nWe will generally get back to you within **24 hours**, but a more detailed response may take up to **48 hours**. If you feel we're not responding back in time, please send us a message _without detail_ on Twitter [@kraken_js](https://twitter.com/kraken_js).\n\n## History\n\nNo reported issues\n"
  },
  {
    "path": "babel.config.js",
    "content": "/* @flow */\n\n// eslint-disable-next-line import/no-commonjs\nmodule.exports = {\n  extends: \"@krakenjs/babel-config-grumbler/babelrc-node\",\n\n  ignore: [\"test/lib\"],\n};\n"
  },
  {
    "path": "commitlint.config.js",
    "content": "/* @flow */\n/* eslint import/no-commonjs: off */\n\nmodule.exports = {\n  extends: [\"@commitlint/config-conventional\"],\n};\n"
  },
  {
    "path": "demo/advanced/props/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <h3>Log in on xyz.com</h3>\n\n  <input id=\"email\" placeholder=\"Custom Email\" />\n  <br /><br />\n\n  <div id=\"container\"></div>\n\n  <div id=\"result\"></div>\n\n  <script>\n    // Render the component\n\n    var instance = MyLoginZoidComponent({\n      prefilledEmail: \"foo@bar.com\",\n\n      onLogin: function (email) {\n        console.log(\"User logged in with email:\", email);\n        document.querySelector(\"#result\").innerText = email + \" logged in!\";\n      },\n    });\n\n    instance.render(\"#container\");\n\n    document\n      .querySelector(\"#email\")\n      .addEventListener(\"keyup\", function (event) {\n        instance.updateProps({\n          prefilledEmail: event.target.value,\n        });\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/props/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    window.xprops.onProps((newProps) => {\n      document.querySelector(\"#email\").value = newProps.prefilledEmail;\n    });\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/props/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n\n  // The properties they can (or must) pass down to my component\n\n  props: {\n    prefilledEmail: {\n      type: \"string\",\n      required: false,\n    },\n\n    onLogin: {\n      type: \"function\",\n    },\n  },\n});\n"
  },
  {
    "path": "demo/advanced/react-end-to-end/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/react/16.13.1/umd/react.development.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.13.1/umd/react-dom.development.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js\"></script>\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <div id=\"container\"></div>\n\n  <script type=\"text/babel\">\n    let LoginZoidReactComponent = LoginZoidComponent.driver(\"react\", {\n      React: window.React,\n      ReactDOM: window.ReactDOM,\n    });\n\n    function App() {\n      const [loggedIn, setLoggedIn] = React.useState(false);\n      const [email, setEmail] = React.useState(\"foo@bar.com\");\n\n      let onLogin = (email) => {\n        setEmail(email);\n        setLoggedIn(true);\n      };\n\n      return (\n        <div>\n          <h3>Log in on xyz.com</h3>\n\n          {loggedIn ? (\n            <p>User logged in with email: {email}</p>\n          ) : (\n            <LoginZoidReactComponent prefilledEmail={email} onLogin={onLogin} />\n          )}\n        </div>\n      );\n    }\n\n    ReactDOM.render(<App />, document.querySelector(\"#container\"));\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/react-end-to-end/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/react/16.13.1/umd/react.development.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.13.1/umd/react-dom.development.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js\"></script>\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <div id=\"container\"></div>\n\n  <script type=\"text/babel\">\n    function Login({ onLogin, prefilledEmail }) {\n      let [email, setEmail] = React.useState(prefilledEmail);\n      let [password, setPassword] = React.useState(\"\");\n      let [displaySpinner, setDisplaySpinner] = React.useState(false);\n\n      let login = () => {\n        setDisplaySpinner(true);\n\n        setTimeout(() => {\n          onLogin(email);\n        }, 2000);\n      };\n\n      return (\n        <form>\n          {displaySpinner ? (\n            <div>\n              <svg\n                id=\"spinner\"\n                className=\"spinner\"\n                width=\"65px\"\n                height=\"65px\"\n                viewBox=\"0 0 66 66\"\n                xmlns=\"http://www.w3.org/2000/svg\"\n              >\n                <circle\n                  className=\"path\"\n                  fill=\"none\"\n                  strokeWidth=\"6\"\n                  strokeLinecap=\"round\"\n                  cx=\"33\"\n                  cy=\"33\"\n                  r=\"30\"\n                ></circle>\n              </svg>\n            </div>\n          ) : (\n            <div>\n              <input\n                placeholder=\"email\"\n                value={email}\n                onChange={(event) => setEmail(event.target.value)}\n              ></input>\n\n              <br />\n\n              <input\n                placeholder=\"password\"\n                type=\"password\"\n                value={password}\n                onChange={(event) => setPassword(event.target.value)}\n              ></input>\n\n              <br />\n\n              <button className=\"btn btn-primary\" onClick={login}>\n                Log In\n              </button>\n            </div>\n          )}\n        </form>\n      );\n    }\n\n    function useXProps() {\n      const [xprops, setXProps] = React.useState(window.xprops);\n      React.useEffect(() => {\n        window.xprops.onProps((props) => {\n          setXProps({ ...props });\n        });\n      }, []);\n      return xprops;\n    }\n\n    function App() {\n      const { prefilledEmail, onLogin } = useXProps();\n\n      return <Login prefilledEmail={prefilledEmail} onLogin={onLogin} />;\n    }\n\n    ReactDOM.render(<App />, document.querySelector(\"#container\"));\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/react-end-to-end/login.js",
    "content": "window.LoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/advanced/redirect-different-domain/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"../../../dist/zoid.js\"></script>\n\n  <script src=\"./login-button.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <h3>Log in on xyz.com</h3>\n\n  <div id=\"container\"></div>\n\n  <hr />\n\n  <div id=\"loginContainer\"></div>\n\n  <script>\n    MyLoginButtonComponent({\n      loginContainer: \"#loginContainer\",\n    }).render(\"#container\");\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/redirect-different-domain/login-button.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n\n  <script src=\"./login-button.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <button id=\"openLoginButton\" class=\"btn btn-primary\">Open Log In</button>\n\n  <div id=\"result\"></div>\n\n  <script>\n    document\n      .querySelector(\"#openLoginButton\")\n      .addEventListener(\"click\", function () {\n        // document.querySelector('#openLoginButton').style.display = 'none';\n\n        MyLoginZoidComponent({\n          prefilledEmail: \"foo@bar.com\",\n\n          onLogin: function (email) {\n            console.log(\"User logged in with email:\", email);\n            document.querySelector(\"#result\").innerText = email + \" logged in!\";\n          },\n        }).renderTo(\n          window.parent,\n          window.xprops.loginContainer,\n          zoid.CONTEXT.POPUP\n        );\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/redirect-different-domain/login-button.js",
    "content": "window.MyLoginButtonComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-button-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login-button.htm\", window.location.href).href,\n\n  // The size of the component on their page\n\n  dimensions: {\n    width: \"250px\",\n    height: \"100px\",\n  },\n});\n"
  },
  {
    "path": "demo/advanced/redirect-different-domain/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/redirect-different-domain/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"redirect.htm\", window.location.href).href,\n  domain: [/.*loca.*8080/, /.*loca.*8001/],\n});\n"
  },
  {
    "path": "demo/advanced/redirect-different-domain/redirect.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    location =\n      \"http://localhost:8080/demo/advanced/redirect-different-domain/login.htm\";\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"../../../dist/zoid.js\"></script>\n\n  <script src=\"./login-button.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <h3>Log in on xyz.com</h3>\n\n  <div id=\"container\"></div>\n\n  <hr />\n\n  <div id=\"loginContainer\"></div>\n\n  <script>\n    MyLoginButtonComponent({\n      loginContainer: \"#loginContainer\",\n    }).render(\"#container\");\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote/login-button.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n\n  <script src=\"./login-button.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <button id=\"openLoginButton\" class=\"btn btn-primary\">Open Log In</button>\n\n  <div id=\"result\"></div>\n\n  <script>\n    document\n      .querySelector(\"#openLoginButton\")\n      .addEventListener(\"click\", function () {\n        // document.querySelector('#openLoginButton').style.display = 'none';\n\n        MyLoginZoidComponent({\n          prefilledEmail: \"foo@bar.com\",\n\n          onLogin: function (email) {\n            console.log(\"User logged in with email:\", email);\n            document.querySelector(\"#result\").innerText = email + \" logged in!\";\n          },\n        }).renderTo(window.parent, window.xprops.loginContainer);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote/login-button.js",
    "content": "window.MyLoginButtonComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-button-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login-button.htm\", window.location.href).href,\n\n  // The size of the component on their page\n\n  dimensions: {\n    width: \"250px\",\n    height: \"100px\",\n  },\n});\n"
  },
  {
    "path": "demo/advanced/remote/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/advanced/remote-popup/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"../../../dist/zoid.js\"></script>\n\n  <script src=\"./login-button.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <h3>Log in on xyz.com</h3>\n\n  <div id=\"container\"></div>\n\n  <hr />\n\n  <div id=\"loginContainer\"></div>\n\n  <script>\n    MyLoginButtonComponent({\n      loginContainer: \"#loginContainer\",\n    }).render(\"#container\");\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote-popup/login-button.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n\n  <script src=\"./login-button.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <button id=\"openLoginButton\" class=\"btn btn-primary\">Open Log In</button>\n\n  <div id=\"result\"></div>\n\n  <script>\n    document\n      .querySelector(\"#openLoginButton\")\n      .addEventListener(\"click\", function () {\n        // document.querySelector('#openLoginButton').style.display = 'none';\n\n        MyLoginZoidComponent({\n          prefilledEmail: \"foo@bar.com\",\n\n          onLogin: function (email) {\n            console.log(\"User logged in with email:\", email);\n            document.querySelector(\"#result\").innerText = email + \" logged in!\";\n          },\n        }).renderTo(\n          window.parent,\n          window.xprops.loginContainer,\n          zoid.CONTEXT.POPUP\n        );\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote-popup/login-button.js",
    "content": "window.MyLoginButtonComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-button-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login-button.htm\", window.location.href).href,\n\n  // The size of the component on their page\n\n  dimensions: {\n    width: \"250px\",\n    height: \"100px\",\n  },\n});\n"
  },
  {
    "path": "demo/advanced/remote-popup/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/advanced/remote-popup/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/basic/iframe/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <h3>Log in on xyz.com</h3>\n\n  <div id=\"container\"></div>\n\n  <div id=\"result\"></div>\n\n  <script>\n    // Render the component\n\n    MyLoginZoidComponent({\n      prefilledEmail: \"foo@bar.com\",\n\n      onLogin: function (email) {\n        console.log(\"User logged in with email:\", email);\n        document.querySelector(\"#result\").innerText = email + \" logged in!\";\n      },\n    }).render(\"#container\");\n  </script>\n</body>\n"
  },
  {
    "path": "demo/basic/iframe/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/basic/iframe/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  dimensions: {\n    width: \"300px\",\n    height: \"150px\",\n  },\n\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/basic/popup/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"https://unpkg.com/jsx-pragmatic@2.0.20/dist/jsx-pragmatic.js\"></script>\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <h3>Log in on xyz.com</h3>\n\n  <button id=\"popupLogin\" class=\"btn btn-primary\">Popup Log In</button>\n\n  <div id=\"result\"></div>\n\n  <script>\n    // To render a popup we need to wait for a click event\n\n    document\n      .querySelector(\"#popupLogin\")\n      .addEventListener(\"click\", function () {\n        // Hide the button\n\n        document.querySelector(\"#popupLogin\").style.display = \"none\";\n\n        // Render the component\n\n        MyLoginZoidComponent({\n          prefilledEmail: \"foo@bar.com\",\n\n          onLogin: function (email) {\n            console.log(\"User logged in with email:\", email);\n            document.querySelector(\"#result\").innerText = email + \" logged in!\";\n          },\n        }).render(\"body\", zoid.CONTEXT.POPUP);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/basic/popup/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/basic/popup/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n\n  dimensions: {\n    width: \"300px\",\n    height: \"150px\",\n  },\n\n  // The background overlay\n\n  containerTemplate: ({ uid, tag, context, focus, close, doc }) => {\n    function closeComponent(event) {\n      event.preventDefault();\n      event.stopPropagation();\n      return close();\n    }\n\n    function focusComponent(event) {\n      event.preventDefault();\n      event.stopPropagation();\n      return focus();\n    }\n\n    return pragmatic\n      .node(\n        \"div\",\n        {\n          id: uid,\n          onClick: focusComponent,\n          class: `${tag} ${tag}-context-${context} ${tag}-focus`,\n        },\n\n        pragmatic.node(\"a\", {\n          href: \"#\",\n          onClick: closeComponent,\n          class: `${tag}-close`,\n        }),\n\n        pragmatic.node(\n          \"style\",\n          null,\n          `\n                #${uid} {\n                    position: fixed;\n                    top: 0;\n                    left: 0;\n                    width: 100%;\n                    height: 100%;\n                    background-color: rgba(0, 0, 0, 0.8);\n                }\n\n                #${uid}.${tag}-context-${zoid.CONTEXT.POPUP} {\n                    cursor: pointer;\n                }\n\n                #${uid} .${tag}-close {\n                    position: absolute;\n                    right: 16px;\n                    top: 16px;\n                    width: 16px;\n                    height: 16px;\n                    opacity: 0.6;\n                }\n\n                #${uid} .${tag}-close:hover {\n                    opacity: 1;\n                }\n\n                #${uid} .${tag}-close:before,\n                #${uid} .${tag}-close:after {\n                    position: absolute;\n                    left: 8px;\n                    content: ' ';\n                    height: 16px;\n                    width: 2px;\n                    background-color: white;\n                }\n\n                #${uid} .${tag}-close:before {\n                    transform: rotate(45deg);\n                }\n\n                #${uid} .${tag}-close:after {\n                    transform: rotate(-45deg);\n                }\n            `\n        )\n      )\n      .render(pragmatic.dom({ doc }));\n  },\n});\n"
  },
  {
    "path": "demo/common/common.js",
    "content": ""
  },
  {
    "path": "demo/common/index.css",
    "content": "body {\n  text-align: center;\n}\n\nh3 {\n  margin: 50px;\n}\n\n#container {\n  display: inline-block;\n}\n"
  },
  {
    "path": "demo/common/login.css",
    "content": "html,\nbody {\n  overflow: hidden;\n}\n\nbody {\n  text-align: center;\n  border: 1px solid #ccc;\n  height: 100%;\n  width: 100%;\n}\n\nform,\ninput,\nbutton {\n  text-align: center;\n  margin-top: 10px;\n}\n\ninput {\n  text-align: left;\n  padding-left: 10px;\n}\n\n.spinner {\n  animation: rotator 1.4s linear infinite;\n  display: inline-block;\n  margin-top: 40px;\n}\n\n@keyframes rotator {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(270deg);\n  }\n}\n\n.path {\n  stroke-dasharray: 187;\n  stroke-dashoffset: 0;\n  transform-origin: center;\n  animation: dash 1.4s ease-in-out infinite, colors 5.6s ease-in-out infinite;\n}\n\n@keyframes colors {\n  0% {\n    stroke: #4285f4;\n  }\n  25% {\n    stroke: #de3e35;\n  }\n  50% {\n    stroke: #f7c223;\n  }\n  75% {\n    stroke: #1b9a59;\n  }\n  100% {\n    stroke: #4285f4;\n  }\n}\n\n@keyframes dash {\n  0% {\n    stroke-dashoffset: 187;\n  }\n  50% {\n    stroke-dashoffset: 47;\n    transform: rotate(135deg);\n  }\n  100% {\n    stroke-dashoffset: 187;\n    transform: rotate(450deg);\n  }\n}\n"
  },
  {
    "path": "demo/frameworks/angular/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js\"></script>\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n\n  <script>\n    var MyLoginAngularZoidComponent = MyLoginZoidComponent.driver(\n      \"angular\",\n      window.angular\n    );\n\n    angular\n      .module(\"app\", [MyLoginAngularZoidComponent.name])\n      .controller(\"appController\", function ($scope) {\n        $scope.userLoggedIn = false;\n        $scope.email = \"foo@bar.com\";\n\n        $scope.onLogin = function onLogin(email) {\n          console.log(\"User logged in with email:\", email);\n\n          $scope.userLoggedIn = true;\n          $scope.email = email;\n        };\n      });\n  </script>\n</head>\n\n<body ng-app=\"app\" ng-controller=\"appController\">\n  <h3>Log in on xyz.com</h3>\n\n  <div id=\"container\">\n    <my-login-component\n      props=\"{ prefilledEmail: email, onLogin: onLogin }\"\n    ></my-login-component>\n  </div>\n\n  <div id=\"result\" ng-if=\"userLoggedIn\">\n    User logged in with email: {{email}}\n  </div>\n</body>\n"
  },
  {
    "path": "demo/frameworks/angular/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/angular/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/frameworks/angular2/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n  <script src=\"https://npmcdn.com/zone.js@0.8.12?main=browser\"></script>\n  <script src=\"https://npmcdn.com/reflect-metadata@0.1.10\"></script>\n  <script src=\"https://unpkg.com/rxjs@6.2.0/bundles/rxjs.umd.min.js\"></script>\n  <script src=\"https://npmcdn.com/@angular/core@12.2.1/bundles/core.umd.js\"></script>\n  <script src=\"https://npmcdn.com/@angular/common@12.2.1/bundles/common.umd.js\"></script>\n  <script src=\"https://npmcdn.com/@angular/compiler@12.2.1/bundles/compiler.umd.js\"></script>\n  <script src=\"https://npmcdn.com/@angular/platform-browser@12.2.1/bundles/platform-browser.umd.js\"></script>\n  <script src=\"https://npmcdn.com/@angular/platform-browser-dynamic@12.2.1/bundles/platform-browser-dynamic.umd.js\"></script>\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <my-app>Loading...</my-app>\n  <script>\n    (function () {\n      const MyLoginZoidComponentModule = MyLoginZoidComponent.driver(\n        \"angular2\",\n        ng.core\n      );\n\n      class AppComponent {\n        constructor() {\n          this.prefilledEmail = \"foo@bar.com\";\n          this.onLogin = function (email) {\n            this.email = email;\n          }.bind(this);\n        }\n      }\n\n      AppComponent.annotations = [\n        new ng.core.Component({\n          selector: \"my-app\",\n          template: `\n                        <div>\n                            <h3>Log in on xyz.com</h3>\n                            <div id=\"container\">\n                                <my-login-component [props]=\"{ onLogin: onLogin, prefilledEmail: prefilledEmail }\"></my-login-component>\n                            </div>\n                            <div id=\"result\" *ngIf=\"email\">User logged in with email: {{email}}</div>\n                        </div>\n                    `,\n        }),\n      ];\n\n      class AppModule {}\n\n      AppModule.annotations = [\n        new ng.core.NgModule({\n          imports: [\n            ng.platformBrowser.BrowserModule,\n            MyLoginZoidComponentModule,\n          ],\n          declarations: [AppComponent],\n          bootstrap: [AppComponent],\n        }),\n      ];\n\n      document.addEventListener(\"DOMContentLoaded\", function () {\n        ng.platformBrowserDynamic\n          .platformBrowserDynamic()\n          .bootstrapModule(AppModule);\n      });\n    })();\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/angular2/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/angular2/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/app-component.html",
    "content": "<div>\n  <h3>Log in on xyz.com</h3>\n  <div id=\"container\">\n    <my-login-component\n      [props]=\"{ onLogin: onLogin, prefilledEmail: prefilledEmail }\"\n    ></my-login-component>\n  </div>\n  <div id=\"result\" *ngIf=\"email\">User logged in with email: {{email}}</div>\n</div>\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/app-component.ts",
    "content": "import { Component } from \"@angular/core\";\n\n@Component({\n  selector: \"my-app\",\n  templateUrl: \"./app-component.html\",\n})\nexport class AppComponent {\n  prefilledEmail: string;\n\n  email: string;\n\n  constructor() {\n    this.prefilledEmail = \"foo@bar.com\";\n    this.onLogin = this.onLogin.bind(this);\n  }\n\n  public onLogin(email) {\n    console.log(\"User logged in with email:\", email);\n    this.email = email;\n  }\n}\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/app-module.ts",
    "content": "import * as ngCore from \"@angular/core\";\nimport { BrowserModule } from \"@angular/platform-browser\";\nimport { AppComponent } from \"./app-component\";\n\ndeclare const zoid: any;\ndeclare const MyLoginZoidComponent: any;\n\nconst MyLoginZoidComponentModule = MyLoginZoidComponent.driver(\n  \"angular2\",\n  ngCore\n);\n\n@ngCore.NgModule({\n  imports: [BrowserModule, MyLoginZoidComponentModule],\n  declarations: [AppComponent],\n  bootstrap: [AppComponent],\n})\nexport class AppModule {\n  constructor() {}\n}\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/config.js",
    "content": "System.config({\n  // use typescript for compilation\n  transpiler: \"typescript\",\n  // typescript compiler options\n  typescriptOptions: {\n    emitDecoratorMetadata: true,\n  },\n  paths: {\n    \"npm:\": \"https://unpkg.com/\",\n  },\n  // map tells the System loader where to look for things\n  map: {\n    app: \"./\",\n    \"@angular/core\": \"npm:@angular/core/bundles/core.umd.js\",\n    \"@angular/common\": \"npm:@angular/common/bundles/common.umd.js\",\n    \"@angular/compiler\": \"npm:@angular/compiler/bundles/compiler.umd.js\",\n    \"@angular/platform-browser\":\n      \"npm:@angular/platform-browser/bundles/platform-browser.umd.js\",\n    \"@angular/platform-browser-dynamic\":\n      \"npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js\",\n    rxjs: \"npm:rxjs\",\n    typescript: \"npm:typescript@2.2.1/lib/typescript.js\",\n  },\n  // packages defines our app package\n  packages: {\n    app: {\n      main: \"./main.ts\",\n      defaultExtension: \"ts\",\n    },\n    rxjs: {\n      defaultExtension: \"js\",\n    },\n  },\n});\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/index.htm",
    "content": "<!DOCTYPE html>\n\n<html>\n  <head>\n    <base href=\".\" />\n    <title>angular2</title>\n    <link\n      rel=\"stylesheet\"\n      href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n    />\n    <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n    <script src=\"https://unpkg.com/core-js@2.4.1/client/shim.min.js\"></script>\n    <script src=\"https://unpkg.com/zone.js/dist/zone.js\"></script>\n    <script src=\"https://unpkg.com/zone.js/dist/long-stack-trace-zone.js\"></script>\n    <script src=\"https://unpkg.com/reflect-metadata@0.1.3/Reflect.js\"></script>\n    <script src=\"https://unpkg.com/systemjs@0.19.31/dist/system.js\"></script>\n    <script src=\"config.js\"></script>\n    <script src=\"../../../dist/zoid.frameworks.js\"></script>\n    <script src=\"./login.js\"></script>\n    <script>\n      System.import(\"app\").catch(console.error.bind(console));\n    </script>\n  </head>\n\n  <body>\n    <my-app> loading... </my-app>\n  </body>\n</html>\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n\n  props: {\n    prefilledEmail: {\n      type: \"string\",\n      required: false,\n    },\n\n    onLogin: {\n      type: \"function\",\n      required: true,\n    },\n  },\n});\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/main.ts",
    "content": "//main entry point\nimport { platformBrowserDynamic } from \"@angular/platform-browser-dynamic\";\nimport { AppModule } from \"./app-module\";\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/start.cmd",
    "content": "Chrome.exe %CD%/index.htm --allow-file-access-from-files"
  },
  {
    "path": "demo/frameworks/angular2_TypeScript/start.sh",
    "content": "google-chrome $PWD/index.htm --allow-file-access-from-files"
  },
  {
    "path": "demo/frameworks/react/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/react/16.0.0/umd/react.production.min.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.0.0/umd/react-dom.production.min.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js\"></script>\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <div id=\"container\"></div>\n\n  <script type=\"text/babel\">\n    let MyLoginReactZoidComponent = MyLoginZoidComponent.driver(\"react\", {\n      React: window.React,\n      ReactDOM: window.ReactDOM,\n    });\n\n    class Main extends React.Component {\n      constructor(props) {\n        super(props);\n\n        this.state = {\n          userLoggedIn: false,\n          email: \"foo@bar.com\",\n        };\n      }\n\n      onLogin(email) {\n        console.log(\"User logged in with email:\", email);\n\n        this.setState({\n          userLoggedIn: true,\n          email: email,\n        });\n      }\n\n      render() {\n        return (\n          <div>\n            <h3>Log in on xyz.com</h3>\n\n            <MyLoginReactZoidComponent\n              prefilledEmail={this.state.email}\n              onLogin={(email) => this.onLogin(email)}\n            />\n\n            <div id=\"result\">\n              {this.state.userLoggedIn\n                ? \"User logged in with email: \" + this.state.email\n                : \"\"}\n            </div>\n          </div>\n        );\n      }\n    }\n\n    ReactDOM.render(<Main />, document.querySelector(\"#container\"));\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/react/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/react/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/frameworks/vue/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js\"></script>\n\n  <script src=\"https://unpkg.com/vue\"></script>\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <div id=\"container\">\n    <app></app>\n  </div>\n\n  <script type=\"text/babel\">\n    var MyLoginVueZoidComponent = MyLoginZoidComponent.driver(\"vue\", Vue);\n\n    Vue.component(\"app\", {\n      data: function () {\n        return {\n          userLoggedIn: false,\n          email: \"foo@bar.com\",\n        };\n      },\n\n      template: `<div>\n                        <h3>Log in on xyz.com</h3>\n\n\n                        <my-component :prefilledEmail = \"this.email\" :onLogin = \"onLogin\"  />\n                        <div id=\"result\">{{ this.userLoggedIn ? 'User logged in with email: ' + email : '' }}</div>\n\n                    </div>`,\n      components: {\n        \"my-component\": MyLoginVueZoidComponent,\n      },\n\n      computed: {\n        onLogin: function (email) {\n          return (email) => {\n            this.userLoggedIn = true;\n            this.email = email;\n          };\n        },\n      },\n    });\n\n    var vm = new Vue({\n      el: \"#container\",\n    });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/vue/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/vue/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/frameworks/vue3/index.htm",
    "content": "<!DOCTYPE html>\n\n<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <link rel=\"stylesheet\" href=\"../../common/index.css\" />\n\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js\"></script>\n\n  <script src=\"https://unpkg.com/vue@next\"></script>\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <div id=\"container\"></div>\n\n  <script type=\"text/babel\">\n    const RootComponent = {\n      template: `\n            <div>\n                <h3>Log in on xyz.com</h3>\n                <app :prefilled-email=\"this.email\" :on-login=\"onLogin\"></app>\n                <div id=\"result\">{{ this.userLoggedIn ? 'User logged in with email: ' + email : '' }}</div>\n            </div>\n            `,\n\n      data() {\n        return {\n          userLoggedIn: false,\n          email: \"foo@bar.com\",\n        };\n      },\n      computed: {\n        onLogin: function (email) {\n          return (email) => {\n            this.userLoggedIn = true;\n            this.email = email;\n          };\n        },\n      },\n    };\n\n    const vueAppp = Vue.createApp(RootComponent);\n\n    const MyVueLoginZoidComponent = MyLoginZoidComponent.driver(\"vue3\");\n\n    vueAppp.component(\"app\", MyVueLoginZoidComponent);\n\n    vueAppp.mount(\"#container\");\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/vue3/login.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n  <!-- <link rel=\"stylesheet\" href=\"./bootstrap-material-design.css\" /> -->\n  <link rel=\"stylesheet\" href=\"../../common/login.css\" />\n\n  <!-- Pull in zoid and the login component we defined -->\n\n  <script src=\"../../../dist/zoid.frameworks.js\"></script>\n  <script src=\"./login.js\"></script>\n</head>\n\n<body>\n  <!-- Set up a login form -->\n\n  <form id=\"loginForm\">\n    <input id=\"email\" type=\"text\" placeholder=\"email\" /><br />\n    <input id=\"password\" type=\"password\" placeholder=\"password\" /><br />\n    <button id=\"loginButton\" class=\"btn btn-primary\">Log In</button>\n  </form>\n\n  <svg\n    id=\"spinner\"\n    class=\"spinner\"\n    width=\"65px\"\n    height=\"65px\"\n    viewBox=\"0 0 66 66\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <circle\n      class=\"path\"\n      fill=\"none\"\n      stroke-width=\"6\"\n      stroke-linecap=\"round\"\n      cx=\"33\"\n      cy=\"33\"\n      r=\"30\"\n    ></circle>\n  </svg>\n\n  <script>\n    // Hide the loading spinner by default\n\n    document.querySelector(\"#spinner\").style.display = \"none\";\n\n    // Pre-polulate the email field, if we're passed an email\n\n    if (window.xprops.prefilledEmail) {\n      document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n    }\n\n    // Handle the button click to log the user in\n\n    document\n      .querySelector(\"#loginButton\")\n      .addEventListener(\"click\", function (event) {\n        event.preventDefault();\n\n        var email = document.querySelector(\"#email\").value;\n        var password = document.querySelector(\"#password\").value;\n\n        if (!email || !password) {\n          return alert(\"Please enter both an email and a password\");\n        }\n\n        // Hide the login form and replace it with a spinner\n\n        document.querySelector(\"#loginForm\").style.display = \"none\";\n        document.querySelector(\"#spinner\").style.display = \"inline-block\";\n\n        // Pretend to make an ajax call to log the user in\n\n        setTimeout(function () {\n          // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n          window.xprops.onLogin(email);\n          window.xprops.close();\n        }, 2000);\n      });\n  </script>\n</body>\n"
  },
  {
    "path": "demo/frameworks/vue3/login.js",
    "content": "window.MyLoginZoidComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: new URL(\"login.htm\", window.location.href).href,\n});\n"
  },
  {
    "path": "demo/index.htm",
    "content": "<head>\n  <link\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css\"\n  />\n\n  <style>\n    h1 {\n      margin-top: 30px;\n    }\n\n    h2 {\n      margin-top: 20px;\n    }\n\n    ul {\n      margin-top: 20px;\n    }\n  </style>\n</head>\n\n<body>\n  <div class=\"container\">\n    <h1>zoid demos</h1>\n\n    <hr />\n\n    <h2>basic demos</h2>\n\n    <ul>\n      <li><a href=\"./basic/iframe/index.htm\">iframe component</a></li>\n      <li><a href=\"./basic/popup/index.htm\">popup component</a></li>\n    </ul>\n\n    <h2>framework demos</h2>\n\n    <ul>\n      <li><a href=\"./frameworks/react/index.htm\">react component</a></li>\n      <li><a href=\"./frameworks/angular/index.htm\">angular component</a></li>\n      <li><a href=\"./frameworks/vue/index.htm\">vue component</a></li>\n    </ul>\n\n    <h2>advanced demos</h2>\n\n    <ul>\n      <li><a href=\"./advanced/props/index.htm\">pre-defined props</a></li>\n      <li><a href=\"./advanced/remote/index.htm\">render remote</a></li>\n      <li>\n        <a href=\"./advanced/remote-popup/index.htm\">render remote popup</a>\n      </li>\n      <li>\n        <a href=\"./advanced/react-end-to-end/index.htm\"\n          >end-to-end react component</a\n        >\n      </li>\n    </ul>\n  </div>\n</body>\n"
  },
  {
    "path": "dist/zoid.frame.js",
    "content": "!function(root, factory) {\n    \"object\" == typeof exports && \"object\" == typeof module ? module.exports = factory() : \"function\" == typeof define && define.amd ? define(\"zoid\", [], factory) : \"object\" == typeof exports ? exports.zoid = factory() : root.zoid = factory();\n}(\"undefined\" != typeof self ? self : this, (function() {\n    return function(modules) {\n        var installedModules = {};\n        function __webpack_require__(moduleId) {\n            if (installedModules[moduleId]) return installedModules[moduleId].exports;\n            var module = installedModules[moduleId] = {\n                i: moduleId,\n                l: !1,\n                exports: {}\n            };\n            modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n            module.l = !0;\n            return module.exports;\n        }\n        __webpack_require__.m = modules;\n        __webpack_require__.c = installedModules;\n        __webpack_require__.d = function(exports, name, getter) {\n            __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {\n                enumerable: !0,\n                get: getter\n            });\n        };\n        __webpack_require__.r = function(exports) {\n            \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {\n                value: \"Module\"\n            });\n            Object.defineProperty(exports, \"__esModule\", {\n                value: !0\n            });\n        };\n        __webpack_require__.t = function(value, mode) {\n            1 & mode && (value = __webpack_require__(value));\n            if (8 & mode) return value;\n            if (4 & mode && \"object\" == typeof value && value && value.__esModule) return value;\n            var ns = Object.create(null);\n            __webpack_require__.r(ns);\n            Object.defineProperty(ns, \"default\", {\n                enumerable: !0,\n                value: value\n            });\n            if (2 & mode && \"string\" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) {\n                return value[key];\n            }.bind(null, key));\n            return ns;\n        };\n        __webpack_require__.n = function(module) {\n            var getter = module && module.__esModule ? function() {\n                return module.default;\n            } : function() {\n                return module;\n            };\n            __webpack_require__.d(getter, \"a\", getter);\n            return getter;\n        };\n        __webpack_require__.o = function(object, property) {\n            return {}.hasOwnProperty.call(object, property);\n        };\n        __webpack_require__.p = \"\";\n        return __webpack_require__(__webpack_require__.s = 0);\n    }([ function(module, __webpack_exports__, __webpack_require__) {\n        \"use strict\";\n        __webpack_require__.r(__webpack_exports__);\n        __webpack_require__.d(__webpack_exports__, \"PopupOpenError\", (function() {\n            return dom_PopupOpenError;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"create\", (function() {\n            return component_create;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroy\", (function() {\n            return component_destroy;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyComponents\", (function() {\n            return destroyComponents;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyAll\", (function() {\n            return destroyAll;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_TYPE\", (function() {\n            return PROP_TYPE;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_SERIALIZATION\", (function() {\n            return PROP_SERIALIZATION;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"CONTEXT\", (function() {\n            return CONTEXT;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"EVENT\", (function() {\n            return EVENT;\n        }));\n        function _setPrototypeOf(o, p) {\n            return (_setPrototypeOf = Object.setPrototypeOf || function(o, p) {\n                o.__proto__ = p;\n                return o;\n            })(o, p);\n        }\n        function _inheritsLoose(subClass, superClass) {\n            subClass.prototype = Object.create(superClass.prototype);\n            subClass.prototype.constructor = subClass;\n            _setPrototypeOf(subClass, superClass);\n        }\n        function _extends() {\n            return (_extends = Object.assign || function(target) {\n                for (var i = 1; i < arguments.length; i++) {\n                    var source = arguments[i];\n                    for (var key in source) ({}).hasOwnProperty.call(source, key) && (target[key] = source[key]);\n                }\n                return target;\n            }).apply(this, arguments);\n        }\n        function utils_isPromise(item) {\n            try {\n                if (!item) return !1;\n                if (\"undefined\" != typeof Promise && item instanceof Promise) return !0;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.Window && item instanceof window.Window) return !1;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.constructor && item instanceof window.constructor) return !1;\n                var _toString = {}.toString;\n                if (_toString) {\n                    var name = _toString.call(item);\n                    if (\"[object Window]\" === name || \"[object global]\" === name || \"[object DOMWindow]\" === name) return !1;\n                }\n                if (\"function\" == typeof item.then) return !0;\n            } catch (err) {\n                return !1;\n            }\n            return !1;\n        }\n        var dispatchedErrors = [];\n        var possiblyUnhandledPromiseHandlers = [];\n        var activeCount = 0;\n        var flushPromise;\n        function flushActive() {\n            if (!activeCount && flushPromise) {\n                var promise = flushPromise;\n                flushPromise = null;\n                promise.resolve();\n            }\n        }\n        function startActive() {\n            activeCount += 1;\n        }\n        function endActive() {\n            activeCount -= 1;\n            flushActive();\n        }\n        var promise_ZalgoPromise = function() {\n            function ZalgoPromise(handler) {\n                var _this = this;\n                this.resolved = void 0;\n                this.rejected = void 0;\n                this.errorHandled = void 0;\n                this.value = void 0;\n                this.error = void 0;\n                this.handlers = void 0;\n                this.dispatching = void 0;\n                this.stack = void 0;\n                this.resolved = !1;\n                this.rejected = !1;\n                this.errorHandled = !1;\n                this.handlers = [];\n                if (handler) {\n                    var _result;\n                    var _error;\n                    var resolved = !1;\n                    var rejected = !1;\n                    var isAsync = !1;\n                    startActive();\n                    try {\n                        handler((function(res) {\n                            if (isAsync) _this.resolve(res); else {\n                                resolved = !0;\n                                _result = res;\n                            }\n                        }), (function(err) {\n                            if (isAsync) _this.reject(err); else {\n                                rejected = !0;\n                                _error = err;\n                            }\n                        }));\n                    } catch (err) {\n                        endActive();\n                        this.reject(err);\n                        return;\n                    }\n                    endActive();\n                    isAsync = !0;\n                    resolved ? this.resolve(_result) : rejected && this.reject(_error);\n                }\n            }\n            var _proto = ZalgoPromise.prototype;\n            _proto.resolve = function(result) {\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(result)) throw new Error(\"Can not resolve promise with another promise\");\n                this.resolved = !0;\n                this.value = result;\n                this.dispatch();\n                return this;\n            };\n            _proto.reject = function(error) {\n                var _this2 = this;\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(error)) throw new Error(\"Can not reject promise with another promise\");\n                if (!error) {\n                    var _err = error && \"function\" == typeof error.toString ? error.toString() : {}.toString.call(error);\n                    error = new Error(\"Expected reject to be called with Error, got \" + _err);\n                }\n                this.rejected = !0;\n                this.error = error;\n                this.errorHandled || setTimeout((function() {\n                    _this2.errorHandled || function(err, promise) {\n                        if (-1 === dispatchedErrors.indexOf(err)) {\n                            dispatchedErrors.push(err);\n                            setTimeout((function() {\n                                throw err;\n                            }), 1);\n                            for (var j = 0; j < possiblyUnhandledPromiseHandlers.length; j++) possiblyUnhandledPromiseHandlers[j](err, promise);\n                        }\n                    }(error, _this2);\n                }), 1);\n                this.dispatch();\n                return this;\n            };\n            _proto.asyncReject = function(error) {\n                this.errorHandled = !0;\n                this.reject(error);\n                return this;\n            };\n            _proto.dispatch = function() {\n                var resolved = this.resolved, rejected = this.rejected, handlers = this.handlers;\n                if (!this.dispatching && (resolved || rejected)) {\n                    this.dispatching = !0;\n                    startActive();\n                    var chain = function(firstPromise, secondPromise) {\n                        return firstPromise.then((function(res) {\n                            secondPromise.resolve(res);\n                        }), (function(err) {\n                            secondPromise.reject(err);\n                        }));\n                    };\n                    for (var i = 0; i < handlers.length; i++) {\n                        var _handlers$i = handlers[i], onSuccess = _handlers$i.onSuccess, onError = _handlers$i.onError, promise = _handlers$i.promise;\n                        var _result2 = void 0;\n                        if (resolved) try {\n                            _result2 = onSuccess ? onSuccess(this.value) : this.value;\n                        } catch (err) {\n                            promise.reject(err);\n                            continue;\n                        } else if (rejected) {\n                            if (!onError) {\n                                promise.reject(this.error);\n                                continue;\n                            }\n                            try {\n                                _result2 = onError(this.error);\n                            } catch (err) {\n                                promise.reject(err);\n                                continue;\n                            }\n                        }\n                        if (_result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected)) {\n                            var promiseResult = _result2;\n                            promiseResult.resolved ? promise.resolve(promiseResult.value) : promise.reject(promiseResult.error);\n                            promiseResult.errorHandled = !0;\n                        } else utils_isPromise(_result2) ? _result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected) ? _result2.resolved ? promise.resolve(_result2.value) : promise.reject(_result2.error) : chain(_result2, promise) : promise.resolve(_result2);\n                    }\n                    handlers.length = 0;\n                    this.dispatching = !1;\n                    endActive();\n                }\n            };\n            _proto.then = function(onSuccess, onError) {\n                if (onSuccess && \"function\" != typeof onSuccess && !onSuccess.call) throw new Error(\"Promise.then expected a function for success handler\");\n                if (onError && \"function\" != typeof onError && !onError.call) throw new Error(\"Promise.then expected a function for error handler\");\n                var promise = new ZalgoPromise;\n                this.handlers.push({\n                    promise: promise,\n                    onSuccess: onSuccess,\n                    onError: onError\n                });\n                this.errorHandled = !0;\n                this.dispatch();\n                return promise;\n            };\n            _proto.catch = function(onError) {\n                return this.then(void 0, onError);\n            };\n            _proto.finally = function(onFinally) {\n                if (onFinally && \"function\" != typeof onFinally && !onFinally.call) throw new Error(\"Promise.finally expected a function\");\n                return this.then((function(result) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        return result;\n                    }));\n                }), (function(err) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        throw err;\n                    }));\n                }));\n            };\n            _proto.timeout = function(time, err) {\n                var _this3 = this;\n                if (this.resolved || this.rejected) return this;\n                var timeout = setTimeout((function() {\n                    _this3.resolved || _this3.rejected || _this3.reject(err || new Error(\"Promise timed out after \" + time + \"ms\"));\n                }), time);\n                return this.then((function(result) {\n                    clearTimeout(timeout);\n                    return result;\n                }));\n            };\n            _proto.toPromise = function() {\n                if (\"undefined\" == typeof Promise) throw new TypeError(\"Could not find Promise\");\n                return Promise.resolve(this);\n            };\n            _proto.lazy = function() {\n                this.errorHandled = !0;\n                return this;\n            };\n            ZalgoPromise.resolve = function(value) {\n                return value instanceof ZalgoPromise ? value : utils_isPromise(value) ? new ZalgoPromise((function(resolve, reject) {\n                    return value.then(resolve, reject);\n                })) : (new ZalgoPromise).resolve(value);\n            };\n            ZalgoPromise.reject = function(error) {\n                return (new ZalgoPromise).reject(error);\n            };\n            ZalgoPromise.asyncReject = function(error) {\n                return (new ZalgoPromise).asyncReject(error);\n            };\n            ZalgoPromise.all = function(promises) {\n                var promise = new ZalgoPromise;\n                var count = promises.length;\n                var results = [].slice();\n                if (!count) {\n                    promise.resolve(results);\n                    return promise;\n                }\n                var chain = function(i, firstPromise, secondPromise) {\n                    return firstPromise.then((function(res) {\n                        results[i] = res;\n                        0 == (count -= 1) && promise.resolve(results);\n                    }), (function(err) {\n                        secondPromise.reject(err);\n                    }));\n                };\n                for (var i = 0; i < promises.length; i++) {\n                    var prom = promises[i];\n                    if (prom instanceof ZalgoPromise) {\n                        if (prom.resolved) {\n                            results[i] = prom.value;\n                            count -= 1;\n                            continue;\n                        }\n                    } else if (!utils_isPromise(prom)) {\n                        results[i] = prom;\n                        count -= 1;\n                        continue;\n                    }\n                    chain(i, ZalgoPromise.resolve(prom), promise);\n                }\n                0 === count && promise.resolve(results);\n                return promise;\n            };\n            ZalgoPromise.hash = function(promises) {\n                var result = {};\n                var awaitPromises = [];\n                var _loop = function(key) {\n                    if (promises.hasOwnProperty(key)) {\n                        var value = promises[key];\n                        utils_isPromise(value) ? awaitPromises.push(value.then((function(res) {\n                            result[key] = res;\n                        }))) : result[key] = value;\n                    }\n                };\n                for (var key in promises) _loop(key);\n                return ZalgoPromise.all(awaitPromises).then((function() {\n                    return result;\n                }));\n            };\n            ZalgoPromise.map = function(items, method) {\n                return ZalgoPromise.all(items.map(method));\n            };\n            ZalgoPromise.onPossiblyUnhandledException = function(handler) {\n                return function(handler) {\n                    possiblyUnhandledPromiseHandlers.push(handler);\n                    return {\n                        cancel: function() {\n                            possiblyUnhandledPromiseHandlers.splice(possiblyUnhandledPromiseHandlers.indexOf(handler), 1);\n                        }\n                    };\n                }(handler);\n            };\n            ZalgoPromise.try = function(method, context, args) {\n                if (method && \"function\" != typeof method && !method.call) throw new Error(\"Promise.try expected a function\");\n                var result;\n                startActive();\n                try {\n                    result = method.apply(context, args || []);\n                } catch (err) {\n                    endActive();\n                    return ZalgoPromise.reject(err);\n                }\n                endActive();\n                return ZalgoPromise.resolve(result);\n            };\n            ZalgoPromise.delay = function(_delay) {\n                return new ZalgoPromise((function(resolve) {\n                    setTimeout(resolve, _delay);\n                }));\n            };\n            ZalgoPromise.isPromise = function(value) {\n                return !!(value && value instanceof ZalgoPromise) || utils_isPromise(value);\n            };\n            ZalgoPromise.flush = function() {\n                return function(Zalgo) {\n                    var promise = flushPromise = flushPromise || new Zalgo;\n                    flushActive();\n                    return promise;\n                }(ZalgoPromise);\n            };\n            return ZalgoPromise;\n        }();\n        function isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        var IE_WIN_ACCESS_ERROR = \"Call was rejected by callee.\\r\\n\";\n        function getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return getActualProtocol(win);\n        }\n        function isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === getProtocol(win);\n        }\n        function utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = utils_getParent(win);\n                return parent && canReadFromWindow() ? getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === getProtocol(win);\n                    }(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (getActualDomain(win) === getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                if (getDomain(window) === getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function assertSameDomain(win) {\n            if (!isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (utils_getParent(win) === win) return win;\n            try {\n                if (isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function getAllFramesInWindow(win) {\n            var top = getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], getAllChildFrames(win)));\n            return result;\n        }\n        var iframeWindows = [];\n        var iframeFrames = [];\n        function isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || err.message !== IE_WIN_ACCESS_ERROR;\n            }\n            if (allowMock && isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function getAncestor(win) {\n            void 0 === win && (win = window);\n            return getOpener(win = win || window) || utils_getParent(win) || void 0;\n        }\n        function anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return isRegex(pattern) ? isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !isRegex(origin) && pattern.some((function(subpattern) {\n                return matchDomain(subpattern, origin);\n            })));\n        }\n        function isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getFrameForWindow(win) {\n            if (isSameDomain(win)) return assertSameDomain(win).frameElement;\n            for (var _i21 = 0, _document$querySelect2 = document.querySelectorAll(\"iframe\"); _i21 < _document$querySelect2.length; _i21++) {\n                var frame = _document$querySelect2[_i21];\n                if (frame && frame.contentWindow && frame.contentWindow === win) return frame;\n            }\n        }\n        function closeWindow(win) {\n            if (function(win) {\n                void 0 === win && (win = window);\n                return Boolean(utils_getParent(win));\n            }(win)) {\n                var frame = getFrameForWindow(win);\n                if (frame && frame.parentElement) {\n                    frame.parentElement.removeChild(frame);\n                    return;\n                }\n            }\n            try {\n                win.close();\n            } catch (err) {}\n        }\n        function util_safeIndexOf(collection, item) {\n            for (var i = 0; i < collection.length; i++) try {\n                if (collection[i] === item) return i;\n            } catch (err) {}\n            return -1;\n        }\n        var weakmap_CrossDomainSafeWeakMap = function() {\n            function CrossDomainSafeWeakMap() {\n                this.name = void 0;\n                this.weakmap = void 0;\n                this.keys = void 0;\n                this.values = void 0;\n                this.name = \"__weakmap_\" + (1e9 * Math.random() >>> 0) + \"__\";\n                if (function() {\n                    if (\"undefined\" == typeof WeakMap) return !1;\n                    if (void 0 === Object.freeze) return !1;\n                    try {\n                        var testWeakMap = new WeakMap;\n                        var testKey = {};\n                        Object.freeze(testKey);\n                        testWeakMap.set(testKey, \"__testvalue__\");\n                        return \"__testvalue__\" === testWeakMap.get(testKey);\n                    } catch (err) {\n                        return !1;\n                    }\n                }()) try {\n                    this.weakmap = new WeakMap;\n                } catch (err) {}\n                this.keys = [];\n                this.values = [];\n            }\n            var _proto = CrossDomainSafeWeakMap.prototype;\n            _proto._cleanupClosedWindows = function() {\n                var weakmap = this.weakmap;\n                var keys = this.keys;\n                for (var i = 0; i < keys.length; i++) {\n                    var value = keys[i];\n                    if (isWindow(value) && isWindowClosed(value)) {\n                        if (weakmap) try {\n                            weakmap.delete(value);\n                        } catch (err) {}\n                        keys.splice(i, 1);\n                        this.values.splice(i, 1);\n                        i -= 1;\n                    }\n                }\n            };\n            _proto.isSafeToReadWrite = function(key) {\n                return !isWindow(key);\n            };\n            _proto.set = function(key, value) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.set(key, value);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var name = this.name;\n                    var entry = key[name];\n                    entry && entry[0] === key ? entry[1] = value : Object.defineProperty(key, name, {\n                        value: [ key, value ],\n                        writable: !0\n                    });\n                    return;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var values = this.values;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 === index) {\n                    keys.push(key);\n                    values.push(value);\n                } else values[index] = value;\n            };\n            _proto.get = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return weakmap.get(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return entry && entry[0] === key ? entry[1] : void 0;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var index = util_safeIndexOf(this.keys, key);\n                if (-1 !== index) return this.values[index];\n            };\n            _proto.delete = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.delete(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    entry && entry[0] === key && (entry[0] = entry[1] = void 0);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 !== index) {\n                    keys.splice(index, 1);\n                    this.values.splice(index, 1);\n                }\n            };\n            _proto.has = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return !0;\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return !(!entry || entry[0] !== key);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                return -1 !== util_safeIndexOf(this.keys, key);\n            };\n            _proto.getOrSet = function(key, getter) {\n                if (this.has(key)) return this.get(key);\n                var value = getter();\n                this.set(key, value);\n                return value;\n            };\n            return CrossDomainSafeWeakMap;\n        }();\n        function _getPrototypeOf(o) {\n            return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {\n                return o.__proto__ || Object.getPrototypeOf(o);\n            })(o);\n        }\n        function _isNativeReflectConstruct() {\n            if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n            if (Reflect.construct.sham) return !1;\n            if (\"function\" == typeof Proxy) return !0;\n            try {\n                Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));\n                return !0;\n            } catch (e) {\n                return !1;\n            }\n        }\n        function construct_construct(Parent, args, Class) {\n            return (construct_construct = _isNativeReflectConstruct() ? Reflect.construct : function(Parent, args, Class) {\n                var a = [ null ];\n                a.push.apply(a, args);\n                var instance = new (Function.bind.apply(Parent, a));\n                Class && _setPrototypeOf(instance, Class.prototype);\n                return instance;\n            }).apply(null, arguments);\n        }\n        function wrapNativeSuper_wrapNativeSuper(Class) {\n            var _cache = \"function\" == typeof Map ? new Map : void 0;\n            return (wrapNativeSuper_wrapNativeSuper = function(Class) {\n                if (null === Class || !(fn = Class, -1 !== Function.toString.call(fn).indexOf(\"[native code]\"))) return Class;\n                var fn;\n                if (\"function\" != typeof Class) throw new TypeError(\"Super expression must either be null or a function\");\n                if (void 0 !== _cache) {\n                    if (_cache.has(Class)) return _cache.get(Class);\n                    _cache.set(Class, Wrapper);\n                }\n                function Wrapper() {\n                    return construct_construct(Class, arguments, _getPrototypeOf(this).constructor);\n                }\n                Wrapper.prototype = Object.create(Class.prototype, {\n                    constructor: {\n                        value: Wrapper,\n                        enumerable: !1,\n                        writable: !0,\n                        configurable: !0\n                    }\n                });\n                return _setPrototypeOf(Wrapper, Class);\n            })(Class);\n        }\n        function isElement(element) {\n            var passed = !1;\n            try {\n                (element instanceof window.Element || null !== element && \"object\" == typeof element && 1 === element.nodeType && \"object\" == typeof element.style && \"object\" == typeof element.ownerDocument) && (passed = !0);\n            } catch (_) {}\n            return passed;\n        }\n        function getFunctionName(fn) {\n            return fn.name || fn.__name__ || fn.displayName || \"anonymous\";\n        }\n        function setFunctionName(fn, name) {\n            try {\n                delete fn.name;\n                fn.name = name;\n            } catch (err) {}\n            fn.__name__ = fn.displayName = name;\n            return fn;\n        }\n        function base64encode(str) {\n            if (\"function\" == typeof btoa) return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (function(m, p1) {\n                return String.fromCharCode(parseInt(p1, 16));\n            }))).replace(/[=]/g, \"\");\n            if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"utf8\").toString(\"base64\").replace(/[=]/g, \"\");\n            throw new Error(\"Can not find window.btoa or Buffer\");\n        }\n        function uniqueID() {\n            var chars = \"0123456789abcdef\";\n            return \"uid_\" + \"xxxxxxxxxx\".replace(/./g, (function() {\n                return chars.charAt(Math.floor(Math.random() * chars.length));\n            })) + \"_\" + base64encode((new Date).toISOString().slice(11, 19).replace(\"T\", \".\")).replace(/[^a-zA-Z0-9]/g, \"\").toLowerCase();\n        }\n        var objectIDs;\n        function serializeArgs(args) {\n            try {\n                return JSON.stringify([].slice.call(args), (function(subkey, val) {\n                    return \"function\" == typeof val ? \"memoize[\" + function(obj) {\n                        objectIDs = objectIDs || new weakmap_CrossDomainSafeWeakMap;\n                        if (null == obj || \"object\" != typeof obj && \"function\" != typeof obj) throw new Error(\"Invalid object\");\n                        var uid = objectIDs.get(obj);\n                        if (!uid) {\n                            uid = typeof obj + \":\" + uniqueID();\n                            objectIDs.set(obj, uid);\n                        }\n                        return uid;\n                    }(val) + \"]\" : isElement(val) ? {} : val;\n                }));\n            } catch (err) {\n                throw new Error(\"Arguments not serializable -- can not be used to memoize\");\n            }\n        }\n        function getEmptyObject() {\n            return {};\n        }\n        var memoizeGlobalIndex = 0;\n        var memoizeGlobalIndexValidFrom = 0;\n        function memoize(method, options) {\n            void 0 === options && (options = {});\n            var _options$thisNamespac = options.thisNamespace, thisNamespace = void 0 !== _options$thisNamespac && _options$thisNamespac, cacheTime = options.time;\n            var simpleCache;\n            var thisCache;\n            var memoizeIndex = memoizeGlobalIndex;\n            memoizeGlobalIndex += 1;\n            var memoizedFunction = function() {\n                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                if (memoizeIndex < memoizeGlobalIndexValidFrom) {\n                    simpleCache = null;\n                    thisCache = null;\n                    memoizeIndex = memoizeGlobalIndex;\n                    memoizeGlobalIndex += 1;\n                }\n                var cache;\n                cache = thisNamespace ? (thisCache = thisCache || new weakmap_CrossDomainSafeWeakMap).getOrSet(this, getEmptyObject) : simpleCache = simpleCache || {};\n                var cacheKey;\n                try {\n                    cacheKey = serializeArgs(args);\n                } catch (_unused) {\n                    return method.apply(this, arguments);\n                }\n                var cacheResult = cache[cacheKey];\n                if (cacheResult && cacheTime && Date.now() - cacheResult.time < cacheTime) {\n                    delete cache[cacheKey];\n                    cacheResult = null;\n                }\n                if (cacheResult) return cacheResult.value;\n                var time = Date.now();\n                var value = method.apply(this, arguments);\n                cache[cacheKey] = {\n                    time: time,\n                    value: value\n                };\n                return value;\n            };\n            memoizedFunction.reset = function() {\n                simpleCache = null;\n                thisCache = null;\n            };\n            return setFunctionName(memoizedFunction, (options.name || getFunctionName(method)) + \"::memoized\");\n        }\n        memoize.clear = function() {\n            memoizeGlobalIndexValidFrom = memoizeGlobalIndex;\n        };\n        function memoizePromise(method) {\n            var cache = {};\n            function memoizedPromiseFunction() {\n                var _arguments = arguments, _this = this;\n                for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                var key = serializeArgs(args);\n                if (cache.hasOwnProperty(key)) return cache[key];\n                cache[key] = promise_ZalgoPromise.try((function() {\n                    return method.apply(_this, _arguments);\n                })).finally((function() {\n                    delete cache[key];\n                }));\n                return cache[key];\n            }\n            memoizedPromiseFunction.reset = function() {\n                cache = {};\n            };\n            return setFunctionName(memoizedPromiseFunction, getFunctionName(method) + \"::promiseMemoized\");\n        }\n        function src_util_noop() {}\n        function once(method) {\n            var called = !1;\n            return setFunctionName((function() {\n                if (!called) {\n                    called = !0;\n                    return method.apply(this, arguments);\n                }\n            }), getFunctionName(method) + \"::once\");\n        }\n        function stringifyError(err, level) {\n            void 0 === level && (level = 1);\n            if (level >= 3) return \"stringifyError stack overflow\";\n            try {\n                if (!err) return \"<unknown error: \" + {}.toString.call(err) + \">\";\n                if (\"string\" == typeof err) return err;\n                if (err instanceof Error) {\n                    var stack = err && err.stack;\n                    var message = err && err.message;\n                    if (stack && message) return -1 !== stack.indexOf(message) ? stack : message + \"\\n\" + stack;\n                    if (stack) return stack;\n                    if (message) return message;\n                }\n                return err && err.toString && \"function\" == typeof err.toString ? err.toString() : {}.toString.call(err);\n            } catch (newErr) {\n                return \"Error while stringifying error: \" + stringifyError(newErr, level + 1);\n            }\n        }\n        function stringify(item) {\n            return \"string\" == typeof item ? item : item && item.toString && \"function\" == typeof item.toString ? item.toString() : {}.toString.call(item);\n        }\n        function extend(obj, source) {\n            if (!source) return obj;\n            if (Object.assign) return Object.assign(obj, source);\n            for (var key in source) source.hasOwnProperty(key) && (obj[key] = source[key]);\n            return obj;\n        }\n        memoize((function(obj) {\n            if (Object.values) return Object.values(obj);\n            var result = [];\n            for (var key in obj) obj.hasOwnProperty(key) && result.push(obj[key]);\n            return result;\n        }));\n        function identity(item) {\n            return item;\n        }\n        function safeInterval(method, time) {\n            var timeout;\n            !function loop() {\n                timeout = setTimeout((function() {\n                    method();\n                    loop();\n                }), time);\n            }();\n            return {\n                cancel: function() {\n                    clearTimeout(timeout);\n                }\n            };\n        }\n        function arrayFrom(item) {\n            return [].slice.call(item);\n        }\n        function isDefined(value) {\n            return null != value;\n        }\n        function util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function util_getOrSet(obj, key, getter) {\n            if (obj.hasOwnProperty(key)) return obj[key];\n            var val = getter();\n            obj[key] = val;\n            return val;\n        }\n        function cleanup(obj) {\n            var tasks = [];\n            var cleaned = !1;\n            var cleanErr;\n            var cleaner = {\n                set: function(name, item) {\n                    if (!cleaned) {\n                        obj[name] = item;\n                        cleaner.register((function() {\n                            delete obj[name];\n                        }));\n                    }\n                    return item;\n                },\n                register: function(method) {\n                    var task = once((function() {\n                        return method(cleanErr);\n                    }));\n                    cleaned ? method(cleanErr) : tasks.push(task);\n                    return {\n                        cancel: function() {\n                            var index = tasks.indexOf(task);\n                            -1 !== index && tasks.splice(index, 1);\n                        }\n                    };\n                },\n                all: function(err) {\n                    cleanErr = err;\n                    var results = [];\n                    cleaned = !0;\n                    for (;tasks.length; ) {\n                        var task = tasks.shift();\n                        results.push(task());\n                    }\n                    return promise_ZalgoPromise.all(results).then(src_util_noop);\n                }\n            };\n            return cleaner;\n        }\n        function assertExists(name, thing) {\n            if (null == thing) throw new Error(\"Expected \" + name + \" to be present\");\n            return thing;\n        }\n        var util_ExtendableError = function(_Error) {\n            _inheritsLoose(ExtendableError, _Error);\n            function ExtendableError(message) {\n                var _this6;\n                (_this6 = _Error.call(this, message) || this).name = _this6.constructor.name;\n                \"function\" == typeof Error.captureStackTrace ? Error.captureStackTrace(function(self) {\n                    if (void 0 === self) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n                    return self;\n                }(_this6), _this6.constructor) : _this6.stack = new Error(message).stack;\n                return _this6;\n            }\n            return ExtendableError;\n        }(wrapNativeSuper_wrapNativeSuper(Error));\n        function getBody() {\n            var body = document.body;\n            if (!body) throw new Error(\"Body element not found\");\n            return body;\n        }\n        function isDocumentReady() {\n            return Boolean(document.body) && \"complete\" === document.readyState;\n        }\n        function isDocumentInteractive() {\n            return Boolean(document.body) && \"interactive\" === document.readyState;\n        }\n        function urlEncode(str) {\n            return encodeURIComponent(str);\n        }\n        memoize((function() {\n            return new promise_ZalgoPromise((function(resolve) {\n                if (isDocumentReady() || isDocumentInteractive()) return resolve();\n                var interval = setInterval((function() {\n                    if (isDocumentReady() || isDocumentInteractive()) {\n                        clearInterval(interval);\n                        return resolve();\n                    }\n                }), 10);\n            }));\n        }));\n        function parseQuery(queryString) {\n            return function(method, logic, args) {\n                void 0 === args && (args = []);\n                var cache = method.__inline_memoize_cache__ = method.__inline_memoize_cache__ || {};\n                var key = serializeArgs(args);\n                return cache.hasOwnProperty(key) ? cache[key] : cache[key] = function() {\n                    var params = {};\n                    if (!queryString) return params;\n                    if (-1 === queryString.indexOf(\"=\")) return params;\n                    for (var _i2 = 0, _queryString$split2 = queryString.split(\"&\"); _i2 < _queryString$split2.length; _i2++) {\n                        var pair = _queryString$split2[_i2];\n                        (pair = pair.split(\"=\"))[0] && pair[1] && (params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]));\n                    }\n                    return params;\n                }.apply(void 0, args);\n            }(parseQuery, 0, [ queryString ]);\n        }\n        function extendQuery(originalQuery, props) {\n            void 0 === props && (props = {});\n            return props && Object.keys(props).length ? function(obj) {\n                void 0 === obj && (obj = {});\n                return Object.keys(obj).filter((function(key) {\n                    return \"string\" == typeof obj[key] || \"boolean\" == typeof obj[key];\n                })).map((function(key) {\n                    var val = obj[key];\n                    if (\"string\" != typeof val && \"boolean\" != typeof val) throw new TypeError(\"Invalid type for query\");\n                    return urlEncode(key) + \"=\" + urlEncode(val.toString());\n                })).join(\"&\");\n            }(_extends({}, parseQuery(originalQuery), props)) : originalQuery;\n        }\n        function appendChild(container, child) {\n            container.appendChild(child);\n        }\n        function getElementSafe(id, doc) {\n            void 0 === doc && (doc = document);\n            return isElement(id) ? id : \"string\" == typeof id ? doc.querySelector(id) : void 0;\n        }\n        function elementReady(id) {\n            return new promise_ZalgoPromise((function(resolve, reject) {\n                var name = stringify(id);\n                var el = getElementSafe(id);\n                if (el) return resolve(el);\n                if (isDocumentReady()) return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                var interval = setInterval((function() {\n                    if (el = getElementSafe(id)) {\n                        resolve(el);\n                        clearInterval(interval);\n                    } else if (isDocumentReady()) {\n                        clearInterval(interval);\n                        return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                    }\n                }), 10);\n            }));\n        }\n        var dom_PopupOpenError = function(_ExtendableError) {\n            _inheritsLoose(PopupOpenError, _ExtendableError);\n            function PopupOpenError() {\n                return _ExtendableError.apply(this, arguments) || this;\n            }\n            return PopupOpenError;\n        }(util_ExtendableError);\n        var awaitFrameLoadPromises;\n        function awaitFrameLoad(frame) {\n            if ((awaitFrameLoadPromises = awaitFrameLoadPromises || new weakmap_CrossDomainSafeWeakMap).has(frame)) {\n                var _promise = awaitFrameLoadPromises.get(frame);\n                if (_promise) return _promise;\n            }\n            var promise = new promise_ZalgoPromise((function(resolve, reject) {\n                frame.addEventListener(\"load\", (function() {\n                    !function(frame) {\n                        !function() {\n                            for (var i = 0; i < iframeWindows.length; i++) {\n                                var closed = !1;\n                                try {\n                                    closed = iframeWindows[i].closed;\n                                } catch (err) {}\n                                if (closed) {\n                                    iframeFrames.splice(i, 1);\n                                    iframeWindows.splice(i, 1);\n                                }\n                            }\n                        }();\n                        if (frame && frame.contentWindow) try {\n                            iframeWindows.push(frame.contentWindow);\n                            iframeFrames.push(frame);\n                        } catch (err) {}\n                    }(frame);\n                    resolve(frame);\n                }));\n                frame.addEventListener(\"error\", (function(err) {\n                    frame.contentWindow ? resolve(frame) : reject(err);\n                }));\n            }));\n            awaitFrameLoadPromises.set(frame, promise);\n            return promise;\n        }\n        function awaitFrameWindow(frame) {\n            return awaitFrameLoad(frame).then((function(loadedFrame) {\n                if (!loadedFrame.contentWindow) throw new Error(\"Could not find window in iframe\");\n                return loadedFrame.contentWindow;\n            }));\n        }\n        function dom_iframe(options, container) {\n            void 0 === options && (options = {});\n            var style = options.style || {};\n            var frame = function(tag, options, container) {\n                void 0 === tag && (tag = \"div\");\n                void 0 === options && (options = {});\n                tag = tag.toLowerCase();\n                var element = document.createElement(tag);\n                options.style && extend(element.style, options.style);\n                options.class && (element.className = options.class.join(\" \"));\n                options.id && element.setAttribute(\"id\", options.id);\n                if (options.attributes) for (var _i10 = 0, _Object$keys2 = Object.keys(options.attributes); _i10 < _Object$keys2.length; _i10++) {\n                    var key = _Object$keys2[_i10];\n                    element.setAttribute(key, options.attributes[key]);\n                }\n                options.styleSheet && function(el, styleText, doc) {\n                    void 0 === doc && (doc = window.document);\n                    el.styleSheet ? el.styleSheet.cssText = styleText : el.appendChild(doc.createTextNode(styleText));\n                }(element, options.styleSheet);\n                if (options.html) {\n                    if (\"iframe\" === tag) throw new Error(\"Iframe html can not be written unless container provided and iframe in DOM\");\n                    element.innerHTML = options.html;\n                }\n                return element;\n            }(\"iframe\", {\n                attributes: _extends({\n                    allowTransparency: \"true\"\n                }, options.attributes || {}),\n                style: _extends({\n                    backgroundColor: \"transparent\",\n                    border: \"none\"\n                }, style),\n                html: options.html,\n                class: options.class\n            });\n            var isIE = window.navigator.userAgent.match(/MSIE|Edge/i);\n            frame.hasAttribute(\"id\") || frame.setAttribute(\"id\", uniqueID());\n            awaitFrameLoad(frame);\n            container && function(id, doc) {\n                void 0 === doc && (doc = document);\n                var element = getElementSafe(id, doc);\n                if (element) return element;\n                throw new Error(\"Can not find element: \" + stringify(id));\n            }(container).appendChild(frame);\n            (options.url || isIE) && frame.setAttribute(\"src\", options.url || \"about:blank\");\n            return frame;\n        }\n        function addEventListener(obj, event, handler) {\n            obj.addEventListener(event, handler);\n            return {\n                cancel: function() {\n                    obj.removeEventListener(event, handler);\n                }\n            };\n        }\n        function showElement(element) {\n            element.style.setProperty(\"display\", \"\");\n        }\n        function hideElement(element) {\n            element.style.setProperty(\"display\", \"none\", \"important\");\n        }\n        function destroyElement(element) {\n            element && element.parentNode && element.parentNode.removeChild(element);\n        }\n        function isElementClosed(el) {\n            return !(el && el.parentNode && el.ownerDocument && el.ownerDocument.documentElement && el.ownerDocument.documentElement.contains(el));\n        }\n        function onResize(el, handler, _temp) {\n            var _ref2 = void 0 === _temp ? {} : _temp, _ref2$width = _ref2.width, width = void 0 === _ref2$width || _ref2$width, _ref2$height = _ref2.height, height = void 0 === _ref2$height || _ref2$height, _ref2$interval = _ref2.interval, interval = void 0 === _ref2$interval ? 100 : _ref2$interval, _ref2$win = _ref2.win, win = void 0 === _ref2$win ? window : _ref2$win;\n            var currentWidth = el.offsetWidth;\n            var currentHeight = el.offsetHeight;\n            var canceled = !1;\n            handler({\n                width: currentWidth,\n                height: currentHeight\n            });\n            var check = function() {\n                if (!canceled && function(el) {\n                    return Boolean(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n                }(el)) {\n                    var newWidth = el.offsetWidth;\n                    var newHeight = el.offsetHeight;\n                    (width && newWidth !== currentWidth || height && newHeight !== currentHeight) && handler({\n                        width: newWidth,\n                        height: newHeight\n                    });\n                    currentWidth = newWidth;\n                    currentHeight = newHeight;\n                }\n            };\n            var observer;\n            var timeout;\n            win.addEventListener(\"resize\", check);\n            if (void 0 !== win.ResizeObserver) {\n                (observer = new win.ResizeObserver(check)).observe(el);\n                timeout = safeInterval(check, 10 * interval);\n            } else if (void 0 !== win.MutationObserver) {\n                (observer = new win.MutationObserver(check)).observe(el, {\n                    attributes: !0,\n                    childList: !0,\n                    subtree: !0,\n                    characterData: !1\n                });\n                timeout = safeInterval(check, 10 * interval);\n            } else timeout = safeInterval(check, interval);\n            return {\n                cancel: function() {\n                    canceled = !0;\n                    observer.disconnect();\n                    window.removeEventListener(\"resize\", check);\n                    timeout.cancel();\n                }\n            };\n        }\n        function isShadowElement(element) {\n            for (;element.parentNode; ) element = element.parentNode;\n            return \"[object ShadowRoot]\" === element.toString();\n        }\n        var currentScript = \"undefined\" != typeof document ? document.currentScript : null;\n        var getCurrentScript = memoize((function() {\n            if (currentScript) return currentScript;\n            if (currentScript = function() {\n                try {\n                    var stack = function() {\n                        try {\n                            throw new Error(\"_\");\n                        } catch (err) {\n                            return err.stack || \"\";\n                        }\n                    }();\n                    var stackDetails = /.*at [^(]*\\((.*):(.+):(.+)\\)$/gi.exec(stack);\n                    var scriptLocation = stackDetails && stackDetails[1];\n                    if (!scriptLocation) return;\n                    for (var _i22 = 0, _Array$prototype$slic2 = [].slice.call(document.getElementsByTagName(\"script\")).reverse(); _i22 < _Array$prototype$slic2.length; _i22++) {\n                        var script = _Array$prototype$slic2[_i22];\n                        if (script.src && script.src === scriptLocation) return script;\n                    }\n                } catch (err) {}\n            }()) return currentScript;\n            throw new Error(\"Can not determine current script\");\n        }));\n        var currentUID = uniqueID();\n        memoize((function() {\n            var script;\n            try {\n                script = getCurrentScript();\n            } catch (err) {\n                return currentUID;\n            }\n            var uid = script.getAttribute(\"data-uid\");\n            if (uid && \"string\" == typeof uid) return uid;\n            if ((uid = script.getAttribute(\"data-uid-auto\")) && \"string\" == typeof uid) return uid;\n            if (script.src) {\n                var hashedString = function(str) {\n                    var hash = \"\";\n                    for (var i = 0; i < str.length; i++) {\n                        var total = str[i].charCodeAt(0) * i;\n                        str[i + 1] && (total += str[i + 1].charCodeAt(0) * (i - 1));\n                        hash += String.fromCharCode(97 + Math.abs(total) % 26);\n                    }\n                    return hash;\n                }(JSON.stringify({\n                    src: script.src,\n                    dataset: script.dataset\n                }));\n                uid = \"uid_\" + hashedString.slice(hashedString.length - 30);\n            } else uid = uniqueID();\n            script.setAttribute(\"data-uid-auto\", uid);\n            return uid;\n        }));\n        function toPx(val) {\n            return function(val) {\n                if (\"number\" == typeof val) return val;\n                var match = val.match(/^([0-9]+)(px|%)$/);\n                if (!match) throw new Error(\"Could not match css value from \" + val);\n                return parseInt(match[1], 10);\n            }(val) + \"px\";\n        }\n        function toCSS(val) {\n            return \"number\" == typeof val ? toPx(val) : \"string\" == typeof (str = val) && /^[0-9]+%$/.test(str) ? val : toPx(val);\n            var str;\n        }\n        function global_getGlobal(win) {\n            void 0 === win && (win = window);\n            var globalKey = \"__post_robot_10_0_46__\";\n            return win !== window ? win[globalKey] : win[globalKey] = win[globalKey] || {};\n        }\n        var getObj = function() {\n            return {};\n        };\n        function globalStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return util_getOrSet(global_getGlobal(), key, (function() {\n                var store = defStore();\n                return {\n                    has: function(storeKey) {\n                        return store.hasOwnProperty(storeKey);\n                    },\n                    get: function(storeKey, defVal) {\n                        return store.hasOwnProperty(storeKey) ? store[storeKey] : defVal;\n                    },\n                    set: function(storeKey, val) {\n                        store[storeKey] = val;\n                        return val;\n                    },\n                    del: function(storeKey) {\n                        delete store[storeKey];\n                    },\n                    getOrSet: function(storeKey, getter) {\n                        return util_getOrSet(store, storeKey, getter);\n                    },\n                    reset: function() {\n                        store = defStore();\n                    },\n                    keys: function() {\n                        return Object.keys(store);\n                    }\n                };\n            }));\n        }\n        var WildCard = function() {};\n        function getWildcard() {\n            var global = global_getGlobal();\n            global.WINDOW_WILDCARD = global.WINDOW_WILDCARD || new WildCard;\n            return global.WINDOW_WILDCARD;\n        }\n        function windowStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return globalStore(\"windowStore\").getOrSet(key, (function() {\n                var winStore = new weakmap_CrossDomainSafeWeakMap;\n                var getStore = function(win) {\n                    return winStore.getOrSet(win, defStore);\n                };\n                return {\n                    has: function(win) {\n                        return getStore(win).hasOwnProperty(key);\n                    },\n                    get: function(win, defVal) {\n                        var store = getStore(win);\n                        return store.hasOwnProperty(key) ? store[key] : defVal;\n                    },\n                    set: function(win, val) {\n                        getStore(win)[key] = val;\n                        return val;\n                    },\n                    del: function(win) {\n                        delete getStore(win)[key];\n                    },\n                    getOrSet: function(win, getter) {\n                        return util_getOrSet(getStore(win), key, getter);\n                    }\n                };\n            }));\n        }\n        function getInstanceID() {\n            return globalStore(\"instance\").getOrSet(\"instanceID\", uniqueID);\n        }\n        function resolveHelloPromise(win, _ref) {\n            var domain = _ref.domain;\n            var helloPromises = windowStore(\"helloPromises\");\n            var existingPromise = helloPromises.get(win);\n            existingPromise && existingPromise.resolve({\n                domain: domain\n            });\n            var newPromise = promise_ZalgoPromise.resolve({\n                domain: domain\n            });\n            helloPromises.set(win, newPromise);\n            return newPromise;\n        }\n        function sayHello(win, _ref4) {\n            return (0, _ref4.send)(win, \"postrobot_hello\", {\n                instanceID: getInstanceID()\n            }, {\n                domain: \"*\",\n                timeout: -1\n            }).then((function(_ref5) {\n                var origin = _ref5.origin, instanceID = _ref5.data.instanceID;\n                resolveHelloPromise(win, {\n                    domain: origin\n                });\n                return {\n                    win: win,\n                    domain: origin,\n                    instanceID: instanceID\n                };\n            }));\n        }\n        function getWindowInstanceID(win, _ref6) {\n            var send = _ref6.send;\n            return windowStore(\"windowInstanceIDPromises\").getOrSet(win, (function() {\n                return sayHello(win, {\n                    send: send\n                }).then((function(_ref7) {\n                    return _ref7.instanceID;\n                }));\n            }));\n        }\n        function markWindowKnown(win) {\n            windowStore(\"knownWindows\").set(win, !0);\n        }\n        function isSerializedType(item) {\n            return \"object\" == typeof item && null !== item && \"string\" == typeof item.__type__;\n        }\n        function determineType(val) {\n            return void 0 === val ? \"undefined\" : null === val ? \"null\" : Array.isArray(val) ? \"array\" : \"function\" == typeof val ? \"function\" : \"object\" == typeof val ? val instanceof Error ? \"error\" : \"function\" == typeof val.then ? \"promise\" : \"[object RegExp]\" === {}.toString.call(val) ? \"regex\" : \"[object Date]\" === {}.toString.call(val) ? \"date\" : \"object\" : \"string\" == typeof val ? \"string\" : \"number\" == typeof val ? \"number\" : \"boolean\" == typeof val ? \"boolean\" : void 0;\n        }\n        function serializeType(type, val) {\n            return {\n                __type__: type,\n                __val__: val\n            };\n        }\n        var _SERIALIZER;\n        var SERIALIZER = ((_SERIALIZER = {}).function = function() {}, _SERIALIZER.error = function(_ref) {\n            return serializeType(\"error\", {\n                message: _ref.message,\n                stack: _ref.stack,\n                code: _ref.code,\n                data: _ref.data\n            });\n        }, _SERIALIZER.promise = function() {}, _SERIALIZER.regex = function(val) {\n            return serializeType(\"regex\", val.source);\n        }, _SERIALIZER.date = function(val) {\n            return serializeType(\"date\", val.toJSON());\n        }, _SERIALIZER.array = function(val) {\n            return val;\n        }, _SERIALIZER.object = function(val) {\n            return val;\n        }, _SERIALIZER.string = function(val) {\n            return val;\n        }, _SERIALIZER.number = function(val) {\n            return val;\n        }, _SERIALIZER.boolean = function(val) {\n            return val;\n        }, _SERIALIZER.null = function(val) {\n            return val;\n        }, _SERIALIZER[void 0] = function(val) {\n            return serializeType(\"undefined\", val);\n        }, _SERIALIZER);\n        var defaultSerializers = {};\n        var _DESERIALIZER;\n        var DESERIALIZER = ((_DESERIALIZER = {}).function = function() {\n            throw new Error(\"Function serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.error = function(_ref2) {\n            var stack = _ref2.stack, code = _ref2.code, data = _ref2.data;\n            var error = new Error(_ref2.message);\n            error.code = code;\n            data && (error.data = data);\n            error.stack = stack + \"\\n\\n\" + error.stack;\n            return error;\n        }, _DESERIALIZER.promise = function() {\n            throw new Error(\"Promise serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.regex = function(val) {\n            return new RegExp(val);\n        }, _DESERIALIZER.date = function(val) {\n            return new Date(val);\n        }, _DESERIALIZER.array = function(val) {\n            return val;\n        }, _DESERIALIZER.object = function(val) {\n            return val;\n        }, _DESERIALIZER.string = function(val) {\n            return val;\n        }, _DESERIALIZER.number = function(val) {\n            return val;\n        }, _DESERIALIZER.boolean = function(val) {\n            return val;\n        }, _DESERIALIZER.null = function(val) {\n            return val;\n        }, _DESERIALIZER[void 0] = function() {}, _DESERIALIZER);\n        var defaultDeserializers = {};\n        new promise_ZalgoPromise((function(resolve) {\n            if (window.document && window.document.body) return resolve(window.document.body);\n            var interval = setInterval((function() {\n                if (window.document && window.document.body) {\n                    clearInterval(interval);\n                    return resolve(window.document.body);\n                }\n            }), 10);\n        }));\n        function cleanupProxyWindows() {\n            var idToProxyWindow = globalStore(\"idToProxyWindow\");\n            for (var _i2 = 0, _idToProxyWindow$keys2 = idToProxyWindow.keys(); _i2 < _idToProxyWindow$keys2.length; _i2++) {\n                var id = _idToProxyWindow$keys2[_i2];\n                idToProxyWindow.get(id).shouldClean() && idToProxyWindow.del(id);\n            }\n        }\n        function getSerializedWindow(winPromise, _ref) {\n            var send = _ref.send, _ref$id = _ref.id, id = void 0 === _ref$id ? uniqueID() : _ref$id;\n            var windowNamePromise = winPromise.then((function(win) {\n                if (isSameDomain(win)) return assertSameDomain(win).name;\n            }));\n            var windowTypePromise = winPromise.then((function(window) {\n                if (isWindowClosed(window)) throw new Error(\"Window is closed, can not determine type\");\n                return getOpener(window) ? \"popup\" : \"iframe\";\n            }));\n            windowNamePromise.catch(src_util_noop);\n            windowTypePromise.catch(src_util_noop);\n            var getName = function() {\n                return winPromise.then((function(win) {\n                    if (!isWindowClosed(win)) return isSameDomain(win) ? assertSameDomain(win).name : windowNamePromise;\n                }));\n            };\n            return {\n                id: id,\n                getType: function() {\n                    return windowTypePromise;\n                },\n                getInstanceID: memoizePromise((function() {\n                    return winPromise.then((function(win) {\n                        return getWindowInstanceID(win, {\n                            send: send\n                        });\n                    }));\n                })),\n                close: function() {\n                    return winPromise.then(closeWindow);\n                },\n                getName: getName,\n                focus: function() {\n                    return winPromise.then((function(win) {\n                        win.focus();\n                    }));\n                },\n                isClosed: function() {\n                    return winPromise.then((function(win) {\n                        return isWindowClosed(win);\n                    }));\n                },\n                setLocation: function(href, opts) {\n                    void 0 === opts && (opts = {});\n                    return winPromise.then((function(win) {\n                        var domain = window.location.protocol + \"//\" + window.location.host;\n                        var _opts$method = opts.method, method = void 0 === _opts$method ? \"get\" : _opts$method, body = opts.body;\n                        if (0 === href.indexOf(\"/\")) href = \"\" + domain + href; else if (!href.match(/^https?:\\/\\//) && 0 !== href.indexOf(domain)) throw new Error(\"Expected url to be http or https url, or absolute path, got \" + JSON.stringify(href));\n                        if (\"post\" === method) return getName().then((function(name) {\n                            if (!name) throw new Error(\"Can not post to window without target name\");\n                            !function(_ref3) {\n                                var url = _ref3.url, target = _ref3.target, body = _ref3.body, _ref3$method = _ref3.method, method = void 0 === _ref3$method ? \"post\" : _ref3$method;\n                                var form = document.createElement(\"form\");\n                                form.setAttribute(\"target\", target);\n                                form.setAttribute(\"method\", method);\n                                form.setAttribute(\"action\", url);\n                                form.style.display = \"none\";\n                                if (body) for (var _i24 = 0, _Object$keys4 = Object.keys(body); _i24 < _Object$keys4.length; _i24++) {\n                                    var _body$key;\n                                    var key = _Object$keys4[_i24];\n                                    var input = document.createElement(\"input\");\n                                    input.setAttribute(\"name\", key);\n                                    input.setAttribute(\"value\", null == (_body$key = body[key]) ? void 0 : _body$key.toString());\n                                    form.appendChild(input);\n                                }\n                                getBody().appendChild(form);\n                                form.submit();\n                                getBody().removeChild(form);\n                            }({\n                                url: href,\n                                target: name,\n                                method: method,\n                                body: body\n                            });\n                        }));\n                        if (\"get\" !== method) throw new Error(\"Unsupported method: \" + method);\n                        if (isSameDomain(win)) try {\n                            if (win.location && \"function\" == typeof win.location.replace) {\n                                win.location.replace(href);\n                                return;\n                            }\n                        } catch (err) {}\n                        win.location = href;\n                    }));\n                },\n                setName: function(name) {\n                    return winPromise.then((function(win) {\n                        var sameDomain = isSameDomain(win);\n                        var frame = getFrameForWindow(win);\n                        if (!sameDomain) throw new Error(\"Can not set name for cross-domain window: \" + name);\n                        assertSameDomain(win).name = name;\n                        frame && frame.setAttribute(\"name\", name);\n                        windowNamePromise = promise_ZalgoPromise.resolve(name);\n                    }));\n                }\n            };\n        }\n        var window_ProxyWindow = function() {\n            function ProxyWindow(_ref2) {\n                var send = _ref2.send, win = _ref2.win, serializedWindow = _ref2.serializedWindow;\n                this.id = void 0;\n                this.isProxyWindow = !0;\n                this.serializedWindow = void 0;\n                this.actualWindow = void 0;\n                this.actualWindowPromise = void 0;\n                this.send = void 0;\n                this.name = void 0;\n                this.actualWindowPromise = new promise_ZalgoPromise;\n                this.serializedWindow = serializedWindow || getSerializedWindow(this.actualWindowPromise, {\n                    send: send\n                });\n                globalStore(\"idToProxyWindow\").set(this.getID(), this);\n                win && this.setWindow(win, {\n                    send: send\n                });\n            }\n            var _proto = ProxyWindow.prototype;\n            _proto.getID = function() {\n                return this.serializedWindow.id;\n            };\n            _proto.getType = function() {\n                return this.serializedWindow.getType();\n            };\n            _proto.isPopup = function() {\n                return this.getType().then((function(type) {\n                    return \"popup\" === type;\n                }));\n            };\n            _proto.setLocation = function(href, opts) {\n                var _this = this;\n                return this.serializedWindow.setLocation(href, opts).then((function() {\n                    return _this;\n                }));\n            };\n            _proto.getName = function() {\n                return this.serializedWindow.getName();\n            };\n            _proto.setName = function(name) {\n                var _this2 = this;\n                return this.serializedWindow.setName(name).then((function() {\n                    return _this2;\n                }));\n            };\n            _proto.close = function() {\n                var _this3 = this;\n                return this.serializedWindow.close().then((function() {\n                    return _this3;\n                }));\n            };\n            _proto.focus = function() {\n                var _this4 = this;\n                var isPopupPromise = this.isPopup();\n                var getNamePromise = this.getName();\n                var reopenPromise = promise_ZalgoPromise.hash({\n                    isPopup: isPopupPromise,\n                    name: getNamePromise\n                }).then((function(_ref3) {\n                    var name = _ref3.name;\n                    _ref3.isPopup && name && window.open(\"\", name, \"noopener\");\n                }));\n                var focusPromise = this.serializedWindow.focus();\n                return promise_ZalgoPromise.all([ reopenPromise, focusPromise ]).then((function() {\n                    return _this4;\n                }));\n            };\n            _proto.isClosed = function() {\n                return this.serializedWindow.isClosed();\n            };\n            _proto.getWindow = function() {\n                return this.actualWindow;\n            };\n            _proto.setWindow = function(win, _ref4) {\n                var send = _ref4.send;\n                this.actualWindow = win;\n                this.actualWindowPromise.resolve(this.actualWindow);\n                this.serializedWindow = getSerializedWindow(this.actualWindowPromise, {\n                    send: send,\n                    id: this.getID()\n                });\n                windowStore(\"winToProxyWindow\").set(win, this);\n            };\n            _proto.awaitWindow = function() {\n                return this.actualWindowPromise;\n            };\n            _proto.matchWindow = function(win, _ref5) {\n                var _this5 = this;\n                var send = _ref5.send;\n                return promise_ZalgoPromise.try((function() {\n                    return _this5.actualWindow ? win === _this5.actualWindow : promise_ZalgoPromise.hash({\n                        proxyInstanceID: _this5.getInstanceID(),\n                        knownWindowInstanceID: getWindowInstanceID(win, {\n                            send: send\n                        })\n                    }).then((function(_ref6) {\n                        var match = _ref6.proxyInstanceID === _ref6.knownWindowInstanceID;\n                        match && _this5.setWindow(win, {\n                            send: send\n                        });\n                        return match;\n                    }));\n                }));\n            };\n            _proto.unwrap = function() {\n                return this.actualWindow || this;\n            };\n            _proto.getInstanceID = function() {\n                return this.serializedWindow.getInstanceID();\n            };\n            _proto.shouldClean = function() {\n                return Boolean(this.actualWindow && isWindowClosed(this.actualWindow));\n            };\n            _proto.serialize = function() {\n                return this.serializedWindow;\n            };\n            ProxyWindow.unwrap = function(win) {\n                return ProxyWindow.isProxyWindow(win) ? win.unwrap() : win;\n            };\n            ProxyWindow.serialize = function(win, _ref7) {\n                var send = _ref7.send;\n                cleanupProxyWindows();\n                return ProxyWindow.toProxyWindow(win, {\n                    send: send\n                }).serialize();\n            };\n            ProxyWindow.deserialize = function(serializedWindow, _ref8) {\n                var send = _ref8.send;\n                cleanupProxyWindows();\n                return globalStore(\"idToProxyWindow\").get(serializedWindow.id) || new ProxyWindow({\n                    serializedWindow: serializedWindow,\n                    send: send\n                });\n            };\n            ProxyWindow.isProxyWindow = function(obj) {\n                return Boolean(obj && !isWindow(obj) && obj.isProxyWindow);\n            };\n            ProxyWindow.toProxyWindow = function(win, _ref9) {\n                var send = _ref9.send;\n                cleanupProxyWindows();\n                if (ProxyWindow.isProxyWindow(win)) return win;\n                var actualWindow = win;\n                return windowStore(\"winToProxyWindow\").get(actualWindow) || new ProxyWindow({\n                    win: actualWindow,\n                    send: send\n                });\n            };\n            return ProxyWindow;\n        }();\n        function addMethod(id, val, name, source, domain) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            if (window_ProxyWindow.isProxyWindow(source)) proxyWindowMethods.set(id, {\n                val: val,\n                name: name,\n                domain: domain,\n                source: source\n            }); else {\n                proxyWindowMethods.del(id);\n                methodStore.getOrSet(source, (function() {\n                    return {};\n                }))[id] = {\n                    domain: domain,\n                    name: name,\n                    val: val,\n                    source: source\n                };\n            }\n        }\n        function lookupMethod(source, id) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            return methodStore.getOrSet(source, (function() {\n                return {};\n            }))[id] || proxyWindowMethods.get(id);\n        }\n        function function_serializeFunction(destination, domain, val, key, _ref3) {\n            on = (_ref = {\n                on: _ref3.on,\n                send: _ref3.send\n            }).on, send = _ref.send, globalStore(\"builtinListeners\").getOrSet(\"functionCalls\", (function() {\n                return on(\"postrobot_method\", {\n                    domain: \"*\"\n                }, (function(_ref2) {\n                    var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                    var id = data.id, name = data.name;\n                    var meth = lookupMethod(source, id);\n                    if (!meth) throw new Error(\"Could not find method '\" + name + \"' with id: \" + data.id + \" in \" + getDomain(window));\n                    var methodSource = meth.source, domain = meth.domain, val = meth.val;\n                    return promise_ZalgoPromise.try((function() {\n                        if (!matchDomain(domain, origin)) throw new Error(\"Method '\" + data.name + \"' domain \" + JSON.stringify(util_isRegex(meth.domain) ? meth.domain.source : meth.domain) + \" does not match origin \" + origin + \" in \" + getDomain(window));\n                        if (window_ProxyWindow.isProxyWindow(methodSource)) return methodSource.matchWindow(source, {\n                            send: send\n                        }).then((function(match) {\n                            if (!match) throw new Error(\"Method call '\" + data.name + \"' failed - proxy window does not match source in \" + getDomain(window));\n                        }));\n                    })).then((function() {\n                        return val.apply({\n                            source: source,\n                            origin: origin\n                        }, data.args);\n                    }), (function(err) {\n                        return promise_ZalgoPromise.try((function() {\n                            if (val.onError) return val.onError(err);\n                        })).then((function() {\n                            err.stack && (err.stack = \"Remote call to \" + name + \"(\" + function(args) {\n                                void 0 === args && (args = []);\n                                return arrayFrom(args).map((function(arg) {\n                                    return \"string\" == typeof arg ? \"'\" + arg + \"'\" : void 0 === arg ? \"undefined\" : null === arg ? \"null\" : \"boolean\" == typeof arg ? arg.toString() : Array.isArray(arg) ? \"[ ... ]\" : \"object\" == typeof arg ? \"{ ... }\" : \"function\" == typeof arg ? \"() => { ... }\" : \"<\" + typeof arg + \">\";\n                                })).join(\", \");\n                            }(data.args) + \") failed\\n\\n\" + err.stack);\n                            throw err;\n                        }));\n                    })).then((function(result) {\n                        return {\n                            result: result,\n                            id: id,\n                            name: name\n                        };\n                    }));\n                }));\n            }));\n            var _ref, on, send;\n            var id = val.__id__ || uniqueID();\n            destination = window_ProxyWindow.unwrap(destination);\n            var name = val.__name__ || val.name || key;\n            \"string\" == typeof name && \"function\" == typeof name.indexOf && 0 === name.indexOf(\"anonymous::\") && (name = name.replace(\"anonymous::\", key + \"::\"));\n            if (window_ProxyWindow.isProxyWindow(destination)) {\n                addMethod(id, val, name, destination, domain);\n                destination.awaitWindow().then((function(win) {\n                    addMethod(id, val, name, win, domain);\n                }));\n            } else addMethod(id, val, name, destination, domain);\n            return serializeType(\"cross_domain_function\", {\n                id: id,\n                name: name\n            });\n        }\n        function serializeMessage(destination, domain, obj, _ref) {\n            var _serialize;\n            var on = _ref.on, send = _ref.send;\n            return function(obj, serializers) {\n                void 0 === serializers && (serializers = defaultSerializers);\n                var result = JSON.stringify(obj, (function(key) {\n                    var val = this[key];\n                    if (isSerializedType(this)) return val;\n                    var type = determineType(val);\n                    if (!type) return val;\n                    var serializer = serializers[type] || SERIALIZER[type];\n                    return serializer ? serializer(val, key) : val;\n                }));\n                return void 0 === result ? \"undefined\" : result;\n            }(obj, ((_serialize = {}).promise = function(val, key) {\n                return function(destination, domain, val, key, _ref) {\n                    return serializeType(\"cross_domain_zalgo_promise\", {\n                        then: function_serializeFunction(destination, domain, (function(resolve, reject) {\n                            return val.then(resolve, reject);\n                        }), key, {\n                            on: _ref.on,\n                            send: _ref.send\n                        })\n                    });\n                }(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.function = function(val, key) {\n                return function_serializeFunction(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.object = function(val) {\n                return isWindow(val) || window_ProxyWindow.isProxyWindow(val) ? serializeType(\"cross_domain_window\", window_ProxyWindow.serialize(val, {\n                    send: send\n                })) : val;\n            }, _serialize));\n        }\n        function deserializeMessage(source, origin, message, _ref2) {\n            var _deserialize;\n            var send = _ref2.send;\n            return function(str, deserializers) {\n                void 0 === deserializers && (deserializers = defaultDeserializers);\n                if (\"undefined\" !== str) return JSON.parse(str, (function(key, val) {\n                    if (isSerializedType(this)) return val;\n                    var type;\n                    var value;\n                    if (isSerializedType(val)) {\n                        type = val.__type__;\n                        value = val.__val__;\n                    } else {\n                        type = determineType(val);\n                        value = val;\n                    }\n                    if (!type) return value;\n                    var deserializer = deserializers[type] || DESERIALIZER[type];\n                    return deserializer ? deserializer(value, key) : value;\n                }));\n            }(message, ((_deserialize = {}).cross_domain_zalgo_promise = function(serializedPromise) {\n                return function(source, origin, _ref2) {\n                    return new promise_ZalgoPromise(_ref2.then);\n                }(0, 0, serializedPromise);\n            }, _deserialize.cross_domain_function = function(serializedFunction) {\n                return function(source, origin, _ref4, _ref5) {\n                    var id = _ref4.id, name = _ref4.name;\n                    var send = _ref5.send;\n                    var getDeserializedFunction = function(opts) {\n                        void 0 === opts && (opts = {});\n                        function crossDomainFunctionWrapper() {\n                            var _arguments = arguments;\n                            return window_ProxyWindow.toProxyWindow(source, {\n                                send: send\n                            }).awaitWindow().then((function(win) {\n                                var meth = lookupMethod(win, id);\n                                if (meth && meth.val !== crossDomainFunctionWrapper) return meth.val.apply({\n                                    source: window,\n                                    origin: getDomain()\n                                }, _arguments);\n                                var _args = [].slice.call(_arguments);\n                                return opts.fireAndForget ? send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !0\n                                }) : send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !1\n                                }).then((function(res) {\n                                    return res.data.result;\n                                }));\n                            })).catch((function(err) {\n                                throw err;\n                            }));\n                        }\n                        crossDomainFunctionWrapper.__name__ = name;\n                        crossDomainFunctionWrapper.__origin__ = origin;\n                        crossDomainFunctionWrapper.__source__ = source;\n                        crossDomainFunctionWrapper.__id__ = id;\n                        crossDomainFunctionWrapper.origin = origin;\n                        return crossDomainFunctionWrapper;\n                    };\n                    var crossDomainFunctionWrapper = getDeserializedFunction();\n                    crossDomainFunctionWrapper.fireAndForget = getDeserializedFunction({\n                        fireAndForget: !0\n                    });\n                    return crossDomainFunctionWrapper;\n                }(source, origin, serializedFunction, {\n                    send: send\n                });\n            }, _deserialize.cross_domain_window = function(serializedWindow) {\n                return window_ProxyWindow.deserialize(serializedWindow, {\n                    send: send\n                });\n            }, _deserialize));\n        }\n        var SEND_MESSAGE_STRATEGIES = {};\n        SEND_MESSAGE_STRATEGIES.postrobot_post_message = function(win, serializedMessage, domain) {\n            0 === domain.indexOf(\"file:\") && (domain = \"*\");\n            win.postMessage(serializedMessage, domain);\n        };\n        SEND_MESSAGE_STRATEGIES.postrobot_global = function(win, serializedMessage) {\n            if (!function(win) {\n                return (win = win || window).navigator.mockUserAgent || win.navigator.userAgent;\n            }(window).match(/MSIE|rv:11|trident|edge\\/12|edge\\/13/i)) throw new Error(\"Global messaging not needed for browser\");\n            if (!isSameDomain(win)) throw new Error(\"Post message through global disabled between different domain windows\");\n            if (!1 !== function(win1, win2) {\n                var top1 = getTop(win1) || win1;\n                var top2 = getTop(win2) || win2;\n                try {\n                    if (top1 && top2) return top1 === top2;\n                } catch (err) {}\n                var allFrames1 = getAllFramesInWindow(win1);\n                var allFrames2 = getAllFramesInWindow(win2);\n                if (anyMatch(allFrames1, allFrames2)) return !0;\n                var opener1 = getOpener(top1);\n                var opener2 = getOpener(top2);\n                return opener1 && anyMatch(getAllFramesInWindow(opener1), allFrames2) || opener2 && anyMatch(getAllFramesInWindow(opener2), allFrames1), \n                !1;\n            }(window, win)) throw new Error(\"Can only use global to communicate between two different windows, not between frames\");\n            var foreignGlobal = global_getGlobal(win);\n            if (!foreignGlobal) throw new Error(\"Can not find postRobot global on foreign window\");\n            foreignGlobal.receiveMessage({\n                source: window,\n                origin: getDomain(),\n                data: serializedMessage\n            });\n        };\n        function send_sendMessage(win, domain, message, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            return promise_ZalgoPromise.try((function() {\n                var domainBuffer = windowStore().getOrSet(win, (function() {\n                    return {};\n                }));\n                domainBuffer.buffer = domainBuffer.buffer || [];\n                domainBuffer.buffer.push(message);\n                domainBuffer.flush = domainBuffer.flush || promise_ZalgoPromise.flush().then((function() {\n                    if (isWindowClosed(win)) throw new Error(\"Window is closed\");\n                    var serializedMessage = serializeMessage(win, domain, ((_ref = {}).__post_robot_10_0_46__ = domainBuffer.buffer || [], \n                    _ref), {\n                        on: on,\n                        send: send\n                    });\n                    var _ref;\n                    delete domainBuffer.buffer;\n                    var strategies = Object.keys(SEND_MESSAGE_STRATEGIES);\n                    var errors = [];\n                    for (var _i2 = 0; _i2 < strategies.length; _i2++) {\n                        var strategyName = strategies[_i2];\n                        try {\n                            SEND_MESSAGE_STRATEGIES[strategyName](win, serializedMessage, domain);\n                        } catch (err) {\n                            errors.push(err);\n                        }\n                    }\n                    if (errors.length === strategies.length) throw new Error(\"All post-robot messaging strategies failed:\\n\\n\" + errors.map((function(err, i) {\n                        return i + \". \" + stringifyError(err);\n                    })).join(\"\\n\\n\"));\n                }));\n                return domainBuffer.flush.then((function() {\n                    delete domainBuffer.flush;\n                }));\n            })).then(src_util_noop);\n        }\n        function getResponseListener(hash) {\n            return globalStore(\"responseListeners\").get(hash);\n        }\n        function deleteResponseListener(hash) {\n            globalStore(\"responseListeners\").del(hash);\n        }\n        function isResponseListenerErrored(hash) {\n            return globalStore(\"erroredResponseListeners\").has(hash);\n        }\n        function getRequestListener(_ref) {\n            var name = _ref.name, win = _ref.win, domain = _ref.domain;\n            var requestListeners = windowStore(\"requestListeners\");\n            \"*\" === win && (win = null);\n            \"*\" === domain && (domain = null);\n            if (!name) throw new Error(\"Name required to get request listener\");\n            for (var _i4 = 0, _ref3 = [ win, getWildcard() ]; _i4 < _ref3.length; _i4++) {\n                var winQualifier = _ref3[_i4];\n                if (winQualifier) {\n                    var nameListeners = requestListeners.get(winQualifier);\n                    if (nameListeners) {\n                        var domainListeners = nameListeners[name];\n                        if (domainListeners) {\n                            if (domain && \"string\" == typeof domain) {\n                                if (domainListeners[domain]) return domainListeners[domain];\n                                if (domainListeners.__domain_regex__) for (var _i6 = 0, _domainListeners$__DO2 = domainListeners.__domain_regex__; _i6 < _domainListeners$__DO2.length; _i6++) {\n                                    var _domainListeners$__DO3 = _domainListeners$__DO2[_i6], listener = _domainListeners$__DO3.listener;\n                                    if (matchDomain(_domainListeners$__DO3.regex, domain)) return listener;\n                                }\n                            }\n                            if (domainListeners[\"*\"]) return domainListeners[\"*\"];\n                        }\n                    }\n                }\n            }\n        }\n        function handleRequest(source, origin, message, _ref) {\n            var on = _ref.on, send = _ref.send;\n            var options = getRequestListener({\n                name: message.name,\n                win: source,\n                domain: origin\n            });\n            var logName = \"postrobot_method\" === message.name && message.data && \"string\" == typeof message.data.name ? message.data.name + \"()\" : message.name;\n            function sendResponse(ack, data, error) {\n                return promise_ZalgoPromise.flush().then((function() {\n                    if (!message.fireAndForget && !isWindowClosed(source)) try {\n                        return send_sendMessage(source, origin, {\n                            id: uniqueID(),\n                            origin: getDomain(window),\n                            type: \"postrobot_message_response\",\n                            hash: message.hash,\n                            name: message.name,\n                            ack: ack,\n                            data: data,\n                            error: error\n                        }, {\n                            on: on,\n                            send: send\n                        });\n                    } catch (err) {\n                        throw new Error(\"Send response message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }\n                }));\n            }\n            return promise_ZalgoPromise.all([ promise_ZalgoPromise.flush().then((function() {\n                if (!message.fireAndForget && !isWindowClosed(source)) try {\n                    return send_sendMessage(source, origin, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_ack\",\n                        hash: message.hash,\n                        name: message.name\n                    }, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    throw new Error(\"Send ack message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                }\n            })), promise_ZalgoPromise.try((function() {\n                if (!options) throw new Error(\"No handler found for post message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                return options.handler({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            })).then((function(data) {\n                return sendResponse(\"success\", data);\n            }), (function(error) {\n                return sendResponse(\"error\", null, error);\n            })) ]).then(src_util_noop).catch((function(err) {\n                if (options && options.handleError) return options.handleError(err);\n                throw err;\n            }));\n        }\n        function handleAck(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message ack for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                try {\n                    if (!matchDomain(options.domain, origin)) throw new Error(\"Ack origin \" + origin + \" does not match domain \" + options.domain.toString());\n                    if (source !== options.win) throw new Error(\"Ack source does not match registered window\");\n                } catch (err) {\n                    options.promise.reject(err);\n                }\n                options.ack = !0;\n            }\n        }\n        function handleResponse(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message response for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                if (!matchDomain(options.domain, origin)) throw new Error(\"Response origin \" + origin + \" does not match domain \" + (pattern = options.domain, \n                Array.isArray(pattern) ? \"(\" + pattern.join(\" | \") + \")\" : isRegex(pattern) ? \"RegExp(\" + pattern.toString() + \")\" : pattern.toString()));\n                var pattern;\n                if (source !== options.win) throw new Error(\"Response source does not match registered window\");\n                deleteResponseListener(message.hash);\n                \"error\" === message.ack ? options.promise.reject(message.error) : \"success\" === message.ack && options.promise.resolve({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            }\n        }\n        function receive_receiveMessage(event, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            var receivedMessages = globalStore(\"receivedMessages\");\n            try {\n                if (!window || window.closed || !event.source) return;\n            } catch (err) {\n                return;\n            }\n            var source = event.source, origin = event.origin;\n            var messages = function(message, source, origin, _ref) {\n                var on = _ref.on, send = _ref.send;\n                var parsedMessage;\n                try {\n                    parsedMessage = deserializeMessage(source, origin, message, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    return;\n                }\n                if (parsedMessage && \"object\" == typeof parsedMessage && null !== parsedMessage) {\n                    var parseMessages = parsedMessage.__post_robot_10_0_46__;\n                    if (Array.isArray(parseMessages)) return parseMessages;\n                }\n            }(event.data, source, origin, {\n                on: on,\n                send: send\n            });\n            if (messages) {\n                markWindowKnown(source);\n                for (var _i2 = 0; _i2 < messages.length; _i2++) {\n                    var message = messages[_i2];\n                    if (receivedMessages.has(message.id)) return;\n                    receivedMessages.set(message.id, !0);\n                    if (isWindowClosed(source) && !message.fireAndForget) return;\n                    0 === message.origin.indexOf(\"file:\") && (origin = \"file://\");\n                    try {\n                        \"postrobot_message_request\" === message.type ? handleRequest(source, origin, message, {\n                            on: on,\n                            send: send\n                        }) : \"postrobot_message_response\" === message.type ? handleResponse(source, origin, message) : \"postrobot_message_ack\" === message.type && handleAck(source, origin, message);\n                    } catch (err) {\n                        setTimeout((function() {\n                            throw err;\n                        }), 0);\n                    }\n                }\n            }\n        }\n        function on_on(name, options, handler) {\n            if (!name) throw new Error(\"Expected name\");\n            if (\"function\" == typeof (options = options || {})) {\n                handler = options;\n                options = {};\n            }\n            if (!handler) throw new Error(\"Expected handler\");\n            var requestListener = function addRequestListener(_ref4, listener) {\n                var name = _ref4.name, winCandidate = _ref4.win, domain = _ref4.domain;\n                var requestListeners = windowStore(\"requestListeners\");\n                if (!name || \"string\" != typeof name) throw new Error(\"Name required to add request listener\");\n                if (winCandidate && \"*\" !== winCandidate && window_ProxyWindow.isProxyWindow(winCandidate)) {\n                    var requestListenerPromise = winCandidate.awaitWindow().then((function(actualWin) {\n                        return addRequestListener({\n                            name: name,\n                            win: actualWin,\n                            domain: domain\n                        }, listener);\n                    }));\n                    return {\n                        cancel: function() {\n                            requestListenerPromise.then((function(requestListener) {\n                                return requestListener.cancel();\n                            }), src_util_noop);\n                        }\n                    };\n                }\n                var win = winCandidate;\n                if (Array.isArray(win)) {\n                    var listenersCollection = [];\n                    for (var _i8 = 0, _win2 = win; _i8 < _win2.length; _i8++) listenersCollection.push(addRequestListener({\n                        name: name,\n                        domain: domain,\n                        win: _win2[_i8]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i10 = 0; _i10 < listenersCollection.length; _i10++) listenersCollection[_i10].cancel();\n                        }\n                    };\n                }\n                if (Array.isArray(domain)) {\n                    var _listenersCollection = [];\n                    for (var _i12 = 0, _domain2 = domain; _i12 < _domain2.length; _i12++) _listenersCollection.push(addRequestListener({\n                        name: name,\n                        win: win,\n                        domain: _domain2[_i12]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i14 = 0; _i14 < _listenersCollection.length; _i14++) _listenersCollection[_i14].cancel();\n                        }\n                    };\n                }\n                var existingListener = getRequestListener({\n                    name: name,\n                    win: win,\n                    domain: domain\n                });\n                win && \"*\" !== win || (win = getWildcard());\n                var strDomain = (domain = domain || \"*\").toString();\n                if (existingListener) throw win && domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString() + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : win ? new Error(\"Request listener already exists for \" + name + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString()) : new Error(\"Request listener already exists for \" + name);\n                var winNameListeners = requestListeners.getOrSet(win, (function() {\n                    return {};\n                }));\n                var winNameDomainListeners = util_getOrSet(winNameListeners, name, (function() {\n                    return {};\n                }));\n                var winNameDomainRegexListeners;\n                var winNameDomainRegexListener;\n                util_isRegex(domain) ? (winNameDomainRegexListeners = util_getOrSet(winNameDomainListeners, \"__domain_regex__\", (function() {\n                    return [];\n                }))).push(winNameDomainRegexListener = {\n                    regex: domain,\n                    listener: listener\n                }) : winNameDomainListeners[strDomain] = listener;\n                return {\n                    cancel: function() {\n                        delete winNameDomainListeners[strDomain];\n                        if (winNameDomainRegexListener) {\n                            winNameDomainRegexListeners.splice(winNameDomainRegexListeners.indexOf(winNameDomainRegexListener, 1));\n                            winNameDomainRegexListeners.length || delete winNameDomainListeners.__domain_regex__;\n                        }\n                        Object.keys(winNameDomainListeners).length || delete winNameListeners[name];\n                        win && !Object.keys(winNameListeners).length && requestListeners.del(win);\n                    }\n                };\n            }({\n                name: name,\n                win: options.window,\n                domain: options.domain || \"*\"\n            }, {\n                handler: handler || options.handler,\n                handleError: options.errorHandler || function(err) {\n                    throw err;\n                }\n            });\n            return {\n                cancel: function() {\n                    requestListener.cancel();\n                }\n            };\n        }\n        var send_send = function send(winOrProxyWin, name, data, options) {\n            var domainMatcher = (options = options || {}).domain || \"*\";\n            var responseTimeout = options.timeout || -1;\n            var childTimeout = options.timeout || 5e3;\n            var fireAndForget = options.fireAndForget || !1;\n            return window_ProxyWindow.toProxyWindow(winOrProxyWin, {\n                send: send\n            }).awaitWindow().then((function(win) {\n                return promise_ZalgoPromise.try((function() {\n                    !function(name, win, domain) {\n                        if (!name) throw new Error(\"Expected name\");\n                        if (domain && \"string\" != typeof domain && !Array.isArray(domain) && !util_isRegex(domain)) throw new TypeError(\"Can not send \" + name + \". Expected domain \" + JSON.stringify(domain) + \" to be a string, array, or regex\");\n                        if (isWindowClosed(win)) throw new Error(\"Can not send \" + name + \". Target window is closed\");\n                    }(name, win, domainMatcher);\n                    if (function(parent, child) {\n                        var actualParent = getAncestor(child);\n                        if (actualParent) return actualParent === parent;\n                        if (child === parent) return !1;\n                        if (getTop(child) === child) return !1;\n                        for (var _i15 = 0, _getFrames8 = getFrames(parent); _i15 < _getFrames8.length; _i15++) if (_getFrames8[_i15] === child) return !0;\n                        return !1;\n                    }(window, win)) return function(win, timeout, name) {\n                        void 0 === timeout && (timeout = 5e3);\n                        void 0 === name && (name = \"Window\");\n                        var promise = function(win) {\n                            return windowStore(\"helloPromises\").getOrSet(win, (function() {\n                                return new promise_ZalgoPromise;\n                            }));\n                        }(win);\n                        -1 !== timeout && (promise = promise.timeout(timeout, new Error(name + \" did not load after \" + timeout + \"ms\")));\n                        return promise;\n                    }(win, childTimeout);\n                })).then((function(_temp) {\n                    return function(win, targetDomain, actualDomain, _ref) {\n                        var send = _ref.send;\n                        return promise_ZalgoPromise.try((function() {\n                            return \"string\" == typeof targetDomain ? targetDomain : promise_ZalgoPromise.try((function() {\n                                return actualDomain || sayHello(win, {\n                                    send: send\n                                }).then((function(_ref2) {\n                                    return _ref2.domain;\n                                }));\n                            })).then((function(normalizedDomain) {\n                                if (!matchDomain(targetDomain, targetDomain)) throw new Error(\"Domain \" + stringify(targetDomain) + \" does not match \" + stringify(targetDomain));\n                                return normalizedDomain;\n                            }));\n                        }));\n                    }(win, domainMatcher, (void 0 === _temp ? {} : _temp).domain, {\n                        send: send\n                    });\n                })).then((function(targetDomain) {\n                    var domain = targetDomain;\n                    var logName = \"postrobot_method\" === name && data && \"string\" == typeof data.name ? data.name + \"()\" : name;\n                    var promise = new promise_ZalgoPromise;\n                    var hash = name + \"_\" + uniqueID();\n                    if (!fireAndForget) {\n                        var responseListener = {\n                            name: name,\n                            win: win,\n                            domain: domain,\n                            promise: promise\n                        };\n                        !function(hash, listener) {\n                            globalStore(\"responseListeners\").set(hash, listener);\n                        }(hash, responseListener);\n                        var reqPromises = windowStore(\"requestPromises\").getOrSet(win, (function() {\n                            return [];\n                        }));\n                        reqPromises.push(promise);\n                        promise.catch((function() {\n                            !function(hash) {\n                                globalStore(\"erroredResponseListeners\").set(hash, !0);\n                            }(hash);\n                            deleteResponseListener(hash);\n                        }));\n                        var totalAckTimeout = function(win) {\n                            return windowStore(\"knownWindows\").get(win, !1);\n                        }(win) ? 1e4 : 2e3;\n                        var totalResTimeout = responseTimeout;\n                        var ackTimeout = totalAckTimeout;\n                        var resTimeout = totalResTimeout;\n                        var interval = safeInterval((function() {\n                            if (isWindowClosed(win)) return promise.reject(new Error(\"Window closed for \" + name + \" before \" + (responseListener.ack ? \"response\" : \"ack\")));\n                            if (responseListener.cancelled) return promise.reject(new Error(\"Response listener was cancelled for \" + name));\n                            ackTimeout = Math.max(ackTimeout - 500, 0);\n                            -1 !== resTimeout && (resTimeout = Math.max(resTimeout - 500, 0));\n                            return responseListener.ack || 0 !== ackTimeout ? 0 === resTimeout ? promise.reject(new Error(\"No response for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalResTimeout + \"ms\")) : void 0 : promise.reject(new Error(\"No ack for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalAckTimeout + \"ms\"));\n                        }), 500);\n                        promise.finally((function() {\n                            interval.cancel();\n                            reqPromises.splice(reqPromises.indexOf(promise, 1));\n                        })).catch(src_util_noop);\n                    }\n                    return send_sendMessage(win, domain, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_request\",\n                        hash: hash,\n                        name: name,\n                        data: data,\n                        fireAndForget: fireAndForget\n                    }, {\n                        on: on_on,\n                        send: send\n                    }).then((function() {\n                        return fireAndForget ? promise.resolve() : promise;\n                    }), (function(err) {\n                        throw new Error(\"Send request message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }));\n                }));\n            }));\n        };\n        function setup_toProxyWindow(win) {\n            return window_ProxyWindow.toProxyWindow(win, {\n                send: send_send\n            });\n        }\n        function src_util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function utils_getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function utils_getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return utils_getActualProtocol(win);\n        }\n        function utils_isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === utils_getProtocol(win);\n        }\n        function src_utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function utils_getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !src_utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function utils_canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = utils_getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = src_utils_getParent(win);\n                return parent && utils_canReadFromWindow() ? utils_getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function utils_getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = utils_getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function utils_isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === utils_getProtocol(win);\n                    }(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (utils_getActualDomain(win) === utils_getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                if (utils_getDomain(window) === utils_getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_assertSameDomain(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function utils_isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = src_utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function utils_getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function utils_getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = utils_getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = utils_getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function utils_getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (src_utils_getParent(win) === win) return win;\n            try {\n                if (utils_isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (utils_isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = utils_getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (src_utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function utils_getAllFramesInWindow(win) {\n            var top = utils_getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(utils_getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], utils_getAllChildFrames(win)));\n            return result;\n        }\n        var utils_iframeWindows = [];\n        var utils_iframeFrames = [];\n        function utils_isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || \"Call was rejected by callee.\\r\\n\" !== err.message;\n            }\n            if (allowMock && utils_isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(utils_iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = utils_iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function utils_getFrameByName(win, name) {\n            var winFrames = utils_getFrames(win);\n            for (var _i9 = 0; _i9 < winFrames.length; _i9++) {\n                var childFrame = winFrames[_i9];\n                try {\n                    if (utils_isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame;\n                } catch (err) {}\n            }\n            try {\n                if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name];\n            } catch (err) {}\n            try {\n                if (-1 !== winFrames.indexOf(win[name])) return win[name];\n            } catch (err) {}\n        }\n        function utils_getAncestor(win) {\n            void 0 === win && (win = window);\n            return utils_getOpener(win = win || window) || src_utils_getParent(win) || void 0;\n        }\n        function utils_anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function utils_getDistanceFromTop(win) {\n            void 0 === win && (win = window);\n            var distance = 0;\n            var parent = win;\n            for (;parent; ) (parent = src_utils_getParent(parent)) && (distance += 1);\n            return distance;\n        }\n        function utils_matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (src_util_isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return src_util_isRegex(pattern) ? src_util_isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !src_util_isRegex(origin) && pattern.some((function(subpattern) {\n                return utils_matchDomain(subpattern, origin);\n            })));\n        }\n        function utils_getDomainFromUrl(url) {\n            return url.match(/^(https?|mock|file):\\/\\//) ? url.split(\"/\").slice(0, 3).join(\"/\") : utils_getDomain();\n        }\n        function utils_onCloseWindow(win, callback, delay, maxtime) {\n            void 0 === delay && (delay = 1e3);\n            void 0 === maxtime && (maxtime = 1 / 0);\n            var timeout;\n            !function check() {\n                if (utils_isWindowClosed(win)) {\n                    timeout && clearTimeout(timeout);\n                    return callback();\n                }\n                if (maxtime <= 0) clearTimeout(timeout); else {\n                    maxtime -= delay;\n                    timeout = setTimeout(check, delay);\n                }\n            }();\n            return {\n                cancel: function() {\n                    timeout && clearTimeout(timeout);\n                }\n            };\n        }\n        function utils_isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function lib_global_getGlobal(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Can not get global for window on different domain\");\n            win.__zoid_9_0_87__ || (win.__zoid_9_0_87__ = {});\n            return win.__zoid_9_0_87__;\n        }\n        function tryGlobal(win, handler) {\n            try {\n                return handler(lib_global_getGlobal(win));\n            } catch (err) {}\n        }\n        function getProxyObject(obj) {\n            return {\n                get: function() {\n                    var _this = this;\n                    return promise_ZalgoPromise.try((function() {\n                        if (_this.source && _this.source !== window) throw new Error(\"Can not call get on proxy object from a remote window\");\n                        return obj;\n                    }));\n                }\n            };\n        }\n        function basicSerialize(data) {\n            return base64encode(JSON.stringify(data));\n        }\n        function getUIDRefStore(win) {\n            var global = lib_global_getGlobal(win);\n            global.references = global.references || {};\n            return global.references;\n        }\n        function crossDomainSerialize(_ref) {\n            var data = _ref.data, metaData = _ref.metaData, sender = _ref.sender, receiver = _ref.receiver, _ref$passByReference = _ref.passByReference, passByReference = void 0 !== _ref$passByReference && _ref$passByReference, _ref$basic = _ref.basic, basic = void 0 !== _ref$basic && _ref$basic;\n            var proxyWin = setup_toProxyWindow(receiver.win);\n            var serializedMessage = basic ? JSON.stringify(data) : serializeMessage(proxyWin, receiver.domain, data, {\n                on: on_on,\n                send: send_send\n            });\n            var reference = passByReference ? function(val) {\n                var uid = uniqueID();\n                getUIDRefStore(window)[uid] = val;\n                return {\n                    type: \"uid\",\n                    uid: uid\n                };\n            }(serializedMessage) : {\n                type: \"raw\",\n                val: serializedMessage\n            };\n            return {\n                serializedData: basicSerialize({\n                    sender: {\n                        domain: sender.domain\n                    },\n                    metaData: metaData,\n                    reference: reference\n                }),\n                cleanReference: function() {\n                    win = window, \"uid\" === (ref = reference).type && delete getUIDRefStore(win)[ref.uid];\n                    var win, ref;\n                }\n            };\n        }\n        function crossDomainDeserialize(_ref2) {\n            var sender = _ref2.sender, _ref2$basic = _ref2.basic, basic = void 0 !== _ref2$basic && _ref2$basic;\n            var message = function(serializedData) {\n                return JSON.parse(function(str) {\n                    if (\"function\" == typeof atob) return decodeURIComponent([].map.call(atob(str), (function(c) {\n                        return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\n                    })).join(\"\"));\n                    if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"base64\").toString(\"utf8\");\n                    throw new Error(\"Can not find window.atob or Buffer\");\n                }(serializedData));\n            }(_ref2.data);\n            var reference = message.reference, metaData = message.metaData;\n            var win;\n            win = \"function\" == typeof sender.win ? sender.win({\n                metaData: metaData\n            }) : sender.win;\n            var domain;\n            domain = \"function\" == typeof sender.domain ? sender.domain({\n                metaData: metaData\n            }) : \"string\" == typeof sender.domain ? sender.domain : message.sender.domain;\n            var serializedData = function(win, ref) {\n                if (\"raw\" === ref.type) return ref.val;\n                if (\"uid\" === ref.type) return getUIDRefStore(win)[ref.uid];\n                throw new Error(\"Unsupported ref type: \" + ref.type);\n            }(win, reference);\n            return {\n                data: basic ? JSON.parse(serializedData) : function(source, origin, message) {\n                    return deserializeMessage(source, origin, message, {\n                        on: on_on,\n                        send: send_send\n                    });\n                }(win, domain, serializedData),\n                metaData: metaData,\n                sender: {\n                    win: win,\n                    domain: domain\n                },\n                reference: reference\n            };\n        }\n        var PROP_TYPE = {\n            STRING: \"string\",\n            OBJECT: \"object\",\n            FUNCTION: \"function\",\n            BOOLEAN: \"boolean\",\n            NUMBER: \"number\",\n            ARRAY: \"array\"\n        };\n        var PROP_SERIALIZATION = {\n            JSON: \"json\",\n            DOTIFY: \"dotify\",\n            BASE64: \"base64\"\n        };\n        var CONTEXT = {\n            IFRAME: \"iframe\",\n            POPUP: \"popup\"\n        };\n        var EVENT = {\n            RENDER: \"zoid-render\",\n            RENDERED: \"zoid-rendered\",\n            DISPLAY: \"zoid-display\",\n            ERROR: \"zoid-error\",\n            CLOSE: \"zoid-close\",\n            DESTROY: \"zoid-destroy\",\n            PROPS: \"zoid-props\",\n            RESIZE: \"zoid-resize\",\n            FOCUS: \"zoid-focus\"\n        };\n        function buildChildWindowName(_ref) {\n            return \"__zoid__\" + _ref.name + \"__\" + _ref.serializedPayload + \"__\";\n        }\n        function parseWindowName(windowName) {\n            if (!windowName) throw new Error(\"No window name\");\n            var _windowName$split = windowName.split(\"__\"), zoidcomp = _windowName$split[1], name = _windowName$split[2], serializedInitialPayload = _windowName$split[3];\n            if (\"zoid\" !== zoidcomp) throw new Error(\"Window not rendered by zoid - got \" + zoidcomp);\n            if (!name) throw new Error(\"Expected component name\");\n            if (!serializedInitialPayload) throw new Error(\"Expected serialized payload ref\");\n            return {\n                name: name,\n                serializedInitialPayload: serializedInitialPayload\n            };\n        }\n        var parseInitialParentPayload = memoize((function(windowName) {\n            var _crossDomainDeseriali = crossDomainDeserialize({\n                data: parseWindowName(windowName).serializedInitialPayload,\n                sender: {\n                    win: function(_ref2) {\n                        return function(windowRef) {\n                            if (\"opener\" === windowRef.type) return assertExists(\"opener\", utils_getOpener(window));\n                            if (\"parent\" === windowRef.type && \"number\" == typeof windowRef.distance) return assertExists(\"parent\", function(win, n) {\n                                void 0 === n && (n = 1);\n                                return function(win, n) {\n                                    void 0 === n && (n = 1);\n                                    var parent = win;\n                                    for (var i = 0; i < n; i++) {\n                                        if (!parent) return;\n                                        parent = src_utils_getParent(parent);\n                                    }\n                                    return parent;\n                                }(win, utils_getDistanceFromTop(win) - n);\n                            }(window, windowRef.distance));\n                            if (\"global\" === windowRef.type && windowRef.uid && \"string\" == typeof windowRef.uid) {\n                                var _ret = function() {\n                                    var uid = windowRef.uid;\n                                    var ancestor = utils_getAncestor(window);\n                                    if (!ancestor) throw new Error(\"Can not find ancestor window\");\n                                    for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(ancestor); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                        var frame = _getAllFramesInWindow2[_i2];\n                                        if (utils_isSameDomain(frame)) {\n                                            var win = tryGlobal(frame, (function(global) {\n                                                return global.windows && global.windows[uid];\n                                            }));\n                                            if (win) return {\n                                                v: win\n                                            };\n                                        }\n                                    }\n                                }();\n                                if (\"object\" == typeof _ret) return _ret.v;\n                            } else if (\"name\" === windowRef.type) {\n                                var name = windowRef.name;\n                                return assertExists(\"namedWindow\", function(win, name) {\n                                    return utils_getFrameByName(win, name) || function utils_findChildFrameByName(win, name) {\n                                        var frame = utils_getFrameByName(win, name);\n                                        if (frame) return frame;\n                                        for (var _i11 = 0, _getFrames4 = utils_getFrames(win); _i11 < _getFrames4.length; _i11++) {\n                                            var namedFrame = utils_findChildFrameByName(_getFrames4[_i11], name);\n                                            if (namedFrame) return namedFrame;\n                                        }\n                                    }(utils_getTop(win) || win, name);\n                                }(assertExists(\"ancestor\", utils_getAncestor(window)), name));\n                            }\n                            throw new Error(\"Unable to find \" + windowRef.type + \" parent component window\");\n                        }(_ref2.metaData.windowRef);\n                    }\n                }\n            });\n            return {\n                parent: _crossDomainDeseriali.sender,\n                payload: _crossDomainDeseriali.data,\n                reference: _crossDomainDeseriali.reference\n            };\n        }));\n        function getInitialParentPayload() {\n            return parseInitialParentPayload(window.name);\n        }\n        function window_getWindowRef(targetWindow, currentWindow) {\n            void 0 === currentWindow && (currentWindow = window);\n            if (targetWindow === src_utils_getParent(currentWindow)) return {\n                type: \"parent\",\n                distance: utils_getDistanceFromTop(targetWindow)\n            };\n            if (targetWindow === utils_getOpener(currentWindow)) return {\n                type: \"opener\"\n            };\n            if (utils_isSameDomain(targetWindow) && !(win = targetWindow, win === utils_getTop(win))) {\n                var windowName = utils_assertSameDomain(targetWindow).name;\n                if (windowName) return {\n                    type: \"name\",\n                    name: windowName\n                };\n            }\n            var win;\n        }\n        function normalizeChildProp(propsDef, props, key, value, helpers) {\n            if (!propsDef.hasOwnProperty(key)) return value;\n            var prop = propsDef[key];\n            return \"function\" == typeof prop.childDecorate ? prop.childDecorate({\n                value: value,\n                uid: helpers.uid,\n                tag: helpers.tag,\n                close: helpers.close,\n                focus: helpers.focus,\n                onError: helpers.onError,\n                onProps: helpers.onProps,\n                resize: helpers.resize,\n                getParent: helpers.getParent,\n                getParentDomain: helpers.getParentDomain,\n                show: helpers.show,\n                hide: helpers.hide,\n                export: helpers.export,\n                getSiblings: helpers.getSiblings\n            }) : value;\n        }\n        function child_focus() {\n            return promise_ZalgoPromise.try((function() {\n                window.focus();\n            }));\n        }\n        function child_destroy() {\n            return promise_ZalgoPromise.try((function() {\n                window.close();\n            }));\n        }\n        var props_defaultNoop = function() {\n            return src_util_noop;\n        };\n        var props_decorateOnce = function(_ref) {\n            return once(_ref.value);\n        };\n        function eachProp(props, propsDef, handler) {\n            for (var _i2 = 0, _Object$keys2 = Object.keys(_extends({}, props, propsDef)); _i2 < _Object$keys2.length; _i2++) {\n                var key = _Object$keys2[_i2];\n                handler(key, propsDef[key], props[key]);\n            }\n        }\n        function serializeProps(propsDef, props, method) {\n            var params = {};\n            return promise_ZalgoPromise.all(function(props, propsDef, handler) {\n                var results = [];\n                eachProp(props, propsDef, (function(key, propDef, value) {\n                    var result = function(key, propDef, value) {\n                        return promise_ZalgoPromise.resolve().then((function() {\n                            var _METHOD$GET$METHOD$PO, _METHOD$GET$METHOD$PO2;\n                            if (null != value && propDef) {\n                                var getParam = (_METHOD$GET$METHOD$PO = {}, _METHOD$GET$METHOD$PO.get = propDef.queryParam, \n                                _METHOD$GET$METHOD$PO.post = propDef.bodyParam, _METHOD$GET$METHOD$PO)[method];\n                                var getValue = (_METHOD$GET$METHOD$PO2 = {}, _METHOD$GET$METHOD$PO2.get = propDef.queryValue, \n                                _METHOD$GET$METHOD$PO2.post = propDef.bodyValue, _METHOD$GET$METHOD$PO2)[method];\n                                if (getParam) return promise_ZalgoPromise.hash({\n                                    finalParam: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getParam ? getParam({\n                                            value: value\n                                        }) : \"string\" == typeof getParam ? getParam : key;\n                                    })),\n                                    finalValue: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getValue && isDefined(value) ? getValue({\n                                            value: value\n                                        }) : value;\n                                    }))\n                                }).then((function(_ref) {\n                                    var finalParam = _ref.finalParam, finalValue = _ref.finalValue;\n                                    var result;\n                                    if (\"boolean\" == typeof finalValue) result = finalValue.toString(); else if (\"string\" == typeof finalValue) result = finalValue.toString(); else if (\"object\" == typeof finalValue && null !== finalValue) {\n                                        if (propDef.serialization === PROP_SERIALIZATION.JSON) result = JSON.stringify(finalValue); else if (propDef.serialization === PROP_SERIALIZATION.BASE64) result = base64encode(JSON.stringify(finalValue)); else if (propDef.serialization === PROP_SERIALIZATION.DOTIFY || !propDef.serialization) {\n                                            result = function dotify(obj, prefix, newobj) {\n                                                void 0 === prefix && (prefix = \"\");\n                                                void 0 === newobj && (newobj = {});\n                                                prefix = prefix ? prefix + \".\" : prefix;\n                                                for (var key in obj) obj.hasOwnProperty(key) && null != obj[key] && \"function\" != typeof obj[key] && (obj[key] && Array.isArray(obj[key]) && obj[key].length && obj[key].every((function(val) {\n                                                    return \"object\" != typeof val;\n                                                })) ? newobj[\"\" + prefix + key + \"[]\"] = obj[key].join(\",\") : obj[key] && \"object\" == typeof obj[key] ? newobj = dotify(obj[key], \"\" + prefix + key, newobj) : newobj[\"\" + prefix + key] = obj[key].toString());\n                                                return newobj;\n                                            }(finalValue, key);\n                                            for (var _i2 = 0, _Object$keys2 = Object.keys(result); _i2 < _Object$keys2.length; _i2++) {\n                                                var dotkey = _Object$keys2[_i2];\n                                                params[dotkey] = result[dotkey];\n                                            }\n                                            return;\n                                        }\n                                    } else \"number\" == typeof finalValue && (result = finalValue.toString());\n                                    params[finalParam] = result;\n                                }));\n                            }\n                        }));\n                    }(key, propDef, value);\n                    results.push(result);\n                }));\n                return results;\n            }(props, propsDef)).then((function() {\n                return params;\n            }));\n        }\n        function parentComponent(_ref) {\n            var uid = _ref.uid, options = _ref.options, _ref$overrides = _ref.overrides, overrides = void 0 === _ref$overrides ? {} : _ref$overrides, _ref$parentWin = _ref.parentWin, parentWin = void 0 === _ref$parentWin ? window : _ref$parentWin;\n            var propsDef = options.propsDef, containerTemplate = options.containerTemplate, prerenderTemplate = options.prerenderTemplate, tag = options.tag, name = options.name, attributes = options.attributes, dimensions = options.dimensions, autoResize = options.autoResize, url = options.url, domainMatch = options.domain, xports = options.exports;\n            var initPromise = new promise_ZalgoPromise;\n            var handledErrors = [];\n            var clean = cleanup();\n            var state = {};\n            var inputProps = {};\n            var internalState = {\n                visible: !0\n            };\n            var event = overrides.event ? overrides.event : (triggered = {}, handlers = {}, \n            emitter = {\n                on: function(eventName, handler) {\n                    var handlerList = handlers[eventName] = handlers[eventName] || [];\n                    handlerList.push(handler);\n                    var cancelled = !1;\n                    return {\n                        cancel: function() {\n                            if (!cancelled) {\n                                cancelled = !0;\n                                handlerList.splice(handlerList.indexOf(handler), 1);\n                            }\n                        }\n                    };\n                },\n                once: function(eventName, handler) {\n                    var listener = emitter.on(eventName, (function() {\n                        listener.cancel();\n                        handler();\n                    }));\n                    return listener;\n                },\n                trigger: function(eventName) {\n                    for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n                    var handlerList = handlers[eventName];\n                    var promises = [];\n                    if (handlerList) {\n                        var _loop = function(_i2) {\n                            var handler = handlerList[_i2];\n                            promises.push(promise_ZalgoPromise.try((function() {\n                                return handler.apply(void 0, args);\n                            })));\n                        };\n                        for (var _i2 = 0; _i2 < handlerList.length; _i2++) _loop(_i2);\n                    }\n                    return promise_ZalgoPromise.all(promises).then(src_util_noop);\n                },\n                triggerOnce: function(eventName) {\n                    if (triggered[eventName]) return promise_ZalgoPromise.resolve();\n                    triggered[eventName] = !0;\n                    for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];\n                    return emitter.trigger.apply(emitter, [ eventName ].concat(args));\n                },\n                reset: function() {\n                    handlers = {};\n                }\n            });\n            var triggered, handlers, emitter;\n            var props = overrides.props ? overrides.props : {};\n            var currentProxyWin;\n            var currentProxyContainer;\n            var childComponent;\n            var currentChildDomain;\n            var currentContainer;\n            var onErrorOverride = overrides.onError;\n            var getProxyContainerOverride = overrides.getProxyContainer;\n            var showOverride = overrides.show;\n            var hideOverride = overrides.hide;\n            var closeOverride = overrides.close;\n            var renderContainerOverride = overrides.renderContainer;\n            var getProxyWindowOverride = overrides.getProxyWindow;\n            var setProxyWinOverride = overrides.setProxyWin;\n            var openFrameOverride = overrides.openFrame;\n            var openPrerenderFrameOverride = overrides.openPrerenderFrame;\n            var prerenderOverride = overrides.prerender;\n            var openOverride = overrides.open;\n            var openPrerenderOverride = overrides.openPrerender;\n            var watchForUnloadOverride = overrides.watchForUnload;\n            var getInternalStateOverride = overrides.getInternalState;\n            var setInternalStateOverride = overrides.setInternalState;\n            var resolveInitPromise = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.resolveInitPromise ? overrides.resolveInitPromise() : initPromise.resolve();\n                }));\n            };\n            var rejectInitPromise = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.rejectInitPromise ? overrides.rejectInitPromise(err) : initPromise.reject(err);\n                }));\n            };\n            var getPropsForChild = function(initialChildDomain) {\n                var result = {};\n                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                    var key = _Object$keys2[_i2];\n                    var prop = propsDef[key];\n                    prop && !1 === prop.sendToChild || prop && prop.sameDomain && !utils_matchDomain(initialChildDomain, utils_getDomain(window)) || (result[key] = props[key]);\n                }\n                return promise_ZalgoPromise.hash(result);\n            };\n            var getInternalState = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return getInternalStateOverride ? getInternalStateOverride() : internalState;\n                }));\n            };\n            var setInternalState = function(newInternalState) {\n                return promise_ZalgoPromise.try((function() {\n                    return setInternalStateOverride ? setInternalStateOverride(newInternalState) : internalState = _extends({}, internalState, newInternalState);\n                }));\n            };\n            var getProxyWindow = function() {\n                return getProxyWindowOverride ? getProxyWindowOverride() : promise_ZalgoPromise.try((function() {\n                    var windowProp = props.window;\n                    if (windowProp) {\n                        var _proxyWin = setup_toProxyWindow(windowProp);\n                        clean.register((function() {\n                            return windowProp.close();\n                        }));\n                        return _proxyWin;\n                    }\n                    return new window_ProxyWindow({\n                        send: send_send\n                    });\n                }));\n            };\n            var setProxyWin = function(proxyWin) {\n                return setProxyWinOverride ? setProxyWinOverride(proxyWin) : promise_ZalgoPromise.try((function() {\n                    currentProxyWin = proxyWin;\n                }));\n            };\n            var show = function() {\n                return showOverride ? showOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !0\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(showElement) : null\n                }).then(src_util_noop);\n            };\n            var hide = function() {\n                return hideOverride ? hideOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !1\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(hideElement) : null\n                }).then(src_util_noop);\n            };\n            var getUrl = function() {\n                return \"function\" == typeof url ? url({\n                    props: props\n                }) : url;\n            };\n            var getAttributes = function() {\n                return \"function\" == typeof attributes ? attributes({\n                    props: props\n                }) : attributes;\n            };\n            var getInitialChildDomain = function() {\n                return utils_getDomainFromUrl(getUrl());\n            };\n            var openFrame = function(context, _ref2) {\n                var windowName = _ref2.windowName;\n                return openFrameOverride ? openFrameOverride(context, {\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: windowName,\n                            title: name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerenderFrame = function(context) {\n                return openPrerenderFrameOverride ? openPrerenderFrameOverride(context) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: \"__zoid_prerender_frame__\" + name + \"_\" + uniqueID() + \"__\",\n                            title: \"prerender__\" + name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerender = function(context, proxyWin, proxyPrerenderFrame) {\n                return openPrerenderOverride ? openPrerenderOverride(context, proxyWin, proxyPrerenderFrame) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyPrerenderFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyPrerenderFrame.get().then((function(prerenderFrame) {\n                            clean.register((function() {\n                                return destroyElement(prerenderFrame);\n                            }));\n                            return awaitFrameWindow(prerenderFrame).then((function(prerenderFrameWindow) {\n                                return utils_assertSameDomain(prerenderFrameWindow);\n                            })).then((function(win) {\n                                return setup_toProxyWindow(win);\n                            }));\n                        }));\n                    }\n                    throw new Error(\"No render context available for \" + context);\n                }));\n            };\n            var focus = function() {\n                return promise_ZalgoPromise.try((function() {\n                    if (currentProxyWin) return promise_ZalgoPromise.all([ event.trigger(EVENT.FOCUS), currentProxyWin.focus() ]).then(src_util_noop);\n                }));\n            };\n            var getCurrentWindowReferenceUID = function() {\n                var global = lib_global_getGlobal(window);\n                global.windows = global.windows || {};\n                global.windows[uid] = window;\n                clean.register((function() {\n                    delete global.windows[uid];\n                }));\n                return uid;\n            };\n            var getWindowRef = function(target, initialChildDomain, context, proxyWin) {\n                if (initialChildDomain === utils_getDomain(window)) return {\n                    type: \"global\",\n                    uid: getCurrentWindowReferenceUID()\n                };\n                if (target !== window) throw new Error(\"Can not construct cross-domain window reference for different target window\");\n                if (props.window) {\n                    var actualComponentWindow = proxyWin.getWindow();\n                    if (!actualComponentWindow) throw new Error(\"Can not construct cross-domain window reference for lazy window prop\");\n                    if (utils_getAncestor(actualComponentWindow) !== window) throw new Error(\"Can not construct cross-domain window reference for window prop with different ancestor\");\n                }\n                if (context === CONTEXT.POPUP) return {\n                    type: \"opener\"\n                };\n                if (context === CONTEXT.IFRAME) return {\n                    type: \"parent\",\n                    distance: utils_getDistanceFromTop(window)\n                };\n                throw new Error(\"Can not construct window reference for child\");\n            };\n            var initChild = function(childDomain, childExports) {\n                return promise_ZalgoPromise.try((function() {\n                    currentChildDomain = childDomain;\n                    childComponent = childExports;\n                    resolveInitPromise();\n                    clean.register((function() {\n                        return childExports.close.fireAndForget().catch(src_util_noop);\n                    }));\n                }));\n            };\n            var resize = function(_ref3) {\n                var width = _ref3.width, height = _ref3.height;\n                return promise_ZalgoPromise.try((function() {\n                    event.trigger(EVENT.RESIZE, {\n                        width: width,\n                        height: height\n                    });\n                }));\n            };\n            var destroy = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return event.trigger(EVENT.DESTROY);\n                })).catch(src_util_noop).then((function() {\n                    return clean.all(err);\n                })).then((function() {\n                    initPromise.asyncReject(err || new Error(\"Component destroyed\"));\n                }));\n            };\n            var close = memoize((function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    if (closeOverride) {\n                        if (utils_isWindowClosed(closeOverride.__source__)) return;\n                        return closeOverride();\n                    }\n                    return promise_ZalgoPromise.try((function() {\n                        return event.trigger(EVENT.CLOSE);\n                    })).then((function() {\n                        return destroy(err || new Error(\"Component closed\"));\n                    }));\n                }));\n            }));\n            var open = function(context, _ref4) {\n                var proxyWin = _ref4.proxyWin, proxyFrame = _ref4.proxyFrame, windowName = _ref4.windowName;\n                return openOverride ? openOverride(context, {\n                    proxyWin: proxyWin,\n                    proxyFrame: proxyFrame,\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyFrame.get().then((function(frame) {\n                            return awaitFrameWindow(frame).then((function(win) {\n                                clean.register((function() {\n                                    return destroyElement(frame);\n                                }));\n                                clean.register((function() {\n                                    return function(win) {\n                                        for (var _i2 = 0, _requestPromises$get2 = windowStore(\"requestPromises\").get(win, []); _i2 < _requestPromises$get2.length; _i2++) _requestPromises$get2[_i2].reject(new Error(\"Window \" + (isWindowClosed(win) ? \"closed\" : \"cleaned up\") + \" before response\")).catch(src_util_noop);\n                                    }(win);\n                                }));\n                                return win;\n                            }));\n                        }));\n                    }\n                    throw new Error(\"No render context available for \" + context);\n                })).then((function(win) {\n                    proxyWin.setWindow(win, {\n                        send: send_send\n                    });\n                    return proxyWin.setName(windowName).then((function() {\n                        return proxyWin;\n                    }));\n                }));\n            };\n            var watchForUnload = function() {\n                return promise_ZalgoPromise.try((function() {\n                    var unloadWindowListener = addEventListener(window, \"unload\", once((function() {\n                        destroy(new Error(\"Window navigated away\"));\n                    })));\n                    var closeParentWindowListener = utils_onCloseWindow(parentWin, destroy, 3e3);\n                    clean.register(closeParentWindowListener.cancel);\n                    clean.register(unloadWindowListener.cancel);\n                    if (watchForUnloadOverride) return watchForUnloadOverride();\n                }));\n            };\n            var checkWindowClose = function(proxyWin) {\n                var closed = !1;\n                return proxyWin.isClosed().then((function(isClosed) {\n                    if (isClosed) {\n                        closed = !0;\n                        return close(new Error(\"Detected component window close\"));\n                    }\n                    return promise_ZalgoPromise.delay(200).then((function() {\n                        return proxyWin.isClosed();\n                    })).then((function(secondIsClosed) {\n                        if (secondIsClosed) {\n                            closed = !0;\n                            return close(new Error(\"Detected component window close\"));\n                        }\n                    }));\n                })).then((function() {\n                    return closed;\n                }));\n            };\n            var onError = function(err) {\n                return onErrorOverride ? onErrorOverride(err) : promise_ZalgoPromise.try((function() {\n                    if (-1 === handledErrors.indexOf(err)) {\n                        handledErrors.push(err);\n                        initPromise.asyncReject(err);\n                        return event.trigger(EVENT.ERROR, err);\n                    }\n                }));\n            };\n            var exportsPromise = new promise_ZalgoPromise;\n            var xport = function(actualExports) {\n                return promise_ZalgoPromise.try((function() {\n                    exportsPromise.resolve(actualExports);\n                }));\n            };\n            initChild.onError = onError;\n            var renderTemplate = function(renderer, _ref8) {\n                return renderer({\n                    uid: uid,\n                    container: _ref8.container,\n                    context: _ref8.context,\n                    doc: _ref8.doc,\n                    frame: _ref8.frame,\n                    prerenderFrame: _ref8.prerenderFrame,\n                    focus: focus,\n                    close: close,\n                    state: state,\n                    props: props,\n                    tag: tag,\n                    dimensions: \"function\" == typeof dimensions ? dimensions({\n                        props: props\n                    }) : dimensions,\n                    event: event\n                });\n            };\n            var prerender = function(proxyPrerenderWin, _ref9) {\n                var context = _ref9.context;\n                return prerenderOverride ? prerenderOverride(proxyPrerenderWin, {\n                    context: context\n                }) : promise_ZalgoPromise.try((function() {\n                    if (prerenderTemplate) {\n                        var prerenderWindow = proxyPrerenderWin.getWindow();\n                        if (prerenderWindow && utils_isSameDomain(prerenderWindow) && function(win) {\n                            try {\n                                if (!win.location.href) return !0;\n                                if (\"about:blank\" === win.location.href) return !0;\n                            } catch (err) {}\n                            return !1;\n                        }(prerenderWindow)) {\n                            var doc = (prerenderWindow = utils_assertSameDomain(prerenderWindow)).document;\n                            var el = renderTemplate(prerenderTemplate, {\n                                context: context,\n                                doc: doc\n                            });\n                            if (el) {\n                                if (el.ownerDocument !== doc) throw new Error(\"Expected prerender template to have been created with document from child window\");\n                                !function(win, el) {\n                                    var tag = el.tagName.toLowerCase();\n                                    if (\"html\" !== tag) throw new Error(\"Expected element to be html, got \" + tag);\n                                    var documentElement = win.document.documentElement;\n                                    for (var _i6 = 0, _arrayFrom2 = arrayFrom(documentElement.children); _i6 < _arrayFrom2.length; _i6++) documentElement.removeChild(_arrayFrom2[_i6]);\n                                    for (var _i8 = 0, _arrayFrom4 = arrayFrom(el.children); _i8 < _arrayFrom4.length; _i8++) documentElement.appendChild(_arrayFrom4[_i8]);\n                                }(prerenderWindow, el);\n                                var _autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, _autoResize$element = autoResize.element, element = void 0 === _autoResize$element ? \"body\" : _autoResize$element;\n                                if ((element = getElementSafe(element, doc)) && (width || height)) {\n                                    var prerenderResizeListener = onResize(element, (function(_ref10) {\n                                        resize({\n                                            width: width ? _ref10.width : void 0,\n                                            height: height ? _ref10.height : void 0\n                                        });\n                                    }), {\n                                        width: width,\n                                        height: height,\n                                        win: prerenderWindow\n                                    });\n                                    event.on(EVENT.RENDERED, prerenderResizeListener.cancel);\n                                }\n                            }\n                        }\n                    }\n                }));\n            };\n            var renderContainer = function(proxyContainer, _ref11) {\n                var proxyFrame = _ref11.proxyFrame, proxyPrerenderFrame = _ref11.proxyPrerenderFrame, context = _ref11.context, rerender = _ref11.rerender;\n                return renderContainerOverride ? renderContainerOverride(proxyContainer, {\n                    proxyFrame: proxyFrame,\n                    proxyPrerenderFrame: proxyPrerenderFrame,\n                    context: context,\n                    rerender: rerender\n                }) : promise_ZalgoPromise.hash({\n                    container: proxyContainer.get(),\n                    frame: proxyFrame ? proxyFrame.get() : null,\n                    prerenderFrame: proxyPrerenderFrame ? proxyPrerenderFrame.get() : null,\n                    internalState: getInternalState()\n                }).then((function(_ref12) {\n                    var container = _ref12.container, visible = _ref12.internalState.visible;\n                    var innerContainer = renderTemplate(containerTemplate, {\n                        context: context,\n                        container: container,\n                        frame: _ref12.frame,\n                        prerenderFrame: _ref12.prerenderFrame,\n                        doc: document\n                    });\n                    if (innerContainer) {\n                        visible || hideElement(innerContainer);\n                        appendChild(container, innerContainer);\n                        var containerWatcher = function(element, handler) {\n                            handler = once(handler);\n                            var cancelled = !1;\n                            var mutationObservers = [];\n                            var interval;\n                            var sacrificialFrame;\n                            var sacrificialFrameWin;\n                            var cancel = function() {\n                                cancelled = !0;\n                                for (var _i18 = 0; _i18 < mutationObservers.length; _i18++) mutationObservers[_i18].disconnect();\n                                interval && interval.cancel();\n                                sacrificialFrameWin && sacrificialFrameWin.removeEventListener(\"unload\", elementClosed);\n                                sacrificialFrame && destroyElement(sacrificialFrame);\n                            };\n                            var elementClosed = function() {\n                                if (!cancelled) {\n                                    handler();\n                                    cancel();\n                                }\n                            };\n                            if (isElementClosed(element)) {\n                                elementClosed();\n                                return {\n                                    cancel: cancel\n                                };\n                            }\n                            if (window.MutationObserver) {\n                                var mutationElement = element.parentElement;\n                                for (;mutationElement; ) {\n                                    var mutationObserver = new window.MutationObserver((function() {\n                                        isElementClosed(element) && elementClosed();\n                                    }));\n                                    mutationObserver.observe(mutationElement, {\n                                        childList: !0\n                                    });\n                                    mutationObservers.push(mutationObserver);\n                                    mutationElement = mutationElement.parentElement;\n                                }\n                            }\n                            (sacrificialFrame = document.createElement(\"iframe\")).setAttribute(\"name\", \"__detect_close_\" + uniqueID() + \"__\");\n                            sacrificialFrame.style.display = \"none\";\n                            awaitFrameWindow(sacrificialFrame).then((function(frameWin) {\n                                (sacrificialFrameWin = assertSameDomain(frameWin)).addEventListener(\"unload\", elementClosed);\n                            }));\n                            element.appendChild(sacrificialFrame);\n                            interval = safeInterval((function() {\n                                isElementClosed(element) && elementClosed();\n                            }), 1e3);\n                            return {\n                                cancel: cancel\n                            };\n                        }(innerContainer, (function() {\n                            var removeError = new Error(\"Detected container element removed from DOM\");\n                            return promise_ZalgoPromise.delay(1).then((function() {\n                                if (!isElementClosed(innerContainer)) {\n                                    clean.all(removeError);\n                                    return rerender().then(resolveInitPromise, rejectInitPromise);\n                                }\n                                close(removeError);\n                            }));\n                        }));\n                        clean.register((function() {\n                            return containerWatcher.cancel();\n                        }));\n                        clean.register((function() {\n                            return destroyElement(innerContainer);\n                        }));\n                        return currentProxyContainer = getProxyObject(innerContainer);\n                    }\n                }));\n            };\n            var getHelpers = function() {\n                return {\n                    state: state,\n                    event: event,\n                    close: close,\n                    focus: focus,\n                    resize: resize,\n                    onError: onError,\n                    updateProps: updateProps,\n                    show: show,\n                    hide: hide\n                };\n            };\n            var setProps = function(newInputProps) {\n                void 0 === newInputProps && (newInputProps = {});\n                var container = currentContainer;\n                var helpers = getHelpers();\n                extend(inputProps, newInputProps);\n                !function(propsDef, existingProps, inputProps, helpers, container) {\n                    var state = helpers.state, close = helpers.close, focus = helpers.focus, event = helpers.event, onError = helpers.onError;\n                    eachProp(inputProps, propsDef, (function(key, propDef, val) {\n                        var valueDetermined = !1;\n                        var value = val;\n                        Object.defineProperty(existingProps, key, {\n                            configurable: !0,\n                            enumerable: !0,\n                            get: function() {\n                                if (valueDetermined) return value;\n                                valueDetermined = !0;\n                                return function() {\n                                    if (!propDef) return value;\n                                    var alias = propDef.alias;\n                                    alias && !isDefined(val) && isDefined(inputProps[alias]) && (value = inputProps[alias]);\n                                    propDef.value && (value = propDef.value({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    !propDef.default || isDefined(value) || isDefined(inputProps[key]) || (value = propDef.default({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    if (isDefined(value)) {\n                                        if (propDef.type === PROP_TYPE.ARRAY ? !Array.isArray(value) : typeof value !== propDef.type) throw new TypeError(\"Prop is not of type \" + propDef.type + \": \" + key);\n                                    } else if (!1 !== propDef.required && !isDefined(inputProps[key])) throw new Error('Expected prop \"' + key + '\" to be defined');\n                                    isDefined(value) && propDef.decorate && (value = propDef.decorate({\n                                        value: value,\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    return value;\n                                }();\n                            }\n                        });\n                    }));\n                    eachProp(existingProps, propsDef, src_util_noop);\n                }(propsDef, props, inputProps, helpers, container);\n            };\n            var updateProps = function(newProps) {\n                setProps(newProps);\n                return initPromise.then((function() {\n                    var child = childComponent;\n                    var proxyWin = currentProxyWin;\n                    if (child && proxyWin && currentChildDomain) return getPropsForChild(currentChildDomain).then((function(childProps) {\n                        return child.updateProps(childProps).catch((function(err) {\n                            return checkWindowClose(proxyWin).then((function(closed) {\n                                if (!closed) throw err;\n                            }));\n                        }));\n                    }));\n                }));\n            };\n            var getProxyContainer = function(container) {\n                return getProxyContainerOverride ? getProxyContainerOverride(container) : promise_ZalgoPromise.try((function() {\n                    return elementReady(container);\n                })).then((function(containerElement) {\n                    isShadowElement(containerElement) && (containerElement = function insertShadowSlot(element) {\n                        var shadowHost = function(element) {\n                            var shadowRoot = function(element) {\n                                for (;element.parentNode; ) element = element.parentNode;\n                                if (isShadowElement(element)) return element;\n                            }(element);\n                            if (shadowRoot && shadowRoot.host) return shadowRoot.host;\n                        }(element);\n                        if (!shadowHost) throw new Error(\"Element is not in shadow dom\");\n                        var slotName = \"shadow-slot-\" + uniqueID();\n                        var slot = document.createElement(\"slot\");\n                        slot.setAttribute(\"name\", slotName);\n                        element.appendChild(slot);\n                        var slotProvider = document.createElement(\"div\");\n                        slotProvider.setAttribute(\"slot\", slotName);\n                        shadowHost.appendChild(slotProvider);\n                        return isShadowElement(shadowHost) ? insertShadowSlot(slotProvider) : slotProvider;\n                    }(containerElement));\n                    currentContainer = containerElement;\n                    return getProxyObject(containerElement);\n                }));\n            };\n            return {\n                init: function() {\n                    !function() {\n                        event.on(EVENT.RENDER, (function() {\n                            return props.onRender();\n                        }));\n                        event.on(EVENT.DISPLAY, (function() {\n                            return props.onDisplay();\n                        }));\n                        event.on(EVENT.RENDERED, (function() {\n                            return props.onRendered();\n                        }));\n                        event.on(EVENT.CLOSE, (function() {\n                            return props.onClose();\n                        }));\n                        event.on(EVENT.DESTROY, (function() {\n                            return props.onDestroy();\n                        }));\n                        event.on(EVENT.RESIZE, (function() {\n                            return props.onResize();\n                        }));\n                        event.on(EVENT.FOCUS, (function() {\n                            return props.onFocus();\n                        }));\n                        event.on(EVENT.PROPS, (function(newProps) {\n                            return props.onProps(newProps);\n                        }));\n                        event.on(EVENT.ERROR, (function(err) {\n                            return props && props.onError ? props.onError(err) : rejectInitPromise(err).then((function() {\n                                setTimeout((function() {\n                                    throw err;\n                                }), 1);\n                            }));\n                        }));\n                        clean.register(event.reset);\n                    }();\n                },\n                render: function(_ref14) {\n                    var target = _ref14.target, container = _ref14.container, context = _ref14.context, rerender = _ref14.rerender;\n                    return promise_ZalgoPromise.try((function() {\n                        var initialChildDomain = getInitialChildDomain();\n                        var childDomainMatch = domainMatch || getInitialChildDomain();\n                        !function(target, childDomainMatch, container) {\n                            if (target !== window) {\n                                if (!function(win1, win2) {\n                                    var top1 = utils_getTop(win1) || win1;\n                                    var top2 = utils_getTop(win2) || win2;\n                                    try {\n                                        if (top1 && top2) return top1 === top2;\n                                    } catch (err) {}\n                                    var allFrames1 = utils_getAllFramesInWindow(win1);\n                                    var allFrames2 = utils_getAllFramesInWindow(win2);\n                                    if (utils_anyMatch(allFrames1, allFrames2)) return !0;\n                                    var opener1 = utils_getOpener(top1);\n                                    var opener2 = utils_getOpener(top2);\n                                    return opener1 && utils_anyMatch(utils_getAllFramesInWindow(opener1), allFrames2) || opener2 && utils_anyMatch(utils_getAllFramesInWindow(opener2), allFrames1), \n                                    !1;\n                                }(window, target)) throw new Error(\"Can only renderTo an adjacent frame\");\n                                var origin = utils_getDomain();\n                                if (!utils_matchDomain(childDomainMatch, origin) && !utils_isSameDomain(target)) throw new Error(\"Can not render remotely to \" + childDomainMatch.toString() + \" - can only render to \" + origin);\n                                if (container && \"string\" != typeof container) throw new Error(\"Container passed to renderTo must be a string selector, got \" + typeof container + \" }\");\n                            }\n                        }(target, childDomainMatch, container);\n                        var delegatePromise = promise_ZalgoPromise.try((function() {\n                            if (target !== window) return function(context, target) {\n                                var delegateProps = {};\n                                for (var _i4 = 0, _Object$keys4 = Object.keys(props); _i4 < _Object$keys4.length; _i4++) {\n                                    var propName = _Object$keys4[_i4];\n                                    var propDef = propsDef[propName];\n                                    propDef && propDef.allowDelegate && (delegateProps[propName] = props[propName]);\n                                }\n                                var childOverridesPromise = send_send(target, \"zoid_delegate_\" + name, {\n                                    uid: uid,\n                                    overrides: {\n                                        props: delegateProps,\n                                        event: event,\n                                        close: close,\n                                        onError: onError,\n                                        getInternalState: getInternalState,\n                                        setInternalState: setInternalState,\n                                        resolveInitPromise: resolveInitPromise,\n                                        rejectInitPromise: rejectInitPromise\n                                    }\n                                }).then((function(_ref13) {\n                                    var parentComp = _ref13.data.parent;\n                                    clean.register((function(err) {\n                                        if (!utils_isWindowClosed(target)) return parentComp.destroy(err);\n                                    }));\n                                    return parentComp.getDelegateOverrides();\n                                })).catch((function(err) {\n                                    throw new Error(\"Unable to delegate rendering. Possibly the component is not loaded in the target window.\\n\\n\" + stringifyError(err));\n                                }));\n                                getProxyContainerOverride = function() {\n                                    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.getProxyContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                renderContainerOverride = function() {\n                                    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.renderContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                showOverride = function() {\n                                    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.show.apply(childOverrides, args);\n                                    }));\n                                };\n                                hideOverride = function() {\n                                    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.hide.apply(childOverrides, args);\n                                    }));\n                                };\n                                watchForUnloadOverride = function() {\n                                    for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) args[_key5] = arguments[_key5];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.watchForUnload.apply(childOverrides, args);\n                                    }));\n                                };\n                                if (context === CONTEXT.IFRAME) {\n                                    getProxyWindowOverride = function() {\n                                        for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) args[_key6] = arguments[_key6];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.getProxyWindow.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openFrameOverride = function() {\n                                        for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) args[_key7] = arguments[_key7];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderFrameOverride = function() {\n                                        for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) args[_key8] = arguments[_key8];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerenderFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    prerenderOverride = function() {\n                                        for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) args[_key9] = arguments[_key9];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.prerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openOverride = function() {\n                                        for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) args[_key10] = arguments[_key10];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.open.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderOverride = function() {\n                                        for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) args[_key11] = arguments[_key11];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                }\n                                return childOverridesPromise;\n                            }(context, target);\n                        }));\n                        var windowProp = props.window;\n                        var watchForUnloadPromise = watchForUnload();\n                        var buildBodyPromise = serializeProps(propsDef, props, \"post\");\n                        var onRenderPromise = event.trigger(EVENT.RENDER);\n                        var getProxyContainerPromise = getProxyContainer(container);\n                        var getProxyWindowPromise = getProxyWindow();\n                        var finalSetPropsPromise = getProxyContainerPromise.then((function() {\n                            return setProps();\n                        }));\n                        var buildUrlPromise = finalSetPropsPromise.then((function() {\n                            return serializeProps(propsDef, props, \"get\").then((function(query) {\n                                return function(url, options) {\n                                    var query = options.query || {};\n                                    var hash = options.hash || {};\n                                    var originalUrl;\n                                    var originalHash;\n                                    var _url$split = url.split(\"#\");\n                                    originalHash = _url$split[1];\n                                    var _originalUrl$split = (originalUrl = _url$split[0]).split(\"?\");\n                                    originalUrl = _originalUrl$split[0];\n                                    var queryString = extendQuery(_originalUrl$split[1], query);\n                                    var hashString = extendQuery(originalHash, hash);\n                                    queryString && (originalUrl = originalUrl + \"?\" + queryString);\n                                    hashString && (originalUrl = originalUrl + \"#\" + hashString);\n                                    return originalUrl;\n                                }(function(url) {\n                                    if (!(domain = utils_getDomainFromUrl(url), 0 === domain.indexOf(\"mock:\"))) return url;\n                                    var domain;\n                                    throw new Error(\"Mock urls not supported out of test mode\");\n                                }(getUrl()), {\n                                    query: query\n                                });\n                            }));\n                        }));\n                        var buildWindowNamePromise = getProxyWindowPromise.then((function(proxyWin) {\n                            return function(_temp2) {\n                                var _ref6 = void 0 === _temp2 ? {} : _temp2, proxyWin = _ref6.proxyWin, initialChildDomain = _ref6.initialChildDomain, childDomainMatch = _ref6.childDomainMatch, _ref6$target = _ref6.target, target = void 0 === _ref6$target ? window : _ref6$target, context = _ref6.context;\n                                return function(_temp) {\n                                    var _ref5 = void 0 === _temp ? {} : _temp, proxyWin = _ref5.proxyWin, childDomainMatch = _ref5.childDomainMatch, context = _ref5.context;\n                                    return getPropsForChild(_ref5.initialChildDomain).then((function(childProps) {\n                                        return {\n                                            uid: uid,\n                                            context: context,\n                                            tag: tag,\n                                            childDomainMatch: childDomainMatch,\n                                            version: \"9_0_87\",\n                                            props: childProps,\n                                            exports: (win = proxyWin, {\n                                                init: function(childExports) {\n                                                    return initChild(this.origin, childExports);\n                                                },\n                                                close: close,\n                                                checkClose: function() {\n                                                    return checkWindowClose(win);\n                                                },\n                                                resize: resize,\n                                                onError: onError,\n                                                show: show,\n                                                hide: hide,\n                                                export: xport\n                                            })\n                                        };\n                                        var win;\n                                    }));\n                                }({\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    context: context\n                                }).then((function(childPayload) {\n                                    var _crossDomainSerialize = crossDomainSerialize({\n                                        data: childPayload,\n                                        metaData: {\n                                            windowRef: getWindowRef(target, initialChildDomain, context, proxyWin)\n                                        },\n                                        sender: {\n                                            domain: utils_getDomain(window)\n                                        },\n                                        receiver: {\n                                            win: proxyWin,\n                                            domain: childDomainMatch\n                                        },\n                                        passByReference: initialChildDomain === utils_getDomain()\n                                    }), serializedData = _crossDomainSerialize.serializedData;\n                                    clean.register(_crossDomainSerialize.cleanReference);\n                                    return serializedData;\n                                }));\n                            }({\n                                proxyWin: (_ref7 = {\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    target: target,\n                                    context: context\n                                }).proxyWin,\n                                initialChildDomain: _ref7.initialChildDomain,\n                                childDomainMatch: _ref7.childDomainMatch,\n                                target: _ref7.target,\n                                context: _ref7.context\n                            }).then((function(serializedPayload) {\n                                return buildChildWindowName({\n                                    name: name,\n                                    serializedPayload: serializedPayload\n                                });\n                            }));\n                            var _ref7;\n                        }));\n                        var openFramePromise = buildWindowNamePromise.then((function(windowName) {\n                            return openFrame(context, {\n                                windowName: windowName\n                            });\n                        }));\n                        var openPrerenderFramePromise = openPrerenderFrame(context);\n                        var renderContainerPromise = promise_ZalgoPromise.hash({\n                            proxyContainer: getProxyContainerPromise,\n                            proxyFrame: openFramePromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref15) {\n                            return renderContainer(_ref15.proxyContainer, {\n                                context: context,\n                                proxyFrame: _ref15.proxyFrame,\n                                proxyPrerenderFrame: _ref15.proxyPrerenderFrame,\n                                rerender: rerender\n                            });\n                        })).then((function(proxyContainer) {\n                            return proxyContainer;\n                        }));\n                        var openPromise = promise_ZalgoPromise.hash({\n                            windowName: buildWindowNamePromise,\n                            proxyFrame: openFramePromise,\n                            proxyWin: getProxyWindowPromise\n                        }).then((function(_ref16) {\n                            var proxyWin = _ref16.proxyWin;\n                            return windowProp ? proxyWin : open(context, {\n                                windowName: _ref16.windowName,\n                                proxyWin: proxyWin,\n                                proxyFrame: _ref16.proxyFrame\n                            });\n                        }));\n                        var openPrerenderPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref17) {\n                            return openPrerender(context, _ref17.proxyWin, _ref17.proxyPrerenderFrame);\n                        }));\n                        var setStatePromise = openPromise.then((function(proxyWin) {\n                            currentProxyWin = proxyWin;\n                            return setProxyWin(proxyWin);\n                        }));\n                        var prerenderPromise = promise_ZalgoPromise.hash({\n                            proxyPrerenderWin: openPrerenderPromise,\n                            state: setStatePromise\n                        }).then((function(_ref18) {\n                            return prerender(_ref18.proxyPrerenderWin, {\n                                context: context\n                            });\n                        }));\n                        var setWindowNamePromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowName: buildWindowNamePromise\n                        }).then((function(_ref19) {\n                            if (windowProp) return _ref19.proxyWin.setName(_ref19.windowName);\n                        }));\n                        var getMethodPromise = promise_ZalgoPromise.hash({\n                            body: buildBodyPromise\n                        }).then((function(_ref20) {\n                            return options.method ? options.method : Object.keys(_ref20.body).length ? \"post\" : \"get\";\n                        }));\n                        var loadUrlPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowUrl: buildUrlPromise,\n                            body: buildBodyPromise,\n                            method: getMethodPromise,\n                            windowName: setWindowNamePromise,\n                            prerender: prerenderPromise\n                        }).then((function(_ref21) {\n                            return _ref21.proxyWin.setLocation(_ref21.windowUrl, {\n                                method: _ref21.method,\n                                body: _ref21.body\n                            });\n                        }));\n                        var watchForClosePromise = openPromise.then((function(proxyWin) {\n                            !function watchForClose(proxyWin, context) {\n                                var cancelled = !1;\n                                clean.register((function() {\n                                    cancelled = !0;\n                                }));\n                                return promise_ZalgoPromise.delay(2e3).then((function() {\n                                    return proxyWin.isClosed();\n                                })).then((function(isClosed) {\n                                    if (!cancelled) return isClosed ? close(new Error(\"Detected \" + context + \" close\")) : watchForClose(proxyWin, context);\n                                }));\n                            }(proxyWin, context);\n                        }));\n                        var onDisplayPromise = promise_ZalgoPromise.hash({\n                            container: renderContainerPromise,\n                            prerender: prerenderPromise\n                        }).then((function() {\n                            return event.trigger(EVENT.DISPLAY);\n                        }));\n                        var openBridgePromise = openPromise.then((function(proxyWin) {}));\n                        var runTimeoutPromise = loadUrlPromise.then((function() {\n                            return promise_ZalgoPromise.try((function() {\n                                var timeout = props.timeout;\n                                if (timeout) return initPromise.timeout(timeout, new Error(\"Loading component timed out after \" + timeout + \" milliseconds\"));\n                            }));\n                        }));\n                        var onRenderedPromise = initPromise.then((function() {\n                            return event.trigger(EVENT.RENDERED);\n                        }));\n                        return promise_ZalgoPromise.hash({\n                            initPromise: initPromise,\n                            buildUrlPromise: buildUrlPromise,\n                            onRenderPromise: onRenderPromise,\n                            getProxyContainerPromise: getProxyContainerPromise,\n                            openFramePromise: openFramePromise,\n                            openPrerenderFramePromise: openPrerenderFramePromise,\n                            renderContainerPromise: renderContainerPromise,\n                            openPromise: openPromise,\n                            openPrerenderPromise: openPrerenderPromise,\n                            setStatePromise: setStatePromise,\n                            prerenderPromise: prerenderPromise,\n                            loadUrlPromise: loadUrlPromise,\n                            buildWindowNamePromise: buildWindowNamePromise,\n                            setWindowNamePromise: setWindowNamePromise,\n                            watchForClosePromise: watchForClosePromise,\n                            onDisplayPromise: onDisplayPromise,\n                            openBridgePromise: openBridgePromise,\n                            runTimeoutPromise: runTimeoutPromise,\n                            onRenderedPromise: onRenderedPromise,\n                            delegatePromise: delegatePromise,\n                            watchForUnloadPromise: watchForUnloadPromise,\n                            finalSetPropsPromise: finalSetPropsPromise\n                        });\n                    })).catch((function(err) {\n                        return promise_ZalgoPromise.all([ onError(err), destroy(err) ]).then((function() {\n                            throw err;\n                        }), (function() {\n                            throw err;\n                        }));\n                    })).then(src_util_noop);\n                },\n                destroy: destroy,\n                getProps: function() {\n                    return props;\n                },\n                setProps: setProps,\n                export: xport,\n                getHelpers: getHelpers,\n                getDelegateOverrides: function() {\n                    return promise_ZalgoPromise.try((function() {\n                        return {\n                            getProxyContainer: getProxyContainer,\n                            show: show,\n                            hide: hide,\n                            renderContainer: renderContainer,\n                            getProxyWindow: getProxyWindow,\n                            watchForUnload: watchForUnload,\n                            openFrame: openFrame,\n                            openPrerenderFrame: openPrerenderFrame,\n                            prerender: prerender,\n                            open: open,\n                            openPrerender: openPrerender,\n                            setProxyWin: setProxyWin\n                        };\n                    }));\n                },\n                getExports: function() {\n                    return xports({\n                        getExports: function() {\n                            return exportsPromise;\n                        }\n                    });\n                }\n            };\n        }\n        function defaultContainerTemplate(_ref) {\n            var uid = _ref.uid, frame = _ref.frame, prerenderFrame = _ref.prerenderFrame, doc = _ref.doc, props = _ref.props, event = _ref.event, dimensions = _ref.dimensions;\n            var width = dimensions.width, height = dimensions.height;\n            if (frame && prerenderFrame) {\n                var div = doc.createElement(\"div\");\n                div.setAttribute(\"id\", uid);\n                var style = doc.createElement(\"style\");\n                props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n                style.appendChild(doc.createTextNode(\"\\n            #\" + uid + \" {\\n                display: inline-block;\\n                position: relative;\\n                width: \" + width + \";\\n                height: \" + height + \";\\n            }\\n\\n            #\" + uid + \" > iframe {\\n                display: inline-block;\\n                position: absolute;\\n                width: 100%;\\n                height: 100%;\\n                top: 0;\\n                left: 0;\\n                transition: opacity .2s ease-in-out;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-invisible {\\n                opacity: 0;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-visible {\\n                opacity: 1;\\n        }\\n        \"));\n                div.appendChild(frame);\n                div.appendChild(prerenderFrame);\n                div.appendChild(style);\n                prerenderFrame.classList.add(\"zoid-visible\");\n                frame.classList.add(\"zoid-invisible\");\n                event.on(EVENT.RENDERED, (function() {\n                    prerenderFrame.classList.remove(\"zoid-visible\");\n                    prerenderFrame.classList.add(\"zoid-invisible\");\n                    frame.classList.remove(\"zoid-invisible\");\n                    frame.classList.add(\"zoid-visible\");\n                    setTimeout((function() {\n                        destroyElement(prerenderFrame);\n                    }), 1);\n                }));\n                event.on(EVENT.RESIZE, (function(_ref2) {\n                    var newWidth = _ref2.width, newHeight = _ref2.height;\n                    \"number\" == typeof newWidth && (div.style.width = toCSS(newWidth));\n                    \"number\" == typeof newHeight && (div.style.height = toCSS(newHeight));\n                }));\n                return div;\n            }\n        }\n        var cleanInstances = cleanup();\n        var cleanZoid = cleanup();\n        function component(opts) {\n            var options = function(options) {\n                var tag = options.tag, url = options.url, domain = options.domain, bridgeUrl = options.bridgeUrl, _options$props = options.props, props = void 0 === _options$props ? {} : _options$props, _options$dimensions = options.dimensions, dimensions = void 0 === _options$dimensions ? {} : _options$dimensions, _options$autoResize = options.autoResize, autoResize = void 0 === _options$autoResize ? {} : _options$autoResize, _options$allowedParen = options.allowedParentDomains, allowedParentDomains = void 0 === _options$allowedParen ? \"*\" : _options$allowedParen, _options$attributes = options.attributes, attributes = void 0 === _options$attributes ? {} : _options$attributes, _options$defaultConte = options.defaultContext, defaultContext = void 0 === _options$defaultConte ? CONTEXT.IFRAME : _options$defaultConte, _options$containerTem = options.containerTemplate, containerTemplate = void 0 === _options$containerTem ? defaultContainerTemplate : _options$containerTem, _options$prerenderTem = options.prerenderTemplate, prerenderTemplate = void 0 === _options$prerenderTem ? null : _options$prerenderTem, validate = options.validate, _options$eligible = options.eligible, eligible = void 0 === _options$eligible ? function() {\n                    return {\n                        eligible: !0\n                    };\n                } : _options$eligible, _options$logger = options.logger, logger = void 0 === _options$logger ? {\n                    info: src_util_noop\n                } : _options$logger, _options$exports = options.exports, xportsDefinition = void 0 === _options$exports ? src_util_noop : _options$exports, method = options.method, _options$children = options.children, children = void 0 === _options$children ? function() {\n                    return {};\n                } : _options$children;\n                var name = tag.replace(/-/g, \"_\");\n                var propsDef = _extends({}, {\n                    window: {\n                        type: PROP_TYPE.OBJECT,\n                        sendToChild: !1,\n                        required: !1,\n                        allowDelegate: !0,\n                        validate: function(_ref2) {\n                            var value = _ref2.value;\n                            if (!utils_isWindow(value) && !window_ProxyWindow.isProxyWindow(value)) throw new Error(\"Expected Window or ProxyWindow\");\n                            if (utils_isWindow(value)) {\n                                if (utils_isWindowClosed(value)) throw new Error(\"Window is closed\");\n                                if (!utils_isSameDomain(value)) throw new Error(\"Window is not same domain\");\n                            }\n                        },\n                        decorate: function(_ref3) {\n                            return setup_toProxyWindow(_ref3.value);\n                        }\n                    },\n                    timeout: {\n                        type: PROP_TYPE.NUMBER,\n                        required: !1,\n                        sendToChild: !1\n                    },\n                    cspNonce: {\n                        type: PROP_TYPE.STRING,\n                        required: !1\n                    },\n                    onDisplay: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRendered: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRender: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onClose: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onDestroy: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onResize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    onFocus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    close: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref4) {\n                            return _ref4.close;\n                        }\n                    },\n                    focus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref5) {\n                            return _ref5.focus;\n                        }\n                    },\n                    resize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref6) {\n                            return _ref6.resize;\n                        }\n                    },\n                    uid: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref7) {\n                            return _ref7.uid;\n                        }\n                    },\n                    tag: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref8) {\n                            return _ref8.tag;\n                        }\n                    },\n                    getParent: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref9) {\n                            return _ref9.getParent;\n                        }\n                    },\n                    getParentDomain: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref10) {\n                            return _ref10.getParentDomain;\n                        }\n                    },\n                    show: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref11) {\n                            return _ref11.show;\n                        }\n                    },\n                    hide: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref12) {\n                            return _ref12.hide;\n                        }\n                    },\n                    export: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref13) {\n                            return _ref13.export;\n                        }\n                    },\n                    onError: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref14) {\n                            return _ref14.onError;\n                        }\n                    },\n                    onProps: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref15) {\n                            return _ref15.onProps;\n                        }\n                    },\n                    getSiblings: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref16) {\n                            return _ref16.getSiblings;\n                        }\n                    }\n                }, props);\n                if (!containerTemplate) throw new Error(\"Container template required\");\n                return {\n                    name: name,\n                    tag: tag,\n                    url: url,\n                    domain: domain,\n                    bridgeUrl: bridgeUrl,\n                    method: method,\n                    propsDef: propsDef,\n                    dimensions: dimensions,\n                    autoResize: autoResize,\n                    allowedParentDomains: allowedParentDomains,\n                    attributes: attributes,\n                    defaultContext: defaultContext,\n                    containerTemplate: containerTemplate,\n                    prerenderTemplate: prerenderTemplate,\n                    validate: validate,\n                    logger: logger,\n                    eligible: eligible,\n                    children: children,\n                    exports: \"function\" == typeof xportsDefinition ? xportsDefinition : function(_ref) {\n                        var getExports = _ref.getExports;\n                        var result = {};\n                        var _loop = function(_i2, _Object$keys2) {\n                            var key = _Object$keys2[_i2];\n                            var type = xportsDefinition[key].type;\n                            var valuePromise = getExports().then((function(res) {\n                                return res[key];\n                            }));\n                            result[key] = type === PROP_TYPE.FUNCTION ? function() {\n                                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                return valuePromise.then((function(value) {\n                                    return value.apply(void 0, args);\n                                }));\n                            } : valuePromise;\n                        };\n                        for (var _i2 = 0, _Object$keys2 = Object.keys(xportsDefinition); _i2 < _Object$keys2.length; _i2++) _loop(_i2, _Object$keys2);\n                        return result;\n                    }\n                };\n            }(opts);\n            var name = options.name, tag = options.tag, defaultContext = options.defaultContext, eligible = options.eligible, children = options.children;\n            var global = lib_global_getGlobal(window);\n            var instances = [];\n            var isChild = function() {\n                if (function(name) {\n                    try {\n                        return parseWindowName(window.name).name === name;\n                    } catch (err) {}\n                    return !1;\n                }(name)) {\n                    var _payload = getInitialParentPayload().payload;\n                    if (_payload.tag === tag && utils_matchDomain(_payload.childDomainMatch, utils_getDomain())) return !0;\n                }\n                return !1;\n            };\n            var registerChild = memoize((function() {\n                if (isChild()) {\n                    if (window.xprops) {\n                        delete global.components[tag];\n                        throw new Error(\"Can not register \" + name + \" as child - child already registered\");\n                    }\n                    var child = function(options) {\n                        var tag = options.tag, propsDef = options.propsDef, autoResize = options.autoResize, allowedParentDomains = options.allowedParentDomains;\n                        var onPropHandlers = [];\n                        var _getInitialParentPayl = getInitialParentPayload(), parent = _getInitialParentPayl.parent, payload = _getInitialParentPayl.payload;\n                        var parentComponentWindow = parent.win, parentDomain = parent.domain;\n                        var props;\n                        var exportsPromise = new promise_ZalgoPromise;\n                        var version = payload.version, uid = payload.uid, parentExports = payload.exports, context = payload.context, initialProps = payload.props;\n                        if (\"9_0_87\" !== version) throw new Error(\"Parent window has zoid version \" + version + \", child window has version 9_0_87\");\n                        var show = parentExports.show, hide = parentExports.hide, close = parentExports.close, onError = parentExports.onError, checkClose = parentExports.checkClose, parentExport = parentExports.export, parentResize = parentExports.resize, parentInit = parentExports.init;\n                        var getParent = function() {\n                            return parentComponentWindow;\n                        };\n                        var getParentDomain = function() {\n                            return parentDomain;\n                        };\n                        var onProps = function(handler) {\n                            onPropHandlers.push(handler);\n                            return {\n                                cancel: function() {\n                                    onPropHandlers.splice(onPropHandlers.indexOf(handler), 1);\n                                }\n                            };\n                        };\n                        var resize = function(_ref) {\n                            return parentResize.fireAndForget({\n                                width: _ref.width,\n                                height: _ref.height\n                            });\n                        };\n                        var xport = function(xports) {\n                            exportsPromise.resolve(xports);\n                            return parentExport(xports);\n                        };\n                        var getSiblings = function(_temp) {\n                            var anyParent = (void 0 === _temp ? {} : _temp).anyParent;\n                            var result = [];\n                            var currentParent = props.parent;\n                            void 0 === anyParent && (anyParent = !currentParent);\n                            if (!anyParent && !currentParent) throw new Error(\"No parent found for \" + tag + \" child\");\n                            for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(window); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                var win = _getAllFramesInWindow2[_i2];\n                                if (utils_isSameDomain(win)) {\n                                    var xprops = utils_assertSameDomain(win).xprops;\n                                    if (xprops && getParent() === xprops.getParent()) {\n                                        var winParent = xprops.parent;\n                                        if (anyParent || !currentParent || winParent && winParent.uid === currentParent.uid) {\n                                            var xports = tryGlobal(win, (function(global) {\n                                                return global.exports;\n                                            }));\n                                            result.push({\n                                                props: xprops,\n                                                exports: xports\n                                            });\n                                        }\n                                    }\n                                }\n                            }\n                            return result;\n                        };\n                        var setProps = function(newProps, origin, isUpdate) {\n                            void 0 === isUpdate && (isUpdate = !1);\n                            var normalizedProps = function(parentComponentWindow, propsDef, props, origin, helpers, isUpdate) {\n                                void 0 === isUpdate && (isUpdate = !1);\n                                var result = {};\n                                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                                    var key = _Object$keys2[_i2];\n                                    var prop = propsDef[key];\n                                    if (!prop || !prop.sameDomain || origin === utils_getDomain(window) && utils_isSameDomain(parentComponentWindow)) {\n                                        var value = normalizeChildProp(propsDef, 0, key, props[key], helpers);\n                                        result[key] = value;\n                                        prop && prop.alias && !result[prop.alias] && (result[prop.alias] = value);\n                                    }\n                                }\n                                if (!isUpdate) for (var _i4 = 0, _Object$keys4 = Object.keys(propsDef); _i4 < _Object$keys4.length; _i4++) {\n                                    var _key = _Object$keys4[_i4];\n                                    props.hasOwnProperty(_key) || (result[_key] = normalizeChildProp(propsDef, 0, _key, void 0, helpers));\n                                }\n                                return result;\n                            }(parentComponentWindow, propsDef, newProps, origin, {\n                                tag: tag,\n                                show: show,\n                                hide: hide,\n                                close: close,\n                                focus: child_focus,\n                                onError: onError,\n                                resize: resize,\n                                getSiblings: getSiblings,\n                                onProps: onProps,\n                                getParent: getParent,\n                                getParentDomain: getParentDomain,\n                                uid: uid,\n                                export: xport\n                            }, isUpdate);\n                            props ? extend(props, normalizedProps) : props = normalizedProps;\n                            for (var _i4 = 0; _i4 < onPropHandlers.length; _i4++) (0, onPropHandlers[_i4])(props);\n                        };\n                        var updateProps = function(newProps) {\n                            return promise_ZalgoPromise.try((function() {\n                                return setProps(newProps, parentDomain, !0);\n                            }));\n                        };\n                        return {\n                            init: function() {\n                                return promise_ZalgoPromise.try((function() {\n                                    utils_isSameDomain(parentComponentWindow) && function(_ref3) {\n                                        var componentName = _ref3.componentName, parentComponentWindow = _ref3.parentComponentWindow;\n                                        var _crossDomainDeseriali2 = crossDomainDeserialize({\n                                            data: parseWindowName(window.name).serializedInitialPayload,\n                                            sender: {\n                                                win: parentComponentWindow\n                                            },\n                                            basic: !0\n                                        }), sender = _crossDomainDeseriali2.sender;\n                                        if (\"uid\" === _crossDomainDeseriali2.reference.type || \"global\" === _crossDomainDeseriali2.metaData.windowRef.type) {\n                                            var _crossDomainSerialize = crossDomainSerialize({\n                                                data: _crossDomainDeseriali2.data,\n                                                metaData: {\n                                                    windowRef: window_getWindowRef(parentComponentWindow)\n                                                },\n                                                sender: {\n                                                    domain: sender.domain\n                                                },\n                                                receiver: {\n                                                    win: window,\n                                                    domain: utils_getDomain()\n                                                },\n                                                basic: !0\n                                            });\n                                            window.name = buildChildWindowName({\n                                                name: componentName,\n                                                serializedPayload: _crossDomainSerialize.serializedData\n                                            });\n                                        }\n                                    }({\n                                        componentName: options.name,\n                                        parentComponentWindow: parentComponentWindow\n                                    });\n                                    lib_global_getGlobal(window).exports = options.exports({\n                                        getExports: function() {\n                                            return exportsPromise;\n                                        }\n                                    });\n                                    !function(allowedParentDomains, domain) {\n                                        if (!utils_matchDomain(allowedParentDomains, domain)) throw new Error(\"Can not be rendered by domain: \" + domain);\n                                    }(allowedParentDomains, parentDomain);\n                                    markWindowKnown(parentComponentWindow);\n                                    !function() {\n                                        window.addEventListener(\"beforeunload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        window.addEventListener(\"unload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        utils_onCloseWindow(parentComponentWindow, (function() {\n                                            child_destroy();\n                                        }));\n                                    }();\n                                    return parentInit({\n                                        updateProps: updateProps,\n                                        close: child_destroy\n                                    });\n                                })).then((function() {\n                                    return (_autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, \n                                    _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, \n                                    _autoResize$element = autoResize.element, elementReady(void 0 === _autoResize$element ? \"body\" : _autoResize$element).catch(src_util_noop).then((function(element) {\n                                        return {\n                                            width: width,\n                                            height: height,\n                                            element: element\n                                        };\n                                    }))).then((function(_ref3) {\n                                        var width = _ref3.width, height = _ref3.height, element = _ref3.element;\n                                        element && (width || height) && context !== CONTEXT.POPUP && onResize(element, (function(_ref4) {\n                                            resize({\n                                                width: width ? _ref4.width : void 0,\n                                                height: height ? _ref4.height : void 0\n                                            });\n                                        }), {\n                                            width: width,\n                                            height: height\n                                        });\n                                    }));\n                                    var _autoResize$width, width, _autoResize$height, height, _autoResize$element;\n                                })).catch((function(err) {\n                                    onError(err);\n                                }));\n                            },\n                            getProps: function() {\n                                if (props) return props;\n                                setProps(initialProps, parentDomain);\n                                return props;\n                            }\n                        };\n                    }(options);\n                    child.init();\n                    return child;\n                }\n            }));\n            registerChild();\n            !function() {\n                var allowDelegateListener = on_on(\"zoid_allow_delegate_\" + name, (function() {\n                    return !0;\n                }));\n                var delegateListener = on_on(\"zoid_delegate_\" + name, (function(_ref2) {\n                    var _ref2$data = _ref2.data;\n                    return {\n                        parent: parentComponent({\n                            uid: _ref2$data.uid,\n                            options: options,\n                            overrides: _ref2$data.overrides,\n                            parentWin: _ref2.source\n                        })\n                    };\n                }));\n                cleanZoid.register(allowDelegateListener.cancel);\n                cleanZoid.register(delegateListener.cancel);\n            }();\n            global.components = global.components || {};\n            if (global.components[tag]) throw new Error(\"Can not register multiple components with the same tag: \" + tag);\n            global.components[tag] = !0;\n            return {\n                init: function init(inputProps) {\n                    var instance;\n                    var uid = \"zoid-\" + tag + \"-\" + uniqueID();\n                    var props = inputProps || {};\n                    var _eligible = eligible({\n                        props: props\n                    }), eligibility = _eligible.eligible, reason = _eligible.reason;\n                    var onDestroy = props.onDestroy;\n                    props.onDestroy = function() {\n                        instance && eligibility && instances.splice(instances.indexOf(instance), 1);\n                        if (onDestroy) return onDestroy.apply(void 0, arguments);\n                    };\n                    var parent = parentComponent({\n                        uid: uid,\n                        options: options\n                    });\n                    parent.init();\n                    eligibility ? parent.setProps(props) : props.onDestroy && props.onDestroy();\n                    cleanInstances.register((function(err) {\n                        return parent.destroy(err || new Error(\"zoid destroyed all components\"));\n                    }));\n                    var clone = function(_temp) {\n                        var _ref4$decorate = (void 0 === _temp ? {} : _temp).decorate;\n                        return init((void 0 === _ref4$decorate ? identity : _ref4$decorate)(props));\n                    };\n                    var _render = function(target, container, context) {\n                        return promise_ZalgoPromise.try((function() {\n                            if (!eligibility) {\n                                var err = new Error(reason || name + \" component is not eligible\");\n                                return parent.destroy(err).then((function() {\n                                    throw err;\n                                }));\n                            }\n                            if (!utils_isWindow(target)) throw new Error(\"Must pass window to renderTo\");\n                            return function(props, context) {\n                                return promise_ZalgoPromise.try((function() {\n                                    if (props.window) return setup_toProxyWindow(props.window).getType();\n                                    if (context) {\n                                        if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) throw new Error(\"Unrecognized context: \" + context);\n                                        return context;\n                                    }\n                                    return defaultContext;\n                                }));\n                            }(props, context);\n                        })).then((function(finalContext) {\n                            container = function(context, container) {\n                                if (container) {\n                                    if (\"string\" != typeof container && !isElement(container)) throw new TypeError(\"Expected string or element selector to be passed\");\n                                    return container;\n                                }\n                                if (context === CONTEXT.POPUP) return \"body\";\n                                throw new Error(\"Expected element to be passed to render iframe\");\n                            }(finalContext, container);\n                            if (target !== window && \"string\" != typeof container) throw new Error(\"Must pass string element when rendering to another window\");\n                            return parent.render({\n                                target: target,\n                                container: container,\n                                context: finalContext,\n                                rerender: function() {\n                                    var newInstance = clone();\n                                    extend(instance, newInstance);\n                                    return newInstance.renderTo(target, container, context);\n                                }\n                            });\n                        })).catch((function(err) {\n                            return parent.destroy(err).then((function() {\n                                throw err;\n                            }));\n                        }));\n                    };\n                    instance = _extends({}, parent.getExports(), parent.getHelpers(), function() {\n                        var childComponents = children();\n                        var result = {};\n                        var _loop2 = function(_i4, _Object$keys4) {\n                            var childName = _Object$keys4[_i4];\n                            var Child = childComponents[childName];\n                            result[childName] = function(childInputProps) {\n                                var parentProps = parent.getProps();\n                                var childProps = _extends({}, childInputProps, {\n                                    parent: {\n                                        uid: uid,\n                                        props: parentProps,\n                                        export: parent.export\n                                    }\n                                });\n                                return Child(childProps);\n                            };\n                        };\n                        for (var _i4 = 0, _Object$keys4 = Object.keys(childComponents); _i4 < _Object$keys4.length; _i4++) _loop2(_i4, _Object$keys4);\n                        return result;\n                    }(), {\n                        isEligible: function() {\n                            return eligibility;\n                        },\n                        clone: clone,\n                        render: function(container, context) {\n                            return _render(window, container, context);\n                        },\n                        renderTo: function(target, container, context) {\n                            return _render(target, container, context);\n                        }\n                    });\n                    eligibility && instances.push(instance);\n                    return instance;\n                },\n                instances: instances,\n                driver: function(driverName, dep) {\n                    throw new Error(\"Driver support not enabled\");\n                },\n                isChild: isChild,\n                canRenderTo: function(win) {\n                    return send_send(win, \"zoid_allow_delegate_\" + name).then((function(_ref3) {\n                        return _ref3.data;\n                    })).catch((function() {\n                        return !1;\n                    }));\n                },\n                registerChild: registerChild\n            };\n        }\n        var component_create = function(options) {\n            !function() {\n                if (!global_getGlobal().initialized) {\n                    global_getGlobal().initialized = !0;\n                    on = (_ref3 = {\n                        on: on_on,\n                        send: send_send\n                    }).on, send = _ref3.send, (global = global_getGlobal()).receiveMessage = global.receiveMessage || function(message) {\n                        return receive_receiveMessage(message, {\n                            on: on,\n                            send: send\n                        });\n                    };\n                    !function(_ref5) {\n                        var on = _ref5.on, send = _ref5.send;\n                        globalStore().getOrSet(\"postMessageListener\", (function() {\n                            return addEventListener(window, \"message\", (function(event) {\n                                !function(event, _ref4) {\n                                    var on = _ref4.on, send = _ref4.send;\n                                    promise_ZalgoPromise.try((function() {\n                                        var source = event.source || event.sourceElement;\n                                        var origin = event.origin || event.originalEvent && event.originalEvent.origin;\n                                        var data = event.data;\n                                        \"null\" === origin && (origin = \"file://\");\n                                        if (source) {\n                                            if (!origin) throw new Error(\"Post message did not have origin domain\");\n                                            receive_receiveMessage({\n                                                source: source,\n                                                origin: origin,\n                                                data: data\n                                            }, {\n                                                on: on,\n                                                send: send\n                                            });\n                                        }\n                                    }));\n                                }(event, {\n                                    on: on,\n                                    send: send\n                                });\n                            }));\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                    !function(_ref8) {\n                        var on = _ref8.on, send = _ref8.send;\n                        globalStore(\"builtinListeners\").getOrSet(\"helloListener\", (function() {\n                            var listener = on(\"postrobot_hello\", {\n                                domain: \"*\"\n                            }, (function(_ref3) {\n                                resolveHelloPromise(_ref3.source, {\n                                    domain: _ref3.origin\n                                });\n                                return {\n                                    instanceID: getInstanceID()\n                                };\n                            }));\n                            var parent = getAncestor();\n                            parent && sayHello(parent, {\n                                send: send\n                            }).catch((function(err) {}));\n                            return listener;\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                }\n                var _ref3, on, send, global;\n            }();\n            var comp = component(options);\n            var init = function(props) {\n                return comp.init(props);\n            };\n            init.driver = function(name, dep) {\n                return comp.driver(name, dep);\n            };\n            init.isChild = function() {\n                return comp.isChild();\n            };\n            init.canRenderTo = function(win) {\n                return comp.canRenderTo(win);\n            };\n            init.instances = comp.instances;\n            var child = comp.registerChild();\n            child && (window.xprops = init.xprops = child.getProps());\n            return init;\n        };\n        function destroyComponents(err) {\n            var destroyPromise = cleanInstances.all(err);\n            cleanInstances = cleanup();\n            return destroyPromise;\n        }\n        var destroyAll = destroyComponents;\n        function component_destroy(err) {\n            destroyAll();\n            delete window.__zoid_9_0_87__;\n            !function() {\n                !function() {\n                    var responseListeners = globalStore(\"responseListeners\");\n                    for (var _i2 = 0, _responseListeners$ke2 = responseListeners.keys(); _i2 < _responseListeners$ke2.length; _i2++) {\n                        var hash = _responseListeners$ke2[_i2];\n                        var listener = responseListeners.get(hash);\n                        listener && (listener.cancelled = !0);\n                        responseListeners.del(hash);\n                    }\n                }();\n                (listener = globalStore().get(\"postMessageListener\")) && listener.cancel();\n                var listener;\n                delete window.__post_robot_10_0_46__;\n            }();\n            return cleanZoid.all(err);\n        }\n    } ]);\n}));"
  },
  {
    "path": "dist/zoid.frameworks.frame.js",
    "content": "!function(root, factory) {\n    \"object\" == typeof exports && \"object\" == typeof module ? module.exports = factory() : \"function\" == typeof define && define.amd ? define(\"zoid\", [], factory) : \"object\" == typeof exports ? exports.zoid = factory() : root.zoid = factory();\n}(\"undefined\" != typeof self ? self : this, (function() {\n    return function(modules) {\n        var installedModules = {};\n        function __webpack_require__(moduleId) {\n            if (installedModules[moduleId]) return installedModules[moduleId].exports;\n            var module = installedModules[moduleId] = {\n                i: moduleId,\n                l: !1,\n                exports: {}\n            };\n            modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n            module.l = !0;\n            return module.exports;\n        }\n        __webpack_require__.m = modules;\n        __webpack_require__.c = installedModules;\n        __webpack_require__.d = function(exports, name, getter) {\n            __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {\n                enumerable: !0,\n                get: getter\n            });\n        };\n        __webpack_require__.r = function(exports) {\n            \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {\n                value: \"Module\"\n            });\n            Object.defineProperty(exports, \"__esModule\", {\n                value: !0\n            });\n        };\n        __webpack_require__.t = function(value, mode) {\n            1 & mode && (value = __webpack_require__(value));\n            if (8 & mode) return value;\n            if (4 & mode && \"object\" == typeof value && value && value.__esModule) return value;\n            var ns = Object.create(null);\n            __webpack_require__.r(ns);\n            Object.defineProperty(ns, \"default\", {\n                enumerable: !0,\n                value: value\n            });\n            if (2 & mode && \"string\" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) {\n                return value[key];\n            }.bind(null, key));\n            return ns;\n        };\n        __webpack_require__.n = function(module) {\n            var getter = module && module.__esModule ? function() {\n                return module.default;\n            } : function() {\n                return module;\n            };\n            __webpack_require__.d(getter, \"a\", getter);\n            return getter;\n        };\n        __webpack_require__.o = function(object, property) {\n            return {}.hasOwnProperty.call(object, property);\n        };\n        __webpack_require__.p = \"\";\n        return __webpack_require__(__webpack_require__.s = 0);\n    }([ function(module, __webpack_exports__, __webpack_require__) {\n        \"use strict\";\n        __webpack_require__.r(__webpack_exports__);\n        __webpack_require__.d(__webpack_exports__, \"PopupOpenError\", (function() {\n            return dom_PopupOpenError;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"create\", (function() {\n            return component_create;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroy\", (function() {\n            return component_destroy;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyComponents\", (function() {\n            return destroyComponents;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyAll\", (function() {\n            return destroyAll;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_TYPE\", (function() {\n            return PROP_TYPE;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_SERIALIZATION\", (function() {\n            return PROP_SERIALIZATION;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"CONTEXT\", (function() {\n            return CONTEXT;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"EVENT\", (function() {\n            return EVENT;\n        }));\n        function _setPrototypeOf(o, p) {\n            return (_setPrototypeOf = Object.setPrototypeOf || function(o, p) {\n                o.__proto__ = p;\n                return o;\n            })(o, p);\n        }\n        function _inheritsLoose(subClass, superClass) {\n            subClass.prototype = Object.create(superClass.prototype);\n            subClass.prototype.constructor = subClass;\n            _setPrototypeOf(subClass, superClass);\n        }\n        function _extends() {\n            return (_extends = Object.assign || function(target) {\n                for (var i = 1; i < arguments.length; i++) {\n                    var source = arguments[i];\n                    for (var key in source) ({}).hasOwnProperty.call(source, key) && (target[key] = source[key]);\n                }\n                return target;\n            }).apply(this, arguments);\n        }\n        function utils_isPromise(item) {\n            try {\n                if (!item) return !1;\n                if (\"undefined\" != typeof Promise && item instanceof Promise) return !0;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.Window && item instanceof window.Window) return !1;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.constructor && item instanceof window.constructor) return !1;\n                var _toString = {}.toString;\n                if (_toString) {\n                    var name = _toString.call(item);\n                    if (\"[object Window]\" === name || \"[object global]\" === name || \"[object DOMWindow]\" === name) return !1;\n                }\n                if (\"function\" == typeof item.then) return !0;\n            } catch (err) {\n                return !1;\n            }\n            return !1;\n        }\n        var dispatchedErrors = [];\n        var possiblyUnhandledPromiseHandlers = [];\n        var activeCount = 0;\n        var flushPromise;\n        function flushActive() {\n            if (!activeCount && flushPromise) {\n                var promise = flushPromise;\n                flushPromise = null;\n                promise.resolve();\n            }\n        }\n        function startActive() {\n            activeCount += 1;\n        }\n        function endActive() {\n            activeCount -= 1;\n            flushActive();\n        }\n        var promise_ZalgoPromise = function() {\n            function ZalgoPromise(handler) {\n                var _this = this;\n                this.resolved = void 0;\n                this.rejected = void 0;\n                this.errorHandled = void 0;\n                this.value = void 0;\n                this.error = void 0;\n                this.handlers = void 0;\n                this.dispatching = void 0;\n                this.stack = void 0;\n                this.resolved = !1;\n                this.rejected = !1;\n                this.errorHandled = !1;\n                this.handlers = [];\n                if (handler) {\n                    var _result;\n                    var _error;\n                    var resolved = !1;\n                    var rejected = !1;\n                    var isAsync = !1;\n                    startActive();\n                    try {\n                        handler((function(res) {\n                            if (isAsync) _this.resolve(res); else {\n                                resolved = !0;\n                                _result = res;\n                            }\n                        }), (function(err) {\n                            if (isAsync) _this.reject(err); else {\n                                rejected = !0;\n                                _error = err;\n                            }\n                        }));\n                    } catch (err) {\n                        endActive();\n                        this.reject(err);\n                        return;\n                    }\n                    endActive();\n                    isAsync = !0;\n                    resolved ? this.resolve(_result) : rejected && this.reject(_error);\n                }\n            }\n            var _proto = ZalgoPromise.prototype;\n            _proto.resolve = function(result) {\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(result)) throw new Error(\"Can not resolve promise with another promise\");\n                this.resolved = !0;\n                this.value = result;\n                this.dispatch();\n                return this;\n            };\n            _proto.reject = function(error) {\n                var _this2 = this;\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(error)) throw new Error(\"Can not reject promise with another promise\");\n                if (!error) {\n                    var _err = error && \"function\" == typeof error.toString ? error.toString() : {}.toString.call(error);\n                    error = new Error(\"Expected reject to be called with Error, got \" + _err);\n                }\n                this.rejected = !0;\n                this.error = error;\n                this.errorHandled || setTimeout((function() {\n                    _this2.errorHandled || function(err, promise) {\n                        if (-1 === dispatchedErrors.indexOf(err)) {\n                            dispatchedErrors.push(err);\n                            setTimeout((function() {\n                                throw err;\n                            }), 1);\n                            for (var j = 0; j < possiblyUnhandledPromiseHandlers.length; j++) possiblyUnhandledPromiseHandlers[j](err, promise);\n                        }\n                    }(error, _this2);\n                }), 1);\n                this.dispatch();\n                return this;\n            };\n            _proto.asyncReject = function(error) {\n                this.errorHandled = !0;\n                this.reject(error);\n                return this;\n            };\n            _proto.dispatch = function() {\n                var resolved = this.resolved, rejected = this.rejected, handlers = this.handlers;\n                if (!this.dispatching && (resolved || rejected)) {\n                    this.dispatching = !0;\n                    startActive();\n                    var chain = function(firstPromise, secondPromise) {\n                        return firstPromise.then((function(res) {\n                            secondPromise.resolve(res);\n                        }), (function(err) {\n                            secondPromise.reject(err);\n                        }));\n                    };\n                    for (var i = 0; i < handlers.length; i++) {\n                        var _handlers$i = handlers[i], onSuccess = _handlers$i.onSuccess, onError = _handlers$i.onError, promise = _handlers$i.promise;\n                        var _result2 = void 0;\n                        if (resolved) try {\n                            _result2 = onSuccess ? onSuccess(this.value) : this.value;\n                        } catch (err) {\n                            promise.reject(err);\n                            continue;\n                        } else if (rejected) {\n                            if (!onError) {\n                                promise.reject(this.error);\n                                continue;\n                            }\n                            try {\n                                _result2 = onError(this.error);\n                            } catch (err) {\n                                promise.reject(err);\n                                continue;\n                            }\n                        }\n                        if (_result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected)) {\n                            var promiseResult = _result2;\n                            promiseResult.resolved ? promise.resolve(promiseResult.value) : promise.reject(promiseResult.error);\n                            promiseResult.errorHandled = !0;\n                        } else utils_isPromise(_result2) ? _result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected) ? _result2.resolved ? promise.resolve(_result2.value) : promise.reject(_result2.error) : chain(_result2, promise) : promise.resolve(_result2);\n                    }\n                    handlers.length = 0;\n                    this.dispatching = !1;\n                    endActive();\n                }\n            };\n            _proto.then = function(onSuccess, onError) {\n                if (onSuccess && \"function\" != typeof onSuccess && !onSuccess.call) throw new Error(\"Promise.then expected a function for success handler\");\n                if (onError && \"function\" != typeof onError && !onError.call) throw new Error(\"Promise.then expected a function for error handler\");\n                var promise = new ZalgoPromise;\n                this.handlers.push({\n                    promise: promise,\n                    onSuccess: onSuccess,\n                    onError: onError\n                });\n                this.errorHandled = !0;\n                this.dispatch();\n                return promise;\n            };\n            _proto.catch = function(onError) {\n                return this.then(void 0, onError);\n            };\n            _proto.finally = function(onFinally) {\n                if (onFinally && \"function\" != typeof onFinally && !onFinally.call) throw new Error(\"Promise.finally expected a function\");\n                return this.then((function(result) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        return result;\n                    }));\n                }), (function(err) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        throw err;\n                    }));\n                }));\n            };\n            _proto.timeout = function(time, err) {\n                var _this3 = this;\n                if (this.resolved || this.rejected) return this;\n                var timeout = setTimeout((function() {\n                    _this3.resolved || _this3.rejected || _this3.reject(err || new Error(\"Promise timed out after \" + time + \"ms\"));\n                }), time);\n                return this.then((function(result) {\n                    clearTimeout(timeout);\n                    return result;\n                }));\n            };\n            _proto.toPromise = function() {\n                if (\"undefined\" == typeof Promise) throw new TypeError(\"Could not find Promise\");\n                return Promise.resolve(this);\n            };\n            _proto.lazy = function() {\n                this.errorHandled = !0;\n                return this;\n            };\n            ZalgoPromise.resolve = function(value) {\n                return value instanceof ZalgoPromise ? value : utils_isPromise(value) ? new ZalgoPromise((function(resolve, reject) {\n                    return value.then(resolve, reject);\n                })) : (new ZalgoPromise).resolve(value);\n            };\n            ZalgoPromise.reject = function(error) {\n                return (new ZalgoPromise).reject(error);\n            };\n            ZalgoPromise.asyncReject = function(error) {\n                return (new ZalgoPromise).asyncReject(error);\n            };\n            ZalgoPromise.all = function(promises) {\n                var promise = new ZalgoPromise;\n                var count = promises.length;\n                var results = [].slice();\n                if (!count) {\n                    promise.resolve(results);\n                    return promise;\n                }\n                var chain = function(i, firstPromise, secondPromise) {\n                    return firstPromise.then((function(res) {\n                        results[i] = res;\n                        0 == (count -= 1) && promise.resolve(results);\n                    }), (function(err) {\n                        secondPromise.reject(err);\n                    }));\n                };\n                for (var i = 0; i < promises.length; i++) {\n                    var prom = promises[i];\n                    if (prom instanceof ZalgoPromise) {\n                        if (prom.resolved) {\n                            results[i] = prom.value;\n                            count -= 1;\n                            continue;\n                        }\n                    } else if (!utils_isPromise(prom)) {\n                        results[i] = prom;\n                        count -= 1;\n                        continue;\n                    }\n                    chain(i, ZalgoPromise.resolve(prom), promise);\n                }\n                0 === count && promise.resolve(results);\n                return promise;\n            };\n            ZalgoPromise.hash = function(promises) {\n                var result = {};\n                var awaitPromises = [];\n                var _loop = function(key) {\n                    if (promises.hasOwnProperty(key)) {\n                        var value = promises[key];\n                        utils_isPromise(value) ? awaitPromises.push(value.then((function(res) {\n                            result[key] = res;\n                        }))) : result[key] = value;\n                    }\n                };\n                for (var key in promises) _loop(key);\n                return ZalgoPromise.all(awaitPromises).then((function() {\n                    return result;\n                }));\n            };\n            ZalgoPromise.map = function(items, method) {\n                return ZalgoPromise.all(items.map(method));\n            };\n            ZalgoPromise.onPossiblyUnhandledException = function(handler) {\n                return function(handler) {\n                    possiblyUnhandledPromiseHandlers.push(handler);\n                    return {\n                        cancel: function() {\n                            possiblyUnhandledPromiseHandlers.splice(possiblyUnhandledPromiseHandlers.indexOf(handler), 1);\n                        }\n                    };\n                }(handler);\n            };\n            ZalgoPromise.try = function(method, context, args) {\n                if (method && \"function\" != typeof method && !method.call) throw new Error(\"Promise.try expected a function\");\n                var result;\n                startActive();\n                try {\n                    result = method.apply(context, args || []);\n                } catch (err) {\n                    endActive();\n                    return ZalgoPromise.reject(err);\n                }\n                endActive();\n                return ZalgoPromise.resolve(result);\n            };\n            ZalgoPromise.delay = function(_delay) {\n                return new ZalgoPromise((function(resolve) {\n                    setTimeout(resolve, _delay);\n                }));\n            };\n            ZalgoPromise.isPromise = function(value) {\n                return !!(value && value instanceof ZalgoPromise) || utils_isPromise(value);\n            };\n            ZalgoPromise.flush = function() {\n                return function(Zalgo) {\n                    var promise = flushPromise = flushPromise || new Zalgo;\n                    flushActive();\n                    return promise;\n                }(ZalgoPromise);\n            };\n            return ZalgoPromise;\n        }();\n        function isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        var IE_WIN_ACCESS_ERROR = \"Call was rejected by callee.\\r\\n\";\n        function getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return getActualProtocol(win);\n        }\n        function isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === getProtocol(win);\n        }\n        function utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = utils_getParent(win);\n                return parent && canReadFromWindow() ? getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === getProtocol(win);\n                    }(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (getActualDomain(win) === getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                if (getDomain(window) === getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function assertSameDomain(win) {\n            if (!isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (utils_getParent(win) === win) return win;\n            try {\n                if (isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function getAllFramesInWindow(win) {\n            var top = getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], getAllChildFrames(win)));\n            return result;\n        }\n        var iframeWindows = [];\n        var iframeFrames = [];\n        function isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || err.message !== IE_WIN_ACCESS_ERROR;\n            }\n            if (allowMock && isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function getAncestor(win) {\n            void 0 === win && (win = window);\n            return getOpener(win = win || window) || utils_getParent(win) || void 0;\n        }\n        function anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return isRegex(pattern) ? isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !isRegex(origin) && pattern.some((function(subpattern) {\n                return matchDomain(subpattern, origin);\n            })));\n        }\n        function isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getFrameForWindow(win) {\n            if (isSameDomain(win)) return assertSameDomain(win).frameElement;\n            for (var _i21 = 0, _document$querySelect2 = document.querySelectorAll(\"iframe\"); _i21 < _document$querySelect2.length; _i21++) {\n                var frame = _document$querySelect2[_i21];\n                if (frame && frame.contentWindow && frame.contentWindow === win) return frame;\n            }\n        }\n        function closeWindow(win) {\n            if (function(win) {\n                void 0 === win && (win = window);\n                return Boolean(utils_getParent(win));\n            }(win)) {\n                var frame = getFrameForWindow(win);\n                if (frame && frame.parentElement) {\n                    frame.parentElement.removeChild(frame);\n                    return;\n                }\n            }\n            try {\n                win.close();\n            } catch (err) {}\n        }\n        function util_safeIndexOf(collection, item) {\n            for (var i = 0; i < collection.length; i++) try {\n                if (collection[i] === item) return i;\n            } catch (err) {}\n            return -1;\n        }\n        var weakmap_CrossDomainSafeWeakMap = function() {\n            function CrossDomainSafeWeakMap() {\n                this.name = void 0;\n                this.weakmap = void 0;\n                this.keys = void 0;\n                this.values = void 0;\n                this.name = \"__weakmap_\" + (1e9 * Math.random() >>> 0) + \"__\";\n                if (function() {\n                    if (\"undefined\" == typeof WeakMap) return !1;\n                    if (void 0 === Object.freeze) return !1;\n                    try {\n                        var testWeakMap = new WeakMap;\n                        var testKey = {};\n                        Object.freeze(testKey);\n                        testWeakMap.set(testKey, \"__testvalue__\");\n                        return \"__testvalue__\" === testWeakMap.get(testKey);\n                    } catch (err) {\n                        return !1;\n                    }\n                }()) try {\n                    this.weakmap = new WeakMap;\n                } catch (err) {}\n                this.keys = [];\n                this.values = [];\n            }\n            var _proto = CrossDomainSafeWeakMap.prototype;\n            _proto._cleanupClosedWindows = function() {\n                var weakmap = this.weakmap;\n                var keys = this.keys;\n                for (var i = 0; i < keys.length; i++) {\n                    var value = keys[i];\n                    if (isWindow(value) && isWindowClosed(value)) {\n                        if (weakmap) try {\n                            weakmap.delete(value);\n                        } catch (err) {}\n                        keys.splice(i, 1);\n                        this.values.splice(i, 1);\n                        i -= 1;\n                    }\n                }\n            };\n            _proto.isSafeToReadWrite = function(key) {\n                return !isWindow(key);\n            };\n            _proto.set = function(key, value) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.set(key, value);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var name = this.name;\n                    var entry = key[name];\n                    entry && entry[0] === key ? entry[1] = value : Object.defineProperty(key, name, {\n                        value: [ key, value ],\n                        writable: !0\n                    });\n                    return;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var values = this.values;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 === index) {\n                    keys.push(key);\n                    values.push(value);\n                } else values[index] = value;\n            };\n            _proto.get = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return weakmap.get(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return entry && entry[0] === key ? entry[1] : void 0;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var index = util_safeIndexOf(this.keys, key);\n                if (-1 !== index) return this.values[index];\n            };\n            _proto.delete = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.delete(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    entry && entry[0] === key && (entry[0] = entry[1] = void 0);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 !== index) {\n                    keys.splice(index, 1);\n                    this.values.splice(index, 1);\n                }\n            };\n            _proto.has = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return !0;\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return !(!entry || entry[0] !== key);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                return -1 !== util_safeIndexOf(this.keys, key);\n            };\n            _proto.getOrSet = function(key, getter) {\n                if (this.has(key)) return this.get(key);\n                var value = getter();\n                this.set(key, value);\n                return value;\n            };\n            return CrossDomainSafeWeakMap;\n        }();\n        function _getPrototypeOf(o) {\n            return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {\n                return o.__proto__ || Object.getPrototypeOf(o);\n            })(o);\n        }\n        function _isNativeReflectConstruct() {\n            if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n            if (Reflect.construct.sham) return !1;\n            if (\"function\" == typeof Proxy) return !0;\n            try {\n                Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));\n                return !0;\n            } catch (e) {\n                return !1;\n            }\n        }\n        function construct_construct(Parent, args, Class) {\n            return (construct_construct = _isNativeReflectConstruct() ? Reflect.construct : function(Parent, args, Class) {\n                var a = [ null ];\n                a.push.apply(a, args);\n                var instance = new (Function.bind.apply(Parent, a));\n                Class && _setPrototypeOf(instance, Class.prototype);\n                return instance;\n            }).apply(null, arguments);\n        }\n        function wrapNativeSuper_wrapNativeSuper(Class) {\n            var _cache = \"function\" == typeof Map ? new Map : void 0;\n            return (wrapNativeSuper_wrapNativeSuper = function(Class) {\n                if (null === Class || !(fn = Class, -1 !== Function.toString.call(fn).indexOf(\"[native code]\"))) return Class;\n                var fn;\n                if (\"function\" != typeof Class) throw new TypeError(\"Super expression must either be null or a function\");\n                if (void 0 !== _cache) {\n                    if (_cache.has(Class)) return _cache.get(Class);\n                    _cache.set(Class, Wrapper);\n                }\n                function Wrapper() {\n                    return construct_construct(Class, arguments, _getPrototypeOf(this).constructor);\n                }\n                Wrapper.prototype = Object.create(Class.prototype, {\n                    constructor: {\n                        value: Wrapper,\n                        enumerable: !1,\n                        writable: !0,\n                        configurable: !0\n                    }\n                });\n                return _setPrototypeOf(Wrapper, Class);\n            })(Class);\n        }\n        function isElement(element) {\n            var passed = !1;\n            try {\n                (element instanceof window.Element || null !== element && \"object\" == typeof element && 1 === element.nodeType && \"object\" == typeof element.style && \"object\" == typeof element.ownerDocument) && (passed = !0);\n            } catch (_) {}\n            return passed;\n        }\n        function getFunctionName(fn) {\n            return fn.name || fn.__name__ || fn.displayName || \"anonymous\";\n        }\n        function setFunctionName(fn, name) {\n            try {\n                delete fn.name;\n                fn.name = name;\n            } catch (err) {}\n            fn.__name__ = fn.displayName = name;\n            return fn;\n        }\n        function base64encode(str) {\n            if (\"function\" == typeof btoa) return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (function(m, p1) {\n                return String.fromCharCode(parseInt(p1, 16));\n            }))).replace(/[=]/g, \"\");\n            if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"utf8\").toString(\"base64\").replace(/[=]/g, \"\");\n            throw new Error(\"Can not find window.btoa or Buffer\");\n        }\n        function uniqueID() {\n            var chars = \"0123456789abcdef\";\n            return \"uid_\" + \"xxxxxxxxxx\".replace(/./g, (function() {\n                return chars.charAt(Math.floor(Math.random() * chars.length));\n            })) + \"_\" + base64encode((new Date).toISOString().slice(11, 19).replace(\"T\", \".\")).replace(/[^a-zA-Z0-9]/g, \"\").toLowerCase();\n        }\n        var objectIDs;\n        function serializeArgs(args) {\n            try {\n                return JSON.stringify([].slice.call(args), (function(subkey, val) {\n                    return \"function\" == typeof val ? \"memoize[\" + function(obj) {\n                        objectIDs = objectIDs || new weakmap_CrossDomainSafeWeakMap;\n                        if (null == obj || \"object\" != typeof obj && \"function\" != typeof obj) throw new Error(\"Invalid object\");\n                        var uid = objectIDs.get(obj);\n                        if (!uid) {\n                            uid = typeof obj + \":\" + uniqueID();\n                            objectIDs.set(obj, uid);\n                        }\n                        return uid;\n                    }(val) + \"]\" : isElement(val) ? {} : val;\n                }));\n            } catch (err) {\n                throw new Error(\"Arguments not serializable -- can not be used to memoize\");\n            }\n        }\n        function getEmptyObject() {\n            return {};\n        }\n        var memoizeGlobalIndex = 0;\n        var memoizeGlobalIndexValidFrom = 0;\n        function memoize(method, options) {\n            void 0 === options && (options = {});\n            var _options$thisNamespac = options.thisNamespace, thisNamespace = void 0 !== _options$thisNamespac && _options$thisNamespac, cacheTime = options.time;\n            var simpleCache;\n            var thisCache;\n            var memoizeIndex = memoizeGlobalIndex;\n            memoizeGlobalIndex += 1;\n            var memoizedFunction = function() {\n                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                if (memoizeIndex < memoizeGlobalIndexValidFrom) {\n                    simpleCache = null;\n                    thisCache = null;\n                    memoizeIndex = memoizeGlobalIndex;\n                    memoizeGlobalIndex += 1;\n                }\n                var cache;\n                cache = thisNamespace ? (thisCache = thisCache || new weakmap_CrossDomainSafeWeakMap).getOrSet(this, getEmptyObject) : simpleCache = simpleCache || {};\n                var cacheKey;\n                try {\n                    cacheKey = serializeArgs(args);\n                } catch (_unused) {\n                    return method.apply(this, arguments);\n                }\n                var cacheResult = cache[cacheKey];\n                if (cacheResult && cacheTime && Date.now() - cacheResult.time < cacheTime) {\n                    delete cache[cacheKey];\n                    cacheResult = null;\n                }\n                if (cacheResult) return cacheResult.value;\n                var time = Date.now();\n                var value = method.apply(this, arguments);\n                cache[cacheKey] = {\n                    time: time,\n                    value: value\n                };\n                return value;\n            };\n            memoizedFunction.reset = function() {\n                simpleCache = null;\n                thisCache = null;\n            };\n            return setFunctionName(memoizedFunction, (options.name || getFunctionName(method)) + \"::memoized\");\n        }\n        memoize.clear = function() {\n            memoizeGlobalIndexValidFrom = memoizeGlobalIndex;\n        };\n        function memoizePromise(method) {\n            var cache = {};\n            function memoizedPromiseFunction() {\n                var _arguments = arguments, _this = this;\n                for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                var key = serializeArgs(args);\n                if (cache.hasOwnProperty(key)) return cache[key];\n                cache[key] = promise_ZalgoPromise.try((function() {\n                    return method.apply(_this, _arguments);\n                })).finally((function() {\n                    delete cache[key];\n                }));\n                return cache[key];\n            }\n            memoizedPromiseFunction.reset = function() {\n                cache = {};\n            };\n            return setFunctionName(memoizedPromiseFunction, getFunctionName(method) + \"::promiseMemoized\");\n        }\n        function src_util_noop() {}\n        function once(method) {\n            var called = !1;\n            return setFunctionName((function() {\n                if (!called) {\n                    called = !0;\n                    return method.apply(this, arguments);\n                }\n            }), getFunctionName(method) + \"::once\");\n        }\n        function stringifyError(err, level) {\n            void 0 === level && (level = 1);\n            if (level >= 3) return \"stringifyError stack overflow\";\n            try {\n                if (!err) return \"<unknown error: \" + {}.toString.call(err) + \">\";\n                if (\"string\" == typeof err) return err;\n                if (err instanceof Error) {\n                    var stack = err && err.stack;\n                    var message = err && err.message;\n                    if (stack && message) return -1 !== stack.indexOf(message) ? stack : message + \"\\n\" + stack;\n                    if (stack) return stack;\n                    if (message) return message;\n                }\n                return err && err.toString && \"function\" == typeof err.toString ? err.toString() : {}.toString.call(err);\n            } catch (newErr) {\n                return \"Error while stringifying error: \" + stringifyError(newErr, level + 1);\n            }\n        }\n        function stringify(item) {\n            return \"string\" == typeof item ? item : item && item.toString && \"function\" == typeof item.toString ? item.toString() : {}.toString.call(item);\n        }\n        function extend(obj, source) {\n            if (!source) return obj;\n            if (Object.assign) return Object.assign(obj, source);\n            for (var key in source) source.hasOwnProperty(key) && (obj[key] = source[key]);\n            return obj;\n        }\n        memoize((function(obj) {\n            if (Object.values) return Object.values(obj);\n            var result = [];\n            for (var key in obj) obj.hasOwnProperty(key) && result.push(obj[key]);\n            return result;\n        }));\n        function identity(item) {\n            return item;\n        }\n        function safeInterval(method, time) {\n            var timeout;\n            !function loop() {\n                timeout = setTimeout((function() {\n                    method();\n                    loop();\n                }), time);\n            }();\n            return {\n                cancel: function() {\n                    clearTimeout(timeout);\n                }\n            };\n        }\n        function dasherizeToCamel(string) {\n            return string.replace(/-([a-z])/g, (function(g) {\n                return g[1].toUpperCase();\n            }));\n        }\n        function defineLazyProp(obj, key, getter) {\n            if (Array.isArray(obj)) {\n                if (\"number\" != typeof key) throw new TypeError(\"Array key must be number\");\n            } else if (\"object\" == typeof obj && null !== obj && \"string\" != typeof key) throw new TypeError(\"Object key must be string\");\n            Object.defineProperty(obj, key, {\n                configurable: !0,\n                enumerable: !0,\n                get: function() {\n                    delete obj[key];\n                    var value = getter();\n                    obj[key] = value;\n                    return value;\n                },\n                set: function(value) {\n                    delete obj[key];\n                    obj[key] = value;\n                }\n            });\n        }\n        function arrayFrom(item) {\n            return [].slice.call(item);\n        }\n        function isObjectObject(obj) {\n            return \"object\" == typeof (item = obj) && null !== item && \"[object Object]\" === {}.toString.call(obj);\n            var item;\n        }\n        function isPlainObject(obj) {\n            if (!isObjectObject(obj)) return !1;\n            var constructor = obj.constructor;\n            if (\"function\" != typeof constructor) return !1;\n            var prototype = constructor.prototype;\n            return !!isObjectObject(prototype) && !!prototype.hasOwnProperty(\"isPrototypeOf\");\n        }\n        function replaceObject(item, replacer, fullKey) {\n            void 0 === fullKey && (fullKey = \"\");\n            if (Array.isArray(item)) {\n                var length = item.length;\n                var result = [];\n                var _loop2 = function(i) {\n                    defineLazyProp(result, i, (function() {\n                        var itemKey = fullKey ? fullKey + \".\" + i : \"\" + i;\n                        var child = replacer(item[i], i, itemKey);\n                        (isPlainObject(child) || Array.isArray(child)) && (child = replaceObject(child, replacer, itemKey));\n                        return child;\n                    }));\n                };\n                for (var i = 0; i < length; i++) _loop2(i);\n                return result;\n            }\n            if (isPlainObject(item)) {\n                var _result = {};\n                var _loop3 = function(key) {\n                    if (!item.hasOwnProperty(key)) return \"continue\";\n                    defineLazyProp(_result, key, (function() {\n                        var itemKey = fullKey ? fullKey + \".\" + key : \"\" + key;\n                        var child = replacer(item[key], key, itemKey);\n                        (isPlainObject(child) || Array.isArray(child)) && (child = replaceObject(child, replacer, itemKey));\n                        return child;\n                    }));\n                };\n                for (var key in item) _loop3(key);\n                return _result;\n            }\n            throw new Error(\"Pass an object or array\");\n        }\n        function isDefined(value) {\n            return null != value;\n        }\n        function util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function util_getOrSet(obj, key, getter) {\n            if (obj.hasOwnProperty(key)) return obj[key];\n            var val = getter();\n            obj[key] = val;\n            return val;\n        }\n        function cleanup(obj) {\n            var tasks = [];\n            var cleaned = !1;\n            var cleanErr;\n            var cleaner = {\n                set: function(name, item) {\n                    if (!cleaned) {\n                        obj[name] = item;\n                        cleaner.register((function() {\n                            delete obj[name];\n                        }));\n                    }\n                    return item;\n                },\n                register: function(method) {\n                    var task = once((function() {\n                        return method(cleanErr);\n                    }));\n                    cleaned ? method(cleanErr) : tasks.push(task);\n                    return {\n                        cancel: function() {\n                            var index = tasks.indexOf(task);\n                            -1 !== index && tasks.splice(index, 1);\n                        }\n                    };\n                },\n                all: function(err) {\n                    cleanErr = err;\n                    var results = [];\n                    cleaned = !0;\n                    for (;tasks.length; ) {\n                        var task = tasks.shift();\n                        results.push(task());\n                    }\n                    return promise_ZalgoPromise.all(results).then(src_util_noop);\n                }\n            };\n            return cleaner;\n        }\n        function assertExists(name, thing) {\n            if (null == thing) throw new Error(\"Expected \" + name + \" to be present\");\n            return thing;\n        }\n        var util_ExtendableError = function(_Error) {\n            _inheritsLoose(ExtendableError, _Error);\n            function ExtendableError(message) {\n                var _this6;\n                (_this6 = _Error.call(this, message) || this).name = _this6.constructor.name;\n                \"function\" == typeof Error.captureStackTrace ? Error.captureStackTrace(function(self) {\n                    if (void 0 === self) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n                    return self;\n                }(_this6), _this6.constructor) : _this6.stack = new Error(message).stack;\n                return _this6;\n            }\n            return ExtendableError;\n        }(wrapNativeSuper_wrapNativeSuper(Error));\n        function getBody() {\n            var body = document.body;\n            if (!body) throw new Error(\"Body element not found\");\n            return body;\n        }\n        function isDocumentReady() {\n            return Boolean(document.body) && \"complete\" === document.readyState;\n        }\n        function isDocumentInteractive() {\n            return Boolean(document.body) && \"interactive\" === document.readyState;\n        }\n        function urlEncode(str) {\n            return encodeURIComponent(str);\n        }\n        memoize((function() {\n            return new promise_ZalgoPromise((function(resolve) {\n                if (isDocumentReady() || isDocumentInteractive()) return resolve();\n                var interval = setInterval((function() {\n                    if (isDocumentReady() || isDocumentInteractive()) {\n                        clearInterval(interval);\n                        return resolve();\n                    }\n                }), 10);\n            }));\n        }));\n        function parseQuery(queryString) {\n            return function(method, logic, args) {\n                void 0 === args && (args = []);\n                var cache = method.__inline_memoize_cache__ = method.__inline_memoize_cache__ || {};\n                var key = serializeArgs(args);\n                return cache.hasOwnProperty(key) ? cache[key] : cache[key] = function() {\n                    var params = {};\n                    if (!queryString) return params;\n                    if (-1 === queryString.indexOf(\"=\")) return params;\n                    for (var _i2 = 0, _queryString$split2 = queryString.split(\"&\"); _i2 < _queryString$split2.length; _i2++) {\n                        var pair = _queryString$split2[_i2];\n                        (pair = pair.split(\"=\"))[0] && pair[1] && (params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]));\n                    }\n                    return params;\n                }.apply(void 0, args);\n            }(parseQuery, 0, [ queryString ]);\n        }\n        function extendQuery(originalQuery, props) {\n            void 0 === props && (props = {});\n            return props && Object.keys(props).length ? function(obj) {\n                void 0 === obj && (obj = {});\n                return Object.keys(obj).filter((function(key) {\n                    return \"string\" == typeof obj[key] || \"boolean\" == typeof obj[key];\n                })).map((function(key) {\n                    var val = obj[key];\n                    if (\"string\" != typeof val && \"boolean\" != typeof val) throw new TypeError(\"Invalid type for query\");\n                    return urlEncode(key) + \"=\" + urlEncode(val.toString());\n                })).join(\"&\");\n            }(_extends({}, parseQuery(originalQuery), props)) : originalQuery;\n        }\n        function appendChild(container, child) {\n            container.appendChild(child);\n        }\n        function getElementSafe(id, doc) {\n            void 0 === doc && (doc = document);\n            return isElement(id) ? id : \"string\" == typeof id ? doc.querySelector(id) : void 0;\n        }\n        function elementReady(id) {\n            return new promise_ZalgoPromise((function(resolve, reject) {\n                var name = stringify(id);\n                var el = getElementSafe(id);\n                if (el) return resolve(el);\n                if (isDocumentReady()) return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                var interval = setInterval((function() {\n                    if (el = getElementSafe(id)) {\n                        resolve(el);\n                        clearInterval(interval);\n                    } else if (isDocumentReady()) {\n                        clearInterval(interval);\n                        return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                    }\n                }), 10);\n            }));\n        }\n        var dom_PopupOpenError = function(_ExtendableError) {\n            _inheritsLoose(PopupOpenError, _ExtendableError);\n            function PopupOpenError() {\n                return _ExtendableError.apply(this, arguments) || this;\n            }\n            return PopupOpenError;\n        }(util_ExtendableError);\n        var awaitFrameLoadPromises;\n        function awaitFrameLoad(frame) {\n            if ((awaitFrameLoadPromises = awaitFrameLoadPromises || new weakmap_CrossDomainSafeWeakMap).has(frame)) {\n                var _promise = awaitFrameLoadPromises.get(frame);\n                if (_promise) return _promise;\n            }\n            var promise = new promise_ZalgoPromise((function(resolve, reject) {\n                frame.addEventListener(\"load\", (function() {\n                    !function(frame) {\n                        !function() {\n                            for (var i = 0; i < iframeWindows.length; i++) {\n                                var closed = !1;\n                                try {\n                                    closed = iframeWindows[i].closed;\n                                } catch (err) {}\n                                if (closed) {\n                                    iframeFrames.splice(i, 1);\n                                    iframeWindows.splice(i, 1);\n                                }\n                            }\n                        }();\n                        if (frame && frame.contentWindow) try {\n                            iframeWindows.push(frame.contentWindow);\n                            iframeFrames.push(frame);\n                        } catch (err) {}\n                    }(frame);\n                    resolve(frame);\n                }));\n                frame.addEventListener(\"error\", (function(err) {\n                    frame.contentWindow ? resolve(frame) : reject(err);\n                }));\n            }));\n            awaitFrameLoadPromises.set(frame, promise);\n            return promise;\n        }\n        function awaitFrameWindow(frame) {\n            return awaitFrameLoad(frame).then((function(loadedFrame) {\n                if (!loadedFrame.contentWindow) throw new Error(\"Could not find window in iframe\");\n                return loadedFrame.contentWindow;\n            }));\n        }\n        function dom_iframe(options, container) {\n            void 0 === options && (options = {});\n            var style = options.style || {};\n            var frame = function(tag, options, container) {\n                void 0 === tag && (tag = \"div\");\n                void 0 === options && (options = {});\n                tag = tag.toLowerCase();\n                var element = document.createElement(tag);\n                options.style && extend(element.style, options.style);\n                options.class && (element.className = options.class.join(\" \"));\n                options.id && element.setAttribute(\"id\", options.id);\n                if (options.attributes) for (var _i10 = 0, _Object$keys2 = Object.keys(options.attributes); _i10 < _Object$keys2.length; _i10++) {\n                    var key = _Object$keys2[_i10];\n                    element.setAttribute(key, options.attributes[key]);\n                }\n                options.styleSheet && function(el, styleText, doc) {\n                    void 0 === doc && (doc = window.document);\n                    el.styleSheet ? el.styleSheet.cssText = styleText : el.appendChild(doc.createTextNode(styleText));\n                }(element, options.styleSheet);\n                if (options.html) {\n                    if (\"iframe\" === tag) throw new Error(\"Iframe html can not be written unless container provided and iframe in DOM\");\n                    element.innerHTML = options.html;\n                }\n                return element;\n            }(\"iframe\", {\n                attributes: _extends({\n                    allowTransparency: \"true\"\n                }, options.attributes || {}),\n                style: _extends({\n                    backgroundColor: \"transparent\",\n                    border: \"none\"\n                }, style),\n                html: options.html,\n                class: options.class\n            });\n            var isIE = window.navigator.userAgent.match(/MSIE|Edge/i);\n            frame.hasAttribute(\"id\") || frame.setAttribute(\"id\", uniqueID());\n            awaitFrameLoad(frame);\n            container && function(id, doc) {\n                void 0 === doc && (doc = document);\n                var element = getElementSafe(id, doc);\n                if (element) return element;\n                throw new Error(\"Can not find element: \" + stringify(id));\n            }(container).appendChild(frame);\n            (options.url || isIE) && frame.setAttribute(\"src\", options.url || \"about:blank\");\n            return frame;\n        }\n        function addEventListener(obj, event, handler) {\n            obj.addEventListener(event, handler);\n            return {\n                cancel: function() {\n                    obj.removeEventListener(event, handler);\n                }\n            };\n        }\n        function showElement(element) {\n            element.style.setProperty(\"display\", \"\");\n        }\n        function hideElement(element) {\n            element.style.setProperty(\"display\", \"none\", \"important\");\n        }\n        function destroyElement(element) {\n            element && element.parentNode && element.parentNode.removeChild(element);\n        }\n        function isElementClosed(el) {\n            return !(el && el.parentNode && el.ownerDocument && el.ownerDocument.documentElement && el.ownerDocument.documentElement.contains(el));\n        }\n        function onResize(el, handler, _temp) {\n            var _ref2 = void 0 === _temp ? {} : _temp, _ref2$width = _ref2.width, width = void 0 === _ref2$width || _ref2$width, _ref2$height = _ref2.height, height = void 0 === _ref2$height || _ref2$height, _ref2$interval = _ref2.interval, interval = void 0 === _ref2$interval ? 100 : _ref2$interval, _ref2$win = _ref2.win, win = void 0 === _ref2$win ? window : _ref2$win;\n            var currentWidth = el.offsetWidth;\n            var currentHeight = el.offsetHeight;\n            var canceled = !1;\n            handler({\n                width: currentWidth,\n                height: currentHeight\n            });\n            var check = function() {\n                if (!canceled && function(el) {\n                    return Boolean(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n                }(el)) {\n                    var newWidth = el.offsetWidth;\n                    var newHeight = el.offsetHeight;\n                    (width && newWidth !== currentWidth || height && newHeight !== currentHeight) && handler({\n                        width: newWidth,\n                        height: newHeight\n                    });\n                    currentWidth = newWidth;\n                    currentHeight = newHeight;\n                }\n            };\n            var observer;\n            var timeout;\n            win.addEventListener(\"resize\", check);\n            if (void 0 !== win.ResizeObserver) {\n                (observer = new win.ResizeObserver(check)).observe(el);\n                timeout = safeInterval(check, 10 * interval);\n            } else if (void 0 !== win.MutationObserver) {\n                (observer = new win.MutationObserver(check)).observe(el, {\n                    attributes: !0,\n                    childList: !0,\n                    subtree: !0,\n                    characterData: !1\n                });\n                timeout = safeInterval(check, 10 * interval);\n            } else timeout = safeInterval(check, interval);\n            return {\n                cancel: function() {\n                    canceled = !0;\n                    observer.disconnect();\n                    window.removeEventListener(\"resize\", check);\n                    timeout.cancel();\n                }\n            };\n        }\n        function isShadowElement(element) {\n            for (;element.parentNode; ) element = element.parentNode;\n            return \"[object ShadowRoot]\" === element.toString();\n        }\n        var currentScript = \"undefined\" != typeof document ? document.currentScript : null;\n        var getCurrentScript = memoize((function() {\n            if (currentScript) return currentScript;\n            if (currentScript = function() {\n                try {\n                    var stack = function() {\n                        try {\n                            throw new Error(\"_\");\n                        } catch (err) {\n                            return err.stack || \"\";\n                        }\n                    }();\n                    var stackDetails = /.*at [^(]*\\((.*):(.+):(.+)\\)$/gi.exec(stack);\n                    var scriptLocation = stackDetails && stackDetails[1];\n                    if (!scriptLocation) return;\n                    for (var _i22 = 0, _Array$prototype$slic2 = [].slice.call(document.getElementsByTagName(\"script\")).reverse(); _i22 < _Array$prototype$slic2.length; _i22++) {\n                        var script = _Array$prototype$slic2[_i22];\n                        if (script.src && script.src === scriptLocation) return script;\n                    }\n                } catch (err) {}\n            }()) return currentScript;\n            throw new Error(\"Can not determine current script\");\n        }));\n        var currentUID = uniqueID();\n        memoize((function() {\n            var script;\n            try {\n                script = getCurrentScript();\n            } catch (err) {\n                return currentUID;\n            }\n            var uid = script.getAttribute(\"data-uid\");\n            if (uid && \"string\" == typeof uid) return uid;\n            if ((uid = script.getAttribute(\"data-uid-auto\")) && \"string\" == typeof uid) return uid;\n            if (script.src) {\n                var hashedString = function(str) {\n                    var hash = \"\";\n                    for (var i = 0; i < str.length; i++) {\n                        var total = str[i].charCodeAt(0) * i;\n                        str[i + 1] && (total += str[i + 1].charCodeAt(0) * (i - 1));\n                        hash += String.fromCharCode(97 + Math.abs(total) % 26);\n                    }\n                    return hash;\n                }(JSON.stringify({\n                    src: script.src,\n                    dataset: script.dataset\n                }));\n                uid = \"uid_\" + hashedString.slice(hashedString.length - 30);\n            } else uid = uniqueID();\n            script.setAttribute(\"data-uid-auto\", uid);\n            return uid;\n        }));\n        function toPx(val) {\n            return function(val) {\n                if (\"number\" == typeof val) return val;\n                var match = val.match(/^([0-9]+)(px|%)$/);\n                if (!match) throw new Error(\"Could not match css value from \" + val);\n                return parseInt(match[1], 10);\n            }(val) + \"px\";\n        }\n        function toCSS(val) {\n            return \"number\" == typeof val ? toPx(val) : \"string\" == typeof (str = val) && /^[0-9]+%$/.test(str) ? val : toPx(val);\n            var str;\n        }\n        function global_getGlobal(win) {\n            void 0 === win && (win = window);\n            var globalKey = \"__post_robot_10_0_46__\";\n            return win !== window ? win[globalKey] : win[globalKey] = win[globalKey] || {};\n        }\n        var getObj = function() {\n            return {};\n        };\n        function globalStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return util_getOrSet(global_getGlobal(), key, (function() {\n                var store = defStore();\n                return {\n                    has: function(storeKey) {\n                        return store.hasOwnProperty(storeKey);\n                    },\n                    get: function(storeKey, defVal) {\n                        return store.hasOwnProperty(storeKey) ? store[storeKey] : defVal;\n                    },\n                    set: function(storeKey, val) {\n                        store[storeKey] = val;\n                        return val;\n                    },\n                    del: function(storeKey) {\n                        delete store[storeKey];\n                    },\n                    getOrSet: function(storeKey, getter) {\n                        return util_getOrSet(store, storeKey, getter);\n                    },\n                    reset: function() {\n                        store = defStore();\n                    },\n                    keys: function() {\n                        return Object.keys(store);\n                    }\n                };\n            }));\n        }\n        var WildCard = function() {};\n        function getWildcard() {\n            var global = global_getGlobal();\n            global.WINDOW_WILDCARD = global.WINDOW_WILDCARD || new WildCard;\n            return global.WINDOW_WILDCARD;\n        }\n        function windowStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return globalStore(\"windowStore\").getOrSet(key, (function() {\n                var winStore = new weakmap_CrossDomainSafeWeakMap;\n                var getStore = function(win) {\n                    return winStore.getOrSet(win, defStore);\n                };\n                return {\n                    has: function(win) {\n                        return getStore(win).hasOwnProperty(key);\n                    },\n                    get: function(win, defVal) {\n                        var store = getStore(win);\n                        return store.hasOwnProperty(key) ? store[key] : defVal;\n                    },\n                    set: function(win, val) {\n                        getStore(win)[key] = val;\n                        return val;\n                    },\n                    del: function(win) {\n                        delete getStore(win)[key];\n                    },\n                    getOrSet: function(win, getter) {\n                        return util_getOrSet(getStore(win), key, getter);\n                    }\n                };\n            }));\n        }\n        function getInstanceID() {\n            return globalStore(\"instance\").getOrSet(\"instanceID\", uniqueID);\n        }\n        function resolveHelloPromise(win, _ref) {\n            var domain = _ref.domain;\n            var helloPromises = windowStore(\"helloPromises\");\n            var existingPromise = helloPromises.get(win);\n            existingPromise && existingPromise.resolve({\n                domain: domain\n            });\n            var newPromise = promise_ZalgoPromise.resolve({\n                domain: domain\n            });\n            helloPromises.set(win, newPromise);\n            return newPromise;\n        }\n        function sayHello(win, _ref4) {\n            return (0, _ref4.send)(win, \"postrobot_hello\", {\n                instanceID: getInstanceID()\n            }, {\n                domain: \"*\",\n                timeout: -1\n            }).then((function(_ref5) {\n                var origin = _ref5.origin, instanceID = _ref5.data.instanceID;\n                resolveHelloPromise(win, {\n                    domain: origin\n                });\n                return {\n                    win: win,\n                    domain: origin,\n                    instanceID: instanceID\n                };\n            }));\n        }\n        function getWindowInstanceID(win, _ref6) {\n            var send = _ref6.send;\n            return windowStore(\"windowInstanceIDPromises\").getOrSet(win, (function() {\n                return sayHello(win, {\n                    send: send\n                }).then((function(_ref7) {\n                    return _ref7.instanceID;\n                }));\n            }));\n        }\n        function markWindowKnown(win) {\n            windowStore(\"knownWindows\").set(win, !0);\n        }\n        function isSerializedType(item) {\n            return \"object\" == typeof item && null !== item && \"string\" == typeof item.__type__;\n        }\n        function determineType(val) {\n            return void 0 === val ? \"undefined\" : null === val ? \"null\" : Array.isArray(val) ? \"array\" : \"function\" == typeof val ? \"function\" : \"object\" == typeof val ? val instanceof Error ? \"error\" : \"function\" == typeof val.then ? \"promise\" : \"[object RegExp]\" === {}.toString.call(val) ? \"regex\" : \"[object Date]\" === {}.toString.call(val) ? \"date\" : \"object\" : \"string\" == typeof val ? \"string\" : \"number\" == typeof val ? \"number\" : \"boolean\" == typeof val ? \"boolean\" : void 0;\n        }\n        function serializeType(type, val) {\n            return {\n                __type__: type,\n                __val__: val\n            };\n        }\n        var _SERIALIZER;\n        var SERIALIZER = ((_SERIALIZER = {}).function = function() {}, _SERIALIZER.error = function(_ref) {\n            return serializeType(\"error\", {\n                message: _ref.message,\n                stack: _ref.stack,\n                code: _ref.code,\n                data: _ref.data\n            });\n        }, _SERIALIZER.promise = function() {}, _SERIALIZER.regex = function(val) {\n            return serializeType(\"regex\", val.source);\n        }, _SERIALIZER.date = function(val) {\n            return serializeType(\"date\", val.toJSON());\n        }, _SERIALIZER.array = function(val) {\n            return val;\n        }, _SERIALIZER.object = function(val) {\n            return val;\n        }, _SERIALIZER.string = function(val) {\n            return val;\n        }, _SERIALIZER.number = function(val) {\n            return val;\n        }, _SERIALIZER.boolean = function(val) {\n            return val;\n        }, _SERIALIZER.null = function(val) {\n            return val;\n        }, _SERIALIZER[void 0] = function(val) {\n            return serializeType(\"undefined\", val);\n        }, _SERIALIZER);\n        var defaultSerializers = {};\n        var _DESERIALIZER;\n        var DESERIALIZER = ((_DESERIALIZER = {}).function = function() {\n            throw new Error(\"Function serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.error = function(_ref2) {\n            var stack = _ref2.stack, code = _ref2.code, data = _ref2.data;\n            var error = new Error(_ref2.message);\n            error.code = code;\n            data && (error.data = data);\n            error.stack = stack + \"\\n\\n\" + error.stack;\n            return error;\n        }, _DESERIALIZER.promise = function() {\n            throw new Error(\"Promise serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.regex = function(val) {\n            return new RegExp(val);\n        }, _DESERIALIZER.date = function(val) {\n            return new Date(val);\n        }, _DESERIALIZER.array = function(val) {\n            return val;\n        }, _DESERIALIZER.object = function(val) {\n            return val;\n        }, _DESERIALIZER.string = function(val) {\n            return val;\n        }, _DESERIALIZER.number = function(val) {\n            return val;\n        }, _DESERIALIZER.boolean = function(val) {\n            return val;\n        }, _DESERIALIZER.null = function(val) {\n            return val;\n        }, _DESERIALIZER[void 0] = function() {}, _DESERIALIZER);\n        var defaultDeserializers = {};\n        new promise_ZalgoPromise((function(resolve) {\n            if (window.document && window.document.body) return resolve(window.document.body);\n            var interval = setInterval((function() {\n                if (window.document && window.document.body) {\n                    clearInterval(interval);\n                    return resolve(window.document.body);\n                }\n            }), 10);\n        }));\n        function cleanupProxyWindows() {\n            var idToProxyWindow = globalStore(\"idToProxyWindow\");\n            for (var _i2 = 0, _idToProxyWindow$keys2 = idToProxyWindow.keys(); _i2 < _idToProxyWindow$keys2.length; _i2++) {\n                var id = _idToProxyWindow$keys2[_i2];\n                idToProxyWindow.get(id).shouldClean() && idToProxyWindow.del(id);\n            }\n        }\n        function getSerializedWindow(winPromise, _ref) {\n            var send = _ref.send, _ref$id = _ref.id, id = void 0 === _ref$id ? uniqueID() : _ref$id;\n            var windowNamePromise = winPromise.then((function(win) {\n                if (isSameDomain(win)) return assertSameDomain(win).name;\n            }));\n            var windowTypePromise = winPromise.then((function(window) {\n                if (isWindowClosed(window)) throw new Error(\"Window is closed, can not determine type\");\n                return getOpener(window) ? \"popup\" : \"iframe\";\n            }));\n            windowNamePromise.catch(src_util_noop);\n            windowTypePromise.catch(src_util_noop);\n            var getName = function() {\n                return winPromise.then((function(win) {\n                    if (!isWindowClosed(win)) return isSameDomain(win) ? assertSameDomain(win).name : windowNamePromise;\n                }));\n            };\n            return {\n                id: id,\n                getType: function() {\n                    return windowTypePromise;\n                },\n                getInstanceID: memoizePromise((function() {\n                    return winPromise.then((function(win) {\n                        return getWindowInstanceID(win, {\n                            send: send\n                        });\n                    }));\n                })),\n                close: function() {\n                    return winPromise.then(closeWindow);\n                },\n                getName: getName,\n                focus: function() {\n                    return winPromise.then((function(win) {\n                        win.focus();\n                    }));\n                },\n                isClosed: function() {\n                    return winPromise.then((function(win) {\n                        return isWindowClosed(win);\n                    }));\n                },\n                setLocation: function(href, opts) {\n                    void 0 === opts && (opts = {});\n                    return winPromise.then((function(win) {\n                        var domain = window.location.protocol + \"//\" + window.location.host;\n                        var _opts$method = opts.method, method = void 0 === _opts$method ? \"get\" : _opts$method, body = opts.body;\n                        if (0 === href.indexOf(\"/\")) href = \"\" + domain + href; else if (!href.match(/^https?:\\/\\//) && 0 !== href.indexOf(domain)) throw new Error(\"Expected url to be http or https url, or absolute path, got \" + JSON.stringify(href));\n                        if (\"post\" === method) return getName().then((function(name) {\n                            if (!name) throw new Error(\"Can not post to window without target name\");\n                            !function(_ref3) {\n                                var url = _ref3.url, target = _ref3.target, body = _ref3.body, _ref3$method = _ref3.method, method = void 0 === _ref3$method ? \"post\" : _ref3$method;\n                                var form = document.createElement(\"form\");\n                                form.setAttribute(\"target\", target);\n                                form.setAttribute(\"method\", method);\n                                form.setAttribute(\"action\", url);\n                                form.style.display = \"none\";\n                                if (body) for (var _i24 = 0, _Object$keys4 = Object.keys(body); _i24 < _Object$keys4.length; _i24++) {\n                                    var _body$key;\n                                    var key = _Object$keys4[_i24];\n                                    var input = document.createElement(\"input\");\n                                    input.setAttribute(\"name\", key);\n                                    input.setAttribute(\"value\", null == (_body$key = body[key]) ? void 0 : _body$key.toString());\n                                    form.appendChild(input);\n                                }\n                                getBody().appendChild(form);\n                                form.submit();\n                                getBody().removeChild(form);\n                            }({\n                                url: href,\n                                target: name,\n                                method: method,\n                                body: body\n                            });\n                        }));\n                        if (\"get\" !== method) throw new Error(\"Unsupported method: \" + method);\n                        if (isSameDomain(win)) try {\n                            if (win.location && \"function\" == typeof win.location.replace) {\n                                win.location.replace(href);\n                                return;\n                            }\n                        } catch (err) {}\n                        win.location = href;\n                    }));\n                },\n                setName: function(name) {\n                    return winPromise.then((function(win) {\n                        var sameDomain = isSameDomain(win);\n                        var frame = getFrameForWindow(win);\n                        if (!sameDomain) throw new Error(\"Can not set name for cross-domain window: \" + name);\n                        assertSameDomain(win).name = name;\n                        frame && frame.setAttribute(\"name\", name);\n                        windowNamePromise = promise_ZalgoPromise.resolve(name);\n                    }));\n                }\n            };\n        }\n        var window_ProxyWindow = function() {\n            function ProxyWindow(_ref2) {\n                var send = _ref2.send, win = _ref2.win, serializedWindow = _ref2.serializedWindow;\n                this.id = void 0;\n                this.isProxyWindow = !0;\n                this.serializedWindow = void 0;\n                this.actualWindow = void 0;\n                this.actualWindowPromise = void 0;\n                this.send = void 0;\n                this.name = void 0;\n                this.actualWindowPromise = new promise_ZalgoPromise;\n                this.serializedWindow = serializedWindow || getSerializedWindow(this.actualWindowPromise, {\n                    send: send\n                });\n                globalStore(\"idToProxyWindow\").set(this.getID(), this);\n                win && this.setWindow(win, {\n                    send: send\n                });\n            }\n            var _proto = ProxyWindow.prototype;\n            _proto.getID = function() {\n                return this.serializedWindow.id;\n            };\n            _proto.getType = function() {\n                return this.serializedWindow.getType();\n            };\n            _proto.isPopup = function() {\n                return this.getType().then((function(type) {\n                    return \"popup\" === type;\n                }));\n            };\n            _proto.setLocation = function(href, opts) {\n                var _this = this;\n                return this.serializedWindow.setLocation(href, opts).then((function() {\n                    return _this;\n                }));\n            };\n            _proto.getName = function() {\n                return this.serializedWindow.getName();\n            };\n            _proto.setName = function(name) {\n                var _this2 = this;\n                return this.serializedWindow.setName(name).then((function() {\n                    return _this2;\n                }));\n            };\n            _proto.close = function() {\n                var _this3 = this;\n                return this.serializedWindow.close().then((function() {\n                    return _this3;\n                }));\n            };\n            _proto.focus = function() {\n                var _this4 = this;\n                var isPopupPromise = this.isPopup();\n                var getNamePromise = this.getName();\n                var reopenPromise = promise_ZalgoPromise.hash({\n                    isPopup: isPopupPromise,\n                    name: getNamePromise\n                }).then((function(_ref3) {\n                    var name = _ref3.name;\n                    _ref3.isPopup && name && window.open(\"\", name, \"noopener\");\n                }));\n                var focusPromise = this.serializedWindow.focus();\n                return promise_ZalgoPromise.all([ reopenPromise, focusPromise ]).then((function() {\n                    return _this4;\n                }));\n            };\n            _proto.isClosed = function() {\n                return this.serializedWindow.isClosed();\n            };\n            _proto.getWindow = function() {\n                return this.actualWindow;\n            };\n            _proto.setWindow = function(win, _ref4) {\n                var send = _ref4.send;\n                this.actualWindow = win;\n                this.actualWindowPromise.resolve(this.actualWindow);\n                this.serializedWindow = getSerializedWindow(this.actualWindowPromise, {\n                    send: send,\n                    id: this.getID()\n                });\n                windowStore(\"winToProxyWindow\").set(win, this);\n            };\n            _proto.awaitWindow = function() {\n                return this.actualWindowPromise;\n            };\n            _proto.matchWindow = function(win, _ref5) {\n                var _this5 = this;\n                var send = _ref5.send;\n                return promise_ZalgoPromise.try((function() {\n                    return _this5.actualWindow ? win === _this5.actualWindow : promise_ZalgoPromise.hash({\n                        proxyInstanceID: _this5.getInstanceID(),\n                        knownWindowInstanceID: getWindowInstanceID(win, {\n                            send: send\n                        })\n                    }).then((function(_ref6) {\n                        var match = _ref6.proxyInstanceID === _ref6.knownWindowInstanceID;\n                        match && _this5.setWindow(win, {\n                            send: send\n                        });\n                        return match;\n                    }));\n                }));\n            };\n            _proto.unwrap = function() {\n                return this.actualWindow || this;\n            };\n            _proto.getInstanceID = function() {\n                return this.serializedWindow.getInstanceID();\n            };\n            _proto.shouldClean = function() {\n                return Boolean(this.actualWindow && isWindowClosed(this.actualWindow));\n            };\n            _proto.serialize = function() {\n                return this.serializedWindow;\n            };\n            ProxyWindow.unwrap = function(win) {\n                return ProxyWindow.isProxyWindow(win) ? win.unwrap() : win;\n            };\n            ProxyWindow.serialize = function(win, _ref7) {\n                var send = _ref7.send;\n                cleanupProxyWindows();\n                return ProxyWindow.toProxyWindow(win, {\n                    send: send\n                }).serialize();\n            };\n            ProxyWindow.deserialize = function(serializedWindow, _ref8) {\n                var send = _ref8.send;\n                cleanupProxyWindows();\n                return globalStore(\"idToProxyWindow\").get(serializedWindow.id) || new ProxyWindow({\n                    serializedWindow: serializedWindow,\n                    send: send\n                });\n            };\n            ProxyWindow.isProxyWindow = function(obj) {\n                return Boolean(obj && !isWindow(obj) && obj.isProxyWindow);\n            };\n            ProxyWindow.toProxyWindow = function(win, _ref9) {\n                var send = _ref9.send;\n                cleanupProxyWindows();\n                if (ProxyWindow.isProxyWindow(win)) return win;\n                var actualWindow = win;\n                return windowStore(\"winToProxyWindow\").get(actualWindow) || new ProxyWindow({\n                    win: actualWindow,\n                    send: send\n                });\n            };\n            return ProxyWindow;\n        }();\n        function addMethod(id, val, name, source, domain) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            if (window_ProxyWindow.isProxyWindow(source)) proxyWindowMethods.set(id, {\n                val: val,\n                name: name,\n                domain: domain,\n                source: source\n            }); else {\n                proxyWindowMethods.del(id);\n                methodStore.getOrSet(source, (function() {\n                    return {};\n                }))[id] = {\n                    domain: domain,\n                    name: name,\n                    val: val,\n                    source: source\n                };\n            }\n        }\n        function lookupMethod(source, id) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            return methodStore.getOrSet(source, (function() {\n                return {};\n            }))[id] || proxyWindowMethods.get(id);\n        }\n        function function_serializeFunction(destination, domain, val, key, _ref3) {\n            on = (_ref = {\n                on: _ref3.on,\n                send: _ref3.send\n            }).on, send = _ref.send, globalStore(\"builtinListeners\").getOrSet(\"functionCalls\", (function() {\n                return on(\"postrobot_method\", {\n                    domain: \"*\"\n                }, (function(_ref2) {\n                    var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                    var id = data.id, name = data.name;\n                    var meth = lookupMethod(source, id);\n                    if (!meth) throw new Error(\"Could not find method '\" + name + \"' with id: \" + data.id + \" in \" + getDomain(window));\n                    var methodSource = meth.source, domain = meth.domain, val = meth.val;\n                    return promise_ZalgoPromise.try((function() {\n                        if (!matchDomain(domain, origin)) throw new Error(\"Method '\" + data.name + \"' domain \" + JSON.stringify(util_isRegex(meth.domain) ? meth.domain.source : meth.domain) + \" does not match origin \" + origin + \" in \" + getDomain(window));\n                        if (window_ProxyWindow.isProxyWindow(methodSource)) return methodSource.matchWindow(source, {\n                            send: send\n                        }).then((function(match) {\n                            if (!match) throw new Error(\"Method call '\" + data.name + \"' failed - proxy window does not match source in \" + getDomain(window));\n                        }));\n                    })).then((function() {\n                        return val.apply({\n                            source: source,\n                            origin: origin\n                        }, data.args);\n                    }), (function(err) {\n                        return promise_ZalgoPromise.try((function() {\n                            if (val.onError) return val.onError(err);\n                        })).then((function() {\n                            err.stack && (err.stack = \"Remote call to \" + name + \"(\" + function(args) {\n                                void 0 === args && (args = []);\n                                return arrayFrom(args).map((function(arg) {\n                                    return \"string\" == typeof arg ? \"'\" + arg + \"'\" : void 0 === arg ? \"undefined\" : null === arg ? \"null\" : \"boolean\" == typeof arg ? arg.toString() : Array.isArray(arg) ? \"[ ... ]\" : \"object\" == typeof arg ? \"{ ... }\" : \"function\" == typeof arg ? \"() => { ... }\" : \"<\" + typeof arg + \">\";\n                                })).join(\", \");\n                            }(data.args) + \") failed\\n\\n\" + err.stack);\n                            throw err;\n                        }));\n                    })).then((function(result) {\n                        return {\n                            result: result,\n                            id: id,\n                            name: name\n                        };\n                    }));\n                }));\n            }));\n            var _ref, on, send;\n            var id = val.__id__ || uniqueID();\n            destination = window_ProxyWindow.unwrap(destination);\n            var name = val.__name__ || val.name || key;\n            \"string\" == typeof name && \"function\" == typeof name.indexOf && 0 === name.indexOf(\"anonymous::\") && (name = name.replace(\"anonymous::\", key + \"::\"));\n            if (window_ProxyWindow.isProxyWindow(destination)) {\n                addMethod(id, val, name, destination, domain);\n                destination.awaitWindow().then((function(win) {\n                    addMethod(id, val, name, win, domain);\n                }));\n            } else addMethod(id, val, name, destination, domain);\n            return serializeType(\"cross_domain_function\", {\n                id: id,\n                name: name\n            });\n        }\n        function serializeMessage(destination, domain, obj, _ref) {\n            var _serialize;\n            var on = _ref.on, send = _ref.send;\n            return function(obj, serializers) {\n                void 0 === serializers && (serializers = defaultSerializers);\n                var result = JSON.stringify(obj, (function(key) {\n                    var val = this[key];\n                    if (isSerializedType(this)) return val;\n                    var type = determineType(val);\n                    if (!type) return val;\n                    var serializer = serializers[type] || SERIALIZER[type];\n                    return serializer ? serializer(val, key) : val;\n                }));\n                return void 0 === result ? \"undefined\" : result;\n            }(obj, ((_serialize = {}).promise = function(val, key) {\n                return function(destination, domain, val, key, _ref) {\n                    return serializeType(\"cross_domain_zalgo_promise\", {\n                        then: function_serializeFunction(destination, domain, (function(resolve, reject) {\n                            return val.then(resolve, reject);\n                        }), key, {\n                            on: _ref.on,\n                            send: _ref.send\n                        })\n                    });\n                }(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.function = function(val, key) {\n                return function_serializeFunction(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.object = function(val) {\n                return isWindow(val) || window_ProxyWindow.isProxyWindow(val) ? serializeType(\"cross_domain_window\", window_ProxyWindow.serialize(val, {\n                    send: send\n                })) : val;\n            }, _serialize));\n        }\n        function deserializeMessage(source, origin, message, _ref2) {\n            var _deserialize;\n            var send = _ref2.send;\n            return function(str, deserializers) {\n                void 0 === deserializers && (deserializers = defaultDeserializers);\n                if (\"undefined\" !== str) return JSON.parse(str, (function(key, val) {\n                    if (isSerializedType(this)) return val;\n                    var type;\n                    var value;\n                    if (isSerializedType(val)) {\n                        type = val.__type__;\n                        value = val.__val__;\n                    } else {\n                        type = determineType(val);\n                        value = val;\n                    }\n                    if (!type) return value;\n                    var deserializer = deserializers[type] || DESERIALIZER[type];\n                    return deserializer ? deserializer(value, key) : value;\n                }));\n            }(message, ((_deserialize = {}).cross_domain_zalgo_promise = function(serializedPromise) {\n                return function(source, origin, _ref2) {\n                    return new promise_ZalgoPromise(_ref2.then);\n                }(0, 0, serializedPromise);\n            }, _deserialize.cross_domain_function = function(serializedFunction) {\n                return function(source, origin, _ref4, _ref5) {\n                    var id = _ref4.id, name = _ref4.name;\n                    var send = _ref5.send;\n                    var getDeserializedFunction = function(opts) {\n                        void 0 === opts && (opts = {});\n                        function crossDomainFunctionWrapper() {\n                            var _arguments = arguments;\n                            return window_ProxyWindow.toProxyWindow(source, {\n                                send: send\n                            }).awaitWindow().then((function(win) {\n                                var meth = lookupMethod(win, id);\n                                if (meth && meth.val !== crossDomainFunctionWrapper) return meth.val.apply({\n                                    source: window,\n                                    origin: getDomain()\n                                }, _arguments);\n                                var _args = [].slice.call(_arguments);\n                                return opts.fireAndForget ? send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !0\n                                }) : send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !1\n                                }).then((function(res) {\n                                    return res.data.result;\n                                }));\n                            })).catch((function(err) {\n                                throw err;\n                            }));\n                        }\n                        crossDomainFunctionWrapper.__name__ = name;\n                        crossDomainFunctionWrapper.__origin__ = origin;\n                        crossDomainFunctionWrapper.__source__ = source;\n                        crossDomainFunctionWrapper.__id__ = id;\n                        crossDomainFunctionWrapper.origin = origin;\n                        return crossDomainFunctionWrapper;\n                    };\n                    var crossDomainFunctionWrapper = getDeserializedFunction();\n                    crossDomainFunctionWrapper.fireAndForget = getDeserializedFunction({\n                        fireAndForget: !0\n                    });\n                    return crossDomainFunctionWrapper;\n                }(source, origin, serializedFunction, {\n                    send: send\n                });\n            }, _deserialize.cross_domain_window = function(serializedWindow) {\n                return window_ProxyWindow.deserialize(serializedWindow, {\n                    send: send\n                });\n            }, _deserialize));\n        }\n        var SEND_MESSAGE_STRATEGIES = {};\n        SEND_MESSAGE_STRATEGIES.postrobot_post_message = function(win, serializedMessage, domain) {\n            0 === domain.indexOf(\"file:\") && (domain = \"*\");\n            win.postMessage(serializedMessage, domain);\n        };\n        SEND_MESSAGE_STRATEGIES.postrobot_global = function(win, serializedMessage) {\n            if (!function(win) {\n                return (win = win || window).navigator.mockUserAgent || win.navigator.userAgent;\n            }(window).match(/MSIE|rv:11|trident|edge\\/12|edge\\/13/i)) throw new Error(\"Global messaging not needed for browser\");\n            if (!isSameDomain(win)) throw new Error(\"Post message through global disabled between different domain windows\");\n            if (!1 !== function(win1, win2) {\n                var top1 = getTop(win1) || win1;\n                var top2 = getTop(win2) || win2;\n                try {\n                    if (top1 && top2) return top1 === top2;\n                } catch (err) {}\n                var allFrames1 = getAllFramesInWindow(win1);\n                var allFrames2 = getAllFramesInWindow(win2);\n                if (anyMatch(allFrames1, allFrames2)) return !0;\n                var opener1 = getOpener(top1);\n                var opener2 = getOpener(top2);\n                return opener1 && anyMatch(getAllFramesInWindow(opener1), allFrames2) || opener2 && anyMatch(getAllFramesInWindow(opener2), allFrames1), \n                !1;\n            }(window, win)) throw new Error(\"Can only use global to communicate between two different windows, not between frames\");\n            var foreignGlobal = global_getGlobal(win);\n            if (!foreignGlobal) throw new Error(\"Can not find postRobot global on foreign window\");\n            foreignGlobal.receiveMessage({\n                source: window,\n                origin: getDomain(),\n                data: serializedMessage\n            });\n        };\n        function send_sendMessage(win, domain, message, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            return promise_ZalgoPromise.try((function() {\n                var domainBuffer = windowStore().getOrSet(win, (function() {\n                    return {};\n                }));\n                domainBuffer.buffer = domainBuffer.buffer || [];\n                domainBuffer.buffer.push(message);\n                domainBuffer.flush = domainBuffer.flush || promise_ZalgoPromise.flush().then((function() {\n                    if (isWindowClosed(win)) throw new Error(\"Window is closed\");\n                    var serializedMessage = serializeMessage(win, domain, ((_ref = {}).__post_robot_10_0_46__ = domainBuffer.buffer || [], \n                    _ref), {\n                        on: on,\n                        send: send\n                    });\n                    var _ref;\n                    delete domainBuffer.buffer;\n                    var strategies = Object.keys(SEND_MESSAGE_STRATEGIES);\n                    var errors = [];\n                    for (var _i2 = 0; _i2 < strategies.length; _i2++) {\n                        var strategyName = strategies[_i2];\n                        try {\n                            SEND_MESSAGE_STRATEGIES[strategyName](win, serializedMessage, domain);\n                        } catch (err) {\n                            errors.push(err);\n                        }\n                    }\n                    if (errors.length === strategies.length) throw new Error(\"All post-robot messaging strategies failed:\\n\\n\" + errors.map((function(err, i) {\n                        return i + \". \" + stringifyError(err);\n                    })).join(\"\\n\\n\"));\n                }));\n                return domainBuffer.flush.then((function() {\n                    delete domainBuffer.flush;\n                }));\n            })).then(src_util_noop);\n        }\n        function getResponseListener(hash) {\n            return globalStore(\"responseListeners\").get(hash);\n        }\n        function deleteResponseListener(hash) {\n            globalStore(\"responseListeners\").del(hash);\n        }\n        function isResponseListenerErrored(hash) {\n            return globalStore(\"erroredResponseListeners\").has(hash);\n        }\n        function getRequestListener(_ref) {\n            var name = _ref.name, win = _ref.win, domain = _ref.domain;\n            var requestListeners = windowStore(\"requestListeners\");\n            \"*\" === win && (win = null);\n            \"*\" === domain && (domain = null);\n            if (!name) throw new Error(\"Name required to get request listener\");\n            for (var _i4 = 0, _ref3 = [ win, getWildcard() ]; _i4 < _ref3.length; _i4++) {\n                var winQualifier = _ref3[_i4];\n                if (winQualifier) {\n                    var nameListeners = requestListeners.get(winQualifier);\n                    if (nameListeners) {\n                        var domainListeners = nameListeners[name];\n                        if (domainListeners) {\n                            if (domain && \"string\" == typeof domain) {\n                                if (domainListeners[domain]) return domainListeners[domain];\n                                if (domainListeners.__domain_regex__) for (var _i6 = 0, _domainListeners$__DO2 = domainListeners.__domain_regex__; _i6 < _domainListeners$__DO2.length; _i6++) {\n                                    var _domainListeners$__DO3 = _domainListeners$__DO2[_i6], listener = _domainListeners$__DO3.listener;\n                                    if (matchDomain(_domainListeners$__DO3.regex, domain)) return listener;\n                                }\n                            }\n                            if (domainListeners[\"*\"]) return domainListeners[\"*\"];\n                        }\n                    }\n                }\n            }\n        }\n        function handleRequest(source, origin, message, _ref) {\n            var on = _ref.on, send = _ref.send;\n            var options = getRequestListener({\n                name: message.name,\n                win: source,\n                domain: origin\n            });\n            var logName = \"postrobot_method\" === message.name && message.data && \"string\" == typeof message.data.name ? message.data.name + \"()\" : message.name;\n            function sendResponse(ack, data, error) {\n                return promise_ZalgoPromise.flush().then((function() {\n                    if (!message.fireAndForget && !isWindowClosed(source)) try {\n                        return send_sendMessage(source, origin, {\n                            id: uniqueID(),\n                            origin: getDomain(window),\n                            type: \"postrobot_message_response\",\n                            hash: message.hash,\n                            name: message.name,\n                            ack: ack,\n                            data: data,\n                            error: error\n                        }, {\n                            on: on,\n                            send: send\n                        });\n                    } catch (err) {\n                        throw new Error(\"Send response message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }\n                }));\n            }\n            return promise_ZalgoPromise.all([ promise_ZalgoPromise.flush().then((function() {\n                if (!message.fireAndForget && !isWindowClosed(source)) try {\n                    return send_sendMessage(source, origin, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_ack\",\n                        hash: message.hash,\n                        name: message.name\n                    }, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    throw new Error(\"Send ack message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                }\n            })), promise_ZalgoPromise.try((function() {\n                if (!options) throw new Error(\"No handler found for post message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                return options.handler({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            })).then((function(data) {\n                return sendResponse(\"success\", data);\n            }), (function(error) {\n                return sendResponse(\"error\", null, error);\n            })) ]).then(src_util_noop).catch((function(err) {\n                if (options && options.handleError) return options.handleError(err);\n                throw err;\n            }));\n        }\n        function handleAck(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message ack for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                try {\n                    if (!matchDomain(options.domain, origin)) throw new Error(\"Ack origin \" + origin + \" does not match domain \" + options.domain.toString());\n                    if (source !== options.win) throw new Error(\"Ack source does not match registered window\");\n                } catch (err) {\n                    options.promise.reject(err);\n                }\n                options.ack = !0;\n            }\n        }\n        function handleResponse(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message response for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                if (!matchDomain(options.domain, origin)) throw new Error(\"Response origin \" + origin + \" does not match domain \" + (pattern = options.domain, \n                Array.isArray(pattern) ? \"(\" + pattern.join(\" | \") + \")\" : isRegex(pattern) ? \"RegExp(\" + pattern.toString() + \")\" : pattern.toString()));\n                var pattern;\n                if (source !== options.win) throw new Error(\"Response source does not match registered window\");\n                deleteResponseListener(message.hash);\n                \"error\" === message.ack ? options.promise.reject(message.error) : \"success\" === message.ack && options.promise.resolve({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            }\n        }\n        function receive_receiveMessage(event, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            var receivedMessages = globalStore(\"receivedMessages\");\n            try {\n                if (!window || window.closed || !event.source) return;\n            } catch (err) {\n                return;\n            }\n            var source = event.source, origin = event.origin;\n            var messages = function(message, source, origin, _ref) {\n                var on = _ref.on, send = _ref.send;\n                var parsedMessage;\n                try {\n                    parsedMessage = deserializeMessage(source, origin, message, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    return;\n                }\n                if (parsedMessage && \"object\" == typeof parsedMessage && null !== parsedMessage) {\n                    var parseMessages = parsedMessage.__post_robot_10_0_46__;\n                    if (Array.isArray(parseMessages)) return parseMessages;\n                }\n            }(event.data, source, origin, {\n                on: on,\n                send: send\n            });\n            if (messages) {\n                markWindowKnown(source);\n                for (var _i2 = 0; _i2 < messages.length; _i2++) {\n                    var message = messages[_i2];\n                    if (receivedMessages.has(message.id)) return;\n                    receivedMessages.set(message.id, !0);\n                    if (isWindowClosed(source) && !message.fireAndForget) return;\n                    0 === message.origin.indexOf(\"file:\") && (origin = \"file://\");\n                    try {\n                        \"postrobot_message_request\" === message.type ? handleRequest(source, origin, message, {\n                            on: on,\n                            send: send\n                        }) : \"postrobot_message_response\" === message.type ? handleResponse(source, origin, message) : \"postrobot_message_ack\" === message.type && handleAck(source, origin, message);\n                    } catch (err) {\n                        setTimeout((function() {\n                            throw err;\n                        }), 0);\n                    }\n                }\n            }\n        }\n        function on_on(name, options, handler) {\n            if (!name) throw new Error(\"Expected name\");\n            if (\"function\" == typeof (options = options || {})) {\n                handler = options;\n                options = {};\n            }\n            if (!handler) throw new Error(\"Expected handler\");\n            var requestListener = function addRequestListener(_ref4, listener) {\n                var name = _ref4.name, winCandidate = _ref4.win, domain = _ref4.domain;\n                var requestListeners = windowStore(\"requestListeners\");\n                if (!name || \"string\" != typeof name) throw new Error(\"Name required to add request listener\");\n                if (winCandidate && \"*\" !== winCandidate && window_ProxyWindow.isProxyWindow(winCandidate)) {\n                    var requestListenerPromise = winCandidate.awaitWindow().then((function(actualWin) {\n                        return addRequestListener({\n                            name: name,\n                            win: actualWin,\n                            domain: domain\n                        }, listener);\n                    }));\n                    return {\n                        cancel: function() {\n                            requestListenerPromise.then((function(requestListener) {\n                                return requestListener.cancel();\n                            }), src_util_noop);\n                        }\n                    };\n                }\n                var win = winCandidate;\n                if (Array.isArray(win)) {\n                    var listenersCollection = [];\n                    for (var _i8 = 0, _win2 = win; _i8 < _win2.length; _i8++) listenersCollection.push(addRequestListener({\n                        name: name,\n                        domain: domain,\n                        win: _win2[_i8]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i10 = 0; _i10 < listenersCollection.length; _i10++) listenersCollection[_i10].cancel();\n                        }\n                    };\n                }\n                if (Array.isArray(domain)) {\n                    var _listenersCollection = [];\n                    for (var _i12 = 0, _domain2 = domain; _i12 < _domain2.length; _i12++) _listenersCollection.push(addRequestListener({\n                        name: name,\n                        win: win,\n                        domain: _domain2[_i12]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i14 = 0; _i14 < _listenersCollection.length; _i14++) _listenersCollection[_i14].cancel();\n                        }\n                    };\n                }\n                var existingListener = getRequestListener({\n                    name: name,\n                    win: win,\n                    domain: domain\n                });\n                win && \"*\" !== win || (win = getWildcard());\n                var strDomain = (domain = domain || \"*\").toString();\n                if (existingListener) throw win && domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString() + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : win ? new Error(\"Request listener already exists for \" + name + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString()) : new Error(\"Request listener already exists for \" + name);\n                var winNameListeners = requestListeners.getOrSet(win, (function() {\n                    return {};\n                }));\n                var winNameDomainListeners = util_getOrSet(winNameListeners, name, (function() {\n                    return {};\n                }));\n                var winNameDomainRegexListeners;\n                var winNameDomainRegexListener;\n                util_isRegex(domain) ? (winNameDomainRegexListeners = util_getOrSet(winNameDomainListeners, \"__domain_regex__\", (function() {\n                    return [];\n                }))).push(winNameDomainRegexListener = {\n                    regex: domain,\n                    listener: listener\n                }) : winNameDomainListeners[strDomain] = listener;\n                return {\n                    cancel: function() {\n                        delete winNameDomainListeners[strDomain];\n                        if (winNameDomainRegexListener) {\n                            winNameDomainRegexListeners.splice(winNameDomainRegexListeners.indexOf(winNameDomainRegexListener, 1));\n                            winNameDomainRegexListeners.length || delete winNameDomainListeners.__domain_regex__;\n                        }\n                        Object.keys(winNameDomainListeners).length || delete winNameListeners[name];\n                        win && !Object.keys(winNameListeners).length && requestListeners.del(win);\n                    }\n                };\n            }({\n                name: name,\n                win: options.window,\n                domain: options.domain || \"*\"\n            }, {\n                handler: handler || options.handler,\n                handleError: options.errorHandler || function(err) {\n                    throw err;\n                }\n            });\n            return {\n                cancel: function() {\n                    requestListener.cancel();\n                }\n            };\n        }\n        var send_send = function send(winOrProxyWin, name, data, options) {\n            var domainMatcher = (options = options || {}).domain || \"*\";\n            var responseTimeout = options.timeout || -1;\n            var childTimeout = options.timeout || 5e3;\n            var fireAndForget = options.fireAndForget || !1;\n            return window_ProxyWindow.toProxyWindow(winOrProxyWin, {\n                send: send\n            }).awaitWindow().then((function(win) {\n                return promise_ZalgoPromise.try((function() {\n                    !function(name, win, domain) {\n                        if (!name) throw new Error(\"Expected name\");\n                        if (domain && \"string\" != typeof domain && !Array.isArray(domain) && !util_isRegex(domain)) throw new TypeError(\"Can not send \" + name + \". Expected domain \" + JSON.stringify(domain) + \" to be a string, array, or regex\");\n                        if (isWindowClosed(win)) throw new Error(\"Can not send \" + name + \". Target window is closed\");\n                    }(name, win, domainMatcher);\n                    if (function(parent, child) {\n                        var actualParent = getAncestor(child);\n                        if (actualParent) return actualParent === parent;\n                        if (child === parent) return !1;\n                        if (getTop(child) === child) return !1;\n                        for (var _i15 = 0, _getFrames8 = getFrames(parent); _i15 < _getFrames8.length; _i15++) if (_getFrames8[_i15] === child) return !0;\n                        return !1;\n                    }(window, win)) return function(win, timeout, name) {\n                        void 0 === timeout && (timeout = 5e3);\n                        void 0 === name && (name = \"Window\");\n                        var promise = function(win) {\n                            return windowStore(\"helloPromises\").getOrSet(win, (function() {\n                                return new promise_ZalgoPromise;\n                            }));\n                        }(win);\n                        -1 !== timeout && (promise = promise.timeout(timeout, new Error(name + \" did not load after \" + timeout + \"ms\")));\n                        return promise;\n                    }(win, childTimeout);\n                })).then((function(_temp) {\n                    return function(win, targetDomain, actualDomain, _ref) {\n                        var send = _ref.send;\n                        return promise_ZalgoPromise.try((function() {\n                            return \"string\" == typeof targetDomain ? targetDomain : promise_ZalgoPromise.try((function() {\n                                return actualDomain || sayHello(win, {\n                                    send: send\n                                }).then((function(_ref2) {\n                                    return _ref2.domain;\n                                }));\n                            })).then((function(normalizedDomain) {\n                                if (!matchDomain(targetDomain, targetDomain)) throw new Error(\"Domain \" + stringify(targetDomain) + \" does not match \" + stringify(targetDomain));\n                                return normalizedDomain;\n                            }));\n                        }));\n                    }(win, domainMatcher, (void 0 === _temp ? {} : _temp).domain, {\n                        send: send\n                    });\n                })).then((function(targetDomain) {\n                    var domain = targetDomain;\n                    var logName = \"postrobot_method\" === name && data && \"string\" == typeof data.name ? data.name + \"()\" : name;\n                    var promise = new promise_ZalgoPromise;\n                    var hash = name + \"_\" + uniqueID();\n                    if (!fireAndForget) {\n                        var responseListener = {\n                            name: name,\n                            win: win,\n                            domain: domain,\n                            promise: promise\n                        };\n                        !function(hash, listener) {\n                            globalStore(\"responseListeners\").set(hash, listener);\n                        }(hash, responseListener);\n                        var reqPromises = windowStore(\"requestPromises\").getOrSet(win, (function() {\n                            return [];\n                        }));\n                        reqPromises.push(promise);\n                        promise.catch((function() {\n                            !function(hash) {\n                                globalStore(\"erroredResponseListeners\").set(hash, !0);\n                            }(hash);\n                            deleteResponseListener(hash);\n                        }));\n                        var totalAckTimeout = function(win) {\n                            return windowStore(\"knownWindows\").get(win, !1);\n                        }(win) ? 1e4 : 2e3;\n                        var totalResTimeout = responseTimeout;\n                        var ackTimeout = totalAckTimeout;\n                        var resTimeout = totalResTimeout;\n                        var interval = safeInterval((function() {\n                            if (isWindowClosed(win)) return promise.reject(new Error(\"Window closed for \" + name + \" before \" + (responseListener.ack ? \"response\" : \"ack\")));\n                            if (responseListener.cancelled) return promise.reject(new Error(\"Response listener was cancelled for \" + name));\n                            ackTimeout = Math.max(ackTimeout - 500, 0);\n                            -1 !== resTimeout && (resTimeout = Math.max(resTimeout - 500, 0));\n                            return responseListener.ack || 0 !== ackTimeout ? 0 === resTimeout ? promise.reject(new Error(\"No response for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalResTimeout + \"ms\")) : void 0 : promise.reject(new Error(\"No ack for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalAckTimeout + \"ms\"));\n                        }), 500);\n                        promise.finally((function() {\n                            interval.cancel();\n                            reqPromises.splice(reqPromises.indexOf(promise, 1));\n                        })).catch(src_util_noop);\n                    }\n                    return send_sendMessage(win, domain, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_request\",\n                        hash: hash,\n                        name: name,\n                        data: data,\n                        fireAndForget: fireAndForget\n                    }, {\n                        on: on_on,\n                        send: send\n                    }).then((function() {\n                        return fireAndForget ? promise.resolve() : promise;\n                    }), (function(err) {\n                        throw new Error(\"Send request message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }));\n                }));\n            }));\n        };\n        function setup_toProxyWindow(win) {\n            return window_ProxyWindow.toProxyWindow(win, {\n                send: send_send\n            });\n        }\n        function src_util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function utils_getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function utils_getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return utils_getActualProtocol(win);\n        }\n        function utils_isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === utils_getProtocol(win);\n        }\n        function src_utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function utils_getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !src_utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function utils_canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = utils_getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = src_utils_getParent(win);\n                return parent && utils_canReadFromWindow() ? utils_getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function utils_getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = utils_getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function utils_isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === utils_getProtocol(win);\n                    }(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (utils_getActualDomain(win) === utils_getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                if (utils_getDomain(window) === utils_getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_assertSameDomain(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function utils_isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = src_utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function utils_getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function utils_getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = utils_getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = utils_getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function utils_getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (src_utils_getParent(win) === win) return win;\n            try {\n                if (utils_isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (utils_isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = utils_getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (src_utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function utils_getAllFramesInWindow(win) {\n            var top = utils_getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(utils_getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], utils_getAllChildFrames(win)));\n            return result;\n        }\n        var utils_iframeWindows = [];\n        var utils_iframeFrames = [];\n        function utils_isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || \"Call was rejected by callee.\\r\\n\" !== err.message;\n            }\n            if (allowMock && utils_isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(utils_iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = utils_iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function utils_getFrameByName(win, name) {\n            var winFrames = utils_getFrames(win);\n            for (var _i9 = 0; _i9 < winFrames.length; _i9++) {\n                var childFrame = winFrames[_i9];\n                try {\n                    if (utils_isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame;\n                } catch (err) {}\n            }\n            try {\n                if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name];\n            } catch (err) {}\n            try {\n                if (-1 !== winFrames.indexOf(win[name])) return win[name];\n            } catch (err) {}\n        }\n        function utils_getAncestor(win) {\n            void 0 === win && (win = window);\n            return utils_getOpener(win = win || window) || src_utils_getParent(win) || void 0;\n        }\n        function utils_anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function utils_getDistanceFromTop(win) {\n            void 0 === win && (win = window);\n            var distance = 0;\n            var parent = win;\n            for (;parent; ) (parent = src_utils_getParent(parent)) && (distance += 1);\n            return distance;\n        }\n        function utils_matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (src_util_isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return src_util_isRegex(pattern) ? src_util_isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !src_util_isRegex(origin) && pattern.some((function(subpattern) {\n                return utils_matchDomain(subpattern, origin);\n            })));\n        }\n        function utils_getDomainFromUrl(url) {\n            return url.match(/^(https?|mock|file):\\/\\//) ? url.split(\"/\").slice(0, 3).join(\"/\") : utils_getDomain();\n        }\n        function utils_onCloseWindow(win, callback, delay, maxtime) {\n            void 0 === delay && (delay = 1e3);\n            void 0 === maxtime && (maxtime = 1 / 0);\n            var timeout;\n            !function check() {\n                if (utils_isWindowClosed(win)) {\n                    timeout && clearTimeout(timeout);\n                    return callback();\n                }\n                if (maxtime <= 0) clearTimeout(timeout); else {\n                    maxtime -= delay;\n                    timeout = setTimeout(check, delay);\n                }\n            }();\n            return {\n                cancel: function() {\n                    timeout && clearTimeout(timeout);\n                }\n            };\n        }\n        function utils_isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function lib_global_getGlobal(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Can not get global for window on different domain\");\n            win.__zoid_9_0_87__ || (win.__zoid_9_0_87__ = {});\n            return win.__zoid_9_0_87__;\n        }\n        function tryGlobal(win, handler) {\n            try {\n                return handler(lib_global_getGlobal(win));\n            } catch (err) {}\n        }\n        function getProxyObject(obj) {\n            return {\n                get: function() {\n                    var _this = this;\n                    return promise_ZalgoPromise.try((function() {\n                        if (_this.source && _this.source !== window) throw new Error(\"Can not call get on proxy object from a remote window\");\n                        return obj;\n                    }));\n                }\n            };\n        }\n        function basicSerialize(data) {\n            return base64encode(JSON.stringify(data));\n        }\n        function getUIDRefStore(win) {\n            var global = lib_global_getGlobal(win);\n            global.references = global.references || {};\n            return global.references;\n        }\n        function crossDomainSerialize(_ref) {\n            var data = _ref.data, metaData = _ref.metaData, sender = _ref.sender, receiver = _ref.receiver, _ref$passByReference = _ref.passByReference, passByReference = void 0 !== _ref$passByReference && _ref$passByReference, _ref$basic = _ref.basic, basic = void 0 !== _ref$basic && _ref$basic;\n            var proxyWin = setup_toProxyWindow(receiver.win);\n            var serializedMessage = basic ? JSON.stringify(data) : serializeMessage(proxyWin, receiver.domain, data, {\n                on: on_on,\n                send: send_send\n            });\n            var reference = passByReference ? function(val) {\n                var uid = uniqueID();\n                getUIDRefStore(window)[uid] = val;\n                return {\n                    type: \"uid\",\n                    uid: uid\n                };\n            }(serializedMessage) : {\n                type: \"raw\",\n                val: serializedMessage\n            };\n            return {\n                serializedData: basicSerialize({\n                    sender: {\n                        domain: sender.domain\n                    },\n                    metaData: metaData,\n                    reference: reference\n                }),\n                cleanReference: function() {\n                    win = window, \"uid\" === (ref = reference).type && delete getUIDRefStore(win)[ref.uid];\n                    var win, ref;\n                }\n            };\n        }\n        function crossDomainDeserialize(_ref2) {\n            var sender = _ref2.sender, _ref2$basic = _ref2.basic, basic = void 0 !== _ref2$basic && _ref2$basic;\n            var message = function(serializedData) {\n                return JSON.parse(function(str) {\n                    if (\"function\" == typeof atob) return decodeURIComponent([].map.call(atob(str), (function(c) {\n                        return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\n                    })).join(\"\"));\n                    if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"base64\").toString(\"utf8\");\n                    throw new Error(\"Can not find window.atob or Buffer\");\n                }(serializedData));\n            }(_ref2.data);\n            var reference = message.reference, metaData = message.metaData;\n            var win;\n            win = \"function\" == typeof sender.win ? sender.win({\n                metaData: metaData\n            }) : sender.win;\n            var domain;\n            domain = \"function\" == typeof sender.domain ? sender.domain({\n                metaData: metaData\n            }) : \"string\" == typeof sender.domain ? sender.domain : message.sender.domain;\n            var serializedData = function(win, ref) {\n                if (\"raw\" === ref.type) return ref.val;\n                if (\"uid\" === ref.type) return getUIDRefStore(win)[ref.uid];\n                throw new Error(\"Unsupported ref type: \" + ref.type);\n            }(win, reference);\n            return {\n                data: basic ? JSON.parse(serializedData) : function(source, origin, message) {\n                    return deserializeMessage(source, origin, message, {\n                        on: on_on,\n                        send: send_send\n                    });\n                }(win, domain, serializedData),\n                metaData: metaData,\n                sender: {\n                    win: win,\n                    domain: domain\n                },\n                reference: reference\n            };\n        }\n        var PROP_TYPE = {\n            STRING: \"string\",\n            OBJECT: \"object\",\n            FUNCTION: \"function\",\n            BOOLEAN: \"boolean\",\n            NUMBER: \"number\",\n            ARRAY: \"array\"\n        };\n        var PROP_SERIALIZATION = {\n            JSON: \"json\",\n            DOTIFY: \"dotify\",\n            BASE64: \"base64\"\n        };\n        var CONTEXT = {\n            IFRAME: \"iframe\",\n            POPUP: \"popup\"\n        };\n        var EVENT = {\n            RENDER: \"zoid-render\",\n            RENDERED: \"zoid-rendered\",\n            DISPLAY: \"zoid-display\",\n            ERROR: \"zoid-error\",\n            CLOSE: \"zoid-close\",\n            DESTROY: \"zoid-destroy\",\n            PROPS: \"zoid-props\",\n            RESIZE: \"zoid-resize\",\n            FOCUS: \"zoid-focus\"\n        };\n        function buildChildWindowName(_ref) {\n            return \"__zoid__\" + _ref.name + \"__\" + _ref.serializedPayload + \"__\";\n        }\n        function parseWindowName(windowName) {\n            if (!windowName) throw new Error(\"No window name\");\n            var _windowName$split = windowName.split(\"__\"), zoidcomp = _windowName$split[1], name = _windowName$split[2], serializedInitialPayload = _windowName$split[3];\n            if (\"zoid\" !== zoidcomp) throw new Error(\"Window not rendered by zoid - got \" + zoidcomp);\n            if (!name) throw new Error(\"Expected component name\");\n            if (!serializedInitialPayload) throw new Error(\"Expected serialized payload ref\");\n            return {\n                name: name,\n                serializedInitialPayload: serializedInitialPayload\n            };\n        }\n        var parseInitialParentPayload = memoize((function(windowName) {\n            var _crossDomainDeseriali = crossDomainDeserialize({\n                data: parseWindowName(windowName).serializedInitialPayload,\n                sender: {\n                    win: function(_ref2) {\n                        return function(windowRef) {\n                            if (\"opener\" === windowRef.type) return assertExists(\"opener\", utils_getOpener(window));\n                            if (\"parent\" === windowRef.type && \"number\" == typeof windowRef.distance) return assertExists(\"parent\", function(win, n) {\n                                void 0 === n && (n = 1);\n                                return function(win, n) {\n                                    void 0 === n && (n = 1);\n                                    var parent = win;\n                                    for (var i = 0; i < n; i++) {\n                                        if (!parent) return;\n                                        parent = src_utils_getParent(parent);\n                                    }\n                                    return parent;\n                                }(win, utils_getDistanceFromTop(win) - n);\n                            }(window, windowRef.distance));\n                            if (\"global\" === windowRef.type && windowRef.uid && \"string\" == typeof windowRef.uid) {\n                                var _ret = function() {\n                                    var uid = windowRef.uid;\n                                    var ancestor = utils_getAncestor(window);\n                                    if (!ancestor) throw new Error(\"Can not find ancestor window\");\n                                    for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(ancestor); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                        var frame = _getAllFramesInWindow2[_i2];\n                                        if (utils_isSameDomain(frame)) {\n                                            var win = tryGlobal(frame, (function(global) {\n                                                return global.windows && global.windows[uid];\n                                            }));\n                                            if (win) return {\n                                                v: win\n                                            };\n                                        }\n                                    }\n                                }();\n                                if (\"object\" == typeof _ret) return _ret.v;\n                            } else if (\"name\" === windowRef.type) {\n                                var name = windowRef.name;\n                                return assertExists(\"namedWindow\", function(win, name) {\n                                    return utils_getFrameByName(win, name) || function utils_findChildFrameByName(win, name) {\n                                        var frame = utils_getFrameByName(win, name);\n                                        if (frame) return frame;\n                                        for (var _i11 = 0, _getFrames4 = utils_getFrames(win); _i11 < _getFrames4.length; _i11++) {\n                                            var namedFrame = utils_findChildFrameByName(_getFrames4[_i11], name);\n                                            if (namedFrame) return namedFrame;\n                                        }\n                                    }(utils_getTop(win) || win, name);\n                                }(assertExists(\"ancestor\", utils_getAncestor(window)), name));\n                            }\n                            throw new Error(\"Unable to find \" + windowRef.type + \" parent component window\");\n                        }(_ref2.metaData.windowRef);\n                    }\n                }\n            });\n            return {\n                parent: _crossDomainDeseriali.sender,\n                payload: _crossDomainDeseriali.data,\n                reference: _crossDomainDeseriali.reference\n            };\n        }));\n        function getInitialParentPayload() {\n            return parseInitialParentPayload(window.name);\n        }\n        function window_getWindowRef(targetWindow, currentWindow) {\n            void 0 === currentWindow && (currentWindow = window);\n            if (targetWindow === src_utils_getParent(currentWindow)) return {\n                type: \"parent\",\n                distance: utils_getDistanceFromTop(targetWindow)\n            };\n            if (targetWindow === utils_getOpener(currentWindow)) return {\n                type: \"opener\"\n            };\n            if (utils_isSameDomain(targetWindow) && !(win = targetWindow, win === utils_getTop(win))) {\n                var windowName = utils_assertSameDomain(targetWindow).name;\n                if (windowName) return {\n                    type: \"name\",\n                    name: windowName\n                };\n            }\n            var win;\n        }\n        function normalizeChildProp(propsDef, props, key, value, helpers) {\n            if (!propsDef.hasOwnProperty(key)) return value;\n            var prop = propsDef[key];\n            return \"function\" == typeof prop.childDecorate ? prop.childDecorate({\n                value: value,\n                uid: helpers.uid,\n                tag: helpers.tag,\n                close: helpers.close,\n                focus: helpers.focus,\n                onError: helpers.onError,\n                onProps: helpers.onProps,\n                resize: helpers.resize,\n                getParent: helpers.getParent,\n                getParentDomain: helpers.getParentDomain,\n                show: helpers.show,\n                hide: helpers.hide,\n                export: helpers.export,\n                getSiblings: helpers.getSiblings\n            }) : value;\n        }\n        function child_focus() {\n            return promise_ZalgoPromise.try((function() {\n                window.focus();\n            }));\n        }\n        function child_destroy() {\n            return promise_ZalgoPromise.try((function() {\n                window.close();\n            }));\n        }\n        var props_defaultNoop = function() {\n            return src_util_noop;\n        };\n        var props_decorateOnce = function(_ref) {\n            return once(_ref.value);\n        };\n        function eachProp(props, propsDef, handler) {\n            for (var _i2 = 0, _Object$keys2 = Object.keys(_extends({}, props, propsDef)); _i2 < _Object$keys2.length; _i2++) {\n                var key = _Object$keys2[_i2];\n                handler(key, propsDef[key], props[key]);\n            }\n        }\n        function serializeProps(propsDef, props, method) {\n            var params = {};\n            return promise_ZalgoPromise.all(function(props, propsDef, handler) {\n                var results = [];\n                eachProp(props, propsDef, (function(key, propDef, value) {\n                    var result = function(key, propDef, value) {\n                        return promise_ZalgoPromise.resolve().then((function() {\n                            var _METHOD$GET$METHOD$PO, _METHOD$GET$METHOD$PO2;\n                            if (null != value && propDef) {\n                                var getParam = (_METHOD$GET$METHOD$PO = {}, _METHOD$GET$METHOD$PO.get = propDef.queryParam, \n                                _METHOD$GET$METHOD$PO.post = propDef.bodyParam, _METHOD$GET$METHOD$PO)[method];\n                                var getValue = (_METHOD$GET$METHOD$PO2 = {}, _METHOD$GET$METHOD$PO2.get = propDef.queryValue, \n                                _METHOD$GET$METHOD$PO2.post = propDef.bodyValue, _METHOD$GET$METHOD$PO2)[method];\n                                if (getParam) return promise_ZalgoPromise.hash({\n                                    finalParam: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getParam ? getParam({\n                                            value: value\n                                        }) : \"string\" == typeof getParam ? getParam : key;\n                                    })),\n                                    finalValue: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getValue && isDefined(value) ? getValue({\n                                            value: value\n                                        }) : value;\n                                    }))\n                                }).then((function(_ref) {\n                                    var finalParam = _ref.finalParam, finalValue = _ref.finalValue;\n                                    var result;\n                                    if (\"boolean\" == typeof finalValue) result = finalValue.toString(); else if (\"string\" == typeof finalValue) result = finalValue.toString(); else if (\"object\" == typeof finalValue && null !== finalValue) {\n                                        if (propDef.serialization === PROP_SERIALIZATION.JSON) result = JSON.stringify(finalValue); else if (propDef.serialization === PROP_SERIALIZATION.BASE64) result = base64encode(JSON.stringify(finalValue)); else if (propDef.serialization === PROP_SERIALIZATION.DOTIFY || !propDef.serialization) {\n                                            result = function dotify(obj, prefix, newobj) {\n                                                void 0 === prefix && (prefix = \"\");\n                                                void 0 === newobj && (newobj = {});\n                                                prefix = prefix ? prefix + \".\" : prefix;\n                                                for (var key in obj) obj.hasOwnProperty(key) && null != obj[key] && \"function\" != typeof obj[key] && (obj[key] && Array.isArray(obj[key]) && obj[key].length && obj[key].every((function(val) {\n                                                    return \"object\" != typeof val;\n                                                })) ? newobj[\"\" + prefix + key + \"[]\"] = obj[key].join(\",\") : obj[key] && \"object\" == typeof obj[key] ? newobj = dotify(obj[key], \"\" + prefix + key, newobj) : newobj[\"\" + prefix + key] = obj[key].toString());\n                                                return newobj;\n                                            }(finalValue, key);\n                                            for (var _i2 = 0, _Object$keys2 = Object.keys(result); _i2 < _Object$keys2.length; _i2++) {\n                                                var dotkey = _Object$keys2[_i2];\n                                                params[dotkey] = result[dotkey];\n                                            }\n                                            return;\n                                        }\n                                    } else \"number\" == typeof finalValue && (result = finalValue.toString());\n                                    params[finalParam] = result;\n                                }));\n                            }\n                        }));\n                    }(key, propDef, value);\n                    results.push(result);\n                }));\n                return results;\n            }(props, propsDef)).then((function() {\n                return params;\n            }));\n        }\n        function parentComponent(_ref) {\n            var uid = _ref.uid, options = _ref.options, _ref$overrides = _ref.overrides, overrides = void 0 === _ref$overrides ? {} : _ref$overrides, _ref$parentWin = _ref.parentWin, parentWin = void 0 === _ref$parentWin ? window : _ref$parentWin;\n            var propsDef = options.propsDef, containerTemplate = options.containerTemplate, prerenderTemplate = options.prerenderTemplate, tag = options.tag, name = options.name, attributes = options.attributes, dimensions = options.dimensions, autoResize = options.autoResize, url = options.url, domainMatch = options.domain, xports = options.exports;\n            var initPromise = new promise_ZalgoPromise;\n            var handledErrors = [];\n            var clean = cleanup();\n            var state = {};\n            var inputProps = {};\n            var internalState = {\n                visible: !0\n            };\n            var event = overrides.event ? overrides.event : (triggered = {}, handlers = {}, \n            emitter = {\n                on: function(eventName, handler) {\n                    var handlerList = handlers[eventName] = handlers[eventName] || [];\n                    handlerList.push(handler);\n                    var cancelled = !1;\n                    return {\n                        cancel: function() {\n                            if (!cancelled) {\n                                cancelled = !0;\n                                handlerList.splice(handlerList.indexOf(handler), 1);\n                            }\n                        }\n                    };\n                },\n                once: function(eventName, handler) {\n                    var listener = emitter.on(eventName, (function() {\n                        listener.cancel();\n                        handler();\n                    }));\n                    return listener;\n                },\n                trigger: function(eventName) {\n                    for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n                    var handlerList = handlers[eventName];\n                    var promises = [];\n                    if (handlerList) {\n                        var _loop = function(_i2) {\n                            var handler = handlerList[_i2];\n                            promises.push(promise_ZalgoPromise.try((function() {\n                                return handler.apply(void 0, args);\n                            })));\n                        };\n                        for (var _i2 = 0; _i2 < handlerList.length; _i2++) _loop(_i2);\n                    }\n                    return promise_ZalgoPromise.all(promises).then(src_util_noop);\n                },\n                triggerOnce: function(eventName) {\n                    if (triggered[eventName]) return promise_ZalgoPromise.resolve();\n                    triggered[eventName] = !0;\n                    for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];\n                    return emitter.trigger.apply(emitter, [ eventName ].concat(args));\n                },\n                reset: function() {\n                    handlers = {};\n                }\n            });\n            var triggered, handlers, emitter;\n            var props = overrides.props ? overrides.props : {};\n            var currentProxyWin;\n            var currentProxyContainer;\n            var childComponent;\n            var currentChildDomain;\n            var currentContainer;\n            var onErrorOverride = overrides.onError;\n            var getProxyContainerOverride = overrides.getProxyContainer;\n            var showOverride = overrides.show;\n            var hideOverride = overrides.hide;\n            var closeOverride = overrides.close;\n            var renderContainerOverride = overrides.renderContainer;\n            var getProxyWindowOverride = overrides.getProxyWindow;\n            var setProxyWinOverride = overrides.setProxyWin;\n            var openFrameOverride = overrides.openFrame;\n            var openPrerenderFrameOverride = overrides.openPrerenderFrame;\n            var prerenderOverride = overrides.prerender;\n            var openOverride = overrides.open;\n            var openPrerenderOverride = overrides.openPrerender;\n            var watchForUnloadOverride = overrides.watchForUnload;\n            var getInternalStateOverride = overrides.getInternalState;\n            var setInternalStateOverride = overrides.setInternalState;\n            var resolveInitPromise = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.resolveInitPromise ? overrides.resolveInitPromise() : initPromise.resolve();\n                }));\n            };\n            var rejectInitPromise = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.rejectInitPromise ? overrides.rejectInitPromise(err) : initPromise.reject(err);\n                }));\n            };\n            var getPropsForChild = function(initialChildDomain) {\n                var result = {};\n                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                    var key = _Object$keys2[_i2];\n                    var prop = propsDef[key];\n                    prop && !1 === prop.sendToChild || prop && prop.sameDomain && !utils_matchDomain(initialChildDomain, utils_getDomain(window)) || (result[key] = props[key]);\n                }\n                return promise_ZalgoPromise.hash(result);\n            };\n            var getInternalState = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return getInternalStateOverride ? getInternalStateOverride() : internalState;\n                }));\n            };\n            var setInternalState = function(newInternalState) {\n                return promise_ZalgoPromise.try((function() {\n                    return setInternalStateOverride ? setInternalStateOverride(newInternalState) : internalState = _extends({}, internalState, newInternalState);\n                }));\n            };\n            var getProxyWindow = function() {\n                return getProxyWindowOverride ? getProxyWindowOverride() : promise_ZalgoPromise.try((function() {\n                    var windowProp = props.window;\n                    if (windowProp) {\n                        var _proxyWin = setup_toProxyWindow(windowProp);\n                        clean.register((function() {\n                            return windowProp.close();\n                        }));\n                        return _proxyWin;\n                    }\n                    return new window_ProxyWindow({\n                        send: send_send\n                    });\n                }));\n            };\n            var setProxyWin = function(proxyWin) {\n                return setProxyWinOverride ? setProxyWinOverride(proxyWin) : promise_ZalgoPromise.try((function() {\n                    currentProxyWin = proxyWin;\n                }));\n            };\n            var show = function() {\n                return showOverride ? showOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !0\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(showElement) : null\n                }).then(src_util_noop);\n            };\n            var hide = function() {\n                return hideOverride ? hideOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !1\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(hideElement) : null\n                }).then(src_util_noop);\n            };\n            var getUrl = function() {\n                return \"function\" == typeof url ? url({\n                    props: props\n                }) : url;\n            };\n            var getAttributes = function() {\n                return \"function\" == typeof attributes ? attributes({\n                    props: props\n                }) : attributes;\n            };\n            var getInitialChildDomain = function() {\n                return utils_getDomainFromUrl(getUrl());\n            };\n            var openFrame = function(context, _ref2) {\n                var windowName = _ref2.windowName;\n                return openFrameOverride ? openFrameOverride(context, {\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: windowName,\n                            title: name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerenderFrame = function(context) {\n                return openPrerenderFrameOverride ? openPrerenderFrameOverride(context) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: \"__zoid_prerender_frame__\" + name + \"_\" + uniqueID() + \"__\",\n                            title: \"prerender__\" + name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerender = function(context, proxyWin, proxyPrerenderFrame) {\n                return openPrerenderOverride ? openPrerenderOverride(context, proxyWin, proxyPrerenderFrame) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyPrerenderFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyPrerenderFrame.get().then((function(prerenderFrame) {\n                            clean.register((function() {\n                                return destroyElement(prerenderFrame);\n                            }));\n                            return awaitFrameWindow(prerenderFrame).then((function(prerenderFrameWindow) {\n                                return utils_assertSameDomain(prerenderFrameWindow);\n                            })).then((function(win) {\n                                return setup_toProxyWindow(win);\n                            }));\n                        }));\n                    }\n                    throw new Error(\"No render context available for \" + context);\n                }));\n            };\n            var focus = function() {\n                return promise_ZalgoPromise.try((function() {\n                    if (currentProxyWin) return promise_ZalgoPromise.all([ event.trigger(EVENT.FOCUS), currentProxyWin.focus() ]).then(src_util_noop);\n                }));\n            };\n            var getCurrentWindowReferenceUID = function() {\n                var global = lib_global_getGlobal(window);\n                global.windows = global.windows || {};\n                global.windows[uid] = window;\n                clean.register((function() {\n                    delete global.windows[uid];\n                }));\n                return uid;\n            };\n            var getWindowRef = function(target, initialChildDomain, context, proxyWin) {\n                if (initialChildDomain === utils_getDomain(window)) return {\n                    type: \"global\",\n                    uid: getCurrentWindowReferenceUID()\n                };\n                if (target !== window) throw new Error(\"Can not construct cross-domain window reference for different target window\");\n                if (props.window) {\n                    var actualComponentWindow = proxyWin.getWindow();\n                    if (!actualComponentWindow) throw new Error(\"Can not construct cross-domain window reference for lazy window prop\");\n                    if (utils_getAncestor(actualComponentWindow) !== window) throw new Error(\"Can not construct cross-domain window reference for window prop with different ancestor\");\n                }\n                if (context === CONTEXT.POPUP) return {\n                    type: \"opener\"\n                };\n                if (context === CONTEXT.IFRAME) return {\n                    type: \"parent\",\n                    distance: utils_getDistanceFromTop(window)\n                };\n                throw new Error(\"Can not construct window reference for child\");\n            };\n            var initChild = function(childDomain, childExports) {\n                return promise_ZalgoPromise.try((function() {\n                    currentChildDomain = childDomain;\n                    childComponent = childExports;\n                    resolveInitPromise();\n                    clean.register((function() {\n                        return childExports.close.fireAndForget().catch(src_util_noop);\n                    }));\n                }));\n            };\n            var resize = function(_ref3) {\n                var width = _ref3.width, height = _ref3.height;\n                return promise_ZalgoPromise.try((function() {\n                    event.trigger(EVENT.RESIZE, {\n                        width: width,\n                        height: height\n                    });\n                }));\n            };\n            var destroy = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return event.trigger(EVENT.DESTROY);\n                })).catch(src_util_noop).then((function() {\n                    return clean.all(err);\n                })).then((function() {\n                    initPromise.asyncReject(err || new Error(\"Component destroyed\"));\n                }));\n            };\n            var close = memoize((function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    if (closeOverride) {\n                        if (utils_isWindowClosed(closeOverride.__source__)) return;\n                        return closeOverride();\n                    }\n                    return promise_ZalgoPromise.try((function() {\n                        return event.trigger(EVENT.CLOSE);\n                    })).then((function() {\n                        return destroy(err || new Error(\"Component closed\"));\n                    }));\n                }));\n            }));\n            var open = function(context, _ref4) {\n                var proxyWin = _ref4.proxyWin, proxyFrame = _ref4.proxyFrame, windowName = _ref4.windowName;\n                return openOverride ? openOverride(context, {\n                    proxyWin: proxyWin,\n                    proxyFrame: proxyFrame,\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyFrame.get().then((function(frame) {\n                            return awaitFrameWindow(frame).then((function(win) {\n                                clean.register((function() {\n                                    return destroyElement(frame);\n                                }));\n                                clean.register((function() {\n                                    return function(win) {\n                                        for (var _i2 = 0, _requestPromises$get2 = windowStore(\"requestPromises\").get(win, []); _i2 < _requestPromises$get2.length; _i2++) _requestPromises$get2[_i2].reject(new Error(\"Window \" + (isWindowClosed(win) ? \"closed\" : \"cleaned up\") + \" before response\")).catch(src_util_noop);\n                                    }(win);\n                                }));\n                                return win;\n                            }));\n                        }));\n                    }\n                    throw new Error(\"No render context available for \" + context);\n                })).then((function(win) {\n                    proxyWin.setWindow(win, {\n                        send: send_send\n                    });\n                    return proxyWin.setName(windowName).then((function() {\n                        return proxyWin;\n                    }));\n                }));\n            };\n            var watchForUnload = function() {\n                return promise_ZalgoPromise.try((function() {\n                    var unloadWindowListener = addEventListener(window, \"unload\", once((function() {\n                        destroy(new Error(\"Window navigated away\"));\n                    })));\n                    var closeParentWindowListener = utils_onCloseWindow(parentWin, destroy, 3e3);\n                    clean.register(closeParentWindowListener.cancel);\n                    clean.register(unloadWindowListener.cancel);\n                    if (watchForUnloadOverride) return watchForUnloadOverride();\n                }));\n            };\n            var checkWindowClose = function(proxyWin) {\n                var closed = !1;\n                return proxyWin.isClosed().then((function(isClosed) {\n                    if (isClosed) {\n                        closed = !0;\n                        return close(new Error(\"Detected component window close\"));\n                    }\n                    return promise_ZalgoPromise.delay(200).then((function() {\n                        return proxyWin.isClosed();\n                    })).then((function(secondIsClosed) {\n                        if (secondIsClosed) {\n                            closed = !0;\n                            return close(new Error(\"Detected component window close\"));\n                        }\n                    }));\n                })).then((function() {\n                    return closed;\n                }));\n            };\n            var onError = function(err) {\n                return onErrorOverride ? onErrorOverride(err) : promise_ZalgoPromise.try((function() {\n                    if (-1 === handledErrors.indexOf(err)) {\n                        handledErrors.push(err);\n                        initPromise.asyncReject(err);\n                        return event.trigger(EVENT.ERROR, err);\n                    }\n                }));\n            };\n            var exportsPromise = new promise_ZalgoPromise;\n            var xport = function(actualExports) {\n                return promise_ZalgoPromise.try((function() {\n                    exportsPromise.resolve(actualExports);\n                }));\n            };\n            initChild.onError = onError;\n            var renderTemplate = function(renderer, _ref8) {\n                return renderer({\n                    uid: uid,\n                    container: _ref8.container,\n                    context: _ref8.context,\n                    doc: _ref8.doc,\n                    frame: _ref8.frame,\n                    prerenderFrame: _ref8.prerenderFrame,\n                    focus: focus,\n                    close: close,\n                    state: state,\n                    props: props,\n                    tag: tag,\n                    dimensions: \"function\" == typeof dimensions ? dimensions({\n                        props: props\n                    }) : dimensions,\n                    event: event\n                });\n            };\n            var prerender = function(proxyPrerenderWin, _ref9) {\n                var context = _ref9.context;\n                return prerenderOverride ? prerenderOverride(proxyPrerenderWin, {\n                    context: context\n                }) : promise_ZalgoPromise.try((function() {\n                    if (prerenderTemplate) {\n                        var prerenderWindow = proxyPrerenderWin.getWindow();\n                        if (prerenderWindow && utils_isSameDomain(prerenderWindow) && function(win) {\n                            try {\n                                if (!win.location.href) return !0;\n                                if (\"about:blank\" === win.location.href) return !0;\n                            } catch (err) {}\n                            return !1;\n                        }(prerenderWindow)) {\n                            var doc = (prerenderWindow = utils_assertSameDomain(prerenderWindow)).document;\n                            var el = renderTemplate(prerenderTemplate, {\n                                context: context,\n                                doc: doc\n                            });\n                            if (el) {\n                                if (el.ownerDocument !== doc) throw new Error(\"Expected prerender template to have been created with document from child window\");\n                                !function(win, el) {\n                                    var tag = el.tagName.toLowerCase();\n                                    if (\"html\" !== tag) throw new Error(\"Expected element to be html, got \" + tag);\n                                    var documentElement = win.document.documentElement;\n                                    for (var _i6 = 0, _arrayFrom2 = arrayFrom(documentElement.children); _i6 < _arrayFrom2.length; _i6++) documentElement.removeChild(_arrayFrom2[_i6]);\n                                    for (var _i8 = 0, _arrayFrom4 = arrayFrom(el.children); _i8 < _arrayFrom4.length; _i8++) documentElement.appendChild(_arrayFrom4[_i8]);\n                                }(prerenderWindow, el);\n                                var _autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, _autoResize$element = autoResize.element, element = void 0 === _autoResize$element ? \"body\" : _autoResize$element;\n                                if ((element = getElementSafe(element, doc)) && (width || height)) {\n                                    var prerenderResizeListener = onResize(element, (function(_ref10) {\n                                        resize({\n                                            width: width ? _ref10.width : void 0,\n                                            height: height ? _ref10.height : void 0\n                                        });\n                                    }), {\n                                        width: width,\n                                        height: height,\n                                        win: prerenderWindow\n                                    });\n                                    event.on(EVENT.RENDERED, prerenderResizeListener.cancel);\n                                }\n                            }\n                        }\n                    }\n                }));\n            };\n            var renderContainer = function(proxyContainer, _ref11) {\n                var proxyFrame = _ref11.proxyFrame, proxyPrerenderFrame = _ref11.proxyPrerenderFrame, context = _ref11.context, rerender = _ref11.rerender;\n                return renderContainerOverride ? renderContainerOverride(proxyContainer, {\n                    proxyFrame: proxyFrame,\n                    proxyPrerenderFrame: proxyPrerenderFrame,\n                    context: context,\n                    rerender: rerender\n                }) : promise_ZalgoPromise.hash({\n                    container: proxyContainer.get(),\n                    frame: proxyFrame ? proxyFrame.get() : null,\n                    prerenderFrame: proxyPrerenderFrame ? proxyPrerenderFrame.get() : null,\n                    internalState: getInternalState()\n                }).then((function(_ref12) {\n                    var container = _ref12.container, visible = _ref12.internalState.visible;\n                    var innerContainer = renderTemplate(containerTemplate, {\n                        context: context,\n                        container: container,\n                        frame: _ref12.frame,\n                        prerenderFrame: _ref12.prerenderFrame,\n                        doc: document\n                    });\n                    if (innerContainer) {\n                        visible || hideElement(innerContainer);\n                        appendChild(container, innerContainer);\n                        var containerWatcher = function(element, handler) {\n                            handler = once(handler);\n                            var cancelled = !1;\n                            var mutationObservers = [];\n                            var interval;\n                            var sacrificialFrame;\n                            var sacrificialFrameWin;\n                            var cancel = function() {\n                                cancelled = !0;\n                                for (var _i18 = 0; _i18 < mutationObservers.length; _i18++) mutationObservers[_i18].disconnect();\n                                interval && interval.cancel();\n                                sacrificialFrameWin && sacrificialFrameWin.removeEventListener(\"unload\", elementClosed);\n                                sacrificialFrame && destroyElement(sacrificialFrame);\n                            };\n                            var elementClosed = function() {\n                                if (!cancelled) {\n                                    handler();\n                                    cancel();\n                                }\n                            };\n                            if (isElementClosed(element)) {\n                                elementClosed();\n                                return {\n                                    cancel: cancel\n                                };\n                            }\n                            if (window.MutationObserver) {\n                                var mutationElement = element.parentElement;\n                                for (;mutationElement; ) {\n                                    var mutationObserver = new window.MutationObserver((function() {\n                                        isElementClosed(element) && elementClosed();\n                                    }));\n                                    mutationObserver.observe(mutationElement, {\n                                        childList: !0\n                                    });\n                                    mutationObservers.push(mutationObserver);\n                                    mutationElement = mutationElement.parentElement;\n                                }\n                            }\n                            (sacrificialFrame = document.createElement(\"iframe\")).setAttribute(\"name\", \"__detect_close_\" + uniqueID() + \"__\");\n                            sacrificialFrame.style.display = \"none\";\n                            awaitFrameWindow(sacrificialFrame).then((function(frameWin) {\n                                (sacrificialFrameWin = assertSameDomain(frameWin)).addEventListener(\"unload\", elementClosed);\n                            }));\n                            element.appendChild(sacrificialFrame);\n                            interval = safeInterval((function() {\n                                isElementClosed(element) && elementClosed();\n                            }), 1e3);\n                            return {\n                                cancel: cancel\n                            };\n                        }(innerContainer, (function() {\n                            var removeError = new Error(\"Detected container element removed from DOM\");\n                            return promise_ZalgoPromise.delay(1).then((function() {\n                                if (!isElementClosed(innerContainer)) {\n                                    clean.all(removeError);\n                                    return rerender().then(resolveInitPromise, rejectInitPromise);\n                                }\n                                close(removeError);\n                            }));\n                        }));\n                        clean.register((function() {\n                            return containerWatcher.cancel();\n                        }));\n                        clean.register((function() {\n                            return destroyElement(innerContainer);\n                        }));\n                        return currentProxyContainer = getProxyObject(innerContainer);\n                    }\n                }));\n            };\n            var getHelpers = function() {\n                return {\n                    state: state,\n                    event: event,\n                    close: close,\n                    focus: focus,\n                    resize: resize,\n                    onError: onError,\n                    updateProps: updateProps,\n                    show: show,\n                    hide: hide\n                };\n            };\n            var setProps = function(newInputProps) {\n                void 0 === newInputProps && (newInputProps = {});\n                var container = currentContainer;\n                var helpers = getHelpers();\n                extend(inputProps, newInputProps);\n                !function(propsDef, existingProps, inputProps, helpers, container) {\n                    var state = helpers.state, close = helpers.close, focus = helpers.focus, event = helpers.event, onError = helpers.onError;\n                    eachProp(inputProps, propsDef, (function(key, propDef, val) {\n                        var valueDetermined = !1;\n                        var value = val;\n                        Object.defineProperty(existingProps, key, {\n                            configurable: !0,\n                            enumerable: !0,\n                            get: function() {\n                                if (valueDetermined) return value;\n                                valueDetermined = !0;\n                                return function() {\n                                    if (!propDef) return value;\n                                    var alias = propDef.alias;\n                                    alias && !isDefined(val) && isDefined(inputProps[alias]) && (value = inputProps[alias]);\n                                    propDef.value && (value = propDef.value({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    !propDef.default || isDefined(value) || isDefined(inputProps[key]) || (value = propDef.default({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    if (isDefined(value)) {\n                                        if (propDef.type === PROP_TYPE.ARRAY ? !Array.isArray(value) : typeof value !== propDef.type) throw new TypeError(\"Prop is not of type \" + propDef.type + \": \" + key);\n                                    } else if (!1 !== propDef.required && !isDefined(inputProps[key])) throw new Error('Expected prop \"' + key + '\" to be defined');\n                                    isDefined(value) && propDef.decorate && (value = propDef.decorate({\n                                        value: value,\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    return value;\n                                }();\n                            }\n                        });\n                    }));\n                    eachProp(existingProps, propsDef, src_util_noop);\n                }(propsDef, props, inputProps, helpers, container);\n            };\n            var updateProps = function(newProps) {\n                setProps(newProps);\n                return initPromise.then((function() {\n                    var child = childComponent;\n                    var proxyWin = currentProxyWin;\n                    if (child && proxyWin && currentChildDomain) return getPropsForChild(currentChildDomain).then((function(childProps) {\n                        return child.updateProps(childProps).catch((function(err) {\n                            return checkWindowClose(proxyWin).then((function(closed) {\n                                if (!closed) throw err;\n                            }));\n                        }));\n                    }));\n                }));\n            };\n            var getProxyContainer = function(container) {\n                return getProxyContainerOverride ? getProxyContainerOverride(container) : promise_ZalgoPromise.try((function() {\n                    return elementReady(container);\n                })).then((function(containerElement) {\n                    isShadowElement(containerElement) && (containerElement = function insertShadowSlot(element) {\n                        var shadowHost = function(element) {\n                            var shadowRoot = function(element) {\n                                for (;element.parentNode; ) element = element.parentNode;\n                                if (isShadowElement(element)) return element;\n                            }(element);\n                            if (shadowRoot && shadowRoot.host) return shadowRoot.host;\n                        }(element);\n                        if (!shadowHost) throw new Error(\"Element is not in shadow dom\");\n                        var slotName = \"shadow-slot-\" + uniqueID();\n                        var slot = document.createElement(\"slot\");\n                        slot.setAttribute(\"name\", slotName);\n                        element.appendChild(slot);\n                        var slotProvider = document.createElement(\"div\");\n                        slotProvider.setAttribute(\"slot\", slotName);\n                        shadowHost.appendChild(slotProvider);\n                        return isShadowElement(shadowHost) ? insertShadowSlot(slotProvider) : slotProvider;\n                    }(containerElement));\n                    currentContainer = containerElement;\n                    return getProxyObject(containerElement);\n                }));\n            };\n            return {\n                init: function() {\n                    !function() {\n                        event.on(EVENT.RENDER, (function() {\n                            return props.onRender();\n                        }));\n                        event.on(EVENT.DISPLAY, (function() {\n                            return props.onDisplay();\n                        }));\n                        event.on(EVENT.RENDERED, (function() {\n                            return props.onRendered();\n                        }));\n                        event.on(EVENT.CLOSE, (function() {\n                            return props.onClose();\n                        }));\n                        event.on(EVENT.DESTROY, (function() {\n                            return props.onDestroy();\n                        }));\n                        event.on(EVENT.RESIZE, (function() {\n                            return props.onResize();\n                        }));\n                        event.on(EVENT.FOCUS, (function() {\n                            return props.onFocus();\n                        }));\n                        event.on(EVENT.PROPS, (function(newProps) {\n                            return props.onProps(newProps);\n                        }));\n                        event.on(EVENT.ERROR, (function(err) {\n                            return props && props.onError ? props.onError(err) : rejectInitPromise(err).then((function() {\n                                setTimeout((function() {\n                                    throw err;\n                                }), 1);\n                            }));\n                        }));\n                        clean.register(event.reset);\n                    }();\n                },\n                render: function(_ref14) {\n                    var target = _ref14.target, container = _ref14.container, context = _ref14.context, rerender = _ref14.rerender;\n                    return promise_ZalgoPromise.try((function() {\n                        var initialChildDomain = getInitialChildDomain();\n                        var childDomainMatch = domainMatch || getInitialChildDomain();\n                        !function(target, childDomainMatch, container) {\n                            if (target !== window) {\n                                if (!function(win1, win2) {\n                                    var top1 = utils_getTop(win1) || win1;\n                                    var top2 = utils_getTop(win2) || win2;\n                                    try {\n                                        if (top1 && top2) return top1 === top2;\n                                    } catch (err) {}\n                                    var allFrames1 = utils_getAllFramesInWindow(win1);\n                                    var allFrames2 = utils_getAllFramesInWindow(win2);\n                                    if (utils_anyMatch(allFrames1, allFrames2)) return !0;\n                                    var opener1 = utils_getOpener(top1);\n                                    var opener2 = utils_getOpener(top2);\n                                    return opener1 && utils_anyMatch(utils_getAllFramesInWindow(opener1), allFrames2) || opener2 && utils_anyMatch(utils_getAllFramesInWindow(opener2), allFrames1), \n                                    !1;\n                                }(window, target)) throw new Error(\"Can only renderTo an adjacent frame\");\n                                var origin = utils_getDomain();\n                                if (!utils_matchDomain(childDomainMatch, origin) && !utils_isSameDomain(target)) throw new Error(\"Can not render remotely to \" + childDomainMatch.toString() + \" - can only render to \" + origin);\n                                if (container && \"string\" != typeof container) throw new Error(\"Container passed to renderTo must be a string selector, got \" + typeof container + \" }\");\n                            }\n                        }(target, childDomainMatch, container);\n                        var delegatePromise = promise_ZalgoPromise.try((function() {\n                            if (target !== window) return function(context, target) {\n                                var delegateProps = {};\n                                for (var _i4 = 0, _Object$keys4 = Object.keys(props); _i4 < _Object$keys4.length; _i4++) {\n                                    var propName = _Object$keys4[_i4];\n                                    var propDef = propsDef[propName];\n                                    propDef && propDef.allowDelegate && (delegateProps[propName] = props[propName]);\n                                }\n                                var childOverridesPromise = send_send(target, \"zoid_delegate_\" + name, {\n                                    uid: uid,\n                                    overrides: {\n                                        props: delegateProps,\n                                        event: event,\n                                        close: close,\n                                        onError: onError,\n                                        getInternalState: getInternalState,\n                                        setInternalState: setInternalState,\n                                        resolveInitPromise: resolveInitPromise,\n                                        rejectInitPromise: rejectInitPromise\n                                    }\n                                }).then((function(_ref13) {\n                                    var parentComp = _ref13.data.parent;\n                                    clean.register((function(err) {\n                                        if (!utils_isWindowClosed(target)) return parentComp.destroy(err);\n                                    }));\n                                    return parentComp.getDelegateOverrides();\n                                })).catch((function(err) {\n                                    throw new Error(\"Unable to delegate rendering. Possibly the component is not loaded in the target window.\\n\\n\" + stringifyError(err));\n                                }));\n                                getProxyContainerOverride = function() {\n                                    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.getProxyContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                renderContainerOverride = function() {\n                                    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.renderContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                showOverride = function() {\n                                    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.show.apply(childOverrides, args);\n                                    }));\n                                };\n                                hideOverride = function() {\n                                    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.hide.apply(childOverrides, args);\n                                    }));\n                                };\n                                watchForUnloadOverride = function() {\n                                    for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) args[_key5] = arguments[_key5];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.watchForUnload.apply(childOverrides, args);\n                                    }));\n                                };\n                                if (context === CONTEXT.IFRAME) {\n                                    getProxyWindowOverride = function() {\n                                        for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) args[_key6] = arguments[_key6];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.getProxyWindow.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openFrameOverride = function() {\n                                        for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) args[_key7] = arguments[_key7];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderFrameOverride = function() {\n                                        for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) args[_key8] = arguments[_key8];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerenderFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    prerenderOverride = function() {\n                                        for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) args[_key9] = arguments[_key9];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.prerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openOverride = function() {\n                                        for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) args[_key10] = arguments[_key10];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.open.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderOverride = function() {\n                                        for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) args[_key11] = arguments[_key11];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                }\n                                return childOverridesPromise;\n                            }(context, target);\n                        }));\n                        var windowProp = props.window;\n                        var watchForUnloadPromise = watchForUnload();\n                        var buildBodyPromise = serializeProps(propsDef, props, \"post\");\n                        var onRenderPromise = event.trigger(EVENT.RENDER);\n                        var getProxyContainerPromise = getProxyContainer(container);\n                        var getProxyWindowPromise = getProxyWindow();\n                        var finalSetPropsPromise = getProxyContainerPromise.then((function() {\n                            return setProps();\n                        }));\n                        var buildUrlPromise = finalSetPropsPromise.then((function() {\n                            return serializeProps(propsDef, props, \"get\").then((function(query) {\n                                return function(url, options) {\n                                    var query = options.query || {};\n                                    var hash = options.hash || {};\n                                    var originalUrl;\n                                    var originalHash;\n                                    var _url$split = url.split(\"#\");\n                                    originalHash = _url$split[1];\n                                    var _originalUrl$split = (originalUrl = _url$split[0]).split(\"?\");\n                                    originalUrl = _originalUrl$split[0];\n                                    var queryString = extendQuery(_originalUrl$split[1], query);\n                                    var hashString = extendQuery(originalHash, hash);\n                                    queryString && (originalUrl = originalUrl + \"?\" + queryString);\n                                    hashString && (originalUrl = originalUrl + \"#\" + hashString);\n                                    return originalUrl;\n                                }(function(url) {\n                                    if (!(domain = utils_getDomainFromUrl(url), 0 === domain.indexOf(\"mock:\"))) return url;\n                                    var domain;\n                                    throw new Error(\"Mock urls not supported out of test mode\");\n                                }(getUrl()), {\n                                    query: query\n                                });\n                            }));\n                        }));\n                        var buildWindowNamePromise = getProxyWindowPromise.then((function(proxyWin) {\n                            return function(_temp2) {\n                                var _ref6 = void 0 === _temp2 ? {} : _temp2, proxyWin = _ref6.proxyWin, initialChildDomain = _ref6.initialChildDomain, childDomainMatch = _ref6.childDomainMatch, _ref6$target = _ref6.target, target = void 0 === _ref6$target ? window : _ref6$target, context = _ref6.context;\n                                return function(_temp) {\n                                    var _ref5 = void 0 === _temp ? {} : _temp, proxyWin = _ref5.proxyWin, childDomainMatch = _ref5.childDomainMatch, context = _ref5.context;\n                                    return getPropsForChild(_ref5.initialChildDomain).then((function(childProps) {\n                                        return {\n                                            uid: uid,\n                                            context: context,\n                                            tag: tag,\n                                            childDomainMatch: childDomainMatch,\n                                            version: \"9_0_87\",\n                                            props: childProps,\n                                            exports: (win = proxyWin, {\n                                                init: function(childExports) {\n                                                    return initChild(this.origin, childExports);\n                                                },\n                                                close: close,\n                                                checkClose: function() {\n                                                    return checkWindowClose(win);\n                                                },\n                                                resize: resize,\n                                                onError: onError,\n                                                show: show,\n                                                hide: hide,\n                                                export: xport\n                                            })\n                                        };\n                                        var win;\n                                    }));\n                                }({\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    context: context\n                                }).then((function(childPayload) {\n                                    var _crossDomainSerialize = crossDomainSerialize({\n                                        data: childPayload,\n                                        metaData: {\n                                            windowRef: getWindowRef(target, initialChildDomain, context, proxyWin)\n                                        },\n                                        sender: {\n                                            domain: utils_getDomain(window)\n                                        },\n                                        receiver: {\n                                            win: proxyWin,\n                                            domain: childDomainMatch\n                                        },\n                                        passByReference: initialChildDomain === utils_getDomain()\n                                    }), serializedData = _crossDomainSerialize.serializedData;\n                                    clean.register(_crossDomainSerialize.cleanReference);\n                                    return serializedData;\n                                }));\n                            }({\n                                proxyWin: (_ref7 = {\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    target: target,\n                                    context: context\n                                }).proxyWin,\n                                initialChildDomain: _ref7.initialChildDomain,\n                                childDomainMatch: _ref7.childDomainMatch,\n                                target: _ref7.target,\n                                context: _ref7.context\n                            }).then((function(serializedPayload) {\n                                return buildChildWindowName({\n                                    name: name,\n                                    serializedPayload: serializedPayload\n                                });\n                            }));\n                            var _ref7;\n                        }));\n                        var openFramePromise = buildWindowNamePromise.then((function(windowName) {\n                            return openFrame(context, {\n                                windowName: windowName\n                            });\n                        }));\n                        var openPrerenderFramePromise = openPrerenderFrame(context);\n                        var renderContainerPromise = promise_ZalgoPromise.hash({\n                            proxyContainer: getProxyContainerPromise,\n                            proxyFrame: openFramePromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref15) {\n                            return renderContainer(_ref15.proxyContainer, {\n                                context: context,\n                                proxyFrame: _ref15.proxyFrame,\n                                proxyPrerenderFrame: _ref15.proxyPrerenderFrame,\n                                rerender: rerender\n                            });\n                        })).then((function(proxyContainer) {\n                            return proxyContainer;\n                        }));\n                        var openPromise = promise_ZalgoPromise.hash({\n                            windowName: buildWindowNamePromise,\n                            proxyFrame: openFramePromise,\n                            proxyWin: getProxyWindowPromise\n                        }).then((function(_ref16) {\n                            var proxyWin = _ref16.proxyWin;\n                            return windowProp ? proxyWin : open(context, {\n                                windowName: _ref16.windowName,\n                                proxyWin: proxyWin,\n                                proxyFrame: _ref16.proxyFrame\n                            });\n                        }));\n                        var openPrerenderPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref17) {\n                            return openPrerender(context, _ref17.proxyWin, _ref17.proxyPrerenderFrame);\n                        }));\n                        var setStatePromise = openPromise.then((function(proxyWin) {\n                            currentProxyWin = proxyWin;\n                            return setProxyWin(proxyWin);\n                        }));\n                        var prerenderPromise = promise_ZalgoPromise.hash({\n                            proxyPrerenderWin: openPrerenderPromise,\n                            state: setStatePromise\n                        }).then((function(_ref18) {\n                            return prerender(_ref18.proxyPrerenderWin, {\n                                context: context\n                            });\n                        }));\n                        var setWindowNamePromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowName: buildWindowNamePromise\n                        }).then((function(_ref19) {\n                            if (windowProp) return _ref19.proxyWin.setName(_ref19.windowName);\n                        }));\n                        var getMethodPromise = promise_ZalgoPromise.hash({\n                            body: buildBodyPromise\n                        }).then((function(_ref20) {\n                            return options.method ? options.method : Object.keys(_ref20.body).length ? \"post\" : \"get\";\n                        }));\n                        var loadUrlPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowUrl: buildUrlPromise,\n                            body: buildBodyPromise,\n                            method: getMethodPromise,\n                            windowName: setWindowNamePromise,\n                            prerender: prerenderPromise\n                        }).then((function(_ref21) {\n                            return _ref21.proxyWin.setLocation(_ref21.windowUrl, {\n                                method: _ref21.method,\n                                body: _ref21.body\n                            });\n                        }));\n                        var watchForClosePromise = openPromise.then((function(proxyWin) {\n                            !function watchForClose(proxyWin, context) {\n                                var cancelled = !1;\n                                clean.register((function() {\n                                    cancelled = !0;\n                                }));\n                                return promise_ZalgoPromise.delay(2e3).then((function() {\n                                    return proxyWin.isClosed();\n                                })).then((function(isClosed) {\n                                    if (!cancelled) return isClosed ? close(new Error(\"Detected \" + context + \" close\")) : watchForClose(proxyWin, context);\n                                }));\n                            }(proxyWin, context);\n                        }));\n                        var onDisplayPromise = promise_ZalgoPromise.hash({\n                            container: renderContainerPromise,\n                            prerender: prerenderPromise\n                        }).then((function() {\n                            return event.trigger(EVENT.DISPLAY);\n                        }));\n                        var openBridgePromise = openPromise.then((function(proxyWin) {}));\n                        var runTimeoutPromise = loadUrlPromise.then((function() {\n                            return promise_ZalgoPromise.try((function() {\n                                var timeout = props.timeout;\n                                if (timeout) return initPromise.timeout(timeout, new Error(\"Loading component timed out after \" + timeout + \" milliseconds\"));\n                            }));\n                        }));\n                        var onRenderedPromise = initPromise.then((function() {\n                            return event.trigger(EVENT.RENDERED);\n                        }));\n                        return promise_ZalgoPromise.hash({\n                            initPromise: initPromise,\n                            buildUrlPromise: buildUrlPromise,\n                            onRenderPromise: onRenderPromise,\n                            getProxyContainerPromise: getProxyContainerPromise,\n                            openFramePromise: openFramePromise,\n                            openPrerenderFramePromise: openPrerenderFramePromise,\n                            renderContainerPromise: renderContainerPromise,\n                            openPromise: openPromise,\n                            openPrerenderPromise: openPrerenderPromise,\n                            setStatePromise: setStatePromise,\n                            prerenderPromise: prerenderPromise,\n                            loadUrlPromise: loadUrlPromise,\n                            buildWindowNamePromise: buildWindowNamePromise,\n                            setWindowNamePromise: setWindowNamePromise,\n                            watchForClosePromise: watchForClosePromise,\n                            onDisplayPromise: onDisplayPromise,\n                            openBridgePromise: openBridgePromise,\n                            runTimeoutPromise: runTimeoutPromise,\n                            onRenderedPromise: onRenderedPromise,\n                            delegatePromise: delegatePromise,\n                            watchForUnloadPromise: watchForUnloadPromise,\n                            finalSetPropsPromise: finalSetPropsPromise\n                        });\n                    })).catch((function(err) {\n                        return promise_ZalgoPromise.all([ onError(err), destroy(err) ]).then((function() {\n                            throw err;\n                        }), (function() {\n                            throw err;\n                        }));\n                    })).then(src_util_noop);\n                },\n                destroy: destroy,\n                getProps: function() {\n                    return props;\n                },\n                setProps: setProps,\n                export: xport,\n                getHelpers: getHelpers,\n                getDelegateOverrides: function() {\n                    return promise_ZalgoPromise.try((function() {\n                        return {\n                            getProxyContainer: getProxyContainer,\n                            show: show,\n                            hide: hide,\n                            renderContainer: renderContainer,\n                            getProxyWindow: getProxyWindow,\n                            watchForUnload: watchForUnload,\n                            openFrame: openFrame,\n                            openPrerenderFrame: openPrerenderFrame,\n                            prerender: prerender,\n                            open: open,\n                            openPrerender: openPrerender,\n                            setProxyWin: setProxyWin\n                        };\n                    }));\n                },\n                getExports: function() {\n                    return xports({\n                        getExports: function() {\n                            return exportsPromise;\n                        }\n                    });\n                }\n            };\n        }\n        var react = {\n            register: function(tag, propsDef, init, _ref) {\n                var React = _ref.React, ReactDOM = _ref.ReactDOM;\n                return function(_React$Component) {\n                    _inheritsLoose(_class, _React$Component);\n                    function _class() {\n                        return _React$Component.apply(this, arguments) || this;\n                    }\n                    var _proto = _class.prototype;\n                    _proto.render = function() {\n                        return React.createElement(\"div\", null);\n                    };\n                    _proto.componentDidMount = function() {\n                        var el = ReactDOM.findDOMNode(this);\n                        var parent = init(extend({}, this.props));\n                        parent.render(el, CONTEXT.IFRAME);\n                        this.setState({\n                            parent: parent\n                        });\n                    };\n                    _proto.componentDidUpdate = function() {\n                        this.state && this.state.parent && this.state.parent.updateProps(extend({}, this.props)).catch(src_util_noop);\n                    };\n                    return _class;\n                }(React.Component);\n            }\n        };\n        var vue = {\n            register: function(tag, propsDef, init, Vue) {\n                return Vue.component(tag, {\n                    render: function(createElement) {\n                        return createElement(\"div\");\n                    },\n                    inheritAttrs: !1,\n                    mounted: function() {\n                        var el = this.$el;\n                        this.parent = init(_extends({}, (props = this.$attrs, Object.keys(props).reduce((function(acc, key) {\n                            var value = props[key];\n                            if (\"style-object\" === key || \"styleObject\" === key) {\n                                acc.style = value;\n                                acc.styleObject = value;\n                            } else key.includes(\"-\") ? acc[dasherizeToCamel(key)] = value : acc[key] = value;\n                            return acc;\n                        }), {}))));\n                        var props;\n                        this.parent.render(el, CONTEXT.IFRAME);\n                    },\n                    watch: {\n                        $attrs: {\n                            handler: function() {\n                                this.parent && this.$attrs && this.parent.updateProps(_extends({}, this.$attrs)).catch(src_util_noop);\n                            },\n                            deep: !0\n                        }\n                    }\n                });\n            }\n        };\n        var vue3 = {\n            register: function(tag, propsDef, init) {\n                return {\n                    template: \"<div></div>\",\n                    inheritAttrs: !1,\n                    mounted: function() {\n                        var el = this.$el;\n                        this.parent = init(_extends({}, (props = this.$attrs, Object.keys(props).reduce((function(acc, key) {\n                            var value = props[key];\n                            if (\"style-object\" === key || \"styleObject\" === key) {\n                                acc.style = value;\n                                acc.styleObject = value;\n                            } else key.includes(\"-\") ? acc[dasherizeToCamel(key)] = value : acc[key] = value;\n                            return acc;\n                        }), {}))));\n                        var props;\n                        this.parent.render(el, CONTEXT.IFRAME);\n                    },\n                    watch: {\n                        $attrs: {\n                            handler: function() {\n                                this.parent && this.$attrs && this.parent.updateProps(_extends({}, this.$attrs)).catch(src_util_noop);\n                            },\n                            deep: !0\n                        }\n                    }\n                };\n            }\n        };\n        var angular = {\n            register: function(tag, propsDef, init, ng) {\n                return ng.module(tag, []).directive(dasherizeToCamel(tag), (function() {\n                    var scope = {};\n                    for (var _i2 = 0, _Object$keys2 = Object.keys(propsDef); _i2 < _Object$keys2.length; _i2++) scope[_Object$keys2[_i2]] = \"=\";\n                    scope.props = \"=\";\n                    return {\n                        scope: scope,\n                        restrict: \"E\",\n                        controller: [ \"$scope\", \"$element\", function($scope, $element) {\n                            function safeApply() {\n                                if (\"$apply\" !== $scope.$root.$$phase && \"$digest\" !== $scope.$root.$$phase) try {\n                                    $scope.$apply();\n                                } catch (err) {}\n                            }\n                            var getProps = function() {\n                                return replaceObject($scope.props, (function(item) {\n                                    return \"function\" == typeof item ? function() {\n                                        var result = item.apply(this, arguments);\n                                        safeApply();\n                                        return result;\n                                    } : item;\n                                }));\n                            };\n                            var instance = init(getProps());\n                            instance.render($element[0], CONTEXT.IFRAME);\n                            $scope.$watch((function() {\n                                instance.updateProps(getProps()).catch(src_util_noop);\n                            }));\n                        } ]\n                    };\n                }));\n            }\n        };\n        var angular2 = {\n            register: function(tag, propsDef, init, _ref) {\n                var AngularComponent = _ref.Component, NgModule = _ref.NgModule, ElementRef = _ref.ElementRef, NgZone = _ref.NgZone, Inject = _ref.Inject;\n                var ComponentInstance = function() {\n                    function ComponentInstance(elementRef, zone) {\n                        this.elementRef = void 0;\n                        this.internalProps = void 0;\n                        this.parent = void 0;\n                        this.props = void 0;\n                        this.zone = void 0;\n                        this._props = void 0;\n                        this._props = {};\n                        this.elementRef = elementRef;\n                        this.zone = zone;\n                    }\n                    var _proto = ComponentInstance.prototype;\n                    _proto.getProps = function() {\n                        var _this = this;\n                        return replaceObject(_extends({}, this.internalProps, this.props), (function(item) {\n                            if (\"function\" == typeof item) {\n                                var zone = _this.zone;\n                                return function() {\n                                    var _arguments = arguments, _this2 = this;\n                                    return zone.run((function() {\n                                        return item.apply(_this2, _arguments);\n                                    }));\n                                };\n                            }\n                            return item;\n                        }));\n                    };\n                    _proto.ngOnInit = function() {\n                        var targetElement = this.elementRef.nativeElement;\n                        this.parent = init(this.getProps());\n                        this.parent.render(targetElement, CONTEXT.IFRAME);\n                    };\n                    _proto.ngDoCheck = function() {\n                        if (this.parent && !function(obj1, obj2) {\n                            var checked = {};\n                            for (var key in obj1) if (obj1.hasOwnProperty(key)) {\n                                checked[key] = !0;\n                                if (obj1[key] !== obj2[key]) return !1;\n                            }\n                            for (var _key in obj2) if (!checked[_key]) return !1;\n                            return !0;\n                        }(this._props, this.props)) {\n                            this._props = _extends({}, this.props);\n                            this.parent.updateProps(this.getProps());\n                        }\n                    };\n                    return ComponentInstance;\n                }();\n                ComponentInstance.annotations = void 0;\n                ComponentInstance.parameters = void 0;\n                ComponentInstance.parameters = [ [ new Inject(ElementRef) ], [ new Inject(NgZone) ] ];\n                ComponentInstance.annotations = [ new AngularComponent({\n                    selector: tag,\n                    template: \"<div></div>\",\n                    inputs: [ \"props\" ]\n                }) ];\n                var ModuleInstance = function() {};\n                ModuleInstance.annotations = void 0;\n                ModuleInstance.annotations = [ new NgModule({\n                    declarations: [ ComponentInstance ],\n                    exports: [ ComponentInstance ]\n                }) ];\n                return ModuleInstance;\n            }\n        };\n        function defaultContainerTemplate(_ref) {\n            var uid = _ref.uid, frame = _ref.frame, prerenderFrame = _ref.prerenderFrame, doc = _ref.doc, props = _ref.props, event = _ref.event, dimensions = _ref.dimensions;\n            var width = dimensions.width, height = dimensions.height;\n            if (frame && prerenderFrame) {\n                var div = doc.createElement(\"div\");\n                div.setAttribute(\"id\", uid);\n                var style = doc.createElement(\"style\");\n                props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n                style.appendChild(doc.createTextNode(\"\\n            #\" + uid + \" {\\n                display: inline-block;\\n                position: relative;\\n                width: \" + width + \";\\n                height: \" + height + \";\\n            }\\n\\n            #\" + uid + \" > iframe {\\n                display: inline-block;\\n                position: absolute;\\n                width: 100%;\\n                height: 100%;\\n                top: 0;\\n                left: 0;\\n                transition: opacity .2s ease-in-out;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-invisible {\\n                opacity: 0;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-visible {\\n                opacity: 1;\\n        }\\n        \"));\n                div.appendChild(frame);\n                div.appendChild(prerenderFrame);\n                div.appendChild(style);\n                prerenderFrame.classList.add(\"zoid-visible\");\n                frame.classList.add(\"zoid-invisible\");\n                event.on(EVENT.RENDERED, (function() {\n                    prerenderFrame.classList.remove(\"zoid-visible\");\n                    prerenderFrame.classList.add(\"zoid-invisible\");\n                    frame.classList.remove(\"zoid-invisible\");\n                    frame.classList.add(\"zoid-visible\");\n                    setTimeout((function() {\n                        destroyElement(prerenderFrame);\n                    }), 1);\n                }));\n                event.on(EVENT.RESIZE, (function(_ref2) {\n                    var newWidth = _ref2.width, newHeight = _ref2.height;\n                    \"number\" == typeof newWidth && (div.style.width = toCSS(newWidth));\n                    \"number\" == typeof newHeight && (div.style.height = toCSS(newHeight));\n                }));\n                return div;\n            }\n        }\n        function defaultPrerenderTemplate(_ref) {\n            var doc = _ref.doc, props = _ref.props;\n            var html = doc.createElement(\"html\");\n            var body = doc.createElement(\"body\");\n            var style = doc.createElement(\"style\");\n            var spinner = doc.createElement(\"div\");\n            spinner.classList.add(\"spinner\");\n            props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n            html.appendChild(body);\n            body.appendChild(spinner);\n            body.appendChild(style);\n            style.appendChild(doc.createTextNode(\"\\n            html, body {\\n                width: 100%;\\n                height: 100%;\\n            }\\n\\n            .spinner {\\n                position: fixed;\\n                max-height: 60vmin;\\n                max-width: 60vmin;\\n                height: 40px;\\n                width: 40px;\\n                top: 50%;\\n                left: 50%;\\n                box-sizing: border-box;\\n                border: 3px solid rgba(0, 0, 0, .2);\\n                border-top-color: rgba(33, 128, 192, 0.8);\\n                border-radius: 100%;\\n                animation: rotation .7s infinite linear;\\n            }\\n\\n            @keyframes rotation {\\n                from {\\n                    transform: translateX(-50%) translateY(-50%) rotate(0deg);\\n                }\\n                to {\\n                    transform: translateX(-50%) translateY(-50%) rotate(359deg);\\n                }\\n            }\\n        \"));\n            return html;\n        }\n        var cleanInstances = cleanup();\n        var cleanZoid = cleanup();\n        function component(opts) {\n            var options = function(options) {\n                var tag = options.tag, url = options.url, domain = options.domain, bridgeUrl = options.bridgeUrl, _options$props = options.props, props = void 0 === _options$props ? {} : _options$props, _options$dimensions = options.dimensions, dimensions = void 0 === _options$dimensions ? {} : _options$dimensions, _options$autoResize = options.autoResize, autoResize = void 0 === _options$autoResize ? {} : _options$autoResize, _options$allowedParen = options.allowedParentDomains, allowedParentDomains = void 0 === _options$allowedParen ? \"*\" : _options$allowedParen, _options$attributes = options.attributes, attributes = void 0 === _options$attributes ? {} : _options$attributes, _options$defaultConte = options.defaultContext, defaultContext = void 0 === _options$defaultConte ? CONTEXT.IFRAME : _options$defaultConte, _options$containerTem = options.containerTemplate, containerTemplate = void 0 === _options$containerTem ? defaultContainerTemplate : _options$containerTem, _options$prerenderTem = options.prerenderTemplate, prerenderTemplate = void 0 === _options$prerenderTem ? defaultPrerenderTemplate : _options$prerenderTem, validate = options.validate, _options$eligible = options.eligible, eligible = void 0 === _options$eligible ? function() {\n                    return {\n                        eligible: !0\n                    };\n                } : _options$eligible, _options$logger = options.logger, logger = void 0 === _options$logger ? {\n                    info: src_util_noop\n                } : _options$logger, _options$exports = options.exports, xportsDefinition = void 0 === _options$exports ? src_util_noop : _options$exports, method = options.method, _options$children = options.children, children = void 0 === _options$children ? function() {\n                    return {};\n                } : _options$children;\n                var name = tag.replace(/-/g, \"_\");\n                var propsDef = _extends({}, {\n                    window: {\n                        type: PROP_TYPE.OBJECT,\n                        sendToChild: !1,\n                        required: !1,\n                        allowDelegate: !0,\n                        validate: function(_ref2) {\n                            var value = _ref2.value;\n                            if (!utils_isWindow(value) && !window_ProxyWindow.isProxyWindow(value)) throw new Error(\"Expected Window or ProxyWindow\");\n                            if (utils_isWindow(value)) {\n                                if (utils_isWindowClosed(value)) throw new Error(\"Window is closed\");\n                                if (!utils_isSameDomain(value)) throw new Error(\"Window is not same domain\");\n                            }\n                        },\n                        decorate: function(_ref3) {\n                            return setup_toProxyWindow(_ref3.value);\n                        }\n                    },\n                    timeout: {\n                        type: PROP_TYPE.NUMBER,\n                        required: !1,\n                        sendToChild: !1\n                    },\n                    cspNonce: {\n                        type: PROP_TYPE.STRING,\n                        required: !1\n                    },\n                    onDisplay: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRendered: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRender: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onClose: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onDestroy: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onResize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    onFocus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    close: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref4) {\n                            return _ref4.close;\n                        }\n                    },\n                    focus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref5) {\n                            return _ref5.focus;\n                        }\n                    },\n                    resize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref6) {\n                            return _ref6.resize;\n                        }\n                    },\n                    uid: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref7) {\n                            return _ref7.uid;\n                        }\n                    },\n                    tag: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref8) {\n                            return _ref8.tag;\n                        }\n                    },\n                    getParent: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref9) {\n                            return _ref9.getParent;\n                        }\n                    },\n                    getParentDomain: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref10) {\n                            return _ref10.getParentDomain;\n                        }\n                    },\n                    show: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref11) {\n                            return _ref11.show;\n                        }\n                    },\n                    hide: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref12) {\n                            return _ref12.hide;\n                        }\n                    },\n                    export: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref13) {\n                            return _ref13.export;\n                        }\n                    },\n                    onError: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref14) {\n                            return _ref14.onError;\n                        }\n                    },\n                    onProps: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref15) {\n                            return _ref15.onProps;\n                        }\n                    },\n                    getSiblings: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref16) {\n                            return _ref16.getSiblings;\n                        }\n                    }\n                }, props);\n                if (!containerTemplate) throw new Error(\"Container template required\");\n                return {\n                    name: name,\n                    tag: tag,\n                    url: url,\n                    domain: domain,\n                    bridgeUrl: bridgeUrl,\n                    method: method,\n                    propsDef: propsDef,\n                    dimensions: dimensions,\n                    autoResize: autoResize,\n                    allowedParentDomains: allowedParentDomains,\n                    attributes: attributes,\n                    defaultContext: defaultContext,\n                    containerTemplate: containerTemplate,\n                    prerenderTemplate: prerenderTemplate,\n                    validate: validate,\n                    logger: logger,\n                    eligible: eligible,\n                    children: children,\n                    exports: \"function\" == typeof xportsDefinition ? xportsDefinition : function(_ref) {\n                        var getExports = _ref.getExports;\n                        var result = {};\n                        var _loop = function(_i2, _Object$keys2) {\n                            var key = _Object$keys2[_i2];\n                            var type = xportsDefinition[key].type;\n                            var valuePromise = getExports().then((function(res) {\n                                return res[key];\n                            }));\n                            result[key] = type === PROP_TYPE.FUNCTION ? function() {\n                                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                return valuePromise.then((function(value) {\n                                    return value.apply(void 0, args);\n                                }));\n                            } : valuePromise;\n                        };\n                        for (var _i2 = 0, _Object$keys2 = Object.keys(xportsDefinition); _i2 < _Object$keys2.length; _i2++) _loop(_i2, _Object$keys2);\n                        return result;\n                    }\n                };\n            }(opts);\n            var name = options.name, tag = options.tag, defaultContext = options.defaultContext, propsDef = options.propsDef, eligible = options.eligible, children = options.children;\n            var global = lib_global_getGlobal(window);\n            var driverCache = {};\n            var instances = [];\n            var isChild = function() {\n                if (function(name) {\n                    try {\n                        return parseWindowName(window.name).name === name;\n                    } catch (err) {}\n                    return !1;\n                }(name)) {\n                    var _payload = getInitialParentPayload().payload;\n                    if (_payload.tag === tag && utils_matchDomain(_payload.childDomainMatch, utils_getDomain())) return !0;\n                }\n                return !1;\n            };\n            var registerChild = memoize((function() {\n                if (isChild()) {\n                    if (window.xprops) {\n                        delete global.components[tag];\n                        throw new Error(\"Can not register \" + name + \" as child - child already registered\");\n                    }\n                    var child = function(options) {\n                        var tag = options.tag, propsDef = options.propsDef, autoResize = options.autoResize, allowedParentDomains = options.allowedParentDomains;\n                        var onPropHandlers = [];\n                        var _getInitialParentPayl = getInitialParentPayload(), parent = _getInitialParentPayl.parent, payload = _getInitialParentPayl.payload;\n                        var parentComponentWindow = parent.win, parentDomain = parent.domain;\n                        var props;\n                        var exportsPromise = new promise_ZalgoPromise;\n                        var version = payload.version, uid = payload.uid, parentExports = payload.exports, context = payload.context, initialProps = payload.props;\n                        if (\"9_0_87\" !== version) throw new Error(\"Parent window has zoid version \" + version + \", child window has version 9_0_87\");\n                        var show = parentExports.show, hide = parentExports.hide, close = parentExports.close, onError = parentExports.onError, checkClose = parentExports.checkClose, parentExport = parentExports.export, parentResize = parentExports.resize, parentInit = parentExports.init;\n                        var getParent = function() {\n                            return parentComponentWindow;\n                        };\n                        var getParentDomain = function() {\n                            return parentDomain;\n                        };\n                        var onProps = function(handler) {\n                            onPropHandlers.push(handler);\n                            return {\n                                cancel: function() {\n                                    onPropHandlers.splice(onPropHandlers.indexOf(handler), 1);\n                                }\n                            };\n                        };\n                        var resize = function(_ref) {\n                            return parentResize.fireAndForget({\n                                width: _ref.width,\n                                height: _ref.height\n                            });\n                        };\n                        var xport = function(xports) {\n                            exportsPromise.resolve(xports);\n                            return parentExport(xports);\n                        };\n                        var getSiblings = function(_temp) {\n                            var anyParent = (void 0 === _temp ? {} : _temp).anyParent;\n                            var result = [];\n                            var currentParent = props.parent;\n                            void 0 === anyParent && (anyParent = !currentParent);\n                            if (!anyParent && !currentParent) throw new Error(\"No parent found for \" + tag + \" child\");\n                            for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(window); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                var win = _getAllFramesInWindow2[_i2];\n                                if (utils_isSameDomain(win)) {\n                                    var xprops = utils_assertSameDomain(win).xprops;\n                                    if (xprops && getParent() === xprops.getParent()) {\n                                        var winParent = xprops.parent;\n                                        if (anyParent || !currentParent || winParent && winParent.uid === currentParent.uid) {\n                                            var xports = tryGlobal(win, (function(global) {\n                                                return global.exports;\n                                            }));\n                                            result.push({\n                                                props: xprops,\n                                                exports: xports\n                                            });\n                                        }\n                                    }\n                                }\n                            }\n                            return result;\n                        };\n                        var setProps = function(newProps, origin, isUpdate) {\n                            void 0 === isUpdate && (isUpdate = !1);\n                            var normalizedProps = function(parentComponentWindow, propsDef, props, origin, helpers, isUpdate) {\n                                void 0 === isUpdate && (isUpdate = !1);\n                                var result = {};\n                                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                                    var key = _Object$keys2[_i2];\n                                    var prop = propsDef[key];\n                                    if (!prop || !prop.sameDomain || origin === utils_getDomain(window) && utils_isSameDomain(parentComponentWindow)) {\n                                        var value = normalizeChildProp(propsDef, 0, key, props[key], helpers);\n                                        result[key] = value;\n                                        prop && prop.alias && !result[prop.alias] && (result[prop.alias] = value);\n                                    }\n                                }\n                                if (!isUpdate) for (var _i4 = 0, _Object$keys4 = Object.keys(propsDef); _i4 < _Object$keys4.length; _i4++) {\n                                    var _key = _Object$keys4[_i4];\n                                    props.hasOwnProperty(_key) || (result[_key] = normalizeChildProp(propsDef, 0, _key, void 0, helpers));\n                                }\n                                return result;\n                            }(parentComponentWindow, propsDef, newProps, origin, {\n                                tag: tag,\n                                show: show,\n                                hide: hide,\n                                close: close,\n                                focus: child_focus,\n                                onError: onError,\n                                resize: resize,\n                                getSiblings: getSiblings,\n                                onProps: onProps,\n                                getParent: getParent,\n                                getParentDomain: getParentDomain,\n                                uid: uid,\n                                export: xport\n                            }, isUpdate);\n                            props ? extend(props, normalizedProps) : props = normalizedProps;\n                            for (var _i4 = 0; _i4 < onPropHandlers.length; _i4++) (0, onPropHandlers[_i4])(props);\n                        };\n                        var updateProps = function(newProps) {\n                            return promise_ZalgoPromise.try((function() {\n                                return setProps(newProps, parentDomain, !0);\n                            }));\n                        };\n                        return {\n                            init: function() {\n                                return promise_ZalgoPromise.try((function() {\n                                    utils_isSameDomain(parentComponentWindow) && function(_ref3) {\n                                        var componentName = _ref3.componentName, parentComponentWindow = _ref3.parentComponentWindow;\n                                        var _crossDomainDeseriali2 = crossDomainDeserialize({\n                                            data: parseWindowName(window.name).serializedInitialPayload,\n                                            sender: {\n                                                win: parentComponentWindow\n                                            },\n                                            basic: !0\n                                        }), sender = _crossDomainDeseriali2.sender;\n                                        if (\"uid\" === _crossDomainDeseriali2.reference.type || \"global\" === _crossDomainDeseriali2.metaData.windowRef.type) {\n                                            var _crossDomainSerialize = crossDomainSerialize({\n                                                data: _crossDomainDeseriali2.data,\n                                                metaData: {\n                                                    windowRef: window_getWindowRef(parentComponentWindow)\n                                                },\n                                                sender: {\n                                                    domain: sender.domain\n                                                },\n                                                receiver: {\n                                                    win: window,\n                                                    domain: utils_getDomain()\n                                                },\n                                                basic: !0\n                                            });\n                                            window.name = buildChildWindowName({\n                                                name: componentName,\n                                                serializedPayload: _crossDomainSerialize.serializedData\n                                            });\n                                        }\n                                    }({\n                                        componentName: options.name,\n                                        parentComponentWindow: parentComponentWindow\n                                    });\n                                    lib_global_getGlobal(window).exports = options.exports({\n                                        getExports: function() {\n                                            return exportsPromise;\n                                        }\n                                    });\n                                    !function(allowedParentDomains, domain) {\n                                        if (!utils_matchDomain(allowedParentDomains, domain)) throw new Error(\"Can not be rendered by domain: \" + domain);\n                                    }(allowedParentDomains, parentDomain);\n                                    markWindowKnown(parentComponentWindow);\n                                    !function() {\n                                        window.addEventListener(\"beforeunload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        window.addEventListener(\"unload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        utils_onCloseWindow(parentComponentWindow, (function() {\n                                            child_destroy();\n                                        }));\n                                    }();\n                                    return parentInit({\n                                        updateProps: updateProps,\n                                        close: child_destroy\n                                    });\n                                })).then((function() {\n                                    return (_autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, \n                                    _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, \n                                    _autoResize$element = autoResize.element, elementReady(void 0 === _autoResize$element ? \"body\" : _autoResize$element).catch(src_util_noop).then((function(element) {\n                                        return {\n                                            width: width,\n                                            height: height,\n                                            element: element\n                                        };\n                                    }))).then((function(_ref3) {\n                                        var width = _ref3.width, height = _ref3.height, element = _ref3.element;\n                                        element && (width || height) && context !== CONTEXT.POPUP && onResize(element, (function(_ref4) {\n                                            resize({\n                                                width: width ? _ref4.width : void 0,\n                                                height: height ? _ref4.height : void 0\n                                            });\n                                        }), {\n                                            width: width,\n                                            height: height\n                                        });\n                                    }));\n                                    var _autoResize$width, width, _autoResize$height, height, _autoResize$element;\n                                })).catch((function(err) {\n                                    onError(err);\n                                }));\n                            },\n                            getProps: function() {\n                                if (props) return props;\n                                setProps(initialProps, parentDomain);\n                                return props;\n                            }\n                        };\n                    }(options);\n                    child.init();\n                    return child;\n                }\n            }));\n            var init = function init(inputProps) {\n                var instance;\n                var uid = \"zoid-\" + tag + \"-\" + uniqueID();\n                var props = inputProps || {};\n                var _eligible = eligible({\n                    props: props\n                }), eligibility = _eligible.eligible, reason = _eligible.reason;\n                var onDestroy = props.onDestroy;\n                props.onDestroy = function() {\n                    instance && eligibility && instances.splice(instances.indexOf(instance), 1);\n                    if (onDestroy) return onDestroy.apply(void 0, arguments);\n                };\n                var parent = parentComponent({\n                    uid: uid,\n                    options: options\n                });\n                parent.init();\n                eligibility ? parent.setProps(props) : props.onDestroy && props.onDestroy();\n                cleanInstances.register((function(err) {\n                    return parent.destroy(err || new Error(\"zoid destroyed all components\"));\n                }));\n                var clone = function(_temp) {\n                    var _ref4$decorate = (void 0 === _temp ? {} : _temp).decorate;\n                    return init((void 0 === _ref4$decorate ? identity : _ref4$decorate)(props));\n                };\n                var _render = function(target, container, context) {\n                    return promise_ZalgoPromise.try((function() {\n                        if (!eligibility) {\n                            var err = new Error(reason || name + \" component is not eligible\");\n                            return parent.destroy(err).then((function() {\n                                throw err;\n                            }));\n                        }\n                        if (!utils_isWindow(target)) throw new Error(\"Must pass window to renderTo\");\n                        return function(props, context) {\n                            return promise_ZalgoPromise.try((function() {\n                                if (props.window) return setup_toProxyWindow(props.window).getType();\n                                if (context) {\n                                    if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) throw new Error(\"Unrecognized context: \" + context);\n                                    return context;\n                                }\n                                return defaultContext;\n                            }));\n                        }(props, context);\n                    })).then((function(finalContext) {\n                        container = function(context, container) {\n                            if (container) {\n                                if (\"string\" != typeof container && !isElement(container)) throw new TypeError(\"Expected string or element selector to be passed\");\n                                return container;\n                            }\n                            if (context === CONTEXT.POPUP) return \"body\";\n                            throw new Error(\"Expected element to be passed to render iframe\");\n                        }(finalContext, container);\n                        if (target !== window && \"string\" != typeof container) throw new Error(\"Must pass string element when rendering to another window\");\n                        return parent.render({\n                            target: target,\n                            container: container,\n                            context: finalContext,\n                            rerender: function() {\n                                var newInstance = clone();\n                                extend(instance, newInstance);\n                                return newInstance.renderTo(target, container, context);\n                            }\n                        });\n                    })).catch((function(err) {\n                        return parent.destroy(err).then((function() {\n                            throw err;\n                        }));\n                    }));\n                };\n                instance = _extends({}, parent.getExports(), parent.getHelpers(), function() {\n                    var childComponents = children();\n                    var result = {};\n                    var _loop2 = function(_i4, _Object$keys4) {\n                        var childName = _Object$keys4[_i4];\n                        var Child = childComponents[childName];\n                        result[childName] = function(childInputProps) {\n                            var parentProps = parent.getProps();\n                            var childProps = _extends({}, childInputProps, {\n                                parent: {\n                                    uid: uid,\n                                    props: parentProps,\n                                    export: parent.export\n                                }\n                            });\n                            return Child(childProps);\n                        };\n                    };\n                    for (var _i4 = 0, _Object$keys4 = Object.keys(childComponents); _i4 < _Object$keys4.length; _i4++) _loop2(_i4, _Object$keys4);\n                    return result;\n                }(), {\n                    isEligible: function() {\n                        return eligibility;\n                    },\n                    clone: clone,\n                    render: function(container, context) {\n                        return _render(window, container, context);\n                    },\n                    renderTo: function(target, container, context) {\n                        return _render(target, container, context);\n                    }\n                });\n                eligibility && instances.push(instance);\n                return instance;\n            };\n            registerChild();\n            !function() {\n                var allowDelegateListener = on_on(\"zoid_allow_delegate_\" + name, (function() {\n                    return !0;\n                }));\n                var delegateListener = on_on(\"zoid_delegate_\" + name, (function(_ref2) {\n                    var _ref2$data = _ref2.data;\n                    return {\n                        parent: parentComponent({\n                            uid: _ref2$data.uid,\n                            options: options,\n                            overrides: _ref2$data.overrides,\n                            parentWin: _ref2.source\n                        })\n                    };\n                }));\n                cleanZoid.register(allowDelegateListener.cancel);\n                cleanZoid.register(delegateListener.cancel);\n            }();\n            global.components = global.components || {};\n            if (global.components[tag]) throw new Error(\"Can not register multiple components with the same tag: \" + tag);\n            global.components[tag] = !0;\n            return {\n                init: init,\n                instances: instances,\n                driver: function(driverName, dep) {\n                    var drivers = {\n                        react: react,\n                        angular: angular,\n                        vue: vue,\n                        vue3: vue3,\n                        angular2: angular2\n                    };\n                    if (!drivers[driverName]) throw new Error(\"Could not find driver for framework: \" + driverName);\n                    driverCache[driverName] || (driverCache[driverName] = drivers[driverName].register(tag, propsDef, init, dep));\n                    return driverCache[driverName];\n                },\n                isChild: isChild,\n                canRenderTo: function(win) {\n                    return send_send(win, \"zoid_allow_delegate_\" + name).then((function(_ref3) {\n                        return _ref3.data;\n                    })).catch((function() {\n                        return !1;\n                    }));\n                },\n                registerChild: registerChild\n            };\n        }\n        var component_create = function(options) {\n            !function() {\n                if (!global_getGlobal().initialized) {\n                    global_getGlobal().initialized = !0;\n                    on = (_ref3 = {\n                        on: on_on,\n                        send: send_send\n                    }).on, send = _ref3.send, (global = global_getGlobal()).receiveMessage = global.receiveMessage || function(message) {\n                        return receive_receiveMessage(message, {\n                            on: on,\n                            send: send\n                        });\n                    };\n                    !function(_ref5) {\n                        var on = _ref5.on, send = _ref5.send;\n                        globalStore().getOrSet(\"postMessageListener\", (function() {\n                            return addEventListener(window, \"message\", (function(event) {\n                                !function(event, _ref4) {\n                                    var on = _ref4.on, send = _ref4.send;\n                                    promise_ZalgoPromise.try((function() {\n                                        var source = event.source || event.sourceElement;\n                                        var origin = event.origin || event.originalEvent && event.originalEvent.origin;\n                                        var data = event.data;\n                                        \"null\" === origin && (origin = \"file://\");\n                                        if (source) {\n                                            if (!origin) throw new Error(\"Post message did not have origin domain\");\n                                            receive_receiveMessage({\n                                                source: source,\n                                                origin: origin,\n                                                data: data\n                                            }, {\n                                                on: on,\n                                                send: send\n                                            });\n                                        }\n                                    }));\n                                }(event, {\n                                    on: on,\n                                    send: send\n                                });\n                            }));\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                    !function(_ref8) {\n                        var on = _ref8.on, send = _ref8.send;\n                        globalStore(\"builtinListeners\").getOrSet(\"helloListener\", (function() {\n                            var listener = on(\"postrobot_hello\", {\n                                domain: \"*\"\n                            }, (function(_ref3) {\n                                resolveHelloPromise(_ref3.source, {\n                                    domain: _ref3.origin\n                                });\n                                return {\n                                    instanceID: getInstanceID()\n                                };\n                            }));\n                            var parent = getAncestor();\n                            parent && sayHello(parent, {\n                                send: send\n                            }).catch((function(err) {}));\n                            return listener;\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                }\n                var _ref3, on, send, global;\n            }();\n            var comp = component(options);\n            var init = function(props) {\n                return comp.init(props);\n            };\n            init.driver = function(name, dep) {\n                return comp.driver(name, dep);\n            };\n            init.isChild = function() {\n                return comp.isChild();\n            };\n            init.canRenderTo = function(win) {\n                return comp.canRenderTo(win);\n            };\n            init.instances = comp.instances;\n            var child = comp.registerChild();\n            child && (window.xprops = init.xprops = child.getProps());\n            return init;\n        };\n        function destroyComponents(err) {\n            var destroyPromise = cleanInstances.all(err);\n            cleanInstances = cleanup();\n            return destroyPromise;\n        }\n        var destroyAll = destroyComponents;\n        function component_destroy(err) {\n            destroyAll();\n            delete window.__zoid_9_0_87__;\n            !function() {\n                !function() {\n                    var responseListeners = globalStore(\"responseListeners\");\n                    for (var _i2 = 0, _responseListeners$ke2 = responseListeners.keys(); _i2 < _responseListeners$ke2.length; _i2++) {\n                        var hash = _responseListeners$ke2[_i2];\n                        var listener = responseListeners.get(hash);\n                        listener && (listener.cancelled = !0);\n                        responseListeners.del(hash);\n                    }\n                }();\n                (listener = globalStore().get(\"postMessageListener\")) && listener.cancel();\n                var listener;\n                delete window.__post_robot_10_0_46__;\n            }();\n            return cleanZoid.all(err);\n        }\n    } ]);\n}));"
  },
  {
    "path": "dist/zoid.frameworks.js",
    "content": "!function(root, factory) {\n    \"object\" == typeof exports && \"object\" == typeof module ? module.exports = factory() : \"function\" == typeof define && define.amd ? define(\"zoid\", [], factory) : \"object\" == typeof exports ? exports.zoid = factory() : root.zoid = factory();\n}(\"undefined\" != typeof self ? self : this, (function() {\n    return function(modules) {\n        var installedModules = {};\n        function __webpack_require__(moduleId) {\n            if (installedModules[moduleId]) return installedModules[moduleId].exports;\n            var module = installedModules[moduleId] = {\n                i: moduleId,\n                l: !1,\n                exports: {}\n            };\n            modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n            module.l = !0;\n            return module.exports;\n        }\n        __webpack_require__.m = modules;\n        __webpack_require__.c = installedModules;\n        __webpack_require__.d = function(exports, name, getter) {\n            __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {\n                enumerable: !0,\n                get: getter\n            });\n        };\n        __webpack_require__.r = function(exports) {\n            \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {\n                value: \"Module\"\n            });\n            Object.defineProperty(exports, \"__esModule\", {\n                value: !0\n            });\n        };\n        __webpack_require__.t = function(value, mode) {\n            1 & mode && (value = __webpack_require__(value));\n            if (8 & mode) return value;\n            if (4 & mode && \"object\" == typeof value && value && value.__esModule) return value;\n            var ns = Object.create(null);\n            __webpack_require__.r(ns);\n            Object.defineProperty(ns, \"default\", {\n                enumerable: !0,\n                value: value\n            });\n            if (2 & mode && \"string\" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) {\n                return value[key];\n            }.bind(null, key));\n            return ns;\n        };\n        __webpack_require__.n = function(module) {\n            var getter = module && module.__esModule ? function() {\n                return module.default;\n            } : function() {\n                return module;\n            };\n            __webpack_require__.d(getter, \"a\", getter);\n            return getter;\n        };\n        __webpack_require__.o = function(object, property) {\n            return {}.hasOwnProperty.call(object, property);\n        };\n        __webpack_require__.p = \"\";\n        return __webpack_require__(__webpack_require__.s = 0);\n    }([ function(module, __webpack_exports__, __webpack_require__) {\n        \"use strict\";\n        __webpack_require__.r(__webpack_exports__);\n        __webpack_require__.d(__webpack_exports__, \"PopupOpenError\", (function() {\n            return dom_PopupOpenError;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"create\", (function() {\n            return component_create;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroy\", (function() {\n            return component_destroy;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyComponents\", (function() {\n            return destroyComponents;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyAll\", (function() {\n            return destroyAll;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_TYPE\", (function() {\n            return PROP_TYPE;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_SERIALIZATION\", (function() {\n            return PROP_SERIALIZATION;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"CONTEXT\", (function() {\n            return CONTEXT;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"EVENT\", (function() {\n            return EVENT;\n        }));\n        function _setPrototypeOf(o, p) {\n            return (_setPrototypeOf = Object.setPrototypeOf || function(o, p) {\n                o.__proto__ = p;\n                return o;\n            })(o, p);\n        }\n        function _inheritsLoose(subClass, superClass) {\n            subClass.prototype = Object.create(superClass.prototype);\n            subClass.prototype.constructor = subClass;\n            _setPrototypeOf(subClass, superClass);\n        }\n        function _extends() {\n            return (_extends = Object.assign || function(target) {\n                for (var i = 1; i < arguments.length; i++) {\n                    var source = arguments[i];\n                    for (var key in source) ({}).hasOwnProperty.call(source, key) && (target[key] = source[key]);\n                }\n                return target;\n            }).apply(this, arguments);\n        }\n        function utils_isPromise(item) {\n            try {\n                if (!item) return !1;\n                if (\"undefined\" != typeof Promise && item instanceof Promise) return !0;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.Window && item instanceof window.Window) return !1;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.constructor && item instanceof window.constructor) return !1;\n                var _toString = {}.toString;\n                if (_toString) {\n                    var name = _toString.call(item);\n                    if (\"[object Window]\" === name || \"[object global]\" === name || \"[object DOMWindow]\" === name) return !1;\n                }\n                if (\"function\" == typeof item.then) return !0;\n            } catch (err) {\n                return !1;\n            }\n            return !1;\n        }\n        var dispatchedErrors = [];\n        var possiblyUnhandledPromiseHandlers = [];\n        var activeCount = 0;\n        var flushPromise;\n        function flushActive() {\n            if (!activeCount && flushPromise) {\n                var promise = flushPromise;\n                flushPromise = null;\n                promise.resolve();\n            }\n        }\n        function startActive() {\n            activeCount += 1;\n        }\n        function endActive() {\n            activeCount -= 1;\n            flushActive();\n        }\n        var promise_ZalgoPromise = function() {\n            function ZalgoPromise(handler) {\n                var _this = this;\n                this.resolved = void 0;\n                this.rejected = void 0;\n                this.errorHandled = void 0;\n                this.value = void 0;\n                this.error = void 0;\n                this.handlers = void 0;\n                this.dispatching = void 0;\n                this.stack = void 0;\n                this.resolved = !1;\n                this.rejected = !1;\n                this.errorHandled = !1;\n                this.handlers = [];\n                if (handler) {\n                    var _result;\n                    var _error;\n                    var resolved = !1;\n                    var rejected = !1;\n                    var isAsync = !1;\n                    startActive();\n                    try {\n                        handler((function(res) {\n                            if (isAsync) _this.resolve(res); else {\n                                resolved = !0;\n                                _result = res;\n                            }\n                        }), (function(err) {\n                            if (isAsync) _this.reject(err); else {\n                                rejected = !0;\n                                _error = err;\n                            }\n                        }));\n                    } catch (err) {\n                        endActive();\n                        this.reject(err);\n                        return;\n                    }\n                    endActive();\n                    isAsync = !0;\n                    resolved ? this.resolve(_result) : rejected && this.reject(_error);\n                }\n            }\n            var _proto = ZalgoPromise.prototype;\n            _proto.resolve = function(result) {\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(result)) throw new Error(\"Can not resolve promise with another promise\");\n                this.resolved = !0;\n                this.value = result;\n                this.dispatch();\n                return this;\n            };\n            _proto.reject = function(error) {\n                var _this2 = this;\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(error)) throw new Error(\"Can not reject promise with another promise\");\n                if (!error) {\n                    var _err = error && \"function\" == typeof error.toString ? error.toString() : {}.toString.call(error);\n                    error = new Error(\"Expected reject to be called with Error, got \" + _err);\n                }\n                this.rejected = !0;\n                this.error = error;\n                this.errorHandled || setTimeout((function() {\n                    _this2.errorHandled || function(err, promise) {\n                        if (-1 === dispatchedErrors.indexOf(err)) {\n                            dispatchedErrors.push(err);\n                            setTimeout((function() {\n                                throw err;\n                            }), 1);\n                            for (var j = 0; j < possiblyUnhandledPromiseHandlers.length; j++) possiblyUnhandledPromiseHandlers[j](err, promise);\n                        }\n                    }(error, _this2);\n                }), 1);\n                this.dispatch();\n                return this;\n            };\n            _proto.asyncReject = function(error) {\n                this.errorHandled = !0;\n                this.reject(error);\n                return this;\n            };\n            _proto.dispatch = function() {\n                var resolved = this.resolved, rejected = this.rejected, handlers = this.handlers;\n                if (!this.dispatching && (resolved || rejected)) {\n                    this.dispatching = !0;\n                    startActive();\n                    var chain = function(firstPromise, secondPromise) {\n                        return firstPromise.then((function(res) {\n                            secondPromise.resolve(res);\n                        }), (function(err) {\n                            secondPromise.reject(err);\n                        }));\n                    };\n                    for (var i = 0; i < handlers.length; i++) {\n                        var _handlers$i = handlers[i], onSuccess = _handlers$i.onSuccess, onError = _handlers$i.onError, promise = _handlers$i.promise;\n                        var _result2 = void 0;\n                        if (resolved) try {\n                            _result2 = onSuccess ? onSuccess(this.value) : this.value;\n                        } catch (err) {\n                            promise.reject(err);\n                            continue;\n                        } else if (rejected) {\n                            if (!onError) {\n                                promise.reject(this.error);\n                                continue;\n                            }\n                            try {\n                                _result2 = onError(this.error);\n                            } catch (err) {\n                                promise.reject(err);\n                                continue;\n                            }\n                        }\n                        if (_result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected)) {\n                            var promiseResult = _result2;\n                            promiseResult.resolved ? promise.resolve(promiseResult.value) : promise.reject(promiseResult.error);\n                            promiseResult.errorHandled = !0;\n                        } else utils_isPromise(_result2) ? _result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected) ? _result2.resolved ? promise.resolve(_result2.value) : promise.reject(_result2.error) : chain(_result2, promise) : promise.resolve(_result2);\n                    }\n                    handlers.length = 0;\n                    this.dispatching = !1;\n                    endActive();\n                }\n            };\n            _proto.then = function(onSuccess, onError) {\n                if (onSuccess && \"function\" != typeof onSuccess && !onSuccess.call) throw new Error(\"Promise.then expected a function for success handler\");\n                if (onError && \"function\" != typeof onError && !onError.call) throw new Error(\"Promise.then expected a function for error handler\");\n                var promise = new ZalgoPromise;\n                this.handlers.push({\n                    promise: promise,\n                    onSuccess: onSuccess,\n                    onError: onError\n                });\n                this.errorHandled = !0;\n                this.dispatch();\n                return promise;\n            };\n            _proto.catch = function(onError) {\n                return this.then(void 0, onError);\n            };\n            _proto.finally = function(onFinally) {\n                if (onFinally && \"function\" != typeof onFinally && !onFinally.call) throw new Error(\"Promise.finally expected a function\");\n                return this.then((function(result) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        return result;\n                    }));\n                }), (function(err) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        throw err;\n                    }));\n                }));\n            };\n            _proto.timeout = function(time, err) {\n                var _this3 = this;\n                if (this.resolved || this.rejected) return this;\n                var timeout = setTimeout((function() {\n                    _this3.resolved || _this3.rejected || _this3.reject(err || new Error(\"Promise timed out after \" + time + \"ms\"));\n                }), time);\n                return this.then((function(result) {\n                    clearTimeout(timeout);\n                    return result;\n                }));\n            };\n            _proto.toPromise = function() {\n                if (\"undefined\" == typeof Promise) throw new TypeError(\"Could not find Promise\");\n                return Promise.resolve(this);\n            };\n            _proto.lazy = function() {\n                this.errorHandled = !0;\n                return this;\n            };\n            ZalgoPromise.resolve = function(value) {\n                return value instanceof ZalgoPromise ? value : utils_isPromise(value) ? new ZalgoPromise((function(resolve, reject) {\n                    return value.then(resolve, reject);\n                })) : (new ZalgoPromise).resolve(value);\n            };\n            ZalgoPromise.reject = function(error) {\n                return (new ZalgoPromise).reject(error);\n            };\n            ZalgoPromise.asyncReject = function(error) {\n                return (new ZalgoPromise).asyncReject(error);\n            };\n            ZalgoPromise.all = function(promises) {\n                var promise = new ZalgoPromise;\n                var count = promises.length;\n                var results = [].slice();\n                if (!count) {\n                    promise.resolve(results);\n                    return promise;\n                }\n                var chain = function(i, firstPromise, secondPromise) {\n                    return firstPromise.then((function(res) {\n                        results[i] = res;\n                        0 == (count -= 1) && promise.resolve(results);\n                    }), (function(err) {\n                        secondPromise.reject(err);\n                    }));\n                };\n                for (var i = 0; i < promises.length; i++) {\n                    var prom = promises[i];\n                    if (prom instanceof ZalgoPromise) {\n                        if (prom.resolved) {\n                            results[i] = prom.value;\n                            count -= 1;\n                            continue;\n                        }\n                    } else if (!utils_isPromise(prom)) {\n                        results[i] = prom;\n                        count -= 1;\n                        continue;\n                    }\n                    chain(i, ZalgoPromise.resolve(prom), promise);\n                }\n                0 === count && promise.resolve(results);\n                return promise;\n            };\n            ZalgoPromise.hash = function(promises) {\n                var result = {};\n                var awaitPromises = [];\n                var _loop = function(key) {\n                    if (promises.hasOwnProperty(key)) {\n                        var value = promises[key];\n                        utils_isPromise(value) ? awaitPromises.push(value.then((function(res) {\n                            result[key] = res;\n                        }))) : result[key] = value;\n                    }\n                };\n                for (var key in promises) _loop(key);\n                return ZalgoPromise.all(awaitPromises).then((function() {\n                    return result;\n                }));\n            };\n            ZalgoPromise.map = function(items, method) {\n                return ZalgoPromise.all(items.map(method));\n            };\n            ZalgoPromise.onPossiblyUnhandledException = function(handler) {\n                return function(handler) {\n                    possiblyUnhandledPromiseHandlers.push(handler);\n                    return {\n                        cancel: function() {\n                            possiblyUnhandledPromiseHandlers.splice(possiblyUnhandledPromiseHandlers.indexOf(handler), 1);\n                        }\n                    };\n                }(handler);\n            };\n            ZalgoPromise.try = function(method, context, args) {\n                if (method && \"function\" != typeof method && !method.call) throw new Error(\"Promise.try expected a function\");\n                var result;\n                startActive();\n                try {\n                    result = method.apply(context, args || []);\n                } catch (err) {\n                    endActive();\n                    return ZalgoPromise.reject(err);\n                }\n                endActive();\n                return ZalgoPromise.resolve(result);\n            };\n            ZalgoPromise.delay = function(_delay) {\n                return new ZalgoPromise((function(resolve) {\n                    setTimeout(resolve, _delay);\n                }));\n            };\n            ZalgoPromise.isPromise = function(value) {\n                return !!(value && value instanceof ZalgoPromise) || utils_isPromise(value);\n            };\n            ZalgoPromise.flush = function() {\n                return function(Zalgo) {\n                    var promise = flushPromise = flushPromise || new Zalgo;\n                    flushActive();\n                    return promise;\n                }(ZalgoPromise);\n            };\n            return ZalgoPromise;\n        }();\n        function isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        var IE_WIN_ACCESS_ERROR = \"Call was rejected by callee.\\r\\n\";\n        function getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return getActualProtocol(win);\n        }\n        function isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === getProtocol(win);\n        }\n        function utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = utils_getParent(win);\n                return parent && canReadFromWindow() ? getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === getProtocol(win);\n                    }(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (getActualDomain(win) === getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                if (getDomain(window) === getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function assertSameDomain(win) {\n            if (!isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (utils_getParent(win) === win) return win;\n            try {\n                if (isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function getAllFramesInWindow(win) {\n            var top = getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], getAllChildFrames(win)));\n            return result;\n        }\n        var iframeWindows = [];\n        var iframeFrames = [];\n        function isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || err.message !== IE_WIN_ACCESS_ERROR;\n            }\n            if (allowMock && isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function utils_getUserAgent(win) {\n            return (win = win || window).navigator.mockUserAgent || win.navigator.userAgent;\n        }\n        function getFrameByName(win, name) {\n            var winFrames = getFrames(win);\n            for (var _i9 = 0; _i9 < winFrames.length; _i9++) {\n                var childFrame = winFrames[_i9];\n                try {\n                    if (isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame;\n                } catch (err) {}\n            }\n            try {\n                if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name];\n            } catch (err) {}\n            try {\n                if (-1 !== winFrames.indexOf(win[name])) return win[name];\n            } catch (err) {}\n        }\n        function isOpener(parent, child) {\n            return parent === getOpener(child);\n        }\n        function getAncestor(win) {\n            void 0 === win && (win = window);\n            return getOpener(win = win || window) || utils_getParent(win) || void 0;\n        }\n        function anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function isSameTopWindow(win1, win2) {\n            var top1 = getTop(win1) || win1;\n            var top2 = getTop(win2) || win2;\n            try {\n                if (top1 && top2) return top1 === top2;\n            } catch (err) {}\n            var allFrames1 = getAllFramesInWindow(win1);\n            var allFrames2 = getAllFramesInWindow(win2);\n            if (anyMatch(allFrames1, allFrames2)) return !0;\n            var opener1 = getOpener(top1);\n            var opener2 = getOpener(top2);\n            return opener1 && anyMatch(getAllFramesInWindow(opener1), allFrames2) || opener2 && anyMatch(getAllFramesInWindow(opener2), allFrames1), \n            !1;\n        }\n        function matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return isRegex(pattern) ? isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !isRegex(origin) && pattern.some((function(subpattern) {\n                return matchDomain(subpattern, origin);\n            })));\n        }\n        function getDomainFromUrl(url) {\n            return url.match(/^(https?|mock|file):\\/\\//) ? url.split(\"/\").slice(0, 3).join(\"/\") : getDomain();\n        }\n        function isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getFrameForWindow(win) {\n            if (isSameDomain(win)) return assertSameDomain(win).frameElement;\n            for (var _i21 = 0, _document$querySelect2 = document.querySelectorAll(\"iframe\"); _i21 < _document$querySelect2.length; _i21++) {\n                var frame = _document$querySelect2[_i21];\n                if (frame && frame.contentWindow && frame.contentWindow === win) return frame;\n            }\n        }\n        function closeWindow(win) {\n            if (function(win) {\n                void 0 === win && (win = window);\n                return Boolean(utils_getParent(win));\n            }(win)) {\n                var frame = getFrameForWindow(win);\n                if (frame && frame.parentElement) {\n                    frame.parentElement.removeChild(frame);\n                    return;\n                }\n            }\n            try {\n                win.close();\n            } catch (err) {}\n        }\n        function util_safeIndexOf(collection, item) {\n            for (var i = 0; i < collection.length; i++) try {\n                if (collection[i] === item) return i;\n            } catch (err) {}\n            return -1;\n        }\n        var weakmap_CrossDomainSafeWeakMap = function() {\n            function CrossDomainSafeWeakMap() {\n                this.name = void 0;\n                this.weakmap = void 0;\n                this.keys = void 0;\n                this.values = void 0;\n                this.name = \"__weakmap_\" + (1e9 * Math.random() >>> 0) + \"__\";\n                if (function() {\n                    if (\"undefined\" == typeof WeakMap) return !1;\n                    if (void 0 === Object.freeze) return !1;\n                    try {\n                        var testWeakMap = new WeakMap;\n                        var testKey = {};\n                        Object.freeze(testKey);\n                        testWeakMap.set(testKey, \"__testvalue__\");\n                        return \"__testvalue__\" === testWeakMap.get(testKey);\n                    } catch (err) {\n                        return !1;\n                    }\n                }()) try {\n                    this.weakmap = new WeakMap;\n                } catch (err) {}\n                this.keys = [];\n                this.values = [];\n            }\n            var _proto = CrossDomainSafeWeakMap.prototype;\n            _proto._cleanupClosedWindows = function() {\n                var weakmap = this.weakmap;\n                var keys = this.keys;\n                for (var i = 0; i < keys.length; i++) {\n                    var value = keys[i];\n                    if (isWindow(value) && isWindowClosed(value)) {\n                        if (weakmap) try {\n                            weakmap.delete(value);\n                        } catch (err) {}\n                        keys.splice(i, 1);\n                        this.values.splice(i, 1);\n                        i -= 1;\n                    }\n                }\n            };\n            _proto.isSafeToReadWrite = function(key) {\n                return !isWindow(key);\n            };\n            _proto.set = function(key, value) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.set(key, value);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var name = this.name;\n                    var entry = key[name];\n                    entry && entry[0] === key ? entry[1] = value : Object.defineProperty(key, name, {\n                        value: [ key, value ],\n                        writable: !0\n                    });\n                    return;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var values = this.values;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 === index) {\n                    keys.push(key);\n                    values.push(value);\n                } else values[index] = value;\n            };\n            _proto.get = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return weakmap.get(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return entry && entry[0] === key ? entry[1] : void 0;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var index = util_safeIndexOf(this.keys, key);\n                if (-1 !== index) return this.values[index];\n            };\n            _proto.delete = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.delete(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    entry && entry[0] === key && (entry[0] = entry[1] = void 0);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 !== index) {\n                    keys.splice(index, 1);\n                    this.values.splice(index, 1);\n                }\n            };\n            _proto.has = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return !0;\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return !(!entry || entry[0] !== key);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                return -1 !== util_safeIndexOf(this.keys, key);\n            };\n            _proto.getOrSet = function(key, getter) {\n                if (this.has(key)) return this.get(key);\n                var value = getter();\n                this.set(key, value);\n                return value;\n            };\n            return CrossDomainSafeWeakMap;\n        }();\n        function _getPrototypeOf(o) {\n            return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {\n                return o.__proto__ || Object.getPrototypeOf(o);\n            })(o);\n        }\n        function _isNativeReflectConstruct() {\n            if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n            if (Reflect.construct.sham) return !1;\n            if (\"function\" == typeof Proxy) return !0;\n            try {\n                Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));\n                return !0;\n            } catch (e) {\n                return !1;\n            }\n        }\n        function construct_construct(Parent, args, Class) {\n            return (construct_construct = _isNativeReflectConstruct() ? Reflect.construct : function(Parent, args, Class) {\n                var a = [ null ];\n                a.push.apply(a, args);\n                var instance = new (Function.bind.apply(Parent, a));\n                Class && _setPrototypeOf(instance, Class.prototype);\n                return instance;\n            }).apply(null, arguments);\n        }\n        function wrapNativeSuper_wrapNativeSuper(Class) {\n            var _cache = \"function\" == typeof Map ? new Map : void 0;\n            return (wrapNativeSuper_wrapNativeSuper = function(Class) {\n                if (null === Class || !(fn = Class, -1 !== Function.toString.call(fn).indexOf(\"[native code]\"))) return Class;\n                var fn;\n                if (\"function\" != typeof Class) throw new TypeError(\"Super expression must either be null or a function\");\n                if (void 0 !== _cache) {\n                    if (_cache.has(Class)) return _cache.get(Class);\n                    _cache.set(Class, Wrapper);\n                }\n                function Wrapper() {\n                    return construct_construct(Class, arguments, _getPrototypeOf(this).constructor);\n                }\n                Wrapper.prototype = Object.create(Class.prototype, {\n                    constructor: {\n                        value: Wrapper,\n                        enumerable: !1,\n                        writable: !0,\n                        configurable: !0\n                    }\n                });\n                return _setPrototypeOf(Wrapper, Class);\n            })(Class);\n        }\n        function isElement(element) {\n            var passed = !1;\n            try {\n                (element instanceof window.Element || null !== element && \"object\" == typeof element && 1 === element.nodeType && \"object\" == typeof element.style && \"object\" == typeof element.ownerDocument) && (passed = !0);\n            } catch (_) {}\n            return passed;\n        }\n        function getFunctionName(fn) {\n            return fn.name || fn.__name__ || fn.displayName || \"anonymous\";\n        }\n        function setFunctionName(fn, name) {\n            try {\n                delete fn.name;\n                fn.name = name;\n            } catch (err) {}\n            fn.__name__ = fn.displayName = name;\n            return fn;\n        }\n        function base64encode(str) {\n            if (\"function\" == typeof btoa) return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (function(m, p1) {\n                return String.fromCharCode(parseInt(p1, 16));\n            }))).replace(/[=]/g, \"\");\n            if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"utf8\").toString(\"base64\").replace(/[=]/g, \"\");\n            throw new Error(\"Can not find window.btoa or Buffer\");\n        }\n        function uniqueID() {\n            var chars = \"0123456789abcdef\";\n            return \"uid_\" + \"xxxxxxxxxx\".replace(/./g, (function() {\n                return chars.charAt(Math.floor(Math.random() * chars.length));\n            })) + \"_\" + base64encode((new Date).toISOString().slice(11, 19).replace(\"T\", \".\")).replace(/[^a-zA-Z0-9]/g, \"\").toLowerCase();\n        }\n        var objectIDs;\n        function serializeArgs(args) {\n            try {\n                return JSON.stringify([].slice.call(args), (function(subkey, val) {\n                    return \"function\" == typeof val ? \"memoize[\" + function(obj) {\n                        objectIDs = objectIDs || new weakmap_CrossDomainSafeWeakMap;\n                        if (null == obj || \"object\" != typeof obj && \"function\" != typeof obj) throw new Error(\"Invalid object\");\n                        var uid = objectIDs.get(obj);\n                        if (!uid) {\n                            uid = typeof obj + \":\" + uniqueID();\n                            objectIDs.set(obj, uid);\n                        }\n                        return uid;\n                    }(val) + \"]\" : isElement(val) ? {} : val;\n                }));\n            } catch (err) {\n                throw new Error(\"Arguments not serializable -- can not be used to memoize\");\n            }\n        }\n        function getEmptyObject() {\n            return {};\n        }\n        var memoizeGlobalIndex = 0;\n        var memoizeGlobalIndexValidFrom = 0;\n        function memoize(method, options) {\n            void 0 === options && (options = {});\n            var _options$thisNamespac = options.thisNamespace, thisNamespace = void 0 !== _options$thisNamespac && _options$thisNamespac, cacheTime = options.time;\n            var simpleCache;\n            var thisCache;\n            var memoizeIndex = memoizeGlobalIndex;\n            memoizeGlobalIndex += 1;\n            var memoizedFunction = function() {\n                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                if (memoizeIndex < memoizeGlobalIndexValidFrom) {\n                    simpleCache = null;\n                    thisCache = null;\n                    memoizeIndex = memoizeGlobalIndex;\n                    memoizeGlobalIndex += 1;\n                }\n                var cache;\n                cache = thisNamespace ? (thisCache = thisCache || new weakmap_CrossDomainSafeWeakMap).getOrSet(this, getEmptyObject) : simpleCache = simpleCache || {};\n                var cacheKey;\n                try {\n                    cacheKey = serializeArgs(args);\n                } catch (_unused) {\n                    return method.apply(this, arguments);\n                }\n                var cacheResult = cache[cacheKey];\n                if (cacheResult && cacheTime && Date.now() - cacheResult.time < cacheTime) {\n                    delete cache[cacheKey];\n                    cacheResult = null;\n                }\n                if (cacheResult) return cacheResult.value;\n                var time = Date.now();\n                var value = method.apply(this, arguments);\n                cache[cacheKey] = {\n                    time: time,\n                    value: value\n                };\n                return value;\n            };\n            memoizedFunction.reset = function() {\n                simpleCache = null;\n                thisCache = null;\n            };\n            return setFunctionName(memoizedFunction, (options.name || getFunctionName(method)) + \"::memoized\");\n        }\n        memoize.clear = function() {\n            memoizeGlobalIndexValidFrom = memoizeGlobalIndex;\n        };\n        function memoizePromise(method) {\n            var cache = {};\n            function memoizedPromiseFunction() {\n                var _arguments = arguments, _this = this;\n                for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                var key = serializeArgs(args);\n                if (cache.hasOwnProperty(key)) return cache[key];\n                cache[key] = promise_ZalgoPromise.try((function() {\n                    return method.apply(_this, _arguments);\n                })).finally((function() {\n                    delete cache[key];\n                }));\n                return cache[key];\n            }\n            memoizedPromiseFunction.reset = function() {\n                cache = {};\n            };\n            return setFunctionName(memoizedPromiseFunction, getFunctionName(method) + \"::promiseMemoized\");\n        }\n        function src_util_noop() {}\n        function once(method) {\n            var called = !1;\n            return setFunctionName((function() {\n                if (!called) {\n                    called = !0;\n                    return method.apply(this, arguments);\n                }\n            }), getFunctionName(method) + \"::once\");\n        }\n        function stringifyError(err, level) {\n            void 0 === level && (level = 1);\n            if (level >= 3) return \"stringifyError stack overflow\";\n            try {\n                if (!err) return \"<unknown error: \" + {}.toString.call(err) + \">\";\n                if (\"string\" == typeof err) return err;\n                if (err instanceof Error) {\n                    var stack = err && err.stack;\n                    var message = err && err.message;\n                    if (stack && message) return -1 !== stack.indexOf(message) ? stack : message + \"\\n\" + stack;\n                    if (stack) return stack;\n                    if (message) return message;\n                }\n                return err && err.toString && \"function\" == typeof err.toString ? err.toString() : {}.toString.call(err);\n            } catch (newErr) {\n                return \"Error while stringifying error: \" + stringifyError(newErr, level + 1);\n            }\n        }\n        function stringify(item) {\n            return \"string\" == typeof item ? item : item && item.toString && \"function\" == typeof item.toString ? item.toString() : {}.toString.call(item);\n        }\n        function extend(obj, source) {\n            if (!source) return obj;\n            if (Object.assign) return Object.assign(obj, source);\n            for (var key in source) source.hasOwnProperty(key) && (obj[key] = source[key]);\n            return obj;\n        }\n        memoize((function(obj) {\n            if (Object.values) return Object.values(obj);\n            var result = [];\n            for (var key in obj) obj.hasOwnProperty(key) && result.push(obj[key]);\n            return result;\n        }));\n        function identity(item) {\n            return item;\n        }\n        function safeInterval(method, time) {\n            var timeout;\n            !function loop() {\n                timeout = setTimeout((function() {\n                    method();\n                    loop();\n                }), time);\n            }();\n            return {\n                cancel: function() {\n                    clearTimeout(timeout);\n                }\n            };\n        }\n        function dasherizeToCamel(string) {\n            return string.replace(/-([a-z])/g, (function(g) {\n                return g[1].toUpperCase();\n            }));\n        }\n        function defineLazyProp(obj, key, getter) {\n            if (Array.isArray(obj)) {\n                if (\"number\" != typeof key) throw new TypeError(\"Array key must be number\");\n            } else if (\"object\" == typeof obj && null !== obj && \"string\" != typeof key) throw new TypeError(\"Object key must be string\");\n            Object.defineProperty(obj, key, {\n                configurable: !0,\n                enumerable: !0,\n                get: function() {\n                    delete obj[key];\n                    var value = getter();\n                    obj[key] = value;\n                    return value;\n                },\n                set: function(value) {\n                    delete obj[key];\n                    obj[key] = value;\n                }\n            });\n        }\n        function arrayFrom(item) {\n            return [].slice.call(item);\n        }\n        function isObjectObject(obj) {\n            return \"object\" == typeof (item = obj) && null !== item && \"[object Object]\" === {}.toString.call(obj);\n            var item;\n        }\n        function isPlainObject(obj) {\n            if (!isObjectObject(obj)) return !1;\n            var constructor = obj.constructor;\n            if (\"function\" != typeof constructor) return !1;\n            var prototype = constructor.prototype;\n            return !!isObjectObject(prototype) && !!prototype.hasOwnProperty(\"isPrototypeOf\");\n        }\n        function replaceObject(item, replacer, fullKey) {\n            void 0 === fullKey && (fullKey = \"\");\n            if (Array.isArray(item)) {\n                var length = item.length;\n                var result = [];\n                var _loop2 = function(i) {\n                    defineLazyProp(result, i, (function() {\n                        var itemKey = fullKey ? fullKey + \".\" + i : \"\" + i;\n                        var child = replacer(item[i], i, itemKey);\n                        (isPlainObject(child) || Array.isArray(child)) && (child = replaceObject(child, replacer, itemKey));\n                        return child;\n                    }));\n                };\n                for (var i = 0; i < length; i++) _loop2(i);\n                return result;\n            }\n            if (isPlainObject(item)) {\n                var _result = {};\n                var _loop3 = function(key) {\n                    if (!item.hasOwnProperty(key)) return \"continue\";\n                    defineLazyProp(_result, key, (function() {\n                        var itemKey = fullKey ? fullKey + \".\" + key : \"\" + key;\n                        var child = replacer(item[key], key, itemKey);\n                        (isPlainObject(child) || Array.isArray(child)) && (child = replaceObject(child, replacer, itemKey));\n                        return child;\n                    }));\n                };\n                for (var key in item) _loop3(key);\n                return _result;\n            }\n            throw new Error(\"Pass an object or array\");\n        }\n        function isDefined(value) {\n            return null != value;\n        }\n        function util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function util_getOrSet(obj, key, getter) {\n            if (obj.hasOwnProperty(key)) return obj[key];\n            var val = getter();\n            obj[key] = val;\n            return val;\n        }\n        function cleanup(obj) {\n            var tasks = [];\n            var cleaned = !1;\n            var cleanErr;\n            var cleaner = {\n                set: function(name, item) {\n                    if (!cleaned) {\n                        obj[name] = item;\n                        cleaner.register((function() {\n                            delete obj[name];\n                        }));\n                    }\n                    return item;\n                },\n                register: function(method) {\n                    var task = once((function() {\n                        return method(cleanErr);\n                    }));\n                    cleaned ? method(cleanErr) : tasks.push(task);\n                    return {\n                        cancel: function() {\n                            var index = tasks.indexOf(task);\n                            -1 !== index && tasks.splice(index, 1);\n                        }\n                    };\n                },\n                all: function(err) {\n                    cleanErr = err;\n                    var results = [];\n                    cleaned = !0;\n                    for (;tasks.length; ) {\n                        var task = tasks.shift();\n                        results.push(task());\n                    }\n                    return promise_ZalgoPromise.all(results).then(src_util_noop);\n                }\n            };\n            return cleaner;\n        }\n        function assertExists(name, thing) {\n            if (null == thing) throw new Error(\"Expected \" + name + \" to be present\");\n            return thing;\n        }\n        var util_ExtendableError = function(_Error) {\n            _inheritsLoose(ExtendableError, _Error);\n            function ExtendableError(message) {\n                var _this6;\n                (_this6 = _Error.call(this, message) || this).name = _this6.constructor.name;\n                \"function\" == typeof Error.captureStackTrace ? Error.captureStackTrace(function(self) {\n                    if (void 0 === self) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n                    return self;\n                }(_this6), _this6.constructor) : _this6.stack = new Error(message).stack;\n                return _this6;\n            }\n            return ExtendableError;\n        }(wrapNativeSuper_wrapNativeSuper(Error));\n        function getBody() {\n            var body = document.body;\n            if (!body) throw new Error(\"Body element not found\");\n            return body;\n        }\n        function isDocumentReady() {\n            return Boolean(document.body) && \"complete\" === document.readyState;\n        }\n        function isDocumentInteractive() {\n            return Boolean(document.body) && \"interactive\" === document.readyState;\n        }\n        function urlEncode(str) {\n            return encodeURIComponent(str);\n        }\n        memoize((function() {\n            return new promise_ZalgoPromise((function(resolve) {\n                if (isDocumentReady() || isDocumentInteractive()) return resolve();\n                var interval = setInterval((function() {\n                    if (isDocumentReady() || isDocumentInteractive()) {\n                        clearInterval(interval);\n                        return resolve();\n                    }\n                }), 10);\n            }));\n        }));\n        function parseQuery(queryString) {\n            return function(method, logic, args) {\n                void 0 === args && (args = []);\n                var cache = method.__inline_memoize_cache__ = method.__inline_memoize_cache__ || {};\n                var key = serializeArgs(args);\n                return cache.hasOwnProperty(key) ? cache[key] : cache[key] = function() {\n                    var params = {};\n                    if (!queryString) return params;\n                    if (-1 === queryString.indexOf(\"=\")) return params;\n                    for (var _i2 = 0, _queryString$split2 = queryString.split(\"&\"); _i2 < _queryString$split2.length; _i2++) {\n                        var pair = _queryString$split2[_i2];\n                        (pair = pair.split(\"=\"))[0] && pair[1] && (params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]));\n                    }\n                    return params;\n                }.apply(void 0, args);\n            }(parseQuery, 0, [ queryString ]);\n        }\n        function extendQuery(originalQuery, props) {\n            void 0 === props && (props = {});\n            return props && Object.keys(props).length ? function(obj) {\n                void 0 === obj && (obj = {});\n                return Object.keys(obj).filter((function(key) {\n                    return \"string\" == typeof obj[key] || \"boolean\" == typeof obj[key];\n                })).map((function(key) {\n                    var val = obj[key];\n                    if (\"string\" != typeof val && \"boolean\" != typeof val) throw new TypeError(\"Invalid type for query\");\n                    return urlEncode(key) + \"=\" + urlEncode(val.toString());\n                })).join(\"&\");\n            }(_extends({}, parseQuery(originalQuery), props)) : originalQuery;\n        }\n        function appendChild(container, child) {\n            container.appendChild(child);\n        }\n        function getElementSafe(id, doc) {\n            void 0 === doc && (doc = document);\n            return isElement(id) ? id : \"string\" == typeof id ? doc.querySelector(id) : void 0;\n        }\n        function elementReady(id) {\n            return new promise_ZalgoPromise((function(resolve, reject) {\n                var name = stringify(id);\n                var el = getElementSafe(id);\n                if (el) return resolve(el);\n                if (isDocumentReady()) return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                var interval = setInterval((function() {\n                    if (el = getElementSafe(id)) {\n                        resolve(el);\n                        clearInterval(interval);\n                    } else if (isDocumentReady()) {\n                        clearInterval(interval);\n                        return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                    }\n                }), 10);\n            }));\n        }\n        var dom_PopupOpenError = function(_ExtendableError) {\n            _inheritsLoose(PopupOpenError, _ExtendableError);\n            function PopupOpenError() {\n                return _ExtendableError.apply(this, arguments) || this;\n            }\n            return PopupOpenError;\n        }(util_ExtendableError);\n        var awaitFrameLoadPromises;\n        function awaitFrameLoad(frame) {\n            if ((awaitFrameLoadPromises = awaitFrameLoadPromises || new weakmap_CrossDomainSafeWeakMap).has(frame)) {\n                var _promise = awaitFrameLoadPromises.get(frame);\n                if (_promise) return _promise;\n            }\n            var promise = new promise_ZalgoPromise((function(resolve, reject) {\n                frame.addEventListener(\"load\", (function() {\n                    !function(frame) {\n                        !function() {\n                            for (var i = 0; i < iframeWindows.length; i++) {\n                                var closed = !1;\n                                try {\n                                    closed = iframeWindows[i].closed;\n                                } catch (err) {}\n                                if (closed) {\n                                    iframeFrames.splice(i, 1);\n                                    iframeWindows.splice(i, 1);\n                                }\n                            }\n                        }();\n                        if (frame && frame.contentWindow) try {\n                            iframeWindows.push(frame.contentWindow);\n                            iframeFrames.push(frame);\n                        } catch (err) {}\n                    }(frame);\n                    resolve(frame);\n                }));\n                frame.addEventListener(\"error\", (function(err) {\n                    frame.contentWindow ? resolve(frame) : reject(err);\n                }));\n            }));\n            awaitFrameLoadPromises.set(frame, promise);\n            return promise;\n        }\n        function awaitFrameWindow(frame) {\n            return awaitFrameLoad(frame).then((function(loadedFrame) {\n                if (!loadedFrame.contentWindow) throw new Error(\"Could not find window in iframe\");\n                return loadedFrame.contentWindow;\n            }));\n        }\n        function dom_iframe(options, container) {\n            void 0 === options && (options = {});\n            var style = options.style || {};\n            var frame = function(tag, options, container) {\n                void 0 === tag && (tag = \"div\");\n                void 0 === options && (options = {});\n                tag = tag.toLowerCase();\n                var element = document.createElement(tag);\n                options.style && extend(element.style, options.style);\n                options.class && (element.className = options.class.join(\" \"));\n                options.id && element.setAttribute(\"id\", options.id);\n                if (options.attributes) for (var _i10 = 0, _Object$keys2 = Object.keys(options.attributes); _i10 < _Object$keys2.length; _i10++) {\n                    var key = _Object$keys2[_i10];\n                    element.setAttribute(key, options.attributes[key]);\n                }\n                options.styleSheet && function(el, styleText, doc) {\n                    void 0 === doc && (doc = window.document);\n                    el.styleSheet ? el.styleSheet.cssText = styleText : el.appendChild(doc.createTextNode(styleText));\n                }(element, options.styleSheet);\n                if (options.html) {\n                    if (\"iframe\" === tag) throw new Error(\"Iframe html can not be written unless container provided and iframe in DOM\");\n                    element.innerHTML = options.html;\n                }\n                return element;\n            }(\"iframe\", {\n                attributes: _extends({\n                    allowTransparency: \"true\"\n                }, options.attributes || {}),\n                style: _extends({\n                    backgroundColor: \"transparent\",\n                    border: \"none\"\n                }, style),\n                html: options.html,\n                class: options.class\n            });\n            var isIE = window.navigator.userAgent.match(/MSIE|Edge/i);\n            frame.hasAttribute(\"id\") || frame.setAttribute(\"id\", uniqueID());\n            awaitFrameLoad(frame);\n            container && function(id, doc) {\n                void 0 === doc && (doc = document);\n                var element = getElementSafe(id, doc);\n                if (element) return element;\n                throw new Error(\"Can not find element: \" + stringify(id));\n            }(container).appendChild(frame);\n            (options.url || isIE) && frame.setAttribute(\"src\", options.url || \"about:blank\");\n            return frame;\n        }\n        function addEventListener(obj, event, handler) {\n            obj.addEventListener(event, handler);\n            return {\n                cancel: function() {\n                    obj.removeEventListener(event, handler);\n                }\n            };\n        }\n        function showElement(element) {\n            element.style.setProperty(\"display\", \"\");\n        }\n        function hideElement(element) {\n            element.style.setProperty(\"display\", \"none\", \"important\");\n        }\n        function destroyElement(element) {\n            element && element.parentNode && element.parentNode.removeChild(element);\n        }\n        function isElementClosed(el) {\n            return !(el && el.parentNode && el.ownerDocument && el.ownerDocument.documentElement && el.ownerDocument.documentElement.contains(el));\n        }\n        function onResize(el, handler, _temp) {\n            var _ref2 = void 0 === _temp ? {} : _temp, _ref2$width = _ref2.width, width = void 0 === _ref2$width || _ref2$width, _ref2$height = _ref2.height, height = void 0 === _ref2$height || _ref2$height, _ref2$interval = _ref2.interval, interval = void 0 === _ref2$interval ? 100 : _ref2$interval, _ref2$win = _ref2.win, win = void 0 === _ref2$win ? window : _ref2$win;\n            var currentWidth = el.offsetWidth;\n            var currentHeight = el.offsetHeight;\n            var canceled = !1;\n            handler({\n                width: currentWidth,\n                height: currentHeight\n            });\n            var check = function() {\n                if (!canceled && function(el) {\n                    return Boolean(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n                }(el)) {\n                    var newWidth = el.offsetWidth;\n                    var newHeight = el.offsetHeight;\n                    (width && newWidth !== currentWidth || height && newHeight !== currentHeight) && handler({\n                        width: newWidth,\n                        height: newHeight\n                    });\n                    currentWidth = newWidth;\n                    currentHeight = newHeight;\n                }\n            };\n            var observer;\n            var timeout;\n            win.addEventListener(\"resize\", check);\n            if (void 0 !== win.ResizeObserver) {\n                (observer = new win.ResizeObserver(check)).observe(el);\n                timeout = safeInterval(check, 10 * interval);\n            } else if (void 0 !== win.MutationObserver) {\n                (observer = new win.MutationObserver(check)).observe(el, {\n                    attributes: !0,\n                    childList: !0,\n                    subtree: !0,\n                    characterData: !1\n                });\n                timeout = safeInterval(check, 10 * interval);\n            } else timeout = safeInterval(check, interval);\n            return {\n                cancel: function() {\n                    canceled = !0;\n                    observer.disconnect();\n                    window.removeEventListener(\"resize\", check);\n                    timeout.cancel();\n                }\n            };\n        }\n        function isShadowElement(element) {\n            for (;element.parentNode; ) element = element.parentNode;\n            return \"[object ShadowRoot]\" === element.toString();\n        }\n        var currentScript = \"undefined\" != typeof document ? document.currentScript : null;\n        var getCurrentScript = memoize((function() {\n            if (currentScript) return currentScript;\n            if (currentScript = function() {\n                try {\n                    var stack = function() {\n                        try {\n                            throw new Error(\"_\");\n                        } catch (err) {\n                            return err.stack || \"\";\n                        }\n                    }();\n                    var stackDetails = /.*at [^(]*\\((.*):(.+):(.+)\\)$/gi.exec(stack);\n                    var scriptLocation = stackDetails && stackDetails[1];\n                    if (!scriptLocation) return;\n                    for (var _i22 = 0, _Array$prototype$slic2 = [].slice.call(document.getElementsByTagName(\"script\")).reverse(); _i22 < _Array$prototype$slic2.length; _i22++) {\n                        var script = _Array$prototype$slic2[_i22];\n                        if (script.src && script.src === scriptLocation) return script;\n                    }\n                } catch (err) {}\n            }()) return currentScript;\n            throw new Error(\"Can not determine current script\");\n        }));\n        var currentUID = uniqueID();\n        memoize((function() {\n            var script;\n            try {\n                script = getCurrentScript();\n            } catch (err) {\n                return currentUID;\n            }\n            var uid = script.getAttribute(\"data-uid\");\n            if (uid && \"string\" == typeof uid) return uid;\n            if ((uid = script.getAttribute(\"data-uid-auto\")) && \"string\" == typeof uid) return uid;\n            if (script.src) {\n                var hashedString = function(str) {\n                    var hash = \"\";\n                    for (var i = 0; i < str.length; i++) {\n                        var total = str[i].charCodeAt(0) * i;\n                        str[i + 1] && (total += str[i + 1].charCodeAt(0) * (i - 1));\n                        hash += String.fromCharCode(97 + Math.abs(total) % 26);\n                    }\n                    return hash;\n                }(JSON.stringify({\n                    src: script.src,\n                    dataset: script.dataset\n                }));\n                uid = \"uid_\" + hashedString.slice(hashedString.length - 30);\n            } else uid = uniqueID();\n            script.setAttribute(\"data-uid-auto\", uid);\n            return uid;\n        }));\n        function isPerc(str) {\n            return \"string\" == typeof str && /^[0-9]+%$/.test(str);\n        }\n        function toNum(val) {\n            if (\"number\" == typeof val) return val;\n            var match = val.match(/^([0-9]+)(px|%)$/);\n            if (!match) throw new Error(\"Could not match css value from \" + val);\n            return parseInt(match[1], 10);\n        }\n        function toPx(val) {\n            return toNum(val) + \"px\";\n        }\n        function toCSS(val) {\n            return \"number\" == typeof val ? toPx(val) : isPerc(val) ? val : toPx(val);\n        }\n        function normalizeDimension(dim, max) {\n            if (\"number\" == typeof dim) return dim;\n            if (isPerc(dim)) return parseInt(max * toNum(dim) / 100, 10);\n            if (\"string\" == typeof (str = dim) && /^[0-9]+px$/.test(str)) return toNum(dim);\n            var str;\n            throw new Error(\"Can not normalize dimension: \" + dim);\n        }\n        function global_getGlobal(win) {\n            void 0 === win && (win = window);\n            var globalKey = \"__post_robot_10_0_46__\";\n            return win !== window ? win[globalKey] : win[globalKey] = win[globalKey] || {};\n        }\n        var getObj = function() {\n            return {};\n        };\n        function globalStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return util_getOrSet(global_getGlobal(), key, (function() {\n                var store = defStore();\n                return {\n                    has: function(storeKey) {\n                        return store.hasOwnProperty(storeKey);\n                    },\n                    get: function(storeKey, defVal) {\n                        return store.hasOwnProperty(storeKey) ? store[storeKey] : defVal;\n                    },\n                    set: function(storeKey, val) {\n                        store[storeKey] = val;\n                        return val;\n                    },\n                    del: function(storeKey) {\n                        delete store[storeKey];\n                    },\n                    getOrSet: function(storeKey, getter) {\n                        return util_getOrSet(store, storeKey, getter);\n                    },\n                    reset: function() {\n                        store = defStore();\n                    },\n                    keys: function() {\n                        return Object.keys(store);\n                    }\n                };\n            }));\n        }\n        var WildCard = function() {};\n        function getWildcard() {\n            var global = global_getGlobal();\n            global.WINDOW_WILDCARD = global.WINDOW_WILDCARD || new WildCard;\n            return global.WINDOW_WILDCARD;\n        }\n        function windowStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return globalStore(\"windowStore\").getOrSet(key, (function() {\n                var winStore = new weakmap_CrossDomainSafeWeakMap;\n                var getStore = function(win) {\n                    return winStore.getOrSet(win, defStore);\n                };\n                return {\n                    has: function(win) {\n                        return getStore(win).hasOwnProperty(key);\n                    },\n                    get: function(win, defVal) {\n                        var store = getStore(win);\n                        return store.hasOwnProperty(key) ? store[key] : defVal;\n                    },\n                    set: function(win, val) {\n                        getStore(win)[key] = val;\n                        return val;\n                    },\n                    del: function(win) {\n                        delete getStore(win)[key];\n                    },\n                    getOrSet: function(win, getter) {\n                        return util_getOrSet(getStore(win), key, getter);\n                    }\n                };\n            }));\n        }\n        function getInstanceID() {\n            return globalStore(\"instance\").getOrSet(\"instanceID\", uniqueID);\n        }\n        function resolveHelloPromise(win, _ref) {\n            var domain = _ref.domain;\n            var helloPromises = windowStore(\"helloPromises\");\n            var existingPromise = helloPromises.get(win);\n            existingPromise && existingPromise.resolve({\n                domain: domain\n            });\n            var newPromise = promise_ZalgoPromise.resolve({\n                domain: domain\n            });\n            helloPromises.set(win, newPromise);\n            return newPromise;\n        }\n        function sayHello(win, _ref4) {\n            return (0, _ref4.send)(win, \"postrobot_hello\", {\n                instanceID: getInstanceID()\n            }, {\n                domain: \"*\",\n                timeout: -1\n            }).then((function(_ref5) {\n                var origin = _ref5.origin, instanceID = _ref5.data.instanceID;\n                resolveHelloPromise(win, {\n                    domain: origin\n                });\n                return {\n                    win: win,\n                    domain: origin,\n                    instanceID: instanceID\n                };\n            }));\n        }\n        function getWindowInstanceID(win, _ref6) {\n            var send = _ref6.send;\n            return windowStore(\"windowInstanceIDPromises\").getOrSet(win, (function() {\n                return sayHello(win, {\n                    send: send\n                }).then((function(_ref7) {\n                    return _ref7.instanceID;\n                }));\n            }));\n        }\n        function awaitWindowHello(win, timeout, name) {\n            void 0 === timeout && (timeout = 5e3);\n            void 0 === name && (name = \"Window\");\n            var promise = function(win) {\n                return windowStore(\"helloPromises\").getOrSet(win, (function() {\n                    return new promise_ZalgoPromise;\n                }));\n            }(win);\n            -1 !== timeout && (promise = promise.timeout(timeout, new Error(name + \" did not load after \" + timeout + \"ms\")));\n            return promise;\n        }\n        function markWindowKnown(win) {\n            windowStore(\"knownWindows\").set(win, !0);\n        }\n        function isSerializedType(item) {\n            return \"object\" == typeof item && null !== item && \"string\" == typeof item.__type__;\n        }\n        function determineType(val) {\n            return void 0 === val ? \"undefined\" : null === val ? \"null\" : Array.isArray(val) ? \"array\" : \"function\" == typeof val ? \"function\" : \"object\" == typeof val ? val instanceof Error ? \"error\" : \"function\" == typeof val.then ? \"promise\" : \"[object RegExp]\" === {}.toString.call(val) ? \"regex\" : \"[object Date]\" === {}.toString.call(val) ? \"date\" : \"object\" : \"string\" == typeof val ? \"string\" : \"number\" == typeof val ? \"number\" : \"boolean\" == typeof val ? \"boolean\" : void 0;\n        }\n        function serializeType(type, val) {\n            return {\n                __type__: type,\n                __val__: val\n            };\n        }\n        var _SERIALIZER;\n        var SERIALIZER = ((_SERIALIZER = {}).function = function() {}, _SERIALIZER.error = function(_ref) {\n            return serializeType(\"error\", {\n                message: _ref.message,\n                stack: _ref.stack,\n                code: _ref.code,\n                data: _ref.data\n            });\n        }, _SERIALIZER.promise = function() {}, _SERIALIZER.regex = function(val) {\n            return serializeType(\"regex\", val.source);\n        }, _SERIALIZER.date = function(val) {\n            return serializeType(\"date\", val.toJSON());\n        }, _SERIALIZER.array = function(val) {\n            return val;\n        }, _SERIALIZER.object = function(val) {\n            return val;\n        }, _SERIALIZER.string = function(val) {\n            return val;\n        }, _SERIALIZER.number = function(val) {\n            return val;\n        }, _SERIALIZER.boolean = function(val) {\n            return val;\n        }, _SERIALIZER.null = function(val) {\n            return val;\n        }, _SERIALIZER[void 0] = function(val) {\n            return serializeType(\"undefined\", val);\n        }, _SERIALIZER);\n        var defaultSerializers = {};\n        var _DESERIALIZER;\n        var DESERIALIZER = ((_DESERIALIZER = {}).function = function() {\n            throw new Error(\"Function serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.error = function(_ref2) {\n            var stack = _ref2.stack, code = _ref2.code, data = _ref2.data;\n            var error = new Error(_ref2.message);\n            error.code = code;\n            data && (error.data = data);\n            error.stack = stack + \"\\n\\n\" + error.stack;\n            return error;\n        }, _DESERIALIZER.promise = function() {\n            throw new Error(\"Promise serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.regex = function(val) {\n            return new RegExp(val);\n        }, _DESERIALIZER.date = function(val) {\n            return new Date(val);\n        }, _DESERIALIZER.array = function(val) {\n            return val;\n        }, _DESERIALIZER.object = function(val) {\n            return val;\n        }, _DESERIALIZER.string = function(val) {\n            return val;\n        }, _DESERIALIZER.number = function(val) {\n            return val;\n        }, _DESERIALIZER.boolean = function(val) {\n            return val;\n        }, _DESERIALIZER.null = function(val) {\n            return val;\n        }, _DESERIALIZER[void 0] = function() {}, _DESERIALIZER);\n        var defaultDeserializers = {};\n        function needsBridgeForBrowser() {\n            return !!utils_getUserAgent(window).match(/MSIE|trident|edge\\/12|edge\\/13/i);\n        }\n        function needsBridgeForWin(win) {\n            return !isSameTopWindow(window, win);\n        }\n        function needsBridgeForDomain(domain, win) {\n            if (domain) {\n                if (getDomain() !== getDomainFromUrl(domain)) return !0;\n            } else if (win && !isSameDomain(win)) return !0;\n            return !1;\n        }\n        function needsBridge(_ref) {\n            var win = _ref.win, domain = _ref.domain;\n            return !(!needsBridgeForBrowser() || domain && !needsBridgeForDomain(domain, win) || win && !needsBridgeForWin(win));\n        }\n        function getBridgeName(domain) {\n            return \"__postrobot_bridge___\" + (domain = domain || getDomainFromUrl(domain)).replace(/[^a-zA-Z0-9]+/g, \"_\");\n        }\n        function isBridge() {\n            return Boolean(window.name && window.name === getBridgeName(getDomain()));\n        }\n        var documentBodyReady = new promise_ZalgoPromise((function(resolve) {\n            if (window.document && window.document.body) return resolve(window.document.body);\n            var interval = setInterval((function() {\n                if (window.document && window.document.body) {\n                    clearInterval(interval);\n                    return resolve(window.document.body);\n                }\n            }), 10);\n        }));\n        function registerRemoteWindow(win) {\n            windowStore(\"remoteWindowPromises\").getOrSet(win, (function() {\n                return new promise_ZalgoPromise;\n            }));\n        }\n        function findRemoteWindow(win) {\n            var remoteWinPromise = windowStore(\"remoteWindowPromises\").get(win);\n            if (!remoteWinPromise) throw new Error(\"Remote window promise not found\");\n            return remoteWinPromise;\n        }\n        function registerRemoteSendMessage(win, domain, sendMessage) {\n            findRemoteWindow(win).resolve((function(remoteWin, remoteDomain, message) {\n                if (remoteWin !== win) throw new Error(\"Remote window does not match window\");\n                if (!matchDomain(remoteDomain, domain)) throw new Error(\"Remote domain \" + remoteDomain + \" does not match domain \" + domain);\n                sendMessage.fireAndForget(message);\n            }));\n        }\n        function rejectRemoteSendMessage(win, err) {\n            findRemoteWindow(win).reject(err).catch(src_util_noop);\n        }\n        function linkWindow(_ref3) {\n            var win = _ref3.win, name = _ref3.name, domain = _ref3.domain;\n            var popupWindowsByName = globalStore(\"popupWindowsByName\");\n            var popupWindowsByWin = windowStore(\"popupWindowsByWin\");\n            for (var _i2 = 0, _popupWindowsByName$k2 = popupWindowsByName.keys(); _i2 < _popupWindowsByName$k2.length; _i2++) {\n                var winName = _popupWindowsByName$k2[_i2];\n                var _details = popupWindowsByName.get(winName);\n                _details && !isWindowClosed(_details.win) || popupWindowsByName.del(winName);\n            }\n            if (isWindowClosed(win)) return {\n                win: win,\n                name: name,\n                domain: domain\n            };\n            var details = popupWindowsByWin.getOrSet(win, (function() {\n                return name ? popupWindowsByName.getOrSet(name, (function() {\n                    return {\n                        win: win,\n                        name: name\n                    };\n                })) : {\n                    win: win\n                };\n            }));\n            if (details.win && details.win !== win) throw new Error(\"Different window already linked for window: \" + (name || \"undefined\"));\n            if (name) {\n                details.name = name;\n                popupWindowsByName.set(name, details);\n            }\n            if (domain) {\n                details.domain = domain;\n                registerRemoteWindow(win);\n            }\n            popupWindowsByWin.set(win, details);\n            return details;\n        }\n        function setupBridge(_ref) {\n            var on = _ref.on, send = _ref.send, receiveMessage = _ref.receiveMessage;\n            windowOpen = window.open, window.open = function(url, name, options, last) {\n                var win = windowOpen.call(this, function(url) {\n                    if (!(domain = getDomainFromUrl(url), 0 === domain.indexOf(\"mock:\"))) return url;\n                    var domain;\n                    throw new Error(\"Mock urls not supported out of test mode\");\n                }(url), name, options, last);\n                if (!win) return win;\n                linkWindow({\n                    win: win,\n                    name: name,\n                    domain: url ? getDomainFromUrl(url) : null\n                });\n                return win;\n            };\n            var windowOpen;\n            !function(_ref) {\n                var on = _ref.on, send = _ref.send, receiveMessage = _ref.receiveMessage;\n                var popupWindowsByName = globalStore(\"popupWindowsByName\");\n                on(\"postrobot_open_tunnel\", (function(_ref2) {\n                    var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                    var bridgePromise = globalStore(\"bridges\").get(origin);\n                    if (!bridgePromise) throw new Error(\"Can not find bridge promise for domain \" + origin);\n                    return bridgePromise.then((function(bridge) {\n                        if (source !== bridge) throw new Error(\"Message source does not matched registered bridge for domain \" + origin);\n                        if (!data.name) throw new Error(\"Register window expected to be passed window name\");\n                        if (!data.sendMessage) throw new Error(\"Register window expected to be passed sendMessage method\");\n                        if (!popupWindowsByName.has(data.name)) throw new Error(\"Window with name \" + data.name + \" does not exist, or was not opened by this window\");\n                        var getWindowDetails = function() {\n                            return popupWindowsByName.get(data.name);\n                        };\n                        if (!getWindowDetails().domain) throw new Error(\"We do not have a registered domain for window \" + data.name);\n                        if (getWindowDetails().domain !== origin) throw new Error(\"Message origin \" + origin + \" does not matched registered window origin \" + (getWindowDetails().domain || \"unknown\"));\n                        registerRemoteSendMessage(getWindowDetails().win, origin, data.sendMessage);\n                        return {\n                            sendMessage: function(message) {\n                                if (window && !window.closed && getWindowDetails()) {\n                                    var domain = getWindowDetails().domain;\n                                    if (domain) try {\n                                        receiveMessage({\n                                            data: message,\n                                            origin: domain,\n                                            source: getWindowDetails().win\n                                        }, {\n                                            on: on,\n                                            send: send\n                                        });\n                                    } catch (err) {\n                                        promise_ZalgoPromise.reject(err);\n                                    }\n                                }\n                            }\n                        };\n                    }));\n                }));\n            }({\n                on: on,\n                send: send,\n                receiveMessage: receiveMessage\n            });\n            !function(_ref2) {\n                var send = _ref2.send;\n                global_getGlobal(window).openTunnelToParent = function(_ref3) {\n                    var name = _ref3.name, source = _ref3.source, canary = _ref3.canary, sendMessage = _ref3.sendMessage;\n                    var tunnelWindows = globalStore(\"tunnelWindows\");\n                    var parentWindow = utils_getParent(window);\n                    if (!parentWindow) throw new Error(\"No parent window found to open tunnel to\");\n                    var id = function(_ref) {\n                        var name = _ref.name, source = _ref.source, canary = _ref.canary, sendMessage = _ref.sendMessage;\n                        !function() {\n                            var tunnelWindows = globalStore(\"tunnelWindows\");\n                            for (var _i2 = 0, _tunnelWindows$keys2 = tunnelWindows.keys(); _i2 < _tunnelWindows$keys2.length; _i2++) {\n                                var key = _tunnelWindows$keys2[_i2];\n                                isWindowClosed(tunnelWindows[key].source) && tunnelWindows.del(key);\n                            }\n                        }();\n                        var id = uniqueID();\n                        globalStore(\"tunnelWindows\").set(id, {\n                            name: name,\n                            source: source,\n                            canary: canary,\n                            sendMessage: sendMessage\n                        });\n                        return id;\n                    }({\n                        name: name,\n                        source: source,\n                        canary: canary,\n                        sendMessage: sendMessage\n                    });\n                    return send(parentWindow, \"postrobot_open_tunnel\", {\n                        name: name,\n                        sendMessage: function() {\n                            var tunnelWindow = tunnelWindows.get(id);\n                            if (tunnelWindow && tunnelWindow.source && !isWindowClosed(tunnelWindow.source)) {\n                                try {\n                                    tunnelWindow.canary();\n                                } catch (err) {\n                                    return;\n                                }\n                                tunnelWindow.sendMessage.apply(this, arguments);\n                            }\n                        }\n                    }, {\n                        domain: \"*\"\n                    });\n                };\n            }({\n                send: send\n            });\n            !function(_ref) {\n                var on = _ref.on, send = _ref.send, receiveMessage = _ref.receiveMessage;\n                promise_ZalgoPromise.try((function() {\n                    var opener = getOpener(window);\n                    if (opener && needsBridge({\n                        win: opener\n                    })) {\n                        registerRemoteWindow(opener);\n                        return (win = opener, windowStore(\"remoteBridgeAwaiters\").getOrSet(win, (function() {\n                            return promise_ZalgoPromise.try((function() {\n                                var frame = getFrameByName(win, getBridgeName(getDomain()));\n                                if (frame) return isSameDomain(frame) && global_getGlobal(assertSameDomain(frame)) ? frame : new promise_ZalgoPromise((function(resolve) {\n                                    var interval;\n                                    var timeout;\n                                    interval = setInterval((function() {\n                                        if (frame && isSameDomain(frame) && global_getGlobal(assertSameDomain(frame))) {\n                                            clearInterval(interval);\n                                            clearTimeout(timeout);\n                                            return resolve(frame);\n                                        }\n                                    }), 100);\n                                    timeout = setTimeout((function() {\n                                        clearInterval(interval);\n                                        return resolve();\n                                    }), 2e3);\n                                }));\n                            }));\n                        }))).then((function(bridge) {\n                            return bridge ? window.name ? global_getGlobal(assertSameDomain(bridge)).openTunnelToParent({\n                                name: window.name,\n                                source: window,\n                                canary: function() {},\n                                sendMessage: function(message) {\n                                    try {\n                                        window;\n                                    } catch (err) {\n                                        return;\n                                    }\n                                    if (window && !window.closed) try {\n                                        receiveMessage({\n                                            data: message,\n                                            origin: this.origin,\n                                            source: this.source\n                                        }, {\n                                            on: on,\n                                            send: send\n                                        });\n                                    } catch (err) {\n                                        promise_ZalgoPromise.reject(err);\n                                    }\n                                }\n                            }).then((function(_ref2) {\n                                var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                                if (source !== opener) throw new Error(\"Source does not match opener\");\n                                registerRemoteSendMessage(source, origin, data.sendMessage);\n                            })).catch((function(err) {\n                                rejectRemoteSendMessage(opener, err);\n                                throw err;\n                            })) : rejectRemoteSendMessage(opener, new Error(\"Can not register with opener: window does not have a name\")) : rejectRemoteSendMessage(opener, new Error(\"Can not register with opener: no bridge found in opener\"));\n                        }));\n                        var win;\n                    }\n                }));\n            }({\n                on: on,\n                send: send,\n                receiveMessage: receiveMessage\n            });\n        }\n        function cleanupProxyWindows() {\n            var idToProxyWindow = globalStore(\"idToProxyWindow\");\n            for (var _i2 = 0, _idToProxyWindow$keys2 = idToProxyWindow.keys(); _i2 < _idToProxyWindow$keys2.length; _i2++) {\n                var id = _idToProxyWindow$keys2[_i2];\n                idToProxyWindow.get(id).shouldClean() && idToProxyWindow.del(id);\n            }\n        }\n        function getSerializedWindow(winPromise, _ref) {\n            var send = _ref.send, _ref$id = _ref.id, id = void 0 === _ref$id ? uniqueID() : _ref$id;\n            var windowNamePromise = winPromise.then((function(win) {\n                if (isSameDomain(win)) return assertSameDomain(win).name;\n            }));\n            var windowTypePromise = winPromise.then((function(window) {\n                if (isWindowClosed(window)) throw new Error(\"Window is closed, can not determine type\");\n                return getOpener(window) ? \"popup\" : \"iframe\";\n            }));\n            windowNamePromise.catch(src_util_noop);\n            windowTypePromise.catch(src_util_noop);\n            var getName = function() {\n                return winPromise.then((function(win) {\n                    if (!isWindowClosed(win)) return isSameDomain(win) ? assertSameDomain(win).name : windowNamePromise;\n                }));\n            };\n            return {\n                id: id,\n                getType: function() {\n                    return windowTypePromise;\n                },\n                getInstanceID: memoizePromise((function() {\n                    return winPromise.then((function(win) {\n                        return getWindowInstanceID(win, {\n                            send: send\n                        });\n                    }));\n                })),\n                close: function() {\n                    return winPromise.then(closeWindow);\n                },\n                getName: getName,\n                focus: function() {\n                    return winPromise.then((function(win) {\n                        win.focus();\n                    }));\n                },\n                isClosed: function() {\n                    return winPromise.then((function(win) {\n                        return isWindowClosed(win);\n                    }));\n                },\n                setLocation: function(href, opts) {\n                    void 0 === opts && (opts = {});\n                    return winPromise.then((function(win) {\n                        var domain = window.location.protocol + \"//\" + window.location.host;\n                        var _opts$method = opts.method, method = void 0 === _opts$method ? \"get\" : _opts$method, body = opts.body;\n                        if (0 === href.indexOf(\"/\")) href = \"\" + domain + href; else if (!href.match(/^https?:\\/\\//) && 0 !== href.indexOf(domain)) throw new Error(\"Expected url to be http or https url, or absolute path, got \" + JSON.stringify(href));\n                        if (\"post\" === method) return getName().then((function(name) {\n                            if (!name) throw new Error(\"Can not post to window without target name\");\n                            !function(_ref3) {\n                                var url = _ref3.url, target = _ref3.target, body = _ref3.body, _ref3$method = _ref3.method, method = void 0 === _ref3$method ? \"post\" : _ref3$method;\n                                var form = document.createElement(\"form\");\n                                form.setAttribute(\"target\", target);\n                                form.setAttribute(\"method\", method);\n                                form.setAttribute(\"action\", url);\n                                form.style.display = \"none\";\n                                if (body) for (var _i24 = 0, _Object$keys4 = Object.keys(body); _i24 < _Object$keys4.length; _i24++) {\n                                    var _body$key;\n                                    var key = _Object$keys4[_i24];\n                                    var input = document.createElement(\"input\");\n                                    input.setAttribute(\"name\", key);\n                                    input.setAttribute(\"value\", null == (_body$key = body[key]) ? void 0 : _body$key.toString());\n                                    form.appendChild(input);\n                                }\n                                getBody().appendChild(form);\n                                form.submit();\n                                getBody().removeChild(form);\n                            }({\n                                url: href,\n                                target: name,\n                                method: method,\n                                body: body\n                            });\n                        }));\n                        if (\"get\" !== method) throw new Error(\"Unsupported method: \" + method);\n                        if (isSameDomain(win)) try {\n                            if (win.location && \"function\" == typeof win.location.replace) {\n                                win.location.replace(href);\n                                return;\n                            }\n                        } catch (err) {}\n                        win.location = href;\n                    }));\n                },\n                setName: function(name) {\n                    return winPromise.then((function(win) {\n                        linkWindow({\n                            win: win,\n                            name: name\n                        });\n                        var sameDomain = isSameDomain(win);\n                        var frame = getFrameForWindow(win);\n                        if (!sameDomain) throw new Error(\"Can not set name for cross-domain window: \" + name);\n                        assertSameDomain(win).name = name;\n                        frame && frame.setAttribute(\"name\", name);\n                        windowNamePromise = promise_ZalgoPromise.resolve(name);\n                    }));\n                }\n            };\n        }\n        var window_ProxyWindow = function() {\n            function ProxyWindow(_ref2) {\n                var send = _ref2.send, win = _ref2.win, serializedWindow = _ref2.serializedWindow;\n                this.id = void 0;\n                this.isProxyWindow = !0;\n                this.serializedWindow = void 0;\n                this.actualWindow = void 0;\n                this.actualWindowPromise = void 0;\n                this.send = void 0;\n                this.name = void 0;\n                this.actualWindowPromise = new promise_ZalgoPromise;\n                this.serializedWindow = serializedWindow || getSerializedWindow(this.actualWindowPromise, {\n                    send: send\n                });\n                globalStore(\"idToProxyWindow\").set(this.getID(), this);\n                win && this.setWindow(win, {\n                    send: send\n                });\n            }\n            var _proto = ProxyWindow.prototype;\n            _proto.getID = function() {\n                return this.serializedWindow.id;\n            };\n            _proto.getType = function() {\n                return this.serializedWindow.getType();\n            };\n            _proto.isPopup = function() {\n                return this.getType().then((function(type) {\n                    return \"popup\" === type;\n                }));\n            };\n            _proto.setLocation = function(href, opts) {\n                var _this = this;\n                return this.serializedWindow.setLocation(href, opts).then((function() {\n                    return _this;\n                }));\n            };\n            _proto.getName = function() {\n                return this.serializedWindow.getName();\n            };\n            _proto.setName = function(name) {\n                var _this2 = this;\n                return this.serializedWindow.setName(name).then((function() {\n                    return _this2;\n                }));\n            };\n            _proto.close = function() {\n                var _this3 = this;\n                return this.serializedWindow.close().then((function() {\n                    return _this3;\n                }));\n            };\n            _proto.focus = function() {\n                var _this4 = this;\n                var isPopupPromise = this.isPopup();\n                var getNamePromise = this.getName();\n                var reopenPromise = promise_ZalgoPromise.hash({\n                    isPopup: isPopupPromise,\n                    name: getNamePromise\n                }).then((function(_ref3) {\n                    var name = _ref3.name;\n                    _ref3.isPopup && name && window.open(\"\", name, \"noopener\");\n                }));\n                var focusPromise = this.serializedWindow.focus();\n                return promise_ZalgoPromise.all([ reopenPromise, focusPromise ]).then((function() {\n                    return _this4;\n                }));\n            };\n            _proto.isClosed = function() {\n                return this.serializedWindow.isClosed();\n            };\n            _proto.getWindow = function() {\n                return this.actualWindow;\n            };\n            _proto.setWindow = function(win, _ref4) {\n                var send = _ref4.send;\n                this.actualWindow = win;\n                this.actualWindowPromise.resolve(this.actualWindow);\n                this.serializedWindow = getSerializedWindow(this.actualWindowPromise, {\n                    send: send,\n                    id: this.getID()\n                });\n                windowStore(\"winToProxyWindow\").set(win, this);\n            };\n            _proto.awaitWindow = function() {\n                return this.actualWindowPromise;\n            };\n            _proto.matchWindow = function(win, _ref5) {\n                var _this5 = this;\n                var send = _ref5.send;\n                return promise_ZalgoPromise.try((function() {\n                    return _this5.actualWindow ? win === _this5.actualWindow : promise_ZalgoPromise.hash({\n                        proxyInstanceID: _this5.getInstanceID(),\n                        knownWindowInstanceID: getWindowInstanceID(win, {\n                            send: send\n                        })\n                    }).then((function(_ref6) {\n                        var match = _ref6.proxyInstanceID === _ref6.knownWindowInstanceID;\n                        match && _this5.setWindow(win, {\n                            send: send\n                        });\n                        return match;\n                    }));\n                }));\n            };\n            _proto.unwrap = function() {\n                return this.actualWindow || this;\n            };\n            _proto.getInstanceID = function() {\n                return this.serializedWindow.getInstanceID();\n            };\n            _proto.shouldClean = function() {\n                return Boolean(this.actualWindow && isWindowClosed(this.actualWindow));\n            };\n            _proto.serialize = function() {\n                return this.serializedWindow;\n            };\n            ProxyWindow.unwrap = function(win) {\n                return ProxyWindow.isProxyWindow(win) ? win.unwrap() : win;\n            };\n            ProxyWindow.serialize = function(win, _ref7) {\n                var send = _ref7.send;\n                cleanupProxyWindows();\n                return ProxyWindow.toProxyWindow(win, {\n                    send: send\n                }).serialize();\n            };\n            ProxyWindow.deserialize = function(serializedWindow, _ref8) {\n                var send = _ref8.send;\n                cleanupProxyWindows();\n                return globalStore(\"idToProxyWindow\").get(serializedWindow.id) || new ProxyWindow({\n                    serializedWindow: serializedWindow,\n                    send: send\n                });\n            };\n            ProxyWindow.isProxyWindow = function(obj) {\n                return Boolean(obj && !isWindow(obj) && obj.isProxyWindow);\n            };\n            ProxyWindow.toProxyWindow = function(win, _ref9) {\n                var send = _ref9.send;\n                cleanupProxyWindows();\n                if (ProxyWindow.isProxyWindow(win)) return win;\n                var actualWindow = win;\n                return windowStore(\"winToProxyWindow\").get(actualWindow) || new ProxyWindow({\n                    win: actualWindow,\n                    send: send\n                });\n            };\n            return ProxyWindow;\n        }();\n        function addMethod(id, val, name, source, domain) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            if (window_ProxyWindow.isProxyWindow(source)) proxyWindowMethods.set(id, {\n                val: val,\n                name: name,\n                domain: domain,\n                source: source\n            }); else {\n                proxyWindowMethods.del(id);\n                methodStore.getOrSet(source, (function() {\n                    return {};\n                }))[id] = {\n                    domain: domain,\n                    name: name,\n                    val: val,\n                    source: source\n                };\n            }\n        }\n        function lookupMethod(source, id) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            return methodStore.getOrSet(source, (function() {\n                return {};\n            }))[id] || proxyWindowMethods.get(id);\n        }\n        function function_serializeFunction(destination, domain, val, key, _ref3) {\n            on = (_ref = {\n                on: _ref3.on,\n                send: _ref3.send\n            }).on, send = _ref.send, globalStore(\"builtinListeners\").getOrSet(\"functionCalls\", (function() {\n                return on(\"postrobot_method\", {\n                    domain: \"*\"\n                }, (function(_ref2) {\n                    var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                    var id = data.id, name = data.name;\n                    var meth = lookupMethod(source, id);\n                    if (!meth) throw new Error(\"Could not find method '\" + name + \"' with id: \" + data.id + \" in \" + getDomain(window));\n                    var methodSource = meth.source, domain = meth.domain, val = meth.val;\n                    return promise_ZalgoPromise.try((function() {\n                        if (!matchDomain(domain, origin)) throw new Error(\"Method '\" + data.name + \"' domain \" + JSON.stringify(util_isRegex(meth.domain) ? meth.domain.source : meth.domain) + \" does not match origin \" + origin + \" in \" + getDomain(window));\n                        if (window_ProxyWindow.isProxyWindow(methodSource)) return methodSource.matchWindow(source, {\n                            send: send\n                        }).then((function(match) {\n                            if (!match) throw new Error(\"Method call '\" + data.name + \"' failed - proxy window does not match source in \" + getDomain(window));\n                        }));\n                    })).then((function() {\n                        return val.apply({\n                            source: source,\n                            origin: origin\n                        }, data.args);\n                    }), (function(err) {\n                        return promise_ZalgoPromise.try((function() {\n                            if (val.onError) return val.onError(err);\n                        })).then((function() {\n                            err.stack && (err.stack = \"Remote call to \" + name + \"(\" + function(args) {\n                                void 0 === args && (args = []);\n                                return arrayFrom(args).map((function(arg) {\n                                    return \"string\" == typeof arg ? \"'\" + arg + \"'\" : void 0 === arg ? \"undefined\" : null === arg ? \"null\" : \"boolean\" == typeof arg ? arg.toString() : Array.isArray(arg) ? \"[ ... ]\" : \"object\" == typeof arg ? \"{ ... }\" : \"function\" == typeof arg ? \"() => { ... }\" : \"<\" + typeof arg + \">\";\n                                })).join(\", \");\n                            }(data.args) + \") failed\\n\\n\" + err.stack);\n                            throw err;\n                        }));\n                    })).then((function(result) {\n                        return {\n                            result: result,\n                            id: id,\n                            name: name\n                        };\n                    }));\n                }));\n            }));\n            var _ref, on, send;\n            var id = val.__id__ || uniqueID();\n            destination = window_ProxyWindow.unwrap(destination);\n            var name = val.__name__ || val.name || key;\n            \"string\" == typeof name && \"function\" == typeof name.indexOf && 0 === name.indexOf(\"anonymous::\") && (name = name.replace(\"anonymous::\", key + \"::\"));\n            if (window_ProxyWindow.isProxyWindow(destination)) {\n                addMethod(id, val, name, destination, domain);\n                destination.awaitWindow().then((function(win) {\n                    addMethod(id, val, name, win, domain);\n                }));\n            } else addMethod(id, val, name, destination, domain);\n            return serializeType(\"cross_domain_function\", {\n                id: id,\n                name: name\n            });\n        }\n        function serializeMessage(destination, domain, obj, _ref) {\n            var _serialize;\n            var on = _ref.on, send = _ref.send;\n            return function(obj, serializers) {\n                void 0 === serializers && (serializers = defaultSerializers);\n                var result = JSON.stringify(obj, (function(key) {\n                    var val = this[key];\n                    if (isSerializedType(this)) return val;\n                    var type = determineType(val);\n                    if (!type) return val;\n                    var serializer = serializers[type] || SERIALIZER[type];\n                    return serializer ? serializer(val, key) : val;\n                }));\n                return void 0 === result ? \"undefined\" : result;\n            }(obj, ((_serialize = {}).promise = function(val, key) {\n                return function(destination, domain, val, key, _ref) {\n                    return serializeType(\"cross_domain_zalgo_promise\", {\n                        then: function_serializeFunction(destination, domain, (function(resolve, reject) {\n                            return val.then(resolve, reject);\n                        }), key, {\n                            on: _ref.on,\n                            send: _ref.send\n                        })\n                    });\n                }(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.function = function(val, key) {\n                return function_serializeFunction(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.object = function(val) {\n                return isWindow(val) || window_ProxyWindow.isProxyWindow(val) ? serializeType(\"cross_domain_window\", window_ProxyWindow.serialize(val, {\n                    send: send\n                })) : val;\n            }, _serialize));\n        }\n        function deserializeMessage(source, origin, message, _ref2) {\n            var _deserialize;\n            var send = _ref2.send;\n            return function(str, deserializers) {\n                void 0 === deserializers && (deserializers = defaultDeserializers);\n                if (\"undefined\" !== str) return JSON.parse(str, (function(key, val) {\n                    if (isSerializedType(this)) return val;\n                    var type;\n                    var value;\n                    if (isSerializedType(val)) {\n                        type = val.__type__;\n                        value = val.__val__;\n                    } else {\n                        type = determineType(val);\n                        value = val;\n                    }\n                    if (!type) return value;\n                    var deserializer = deserializers[type] || DESERIALIZER[type];\n                    return deserializer ? deserializer(value, key) : value;\n                }));\n            }(message, ((_deserialize = {}).cross_domain_zalgo_promise = function(serializedPromise) {\n                return function(source, origin, _ref2) {\n                    return new promise_ZalgoPromise(_ref2.then);\n                }(0, 0, serializedPromise);\n            }, _deserialize.cross_domain_function = function(serializedFunction) {\n                return function(source, origin, _ref4, _ref5) {\n                    var id = _ref4.id, name = _ref4.name;\n                    var send = _ref5.send;\n                    var getDeserializedFunction = function(opts) {\n                        void 0 === opts && (opts = {});\n                        function crossDomainFunctionWrapper() {\n                            var _arguments = arguments;\n                            return window_ProxyWindow.toProxyWindow(source, {\n                                send: send\n                            }).awaitWindow().then((function(win) {\n                                var meth = lookupMethod(win, id);\n                                if (meth && meth.val !== crossDomainFunctionWrapper) return meth.val.apply({\n                                    source: window,\n                                    origin: getDomain()\n                                }, _arguments);\n                                var _args = [].slice.call(_arguments);\n                                return opts.fireAndForget ? send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !0\n                                }) : send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !1\n                                }).then((function(res) {\n                                    return res.data.result;\n                                }));\n                            })).catch((function(err) {\n                                throw err;\n                            }));\n                        }\n                        crossDomainFunctionWrapper.__name__ = name;\n                        crossDomainFunctionWrapper.__origin__ = origin;\n                        crossDomainFunctionWrapper.__source__ = source;\n                        crossDomainFunctionWrapper.__id__ = id;\n                        crossDomainFunctionWrapper.origin = origin;\n                        return crossDomainFunctionWrapper;\n                    };\n                    var crossDomainFunctionWrapper = getDeserializedFunction();\n                    crossDomainFunctionWrapper.fireAndForget = getDeserializedFunction({\n                        fireAndForget: !0\n                    });\n                    return crossDomainFunctionWrapper;\n                }(source, origin, serializedFunction, {\n                    send: send\n                });\n            }, _deserialize.cross_domain_window = function(serializedWindow) {\n                return window_ProxyWindow.deserialize(serializedWindow, {\n                    send: send\n                });\n            }, _deserialize));\n        }\n        var SEND_MESSAGE_STRATEGIES = {};\n        SEND_MESSAGE_STRATEGIES.postrobot_post_message = function(win, serializedMessage, domain) {\n            0 === domain.indexOf(\"file:\") && (domain = \"*\");\n            win.postMessage(serializedMessage, domain);\n        };\n        SEND_MESSAGE_STRATEGIES.postrobot_bridge = function(win, serializedMessage, domain) {\n            if (!needsBridgeForBrowser() && !isBridge()) throw new Error(\"Bridge not needed for browser\");\n            if (isSameDomain(win)) throw new Error(\"Post message through bridge disabled between same domain windows\");\n            if (!1 !== isSameTopWindow(window, win)) throw new Error(\"Can only use bridge to communicate between two different windows, not between frames\");\n            !function(win, domain, message) {\n                var messagingChild = isOpener(window, win);\n                var messagingParent = isOpener(win, window);\n                if (!messagingChild && !messagingParent) throw new Error(\"Can only send messages to and from parent and popup windows\");\n                findRemoteWindow(win).then((function(sendMessage) {\n                    return sendMessage(win, domain, message);\n                }));\n            }(win, domain, serializedMessage);\n        };\n        SEND_MESSAGE_STRATEGIES.postrobot_global = function(win, serializedMessage) {\n            if (!utils_getUserAgent(window).match(/MSIE|rv:11|trident|edge\\/12|edge\\/13/i)) throw new Error(\"Global messaging not needed for browser\");\n            if (!isSameDomain(win)) throw new Error(\"Post message through global disabled between different domain windows\");\n            if (!1 !== isSameTopWindow(window, win)) throw new Error(\"Can only use global to communicate between two different windows, not between frames\");\n            var foreignGlobal = global_getGlobal(win);\n            if (!foreignGlobal) throw new Error(\"Can not find postRobot global on foreign window\");\n            foreignGlobal.receiveMessage({\n                source: window,\n                origin: getDomain(),\n                data: serializedMessage\n            });\n        };\n        function send_sendMessage(win, domain, message, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            return promise_ZalgoPromise.try((function() {\n                var domainBuffer = windowStore().getOrSet(win, (function() {\n                    return {};\n                }));\n                domainBuffer.buffer = domainBuffer.buffer || [];\n                domainBuffer.buffer.push(message);\n                domainBuffer.flush = domainBuffer.flush || promise_ZalgoPromise.flush().then((function() {\n                    if (isWindowClosed(win)) throw new Error(\"Window is closed\");\n                    var serializedMessage = serializeMessage(win, domain, ((_ref = {}).__post_robot_10_0_46__ = domainBuffer.buffer || [], \n                    _ref), {\n                        on: on,\n                        send: send\n                    });\n                    var _ref;\n                    delete domainBuffer.buffer;\n                    var strategies = Object.keys(SEND_MESSAGE_STRATEGIES);\n                    var errors = [];\n                    for (var _i2 = 0; _i2 < strategies.length; _i2++) {\n                        var strategyName = strategies[_i2];\n                        try {\n                            SEND_MESSAGE_STRATEGIES[strategyName](win, serializedMessage, domain);\n                        } catch (err) {\n                            errors.push(err);\n                        }\n                    }\n                    if (errors.length === strategies.length) throw new Error(\"All post-robot messaging strategies failed:\\n\\n\" + errors.map((function(err, i) {\n                        return i + \". \" + stringifyError(err);\n                    })).join(\"\\n\\n\"));\n                }));\n                return domainBuffer.flush.then((function() {\n                    delete domainBuffer.flush;\n                }));\n            })).then(src_util_noop);\n        }\n        function getResponseListener(hash) {\n            return globalStore(\"responseListeners\").get(hash);\n        }\n        function deleteResponseListener(hash) {\n            globalStore(\"responseListeners\").del(hash);\n        }\n        function isResponseListenerErrored(hash) {\n            return globalStore(\"erroredResponseListeners\").has(hash);\n        }\n        function getRequestListener(_ref) {\n            var name = _ref.name, win = _ref.win, domain = _ref.domain;\n            var requestListeners = windowStore(\"requestListeners\");\n            \"*\" === win && (win = null);\n            \"*\" === domain && (domain = null);\n            if (!name) throw new Error(\"Name required to get request listener\");\n            for (var _i4 = 0, _ref3 = [ win, getWildcard() ]; _i4 < _ref3.length; _i4++) {\n                var winQualifier = _ref3[_i4];\n                if (winQualifier) {\n                    var nameListeners = requestListeners.get(winQualifier);\n                    if (nameListeners) {\n                        var domainListeners = nameListeners[name];\n                        if (domainListeners) {\n                            if (domain && \"string\" == typeof domain) {\n                                if (domainListeners[domain]) return domainListeners[domain];\n                                if (domainListeners.__domain_regex__) for (var _i6 = 0, _domainListeners$__DO2 = domainListeners.__domain_regex__; _i6 < _domainListeners$__DO2.length; _i6++) {\n                                    var _domainListeners$__DO3 = _domainListeners$__DO2[_i6], listener = _domainListeners$__DO3.listener;\n                                    if (matchDomain(_domainListeners$__DO3.regex, domain)) return listener;\n                                }\n                            }\n                            if (domainListeners[\"*\"]) return domainListeners[\"*\"];\n                        }\n                    }\n                }\n            }\n        }\n        function handleRequest(source, origin, message, _ref) {\n            var on = _ref.on, send = _ref.send;\n            var options = getRequestListener({\n                name: message.name,\n                win: source,\n                domain: origin\n            });\n            var logName = \"postrobot_method\" === message.name && message.data && \"string\" == typeof message.data.name ? message.data.name + \"()\" : message.name;\n            function sendResponse(ack, data, error) {\n                return promise_ZalgoPromise.flush().then((function() {\n                    if (!message.fireAndForget && !isWindowClosed(source)) try {\n                        return send_sendMessage(source, origin, {\n                            id: uniqueID(),\n                            origin: getDomain(window),\n                            type: \"postrobot_message_response\",\n                            hash: message.hash,\n                            name: message.name,\n                            ack: ack,\n                            data: data,\n                            error: error\n                        }, {\n                            on: on,\n                            send: send\n                        });\n                    } catch (err) {\n                        throw new Error(\"Send response message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }\n                }));\n            }\n            return promise_ZalgoPromise.all([ promise_ZalgoPromise.flush().then((function() {\n                if (!message.fireAndForget && !isWindowClosed(source)) try {\n                    return send_sendMessage(source, origin, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_ack\",\n                        hash: message.hash,\n                        name: message.name\n                    }, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    throw new Error(\"Send ack message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                }\n            })), promise_ZalgoPromise.try((function() {\n                if (!options) throw new Error(\"No handler found for post message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                return options.handler({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            })).then((function(data) {\n                return sendResponse(\"success\", data);\n            }), (function(error) {\n                return sendResponse(\"error\", null, error);\n            })) ]).then(src_util_noop).catch((function(err) {\n                if (options && options.handleError) return options.handleError(err);\n                throw err;\n            }));\n        }\n        function handleAck(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message ack for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                try {\n                    if (!matchDomain(options.domain, origin)) throw new Error(\"Ack origin \" + origin + \" does not match domain \" + options.domain.toString());\n                    if (source !== options.win) throw new Error(\"Ack source does not match registered window\");\n                } catch (err) {\n                    options.promise.reject(err);\n                }\n                options.ack = !0;\n            }\n        }\n        function handleResponse(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message response for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                if (!matchDomain(options.domain, origin)) throw new Error(\"Response origin \" + origin + \" does not match domain \" + (pattern = options.domain, \n                Array.isArray(pattern) ? \"(\" + pattern.join(\" | \") + \")\" : isRegex(pattern) ? \"RegExp(\" + pattern.toString() + \")\" : pattern.toString()));\n                var pattern;\n                if (source !== options.win) throw new Error(\"Response source does not match registered window\");\n                deleteResponseListener(message.hash);\n                \"error\" === message.ack ? options.promise.reject(message.error) : \"success\" === message.ack && options.promise.resolve({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            }\n        }\n        function receive_receiveMessage(event, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            var receivedMessages = globalStore(\"receivedMessages\");\n            try {\n                if (!window || window.closed || !event.source) return;\n            } catch (err) {\n                return;\n            }\n            var source = event.source, origin = event.origin;\n            var messages = function(message, source, origin, _ref) {\n                var on = _ref.on, send = _ref.send;\n                var parsedMessage;\n                try {\n                    parsedMessage = deserializeMessage(source, origin, message, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    return;\n                }\n                if (parsedMessage && \"object\" == typeof parsedMessage && null !== parsedMessage) {\n                    var parseMessages = parsedMessage.__post_robot_10_0_46__;\n                    if (Array.isArray(parseMessages)) return parseMessages;\n                }\n            }(event.data, source, origin, {\n                on: on,\n                send: send\n            });\n            if (messages) {\n                markWindowKnown(source);\n                for (var _i2 = 0; _i2 < messages.length; _i2++) {\n                    var message = messages[_i2];\n                    if (receivedMessages.has(message.id)) return;\n                    receivedMessages.set(message.id, !0);\n                    if (isWindowClosed(source) && !message.fireAndForget) return;\n                    0 === message.origin.indexOf(\"file:\") && (origin = \"file://\");\n                    try {\n                        \"postrobot_message_request\" === message.type ? handleRequest(source, origin, message, {\n                            on: on,\n                            send: send\n                        }) : \"postrobot_message_response\" === message.type ? handleResponse(source, origin, message) : \"postrobot_message_ack\" === message.type && handleAck(source, origin, message);\n                    } catch (err) {\n                        setTimeout((function() {\n                            throw err;\n                        }), 0);\n                    }\n                }\n            }\n        }\n        function on_on(name, options, handler) {\n            if (!name) throw new Error(\"Expected name\");\n            if (\"function\" == typeof (options = options || {})) {\n                handler = options;\n                options = {};\n            }\n            if (!handler) throw new Error(\"Expected handler\");\n            var requestListener = function addRequestListener(_ref4, listener) {\n                var name = _ref4.name, winCandidate = _ref4.win, domain = _ref4.domain;\n                var requestListeners = windowStore(\"requestListeners\");\n                if (!name || \"string\" != typeof name) throw new Error(\"Name required to add request listener\");\n                if (winCandidate && \"*\" !== winCandidate && window_ProxyWindow.isProxyWindow(winCandidate)) {\n                    var requestListenerPromise = winCandidate.awaitWindow().then((function(actualWin) {\n                        return addRequestListener({\n                            name: name,\n                            win: actualWin,\n                            domain: domain\n                        }, listener);\n                    }));\n                    return {\n                        cancel: function() {\n                            requestListenerPromise.then((function(requestListener) {\n                                return requestListener.cancel();\n                            }), src_util_noop);\n                        }\n                    };\n                }\n                var win = winCandidate;\n                if (Array.isArray(win)) {\n                    var listenersCollection = [];\n                    for (var _i8 = 0, _win2 = win; _i8 < _win2.length; _i8++) listenersCollection.push(addRequestListener({\n                        name: name,\n                        domain: domain,\n                        win: _win2[_i8]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i10 = 0; _i10 < listenersCollection.length; _i10++) listenersCollection[_i10].cancel();\n                        }\n                    };\n                }\n                if (Array.isArray(domain)) {\n                    var _listenersCollection = [];\n                    for (var _i12 = 0, _domain2 = domain; _i12 < _domain2.length; _i12++) _listenersCollection.push(addRequestListener({\n                        name: name,\n                        win: win,\n                        domain: _domain2[_i12]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i14 = 0; _i14 < _listenersCollection.length; _i14++) _listenersCollection[_i14].cancel();\n                        }\n                    };\n                }\n                var existingListener = getRequestListener({\n                    name: name,\n                    win: win,\n                    domain: domain\n                });\n                win && \"*\" !== win || (win = getWildcard());\n                var strDomain = (domain = domain || \"*\").toString();\n                if (existingListener) throw win && domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString() + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : win ? new Error(\"Request listener already exists for \" + name + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString()) : new Error(\"Request listener already exists for \" + name);\n                var winNameListeners = requestListeners.getOrSet(win, (function() {\n                    return {};\n                }));\n                var winNameDomainListeners = util_getOrSet(winNameListeners, name, (function() {\n                    return {};\n                }));\n                var winNameDomainRegexListeners;\n                var winNameDomainRegexListener;\n                util_isRegex(domain) ? (winNameDomainRegexListeners = util_getOrSet(winNameDomainListeners, \"__domain_regex__\", (function() {\n                    return [];\n                }))).push(winNameDomainRegexListener = {\n                    regex: domain,\n                    listener: listener\n                }) : winNameDomainListeners[strDomain] = listener;\n                return {\n                    cancel: function() {\n                        delete winNameDomainListeners[strDomain];\n                        if (winNameDomainRegexListener) {\n                            winNameDomainRegexListeners.splice(winNameDomainRegexListeners.indexOf(winNameDomainRegexListener, 1));\n                            winNameDomainRegexListeners.length || delete winNameDomainListeners.__domain_regex__;\n                        }\n                        Object.keys(winNameDomainListeners).length || delete winNameListeners[name];\n                        win && !Object.keys(winNameListeners).length && requestListeners.del(win);\n                    }\n                };\n            }({\n                name: name,\n                win: options.window,\n                domain: options.domain || \"*\"\n            }, {\n                handler: handler || options.handler,\n                handleError: options.errorHandler || function(err) {\n                    throw err;\n                }\n            });\n            return {\n                cancel: function() {\n                    requestListener.cancel();\n                }\n            };\n        }\n        var send_send = function send(winOrProxyWin, name, data, options) {\n            var domainMatcher = (options = options || {}).domain || \"*\";\n            var responseTimeout = options.timeout || -1;\n            var childTimeout = options.timeout || 5e3;\n            var fireAndForget = options.fireAndForget || !1;\n            return window_ProxyWindow.toProxyWindow(winOrProxyWin, {\n                send: send\n            }).awaitWindow().then((function(win) {\n                return promise_ZalgoPromise.try((function() {\n                    !function(name, win, domain) {\n                        if (!name) throw new Error(\"Expected name\");\n                        if (domain && \"string\" != typeof domain && !Array.isArray(domain) && !util_isRegex(domain)) throw new TypeError(\"Can not send \" + name + \". Expected domain \" + JSON.stringify(domain) + \" to be a string, array, or regex\");\n                        if (isWindowClosed(win)) throw new Error(\"Can not send \" + name + \". Target window is closed\");\n                    }(name, win, domainMatcher);\n                    if (function(parent, child) {\n                        var actualParent = getAncestor(child);\n                        if (actualParent) return actualParent === parent;\n                        if (child === parent) return !1;\n                        if (getTop(child) === child) return !1;\n                        for (var _i15 = 0, _getFrames8 = getFrames(parent); _i15 < _getFrames8.length; _i15++) if (_getFrames8[_i15] === child) return !0;\n                        return !1;\n                    }(window, win)) return awaitWindowHello(win, childTimeout);\n                })).then((function(_temp) {\n                    return function(win, targetDomain, actualDomain, _ref) {\n                        var send = _ref.send;\n                        return promise_ZalgoPromise.try((function() {\n                            return \"string\" == typeof targetDomain ? targetDomain : promise_ZalgoPromise.try((function() {\n                                return actualDomain || sayHello(win, {\n                                    send: send\n                                }).then((function(_ref2) {\n                                    return _ref2.domain;\n                                }));\n                            })).then((function(normalizedDomain) {\n                                if (!matchDomain(targetDomain, targetDomain)) throw new Error(\"Domain \" + stringify(targetDomain) + \" does not match \" + stringify(targetDomain));\n                                return normalizedDomain;\n                            }));\n                        }));\n                    }(win, domainMatcher, (void 0 === _temp ? {} : _temp).domain, {\n                        send: send\n                    });\n                })).then((function(targetDomain) {\n                    var domain = targetDomain;\n                    var logName = \"postrobot_method\" === name && data && \"string\" == typeof data.name ? data.name + \"()\" : name;\n                    var promise = new promise_ZalgoPromise;\n                    var hash = name + \"_\" + uniqueID();\n                    if (!fireAndForget) {\n                        var responseListener = {\n                            name: name,\n                            win: win,\n                            domain: domain,\n                            promise: promise\n                        };\n                        !function(hash, listener) {\n                            globalStore(\"responseListeners\").set(hash, listener);\n                        }(hash, responseListener);\n                        var reqPromises = windowStore(\"requestPromises\").getOrSet(win, (function() {\n                            return [];\n                        }));\n                        reqPromises.push(promise);\n                        promise.catch((function() {\n                            !function(hash) {\n                                globalStore(\"erroredResponseListeners\").set(hash, !0);\n                            }(hash);\n                            deleteResponseListener(hash);\n                        }));\n                        var totalAckTimeout = function(win) {\n                            return windowStore(\"knownWindows\").get(win, !1);\n                        }(win) ? 1e4 : 2e3;\n                        var totalResTimeout = responseTimeout;\n                        var ackTimeout = totalAckTimeout;\n                        var resTimeout = totalResTimeout;\n                        var interval = safeInterval((function() {\n                            if (isWindowClosed(win)) return promise.reject(new Error(\"Window closed for \" + name + \" before \" + (responseListener.ack ? \"response\" : \"ack\")));\n                            if (responseListener.cancelled) return promise.reject(new Error(\"Response listener was cancelled for \" + name));\n                            ackTimeout = Math.max(ackTimeout - 500, 0);\n                            -1 !== resTimeout && (resTimeout = Math.max(resTimeout - 500, 0));\n                            return responseListener.ack || 0 !== ackTimeout ? 0 === resTimeout ? promise.reject(new Error(\"No response for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalResTimeout + \"ms\")) : void 0 : promise.reject(new Error(\"No ack for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalAckTimeout + \"ms\"));\n                        }), 500);\n                        promise.finally((function() {\n                            interval.cancel();\n                            reqPromises.splice(reqPromises.indexOf(promise, 1));\n                        })).catch(src_util_noop);\n                    }\n                    return send_sendMessage(win, domain, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_request\",\n                        hash: hash,\n                        name: name,\n                        data: data,\n                        fireAndForget: fireAndForget\n                    }, {\n                        on: on_on,\n                        send: send\n                    }).then((function() {\n                        return fireAndForget ? promise.resolve() : promise;\n                    }), (function(err) {\n                        throw new Error(\"Send request message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }));\n                }));\n            }));\n        };\n        function setup_toProxyWindow(win) {\n            return window_ProxyWindow.toProxyWindow(win, {\n                send: send_send\n            });\n        }\n        function cleanUpWindow(win) {\n            for (var _i2 = 0, _requestPromises$get2 = windowStore(\"requestPromises\").get(win, []); _i2 < _requestPromises$get2.length; _i2++) _requestPromises$get2[_i2].reject(new Error(\"Window \" + (isWindowClosed(win) ? \"closed\" : \"cleaned up\") + \" before response\")).catch(src_util_noop);\n        }\n        var src_bridge;\n        src_bridge = {\n            setupBridge: setupBridge,\n            openBridge: function(url, domain) {\n                var bridges = globalStore(\"bridges\");\n                var bridgeFrames = globalStore(\"bridgeFrames\");\n                domain = domain || getDomainFromUrl(url);\n                return bridges.getOrSet(domain, (function() {\n                    return promise_ZalgoPromise.try((function() {\n                        if (getDomain() === domain) throw new Error(\"Can not open bridge on the same domain as current domain: \" + domain);\n                        var name = getBridgeName(domain);\n                        if (getFrameByName(window, name)) throw new Error(\"Frame with name \" + name + \" already exists on page\");\n                        var iframe = function(name, url) {\n                            var iframe = document.createElement(\"iframe\");\n                            iframe.setAttribute(\"name\", name);\n                            iframe.setAttribute(\"id\", name);\n                            iframe.setAttribute(\"style\", \"display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;\");\n                            iframe.setAttribute(\"frameborder\", \"0\");\n                            iframe.setAttribute(\"border\", \"0\");\n                            iframe.setAttribute(\"scrolling\", \"no\");\n                            iframe.setAttribute(\"allowTransparency\", \"true\");\n                            iframe.setAttribute(\"tabindex\", \"-1\");\n                            iframe.setAttribute(\"hidden\", \"true\");\n                            iframe.setAttribute(\"title\", \"\");\n                            iframe.setAttribute(\"role\", \"presentation\");\n                            iframe.src = url;\n                            return iframe;\n                        }(name, url);\n                        bridgeFrames.set(domain, iframe);\n                        return documentBodyReady.then((function(body) {\n                            body.appendChild(iframe);\n                            var bridge = iframe.contentWindow;\n                            return new promise_ZalgoPromise((function(resolve, reject) {\n                                iframe.addEventListener(\"load\", resolve);\n                                iframe.addEventListener(\"error\", reject);\n                            })).then((function() {\n                                return awaitWindowHello(bridge, 5e3, \"Bridge \" + url);\n                            })).then((function() {\n                                return bridge;\n                            }));\n                        }));\n                    }));\n                }));\n            },\n            linkWindow: linkWindow,\n            linkUrl: function(win, url) {\n                linkWindow({\n                    win: win,\n                    domain: getDomainFromUrl(url)\n                });\n            },\n            isBridge: isBridge,\n            needsBridge: needsBridge,\n            needsBridgeForBrowser: needsBridgeForBrowser,\n            hasBridge: function(url, domain) {\n                return globalStore(\"bridges\").has(domain || getDomainFromUrl(url));\n            },\n            needsBridgeForWin: needsBridgeForWin,\n            needsBridgeForDomain: needsBridgeForDomain,\n            destroyBridges: function() {\n                var bridges = globalStore(\"bridges\");\n                var bridgeFrames = globalStore(\"bridgeFrames\");\n                for (var _i4 = 0, _bridgeFrames$keys2 = bridgeFrames.keys(); _i4 < _bridgeFrames$keys2.length; _i4++) {\n                    var frame = bridgeFrames.get(_bridgeFrames$keys2[_i4]);\n                    frame && frame.parentNode && frame.parentNode.removeChild(frame);\n                }\n                bridgeFrames.reset();\n                bridges.reset();\n            }\n        };\n        function src_util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function utils_getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function utils_getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return utils_getActualProtocol(win);\n        }\n        function utils_isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === utils_getProtocol(win);\n        }\n        function src_utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function utils_getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !src_utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function utils_canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = utils_getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = src_utils_getParent(win);\n                return parent && utils_canReadFromWindow() ? utils_getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function utils_getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = utils_getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function utils_isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === utils_getProtocol(win);\n                    }(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (utils_getActualDomain(win) === utils_getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                if (utils_getDomain(window) === utils_getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_assertSameDomain(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function utils_isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = src_utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function utils_getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function utils_getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = utils_getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = utils_getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function utils_getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (src_utils_getParent(win) === win) return win;\n            try {\n                if (utils_isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (utils_isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = utils_getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (src_utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function utils_getAllFramesInWindow(win) {\n            var top = utils_getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(utils_getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], utils_getAllChildFrames(win)));\n            return result;\n        }\n        var utils_iframeWindows = [];\n        var utils_iframeFrames = [];\n        function utils_isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || \"Call was rejected by callee.\\r\\n\" !== err.message;\n            }\n            if (allowMock && utils_isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(utils_iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = utils_iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function utils_getFrameByName(win, name) {\n            var winFrames = utils_getFrames(win);\n            for (var _i9 = 0; _i9 < winFrames.length; _i9++) {\n                var childFrame = winFrames[_i9];\n                try {\n                    if (utils_isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame;\n                } catch (err) {}\n            }\n            try {\n                if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name];\n            } catch (err) {}\n            try {\n                if (-1 !== winFrames.indexOf(win[name])) return win[name];\n            } catch (err) {}\n        }\n        function utils_getAncestor(win) {\n            void 0 === win && (win = window);\n            return utils_getOpener(win = win || window) || src_utils_getParent(win) || void 0;\n        }\n        function utils_anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function utils_getDistanceFromTop(win) {\n            void 0 === win && (win = window);\n            var distance = 0;\n            var parent = win;\n            for (;parent; ) (parent = src_utils_getParent(parent)) && (distance += 1);\n            return distance;\n        }\n        function utils_matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (src_util_isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return src_util_isRegex(pattern) ? src_util_isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !src_util_isRegex(origin) && pattern.some((function(subpattern) {\n                return utils_matchDomain(subpattern, origin);\n            })));\n        }\n        function utils_getDomainFromUrl(url) {\n            return url.match(/^(https?|mock|file):\\/\\//) ? url.split(\"/\").slice(0, 3).join(\"/\") : utils_getDomain();\n        }\n        function utils_onCloseWindow(win, callback, delay, maxtime) {\n            void 0 === delay && (delay = 1e3);\n            void 0 === maxtime && (maxtime = 1 / 0);\n            var timeout;\n            !function check() {\n                if (utils_isWindowClosed(win)) {\n                    timeout && clearTimeout(timeout);\n                    return callback();\n                }\n                if (maxtime <= 0) clearTimeout(timeout); else {\n                    maxtime -= delay;\n                    timeout = setTimeout(check, delay);\n                }\n            }();\n            return {\n                cancel: function() {\n                    timeout && clearTimeout(timeout);\n                }\n            };\n        }\n        function utils_isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_normalizeMockUrl(url) {\n            if (!(domain = utils_getDomainFromUrl(url), 0 === domain.indexOf(\"mock:\"))) return url;\n            var domain;\n            throw new Error(\"Mock urls not supported out of test mode\");\n        }\n        function lib_global_getGlobal(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Can not get global for window on different domain\");\n            win.__zoid_9_0_87__ || (win.__zoid_9_0_87__ = {});\n            return win.__zoid_9_0_87__;\n        }\n        function tryGlobal(win, handler) {\n            try {\n                return handler(lib_global_getGlobal(win));\n            } catch (err) {}\n        }\n        function getProxyObject(obj) {\n            return {\n                get: function() {\n                    var _this = this;\n                    return promise_ZalgoPromise.try((function() {\n                        if (_this.source && _this.source !== window) throw new Error(\"Can not call get on proxy object from a remote window\");\n                        return obj;\n                    }));\n                }\n            };\n        }\n        function basicSerialize(data) {\n            return base64encode(JSON.stringify(data));\n        }\n        function getUIDRefStore(win) {\n            var global = lib_global_getGlobal(win);\n            global.references = global.references || {};\n            return global.references;\n        }\n        function crossDomainSerialize(_ref) {\n            var data = _ref.data, metaData = _ref.metaData, sender = _ref.sender, receiver = _ref.receiver, _ref$passByReference = _ref.passByReference, passByReference = void 0 !== _ref$passByReference && _ref$passByReference, _ref$basic = _ref.basic, basic = void 0 !== _ref$basic && _ref$basic;\n            var proxyWin = setup_toProxyWindow(receiver.win);\n            var serializedMessage = basic ? JSON.stringify(data) : serializeMessage(proxyWin, receiver.domain, data, {\n                on: on_on,\n                send: send_send\n            });\n            var reference = passByReference ? function(val) {\n                var uid = uniqueID();\n                getUIDRefStore(window)[uid] = val;\n                return {\n                    type: \"uid\",\n                    uid: uid\n                };\n            }(serializedMessage) : {\n                type: \"raw\",\n                val: serializedMessage\n            };\n            return {\n                serializedData: basicSerialize({\n                    sender: {\n                        domain: sender.domain\n                    },\n                    metaData: metaData,\n                    reference: reference\n                }),\n                cleanReference: function() {\n                    win = window, \"uid\" === (ref = reference).type && delete getUIDRefStore(win)[ref.uid];\n                    var win, ref;\n                }\n            };\n        }\n        function crossDomainDeserialize(_ref2) {\n            var sender = _ref2.sender, _ref2$basic = _ref2.basic, basic = void 0 !== _ref2$basic && _ref2$basic;\n            var message = function(serializedData) {\n                return JSON.parse(function(str) {\n                    if (\"function\" == typeof atob) return decodeURIComponent([].map.call(atob(str), (function(c) {\n                        return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\n                    })).join(\"\"));\n                    if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"base64\").toString(\"utf8\");\n                    throw new Error(\"Can not find window.atob or Buffer\");\n                }(serializedData));\n            }(_ref2.data);\n            var reference = message.reference, metaData = message.metaData;\n            var win;\n            win = \"function\" == typeof sender.win ? sender.win({\n                metaData: metaData\n            }) : sender.win;\n            var domain;\n            domain = \"function\" == typeof sender.domain ? sender.domain({\n                metaData: metaData\n            }) : \"string\" == typeof sender.domain ? sender.domain : message.sender.domain;\n            var serializedData = function(win, ref) {\n                if (\"raw\" === ref.type) return ref.val;\n                if (\"uid\" === ref.type) return getUIDRefStore(win)[ref.uid];\n                throw new Error(\"Unsupported ref type: \" + ref.type);\n            }(win, reference);\n            return {\n                data: basic ? JSON.parse(serializedData) : function(source, origin, message) {\n                    return deserializeMessage(source, origin, message, {\n                        on: on_on,\n                        send: send_send\n                    });\n                }(win, domain, serializedData),\n                metaData: metaData,\n                sender: {\n                    win: win,\n                    domain: domain\n                },\n                reference: reference\n            };\n        }\n        var PROP_TYPE = {\n            STRING: \"string\",\n            OBJECT: \"object\",\n            FUNCTION: \"function\",\n            BOOLEAN: \"boolean\",\n            NUMBER: \"number\",\n            ARRAY: \"array\"\n        };\n        var PROP_SERIALIZATION = {\n            JSON: \"json\",\n            DOTIFY: \"dotify\",\n            BASE64: \"base64\"\n        };\n        var CONTEXT = {\n            IFRAME: \"iframe\",\n            POPUP: \"popup\"\n        };\n        var EVENT = {\n            RENDER: \"zoid-render\",\n            RENDERED: \"zoid-rendered\",\n            DISPLAY: \"zoid-display\",\n            ERROR: \"zoid-error\",\n            CLOSE: \"zoid-close\",\n            DESTROY: \"zoid-destroy\",\n            PROPS: \"zoid-props\",\n            RESIZE: \"zoid-resize\",\n            FOCUS: \"zoid-focus\"\n        };\n        function buildChildWindowName(_ref) {\n            return \"__zoid__\" + _ref.name + \"__\" + _ref.serializedPayload + \"__\";\n        }\n        function parseWindowName(windowName) {\n            if (!windowName) throw new Error(\"No window name\");\n            var _windowName$split = windowName.split(\"__\"), zoidcomp = _windowName$split[1], name = _windowName$split[2], serializedInitialPayload = _windowName$split[3];\n            if (\"zoid\" !== zoidcomp) throw new Error(\"Window not rendered by zoid - got \" + zoidcomp);\n            if (!name) throw new Error(\"Expected component name\");\n            if (!serializedInitialPayload) throw new Error(\"Expected serialized payload ref\");\n            return {\n                name: name,\n                serializedInitialPayload: serializedInitialPayload\n            };\n        }\n        var parseInitialParentPayload = memoize((function(windowName) {\n            var _crossDomainDeseriali = crossDomainDeserialize({\n                data: parseWindowName(windowName).serializedInitialPayload,\n                sender: {\n                    win: function(_ref2) {\n                        return function(windowRef) {\n                            if (\"opener\" === windowRef.type) return assertExists(\"opener\", utils_getOpener(window));\n                            if (\"parent\" === windowRef.type && \"number\" == typeof windowRef.distance) return assertExists(\"parent\", function(win, n) {\n                                void 0 === n && (n = 1);\n                                return function(win, n) {\n                                    void 0 === n && (n = 1);\n                                    var parent = win;\n                                    for (var i = 0; i < n; i++) {\n                                        if (!parent) return;\n                                        parent = src_utils_getParent(parent);\n                                    }\n                                    return parent;\n                                }(win, utils_getDistanceFromTop(win) - n);\n                            }(window, windowRef.distance));\n                            if (\"global\" === windowRef.type && windowRef.uid && \"string\" == typeof windowRef.uid) {\n                                var _ret = function() {\n                                    var uid = windowRef.uid;\n                                    var ancestor = utils_getAncestor(window);\n                                    if (!ancestor) throw new Error(\"Can not find ancestor window\");\n                                    for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(ancestor); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                        var frame = _getAllFramesInWindow2[_i2];\n                                        if (utils_isSameDomain(frame)) {\n                                            var win = tryGlobal(frame, (function(global) {\n                                                return global.windows && global.windows[uid];\n                                            }));\n                                            if (win) return {\n                                                v: win\n                                            };\n                                        }\n                                    }\n                                }();\n                                if (\"object\" == typeof _ret) return _ret.v;\n                            } else if (\"name\" === windowRef.type) {\n                                var name = windowRef.name;\n                                return assertExists(\"namedWindow\", function(win, name) {\n                                    return utils_getFrameByName(win, name) || function utils_findChildFrameByName(win, name) {\n                                        var frame = utils_getFrameByName(win, name);\n                                        if (frame) return frame;\n                                        for (var _i11 = 0, _getFrames4 = utils_getFrames(win); _i11 < _getFrames4.length; _i11++) {\n                                            var namedFrame = utils_findChildFrameByName(_getFrames4[_i11], name);\n                                            if (namedFrame) return namedFrame;\n                                        }\n                                    }(utils_getTop(win) || win, name);\n                                }(assertExists(\"ancestor\", utils_getAncestor(window)), name));\n                            }\n                            throw new Error(\"Unable to find \" + windowRef.type + \" parent component window\");\n                        }(_ref2.metaData.windowRef);\n                    }\n                }\n            });\n            return {\n                parent: _crossDomainDeseriali.sender,\n                payload: _crossDomainDeseriali.data,\n                reference: _crossDomainDeseriali.reference\n            };\n        }));\n        function getInitialParentPayload() {\n            return parseInitialParentPayload(window.name);\n        }\n        function window_getWindowRef(targetWindow, currentWindow) {\n            void 0 === currentWindow && (currentWindow = window);\n            if (targetWindow === src_utils_getParent(currentWindow)) return {\n                type: \"parent\",\n                distance: utils_getDistanceFromTop(targetWindow)\n            };\n            if (targetWindow === utils_getOpener(currentWindow)) return {\n                type: \"opener\"\n            };\n            if (utils_isSameDomain(targetWindow) && !(win = targetWindow, win === utils_getTop(win))) {\n                var windowName = utils_assertSameDomain(targetWindow).name;\n                if (windowName) return {\n                    type: \"name\",\n                    name: windowName\n                };\n            }\n            var win;\n        }\n        function normalizeChildProp(propsDef, props, key, value, helpers) {\n            if (!propsDef.hasOwnProperty(key)) return value;\n            var prop = propsDef[key];\n            return \"function\" == typeof prop.childDecorate ? prop.childDecorate({\n                value: value,\n                uid: helpers.uid,\n                tag: helpers.tag,\n                close: helpers.close,\n                focus: helpers.focus,\n                onError: helpers.onError,\n                onProps: helpers.onProps,\n                resize: helpers.resize,\n                getParent: helpers.getParent,\n                getParentDomain: helpers.getParentDomain,\n                show: helpers.show,\n                hide: helpers.hide,\n                export: helpers.export,\n                getSiblings: helpers.getSiblings\n            }) : value;\n        }\n        function child_focus() {\n            return promise_ZalgoPromise.try((function() {\n                window.focus();\n            }));\n        }\n        function child_destroy() {\n            return promise_ZalgoPromise.try((function() {\n                window.close();\n            }));\n        }\n        var props_defaultNoop = function() {\n            return src_util_noop;\n        };\n        var props_decorateOnce = function(_ref) {\n            return once(_ref.value);\n        };\n        function eachProp(props, propsDef, handler) {\n            for (var _i2 = 0, _Object$keys2 = Object.keys(_extends({}, props, propsDef)); _i2 < _Object$keys2.length; _i2++) {\n                var key = _Object$keys2[_i2];\n                handler(key, propsDef[key], props[key]);\n            }\n        }\n        function serializeProps(propsDef, props, method) {\n            var params = {};\n            return promise_ZalgoPromise.all(function(props, propsDef, handler) {\n                var results = [];\n                eachProp(props, propsDef, (function(key, propDef, value) {\n                    var result = function(key, propDef, value) {\n                        return promise_ZalgoPromise.resolve().then((function() {\n                            var _METHOD$GET$METHOD$PO, _METHOD$GET$METHOD$PO2;\n                            if (null != value && propDef) {\n                                var getParam = (_METHOD$GET$METHOD$PO = {}, _METHOD$GET$METHOD$PO.get = propDef.queryParam, \n                                _METHOD$GET$METHOD$PO.post = propDef.bodyParam, _METHOD$GET$METHOD$PO)[method];\n                                var getValue = (_METHOD$GET$METHOD$PO2 = {}, _METHOD$GET$METHOD$PO2.get = propDef.queryValue, \n                                _METHOD$GET$METHOD$PO2.post = propDef.bodyValue, _METHOD$GET$METHOD$PO2)[method];\n                                if (getParam) return promise_ZalgoPromise.hash({\n                                    finalParam: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getParam ? getParam({\n                                            value: value\n                                        }) : \"string\" == typeof getParam ? getParam : key;\n                                    })),\n                                    finalValue: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getValue && isDefined(value) ? getValue({\n                                            value: value\n                                        }) : value;\n                                    }))\n                                }).then((function(_ref) {\n                                    var finalParam = _ref.finalParam, finalValue = _ref.finalValue;\n                                    var result;\n                                    if (\"boolean\" == typeof finalValue) result = finalValue.toString(); else if (\"string\" == typeof finalValue) result = finalValue.toString(); else if (\"object\" == typeof finalValue && null !== finalValue) {\n                                        if (propDef.serialization === PROP_SERIALIZATION.JSON) result = JSON.stringify(finalValue); else if (propDef.serialization === PROP_SERIALIZATION.BASE64) result = base64encode(JSON.stringify(finalValue)); else if (propDef.serialization === PROP_SERIALIZATION.DOTIFY || !propDef.serialization) {\n                                            result = function dotify(obj, prefix, newobj) {\n                                                void 0 === prefix && (prefix = \"\");\n                                                void 0 === newobj && (newobj = {});\n                                                prefix = prefix ? prefix + \".\" : prefix;\n                                                for (var key in obj) obj.hasOwnProperty(key) && null != obj[key] && \"function\" != typeof obj[key] && (obj[key] && Array.isArray(obj[key]) && obj[key].length && obj[key].every((function(val) {\n                                                    return \"object\" != typeof val;\n                                                })) ? newobj[\"\" + prefix + key + \"[]\"] = obj[key].join(\",\") : obj[key] && \"object\" == typeof obj[key] ? newobj = dotify(obj[key], \"\" + prefix + key, newobj) : newobj[\"\" + prefix + key] = obj[key].toString());\n                                                return newobj;\n                                            }(finalValue, key);\n                                            for (var _i2 = 0, _Object$keys2 = Object.keys(result); _i2 < _Object$keys2.length; _i2++) {\n                                                var dotkey = _Object$keys2[_i2];\n                                                params[dotkey] = result[dotkey];\n                                            }\n                                            return;\n                                        }\n                                    } else \"number\" == typeof finalValue && (result = finalValue.toString());\n                                    params[finalParam] = result;\n                                }));\n                            }\n                        }));\n                    }(key, propDef, value);\n                    results.push(result);\n                }));\n                return results;\n            }(props, propsDef)).then((function() {\n                return params;\n            }));\n        }\n        function parentComponent(_ref) {\n            var uid = _ref.uid, options = _ref.options, _ref$overrides = _ref.overrides, overrides = void 0 === _ref$overrides ? {} : _ref$overrides, _ref$parentWin = _ref.parentWin, parentWin = void 0 === _ref$parentWin ? window : _ref$parentWin;\n            var propsDef = options.propsDef, containerTemplate = options.containerTemplate, prerenderTemplate = options.prerenderTemplate, tag = options.tag, name = options.name, attributes = options.attributes, dimensions = options.dimensions, autoResize = options.autoResize, url = options.url, domainMatch = options.domain, xports = options.exports;\n            var initPromise = new promise_ZalgoPromise;\n            var handledErrors = [];\n            var clean = cleanup();\n            var state = {};\n            var inputProps = {};\n            var internalState = {\n                visible: !0\n            };\n            var event = overrides.event ? overrides.event : (triggered = {}, handlers = {}, \n            emitter = {\n                on: function(eventName, handler) {\n                    var handlerList = handlers[eventName] = handlers[eventName] || [];\n                    handlerList.push(handler);\n                    var cancelled = !1;\n                    return {\n                        cancel: function() {\n                            if (!cancelled) {\n                                cancelled = !0;\n                                handlerList.splice(handlerList.indexOf(handler), 1);\n                            }\n                        }\n                    };\n                },\n                once: function(eventName, handler) {\n                    var listener = emitter.on(eventName, (function() {\n                        listener.cancel();\n                        handler();\n                    }));\n                    return listener;\n                },\n                trigger: function(eventName) {\n                    for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n                    var handlerList = handlers[eventName];\n                    var promises = [];\n                    if (handlerList) {\n                        var _loop = function(_i2) {\n                            var handler = handlerList[_i2];\n                            promises.push(promise_ZalgoPromise.try((function() {\n                                return handler.apply(void 0, args);\n                            })));\n                        };\n                        for (var _i2 = 0; _i2 < handlerList.length; _i2++) _loop(_i2);\n                    }\n                    return promise_ZalgoPromise.all(promises).then(src_util_noop);\n                },\n                triggerOnce: function(eventName) {\n                    if (triggered[eventName]) return promise_ZalgoPromise.resolve();\n                    triggered[eventName] = !0;\n                    for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];\n                    return emitter.trigger.apply(emitter, [ eventName ].concat(args));\n                },\n                reset: function() {\n                    handlers = {};\n                }\n            });\n            var triggered, handlers, emitter;\n            var props = overrides.props ? overrides.props : {};\n            var currentProxyWin;\n            var currentProxyContainer;\n            var childComponent;\n            var currentChildDomain;\n            var currentContainer;\n            var onErrorOverride = overrides.onError;\n            var getProxyContainerOverride = overrides.getProxyContainer;\n            var showOverride = overrides.show;\n            var hideOverride = overrides.hide;\n            var closeOverride = overrides.close;\n            var renderContainerOverride = overrides.renderContainer;\n            var getProxyWindowOverride = overrides.getProxyWindow;\n            var setProxyWinOverride = overrides.setProxyWin;\n            var openFrameOverride = overrides.openFrame;\n            var openPrerenderFrameOverride = overrides.openPrerenderFrame;\n            var prerenderOverride = overrides.prerender;\n            var openOverride = overrides.open;\n            var openPrerenderOverride = overrides.openPrerender;\n            var watchForUnloadOverride = overrides.watchForUnload;\n            var getInternalStateOverride = overrides.getInternalState;\n            var setInternalStateOverride = overrides.setInternalState;\n            var getDimensions = function() {\n                return \"function\" == typeof dimensions ? dimensions({\n                    props: props\n                }) : dimensions;\n            };\n            var resolveInitPromise = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.resolveInitPromise ? overrides.resolveInitPromise() : initPromise.resolve();\n                }));\n            };\n            var rejectInitPromise = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.rejectInitPromise ? overrides.rejectInitPromise(err) : initPromise.reject(err);\n                }));\n            };\n            var getPropsForChild = function(initialChildDomain) {\n                var result = {};\n                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                    var key = _Object$keys2[_i2];\n                    var prop = propsDef[key];\n                    prop && !1 === prop.sendToChild || prop && prop.sameDomain && !utils_matchDomain(initialChildDomain, utils_getDomain(window)) || (result[key] = props[key]);\n                }\n                return promise_ZalgoPromise.hash(result);\n            };\n            var getInternalState = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return getInternalStateOverride ? getInternalStateOverride() : internalState;\n                }));\n            };\n            var setInternalState = function(newInternalState) {\n                return promise_ZalgoPromise.try((function() {\n                    return setInternalStateOverride ? setInternalStateOverride(newInternalState) : internalState = _extends({}, internalState, newInternalState);\n                }));\n            };\n            var getProxyWindow = function() {\n                return getProxyWindowOverride ? getProxyWindowOverride() : promise_ZalgoPromise.try((function() {\n                    var windowProp = props.window;\n                    if (windowProp) {\n                        var _proxyWin = setup_toProxyWindow(windowProp);\n                        clean.register((function() {\n                            return windowProp.close();\n                        }));\n                        return _proxyWin;\n                    }\n                    return new window_ProxyWindow({\n                        send: send_send\n                    });\n                }));\n            };\n            var setProxyWin = function(proxyWin) {\n                return setProxyWinOverride ? setProxyWinOverride(proxyWin) : promise_ZalgoPromise.try((function() {\n                    currentProxyWin = proxyWin;\n                }));\n            };\n            var show = function() {\n                return showOverride ? showOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !0\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(showElement) : null\n                }).then(src_util_noop);\n            };\n            var hide = function() {\n                return hideOverride ? hideOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !1\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(hideElement) : null\n                }).then(src_util_noop);\n            };\n            var getUrl = function() {\n                return \"function\" == typeof url ? url({\n                    props: props\n                }) : url;\n            };\n            var getAttributes = function() {\n                return \"function\" == typeof attributes ? attributes({\n                    props: props\n                }) : attributes;\n            };\n            var getInitialChildDomain = function() {\n                return utils_getDomainFromUrl(getUrl());\n            };\n            var openFrame = function(context, _ref2) {\n                var windowName = _ref2.windowName;\n                return openFrameOverride ? openFrameOverride(context, {\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: windowName,\n                            title: name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerenderFrame = function(context) {\n                return openPrerenderFrameOverride ? openPrerenderFrameOverride(context) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: \"__zoid_prerender_frame__\" + name + \"_\" + uniqueID() + \"__\",\n                            title: \"prerender__\" + name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerender = function(context, proxyWin, proxyPrerenderFrame) {\n                return openPrerenderOverride ? openPrerenderOverride(context, proxyWin, proxyPrerenderFrame) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyPrerenderFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyPrerenderFrame.get().then((function(prerenderFrame) {\n                            clean.register((function() {\n                                return destroyElement(prerenderFrame);\n                            }));\n                            return awaitFrameWindow(prerenderFrame).then((function(prerenderFrameWindow) {\n                                return utils_assertSameDomain(prerenderFrameWindow);\n                            })).then((function(win) {\n                                return setup_toProxyWindow(win);\n                            }));\n                        }));\n                    }\n                    if (context === CONTEXT.POPUP) return proxyWin;\n                    throw new Error(\"No render context available for \" + context);\n                }));\n            };\n            var focus = function() {\n                return promise_ZalgoPromise.try((function() {\n                    if (currentProxyWin) return promise_ZalgoPromise.all([ event.trigger(EVENT.FOCUS), currentProxyWin.focus() ]).then(src_util_noop);\n                }));\n            };\n            var getCurrentWindowReferenceUID = function() {\n                var global = lib_global_getGlobal(window);\n                global.windows = global.windows || {};\n                global.windows[uid] = window;\n                clean.register((function() {\n                    delete global.windows[uid];\n                }));\n                return uid;\n            };\n            var getWindowRef = function(target, initialChildDomain, context, proxyWin) {\n                if (initialChildDomain === utils_getDomain(window)) return {\n                    type: \"global\",\n                    uid: getCurrentWindowReferenceUID()\n                };\n                if (target !== window) throw new Error(\"Can not construct cross-domain window reference for different target window\");\n                if (props.window) {\n                    var actualComponentWindow = proxyWin.getWindow();\n                    if (!actualComponentWindow) throw new Error(\"Can not construct cross-domain window reference for lazy window prop\");\n                    if (utils_getAncestor(actualComponentWindow) !== window) throw new Error(\"Can not construct cross-domain window reference for window prop with different ancestor\");\n                }\n                if (context === CONTEXT.POPUP) return {\n                    type: \"opener\"\n                };\n                if (context === CONTEXT.IFRAME) return {\n                    type: \"parent\",\n                    distance: utils_getDistanceFromTop(window)\n                };\n                throw new Error(\"Can not construct window reference for child\");\n            };\n            var initChild = function(childDomain, childExports) {\n                return promise_ZalgoPromise.try((function() {\n                    currentChildDomain = childDomain;\n                    childComponent = childExports;\n                    resolveInitPromise();\n                    clean.register((function() {\n                        return childExports.close.fireAndForget().catch(src_util_noop);\n                    }));\n                }));\n            };\n            var resize = function(_ref3) {\n                var width = _ref3.width, height = _ref3.height;\n                return promise_ZalgoPromise.try((function() {\n                    event.trigger(EVENT.RESIZE, {\n                        width: width,\n                        height: height\n                    });\n                }));\n            };\n            var destroy = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return event.trigger(EVENT.DESTROY);\n                })).catch(src_util_noop).then((function() {\n                    return clean.all(err);\n                })).then((function() {\n                    initPromise.asyncReject(err || new Error(\"Component destroyed\"));\n                }));\n            };\n            var close = memoize((function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    if (closeOverride) {\n                        if (utils_isWindowClosed(closeOverride.__source__)) return;\n                        return closeOverride();\n                    }\n                    return promise_ZalgoPromise.try((function() {\n                        return event.trigger(EVENT.CLOSE);\n                    })).then((function() {\n                        return destroy(err || new Error(\"Component closed\"));\n                    }));\n                }));\n            }));\n            var open = function(context, _ref4) {\n                var proxyWin = _ref4.proxyWin, proxyFrame = _ref4.proxyFrame, windowName = _ref4.windowName;\n                return openOverride ? openOverride(context, {\n                    proxyWin: proxyWin,\n                    proxyFrame: proxyFrame,\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyFrame.get().then((function(frame) {\n                            return awaitFrameWindow(frame).then((function(win) {\n                                clean.register((function() {\n                                    return destroyElement(frame);\n                                }));\n                                clean.register((function() {\n                                    return cleanUpWindow(win);\n                                }));\n                                return win;\n                            }));\n                        }));\n                    }\n                    if (context === CONTEXT.POPUP) {\n                        var _getDimensions = getDimensions(), _getDimensions$width = _getDimensions.width, width = void 0 === _getDimensions$width ? \"300px\" : _getDimensions$width, _getDimensions$height = _getDimensions.height, height = void 0 === _getDimensions$height ? \"150px\" : _getDimensions$height;\n                        width = normalizeDimension(width, window.outerWidth);\n                        height = normalizeDimension(height, window.outerWidth);\n                        var win = function(url, options) {\n                            var _options$closeOnUnloa = (options = options || {}).closeOnUnload, closeOnUnload = void 0 === _options$closeOnUnloa ? 1 : _options$closeOnUnloa, _options$name = options.name, name = void 0 === _options$name ? \"\" : _options$name, width = options.width, height = options.height;\n                            var top = 0;\n                            var left = 0;\n                            width && (window.outerWidth ? left = Math.round((window.outerWidth - width) / 2) + window.screenX : window.screen.width && (left = Math.round((window.screen.width - width) / 2)));\n                            height && (window.outerHeight ? top = Math.round((window.outerHeight - height) / 2) + window.screenY : window.screen.height && (top = Math.round((window.screen.height - height) / 2)));\n                            delete options.closeOnUnload;\n                            delete options.name;\n                            width && height && (options = _extends({\n                                top: top,\n                                left: left,\n                                width: width,\n                                height: height,\n                                status: 1,\n                                toolbar: 0,\n                                menubar: 0,\n                                resizable: 1,\n                                scrollbars: 1\n                            }, options));\n                            var params = Object.keys(options).map((function(key) {\n                                if (null != options[key]) return key + \"=\" + stringify(options[key]);\n                            })).filter(Boolean).join(\",\");\n                            var win;\n                            try {\n                                win = window.open(\"\", name, params);\n                            } catch (err) {\n                                throw new dom_PopupOpenError(\"Can not open popup window - \" + (err.stack || err.message));\n                            }\n                            if (isWindowClosed(win)) {\n                                var err;\n                                throw new dom_PopupOpenError(\"Can not open popup window - blocked\");\n                            }\n                            closeOnUnload && window.addEventListener(\"unload\", (function() {\n                                return win.close();\n                            }));\n                            return win;\n                        }(0, _extends({\n                            name: windowName,\n                            width: width,\n                            height: height\n                        }, getAttributes().popup));\n                        clean.register((function() {\n                            return function(win) {\n                                if (function(win) {\n                                    void 0 === win && (win = window);\n                                    return Boolean(src_utils_getParent(win));\n                                }(win)) {\n                                    var frame = function(win) {\n                                        if (utils_isSameDomain(win)) return utils_assertSameDomain(win).frameElement;\n                                        for (var _i21 = 0, _document$querySelect2 = document.querySelectorAll(\"iframe\"); _i21 < _document$querySelect2.length; _i21++) {\n                                            var frame = _document$querySelect2[_i21];\n                                            if (frame && frame.contentWindow && frame.contentWindow === win) return frame;\n                                        }\n                                    }(win);\n                                    if (frame && frame.parentElement) {\n                                        frame.parentElement.removeChild(frame);\n                                        return;\n                                    }\n                                }\n                                try {\n                                    win.close();\n                                } catch (err) {}\n                            }(win);\n                        }));\n                        clean.register((function() {\n                            return cleanUpWindow(win);\n                        }));\n                        return win;\n                    }\n                    throw new Error(\"No render context available for \" + context);\n                })).then((function(win) {\n                    proxyWin.setWindow(win, {\n                        send: send_send\n                    });\n                    return proxyWin.setName(windowName).then((function() {\n                        return proxyWin;\n                    }));\n                }));\n            };\n            var watchForUnload = function() {\n                return promise_ZalgoPromise.try((function() {\n                    var unloadWindowListener = addEventListener(window, \"unload\", once((function() {\n                        destroy(new Error(\"Window navigated away\"));\n                    })));\n                    var closeParentWindowListener = utils_onCloseWindow(parentWin, destroy, 3e3);\n                    clean.register(closeParentWindowListener.cancel);\n                    clean.register(unloadWindowListener.cancel);\n                    if (watchForUnloadOverride) return watchForUnloadOverride();\n                }));\n            };\n            var checkWindowClose = function(proxyWin) {\n                var closed = !1;\n                return proxyWin.isClosed().then((function(isClosed) {\n                    if (isClosed) {\n                        closed = !0;\n                        return close(new Error(\"Detected component window close\"));\n                    }\n                    return promise_ZalgoPromise.delay(200).then((function() {\n                        return proxyWin.isClosed();\n                    })).then((function(secondIsClosed) {\n                        if (secondIsClosed) {\n                            closed = !0;\n                            return close(new Error(\"Detected component window close\"));\n                        }\n                    }));\n                })).then((function() {\n                    return closed;\n                }));\n            };\n            var onError = function(err) {\n                return onErrorOverride ? onErrorOverride(err) : promise_ZalgoPromise.try((function() {\n                    if (-1 === handledErrors.indexOf(err)) {\n                        handledErrors.push(err);\n                        initPromise.asyncReject(err);\n                        return event.trigger(EVENT.ERROR, err);\n                    }\n                }));\n            };\n            var exportsPromise = new promise_ZalgoPromise;\n            var xport = function(actualExports) {\n                return promise_ZalgoPromise.try((function() {\n                    exportsPromise.resolve(actualExports);\n                }));\n            };\n            initChild.onError = onError;\n            var renderTemplate = function(renderer, _ref8) {\n                return renderer({\n                    uid: uid,\n                    container: _ref8.container,\n                    context: _ref8.context,\n                    doc: _ref8.doc,\n                    frame: _ref8.frame,\n                    prerenderFrame: _ref8.prerenderFrame,\n                    focus: focus,\n                    close: close,\n                    state: state,\n                    props: props,\n                    tag: tag,\n                    dimensions: getDimensions(),\n                    event: event\n                });\n            };\n            var prerender = function(proxyPrerenderWin, _ref9) {\n                var context = _ref9.context;\n                return prerenderOverride ? prerenderOverride(proxyPrerenderWin, {\n                    context: context\n                }) : promise_ZalgoPromise.try((function() {\n                    if (prerenderTemplate) {\n                        var prerenderWindow = proxyPrerenderWin.getWindow();\n                        if (prerenderWindow && utils_isSameDomain(prerenderWindow) && function(win) {\n                            try {\n                                if (!win.location.href) return !0;\n                                if (\"about:blank\" === win.location.href) return !0;\n                            } catch (err) {}\n                            return !1;\n                        }(prerenderWindow)) {\n                            var doc = (prerenderWindow = utils_assertSameDomain(prerenderWindow)).document;\n                            var el = renderTemplate(prerenderTemplate, {\n                                context: context,\n                                doc: doc\n                            });\n                            if (el) {\n                                if (el.ownerDocument !== doc) throw new Error(\"Expected prerender template to have been created with document from child window\");\n                                !function(win, el) {\n                                    var tag = el.tagName.toLowerCase();\n                                    if (\"html\" !== tag) throw new Error(\"Expected element to be html, got \" + tag);\n                                    var documentElement = win.document.documentElement;\n                                    for (var _i6 = 0, _arrayFrom2 = arrayFrom(documentElement.children); _i6 < _arrayFrom2.length; _i6++) documentElement.removeChild(_arrayFrom2[_i6]);\n                                    for (var _i8 = 0, _arrayFrom4 = arrayFrom(el.children); _i8 < _arrayFrom4.length; _i8++) documentElement.appendChild(_arrayFrom4[_i8]);\n                                }(prerenderWindow, el);\n                                var _autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, _autoResize$element = autoResize.element, element = void 0 === _autoResize$element ? \"body\" : _autoResize$element;\n                                if ((element = getElementSafe(element, doc)) && (width || height)) {\n                                    var prerenderResizeListener = onResize(element, (function(_ref10) {\n                                        resize({\n                                            width: width ? _ref10.width : void 0,\n                                            height: height ? _ref10.height : void 0\n                                        });\n                                    }), {\n                                        width: width,\n                                        height: height,\n                                        win: prerenderWindow\n                                    });\n                                    event.on(EVENT.RENDERED, prerenderResizeListener.cancel);\n                                }\n                            }\n                        }\n                    }\n                }));\n            };\n            var renderContainer = function(proxyContainer, _ref11) {\n                var proxyFrame = _ref11.proxyFrame, proxyPrerenderFrame = _ref11.proxyPrerenderFrame, context = _ref11.context, rerender = _ref11.rerender;\n                return renderContainerOverride ? renderContainerOverride(proxyContainer, {\n                    proxyFrame: proxyFrame,\n                    proxyPrerenderFrame: proxyPrerenderFrame,\n                    context: context,\n                    rerender: rerender\n                }) : promise_ZalgoPromise.hash({\n                    container: proxyContainer.get(),\n                    frame: proxyFrame ? proxyFrame.get() : null,\n                    prerenderFrame: proxyPrerenderFrame ? proxyPrerenderFrame.get() : null,\n                    internalState: getInternalState()\n                }).then((function(_ref12) {\n                    var container = _ref12.container, visible = _ref12.internalState.visible;\n                    var innerContainer = renderTemplate(containerTemplate, {\n                        context: context,\n                        container: container,\n                        frame: _ref12.frame,\n                        prerenderFrame: _ref12.prerenderFrame,\n                        doc: document\n                    });\n                    if (innerContainer) {\n                        visible || hideElement(innerContainer);\n                        appendChild(container, innerContainer);\n                        var containerWatcher = function(element, handler) {\n                            handler = once(handler);\n                            var cancelled = !1;\n                            var mutationObservers = [];\n                            var interval;\n                            var sacrificialFrame;\n                            var sacrificialFrameWin;\n                            var cancel = function() {\n                                cancelled = !0;\n                                for (var _i18 = 0; _i18 < mutationObservers.length; _i18++) mutationObservers[_i18].disconnect();\n                                interval && interval.cancel();\n                                sacrificialFrameWin && sacrificialFrameWin.removeEventListener(\"unload\", elementClosed);\n                                sacrificialFrame && destroyElement(sacrificialFrame);\n                            };\n                            var elementClosed = function() {\n                                if (!cancelled) {\n                                    handler();\n                                    cancel();\n                                }\n                            };\n                            if (isElementClosed(element)) {\n                                elementClosed();\n                                return {\n                                    cancel: cancel\n                                };\n                            }\n                            if (window.MutationObserver) {\n                                var mutationElement = element.parentElement;\n                                for (;mutationElement; ) {\n                                    var mutationObserver = new window.MutationObserver((function() {\n                                        isElementClosed(element) && elementClosed();\n                                    }));\n                                    mutationObserver.observe(mutationElement, {\n                                        childList: !0\n                                    });\n                                    mutationObservers.push(mutationObserver);\n                                    mutationElement = mutationElement.parentElement;\n                                }\n                            }\n                            (sacrificialFrame = document.createElement(\"iframe\")).setAttribute(\"name\", \"__detect_close_\" + uniqueID() + \"__\");\n                            sacrificialFrame.style.display = \"none\";\n                            awaitFrameWindow(sacrificialFrame).then((function(frameWin) {\n                                (sacrificialFrameWin = assertSameDomain(frameWin)).addEventListener(\"unload\", elementClosed);\n                            }));\n                            element.appendChild(sacrificialFrame);\n                            interval = safeInterval((function() {\n                                isElementClosed(element) && elementClosed();\n                            }), 1e3);\n                            return {\n                                cancel: cancel\n                            };\n                        }(innerContainer, (function() {\n                            var removeError = new Error(\"Detected container element removed from DOM\");\n                            return promise_ZalgoPromise.delay(1).then((function() {\n                                if (!isElementClosed(innerContainer)) {\n                                    clean.all(removeError);\n                                    return rerender().then(resolveInitPromise, rejectInitPromise);\n                                }\n                                close(removeError);\n                            }));\n                        }));\n                        clean.register((function() {\n                            return containerWatcher.cancel();\n                        }));\n                        clean.register((function() {\n                            return destroyElement(innerContainer);\n                        }));\n                        return currentProxyContainer = getProxyObject(innerContainer);\n                    }\n                }));\n            };\n            var getHelpers = function() {\n                return {\n                    state: state,\n                    event: event,\n                    close: close,\n                    focus: focus,\n                    resize: resize,\n                    onError: onError,\n                    updateProps: updateProps,\n                    show: show,\n                    hide: hide\n                };\n            };\n            var setProps = function(newInputProps) {\n                void 0 === newInputProps && (newInputProps = {});\n                var container = currentContainer;\n                var helpers = getHelpers();\n                extend(inputProps, newInputProps);\n                !function(propsDef, existingProps, inputProps, helpers, container) {\n                    var state = helpers.state, close = helpers.close, focus = helpers.focus, event = helpers.event, onError = helpers.onError;\n                    eachProp(inputProps, propsDef, (function(key, propDef, val) {\n                        var valueDetermined = !1;\n                        var value = val;\n                        Object.defineProperty(existingProps, key, {\n                            configurable: !0,\n                            enumerable: !0,\n                            get: function() {\n                                if (valueDetermined) return value;\n                                valueDetermined = !0;\n                                return function() {\n                                    if (!propDef) return value;\n                                    var alias = propDef.alias;\n                                    alias && !isDefined(val) && isDefined(inputProps[alias]) && (value = inputProps[alias]);\n                                    propDef.value && (value = propDef.value({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    !propDef.default || isDefined(value) || isDefined(inputProps[key]) || (value = propDef.default({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    if (isDefined(value)) {\n                                        if (propDef.type === PROP_TYPE.ARRAY ? !Array.isArray(value) : typeof value !== propDef.type) throw new TypeError(\"Prop is not of type \" + propDef.type + \": \" + key);\n                                    } else if (!1 !== propDef.required && !isDefined(inputProps[key])) throw new Error('Expected prop \"' + key + '\" to be defined');\n                                    isDefined(value) && propDef.decorate && (value = propDef.decorate({\n                                        value: value,\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    return value;\n                                }();\n                            }\n                        });\n                    }));\n                    eachProp(existingProps, propsDef, src_util_noop);\n                }(propsDef, props, inputProps, helpers, container);\n            };\n            var updateProps = function(newProps) {\n                setProps(newProps);\n                return initPromise.then((function() {\n                    var child = childComponent;\n                    var proxyWin = currentProxyWin;\n                    if (child && proxyWin && currentChildDomain) return getPropsForChild(currentChildDomain).then((function(childProps) {\n                        return child.updateProps(childProps).catch((function(err) {\n                            return checkWindowClose(proxyWin).then((function(closed) {\n                                if (!closed) throw err;\n                            }));\n                        }));\n                    }));\n                }));\n            };\n            var getProxyContainer = function(container) {\n                return getProxyContainerOverride ? getProxyContainerOverride(container) : promise_ZalgoPromise.try((function() {\n                    return elementReady(container);\n                })).then((function(containerElement) {\n                    isShadowElement(containerElement) && (containerElement = function insertShadowSlot(element) {\n                        var shadowHost = function(element) {\n                            var shadowRoot = function(element) {\n                                for (;element.parentNode; ) element = element.parentNode;\n                                if (isShadowElement(element)) return element;\n                            }(element);\n                            if (shadowRoot && shadowRoot.host) return shadowRoot.host;\n                        }(element);\n                        if (!shadowHost) throw new Error(\"Element is not in shadow dom\");\n                        var slotName = \"shadow-slot-\" + uniqueID();\n                        var slot = document.createElement(\"slot\");\n                        slot.setAttribute(\"name\", slotName);\n                        element.appendChild(slot);\n                        var slotProvider = document.createElement(\"div\");\n                        slotProvider.setAttribute(\"slot\", slotName);\n                        shadowHost.appendChild(slotProvider);\n                        return isShadowElement(shadowHost) ? insertShadowSlot(slotProvider) : slotProvider;\n                    }(containerElement));\n                    currentContainer = containerElement;\n                    return getProxyObject(containerElement);\n                }));\n            };\n            return {\n                init: function() {\n                    !function() {\n                        event.on(EVENT.RENDER, (function() {\n                            return props.onRender();\n                        }));\n                        event.on(EVENT.DISPLAY, (function() {\n                            return props.onDisplay();\n                        }));\n                        event.on(EVENT.RENDERED, (function() {\n                            return props.onRendered();\n                        }));\n                        event.on(EVENT.CLOSE, (function() {\n                            return props.onClose();\n                        }));\n                        event.on(EVENT.DESTROY, (function() {\n                            return props.onDestroy();\n                        }));\n                        event.on(EVENT.RESIZE, (function() {\n                            return props.onResize();\n                        }));\n                        event.on(EVENT.FOCUS, (function() {\n                            return props.onFocus();\n                        }));\n                        event.on(EVENT.PROPS, (function(newProps) {\n                            return props.onProps(newProps);\n                        }));\n                        event.on(EVENT.ERROR, (function(err) {\n                            return props && props.onError ? props.onError(err) : rejectInitPromise(err).then((function() {\n                                setTimeout((function() {\n                                    throw err;\n                                }), 1);\n                            }));\n                        }));\n                        clean.register(event.reset);\n                    }();\n                },\n                render: function(_ref14) {\n                    var target = _ref14.target, container = _ref14.container, context = _ref14.context, rerender = _ref14.rerender;\n                    return promise_ZalgoPromise.try((function() {\n                        var initialChildDomain = getInitialChildDomain();\n                        var childDomainMatch = domainMatch || getInitialChildDomain();\n                        !function(target, childDomainMatch, container) {\n                            if (target !== window) {\n                                if (!function(win1, win2) {\n                                    var top1 = utils_getTop(win1) || win1;\n                                    var top2 = utils_getTop(win2) || win2;\n                                    try {\n                                        if (top1 && top2) return top1 === top2;\n                                    } catch (err) {}\n                                    var allFrames1 = utils_getAllFramesInWindow(win1);\n                                    var allFrames2 = utils_getAllFramesInWindow(win2);\n                                    if (utils_anyMatch(allFrames1, allFrames2)) return !0;\n                                    var opener1 = utils_getOpener(top1);\n                                    var opener2 = utils_getOpener(top2);\n                                    return opener1 && utils_anyMatch(utils_getAllFramesInWindow(opener1), allFrames2) || opener2 && utils_anyMatch(utils_getAllFramesInWindow(opener2), allFrames1), \n                                    !1;\n                                }(window, target)) throw new Error(\"Can only renderTo an adjacent frame\");\n                                var origin = utils_getDomain();\n                                if (!utils_matchDomain(childDomainMatch, origin) && !utils_isSameDomain(target)) throw new Error(\"Can not render remotely to \" + childDomainMatch.toString() + \" - can only render to \" + origin);\n                                if (container && \"string\" != typeof container) throw new Error(\"Container passed to renderTo must be a string selector, got \" + typeof container + \" }\");\n                            }\n                        }(target, childDomainMatch, container);\n                        var delegatePromise = promise_ZalgoPromise.try((function() {\n                            if (target !== window) return function(context, target) {\n                                var delegateProps = {};\n                                for (var _i4 = 0, _Object$keys4 = Object.keys(props); _i4 < _Object$keys4.length; _i4++) {\n                                    var propName = _Object$keys4[_i4];\n                                    var propDef = propsDef[propName];\n                                    propDef && propDef.allowDelegate && (delegateProps[propName] = props[propName]);\n                                }\n                                var childOverridesPromise = send_send(target, \"zoid_delegate_\" + name, {\n                                    uid: uid,\n                                    overrides: {\n                                        props: delegateProps,\n                                        event: event,\n                                        close: close,\n                                        onError: onError,\n                                        getInternalState: getInternalState,\n                                        setInternalState: setInternalState,\n                                        resolveInitPromise: resolveInitPromise,\n                                        rejectInitPromise: rejectInitPromise\n                                    }\n                                }).then((function(_ref13) {\n                                    var parentComp = _ref13.data.parent;\n                                    clean.register((function(err) {\n                                        if (!utils_isWindowClosed(target)) return parentComp.destroy(err);\n                                    }));\n                                    return parentComp.getDelegateOverrides();\n                                })).catch((function(err) {\n                                    throw new Error(\"Unable to delegate rendering. Possibly the component is not loaded in the target window.\\n\\n\" + stringifyError(err));\n                                }));\n                                getProxyContainerOverride = function() {\n                                    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.getProxyContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                renderContainerOverride = function() {\n                                    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.renderContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                showOverride = function() {\n                                    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.show.apply(childOverrides, args);\n                                    }));\n                                };\n                                hideOverride = function() {\n                                    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.hide.apply(childOverrides, args);\n                                    }));\n                                };\n                                watchForUnloadOverride = function() {\n                                    for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) args[_key5] = arguments[_key5];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.watchForUnload.apply(childOverrides, args);\n                                    }));\n                                };\n                                if (context === CONTEXT.IFRAME) {\n                                    getProxyWindowOverride = function() {\n                                        for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) args[_key6] = arguments[_key6];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.getProxyWindow.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openFrameOverride = function() {\n                                        for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) args[_key7] = arguments[_key7];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderFrameOverride = function() {\n                                        for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) args[_key8] = arguments[_key8];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerenderFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    prerenderOverride = function() {\n                                        for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) args[_key9] = arguments[_key9];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.prerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openOverride = function() {\n                                        for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) args[_key10] = arguments[_key10];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.open.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderOverride = function() {\n                                        for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) args[_key11] = arguments[_key11];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                } else context === CONTEXT.POPUP && (setProxyWinOverride = function() {\n                                    for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) args[_key12] = arguments[_key12];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.setProxyWin.apply(childOverrides, args);\n                                    }));\n                                });\n                                return childOverridesPromise;\n                            }(context, target);\n                        }));\n                        var windowProp = props.window;\n                        var watchForUnloadPromise = watchForUnload();\n                        var buildBodyPromise = serializeProps(propsDef, props, \"post\");\n                        var onRenderPromise = event.trigger(EVENT.RENDER);\n                        var getProxyContainerPromise = getProxyContainer(container);\n                        var getProxyWindowPromise = getProxyWindow();\n                        var finalSetPropsPromise = getProxyContainerPromise.then((function() {\n                            return setProps();\n                        }));\n                        var buildUrlPromise = finalSetPropsPromise.then((function() {\n                            return serializeProps(propsDef, props, \"get\").then((function(query) {\n                                return function(url, options) {\n                                    var query = options.query || {};\n                                    var hash = options.hash || {};\n                                    var originalUrl;\n                                    var originalHash;\n                                    var _url$split = url.split(\"#\");\n                                    originalHash = _url$split[1];\n                                    var _originalUrl$split = (originalUrl = _url$split[0]).split(\"?\");\n                                    originalUrl = _originalUrl$split[0];\n                                    var queryString = extendQuery(_originalUrl$split[1], query);\n                                    var hashString = extendQuery(originalHash, hash);\n                                    queryString && (originalUrl = originalUrl + \"?\" + queryString);\n                                    hashString && (originalUrl = originalUrl + \"#\" + hashString);\n                                    return originalUrl;\n                                }(utils_normalizeMockUrl(getUrl()), {\n                                    query: query\n                                });\n                            }));\n                        }));\n                        var buildWindowNamePromise = getProxyWindowPromise.then((function(proxyWin) {\n                            return function(_temp2) {\n                                var _ref6 = void 0 === _temp2 ? {} : _temp2, proxyWin = _ref6.proxyWin, initialChildDomain = _ref6.initialChildDomain, childDomainMatch = _ref6.childDomainMatch, _ref6$target = _ref6.target, target = void 0 === _ref6$target ? window : _ref6$target, context = _ref6.context;\n                                return function(_temp) {\n                                    var _ref5 = void 0 === _temp ? {} : _temp, proxyWin = _ref5.proxyWin, childDomainMatch = _ref5.childDomainMatch, context = _ref5.context;\n                                    return getPropsForChild(_ref5.initialChildDomain).then((function(childProps) {\n                                        return {\n                                            uid: uid,\n                                            context: context,\n                                            tag: tag,\n                                            childDomainMatch: childDomainMatch,\n                                            version: \"9_0_87\",\n                                            props: childProps,\n                                            exports: (win = proxyWin, {\n                                                init: function(childExports) {\n                                                    return initChild(this.origin, childExports);\n                                                },\n                                                close: close,\n                                                checkClose: function() {\n                                                    return checkWindowClose(win);\n                                                },\n                                                resize: resize,\n                                                onError: onError,\n                                                show: show,\n                                                hide: hide,\n                                                export: xport\n                                            })\n                                        };\n                                        var win;\n                                    }));\n                                }({\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    context: context\n                                }).then((function(childPayload) {\n                                    var _crossDomainSerialize = crossDomainSerialize({\n                                        data: childPayload,\n                                        metaData: {\n                                            windowRef: getWindowRef(target, initialChildDomain, context, proxyWin)\n                                        },\n                                        sender: {\n                                            domain: utils_getDomain(window)\n                                        },\n                                        receiver: {\n                                            win: proxyWin,\n                                            domain: childDomainMatch\n                                        },\n                                        passByReference: initialChildDomain === utils_getDomain()\n                                    }), serializedData = _crossDomainSerialize.serializedData;\n                                    clean.register(_crossDomainSerialize.cleanReference);\n                                    return serializedData;\n                                }));\n                            }({\n                                proxyWin: (_ref7 = {\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    target: target,\n                                    context: context\n                                }).proxyWin,\n                                initialChildDomain: _ref7.initialChildDomain,\n                                childDomainMatch: _ref7.childDomainMatch,\n                                target: _ref7.target,\n                                context: _ref7.context\n                            }).then((function(serializedPayload) {\n                                return buildChildWindowName({\n                                    name: name,\n                                    serializedPayload: serializedPayload\n                                });\n                            }));\n                            var _ref7;\n                        }));\n                        var openFramePromise = buildWindowNamePromise.then((function(windowName) {\n                            return openFrame(context, {\n                                windowName: windowName\n                            });\n                        }));\n                        var openPrerenderFramePromise = openPrerenderFrame(context);\n                        var renderContainerPromise = promise_ZalgoPromise.hash({\n                            proxyContainer: getProxyContainerPromise,\n                            proxyFrame: openFramePromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref15) {\n                            return renderContainer(_ref15.proxyContainer, {\n                                context: context,\n                                proxyFrame: _ref15.proxyFrame,\n                                proxyPrerenderFrame: _ref15.proxyPrerenderFrame,\n                                rerender: rerender\n                            });\n                        })).then((function(proxyContainer) {\n                            return proxyContainer;\n                        }));\n                        var openPromise = promise_ZalgoPromise.hash({\n                            windowName: buildWindowNamePromise,\n                            proxyFrame: openFramePromise,\n                            proxyWin: getProxyWindowPromise\n                        }).then((function(_ref16) {\n                            var proxyWin = _ref16.proxyWin;\n                            return windowProp ? proxyWin : open(context, {\n                                windowName: _ref16.windowName,\n                                proxyWin: proxyWin,\n                                proxyFrame: _ref16.proxyFrame\n                            });\n                        }));\n                        var openPrerenderPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref17) {\n                            return openPrerender(context, _ref17.proxyWin, _ref17.proxyPrerenderFrame);\n                        }));\n                        var setStatePromise = openPromise.then((function(proxyWin) {\n                            currentProxyWin = proxyWin;\n                            return setProxyWin(proxyWin);\n                        }));\n                        var prerenderPromise = promise_ZalgoPromise.hash({\n                            proxyPrerenderWin: openPrerenderPromise,\n                            state: setStatePromise\n                        }).then((function(_ref18) {\n                            return prerender(_ref18.proxyPrerenderWin, {\n                                context: context\n                            });\n                        }));\n                        var setWindowNamePromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowName: buildWindowNamePromise\n                        }).then((function(_ref19) {\n                            if (windowProp) return _ref19.proxyWin.setName(_ref19.windowName);\n                        }));\n                        var getMethodPromise = promise_ZalgoPromise.hash({\n                            body: buildBodyPromise\n                        }).then((function(_ref20) {\n                            return options.method ? options.method : Object.keys(_ref20.body).length ? \"post\" : \"get\";\n                        }));\n                        var loadUrlPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowUrl: buildUrlPromise,\n                            body: buildBodyPromise,\n                            method: getMethodPromise,\n                            windowName: setWindowNamePromise,\n                            prerender: prerenderPromise\n                        }).then((function(_ref21) {\n                            return _ref21.proxyWin.setLocation(_ref21.windowUrl, {\n                                method: _ref21.method,\n                                body: _ref21.body\n                            });\n                        }));\n                        var watchForClosePromise = openPromise.then((function(proxyWin) {\n                            !function watchForClose(proxyWin, context) {\n                                var cancelled = !1;\n                                clean.register((function() {\n                                    cancelled = !0;\n                                }));\n                                return promise_ZalgoPromise.delay(2e3).then((function() {\n                                    return proxyWin.isClosed();\n                                })).then((function(isClosed) {\n                                    if (!cancelled) return isClosed ? close(new Error(\"Detected \" + context + \" close\")) : watchForClose(proxyWin, context);\n                                }));\n                            }(proxyWin, context);\n                        }));\n                        var onDisplayPromise = promise_ZalgoPromise.hash({\n                            container: renderContainerPromise,\n                            prerender: prerenderPromise\n                        }).then((function() {\n                            return event.trigger(EVENT.DISPLAY);\n                        }));\n                        var openBridgePromise = openPromise.then((function(proxyWin) {\n                            return function(proxyWin, initialChildDomain, context) {\n                                return promise_ZalgoPromise.try((function() {\n                                    return proxyWin.awaitWindow();\n                                })).then((function(win) {\n                                    if (src_bridge && src_bridge.needsBridge({\n                                        win: win,\n                                        domain: initialChildDomain\n                                    }) && !src_bridge.hasBridge(initialChildDomain, initialChildDomain)) {\n                                        var bridgeUrl = \"function\" == typeof options.bridgeUrl ? options.bridgeUrl({\n                                            props: props\n                                        }) : options.bridgeUrl;\n                                        if (!bridgeUrl) throw new Error(\"Bridge needed to render \" + context);\n                                        var bridgeDomain = utils_getDomainFromUrl(bridgeUrl);\n                                        src_bridge.linkUrl(win, initialChildDomain);\n                                        return src_bridge.openBridge(utils_normalizeMockUrl(bridgeUrl), bridgeDomain);\n                                    }\n                                }));\n                            }(proxyWin, initialChildDomain, context);\n                        }));\n                        var runTimeoutPromise = loadUrlPromise.then((function() {\n                            return promise_ZalgoPromise.try((function() {\n                                var timeout = props.timeout;\n                                if (timeout) return initPromise.timeout(timeout, new Error(\"Loading component timed out after \" + timeout + \" milliseconds\"));\n                            }));\n                        }));\n                        var onRenderedPromise = initPromise.then((function() {\n                            return event.trigger(EVENT.RENDERED);\n                        }));\n                        return promise_ZalgoPromise.hash({\n                            initPromise: initPromise,\n                            buildUrlPromise: buildUrlPromise,\n                            onRenderPromise: onRenderPromise,\n                            getProxyContainerPromise: getProxyContainerPromise,\n                            openFramePromise: openFramePromise,\n                            openPrerenderFramePromise: openPrerenderFramePromise,\n                            renderContainerPromise: renderContainerPromise,\n                            openPromise: openPromise,\n                            openPrerenderPromise: openPrerenderPromise,\n                            setStatePromise: setStatePromise,\n                            prerenderPromise: prerenderPromise,\n                            loadUrlPromise: loadUrlPromise,\n                            buildWindowNamePromise: buildWindowNamePromise,\n                            setWindowNamePromise: setWindowNamePromise,\n                            watchForClosePromise: watchForClosePromise,\n                            onDisplayPromise: onDisplayPromise,\n                            openBridgePromise: openBridgePromise,\n                            runTimeoutPromise: runTimeoutPromise,\n                            onRenderedPromise: onRenderedPromise,\n                            delegatePromise: delegatePromise,\n                            watchForUnloadPromise: watchForUnloadPromise,\n                            finalSetPropsPromise: finalSetPropsPromise\n                        });\n                    })).catch((function(err) {\n                        return promise_ZalgoPromise.all([ onError(err), destroy(err) ]).then((function() {\n                            throw err;\n                        }), (function() {\n                            throw err;\n                        }));\n                    })).then(src_util_noop);\n                },\n                destroy: destroy,\n                getProps: function() {\n                    return props;\n                },\n                setProps: setProps,\n                export: xport,\n                getHelpers: getHelpers,\n                getDelegateOverrides: function() {\n                    return promise_ZalgoPromise.try((function() {\n                        return {\n                            getProxyContainer: getProxyContainer,\n                            show: show,\n                            hide: hide,\n                            renderContainer: renderContainer,\n                            getProxyWindow: getProxyWindow,\n                            watchForUnload: watchForUnload,\n                            openFrame: openFrame,\n                            openPrerenderFrame: openPrerenderFrame,\n                            prerender: prerender,\n                            open: open,\n                            openPrerender: openPrerender,\n                            setProxyWin: setProxyWin\n                        };\n                    }));\n                },\n                getExports: function() {\n                    return xports({\n                        getExports: function() {\n                            return exportsPromise;\n                        }\n                    });\n                }\n            };\n        }\n        var react = {\n            register: function(tag, propsDef, init, _ref) {\n                var React = _ref.React, ReactDOM = _ref.ReactDOM;\n                return function(_React$Component) {\n                    _inheritsLoose(_class, _React$Component);\n                    function _class() {\n                        return _React$Component.apply(this, arguments) || this;\n                    }\n                    var _proto = _class.prototype;\n                    _proto.render = function() {\n                        return React.createElement(\"div\", null);\n                    };\n                    _proto.componentDidMount = function() {\n                        var el = ReactDOM.findDOMNode(this);\n                        var parent = init(extend({}, this.props));\n                        parent.render(el, CONTEXT.IFRAME);\n                        this.setState({\n                            parent: parent\n                        });\n                    };\n                    _proto.componentDidUpdate = function() {\n                        this.state && this.state.parent && this.state.parent.updateProps(extend({}, this.props)).catch(src_util_noop);\n                    };\n                    return _class;\n                }(React.Component);\n            }\n        };\n        var vue = {\n            register: function(tag, propsDef, init, Vue) {\n                return Vue.component(tag, {\n                    render: function(createElement) {\n                        return createElement(\"div\");\n                    },\n                    inheritAttrs: !1,\n                    mounted: function() {\n                        var el = this.$el;\n                        this.parent = init(_extends({}, (props = this.$attrs, Object.keys(props).reduce((function(acc, key) {\n                            var value = props[key];\n                            if (\"style-object\" === key || \"styleObject\" === key) {\n                                acc.style = value;\n                                acc.styleObject = value;\n                            } else key.includes(\"-\") ? acc[dasherizeToCamel(key)] = value : acc[key] = value;\n                            return acc;\n                        }), {}))));\n                        var props;\n                        this.parent.render(el, CONTEXT.IFRAME);\n                    },\n                    watch: {\n                        $attrs: {\n                            handler: function() {\n                                this.parent && this.$attrs && this.parent.updateProps(_extends({}, this.$attrs)).catch(src_util_noop);\n                            },\n                            deep: !0\n                        }\n                    }\n                });\n            }\n        };\n        var vue3 = {\n            register: function(tag, propsDef, init) {\n                return {\n                    template: \"<div></div>\",\n                    inheritAttrs: !1,\n                    mounted: function() {\n                        var el = this.$el;\n                        this.parent = init(_extends({}, (props = this.$attrs, Object.keys(props).reduce((function(acc, key) {\n                            var value = props[key];\n                            if (\"style-object\" === key || \"styleObject\" === key) {\n                                acc.style = value;\n                                acc.styleObject = value;\n                            } else key.includes(\"-\") ? acc[dasherizeToCamel(key)] = value : acc[key] = value;\n                            return acc;\n                        }), {}))));\n                        var props;\n                        this.parent.render(el, CONTEXT.IFRAME);\n                    },\n                    watch: {\n                        $attrs: {\n                            handler: function() {\n                                this.parent && this.$attrs && this.parent.updateProps(_extends({}, this.$attrs)).catch(src_util_noop);\n                            },\n                            deep: !0\n                        }\n                    }\n                };\n            }\n        };\n        var angular = {\n            register: function(tag, propsDef, init, ng) {\n                return ng.module(tag, []).directive(dasherizeToCamel(tag), (function() {\n                    var scope = {};\n                    for (var _i2 = 0, _Object$keys2 = Object.keys(propsDef); _i2 < _Object$keys2.length; _i2++) scope[_Object$keys2[_i2]] = \"=\";\n                    scope.props = \"=\";\n                    return {\n                        scope: scope,\n                        restrict: \"E\",\n                        controller: [ \"$scope\", \"$element\", function($scope, $element) {\n                            function safeApply() {\n                                if (\"$apply\" !== $scope.$root.$$phase && \"$digest\" !== $scope.$root.$$phase) try {\n                                    $scope.$apply();\n                                } catch (err) {}\n                            }\n                            var getProps = function() {\n                                return replaceObject($scope.props, (function(item) {\n                                    return \"function\" == typeof item ? function() {\n                                        var result = item.apply(this, arguments);\n                                        safeApply();\n                                        return result;\n                                    } : item;\n                                }));\n                            };\n                            var instance = init(getProps());\n                            instance.render($element[0], CONTEXT.IFRAME);\n                            $scope.$watch((function() {\n                                instance.updateProps(getProps()).catch(src_util_noop);\n                            }));\n                        } ]\n                    };\n                }));\n            }\n        };\n        var angular2 = {\n            register: function(tag, propsDef, init, _ref) {\n                var AngularComponent = _ref.Component, NgModule = _ref.NgModule, ElementRef = _ref.ElementRef, NgZone = _ref.NgZone, Inject = _ref.Inject;\n                var ComponentInstance = function() {\n                    function ComponentInstance(elementRef, zone) {\n                        this.elementRef = void 0;\n                        this.internalProps = void 0;\n                        this.parent = void 0;\n                        this.props = void 0;\n                        this.zone = void 0;\n                        this._props = void 0;\n                        this._props = {};\n                        this.elementRef = elementRef;\n                        this.zone = zone;\n                    }\n                    var _proto = ComponentInstance.prototype;\n                    _proto.getProps = function() {\n                        var _this = this;\n                        return replaceObject(_extends({}, this.internalProps, this.props), (function(item) {\n                            if (\"function\" == typeof item) {\n                                var zone = _this.zone;\n                                return function() {\n                                    var _arguments = arguments, _this2 = this;\n                                    return zone.run((function() {\n                                        return item.apply(_this2, _arguments);\n                                    }));\n                                };\n                            }\n                            return item;\n                        }));\n                    };\n                    _proto.ngOnInit = function() {\n                        var targetElement = this.elementRef.nativeElement;\n                        this.parent = init(this.getProps());\n                        this.parent.render(targetElement, CONTEXT.IFRAME);\n                    };\n                    _proto.ngDoCheck = function() {\n                        if (this.parent && !function(obj1, obj2) {\n                            var checked = {};\n                            for (var key in obj1) if (obj1.hasOwnProperty(key)) {\n                                checked[key] = !0;\n                                if (obj1[key] !== obj2[key]) return !1;\n                            }\n                            for (var _key in obj2) if (!checked[_key]) return !1;\n                            return !0;\n                        }(this._props, this.props)) {\n                            this._props = _extends({}, this.props);\n                            this.parent.updateProps(this.getProps());\n                        }\n                    };\n                    return ComponentInstance;\n                }();\n                ComponentInstance.annotations = void 0;\n                ComponentInstance.parameters = void 0;\n                ComponentInstance.parameters = [ [ new Inject(ElementRef) ], [ new Inject(NgZone) ] ];\n                ComponentInstance.annotations = [ new AngularComponent({\n                    selector: tag,\n                    template: \"<div></div>\",\n                    inputs: [ \"props\" ]\n                }) ];\n                var ModuleInstance = function() {};\n                ModuleInstance.annotations = void 0;\n                ModuleInstance.annotations = [ new NgModule({\n                    declarations: [ ComponentInstance ],\n                    exports: [ ComponentInstance ]\n                }) ];\n                return ModuleInstance;\n            }\n        };\n        function defaultContainerTemplate(_ref) {\n            var uid = _ref.uid, frame = _ref.frame, prerenderFrame = _ref.prerenderFrame, doc = _ref.doc, props = _ref.props, event = _ref.event, dimensions = _ref.dimensions;\n            var width = dimensions.width, height = dimensions.height;\n            if (frame && prerenderFrame) {\n                var div = doc.createElement(\"div\");\n                div.setAttribute(\"id\", uid);\n                var style = doc.createElement(\"style\");\n                props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n                style.appendChild(doc.createTextNode(\"\\n            #\" + uid + \" {\\n                display: inline-block;\\n                position: relative;\\n                width: \" + width + \";\\n                height: \" + height + \";\\n            }\\n\\n            #\" + uid + \" > iframe {\\n                display: inline-block;\\n                position: absolute;\\n                width: 100%;\\n                height: 100%;\\n                top: 0;\\n                left: 0;\\n                transition: opacity .2s ease-in-out;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-invisible {\\n                opacity: 0;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-visible {\\n                opacity: 1;\\n        }\\n        \"));\n                div.appendChild(frame);\n                div.appendChild(prerenderFrame);\n                div.appendChild(style);\n                prerenderFrame.classList.add(\"zoid-visible\");\n                frame.classList.add(\"zoid-invisible\");\n                event.on(EVENT.RENDERED, (function() {\n                    prerenderFrame.classList.remove(\"zoid-visible\");\n                    prerenderFrame.classList.add(\"zoid-invisible\");\n                    frame.classList.remove(\"zoid-invisible\");\n                    frame.classList.add(\"zoid-visible\");\n                    setTimeout((function() {\n                        destroyElement(prerenderFrame);\n                    }), 1);\n                }));\n                event.on(EVENT.RESIZE, (function(_ref2) {\n                    var newWidth = _ref2.width, newHeight = _ref2.height;\n                    \"number\" == typeof newWidth && (div.style.width = toCSS(newWidth));\n                    \"number\" == typeof newHeight && (div.style.height = toCSS(newHeight));\n                }));\n                return div;\n            }\n        }\n        function defaultPrerenderTemplate(_ref) {\n            var doc = _ref.doc, props = _ref.props;\n            var html = doc.createElement(\"html\");\n            var body = doc.createElement(\"body\");\n            var style = doc.createElement(\"style\");\n            var spinner = doc.createElement(\"div\");\n            spinner.classList.add(\"spinner\");\n            props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n            html.appendChild(body);\n            body.appendChild(spinner);\n            body.appendChild(style);\n            style.appendChild(doc.createTextNode(\"\\n            html, body {\\n                width: 100%;\\n                height: 100%;\\n            }\\n\\n            .spinner {\\n                position: fixed;\\n                max-height: 60vmin;\\n                max-width: 60vmin;\\n                height: 40px;\\n                width: 40px;\\n                top: 50%;\\n                left: 50%;\\n                box-sizing: border-box;\\n                border: 3px solid rgba(0, 0, 0, .2);\\n                border-top-color: rgba(33, 128, 192, 0.8);\\n                border-radius: 100%;\\n                animation: rotation .7s infinite linear;\\n            }\\n\\n            @keyframes rotation {\\n                from {\\n                    transform: translateX(-50%) translateY(-50%) rotate(0deg);\\n                }\\n                to {\\n                    transform: translateX(-50%) translateY(-50%) rotate(359deg);\\n                }\\n            }\\n        \"));\n            return html;\n        }\n        var cleanInstances = cleanup();\n        var cleanZoid = cleanup();\n        function component(opts) {\n            var options = function(options) {\n                var tag = options.tag, url = options.url, domain = options.domain, bridgeUrl = options.bridgeUrl, _options$props = options.props, props = void 0 === _options$props ? {} : _options$props, _options$dimensions = options.dimensions, dimensions = void 0 === _options$dimensions ? {} : _options$dimensions, _options$autoResize = options.autoResize, autoResize = void 0 === _options$autoResize ? {} : _options$autoResize, _options$allowedParen = options.allowedParentDomains, allowedParentDomains = void 0 === _options$allowedParen ? \"*\" : _options$allowedParen, _options$attributes = options.attributes, attributes = void 0 === _options$attributes ? {} : _options$attributes, _options$defaultConte = options.defaultContext, defaultContext = void 0 === _options$defaultConte ? CONTEXT.IFRAME : _options$defaultConte, _options$containerTem = options.containerTemplate, containerTemplate = void 0 === _options$containerTem ? defaultContainerTemplate : _options$containerTem, _options$prerenderTem = options.prerenderTemplate, prerenderTemplate = void 0 === _options$prerenderTem ? defaultPrerenderTemplate : _options$prerenderTem, validate = options.validate, _options$eligible = options.eligible, eligible = void 0 === _options$eligible ? function() {\n                    return {\n                        eligible: !0\n                    };\n                } : _options$eligible, _options$logger = options.logger, logger = void 0 === _options$logger ? {\n                    info: src_util_noop\n                } : _options$logger, _options$exports = options.exports, xportsDefinition = void 0 === _options$exports ? src_util_noop : _options$exports, method = options.method, _options$children = options.children, children = void 0 === _options$children ? function() {\n                    return {};\n                } : _options$children;\n                var name = tag.replace(/-/g, \"_\");\n                var propsDef = _extends({}, {\n                    window: {\n                        type: PROP_TYPE.OBJECT,\n                        sendToChild: !1,\n                        required: !1,\n                        allowDelegate: !0,\n                        validate: function(_ref2) {\n                            var value = _ref2.value;\n                            if (!utils_isWindow(value) && !window_ProxyWindow.isProxyWindow(value)) throw new Error(\"Expected Window or ProxyWindow\");\n                            if (utils_isWindow(value)) {\n                                if (utils_isWindowClosed(value)) throw new Error(\"Window is closed\");\n                                if (!utils_isSameDomain(value)) throw new Error(\"Window is not same domain\");\n                            }\n                        },\n                        decorate: function(_ref3) {\n                            return setup_toProxyWindow(_ref3.value);\n                        }\n                    },\n                    timeout: {\n                        type: PROP_TYPE.NUMBER,\n                        required: !1,\n                        sendToChild: !1\n                    },\n                    cspNonce: {\n                        type: PROP_TYPE.STRING,\n                        required: !1\n                    },\n                    onDisplay: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRendered: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRender: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onClose: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onDestroy: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onResize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    onFocus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    close: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref4) {\n                            return _ref4.close;\n                        }\n                    },\n                    focus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref5) {\n                            return _ref5.focus;\n                        }\n                    },\n                    resize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref6) {\n                            return _ref6.resize;\n                        }\n                    },\n                    uid: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref7) {\n                            return _ref7.uid;\n                        }\n                    },\n                    tag: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref8) {\n                            return _ref8.tag;\n                        }\n                    },\n                    getParent: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref9) {\n                            return _ref9.getParent;\n                        }\n                    },\n                    getParentDomain: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref10) {\n                            return _ref10.getParentDomain;\n                        }\n                    },\n                    show: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref11) {\n                            return _ref11.show;\n                        }\n                    },\n                    hide: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref12) {\n                            return _ref12.hide;\n                        }\n                    },\n                    export: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref13) {\n                            return _ref13.export;\n                        }\n                    },\n                    onError: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref14) {\n                            return _ref14.onError;\n                        }\n                    },\n                    onProps: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref15) {\n                            return _ref15.onProps;\n                        }\n                    },\n                    getSiblings: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref16) {\n                            return _ref16.getSiblings;\n                        }\n                    }\n                }, props);\n                if (!containerTemplate) throw new Error(\"Container template required\");\n                return {\n                    name: name,\n                    tag: tag,\n                    url: url,\n                    domain: domain,\n                    bridgeUrl: bridgeUrl,\n                    method: method,\n                    propsDef: propsDef,\n                    dimensions: dimensions,\n                    autoResize: autoResize,\n                    allowedParentDomains: allowedParentDomains,\n                    attributes: attributes,\n                    defaultContext: defaultContext,\n                    containerTemplate: containerTemplate,\n                    prerenderTemplate: prerenderTemplate,\n                    validate: validate,\n                    logger: logger,\n                    eligible: eligible,\n                    children: children,\n                    exports: \"function\" == typeof xportsDefinition ? xportsDefinition : function(_ref) {\n                        var getExports = _ref.getExports;\n                        var result = {};\n                        var _loop = function(_i2, _Object$keys2) {\n                            var key = _Object$keys2[_i2];\n                            var type = xportsDefinition[key].type;\n                            var valuePromise = getExports().then((function(res) {\n                                return res[key];\n                            }));\n                            result[key] = type === PROP_TYPE.FUNCTION ? function() {\n                                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                return valuePromise.then((function(value) {\n                                    return value.apply(void 0, args);\n                                }));\n                            } : valuePromise;\n                        };\n                        for (var _i2 = 0, _Object$keys2 = Object.keys(xportsDefinition); _i2 < _Object$keys2.length; _i2++) _loop(_i2, _Object$keys2);\n                        return result;\n                    }\n                };\n            }(opts);\n            var name = options.name, tag = options.tag, defaultContext = options.defaultContext, propsDef = options.propsDef, eligible = options.eligible, children = options.children;\n            var global = lib_global_getGlobal(window);\n            var driverCache = {};\n            var instances = [];\n            var isChild = function() {\n                if (function(name) {\n                    try {\n                        return parseWindowName(window.name).name === name;\n                    } catch (err) {}\n                    return !1;\n                }(name)) {\n                    var _payload = getInitialParentPayload().payload;\n                    if (_payload.tag === tag && utils_matchDomain(_payload.childDomainMatch, utils_getDomain())) return !0;\n                }\n                return !1;\n            };\n            var registerChild = memoize((function() {\n                if (isChild()) {\n                    if (window.xprops) {\n                        delete global.components[tag];\n                        throw new Error(\"Can not register \" + name + \" as child - child already registered\");\n                    }\n                    var child = function(options) {\n                        var tag = options.tag, propsDef = options.propsDef, autoResize = options.autoResize, allowedParentDomains = options.allowedParentDomains;\n                        var onPropHandlers = [];\n                        var _getInitialParentPayl = getInitialParentPayload(), parent = _getInitialParentPayl.parent, payload = _getInitialParentPayl.payload;\n                        var parentComponentWindow = parent.win, parentDomain = parent.domain;\n                        var props;\n                        var exportsPromise = new promise_ZalgoPromise;\n                        var version = payload.version, uid = payload.uid, parentExports = payload.exports, context = payload.context, initialProps = payload.props;\n                        if (\"9_0_87\" !== version) throw new Error(\"Parent window has zoid version \" + version + \", child window has version 9_0_87\");\n                        var show = parentExports.show, hide = parentExports.hide, close = parentExports.close, onError = parentExports.onError, checkClose = parentExports.checkClose, parentExport = parentExports.export, parentResize = parentExports.resize, parentInit = parentExports.init;\n                        var getParent = function() {\n                            return parentComponentWindow;\n                        };\n                        var getParentDomain = function() {\n                            return parentDomain;\n                        };\n                        var onProps = function(handler) {\n                            onPropHandlers.push(handler);\n                            return {\n                                cancel: function() {\n                                    onPropHandlers.splice(onPropHandlers.indexOf(handler), 1);\n                                }\n                            };\n                        };\n                        var resize = function(_ref) {\n                            return parentResize.fireAndForget({\n                                width: _ref.width,\n                                height: _ref.height\n                            });\n                        };\n                        var xport = function(xports) {\n                            exportsPromise.resolve(xports);\n                            return parentExport(xports);\n                        };\n                        var getSiblings = function(_temp) {\n                            var anyParent = (void 0 === _temp ? {} : _temp).anyParent;\n                            var result = [];\n                            var currentParent = props.parent;\n                            void 0 === anyParent && (anyParent = !currentParent);\n                            if (!anyParent && !currentParent) throw new Error(\"No parent found for \" + tag + \" child\");\n                            for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(window); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                var win = _getAllFramesInWindow2[_i2];\n                                if (utils_isSameDomain(win)) {\n                                    var xprops = utils_assertSameDomain(win).xprops;\n                                    if (xprops && getParent() === xprops.getParent()) {\n                                        var winParent = xprops.parent;\n                                        if (anyParent || !currentParent || winParent && winParent.uid === currentParent.uid) {\n                                            var xports = tryGlobal(win, (function(global) {\n                                                return global.exports;\n                                            }));\n                                            result.push({\n                                                props: xprops,\n                                                exports: xports\n                                            });\n                                        }\n                                    }\n                                }\n                            }\n                            return result;\n                        };\n                        var setProps = function(newProps, origin, isUpdate) {\n                            void 0 === isUpdate && (isUpdate = !1);\n                            var normalizedProps = function(parentComponentWindow, propsDef, props, origin, helpers, isUpdate) {\n                                void 0 === isUpdate && (isUpdate = !1);\n                                var result = {};\n                                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                                    var key = _Object$keys2[_i2];\n                                    var prop = propsDef[key];\n                                    if (!prop || !prop.sameDomain || origin === utils_getDomain(window) && utils_isSameDomain(parentComponentWindow)) {\n                                        var value = normalizeChildProp(propsDef, 0, key, props[key], helpers);\n                                        result[key] = value;\n                                        prop && prop.alias && !result[prop.alias] && (result[prop.alias] = value);\n                                    }\n                                }\n                                if (!isUpdate) for (var _i4 = 0, _Object$keys4 = Object.keys(propsDef); _i4 < _Object$keys4.length; _i4++) {\n                                    var _key = _Object$keys4[_i4];\n                                    props.hasOwnProperty(_key) || (result[_key] = normalizeChildProp(propsDef, 0, _key, void 0, helpers));\n                                }\n                                return result;\n                            }(parentComponentWindow, propsDef, newProps, origin, {\n                                tag: tag,\n                                show: show,\n                                hide: hide,\n                                close: close,\n                                focus: child_focus,\n                                onError: onError,\n                                resize: resize,\n                                getSiblings: getSiblings,\n                                onProps: onProps,\n                                getParent: getParent,\n                                getParentDomain: getParentDomain,\n                                uid: uid,\n                                export: xport\n                            }, isUpdate);\n                            props ? extend(props, normalizedProps) : props = normalizedProps;\n                            for (var _i4 = 0; _i4 < onPropHandlers.length; _i4++) (0, onPropHandlers[_i4])(props);\n                        };\n                        var updateProps = function(newProps) {\n                            return promise_ZalgoPromise.try((function() {\n                                return setProps(newProps, parentDomain, !0);\n                            }));\n                        };\n                        return {\n                            init: function() {\n                                return promise_ZalgoPromise.try((function() {\n                                    utils_isSameDomain(parentComponentWindow) && function(_ref3) {\n                                        var componentName = _ref3.componentName, parentComponentWindow = _ref3.parentComponentWindow;\n                                        var _crossDomainDeseriali2 = crossDomainDeserialize({\n                                            data: parseWindowName(window.name).serializedInitialPayload,\n                                            sender: {\n                                                win: parentComponentWindow\n                                            },\n                                            basic: !0\n                                        }), sender = _crossDomainDeseriali2.sender;\n                                        if (\"uid\" === _crossDomainDeseriali2.reference.type || \"global\" === _crossDomainDeseriali2.metaData.windowRef.type) {\n                                            var _crossDomainSerialize = crossDomainSerialize({\n                                                data: _crossDomainDeseriali2.data,\n                                                metaData: {\n                                                    windowRef: window_getWindowRef(parentComponentWindow)\n                                                },\n                                                sender: {\n                                                    domain: sender.domain\n                                                },\n                                                receiver: {\n                                                    win: window,\n                                                    domain: utils_getDomain()\n                                                },\n                                                basic: !0\n                                            });\n                                            window.name = buildChildWindowName({\n                                                name: componentName,\n                                                serializedPayload: _crossDomainSerialize.serializedData\n                                            });\n                                        }\n                                    }({\n                                        componentName: options.name,\n                                        parentComponentWindow: parentComponentWindow\n                                    });\n                                    lib_global_getGlobal(window).exports = options.exports({\n                                        getExports: function() {\n                                            return exportsPromise;\n                                        }\n                                    });\n                                    !function(allowedParentDomains, domain) {\n                                        if (!utils_matchDomain(allowedParentDomains, domain)) throw new Error(\"Can not be rendered by domain: \" + domain);\n                                    }(allowedParentDomains, parentDomain);\n                                    markWindowKnown(parentComponentWindow);\n                                    !function() {\n                                        window.addEventListener(\"beforeunload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        window.addEventListener(\"unload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        utils_onCloseWindow(parentComponentWindow, (function() {\n                                            child_destroy();\n                                        }));\n                                    }();\n                                    return parentInit({\n                                        updateProps: updateProps,\n                                        close: child_destroy\n                                    });\n                                })).then((function() {\n                                    return (_autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, \n                                    _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, \n                                    _autoResize$element = autoResize.element, elementReady(void 0 === _autoResize$element ? \"body\" : _autoResize$element).catch(src_util_noop).then((function(element) {\n                                        return {\n                                            width: width,\n                                            height: height,\n                                            element: element\n                                        };\n                                    }))).then((function(_ref3) {\n                                        var width = _ref3.width, height = _ref3.height, element = _ref3.element;\n                                        element && (width || height) && context !== CONTEXT.POPUP && onResize(element, (function(_ref4) {\n                                            resize({\n                                                width: width ? _ref4.width : void 0,\n                                                height: height ? _ref4.height : void 0\n                                            });\n                                        }), {\n                                            width: width,\n                                            height: height\n                                        });\n                                    }));\n                                    var _autoResize$width, width, _autoResize$height, height, _autoResize$element;\n                                })).catch((function(err) {\n                                    onError(err);\n                                }));\n                            },\n                            getProps: function() {\n                                if (props) return props;\n                                setProps(initialProps, parentDomain);\n                                return props;\n                            }\n                        };\n                    }(options);\n                    child.init();\n                    return child;\n                }\n            }));\n            var init = function init(inputProps) {\n                var instance;\n                var uid = \"zoid-\" + tag + \"-\" + uniqueID();\n                var props = inputProps || {};\n                var _eligible = eligible({\n                    props: props\n                }), eligibility = _eligible.eligible, reason = _eligible.reason;\n                var onDestroy = props.onDestroy;\n                props.onDestroy = function() {\n                    instance && eligibility && instances.splice(instances.indexOf(instance), 1);\n                    if (onDestroy) return onDestroy.apply(void 0, arguments);\n                };\n                var parent = parentComponent({\n                    uid: uid,\n                    options: options\n                });\n                parent.init();\n                eligibility ? parent.setProps(props) : props.onDestroy && props.onDestroy();\n                cleanInstances.register((function(err) {\n                    return parent.destroy(err || new Error(\"zoid destroyed all components\"));\n                }));\n                var clone = function(_temp) {\n                    var _ref4$decorate = (void 0 === _temp ? {} : _temp).decorate;\n                    return init((void 0 === _ref4$decorate ? identity : _ref4$decorate)(props));\n                };\n                var _render = function(target, container, context) {\n                    return promise_ZalgoPromise.try((function() {\n                        if (!eligibility) {\n                            var err = new Error(reason || name + \" component is not eligible\");\n                            return parent.destroy(err).then((function() {\n                                throw err;\n                            }));\n                        }\n                        if (!utils_isWindow(target)) throw new Error(\"Must pass window to renderTo\");\n                        return function(props, context) {\n                            return promise_ZalgoPromise.try((function() {\n                                if (props.window) return setup_toProxyWindow(props.window).getType();\n                                if (context) {\n                                    if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) throw new Error(\"Unrecognized context: \" + context);\n                                    return context;\n                                }\n                                return defaultContext;\n                            }));\n                        }(props, context);\n                    })).then((function(finalContext) {\n                        container = function(context, container) {\n                            if (container) {\n                                if (\"string\" != typeof container && !isElement(container)) throw new TypeError(\"Expected string or element selector to be passed\");\n                                return container;\n                            }\n                            if (context === CONTEXT.POPUP) return \"body\";\n                            throw new Error(\"Expected element to be passed to render iframe\");\n                        }(finalContext, container);\n                        if (target !== window && \"string\" != typeof container) throw new Error(\"Must pass string element when rendering to another window\");\n                        return parent.render({\n                            target: target,\n                            container: container,\n                            context: finalContext,\n                            rerender: function() {\n                                var newInstance = clone();\n                                extend(instance, newInstance);\n                                return newInstance.renderTo(target, container, context);\n                            }\n                        });\n                    })).catch((function(err) {\n                        return parent.destroy(err).then((function() {\n                            throw err;\n                        }));\n                    }));\n                };\n                instance = _extends({}, parent.getExports(), parent.getHelpers(), function() {\n                    var childComponents = children();\n                    var result = {};\n                    var _loop2 = function(_i4, _Object$keys4) {\n                        var childName = _Object$keys4[_i4];\n                        var Child = childComponents[childName];\n                        result[childName] = function(childInputProps) {\n                            var parentProps = parent.getProps();\n                            var childProps = _extends({}, childInputProps, {\n                                parent: {\n                                    uid: uid,\n                                    props: parentProps,\n                                    export: parent.export\n                                }\n                            });\n                            return Child(childProps);\n                        };\n                    };\n                    for (var _i4 = 0, _Object$keys4 = Object.keys(childComponents); _i4 < _Object$keys4.length; _i4++) _loop2(_i4, _Object$keys4);\n                    return result;\n                }(), {\n                    isEligible: function() {\n                        return eligibility;\n                    },\n                    clone: clone,\n                    render: function(container, context) {\n                        return _render(window, container, context);\n                    },\n                    renderTo: function(target, container, context) {\n                        return _render(target, container, context);\n                    }\n                });\n                eligibility && instances.push(instance);\n                return instance;\n            };\n            registerChild();\n            !function() {\n                var allowDelegateListener = on_on(\"zoid_allow_delegate_\" + name, (function() {\n                    return !0;\n                }));\n                var delegateListener = on_on(\"zoid_delegate_\" + name, (function(_ref2) {\n                    var _ref2$data = _ref2.data;\n                    return {\n                        parent: parentComponent({\n                            uid: _ref2$data.uid,\n                            options: options,\n                            overrides: _ref2$data.overrides,\n                            parentWin: _ref2.source\n                        })\n                    };\n                }));\n                cleanZoid.register(allowDelegateListener.cancel);\n                cleanZoid.register(delegateListener.cancel);\n            }();\n            global.components = global.components || {};\n            if (global.components[tag]) throw new Error(\"Can not register multiple components with the same tag: \" + tag);\n            global.components[tag] = !0;\n            return {\n                init: init,\n                instances: instances,\n                driver: function(driverName, dep) {\n                    var drivers = {\n                        react: react,\n                        angular: angular,\n                        vue: vue,\n                        vue3: vue3,\n                        angular2: angular2\n                    };\n                    if (!drivers[driverName]) throw new Error(\"Could not find driver for framework: \" + driverName);\n                    driverCache[driverName] || (driverCache[driverName] = drivers[driverName].register(tag, propsDef, init, dep));\n                    return driverCache[driverName];\n                },\n                isChild: isChild,\n                canRenderTo: function(win) {\n                    return send_send(win, \"zoid_allow_delegate_\" + name).then((function(_ref3) {\n                        return _ref3.data;\n                    })).catch((function() {\n                        return !1;\n                    }));\n                },\n                registerChild: registerChild\n            };\n        }\n        var component_create = function(options) {\n            !function() {\n                if (!global_getGlobal().initialized) {\n                    global_getGlobal().initialized = !0;\n                    on = (_ref3 = {\n                        on: on_on,\n                        send: send_send\n                    }).on, send = _ref3.send, (global = global_getGlobal()).receiveMessage = global.receiveMessage || function(message) {\n                        return receive_receiveMessage(message, {\n                            on: on,\n                            send: send\n                        });\n                    };\n                    !function(_ref5) {\n                        var on = _ref5.on, send = _ref5.send;\n                        globalStore().getOrSet(\"postMessageListener\", (function() {\n                            return addEventListener(window, \"message\", (function(event) {\n                                !function(event, _ref4) {\n                                    var on = _ref4.on, send = _ref4.send;\n                                    promise_ZalgoPromise.try((function() {\n                                        var source = event.source || event.sourceElement;\n                                        var origin = event.origin || event.originalEvent && event.originalEvent.origin;\n                                        var data = event.data;\n                                        \"null\" === origin && (origin = \"file://\");\n                                        if (source) {\n                                            if (!origin) throw new Error(\"Post message did not have origin domain\");\n                                            receive_receiveMessage({\n                                                source: source,\n                                                origin: origin,\n                                                data: data\n                                            }, {\n                                                on: on,\n                                                send: send\n                                            });\n                                        }\n                                    }));\n                                }(event, {\n                                    on: on,\n                                    send: send\n                                });\n                            }));\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                    setupBridge({\n                        on: on_on,\n                        send: send_send,\n                        receiveMessage: receive_receiveMessage\n                    });\n                    !function(_ref8) {\n                        var on = _ref8.on, send = _ref8.send;\n                        globalStore(\"builtinListeners\").getOrSet(\"helloListener\", (function() {\n                            var listener = on(\"postrobot_hello\", {\n                                domain: \"*\"\n                            }, (function(_ref3) {\n                                resolveHelloPromise(_ref3.source, {\n                                    domain: _ref3.origin\n                                });\n                                return {\n                                    instanceID: getInstanceID()\n                                };\n                            }));\n                            var parent = getAncestor();\n                            parent && sayHello(parent, {\n                                send: send\n                            }).catch((function(err) {}));\n                            return listener;\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                }\n                var _ref3, on, send, global;\n            }();\n            var comp = component(options);\n            var init = function(props) {\n                return comp.init(props);\n            };\n            init.driver = function(name, dep) {\n                return comp.driver(name, dep);\n            };\n            init.isChild = function() {\n                return comp.isChild();\n            };\n            init.canRenderTo = function(win) {\n                return comp.canRenderTo(win);\n            };\n            init.instances = comp.instances;\n            var child = comp.registerChild();\n            child && (window.xprops = init.xprops = child.getProps());\n            return init;\n        };\n        function destroyComponents(err) {\n            src_bridge && src_bridge.destroyBridges();\n            var destroyPromise = cleanInstances.all(err);\n            cleanInstances = cleanup();\n            return destroyPromise;\n        }\n        var destroyAll = destroyComponents;\n        function component_destroy(err) {\n            destroyAll();\n            delete window.__zoid_9_0_87__;\n            !function() {\n                !function() {\n                    var responseListeners = globalStore(\"responseListeners\");\n                    for (var _i2 = 0, _responseListeners$ke2 = responseListeners.keys(); _i2 < _responseListeners$ke2.length; _i2++) {\n                        var hash = _responseListeners$ke2[_i2];\n                        var listener = responseListeners.get(hash);\n                        listener && (listener.cancelled = !0);\n                        responseListeners.del(hash);\n                    }\n                }();\n                (listener = globalStore().get(\"postMessageListener\")) && listener.cancel();\n                var listener;\n                delete window.__post_robot_10_0_46__;\n            }();\n            return cleanZoid.all(err);\n        }\n    } ]);\n}));"
  },
  {
    "path": "dist/zoid.js",
    "content": "!function(root, factory) {\n    \"object\" == typeof exports && \"object\" == typeof module ? module.exports = factory() : \"function\" == typeof define && define.amd ? define(\"zoid\", [], factory) : \"object\" == typeof exports ? exports.zoid = factory() : root.zoid = factory();\n}(\"undefined\" != typeof self ? self : this, (function() {\n    return function(modules) {\n        var installedModules = {};\n        function __webpack_require__(moduleId) {\n            if (installedModules[moduleId]) return installedModules[moduleId].exports;\n            var module = installedModules[moduleId] = {\n                i: moduleId,\n                l: !1,\n                exports: {}\n            };\n            modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n            module.l = !0;\n            return module.exports;\n        }\n        __webpack_require__.m = modules;\n        __webpack_require__.c = installedModules;\n        __webpack_require__.d = function(exports, name, getter) {\n            __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {\n                enumerable: !0,\n                get: getter\n            });\n        };\n        __webpack_require__.r = function(exports) {\n            \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {\n                value: \"Module\"\n            });\n            Object.defineProperty(exports, \"__esModule\", {\n                value: !0\n            });\n        };\n        __webpack_require__.t = function(value, mode) {\n            1 & mode && (value = __webpack_require__(value));\n            if (8 & mode) return value;\n            if (4 & mode && \"object\" == typeof value && value && value.__esModule) return value;\n            var ns = Object.create(null);\n            __webpack_require__.r(ns);\n            Object.defineProperty(ns, \"default\", {\n                enumerable: !0,\n                value: value\n            });\n            if (2 & mode && \"string\" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) {\n                return value[key];\n            }.bind(null, key));\n            return ns;\n        };\n        __webpack_require__.n = function(module) {\n            var getter = module && module.__esModule ? function() {\n                return module.default;\n            } : function() {\n                return module;\n            };\n            __webpack_require__.d(getter, \"a\", getter);\n            return getter;\n        };\n        __webpack_require__.o = function(object, property) {\n            return {}.hasOwnProperty.call(object, property);\n        };\n        __webpack_require__.p = \"\";\n        return __webpack_require__(__webpack_require__.s = 0);\n    }([ function(module, __webpack_exports__, __webpack_require__) {\n        \"use strict\";\n        __webpack_require__.r(__webpack_exports__);\n        __webpack_require__.d(__webpack_exports__, \"PopupOpenError\", (function() {\n            return dom_PopupOpenError;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"create\", (function() {\n            return component_create;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroy\", (function() {\n            return component_destroy;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyComponents\", (function() {\n            return destroyComponents;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"destroyAll\", (function() {\n            return destroyAll;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_TYPE\", (function() {\n            return PROP_TYPE;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"PROP_SERIALIZATION\", (function() {\n            return PROP_SERIALIZATION;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"CONTEXT\", (function() {\n            return CONTEXT;\n        }));\n        __webpack_require__.d(__webpack_exports__, \"EVENT\", (function() {\n            return EVENT;\n        }));\n        function _setPrototypeOf(o, p) {\n            return (_setPrototypeOf = Object.setPrototypeOf || function(o, p) {\n                o.__proto__ = p;\n                return o;\n            })(o, p);\n        }\n        function _inheritsLoose(subClass, superClass) {\n            subClass.prototype = Object.create(superClass.prototype);\n            subClass.prototype.constructor = subClass;\n            _setPrototypeOf(subClass, superClass);\n        }\n        function _extends() {\n            return (_extends = Object.assign || function(target) {\n                for (var i = 1; i < arguments.length; i++) {\n                    var source = arguments[i];\n                    for (var key in source) ({}).hasOwnProperty.call(source, key) && (target[key] = source[key]);\n                }\n                return target;\n            }).apply(this, arguments);\n        }\n        function utils_isPromise(item) {\n            try {\n                if (!item) return !1;\n                if (\"undefined\" != typeof Promise && item instanceof Promise) return !0;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.Window && item instanceof window.Window) return !1;\n                if (\"undefined\" != typeof window && \"function\" == typeof window.constructor && item instanceof window.constructor) return !1;\n                var _toString = {}.toString;\n                if (_toString) {\n                    var name = _toString.call(item);\n                    if (\"[object Window]\" === name || \"[object global]\" === name || \"[object DOMWindow]\" === name) return !1;\n                }\n                if (\"function\" == typeof item.then) return !0;\n            } catch (err) {\n                return !1;\n            }\n            return !1;\n        }\n        var dispatchedErrors = [];\n        var possiblyUnhandledPromiseHandlers = [];\n        var activeCount = 0;\n        var flushPromise;\n        function flushActive() {\n            if (!activeCount && flushPromise) {\n                var promise = flushPromise;\n                flushPromise = null;\n                promise.resolve();\n            }\n        }\n        function startActive() {\n            activeCount += 1;\n        }\n        function endActive() {\n            activeCount -= 1;\n            flushActive();\n        }\n        var promise_ZalgoPromise = function() {\n            function ZalgoPromise(handler) {\n                var _this = this;\n                this.resolved = void 0;\n                this.rejected = void 0;\n                this.errorHandled = void 0;\n                this.value = void 0;\n                this.error = void 0;\n                this.handlers = void 0;\n                this.dispatching = void 0;\n                this.stack = void 0;\n                this.resolved = !1;\n                this.rejected = !1;\n                this.errorHandled = !1;\n                this.handlers = [];\n                if (handler) {\n                    var _result;\n                    var _error;\n                    var resolved = !1;\n                    var rejected = !1;\n                    var isAsync = !1;\n                    startActive();\n                    try {\n                        handler((function(res) {\n                            if (isAsync) _this.resolve(res); else {\n                                resolved = !0;\n                                _result = res;\n                            }\n                        }), (function(err) {\n                            if (isAsync) _this.reject(err); else {\n                                rejected = !0;\n                                _error = err;\n                            }\n                        }));\n                    } catch (err) {\n                        endActive();\n                        this.reject(err);\n                        return;\n                    }\n                    endActive();\n                    isAsync = !0;\n                    resolved ? this.resolve(_result) : rejected && this.reject(_error);\n                }\n            }\n            var _proto = ZalgoPromise.prototype;\n            _proto.resolve = function(result) {\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(result)) throw new Error(\"Can not resolve promise with another promise\");\n                this.resolved = !0;\n                this.value = result;\n                this.dispatch();\n                return this;\n            };\n            _proto.reject = function(error) {\n                var _this2 = this;\n                if (this.resolved || this.rejected) return this;\n                if (utils_isPromise(error)) throw new Error(\"Can not reject promise with another promise\");\n                if (!error) {\n                    var _err = error && \"function\" == typeof error.toString ? error.toString() : {}.toString.call(error);\n                    error = new Error(\"Expected reject to be called with Error, got \" + _err);\n                }\n                this.rejected = !0;\n                this.error = error;\n                this.errorHandled || setTimeout((function() {\n                    _this2.errorHandled || function(err, promise) {\n                        if (-1 === dispatchedErrors.indexOf(err)) {\n                            dispatchedErrors.push(err);\n                            setTimeout((function() {\n                                throw err;\n                            }), 1);\n                            for (var j = 0; j < possiblyUnhandledPromiseHandlers.length; j++) possiblyUnhandledPromiseHandlers[j](err, promise);\n                        }\n                    }(error, _this2);\n                }), 1);\n                this.dispatch();\n                return this;\n            };\n            _proto.asyncReject = function(error) {\n                this.errorHandled = !0;\n                this.reject(error);\n                return this;\n            };\n            _proto.dispatch = function() {\n                var resolved = this.resolved, rejected = this.rejected, handlers = this.handlers;\n                if (!this.dispatching && (resolved || rejected)) {\n                    this.dispatching = !0;\n                    startActive();\n                    var chain = function(firstPromise, secondPromise) {\n                        return firstPromise.then((function(res) {\n                            secondPromise.resolve(res);\n                        }), (function(err) {\n                            secondPromise.reject(err);\n                        }));\n                    };\n                    for (var i = 0; i < handlers.length; i++) {\n                        var _handlers$i = handlers[i], onSuccess = _handlers$i.onSuccess, onError = _handlers$i.onError, promise = _handlers$i.promise;\n                        var _result2 = void 0;\n                        if (resolved) try {\n                            _result2 = onSuccess ? onSuccess(this.value) : this.value;\n                        } catch (err) {\n                            promise.reject(err);\n                            continue;\n                        } else if (rejected) {\n                            if (!onError) {\n                                promise.reject(this.error);\n                                continue;\n                            }\n                            try {\n                                _result2 = onError(this.error);\n                            } catch (err) {\n                                promise.reject(err);\n                                continue;\n                            }\n                        }\n                        if (_result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected)) {\n                            var promiseResult = _result2;\n                            promiseResult.resolved ? promise.resolve(promiseResult.value) : promise.reject(promiseResult.error);\n                            promiseResult.errorHandled = !0;\n                        } else utils_isPromise(_result2) ? _result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected) ? _result2.resolved ? promise.resolve(_result2.value) : promise.reject(_result2.error) : chain(_result2, promise) : promise.resolve(_result2);\n                    }\n                    handlers.length = 0;\n                    this.dispatching = !1;\n                    endActive();\n                }\n            };\n            _proto.then = function(onSuccess, onError) {\n                if (onSuccess && \"function\" != typeof onSuccess && !onSuccess.call) throw new Error(\"Promise.then expected a function for success handler\");\n                if (onError && \"function\" != typeof onError && !onError.call) throw new Error(\"Promise.then expected a function for error handler\");\n                var promise = new ZalgoPromise;\n                this.handlers.push({\n                    promise: promise,\n                    onSuccess: onSuccess,\n                    onError: onError\n                });\n                this.errorHandled = !0;\n                this.dispatch();\n                return promise;\n            };\n            _proto.catch = function(onError) {\n                return this.then(void 0, onError);\n            };\n            _proto.finally = function(onFinally) {\n                if (onFinally && \"function\" != typeof onFinally && !onFinally.call) throw new Error(\"Promise.finally expected a function\");\n                return this.then((function(result) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        return result;\n                    }));\n                }), (function(err) {\n                    return ZalgoPromise.try(onFinally).then((function() {\n                        throw err;\n                    }));\n                }));\n            };\n            _proto.timeout = function(time, err) {\n                var _this3 = this;\n                if (this.resolved || this.rejected) return this;\n                var timeout = setTimeout((function() {\n                    _this3.resolved || _this3.rejected || _this3.reject(err || new Error(\"Promise timed out after \" + time + \"ms\"));\n                }), time);\n                return this.then((function(result) {\n                    clearTimeout(timeout);\n                    return result;\n                }));\n            };\n            _proto.toPromise = function() {\n                if (\"undefined\" == typeof Promise) throw new TypeError(\"Could not find Promise\");\n                return Promise.resolve(this);\n            };\n            _proto.lazy = function() {\n                this.errorHandled = !0;\n                return this;\n            };\n            ZalgoPromise.resolve = function(value) {\n                return value instanceof ZalgoPromise ? value : utils_isPromise(value) ? new ZalgoPromise((function(resolve, reject) {\n                    return value.then(resolve, reject);\n                })) : (new ZalgoPromise).resolve(value);\n            };\n            ZalgoPromise.reject = function(error) {\n                return (new ZalgoPromise).reject(error);\n            };\n            ZalgoPromise.asyncReject = function(error) {\n                return (new ZalgoPromise).asyncReject(error);\n            };\n            ZalgoPromise.all = function(promises) {\n                var promise = new ZalgoPromise;\n                var count = promises.length;\n                var results = [].slice();\n                if (!count) {\n                    promise.resolve(results);\n                    return promise;\n                }\n                var chain = function(i, firstPromise, secondPromise) {\n                    return firstPromise.then((function(res) {\n                        results[i] = res;\n                        0 == (count -= 1) && promise.resolve(results);\n                    }), (function(err) {\n                        secondPromise.reject(err);\n                    }));\n                };\n                for (var i = 0; i < promises.length; i++) {\n                    var prom = promises[i];\n                    if (prom instanceof ZalgoPromise) {\n                        if (prom.resolved) {\n                            results[i] = prom.value;\n                            count -= 1;\n                            continue;\n                        }\n                    } else if (!utils_isPromise(prom)) {\n                        results[i] = prom;\n                        count -= 1;\n                        continue;\n                    }\n                    chain(i, ZalgoPromise.resolve(prom), promise);\n                }\n                0 === count && promise.resolve(results);\n                return promise;\n            };\n            ZalgoPromise.hash = function(promises) {\n                var result = {};\n                var awaitPromises = [];\n                var _loop = function(key) {\n                    if (promises.hasOwnProperty(key)) {\n                        var value = promises[key];\n                        utils_isPromise(value) ? awaitPromises.push(value.then((function(res) {\n                            result[key] = res;\n                        }))) : result[key] = value;\n                    }\n                };\n                for (var key in promises) _loop(key);\n                return ZalgoPromise.all(awaitPromises).then((function() {\n                    return result;\n                }));\n            };\n            ZalgoPromise.map = function(items, method) {\n                return ZalgoPromise.all(items.map(method));\n            };\n            ZalgoPromise.onPossiblyUnhandledException = function(handler) {\n                return function(handler) {\n                    possiblyUnhandledPromiseHandlers.push(handler);\n                    return {\n                        cancel: function() {\n                            possiblyUnhandledPromiseHandlers.splice(possiblyUnhandledPromiseHandlers.indexOf(handler), 1);\n                        }\n                    };\n                }(handler);\n            };\n            ZalgoPromise.try = function(method, context, args) {\n                if (method && \"function\" != typeof method && !method.call) throw new Error(\"Promise.try expected a function\");\n                var result;\n                startActive();\n                try {\n                    result = method.apply(context, args || []);\n                } catch (err) {\n                    endActive();\n                    return ZalgoPromise.reject(err);\n                }\n                endActive();\n                return ZalgoPromise.resolve(result);\n            };\n            ZalgoPromise.delay = function(_delay) {\n                return new ZalgoPromise((function(resolve) {\n                    setTimeout(resolve, _delay);\n                }));\n            };\n            ZalgoPromise.isPromise = function(value) {\n                return !!(value && value instanceof ZalgoPromise) || utils_isPromise(value);\n            };\n            ZalgoPromise.flush = function() {\n                return function(Zalgo) {\n                    var promise = flushPromise = flushPromise || new Zalgo;\n                    flushActive();\n                    return promise;\n                }(ZalgoPromise);\n            };\n            return ZalgoPromise;\n        }();\n        function isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        var IE_WIN_ACCESS_ERROR = \"Call was rejected by callee.\\r\\n\";\n        function getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return getActualProtocol(win);\n        }\n        function isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === getProtocol(win);\n        }\n        function utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = utils_getParent(win);\n                return parent && canReadFromWindow() ? getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === getProtocol(win);\n                    }(win) && canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (getActualDomain(win) === getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (isAboutProtocol(win) && canReadFromWindow()) return !0;\n                if (getDomain(window) === getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function assertSameDomain(win) {\n            if (!isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (utils_getParent(win) === win) return win;\n            try {\n                if (isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function getAllFramesInWindow(win) {\n            var top = getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], getAllChildFrames(win)));\n            return result;\n        }\n        var iframeWindows = [];\n        var iframeFrames = [];\n        function isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || err.message !== IE_WIN_ACCESS_ERROR;\n            }\n            if (allowMock && isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function utils_getUserAgent(win) {\n            return (win = win || window).navigator.mockUserAgent || win.navigator.userAgent;\n        }\n        function getFrameByName(win, name) {\n            var winFrames = getFrames(win);\n            for (var _i9 = 0; _i9 < winFrames.length; _i9++) {\n                var childFrame = winFrames[_i9];\n                try {\n                    if (isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame;\n                } catch (err) {}\n            }\n            try {\n                if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name];\n            } catch (err) {}\n            try {\n                if (-1 !== winFrames.indexOf(win[name])) return win[name];\n            } catch (err) {}\n        }\n        function isOpener(parent, child) {\n            return parent === getOpener(child);\n        }\n        function getAncestor(win) {\n            void 0 === win && (win = window);\n            return getOpener(win = win || window) || utils_getParent(win) || void 0;\n        }\n        function anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function isSameTopWindow(win1, win2) {\n            var top1 = getTop(win1) || win1;\n            var top2 = getTop(win2) || win2;\n            try {\n                if (top1 && top2) return top1 === top2;\n            } catch (err) {}\n            var allFrames1 = getAllFramesInWindow(win1);\n            var allFrames2 = getAllFramesInWindow(win2);\n            if (anyMatch(allFrames1, allFrames2)) return !0;\n            var opener1 = getOpener(top1);\n            var opener2 = getOpener(top2);\n            return opener1 && anyMatch(getAllFramesInWindow(opener1), allFrames2) || opener2 && anyMatch(getAllFramesInWindow(opener2), allFrames1), \n            !1;\n        }\n        function matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return isRegex(pattern) ? isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !isRegex(origin) && pattern.some((function(subpattern) {\n                return matchDomain(subpattern, origin);\n            })));\n        }\n        function getDomainFromUrl(url) {\n            return url.match(/^(https?|mock|file):\\/\\//) ? url.split(\"/\").slice(0, 3).join(\"/\") : getDomain();\n        }\n        function isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function getFrameForWindow(win) {\n            if (isSameDomain(win)) return assertSameDomain(win).frameElement;\n            for (var _i21 = 0, _document$querySelect2 = document.querySelectorAll(\"iframe\"); _i21 < _document$querySelect2.length; _i21++) {\n                var frame = _document$querySelect2[_i21];\n                if (frame && frame.contentWindow && frame.contentWindow === win) return frame;\n            }\n        }\n        function closeWindow(win) {\n            if (function(win) {\n                void 0 === win && (win = window);\n                return Boolean(utils_getParent(win));\n            }(win)) {\n                var frame = getFrameForWindow(win);\n                if (frame && frame.parentElement) {\n                    frame.parentElement.removeChild(frame);\n                    return;\n                }\n            }\n            try {\n                win.close();\n            } catch (err) {}\n        }\n        function util_safeIndexOf(collection, item) {\n            for (var i = 0; i < collection.length; i++) try {\n                if (collection[i] === item) return i;\n            } catch (err) {}\n            return -1;\n        }\n        var weakmap_CrossDomainSafeWeakMap = function() {\n            function CrossDomainSafeWeakMap() {\n                this.name = void 0;\n                this.weakmap = void 0;\n                this.keys = void 0;\n                this.values = void 0;\n                this.name = \"__weakmap_\" + (1e9 * Math.random() >>> 0) + \"__\";\n                if (function() {\n                    if (\"undefined\" == typeof WeakMap) return !1;\n                    if (void 0 === Object.freeze) return !1;\n                    try {\n                        var testWeakMap = new WeakMap;\n                        var testKey = {};\n                        Object.freeze(testKey);\n                        testWeakMap.set(testKey, \"__testvalue__\");\n                        return \"__testvalue__\" === testWeakMap.get(testKey);\n                    } catch (err) {\n                        return !1;\n                    }\n                }()) try {\n                    this.weakmap = new WeakMap;\n                } catch (err) {}\n                this.keys = [];\n                this.values = [];\n            }\n            var _proto = CrossDomainSafeWeakMap.prototype;\n            _proto._cleanupClosedWindows = function() {\n                var weakmap = this.weakmap;\n                var keys = this.keys;\n                for (var i = 0; i < keys.length; i++) {\n                    var value = keys[i];\n                    if (isWindow(value) && isWindowClosed(value)) {\n                        if (weakmap) try {\n                            weakmap.delete(value);\n                        } catch (err) {}\n                        keys.splice(i, 1);\n                        this.values.splice(i, 1);\n                        i -= 1;\n                    }\n                }\n            };\n            _proto.isSafeToReadWrite = function(key) {\n                return !isWindow(key);\n            };\n            _proto.set = function(key, value) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.set(key, value);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var name = this.name;\n                    var entry = key[name];\n                    entry && entry[0] === key ? entry[1] = value : Object.defineProperty(key, name, {\n                        value: [ key, value ],\n                        writable: !0\n                    });\n                    return;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var values = this.values;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 === index) {\n                    keys.push(key);\n                    values.push(value);\n                } else values[index] = value;\n            };\n            _proto.get = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return weakmap.get(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return entry && entry[0] === key ? entry[1] : void 0;\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var index = util_safeIndexOf(this.keys, key);\n                if (-1 !== index) return this.values[index];\n            };\n            _proto.delete = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    weakmap.delete(key);\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    entry && entry[0] === key && (entry[0] = entry[1] = void 0);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                var keys = this.keys;\n                var index = util_safeIndexOf(keys, key);\n                if (-1 !== index) {\n                    keys.splice(index, 1);\n                    this.values.splice(index, 1);\n                }\n            };\n            _proto.has = function(key) {\n                if (!key) throw new Error(\"WeakMap expected key\");\n                var weakmap = this.weakmap;\n                if (weakmap) try {\n                    if (weakmap.has(key)) return !0;\n                } catch (err) {\n                    delete this.weakmap;\n                }\n                if (this.isSafeToReadWrite(key)) try {\n                    var entry = key[this.name];\n                    return !(!entry || entry[0] !== key);\n                } catch (err) {}\n                this._cleanupClosedWindows();\n                return -1 !== util_safeIndexOf(this.keys, key);\n            };\n            _proto.getOrSet = function(key, getter) {\n                if (this.has(key)) return this.get(key);\n                var value = getter();\n                this.set(key, value);\n                return value;\n            };\n            return CrossDomainSafeWeakMap;\n        }();\n        function _getPrototypeOf(o) {\n            return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {\n                return o.__proto__ || Object.getPrototypeOf(o);\n            })(o);\n        }\n        function _isNativeReflectConstruct() {\n            if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n            if (Reflect.construct.sham) return !1;\n            if (\"function\" == typeof Proxy) return !0;\n            try {\n                Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));\n                return !0;\n            } catch (e) {\n                return !1;\n            }\n        }\n        function construct_construct(Parent, args, Class) {\n            return (construct_construct = _isNativeReflectConstruct() ? Reflect.construct : function(Parent, args, Class) {\n                var a = [ null ];\n                a.push.apply(a, args);\n                var instance = new (Function.bind.apply(Parent, a));\n                Class && _setPrototypeOf(instance, Class.prototype);\n                return instance;\n            }).apply(null, arguments);\n        }\n        function wrapNativeSuper_wrapNativeSuper(Class) {\n            var _cache = \"function\" == typeof Map ? new Map : void 0;\n            return (wrapNativeSuper_wrapNativeSuper = function(Class) {\n                if (null === Class || !(fn = Class, -1 !== Function.toString.call(fn).indexOf(\"[native code]\"))) return Class;\n                var fn;\n                if (\"function\" != typeof Class) throw new TypeError(\"Super expression must either be null or a function\");\n                if (void 0 !== _cache) {\n                    if (_cache.has(Class)) return _cache.get(Class);\n                    _cache.set(Class, Wrapper);\n                }\n                function Wrapper() {\n                    return construct_construct(Class, arguments, _getPrototypeOf(this).constructor);\n                }\n                Wrapper.prototype = Object.create(Class.prototype, {\n                    constructor: {\n                        value: Wrapper,\n                        enumerable: !1,\n                        writable: !0,\n                        configurable: !0\n                    }\n                });\n                return _setPrototypeOf(Wrapper, Class);\n            })(Class);\n        }\n        function isElement(element) {\n            var passed = !1;\n            try {\n                (element instanceof window.Element || null !== element && \"object\" == typeof element && 1 === element.nodeType && \"object\" == typeof element.style && \"object\" == typeof element.ownerDocument) && (passed = !0);\n            } catch (_) {}\n            return passed;\n        }\n        function getFunctionName(fn) {\n            return fn.name || fn.__name__ || fn.displayName || \"anonymous\";\n        }\n        function setFunctionName(fn, name) {\n            try {\n                delete fn.name;\n                fn.name = name;\n            } catch (err) {}\n            fn.__name__ = fn.displayName = name;\n            return fn;\n        }\n        function base64encode(str) {\n            if (\"function\" == typeof btoa) return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (function(m, p1) {\n                return String.fromCharCode(parseInt(p1, 16));\n            }))).replace(/[=]/g, \"\");\n            if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"utf8\").toString(\"base64\").replace(/[=]/g, \"\");\n            throw new Error(\"Can not find window.btoa or Buffer\");\n        }\n        function uniqueID() {\n            var chars = \"0123456789abcdef\";\n            return \"uid_\" + \"xxxxxxxxxx\".replace(/./g, (function() {\n                return chars.charAt(Math.floor(Math.random() * chars.length));\n            })) + \"_\" + base64encode((new Date).toISOString().slice(11, 19).replace(\"T\", \".\")).replace(/[^a-zA-Z0-9]/g, \"\").toLowerCase();\n        }\n        var objectIDs;\n        function serializeArgs(args) {\n            try {\n                return JSON.stringify([].slice.call(args), (function(subkey, val) {\n                    return \"function\" == typeof val ? \"memoize[\" + function(obj) {\n                        objectIDs = objectIDs || new weakmap_CrossDomainSafeWeakMap;\n                        if (null == obj || \"object\" != typeof obj && \"function\" != typeof obj) throw new Error(\"Invalid object\");\n                        var uid = objectIDs.get(obj);\n                        if (!uid) {\n                            uid = typeof obj + \":\" + uniqueID();\n                            objectIDs.set(obj, uid);\n                        }\n                        return uid;\n                    }(val) + \"]\" : isElement(val) ? {} : val;\n                }));\n            } catch (err) {\n                throw new Error(\"Arguments not serializable -- can not be used to memoize\");\n            }\n        }\n        function getEmptyObject() {\n            return {};\n        }\n        var memoizeGlobalIndex = 0;\n        var memoizeGlobalIndexValidFrom = 0;\n        function memoize(method, options) {\n            void 0 === options && (options = {});\n            var _options$thisNamespac = options.thisNamespace, thisNamespace = void 0 !== _options$thisNamespac && _options$thisNamespac, cacheTime = options.time;\n            var simpleCache;\n            var thisCache;\n            var memoizeIndex = memoizeGlobalIndex;\n            memoizeGlobalIndex += 1;\n            var memoizedFunction = function() {\n                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                if (memoizeIndex < memoizeGlobalIndexValidFrom) {\n                    simpleCache = null;\n                    thisCache = null;\n                    memoizeIndex = memoizeGlobalIndex;\n                    memoizeGlobalIndex += 1;\n                }\n                var cache;\n                cache = thisNamespace ? (thisCache = thisCache || new weakmap_CrossDomainSafeWeakMap).getOrSet(this, getEmptyObject) : simpleCache = simpleCache || {};\n                var cacheKey;\n                try {\n                    cacheKey = serializeArgs(args);\n                } catch (_unused) {\n                    return method.apply(this, arguments);\n                }\n                var cacheResult = cache[cacheKey];\n                if (cacheResult && cacheTime && Date.now() - cacheResult.time < cacheTime) {\n                    delete cache[cacheKey];\n                    cacheResult = null;\n                }\n                if (cacheResult) return cacheResult.value;\n                var time = Date.now();\n                var value = method.apply(this, arguments);\n                cache[cacheKey] = {\n                    time: time,\n                    value: value\n                };\n                return value;\n            };\n            memoizedFunction.reset = function() {\n                simpleCache = null;\n                thisCache = null;\n            };\n            return setFunctionName(memoizedFunction, (options.name || getFunctionName(method)) + \"::memoized\");\n        }\n        memoize.clear = function() {\n            memoizeGlobalIndexValidFrom = memoizeGlobalIndex;\n        };\n        function memoizePromise(method) {\n            var cache = {};\n            function memoizedPromiseFunction() {\n                var _arguments = arguments, _this = this;\n                for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                var key = serializeArgs(args);\n                if (cache.hasOwnProperty(key)) return cache[key];\n                cache[key] = promise_ZalgoPromise.try((function() {\n                    return method.apply(_this, _arguments);\n                })).finally((function() {\n                    delete cache[key];\n                }));\n                return cache[key];\n            }\n            memoizedPromiseFunction.reset = function() {\n                cache = {};\n            };\n            return setFunctionName(memoizedPromiseFunction, getFunctionName(method) + \"::promiseMemoized\");\n        }\n        function src_util_noop() {}\n        function once(method) {\n            var called = !1;\n            return setFunctionName((function() {\n                if (!called) {\n                    called = !0;\n                    return method.apply(this, arguments);\n                }\n            }), getFunctionName(method) + \"::once\");\n        }\n        function stringifyError(err, level) {\n            void 0 === level && (level = 1);\n            if (level >= 3) return \"stringifyError stack overflow\";\n            try {\n                if (!err) return \"<unknown error: \" + {}.toString.call(err) + \">\";\n                if (\"string\" == typeof err) return err;\n                if (err instanceof Error) {\n                    var stack = err && err.stack;\n                    var message = err && err.message;\n                    if (stack && message) return -1 !== stack.indexOf(message) ? stack : message + \"\\n\" + stack;\n                    if (stack) return stack;\n                    if (message) return message;\n                }\n                return err && err.toString && \"function\" == typeof err.toString ? err.toString() : {}.toString.call(err);\n            } catch (newErr) {\n                return \"Error while stringifying error: \" + stringifyError(newErr, level + 1);\n            }\n        }\n        function stringify(item) {\n            return \"string\" == typeof item ? item : item && item.toString && \"function\" == typeof item.toString ? item.toString() : {}.toString.call(item);\n        }\n        function extend(obj, source) {\n            if (!source) return obj;\n            if (Object.assign) return Object.assign(obj, source);\n            for (var key in source) source.hasOwnProperty(key) && (obj[key] = source[key]);\n            return obj;\n        }\n        memoize((function(obj) {\n            if (Object.values) return Object.values(obj);\n            var result = [];\n            for (var key in obj) obj.hasOwnProperty(key) && result.push(obj[key]);\n            return result;\n        }));\n        function identity(item) {\n            return item;\n        }\n        function safeInterval(method, time) {\n            var timeout;\n            !function loop() {\n                timeout = setTimeout((function() {\n                    method();\n                    loop();\n                }), time);\n            }();\n            return {\n                cancel: function() {\n                    clearTimeout(timeout);\n                }\n            };\n        }\n        function arrayFrom(item) {\n            return [].slice.call(item);\n        }\n        function isDefined(value) {\n            return null != value;\n        }\n        function util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function util_getOrSet(obj, key, getter) {\n            if (obj.hasOwnProperty(key)) return obj[key];\n            var val = getter();\n            obj[key] = val;\n            return val;\n        }\n        function cleanup(obj) {\n            var tasks = [];\n            var cleaned = !1;\n            var cleanErr;\n            var cleaner = {\n                set: function(name, item) {\n                    if (!cleaned) {\n                        obj[name] = item;\n                        cleaner.register((function() {\n                            delete obj[name];\n                        }));\n                    }\n                    return item;\n                },\n                register: function(method) {\n                    var task = once((function() {\n                        return method(cleanErr);\n                    }));\n                    cleaned ? method(cleanErr) : tasks.push(task);\n                    return {\n                        cancel: function() {\n                            var index = tasks.indexOf(task);\n                            -1 !== index && tasks.splice(index, 1);\n                        }\n                    };\n                },\n                all: function(err) {\n                    cleanErr = err;\n                    var results = [];\n                    cleaned = !0;\n                    for (;tasks.length; ) {\n                        var task = tasks.shift();\n                        results.push(task());\n                    }\n                    return promise_ZalgoPromise.all(results).then(src_util_noop);\n                }\n            };\n            return cleaner;\n        }\n        function assertExists(name, thing) {\n            if (null == thing) throw new Error(\"Expected \" + name + \" to be present\");\n            return thing;\n        }\n        var util_ExtendableError = function(_Error) {\n            _inheritsLoose(ExtendableError, _Error);\n            function ExtendableError(message) {\n                var _this6;\n                (_this6 = _Error.call(this, message) || this).name = _this6.constructor.name;\n                \"function\" == typeof Error.captureStackTrace ? Error.captureStackTrace(function(self) {\n                    if (void 0 === self) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n                    return self;\n                }(_this6), _this6.constructor) : _this6.stack = new Error(message).stack;\n                return _this6;\n            }\n            return ExtendableError;\n        }(wrapNativeSuper_wrapNativeSuper(Error));\n        function getBody() {\n            var body = document.body;\n            if (!body) throw new Error(\"Body element not found\");\n            return body;\n        }\n        function isDocumentReady() {\n            return Boolean(document.body) && \"complete\" === document.readyState;\n        }\n        function isDocumentInteractive() {\n            return Boolean(document.body) && \"interactive\" === document.readyState;\n        }\n        function urlEncode(str) {\n            return encodeURIComponent(str);\n        }\n        memoize((function() {\n            return new promise_ZalgoPromise((function(resolve) {\n                if (isDocumentReady() || isDocumentInteractive()) return resolve();\n                var interval = setInterval((function() {\n                    if (isDocumentReady() || isDocumentInteractive()) {\n                        clearInterval(interval);\n                        return resolve();\n                    }\n                }), 10);\n            }));\n        }));\n        function parseQuery(queryString) {\n            return function(method, logic, args) {\n                void 0 === args && (args = []);\n                var cache = method.__inline_memoize_cache__ = method.__inline_memoize_cache__ || {};\n                var key = serializeArgs(args);\n                return cache.hasOwnProperty(key) ? cache[key] : cache[key] = function() {\n                    var params = {};\n                    if (!queryString) return params;\n                    if (-1 === queryString.indexOf(\"=\")) return params;\n                    for (var _i2 = 0, _queryString$split2 = queryString.split(\"&\"); _i2 < _queryString$split2.length; _i2++) {\n                        var pair = _queryString$split2[_i2];\n                        (pair = pair.split(\"=\"))[0] && pair[1] && (params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]));\n                    }\n                    return params;\n                }.apply(void 0, args);\n            }(parseQuery, 0, [ queryString ]);\n        }\n        function extendQuery(originalQuery, props) {\n            void 0 === props && (props = {});\n            return props && Object.keys(props).length ? function(obj) {\n                void 0 === obj && (obj = {});\n                return Object.keys(obj).filter((function(key) {\n                    return \"string\" == typeof obj[key] || \"boolean\" == typeof obj[key];\n                })).map((function(key) {\n                    var val = obj[key];\n                    if (\"string\" != typeof val && \"boolean\" != typeof val) throw new TypeError(\"Invalid type for query\");\n                    return urlEncode(key) + \"=\" + urlEncode(val.toString());\n                })).join(\"&\");\n            }(_extends({}, parseQuery(originalQuery), props)) : originalQuery;\n        }\n        function appendChild(container, child) {\n            container.appendChild(child);\n        }\n        function getElementSafe(id, doc) {\n            void 0 === doc && (doc = document);\n            return isElement(id) ? id : \"string\" == typeof id ? doc.querySelector(id) : void 0;\n        }\n        function elementReady(id) {\n            return new promise_ZalgoPromise((function(resolve, reject) {\n                var name = stringify(id);\n                var el = getElementSafe(id);\n                if (el) return resolve(el);\n                if (isDocumentReady()) return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                var interval = setInterval((function() {\n                    if (el = getElementSafe(id)) {\n                        resolve(el);\n                        clearInterval(interval);\n                    } else if (isDocumentReady()) {\n                        clearInterval(interval);\n                        return reject(new Error(\"Document is ready and element \" + name + \" does not exist\"));\n                    }\n                }), 10);\n            }));\n        }\n        var dom_PopupOpenError = function(_ExtendableError) {\n            _inheritsLoose(PopupOpenError, _ExtendableError);\n            function PopupOpenError() {\n                return _ExtendableError.apply(this, arguments) || this;\n            }\n            return PopupOpenError;\n        }(util_ExtendableError);\n        var awaitFrameLoadPromises;\n        function awaitFrameLoad(frame) {\n            if ((awaitFrameLoadPromises = awaitFrameLoadPromises || new weakmap_CrossDomainSafeWeakMap).has(frame)) {\n                var _promise = awaitFrameLoadPromises.get(frame);\n                if (_promise) return _promise;\n            }\n            var promise = new promise_ZalgoPromise((function(resolve, reject) {\n                frame.addEventListener(\"load\", (function() {\n                    !function(frame) {\n                        !function() {\n                            for (var i = 0; i < iframeWindows.length; i++) {\n                                var closed = !1;\n                                try {\n                                    closed = iframeWindows[i].closed;\n                                } catch (err) {}\n                                if (closed) {\n                                    iframeFrames.splice(i, 1);\n                                    iframeWindows.splice(i, 1);\n                                }\n                            }\n                        }();\n                        if (frame && frame.contentWindow) try {\n                            iframeWindows.push(frame.contentWindow);\n                            iframeFrames.push(frame);\n                        } catch (err) {}\n                    }(frame);\n                    resolve(frame);\n                }));\n                frame.addEventListener(\"error\", (function(err) {\n                    frame.contentWindow ? resolve(frame) : reject(err);\n                }));\n            }));\n            awaitFrameLoadPromises.set(frame, promise);\n            return promise;\n        }\n        function awaitFrameWindow(frame) {\n            return awaitFrameLoad(frame).then((function(loadedFrame) {\n                if (!loadedFrame.contentWindow) throw new Error(\"Could not find window in iframe\");\n                return loadedFrame.contentWindow;\n            }));\n        }\n        function dom_iframe(options, container) {\n            void 0 === options && (options = {});\n            var style = options.style || {};\n            var frame = function(tag, options, container) {\n                void 0 === tag && (tag = \"div\");\n                void 0 === options && (options = {});\n                tag = tag.toLowerCase();\n                var element = document.createElement(tag);\n                options.style && extend(element.style, options.style);\n                options.class && (element.className = options.class.join(\" \"));\n                options.id && element.setAttribute(\"id\", options.id);\n                if (options.attributes) for (var _i10 = 0, _Object$keys2 = Object.keys(options.attributes); _i10 < _Object$keys2.length; _i10++) {\n                    var key = _Object$keys2[_i10];\n                    element.setAttribute(key, options.attributes[key]);\n                }\n                options.styleSheet && function(el, styleText, doc) {\n                    void 0 === doc && (doc = window.document);\n                    el.styleSheet ? el.styleSheet.cssText = styleText : el.appendChild(doc.createTextNode(styleText));\n                }(element, options.styleSheet);\n                if (options.html) {\n                    if (\"iframe\" === tag) throw new Error(\"Iframe html can not be written unless container provided and iframe in DOM\");\n                    element.innerHTML = options.html;\n                }\n                return element;\n            }(\"iframe\", {\n                attributes: _extends({\n                    allowTransparency: \"true\"\n                }, options.attributes || {}),\n                style: _extends({\n                    backgroundColor: \"transparent\",\n                    border: \"none\"\n                }, style),\n                html: options.html,\n                class: options.class\n            });\n            var isIE = window.navigator.userAgent.match(/MSIE|Edge/i);\n            frame.hasAttribute(\"id\") || frame.setAttribute(\"id\", uniqueID());\n            awaitFrameLoad(frame);\n            container && function(id, doc) {\n                void 0 === doc && (doc = document);\n                var element = getElementSafe(id, doc);\n                if (element) return element;\n                throw new Error(\"Can not find element: \" + stringify(id));\n            }(container).appendChild(frame);\n            (options.url || isIE) && frame.setAttribute(\"src\", options.url || \"about:blank\");\n            return frame;\n        }\n        function addEventListener(obj, event, handler) {\n            obj.addEventListener(event, handler);\n            return {\n                cancel: function() {\n                    obj.removeEventListener(event, handler);\n                }\n            };\n        }\n        function showElement(element) {\n            element.style.setProperty(\"display\", \"\");\n        }\n        function hideElement(element) {\n            element.style.setProperty(\"display\", \"none\", \"important\");\n        }\n        function destroyElement(element) {\n            element && element.parentNode && element.parentNode.removeChild(element);\n        }\n        function isElementClosed(el) {\n            return !(el && el.parentNode && el.ownerDocument && el.ownerDocument.documentElement && el.ownerDocument.documentElement.contains(el));\n        }\n        function onResize(el, handler, _temp) {\n            var _ref2 = void 0 === _temp ? {} : _temp, _ref2$width = _ref2.width, width = void 0 === _ref2$width || _ref2$width, _ref2$height = _ref2.height, height = void 0 === _ref2$height || _ref2$height, _ref2$interval = _ref2.interval, interval = void 0 === _ref2$interval ? 100 : _ref2$interval, _ref2$win = _ref2.win, win = void 0 === _ref2$win ? window : _ref2$win;\n            var currentWidth = el.offsetWidth;\n            var currentHeight = el.offsetHeight;\n            var canceled = !1;\n            handler({\n                width: currentWidth,\n                height: currentHeight\n            });\n            var check = function() {\n                if (!canceled && function(el) {\n                    return Boolean(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n                }(el)) {\n                    var newWidth = el.offsetWidth;\n                    var newHeight = el.offsetHeight;\n                    (width && newWidth !== currentWidth || height && newHeight !== currentHeight) && handler({\n                        width: newWidth,\n                        height: newHeight\n                    });\n                    currentWidth = newWidth;\n                    currentHeight = newHeight;\n                }\n            };\n            var observer;\n            var timeout;\n            win.addEventListener(\"resize\", check);\n            if (void 0 !== win.ResizeObserver) {\n                (observer = new win.ResizeObserver(check)).observe(el);\n                timeout = safeInterval(check, 10 * interval);\n            } else if (void 0 !== win.MutationObserver) {\n                (observer = new win.MutationObserver(check)).observe(el, {\n                    attributes: !0,\n                    childList: !0,\n                    subtree: !0,\n                    characterData: !1\n                });\n                timeout = safeInterval(check, 10 * interval);\n            } else timeout = safeInterval(check, interval);\n            return {\n                cancel: function() {\n                    canceled = !0;\n                    observer.disconnect();\n                    window.removeEventListener(\"resize\", check);\n                    timeout.cancel();\n                }\n            };\n        }\n        function isShadowElement(element) {\n            for (;element.parentNode; ) element = element.parentNode;\n            return \"[object ShadowRoot]\" === element.toString();\n        }\n        var currentScript = \"undefined\" != typeof document ? document.currentScript : null;\n        var getCurrentScript = memoize((function() {\n            if (currentScript) return currentScript;\n            if (currentScript = function() {\n                try {\n                    var stack = function() {\n                        try {\n                            throw new Error(\"_\");\n                        } catch (err) {\n                            return err.stack || \"\";\n                        }\n                    }();\n                    var stackDetails = /.*at [^(]*\\((.*):(.+):(.+)\\)$/gi.exec(stack);\n                    var scriptLocation = stackDetails && stackDetails[1];\n                    if (!scriptLocation) return;\n                    for (var _i22 = 0, _Array$prototype$slic2 = [].slice.call(document.getElementsByTagName(\"script\")).reverse(); _i22 < _Array$prototype$slic2.length; _i22++) {\n                        var script = _Array$prototype$slic2[_i22];\n                        if (script.src && script.src === scriptLocation) return script;\n                    }\n                } catch (err) {}\n            }()) return currentScript;\n            throw new Error(\"Can not determine current script\");\n        }));\n        var currentUID = uniqueID();\n        memoize((function() {\n            var script;\n            try {\n                script = getCurrentScript();\n            } catch (err) {\n                return currentUID;\n            }\n            var uid = script.getAttribute(\"data-uid\");\n            if (uid && \"string\" == typeof uid) return uid;\n            if ((uid = script.getAttribute(\"data-uid-auto\")) && \"string\" == typeof uid) return uid;\n            if (script.src) {\n                var hashedString = function(str) {\n                    var hash = \"\";\n                    for (var i = 0; i < str.length; i++) {\n                        var total = str[i].charCodeAt(0) * i;\n                        str[i + 1] && (total += str[i + 1].charCodeAt(0) * (i - 1));\n                        hash += String.fromCharCode(97 + Math.abs(total) % 26);\n                    }\n                    return hash;\n                }(JSON.stringify({\n                    src: script.src,\n                    dataset: script.dataset\n                }));\n                uid = \"uid_\" + hashedString.slice(hashedString.length - 30);\n            } else uid = uniqueID();\n            script.setAttribute(\"data-uid-auto\", uid);\n            return uid;\n        }));\n        function isPerc(str) {\n            return \"string\" == typeof str && /^[0-9]+%$/.test(str);\n        }\n        function toNum(val) {\n            if (\"number\" == typeof val) return val;\n            var match = val.match(/^([0-9]+)(px|%)$/);\n            if (!match) throw new Error(\"Could not match css value from \" + val);\n            return parseInt(match[1], 10);\n        }\n        function toPx(val) {\n            return toNum(val) + \"px\";\n        }\n        function toCSS(val) {\n            return \"number\" == typeof val ? toPx(val) : isPerc(val) ? val : toPx(val);\n        }\n        function normalizeDimension(dim, max) {\n            if (\"number\" == typeof dim) return dim;\n            if (isPerc(dim)) return parseInt(max * toNum(dim) / 100, 10);\n            if (\"string\" == typeof (str = dim) && /^[0-9]+px$/.test(str)) return toNum(dim);\n            var str;\n            throw new Error(\"Can not normalize dimension: \" + dim);\n        }\n        function global_getGlobal(win) {\n            void 0 === win && (win = window);\n            var globalKey = \"__post_robot_10_0_46__\";\n            return win !== window ? win[globalKey] : win[globalKey] = win[globalKey] || {};\n        }\n        var getObj = function() {\n            return {};\n        };\n        function globalStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return util_getOrSet(global_getGlobal(), key, (function() {\n                var store = defStore();\n                return {\n                    has: function(storeKey) {\n                        return store.hasOwnProperty(storeKey);\n                    },\n                    get: function(storeKey, defVal) {\n                        return store.hasOwnProperty(storeKey) ? store[storeKey] : defVal;\n                    },\n                    set: function(storeKey, val) {\n                        store[storeKey] = val;\n                        return val;\n                    },\n                    del: function(storeKey) {\n                        delete store[storeKey];\n                    },\n                    getOrSet: function(storeKey, getter) {\n                        return util_getOrSet(store, storeKey, getter);\n                    },\n                    reset: function() {\n                        store = defStore();\n                    },\n                    keys: function() {\n                        return Object.keys(store);\n                    }\n                };\n            }));\n        }\n        var WildCard = function() {};\n        function getWildcard() {\n            var global = global_getGlobal();\n            global.WINDOW_WILDCARD = global.WINDOW_WILDCARD || new WildCard;\n            return global.WINDOW_WILDCARD;\n        }\n        function windowStore(key, defStore) {\n            void 0 === key && (key = \"store\");\n            void 0 === defStore && (defStore = getObj);\n            return globalStore(\"windowStore\").getOrSet(key, (function() {\n                var winStore = new weakmap_CrossDomainSafeWeakMap;\n                var getStore = function(win) {\n                    return winStore.getOrSet(win, defStore);\n                };\n                return {\n                    has: function(win) {\n                        return getStore(win).hasOwnProperty(key);\n                    },\n                    get: function(win, defVal) {\n                        var store = getStore(win);\n                        return store.hasOwnProperty(key) ? store[key] : defVal;\n                    },\n                    set: function(win, val) {\n                        getStore(win)[key] = val;\n                        return val;\n                    },\n                    del: function(win) {\n                        delete getStore(win)[key];\n                    },\n                    getOrSet: function(win, getter) {\n                        return util_getOrSet(getStore(win), key, getter);\n                    }\n                };\n            }));\n        }\n        function getInstanceID() {\n            return globalStore(\"instance\").getOrSet(\"instanceID\", uniqueID);\n        }\n        function resolveHelloPromise(win, _ref) {\n            var domain = _ref.domain;\n            var helloPromises = windowStore(\"helloPromises\");\n            var existingPromise = helloPromises.get(win);\n            existingPromise && existingPromise.resolve({\n                domain: domain\n            });\n            var newPromise = promise_ZalgoPromise.resolve({\n                domain: domain\n            });\n            helloPromises.set(win, newPromise);\n            return newPromise;\n        }\n        function sayHello(win, _ref4) {\n            return (0, _ref4.send)(win, \"postrobot_hello\", {\n                instanceID: getInstanceID()\n            }, {\n                domain: \"*\",\n                timeout: -1\n            }).then((function(_ref5) {\n                var origin = _ref5.origin, instanceID = _ref5.data.instanceID;\n                resolveHelloPromise(win, {\n                    domain: origin\n                });\n                return {\n                    win: win,\n                    domain: origin,\n                    instanceID: instanceID\n                };\n            }));\n        }\n        function getWindowInstanceID(win, _ref6) {\n            var send = _ref6.send;\n            return windowStore(\"windowInstanceIDPromises\").getOrSet(win, (function() {\n                return sayHello(win, {\n                    send: send\n                }).then((function(_ref7) {\n                    return _ref7.instanceID;\n                }));\n            }));\n        }\n        function awaitWindowHello(win, timeout, name) {\n            void 0 === timeout && (timeout = 5e3);\n            void 0 === name && (name = \"Window\");\n            var promise = function(win) {\n                return windowStore(\"helloPromises\").getOrSet(win, (function() {\n                    return new promise_ZalgoPromise;\n                }));\n            }(win);\n            -1 !== timeout && (promise = promise.timeout(timeout, new Error(name + \" did not load after \" + timeout + \"ms\")));\n            return promise;\n        }\n        function markWindowKnown(win) {\n            windowStore(\"knownWindows\").set(win, !0);\n        }\n        function isSerializedType(item) {\n            return \"object\" == typeof item && null !== item && \"string\" == typeof item.__type__;\n        }\n        function determineType(val) {\n            return void 0 === val ? \"undefined\" : null === val ? \"null\" : Array.isArray(val) ? \"array\" : \"function\" == typeof val ? \"function\" : \"object\" == typeof val ? val instanceof Error ? \"error\" : \"function\" == typeof val.then ? \"promise\" : \"[object RegExp]\" === {}.toString.call(val) ? \"regex\" : \"[object Date]\" === {}.toString.call(val) ? \"date\" : \"object\" : \"string\" == typeof val ? \"string\" : \"number\" == typeof val ? \"number\" : \"boolean\" == typeof val ? \"boolean\" : void 0;\n        }\n        function serializeType(type, val) {\n            return {\n                __type__: type,\n                __val__: val\n            };\n        }\n        var _SERIALIZER;\n        var SERIALIZER = ((_SERIALIZER = {}).function = function() {}, _SERIALIZER.error = function(_ref) {\n            return serializeType(\"error\", {\n                message: _ref.message,\n                stack: _ref.stack,\n                code: _ref.code,\n                data: _ref.data\n            });\n        }, _SERIALIZER.promise = function() {}, _SERIALIZER.regex = function(val) {\n            return serializeType(\"regex\", val.source);\n        }, _SERIALIZER.date = function(val) {\n            return serializeType(\"date\", val.toJSON());\n        }, _SERIALIZER.array = function(val) {\n            return val;\n        }, _SERIALIZER.object = function(val) {\n            return val;\n        }, _SERIALIZER.string = function(val) {\n            return val;\n        }, _SERIALIZER.number = function(val) {\n            return val;\n        }, _SERIALIZER.boolean = function(val) {\n            return val;\n        }, _SERIALIZER.null = function(val) {\n            return val;\n        }, _SERIALIZER[void 0] = function(val) {\n            return serializeType(\"undefined\", val);\n        }, _SERIALIZER);\n        var defaultSerializers = {};\n        var _DESERIALIZER;\n        var DESERIALIZER = ((_DESERIALIZER = {}).function = function() {\n            throw new Error(\"Function serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.error = function(_ref2) {\n            var stack = _ref2.stack, code = _ref2.code, data = _ref2.data;\n            var error = new Error(_ref2.message);\n            error.code = code;\n            data && (error.data = data);\n            error.stack = stack + \"\\n\\n\" + error.stack;\n            return error;\n        }, _DESERIALIZER.promise = function() {\n            throw new Error(\"Promise serialization is not implemented; nothing to deserialize\");\n        }, _DESERIALIZER.regex = function(val) {\n            return new RegExp(val);\n        }, _DESERIALIZER.date = function(val) {\n            return new Date(val);\n        }, _DESERIALIZER.array = function(val) {\n            return val;\n        }, _DESERIALIZER.object = function(val) {\n            return val;\n        }, _DESERIALIZER.string = function(val) {\n            return val;\n        }, _DESERIALIZER.number = function(val) {\n            return val;\n        }, _DESERIALIZER.boolean = function(val) {\n            return val;\n        }, _DESERIALIZER.null = function(val) {\n            return val;\n        }, _DESERIALIZER[void 0] = function() {}, _DESERIALIZER);\n        var defaultDeserializers = {};\n        function needsBridgeForBrowser() {\n            return !!utils_getUserAgent(window).match(/MSIE|trident|edge\\/12|edge\\/13/i);\n        }\n        function needsBridgeForWin(win) {\n            return !isSameTopWindow(window, win);\n        }\n        function needsBridgeForDomain(domain, win) {\n            if (domain) {\n                if (getDomain() !== getDomainFromUrl(domain)) return !0;\n            } else if (win && !isSameDomain(win)) return !0;\n            return !1;\n        }\n        function needsBridge(_ref) {\n            var win = _ref.win, domain = _ref.domain;\n            return !(!needsBridgeForBrowser() || domain && !needsBridgeForDomain(domain, win) || win && !needsBridgeForWin(win));\n        }\n        function getBridgeName(domain) {\n            return \"__postrobot_bridge___\" + (domain = domain || getDomainFromUrl(domain)).replace(/[^a-zA-Z0-9]+/g, \"_\");\n        }\n        function isBridge() {\n            return Boolean(window.name && window.name === getBridgeName(getDomain()));\n        }\n        var documentBodyReady = new promise_ZalgoPromise((function(resolve) {\n            if (window.document && window.document.body) return resolve(window.document.body);\n            var interval = setInterval((function() {\n                if (window.document && window.document.body) {\n                    clearInterval(interval);\n                    return resolve(window.document.body);\n                }\n            }), 10);\n        }));\n        function registerRemoteWindow(win) {\n            windowStore(\"remoteWindowPromises\").getOrSet(win, (function() {\n                return new promise_ZalgoPromise;\n            }));\n        }\n        function findRemoteWindow(win) {\n            var remoteWinPromise = windowStore(\"remoteWindowPromises\").get(win);\n            if (!remoteWinPromise) throw new Error(\"Remote window promise not found\");\n            return remoteWinPromise;\n        }\n        function registerRemoteSendMessage(win, domain, sendMessage) {\n            findRemoteWindow(win).resolve((function(remoteWin, remoteDomain, message) {\n                if (remoteWin !== win) throw new Error(\"Remote window does not match window\");\n                if (!matchDomain(remoteDomain, domain)) throw new Error(\"Remote domain \" + remoteDomain + \" does not match domain \" + domain);\n                sendMessage.fireAndForget(message);\n            }));\n        }\n        function rejectRemoteSendMessage(win, err) {\n            findRemoteWindow(win).reject(err).catch(src_util_noop);\n        }\n        function linkWindow(_ref3) {\n            var win = _ref3.win, name = _ref3.name, domain = _ref3.domain;\n            var popupWindowsByName = globalStore(\"popupWindowsByName\");\n            var popupWindowsByWin = windowStore(\"popupWindowsByWin\");\n            for (var _i2 = 0, _popupWindowsByName$k2 = popupWindowsByName.keys(); _i2 < _popupWindowsByName$k2.length; _i2++) {\n                var winName = _popupWindowsByName$k2[_i2];\n                var _details = popupWindowsByName.get(winName);\n                _details && !isWindowClosed(_details.win) || popupWindowsByName.del(winName);\n            }\n            if (isWindowClosed(win)) return {\n                win: win,\n                name: name,\n                domain: domain\n            };\n            var details = popupWindowsByWin.getOrSet(win, (function() {\n                return name ? popupWindowsByName.getOrSet(name, (function() {\n                    return {\n                        win: win,\n                        name: name\n                    };\n                })) : {\n                    win: win\n                };\n            }));\n            if (details.win && details.win !== win) throw new Error(\"Different window already linked for window: \" + (name || \"undefined\"));\n            if (name) {\n                details.name = name;\n                popupWindowsByName.set(name, details);\n            }\n            if (domain) {\n                details.domain = domain;\n                registerRemoteWindow(win);\n            }\n            popupWindowsByWin.set(win, details);\n            return details;\n        }\n        function setupBridge(_ref) {\n            var on = _ref.on, send = _ref.send, receiveMessage = _ref.receiveMessage;\n            windowOpen = window.open, window.open = function(url, name, options, last) {\n                var win = windowOpen.call(this, function(url) {\n                    if (!(domain = getDomainFromUrl(url), 0 === domain.indexOf(\"mock:\"))) return url;\n                    var domain;\n                    throw new Error(\"Mock urls not supported out of test mode\");\n                }(url), name, options, last);\n                if (!win) return win;\n                linkWindow({\n                    win: win,\n                    name: name,\n                    domain: url ? getDomainFromUrl(url) : null\n                });\n                return win;\n            };\n            var windowOpen;\n            !function(_ref) {\n                var on = _ref.on, send = _ref.send, receiveMessage = _ref.receiveMessage;\n                var popupWindowsByName = globalStore(\"popupWindowsByName\");\n                on(\"postrobot_open_tunnel\", (function(_ref2) {\n                    var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                    var bridgePromise = globalStore(\"bridges\").get(origin);\n                    if (!bridgePromise) throw new Error(\"Can not find bridge promise for domain \" + origin);\n                    return bridgePromise.then((function(bridge) {\n                        if (source !== bridge) throw new Error(\"Message source does not matched registered bridge for domain \" + origin);\n                        if (!data.name) throw new Error(\"Register window expected to be passed window name\");\n                        if (!data.sendMessage) throw new Error(\"Register window expected to be passed sendMessage method\");\n                        if (!popupWindowsByName.has(data.name)) throw new Error(\"Window with name \" + data.name + \" does not exist, or was not opened by this window\");\n                        var getWindowDetails = function() {\n                            return popupWindowsByName.get(data.name);\n                        };\n                        if (!getWindowDetails().domain) throw new Error(\"We do not have a registered domain for window \" + data.name);\n                        if (getWindowDetails().domain !== origin) throw new Error(\"Message origin \" + origin + \" does not matched registered window origin \" + (getWindowDetails().domain || \"unknown\"));\n                        registerRemoteSendMessage(getWindowDetails().win, origin, data.sendMessage);\n                        return {\n                            sendMessage: function(message) {\n                                if (window && !window.closed && getWindowDetails()) {\n                                    var domain = getWindowDetails().domain;\n                                    if (domain) try {\n                                        receiveMessage({\n                                            data: message,\n                                            origin: domain,\n                                            source: getWindowDetails().win\n                                        }, {\n                                            on: on,\n                                            send: send\n                                        });\n                                    } catch (err) {\n                                        promise_ZalgoPromise.reject(err);\n                                    }\n                                }\n                            }\n                        };\n                    }));\n                }));\n            }({\n                on: on,\n                send: send,\n                receiveMessage: receiveMessage\n            });\n            !function(_ref2) {\n                var send = _ref2.send;\n                global_getGlobal(window).openTunnelToParent = function(_ref3) {\n                    var name = _ref3.name, source = _ref3.source, canary = _ref3.canary, sendMessage = _ref3.sendMessage;\n                    var tunnelWindows = globalStore(\"tunnelWindows\");\n                    var parentWindow = utils_getParent(window);\n                    if (!parentWindow) throw new Error(\"No parent window found to open tunnel to\");\n                    var id = function(_ref) {\n                        var name = _ref.name, source = _ref.source, canary = _ref.canary, sendMessage = _ref.sendMessage;\n                        !function() {\n                            var tunnelWindows = globalStore(\"tunnelWindows\");\n                            for (var _i2 = 0, _tunnelWindows$keys2 = tunnelWindows.keys(); _i2 < _tunnelWindows$keys2.length; _i2++) {\n                                var key = _tunnelWindows$keys2[_i2];\n                                isWindowClosed(tunnelWindows[key].source) && tunnelWindows.del(key);\n                            }\n                        }();\n                        var id = uniqueID();\n                        globalStore(\"tunnelWindows\").set(id, {\n                            name: name,\n                            source: source,\n                            canary: canary,\n                            sendMessage: sendMessage\n                        });\n                        return id;\n                    }({\n                        name: name,\n                        source: source,\n                        canary: canary,\n                        sendMessage: sendMessage\n                    });\n                    return send(parentWindow, \"postrobot_open_tunnel\", {\n                        name: name,\n                        sendMessage: function() {\n                            var tunnelWindow = tunnelWindows.get(id);\n                            if (tunnelWindow && tunnelWindow.source && !isWindowClosed(tunnelWindow.source)) {\n                                try {\n                                    tunnelWindow.canary();\n                                } catch (err) {\n                                    return;\n                                }\n                                tunnelWindow.sendMessage.apply(this, arguments);\n                            }\n                        }\n                    }, {\n                        domain: \"*\"\n                    });\n                };\n            }({\n                send: send\n            });\n            !function(_ref) {\n                var on = _ref.on, send = _ref.send, receiveMessage = _ref.receiveMessage;\n                promise_ZalgoPromise.try((function() {\n                    var opener = getOpener(window);\n                    if (opener && needsBridge({\n                        win: opener\n                    })) {\n                        registerRemoteWindow(opener);\n                        return (win = opener, windowStore(\"remoteBridgeAwaiters\").getOrSet(win, (function() {\n                            return promise_ZalgoPromise.try((function() {\n                                var frame = getFrameByName(win, getBridgeName(getDomain()));\n                                if (frame) return isSameDomain(frame) && global_getGlobal(assertSameDomain(frame)) ? frame : new promise_ZalgoPromise((function(resolve) {\n                                    var interval;\n                                    var timeout;\n                                    interval = setInterval((function() {\n                                        if (frame && isSameDomain(frame) && global_getGlobal(assertSameDomain(frame))) {\n                                            clearInterval(interval);\n                                            clearTimeout(timeout);\n                                            return resolve(frame);\n                                        }\n                                    }), 100);\n                                    timeout = setTimeout((function() {\n                                        clearInterval(interval);\n                                        return resolve();\n                                    }), 2e3);\n                                }));\n                            }));\n                        }))).then((function(bridge) {\n                            return bridge ? window.name ? global_getGlobal(assertSameDomain(bridge)).openTunnelToParent({\n                                name: window.name,\n                                source: window,\n                                canary: function() {},\n                                sendMessage: function(message) {\n                                    try {\n                                        window;\n                                    } catch (err) {\n                                        return;\n                                    }\n                                    if (window && !window.closed) try {\n                                        receiveMessage({\n                                            data: message,\n                                            origin: this.origin,\n                                            source: this.source\n                                        }, {\n                                            on: on,\n                                            send: send\n                                        });\n                                    } catch (err) {\n                                        promise_ZalgoPromise.reject(err);\n                                    }\n                                }\n                            }).then((function(_ref2) {\n                                var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                                if (source !== opener) throw new Error(\"Source does not match opener\");\n                                registerRemoteSendMessage(source, origin, data.sendMessage);\n                            })).catch((function(err) {\n                                rejectRemoteSendMessage(opener, err);\n                                throw err;\n                            })) : rejectRemoteSendMessage(opener, new Error(\"Can not register with opener: window does not have a name\")) : rejectRemoteSendMessage(opener, new Error(\"Can not register with opener: no bridge found in opener\"));\n                        }));\n                        var win;\n                    }\n                }));\n            }({\n                on: on,\n                send: send,\n                receiveMessage: receiveMessage\n            });\n        }\n        function cleanupProxyWindows() {\n            var idToProxyWindow = globalStore(\"idToProxyWindow\");\n            for (var _i2 = 0, _idToProxyWindow$keys2 = idToProxyWindow.keys(); _i2 < _idToProxyWindow$keys2.length; _i2++) {\n                var id = _idToProxyWindow$keys2[_i2];\n                idToProxyWindow.get(id).shouldClean() && idToProxyWindow.del(id);\n            }\n        }\n        function getSerializedWindow(winPromise, _ref) {\n            var send = _ref.send, _ref$id = _ref.id, id = void 0 === _ref$id ? uniqueID() : _ref$id;\n            var windowNamePromise = winPromise.then((function(win) {\n                if (isSameDomain(win)) return assertSameDomain(win).name;\n            }));\n            var windowTypePromise = winPromise.then((function(window) {\n                if (isWindowClosed(window)) throw new Error(\"Window is closed, can not determine type\");\n                return getOpener(window) ? \"popup\" : \"iframe\";\n            }));\n            windowNamePromise.catch(src_util_noop);\n            windowTypePromise.catch(src_util_noop);\n            var getName = function() {\n                return winPromise.then((function(win) {\n                    if (!isWindowClosed(win)) return isSameDomain(win) ? assertSameDomain(win).name : windowNamePromise;\n                }));\n            };\n            return {\n                id: id,\n                getType: function() {\n                    return windowTypePromise;\n                },\n                getInstanceID: memoizePromise((function() {\n                    return winPromise.then((function(win) {\n                        return getWindowInstanceID(win, {\n                            send: send\n                        });\n                    }));\n                })),\n                close: function() {\n                    return winPromise.then(closeWindow);\n                },\n                getName: getName,\n                focus: function() {\n                    return winPromise.then((function(win) {\n                        win.focus();\n                    }));\n                },\n                isClosed: function() {\n                    return winPromise.then((function(win) {\n                        return isWindowClosed(win);\n                    }));\n                },\n                setLocation: function(href, opts) {\n                    void 0 === opts && (opts = {});\n                    return winPromise.then((function(win) {\n                        var domain = window.location.protocol + \"//\" + window.location.host;\n                        var _opts$method = opts.method, method = void 0 === _opts$method ? \"get\" : _opts$method, body = opts.body;\n                        if (0 === href.indexOf(\"/\")) href = \"\" + domain + href; else if (!href.match(/^https?:\\/\\//) && 0 !== href.indexOf(domain)) throw new Error(\"Expected url to be http or https url, or absolute path, got \" + JSON.stringify(href));\n                        if (\"post\" === method) return getName().then((function(name) {\n                            if (!name) throw new Error(\"Can not post to window without target name\");\n                            !function(_ref3) {\n                                var url = _ref3.url, target = _ref3.target, body = _ref3.body, _ref3$method = _ref3.method, method = void 0 === _ref3$method ? \"post\" : _ref3$method;\n                                var form = document.createElement(\"form\");\n                                form.setAttribute(\"target\", target);\n                                form.setAttribute(\"method\", method);\n                                form.setAttribute(\"action\", url);\n                                form.style.display = \"none\";\n                                if (body) for (var _i24 = 0, _Object$keys4 = Object.keys(body); _i24 < _Object$keys4.length; _i24++) {\n                                    var _body$key;\n                                    var key = _Object$keys4[_i24];\n                                    var input = document.createElement(\"input\");\n                                    input.setAttribute(\"name\", key);\n                                    input.setAttribute(\"value\", null == (_body$key = body[key]) ? void 0 : _body$key.toString());\n                                    form.appendChild(input);\n                                }\n                                getBody().appendChild(form);\n                                form.submit();\n                                getBody().removeChild(form);\n                            }({\n                                url: href,\n                                target: name,\n                                method: method,\n                                body: body\n                            });\n                        }));\n                        if (\"get\" !== method) throw new Error(\"Unsupported method: \" + method);\n                        if (isSameDomain(win)) try {\n                            if (win.location && \"function\" == typeof win.location.replace) {\n                                win.location.replace(href);\n                                return;\n                            }\n                        } catch (err) {}\n                        win.location = href;\n                    }));\n                },\n                setName: function(name) {\n                    return winPromise.then((function(win) {\n                        linkWindow({\n                            win: win,\n                            name: name\n                        });\n                        var sameDomain = isSameDomain(win);\n                        var frame = getFrameForWindow(win);\n                        if (!sameDomain) throw new Error(\"Can not set name for cross-domain window: \" + name);\n                        assertSameDomain(win).name = name;\n                        frame && frame.setAttribute(\"name\", name);\n                        windowNamePromise = promise_ZalgoPromise.resolve(name);\n                    }));\n                }\n            };\n        }\n        var window_ProxyWindow = function() {\n            function ProxyWindow(_ref2) {\n                var send = _ref2.send, win = _ref2.win, serializedWindow = _ref2.serializedWindow;\n                this.id = void 0;\n                this.isProxyWindow = !0;\n                this.serializedWindow = void 0;\n                this.actualWindow = void 0;\n                this.actualWindowPromise = void 0;\n                this.send = void 0;\n                this.name = void 0;\n                this.actualWindowPromise = new promise_ZalgoPromise;\n                this.serializedWindow = serializedWindow || getSerializedWindow(this.actualWindowPromise, {\n                    send: send\n                });\n                globalStore(\"idToProxyWindow\").set(this.getID(), this);\n                win && this.setWindow(win, {\n                    send: send\n                });\n            }\n            var _proto = ProxyWindow.prototype;\n            _proto.getID = function() {\n                return this.serializedWindow.id;\n            };\n            _proto.getType = function() {\n                return this.serializedWindow.getType();\n            };\n            _proto.isPopup = function() {\n                return this.getType().then((function(type) {\n                    return \"popup\" === type;\n                }));\n            };\n            _proto.setLocation = function(href, opts) {\n                var _this = this;\n                return this.serializedWindow.setLocation(href, opts).then((function() {\n                    return _this;\n                }));\n            };\n            _proto.getName = function() {\n                return this.serializedWindow.getName();\n            };\n            _proto.setName = function(name) {\n                var _this2 = this;\n                return this.serializedWindow.setName(name).then((function() {\n                    return _this2;\n                }));\n            };\n            _proto.close = function() {\n                var _this3 = this;\n                return this.serializedWindow.close().then((function() {\n                    return _this3;\n                }));\n            };\n            _proto.focus = function() {\n                var _this4 = this;\n                var isPopupPromise = this.isPopup();\n                var getNamePromise = this.getName();\n                var reopenPromise = promise_ZalgoPromise.hash({\n                    isPopup: isPopupPromise,\n                    name: getNamePromise\n                }).then((function(_ref3) {\n                    var name = _ref3.name;\n                    _ref3.isPopup && name && window.open(\"\", name, \"noopener\");\n                }));\n                var focusPromise = this.serializedWindow.focus();\n                return promise_ZalgoPromise.all([ reopenPromise, focusPromise ]).then((function() {\n                    return _this4;\n                }));\n            };\n            _proto.isClosed = function() {\n                return this.serializedWindow.isClosed();\n            };\n            _proto.getWindow = function() {\n                return this.actualWindow;\n            };\n            _proto.setWindow = function(win, _ref4) {\n                var send = _ref4.send;\n                this.actualWindow = win;\n                this.actualWindowPromise.resolve(this.actualWindow);\n                this.serializedWindow = getSerializedWindow(this.actualWindowPromise, {\n                    send: send,\n                    id: this.getID()\n                });\n                windowStore(\"winToProxyWindow\").set(win, this);\n            };\n            _proto.awaitWindow = function() {\n                return this.actualWindowPromise;\n            };\n            _proto.matchWindow = function(win, _ref5) {\n                var _this5 = this;\n                var send = _ref5.send;\n                return promise_ZalgoPromise.try((function() {\n                    return _this5.actualWindow ? win === _this5.actualWindow : promise_ZalgoPromise.hash({\n                        proxyInstanceID: _this5.getInstanceID(),\n                        knownWindowInstanceID: getWindowInstanceID(win, {\n                            send: send\n                        })\n                    }).then((function(_ref6) {\n                        var match = _ref6.proxyInstanceID === _ref6.knownWindowInstanceID;\n                        match && _this5.setWindow(win, {\n                            send: send\n                        });\n                        return match;\n                    }));\n                }));\n            };\n            _proto.unwrap = function() {\n                return this.actualWindow || this;\n            };\n            _proto.getInstanceID = function() {\n                return this.serializedWindow.getInstanceID();\n            };\n            _proto.shouldClean = function() {\n                return Boolean(this.actualWindow && isWindowClosed(this.actualWindow));\n            };\n            _proto.serialize = function() {\n                return this.serializedWindow;\n            };\n            ProxyWindow.unwrap = function(win) {\n                return ProxyWindow.isProxyWindow(win) ? win.unwrap() : win;\n            };\n            ProxyWindow.serialize = function(win, _ref7) {\n                var send = _ref7.send;\n                cleanupProxyWindows();\n                return ProxyWindow.toProxyWindow(win, {\n                    send: send\n                }).serialize();\n            };\n            ProxyWindow.deserialize = function(serializedWindow, _ref8) {\n                var send = _ref8.send;\n                cleanupProxyWindows();\n                return globalStore(\"idToProxyWindow\").get(serializedWindow.id) || new ProxyWindow({\n                    serializedWindow: serializedWindow,\n                    send: send\n                });\n            };\n            ProxyWindow.isProxyWindow = function(obj) {\n                return Boolean(obj && !isWindow(obj) && obj.isProxyWindow);\n            };\n            ProxyWindow.toProxyWindow = function(win, _ref9) {\n                var send = _ref9.send;\n                cleanupProxyWindows();\n                if (ProxyWindow.isProxyWindow(win)) return win;\n                var actualWindow = win;\n                return windowStore(\"winToProxyWindow\").get(actualWindow) || new ProxyWindow({\n                    win: actualWindow,\n                    send: send\n                });\n            };\n            return ProxyWindow;\n        }();\n        function addMethod(id, val, name, source, domain) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            if (window_ProxyWindow.isProxyWindow(source)) proxyWindowMethods.set(id, {\n                val: val,\n                name: name,\n                domain: domain,\n                source: source\n            }); else {\n                proxyWindowMethods.del(id);\n                methodStore.getOrSet(source, (function() {\n                    return {};\n                }))[id] = {\n                    domain: domain,\n                    name: name,\n                    val: val,\n                    source: source\n                };\n            }\n        }\n        function lookupMethod(source, id) {\n            var methodStore = windowStore(\"methodStore\");\n            var proxyWindowMethods = globalStore(\"proxyWindowMethods\");\n            return methodStore.getOrSet(source, (function() {\n                return {};\n            }))[id] || proxyWindowMethods.get(id);\n        }\n        function function_serializeFunction(destination, domain, val, key, _ref3) {\n            on = (_ref = {\n                on: _ref3.on,\n                send: _ref3.send\n            }).on, send = _ref.send, globalStore(\"builtinListeners\").getOrSet(\"functionCalls\", (function() {\n                return on(\"postrobot_method\", {\n                    domain: \"*\"\n                }, (function(_ref2) {\n                    var source = _ref2.source, origin = _ref2.origin, data = _ref2.data;\n                    var id = data.id, name = data.name;\n                    var meth = lookupMethod(source, id);\n                    if (!meth) throw new Error(\"Could not find method '\" + name + \"' with id: \" + data.id + \" in \" + getDomain(window));\n                    var methodSource = meth.source, domain = meth.domain, val = meth.val;\n                    return promise_ZalgoPromise.try((function() {\n                        if (!matchDomain(domain, origin)) throw new Error(\"Method '\" + data.name + \"' domain \" + JSON.stringify(util_isRegex(meth.domain) ? meth.domain.source : meth.domain) + \" does not match origin \" + origin + \" in \" + getDomain(window));\n                        if (window_ProxyWindow.isProxyWindow(methodSource)) return methodSource.matchWindow(source, {\n                            send: send\n                        }).then((function(match) {\n                            if (!match) throw new Error(\"Method call '\" + data.name + \"' failed - proxy window does not match source in \" + getDomain(window));\n                        }));\n                    })).then((function() {\n                        return val.apply({\n                            source: source,\n                            origin: origin\n                        }, data.args);\n                    }), (function(err) {\n                        return promise_ZalgoPromise.try((function() {\n                            if (val.onError) return val.onError(err);\n                        })).then((function() {\n                            err.stack && (err.stack = \"Remote call to \" + name + \"(\" + function(args) {\n                                void 0 === args && (args = []);\n                                return arrayFrom(args).map((function(arg) {\n                                    return \"string\" == typeof arg ? \"'\" + arg + \"'\" : void 0 === arg ? \"undefined\" : null === arg ? \"null\" : \"boolean\" == typeof arg ? arg.toString() : Array.isArray(arg) ? \"[ ... ]\" : \"object\" == typeof arg ? \"{ ... }\" : \"function\" == typeof arg ? \"() => { ... }\" : \"<\" + typeof arg + \">\";\n                                })).join(\", \");\n                            }(data.args) + \") failed\\n\\n\" + err.stack);\n                            throw err;\n                        }));\n                    })).then((function(result) {\n                        return {\n                            result: result,\n                            id: id,\n                            name: name\n                        };\n                    }));\n                }));\n            }));\n            var _ref, on, send;\n            var id = val.__id__ || uniqueID();\n            destination = window_ProxyWindow.unwrap(destination);\n            var name = val.__name__ || val.name || key;\n            \"string\" == typeof name && \"function\" == typeof name.indexOf && 0 === name.indexOf(\"anonymous::\") && (name = name.replace(\"anonymous::\", key + \"::\"));\n            if (window_ProxyWindow.isProxyWindow(destination)) {\n                addMethod(id, val, name, destination, domain);\n                destination.awaitWindow().then((function(win) {\n                    addMethod(id, val, name, win, domain);\n                }));\n            } else addMethod(id, val, name, destination, domain);\n            return serializeType(\"cross_domain_function\", {\n                id: id,\n                name: name\n            });\n        }\n        function serializeMessage(destination, domain, obj, _ref) {\n            var _serialize;\n            var on = _ref.on, send = _ref.send;\n            return function(obj, serializers) {\n                void 0 === serializers && (serializers = defaultSerializers);\n                var result = JSON.stringify(obj, (function(key) {\n                    var val = this[key];\n                    if (isSerializedType(this)) return val;\n                    var type = determineType(val);\n                    if (!type) return val;\n                    var serializer = serializers[type] || SERIALIZER[type];\n                    return serializer ? serializer(val, key) : val;\n                }));\n                return void 0 === result ? \"undefined\" : result;\n            }(obj, ((_serialize = {}).promise = function(val, key) {\n                return function(destination, domain, val, key, _ref) {\n                    return serializeType(\"cross_domain_zalgo_promise\", {\n                        then: function_serializeFunction(destination, domain, (function(resolve, reject) {\n                            return val.then(resolve, reject);\n                        }), key, {\n                            on: _ref.on,\n                            send: _ref.send\n                        })\n                    });\n                }(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.function = function(val, key) {\n                return function_serializeFunction(destination, domain, val, key, {\n                    on: on,\n                    send: send\n                });\n            }, _serialize.object = function(val) {\n                return isWindow(val) || window_ProxyWindow.isProxyWindow(val) ? serializeType(\"cross_domain_window\", window_ProxyWindow.serialize(val, {\n                    send: send\n                })) : val;\n            }, _serialize));\n        }\n        function deserializeMessage(source, origin, message, _ref2) {\n            var _deserialize;\n            var send = _ref2.send;\n            return function(str, deserializers) {\n                void 0 === deserializers && (deserializers = defaultDeserializers);\n                if (\"undefined\" !== str) return JSON.parse(str, (function(key, val) {\n                    if (isSerializedType(this)) return val;\n                    var type;\n                    var value;\n                    if (isSerializedType(val)) {\n                        type = val.__type__;\n                        value = val.__val__;\n                    } else {\n                        type = determineType(val);\n                        value = val;\n                    }\n                    if (!type) return value;\n                    var deserializer = deserializers[type] || DESERIALIZER[type];\n                    return deserializer ? deserializer(value, key) : value;\n                }));\n            }(message, ((_deserialize = {}).cross_domain_zalgo_promise = function(serializedPromise) {\n                return function(source, origin, _ref2) {\n                    return new promise_ZalgoPromise(_ref2.then);\n                }(0, 0, serializedPromise);\n            }, _deserialize.cross_domain_function = function(serializedFunction) {\n                return function(source, origin, _ref4, _ref5) {\n                    var id = _ref4.id, name = _ref4.name;\n                    var send = _ref5.send;\n                    var getDeserializedFunction = function(opts) {\n                        void 0 === opts && (opts = {});\n                        function crossDomainFunctionWrapper() {\n                            var _arguments = arguments;\n                            return window_ProxyWindow.toProxyWindow(source, {\n                                send: send\n                            }).awaitWindow().then((function(win) {\n                                var meth = lookupMethod(win, id);\n                                if (meth && meth.val !== crossDomainFunctionWrapper) return meth.val.apply({\n                                    source: window,\n                                    origin: getDomain()\n                                }, _arguments);\n                                var _args = [].slice.call(_arguments);\n                                return opts.fireAndForget ? send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !0\n                                }) : send(win, \"postrobot_method\", {\n                                    id: id,\n                                    name: name,\n                                    args: _args\n                                }, {\n                                    domain: origin,\n                                    fireAndForget: !1\n                                }).then((function(res) {\n                                    return res.data.result;\n                                }));\n                            })).catch((function(err) {\n                                throw err;\n                            }));\n                        }\n                        crossDomainFunctionWrapper.__name__ = name;\n                        crossDomainFunctionWrapper.__origin__ = origin;\n                        crossDomainFunctionWrapper.__source__ = source;\n                        crossDomainFunctionWrapper.__id__ = id;\n                        crossDomainFunctionWrapper.origin = origin;\n                        return crossDomainFunctionWrapper;\n                    };\n                    var crossDomainFunctionWrapper = getDeserializedFunction();\n                    crossDomainFunctionWrapper.fireAndForget = getDeserializedFunction({\n                        fireAndForget: !0\n                    });\n                    return crossDomainFunctionWrapper;\n                }(source, origin, serializedFunction, {\n                    send: send\n                });\n            }, _deserialize.cross_domain_window = function(serializedWindow) {\n                return window_ProxyWindow.deserialize(serializedWindow, {\n                    send: send\n                });\n            }, _deserialize));\n        }\n        var SEND_MESSAGE_STRATEGIES = {};\n        SEND_MESSAGE_STRATEGIES.postrobot_post_message = function(win, serializedMessage, domain) {\n            0 === domain.indexOf(\"file:\") && (domain = \"*\");\n            win.postMessage(serializedMessage, domain);\n        };\n        SEND_MESSAGE_STRATEGIES.postrobot_bridge = function(win, serializedMessage, domain) {\n            if (!needsBridgeForBrowser() && !isBridge()) throw new Error(\"Bridge not needed for browser\");\n            if (isSameDomain(win)) throw new Error(\"Post message through bridge disabled between same domain windows\");\n            if (!1 !== isSameTopWindow(window, win)) throw new Error(\"Can only use bridge to communicate between two different windows, not between frames\");\n            !function(win, domain, message) {\n                var messagingChild = isOpener(window, win);\n                var messagingParent = isOpener(win, window);\n                if (!messagingChild && !messagingParent) throw new Error(\"Can only send messages to and from parent and popup windows\");\n                findRemoteWindow(win).then((function(sendMessage) {\n                    return sendMessage(win, domain, message);\n                }));\n            }(win, domain, serializedMessage);\n        };\n        SEND_MESSAGE_STRATEGIES.postrobot_global = function(win, serializedMessage) {\n            if (!utils_getUserAgent(window).match(/MSIE|rv:11|trident|edge\\/12|edge\\/13/i)) throw new Error(\"Global messaging not needed for browser\");\n            if (!isSameDomain(win)) throw new Error(\"Post message through global disabled between different domain windows\");\n            if (!1 !== isSameTopWindow(window, win)) throw new Error(\"Can only use global to communicate between two different windows, not between frames\");\n            var foreignGlobal = global_getGlobal(win);\n            if (!foreignGlobal) throw new Error(\"Can not find postRobot global on foreign window\");\n            foreignGlobal.receiveMessage({\n                source: window,\n                origin: getDomain(),\n                data: serializedMessage\n            });\n        };\n        function send_sendMessage(win, domain, message, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            return promise_ZalgoPromise.try((function() {\n                var domainBuffer = windowStore().getOrSet(win, (function() {\n                    return {};\n                }));\n                domainBuffer.buffer = domainBuffer.buffer || [];\n                domainBuffer.buffer.push(message);\n                domainBuffer.flush = domainBuffer.flush || promise_ZalgoPromise.flush().then((function() {\n                    if (isWindowClosed(win)) throw new Error(\"Window is closed\");\n                    var serializedMessage = serializeMessage(win, domain, ((_ref = {}).__post_robot_10_0_46__ = domainBuffer.buffer || [], \n                    _ref), {\n                        on: on,\n                        send: send\n                    });\n                    var _ref;\n                    delete domainBuffer.buffer;\n                    var strategies = Object.keys(SEND_MESSAGE_STRATEGIES);\n                    var errors = [];\n                    for (var _i2 = 0; _i2 < strategies.length; _i2++) {\n                        var strategyName = strategies[_i2];\n                        try {\n                            SEND_MESSAGE_STRATEGIES[strategyName](win, serializedMessage, domain);\n                        } catch (err) {\n                            errors.push(err);\n                        }\n                    }\n                    if (errors.length === strategies.length) throw new Error(\"All post-robot messaging strategies failed:\\n\\n\" + errors.map((function(err, i) {\n                        return i + \". \" + stringifyError(err);\n                    })).join(\"\\n\\n\"));\n                }));\n                return domainBuffer.flush.then((function() {\n                    delete domainBuffer.flush;\n                }));\n            })).then(src_util_noop);\n        }\n        function getResponseListener(hash) {\n            return globalStore(\"responseListeners\").get(hash);\n        }\n        function deleteResponseListener(hash) {\n            globalStore(\"responseListeners\").del(hash);\n        }\n        function isResponseListenerErrored(hash) {\n            return globalStore(\"erroredResponseListeners\").has(hash);\n        }\n        function getRequestListener(_ref) {\n            var name = _ref.name, win = _ref.win, domain = _ref.domain;\n            var requestListeners = windowStore(\"requestListeners\");\n            \"*\" === win && (win = null);\n            \"*\" === domain && (domain = null);\n            if (!name) throw new Error(\"Name required to get request listener\");\n            for (var _i4 = 0, _ref3 = [ win, getWildcard() ]; _i4 < _ref3.length; _i4++) {\n                var winQualifier = _ref3[_i4];\n                if (winQualifier) {\n                    var nameListeners = requestListeners.get(winQualifier);\n                    if (nameListeners) {\n                        var domainListeners = nameListeners[name];\n                        if (domainListeners) {\n                            if (domain && \"string\" == typeof domain) {\n                                if (domainListeners[domain]) return domainListeners[domain];\n                                if (domainListeners.__domain_regex__) for (var _i6 = 0, _domainListeners$__DO2 = domainListeners.__domain_regex__; _i6 < _domainListeners$__DO2.length; _i6++) {\n                                    var _domainListeners$__DO3 = _domainListeners$__DO2[_i6], listener = _domainListeners$__DO3.listener;\n                                    if (matchDomain(_domainListeners$__DO3.regex, domain)) return listener;\n                                }\n                            }\n                            if (domainListeners[\"*\"]) return domainListeners[\"*\"];\n                        }\n                    }\n                }\n            }\n        }\n        function handleRequest(source, origin, message, _ref) {\n            var on = _ref.on, send = _ref.send;\n            var options = getRequestListener({\n                name: message.name,\n                win: source,\n                domain: origin\n            });\n            var logName = \"postrobot_method\" === message.name && message.data && \"string\" == typeof message.data.name ? message.data.name + \"()\" : message.name;\n            function sendResponse(ack, data, error) {\n                return promise_ZalgoPromise.flush().then((function() {\n                    if (!message.fireAndForget && !isWindowClosed(source)) try {\n                        return send_sendMessage(source, origin, {\n                            id: uniqueID(),\n                            origin: getDomain(window),\n                            type: \"postrobot_message_response\",\n                            hash: message.hash,\n                            name: message.name,\n                            ack: ack,\n                            data: data,\n                            error: error\n                        }, {\n                            on: on,\n                            send: send\n                        });\n                    } catch (err) {\n                        throw new Error(\"Send response message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }\n                }));\n            }\n            return promise_ZalgoPromise.all([ promise_ZalgoPromise.flush().then((function() {\n                if (!message.fireAndForget && !isWindowClosed(source)) try {\n                    return send_sendMessage(source, origin, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_ack\",\n                        hash: message.hash,\n                        name: message.name\n                    }, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    throw new Error(\"Send ack message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                }\n            })), promise_ZalgoPromise.try((function() {\n                if (!options) throw new Error(\"No handler found for post message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                return options.handler({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            })).then((function(data) {\n                return sendResponse(\"success\", data);\n            }), (function(error) {\n                return sendResponse(\"error\", null, error);\n            })) ]).then(src_util_noop).catch((function(err) {\n                if (options && options.handleError) return options.handleError(err);\n                throw err;\n            }));\n        }\n        function handleAck(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message ack for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                try {\n                    if (!matchDomain(options.domain, origin)) throw new Error(\"Ack origin \" + origin + \" does not match domain \" + options.domain.toString());\n                    if (source !== options.win) throw new Error(\"Ack source does not match registered window\");\n                } catch (err) {\n                    options.promise.reject(err);\n                }\n                options.ack = !0;\n            }\n        }\n        function handleResponse(source, origin, message) {\n            if (!isResponseListenerErrored(message.hash)) {\n                var options = getResponseListener(message.hash);\n                if (!options) throw new Error(\"No handler found for post message response for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n                if (!matchDomain(options.domain, origin)) throw new Error(\"Response origin \" + origin + \" does not match domain \" + (pattern = options.domain, \n                Array.isArray(pattern) ? \"(\" + pattern.join(\" | \") + \")\" : isRegex(pattern) ? \"RegExp(\" + pattern.toString() + \")\" : pattern.toString()));\n                var pattern;\n                if (source !== options.win) throw new Error(\"Response source does not match registered window\");\n                deleteResponseListener(message.hash);\n                \"error\" === message.ack ? options.promise.reject(message.error) : \"success\" === message.ack && options.promise.resolve({\n                    source: source,\n                    origin: origin,\n                    data: message.data\n                });\n            }\n        }\n        function receive_receiveMessage(event, _ref2) {\n            var on = _ref2.on, send = _ref2.send;\n            var receivedMessages = globalStore(\"receivedMessages\");\n            try {\n                if (!window || window.closed || !event.source) return;\n            } catch (err) {\n                return;\n            }\n            var source = event.source, origin = event.origin;\n            var messages = function(message, source, origin, _ref) {\n                var on = _ref.on, send = _ref.send;\n                var parsedMessage;\n                try {\n                    parsedMessage = deserializeMessage(source, origin, message, {\n                        on: on,\n                        send: send\n                    });\n                } catch (err) {\n                    return;\n                }\n                if (parsedMessage && \"object\" == typeof parsedMessage && null !== parsedMessage) {\n                    var parseMessages = parsedMessage.__post_robot_10_0_46__;\n                    if (Array.isArray(parseMessages)) return parseMessages;\n                }\n            }(event.data, source, origin, {\n                on: on,\n                send: send\n            });\n            if (messages) {\n                markWindowKnown(source);\n                for (var _i2 = 0; _i2 < messages.length; _i2++) {\n                    var message = messages[_i2];\n                    if (receivedMessages.has(message.id)) return;\n                    receivedMessages.set(message.id, !0);\n                    if (isWindowClosed(source) && !message.fireAndForget) return;\n                    0 === message.origin.indexOf(\"file:\") && (origin = \"file://\");\n                    try {\n                        \"postrobot_message_request\" === message.type ? handleRequest(source, origin, message, {\n                            on: on,\n                            send: send\n                        }) : \"postrobot_message_response\" === message.type ? handleResponse(source, origin, message) : \"postrobot_message_ack\" === message.type && handleAck(source, origin, message);\n                    } catch (err) {\n                        setTimeout((function() {\n                            throw err;\n                        }), 0);\n                    }\n                }\n            }\n        }\n        function on_on(name, options, handler) {\n            if (!name) throw new Error(\"Expected name\");\n            if (\"function\" == typeof (options = options || {})) {\n                handler = options;\n                options = {};\n            }\n            if (!handler) throw new Error(\"Expected handler\");\n            var requestListener = function addRequestListener(_ref4, listener) {\n                var name = _ref4.name, winCandidate = _ref4.win, domain = _ref4.domain;\n                var requestListeners = windowStore(\"requestListeners\");\n                if (!name || \"string\" != typeof name) throw new Error(\"Name required to add request listener\");\n                if (winCandidate && \"*\" !== winCandidate && window_ProxyWindow.isProxyWindow(winCandidate)) {\n                    var requestListenerPromise = winCandidate.awaitWindow().then((function(actualWin) {\n                        return addRequestListener({\n                            name: name,\n                            win: actualWin,\n                            domain: domain\n                        }, listener);\n                    }));\n                    return {\n                        cancel: function() {\n                            requestListenerPromise.then((function(requestListener) {\n                                return requestListener.cancel();\n                            }), src_util_noop);\n                        }\n                    };\n                }\n                var win = winCandidate;\n                if (Array.isArray(win)) {\n                    var listenersCollection = [];\n                    for (var _i8 = 0, _win2 = win; _i8 < _win2.length; _i8++) listenersCollection.push(addRequestListener({\n                        name: name,\n                        domain: domain,\n                        win: _win2[_i8]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i10 = 0; _i10 < listenersCollection.length; _i10++) listenersCollection[_i10].cancel();\n                        }\n                    };\n                }\n                if (Array.isArray(domain)) {\n                    var _listenersCollection = [];\n                    for (var _i12 = 0, _domain2 = domain; _i12 < _domain2.length; _i12++) _listenersCollection.push(addRequestListener({\n                        name: name,\n                        win: win,\n                        domain: _domain2[_i12]\n                    }, listener));\n                    return {\n                        cancel: function() {\n                            for (var _i14 = 0; _i14 < _listenersCollection.length; _i14++) _listenersCollection[_i14].cancel();\n                        }\n                    };\n                }\n                var existingListener = getRequestListener({\n                    name: name,\n                    win: win,\n                    domain: domain\n                });\n                win && \"*\" !== win || (win = getWildcard());\n                var strDomain = (domain = domain || \"*\").toString();\n                if (existingListener) throw win && domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString() + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : win ? new Error(\"Request listener already exists for \" + name + \" for \" + (win === getWildcard() ? \"wildcard\" : \"specified\") + \" window\") : domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString()) : new Error(\"Request listener already exists for \" + name);\n                var winNameListeners = requestListeners.getOrSet(win, (function() {\n                    return {};\n                }));\n                var winNameDomainListeners = util_getOrSet(winNameListeners, name, (function() {\n                    return {};\n                }));\n                var winNameDomainRegexListeners;\n                var winNameDomainRegexListener;\n                util_isRegex(domain) ? (winNameDomainRegexListeners = util_getOrSet(winNameDomainListeners, \"__domain_regex__\", (function() {\n                    return [];\n                }))).push(winNameDomainRegexListener = {\n                    regex: domain,\n                    listener: listener\n                }) : winNameDomainListeners[strDomain] = listener;\n                return {\n                    cancel: function() {\n                        delete winNameDomainListeners[strDomain];\n                        if (winNameDomainRegexListener) {\n                            winNameDomainRegexListeners.splice(winNameDomainRegexListeners.indexOf(winNameDomainRegexListener, 1));\n                            winNameDomainRegexListeners.length || delete winNameDomainListeners.__domain_regex__;\n                        }\n                        Object.keys(winNameDomainListeners).length || delete winNameListeners[name];\n                        win && !Object.keys(winNameListeners).length && requestListeners.del(win);\n                    }\n                };\n            }({\n                name: name,\n                win: options.window,\n                domain: options.domain || \"*\"\n            }, {\n                handler: handler || options.handler,\n                handleError: options.errorHandler || function(err) {\n                    throw err;\n                }\n            });\n            return {\n                cancel: function() {\n                    requestListener.cancel();\n                }\n            };\n        }\n        var send_send = function send(winOrProxyWin, name, data, options) {\n            var domainMatcher = (options = options || {}).domain || \"*\";\n            var responseTimeout = options.timeout || -1;\n            var childTimeout = options.timeout || 5e3;\n            var fireAndForget = options.fireAndForget || !1;\n            return window_ProxyWindow.toProxyWindow(winOrProxyWin, {\n                send: send\n            }).awaitWindow().then((function(win) {\n                return promise_ZalgoPromise.try((function() {\n                    !function(name, win, domain) {\n                        if (!name) throw new Error(\"Expected name\");\n                        if (domain && \"string\" != typeof domain && !Array.isArray(domain) && !util_isRegex(domain)) throw new TypeError(\"Can not send \" + name + \". Expected domain \" + JSON.stringify(domain) + \" to be a string, array, or regex\");\n                        if (isWindowClosed(win)) throw new Error(\"Can not send \" + name + \". Target window is closed\");\n                    }(name, win, domainMatcher);\n                    if (function(parent, child) {\n                        var actualParent = getAncestor(child);\n                        if (actualParent) return actualParent === parent;\n                        if (child === parent) return !1;\n                        if (getTop(child) === child) return !1;\n                        for (var _i15 = 0, _getFrames8 = getFrames(parent); _i15 < _getFrames8.length; _i15++) if (_getFrames8[_i15] === child) return !0;\n                        return !1;\n                    }(window, win)) return awaitWindowHello(win, childTimeout);\n                })).then((function(_temp) {\n                    return function(win, targetDomain, actualDomain, _ref) {\n                        var send = _ref.send;\n                        return promise_ZalgoPromise.try((function() {\n                            return \"string\" == typeof targetDomain ? targetDomain : promise_ZalgoPromise.try((function() {\n                                return actualDomain || sayHello(win, {\n                                    send: send\n                                }).then((function(_ref2) {\n                                    return _ref2.domain;\n                                }));\n                            })).then((function(normalizedDomain) {\n                                if (!matchDomain(targetDomain, targetDomain)) throw new Error(\"Domain \" + stringify(targetDomain) + \" does not match \" + stringify(targetDomain));\n                                return normalizedDomain;\n                            }));\n                        }));\n                    }(win, domainMatcher, (void 0 === _temp ? {} : _temp).domain, {\n                        send: send\n                    });\n                })).then((function(targetDomain) {\n                    var domain = targetDomain;\n                    var logName = \"postrobot_method\" === name && data && \"string\" == typeof data.name ? data.name + \"()\" : name;\n                    var promise = new promise_ZalgoPromise;\n                    var hash = name + \"_\" + uniqueID();\n                    if (!fireAndForget) {\n                        var responseListener = {\n                            name: name,\n                            win: win,\n                            domain: domain,\n                            promise: promise\n                        };\n                        !function(hash, listener) {\n                            globalStore(\"responseListeners\").set(hash, listener);\n                        }(hash, responseListener);\n                        var reqPromises = windowStore(\"requestPromises\").getOrSet(win, (function() {\n                            return [];\n                        }));\n                        reqPromises.push(promise);\n                        promise.catch((function() {\n                            !function(hash) {\n                                globalStore(\"erroredResponseListeners\").set(hash, !0);\n                            }(hash);\n                            deleteResponseListener(hash);\n                        }));\n                        var totalAckTimeout = function(win) {\n                            return windowStore(\"knownWindows\").get(win, !1);\n                        }(win) ? 1e4 : 2e3;\n                        var totalResTimeout = responseTimeout;\n                        var ackTimeout = totalAckTimeout;\n                        var resTimeout = totalResTimeout;\n                        var interval = safeInterval((function() {\n                            if (isWindowClosed(win)) return promise.reject(new Error(\"Window closed for \" + name + \" before \" + (responseListener.ack ? \"response\" : \"ack\")));\n                            if (responseListener.cancelled) return promise.reject(new Error(\"Response listener was cancelled for \" + name));\n                            ackTimeout = Math.max(ackTimeout - 500, 0);\n                            -1 !== resTimeout && (resTimeout = Math.max(resTimeout - 500, 0));\n                            return responseListener.ack || 0 !== ackTimeout ? 0 === resTimeout ? promise.reject(new Error(\"No response for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalResTimeout + \"ms\")) : void 0 : promise.reject(new Error(\"No ack for postMessage \" + logName + \" in \" + getDomain() + \" in \" + totalAckTimeout + \"ms\"));\n                        }), 500);\n                        promise.finally((function() {\n                            interval.cancel();\n                            reqPromises.splice(reqPromises.indexOf(promise, 1));\n                        })).catch(src_util_noop);\n                    }\n                    return send_sendMessage(win, domain, {\n                        id: uniqueID(),\n                        origin: getDomain(window),\n                        type: \"postrobot_message_request\",\n                        hash: hash,\n                        name: name,\n                        data: data,\n                        fireAndForget: fireAndForget\n                    }, {\n                        on: on_on,\n                        send: send\n                    }).then((function() {\n                        return fireAndForget ? promise.resolve() : promise;\n                    }), (function(err) {\n                        throw new Error(\"Send request message failed for \" + logName + \" in \" + getDomain() + \"\\n\\n\" + stringifyError(err));\n                    }));\n                }));\n            }));\n        };\n        function setup_toProxyWindow(win) {\n            return window_ProxyWindow.toProxyWindow(win, {\n                send: send_send\n            });\n        }\n        function cleanUpWindow(win) {\n            for (var _i2 = 0, _requestPromises$get2 = windowStore(\"requestPromises\").get(win, []); _i2 < _requestPromises$get2.length; _i2++) _requestPromises$get2[_i2].reject(new Error(\"Window \" + (isWindowClosed(win) ? \"closed\" : \"cleaned up\") + \" before response\")).catch(src_util_noop);\n        }\n        var src_bridge;\n        src_bridge = {\n            setupBridge: setupBridge,\n            openBridge: function(url, domain) {\n                var bridges = globalStore(\"bridges\");\n                var bridgeFrames = globalStore(\"bridgeFrames\");\n                domain = domain || getDomainFromUrl(url);\n                return bridges.getOrSet(domain, (function() {\n                    return promise_ZalgoPromise.try((function() {\n                        if (getDomain() === domain) throw new Error(\"Can not open bridge on the same domain as current domain: \" + domain);\n                        var name = getBridgeName(domain);\n                        if (getFrameByName(window, name)) throw new Error(\"Frame with name \" + name + \" already exists on page\");\n                        var iframe = function(name, url) {\n                            var iframe = document.createElement(\"iframe\");\n                            iframe.setAttribute(\"name\", name);\n                            iframe.setAttribute(\"id\", name);\n                            iframe.setAttribute(\"style\", \"display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;\");\n                            iframe.setAttribute(\"frameborder\", \"0\");\n                            iframe.setAttribute(\"border\", \"0\");\n                            iframe.setAttribute(\"scrolling\", \"no\");\n                            iframe.setAttribute(\"allowTransparency\", \"true\");\n                            iframe.setAttribute(\"tabindex\", \"-1\");\n                            iframe.setAttribute(\"hidden\", \"true\");\n                            iframe.setAttribute(\"title\", \"\");\n                            iframe.setAttribute(\"role\", \"presentation\");\n                            iframe.src = url;\n                            return iframe;\n                        }(name, url);\n                        bridgeFrames.set(domain, iframe);\n                        return documentBodyReady.then((function(body) {\n                            body.appendChild(iframe);\n                            var bridge = iframe.contentWindow;\n                            return new promise_ZalgoPromise((function(resolve, reject) {\n                                iframe.addEventListener(\"load\", resolve);\n                                iframe.addEventListener(\"error\", reject);\n                            })).then((function() {\n                                return awaitWindowHello(bridge, 5e3, \"Bridge \" + url);\n                            })).then((function() {\n                                return bridge;\n                            }));\n                        }));\n                    }));\n                }));\n            },\n            linkWindow: linkWindow,\n            linkUrl: function(win, url) {\n                linkWindow({\n                    win: win,\n                    domain: getDomainFromUrl(url)\n                });\n            },\n            isBridge: isBridge,\n            needsBridge: needsBridge,\n            needsBridgeForBrowser: needsBridgeForBrowser,\n            hasBridge: function(url, domain) {\n                return globalStore(\"bridges\").has(domain || getDomainFromUrl(url));\n            },\n            needsBridgeForWin: needsBridgeForWin,\n            needsBridgeForDomain: needsBridgeForDomain,\n            destroyBridges: function() {\n                var bridges = globalStore(\"bridges\");\n                var bridgeFrames = globalStore(\"bridgeFrames\");\n                for (var _i4 = 0, _bridgeFrames$keys2 = bridgeFrames.keys(); _i4 < _bridgeFrames$keys2.length; _i4++) {\n                    var frame = bridgeFrames.get(_bridgeFrames$keys2[_i4]);\n                    frame && frame.parentNode && frame.parentNode.removeChild(frame);\n                }\n                bridgeFrames.reset();\n                bridges.reset();\n            }\n        };\n        function src_util_isRegex(item) {\n            return \"[object RegExp]\" === {}.toString.call(item);\n        }\n        function utils_getActualProtocol(win) {\n            void 0 === win && (win = window);\n            return win.location.protocol;\n        }\n        function utils_getProtocol(win) {\n            void 0 === win && (win = window);\n            if (win.mockDomain) {\n                var protocol = win.mockDomain.split(\"//\")[0];\n                if (protocol) return protocol;\n            }\n            return utils_getActualProtocol(win);\n        }\n        function utils_isAboutProtocol(win) {\n            void 0 === win && (win = window);\n            return \"about:\" === utils_getProtocol(win);\n        }\n        function src_utils_getParent(win) {\n            void 0 === win && (win = window);\n            if (win) try {\n                if (win.parent && win.parent !== win) return win.parent;\n            } catch (err) {}\n        }\n        function utils_getOpener(win) {\n            void 0 === win && (win = window);\n            if (win && !src_utils_getParent(win)) try {\n                return win.opener;\n            } catch (err) {}\n        }\n        function utils_canReadFromWindow(win) {\n            try {\n                return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_getActualDomain(win) {\n            void 0 === win && (win = window);\n            var location = win.location;\n            if (!location) throw new Error(\"Can not read window location\");\n            var protocol = utils_getActualProtocol(win);\n            if (!protocol) throw new Error(\"Can not read window protocol\");\n            if (\"file:\" === protocol) return \"file://\";\n            if (\"about:\" === protocol) {\n                var parent = src_utils_getParent(win);\n                return parent && utils_canReadFromWindow() ? utils_getActualDomain(parent) : \"about://\";\n            }\n            var host = location.host;\n            if (!host) throw new Error(\"Can not read window host\");\n            return protocol + \"//\" + host;\n        }\n        function utils_getDomain(win) {\n            void 0 === win && (win = window);\n            var domain = utils_getActualDomain(win);\n            return domain && win.mockDomain && 0 === win.mockDomain.indexOf(\"mock:\") ? win.mockDomain : domain;\n        }\n        function utils_isSameDomain(win) {\n            if (!function(win) {\n                try {\n                    if (win === window) return !0;\n                } catch (err) {}\n                try {\n                    var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n                    if (desc && !1 === desc.enumerable) return !1;\n                } catch (err) {}\n                try {\n                    if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (function(win) {\n                        void 0 === win && (win = window);\n                        return \"mock:\" === utils_getProtocol(win);\n                    }(win) && utils_canReadFromWindow()) return !0;\n                } catch (err) {}\n                try {\n                    if (utils_getActualDomain(win) === utils_getActualDomain(window)) return !0;\n                } catch (err) {}\n                return !1;\n            }(win)) return !1;\n            try {\n                if (win === window) return !0;\n                if (utils_isAboutProtocol(win) && utils_canReadFromWindow()) return !0;\n                if (utils_getDomain(window) === utils_getDomain(win)) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_assertSameDomain(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Expected window to be same domain\");\n            return win;\n        }\n        function utils_isAncestorParent(parent, child) {\n            if (!parent || !child) return !1;\n            var childParent = src_utils_getParent(child);\n            return childParent ? childParent === parent : -1 !== function(win) {\n                var result = [];\n                try {\n                    for (;win.parent !== win; ) {\n                        result.push(win.parent);\n                        win = win.parent;\n                    }\n                } catch (err) {}\n                return result;\n            }(child).indexOf(parent);\n        }\n        function utils_getFrames(win) {\n            var result = [];\n            var frames;\n            try {\n                frames = win.frames;\n            } catch (err) {\n                frames = win;\n            }\n            var len;\n            try {\n                len = frames.length;\n            } catch (err) {}\n            if (0 === len) return result;\n            if (len) {\n                for (var i = 0; i < len; i++) {\n                    var frame = void 0;\n                    try {\n                        frame = frames[i];\n                    } catch (err) {\n                        continue;\n                    }\n                    result.push(frame);\n                }\n                return result;\n            }\n            for (var _i = 0; _i < 100; _i++) {\n                var _frame = void 0;\n                try {\n                    _frame = frames[_i];\n                } catch (err) {\n                    return result;\n                }\n                if (!_frame) return result;\n                result.push(_frame);\n            }\n            return result;\n        }\n        function utils_getAllChildFrames(win) {\n            var result = [];\n            for (var _i3 = 0, _getFrames2 = utils_getFrames(win); _i3 < _getFrames2.length; _i3++) {\n                var frame = _getFrames2[_i3];\n                result.push(frame);\n                for (var _i5 = 0, _getAllChildFrames2 = utils_getAllChildFrames(frame); _i5 < _getAllChildFrames2.length; _i5++) result.push(_getAllChildFrames2[_i5]);\n            }\n            return result;\n        }\n        function utils_getTop(win) {\n            void 0 === win && (win = window);\n            try {\n                if (win.top) return win.top;\n            } catch (err) {}\n            if (src_utils_getParent(win) === win) return win;\n            try {\n                if (utils_isAncestorParent(window, win) && window.top) return window.top;\n            } catch (err) {}\n            try {\n                if (utils_isAncestorParent(win, window) && window.top) return window.top;\n            } catch (err) {}\n            for (var _i7 = 0, _getAllChildFrames4 = utils_getAllChildFrames(win); _i7 < _getAllChildFrames4.length; _i7++) {\n                var frame = _getAllChildFrames4[_i7];\n                try {\n                    if (frame.top) return frame.top;\n                } catch (err) {}\n                if (src_utils_getParent(frame) === frame) return frame;\n            }\n        }\n        function utils_getAllFramesInWindow(win) {\n            var top = utils_getTop(win);\n            if (!top) throw new Error(\"Can not determine top window\");\n            var result = [].concat(utils_getAllChildFrames(top), [ top ]);\n            -1 === result.indexOf(win) && (result = [].concat(result, [ win ], utils_getAllChildFrames(win)));\n            return result;\n        }\n        var utils_iframeWindows = [];\n        var utils_iframeFrames = [];\n        function utils_isWindowClosed(win, allowMock) {\n            void 0 === allowMock && (allowMock = !0);\n            try {\n                if (win === window) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (!win) return !0;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (win.closed) return !0;\n            } catch (err) {\n                return !err || \"Call was rejected by callee.\\r\\n\" !== err.message;\n            }\n            if (allowMock && utils_isSameDomain(win)) try {\n                if (win.mockclosed) return !0;\n            } catch (err) {}\n            try {\n                if (!win.parent || !win.top) return !0;\n            } catch (err) {}\n            var iframeIndex = function(collection, item) {\n                for (var i = 0; i < collection.length; i++) try {\n                    if (collection[i] === item) return i;\n                } catch (err) {}\n                return -1;\n            }(utils_iframeWindows, win);\n            if (-1 !== iframeIndex) {\n                var frame = utils_iframeFrames[iframeIndex];\n                if (frame && function(frame) {\n                    if (!frame.contentWindow) return !0;\n                    if (!frame.parentNode) return !0;\n                    var doc = frame.ownerDocument;\n                    if (doc && doc.documentElement && !doc.documentElement.contains(frame)) {\n                        var parent = frame;\n                        for (;parent.parentNode && parent.parentNode !== parent; ) parent = parent.parentNode;\n                        if (!parent.host || !doc.documentElement.contains(parent.host)) return !0;\n                    }\n                    return !1;\n                }(frame)) return !0;\n            }\n            return !1;\n        }\n        function utils_getFrameByName(win, name) {\n            var winFrames = utils_getFrames(win);\n            for (var _i9 = 0; _i9 < winFrames.length; _i9++) {\n                var childFrame = winFrames[_i9];\n                try {\n                    if (utils_isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame;\n                } catch (err) {}\n            }\n            try {\n                if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name];\n            } catch (err) {}\n            try {\n                if (-1 !== winFrames.indexOf(win[name])) return win[name];\n            } catch (err) {}\n        }\n        function utils_getAncestor(win) {\n            void 0 === win && (win = window);\n            return utils_getOpener(win = win || window) || src_utils_getParent(win) || void 0;\n        }\n        function utils_anyMatch(collection1, collection2) {\n            for (var _i17 = 0; _i17 < collection1.length; _i17++) {\n                var item1 = collection1[_i17];\n                for (var _i19 = 0; _i19 < collection2.length; _i19++) if (item1 === collection2[_i19]) return !0;\n            }\n            return !1;\n        }\n        function utils_getDistanceFromTop(win) {\n            void 0 === win && (win = window);\n            var distance = 0;\n            var parent = win;\n            for (;parent; ) (parent = src_utils_getParent(parent)) && (distance += 1);\n            return distance;\n        }\n        function utils_matchDomain(pattern, origin) {\n            if (\"string\" == typeof pattern) {\n                if (\"string\" == typeof origin) return \"*\" === pattern || origin === pattern;\n                if (src_util_isRegex(origin)) return !1;\n                if (Array.isArray(origin)) return !1;\n            }\n            return src_util_isRegex(pattern) ? src_util_isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !src_util_isRegex(origin) && pattern.some((function(subpattern) {\n                return utils_matchDomain(subpattern, origin);\n            })));\n        }\n        function utils_getDomainFromUrl(url) {\n            return url.match(/^(https?|mock|file):\\/\\//) ? url.split(\"/\").slice(0, 3).join(\"/\") : utils_getDomain();\n        }\n        function utils_onCloseWindow(win, callback, delay, maxtime) {\n            void 0 === delay && (delay = 1e3);\n            void 0 === maxtime && (maxtime = 1 / 0);\n            var timeout;\n            !function check() {\n                if (utils_isWindowClosed(win)) {\n                    timeout && clearTimeout(timeout);\n                    return callback();\n                }\n                if (maxtime <= 0) clearTimeout(timeout); else {\n                    maxtime -= delay;\n                    timeout = setTimeout(check, delay);\n                }\n            }();\n            return {\n                cancel: function() {\n                    timeout && clearTimeout(timeout);\n                }\n            };\n        }\n        function utils_isWindow(obj) {\n            try {\n                if (obj === window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (\"[object Window]\" === {}.toString.call(obj)) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (window.Window && obj instanceof window.Window) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.self === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.parent === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && obj.top === obj) return !0;\n            } catch (err) {\n                if (err && \"Call was rejected by callee.\\r\\n\" === err.message) return !0;\n            }\n            try {\n                if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n            } catch (err) {\n                return !0;\n            }\n            try {\n                if (\"postMessage\" in obj && \"self\" in obj && \"location\" in obj) return !0;\n            } catch (err) {}\n            return !1;\n        }\n        function utils_normalizeMockUrl(url) {\n            if (!(domain = utils_getDomainFromUrl(url), 0 === domain.indexOf(\"mock:\"))) return url;\n            var domain;\n            throw new Error(\"Mock urls not supported out of test mode\");\n        }\n        function lib_global_getGlobal(win) {\n            if (!utils_isSameDomain(win)) throw new Error(\"Can not get global for window on different domain\");\n            win.__zoid_9_0_87__ || (win.__zoid_9_0_87__ = {});\n            return win.__zoid_9_0_87__;\n        }\n        function tryGlobal(win, handler) {\n            try {\n                return handler(lib_global_getGlobal(win));\n            } catch (err) {}\n        }\n        function getProxyObject(obj) {\n            return {\n                get: function() {\n                    var _this = this;\n                    return promise_ZalgoPromise.try((function() {\n                        if (_this.source && _this.source !== window) throw new Error(\"Can not call get on proxy object from a remote window\");\n                        return obj;\n                    }));\n                }\n            };\n        }\n        function basicSerialize(data) {\n            return base64encode(JSON.stringify(data));\n        }\n        function getUIDRefStore(win) {\n            var global = lib_global_getGlobal(win);\n            global.references = global.references || {};\n            return global.references;\n        }\n        function crossDomainSerialize(_ref) {\n            var data = _ref.data, metaData = _ref.metaData, sender = _ref.sender, receiver = _ref.receiver, _ref$passByReference = _ref.passByReference, passByReference = void 0 !== _ref$passByReference && _ref$passByReference, _ref$basic = _ref.basic, basic = void 0 !== _ref$basic && _ref$basic;\n            var proxyWin = setup_toProxyWindow(receiver.win);\n            var serializedMessage = basic ? JSON.stringify(data) : serializeMessage(proxyWin, receiver.domain, data, {\n                on: on_on,\n                send: send_send\n            });\n            var reference = passByReference ? function(val) {\n                var uid = uniqueID();\n                getUIDRefStore(window)[uid] = val;\n                return {\n                    type: \"uid\",\n                    uid: uid\n                };\n            }(serializedMessage) : {\n                type: \"raw\",\n                val: serializedMessage\n            };\n            return {\n                serializedData: basicSerialize({\n                    sender: {\n                        domain: sender.domain\n                    },\n                    metaData: metaData,\n                    reference: reference\n                }),\n                cleanReference: function() {\n                    win = window, \"uid\" === (ref = reference).type && delete getUIDRefStore(win)[ref.uid];\n                    var win, ref;\n                }\n            };\n        }\n        function crossDomainDeserialize(_ref2) {\n            var sender = _ref2.sender, _ref2$basic = _ref2.basic, basic = void 0 !== _ref2$basic && _ref2$basic;\n            var message = function(serializedData) {\n                return JSON.parse(function(str) {\n                    if (\"function\" == typeof atob) return decodeURIComponent([].map.call(atob(str), (function(c) {\n                        return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\n                    })).join(\"\"));\n                    if (\"undefined\" != typeof Buffer) return Buffer.from(str, \"base64\").toString(\"utf8\");\n                    throw new Error(\"Can not find window.atob or Buffer\");\n                }(serializedData));\n            }(_ref2.data);\n            var reference = message.reference, metaData = message.metaData;\n            var win;\n            win = \"function\" == typeof sender.win ? sender.win({\n                metaData: metaData\n            }) : sender.win;\n            var domain;\n            domain = \"function\" == typeof sender.domain ? sender.domain({\n                metaData: metaData\n            }) : \"string\" == typeof sender.domain ? sender.domain : message.sender.domain;\n            var serializedData = function(win, ref) {\n                if (\"raw\" === ref.type) return ref.val;\n                if (\"uid\" === ref.type) return getUIDRefStore(win)[ref.uid];\n                throw new Error(\"Unsupported ref type: \" + ref.type);\n            }(win, reference);\n            return {\n                data: basic ? JSON.parse(serializedData) : function(source, origin, message) {\n                    return deserializeMessage(source, origin, message, {\n                        on: on_on,\n                        send: send_send\n                    });\n                }(win, domain, serializedData),\n                metaData: metaData,\n                sender: {\n                    win: win,\n                    domain: domain\n                },\n                reference: reference\n            };\n        }\n        var PROP_TYPE = {\n            STRING: \"string\",\n            OBJECT: \"object\",\n            FUNCTION: \"function\",\n            BOOLEAN: \"boolean\",\n            NUMBER: \"number\",\n            ARRAY: \"array\"\n        };\n        var PROP_SERIALIZATION = {\n            JSON: \"json\",\n            DOTIFY: \"dotify\",\n            BASE64: \"base64\"\n        };\n        var CONTEXT = {\n            IFRAME: \"iframe\",\n            POPUP: \"popup\"\n        };\n        var EVENT = {\n            RENDER: \"zoid-render\",\n            RENDERED: \"zoid-rendered\",\n            DISPLAY: \"zoid-display\",\n            ERROR: \"zoid-error\",\n            CLOSE: \"zoid-close\",\n            DESTROY: \"zoid-destroy\",\n            PROPS: \"zoid-props\",\n            RESIZE: \"zoid-resize\",\n            FOCUS: \"zoid-focus\"\n        };\n        function buildChildWindowName(_ref) {\n            return \"__zoid__\" + _ref.name + \"__\" + _ref.serializedPayload + \"__\";\n        }\n        function parseWindowName(windowName) {\n            if (!windowName) throw new Error(\"No window name\");\n            var _windowName$split = windowName.split(\"__\"), zoidcomp = _windowName$split[1], name = _windowName$split[2], serializedInitialPayload = _windowName$split[3];\n            if (\"zoid\" !== zoidcomp) throw new Error(\"Window not rendered by zoid - got \" + zoidcomp);\n            if (!name) throw new Error(\"Expected component name\");\n            if (!serializedInitialPayload) throw new Error(\"Expected serialized payload ref\");\n            return {\n                name: name,\n                serializedInitialPayload: serializedInitialPayload\n            };\n        }\n        var parseInitialParentPayload = memoize((function(windowName) {\n            var _crossDomainDeseriali = crossDomainDeserialize({\n                data: parseWindowName(windowName).serializedInitialPayload,\n                sender: {\n                    win: function(_ref2) {\n                        return function(windowRef) {\n                            if (\"opener\" === windowRef.type) return assertExists(\"opener\", utils_getOpener(window));\n                            if (\"parent\" === windowRef.type && \"number\" == typeof windowRef.distance) return assertExists(\"parent\", function(win, n) {\n                                void 0 === n && (n = 1);\n                                return function(win, n) {\n                                    void 0 === n && (n = 1);\n                                    var parent = win;\n                                    for (var i = 0; i < n; i++) {\n                                        if (!parent) return;\n                                        parent = src_utils_getParent(parent);\n                                    }\n                                    return parent;\n                                }(win, utils_getDistanceFromTop(win) - n);\n                            }(window, windowRef.distance));\n                            if (\"global\" === windowRef.type && windowRef.uid && \"string\" == typeof windowRef.uid) {\n                                var _ret = function() {\n                                    var uid = windowRef.uid;\n                                    var ancestor = utils_getAncestor(window);\n                                    if (!ancestor) throw new Error(\"Can not find ancestor window\");\n                                    for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(ancestor); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                        var frame = _getAllFramesInWindow2[_i2];\n                                        if (utils_isSameDomain(frame)) {\n                                            var win = tryGlobal(frame, (function(global) {\n                                                return global.windows && global.windows[uid];\n                                            }));\n                                            if (win) return {\n                                                v: win\n                                            };\n                                        }\n                                    }\n                                }();\n                                if (\"object\" == typeof _ret) return _ret.v;\n                            } else if (\"name\" === windowRef.type) {\n                                var name = windowRef.name;\n                                return assertExists(\"namedWindow\", function(win, name) {\n                                    return utils_getFrameByName(win, name) || function utils_findChildFrameByName(win, name) {\n                                        var frame = utils_getFrameByName(win, name);\n                                        if (frame) return frame;\n                                        for (var _i11 = 0, _getFrames4 = utils_getFrames(win); _i11 < _getFrames4.length; _i11++) {\n                                            var namedFrame = utils_findChildFrameByName(_getFrames4[_i11], name);\n                                            if (namedFrame) return namedFrame;\n                                        }\n                                    }(utils_getTop(win) || win, name);\n                                }(assertExists(\"ancestor\", utils_getAncestor(window)), name));\n                            }\n                            throw new Error(\"Unable to find \" + windowRef.type + \" parent component window\");\n                        }(_ref2.metaData.windowRef);\n                    }\n                }\n            });\n            return {\n                parent: _crossDomainDeseriali.sender,\n                payload: _crossDomainDeseriali.data,\n                reference: _crossDomainDeseriali.reference\n            };\n        }));\n        function getInitialParentPayload() {\n            return parseInitialParentPayload(window.name);\n        }\n        function window_getWindowRef(targetWindow, currentWindow) {\n            void 0 === currentWindow && (currentWindow = window);\n            if (targetWindow === src_utils_getParent(currentWindow)) return {\n                type: \"parent\",\n                distance: utils_getDistanceFromTop(targetWindow)\n            };\n            if (targetWindow === utils_getOpener(currentWindow)) return {\n                type: \"opener\"\n            };\n            if (utils_isSameDomain(targetWindow) && !(win = targetWindow, win === utils_getTop(win))) {\n                var windowName = utils_assertSameDomain(targetWindow).name;\n                if (windowName) return {\n                    type: \"name\",\n                    name: windowName\n                };\n            }\n            var win;\n        }\n        function normalizeChildProp(propsDef, props, key, value, helpers) {\n            if (!propsDef.hasOwnProperty(key)) return value;\n            var prop = propsDef[key];\n            return \"function\" == typeof prop.childDecorate ? prop.childDecorate({\n                value: value,\n                uid: helpers.uid,\n                tag: helpers.tag,\n                close: helpers.close,\n                focus: helpers.focus,\n                onError: helpers.onError,\n                onProps: helpers.onProps,\n                resize: helpers.resize,\n                getParent: helpers.getParent,\n                getParentDomain: helpers.getParentDomain,\n                show: helpers.show,\n                hide: helpers.hide,\n                export: helpers.export,\n                getSiblings: helpers.getSiblings\n            }) : value;\n        }\n        function child_focus() {\n            return promise_ZalgoPromise.try((function() {\n                window.focus();\n            }));\n        }\n        function child_destroy() {\n            return promise_ZalgoPromise.try((function() {\n                window.close();\n            }));\n        }\n        var props_defaultNoop = function() {\n            return src_util_noop;\n        };\n        var props_decorateOnce = function(_ref) {\n            return once(_ref.value);\n        };\n        function eachProp(props, propsDef, handler) {\n            for (var _i2 = 0, _Object$keys2 = Object.keys(_extends({}, props, propsDef)); _i2 < _Object$keys2.length; _i2++) {\n                var key = _Object$keys2[_i2];\n                handler(key, propsDef[key], props[key]);\n            }\n        }\n        function serializeProps(propsDef, props, method) {\n            var params = {};\n            return promise_ZalgoPromise.all(function(props, propsDef, handler) {\n                var results = [];\n                eachProp(props, propsDef, (function(key, propDef, value) {\n                    var result = function(key, propDef, value) {\n                        return promise_ZalgoPromise.resolve().then((function() {\n                            var _METHOD$GET$METHOD$PO, _METHOD$GET$METHOD$PO2;\n                            if (null != value && propDef) {\n                                var getParam = (_METHOD$GET$METHOD$PO = {}, _METHOD$GET$METHOD$PO.get = propDef.queryParam, \n                                _METHOD$GET$METHOD$PO.post = propDef.bodyParam, _METHOD$GET$METHOD$PO)[method];\n                                var getValue = (_METHOD$GET$METHOD$PO2 = {}, _METHOD$GET$METHOD$PO2.get = propDef.queryValue, \n                                _METHOD$GET$METHOD$PO2.post = propDef.bodyValue, _METHOD$GET$METHOD$PO2)[method];\n                                if (getParam) return promise_ZalgoPromise.hash({\n                                    finalParam: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getParam ? getParam({\n                                            value: value\n                                        }) : \"string\" == typeof getParam ? getParam : key;\n                                    })),\n                                    finalValue: promise_ZalgoPromise.try((function() {\n                                        return \"function\" == typeof getValue && isDefined(value) ? getValue({\n                                            value: value\n                                        }) : value;\n                                    }))\n                                }).then((function(_ref) {\n                                    var finalParam = _ref.finalParam, finalValue = _ref.finalValue;\n                                    var result;\n                                    if (\"boolean\" == typeof finalValue) result = finalValue.toString(); else if (\"string\" == typeof finalValue) result = finalValue.toString(); else if (\"object\" == typeof finalValue && null !== finalValue) {\n                                        if (propDef.serialization === PROP_SERIALIZATION.JSON) result = JSON.stringify(finalValue); else if (propDef.serialization === PROP_SERIALIZATION.BASE64) result = base64encode(JSON.stringify(finalValue)); else if (propDef.serialization === PROP_SERIALIZATION.DOTIFY || !propDef.serialization) {\n                                            result = function dotify(obj, prefix, newobj) {\n                                                void 0 === prefix && (prefix = \"\");\n                                                void 0 === newobj && (newobj = {});\n                                                prefix = prefix ? prefix + \".\" : prefix;\n                                                for (var key in obj) obj.hasOwnProperty(key) && null != obj[key] && \"function\" != typeof obj[key] && (obj[key] && Array.isArray(obj[key]) && obj[key].length && obj[key].every((function(val) {\n                                                    return \"object\" != typeof val;\n                                                })) ? newobj[\"\" + prefix + key + \"[]\"] = obj[key].join(\",\") : obj[key] && \"object\" == typeof obj[key] ? newobj = dotify(obj[key], \"\" + prefix + key, newobj) : newobj[\"\" + prefix + key] = obj[key].toString());\n                                                return newobj;\n                                            }(finalValue, key);\n                                            for (var _i2 = 0, _Object$keys2 = Object.keys(result); _i2 < _Object$keys2.length; _i2++) {\n                                                var dotkey = _Object$keys2[_i2];\n                                                params[dotkey] = result[dotkey];\n                                            }\n                                            return;\n                                        }\n                                    } else \"number\" == typeof finalValue && (result = finalValue.toString());\n                                    params[finalParam] = result;\n                                }));\n                            }\n                        }));\n                    }(key, propDef, value);\n                    results.push(result);\n                }));\n                return results;\n            }(props, propsDef)).then((function() {\n                return params;\n            }));\n        }\n        function parentComponent(_ref) {\n            var uid = _ref.uid, options = _ref.options, _ref$overrides = _ref.overrides, overrides = void 0 === _ref$overrides ? {} : _ref$overrides, _ref$parentWin = _ref.parentWin, parentWin = void 0 === _ref$parentWin ? window : _ref$parentWin;\n            var propsDef = options.propsDef, containerTemplate = options.containerTemplate, prerenderTemplate = options.prerenderTemplate, tag = options.tag, name = options.name, attributes = options.attributes, dimensions = options.dimensions, autoResize = options.autoResize, url = options.url, domainMatch = options.domain, xports = options.exports;\n            var initPromise = new promise_ZalgoPromise;\n            var handledErrors = [];\n            var clean = cleanup();\n            var state = {};\n            var inputProps = {};\n            var internalState = {\n                visible: !0\n            };\n            var event = overrides.event ? overrides.event : (triggered = {}, handlers = {}, \n            emitter = {\n                on: function(eventName, handler) {\n                    var handlerList = handlers[eventName] = handlers[eventName] || [];\n                    handlerList.push(handler);\n                    var cancelled = !1;\n                    return {\n                        cancel: function() {\n                            if (!cancelled) {\n                                cancelled = !0;\n                                handlerList.splice(handlerList.indexOf(handler), 1);\n                            }\n                        }\n                    };\n                },\n                once: function(eventName, handler) {\n                    var listener = emitter.on(eventName, (function() {\n                        listener.cancel();\n                        handler();\n                    }));\n                    return listener;\n                },\n                trigger: function(eventName) {\n                    for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n                    var handlerList = handlers[eventName];\n                    var promises = [];\n                    if (handlerList) {\n                        var _loop = function(_i2) {\n                            var handler = handlerList[_i2];\n                            promises.push(promise_ZalgoPromise.try((function() {\n                                return handler.apply(void 0, args);\n                            })));\n                        };\n                        for (var _i2 = 0; _i2 < handlerList.length; _i2++) _loop(_i2);\n                    }\n                    return promise_ZalgoPromise.all(promises).then(src_util_noop);\n                },\n                triggerOnce: function(eventName) {\n                    if (triggered[eventName]) return promise_ZalgoPromise.resolve();\n                    triggered[eventName] = !0;\n                    for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];\n                    return emitter.trigger.apply(emitter, [ eventName ].concat(args));\n                },\n                reset: function() {\n                    handlers = {};\n                }\n            });\n            var triggered, handlers, emitter;\n            var props = overrides.props ? overrides.props : {};\n            var currentProxyWin;\n            var currentProxyContainer;\n            var childComponent;\n            var currentChildDomain;\n            var currentContainer;\n            var onErrorOverride = overrides.onError;\n            var getProxyContainerOverride = overrides.getProxyContainer;\n            var showOverride = overrides.show;\n            var hideOverride = overrides.hide;\n            var closeOverride = overrides.close;\n            var renderContainerOverride = overrides.renderContainer;\n            var getProxyWindowOverride = overrides.getProxyWindow;\n            var setProxyWinOverride = overrides.setProxyWin;\n            var openFrameOverride = overrides.openFrame;\n            var openPrerenderFrameOverride = overrides.openPrerenderFrame;\n            var prerenderOverride = overrides.prerender;\n            var openOverride = overrides.open;\n            var openPrerenderOverride = overrides.openPrerender;\n            var watchForUnloadOverride = overrides.watchForUnload;\n            var getInternalStateOverride = overrides.getInternalState;\n            var setInternalStateOverride = overrides.setInternalState;\n            var getDimensions = function() {\n                return \"function\" == typeof dimensions ? dimensions({\n                    props: props\n                }) : dimensions;\n            };\n            var resolveInitPromise = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.resolveInitPromise ? overrides.resolveInitPromise() : initPromise.resolve();\n                }));\n            };\n            var rejectInitPromise = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return overrides.rejectInitPromise ? overrides.rejectInitPromise(err) : initPromise.reject(err);\n                }));\n            };\n            var getPropsForChild = function(initialChildDomain) {\n                var result = {};\n                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                    var key = _Object$keys2[_i2];\n                    var prop = propsDef[key];\n                    prop && !1 === prop.sendToChild || prop && prop.sameDomain && !utils_matchDomain(initialChildDomain, utils_getDomain(window)) || (result[key] = props[key]);\n                }\n                return promise_ZalgoPromise.hash(result);\n            };\n            var getInternalState = function() {\n                return promise_ZalgoPromise.try((function() {\n                    return getInternalStateOverride ? getInternalStateOverride() : internalState;\n                }));\n            };\n            var setInternalState = function(newInternalState) {\n                return promise_ZalgoPromise.try((function() {\n                    return setInternalStateOverride ? setInternalStateOverride(newInternalState) : internalState = _extends({}, internalState, newInternalState);\n                }));\n            };\n            var getProxyWindow = function() {\n                return getProxyWindowOverride ? getProxyWindowOverride() : promise_ZalgoPromise.try((function() {\n                    var windowProp = props.window;\n                    if (windowProp) {\n                        var _proxyWin = setup_toProxyWindow(windowProp);\n                        clean.register((function() {\n                            return windowProp.close();\n                        }));\n                        return _proxyWin;\n                    }\n                    return new window_ProxyWindow({\n                        send: send_send\n                    });\n                }));\n            };\n            var setProxyWin = function(proxyWin) {\n                return setProxyWinOverride ? setProxyWinOverride(proxyWin) : promise_ZalgoPromise.try((function() {\n                    currentProxyWin = proxyWin;\n                }));\n            };\n            var show = function() {\n                return showOverride ? showOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !0\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(showElement) : null\n                }).then(src_util_noop);\n            };\n            var hide = function() {\n                return hideOverride ? hideOverride() : promise_ZalgoPromise.hash({\n                    setState: setInternalState({\n                        visible: !1\n                    }),\n                    showElement: currentProxyContainer ? currentProxyContainer.get().then(hideElement) : null\n                }).then(src_util_noop);\n            };\n            var getUrl = function() {\n                return \"function\" == typeof url ? url({\n                    props: props\n                }) : url;\n            };\n            var getAttributes = function() {\n                return \"function\" == typeof attributes ? attributes({\n                    props: props\n                }) : attributes;\n            };\n            var getInitialChildDomain = function() {\n                return utils_getDomainFromUrl(getUrl());\n            };\n            var openFrame = function(context, _ref2) {\n                var windowName = _ref2.windowName;\n                return openFrameOverride ? openFrameOverride(context, {\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: windowName,\n                            title: name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerenderFrame = function(context) {\n                return openPrerenderFrameOverride ? openPrerenderFrameOverride(context) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) return getProxyObject(dom_iframe({\n                        attributes: _extends({\n                            name: \"__zoid_prerender_frame__\" + name + \"_\" + uniqueID() + \"__\",\n                            title: \"prerender__\" + name\n                        }, getAttributes().iframe)\n                    }));\n                }));\n            };\n            var openPrerender = function(context, proxyWin, proxyPrerenderFrame) {\n                return openPrerenderOverride ? openPrerenderOverride(context, proxyWin, proxyPrerenderFrame) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyPrerenderFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyPrerenderFrame.get().then((function(prerenderFrame) {\n                            clean.register((function() {\n                                return destroyElement(prerenderFrame);\n                            }));\n                            return awaitFrameWindow(prerenderFrame).then((function(prerenderFrameWindow) {\n                                return utils_assertSameDomain(prerenderFrameWindow);\n                            })).then((function(win) {\n                                return setup_toProxyWindow(win);\n                            }));\n                        }));\n                    }\n                    if (context === CONTEXT.POPUP) return proxyWin;\n                    throw new Error(\"No render context available for \" + context);\n                }));\n            };\n            var focus = function() {\n                return promise_ZalgoPromise.try((function() {\n                    if (currentProxyWin) return promise_ZalgoPromise.all([ event.trigger(EVENT.FOCUS), currentProxyWin.focus() ]).then(src_util_noop);\n                }));\n            };\n            var getCurrentWindowReferenceUID = function() {\n                var global = lib_global_getGlobal(window);\n                global.windows = global.windows || {};\n                global.windows[uid] = window;\n                clean.register((function() {\n                    delete global.windows[uid];\n                }));\n                return uid;\n            };\n            var getWindowRef = function(target, initialChildDomain, context, proxyWin) {\n                if (initialChildDomain === utils_getDomain(window)) return {\n                    type: \"global\",\n                    uid: getCurrentWindowReferenceUID()\n                };\n                if (target !== window) throw new Error(\"Can not construct cross-domain window reference for different target window\");\n                if (props.window) {\n                    var actualComponentWindow = proxyWin.getWindow();\n                    if (!actualComponentWindow) throw new Error(\"Can not construct cross-domain window reference for lazy window prop\");\n                    if (utils_getAncestor(actualComponentWindow) !== window) throw new Error(\"Can not construct cross-domain window reference for window prop with different ancestor\");\n                }\n                if (context === CONTEXT.POPUP) return {\n                    type: \"opener\"\n                };\n                if (context === CONTEXT.IFRAME) return {\n                    type: \"parent\",\n                    distance: utils_getDistanceFromTop(window)\n                };\n                throw new Error(\"Can not construct window reference for child\");\n            };\n            var initChild = function(childDomain, childExports) {\n                return promise_ZalgoPromise.try((function() {\n                    currentChildDomain = childDomain;\n                    childComponent = childExports;\n                    resolveInitPromise();\n                    clean.register((function() {\n                        return childExports.close.fireAndForget().catch(src_util_noop);\n                    }));\n                }));\n            };\n            var resize = function(_ref3) {\n                var width = _ref3.width, height = _ref3.height;\n                return promise_ZalgoPromise.try((function() {\n                    event.trigger(EVENT.RESIZE, {\n                        width: width,\n                        height: height\n                    });\n                }));\n            };\n            var destroy = function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    return event.trigger(EVENT.DESTROY);\n                })).catch(src_util_noop).then((function() {\n                    return clean.all(err);\n                })).then((function() {\n                    initPromise.asyncReject(err || new Error(\"Component destroyed\"));\n                }));\n            };\n            var close = memoize((function(err) {\n                return promise_ZalgoPromise.try((function() {\n                    if (closeOverride) {\n                        if (utils_isWindowClosed(closeOverride.__source__)) return;\n                        return closeOverride();\n                    }\n                    return promise_ZalgoPromise.try((function() {\n                        return event.trigger(EVENT.CLOSE);\n                    })).then((function() {\n                        return destroy(err || new Error(\"Component closed\"));\n                    }));\n                }));\n            }));\n            var open = function(context, _ref4) {\n                var proxyWin = _ref4.proxyWin, proxyFrame = _ref4.proxyFrame, windowName = _ref4.windowName;\n                return openOverride ? openOverride(context, {\n                    proxyWin: proxyWin,\n                    proxyFrame: proxyFrame,\n                    windowName: windowName\n                }) : promise_ZalgoPromise.try((function() {\n                    if (context === CONTEXT.IFRAME) {\n                        if (!proxyFrame) throw new Error(\"Expected proxy frame to be passed\");\n                        return proxyFrame.get().then((function(frame) {\n                            return awaitFrameWindow(frame).then((function(win) {\n                                clean.register((function() {\n                                    return destroyElement(frame);\n                                }));\n                                clean.register((function() {\n                                    return cleanUpWindow(win);\n                                }));\n                                return win;\n                            }));\n                        }));\n                    }\n                    if (context === CONTEXT.POPUP) {\n                        var _getDimensions = getDimensions(), _getDimensions$width = _getDimensions.width, width = void 0 === _getDimensions$width ? \"300px\" : _getDimensions$width, _getDimensions$height = _getDimensions.height, height = void 0 === _getDimensions$height ? \"150px\" : _getDimensions$height;\n                        width = normalizeDimension(width, window.outerWidth);\n                        height = normalizeDimension(height, window.outerWidth);\n                        var win = function(url, options) {\n                            var _options$closeOnUnloa = (options = options || {}).closeOnUnload, closeOnUnload = void 0 === _options$closeOnUnloa ? 1 : _options$closeOnUnloa, _options$name = options.name, name = void 0 === _options$name ? \"\" : _options$name, width = options.width, height = options.height;\n                            var top = 0;\n                            var left = 0;\n                            width && (window.outerWidth ? left = Math.round((window.outerWidth - width) / 2) + window.screenX : window.screen.width && (left = Math.round((window.screen.width - width) / 2)));\n                            height && (window.outerHeight ? top = Math.round((window.outerHeight - height) / 2) + window.screenY : window.screen.height && (top = Math.round((window.screen.height - height) / 2)));\n                            delete options.closeOnUnload;\n                            delete options.name;\n                            width && height && (options = _extends({\n                                top: top,\n                                left: left,\n                                width: width,\n                                height: height,\n                                status: 1,\n                                toolbar: 0,\n                                menubar: 0,\n                                resizable: 1,\n                                scrollbars: 1\n                            }, options));\n                            var params = Object.keys(options).map((function(key) {\n                                if (null != options[key]) return key + \"=\" + stringify(options[key]);\n                            })).filter(Boolean).join(\",\");\n                            var win;\n                            try {\n                                win = window.open(\"\", name, params);\n                            } catch (err) {\n                                throw new dom_PopupOpenError(\"Can not open popup window - \" + (err.stack || err.message));\n                            }\n                            if (isWindowClosed(win)) {\n                                var err;\n                                throw new dom_PopupOpenError(\"Can not open popup window - blocked\");\n                            }\n                            closeOnUnload && window.addEventListener(\"unload\", (function() {\n                                return win.close();\n                            }));\n                            return win;\n                        }(0, _extends({\n                            name: windowName,\n                            width: width,\n                            height: height\n                        }, getAttributes().popup));\n                        clean.register((function() {\n                            return function(win) {\n                                if (function(win) {\n                                    void 0 === win && (win = window);\n                                    return Boolean(src_utils_getParent(win));\n                                }(win)) {\n                                    var frame = function(win) {\n                                        if (utils_isSameDomain(win)) return utils_assertSameDomain(win).frameElement;\n                                        for (var _i21 = 0, _document$querySelect2 = document.querySelectorAll(\"iframe\"); _i21 < _document$querySelect2.length; _i21++) {\n                                            var frame = _document$querySelect2[_i21];\n                                            if (frame && frame.contentWindow && frame.contentWindow === win) return frame;\n                                        }\n                                    }(win);\n                                    if (frame && frame.parentElement) {\n                                        frame.parentElement.removeChild(frame);\n                                        return;\n                                    }\n                                }\n                                try {\n                                    win.close();\n                                } catch (err) {}\n                            }(win);\n                        }));\n                        clean.register((function() {\n                            return cleanUpWindow(win);\n                        }));\n                        return win;\n                    }\n                    throw new Error(\"No render context available for \" + context);\n                })).then((function(win) {\n                    proxyWin.setWindow(win, {\n                        send: send_send\n                    });\n                    return proxyWin.setName(windowName).then((function() {\n                        return proxyWin;\n                    }));\n                }));\n            };\n            var watchForUnload = function() {\n                return promise_ZalgoPromise.try((function() {\n                    var unloadWindowListener = addEventListener(window, \"unload\", once((function() {\n                        destroy(new Error(\"Window navigated away\"));\n                    })));\n                    var closeParentWindowListener = utils_onCloseWindow(parentWin, destroy, 3e3);\n                    clean.register(closeParentWindowListener.cancel);\n                    clean.register(unloadWindowListener.cancel);\n                    if (watchForUnloadOverride) return watchForUnloadOverride();\n                }));\n            };\n            var checkWindowClose = function(proxyWin) {\n                var closed = !1;\n                return proxyWin.isClosed().then((function(isClosed) {\n                    if (isClosed) {\n                        closed = !0;\n                        return close(new Error(\"Detected component window close\"));\n                    }\n                    return promise_ZalgoPromise.delay(200).then((function() {\n                        return proxyWin.isClosed();\n                    })).then((function(secondIsClosed) {\n                        if (secondIsClosed) {\n                            closed = !0;\n                            return close(new Error(\"Detected component window close\"));\n                        }\n                    }));\n                })).then((function() {\n                    return closed;\n                }));\n            };\n            var onError = function(err) {\n                return onErrorOverride ? onErrorOverride(err) : promise_ZalgoPromise.try((function() {\n                    if (-1 === handledErrors.indexOf(err)) {\n                        handledErrors.push(err);\n                        initPromise.asyncReject(err);\n                        return event.trigger(EVENT.ERROR, err);\n                    }\n                }));\n            };\n            var exportsPromise = new promise_ZalgoPromise;\n            var xport = function(actualExports) {\n                return promise_ZalgoPromise.try((function() {\n                    exportsPromise.resolve(actualExports);\n                }));\n            };\n            initChild.onError = onError;\n            var renderTemplate = function(renderer, _ref8) {\n                return renderer({\n                    uid: uid,\n                    container: _ref8.container,\n                    context: _ref8.context,\n                    doc: _ref8.doc,\n                    frame: _ref8.frame,\n                    prerenderFrame: _ref8.prerenderFrame,\n                    focus: focus,\n                    close: close,\n                    state: state,\n                    props: props,\n                    tag: tag,\n                    dimensions: getDimensions(),\n                    event: event\n                });\n            };\n            var prerender = function(proxyPrerenderWin, _ref9) {\n                var context = _ref9.context;\n                return prerenderOverride ? prerenderOverride(proxyPrerenderWin, {\n                    context: context\n                }) : promise_ZalgoPromise.try((function() {\n                    if (prerenderTemplate) {\n                        var prerenderWindow = proxyPrerenderWin.getWindow();\n                        if (prerenderWindow && utils_isSameDomain(prerenderWindow) && function(win) {\n                            try {\n                                if (!win.location.href) return !0;\n                                if (\"about:blank\" === win.location.href) return !0;\n                            } catch (err) {}\n                            return !1;\n                        }(prerenderWindow)) {\n                            var doc = (prerenderWindow = utils_assertSameDomain(prerenderWindow)).document;\n                            var el = renderTemplate(prerenderTemplate, {\n                                context: context,\n                                doc: doc\n                            });\n                            if (el) {\n                                if (el.ownerDocument !== doc) throw new Error(\"Expected prerender template to have been created with document from child window\");\n                                !function(win, el) {\n                                    var tag = el.tagName.toLowerCase();\n                                    if (\"html\" !== tag) throw new Error(\"Expected element to be html, got \" + tag);\n                                    var documentElement = win.document.documentElement;\n                                    for (var _i6 = 0, _arrayFrom2 = arrayFrom(documentElement.children); _i6 < _arrayFrom2.length; _i6++) documentElement.removeChild(_arrayFrom2[_i6]);\n                                    for (var _i8 = 0, _arrayFrom4 = arrayFrom(el.children); _i8 < _arrayFrom4.length; _i8++) documentElement.appendChild(_arrayFrom4[_i8]);\n                                }(prerenderWindow, el);\n                                var _autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, _autoResize$element = autoResize.element, element = void 0 === _autoResize$element ? \"body\" : _autoResize$element;\n                                if ((element = getElementSafe(element, doc)) && (width || height)) {\n                                    var prerenderResizeListener = onResize(element, (function(_ref10) {\n                                        resize({\n                                            width: width ? _ref10.width : void 0,\n                                            height: height ? _ref10.height : void 0\n                                        });\n                                    }), {\n                                        width: width,\n                                        height: height,\n                                        win: prerenderWindow\n                                    });\n                                    event.on(EVENT.RENDERED, prerenderResizeListener.cancel);\n                                }\n                            }\n                        }\n                    }\n                }));\n            };\n            var renderContainer = function(proxyContainer, _ref11) {\n                var proxyFrame = _ref11.proxyFrame, proxyPrerenderFrame = _ref11.proxyPrerenderFrame, context = _ref11.context, rerender = _ref11.rerender;\n                return renderContainerOverride ? renderContainerOverride(proxyContainer, {\n                    proxyFrame: proxyFrame,\n                    proxyPrerenderFrame: proxyPrerenderFrame,\n                    context: context,\n                    rerender: rerender\n                }) : promise_ZalgoPromise.hash({\n                    container: proxyContainer.get(),\n                    frame: proxyFrame ? proxyFrame.get() : null,\n                    prerenderFrame: proxyPrerenderFrame ? proxyPrerenderFrame.get() : null,\n                    internalState: getInternalState()\n                }).then((function(_ref12) {\n                    var container = _ref12.container, visible = _ref12.internalState.visible;\n                    var innerContainer = renderTemplate(containerTemplate, {\n                        context: context,\n                        container: container,\n                        frame: _ref12.frame,\n                        prerenderFrame: _ref12.prerenderFrame,\n                        doc: document\n                    });\n                    if (innerContainer) {\n                        visible || hideElement(innerContainer);\n                        appendChild(container, innerContainer);\n                        var containerWatcher = function(element, handler) {\n                            handler = once(handler);\n                            var cancelled = !1;\n                            var mutationObservers = [];\n                            var interval;\n                            var sacrificialFrame;\n                            var sacrificialFrameWin;\n                            var cancel = function() {\n                                cancelled = !0;\n                                for (var _i18 = 0; _i18 < mutationObservers.length; _i18++) mutationObservers[_i18].disconnect();\n                                interval && interval.cancel();\n                                sacrificialFrameWin && sacrificialFrameWin.removeEventListener(\"unload\", elementClosed);\n                                sacrificialFrame && destroyElement(sacrificialFrame);\n                            };\n                            var elementClosed = function() {\n                                if (!cancelled) {\n                                    handler();\n                                    cancel();\n                                }\n                            };\n                            if (isElementClosed(element)) {\n                                elementClosed();\n                                return {\n                                    cancel: cancel\n                                };\n                            }\n                            if (window.MutationObserver) {\n                                var mutationElement = element.parentElement;\n                                for (;mutationElement; ) {\n                                    var mutationObserver = new window.MutationObserver((function() {\n                                        isElementClosed(element) && elementClosed();\n                                    }));\n                                    mutationObserver.observe(mutationElement, {\n                                        childList: !0\n                                    });\n                                    mutationObservers.push(mutationObserver);\n                                    mutationElement = mutationElement.parentElement;\n                                }\n                            }\n                            (sacrificialFrame = document.createElement(\"iframe\")).setAttribute(\"name\", \"__detect_close_\" + uniqueID() + \"__\");\n                            sacrificialFrame.style.display = \"none\";\n                            awaitFrameWindow(sacrificialFrame).then((function(frameWin) {\n                                (sacrificialFrameWin = assertSameDomain(frameWin)).addEventListener(\"unload\", elementClosed);\n                            }));\n                            element.appendChild(sacrificialFrame);\n                            interval = safeInterval((function() {\n                                isElementClosed(element) && elementClosed();\n                            }), 1e3);\n                            return {\n                                cancel: cancel\n                            };\n                        }(innerContainer, (function() {\n                            var removeError = new Error(\"Detected container element removed from DOM\");\n                            return promise_ZalgoPromise.delay(1).then((function() {\n                                if (!isElementClosed(innerContainer)) {\n                                    clean.all(removeError);\n                                    return rerender().then(resolveInitPromise, rejectInitPromise);\n                                }\n                                close(removeError);\n                            }));\n                        }));\n                        clean.register((function() {\n                            return containerWatcher.cancel();\n                        }));\n                        clean.register((function() {\n                            return destroyElement(innerContainer);\n                        }));\n                        return currentProxyContainer = getProxyObject(innerContainer);\n                    }\n                }));\n            };\n            var getHelpers = function() {\n                return {\n                    state: state,\n                    event: event,\n                    close: close,\n                    focus: focus,\n                    resize: resize,\n                    onError: onError,\n                    updateProps: updateProps,\n                    show: show,\n                    hide: hide\n                };\n            };\n            var setProps = function(newInputProps) {\n                void 0 === newInputProps && (newInputProps = {});\n                var container = currentContainer;\n                var helpers = getHelpers();\n                extend(inputProps, newInputProps);\n                !function(propsDef, existingProps, inputProps, helpers, container) {\n                    var state = helpers.state, close = helpers.close, focus = helpers.focus, event = helpers.event, onError = helpers.onError;\n                    eachProp(inputProps, propsDef, (function(key, propDef, val) {\n                        var valueDetermined = !1;\n                        var value = val;\n                        Object.defineProperty(existingProps, key, {\n                            configurable: !0,\n                            enumerable: !0,\n                            get: function() {\n                                if (valueDetermined) return value;\n                                valueDetermined = !0;\n                                return function() {\n                                    if (!propDef) return value;\n                                    var alias = propDef.alias;\n                                    alias && !isDefined(val) && isDefined(inputProps[alias]) && (value = inputProps[alias]);\n                                    propDef.value && (value = propDef.value({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    !propDef.default || isDefined(value) || isDefined(inputProps[key]) || (value = propDef.default({\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    if (isDefined(value)) {\n                                        if (propDef.type === PROP_TYPE.ARRAY ? !Array.isArray(value) : typeof value !== propDef.type) throw new TypeError(\"Prop is not of type \" + propDef.type + \": \" + key);\n                                    } else if (!1 !== propDef.required && !isDefined(inputProps[key])) throw new Error('Expected prop \"' + key + '\" to be defined');\n                                    isDefined(value) && propDef.decorate && (value = propDef.decorate({\n                                        value: value,\n                                        props: existingProps,\n                                        state: state,\n                                        close: close,\n                                        focus: focus,\n                                        event: event,\n                                        onError: onError,\n                                        container: container\n                                    }));\n                                    return value;\n                                }();\n                            }\n                        });\n                    }));\n                    eachProp(existingProps, propsDef, src_util_noop);\n                }(propsDef, props, inputProps, helpers, container);\n            };\n            var updateProps = function(newProps) {\n                setProps(newProps);\n                return initPromise.then((function() {\n                    var child = childComponent;\n                    var proxyWin = currentProxyWin;\n                    if (child && proxyWin && currentChildDomain) return getPropsForChild(currentChildDomain).then((function(childProps) {\n                        return child.updateProps(childProps).catch((function(err) {\n                            return checkWindowClose(proxyWin).then((function(closed) {\n                                if (!closed) throw err;\n                            }));\n                        }));\n                    }));\n                }));\n            };\n            var getProxyContainer = function(container) {\n                return getProxyContainerOverride ? getProxyContainerOverride(container) : promise_ZalgoPromise.try((function() {\n                    return elementReady(container);\n                })).then((function(containerElement) {\n                    isShadowElement(containerElement) && (containerElement = function insertShadowSlot(element) {\n                        var shadowHost = function(element) {\n                            var shadowRoot = function(element) {\n                                for (;element.parentNode; ) element = element.parentNode;\n                                if (isShadowElement(element)) return element;\n                            }(element);\n                            if (shadowRoot && shadowRoot.host) return shadowRoot.host;\n                        }(element);\n                        if (!shadowHost) throw new Error(\"Element is not in shadow dom\");\n                        var slotName = \"shadow-slot-\" + uniqueID();\n                        var slot = document.createElement(\"slot\");\n                        slot.setAttribute(\"name\", slotName);\n                        element.appendChild(slot);\n                        var slotProvider = document.createElement(\"div\");\n                        slotProvider.setAttribute(\"slot\", slotName);\n                        shadowHost.appendChild(slotProvider);\n                        return isShadowElement(shadowHost) ? insertShadowSlot(slotProvider) : slotProvider;\n                    }(containerElement));\n                    currentContainer = containerElement;\n                    return getProxyObject(containerElement);\n                }));\n            };\n            return {\n                init: function() {\n                    !function() {\n                        event.on(EVENT.RENDER, (function() {\n                            return props.onRender();\n                        }));\n                        event.on(EVENT.DISPLAY, (function() {\n                            return props.onDisplay();\n                        }));\n                        event.on(EVENT.RENDERED, (function() {\n                            return props.onRendered();\n                        }));\n                        event.on(EVENT.CLOSE, (function() {\n                            return props.onClose();\n                        }));\n                        event.on(EVENT.DESTROY, (function() {\n                            return props.onDestroy();\n                        }));\n                        event.on(EVENT.RESIZE, (function() {\n                            return props.onResize();\n                        }));\n                        event.on(EVENT.FOCUS, (function() {\n                            return props.onFocus();\n                        }));\n                        event.on(EVENT.PROPS, (function(newProps) {\n                            return props.onProps(newProps);\n                        }));\n                        event.on(EVENT.ERROR, (function(err) {\n                            return props && props.onError ? props.onError(err) : rejectInitPromise(err).then((function() {\n                                setTimeout((function() {\n                                    throw err;\n                                }), 1);\n                            }));\n                        }));\n                        clean.register(event.reset);\n                    }();\n                },\n                render: function(_ref14) {\n                    var target = _ref14.target, container = _ref14.container, context = _ref14.context, rerender = _ref14.rerender;\n                    return promise_ZalgoPromise.try((function() {\n                        var initialChildDomain = getInitialChildDomain();\n                        var childDomainMatch = domainMatch || getInitialChildDomain();\n                        !function(target, childDomainMatch, container) {\n                            if (target !== window) {\n                                if (!function(win1, win2) {\n                                    var top1 = utils_getTop(win1) || win1;\n                                    var top2 = utils_getTop(win2) || win2;\n                                    try {\n                                        if (top1 && top2) return top1 === top2;\n                                    } catch (err) {}\n                                    var allFrames1 = utils_getAllFramesInWindow(win1);\n                                    var allFrames2 = utils_getAllFramesInWindow(win2);\n                                    if (utils_anyMatch(allFrames1, allFrames2)) return !0;\n                                    var opener1 = utils_getOpener(top1);\n                                    var opener2 = utils_getOpener(top2);\n                                    return opener1 && utils_anyMatch(utils_getAllFramesInWindow(opener1), allFrames2) || opener2 && utils_anyMatch(utils_getAllFramesInWindow(opener2), allFrames1), \n                                    !1;\n                                }(window, target)) throw new Error(\"Can only renderTo an adjacent frame\");\n                                var origin = utils_getDomain();\n                                if (!utils_matchDomain(childDomainMatch, origin) && !utils_isSameDomain(target)) throw new Error(\"Can not render remotely to \" + childDomainMatch.toString() + \" - can only render to \" + origin);\n                                if (container && \"string\" != typeof container) throw new Error(\"Container passed to renderTo must be a string selector, got \" + typeof container + \" }\");\n                            }\n                        }(target, childDomainMatch, container);\n                        var delegatePromise = promise_ZalgoPromise.try((function() {\n                            if (target !== window) return function(context, target) {\n                                var delegateProps = {};\n                                for (var _i4 = 0, _Object$keys4 = Object.keys(props); _i4 < _Object$keys4.length; _i4++) {\n                                    var propName = _Object$keys4[_i4];\n                                    var propDef = propsDef[propName];\n                                    propDef && propDef.allowDelegate && (delegateProps[propName] = props[propName]);\n                                }\n                                var childOverridesPromise = send_send(target, \"zoid_delegate_\" + name, {\n                                    uid: uid,\n                                    overrides: {\n                                        props: delegateProps,\n                                        event: event,\n                                        close: close,\n                                        onError: onError,\n                                        getInternalState: getInternalState,\n                                        setInternalState: setInternalState,\n                                        resolveInitPromise: resolveInitPromise,\n                                        rejectInitPromise: rejectInitPromise\n                                    }\n                                }).then((function(_ref13) {\n                                    var parentComp = _ref13.data.parent;\n                                    clean.register((function(err) {\n                                        if (!utils_isWindowClosed(target)) return parentComp.destroy(err);\n                                    }));\n                                    return parentComp.getDelegateOverrides();\n                                })).catch((function(err) {\n                                    throw new Error(\"Unable to delegate rendering. Possibly the component is not loaded in the target window.\\n\\n\" + stringifyError(err));\n                                }));\n                                getProxyContainerOverride = function() {\n                                    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.getProxyContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                renderContainerOverride = function() {\n                                    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.renderContainer.apply(childOverrides, args);\n                                    }));\n                                };\n                                showOverride = function() {\n                                    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.show.apply(childOverrides, args);\n                                    }));\n                                };\n                                hideOverride = function() {\n                                    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.hide.apply(childOverrides, args);\n                                    }));\n                                };\n                                watchForUnloadOverride = function() {\n                                    for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) args[_key5] = arguments[_key5];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.watchForUnload.apply(childOverrides, args);\n                                    }));\n                                };\n                                if (context === CONTEXT.IFRAME) {\n                                    getProxyWindowOverride = function() {\n                                        for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) args[_key6] = arguments[_key6];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.getProxyWindow.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openFrameOverride = function() {\n                                        for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) args[_key7] = arguments[_key7];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderFrameOverride = function() {\n                                        for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) args[_key8] = arguments[_key8];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerenderFrame.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    prerenderOverride = function() {\n                                        for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) args[_key9] = arguments[_key9];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.prerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openOverride = function() {\n                                        for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) args[_key10] = arguments[_key10];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.open.apply(childOverrides, args);\n                                        }));\n                                    };\n                                    openPrerenderOverride = function() {\n                                        for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) args[_key11] = arguments[_key11];\n                                        return childOverridesPromise.then((function(childOverrides) {\n                                            return childOverrides.openPrerender.apply(childOverrides, args);\n                                        }));\n                                    };\n                                } else context === CONTEXT.POPUP && (setProxyWinOverride = function() {\n                                    for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) args[_key12] = arguments[_key12];\n                                    return childOverridesPromise.then((function(childOverrides) {\n                                        return childOverrides.setProxyWin.apply(childOverrides, args);\n                                    }));\n                                });\n                                return childOverridesPromise;\n                            }(context, target);\n                        }));\n                        var windowProp = props.window;\n                        var watchForUnloadPromise = watchForUnload();\n                        var buildBodyPromise = serializeProps(propsDef, props, \"post\");\n                        var onRenderPromise = event.trigger(EVENT.RENDER);\n                        var getProxyContainerPromise = getProxyContainer(container);\n                        var getProxyWindowPromise = getProxyWindow();\n                        var finalSetPropsPromise = getProxyContainerPromise.then((function() {\n                            return setProps();\n                        }));\n                        var buildUrlPromise = finalSetPropsPromise.then((function() {\n                            return serializeProps(propsDef, props, \"get\").then((function(query) {\n                                return function(url, options) {\n                                    var query = options.query || {};\n                                    var hash = options.hash || {};\n                                    var originalUrl;\n                                    var originalHash;\n                                    var _url$split = url.split(\"#\");\n                                    originalHash = _url$split[1];\n                                    var _originalUrl$split = (originalUrl = _url$split[0]).split(\"?\");\n                                    originalUrl = _originalUrl$split[0];\n                                    var queryString = extendQuery(_originalUrl$split[1], query);\n                                    var hashString = extendQuery(originalHash, hash);\n                                    queryString && (originalUrl = originalUrl + \"?\" + queryString);\n                                    hashString && (originalUrl = originalUrl + \"#\" + hashString);\n                                    return originalUrl;\n                                }(utils_normalizeMockUrl(getUrl()), {\n                                    query: query\n                                });\n                            }));\n                        }));\n                        var buildWindowNamePromise = getProxyWindowPromise.then((function(proxyWin) {\n                            return function(_temp2) {\n                                var _ref6 = void 0 === _temp2 ? {} : _temp2, proxyWin = _ref6.proxyWin, initialChildDomain = _ref6.initialChildDomain, childDomainMatch = _ref6.childDomainMatch, _ref6$target = _ref6.target, target = void 0 === _ref6$target ? window : _ref6$target, context = _ref6.context;\n                                return function(_temp) {\n                                    var _ref5 = void 0 === _temp ? {} : _temp, proxyWin = _ref5.proxyWin, childDomainMatch = _ref5.childDomainMatch, context = _ref5.context;\n                                    return getPropsForChild(_ref5.initialChildDomain).then((function(childProps) {\n                                        return {\n                                            uid: uid,\n                                            context: context,\n                                            tag: tag,\n                                            childDomainMatch: childDomainMatch,\n                                            version: \"9_0_87\",\n                                            props: childProps,\n                                            exports: (win = proxyWin, {\n                                                init: function(childExports) {\n                                                    return initChild(this.origin, childExports);\n                                                },\n                                                close: close,\n                                                checkClose: function() {\n                                                    return checkWindowClose(win);\n                                                },\n                                                resize: resize,\n                                                onError: onError,\n                                                show: show,\n                                                hide: hide,\n                                                export: xport\n                                            })\n                                        };\n                                        var win;\n                                    }));\n                                }({\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    context: context\n                                }).then((function(childPayload) {\n                                    var _crossDomainSerialize = crossDomainSerialize({\n                                        data: childPayload,\n                                        metaData: {\n                                            windowRef: getWindowRef(target, initialChildDomain, context, proxyWin)\n                                        },\n                                        sender: {\n                                            domain: utils_getDomain(window)\n                                        },\n                                        receiver: {\n                                            win: proxyWin,\n                                            domain: childDomainMatch\n                                        },\n                                        passByReference: initialChildDomain === utils_getDomain()\n                                    }), serializedData = _crossDomainSerialize.serializedData;\n                                    clean.register(_crossDomainSerialize.cleanReference);\n                                    return serializedData;\n                                }));\n                            }({\n                                proxyWin: (_ref7 = {\n                                    proxyWin: proxyWin,\n                                    initialChildDomain: initialChildDomain,\n                                    childDomainMatch: childDomainMatch,\n                                    target: target,\n                                    context: context\n                                }).proxyWin,\n                                initialChildDomain: _ref7.initialChildDomain,\n                                childDomainMatch: _ref7.childDomainMatch,\n                                target: _ref7.target,\n                                context: _ref7.context\n                            }).then((function(serializedPayload) {\n                                return buildChildWindowName({\n                                    name: name,\n                                    serializedPayload: serializedPayload\n                                });\n                            }));\n                            var _ref7;\n                        }));\n                        var openFramePromise = buildWindowNamePromise.then((function(windowName) {\n                            return openFrame(context, {\n                                windowName: windowName\n                            });\n                        }));\n                        var openPrerenderFramePromise = openPrerenderFrame(context);\n                        var renderContainerPromise = promise_ZalgoPromise.hash({\n                            proxyContainer: getProxyContainerPromise,\n                            proxyFrame: openFramePromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref15) {\n                            return renderContainer(_ref15.proxyContainer, {\n                                context: context,\n                                proxyFrame: _ref15.proxyFrame,\n                                proxyPrerenderFrame: _ref15.proxyPrerenderFrame,\n                                rerender: rerender\n                            });\n                        })).then((function(proxyContainer) {\n                            return proxyContainer;\n                        }));\n                        var openPromise = promise_ZalgoPromise.hash({\n                            windowName: buildWindowNamePromise,\n                            proxyFrame: openFramePromise,\n                            proxyWin: getProxyWindowPromise\n                        }).then((function(_ref16) {\n                            var proxyWin = _ref16.proxyWin;\n                            return windowProp ? proxyWin : open(context, {\n                                windowName: _ref16.windowName,\n                                proxyWin: proxyWin,\n                                proxyFrame: _ref16.proxyFrame\n                            });\n                        }));\n                        var openPrerenderPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            proxyPrerenderFrame: openPrerenderFramePromise\n                        }).then((function(_ref17) {\n                            return openPrerender(context, _ref17.proxyWin, _ref17.proxyPrerenderFrame);\n                        }));\n                        var setStatePromise = openPromise.then((function(proxyWin) {\n                            currentProxyWin = proxyWin;\n                            return setProxyWin(proxyWin);\n                        }));\n                        var prerenderPromise = promise_ZalgoPromise.hash({\n                            proxyPrerenderWin: openPrerenderPromise,\n                            state: setStatePromise\n                        }).then((function(_ref18) {\n                            return prerender(_ref18.proxyPrerenderWin, {\n                                context: context\n                            });\n                        }));\n                        var setWindowNamePromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowName: buildWindowNamePromise\n                        }).then((function(_ref19) {\n                            if (windowProp) return _ref19.proxyWin.setName(_ref19.windowName);\n                        }));\n                        var getMethodPromise = promise_ZalgoPromise.hash({\n                            body: buildBodyPromise\n                        }).then((function(_ref20) {\n                            return options.method ? options.method : Object.keys(_ref20.body).length ? \"post\" : \"get\";\n                        }));\n                        var loadUrlPromise = promise_ZalgoPromise.hash({\n                            proxyWin: openPromise,\n                            windowUrl: buildUrlPromise,\n                            body: buildBodyPromise,\n                            method: getMethodPromise,\n                            windowName: setWindowNamePromise,\n                            prerender: prerenderPromise\n                        }).then((function(_ref21) {\n                            return _ref21.proxyWin.setLocation(_ref21.windowUrl, {\n                                method: _ref21.method,\n                                body: _ref21.body\n                            });\n                        }));\n                        var watchForClosePromise = openPromise.then((function(proxyWin) {\n                            !function watchForClose(proxyWin, context) {\n                                var cancelled = !1;\n                                clean.register((function() {\n                                    cancelled = !0;\n                                }));\n                                return promise_ZalgoPromise.delay(2e3).then((function() {\n                                    return proxyWin.isClosed();\n                                })).then((function(isClosed) {\n                                    if (!cancelled) return isClosed ? close(new Error(\"Detected \" + context + \" close\")) : watchForClose(proxyWin, context);\n                                }));\n                            }(proxyWin, context);\n                        }));\n                        var onDisplayPromise = promise_ZalgoPromise.hash({\n                            container: renderContainerPromise,\n                            prerender: prerenderPromise\n                        }).then((function() {\n                            return event.trigger(EVENT.DISPLAY);\n                        }));\n                        var openBridgePromise = openPromise.then((function(proxyWin) {\n                            return function(proxyWin, initialChildDomain, context) {\n                                return promise_ZalgoPromise.try((function() {\n                                    return proxyWin.awaitWindow();\n                                })).then((function(win) {\n                                    if (src_bridge && src_bridge.needsBridge({\n                                        win: win,\n                                        domain: initialChildDomain\n                                    }) && !src_bridge.hasBridge(initialChildDomain, initialChildDomain)) {\n                                        var bridgeUrl = \"function\" == typeof options.bridgeUrl ? options.bridgeUrl({\n                                            props: props\n                                        }) : options.bridgeUrl;\n                                        if (!bridgeUrl) throw new Error(\"Bridge needed to render \" + context);\n                                        var bridgeDomain = utils_getDomainFromUrl(bridgeUrl);\n                                        src_bridge.linkUrl(win, initialChildDomain);\n                                        return src_bridge.openBridge(utils_normalizeMockUrl(bridgeUrl), bridgeDomain);\n                                    }\n                                }));\n                            }(proxyWin, initialChildDomain, context);\n                        }));\n                        var runTimeoutPromise = loadUrlPromise.then((function() {\n                            return promise_ZalgoPromise.try((function() {\n                                var timeout = props.timeout;\n                                if (timeout) return initPromise.timeout(timeout, new Error(\"Loading component timed out after \" + timeout + \" milliseconds\"));\n                            }));\n                        }));\n                        var onRenderedPromise = initPromise.then((function() {\n                            return event.trigger(EVENT.RENDERED);\n                        }));\n                        return promise_ZalgoPromise.hash({\n                            initPromise: initPromise,\n                            buildUrlPromise: buildUrlPromise,\n                            onRenderPromise: onRenderPromise,\n                            getProxyContainerPromise: getProxyContainerPromise,\n                            openFramePromise: openFramePromise,\n                            openPrerenderFramePromise: openPrerenderFramePromise,\n                            renderContainerPromise: renderContainerPromise,\n                            openPromise: openPromise,\n                            openPrerenderPromise: openPrerenderPromise,\n                            setStatePromise: setStatePromise,\n                            prerenderPromise: prerenderPromise,\n                            loadUrlPromise: loadUrlPromise,\n                            buildWindowNamePromise: buildWindowNamePromise,\n                            setWindowNamePromise: setWindowNamePromise,\n                            watchForClosePromise: watchForClosePromise,\n                            onDisplayPromise: onDisplayPromise,\n                            openBridgePromise: openBridgePromise,\n                            runTimeoutPromise: runTimeoutPromise,\n                            onRenderedPromise: onRenderedPromise,\n                            delegatePromise: delegatePromise,\n                            watchForUnloadPromise: watchForUnloadPromise,\n                            finalSetPropsPromise: finalSetPropsPromise\n                        });\n                    })).catch((function(err) {\n                        return promise_ZalgoPromise.all([ onError(err), destroy(err) ]).then((function() {\n                            throw err;\n                        }), (function() {\n                            throw err;\n                        }));\n                    })).then(src_util_noop);\n                },\n                destroy: destroy,\n                getProps: function() {\n                    return props;\n                },\n                setProps: setProps,\n                export: xport,\n                getHelpers: getHelpers,\n                getDelegateOverrides: function() {\n                    return promise_ZalgoPromise.try((function() {\n                        return {\n                            getProxyContainer: getProxyContainer,\n                            show: show,\n                            hide: hide,\n                            renderContainer: renderContainer,\n                            getProxyWindow: getProxyWindow,\n                            watchForUnload: watchForUnload,\n                            openFrame: openFrame,\n                            openPrerenderFrame: openPrerenderFrame,\n                            prerender: prerender,\n                            open: open,\n                            openPrerender: openPrerender,\n                            setProxyWin: setProxyWin\n                        };\n                    }));\n                },\n                getExports: function() {\n                    return xports({\n                        getExports: function() {\n                            return exportsPromise;\n                        }\n                    });\n                }\n            };\n        }\n        function defaultContainerTemplate(_ref) {\n            var uid = _ref.uid, frame = _ref.frame, prerenderFrame = _ref.prerenderFrame, doc = _ref.doc, props = _ref.props, event = _ref.event, dimensions = _ref.dimensions;\n            var width = dimensions.width, height = dimensions.height;\n            if (frame && prerenderFrame) {\n                var div = doc.createElement(\"div\");\n                div.setAttribute(\"id\", uid);\n                var style = doc.createElement(\"style\");\n                props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n                style.appendChild(doc.createTextNode(\"\\n            #\" + uid + \" {\\n                display: inline-block;\\n                position: relative;\\n                width: \" + width + \";\\n                height: \" + height + \";\\n            }\\n\\n            #\" + uid + \" > iframe {\\n                display: inline-block;\\n                position: absolute;\\n                width: 100%;\\n                height: 100%;\\n                top: 0;\\n                left: 0;\\n                transition: opacity .2s ease-in-out;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-invisible {\\n                opacity: 0;\\n            }\\n\\n            #\" + uid + \" > iframe.zoid-visible {\\n                opacity: 1;\\n        }\\n        \"));\n                div.appendChild(frame);\n                div.appendChild(prerenderFrame);\n                div.appendChild(style);\n                prerenderFrame.classList.add(\"zoid-visible\");\n                frame.classList.add(\"zoid-invisible\");\n                event.on(EVENT.RENDERED, (function() {\n                    prerenderFrame.classList.remove(\"zoid-visible\");\n                    prerenderFrame.classList.add(\"zoid-invisible\");\n                    frame.classList.remove(\"zoid-invisible\");\n                    frame.classList.add(\"zoid-visible\");\n                    setTimeout((function() {\n                        destroyElement(prerenderFrame);\n                    }), 1);\n                }));\n                event.on(EVENT.RESIZE, (function(_ref2) {\n                    var newWidth = _ref2.width, newHeight = _ref2.height;\n                    \"number\" == typeof newWidth && (div.style.width = toCSS(newWidth));\n                    \"number\" == typeof newHeight && (div.style.height = toCSS(newHeight));\n                }));\n                return div;\n            }\n        }\n        function defaultPrerenderTemplate(_ref) {\n            var doc = _ref.doc, props = _ref.props;\n            var html = doc.createElement(\"html\");\n            var body = doc.createElement(\"body\");\n            var style = doc.createElement(\"style\");\n            var spinner = doc.createElement(\"div\");\n            spinner.classList.add(\"spinner\");\n            props.cspNonce && style.setAttribute(\"nonce\", props.cspNonce);\n            html.appendChild(body);\n            body.appendChild(spinner);\n            body.appendChild(style);\n            style.appendChild(doc.createTextNode(\"\\n            html, body {\\n                width: 100%;\\n                height: 100%;\\n            }\\n\\n            .spinner {\\n                position: fixed;\\n                max-height: 60vmin;\\n                max-width: 60vmin;\\n                height: 40px;\\n                width: 40px;\\n                top: 50%;\\n                left: 50%;\\n                box-sizing: border-box;\\n                border: 3px solid rgba(0, 0, 0, .2);\\n                border-top-color: rgba(33, 128, 192, 0.8);\\n                border-radius: 100%;\\n                animation: rotation .7s infinite linear;\\n            }\\n\\n            @keyframes rotation {\\n                from {\\n                    transform: translateX(-50%) translateY(-50%) rotate(0deg);\\n                }\\n                to {\\n                    transform: translateX(-50%) translateY(-50%) rotate(359deg);\\n                }\\n            }\\n        \"));\n            return html;\n        }\n        var cleanInstances = cleanup();\n        var cleanZoid = cleanup();\n        function component(opts) {\n            var options = function(options) {\n                var tag = options.tag, url = options.url, domain = options.domain, bridgeUrl = options.bridgeUrl, _options$props = options.props, props = void 0 === _options$props ? {} : _options$props, _options$dimensions = options.dimensions, dimensions = void 0 === _options$dimensions ? {} : _options$dimensions, _options$autoResize = options.autoResize, autoResize = void 0 === _options$autoResize ? {} : _options$autoResize, _options$allowedParen = options.allowedParentDomains, allowedParentDomains = void 0 === _options$allowedParen ? \"*\" : _options$allowedParen, _options$attributes = options.attributes, attributes = void 0 === _options$attributes ? {} : _options$attributes, _options$defaultConte = options.defaultContext, defaultContext = void 0 === _options$defaultConte ? CONTEXT.IFRAME : _options$defaultConte, _options$containerTem = options.containerTemplate, containerTemplate = void 0 === _options$containerTem ? defaultContainerTemplate : _options$containerTem, _options$prerenderTem = options.prerenderTemplate, prerenderTemplate = void 0 === _options$prerenderTem ? defaultPrerenderTemplate : _options$prerenderTem, validate = options.validate, _options$eligible = options.eligible, eligible = void 0 === _options$eligible ? function() {\n                    return {\n                        eligible: !0\n                    };\n                } : _options$eligible, _options$logger = options.logger, logger = void 0 === _options$logger ? {\n                    info: src_util_noop\n                } : _options$logger, _options$exports = options.exports, xportsDefinition = void 0 === _options$exports ? src_util_noop : _options$exports, method = options.method, _options$children = options.children, children = void 0 === _options$children ? function() {\n                    return {};\n                } : _options$children;\n                var name = tag.replace(/-/g, \"_\");\n                var propsDef = _extends({}, {\n                    window: {\n                        type: PROP_TYPE.OBJECT,\n                        sendToChild: !1,\n                        required: !1,\n                        allowDelegate: !0,\n                        validate: function(_ref2) {\n                            var value = _ref2.value;\n                            if (!utils_isWindow(value) && !window_ProxyWindow.isProxyWindow(value)) throw new Error(\"Expected Window or ProxyWindow\");\n                            if (utils_isWindow(value)) {\n                                if (utils_isWindowClosed(value)) throw new Error(\"Window is closed\");\n                                if (!utils_isSameDomain(value)) throw new Error(\"Window is not same domain\");\n                            }\n                        },\n                        decorate: function(_ref3) {\n                            return setup_toProxyWindow(_ref3.value);\n                        }\n                    },\n                    timeout: {\n                        type: PROP_TYPE.NUMBER,\n                        required: !1,\n                        sendToChild: !1\n                    },\n                    cspNonce: {\n                        type: PROP_TYPE.STRING,\n                        required: !1\n                    },\n                    onDisplay: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRendered: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onRender: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onClose: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onDestroy: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop,\n                        decorate: props_decorateOnce\n                    },\n                    onResize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    onFocus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        allowDelegate: !0,\n                        default: props_defaultNoop\n                    },\n                    close: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref4) {\n                            return _ref4.close;\n                        }\n                    },\n                    focus: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref5) {\n                            return _ref5.focus;\n                        }\n                    },\n                    resize: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref6) {\n                            return _ref6.resize;\n                        }\n                    },\n                    uid: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref7) {\n                            return _ref7.uid;\n                        }\n                    },\n                    tag: {\n                        type: PROP_TYPE.STRING,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref8) {\n                            return _ref8.tag;\n                        }\n                    },\n                    getParent: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref9) {\n                            return _ref9.getParent;\n                        }\n                    },\n                    getParentDomain: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref10) {\n                            return _ref10.getParentDomain;\n                        }\n                    },\n                    show: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref11) {\n                            return _ref11.show;\n                        }\n                    },\n                    hide: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref12) {\n                            return _ref12.hide;\n                        }\n                    },\n                    export: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref13) {\n                            return _ref13.export;\n                        }\n                    },\n                    onError: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref14) {\n                            return _ref14.onError;\n                        }\n                    },\n                    onProps: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref15) {\n                            return _ref15.onProps;\n                        }\n                    },\n                    getSiblings: {\n                        type: PROP_TYPE.FUNCTION,\n                        required: !1,\n                        sendToChild: !1,\n                        childDecorate: function(_ref16) {\n                            return _ref16.getSiblings;\n                        }\n                    }\n                }, props);\n                if (!containerTemplate) throw new Error(\"Container template required\");\n                return {\n                    name: name,\n                    tag: tag,\n                    url: url,\n                    domain: domain,\n                    bridgeUrl: bridgeUrl,\n                    method: method,\n                    propsDef: propsDef,\n                    dimensions: dimensions,\n                    autoResize: autoResize,\n                    allowedParentDomains: allowedParentDomains,\n                    attributes: attributes,\n                    defaultContext: defaultContext,\n                    containerTemplate: containerTemplate,\n                    prerenderTemplate: prerenderTemplate,\n                    validate: validate,\n                    logger: logger,\n                    eligible: eligible,\n                    children: children,\n                    exports: \"function\" == typeof xportsDefinition ? xportsDefinition : function(_ref) {\n                        var getExports = _ref.getExports;\n                        var result = {};\n                        var _loop = function(_i2, _Object$keys2) {\n                            var key = _Object$keys2[_i2];\n                            var type = xportsDefinition[key].type;\n                            var valuePromise = getExports().then((function(res) {\n                                return res[key];\n                            }));\n                            result[key] = type === PROP_TYPE.FUNCTION ? function() {\n                                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n                                return valuePromise.then((function(value) {\n                                    return value.apply(void 0, args);\n                                }));\n                            } : valuePromise;\n                        };\n                        for (var _i2 = 0, _Object$keys2 = Object.keys(xportsDefinition); _i2 < _Object$keys2.length; _i2++) _loop(_i2, _Object$keys2);\n                        return result;\n                    }\n                };\n            }(opts);\n            var name = options.name, tag = options.tag, defaultContext = options.defaultContext, eligible = options.eligible, children = options.children;\n            var global = lib_global_getGlobal(window);\n            var instances = [];\n            var isChild = function() {\n                if (function(name) {\n                    try {\n                        return parseWindowName(window.name).name === name;\n                    } catch (err) {}\n                    return !1;\n                }(name)) {\n                    var _payload = getInitialParentPayload().payload;\n                    if (_payload.tag === tag && utils_matchDomain(_payload.childDomainMatch, utils_getDomain())) return !0;\n                }\n                return !1;\n            };\n            var registerChild = memoize((function() {\n                if (isChild()) {\n                    if (window.xprops) {\n                        delete global.components[tag];\n                        throw new Error(\"Can not register \" + name + \" as child - child already registered\");\n                    }\n                    var child = function(options) {\n                        var tag = options.tag, propsDef = options.propsDef, autoResize = options.autoResize, allowedParentDomains = options.allowedParentDomains;\n                        var onPropHandlers = [];\n                        var _getInitialParentPayl = getInitialParentPayload(), parent = _getInitialParentPayl.parent, payload = _getInitialParentPayl.payload;\n                        var parentComponentWindow = parent.win, parentDomain = parent.domain;\n                        var props;\n                        var exportsPromise = new promise_ZalgoPromise;\n                        var version = payload.version, uid = payload.uid, parentExports = payload.exports, context = payload.context, initialProps = payload.props;\n                        if (\"9_0_87\" !== version) throw new Error(\"Parent window has zoid version \" + version + \", child window has version 9_0_87\");\n                        var show = parentExports.show, hide = parentExports.hide, close = parentExports.close, onError = parentExports.onError, checkClose = parentExports.checkClose, parentExport = parentExports.export, parentResize = parentExports.resize, parentInit = parentExports.init;\n                        var getParent = function() {\n                            return parentComponentWindow;\n                        };\n                        var getParentDomain = function() {\n                            return parentDomain;\n                        };\n                        var onProps = function(handler) {\n                            onPropHandlers.push(handler);\n                            return {\n                                cancel: function() {\n                                    onPropHandlers.splice(onPropHandlers.indexOf(handler), 1);\n                                }\n                            };\n                        };\n                        var resize = function(_ref) {\n                            return parentResize.fireAndForget({\n                                width: _ref.width,\n                                height: _ref.height\n                            });\n                        };\n                        var xport = function(xports) {\n                            exportsPromise.resolve(xports);\n                            return parentExport(xports);\n                        };\n                        var getSiblings = function(_temp) {\n                            var anyParent = (void 0 === _temp ? {} : _temp).anyParent;\n                            var result = [];\n                            var currentParent = props.parent;\n                            void 0 === anyParent && (anyParent = !currentParent);\n                            if (!anyParent && !currentParent) throw new Error(\"No parent found for \" + tag + \" child\");\n                            for (var _i2 = 0, _getAllFramesInWindow2 = utils_getAllFramesInWindow(window); _i2 < _getAllFramesInWindow2.length; _i2++) {\n                                var win = _getAllFramesInWindow2[_i2];\n                                if (utils_isSameDomain(win)) {\n                                    var xprops = utils_assertSameDomain(win).xprops;\n                                    if (xprops && getParent() === xprops.getParent()) {\n                                        var winParent = xprops.parent;\n                                        if (anyParent || !currentParent || winParent && winParent.uid === currentParent.uid) {\n                                            var xports = tryGlobal(win, (function(global) {\n                                                return global.exports;\n                                            }));\n                                            result.push({\n                                                props: xprops,\n                                                exports: xports\n                                            });\n                                        }\n                                    }\n                                }\n                            }\n                            return result;\n                        };\n                        var setProps = function(newProps, origin, isUpdate) {\n                            void 0 === isUpdate && (isUpdate = !1);\n                            var normalizedProps = function(parentComponentWindow, propsDef, props, origin, helpers, isUpdate) {\n                                void 0 === isUpdate && (isUpdate = !1);\n                                var result = {};\n                                for (var _i2 = 0, _Object$keys2 = Object.keys(props); _i2 < _Object$keys2.length; _i2++) {\n                                    var key = _Object$keys2[_i2];\n                                    var prop = propsDef[key];\n                                    if (!prop || !prop.sameDomain || origin === utils_getDomain(window) && utils_isSameDomain(parentComponentWindow)) {\n                                        var value = normalizeChildProp(propsDef, 0, key, props[key], helpers);\n                                        result[key] = value;\n                                        prop && prop.alias && !result[prop.alias] && (result[prop.alias] = value);\n                                    }\n                                }\n                                if (!isUpdate) for (var _i4 = 0, _Object$keys4 = Object.keys(propsDef); _i4 < _Object$keys4.length; _i4++) {\n                                    var _key = _Object$keys4[_i4];\n                                    props.hasOwnProperty(_key) || (result[_key] = normalizeChildProp(propsDef, 0, _key, void 0, helpers));\n                                }\n                                return result;\n                            }(parentComponentWindow, propsDef, newProps, origin, {\n                                tag: tag,\n                                show: show,\n                                hide: hide,\n                                close: close,\n                                focus: child_focus,\n                                onError: onError,\n                                resize: resize,\n                                getSiblings: getSiblings,\n                                onProps: onProps,\n                                getParent: getParent,\n                                getParentDomain: getParentDomain,\n                                uid: uid,\n                                export: xport\n                            }, isUpdate);\n                            props ? extend(props, normalizedProps) : props = normalizedProps;\n                            for (var _i4 = 0; _i4 < onPropHandlers.length; _i4++) (0, onPropHandlers[_i4])(props);\n                        };\n                        var updateProps = function(newProps) {\n                            return promise_ZalgoPromise.try((function() {\n                                return setProps(newProps, parentDomain, !0);\n                            }));\n                        };\n                        return {\n                            init: function() {\n                                return promise_ZalgoPromise.try((function() {\n                                    utils_isSameDomain(parentComponentWindow) && function(_ref3) {\n                                        var componentName = _ref3.componentName, parentComponentWindow = _ref3.parentComponentWindow;\n                                        var _crossDomainDeseriali2 = crossDomainDeserialize({\n                                            data: parseWindowName(window.name).serializedInitialPayload,\n                                            sender: {\n                                                win: parentComponentWindow\n                                            },\n                                            basic: !0\n                                        }), sender = _crossDomainDeseriali2.sender;\n                                        if (\"uid\" === _crossDomainDeseriali2.reference.type || \"global\" === _crossDomainDeseriali2.metaData.windowRef.type) {\n                                            var _crossDomainSerialize = crossDomainSerialize({\n                                                data: _crossDomainDeseriali2.data,\n                                                metaData: {\n                                                    windowRef: window_getWindowRef(parentComponentWindow)\n                                                },\n                                                sender: {\n                                                    domain: sender.domain\n                                                },\n                                                receiver: {\n                                                    win: window,\n                                                    domain: utils_getDomain()\n                                                },\n                                                basic: !0\n                                            });\n                                            window.name = buildChildWindowName({\n                                                name: componentName,\n                                                serializedPayload: _crossDomainSerialize.serializedData\n                                            });\n                                        }\n                                    }({\n                                        componentName: options.name,\n                                        parentComponentWindow: parentComponentWindow\n                                    });\n                                    lib_global_getGlobal(window).exports = options.exports({\n                                        getExports: function() {\n                                            return exportsPromise;\n                                        }\n                                    });\n                                    !function(allowedParentDomains, domain) {\n                                        if (!utils_matchDomain(allowedParentDomains, domain)) throw new Error(\"Can not be rendered by domain: \" + domain);\n                                    }(allowedParentDomains, parentDomain);\n                                    markWindowKnown(parentComponentWindow);\n                                    !function() {\n                                        window.addEventListener(\"beforeunload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        window.addEventListener(\"unload\", (function() {\n                                            checkClose.fireAndForget();\n                                        }));\n                                        utils_onCloseWindow(parentComponentWindow, (function() {\n                                            child_destroy();\n                                        }));\n                                    }();\n                                    return parentInit({\n                                        updateProps: updateProps,\n                                        close: child_destroy\n                                    });\n                                })).then((function() {\n                                    return (_autoResize$width = autoResize.width, width = void 0 !== _autoResize$width && _autoResize$width, \n                                    _autoResize$height = autoResize.height, height = void 0 !== _autoResize$height && _autoResize$height, \n                                    _autoResize$element = autoResize.element, elementReady(void 0 === _autoResize$element ? \"body\" : _autoResize$element).catch(src_util_noop).then((function(element) {\n                                        return {\n                                            width: width,\n                                            height: height,\n                                            element: element\n                                        };\n                                    }))).then((function(_ref3) {\n                                        var width = _ref3.width, height = _ref3.height, element = _ref3.element;\n                                        element && (width || height) && context !== CONTEXT.POPUP && onResize(element, (function(_ref4) {\n                                            resize({\n                                                width: width ? _ref4.width : void 0,\n                                                height: height ? _ref4.height : void 0\n                                            });\n                                        }), {\n                                            width: width,\n                                            height: height\n                                        });\n                                    }));\n                                    var _autoResize$width, width, _autoResize$height, height, _autoResize$element;\n                                })).catch((function(err) {\n                                    onError(err);\n                                }));\n                            },\n                            getProps: function() {\n                                if (props) return props;\n                                setProps(initialProps, parentDomain);\n                                return props;\n                            }\n                        };\n                    }(options);\n                    child.init();\n                    return child;\n                }\n            }));\n            registerChild();\n            !function() {\n                var allowDelegateListener = on_on(\"zoid_allow_delegate_\" + name, (function() {\n                    return !0;\n                }));\n                var delegateListener = on_on(\"zoid_delegate_\" + name, (function(_ref2) {\n                    var _ref2$data = _ref2.data;\n                    return {\n                        parent: parentComponent({\n                            uid: _ref2$data.uid,\n                            options: options,\n                            overrides: _ref2$data.overrides,\n                            parentWin: _ref2.source\n                        })\n                    };\n                }));\n                cleanZoid.register(allowDelegateListener.cancel);\n                cleanZoid.register(delegateListener.cancel);\n            }();\n            global.components = global.components || {};\n            if (global.components[tag]) throw new Error(\"Can not register multiple components with the same tag: \" + tag);\n            global.components[tag] = !0;\n            return {\n                init: function init(inputProps) {\n                    var instance;\n                    var uid = \"zoid-\" + tag + \"-\" + uniqueID();\n                    var props = inputProps || {};\n                    var _eligible = eligible({\n                        props: props\n                    }), eligibility = _eligible.eligible, reason = _eligible.reason;\n                    var onDestroy = props.onDestroy;\n                    props.onDestroy = function() {\n                        instance && eligibility && instances.splice(instances.indexOf(instance), 1);\n                        if (onDestroy) return onDestroy.apply(void 0, arguments);\n                    };\n                    var parent = parentComponent({\n                        uid: uid,\n                        options: options\n                    });\n                    parent.init();\n                    eligibility ? parent.setProps(props) : props.onDestroy && props.onDestroy();\n                    cleanInstances.register((function(err) {\n                        return parent.destroy(err || new Error(\"zoid destroyed all components\"));\n                    }));\n                    var clone = function(_temp) {\n                        var _ref4$decorate = (void 0 === _temp ? {} : _temp).decorate;\n                        return init((void 0 === _ref4$decorate ? identity : _ref4$decorate)(props));\n                    };\n                    var _render = function(target, container, context) {\n                        return promise_ZalgoPromise.try((function() {\n                            if (!eligibility) {\n                                var err = new Error(reason || name + \" component is not eligible\");\n                                return parent.destroy(err).then((function() {\n                                    throw err;\n                                }));\n                            }\n                            if (!utils_isWindow(target)) throw new Error(\"Must pass window to renderTo\");\n                            return function(props, context) {\n                                return promise_ZalgoPromise.try((function() {\n                                    if (props.window) return setup_toProxyWindow(props.window).getType();\n                                    if (context) {\n                                        if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) throw new Error(\"Unrecognized context: \" + context);\n                                        return context;\n                                    }\n                                    return defaultContext;\n                                }));\n                            }(props, context);\n                        })).then((function(finalContext) {\n                            container = function(context, container) {\n                                if (container) {\n                                    if (\"string\" != typeof container && !isElement(container)) throw new TypeError(\"Expected string or element selector to be passed\");\n                                    return container;\n                                }\n                                if (context === CONTEXT.POPUP) return \"body\";\n                                throw new Error(\"Expected element to be passed to render iframe\");\n                            }(finalContext, container);\n                            if (target !== window && \"string\" != typeof container) throw new Error(\"Must pass string element when rendering to another window\");\n                            return parent.render({\n                                target: target,\n                                container: container,\n                                context: finalContext,\n                                rerender: function() {\n                                    var newInstance = clone();\n                                    extend(instance, newInstance);\n                                    return newInstance.renderTo(target, container, context);\n                                }\n                            });\n                        })).catch((function(err) {\n                            return parent.destroy(err).then((function() {\n                                throw err;\n                            }));\n                        }));\n                    };\n                    instance = _extends({}, parent.getExports(), parent.getHelpers(), function() {\n                        var childComponents = children();\n                        var result = {};\n                        var _loop2 = function(_i4, _Object$keys4) {\n                            var childName = _Object$keys4[_i4];\n                            var Child = childComponents[childName];\n                            result[childName] = function(childInputProps) {\n                                var parentProps = parent.getProps();\n                                var childProps = _extends({}, childInputProps, {\n                                    parent: {\n                                        uid: uid,\n                                        props: parentProps,\n                                        export: parent.export\n                                    }\n                                });\n                                return Child(childProps);\n                            };\n                        };\n                        for (var _i4 = 0, _Object$keys4 = Object.keys(childComponents); _i4 < _Object$keys4.length; _i4++) _loop2(_i4, _Object$keys4);\n                        return result;\n                    }(), {\n                        isEligible: function() {\n                            return eligibility;\n                        },\n                        clone: clone,\n                        render: function(container, context) {\n                            return _render(window, container, context);\n                        },\n                        renderTo: function(target, container, context) {\n                            return _render(target, container, context);\n                        }\n                    });\n                    eligibility && instances.push(instance);\n                    return instance;\n                },\n                instances: instances,\n                driver: function(driverName, dep) {\n                    throw new Error(\"Driver support not enabled\");\n                },\n                isChild: isChild,\n                canRenderTo: function(win) {\n                    return send_send(win, \"zoid_allow_delegate_\" + name).then((function(_ref3) {\n                        return _ref3.data;\n                    })).catch((function() {\n                        return !1;\n                    }));\n                },\n                registerChild: registerChild\n            };\n        }\n        var component_create = function(options) {\n            !function() {\n                if (!global_getGlobal().initialized) {\n                    global_getGlobal().initialized = !0;\n                    on = (_ref3 = {\n                        on: on_on,\n                        send: send_send\n                    }).on, send = _ref3.send, (global = global_getGlobal()).receiveMessage = global.receiveMessage || function(message) {\n                        return receive_receiveMessage(message, {\n                            on: on,\n                            send: send\n                        });\n                    };\n                    !function(_ref5) {\n                        var on = _ref5.on, send = _ref5.send;\n                        globalStore().getOrSet(\"postMessageListener\", (function() {\n                            return addEventListener(window, \"message\", (function(event) {\n                                !function(event, _ref4) {\n                                    var on = _ref4.on, send = _ref4.send;\n                                    promise_ZalgoPromise.try((function() {\n                                        var source = event.source || event.sourceElement;\n                                        var origin = event.origin || event.originalEvent && event.originalEvent.origin;\n                                        var data = event.data;\n                                        \"null\" === origin && (origin = \"file://\");\n                                        if (source) {\n                                            if (!origin) throw new Error(\"Post message did not have origin domain\");\n                                            receive_receiveMessage({\n                                                source: source,\n                                                origin: origin,\n                                                data: data\n                                            }, {\n                                                on: on,\n                                                send: send\n                                            });\n                                        }\n                                    }));\n                                }(event, {\n                                    on: on,\n                                    send: send\n                                });\n                            }));\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                    setupBridge({\n                        on: on_on,\n                        send: send_send,\n                        receiveMessage: receive_receiveMessage\n                    });\n                    !function(_ref8) {\n                        var on = _ref8.on, send = _ref8.send;\n                        globalStore(\"builtinListeners\").getOrSet(\"helloListener\", (function() {\n                            var listener = on(\"postrobot_hello\", {\n                                domain: \"*\"\n                            }, (function(_ref3) {\n                                resolveHelloPromise(_ref3.source, {\n                                    domain: _ref3.origin\n                                });\n                                return {\n                                    instanceID: getInstanceID()\n                                };\n                            }));\n                            var parent = getAncestor();\n                            parent && sayHello(parent, {\n                                send: send\n                            }).catch((function(err) {}));\n                            return listener;\n                        }));\n                    }({\n                        on: on_on,\n                        send: send_send\n                    });\n                }\n                var _ref3, on, send, global;\n            }();\n            var comp = component(options);\n            var init = function(props) {\n                return comp.init(props);\n            };\n            init.driver = function(name, dep) {\n                return comp.driver(name, dep);\n            };\n            init.isChild = function() {\n                return comp.isChild();\n            };\n            init.canRenderTo = function(win) {\n                return comp.canRenderTo(win);\n            };\n            init.instances = comp.instances;\n            var child = comp.registerChild();\n            child && (window.xprops = init.xprops = child.getProps());\n            return init;\n        };\n        function destroyComponents(err) {\n            src_bridge && src_bridge.destroyBridges();\n            var destroyPromise = cleanInstances.all(err);\n            cleanInstances = cleanup();\n            return destroyPromise;\n        }\n        var destroyAll = destroyComponents;\n        function component_destroy(err) {\n            destroyAll();\n            delete window.__zoid_9_0_87__;\n            !function() {\n                !function() {\n                    var responseListeners = globalStore(\"responseListeners\");\n                    for (var _i2 = 0, _responseListeners$ke2 = responseListeners.keys(); _i2 < _responseListeners$ke2.length; _i2++) {\n                        var hash = _responseListeners$ke2[_i2];\n                        var listener = responseListeners.get(hash);\n                        listener && (listener.cancelled = !0);\n                        responseListeners.del(hash);\n                    }\n                }();\n                (listener = globalStore().get(\"postMessageListener\")) && listener.cancel();\n                var listener;\n                delete window.__post_robot_10_0_46__;\n            }();\n            return cleanZoid.all(err);\n        }\n    } ]);\n}));"
  },
  {
    "path": "docs/api/component.md",
    "content": "# Component\n\n## Instantiate `(props : { [string] : any }) => ZoidComponentInstance`\n\nInstantiate a component and pass in props.\n\n```javascript\nconst Component = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n});\n\nconst componentInstance = Component({\n  foo: \"bar\",\n  onSomething: () => {\n    console.log(\"Something happened!\");\n  },\n});\n```\n\nSee [Component Instance](./instance.md);\n\n## isChild `() => boolean`\n\nReturns `true` if the window you are currently in is an instance of the component, `false` if not.\n\n```javascript\nconst MyComponent = zoid.create({ ... });\n\nif (MyComponent.isChild()) {\n    console.log('We are currently in a child iframe or popup of MyComponent!')\n}\n```\n\n## xprops `{ [string] : any }`\n\nSimilar to `window.xprops` -- gives you access to the props passed down to the child window or iframe\n\n```javascript\nconst MyComponent = zoid.create({ ... });\n\nconsole.log(MyComponent.xprops.message);\n```\n\n## canRenderTo `(Window) => Promise<boolean>`\n\nReturns a promise for a boolean, informing you if it is possible to remotely render the component to a different window.\n\n```javascript\nconst MyComponent = zoid.create({ ... });\n\nMyComponent.canRenderTo(window.parent).then(result => {\n    if (result) {\n        console.log('We can render to the parent window!');\n        MyComponent().renderTo(window.parent, '#container');\n    }\n});\n```\n\n## Instances `Array<ZoidComponentInstances>`\n\nProvides an array of currently rendered instances of the zoid component\n\n```\nconst MyComponent = zoid.create({ ... });\n\nconsole.log(`There are currently ${ MyComponent.instances.length } active instances of MyComponent`);\n```\n\n## driver `(frameworkName : string, dependencies : { ... }) => Driver`\n\nRegister a component with your framework of choice, so it can be rendered natively in your app.\n\n```javascript\nimport FooFramework from 'foo-framework';\n\nconst Component = zoid.create({ ... });\nconst FooComponent = Component.driver('foo', { FooFramework });\n\n// Now `FooComponent` is natively renderable inside a `FooFramework` app.\n```\n\n### React\n\n```javascript\nlet MyReactZoidComponent = MyZoidComponent.driver(\"react\", {\n  React: React,\n  ReactDOM: ReactDOM,\n});\n```\n\n```javascript\nrender() {\n    return (\n        <MyReactZoidComponent foo=\"bar\" />\n    );\n}\n```\n\n### Angular 1\n\n```javascript\nMyZoidComponent.driver('angular', angular);`\n```\n\n```html\n<my-zoid foo=\"bar\"></my-zoid>\n```\n\n### Angular 2\n\n```javascript\n@ng.core.NgModule({\n    imports: [\n        ng.platformBrowser.BrowserModule,\n        MyZoidComponent.driver('angular2', ng.core)\n    ]\n});\n```\n\n```html\n<my-zoid [props]=\"{ foo: 'bar' }\"></my-zoid>\n```\n\n### Glimmer\n\n```javascript\nimport Component from \"@glimmer/component\";\n\nexport default MyZoidComponent.driver(\"glimmer\", Component);\n```\n\n```html\n<my-zoid @foo=\"{{bar}}\"></my-zoid>\n```\n\n### Vue\n\n```javascript\nVue.component('app', {\n\n    components: {\n        'my-zoid': MyZoidComponent.driver('vue')\n    }\n}\n```\n\n```html\n<my-zoid :foo=\"bar\" />\n```\n\n### Vue 3\n\n```javascript\n// Create Vue application\nconst app = Vue.createApp(...)\n\n// Define a new component called my-zoid\napp.component('my-zoid', MyZoidComponent.driver('vue3'))\n\n// Mount Vue application\napp.mount(...)\n```\n\n```html\n<my-zoid :foo=\"bar\" />\n```\n"
  },
  {
    "path": "docs/api/create.md",
    "content": "# Create new component\n\n```javascript\nzoid.create({ ...options });\n```\n\nCreate a component definition, which will be loaded in both the parent and child windows.\n\n## tag `string` [required]\n\nA tag-name for the component, used for:\n\n- Loading the correct component in the child window or frame\n- Generating framework drivers\n- Logging\n\n```javascript\nconst MyComponent = zoid.create({\n    tag: 'my-component-tag',\n    ...\n});\n```\n\n## url `string | ({ props }) => string` [required]\n\nThe full url that will be loaded when your component is rendered, or a function returning the url.\n\nThis must include a protocol (http:, https:, or about:); it cannot be scheme-relative.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n});\n\nurl: \"https://www.my-site.com/mycomponent\";\n```\n\n```javascript\nconst MyComponent = zoid.create({\n    tag: 'my-component',\n    url: ({ props }) => {\n        return (props.env === 'development')\n            ? 'http://dev.my-site.com/mycomponent'\n            : 'https://www.my-site.com/mycomponent';\n});\n```\n\n## dimensions `{ width : string, height : string }`\n\nThe dimensions for your component, in css-style units, with support for `px` or `%`.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  dimensions: {\n    width: \"300px\",\n    height: \"200px\",\n  },\n});\n```\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  dimensions: {\n    width: \"80%\",\n    height: \"90%\",\n  },\n});\n```\n\n## props `{ [string] : PropDefinition }`\n\nA mapping of prop name to prop settings. Helpful for setting default values, decorating values, adding props to the query string of your component url, and more.\n\nNote: you are not required to create a prop definition for each new prop. By default, anything passed in as a prop when instantiating your component, will be automatically passed to the child window in `window.xprops`.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n\n  props: {\n    onLogin: {\n      type: \"function\",\n    },\n\n    prefilledEmail: {\n      type: \"string\",\n      required: false,\n    },\n  },\n});\n```\n\nSee [Prop Definitions](./prop-definitions.md) for all options which can be passed to prop definitions.\n\n## containerTemplate `(opts) => HTMLElement`\n\nA function which should return a DOM element, rendered on the parent page and containing the iframe element (or rendered behind the popup window).\n\nzoid will pass `opts.frame` and `opts.prerenderFrame` to this function, which is a pre-generated element your component will be rendered into. These must be inserted somewhere into the DOM element you return, for frame-based components\n\nThe `opts` parameter is [the same](#opts) as the parameter used in `prerenderTemplate`\n\nBest used with [jsx-pragmatic](https://github.com/krakenjs/jsx-pragmatic). You can use [babel](https://babeljs.io/docs/plugins/transform-react-jsx/) with a `/* @jsx node */` comment, to transpile the jsx down to regular javascript.\n\n```javascript\n/* @jsx node */\n\nimport { node, dom } from \"jsx-pragmatic\";\n\nvar MyLoginZoidComponent = zoid.create({\n  tag: \"my-login\",\n  url: \"https://www.mysite.com/login\",\n\n  containerTemplate: function ({ uid, doc, frame, prerenderFrame }) {\n    return (\n      <div id={uid} class=\"container\">\n        <style>\n          {`\n                        #${uid}.container {\n                            border: 5px solid red;\n                        }\n                    `}\n        </style>\n\n        <node el={frame} />\n        <node el={prerenderFrame} />\n      </div>\n    ).render(dom({ doc }));\n  },\n});\n```\n\nAs with React, you are also free to skip using JSX and just use `node` from `jsx-pragmatic` directly:\n\n```javascript\nimport { node, dom } from \"jsx-pragmatic\";\n\nvar MyLoginZoidComponent = zoid.create({\n  tag: \"my-login\",\n  url: \"https://www.mysite.com/login\",\n\n  containerTemplate: function containerTemplate({\n    uid,\n    doc,\n    frame,\n    prerenderFrame,\n  }) {\n    return node(\n      \"div\",\n      { id: uid, class: \"container\" },\n      node(\n        \"style\",\n        null,\n        `\n                #${uid}.container {\n                    border: 5px solid red;\n                }\n            `\n      ),\n      node(\"node\", { el: frame }),\n      node(\"node\", { el: prerenderFrame })\n    ).render(dom({ doc }));\n  },\n});\n```\n\nSince `containerTemplate` requires a DOM element to be returned, you're also free to manually create the element hierarchy using built-in browser methods like `doc.createElement`:\n\n```javascript\nimport { node, dom } from \"jsx-pragmatic\";\n\nvar MyLoginZoidComponent = zoid.create({\n  tag: \"my-login\",\n  url: \"https://www.mysite.com/login\",\n\n  containerTemplate: function containerTemplate({\n    doc,\n    uid,\n    frame,\n    prerenderFrame,\n  }) {\n    let container = doc.createElement(\"div\");\n    container.id = uid;\n    container.appendChild(frame);\n    container.appendChild(prerenderFrame);\n    return container;\n  },\n});\n```\n\nIf no `containerTemplate` function is defined, then a default is used. The default template can be found [here](https://github.com/krakenjs/zoid/blob/main/src/component/templates/container.js).\n\n## prerenderTemplate `(opts) => HTMLElement`\n\nA function which should return a DOM element, rendered in place of the iframe element, or inside the popup window, as it loads.\n\nUseful if you want to display a loading spinner or pre-render some content as the component loads.\n\nBest used with [jsx-pragmatic](https://github.com/krakenjs/jsx-pragmatic). You can use [babel](https://babeljs.io/docs/plugins/transform-react-jsx/) with a `/* @jsx node */` comment, to transpile the jsx down to regular javascript.\n\n```javascript\n/* @jsx node */\n\nimport { node, dom } from \"jsx-pragmatic\";\n\nvar MyLoginZoidComponent = zoid.create({\n  tag: \"my-login\",\n  url: \"https://www.mysite.com/login\",\n\n  prerenderTemplate: function ({ doc }) {\n    return (<p>Please wait while the component loads...</p>).render(\n      dom({ doc })\n    );\n  },\n});\n```\n\nAs with React, you are also free to skip using JSX and just use `node` directly:\n\n```javascript\nimport { node, dom } from \"jsx-pragmatic\";\n\nvar MyLoginZoidComponent = zoid.create({\n  tag: \"my-login\",\n  url: \"https://www.mysite.com/login\",\n\n  prerenderTemplate: function containerTemplate({ doc }) {\n    return node(\n      \"p\",\n      null,\n      `\n            Please wait while the component loads...\n        `\n    ).render(dom({ doc }));\n  },\n});\n```\n\nSince `prerenderTemplate` only requires a DOM element, you're also free to manually create the element hierarchy using built-in browser methods like `doc.createElement`.\n\n**Note:** if you're using `document` method, you must use the `doc` passed to `prerenderTemplate`, so the element is created using the target document of the new iframe or popup window, **not** the document of the parent page. This is essential for browser compatibility.\n\n```javascript\nimport { node, dom } from \"jsx-pragmatic\";\n\nvar MyLoginZoidComponent = zoid.create({\n  tag: \"my-login\",\n  url: \"https://www.mysite.com/login\",\n\n  prerenderTemplate: function containerTemplate({ doc }) {\n    const p = doc.createElement(\"p\");\n    p.innerText = \"Please wait while the component loads...\";\n    return p;\n  },\n});\n```\n\n### opts\n\nData automatically passed to `containerTemplate` and `prerenderTemplate`, used to help render and customize the template.\n\n- `uid`: Unique id automatically generated by zoid on render, unique to the instantiation of the given component\n- `props`: Props passed to the component in `render()`\n- `doc`: The appropriate document used to render dom elements\n- `container`: The element into which the generated element will be inserted\n- `dimensions`: The dimensions for the component\n- `tag`: Tag name of the component\n- `context`: Context type of the component (`iframe` or `popup`)\n- `frame`: Frame element that will be rendered into. Only applies to `containerTemplate` when rendering an iframe\n- `prerenderFrame`: Frame element that will be pre-rendered into. Only applies to `containerTemplate` when rendering an iframe using `prerenderTemplate`\n- `close`: Close the component. Useful if you want to render a close button outside the component\n- `focus`: Focus the component. Valid for popup components only. Useful if you want a clickable background overlay to re-focus the popup window.\n- `event`: Object that can be used to listen for the following events: `RENDER`, `RENDERED`, `DISPLAY`, `ERROR`, `CLOSED`, `PROPS`, `RESIZE`\n\n### Listening to zoid events\n\nIn the `containerTemplate` and `prerenderFunctions`, it is possible to attach functions that fire at events in the zoid lifecycle:\n\n```javascript\nevent.on(EVENT.RENDERED, () => {\n  prerenderFrame.classList.remove(CLASS.VISIBLE);\n  prerenderFrame.classList.add(CLASS.INVISIBLE);\n\n  frame.classList.remove(CLASS.INVISIBLE);\n  frame.classList.add(CLASS.VISIBLE);\n\n  setTimeout(() => {\n    destroyElement(prerenderFrame);\n  }, 1);\n});\n```\n\n## autoResize `{ height: boolean, width: boolean, element: string }`\n\nMakes the iframe resize automatically when the child window size changes.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  autoResize: {\n    width: false,\n    height: true,\n  },\n});\n```\n\nNote that by default it matches the `body` element of your content.\nYou can override this setting by specifying a custom selector as an `element` property.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  autoResize: {\n    width: false,\n    height: true,\n    element: \".my-selector\",\n  },\n});\n```\n\nRecommended to only use autoResize for height. Width has some strange effects, especially when scroll bars are present.\n\n## allowedParentDomains `string | Array<string | RegEx>`\n\nA string, array of strings or reqular expresions to be used to validate parent domain. If parent domain doesn't match any item, communication from child to parent will be prevented. The default value is '\\*' which match any domain.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  allowedParentDomains: [\"http://localhost\", /^http:\\/\\/www\\.mydomain\\.com$/],\n});\n```\n\n## domain `string`\n\nA string, or map of env to strings, for the domain which will be loaded in the iframe or popup.\n\nOnly required if the domain which will be rendered is different to the domain specified in the `url` setting - for example, if the original url does a 302 redirect to a different domain or subdomain.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://foo.com/login\",\n  domain: \"https://subdomain.foo.com\",\n});\n```\n\n## defaultContext `string`\n\nDetermines which should be picked by default when `render()` is called. Defaults to `iframe`.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  defaultContext: \"popup\",\n});\n```\n\n## validate `({ props }) => void`\n\nFunction which is passed all of the props at once and may validate them. Useful for validating inter-dependant props.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  validate: function ({ props }) {\n    if (props.name === \"Batman\" && props.strength < 10) {\n      throw new Error(`Batman must have at least 10 strength`);\n    }\n  },\n});\n```\n\n## eligible `({ props : { [string] : any } }) => boolean`\n\nFunction which determines if the component is eligible to be rendered.\n\n```javascript\nconst FirefoxOnlyButton = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  eligible: () => {\n    if (isFireFox()) {\n      return true;\n    } else {\n      return false;\n    }\n  },\n});\n```\n\nNow anyone can check eligibility prior to rendering the component:\n\n```javascript\nconst myComponent = MyComponent();\n\nif (myComponent.isEligible()) {\n  myComponent.render(\"#my-container\");\n}\n```\n\nIf the component is not eligible, calling `.render(...)` will return a rejected promise:\n\nconst myComponent = MyComponent();\n\nmyComponent.render('#my-container').catch(err => {\nconsole.error(err); // This will happen if we're not in firefox\n});\n\n## exports `{ [string] : ExportDefinition }`\n\n## exports `({ getExports : () => Promise<{ [string] : any }> }) => { [string] : Promise<any> }`\n\nUsed to map exports from the child (passed with `xprops.export(...)`) to properties on the parent component instance.\n\n```javascript\nconst CreatePostForm = zoid.create({\n  tag: \"create-post-form\",\n  url: \"https://my-site.com/component/create-post-form\",\n\n  exports: {\n    submit: {\n      type: \"function\",\n    },\n  },\n});\n```\n\nOnce this mapper is defined, the child window may export values up to the parent:\n\n```javascript\nwindow.xprops.export({\n  submit: () => {\n    document.querySelector(\"form#createPost\").submit();\n  },\n});\n```\n\nThe parent window may call these exports at any time:\n\n```javascript\nconst postForm = CreatePostForm();\npostForm.render(\"#create-post-form-container\");\n\ndocument.querySelector(\"button#submitForm\").addEventListener(\"click\", () => {\n  postForm.submit();\n});\n```\n\n## bridgeUrl `string | ({ props }) => string`\n\nThe url or a function returning the url for a [post-robot bridge](https://github.com/krakenjs/post-robot#parent-to-popup-messaging). Will be automatically loaded in a hidden iframe when a popup component is rendered, to allow communication between the parent window and the popup in IE/Edge.\n\nThis is only necessary if you are creating a popup component which needs to run in IE and/or Edge.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  bridgeUrl: \"https://foo.com/bridge\",\n});\n```\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  bridgeUrl: ({ props }) => {\n    return props.env === \"development\"\n      ? \"http://foo.dev/bridge\"\n      : \"https://foo.com/bridge\";\n  },\n});\n```\n\n## exports `({ getExports : () => Promise<{ [string] : any }> }) => { [string] : Promise<any> }`\n\nUsed to map exports from the child (passed with `xprops.export(...)`) to properties on the parent component instance.\n\n```javascript\nconst CreatePostForm = zoid.create({\n    tag: 'create-post-form',\n    url: 'https://my-site.com/component/create-post-form',\n\n    exports: ({ getExports }) => {\n        return {\n            submit: () => getExports().then(exports => exports.submit())\n        };\n    };\n});\n```\n\nOnce this mapper is defined, the child window may export values up to the parent:\n\n```javascript\nwindow.xprops.export({\n  submit: () => {\n    document.querySelector(\"form#createPost\").submit();\n  },\n});\n```\n\nThe parent window may call these exports at any time:\n\n```javascript\nconst postForm = CreatePostForm();\npostForm.render(\"#create-post-form-container\");\n\ndocument.querySelector(\"button#submitForm\").addEventListener(\"click\", () => {\n  postForm.submit();\n});\n```\n\n## children `() => { [string] : ZoidComponent }`\n\nSet up components which will be renderable as children of the current component\n\n```javascript\nconst CardNumberField = zoid.create({\n    tag: 'card-number-field',\n    url: 'https://my-site.com/component/card-fields/number'\n});\n\nconst CardCVVField = zoid.create({\n    tag: 'card-cvv-field',\n    url: 'https://my-site.com/component/card-fields/cvv'\n});\n\nconst CardExpiryField = zoid.create({\n    tag: 'card-expiry-field',\n    url: 'https://my-site.com/component/card-fields/expiry'\n});\n\nconst CardFields = zoid.create({\n    tag: 'card-fields',\n    url: 'https://my-site.com/component/card-fields',\n\n    children: () => {\n        return {\n            NumberField: CardNumberField,\n            CVVField: CardCVVField,\n            ExpiryField: CardExpiryField\n        };\n    };\n});\n```\n\nThese children will now be renderable as children of the parent:\n\n```javascript\nconst cardFields = CardFields({\n  style: {\n    borderColor: \"red\",\n  },\n});\n\ncardFields.NumberField().render(\"#card-number-field-container\");\ncardFields.CVVField().render(\"#card-cvv-field-container\");\ncardFields.ExpiryField().render(\"#card-expiry-field-container\");\n```\n\nThe children will inherit both `props` and `export` from the parent, in `window.xprops.parent`.\n\n```javascript\nconsole.log(\"Parent style:\", window.xprops.parent.style);\n```\n\n```javascript\nwindow.xprops.parent.export({\n  submit: () => {\n    document.querySelector(\"form#cardFields\").submit();\n  },\n});\n```\n"
  },
  {
    "path": "docs/api/index.md",
    "content": "# API\n\n- [Create](./create.md)\n  - [Prop Definitions](./prop-definitions.md)\n- [Component](./component.md)\n- [Instance](./instance.md)\n- [Render](./render.md)\n  - [Parent Props](./parent-props.md)\n- [XProps](./xprops.md)\n"
  },
  {
    "path": "docs/api/instance.md",
    "content": "# Component Instance\n\nAfter instantiating a component, that component instance has a number of helpers.\n\n```javascript\nconst MyComponent = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n});\n\nconst component = MyComponent({\n  foo: \"bar\",\n  onSomething: () => {\n    console.log(\"Something happened!\");\n  },\n});\n```\n\n## render `(container : string | HTMLElement, context : 'iframe' | 'popup') => Promise<void>`\n\nRender the component to a given container.\n\n- container: can be a string selector like `'#my-container'` or a DOM element like `document.body`\n- context: defaults to `iframe` or `defaultContainer` if set. Can be overriden to explicitly specify `'iframe'` or `'popup'`.\n\n```javascript\nconst component = MyComponent();\n\ncomponent.render(\"#my-container\").then(() => {\n  console.info(\"The component was successfully rendered\");\n});\n```\n\n```javascript\nconst component = MyComponent();\n\ncomponent.render(document.body).then(() => {\n  console.info(\"The component was successfully rendered\");\n});\n```\n\n```javascript\nconst component = MyComponent();\n\ncomponent.render(\"#my-container\", \"popup\").then(() => {\n  console.info(\"The component was successfully rendered\");\n});\n```\n\n## renderTo `(window : Window, container : string | HTMLElement, context : 'iframe' | 'popup') => Promise<void>`\n\nRender the component to a given window and given container.\n\n- window: a reference to the window which the component should be rendered to. Zoid must be loaded in that window and the component must be registered.\n- container: must be a string selector like `'#my-container'` (DOM element is not transferable across different windows)\n- context: defaults to `iframe` or `defaultContainer` if set. Can be overriden to explicitly specify `'iframe'` or `'popup'`.\n\n```javascript\nconst component = MyComponent();\n\ncomponent.renderTo(window.parent, \"#my-container\").then(() => {\n  console.info(\"The component was successfully rendered\");\n});\n```\n\n```javascript\nconst component = MyComponent();\n\ncomponent.renderTo(window.parent, \"#my-container\", \"popup\").then(() => {\n  console.info(\"The component was successfully rendered\");\n});\n```\n\n## clone `() => ZoidComponentInstance`\n\nClones the current instance with the exact same set of props\n\n```javascript\nconst button1 = ButtonComponent({\n  color: \"red\",\n});\n\nconst button2 = button1.clone();\n\nbutton1.render(\"#first-button-container\"); // First red button\nbutton2.render(\"#first-button-container\"); // Second red button\n```\n\n## isEligible `() => boolean`\n\nInforms if the component is eligible\n\n```javascript\nconst myComponent = MyComponent();\n\nif (myComponent.isEligible()) {\n  myComponent.render(\"#my-container\");\n}\n```\n\nTo use `isEligible()` you must first define an `eligible` handler when setting up the component:\n\n```javascript\nconst FirefoxOnlyButton = zoid.create({\n  tag: \"my-component\",\n  url: \"https://my-site.com/my-component\",\n  eligible: () => {\n    if (isFireFox()) {\n      return true;\n    } else {\n      return false;\n    }\n  },\n});\n```\n\n## close `() => Promise<void>`\n\nGracefully close the component\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\ndocument\n  .querySelector(\"button#close-component\")\n  .addEventListener(\"click\", () => {\n    myComponent.close().then(() => {\n      console.log(\"Component is now closed\");\n    });\n  });\n```\n\n## focus `() => Promise<void>`\n\nFocus the component. Only works for popup windows, on a user action like a click.\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\ndocument\n  .querySelector(\"button#focus-component\")\n  .addEventListener(\"click\", () => {\n    myComponent.focus().then(() => {\n      console.log(\"Component is now focused\");\n    });\n  });\n```\n\n## resize `({ width : number, height : number }) => Promise<void>`\n\nResize the component. Only works for iframe windows, popups can not be resized once opened.\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\ndocument\n  .querySelector(\"button#resize-component\")\n  .addEventListener(\"click\", () => {\n    myComponent.resize({ width: 500, height: 800 }).then(() => {\n      console.log(\"Component is now resized\");\n    });\n  });\n```\n\n## show `() => Promise<void>`\n\nShow the component. Only works for iframe windows, popups can not be hidden/shown once opened.\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\ndocument\n  .querySelector(\"button#show-component\")\n  .addEventListener(\"click\", () => {\n    myComponent.show().then(() => {\n      console.log(\"Component is now visible\");\n    });\n  });\n```\n\n## hide `() => Promise<void>`\n\nHide the component. Only works for iframe windows, popups can not be hidden/shown once opened.\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\ndocument\n  .querySelector(\"button#hide-component\")\n  .addEventListener(\"click\", () => {\n    myComponent.hide().then(() => {\n      console.log(\"Component is now hidden\");\n    });\n  });\n```\n\n## updateProps `({ [string ] : any }) => Promise<void>`\n\nUpdate props in the child window. The child can listen for new props using `window.xprops.onProps`\n\nIn the parent window:\n\n```javascript\nconst component = MyComponent({\n  color: \"red\",\n});\n\ncomponent.render(\"#container\").then(() => {\n  component.setProps({\n    color: \"blue\",\n  });\n});\n```\n\nIn the child window:\n\n```javascript\nconsole.log(\"The current color is\", window.xprops.color); // red\n\nwindow.xprops.onProps(() => {\n  console.log(\"The current color is\", window.xprops.color); // lue\n});\n```\n\n## onError `(Error) => Promise<void>`\n\nTrigger an error in the component\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\ndocument.querySelector(\"button#trigger-error\").addEventListener(\"click\", () => {\n  myComponent.onError(new Error(`Something went wrong`)).then(() => {\n    console.log(\"Error successfully triggered\");\n  });\n});\n```\n\n## event\n\nEvent emitter that can be used to listen for the following events: `RENDER`, `RENDERED`, `PRERENDER`, `PRERENDERED`, `DISPLAY`, `ERROR`, `CLOSED`, `PROPS`, `RESIZE`.\n\n```javascript\nconst myComponent = MyComponent();\nmyComponent.render(\"#container\");\n\nmyComponent.event.on(zoid.EVENT.RENDERED, () => {\n  console.log(\"Component was rendered!\");\n});\n```\n\n## exports\n\nAny values defined in `export` and passed to `window.xprops.export()` will be available as keys on the component instance:\n\n```javascript\nconst CreatePostForm = zoid.create({\n    tag: 'create-post-form',\n    url: 'https://my-site.com/component/create-post-form',\n\n    exports: ({ getExports }) => {\n        return {\n            submit: () => getExports().then(exports => exports.submit())\n        };\n    };\n});\n```\n\nOnce this mapper is defined, the child window may export values up to the parent:\n\n```javascript\nwindow.xprops.export({\n  submit: () => {\n    document.querySelector(\"form#createPost\").submit();\n  },\n});\n```\n\nThe parent window may call these exports at any time:\n\n```javascript\nconst postForm = CreatePostForm();\npostForm.render(\"#create-post-form-container\");\n\ndocument.querySelector(\"button#submitForm\").addEventListener(\"click\", () => {\n  postForm.submit();\n});\n```\n"
  },
  {
    "path": "docs/api/parent-props.md",
    "content": "# Parent Props\n\n## window `Window | ProxyWindow`\n\nPass in a custom window to render the zoid component to. Passing this option will suppress zoid from opening a new window.\n\nThis value can also be a `ProxyWindow` type (a window serialized by `post-robot` which can be transferred via post message).\n\n```javascript\ndocument.querySelector(\"button#clickme\").addEventListener(\"click\", () => {\n  const customPopup = window.open();\n  MyComponent({\n    window: customPopup,\n  }).render();\n});\n```\n\n## timeout `number`\n\nA timeout after which a component render should fail/error out.\n\n```javascript\nMyComponent({\n  timeout: 1000,\n})\n  .render(\"#container\")\n  .catch((err) => {\n    console.warn(\"Component render errored\", err); // This could be a timeout error\n  });\n```\n\n## cspNonce `string`\n\nA CSP nonce that will be passed to any inline `script` or `style` tags rendered by zoid in the default `containerTemplate` or `prerenderTemplate` functions.\n\n```javascript\nMyComponent({\n  cspNonce: \"xyz12345\",\n}).render(\"#container\");\n```\n\n## onRender `() => void`\n\nCalled immediately when a render is triggered\n\n```javascript\nMyComponent({\n  onRender: () => {\n    console.log(\"The component started to render!\");\n  },\n}).render(\"#container\");\n```\n\n## onDisplay `() => void`\n\nCalled when the component has completed its initial prerender\n\n```javascript\nMyComponent({\n  onDisplay: () => {\n    console.log(\"The component was displayed!\");\n  },\n}).render(\"#container\");\n```\n\n## onRendered `() => void`\n\nCalled when the component has completed its full render\n\n```javascript\nMyComponent({\n  onRendered: () => {\n    console.log(\"The component was fully rendered!\");\n  },\n}).render(\"#container\");\n```\n\n## onClose `() => void`\n\nCalled when the component is first closed\n\n```javascript\nMyComponent({\n  onClose: () => {\n    console.log(\"The component was closed!\");\n  },\n}).render(\"#container\");\n```\n\n## onDestroy `() => void`\n\nCalled when the component is fully destroyed\n\n```javascript\nMyComponent({\n  onDestroy: () => {\n    console.log(\"The component was fully destroyed!\");\n  },\n}).render(\"#container\");\n```\n\n## onResize `() => void`\n\nCalled when the component is resized\n\n```javascript\nMyComponent({\n  onResize: () => {\n    console.log(\"The component was resized!\");\n  },\n}).render(\"#container\");\n```\n\n## onFocus `() => void`\n\nCalled when the component is focused\n\n```javascript\nMyComponent({\n  onFocus: () => {\n    console.log(\"The component was focused!\");\n  },\n}).render(\"#container\");\n```\n"
  },
  {
    "path": "docs/api/prop-definitions.md",
    "content": "# Prop Definitions\n\n## type\n\n`string`\n\nThe data-type expected for the prop\n\n- `'string'`\n- `'number'`\n- `'boolean'`\n- `'object'`\n- `'function'`\n- `'array'`\n\n## required\n\n`boolean`\n\nWhether or not the prop is mandatory. Defaults to `true`.\n\n```javascript\nonLogin: {\n    type: 'function',\n    required: false\n}\n```\n\n## default\n\n```javascript\n({\n    props : Props,\n    state : Object,\n    close : () => Promise<undefined>,\n    focus : () => Promise<undefined>,\n    onError : (mixed) => Promise<undefined>,\n    container : HTMLElement | undefined,\n    event : Event\n}) => value\n```\n\nA function returning the default value for the prop, if none is passed\n\n```javascript\nemail: {\n    type: 'string',\n    required: false,\n    default: function() {\n        return 'a@b.com';\n    }\n}\n```\n\n## validate\n\n`({ value, props }) => void`\n\nA function to validate the passed value. Should throw an appropriate error if invalid.\n\n```javascript\nemail: {\n    type: 'string',\n    validate: function({ value, props }) {\n        if (!value.match(/^.+@.+\\..+$/)) {\n            throw new TypeError(`Expected email to be valid format`);\n        }\n    }\n}\n```\n\n## queryParam\n\n`boolean | string | (value) => string`\n\nShould a prop be passed in the url.\n\n```javascript\nemail: {\n    type: 'string',\n    queryParam: true // ?email=foo@bar.com\n}\n```\n\nIf a string is set, this specifies the url param name which will be used.\n\n```javascript\nemail: {\n    type: 'string',\n    queryParam: 'user-email' // ?user-email=foo@bar.com\n}\n```\n\nIf a function is set, this is called to determine the url param which should be used.\n\n```javascript\nemail: {\n    type: 'string',\n    queryParam: function({ value }) {\n        if (value.indexOf('@foo.com') !== -1) {\n            return 'foo-email'; // ?foo-email=person@foo.com\n        } else {\n            return 'generic-email'; // ?generic-email=person@whatever.com\n        }\n    }\n}\n```\n\n## value\n\n```javascript\n({\n    props : Props,\n    state : Object,\n    close : () => Promise<undefined>,\n    focus : () => Promise<undefined>,\n    onError : (mixed) => Promise<undefined>,\n    container : HTMLElement | undefined,\n    event : Event\n}) => value\n```\n\nThe value for the prop, if it should be statically defined at component creation time\n\n```javascript\nuserAgent: {\n    type: 'string',\n    value() {\n        return window.navigator.userAgent;\n    }\n}\n```\n\n## decorate\n\n```javascript\n({\n    props : Props,\n    state : Object,\n    close : () => Promise<undefined>,\n    focus : () => Promise<undefined>,\n    onError : (mixed) => Promise<undefined>,\n    container : HTMLElement | undefined,\n    event : Event,\n    value : Value\n}) => value\n```\n\nA function used to decorate the prop at render-time. Called with the value of the prop, should return the new value.\n\n```javascript\nonLogin: {\n    type: 'function',\n    decorate(original) {\n        return function() {\n            console.log('User logged in!');\n            return original.apply(this, arguments);\n        };\n    }\n}\n```\n\n## serialization\n\n`string`\n\nIf `json`, the prop will be JSON stringified before being inserted into the url\n\n```javascript\nuser: {\n    type: 'object',\n    serialization: 'json' // ?user={\"name\":\"Zippy\",\"age\":34}\n}\n```\n\nIf `dotify` the prop will be converted to dot-notation.\n\n```javascript\nuser: {\n    type: 'object',\n    serialization: 'dotify' // ?user.name=Zippy&user.age=34\n}\n```\n\nIf `base64`, the prop will be JSON stringified then base64 encoded before being inserted into the url\n\n```javascript\nuser: {\n    type: 'object',\n    serialization: 'base64' // ?user=eyJuYW1lIjoiWmlwcHkiLCJhZ2UiOjM0fQ==\n}\n```\n\n## alias\n\n`string`\n\nAn aliased name for the prop\n\n```javascript\nonLogin: {\n    type: 'function',\n    alias: 'onUserLogin'\n}\n```\n"
  },
  {
    "path": "docs/api/render.md",
    "content": "# Render\n\n## Basic Render (same window)\n\n```javacript\nComponent(props).render(container, ?context)\n```\n\nRender the component to the given container element.\n\n### props `{ [string] : any }`\n\nObject containing all of the props required by the given component. These can be user-defined props, or pre-defined built-in props.\n\n```javascript\nMyComponent({\n  foo: \"bar\",\n  onBaz: () => {\n    console.log(\"Baz happened\");\n  },\n}).render(\"#container\");\n```\n\nSee [Parent Props](./parent-props.md) for built-in props that can be passed to any zoid component.\n\n### container `string | HTMLElement`\n\nElement selector, or element, into which the component should be rendered.\n\nDefaults to `document.body`.\n\n### context `iframe | popup`\n\nThe context to render to. Defaults to `defaultContext`, or if `defaultContext` is not set, `iframe`.\n\n## Remote render (different window)\n\n```javascript\nComponent(props).renderTo(win, container, ?context)\n```\n\nEquivalent to `Component().render()` but allows rendering to a remote window. For example, a child component may render a new component to the parent page.\n\n- The component must have been registered on the target window\n- The component must be rendered from within the iframe of an existing component\n- The component being rendered must have the same domain as the component initiating the render\n\n### win `Window`\n\nThe target window to which the component should be rendered. Ordinarily this will be `window.parent`.\n\n### props `{ [string] : any }`\n\nObject containing all of the props required by the given component\n\n### container `string`\n\nElement selector, into which the component should be rendered. Must be a string for remote rendering\n\nDefaults to `document.body`.\n\n### context `iframe | popup`\n\nThe context to render to. Defaults to `defaultContext`, or if `defaultContext` is not set, `iframe`.\n"
  },
  {
    "path": "docs/api/xprops.md",
    "content": "# `xprops`\n\nBy default `window.xprops` is populated in the child window/frame with any props from the parent.\n\nSome built-in props are provided and automatically populated on `window.xprops`:\n\n## xprops.close `() => Promise<void>`\n\nGracefully close the component.\n\n```javascript\ndocument.querySelector(\"button#close\").addEventListener(\"click\", () => {\n  window.xprops.close();\n});\n```\n\n## xprops.focus `() => Promise<void>`\n\nRefocus the component. Works on popup windows only, should be triggered on a user interaction like a click, in order to be allowed by the browser.\n\n```javascript\ndocument.querySelector(\"button#focus\").addEventListener(\"click\", () => {\n  window.xprops.focus();\n});\n```\n\n## xprops.resize `({ width : number, height : number }) => Promise<void>`\n\nResize the component. Works on iframe windows only, popups can not be resized after opening.\n\n```javascript\ndocument.querySelector(\"button#resize\").addEventListener(\"click\", () => {\n  window.xprops.resize({ width: 500, height: 800 });\n});\n```\n\n## xprops.uid `string`\n\nUnique ID for the component instance\n\n```javascript\nconsole.log(\"The current component uid is:\", window.xprops.uid);\n```\n\n## xprops.tag `string`\n\nTag for the component instance\n\n```javascript\nconsole.log(\"The current component is:\", window.xprops.tag);\n```\n\n## xprops.getParent `() => Window`\n\nGet a reference to the parent window\n\n```javascript\nconst parentWindow = window.xprops.getParent();\n\nparentWindow.postMessage(\"hello!\", \"*\");\n```\n\n## xprops.getParentDomain `() => string`\n\nGet the domain of the parent window\n\n```javascript\nconsole.log(\n  \"The current parent window domain is:\",\n  window.xprops.getParentDomain()\n);\n```\n\n## xprops.show `() => Promise<void>`\n\nShow the component. Works on iframe windows only, popups can not be shown/hidden after opening.\n\n```javascript\ndocument.querySelector(\"button#show\").addEventListener(\"click\", () => {\n  window.xprops.show();\n});\n```\n\n## xprops.hide `() => Promise<void>`\n\nHide the component. Works on iframe windows only, popups can not be shown/hidden after opening.\n\n```javascript\ndocument.querySelector(\"button#hide\").addEventListener(\"click\", () => {\n  window.xprops.hide();\n});\n```\n\n## xprops.export `({ [string] : any }) => Promise<void>`\n\nExport data and/or functions from the child to the parent window.\n\n```javascript\nwindow.xprops.export({\n  submit: () => {\n    document.querySelector(\"form#createPost\").submit();\n  },\n});\n```\n\nThis export will be available on the parent window:\n\n```javascript\nconst postForm = CreatePostForm();\npostForm.render(\"#create-post-form-container\");\n\ndocument.querySelector(\"button#submitForm\").addEventListener(\"click\", () => {\n  postForm.submit();\n});\n```\n\nThis assumes that when the component was first created, the author implemented the `exports` function to ensure the exports are mapped to the parent:\n\n```javascript\nconst CreatePostForm = zoid.create({\n    tag: 'create-post-form',\n    url: 'https://my-site.com/component/create-post-form',\n\n    exports: ({ getExports }) => {\n        return {\n            submit: () => getExports().then(exports => exports.submit())\n        };\n    };\n});\n```\n\nThis mapper is necessary so that the exports are immediately available on the parent component instance, even before the component is fully rendered and before `xprops.export(...)` has been called in the child window.\n\n## xprops.onError `(Error) => Promise<void>`\n\nSend an error to the parent\n\n```\nwindow.xprops.onError(new Error(`Something went wrong!`));\n```\n\n## xprops.onProps `(({ [string] : any }) => void) => void`\n\nSet up a listener to receive new props as they are set by the parent window using `componentInstance.setProps(...)`\n\nIn the child window:\n\n```javascript\nconsole.log(\"The current color is\", window.xprops.color); // red\n\nwindow.xprops.onProps(() => {\n  console.log(\"The current color is\", window.xprops.color); // blue\n});\n```\n\nIn the parent window:\n\n```javascript\nconst component = MyComponent({\n  color: \"red\",\n});\n\ncomponent.render(\"#container\").then(() => {\n  component.setProps({\n    color: \"blue\",\n  });\n});\n```\n\n## xprops.parent.props `{ [string] : any }`\n\nProps from the parent component, if the component is rendered as a child.\n\nDefine the components:\n\n```javascript\nconst ChildComponent = zoid.create({\n  tag: \"child-component\",\n  url: \"https://my-site.com/component/child\",\n});\n\nconst ParentComponent = zoid.create({\n  tag: \"child-component\",\n  url: \"https://my-site.com/component/child\",\n\n  children: () => {\n    return {\n      Child: ChildComponent,\n    };\n  },\n});\n```\n\nIn the parent window:\n\n```javascript\nconst parent = ParentComponent({\n  color: \"blue\",\n});\n\nconst child = parent.Child();\n\nchild.render(\"#child-container\");\n```\n\nIn the child window:\n\n```javascript\nconsole.log(\"The color of this component is:\", window.xprops.parent.color); // Red\n```\n\n## xprops.parent.export `({ [string] : any }) => Promise<void>`\n\nExport values to the parent component.\n\nDefine the components:\n\n```javascript\nconst ChildComponent = zoid.create({\n  tag: \"child-component\",\n  url: \"https://my-site.com/component/child\",\n});\n\nconst ParentComponent = zoid.create({\n  tag: \"child-component\",\n  url: \"https://my-site.com/component/child\",\n\n  children: () => {\n    return {\n      Child: ChildComponent,\n    };\n  },\n\n  exports: ({ getExports }) => {\n    return {\n      sayHello: () => getExports().then((exports) => exports.sayHello()),\n    };\n  },\n});\n```\n\nIn the parent window:\n\n```javascript\nconst parent = ParentComponent({\n  color: \"blue\",\n});\n\nconst child = parent.Child();\nchild.render(\"#child-container\");\n\ndocument.querySelector(\"button#doSomething\").addEventListener(\"click\", () => {\n  parent.sayHello(); // Should log 'hello world!'\n});\n```\n\nIn the child window:\n\n```javascript\nwindow.xprops.parent.export({\n  sayHello: () => {\n    console.log(\"hello world!\");\n  },\n});\n```\n\n## xprops.getSiblings `({ anyParent : boolean }) => Array<{ tag : string, xprops : XProps, exports : Exports }>`\n\nGet an array of sibling components on the same domain\n\n```javascript\nfor (const sibling of window.xprops.getSiblings()) {\n  console.log(\"Found sibling!\", sibling.tag);\n}\n```\n\n```javascript\nfor (const sibling of window.xprops.getSiblings({ anyParent: true })) {\n  console.log(\"Found sibling from any parent!\", sibling.tag);\n}\n```\n"
  },
  {
    "path": "docs/example.md",
    "content": "# zoid example\n\nLet's create a login component. We want the user to be able to log in on our site, and to notify the parent window\nthat the user has logged in, without exposing any of the users credentials to the parent window.\n\nTake a look at the [demos](http://krakenjs.com/zoid/demo/index.htm) to see this example in action.\n\n### As the component creator\n\nFirst I'd create a spec for the component's interface. I should do this once -- once I've created the component, I can render it multiple times if I need to:\n\n```javascript\nvar MyLoginComponent = zoid.create({\n  // The html tag used to render my component\n\n  tag: \"my-login-component\",\n\n  // The url that will be loaded in the iframe or popup, when someone includes my component on their page\n\n  url: \"http://www.my-site.com/my-login-component\",\n\n  // The size of the component on their page. Only px and % strings are supported\n\n  dimensions: {\n    width: \"400px\",\n    height: \"200px\",\n  },\n\n  // The properties they can (or must) pass down to my component. This is optional.\n\n  props: {\n    prefilledEmail: {\n      type: \"string\",\n      required: false,\n    },\n\n    onLogin: {\n      type: \"function\",\n      required: true,\n    },\n  },\n});\n```\n\nThis spec describes everything needed to render the component on the parent page, including the props the component expects.\n\nNow we need to actually implement the business logic of the component -- the code that will run inside the iframe.\n\nI just need to use `window.xprops` to get the props that are passed down.\n\n```html\n<!-- Pull in the login component we defined above -->\n\n<script src=\"./my-login-component.js\"></script>\n\n<!-- Set up a login form -->\n\n<form>\n  <input id=\"email\" type=\"text\" />\n  <input id=\"password\" type=\"password\" />\n  <button id=\"login\">Log In</button>\n</form>\n\n<script>\n  // Pre-polulate the email field, if we're passed an email\n\n  if (window.xprops.prefilledEmail) {\n    document.querySelector(\"#email\").value = window.xprops.prefilledEmail;\n  }\n\n  // Handle the button click to log the user in\n\n  document.querySelector(\"#login\").addEventListener(\"click\", function (event) {\n    event.preventDefault();\n\n    var email = document.querySelector(\"#email\").value;\n    var password = document.querySelector(\"#password\").value;\n\n    jQuery.post(\n      \"/api/login\",\n      { email: email, password: password },\n      function () {\n        // Since we had a successful login, call-back the parent page to let them know which user logged in:\n\n        window.xprops.onLogin(email);\n      }\n    );\n  });\n</script>\n```\n\nNow anyone can render the component we defined onto their page!\n\n### As the component user\n\nMy life is even easier. I just need to drop in your component onto my page:\n\n```html\n<!-- Pull in the login component we defined above -->\n\n<script src=\"./my-login-component.js\"></script>\n\n<!-- Set up a container for the iframe to be rendered into -->\n\n<div id=\"container\"></div>\n\n<script>\n  // Render the component\n\n  MyLoginComponent({\n    prefilledEmail: \"foo@bar.com\",\n\n    onLogin: function (email) {\n      console.log(\"User logged in with email:\", email);\n    },\n  }).render(\"#container\");\n</script>\n```\n\nI can render a component as many times as I like on my page.\n\nThis is even easier if you're using a supported framework like React, Ember or Angular -- zoid will automatically\nset up bindings for these frameworks:\n\n### React / JSX\n\nDrop the component in any `render()` method:\n\n```javascript\nlet MyReactLoginComponent = MyLoginComponent.driver(\"react\", {\n  React: React,\n  ReactDOM: ReactDOM,\n});\n```\n\n```javascript\nrender: function() {\n    return (\n        <MyReactLoginComponent prefilledEmail='foo@bar.com' onLogin={onLogin} />\n    );\n}\n```\n\n### Angular\n\nSpecify the component name as a dependency to your angular app:\n\n```javascript\nangular.module(\"myapp\", [\"my-login-component\"]);\n```\n\nInclude the tag in one of your templates (don't forget to use dasherized prop names):\n\n```html\n<my-login-component prefilled-email=\"foo@bar.com\" on-login=\"onLogin\" />\n```\n\n---\n\nAnd we're done! Notice how I never had to write any code to create an iframe, or send post messages? That's all taken care of for you.\nWhen you call `this.props.onLogin(email);` it looks like you're just calling a function, but in reality `zoid` is transparently\nturning that callback into a post-message and relaying it to the parent for you.\n\n- [Now try building a cross-domain React component!](https://medium.com/@bluepnume/creating-a-cross-domain-react-component-with-zoid-fbcccc4778fd#.73jnwv44c)\n"
  },
  {
    "path": "flow-typed/npm/@commitlint/cli_vx.x.x.js",
    "content": "// flow-typed signature: 5559d97aaf526bbcbabcb99b36bc5e17\n// flow-typed version: <<STUB>>/@commitlint/cli_v^16.2.1/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@commitlint/cli'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@commitlint/cli' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@commitlint/cli/cli' {\n  declare module.exports: any;\n}\n\ndeclare module '@commitlint/cli/lib/cli-error' {\n  declare module.exports: any;\n}\n\ndeclare module '@commitlint/cli/lib/cli' {\n  declare module.exports: any;\n}\n\ndeclare module '@commitlint/cli/lib/types' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@commitlint/cli/cli.js' {\n  declare module.exports: $Exports<'@commitlint/cli/cli'>;\n}\ndeclare module '@commitlint/cli/index' {\n  declare module.exports: $Exports<'@commitlint/cli'>;\n}\ndeclare module '@commitlint/cli/index.js' {\n  declare module.exports: $Exports<'@commitlint/cli'>;\n}\ndeclare module '@commitlint/cli/lib/cli-error.js' {\n  declare module.exports: $Exports<'@commitlint/cli/lib/cli-error'>;\n}\ndeclare module '@commitlint/cli/lib/cli.js' {\n  declare module.exports: $Exports<'@commitlint/cli/lib/cli'>;\n}\ndeclare module '@commitlint/cli/lib/types.js' {\n  declare module.exports: $Exports<'@commitlint/cli/lib/types'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@commitlint/config-conventional_vx.x.x.js",
    "content": "// flow-typed signature: 9962542700789a22cff26fc78989b904\n// flow-typed version: <<STUB>>/@commitlint/config-conventional_v^16.2.1/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@commitlint/config-conventional'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@commitlint/config-conventional' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\n\n\n// Filename aliases\ndeclare module '@commitlint/config-conventional/index' {\n  declare module.exports: $Exports<'@commitlint/config-conventional'>;\n}\ndeclare module '@commitlint/config-conventional/index.js' {\n  declare module.exports: $Exports<'@commitlint/config-conventional'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@krakenjs/belter_vx.x.x.js",
    "content": "// flow-typed signature: 78dfcbdab7b7573cb3d17170eaade9ab\n// flow-typed version: <<STUB>>/@krakenjs/belter_v^2.0.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@krakenjs/belter'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@krakenjs/belter' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@krakenjs/belter/dist/belter' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/belter.min' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/css' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/decorators' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/device' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/dom' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/experiment' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/global' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/http' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/index.flow' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/screenHeights' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/storage' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/test' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/dist/module/util' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/css' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/decorators' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/device' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/dom' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/experiment' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/global' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/http' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/index.flow' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/screenHeights' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/storage' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/test' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/belter/src/util' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@krakenjs/belter/dist/belter.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/belter'>;\n}\ndeclare module '@krakenjs/belter/dist/belter.min.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/belter.min'>;\n}\ndeclare module '@krakenjs/belter/dist/module/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/constants'>;\n}\ndeclare module '@krakenjs/belter/dist/module/css.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/css'>;\n}\ndeclare module '@krakenjs/belter/dist/module/decorators.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/decorators'>;\n}\ndeclare module '@krakenjs/belter/dist/module/device.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/device'>;\n}\ndeclare module '@krakenjs/belter/dist/module/dom.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/dom'>;\n}\ndeclare module '@krakenjs/belter/dist/module/experiment.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/experiment'>;\n}\ndeclare module '@krakenjs/belter/dist/module/global.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/global'>;\n}\ndeclare module '@krakenjs/belter/dist/module/http.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/http'>;\n}\ndeclare module '@krakenjs/belter/dist/module/index.flow.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/index.flow'>;\n}\ndeclare module '@krakenjs/belter/dist/module/index' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module'>;\n}\ndeclare module '@krakenjs/belter/dist/module/index.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module'>;\n}\ndeclare module '@krakenjs/belter/dist/module/screenHeights.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/screenHeights'>;\n}\ndeclare module '@krakenjs/belter/dist/module/storage.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/storage'>;\n}\ndeclare module '@krakenjs/belter/dist/module/test.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/test'>;\n}\ndeclare module '@krakenjs/belter/dist/module/types.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/types'>;\n}\ndeclare module '@krakenjs/belter/dist/module/util.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/dist/module/util'>;\n}\ndeclare module '@krakenjs/belter/index' {\n  declare module.exports: $Exports<'@krakenjs/belter'>;\n}\ndeclare module '@krakenjs/belter/index.js' {\n  declare module.exports: $Exports<'@krakenjs/belter'>;\n}\ndeclare module '@krakenjs/belter/src/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/constants'>;\n}\ndeclare module '@krakenjs/belter/src/css.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/css'>;\n}\ndeclare module '@krakenjs/belter/src/decorators.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/decorators'>;\n}\ndeclare module '@krakenjs/belter/src/device.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/device'>;\n}\ndeclare module '@krakenjs/belter/src/dom.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/dom'>;\n}\ndeclare module '@krakenjs/belter/src/experiment.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/experiment'>;\n}\ndeclare module '@krakenjs/belter/src/global.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/global'>;\n}\ndeclare module '@krakenjs/belter/src/http.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/http'>;\n}\ndeclare module '@krakenjs/belter/src/index.flow.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/index.flow'>;\n}\ndeclare module '@krakenjs/belter/src/index' {\n  declare module.exports: $Exports<'@krakenjs/belter/src'>;\n}\ndeclare module '@krakenjs/belter/src/index.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src'>;\n}\ndeclare module '@krakenjs/belter/src/screenHeights.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/screenHeights'>;\n}\ndeclare module '@krakenjs/belter/src/storage.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/storage'>;\n}\ndeclare module '@krakenjs/belter/src/test.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/test'>;\n}\ndeclare module '@krakenjs/belter/src/types.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/types'>;\n}\ndeclare module '@krakenjs/belter/src/util.js' {\n  declare module.exports: $Exports<'@krakenjs/belter/src/util'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@krakenjs/cross-domain-utils_vx.x.x.js",
    "content": "// flow-typed signature: 1b384d8a481c18b578d4eb7f1866aefd\n// flow-typed version: <<STUB>>/@krakenjs/cross-domain-utils_v^3.0.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@krakenjs/cross-domain-utils'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@krakenjs/cross-domain-utils' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@krakenjs/cross-domain-utils/dist/cross-domain-utils' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/cross-domain-utils.min' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/module/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/module/index.flow' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/module' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/module/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/module/util' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/dist/module/utils' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/src/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/src/index.flow' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/src' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/src/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/src/util' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/cross-domain-utils/src/utils' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@krakenjs/cross-domain-utils/dist/cross-domain-utils.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/cross-domain-utils'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/cross-domain-utils.min.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/cross-domain-utils.min'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module/constants'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/index.flow.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module/index.flow'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/index' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/index.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/types.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module/types'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/util.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module/util'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/dist/module/utils.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/dist/module/utils'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src/constants'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/index.flow.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src/index.flow'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/index' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/index.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/types.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src/types'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/util.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src/util'>;\n}\ndeclare module '@krakenjs/cross-domain-utils/src/utils.js' {\n  declare module.exports: $Exports<'@krakenjs/cross-domain-utils/src/utils'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@krakenjs/grumbler-scripts_vx.x.x.js",
    "content": "// flow-typed signature: 7ec2f9ff984b201918fcd9678837db06\n// flow-typed version: <<STUB>>/@krakenjs/grumbler-scripts_v^8.0.4/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@krakenjs/grumbler-scripts'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@krakenjs/grumbler-scripts' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@krakenjs/grumbler-scripts/config/karma.conf' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/grumbler-scripts/config/webpack.config' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/grumbler-scripts/test/component' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/grumbler-scripts/test/dependency' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/grumbler-scripts/test/module' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/grumbler-scripts/webpack.config' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@krakenjs/grumbler-scripts/config/karma.conf.js' {\n  declare module.exports: $Exports<'@krakenjs/grumbler-scripts/config/karma.conf'>;\n}\ndeclare module '@krakenjs/grumbler-scripts/config/webpack.config.js' {\n  declare module.exports: $Exports<'@krakenjs/grumbler-scripts/config/webpack.config'>;\n}\ndeclare module '@krakenjs/grumbler-scripts/test/component.jsx' {\n  declare module.exports: $Exports<'@krakenjs/grumbler-scripts/test/component'>;\n}\ndeclare module '@krakenjs/grumbler-scripts/test/dependency.js' {\n  declare module.exports: $Exports<'@krakenjs/grumbler-scripts/test/dependency'>;\n}\ndeclare module '@krakenjs/grumbler-scripts/test/module.js' {\n  declare module.exports: $Exports<'@krakenjs/grumbler-scripts/test/module'>;\n}\ndeclare module '@krakenjs/grumbler-scripts/webpack.config.js' {\n  declare module.exports: $Exports<'@krakenjs/grumbler-scripts/webpack.config'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@krakenjs/jsx-pragmatic_vx.x.x.js",
    "content": "// flow-typed signature: e3879a2c640bc8421f798cb70cce7477\n// flow-typed version: <<STUB>>/@krakenjs/jsx-pragmatic_v^3.0.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@krakenjs/jsx-pragmatic'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@krakenjs/jsx-pragmatic' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@krakenjs/jsx-pragmatic/dist/jsx-pragmatic-demo' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/jsx-pragmatic' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/jsx-pragmatic.min' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component/regex' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component/style' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/node' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/dom' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/html' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/preact' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/react' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/regex' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/text' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/util' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/component' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/component/regex' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/component/style' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/node' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/dom' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/html' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/preact' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/react' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/regex' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/text' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/jsx-pragmatic/src/util' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@krakenjs/jsx-pragmatic/dist/jsx-pragmatic-demo.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/jsx-pragmatic-demo'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/jsx-pragmatic.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/jsx-pragmatic'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/jsx-pragmatic.min.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/jsx-pragmatic.min'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/component'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/component'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component/regex.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/component/regex'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/component/style.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/component/style'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/constants'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/node.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/node'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/dom.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers/dom'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/html.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers/html'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/preact.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers/preact'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/react.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers/react'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/regex.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers/regex'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/renderers/text.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/renderers/text'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/types.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/types'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/dist/module/util.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/dist/module/util'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/component/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/component'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/component/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/component'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/component/regex.jsx' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/component/regex'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/component/style.jsx' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/component/style'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/constants'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/node.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/node'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/dom.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers/dom'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/html.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers/html'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/index' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/index.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/preact.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers/preact'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/react.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers/react'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/regex.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers/regex'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/renderers/text.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/renderers/text'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/types.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/types'>;\n}\ndeclare module '@krakenjs/jsx-pragmatic/src/util.js' {\n  declare module.exports: $Exports<'@krakenjs/jsx-pragmatic/src/util'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@krakenjs/post-robot_vx.x.x.js",
    "content": "// flow-typed signature: 18f28813f8bef0fbfc11f18b89116082\n// flow-typed version: <<STUB>>/@krakenjs/post-robot_v^11.0.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@krakenjs/post-robot'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@krakenjs/post-robot' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@krakenjs/post-robot/dist/module/bridge/bridge' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/bridge/child' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/bridge/common' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/bridge' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/bridge/parent' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/bridge/setup' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/clean' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/conf/config' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/conf/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/conf' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/declarations' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers/listeners' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers/receive' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers/receive/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers/send' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers/send/strategies' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/drivers/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/global' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/lib/compat' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/lib/hello' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/lib' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/lib/windows' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/public' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/public/on' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/public/send' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/serialize/function' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/serialize' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/serialize/promise' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/serialize/serialize' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/serialize/window' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/setup' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/module/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/post-robot.ie' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/post-robot.ie.min' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/post-robot' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/dist/post-robot.min' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/globals' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/bridge/bridge' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/bridge/child' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/bridge/common' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/bridge' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/bridge/parent' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/bridge/setup' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/clean' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/conf/config' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/conf/constants' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/conf' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/declarations' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers/listeners' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers/receive' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers/receive/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers/send' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers/send/strategies' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/drivers/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/global' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/lib/compat' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/lib/hello' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/lib' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/lib/windows' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/public' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/public/on' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/public/send' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/serialize/function' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/serialize' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/serialize/promise' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/serialize/serialize' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/serialize/window' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/setup' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/post-robot/src/types' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@krakenjs/post-robot/dist/module/bridge/bridge.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge/bridge'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/bridge/child.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge/child'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/bridge/common.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge/common'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/bridge/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/bridge/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/bridge/parent.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge/parent'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/bridge/setup.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/bridge/setup'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/clean.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/clean'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/conf/config.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/conf/config'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/conf/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/conf/constants'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/conf/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/conf'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/conf/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/conf'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/declarations.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/declarations'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/listeners.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/listeners'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/receive/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/receive'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/receive/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/receive'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/receive/types.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/receive/types'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/send/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/send'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/send/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/send'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/send/strategies.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/send/strategies'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/drivers/types.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/drivers/types'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/global.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/global'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/lib/compat.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/lib/compat'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/lib/hello.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/lib/hello'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/lib/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/lib'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/lib/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/lib'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/lib/windows.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/lib/windows'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/public/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/public'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/public/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/public'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/public/on.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/public/on'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/public/send.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/public/send'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/serialize/function.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/serialize/function'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/serialize/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/serialize'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/serialize/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/serialize'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/serialize/promise.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/serialize/promise'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/serialize/serialize.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/serialize/serialize'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/serialize/window.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/serialize/window'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/setup.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/setup'>;\n}\ndeclare module '@krakenjs/post-robot/dist/module/types.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/module/types'>;\n}\ndeclare module '@krakenjs/post-robot/dist/post-robot.ie.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/post-robot.ie'>;\n}\ndeclare module '@krakenjs/post-robot/dist/post-robot.ie.min.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/post-robot.ie.min'>;\n}\ndeclare module '@krakenjs/post-robot/dist/post-robot.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/post-robot'>;\n}\ndeclare module '@krakenjs/post-robot/dist/post-robot.min.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/dist/post-robot.min'>;\n}\ndeclare module '@krakenjs/post-robot/globals.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/globals'>;\n}\ndeclare module '@krakenjs/post-robot/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot'>;\n}\ndeclare module '@krakenjs/post-robot/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/bridge.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge/bridge'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/child.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge/child'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/common.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge/common'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/parent.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge/parent'>;\n}\ndeclare module '@krakenjs/post-robot/src/bridge/setup.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/bridge/setup'>;\n}\ndeclare module '@krakenjs/post-robot/src/clean.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/clean'>;\n}\ndeclare module '@krakenjs/post-robot/src/conf/config.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/conf/config'>;\n}\ndeclare module '@krakenjs/post-robot/src/conf/constants.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/conf/constants'>;\n}\ndeclare module '@krakenjs/post-robot/src/conf/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/conf'>;\n}\ndeclare module '@krakenjs/post-robot/src/conf/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/conf'>;\n}\ndeclare module '@krakenjs/post-robot/src/declarations.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/declarations'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/listeners.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/listeners'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/receive/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/receive'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/receive/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/receive'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/receive/types.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/receive/types'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/send/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/send'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/send/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/send'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/send/strategies.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/send/strategies'>;\n}\ndeclare module '@krakenjs/post-robot/src/drivers/types.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/drivers/types'>;\n}\ndeclare module '@krakenjs/post-robot/src/global.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/global'>;\n}\ndeclare module '@krakenjs/post-robot/src/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src'>;\n}\ndeclare module '@krakenjs/post-robot/src/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src'>;\n}\ndeclare module '@krakenjs/post-robot/src/lib/compat.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/lib/compat'>;\n}\ndeclare module '@krakenjs/post-robot/src/lib/hello.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/lib/hello'>;\n}\ndeclare module '@krakenjs/post-robot/src/lib/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/lib'>;\n}\ndeclare module '@krakenjs/post-robot/src/lib/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/lib'>;\n}\ndeclare module '@krakenjs/post-robot/src/lib/windows.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/lib/windows'>;\n}\ndeclare module '@krakenjs/post-robot/src/public/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/public'>;\n}\ndeclare module '@krakenjs/post-robot/src/public/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/public'>;\n}\ndeclare module '@krakenjs/post-robot/src/public/on.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/public/on'>;\n}\ndeclare module '@krakenjs/post-robot/src/public/send.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/public/send'>;\n}\ndeclare module '@krakenjs/post-robot/src/serialize/function.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/serialize/function'>;\n}\ndeclare module '@krakenjs/post-robot/src/serialize/index' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/serialize'>;\n}\ndeclare module '@krakenjs/post-robot/src/serialize/index.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/serialize'>;\n}\ndeclare module '@krakenjs/post-robot/src/serialize/promise.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/serialize/promise'>;\n}\ndeclare module '@krakenjs/post-robot/src/serialize/serialize.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/serialize/serialize'>;\n}\ndeclare module '@krakenjs/post-robot/src/serialize/window.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/serialize/window'>;\n}\ndeclare module '@krakenjs/post-robot/src/setup.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/setup'>;\n}\ndeclare module '@krakenjs/post-robot/src/types.js' {\n  declare module.exports: $Exports<'@krakenjs/post-robot/src/types'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@krakenjs/zalgo-promise_vx.x.x.js",
    "content": "// flow-typed signature: a31bde17276864ac955bb0ae5d9ebb5f\n// flow-typed version: <<STUB>>/@krakenjs/zalgo-promise_v^2.0.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@krakenjs/zalgo-promise'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@krakenjs/zalgo-promise' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@krakenjs/zalgo-promise/dist/module/exceptions' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/module/export' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/module/flush' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/module' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/module/promise' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/module/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/module/utils' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/zalgo-promise' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/dist/zalgo-promise.min' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src/exceptions' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src/export' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src/flush' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src/promise' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@krakenjs/zalgo-promise/src/utils' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@krakenjs/zalgo-promise/dist/module/exceptions.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module/exceptions'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/export.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module/export'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/flush.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module/flush'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/index' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/index.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/promise.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module/promise'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/types.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module/types'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/module/utils.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/module/utils'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/zalgo-promise.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/zalgo-promise'>;\n}\ndeclare module '@krakenjs/zalgo-promise/dist/zalgo-promise.min.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/dist/zalgo-promise.min'>;\n}\ndeclare module '@krakenjs/zalgo-promise/index' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise'>;\n}\ndeclare module '@krakenjs/zalgo-promise/index.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/exceptions.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src/exceptions'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/export.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src/export'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/flush.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src/flush'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/index' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/index.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/promise.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src/promise'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/types.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src/types'>;\n}\ndeclare module '@krakenjs/zalgo-promise/src/utils.js' {\n  declare module.exports: $Exports<'@krakenjs/zalgo-promise/src/utils'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@octokit/rest_v18.x.x.js",
    "content": "// flow-typed signature: 6103021a6389a42ea8b41c577b3f91b3\n// flow-typed version: 79dc43986b/@octokit/rest_v18.x.x/flow_>=v0.83.x\n\ndeclare module '@octokit/rest' {\n  /**\n   * Octokit-specific request options which are ignored for the actual request, but can be used by Octokit or plugins to manipulate how the request is sent or how a response is handled\n   */\n  declare type RequestRequestOptions = {|\n    /**\n     * Node only. Useful for custom proxy, certificate, or dns lookup.\n     *\n     * @see https://nodejs.org/api/http.html#http_class_http_agent\n     */\n    agent?: mixed,\n    /**\n     * Custom replacement for built-in fetch method. Useful for testing or request hooks.\n     */\n    fetch?: any,\n    /**\n     * Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests.\n     */\n    signal?: any,\n    /**\n     * Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). `options.request.signal` is recommended instead.\n     */\n    timeout?: number,\n    [option: string]: any,\n  |};\n\n  declare class Octokit {\n    constructor(options?: {|\n      authStrategy?: any,\n      auth?: any,\n      userAgent?: string,\n      previews?: Array<string>,\n      baseUrl?: string,\n      log?: {|\n        debug?: (message: string) => mixed;\n        info?: (message: string) => mixed;\n        warn?: (message: string) => mixed;\n        error?: (message: string) => mixed;\n      |},\n      request?: RequestRequestOptions,\n      timeZone?: string,\n      [option: string]: any,\n    |}): this;\n\n    static VERSION: string;\n\n    actions: {| [key: string]: any |},\n    activity: {| [key: string]: any |},\n    apps: {| [key: string]: any |},\n    auth: (...args: Array<any>) => Promise<{| [key: string]: any |}>,\n    billing: {| [key: string]: any |},\n    checks: {| [key: string]: any |},\n    codeScanning: {| [key: string]: any |},\n    codesOfConduct: {| [key: string]: any |},\n    emojis: {| [key: string]: any |},\n    enterpriseAdmin: {| [key: string]: any |},\n    gists: {| [key: string]: any |},\n    git: {| [key: string]: any |},\n    gitignore: {| [key: string]: any |},\n    graphql: (...args: Array<any>) => any,\n    hook: (...args: Array<any>) => any,\n    interactions: {| [key: string]: any |},\n    issues: {| [key: string]: any |},\n    licenses: {| [key: string]: any |},\n    log:{| [key: string]: any |},\n    markdown: {| [key: string]: any |},\n    meta: {| [key: string]: any |},\n    migrations: {| [key: string]: any |},\n    orgs: {| [key: string]: any |},\n    packages: {| [key: string]: any |},\n    paginate: (...args: Array<any>) => any,\n    projects: {| [key: string]: any |},\n    pulls: {| [key: string]: any |},\n    rateLimit: {| [key: string]: any |},\n    reactions: {| [key: string]: any |},\n    repos: {\n      getContent: ({|\n        owner: string,\n        repo: string,\n        path?: string,\n        ref?: string,\n      |}) => Promise<{|\n        headers: {| [key: string]: any |},\n        status: number,\n        url: string,\n        data: Array<{|\n          download_url: any,\n          git_url: string,\n          html_url: string,\n          name: string,\n          path: string,\n          sha: string,\n          size: number,\n          type: string,\n          url: string,\n          _links: {|\n            git: string,\n            html: string,\n            self: string,\n          |}\n        |}>,\n      |}>,\n      /**\n       * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API.\n       *\n       * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.\n       */\n      listReleases: ({|\n        /**\n         * The account owner of the repository. The name is not case sensitive.\n         */\n        owner: string,\n        /**\n         * The name of the repository. The name is not case sensitive.\n         */\n        repo: string,\n        /**\n         * The number of results per page (max 100).\n         */\n        page?: number,\n        /**\n         * Page number of the results to fetch.\n         */\n        per_page?: number,\n      |}) => Promise<{|\n        headers: {| [key: string]: any |},\n        status: number,\n        url: string,\n        data: Array<{|\n          url: string,\n          assets_url: string,\n          upload_url: string,\n          html_url: string,\n          id: number,\n          author: {|\n            login: string,\n            id: number,\n            node_id: string,\n            avatar_url: string,\n            gravatar_id: string,\n            url: string,\n            html_url: string,\n            followers_url: string,\n            following_url: string,\n            gists_url: string,\n            starred_url: string,\n            subscriptions_url: string,\n            organizations_url: string,\n            repos_url: string,\n            events_url: string,\n            received_events_url: string,\n            type: string,\n            site_admin: boolean,\n          |},\n          node_id: string,\n          tag_name: string,\n          target_commitish: string,\n          name: any,\n          draft: boolean,\n          prerelease: boolean,\n          created_at: string,\n          published_at: string,\n          assets: Array<any>,\n          tarball_url: string,\n          zipball_url: string,\n          body: string,\n        |}>,\n      |}>,\n      [key: string]: any,\n    },\n    request: (...args: Array<any>) => any,\n    rest: {| [key: string]: any |},\n    search: {| [key: string]: any |},\n    secretScanning: {| [key: string]: any |},\n    teams: {| [key: string]: any |},\n    users: {| [key: string]: any |},\n  }\n\n  declare module.exports: {|\n    Octokit: typeof Octokit,\n  |};\n}\n"
  },
  {
    "path": "flow-typed/npm/colors_v1.x.x.js",
    "content": "// flow-typed signature: 6c56e55f6af24f47c33f50f10270785f\n// flow-typed version: 590676b089/colors_v1.x.x/flow_>=v0.104.x\n\ndeclare module \"colors\" {\n  declare type Color = {\n    (text: string): string,\n    strip: Color,\n    stripColors: Color,\n    black: Color,\n    red: Color,\n    green: Color,\n    yellow: Color,\n    blue: Color,\n    magenta: Color,\n    cyan: Color,\n    white: Color,\n    gray: Color,\n    grey: Color,\n    bgBlack: Color,\n    bgRed: Color,\n    bgGreen: Color,\n    bgYellow: Color,\n    bgBlue: Color,\n    bgMagenta: Color,\n    bgCyan: Color,\n    bgWhite: Color,\n    reset: Color,\n    bold: Color,\n    dim: Color,\n    italic: Color,\n    underline: Color,\n    inverse: Color,\n    hidden: Color,\n    strikethrough: Color,\n    rainbow: Color,\n    zebra: Color,\n    america: Color,\n    trap: Color,\n    random: Color,\n    zalgo: Color,\n    ...\n  };\n\n  declare module.exports: {\n    enabled: boolean,\n    themes: {...},\n    enable(): void,\n    disable(): void,\n    setTheme(theme: {...}): void,\n    strip: Color,\n    stripColors: Color,\n    black: Color,\n    red: Color,\n    green: Color,\n    yellow: Color,\n    blue: Color,\n    magenta: Color,\n    cyan: Color,\n    white: Color,\n    gray: Color,\n    grey: Color,\n    bgBlack: Color,\n    bgRed: Color,\n    bgGreen: Color,\n    bgYellow: Color,\n    bgBlue: Color,\n    bgMagenta: Color,\n    bgCyan: Color,\n    bgWhite: Color,\n    reset: Color,\n    bold: Color,\n    dim: Color,\n    italic: Color,\n    underline: Color,\n    inverse: Color,\n    hidden: Color,\n    strikethrough: Color,\n    rainbow: Color,\n    zebra: Color,\n    america: Color,\n    trap: Color,\n    random: Color,\n    zalgo: Color,\n    ...\n  };\n}\n\ndeclare module \"colors/safe\" {\n  declare module.exports: $Exports<\"colors\">;\n}\n"
  },
  {
    "path": "flow-typed/npm/cross-env_vx.x.x.js",
    "content": "// flow-typed signature: d88f07e71439b946a3c634907a30e9c7\n// flow-typed version: <<STUB>>/cross-env_v^7.0.3/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'cross-env'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'cross-env' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'cross-env/src/bin/cross-env-shell' {\n  declare module.exports: any;\n}\n\ndeclare module 'cross-env/src/bin/cross-env' {\n  declare module.exports: any;\n}\n\ndeclare module 'cross-env/src/command' {\n  declare module.exports: any;\n}\n\ndeclare module 'cross-env/src' {\n  declare module.exports: any;\n}\n\ndeclare module 'cross-env/src/is-windows' {\n  declare module.exports: any;\n}\n\ndeclare module 'cross-env/src/variable' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'cross-env/src/bin/cross-env-shell.js' {\n  declare module.exports: $Exports<'cross-env/src/bin/cross-env-shell'>;\n}\ndeclare module 'cross-env/src/bin/cross-env.js' {\n  declare module.exports: $Exports<'cross-env/src/bin/cross-env'>;\n}\ndeclare module 'cross-env/src/command.js' {\n  declare module.exports: $Exports<'cross-env/src/command'>;\n}\ndeclare module 'cross-env/src/index' {\n  declare module.exports: $Exports<'cross-env/src'>;\n}\ndeclare module 'cross-env/src/index.js' {\n  declare module.exports: $Exports<'cross-env/src'>;\n}\ndeclare module 'cross-env/src/is-windows.js' {\n  declare module.exports: $Exports<'cross-env/src/is-windows'>;\n}\ndeclare module 'cross-env/src/variable.js' {\n  declare module.exports: $Exports<'cross-env/src/variable'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/flow-bin_v0.x.x.js",
    "content": "// flow-typed signature: 28fdff7f110e1c75efab63ff205dda30\n// flow-typed version: c6154227d1/flow-bin_v0.x.x/flow_>=v0.104.x\n\ndeclare module \"flow-bin\" {\n  declare module.exports: string;\n}\n"
  },
  {
    "path": "flow-typed/npm/fs-extra_v8.x.x.js",
    "content": "// flow-typed signature: beb4c73787fb04b445ce22aee439eed9\n// flow-typed version: d81afd5307/fs-extra_v8.x.x/flow_>=v0.104.x\n\ndeclare module \"fs-extra\" {\n  import type { Stats, ReadStream, WriteStream } from \"fs\";\n  import typeof fsTypes from \"fs\";\n\n  declare type SymlinkType = \"dir\" | \"file\";\n  declare type FsSymlinkType = \"dir\" | \"file\" | \"junction\";\n\n  declare type CopyFilterSync = (src: string, dest: string) => boolean;\n  declare type CopyFilterAsync = (\n    src: string,\n    dest: string\n  ) => Promise<boolean>;\n\n  declare type CopyOptions = {\n    dereference?: boolean,\n    overwrite?: boolean,\n    preserveTimestamps?: boolean,\n    errorOnExist?: boolean,\n    recursive?: boolean,\n    ...\n  };\n\n  declare type CopyOptionsAync = CopyOptions & { filter?: CopyFilterSync | CopyFilterAsync, ... };\n\n  declare type CopyOptionsSync = CopyOptions & { filter?: CopyFilterSync, ... };\n\n  declare type MoveOptions = {\n    overwrite?: boolean,\n    limit?: number,\n    ...\n  };\n\n  declare type ReadOptions = {\n    throws?: boolean,\n    fs?: Object,\n    reviver?: any,\n    encoding?: string,\n    flag?: string,\n    ...\n  };\n\n  declare type WriteFileOptions = {\n    encoding?: string,\n    flag?: string,\n    mode?: number,\n    ...\n  };\n\n  declare type WriteOptions = WriteFileOptions & {\n    fs?: Object,\n    replacer?: any,\n    spaces?: number | string,\n    EOL?: string,\n    ...\n  };\n\n  declare type ReadResult = {\n    bytesRead: number,\n    buffer: Buffer,\n    ...\n  };\n\n  declare type WriteResult = {\n    bytesWritten: number,\n    buffer: Buffer,\n    ...\n  };\n\n  declare type ReadStreamOptions = {\n    bufferSize?: number,\n    encoding?: string,\n    fd?: number,\n    flags?: string,\n    mode?: number,\n    ...\n  }\n\n  declare type WriteStreamOptions = {\n    encoding?: string,\n    flags?: string,\n    string?: string,\n    ...\n  }\n\n  declare function copy(\n    src: string,\n    dest: string,\n    options?: CopyOptionsAync\n  ): Promise<void>;\n  declare function copy(\n    src: string,\n    dest: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function copy(\n    src: string,\n    dest: string,\n    options: CopyOptionsAync,\n    callback: (err: Error) => void\n  ): void;\n  declare function copySync(\n    src: string,\n    dest: string,\n    options?: CopyOptionsSync\n  ): void;\n\n  declare function move(\n    src: string,\n    dest: string,\n    options?: MoveOptions\n  ): Promise<void>;\n  declare function move(\n    src: string,\n    dest: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function move(\n    src: string,\n    dest: string,\n    options: MoveOptions,\n    callback: (err: Error) => void\n  ): void;\n  declare function moveSync(\n    src: string,\n    dest: string,\n    options?: MoveOptions\n  ): void;\n\n  declare function createFile(file: string): Promise<void>;\n  declare function createFile(\n    file: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function createFileSync(file: string): void;\n  declare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;\n  declare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;\n\n  declare function ensureDir(path: string): Promise<void>;\n  declare function ensureDir(\n    path: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function ensureDirSync(path: string): void;\n\n  declare function exists(path: string): Promise<boolean>;\n  declare function exists(path: string, callback?: (exists: boolean) => void): void;\n\n  declare function mkdirs(dir: string): Promise<void>;\n  declare function mkdirs(\n    dir: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function mkdirsSync(dir: string): void;\n\n  declare function mkdirp(dir: string): Promise<void>;\n  declare function mkdirp(\n    dir: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function mkdirpSync(dir: string): void;\n\n  declare function outputFile(\n    file: string,\n    data: any,\n    options?: WriteFileOptions | string\n  ): Promise<void>;\n  declare function outputFile(\n    file: string,\n    data: any,\n    callback: (err: Error) => void\n  ): void;\n  declare function outputFile(\n    file: string,\n    data: any,\n    options: WriteFileOptions | string,\n    callback: (err: Error) => void\n  ): void;\n  declare function outputFileSync(\n    file: string,\n    data: any,\n    options?: WriteFileOptions | string\n  ): void;\n\n  declare function readJson(\n    file: string,\n    options?: ReadOptions\n  ): Promise<any>;\n  declare function readJson(\n    file: string,\n    callback: (err: Error, jsonObject: any) => void\n  ): void;\n  declare function readJson(\n    file: string,\n    options: ReadOptions,\n    callback: (err: Error, jsonObject: any) => void\n  ): void;\n  declare function readJSON(\n    file: string,\n    options?: ReadOptions\n  ): Promise<any>;\n  declare function readJSON(\n    file: string,\n    callback: (err: Error, jsonObject: any) => void\n  ): void;\n  declare function readJSON(\n    file: string,\n    options: ReadOptions,\n    callback: (err: Error, jsonObject: any) => void\n  ): void;\n\n  declare function readJsonSync(\n    file: string,\n    options?: ReadOptions\n  ): any;\n  declare function readJSONSync(\n    file: string,\n    options?: ReadOptions\n  ): any;\n\n  declare function remove(dir: string): Promise<void>;\n  declare function remove(\n    dir: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function removeSync(dir: string): void;\n\n  declare function outputJson(\n    file: string,\n    data: any,\n    options?: WriteOptions\n  ): Promise<void>;\n  declare function outputJSON(\n    file: string,\n    data: any,\n    options?: WriteOptions\n  ): Promise<void>;\n  declare function outputJson(\n    file: string,\n    data: any,\n    options: WriteOptions,\n    callback: (err: Error) => void\n  ): void;\n  declare function outputJSON(\n    file: string,\n    data: any,\n    options: WriteOptions,\n    callback: (err: Error) => void\n  ): void;\n  declare function outputJson(\n    file: string,\n    data: any,\n    callback: (err: Error) => void\n  ): void;\n  declare function outputJSON(\n    file: string,\n    data: any,\n    callback: (err: Error) => void\n  ): void;\n  declare function outputJsonSync(\n    file: string,\n    data: any,\n    options?: WriteOptions\n  ): void;\n  declare function outputJSONSync(\n    file: string,\n    data: any,\n    options?: WriteOptions\n  ): void;\n\n  declare function writeJSON(\n    file: string,\n    object: any,\n    options?: WriteOptions\n  ): Promise<void>;\n  declare function writeJSON(\n    file: string,\n    object: any,\n    callback: (err: Error) => void\n  ): void;\n  declare function writeJSON(\n    file: string,\n    object: any,\n    options: WriteOptions,\n    callback: (err: Error) => void\n  ): void;\n  declare function writeJson(\n    file: string,\n    object: any,\n    options?: WriteOptions\n  ): Promise<void>;\n  declare function writeJson(\n    file: string,\n    object: any,\n    callback: (err: Error) => void\n  ): void;\n  declare function writeJson(\n    file: string,\n    object: any,\n    options: WriteOptions,\n    callback: (err: Error) => void\n  ): void;\n\n  declare function writeJsonSync(\n    file: string,\n    object: any,\n    options?: WriteOptions\n  ): void;\n  declare function writeJSONSync(\n    file: string,\n    object: any,\n    options?: WriteOptions\n  ): void;\n\n  declare function ensureFile(path: string): Promise<void>;\n  declare function ensureFile(\n    path: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function ensureFileSync(path: string): void;\n\n  declare function ensureLink(src: string, dest: string): Promise<void>;\n  declare function ensureLink(\n    src: string,\n    dest: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function ensureLinkSync(src: string, dest: string): void;\n\n  declare function ensureSymlink(\n    src: string,\n    dest: string,\n    type?: SymlinkType\n  ): Promise<void>;\n  declare function ensureSymlink(\n    src: string,\n    dest: string,\n    type: SymlinkType,\n    callback: (err: Error) => void\n  ): void;\n  declare function ensureSymlink(\n    src: string,\n    dest: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function ensureSymlinkSync(\n    src: string,\n    dest: string,\n    type?: SymlinkType\n  ): void;\n\n  declare function emptyDir(path: string): Promise<void>;\n  declare function emptyDir(\n    path: string,\n    callback: (err: Error) => void\n  ): void;\n  declare function emptyDirSync(path: string): void;\n\n  declare function pathExists(path: string): Promise<boolean>;\n  declare function pathExists(\n    path: string,\n    callback: (err: Error, exists: boolean) => void\n  ): void;\n  declare function pathExistsSync(path: string): boolean;\n\n  declare function access(\n    path: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function access(\n    path: string | Buffer,\n    mode: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function access(\n    path: string | Buffer,\n    mode?: number\n  ): Promise<void>;\n\n  declare function appendFile(\n    file: string | Buffer | number,\n    data: any,\n    options: {\n      encoding?: string,\n      mode?: number | string,\n      flag?: string,\n      ...\n    },\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function appendFile(\n    file: string | Buffer | number,\n    data: any,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function appendFile(\n    file: string | Buffer | number,\n    data: any,\n    options?: {\n      encoding?: string,\n      mode?: number | string,\n      flag?: string,\n      ...\n    }\n  ): Promise<void>;\n\n  declare function chmod(\n    path: string | Buffer,\n    mode: string | number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function chmod(\n    path: string | Buffer,\n    mode: string | number\n  ): Promise<void>;\n\n  declare function chown(\n    path: string | Buffer,\n    uid: number,\n    gid: number\n  ): Promise<void>;\n  declare function chown(\n    path: string | Buffer,\n    uid: number,\n    gid: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n\n  declare function close(\n    fd: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function close(fd: number): Promise<void>;\n\n  declare function fchmod(\n    fd: number,\n    mode: string | number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function fchmod(\n    fd: number,\n    mode: string | number\n  ): Promise<void>;\n\n  declare function fchown(\n    fd: number,\n    uid: number,\n    gid: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function fchown(\n    fd: number,\n    uid: number,\n    gid: number\n  ): Promise<void>;\n\n  declare function fdatasync(fd: number, callback: () => void): void;\n  declare function fdatasync(fd: number): Promise<void>;\n\n  declare function fstat(\n    fd: number,\n    callback: (err: ErrnoError, stats: Stats) => any\n  ): void;\n  declare function fstat(fd: number): Promise<Stats>;\n\n  declare function fsync(\n    fd: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function fsync(fd: number): Promise<void>;\n\n  declare function ftruncate(\n    fd: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function ftruncate(\n    fd: number,\n    len: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function ftruncate(fd: number, len?: number): Promise<void>;\n\n  declare function futimes(\n    fd: number,\n    atime: number,\n    mtime: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function futimes(\n    fd: number,\n    atime: Date,\n    mtime: Date,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function futimes(\n    fd: number,\n    atime: number,\n    mtime: number\n  ): Promise<void>;\n  declare function futimes(\n    fd: number,\n    atime: Date,\n    mtime: Date\n  ): Promise<void>;\n\n  declare function lchown(\n    path: string | Buffer,\n    uid: number,\n    gid: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function lchown(\n    path: string | Buffer,\n    uid: number,\n    gid: number\n  ): Promise<void>;\n\n  declare function link(\n    srcpath: string | Buffer,\n    dstpath: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function link(\n    srcpath: string | Buffer,\n    dstpath: string | Buffer\n  ): Promise<void>;\n\n  declare function lstat(\n    path: string | Buffer,\n    callback: (err: ErrnoError, stats: Stats) => any\n  ): void;\n  declare function lstat(path: string | Buffer): Promise<Stats>;\n\n  declare function mkdir(\n    path: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function mkdir(\n    path: string | Buffer,\n    mode: number | string,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function mkdir(path: string | Buffer): Promise<void>;\n\n  declare function open(\n    path: string | Buffer,\n    flags: string | number,\n    callback: (err: ErrnoError, fd: number) => void\n  ): void;\n  declare function open(\n    path: string | Buffer,\n    flags: string | number,\n    mode: number,\n    callback: (err: ErrnoError, fd: number) => void\n  ): void;\n  declare function open(\n    path: string | Buffer,\n    flags: string | number,\n    mode?: number\n  ): Promise<number>;\n\n  declare function read(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    position: number | null,\n    callback: (err: ErrnoError, bytesRead: number, buffer: Buffer) => void\n  ): void;\n  declare function read(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    position: number | null\n  ): Promise<ReadResult>;\n\n  declare function readFile(\n    file: string | Buffer | number,\n    callback: (err: ErrnoError, data: Buffer) => void\n  ): void;\n  declare function readFile(\n    file: string | Buffer | number,\n    encoding: string,\n    callback: (err: ErrnoError, data: string) => void\n  ): void;\n  declare function readFile(\n    file: string | Buffer | number,\n    options: { flag?: string, ... } | {\n      encoding: string,\n      flag?: string,\n      ...\n    },\n    callback: (err: ErrnoError, data: Buffer) => void\n  ): void;\n  declare function readFile(\n    file: string | Buffer | number,\n    options: { flag?: string, ... } | {\n      encoding: string,\n      flag?: string,\n      ...\n    },\n  ): Promise<string>;\n  declare function readFile(\n    file: string | Buffer | number,\n    encoding: string\n  ): Promise<string>;\n  declare function readFile(\n    file: string | Buffer | number\n  ): Promise<Buffer>;\n\n  declare function readdir(\n    path: string | Buffer,\n    callback: (err: ErrnoError, files: string[]) => void\n  ): void;\n  declare function readdir(path: string | Buffer): Promise<string[]>;\n\n  declare function readlink(\n    path: string | Buffer,\n    callback: (err: ErrnoError, linkString: string) => any\n  ): void;\n  declare function readlink(path: string | Buffer): Promise<string>;\n\n  declare function realpath(\n    path: string | Buffer,\n    callback: (err: ErrnoError, resolvedPath: string) => any\n  ): void;\n  declare function realpath(\n    path: string | Buffer,\n    cache: { [path: string]: string, ... },\n    callback: (err: ErrnoError, resolvedPath: string) => any\n  ): void;\n  declare function realpath(\n    path: string | Buffer,\n    cache?: { [path: string]: string, ... }\n  ): Promise<string>;\n\n  declare function rename(\n    oldPath: string,\n    newPath: string,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function rename(\n    oldPath: string,\n    newPath: string\n  ): Promise<void>;\n\n  declare function rmdir(\n    path: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function rmdir(path: string | Buffer): Promise<void>;\n\n  declare function stat(\n    path: string | Buffer,\n    callback: (err: ErrnoError, stats: Stats) => any\n  ): void;\n  declare function stat(path: string | Buffer): Promise<Stats>;\n\n  declare function statSync(path: string): Stats;\n\n  declare function symlink(\n    srcpath: string | Buffer,\n    dstpath: string | Buffer,\n    type: FsSymlinkType | void,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function symlink(\n    srcpath: string | Buffer,\n    dstpath: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function symlink(\n    srcpath: string | Buffer,\n    dstpath: string | Buffer,\n    type?: FsSymlinkType\n  ): Promise<void>;\n\n  declare function truncate(\n    path: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function truncate(\n    path: string | Buffer,\n    len: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function truncate(\n    path: string | Buffer,\n    len?: number\n  ): Promise<void>;\n\n  declare function unlink(\n    path: string | Buffer,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function unlink(path: string | Buffer): Promise<void>;\n\n  declare function utimes(\n    path: string | Buffer,\n    atime: number,\n    mtime: number,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function utimes(\n    path: string | Buffer,\n    atime: Date,\n    mtime: Date,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function utimes(\n    path: string | Buffer,\n    atime: number,\n    mtime: number\n  ): Promise<void>;\n  declare function utimes(\n    path: string | Buffer,\n    atime: Date,\n    mtime: Date\n  ): Promise<void>;\n\n  declare function write(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    position: number | null,\n    callback: (err: ErrnoError, written: number, buffer: Buffer) => void\n  ): void;\n  declare function write(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    callback: (err: ErrnoError, written: number, buffer: Buffer) => void\n  ): void;\n  declare function write(\n    fd: number,\n    data: any,\n    callback: (err: ErrnoError, written: number, str: string) => void\n  ): void;\n  declare function write(\n    fd: number,\n    data: any,\n    offset: number,\n    callback: (err: ErrnoError, written: number, str: string) => void\n  ): void;\n  declare function write(\n    fd: number,\n    data: any,\n    offset: number,\n    encoding: string,\n    callback: (err: ErrnoError, written: number, str: string) => void\n  ): void;\n  declare function write(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    position?: number | null\n  ): Promise<WriteResult>;\n  declare function write(\n    fd: number,\n    data: any,\n    offset: number,\n    encoding?: string\n  ): Promise<WriteResult>;\n\n  declare function writeFile(\n    file: string | Buffer | number,\n    data: any,\n    callback: (err: ErrnoError) => void\n  ): void;\n  declare function writeFile(\n    file: string | Buffer | number,\n    data: any,\n    options?: WriteFileOptions | string\n  ): Promise<void>;\n  declare function writeFile(\n    file: string | Buffer | number,\n    data: any,\n    options: WriteFileOptions | string,\n    callback: (err: ErrnoError) => void\n  ): void;\n\n  declare function mkdtemp(prefix: string): Promise<string>;\n  declare function mkdtemp(\n    prefix: string,\n    callback: (err: ErrnoError, folder: string) => void\n  ): void;\n\n  declare module.exports: {|\n    ...fsTypes;\n    access: typeof access;\n    appendFile: typeof appendFile;\n    chmod: typeof chmod;\n    chown: typeof chown;\n    close: typeof close;\n    copy: typeof copy;\n    copySync: typeof copySync;\n    createFile: typeof createFile;\n    createFileSync: typeof createFileSync;\n    createReadStream: typeof createReadStream;\n    createWriteStream: typeof createWriteStream;\n    emptyDir: typeof emptyDir;\n    emptyDirSync: typeof emptyDirSync;\n    ensureDir: typeof ensureDir;\n    ensureDirSync: typeof ensureDirSync;\n    ensureFile: typeof ensureFile;\n    ensureFileSync: typeof ensureFileSync;\n    ensureLink: typeof ensureLink;\n    ensureLinkSync: typeof ensureLinkSync;\n    ensureSymlink: typeof ensureSymlink;\n    ensureSymlinkSync: typeof ensureSymlinkSync;\n    exists: typeof exists;\n    fchmod: typeof fchmod;\n    fchown: typeof fchown;\n    fdatasync: typeof fdatasync;\n    fstat: typeof fstat;\n    fsync: typeof fsync;\n    ftruncate: typeof ftruncate;\n    futimes: typeof futimes;\n    lchown: typeof lchown;\n    link: typeof link;\n    lstat: typeof lstat;\n    mkdir: typeof mkdir;\n    mkdirp: typeof mkdirp;\n    mkdirpSync: typeof mkdirpSync;\n    mkdirs: typeof mkdirs;\n    mkdirsSync: typeof mkdirsSync;\n    mkdtemp: typeof mkdtemp;\n    move: typeof move;\n    moveSync: typeof moveSync;\n    open: typeof open;\n    outputFile: typeof outputFile;\n    outputFileSync: typeof outputFileSync;\n    outputJson: typeof outputJson;\n    outputJSON: typeof outputJSON;\n    outputJsonSync: typeof outputJsonSync;\n    outputJSONSync: typeof outputJSONSync;\n    pathExists: typeof pathExists;\n    pathExistsSync: typeof pathExistsSync;\n    read: typeof read;\n    readdir: typeof readdir;\n    readFile: typeof readFile;\n    readJson: typeof readJson;\n    readJSON: typeof readJSON;\n    readJsonSync: typeof readJsonSync;\n    readJSONSync: typeof readJSONSync;\n    readlink: typeof readlink;\n    realpath: typeof realpath;\n    remove: typeof remove;\n    removeSync: typeof removeSync;\n    rename: typeof rename;\n    rmdir: typeof rmdir;\n    stat: typeof stat;\n    statSync: typeof statSync;\n    symlink: typeof symlink;\n    truncate: typeof truncate;\n    unlink: typeof unlink;\n    utimes: typeof utimes;\n    write: typeof write;\n    writeFile: typeof writeFile;\n    writeJSON: typeof writeJSON;\n    writeJson: typeof writeJson;\n    writeJsonSync: typeof writeJsonSync;\n    writeJSONSync: typeof writeJSONSync;\n  |};\n}\n"
  },
  {
    "path": "flow-typed/npm/glob_v7.x.x.js",
    "content": "// flow-typed signature: d2a519d7d007e9ba3e5bf2ac3ff76eca\n// flow-typed version: f243e51ed7/glob_v7.x.x/flow_>=v0.104.x\n\ndeclare module \"glob\" {\n  declare type MinimatchOptions = {|\n    debug?: boolean,\n    nobrace?: boolean,\n    noglobstar?: boolean,\n    dot?: boolean,\n    noext?: boolean,\n    nocase?: boolean,\n    nonull?: boolean,\n    matchBase?: boolean,\n    nocomment?: boolean,\n    nonegate?: boolean,\n    flipNegate?: boolean\n  |};\n\n  declare type Options = {|\n    ...MinimatchOptions,\n    cwd?: string,\n    root?: string,\n    nomount?: boolean,\n    mark?: boolean,\n    nosort?: boolean,\n    stat?: boolean,\n    silent?: boolean,\n    strict?: boolean,\n    cache?: { [path: string]: boolean | \"DIR\" | \"FILE\" | $ReadOnlyArray<string>, ... },\n    statCache?: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... },\n    symlinks?: { [path: string]: boolean | void, ... },\n    realpathCache?: { [path: string]: string, ... },\n    sync?: boolean,\n    nounique?: boolean,\n    nodir?: boolean,\n    ignore?: string | $ReadOnlyArray<string>,\n    follow?: boolean,\n    realpath?: boolean,\n    absolute?: boolean\n  |};\n\n  /**\n   * Called when an error occurs, or matches are found\n   *   err\n   *   matches: filenames found matching the pattern\n   */\n  declare type CallBack = (err: ?Error, matches: Array<string>) => void;\n\n  declare class Glob extends events$EventEmitter {\n    constructor(pattern: string): this;\n    constructor(pattern: string, callback: CallBack): this;\n    constructor(pattern: string, options: Options, callback: CallBack): this;\n\n    minimatch: {...};\n    options: Options;\n    aborted: boolean;\n    cache: { [path: string]: boolean | \"DIR\" | \"FILE\" | $ReadOnlyArray<string>, ... };\n    statCache: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... };\n    symlinks: { [path: string]: boolean | void, ... };\n    realpathCache: { [path: string]: string, ... };\n    found: Array<string>;\n\n    pause(): void;\n    resume(): void;\n    abort(): void;\n  }\n\n  declare class GlobModule {\n    Glob: Class<Glob>;\n\n    (pattern: string, callback: CallBack): void;\n    (pattern: string, options: Options, callback: CallBack): void;\n\n    hasMagic(pattern: string, options?: Options): boolean;\n    sync(pattern: string, options?: Options): Array<string>;\n  }\n\n  declare module.exports: GlobModule;\n}\n"
  },
  {
    "path": "flow-typed/npm/husky_vx.x.x.js",
    "content": "// flow-typed signature: 879510e2b63c9ed0a1bead509d75e31c\n// flow-typed version: <<STUB>>/husky_v^7.0.4/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'husky'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'husky' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'husky/lib/bin' {\n  declare module.exports: any;\n}\n\ndeclare module 'husky/lib' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'husky/lib/bin.js' {\n  declare module.exports: $Exports<'husky/lib/bin'>;\n}\ndeclare module 'husky/lib/index' {\n  declare module.exports: $Exports<'husky/lib'>;\n}\ndeclare module 'husky/lib/index.js' {\n  declare module.exports: $Exports<'husky/lib'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/jest_v29.x.x.js",
    "content": "// flow-typed signature: 0e64c840aab684c37415b655ddbf8ce1\n// flow-typed version: 02d4f1d2c5/jest_v29.x.x/flow_>=v0.134.x <=v0.200.x\n\ntype JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {\n  (...args: TArguments): TReturn,\n  /**\n   * An object for introspecting mock calls\n   */\n  mock: {\n    /**\n     * An array that represents all calls that have been made into this mock\n     * function. Each call is represented by an array of arguments that were\n     * passed during the call.\n     */\n    calls: Array<TArguments>,\n    /**\n     * An array containing the call arguments of the last call that was made\n     * to this mock function. If the function was not called, it will return\n     * undefined.\n     */\n    lastCall: TArguments,\n    /**\n     * An array that contains all the object instances that have been\n     * instantiated from this mock function.\n     */\n    instances: Array<TReturn>,\n    /**\n     * An array that contains all the object results that have been\n     * returned by this mock function call\n     */\n    results: Array<{\n      isThrow: boolean,\n      value: TReturn,\n      ...\n    }>,\n    ...\n  },\n  /**\n   * Resets all information stored in the mockFn.mock.calls and\n   * mockFn.mock.instances arrays. Often this is useful when you want to clean\n   * up a mock's usage data between two assertions.\n   */\n  mockClear(): void,\n  /**\n   * Resets all information stored in the mock. This is useful when you want to\n   * completely restore a mock back to its initial state.\n   */\n  mockReset(): void,\n  /**\n   * Removes the mock and restores the initial implementation. This is useful\n   * when you want to mock functions in certain test cases and restore the\n   * original implementation in others. Beware that mockFn.mockRestore only\n   * works when mock was created with jest.spyOn. Thus you have to take care of\n   * restoration yourself when manually assigning jest.fn().\n   */\n  mockRestore(): void,\n  /**\n   * Accepts a function that should be used as the implementation of the mock.\n   * The mock itself will still record all calls that go into and instances\n   * that come from itself -- the only difference is that the implementation\n   * will also be executed when the mock is called.\n   */\n  mockImplementation(\n    fn: (...args: TArguments) => TReturn\n  ): JestMockFn<TArguments, TReturn>,\n  /**\n   * Accepts a function that will be used as an implementation of the mock for\n   * one call to the mocked function. Can be chained so that multiple function\n   * calls produce different results.\n   */\n  mockImplementationOnce(\n    fn: (...args: TArguments) => TReturn\n  ): JestMockFn<TArguments, TReturn>,\n  /**\n   * Accepts a string to use in test result output in place of \"jest.fn()\" to\n   * indicate which mock function is being referenced.\n   */\n  mockName(name: string): JestMockFn<TArguments, TReturn>,\n  /**\n   * Just a simple sugar function for returning `this`\n   */\n  mockReturnThis(): void,\n  /**\n   * Accepts a value that will be returned whenever the mock function is called.\n   */\n  mockReturnValue(value: TReturn): JestMockFn<TArguments, TReturn>,\n  /**\n   * Sugar for only returning a value once inside your mock\n   */\n  mockReturnValueOnce(value: TReturn): JestMockFn<TArguments, TReturn>,\n  /**\n   * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value))\n   */\n  mockResolvedValue(value: TReturn): JestMockFn<TArguments, Promise<TReturn>>,\n  /**\n   * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value))\n   */\n  mockResolvedValueOnce(\n    value: TReturn\n  ): JestMockFn<TArguments, Promise<TReturn>>,\n  /**\n   * Sugar for jest.fn().mockImplementation(() => Promise.reject(value))\n   */\n  mockRejectedValue(value: TReturn): JestMockFn<TArguments, Promise<any>>,\n  /**\n   * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value))\n   */\n  mockRejectedValueOnce(value: TReturn): JestMockFn<TArguments, Promise<any>>,\n  ...\n};\n\ntype JestAsymmetricEqualityType = {\n  /**\n   * A custom Jasmine equality tester\n   */\n  asymmetricMatch(value: mixed): boolean,\n  ...\n};\n\ntype JestCallsType = {\n  allArgs(): mixed,\n  all(): mixed,\n  any(): boolean,\n  count(): number,\n  first(): mixed,\n  mostRecent(): mixed,\n  reset(): void,\n  ...\n};\n\ntype JestClockType = {\n  install(): void,\n  mockDate(date: Date): void,\n  tick(milliseconds?: number): void,\n  uninstall(): void,\n  ...\n};\n\ntype JestMatcherResult = {\n  message?: string | (() => string),\n  pass: boolean,\n  ...\n};\n\ntype JestMatcher = (\n  received: any,\n  ...actual: Array<any>\n) => JestMatcherResult | Promise<JestMatcherResult>;\n\ntype JestPromiseType = {\n  /**\n   * Use rejects to unwrap the reason of a rejected promise so any other\n   * matcher can be chained. If the promise is fulfilled the assertion fails.\n   */\n  rejects: JestExpectType,\n  /**\n   * Use resolves to unwrap the value of a fulfilled promise so any other\n   * matcher can be chained. If the promise is rejected the assertion fails.\n   */\n  resolves: JestExpectType,\n  ...\n};\n\n/**\n * Jest allows functions and classes to be used as test names in test() and\n * describe()\n */\ntype JestTestName = string | Function;\n\ntype FakeableAPI =\n  | 'Date'\n  | 'hrtime'\n  | 'nextTick'\n  | 'performance'\n  | 'queueMicrotask'\n  | 'requestAnimationFrame'\n  | 'cancelAnimationFrame'\n  | 'requestIdleCallback'\n  | 'cancelIdleCallback'\n  | 'setImmediate'\n  | 'clearImmediate'\n  | 'setInterval'\n  | 'clearInterval'\n  | 'setTimeout'\n  | 'clearTimeout';\n\ntype FakeTimersConfig = {\n  advanceTimers?: boolean | number,\n  doNotFake?: Array<FakeableAPI>,\n  now?: number | Date,\n  timerLimit?: number,\n  legacyFakeTimers?: boolean,\n  ...\n};\n\n/**\n *  Plugin: jest-styled-components\n */\n\ntype JestStyledComponentsMatcherValue =\n  | string\n  | JestAsymmetricEqualityType\n  | RegExp\n  | typeof undefined;\n\ntype JestStyledComponentsMatcherOptions = {\n  media?: string,\n  modifier?: string,\n  supports?: string,\n  ...\n};\n\ntype JestStyledComponentsMatchersType = {\n  toHaveStyleRule(\n    property: string,\n    value: JestStyledComponentsMatcherValue,\n    options?: JestStyledComponentsMatcherOptions\n  ): void,\n  ...\n};\n\n/**\n *  Plugin: jest-enzyme\n */\ntype EnzymeMatchersType = {\n  // 5.x\n  toBeEmpty(): void,\n  toBePresent(): void,\n  // 6.x\n  toBeChecked(): void,\n  toBeDisabled(): void,\n  toBeEmptyRender(): void,\n  toContainMatchingElement(selector: string): void,\n  toContainMatchingElements(n: number, selector: string): void,\n  toContainExactlyOneMatchingElement(selector: string): void,\n  toContainReact(element: React$Element<any>): void,\n  toExist(): void,\n  toHaveClassName(className: string): void,\n  toHaveHTML(html: string): void,\n  toHaveProp: ((propKey: string, propValue?: any) => void) &\n    ((props: { ... }) => void),\n  toHaveRef(refName: string): void,\n  toHaveState: ((stateKey: string, stateValue?: any) => void) &\n    ((state: { ... }) => void),\n  toHaveStyle: ((styleKey: string, styleValue?: any) => void) &\n    ((style: { ... }) => void),\n  toHaveTagName(tagName: string): void,\n  toHaveText(text: string): void,\n  toHaveValue(value: any): void,\n  toIncludeText(text: string): void,\n  toMatchElement(\n    element: React$Element<any>,\n    options?: {| ignoreProps?: boolean, verbose?: boolean |}\n  ): void,\n  toMatchSelector(selector: string): void,\n  // 7.x\n  toHaveDisplayName(name: string): void,\n  ...\n};\n\n// DOM testing library extensions (jest-dom)\n// https://github.com/testing-library/jest-dom\ntype DomTestingLibraryType = {\n  /**\n   * @deprecated\n   */\n  toBeInTheDOM(container?: HTMLElement): void,\n\n  // 4.x\n  toBeInTheDocument(): void,\n  toBeVisible(): void,\n  toBeEmpty(): void,\n  toBeDisabled(): void,\n  toBeEnabled(): void,\n  toBeInvalid(): void,\n  toBeRequired(): void,\n  toBeValid(): void,\n  toContainElement(element: HTMLElement | null): void,\n  toContainHTML(htmlText: string): void,\n  toHaveAttribute(attr: string, value?: any): void,\n  toHaveClass(...classNames: string[]): void,\n  toHaveFocus(): void,\n  toHaveFormValues(expectedValues: { [name: string]: any, ... }): void,\n  toHaveStyle(css: string | { [name: string]: any, ... }): void,\n  toHaveTextContent(\n    text: string | RegExp,\n    options?: {| normalizeWhitespace: boolean |}\n  ): void,\n  toHaveValue(value?: string | string[] | number): void,\n\n  // 5.x\n  toHaveDisplayValue(value: string | string[]): void,\n  toBeChecked(): void,\n  toBeEmptyDOMElement(): void,\n  toBePartiallyChecked(): void,\n  toHaveDescription(text: string | RegExp): void,\n  ...\n};\n\n// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers\ntype JestJQueryMatchersType = {\n  toExist(): void,\n  toHaveLength(len: number): void,\n  toHaveId(id: string): void,\n  toHaveClass(className: string): void,\n  toHaveTag(tag: string): void,\n  toHaveAttr(key: string, val?: any): void,\n  toHaveProp(key: string, val?: any): void,\n  toHaveText(text: string | RegExp): void,\n  toHaveData(key: string, val?: any): void,\n  toHaveValue(val: any): void,\n  toHaveCss(css: { [key: string]: any, ... }): void,\n  toBeChecked(): void,\n  toBeDisabled(): void,\n  toBeEmpty(): void,\n  toBeHidden(): void,\n  toBeSelected(): void,\n  toBeVisible(): void,\n  toBeFocused(): void,\n  toBeInDom(): void,\n  toBeMatchedBy(sel: string): void,\n  toHaveDescendant(sel: string): void,\n  toHaveDescendantWithText(sel: string, text: string | RegExp): void,\n  ...\n};\n\n// Jest Extended Matchers: https://github.com/jest-community/jest-extended\ntype JestExtendedMatchersType = {\n  /**\n   * Note: Currently unimplemented\n   * Passing assertion\n   *\n   * @param {String} message\n   */\n  //  pass(message: string): void;\n\n  /**\n   * Note: Currently unimplemented\n   * Failing assertion\n   *\n   * @param {String} message\n   */\n  //  fail(message: string): void;\n\n  /**\n   * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty.\n   */\n  toBeEmpty(): void,\n  /**\n   * Use .toBeOneOf when checking if a value is a member of a given Array.\n   * @param {Array.<*>} members\n   */\n  toBeOneOf(members: any[]): void,\n  /**\n   * Use `.toBeNil` when checking a value is `null` or `undefined`.\n   */\n  toBeNil(): void,\n  /**\n   * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`.\n   * @param {Function} predicate\n   */\n  toSatisfy(predicate: (n: any) => boolean): void,\n  /**\n   * Use `.toBeArray` when checking if a value is an `Array`.\n   */\n  toBeArray(): void,\n  /**\n   * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x.\n   * @param {Number} x\n   */\n  toBeArrayOfSize(x: number): void,\n  /**\n   * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set.\n   * @param {Array.<*>} members\n   */\n  toIncludeAllMembers(members: any[]): void,\n  /**\n   * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set.\n   * @param {Array.<*>} members\n   */\n  toIncludeAnyMembers(members: any[]): void,\n  /**\n   * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array.\n   * @param {Function} predicate\n   */\n  toSatisfyAll(predicate: (n: any) => boolean): void,\n  /**\n   * Use `.toBeBoolean` when checking if a value is a `Boolean`.\n   */\n  toBeBoolean(): void,\n  /**\n   * Use `.toBeTrue` when checking a value is equal (===) to `true`.\n   */\n  toBeTrue(): void,\n  /**\n   * Use `.toBeFalse` when checking a value is equal (===) to `false`.\n   */\n  toBeFalse(): void,\n  /**\n   * Use .toBeDate when checking if a value is a Date.\n   */\n  toBeDate(): void,\n  /**\n   * Use `.toBeFunction` when checking if a value is a `Function`.\n   */\n  toBeFunction(): void,\n  /**\n   * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.\n   *\n   * Note: Required Jest version >22\n   * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same\n   *\n   * @param {Mock} mock\n   */\n  toHaveBeenCalledBefore(mock: JestMockFn<any, any>): void,\n  /**\n   * Use `.toBeNumber` when checking if a value is a `Number`.\n   */\n  toBeNumber(): void,\n  /**\n   * Use `.toBeNaN` when checking a value is `NaN`.\n   */\n  toBeNaN(): void,\n  /**\n   * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`.\n   */\n  toBeFinite(): void,\n  /**\n   * Use `.toBePositive` when checking if a value is a positive `Number`.\n   */\n  toBePositive(): void,\n  /**\n   * Use `.toBeNegative` when checking if a value is a negative `Number`.\n   */\n  toBeNegative(): void,\n  /**\n   * Use `.toBeEven` when checking if a value is an even `Number`.\n   */\n  toBeEven(): void,\n  /**\n   * Use `.toBeOdd` when checking if a value is an odd `Number`.\n   */\n  toBeOdd(): void,\n  /**\n   * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive).\n   *\n   * @param {Number} start\n   * @param {Number} end\n   */\n  toBeWithin(start: number, end: number): void,\n  /**\n   * Use `.toBeObject` when checking if a value is an `Object`.\n   */\n  toBeObject(): void,\n  /**\n   * Use `.toContainKey` when checking if an object contains the provided key.\n   *\n   * @param {String} key\n   */\n  toContainKey(key: string): void,\n  /**\n   * Use `.toContainKeys` when checking if an object has all of the provided keys.\n   *\n   * @param {Array.<String>} keys\n   */\n  toContainKeys(keys: string[]): void,\n  /**\n   * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys.\n   *\n   * @param {Array.<String>} keys\n   */\n  toContainAllKeys(keys: string[]): void,\n  /**\n   * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys.\n   *\n   * @param {Array.<String>} keys\n   */\n  toContainAnyKeys(keys: string[]): void,\n  /**\n   * Use `.toContainValue` when checking if an object contains the provided value.\n   *\n   * @param {*} value\n   */\n  toContainValue(value: any): void,\n  /**\n   * Use `.toContainValues` when checking if an object contains all of the provided values.\n   *\n   * @param {Array.<*>} values\n   */\n  toContainValues(values: any[]): void,\n  /**\n   * Use `.toContainAllValues` when checking if an object only contains all of the provided values.\n   *\n   * @param {Array.<*>} values\n   */\n  toContainAllValues(values: any[]): void,\n  /**\n   * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values.\n   *\n   * @param {Array.<*>} values\n   */\n  toContainAnyValues(values: any[]): void,\n  /**\n   * Use `.toContainEntry` when checking if an object contains the provided entry.\n   *\n   * @param {Array.<String, String>} entry\n   */\n  toContainEntry(entry: [string, string]): void,\n  /**\n   * Use `.toContainEntries` when checking if an object contains all of the provided entries.\n   *\n   * @param {Array.<Array.<String, String>>} entries\n   */\n  toContainEntries(entries: [string, string][]): void,\n  /**\n   * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.\n   *\n   * @param {Array.<Array.<String, String>>} entries\n   */\n  toContainAllEntries(entries: [string, string][]): void,\n  /**\n   * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.\n   *\n   * @param {Array.<Array.<String, String>>} entries\n   */\n  toContainAnyEntries(entries: [string, string][]): void,\n  /**\n   * Use `.toBeExtensible` when checking if an object is extensible.\n   */\n  toBeExtensible(): void,\n  /**\n   * Use `.toBeFrozen` when checking if an object is frozen.\n   */\n  toBeFrozen(): void,\n  /**\n   * Use `.toBeSealed` when checking if an object is sealed.\n   */\n  toBeSealed(): void,\n  /**\n   * Use `.toBeString` when checking if a value is a `String`.\n   */\n  toBeString(): void,\n  /**\n   * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings.\n   *\n   * @param {String} string\n   */\n  toEqualCaseInsensitive(string: string): void,\n  /**\n   * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix.\n   *\n   * @param {String} prefix\n   */\n  toStartWith(prefix: string): void,\n  /**\n   * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix.\n   *\n   * @param {String} suffix\n   */\n  toEndWith(suffix: string): void,\n  /**\n   * Use `.toInclude` when checking if a `String` includes the given `String` substring.\n   *\n   * @param {String} substring\n   */\n  toInclude(substring: string): void,\n  /**\n   * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times.\n   *\n   * @param {String} substring\n   * @param {Number} times\n   */\n  toIncludeRepeated(substring: string, times: number): void,\n  /**\n   * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings.\n   *\n   * @param {Array.<String>} substring\n   */\n  toIncludeMultiple(substring: string[]): void,\n  ...\n};\n\n// Diffing snapshot utility for Jest (snapshot-diff)\n// https://github.com/jest-community/snapshot-diff\ntype SnapshotDiffType = {\n  /**\n   * Compare the difference between the actual in the `expect()`\n   * vs the object inside `valueB` with some extra options.\n   */\n  toMatchDiffSnapshot(\n    valueB: any,\n    options?: {|\n      expand?: boolean,\n      colors?: boolean,\n      contextLines?: number,\n      stablePatchmarks?: boolean,\n      aAnnotation?: string,\n      bAnnotation?: string,\n    |},\n    testName?: string\n  ): void,\n  ...\n};\n\ninterface JestExpectType {\n  not: JestExpectType &\n    EnzymeMatchersType &\n    DomTestingLibraryType &\n    JestJQueryMatchersType &\n    JestStyledComponentsMatchersType &\n    JestExtendedMatchersType &\n    SnapshotDiffType;\n  /**\n   * If you have a mock function, you can use .lastCalledWith to test what\n   * arguments it was last called with.\n   */\n  lastCalledWith(...args: Array<any>): void;\n  /**\n   * toBe just checks that a value is what you expect. It uses === to check\n   * strict equality.\n   */\n  toBe(value: any): void;\n  /**\n   * Use .toBeCalledWith to ensure that a mock function was called with\n   * specific arguments.\n   */\n  toBeCalledWith(...args: Array<any>): void;\n  /**\n   * Using exact equality with floating point numbers is a bad idea. Rounding\n   * means that intuitive things fail.\n   */\n  toBeCloseTo(num: number, delta: any): void;\n  /**\n   * Use .toBeDefined to check that a variable is not undefined.\n   */\n  toBeDefined(): void;\n  /**\n   * Use .toBeFalsy when you don't care what a value is, you just want to\n   * ensure a value is false in a boolean context.\n   */\n  toBeFalsy(): void;\n  /**\n   * To compare floating point numbers, you can use toBeGreaterThan.\n   */\n  toBeGreaterThan(number: number): void;\n  /**\n   * To compare floating point numbers, you can use toBeGreaterThanOrEqual.\n   */\n  toBeGreaterThanOrEqual(number: number): void;\n  /**\n   * To compare floating point numbers, you can use toBeLessThan.\n   */\n  toBeLessThan(number: number): void;\n  /**\n   * To compare floating point numbers, you can use toBeLessThanOrEqual.\n   */\n  toBeLessThanOrEqual(number: number): void;\n  /**\n   * Use .toBeInstanceOf(Class) to check that an object is an instance of a\n   * class.\n   */\n  toBeInstanceOf(cls: Class<*>): void;\n  /**\n   * .toBeNull() is the same as .toBe(null) but the error messages are a bit\n   * nicer.\n   */\n  toBeNull(): void;\n  /**\n   * Use .toBeTruthy when you don't care what a value is, you just want to\n   * ensure a value is true in a boolean context.\n   */\n  toBeTruthy(): void;\n  /**\n   * Use .toBeUndefined to check that a variable is undefined.\n   */\n  toBeUndefined(): void;\n  /**\n   * Use .toContain when you want to check that an item is in a list. For\n   * testing the items in the list, this uses ===, a strict equality check.\n   */\n  toContain(item: any): void;\n  /**\n   * Use .toContainEqual when you want to check that an item is in a list. For\n   * testing the items in the list, this matcher recursively checks the\n   * equality of all fields, rather than checking for object identity.\n   */\n  toContainEqual(item: any): void;\n  /**\n   * Use .toEqual when you want to check that two objects have the same value.\n   * This matcher recursively checks the equality of all fields, rather than\n   * checking for object identity.\n   */\n  toEqual(value: any): void;\n  /**\n   * Use .toHaveBeenCalled to ensure that a mock function got called.\n   */\n  toHaveBeenCalled(): void;\n  toBeCalled(): void;\n  /**\n   * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact\n   * number of times.\n   */\n  toHaveBeenCalledTimes(number: number): void;\n  toBeCalledTimes(number: number): void;\n  /**\n   *\n   */\n  toHaveBeenNthCalledWith(nthCall: number, ...args: Array<any>): void;\n  nthCalledWith(nthCall: number, ...args: Array<any>): void;\n  /**\n   *\n   */\n  toHaveReturned(): void;\n  toReturn(): void;\n  /**\n   *\n   */\n  toHaveReturnedTimes(number: number): void;\n  toReturnTimes(number: number): void;\n  /**\n   *\n   */\n  toHaveReturnedWith(value: any): void;\n  toReturnWith(value: any): void;\n  /**\n   *\n   */\n  toHaveLastReturnedWith(value: any): void;\n  lastReturnedWith(value: any): void;\n  /**\n   *\n   */\n  toHaveNthReturnedWith(nthCall: number, value: any): void;\n  nthReturnedWith(nthCall: number, value: any): void;\n  /**\n   * Use .toHaveBeenCalledWith to ensure that a mock function was called with\n   * specific arguments.\n   */\n  toHaveBeenCalledWith(...args: Array<any>): void;\n  toBeCalledWith(...args: Array<any>): void;\n  /**\n   * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called\n   * with specific arguments.\n   */\n  toHaveBeenLastCalledWith(...args: Array<any>): void;\n  lastCalledWith(...args: Array<any>): void;\n  /**\n   * Check that an object has a .length property and it is set to a certain\n   * numeric value.\n   */\n  toHaveLength(number: number): void;\n  /**\n   *\n   */\n  toHaveProperty(propPath: string | $ReadOnlyArray<string>, value?: any): void;\n  /**\n   * Use .toMatch to check that a string matches a regular expression or string.\n   */\n  toMatch(regexpOrString: RegExp | string): void;\n  /**\n   * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object.\n   */\n  toMatchObject(object: Object | Array<Object>): void;\n  /**\n   * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object.\n   */\n  toStrictEqual(value: any): void;\n  /**\n   * This ensures that an Object matches the most recent snapshot.\n   */\n  toMatchSnapshot(propertyMatchers?: any, name?: string): void;\n  /**\n   * This ensures that an Object matches the most recent snapshot.\n   */\n  toMatchSnapshot(name: string): void;\n\n  toMatchInlineSnapshot(snapshot?: string): void;\n  toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void;\n  /**\n   * Use .toThrow to test that a function throws when it is called.\n   * If you want to test that a specific error gets thrown, you can provide an\n   * argument to toThrow. The argument can be a string for the error message,\n   * a class for the error, or a regex that should match the error.\n   *\n   * Alias: .toThrowError\n   */\n  toThrow(message?: string | Error | Class<Error> | RegExp): void;\n  toThrowError(message?: string | Error | Class<Error> | RegExp): void;\n  /**\n   * Use .toThrowErrorMatchingSnapshot to test that a function throws a error\n   * matching the most recent snapshot when it is called.\n   */\n  toThrowErrorMatchingSnapshot(): void;\n  toThrowErrorMatchingInlineSnapshot(snapshot?: string): void;\n}\n\ntype JestObjectType = {\n  /**\n   *  Disables automatic mocking in the module loader.\n   *\n   *  After this method is called, all `require()`s will return the real\n   *  versions of each module (rather than a mocked version).\n   */\n  disableAutomock(): JestObjectType,\n  /**\n   * An un-hoisted version of disableAutomock\n   */\n  autoMockOff(): JestObjectType,\n  /**\n   * Enables automatic mocking in the module loader.\n   */\n  enableAutomock(): JestObjectType,\n  /**\n   * An un-hoisted version of enableAutomock\n   */\n  autoMockOn(): JestObjectType,\n  /**\n   * Clears the mock.calls and mock.instances properties of all mocks.\n   * Equivalent to calling .mockClear() on every mocked function.\n   */\n  clearAllMocks(): JestObjectType,\n  /**\n   * Resets the state of all mocks. Equivalent to calling .mockReset() on every\n   * mocked function.\n   */\n  resetAllMocks(): JestObjectType,\n  /**\n   * Restores all mocks back to their original value.\n   */\n  restoreAllMocks(): JestObjectType,\n  /**\n   * Removes any pending timers from the timer system.\n   */\n  clearAllTimers(): void,\n  /**\n   * Returns the number of fake timers still left to run.\n   */\n  getTimerCount(): number,\n  /**\n   * Set the current system time used by fake timers.\n   * Simulates a user changing the system clock while your program is running.\n   * It affects the current time but it does not in itself cause\n   * e.g. timers to fire; they will fire exactly as they would have done\n   * without the call to jest.setSystemTime().\n   */\n  setSystemTime(now?: number | Date): void,\n  /**\n   * The same as `mock` but not moved to the top of the expectation by\n   * babel-jest.\n   */\n  doMock(moduleName: string, moduleFactory?: any): JestObjectType,\n  /**\n   * The same as `unmock` but not moved to the top of the expectation by\n   * babel-jest.\n   */\n  dontMock(moduleName: string): JestObjectType,\n  /**\n   * Returns a new, unused mock function. Optionally takes a mock\n   * implementation.\n   */\n  fn<TArguments: $ReadOnlyArray<*>, TReturn>(\n    implementation?: (...args: TArguments) => TReturn\n  ): JestMockFn<TArguments, TReturn>,\n  /**\n   * Determines if the given function is a mocked function.\n   */\n  isMockFunction(fn: Function): boolean,\n  /**\n   * Alias of `createMockFromModule`.\n   */\n  genMockFromModule(moduleName: string): any,\n  /**\n   * Given the name of a module, use the automatic mocking system to generate a\n   * mocked version of the module for you.\n   */\n  createMockFromModule(moduleName: string): any,\n  /**\n   * Mocks a module with an auto-mocked version when it is being required.\n   *\n   * The second argument can be used to specify an explicit module factory that\n   * is being run instead of using Jest's automocking feature.\n   *\n   * The third argument can be used to create virtual mocks -- mocks of modules\n   * that don't exist anywhere in the system.\n   */\n  mock(\n    moduleName: string,\n    moduleFactory?: any,\n    options?: Object\n  ): JestObjectType,\n  /**\n   * Returns the actual module instead of a mock, bypassing all checks on\n   * whether the module should receive a mock implementation or not.\n   */\n  requireActual<T>(m: $Flow$ModuleRef<T> | string): T,\n  /**\n   * Returns a mock module instead of the actual module, bypassing all checks\n   * on whether the module should be required normally or not.\n   */\n  requireMock(moduleName: string): any,\n  /**\n   * Resets the module registry - the cache of all required modules. This is\n   * useful to isolate modules where local state might conflict between tests.\n   */\n  resetModules(): JestObjectType,\n  /**\n   * Creates a sandbox registry for the modules that are loaded inside the\n   * callback function. This is useful to isolate specific modules for every\n   * test so that local module state doesn't conflict between tests.\n   */\n  isolateModules(fn: () => void): JestObjectType,\n  /**\n   * Exhausts the micro-task queue (usually interfaced in node via\n   * process.nextTick).\n   */\n  runAllTicks(): void,\n  /**\n   * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(),\n   * setInterval(), and setImmediate()).\n   */\n  runAllTimers(): void,\n  /**\n   * Exhausts all tasks queued by setImmediate().\n   */\n  runAllImmediates(): void,\n  /**\n   * Executes only the macro task queue (i.e. all tasks queued by setTimeout()\n   * or setInterval() and setImmediate()).\n   */\n  advanceTimersByTime(msToRun: number): void,\n  /**\n   * Executes only the macro-tasks that are currently pending (i.e., only the\n   * tasks that have been queued by setTimeout() or setInterval() up to this\n   * point)\n   */\n  runOnlyPendingTimers(): void,\n  /**\n   * Explicitly supplies the mock object that the module system should return\n   * for the specified module. Note: It is recommended to use jest.mock()\n   * instead.\n   */\n  setMock(moduleName: string, moduleExports: any): JestObjectType,\n  /**\n   * Indicates that the module system should never return a mocked version of\n   * the specified module from require() (e.g. that it should always return the\n   * real module).\n   */\n  unmock(moduleName: string): JestObjectType,\n  /**\n   * Instructs Jest to use fake versions of the standard timer functions\n   * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick,\n   * setImmediate and clearImmediate).\n   */\n  useFakeTimers(fakeTimersConfig?: FakeTimersConfig): JestObjectType,\n  /**\n   * Instructs Jest to use the real versions of the standard timer functions.\n   */\n  useRealTimers(): JestObjectType,\n  /**\n   * Creates a mock function similar to jest.fn but also tracks calls to\n   * object[methodName].\n   */\n  spyOn(\n    object: Object,\n    methodName: string,\n    accessType?: 'get' | 'set'\n  ): JestMockFn<any, any>,\n  /**\n   * Set the default timeout interval for tests and before/after hooks in milliseconds.\n   * Note: The default timeout interval is 5 seconds if this method is not called.\n   */\n  setTimeout(timeout: number): JestObjectType,\n  ...\n};\n\ntype JestSpyType = { calls: JestCallsType, ... };\n\ntype JestDoneFn = {|\n  (error?: Error): void,\n  fail: (error: Error) => void,\n|};\n\n/** Runs this function after every test inside this context */\ndeclare function afterEach(\n  fn: (done: JestDoneFn) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** Runs this function before every test inside this context */\ndeclare function beforeEach(\n  fn: (done: JestDoneFn) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** Runs this function after all tests have finished inside this context */\ndeclare function afterAll(\n  fn: (done: JestDoneFn) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** Runs this function before any tests have started inside this context */\ndeclare function beforeAll(\n  fn: (done: JestDoneFn) => ?Promise<mixed>,\n  timeout?: number\n): void;\n\n/** A context for grouping tests together */\ndeclare var describe: {\n  /**\n   * Creates a block that groups together several related tests in one \"test suite\"\n   */\n  (name: JestTestName, fn: () => void): void,\n  /**\n   * Only run this describe block\n   */\n  only(name: JestTestName, fn: () => void): void,\n  /**\n   * Skip running this describe block\n   */\n  skip(name: JestTestName, fn: () => void): void,\n  /**\n   * each runs this test against array of argument arrays per each run\n   *\n   * @param {table} table of Test\n   */\n  each(\n    ...table: Array<Array<mixed> | mixed> | [Array<string>, string]\n  ): (\n    name: JestTestName,\n    fn?: (...args: Array<any>) => ?Promise<mixed>,\n    timeout?: number\n  ) => void,\n  ...\n};\n\n/** An individual test unit */\ndeclare var it: {\n  /**\n   * An individual test unit\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  (\n    name: JestTestName,\n    fn?: (done: JestDoneFn) => ?Promise<mixed>,\n    timeout?: number\n  ): void,\n  /**\n   * Only run this test\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  only: {|\n    (\n      name: JestTestName,\n      fn?: (done: JestDoneFn) => ?Promise<mixed>,\n      timeout?: number\n    ): void,\n    each(\n      ...table: Array<Array<mixed> | mixed> | [Array<string>, string]\n    ): (\n      name: JestTestName,\n      fn?: (...args: Array<any>) => ?Promise<mixed>,\n      timeout?: number\n    ) => void,\n  |},\n  /**\n   * Skip running this test\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  skip: {|\n    (\n      name: JestTestName,\n      fn?: (done: JestDoneFn) => ?Promise<mixed>,\n      timeout?: number\n    ): void,\n    each(\n      ...table: Array<Array<mixed> | mixed> | [Array<string>, string]\n    ): (\n      name: JestTestName,\n      fn?: (...args: Array<any>) => ?Promise<mixed>,\n      timeout?: number\n    ) => void,\n  |},\n  /**\n   * Highlight planned tests in the summary output\n   *\n   * @param {String} Name of Test to do\n   */\n  todo(name: string): void,\n  /**\n   * Run the test concurrently\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  concurrent(\n    name: JestTestName,\n    fn?: (done: JestDoneFn) => ?Promise<mixed>,\n    timeout?: number\n  ): void,\n  /**\n   * each runs this test against array of argument arrays per each run\n   *\n   * @param {table} table of Test\n   */\n  each(\n    ...table: Array<Array<mixed> | mixed> | [Array<string>, string]\n  ): (\n    name: JestTestName,\n    fn?: (...args: Array<any>) => ?Promise<mixed>,\n    timeout?: number\n  ) => void,\n  ...\n};\n\ndeclare function fit(\n  name: JestTestName,\n  fn: (done: JestDoneFn) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** An individual test unit */\ndeclare var test: typeof it;\n/** A disabled group of tests */\ndeclare var xdescribe: typeof describe;\n/** A focused group of tests */\ndeclare var fdescribe: typeof describe;\n/** A disabled individual test */\ndeclare var xit: typeof it;\n/** A disabled individual test */\ndeclare var xtest: typeof it;\n\ntype JestPrettyFormatColors = {\n  comment: {\n    close: string,\n    open: string,\n    ...\n  },\n  content: {\n    close: string,\n    open: string,\n    ...\n  },\n  prop: {\n    close: string,\n    open: string,\n    ...\n  },\n  tag: {\n    close: string,\n    open: string,\n    ...\n  },\n  value: {\n    close: string,\n    open: string,\n    ...\n  },\n  ...\n};\n\ntype JestPrettyFormatIndent = (string) => string;\ntype JestPrettyFormatRefs = Array<any>;\ntype JestPrettyFormatPrint = (any) => string;\ntype JestPrettyFormatStringOrNull = string | null;\n\ntype JestPrettyFormatOptions = {|\n  callToJSON: boolean,\n  edgeSpacing: string,\n  escapeRegex: boolean,\n  highlight: boolean,\n  indent: number,\n  maxDepth: number,\n  min: boolean,\n  plugins: JestPrettyFormatPlugins,\n  printFunctionName: boolean,\n  spacing: string,\n  theme: {|\n    comment: string,\n    content: string,\n    prop: string,\n    tag: string,\n    value: string,\n  |},\n|};\n\ntype JestPrettyFormatPlugin = {\n  print: (\n    val: any,\n    serialize: JestPrettyFormatPrint,\n    indent: JestPrettyFormatIndent,\n    opts: JestPrettyFormatOptions,\n    colors: JestPrettyFormatColors\n  ) => string,\n  test: (any) => boolean,\n  ...\n};\n\ntype JestPrettyFormatPlugins = Array<JestPrettyFormatPlugin>;\n\n/** The expect function is used every time you want to test a value */\ndeclare var expect: {\n  /** The object that you want to make assertions against */\n  (\n    value: any\n  ): JestExpectType &\n    JestPromiseType &\n    EnzymeMatchersType &\n    DomTestingLibraryType &\n    JestJQueryMatchersType &\n    JestStyledComponentsMatchersType &\n    JestExtendedMatchersType &\n    SnapshotDiffType,\n  /** Add additional Jasmine matchers to Jest's roster */\n  extend(matchers: { [name: string]: JestMatcher, ... }): void,\n  /** Add a module that formats application-specific data structures. */\n  addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void,\n  assertions(expectedAssertions: number): void,\n  hasAssertions(): void,\n  any(value: mixed): JestAsymmetricEqualityType,\n  anything(): any,\n  arrayContaining(value: Array<mixed>): Array<mixed>,\n  objectContaining(value: Object): Object,\n  /** Matches any received string that contains the exact expected string. */\n  stringContaining(value: string): string,\n  stringMatching(value: string | RegExp): string,\n  not: {\n    arrayContaining: (value: $ReadOnlyArray<mixed>) => Array<mixed>,\n    objectContaining: (value: { ... }) => Object,\n    stringContaining: (value: string) => string,\n    stringMatching: (value: string | RegExp) => string,\n    ...\n  },\n  ...\n};\n\n// TODO handle return type\n// http://jasmine.github.io/2.4/introduction.html#section-Spies\ndeclare function spyOn(value: mixed, method: string): Object;\n\n/** Holds all functions related to manipulating test runner */\ndeclare var jest: JestObjectType;\n\n/**\n * The global Jasmine object, this is generally not exposed as the public API,\n * using features inside here could break in later versions of Jest.\n */\ndeclare var jasmine: {\n  DEFAULT_TIMEOUT_INTERVAL: number,\n  any(value: mixed): JestAsymmetricEqualityType,\n  anything(): any,\n  arrayContaining(value: Array<mixed>): Array<mixed>,\n  clock(): JestClockType,\n  createSpy(name: string): JestSpyType,\n  createSpyObj(\n    baseName: string,\n    methodNames: Array<string>\n  ): { [methodName: string]: JestSpyType, ... },\n  objectContaining(value: Object): Object,\n  stringMatching(value: string): string,\n  ...\n};\n"
  },
  {
    "path": "flow-typed/npm/lint-staged_vx.x.x.js",
    "content": "// flow-typed signature: 9793179ff11430685c8286a4ff6f3f16\n// flow-typed version: <<STUB>>/lint-staged_v^12.4.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'lint-staged'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'lint-staged' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'lint-staged/bin/lint-staged' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/chunkFiles' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/dynamicImport' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/execGit' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/figures' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/file' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/generateTasks' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/getRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/getStagedFiles' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/gitWorkflow' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/groupFilesByConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/loadConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/makeCmdTasks' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/messages' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/parseGitZOutput' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/printTaskOutput' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/resolveConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/resolveGitRepo' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/resolveTaskFn' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/runAll' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/searchConfigs' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/state' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/symbols' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/validateBraces' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/validateConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'lint-staged/lib/validateOptions' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'lint-staged/bin/lint-staged.js' {\n  declare module.exports: $Exports<'lint-staged/bin/lint-staged'>;\n}\ndeclare module 'lint-staged/lib/chunkFiles.js' {\n  declare module.exports: $Exports<'lint-staged/lib/chunkFiles'>;\n}\ndeclare module 'lint-staged/lib/dynamicImport.js' {\n  declare module.exports: $Exports<'lint-staged/lib/dynamicImport'>;\n}\ndeclare module 'lint-staged/lib/execGit.js' {\n  declare module.exports: $Exports<'lint-staged/lib/execGit'>;\n}\ndeclare module 'lint-staged/lib/figures.js' {\n  declare module.exports: $Exports<'lint-staged/lib/figures'>;\n}\ndeclare module 'lint-staged/lib/file.js' {\n  declare module.exports: $Exports<'lint-staged/lib/file'>;\n}\ndeclare module 'lint-staged/lib/generateTasks.js' {\n  declare module.exports: $Exports<'lint-staged/lib/generateTasks'>;\n}\ndeclare module 'lint-staged/lib/getRenderer.js' {\n  declare module.exports: $Exports<'lint-staged/lib/getRenderer'>;\n}\ndeclare module 'lint-staged/lib/getStagedFiles.js' {\n  declare module.exports: $Exports<'lint-staged/lib/getStagedFiles'>;\n}\ndeclare module 'lint-staged/lib/gitWorkflow.js' {\n  declare module.exports: $Exports<'lint-staged/lib/gitWorkflow'>;\n}\ndeclare module 'lint-staged/lib/groupFilesByConfig.js' {\n  declare module.exports: $Exports<'lint-staged/lib/groupFilesByConfig'>;\n}\ndeclare module 'lint-staged/lib/index' {\n  declare module.exports: $Exports<'lint-staged/lib'>;\n}\ndeclare module 'lint-staged/lib/index.js' {\n  declare module.exports: $Exports<'lint-staged/lib'>;\n}\ndeclare module 'lint-staged/lib/loadConfig.js' {\n  declare module.exports: $Exports<'lint-staged/lib/loadConfig'>;\n}\ndeclare module 'lint-staged/lib/makeCmdTasks.js' {\n  declare module.exports: $Exports<'lint-staged/lib/makeCmdTasks'>;\n}\ndeclare module 'lint-staged/lib/messages.js' {\n  declare module.exports: $Exports<'lint-staged/lib/messages'>;\n}\ndeclare module 'lint-staged/lib/parseGitZOutput.js' {\n  declare module.exports: $Exports<'lint-staged/lib/parseGitZOutput'>;\n}\ndeclare module 'lint-staged/lib/printTaskOutput.js' {\n  declare module.exports: $Exports<'lint-staged/lib/printTaskOutput'>;\n}\ndeclare module 'lint-staged/lib/resolveConfig.js' {\n  declare module.exports: $Exports<'lint-staged/lib/resolveConfig'>;\n}\ndeclare module 'lint-staged/lib/resolveGitRepo.js' {\n  declare module.exports: $Exports<'lint-staged/lib/resolveGitRepo'>;\n}\ndeclare module 'lint-staged/lib/resolveTaskFn.js' {\n  declare module.exports: $Exports<'lint-staged/lib/resolveTaskFn'>;\n}\ndeclare module 'lint-staged/lib/runAll.js' {\n  declare module.exports: $Exports<'lint-staged/lib/runAll'>;\n}\ndeclare module 'lint-staged/lib/searchConfigs.js' {\n  declare module.exports: $Exports<'lint-staged/lib/searchConfigs'>;\n}\ndeclare module 'lint-staged/lib/state.js' {\n  declare module.exports: $Exports<'lint-staged/lib/state'>;\n}\ndeclare module 'lint-staged/lib/symbols.js' {\n  declare module.exports: $Exports<'lint-staged/lib/symbols'>;\n}\ndeclare module 'lint-staged/lib/validateBraces.js' {\n  declare module.exports: $Exports<'lint-staged/lib/validateBraces'>;\n}\ndeclare module 'lint-staged/lib/validateConfig.js' {\n  declare module.exports: $Exports<'lint-staged/lib/validateConfig'>;\n}\ndeclare module 'lint-staged/lib/validateOptions.js' {\n  declare module.exports: $Exports<'lint-staged/lib/validateOptions'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/md5_v2.x.x.js",
    "content": "// flow-typed signature: 198b480a6b35dbf3a74cb37d21258b00\n// flow-typed version: c6154227d1/md5_v2.x.x/flow_>=v0.104.x\n\n// @flow\n\ndeclare module \"md5\" {\n  declare module.exports: (\n    message: string | Buffer,\n    options?: {\n      asString?: boolean,\n      asBytes?: boolean,\n      encoding?: string,\n      ...\n    }\n  ) => string;\n}\n"
  },
  {
    "path": "flow-typed/npm/mkdirp_v1.x.x.js",
    "content": "// flow-typed signature: 28ddcca31abd597a77830710de25f5fe\n// flow-typed version: a75473352d/mkdirp_v1.x.x/flow_>=v0.83.x\n\ndeclare module 'mkdirp' {\n  import typeof { mkdir, stat } from 'fs';\n\n  declare type FsImplementation = {\n    +mkdir?: mkdir,\n    +stat?: stat,\n    ...\n  };\n\n  declare type Options = number | string | {| mode?: number; fs?: FsImplementation |};\n\n  declare type Callback = (err: ?Error, path: ?string) => void;\n\n  declare module.exports: {|\n    (path: string, options?: Options | Callback): Promise<string| void>;\n    sync(path: string, options?: Options): string | void;\n    manual(path: string, options?: Options | Callback): Promise<string| void>;\n    manualSync(path: string, options?: Options): string | void;\n    native(path: string, options?: Options | Callback): Promise<string| void>;\n    nativeSync(path: string, options?: Options): string | void;\n  |};\n}\n"
  },
  {
    "path": "flow-typed/npm/mocha_v4.x.x.js",
    "content": "// flow-typed signature: 8b533a1271b4580048529f45ac3a3c68\n// flow-typed version: ba7bfb2fda/mocha_v4.x.x/flow_>=v0.104.x\n\ndeclare interface $npm$mocha$SetupOptions {\n  slow?: number;\n  timeout?: number;\n  ui?: string;\n  globals?: Array<any>;\n  reporter?: any;\n  bail?: boolean;\n  ignoreLeaks?: boolean;\n  grep?: any;\n}\n\ndeclare type $npm$mocha$done = (error?: any) => any;\n\n// declare interface $npm$mocha$SuiteCallbackContext {\n//   timeout(ms: number): void;\n//   retries(n: number): void;\n//   slow(ms: number): void;\n// }\n\n// declare interface $npm$mocha$TestCallbackContext {\n//   skip(): void;\n//   timeout(ms: number): void;\n//   retries(n: number): void;\n//   slow(ms: number): void;\n//   [index: string]: any;\n// }\n\ndeclare interface $npm$mocha$Suite {\n  parent: $npm$mocha$Suite;\n  title: string;\n  fullTitle(): string;\n}\n\ndeclare type $npm$mocha$ContextDefinition = {|\n  (description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): $npm$mocha$Suite;\n  only(description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): $npm$mocha$Suite;\n  skip(description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): void;\n  timeout(ms: number): void;\n|}\n\ndeclare type $npm$mocha$TestDefinition = {|\n  (expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): $npm$mocha$Test;\n  only(expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): $npm$mocha$Test;\n  skip(expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): void;\n  timeout(ms: number): void;\n  state: 'failed' | 'passed';\n|}\n\ndeclare interface $npm$mocha$Runner {}\n\ndeclare class $npm$mocha$BaseReporter {\n  stats: {\n    suites: number,\n    tests: number,\n    passes: number,\n    pending: number,\n    failures: number,\n    ...\n  };\n\n  constructor(runner: $npm$mocha$Runner): $npm$mocha$BaseReporter;\n}\n\ndeclare class $npm$mocha$DocReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$DotReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$HTMLReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$HTMLCovReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$JSONReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$JSONCovReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$JSONStreamReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$LandingReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$ListReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$MarkdownReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$MinReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$NyanReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$ProgressReporter extends $npm$mocha$BaseReporter {\n  constructor(runner: $npm$mocha$Runner, options?: {\n    open?: string,\n    complete?: string,\n    incomplete?: string,\n    close?: string,\n    ...\n  }): $npm$mocha$ProgressReporter;\n}\ndeclare class $npm$mocha$SpecReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$TAPReporter extends $npm$mocha$BaseReporter {}\ndeclare class $npm$mocha$XUnitReporter extends $npm$mocha$BaseReporter {\n  constructor(runner: $npm$mocha$Runner, options?: any): $npm$mocha$XUnitReporter;\n}\n\ndeclare class $npm$mocha$Mocha {\n  currentTest: $npm$mocha$TestDefinition;\n  constructor(options?: {\n    grep?: RegExp,\n    ui?: string,\n    reporter?: string,\n    timeout?: number,\n    reporterOptions?: any,\n    slow?: number,\n    bail?: boolean,\n    ...\n  }): $npm$mocha$Mocha;\n  setup(options: $npm$mocha$SetupOptions): this;\n  bail(value?: boolean): this;\n  addFile(file: string): this;\n  reporter(name: string): this;\n  reporter(reporter: (runner: $npm$mocha$Runner, options: any) => any): this;\n  ui(value: string): this;\n  grep(value: string): this;\n  grep(value: RegExp): this;\n  invert(): this;\n  ignoreLeaks(value: boolean): this;\n  checkLeaks(): this;\n  throwError(error: Error): void;\n  growl(): this;\n  globals(value: string): this;\n  globals(values: Array<string>): this;\n  useColors(value: boolean): this;\n  useInlineDiffs(value: boolean): this;\n  timeout(value: number): this;\n  slow(value: number): this;\n  enableTimeouts(value: boolean): this;\n  asyncOnly(value: boolean): this;\n  noHighlighting(value: boolean): this;\n  run(onComplete?: (failures: number) => void): $npm$mocha$Runner;\n\n  static reporters: {\n    Doc: $npm$mocha$DocReporter,\n    Dot: $npm$mocha$DotReporter,\n    HTML: $npm$mocha$HTMLReporter,\n    HTMLCov: $npm$mocha$HTMLCovReporter,\n    JSON: $npm$mocha$JSONReporter,\n    JSONCov: $npm$mocha$JSONCovReporter,\n    JSONStream: $npm$mocha$JSONStreamReporter,\n    Landing: $npm$mocha$LandingReporter,\n    List: $npm$mocha$ListReporter,\n    Markdown: $npm$mocha$MarkdownReporter,\n    Min: $npm$mocha$MinReporter,\n    Nyan: $npm$mocha$NyanReporter,\n    Progress: $npm$mocha$ProgressReporter,\n    ...\n  };\n}\n\n// declare interface $npm$mocha$HookCallbackContext {\n//   skip(): void;\n//   timeout(ms: number): void;\n//   [index: string]: any;\n// }\n\ndeclare interface $npm$mocha$Runnable {\n  title: string;\n  fn: Function;\n  async: boolean;\n  sync: boolean;\n  timedOut: boolean;\n}\n\ndeclare interface $npm$mocha$Test extends $npm$mocha$Runnable {\n  parent: $npm$mocha$Suite;\n  pending: boolean;\n  state: 'failed' | 'passed' | void;\n  fullTitle(): string;\n}\n\n// declare interface $npm$mocha$BeforeAndAfterContext extends $npm$mocha$HookCallbackContext {\n//   currentTest: $npm$mocha$Test;\n// }\n\ndeclare var mocha: $npm$mocha$Mocha;\ndeclare var describe: $npm$mocha$ContextDefinition;\ndeclare var xdescribe: $npm$mocha$ContextDefinition;\ndeclare var context: $npm$mocha$ContextDefinition;\ndeclare var suite: $npm$mocha$ContextDefinition;\ndeclare var it: $npm$mocha$TestDefinition;\ndeclare var xit: $npm$mocha$TestDefinition;\ndeclare var test: $npm$mocha$TestDefinition;\ndeclare var specify: $npm$mocha$TestDefinition;\n\ntype Run = () => void;\n\ndeclare var run: Run;\n\ntype Setup = (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void;\ntype Teardown = (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void;\ntype SuiteSetup = (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void;\ntype SuiteTeardown = (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void;\ntype Before =\n  | (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void\n  | (description: string, callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void;\ntype After =\n  | (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void\n  | (description: string, callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void;\ntype BeforeEach =\n  | (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void\n  | (description: string, callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void;\ntype AfterEach =\n  | (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void\n  | (description: string, callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void;\n\n\ndeclare var setup: Setup;\ndeclare var teardown: Teardown;\ndeclare var suiteSetup: SuiteSetup;\ndeclare var suiteTeardown: SuiteTeardown;\ndeclare var before: Before\ndeclare var after: After;\ndeclare var beforeEach: BeforeEach;\ndeclare var afterEach: AfterEach;\n\ndeclare module \"mocha\" {\n  declare export var mocha: $npm$mocha$TestDefinition;\n  declare export var describe: $npm$mocha$ContextDefinition;\n  declare export var xdescribe: $npm$mocha$ContextDefinition;\n  declare export var context: $npm$mocha$ContextDefinition;\n  declare export var suite: $npm$mocha$ContextDefinition;\n  declare export var it: $npm$mocha$TestDefinition;\n  declare export var xit: $npm$mocha$TestDefinition;\n  declare export var test: $npm$mocha$TestDefinition;\n  declare export var specify: $npm$mocha$TestDefinition;\n\n  declare export var run: Run;\n\n  declare export var setup: Setup;\n  declare export var teardown: Teardown;\n  declare export var suiteSetup: SuiteSetup;\n  declare export var suiteTeardown: SuiteTeardown;\n  declare export var before: Before;\n  declare export var after: After;\n  declare export var beforeEach: BeforeEach;\n  declare export var afterEach: AfterEach;\n\n  declare export default $npm$mocha$Mocha;\n}\n"
  },
  {
    "path": "flow-typed/npm/node-stream-zip_v1.x.x.js",
    "content": "// flow-typed signature: bd18604d0696d9e4ad0da443cf74273b\n// flow-typed version: 1ff21d416b/node-stream-zip_v1.x.x/flow_>=v0.104.x\n\ndeclare module 'node-stream-zip' {\n    declare type StreamZipOptions = {|\n      /**\n       * File to read\n       * @default undefined\n       */\n      file?: string;\n  \n      /**\n       * Alternatively, you can pass fd here\n       * @default undefined\n       */\n      fd?: number;\n  \n      /**\n       * You will be able to work with entries inside zip archive,\n       * otherwise the only way to access them is entry event\n       * @default true\n       */\n      storeEntries?: boolean;\n  \n      /**\n       * By default, entry name is checked for malicious characters, like ../ or c:\\123,\n       * pass this flag to disable validation error\n       * @default false\n       */\n      skipEntryNameValidation?: boolean;\n  \n      /**\n       * Filesystem read chunk size\n       * @default automatic based on file size\n       */\n      chunkSize?: number;\n  \n      /**\n       * Encoding used to decode file names\n       * @default UTF8\n       */\n      nameEncoding?: string;\n    |}\n  \n    declare type ZipEntry = {|\n      /**\n       * file name\n       */\n      name: string;\n  \n      /**\n       * true if it's a directory entry\n       */\n      isDirectory: boolean;\n  \n      /**\n       * true if it's a file entry, see also isDirectory\n       */\n      isFile: boolean;\n  \n      /**\n       * file comment\n       */\n      comment: string;\n  \n      /**\n       * if the file is encrypted\n       */\n      encrypted: boolean;\n  \n      /**\n       * version made by\n       */\n      verMade: number;\n  \n      /**\n       * version needed to extract\n       */\n      version: number;\n  \n      /**\n       * encrypt, decrypt flags\n       */\n      flags: number;\n  \n      /**\n       * compression method\n       */\n      method: number;\n  \n      /**\n       * modification time\n       */\n      time: number;\n  \n      /**\n       * uncompressed file crc-32 value\n       */\n      crc: number;\n  \n      /**\n       * compressed size\n       */\n      compressedSize: number;\n  \n      /**\n       * uncompressed size\n       */\n      size: number;\n  \n      /**\n       * volume number start\n       */\n      diskStart: number;\n  \n      /**\n       * internal file attributes\n       */\n      inattr: number;\n  \n      /**\n       * external file attributes\n       */\n      attr: number;\n  \n      /**\n       * LOC header offset\n       */\n      offset: number;\n    |}\n  \n    declare class StreamZipAsync {\n      constructor(config: StreamZipOptions): this;\n  \n      entriesCount: Promise<number>;\n      comment: Promise<string>;\n  \n      entry(name: string): Promise<?ZipEntry>;\n      entries(): Promise<{ [name: string]: ZipEntry }>;\n      entryData(entry: string | ZipEntry): Promise<Buffer>;\n      stream(entry: string | ZipEntry): Promise<ReadableStream>;\n      extract(entry: string | ZipEntry | null, outPath: string): Promise<?number>;\n  \n      on(event: 'entry', handler: (entry: ZipEntry) => void): void;\n      on(event: 'extract', handler: (entry: ZipEntry, outPath: string) => void): void;\n  \n      close(): Promise<void>;\n    }\n  \n    declare class StreamZip {\n      constructor(config: StreamZipOptions): this;\n  \n      entriesCount: number;\n      comment: string;\n   \n      on(event: 'error', handler: (error: any) => void): void;\n      on(event: 'entry', handler: (entry: ZipEntry) => void): void;\n      on(event: 'ready', handler: () => void): void;\n      on(event: 'extract', handler: (entry: ZipEntry, outPath: string) => void): void;\n  \n      entry(name: string): ?ZipEntry;\n  \n      entries(): { [name: string]: ZipEntry };\n  \n      stream(\n          entry: string | ZipEntry,\n          callback: (err: any | null, stream?: ReadableStream) => void\n      ): void;\n  \n      entryDataSync(entry: string | ZipEntry): Buffer;\n  \n      openEntry(\n          entry: string | ZipEntry,\n          callback: (err: any | null, entry?: ZipEntry) => void,\n          sync: boolean\n      ): void;\n  \n      extract(\n          entry: string | ZipEntry | null,\n          outPath: string,\n          callback: (err?: any, res?: number) => void\n      ): void;\n  \n      close(callback?: (err?: any) => void): void;\n  \n      static async: Class<StreamZipAsync>;\n    }\n  \n    declare module.exports: Class<StreamZip>;\n  }\n  "
  },
  {
    "path": "flow-typed/npm/prettier_v1.x.x.js",
    "content": "// flow-typed signature: cfdc7e61e71ab8d32e882a236b798eaf\n// flow-typed version: 02d4f1d2c5/prettier_v1.x.x/flow_>=v0.104.x <=v0.200.x\n\ndeclare module \"prettier\" {\n  declare export type AST = { [key: string]: any, ... };\n  declare export type Doc = {\n    [key: string]: any,\n    ...\n  };\n  declare export type FastPath<T = any> = {\n    stack: any[],\n    getName(): null | string | number | Symbol,\n    getValue(): T,\n    getNode(count?: number): null | T,\n    getParentNode(count?: number): null | T,\n    call<U>(callback: (path: FastPath<T>) => U, ...names: Array<string | number | Symbol>): U,\n    each(callback: (path: FastPath<T>) => void, ...names: Array<string | number | Symbol>): void,\n    map<U>(callback: (path: FastPath<T>, index: number) => U, ...names: Array<string | number | Symbol>): U[],\n    ...\n  };\n\n  declare export type PrettierParserName =\n    | \"babylon\" // deprecated\n    | \"babel\"\n    | \"babel-flow\"\n    | \"flow\"\n    | \"typescript\"\n    | \"postcss\" // deprecated\n    | \"css\"\n    | \"less\"\n    | \"scss\"\n    | \"json\"\n    | \"json5\"\n    | \"json-stringify\"\n    | \"graphql\"\n    | \"markdown\"\n    | \"vue\"\n    | \"html\"\n    | \"angular\"\n    | \"mdx\"\n    | \"yaml\";\n\n  declare export type PrettierParser = {\n    [name: PrettierParserName]: (text: string, options?: { [key: string]: any, ... }) => AST,\n    ...\n  };\n\n  declare export type CustomParser = (\n    text: string,\n    parsers: PrettierParser,\n    options: Options\n  ) => AST;\n\n  declare export type Options = {|\n    printWidth?: number,\n    tabWidth?: number,\n    useTabs?: boolean,\n    semi?: boolean,\n    singleQuote?: boolean,\n    trailingComma?: \"none\" | \"es5\" | \"all\",\n    bracketSpacing?: boolean,\n    jsxBracketSameLine?: boolean,\n    arrowParens?: \"avoid\" | \"always\",\n    rangeStart?: number,\n    rangeEnd?: number,\n    parser?: PrettierParserName | CustomParser,\n    filepath?: string,\n    requirePragma?: boolean,\n    insertPragma?: boolean,\n    proseWrap?: \"always\" | \"never\" | \"preserve\",\n    plugins?: Array<string | Plugin>\n  |};\n\n  declare export type Plugin = {\n    languages: SupportLanguage,\n    parsers: { [parserName: string]: Parser, ... },\n    printers: { [astFormat: string]: Printer, ... },\n    options?: SupportOption[],\n    ...\n  };\n\n  declare export type Parser = {\n    parse: (\n      text: string,\n      parsers: { [parserName: string]: Parser, ... },\n      options: { [key: string]: any, ... }\n    ) => AST,\n    astFormat: string,\n    hasPragma?: (text: string) => boolean,\n    locStart: (node: any) => number,\n    locEnd: (node: any) => number,\n    preprocess?: (text: string, options: { [key: string]: any, ... }) => string,\n    ...\n  };\n\n  declare export type Printer = {\n    print: (\n      path: FastPath<>,\n      options: { [key: string]: any, ... },\n      print: (path: FastPath<>) => Doc\n    ) => Doc,\n    embed: (\n      path: FastPath<>,\n      print: (path: FastPath<>) => Doc,\n      textToDoc: (text: string, options: { [key: string]: any, ... }) => Doc,\n      options: { [key: string]: any, ... }\n    ) => ?Doc,\n    insertPragma?: (text: string) => string,\n    massageAstNode?: (node: any, newNode: any, parent: any) => any,\n    hasPrettierIgnore?: (path: FastPath<>) => boolean,\n    canAttachComment?: (node: any) => boolean,\n    willPrintOwnComments?: (path: FastPath<>) => boolean,\n    printComments?: (path: FastPath<>, print: (path: FastPath<>) => Doc, options: { [key: string]: any, ... }, needsSemi: boolean) => Doc,\n    handleComments?: {\n      ownLine?: (commentNode: any, text: string, options: { [key: string]: any, ... }, ast: any, isLastComment: boolean) => boolean,\n      endOfLine?: (commentNode: any, text: string, options: { [key: string]: any, ... }, ast: any, isLastComment: boolean) => boolean,\n      remaining?: (commentNode: any, text: string, options: { [key: string]: any, ... }, ast: any, isLastComment: boolean) => boolean,\n      ...\n    },\n    ...\n  };\n\n  declare export type CursorOptions = {|\n    cursorOffset: number,\n    printWidth?: $PropertyType<Options, \"printWidth\">,\n    tabWidth?: $PropertyType<Options, \"tabWidth\">,\n    useTabs?: $PropertyType<Options, \"useTabs\">,\n    semi?: $PropertyType<Options, \"semi\">,\n    singleQuote?: $PropertyType<Options, \"singleQuote\">,\n    trailingComma?: $PropertyType<Options, \"trailingComma\">,\n    bracketSpacing?: $PropertyType<Options, \"bracketSpacing\">,\n    jsxBracketSameLine?: $PropertyType<Options, \"jsxBracketSameLine\">,\n    arrowParens?: $PropertyType<Options, \"arrowParens\">,\n    parser?: $PropertyType<Options, \"parser\">,\n    filepath?: $PropertyType<Options, \"filepath\">,\n    requirePragma?: $PropertyType<Options, \"requirePragma\">,\n    insertPragma?: $PropertyType<Options, \"insertPragma\">,\n    proseWrap?: $PropertyType<Options, \"proseWrap\">,\n    plugins?: $PropertyType<Options, \"plugins\">\n  |};\n\n  declare export type CursorResult = {|\n    formatted: string,\n    cursorOffset: number\n  |};\n\n  declare export type ResolveConfigOptions = {|\n    useCache?: boolean,\n    config?: string,\n    editorconfig?: boolean\n  |};\n\n  declare export type SupportLanguage = {\n    name: string,\n    since: string,\n    parsers: Array<string>,\n    group?: string,\n    tmScope: string,\n    aceMode: string,\n    codemirrorMode: string,\n    codemirrorMimeType: string,\n    aliases?: Array<string>,\n    extensions: Array<string>,\n    filenames?: Array<string>,\n    linguistLanguageId: number,\n    vscodeLanguageIds: Array<string>,\n    ...\n  };\n\n  declare export type SupportOption = {|\n    since: string,\n    type: \"int\" | \"boolean\" | \"choice\" | \"path\",\n    deprecated?: string,\n    redirect?: SupportOptionRedirect,\n    description: string,\n    oppositeDescription?: string,\n    default: SupportOptionValue,\n    range?: SupportOptionRange,\n    choices?: SupportOptionChoice\n  |};\n\n  declare export type SupportOptionRedirect = {|\n    options: string,\n    value: SupportOptionValue\n  |};\n\n  declare export type SupportOptionRange = {|\n    start: number,\n    end: number,\n    step: number\n  |};\n\n  declare export type SupportOptionChoice = {|\n    value: boolean | string,\n    description?: string,\n    since?: string,\n    deprecated?: string,\n    redirect?: SupportOptionValue\n  |};\n\n  declare export type SupportOptionValue = number | boolean | string;\n\n  declare export type SupportInfo = {|\n    languages: Array<SupportLanguage>,\n    options: Array<SupportOption>\n  |};\n                                                             \n  declare export type FileInfo = {|\n    ignored: boolean,\n    inferredParser: PrettierParserName | null,\n  |};                                                          \n\n  declare export type Prettier = {|\n    format: (source: string, options?: Options) => string,\n    check: (source: string, options?: Options) => boolean,\n    formatWithCursor: (source: string, options: CursorOptions) => CursorResult,\n    resolveConfig: {\n      (filePath: string, options?: ResolveConfigOptions): Promise<?Options>,\n      sync(filePath: string, options?: ResolveConfigOptions): ?Options,\n      ...\n    },\n    clearConfigCache: () => void,\n    getSupportInfo: (version?: string) => SupportInfo,\n    getFileInfo: (filePath: string) => Promise<FileInfo>\n  |};\n\n  declare export default Prettier;\n}\n"
  },
  {
    "path": "flow-typed/npm/prettier_vx.x.x.js",
    "content": "// flow-typed signature: 1f4ab6c1d3d18b92a343b925d5e6384c\n// flow-typed version: <<STUB>>/prettier_v^2.6.2/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'prettier'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'prettier' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'prettier/bin-prettier' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/doc' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-angular' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-babel' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-espree' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-flow' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-glimmer' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-graphql' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-html' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-markdown' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-meriyah' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-postcss' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-typescript' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/parser-yaml' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/standalone' {\n  declare module.exports: any;\n}\n\ndeclare module 'prettier/third-party' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'prettier/bin-prettier.js' {\n  declare module.exports: $Exports<'prettier/bin-prettier'>;\n}\ndeclare module 'prettier/cli.js' {\n  declare module.exports: $Exports<'prettier/cli'>;\n}\ndeclare module 'prettier/doc.js' {\n  declare module.exports: $Exports<'prettier/doc'>;\n}\ndeclare module 'prettier/index' {\n  declare module.exports: $Exports<'prettier'>;\n}\ndeclare module 'prettier/index.js' {\n  declare module.exports: $Exports<'prettier'>;\n}\ndeclare module 'prettier/parser-angular.js' {\n  declare module.exports: $Exports<'prettier/parser-angular'>;\n}\ndeclare module 'prettier/parser-babel.js' {\n  declare module.exports: $Exports<'prettier/parser-babel'>;\n}\ndeclare module 'prettier/parser-espree.js' {\n  declare module.exports: $Exports<'prettier/parser-espree'>;\n}\ndeclare module 'prettier/parser-flow.js' {\n  declare module.exports: $Exports<'prettier/parser-flow'>;\n}\ndeclare module 'prettier/parser-glimmer.js' {\n  declare module.exports: $Exports<'prettier/parser-glimmer'>;\n}\ndeclare module 'prettier/parser-graphql.js' {\n  declare module.exports: $Exports<'prettier/parser-graphql'>;\n}\ndeclare module 'prettier/parser-html.js' {\n  declare module.exports: $Exports<'prettier/parser-html'>;\n}\ndeclare module 'prettier/parser-markdown.js' {\n  declare module.exports: $Exports<'prettier/parser-markdown'>;\n}\ndeclare module 'prettier/parser-meriyah.js' {\n  declare module.exports: $Exports<'prettier/parser-meriyah'>;\n}\ndeclare module 'prettier/parser-postcss.js' {\n  declare module.exports: $Exports<'prettier/parser-postcss'>;\n}\ndeclare module 'prettier/parser-typescript.js' {\n  declare module.exports: $Exports<'prettier/parser-typescript'>;\n}\ndeclare module 'prettier/parser-yaml.js' {\n  declare module.exports: $Exports<'prettier/parser-yaml'>;\n}\ndeclare module 'prettier/standalone.js' {\n  declare module.exports: $Exports<'prettier/standalone'>;\n}\ndeclare module 'prettier/third-party.js' {\n  declare module.exports: $Exports<'prettier/third-party'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/rimraf_v3.x.x.js",
    "content": "// flow-typed signature: 31191d41b239d1242753bdea18136ae9\n// flow-typed version: 6ee04b16cf/rimraf_v3.x.x/flow_>=v0.104.x\n\ndeclare module 'rimraf' {\n  declare type Options = {\n    maxBusyTries?: number,\n    emfileWait?: number,\n    glob?: boolean,\n    disableGlob?: boolean,\n    ...\n  };\n  \n  declare type Callback = (err: ?Error, path: ?string) => void;\n\n  declare module.exports: {\n    (f: string, opts?: Options | Callback, callback?: Callback): void,\n    sync(path: string, opts?: Options): void,\n    ...\n  };\n}\n"
  },
  {
    "path": "flow-typed/npm/semver_v7.x.x.js",
    "content": "// flow-typed signature: bf6205896c200fb28700dfa8d29f2b8a\n// flow-typed version: 3d76504c27/semver_v7.x.x/flow_>=v0.104.x\n\ndeclare module \"semver\" {\n  declare type Release =\n    | \"major\"\n    | \"premajor\"\n    | \"minor\"\n    | \"preminor\"\n    | \"patch\"\n    | \"prepatch\"\n    | \"prerelease\";\n\n  // The supported comparators are taken from the source here:\n  // https://github.com/npm/node-semver/blob/8bd070b550db2646362c9883c8d008d32f66a234/semver.js#L623\n  declare type Operator =\n    | \"===\"\n    | \"!==\"\n    | \"==\"\n    | \"=\"\n    | \"\" // Not sure why you would want this, but whatever.\n    | \"!=\"\n    | \">\"\n    | \">=\"\n    | \"<\"\n    | \"<=\";\n\n  declare class SemVer {\n    build: Array<string>;\n    loose: ?boolean;\n    major: number;\n    minor: number;\n    patch: number;\n    prerelease: Array<string | number>;\n    raw: string;\n    version: string;\n\n    constructor(version: string | SemVer, options?: Options): SemVer;\n    compare(other: string | SemVer): -1 | 0 | 1;\n    compareMain(other: string | SemVer): -1 | 0 | 1;\n    comparePre(other: string | SemVer): -1 | 0 | 1;\n    compareBuild(other: string | SemVer): -1 | 0 | 1;\n    format(): string;\n    inc(release: Release, identifier: string): this;\n  }\n\n  declare class Comparator {\n    options?: Options;\n    operator: Operator;\n    semver: SemVer;\n    value: string;\n\n    constructor(comp: string | Comparator, options?: Options): Comparator;\n    parse(comp: string): void;\n    test(version: string): boolean;\n  }\n\n  declare class Range {\n    loose: ?boolean;\n    raw: string;\n    set: Array<Array<Comparator>>;\n\n    constructor(range: string | Range, options?: Options): Range;\n    format(): string;\n    parseRange(range: string): Array<Comparator>;\n    test(version: string): boolean;\n    toString(): string;\n  }\n\n  declare var SEMVER_SPEC_VERSION: string;\n  declare var re: Array<RegExp>;\n  declare var src: Array<string>;\n\n  declare type Options = {\n    options?: Options,\n    includePrerelease?: boolean,\n    ...\n  } | boolean;\n\n  // Functions\n  declare function valid(v: string | SemVer, options?: Options): string | null;\n  declare function clean(v: string | SemVer, options?: Options): string | null;\n  declare function inc(\n    v: string | SemVer,\n    release: Release,\n    options?: Options,\n    identifier?: string\n  ): string | null;\n  declare function inc(\n    v: string | SemVer,\n    release: Release,\n    identifier: string\n  ): string | null;\n  declare function major(v: string | SemVer, options?: Options): number;\n  declare function minor(v: string | SemVer, options?: Options): number;\n  declare function patch(v: string | SemVer, options?: Options): number;\n  declare function intersects(r1: string | SemVer, r2: string | SemVer, loose?: boolean): boolean;\n  declare function minVersion(r: string | Range): Range | null;\n\n  // Comparison\n  declare function gt(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function gte(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function lt(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function lte(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function eq(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function neq(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function cmp(\n    v1: string | SemVer,\n    comparator: Operator,\n    v2: string | SemVer,\n    options?: Options\n  ): boolean;\n  declare function compare(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): -1 | 0 | 1;\n  declare function rcompare(\n    v1: string | SemVer,\n    v2: string | SemVer,\n    options?: Options\n  ): -1 | 0 | 1;\n  declare function diff(v1: string | SemVer, v2: string | SemVer): ?Release;\n  declare function intersects(comparator: Comparator): boolean;\n  declare function sort(\n    list: Array<string | SemVer>,\n    options?: Options\n  ): Array<string | SemVer>;\n  declare function rsort(\n    list: Array<string | SemVer>,\n    options?: Options\n  ): Array<string | SemVer>;\n  declare function compareIdentifiers(\n    v1: string | SemVer,\n    v2: string | SemVer\n  ): -1 | 0 | 1;\n  declare function rcompareIdentifiers(\n    v1: string | SemVer,\n    v2: string | SemVer\n  ): -1 | 0 | 1;\n\n  // Ranges\n  declare function validRange(\n    range: string | Range,\n    options?: Options\n  ): string | null;\n  declare function satisfies(\n    version: string | SemVer,\n    range: string | Range,\n    options?: Options\n  ): boolean;\n  declare function maxSatisfying(\n    versions: Array<string | SemVer>,\n    range: string | Range,\n    options?: Options\n  ): string | SemVer | null;\n  declare function minSatisfying(\n    versions: Array<string | SemVer>,\n    range: string | Range,\n    options?: Options\n  ): string | SemVer | null;\n  declare function gtr(\n    version: string | SemVer,\n    range: string | Range,\n    options?: Options\n  ): boolean;\n  declare function ltr(\n    version: string | SemVer,\n    range: string | Range,\n    options?: Options\n  ): boolean;\n  declare function outside(\n    version: string | SemVer,\n    range: string | Range,\n    hilo: \">\" | \"<\",\n    options?: Options\n  ): boolean;\n  declare function intersects(\n    range: Range\n  ): boolean;\n  declare function simplifyRange(\n    ranges: Array<string>,\n    range: string | Range,\n    options?: Options,\n  ): string | Range;\n  declare function subset(\n      sub: string | Range,\n      dom: string | Range,\n      options?: Options,\n  ): boolean;\n\n  // Coercion\n  declare function coerce(\n    version: string | SemVer,\n    options?: Options\n  ): ?SemVer\n\n  // Not explicitly documented, or deprecated\n  declare function parse(version: string, options?: Options): ?SemVer;\n  declare function toComparators(\n    range: string | Range,\n    options?: Options\n  ): Array<Array<string>>;\n}\n\ndeclare module \"semver/preload\" {\n  declare module.exports: $Exports<\"semver\">;\n}\n"
  },
  {
    "path": "flow-typed/npm/serve_vx.x.x.js",
    "content": "// flow-typed signature: ff47633e906b77d18196430051db52fa\n// flow-typed version: <<STUB>>/serve_v^10.0.0/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'serve'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'serve' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'serve/bin/serve' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'serve/bin/serve.js' {\n  declare module.exports: $Exports<'serve/bin/serve'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/standard-version_vx.x.x.js",
    "content": "// flow-typed signature: 570f5014289cb73342d1dd70c136bca1\n// flow-typed version: <<STUB>>/standard-version_v^9.3.2/flow_v0.155.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'standard-version'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'standard-version' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'standard-version/bin/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/command' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/defaults' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/checkpoint' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/configuration' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/format-commit-message' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/latest-semver-tag' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/lifecycles/bump' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/lifecycles/changelog' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/lifecycles/commit' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/lifecycles/tag' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/preset-loader' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/print-error' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/run-exec' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/run-execFile' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/run-lifecycle-script' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/updaters' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/updaters/types/json' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/updaters/types/plain-text' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/lib/write-file' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/test/config-files.spec' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/test/core.spec' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/test/git.spec' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/test/mocks/updater/customer-updater' {\n  declare module.exports: any;\n}\n\ndeclare module 'standard-version/test/preset.spec' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'standard-version/bin/cli.js' {\n  declare module.exports: $Exports<'standard-version/bin/cli'>;\n}\ndeclare module 'standard-version/command.js' {\n  declare module.exports: $Exports<'standard-version/command'>;\n}\ndeclare module 'standard-version/defaults.js' {\n  declare module.exports: $Exports<'standard-version/defaults'>;\n}\ndeclare module 'standard-version/index' {\n  declare module.exports: $Exports<'standard-version'>;\n}\ndeclare module 'standard-version/index.js' {\n  declare module.exports: $Exports<'standard-version'>;\n}\ndeclare module 'standard-version/lib/checkpoint.js' {\n  declare module.exports: $Exports<'standard-version/lib/checkpoint'>;\n}\ndeclare module 'standard-version/lib/configuration.js' {\n  declare module.exports: $Exports<'standard-version/lib/configuration'>;\n}\ndeclare module 'standard-version/lib/format-commit-message.js' {\n  declare module.exports: $Exports<'standard-version/lib/format-commit-message'>;\n}\ndeclare module 'standard-version/lib/latest-semver-tag.js' {\n  declare module.exports: $Exports<'standard-version/lib/latest-semver-tag'>;\n}\ndeclare module 'standard-version/lib/lifecycles/bump.js' {\n  declare module.exports: $Exports<'standard-version/lib/lifecycles/bump'>;\n}\ndeclare module 'standard-version/lib/lifecycles/changelog.js' {\n  declare module.exports: $Exports<'standard-version/lib/lifecycles/changelog'>;\n}\ndeclare module 'standard-version/lib/lifecycles/commit.js' {\n  declare module.exports: $Exports<'standard-version/lib/lifecycles/commit'>;\n}\ndeclare module 'standard-version/lib/lifecycles/tag.js' {\n  declare module.exports: $Exports<'standard-version/lib/lifecycles/tag'>;\n}\ndeclare module 'standard-version/lib/preset-loader.js' {\n  declare module.exports: $Exports<'standard-version/lib/preset-loader'>;\n}\ndeclare module 'standard-version/lib/print-error.js' {\n  declare module.exports: $Exports<'standard-version/lib/print-error'>;\n}\ndeclare module 'standard-version/lib/run-exec.js' {\n  declare module.exports: $Exports<'standard-version/lib/run-exec'>;\n}\ndeclare module 'standard-version/lib/run-execFile.js' {\n  declare module.exports: $Exports<'standard-version/lib/run-execFile'>;\n}\ndeclare module 'standard-version/lib/run-lifecycle-script.js' {\n  declare module.exports: $Exports<'standard-version/lib/run-lifecycle-script'>;\n}\ndeclare module 'standard-version/lib/updaters/index' {\n  declare module.exports: $Exports<'standard-version/lib/updaters'>;\n}\ndeclare module 'standard-version/lib/updaters/index.js' {\n  declare module.exports: $Exports<'standard-version/lib/updaters'>;\n}\ndeclare module 'standard-version/lib/updaters/types/json.js' {\n  declare module.exports: $Exports<'standard-version/lib/updaters/types/json'>;\n}\ndeclare module 'standard-version/lib/updaters/types/plain-text.js' {\n  declare module.exports: $Exports<'standard-version/lib/updaters/types/plain-text'>;\n}\ndeclare module 'standard-version/lib/write-file.js' {\n  declare module.exports: $Exports<'standard-version/lib/write-file'>;\n}\ndeclare module 'standard-version/test/config-files.spec.js' {\n  declare module.exports: $Exports<'standard-version/test/config-files.spec'>;\n}\ndeclare module 'standard-version/test/core.spec.js' {\n  declare module.exports: $Exports<'standard-version/test/core.spec'>;\n}\ndeclare module 'standard-version/test/git.spec.js' {\n  declare module.exports: $Exports<'standard-version/test/git.spec'>;\n}\ndeclare module 'standard-version/test/mocks/updater/customer-updater.js' {\n  declare module.exports: $Exports<'standard-version/test/mocks/updater/customer-updater'>;\n}\ndeclare module 'standard-version/test/preset.spec.js' {\n  declare module.exports: $Exports<'standard-version/test/preset.spec'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/yargs_v15.x.x.js",
    "content": "// flow-typed signature: d538758c32ffc612a9c0d1262c22d161\n// flow-typed version: 3c81f4d103/yargs_v15.x.x/flow_>=v0.118.x <=v0.200.x\n\ndeclare module \"yargs\" {\n  declare type Argv = {\n    [key: string]: any,\n    _: Array<string>,\n    $0: string,\n    ...\n  };\n\n  declare type Options = $Shape<{\n    alias: string | Array<string>,\n    array: boolean,\n    boolean: boolean,\n    choices: Array<mixed>,\n    coerce: (arg: {[key: string]: any, ...} | any) => mixed,\n    config: boolean,\n    configParser: (configPath: string) => { [key: string]: mixed, ... },\n    conflicts: string | Array<string> | { [key: string]: string, ... },\n    count: boolean,\n    default: mixed,\n    defaultDescription: string,\n    demandOption: boolean | string,\n    desc: string,\n    describe: string,\n    description: string,\n    global: boolean,\n    group: string,\n    implies: string | { [key: string]: string, ... },\n    nargs: number,\n    normalize: boolean,\n    number: boolean,\n    required: boolean,\n    requiresArg: boolean,\n    skipValidation: boolean,\n    string: boolean,\n    type: \"array\" | \"boolean\" | \"count\" | \"number\" | \"string\",\n    ...\n  }>;\n\n  declare type CommonModuleObject = {|\n    command?: string | Array<string>,\n    aliases?: Array<string> | string,\n    builder?: { [key: string]: Options, ... } | ((yargsInstance: Yargs) => mixed),\n    handler?: ((argv: Argv) => void) | ((argv: Argv) => Promise<void>)\n  |};\n\n  declare type ModuleObjectDesc = {|\n    ...CommonModuleObject,\n    desc?: string | false\n  |};\n\n  declare type ModuleObjectDescribe = {|\n    ...CommonModuleObject,\n    describe?: string | false\n  |};\n\n  declare type ModuleObjectDescription = {|\n    ...CommonModuleObject,\n    description?: string | false\n  |};\n\n  declare type ModuleObject =\n    | ModuleObjectDesc\n    | ModuleObjectDescribe\n    | ModuleObjectDescription;\n\n  declare type MiddleWareCallback =\n    | (argv: Argv, yargsInstance?: Yargs) => void\n    | (argv: Argv, yargsInstance?: Yargs) => Promise<void>;\n\n  declare type Middleware = MiddleWareCallback | Array<MiddleWareCallback>;\n\n  declare class Yargs {\n    (args: Array<string>): Yargs;\n\n    alias(key: string, alias: string): this;\n    alias(alias: { [key: string]: string | Array<string>, ... }): this;\n    argv: Argv;\n    array(key: string | Array<string>): this;\n    boolean(parameter: string | Array<string>): this;\n    check(fn: (argv: Argv, options: Array<string>) => ?boolean): this;\n    choices(key: string, allowed: Array<string>): this;\n    choices(allowed: { [key: string]: Array<string>, ... }): this;\n    coerce(key: string, fn: (value: any) => mixed): this;\n    coerce(object: { [key: string]: (value: any) => mixed, ... }): this;\n    coerce(keys: Array<string>, fn: (value: any) => mixed): this;\n\n    command(\n      cmd: string | Array<string>,\n      desc: string | false,\n      builder?: { [key: string]: Options, ... } | ((yargsInstance: Yargs) => mixed),\n      handler?: Function\n    ): this;\n\n    command(\n      cmd: string | Array<string>,\n      desc: string | false,\n      module: ModuleObject\n    ): this;\n\n    command(module: ModuleObject): this;\n\n    commandDir(\n      directory: string,\n      options?: {\n        exclude?: string | Function,\n        extensions?: Array<string>,\n        include?: string | Function,\n        recurse?: boolean,\n        visit?: Function,\n        ...\n      },\n    ): this;\n\n    completion(\n      cmd?: string,\n      description?: string | false | (\n        current: string,\n        argv: Argv,\n        done: (compeltion: Array<string>) => void\n      ) => ?(Array<string> | Promise<Array<string>>),\n      fn?: (\n        current: string,\n        argv: Argv,\n        done: (completion: Array<string>) => void\n      ) => ?(Array<string> | Promise<Array<string>>)\n    ): this;\n\n    config(\n      key?: string,\n      description?: string,\n      parseFn?: (configPath: string) => { [key: string]: mixed, ... }\n    ): this;\n    config(\n      key: string,\n      parseFn?: (configPath: string) => { [key: string]: mixed, ... }\n    ): this;\n    config(config: { [key: string]: mixed, ... }): this;\n\n    conflicts(key: string, value: string | Array<string>): this;\n    conflicts(keys: { [key: string]: string | Array<string>, ... }): this;\n\n    count(name: string): this;\n\n    default(key: string, value: mixed, description?: string): this;\n    default(defaults: { [key: string]: mixed, ... }): this;\n\n    // Deprecated: use demandOption() and demandCommand() instead.\n    demand(key: string, msg?: string | boolean): this;\n    demand(count: number, max?: number, msg?: string | boolean): this;\n\n    demandOption(key: string | Array<string>, msg?: string | boolean): this;\n\n    demandCommand(): this;\n    demandCommand(min: number, minMsg?: string): this;\n    demandCommand(\n      min: number,\n      max: number,\n      minMsg?: string,\n      maxMsg?: string\n    ): this;\n\n    describe(key: string, description: string): this;\n    describe(describeObject: { [key: string]: string, ... }): this;\n\n    detectLocale(shouldDetect: boolean): this;\n\n    env(prefix?: string): this;\n\n    epilog(text: string): this;\n    epilogue(text: string): this;\n\n    example(cmd: string, desc?: string): this;\n\n    exitProcess(enable: boolean): this;\n\n    fail(fn: (failureMessage: string, err: Error, yargs: Yargs) => mixed): this;\n\n    getCompletion(args: Array<string>, fn: () => void): this;\n\n    global(globals: string | Array<string>, isGlobal?: boolean): this;\n\n    group(key: string | Array<string>, groupName: string): this;\n\n    help(option: boolean): this;\n\n    help(option?: string, desc?: string): this;\n\n    hide(key: string): this;\n\n    implies(key: string, value: string | Array<string>): this;\n    implies(keys: { [key: string]: string | Array<string>, ... }): this;\n\n    locale(\n      locale: | \"de\"\n      | \"en\"\n      | \"es\"\n      | \"fr\"\n      | \"hi\"\n      | \"hu\"\n      | \"id\"\n      | \"it\"\n      | \"ja\"\n      | \"ko\"\n      | \"nb\"\n      | \"pirate\"\n      | \"pl\"\n      | \"pt\"\n      | \"pt_BR\"\n      | \"ru\"\n      | \"th\"\n      | \"tr\"\n      | \"zh_CN\"\n    ): this;\n    locale(): string;\n\n    middleware(\n      middlewareCallbacks: Middleware,\n      applyBeforeValidation?: boolean,\n    ): this;\n\n    nargs(key: string, count: number): this;\n\n    normalize(key: string): this;\n\n    number(key: string | Array<string>): this;\n\n    onFinishCommand(handler: () => mixed): this;\n\n    option(key: string, options?: Options): this;\n    option(optionMap: { [key: string]: Options, ... }): this;\n\n    options(key: string, options?: Options): this;\n    options(optionMap: { [key: string]: Options, ... }): this;\n\n    parse(\n      args?: string | Array<string>,\n      context?: { [key: string]: any, ... },\n      parseCallback?: (err: Error, argv: Argv, output?: string) => void\n    ): Argv;\n    parse(\n      args?: string | Array<string>,\n      parseCallback?: (err: Error, argv: Argv, output?: string) => void\n    ): Argv;\n\n    parserConfiguration(configuration: {[key: string]: any, ...}): this;\n\n    pkgConf(key: string, cwd?: string): this;\n\n    positional(key: string, opt?: Options): this;\n\n    recommendCommands(): this;\n\n    // Alias of demand()\n    require(key: string, msg: string | boolean): this;\n    require(count: number, max?: number, msg?: string | boolean): this;\n\n    requiresArg(key: string | Array<string>): this;\n\n    reset(): this;\n\n    scriptName(name: string): this;\n\n    showCompletionScript(): this;\n\n    showHelp(consoleLevel?: \"error\" | \"warn\" | \"log\"): this;\n    showHelp(printCallback: (usageData: string) => void): this;\n\n    showHelpOnFail(enable: boolean, message?: string): this;\n\n    strict(): this;\n\n    skipValidation(key: string): this;\n\n    strict(global?: boolean): this;\n\n    string(key: string | Array<string>): this;\n\n    terminalWidth(): number;\n\n    updateLocale(obj: { [key: string]: string, ... }): this;\n    updateStrings(obj: { [key: string]: string, ... }): this;\n\n    usage(message: string, opts?: { [key: string]: Options, ... }): this;\n\n    version(): this;\n    version(version: string | false): this;\n    version(option: string | (() => string), version: string): this;\n    version(\n      option: string | (() => string),\n      description: string | (() => string),\n      version: string\n    ): this;\n\n    wrap(columns: number | null): this;\n  }\n\n  declare module.exports: Yargs;\n}\n"
  },
  {
    "path": "globals.js",
    "content": "/* @flow */\n/* eslint import/no-commonjs: off */\n\nconst postRobotGlobals = require(\"@krakenjs/post-robot/globals\");\n\nconst pkg = require(\"./package.json\");\n\nconst formatVersion = (version) => {\n  return version.replace(/[^\\d]+/g, \"_\");\n};\n\nmodule.exports = {\n  __POST_ROBOT__: {\n    ...postRobotGlobals.__POST_ROBOT__,\n    __AUTO_SETUP__: false,\n  },\n  __ZOID__: {\n    __VERSION__: `${formatVersion(pkg.version)}`,\n    __GLOBAL_KEY__: `__zoid_${formatVersion(pkg.version)}__`,\n    __IFRAME_SUPPORT__: true,\n    __POPUP_SUPPORT__: true,\n    __FRAMEWORK_SUPPORT__: false,\n    __DEFAULT_CONTAINER__: true,\n    __DEFAULT_PRERENDER__: true,\n    __SCRIPT_NAMESPACE__: false,\n  },\n};\n"
  },
  {
    "path": "index.js",
    "content": "/* @flow */\n/* eslint import/no-commonjs: 0, import/extensions: 0 */\n\n// eslint-disable-next-line no-process-env\nif (process && process.env && process.env.ZOID_FRAME_ONLY) {\n  // $FlowFixMe\n  module.exports = require(\"./dist/zoid.frame\");\n  // $FlowFixMe\n  module.exports.default = module.exports;\n} else {\n  // $FlowFixMe\n  module.exports = require(\"./dist/zoid\");\n  // $FlowFixMe\n  module.exports.default = module.exports;\n}\n"
  },
  {
    "path": "karma.conf.js",
    "content": "/* @flow */\n/* eslint import/no-default-export: off */\n\nimport { getKarmaConfig } from \"@krakenjs/karma-config-grumbler\";\n\nimport { WEBPACK_CONFIG_TEST } from \"./webpack.config\";\n\n// List libs that can be dynamically loaded\n// Those files should be available(served), but not included as default\nconst serveWithoutInclude = [\n  \"test/lib/angular-4.js\",\n  \"test/lib/angular-12/zone_v0.8.12.js\",\n  \"test/lib/angular-12/rxjs_v6.2.0.js\",\n  \"test/lib/angular-12/angular-12-core.js\",\n  \"test/lib/angular-12/angular-12-common.js\",\n  \"test/lib/angular-12/angular-12-compiler.js\",\n  \"test/lib/angular-12/angular-12-platform-browser.js\",\n  \"test/lib/angular-12/angular-12-platform-browser-dynamic.js\",\n  \"test/lib/vue_v2.5.16.runtime.min.js\",\n  \"test/lib/vue_v3.2.1.js\",\n].map((file) => ({\n  pattern: file,\n  included: false,\n  served: true,\n}));\n\nexport default function configKarma(karma: Object) {\n  const karmaConfig = getKarmaConfig(karma, {\n    basePath: __dirname,\n    webpack: WEBPACK_CONFIG_TEST,\n  });\n\n  karmaConfig.client.useIframe = false;\n\n  karma.set({\n    ...karmaConfig,\n\n    files: [\n      \"test/lib/react_v16.0.0.js\",\n      \"test/lib/react-dom_v16.0.0.js\",\n      \"test/lib/angular.min.js\",\n      {\n        pattern: \"test/zoid.global.js\",\n        included: true,\n        served: true,\n      },\n      ...serveWithoutInclude,\n      ...karmaConfig.files,\n    ],\n\n    preprocessors: {\n      ...karmaConfig.preprocessors,\n\n      \"src/index.js\": [\"webpack\", \"sourcemap\"],\n      \"src/**/*.js\": [\"sourcemap\"],\n    },\n  });\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"@krakenjs/zoid\",\n  \"version\": \"10.5.1\",\n  \"description\": \"Cross domain components.\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"setup\": \"npm install && npm run flow-typed\",\n    \"demo\": \"serve . -l 1337\",\n    \"lint\": \"eslint --ext .js --ext .jsx src/ test/ *.js\",\n    \"flow-typed\": \"rm -rf ./flow-typed && flow-typed install\",\n    \"flow\": \"flow\",\n    \"format\": \"prettier --write --ignore-unknown .\",\n    \"format:check\": \"prettier --check .\",\n    \"karma\": \"cross-env NODE_ENV=test babel-node --plugins=@babel/plugin-transform-modules-commonjs ./node_modules/.bin/karma start\",\n    \"babel\": \"babel src/ --out-dir dist/module\",\n    \"webpack\": \"babel-node --plugins=@babel/plugin-transform-modules-commonjs ./node_modules/.bin/webpack -- --progress\",\n    \"test\": \"npm run format:check && npm run lint && npm run flow && npm run karma\",\n    \"clear-dist\": \"rm -rf dist/*;\",\n    \"build\": \"npm run test && npm run babel && npm run clear-dist && npm run webpack -- $@\",\n    \"clean\": \"rimraf dist coverage\",\n    \"reinstall\": \"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install\",\n    \"debug\": \"cross-env NODE_ENV=debug\",\n    \"prepare\": \"husky install\",\n    \"prebuild:release\": \"npm run clean && npm run test && npm run build\",\n    \"prerelease\": \"npm run prebuild:release\",\n    \"release\": \"standard-version\",\n    \"postrelease\": \"git push && git push --follow-tags && npm publish\",\n    \"prerelease:alpha\": \"npm run prebuild:release\",\n    \"release:alpha\": \"standard-version --prerelease alpha\",\n    \"postrelease:alpha\": \"git push && git push --follow-tags && npm publish --tag alpha\"\n  },\n  \"standard-version\": {\n    \"types\": [\n      {\n        \"type\": \"feat\",\n        \"section\": \"Features\"\n      },\n      {\n        \"type\": \"fix\",\n        \"section\": \"Bug Fixes\"\n      },\n      {\n        \"type\": \"chore\",\n        \"hidden\": false\n      },\n      {\n        \"type\": \"docs\",\n        \"hidden\": false\n      },\n      {\n        \"type\": \"style\",\n        \"hidden\": false\n      },\n      {\n        \"type\": \"refactor\",\n        \"hidden\": false\n      },\n      {\n        \"type\": \"perf\",\n        \"hidden\": false\n      },\n      {\n        \"type\": \"test\",\n        \"hidden\": false\n      }\n    ]\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/krakenjs/zoid.git\"\n  },\n  \"keywords\": [\n    \"cross-domain\",\n    \"cross domain\",\n    \"components\",\n    \"component\",\n    \"krakenjs\",\n    \"kraken\"\n  ],\n  \"browserslist\": [\n    \"IE >= 11\",\n    \"chrome >= 41\",\n    \"firefox >= 43\",\n    \"safari >= 8\",\n    \"opera >= 23\"\n  ],\n  \"licenses\": [\n    {\n      \"type\": \"Apache 2.0\",\n      \"url\": \"http://www.apache.org/licenses/LICENSE-2.0.html\"\n    }\n  ],\n  \"files\": [\n    \"dist/\",\n    \"src/\",\n    \"globals.js\"\n  ],\n  \"readmeFilename\": \"README.md\",\n  \"devDependencies\": {\n    \"@commitlint/cli\": \"^16.2.1\",\n    \"@commitlint/config-conventional\": \"^16.2.1\",\n    \"@krakenjs/grumbler-scripts\": \"^8.0.4\",\n    \"@krakenjs/jsx-pragmatic\": \"^3.0.0\",\n    \"cross-env\": \"^7.0.3\",\n    \"flow-bin\": \"0.155.0\",\n    \"flow-typed\": \"^3.8.0\",\n    \"husky\": \"^7.0.4\",\n    \"jest\": \"^29.3.1\",\n    \"lint-staged\": \"^12.4.0\",\n    \"mocha\": \"^4\",\n    \"prettier\": \"^2.6.2\",\n    \"serve\": \"^10.0.0\",\n    \"standard-version\": \"^9.3.2\"\n  },\n  \"dependencies\": {\n    \"@krakenjs/belter\": \"^2.0.0\",\n    \"@krakenjs/cross-domain-utils\": \"^3.0.0\",\n    \"@krakenjs/post-robot\": \"^11.0.0\",\n    \"@krakenjs/zalgo-promise\": \"^2.0.0\"\n  },\n  \"lint-staged\": {\n    \"*\": \"prettier --write --ignore-unknown\"\n  }\n}\n"
  },
  {
    "path": "src/babel.config.js",
    "content": "/* @flow */\n\n// eslint-disable-next-line import/no-commonjs\nmodule.exports = {\n  extends: \"@krakenjs/babel-config-grumbler/babelrc-browser\",\n};\n"
  },
  {
    "path": "src/child/child.js",
    "content": "/* @flow */\n/* eslint max-lines: 0 */\n\nimport {\n  isSameDomain,\n  matchDomain,\n  getAllFramesInWindow,\n  type CrossDomainWindowType,\n  onCloseWindow,\n  assertSameDomain,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport {\n  markWindowKnown,\n  type CrossDomainFunctionType,\n} from \"@krakenjs/post-robot/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { extend, onResize, elementReady, noop } from \"@krakenjs/belter/src\";\n\nimport {\n  getGlobal,\n  tryGlobal,\n  getInitialParentPayload,\n  updateChildWindowNameWithRef,\n} from \"../lib\";\nimport { CONTEXT } from \"../constants\";\nimport type {\n  NormalizedComponentOptionsType,\n  getSiblingsPropType,\n} from \"../component\";\nimport type { PropsType, ChildPropsType } from \"../component/props\";\nimport type { StringMatcherType } from \"../types\";\n\nimport { normalizeChildProps } from \"./props\";\n\nexport type ChildExportsType<P> = {|\n  updateProps: CrossDomainFunctionType<[PropsType<P>], void>,\n  close: CrossDomainFunctionType<[], void>,\n  name: string,\n|};\n\nexport type ChildHelpers<P, X> = {|\n  uid: string,\n  tag: string,\n  close: () => ZalgoPromise<void>,\n  focus: () => ZalgoPromise<void>,\n  resize: ({| width: ?number, height: ?number |}) => ZalgoPromise<void>,\n  onError: (mixed) => ZalgoPromise<void>,\n  onProps: ((PropsType<P>) => void) => {| cancel: () => void |},\n  getParent: () => CrossDomainWindowType,\n  getParentDomain: () => string,\n  show: () => ZalgoPromise<void>,\n  hide: () => ZalgoPromise<void>,\n  export: (X) => ZalgoPromise<void>,\n  getSiblings: getSiblingsPropType,\n|};\n\nfunction checkParentDomain(\n  allowedParentDomains: StringMatcherType,\n  domain: string\n) {\n  if (!matchDomain(allowedParentDomains, domain)) {\n    throw new Error(`Can not be rendered by domain: ${domain}`);\n  }\n}\n\nfunction focus(): ZalgoPromise<void> {\n  return ZalgoPromise.try(() => {\n    window.focus();\n  });\n}\n\nfunction destroy(): ZalgoPromise<void> {\n  return ZalgoPromise.try(() => {\n    window.close();\n  });\n}\n\n// Compares the first numerical value of the parent and child versions of zoid,\n// ensuring that an error is only thrown when major versions of Zoid do not match.\n// Additionally, zoid version strings should be in snake_case format (10_1_0, 10_2_0, 11_0_0, etc.)\nfunction versionCompatabilityCheck(\n  version1: string,\n  version2: string\n): boolean {\n  if (!/_/.test(version1) || !/_/.test(version2)) {\n    throw new Error(\n      `Versions are in an invalid format (${version1}, ${version2})`\n    );\n  }\n\n  return version1.split(\"_\")[0] === version2.split(\"_\")[0];\n}\n\nexport type ChildComponent<P, X> = {|\n  getProps: () => ChildPropsType<P, X>,\n  init: () => ZalgoPromise<void>,\n|};\n\nexport function childComponent<P, X, C, ExtType>(\n  options: NormalizedComponentOptionsType<P, X, C, ExtType>\n): ChildComponent<P, X> {\n  const { tag, propsDef, autoResize, allowedParentDomains } = options;\n\n  const onPropHandlers = [];\n\n  const { parent, payload } = getInitialParentPayload();\n  const { win: parentComponentWindow, domain: parentDomain } = parent;\n\n  let props: ChildPropsType<P, X>;\n  const exportsPromise = new ZalgoPromise();\n\n  const {\n    version,\n    uid,\n    exports: parentExports,\n    context,\n    props: initialProps,\n  } = payload;\n\n  if (!versionCompatabilityCheck(version, __ZOID__.__VERSION__)) {\n    throw new Error(\n      `Parent window has zoid version ${version}, child window has version ${__ZOID__.__VERSION__}`\n    );\n  }\n\n  const {\n    show,\n    hide,\n    close,\n    onError,\n    checkClose,\n    export: parentExport,\n    resize: parentResize,\n    init: parentInit,\n  } = parentExports;\n\n  const getParent = () => parentComponentWindow;\n  const getParentDomain = () => parentDomain;\n\n  const onProps = (handler: Function) => {\n    onPropHandlers.push(handler);\n    return {\n      cancel: () => {\n        onPropHandlers.splice(onPropHandlers.indexOf(handler), 1);\n      },\n    };\n  };\n\n  const resize = ({\n    width,\n    height,\n  }: {|\n    width: ?number,\n    height: ?number,\n  |}): ZalgoPromise<void> => {\n    return parentResize.fireAndForget({ width, height });\n  };\n\n  const xport = (xports: X): ZalgoPromise<void> => {\n    exportsPromise.resolve(xports);\n    return parentExport(xports);\n  };\n\n  const getSiblings = ({ anyParent } = {}) => {\n    const result = [];\n    const currentParent = props.parent;\n\n    if (typeof anyParent === \"undefined\") {\n      anyParent = !currentParent;\n    }\n\n    if (!anyParent && !currentParent) {\n      throw new Error(`No parent found for ${tag} child`);\n    }\n\n    for (const win of getAllFramesInWindow(window)) {\n      if (!isSameDomain(win)) {\n        continue;\n      }\n\n      const xprops: ChildPropsType<mixed, mixed> = assertSameDomain(win).xprops;\n\n      if (!xprops || getParent() !== xprops.getParent()) {\n        continue;\n      }\n\n      const winParent = xprops.parent;\n\n      if (!anyParent && currentParent) {\n        if (!winParent || winParent.uid !== currentParent.uid) {\n          continue;\n        }\n      }\n\n      const xports = tryGlobal(win, (global) => global.exports);\n\n      result.push({\n        props: xprops,\n        exports: xports,\n      });\n    }\n\n    return result;\n  };\n\n  const getHelpers = (): ChildHelpers<P, X> => {\n    return {\n      tag,\n      show,\n      hide,\n      close,\n      focus,\n      onError,\n      resize,\n      getSiblings,\n      onProps,\n      getParent,\n      getParentDomain,\n      uid,\n      export: xport,\n    };\n  };\n\n  const watchForClose = () => {\n    window.addEventListener(\"beforeunload\", () => {\n      checkClose.fireAndForget();\n    });\n\n    if (\"onpagehide\" in window) {\n      window.addEventListener(\"pagehide\", () => {\n        checkClose.fireAndForget();\n      });\n    } else {\n      window.addEventListener(\"unload\", () => {\n        checkClose.fireAndForget();\n      });\n    }\n\n    onCloseWindow(parentComponentWindow, () => {\n      destroy();\n    });\n  };\n\n  const setProps = (\n    newProps: PropsType<P>,\n    origin: string,\n    isUpdate: boolean = false\n  ) => {\n    const helpers = getHelpers();\n    const normalizedProps = normalizeChildProps(\n      parentComponentWindow,\n      propsDef,\n      newProps,\n      origin,\n      helpers,\n      isUpdate\n    );\n\n    if (props) {\n      extend(props, normalizedProps);\n    } else {\n      props = normalizedProps;\n    }\n\n    for (const handler of onPropHandlers) {\n      handler(props);\n    }\n  };\n\n  const getAutoResize = (): ZalgoPromise<{|\n    width: boolean,\n    height: boolean,\n    element: ?HTMLElement,\n  |}> => {\n    const {\n      width = false,\n      height = false,\n      element: elementRef = \"body\",\n    } = autoResize;\n    return elementReady(elementRef)\n      .catch(noop)\n      .then((element) => {\n        return { width, height, element };\n      });\n  };\n\n  const watchForResize = (): ?ZalgoPromise<void> => {\n    return getAutoResize().then(({ width, height, element }) => {\n      if (!element || (!width && !height) || context === CONTEXT.POPUP) {\n        return;\n      }\n\n      onResize(\n        element,\n        ({ width: newWidth, height: newHeight }) => {\n          resize({\n            width: width ? newWidth : undefined,\n            height: height ? newHeight : undefined,\n          });\n        },\n        { width, height }\n      );\n    });\n  };\n\n  const updateProps = (newProps: PropsType<P>): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => setProps(newProps, parentDomain, true));\n  };\n\n  const init = () => {\n    return ZalgoPromise.try(() => {\n      let updatedChildName = \"\";\n      if (isSameDomain(parentComponentWindow)) {\n        updatedChildName =\n          updateChildWindowNameWithRef({\n            componentName: options.name,\n            parentComponentWindow,\n          }) || \"\";\n      }\n\n      getGlobal(window).exports = options.exports({\n        getExports: () => exportsPromise,\n      });\n\n      checkParentDomain(allowedParentDomains, parentDomain);\n      markWindowKnown(parentComponentWindow);\n      watchForClose();\n\n      return parentInit({\n        name: updatedChildName,\n        updateProps,\n        close: destroy,\n      });\n    })\n      .then(() => {\n        return watchForResize();\n      })\n      .catch((err) => {\n        onError(err);\n      });\n  };\n\n  const getProps = () => {\n    if (props) {\n      return props;\n    } else {\n      setProps(initialProps, parentDomain);\n      return props;\n    }\n  };\n\n  return {\n    init,\n    getProps,\n  };\n}\n"
  },
  {
    "path": "src/child/index.js",
    "content": "/* @flow */\n\nexport * from \"./child\";\n"
  },
  {
    "path": "src/child/props.js",
    "content": "/* @flow */\n\nimport {\n  getDomain,\n  isSameDomain,\n  matchDomain,\n  type CrossDomainWindowType,\n} from \"@krakenjs/cross-domain-utils/src\";\n\nimport type {\n  PropsDefinitionType,\n  PropsType,\n  ChildPropsType,\n} from \"../component/props\";\n\nimport type { ChildHelpers } from \"./index\";\n\nexport function normalizeChildProp<P, T, X>(\n  // $FlowFixMe\n  propsDef: PropsDefinitionType<P, X>,\n  props: PropsType<P>,\n  key: string,\n  value: ?T,\n  helpers: ChildHelpers<P, X>\n): ?T {\n  if (!propsDef.hasOwnProperty(key)) {\n    return value;\n  }\n\n  const prop = propsDef[key];\n\n  if (typeof prop.childDecorate === \"function\") {\n    const {\n      uid,\n      tag,\n      close,\n      focus,\n      onError,\n      onProps,\n      resize,\n      getParent,\n      getParentDomain,\n      show,\n      hide,\n      export: xport,\n      getSiblings,\n    } = helpers;\n    const decoratedValue = prop.childDecorate({\n      value,\n      uid,\n      tag,\n      close,\n      focus,\n      onError,\n      onProps,\n      resize,\n      getParent,\n      getParentDomain,\n      show,\n      hide,\n      export: xport,\n      getSiblings,\n    });\n\n    // $FlowFixMe\n    return decoratedValue;\n  }\n\n  return value;\n}\n\n// eslint-disable-next-line max-params\nexport function normalizeChildProps<P, X>(\n  parentComponentWindow: CrossDomainWindowType,\n  propsDef: PropsDefinitionType<P, X>,\n  props: PropsType<P>,\n  origin: string,\n  helpers: ChildHelpers<P, X>,\n  isUpdate: boolean = false\n): ChildPropsType<P, X> {\n  const result = {};\n\n  for (const key of Object.keys(props)) {\n    const prop = propsDef[key];\n\n    const trustedChild: boolean =\n      prop && prop.trustedDomains && prop.trustedDomains.length > 0\n        ? prop.trustedDomains.reduce((acc, val) => {\n            return acc || matchDomain(val, getDomain(window));\n          }, false)\n        : origin === getDomain(window) || isSameDomain(parentComponentWindow);\n\n    // let trustedDomains override sameDomain prop\n    if (prop && prop.sameDomain && !trustedChild) {\n      continue;\n    }\n\n    // sameDomain was not set and trusted domains must match\n    if (prop && prop.trustedDomains && !trustedChild) {\n      continue;\n    }\n\n    // $FlowFixMe\n    const value = normalizeChildProp(propsDef, props, key, props[key], helpers);\n\n    result[key] = value;\n    if (prop && prop.alias && !result[prop.alias]) {\n      result[prop.alias] = value;\n    }\n  }\n\n  if (!isUpdate) {\n    for (const key of Object.keys(propsDef)) {\n      if (!props.hasOwnProperty(key)) {\n        result[key] = normalizeChildProp(\n          propsDef,\n          props,\n          key,\n          undefined,\n          helpers\n        );\n      }\n    }\n  }\n\n  // $FlowFixMe\n  return result;\n}\n"
  },
  {
    "path": "src/component/component.js",
    "content": "/* @flow */\n/* eslint max-lines: 0 */\n\nimport {\n  setup as setupPostRobot,\n  on,\n  send,\n  bridge,\n  toProxyWindow,\n  destroy as destroyPostRobot,\n} from \"@krakenjs/post-robot/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport {\n  isWindow,\n  getDomain,\n  matchDomain,\n  type CrossDomainWindowType,\n  type DomainMatcher,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport {\n  noop,\n  isElement,\n  cleanup,\n  memoize,\n  identity,\n  extend,\n  uniqueID,\n} from \"@krakenjs/belter/src\";\n\nimport { childComponent, type ChildComponent } from \"../child\";\nimport {\n  type ParentComponent,\n  type RenderOptionsType,\n  type ParentHelpers,\n  parentComponent,\n} from \"../parent/parent\";\nimport {\n  ZOID,\n  CONTEXT,\n  POST_MESSAGE,\n  WILDCARD,\n  METHOD,\n  PROP_TYPE,\n} from \"../constants\";\nimport { react, angular, vue, vue3, angular2 } from \"../drivers\";\nimport {\n  getGlobal,\n  destroyGlobal,\n  getInitialParentPayload,\n  isChildComponentWindow,\n} from \"../lib\";\nimport type {\n  CssDimensionsType,\n  StringMatcherType,\n  ContainerReferenceType,\n} from \"../types\";\n\nimport { validateOptions } from \"./validate\";\nimport {\n  defaultContainerTemplate,\n  defaultPrerenderTemplate,\n} from \"./templates\";\nimport {\n  getBuiltInProps,\n  type UserPropsDefinitionType,\n  type PropsDefinitionType,\n  type PropsInputType,\n  type PropsType,\n  type ParentPropType,\n  type exportPropType,\n  type DEFINITION_TYPE,\n} from \"./props\";\n\ntype LoggerPayload = { [string]: ?string | ?boolean };\n\n// eslint-disable-next-line flowtype/require-exact-type\ntype Logger = {\n  info: (event: string, payload?: LoggerPayload) => any, // eslint-disable-line flowtype/no-weak-types\n};\n\n/*  Component\n    ---------\n\n    This is the spec for the component. The idea is, when I call zoid.create(), it will create a new instance\n    of Component with the blueprint needed to set up ParentComponents and ChildComponents.\n\n    This is the one portion of code which is required by -- and shared to -- both the parent and child windows, and\n    contains all of the configuration needed for them to set themselves up.\n*/\n\ntype Attributes = {|\n  iframe?: { [string]: string },\n  popup?: { [string]: string },\n|};\n\nexport type ExportsConfigDefinition = {|\n  [string]: {|\n    type: DEFINITION_TYPE,\n  |},\n|};\n\nexport type ExportsMapperDefinition<X> = ({|\n  getExports: () => ZalgoPromise<X>,\n|}) => X;\n\nexport type ExportsDefinition<X> =\n  | ExportsConfigDefinition\n  | ExportsMapperDefinition<X>;\n\nexport type ComponentOptionsType<P, X, C, ExtType> = {|\n  tag: string,\n\n  getExtensions?: (parent: ParentComponent<P, X>) => ExtType,\n  url: string | (({| props: PropsType<P> |}) => string),\n  domain?: DomainMatcher,\n  bridgeUrl?: string,\n  method?: $Values<typeof METHOD>,\n\n  props?: UserPropsDefinitionType<P, X>,\n\n  dimensions?:\n    | CssDimensionsType\n    | (({| props: PropsType<P> |}) => CssDimensionsType),\n  autoResize?: {| width?: boolean, height?: boolean, element?: string |},\n\n  allowedParentDomains?: StringMatcherType,\n\n  attributes?: Attributes | (({| props: PropsType<P> |}) => Attributes),\n\n  eligible?: ({| props: PropsInputType<P> |}) => {|\n    eligible: boolean,\n    reason?: string,\n  |},\n\n  defaultContext?: $Values<typeof CONTEXT>,\n\n  containerTemplate?: (RenderOptionsType<P>) => ?HTMLElement,\n  prerenderTemplate?: (RenderOptionsType<P>) => ?HTMLElement,\n\n  validate?: ({| props: PropsInputType<P> |}) => void,\n\n  logger?: Logger,\n\n  children?: () => C,\n\n  exports?: ExportsDefinition<X>,\n|};\n\nexport type AttributesType = {|\n  iframe?: { [string]: string },\n  popup?: { [string]: string },\n|};\n\ntype AutoResizeType = {|\n  width?: boolean,\n  height?: boolean,\n  element?: string,\n|};\n\nexport type NormalizedComponentOptionsType<P, X, C, ExtType> = {|\n  tag: string,\n  name: string,\n\n  getExtensions: (parent: ParentComponent<P, X>) => ExtType,\n  url: string | (({| props: PropsType<P> |}) => string),\n  domain: ?DomainMatcher,\n  bridgeUrl: ?string,\n  method: ?$Values<typeof METHOD>,\n\n  propsDef: PropsDefinitionType<P, X>,\n  dimensions:\n    | CssDimensionsType\n    | (({| props: PropsType<P> |}) => CssDimensionsType),\n  autoResize: AutoResizeType,\n\n  allowedParentDomains: StringMatcherType,\n\n  attributes: AttributesType | (({| props: PropsType<P> |}) => AttributesType),\n\n  eligible: ({| props: PropsInputType<P> |}) => {|\n    eligible: boolean,\n    reason?: string,\n  |},\n\n  defaultContext: $Values<typeof CONTEXT>,\n\n  containerTemplate: (RenderOptionsType<P>) => ?HTMLElement,\n  prerenderTemplate: ?(RenderOptionsType<P>) => ?HTMLElement,\n\n  validate: ?({| props: PropsInputType<P> |}) => void,\n  logger: Logger,\n\n  children: () => C,\n\n  exports: ExportsMapperDefinition<X>,\n|};\n\nexport type ZoidComponentInstance<P, X = void, C = void, ExtType = void> = {|\n  ...ExtType,\n  ...ParentHelpers<P>,\n  ...X,\n  ...C,\n  isEligible: () => boolean,\n  clone: () => ZoidComponentInstance<P, X, C, ExtType>,\n  render: (\n    container?: ContainerReferenceType,\n    context?: $Values<typeof CONTEXT>\n  ) => ZalgoPromise<void>,\n  renderTo: (\n    target: CrossDomainWindowType,\n    container?: ContainerReferenceType,\n    context?: $Values<typeof CONTEXT>\n  ) => ZalgoPromise<void>,\n|};\n\n// eslint-disable-next-line flowtype/require-exact-type\nexport type ZoidComponent<P, X = void, C = void, ExtType = void> = {\n  (props?: PropsInputType<P> | void): ZoidComponentInstance<P, X, C, ExtType>,\n  // eslint-disable-next-line no-undef\n  driver: <T>(string, mixed) => T,\n  isChild: () => boolean,\n  xprops?: PropsType<P>,\n  canRenderTo: (CrossDomainWindowType) => ZalgoPromise<boolean>,\n  instances: $ReadOnlyArray<ZoidComponentInstance<P, X, C, ExtType>>,\n};\n\nconst getDefaultAttributes = (): AttributesType => {\n  // $FlowFixMe\n  return {};\n};\n\nconst getDefaultAutoResize = (): AutoResizeType => {\n  // $FlowFixMe\n  return {};\n};\n\nconst getDefaultExports = <X>(): (() => X) => {\n  // $FlowFixMe\n  return noop;\n};\n\nconst getDefaultDimensions = (): CssDimensionsType => {\n  // $FlowFixMe\n  return {};\n};\n\nfunction getDefaultGetExtensions<P, X, ExtType>(): (\n  parent: ParentComponent<P, X>\n) => ExtType {\n  return function getExtensions(): ExtType {\n    // $FlowFixMe\n    const ext: ExtType = {};\n    return ext;\n  };\n}\n\nfunction normalizeOptions<P, X, C, ExtType>(\n  options: ComponentOptionsType<P, X, C, ExtType>\n): NormalizedComponentOptionsType<P, X, C, ExtType> {\n  const {\n    tag,\n    url,\n    domain,\n    bridgeUrl,\n    props = {},\n    getExtensions = getDefaultGetExtensions<P, X, ExtType>(),\n    dimensions = getDefaultDimensions(),\n    autoResize = getDefaultAutoResize(),\n    allowedParentDomains = WILDCARD,\n    attributes = getDefaultAttributes(),\n    defaultContext = CONTEXT.IFRAME,\n    containerTemplate = __ZOID__.__DEFAULT_CONTAINER__\n      ? defaultContainerTemplate\n      : null,\n    prerenderTemplate = __ZOID__.__DEFAULT_PRERENDER__\n      ? defaultPrerenderTemplate\n      : null,\n    validate,\n    eligible = () => ({ eligible: true }),\n    logger = { info: noop },\n    exports: xportsDefinition = getDefaultExports(),\n    method,\n    children = (): C => {\n      // $FlowFixMe\n      return {};\n    },\n  } = options;\n\n  const name = tag.replace(/-/g, \"_\");\n\n  // $FlowFixMe[incompatible-type]\n  // $FlowFixMe[cannot-spread-inexact]\n  const propsDef: PropsDefinitionType<P, X> = {\n    ...getBuiltInProps(),\n    ...props,\n  };\n\n  if (!containerTemplate) {\n    throw new Error(`Container template required`);\n  }\n\n  const xports =\n    typeof xportsDefinition === \"function\"\n      ? xportsDefinition\n      : ({ getExports }): X => {\n          const result = {};\n\n          for (const key of Object.keys(xportsDefinition)) {\n            const { type } = xportsDefinition[key];\n            const valuePromise = getExports().then((res) => {\n              // $FlowFixMe\n              return res[key];\n            });\n\n            if (type === PROP_TYPE.FUNCTION) {\n              result[key] = (...args) =>\n                valuePromise.then((value) => value(...args));\n            } else {\n              result[key] = valuePromise;\n            }\n          }\n\n          // $FlowFixMe\n          return result;\n        };\n\n  return {\n    name,\n    tag,\n    url,\n    domain,\n    bridgeUrl,\n    method,\n    propsDef,\n    dimensions,\n    autoResize,\n    allowedParentDomains,\n    attributes,\n    defaultContext,\n    containerTemplate,\n    prerenderTemplate,\n    validate,\n    logger,\n    eligible,\n    children,\n    exports: xports,\n    getExtensions,\n  };\n}\n\nlet cleanInstances = cleanup();\nconst cleanZoid = cleanup();\n\nexport type Component<P, X, C, ExtType> = {|\n  init: (\n    props?: PropsInputType<P> | void\n  ) => ZoidComponentInstance<P, X, C, ExtType>,\n  instances: $ReadOnlyArray<ZoidComponentInstance<P, X, C, ExtType>>,\n  driver: (string, mixed) => mixed,\n  isChild: () => boolean,\n  canRenderTo: (CrossDomainWindowType) => ZalgoPromise<boolean>,\n  registerChild: () => ?ChildComponent<P, X>,\n|};\n\nexport function component<P, X, C, ExtType>(\n  opts: ComponentOptionsType<P, X, C, ExtType>\n): Component<P, X, C, ExtType> {\n  if (__DEBUG__) {\n    validateOptions(opts);\n  }\n\n  const options = normalizeOptions(opts);\n\n  const {\n    name,\n    tag,\n    defaultContext,\n    propsDef,\n    eligible,\n    children,\n    getExtensions,\n  } = options;\n\n  const global = getGlobal(window);\n  const driverCache = {};\n  const instances = [];\n\n  const isChild = (): boolean => {\n    if (isChildComponentWindow(name)) {\n      const { payload } = getInitialParentPayload();\n      if (\n        payload.tag === tag &&\n        matchDomain(payload.childDomainMatch, getDomain())\n      ) {\n        return true;\n      }\n    }\n\n    return false;\n  };\n\n  const registerChild = memoize((): ?ChildComponent<P, X> => {\n    if (isChild()) {\n      if (window.xprops) {\n        delete global.components[tag];\n        throw new Error(\n          `Can not register ${name} as child - child already registered`\n        );\n      }\n\n      const child = childComponent(options);\n      child.init();\n      return child;\n    }\n  });\n\n  const listenForDelegate = () => {\n    const allowDelegateListener = on(\n      `${POST_MESSAGE.ALLOW_DELEGATE}_${name}`,\n      () => {\n        return true;\n      }\n    );\n\n    const delegateListener = on(\n      `${POST_MESSAGE.DELEGATE}_${name}`,\n      ({ source, data: { uid, overrides } }) => {\n        return {\n          parent: parentComponent({\n            uid,\n            options,\n            overrides,\n            parentWin: source,\n          }),\n        };\n      }\n    );\n\n    cleanZoid.register(allowDelegateListener.cancel);\n    cleanZoid.register(delegateListener.cancel);\n  };\n\n  const canRenderTo = (win: CrossDomainWindowType): ZalgoPromise<boolean> => {\n    return send(win, `${POST_MESSAGE.ALLOW_DELEGATE}_${name}`)\n      .then(({ data }) => {\n        return data;\n      })\n      .catch(() => {\n        return false;\n      });\n  };\n\n  const getDefaultContainer = (\n    context: $Values<typeof CONTEXT>,\n    container?: ContainerReferenceType\n  ): ContainerReferenceType => {\n    if (container) {\n      if (typeof container !== \"string\" && !isElement(container)) {\n        throw new TypeError(`Expected string or element selector to be passed`);\n      }\n\n      return container;\n    }\n\n    if (context === CONTEXT.POPUP) {\n      return \"body\";\n    }\n\n    throw new Error(`Expected element to be passed to render iframe`);\n  };\n\n  const getDefaultContext = (\n    props: PropsInputType<P>,\n    context: ?$Values<typeof CONTEXT>\n  ): ZalgoPromise<$Values<typeof CONTEXT>> => {\n    return ZalgoPromise.try(() => {\n      if (props.window) {\n        return toProxyWindow(props.window).getType();\n      }\n\n      if (context) {\n        if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) {\n          throw new Error(`Unrecognized context: ${context}`);\n        }\n\n        return context;\n      }\n\n      return defaultContext;\n    });\n  };\n\n  const getDefaultInputProps = (): PropsInputType<P> => {\n    // $FlowFixMe\n    return {};\n  };\n\n  const init = (\n    inputProps?: PropsInputType<P> | void\n  ): ZoidComponentInstance<P, X, C, ExtType> => {\n    // eslint-disable-next-line prefer-const\n    let instance;\n\n    const uid = `${ZOID}-${tag}-${uniqueID()}`;\n    const props = inputProps || getDefaultInputProps();\n\n    const { eligible: eligibility, reason } = eligible({ props });\n    const isEligible = () => eligibility;\n\n    const onDestroy = props.onDestroy;\n    props.onDestroy = (...args) => {\n      if (instance && eligibility) {\n        instances.splice(instances.indexOf(instance), 1);\n      }\n\n      if (onDestroy) {\n        return onDestroy(...args);\n      }\n    };\n\n    const parent = parentComponent({\n      uid,\n      options,\n    });\n\n    parent.init();\n\n    if (eligibility) {\n      parent.setProps(props);\n    } else {\n      if (props.onDestroy) {\n        props.onDestroy();\n      }\n    }\n\n    cleanInstances.register((err) => {\n      return parent.destroy(err || new Error(`zoid destroyed all components`));\n    });\n\n    const clone = ({ decorate = identity } = {}) => {\n      return init(decorate(props));\n    };\n\n    const getChildren = (): C => {\n      // $FlowFixMe\n      const childComponents: {| [string]: ZoidComponent<mixed> |} = children();\n      const result = {};\n\n      for (const childName of Object.keys(childComponents)) {\n        const Child: ZoidComponent<mixed> = childComponents[childName];\n\n        result[childName] = (childInputProps) => {\n          const parentProps: PropsType<P> = parent.getProps();\n          const parentExport: exportPropType<X> = parent.export;\n\n          const childParent: ParentPropType<P, X> = {\n            uid,\n            props: parentProps,\n            export: parentExport,\n          };\n\n          const childProps: PropsInputType<mixed> = {\n            ...childInputProps,\n            parent: childParent,\n          };\n\n          return Child(childProps);\n        };\n      }\n\n      // $FlowFixMe\n      return result;\n    };\n\n    const render = (target, container, context) => {\n      return ZalgoPromise.try(() => {\n        if (!eligibility) {\n          const err = new Error(reason || `${name} component is not eligible`);\n\n          return parent.destroy(err).then(() => {\n            throw err;\n          });\n        }\n\n        if (!isWindow(target)) {\n          throw new Error(`Must pass window to renderTo`);\n        }\n\n        return getDefaultContext(props, context);\n      })\n        .then((finalContext) => {\n          container = getDefaultContainer(finalContext, container);\n\n          if (target !== window && typeof container !== \"string\") {\n            throw new Error(\n              `Must pass string element when rendering to another window`\n            );\n          }\n\n          return parent.render({\n            target,\n            container,\n            context: finalContext,\n            rerender: () => {\n              const newInstance = clone();\n              extend(instance, newInstance);\n              return newInstance.renderTo(target, container, context);\n            },\n          });\n        })\n        .catch((err) => {\n          return parent.destroy(err).then(() => {\n            throw err;\n          });\n        });\n    };\n\n    instance = {\n      ...getExtensions(parent),\n      ...parent.getExports(),\n      ...parent.getHelpers(),\n      ...getChildren(),\n      isEligible,\n      clone,\n      render: (container, context) => render(window, container, context),\n      renderTo: (target, container, context) =>\n        render(target, container, context),\n    };\n\n    if (eligibility) {\n      instances.push(instance);\n    }\n\n    return instance;\n  };\n\n  const driver = (driverName: string, dep: mixed): mixed => {\n    if (__ZOID__.__FRAMEWORK_SUPPORT__) {\n      const drivers = { react, angular, vue, vue3, angular2 };\n\n      if (!drivers[driverName]) {\n        throw new Error(`Could not find driver for framework: ${driverName}`);\n      }\n\n      if (!driverCache[driverName]) {\n        driverCache[driverName] = drivers[driverName].register(\n          tag,\n          propsDef,\n          init,\n          dep\n        );\n      }\n\n      return driverCache[driverName];\n    } else {\n      throw new Error(`Driver support not enabled`);\n    }\n  };\n\n  registerChild();\n  listenForDelegate();\n\n  global.components = global.components || {};\n  if (global.components[tag]) {\n    throw new Error(\n      `Can not register multiple components with the same tag: ${tag}`\n    );\n  }\n  global.components[tag] = true;\n\n  return {\n    init,\n    instances,\n    driver,\n    isChild,\n    canRenderTo,\n    registerChild,\n  };\n}\n\nexport type ComponentDriverType<P, L, D, X, C> = {|\n  register: (\n    string,\n    PropsDefinitionType<P, X>,\n    (PropsInputType<P>) => ZoidComponentInstance<P, X, C>,\n    L\n  ) => D,\n|};\n\nexport type ZoidProps<P> = PropsType<P>;\n\n// eslint-disable-next-line no-undef\nexport type CreateZoidComponent = <P, X, C, ExtType>(\n  // eslint-disable-next-line no-undef\n  options: ComponentOptionsType<P, X, C, ExtType>\n  // eslint-disable-next-line no-undef\n) => ZoidComponent<P, X, C, ExtType>;\n\nexport const create: CreateZoidComponent = <P, X, C, ExtType>(\n  options: ComponentOptionsType<P, X, C, ExtType>\n): ZoidComponent<P, X, C, ExtType> => {\n  setupPostRobot();\n\n  const comp = component(options);\n\n  const init = (props?: PropsInputType<P> | void) => comp.init(props);\n  init.driver = (name, dep) => comp.driver(name, dep);\n  init.isChild = () => comp.isChild();\n  init.canRenderTo = (win) => comp.canRenderTo(win);\n  init.instances = comp.instances;\n\n  const child = comp.registerChild();\n  if (child) {\n    window.xprops = init.xprops = child.getProps();\n  }\n\n  return init;\n};\n\nexport function destroyComponents(err?: mixed): ZalgoPromise<void> {\n  if (bridge) {\n    bridge.destroyBridges();\n  }\n\n  const destroyPromise = cleanInstances.all(err);\n  cleanInstances = cleanup();\n  return destroyPromise;\n}\n\nexport const destroyAll = destroyComponents;\n\nexport function destroy(err?: mixed): ZalgoPromise<void> {\n  destroyAll();\n  destroyGlobal();\n  destroyPostRobot();\n  return cleanZoid.all(err);\n}\n"
  },
  {
    "path": "src/component/index.js",
    "content": "/* @flow */\n\nexport * from \"./component\";\nexport * from \"./props\";\n"
  },
  {
    "path": "src/component/props.js",
    "content": "/* @flow */\n/* eslint max-lines: off */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { once, noop, type EventEmitterType } from \"@krakenjs/belter/src\";\nimport {\n  isWindow,\n  type CrossDomainWindowType,\n  type DomainMatcher,\n  isWindowClosed,\n  isSameDomain,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport { ProxyWindow, toProxyWindow } from \"@krakenjs/post-robot/src\";\n\nimport type { CssDimensionsType } from \"../types\";\nimport { PROP_SERIALIZATION, PROP_TYPE } from \"../constants\";\n\nexport type EventHandlerType<T> = (T) => void | ZalgoPromise<void>;\nexport type Sibling = {|\n  props: mixed,\n  exports: mixed,\n|};\n\nexport type timeoutPropType = number;\nexport type windowPropType = CrossDomainWindowType | ProxyWindow;\nexport type cspNoncePropType = string;\nexport type uidPropType = string;\nexport type tagPropType = string;\nexport type closePropType = () => ZalgoPromise<void>;\nexport type focusPropType = () => ZalgoPromise<void>;\nexport type showPropType = () => ZalgoPromise<void>;\nexport type exportPropType<X> = (X) => ZalgoPromise<void>;\nexport type getSiblingsPropType = (opts?: {|\n  anyParent?: boolean,\n|}) => $ReadOnlyArray<Sibling>;\nexport type hidePropType = () => ZalgoPromise<void>;\nexport type resizePropType = ({|\n  width: ?number,\n  height: ?number,\n|}) => ZalgoPromise<void>;\nexport type getParentPropType = () => CrossDomainWindowType;\nexport type getParentDomainPropType = () => string;\n\nexport type onDisplayPropType = EventHandlerType<void>;\nexport type onRenderedPropType = EventHandlerType<void>;\nexport type onRenderPropType = EventHandlerType<void>;\nexport type onPrerenderedPropType = EventHandlerType<void>;\nexport type onPrerenderPropType = EventHandlerType<void>;\nexport type onClosePropType = EventHandlerType<void>;\nexport type onDestroyPropType = EventHandlerType<void>;\nexport type onResizePropType = EventHandlerType<void>;\nexport type onFocusPropType = EventHandlerType<void>;\nexport type onBfcacheCachePropType = EventHandlerType<void>;\nexport type onBfcacheRestorePropType = EventHandlerType<{|\n  cachedDurationMs: ?number,\n|}>;\nexport type onErrorPropType = EventHandlerType<mixed>;\n// eslint-disable-next-line no-use-before-define\nexport type onPropsPropType<P> = ((PropsType<P>) => void) => {|\n  cancel: () => void,\n|};\n\nexport type ParentPropType<P, X> = {|\n  uid: string,\n  // eslint-disable-next-line no-use-before-define\n  props: PropsType<P>,\n  export: exportPropType<X>,\n|};\n\nexport type PropsInputType<P> = {|\n  parent?: ParentPropType<mixed, mixed>,\n\n  timeout?: timeoutPropType,\n  window?: windowPropType,\n  cspNonce?: ?cspNoncePropType,\n\n  onDisplay?: onDisplayPropType,\n  onRendered?: onRenderedPropType,\n  onRender?: onRenderPropType,\n  onPrerendered?: onPrerenderedPropType,\n  onPrerender?: onPrerenderPropType,\n  onClose?: onClosePropType,\n  onDestroy?: onDestroyPropType,\n  onResize?: onResizePropType,\n  onFocus?: onFocusPropType,\n  onBfcacheCache?: onBfcacheCachePropType,\n  onBfcacheRestore?: onBfcacheRestorePropType,\n  onError?: onErrorPropType,\n  onProps?: onPropsPropType<P>,\n\n  ...P,\n|};\n\nexport type PropsType<P> = {|\n  timeout?: timeoutPropType,\n  window?: ?windowPropType,\n  cspNonce?: ?cspNoncePropType,\n  dimensions: CssDimensionsType,\n\n  onDisplay: onDisplayPropType,\n  onRendered: onRenderedPropType,\n  onRender: onRenderPropType,\n  onPrerendered: onPrerenderedPropType,\n  onPrerender: onPrerenderPropType,\n  onClose: onClosePropType,\n  onDestroy: onDestroyPropType,\n  onResize: onResizePropType,\n  onFocus: onFocusPropType,\n  onError: onErrorPropType,\n  onBfcacheCache: EventHandlerType<void>,\n  onBfcacheRestore: EventHandlerType<{| cachedDurationMs: ?number |}>,\n  onProps: onPropsPropType<P>,\n\n  ...P,\n|};\n\ntype onErrorChildPropType = (mixed) => ZalgoPromise<void>;\n\nexport type ChildPropsType<P, X> = {|\n  ...PropsType<P>,\n\n  parent?: ParentPropType<mixed, mixed>,\n  uid: uidPropType,\n  tag: tagPropType,\n  close: closePropType,\n  focus: focusPropType,\n  show: showPropType,\n  hide: hidePropType,\n  export: exportPropType<X>,\n  getParent: getParentPropType,\n  getParentDomain: getParentDomainPropType,\n  resize: resizePropType,\n  onError: onErrorChildPropType,\n  onProps: onPropsPropType<P>,\n  getSiblings: getSiblingsPropType,\n|};\n\nexport type PropDefinitionType<T, P, S: $Values<typeof PROP_TYPE>, X> = {|\n  type: S,\n  alias?: string,\n  value?: ({|\n    props: P,\n    state: Object,\n    close: () => ZalgoPromise<void>,\n    focus: () => ZalgoPromise<void>,\n    onError: (mixed) => ZalgoPromise<void>,\n    container: HTMLElement | void,\n    event: EventEmitterType,\n  |}) => ?T,\n  default?: ({|\n    props: P,\n    state: Object,\n    close: () => ZalgoPromise<void>,\n    focus: () => ZalgoPromise<void>,\n    onError: (mixed) => ZalgoPromise<void>,\n    container: HTMLElement | void,\n    event: EventEmitterType,\n  |}) => ?T,\n  decorate?: ({|\n    value: T,\n    props: PropsType<P>,\n    state: Object,\n    close: () => ZalgoPromise<void>,\n    focus: () => ZalgoPromise<void>,\n    onError: (mixed) => ZalgoPromise<void>,\n    container: HTMLElement | void,\n    event: EventEmitterType,\n  |}) => T,\n  childDecorate?: ({|\n    value: ?T,\n    uid: uidPropType,\n    tag: tagPropType,\n    close: closePropType,\n    focus: focusPropType,\n    onError: onErrorPropType,\n    onProps: onPropsPropType<P>,\n    resize: resizePropType,\n    getParentDomain: getParentDomainPropType,\n    getParent: getParentPropType,\n    show: showPropType,\n    hide: hidePropType,\n    export: exportPropType<X>,\n    getSiblings: getSiblingsPropType,\n  |}) => ?T,\n  required?: boolean,\n  queryParam?:\n    | boolean\n    | string\n    | (({| value: T |}) => string | ZalgoPromise<string>),\n  bodyParam?:\n    | boolean\n    | string\n    | (({| value: T |}) => string | ZalgoPromise<string>),\n  // eslint-disable-next-line no-undef\n  queryValue?: <R>({| value: T |}) => ZalgoPromise<R> | R | string,\n  // eslint-disable-next-line no-undef\n  bodyValue?: <R>({| value: T |}) => ZalgoPromise<R> | R | string,\n  sendToChild?: boolean,\n  allowDelegate?: boolean,\n  validate?: ({| value: T, props: PropsType<P> |}) => void,\n  sameDomain?: boolean,\n  serialization?: $Values<typeof PROP_SERIALIZATION>,\n  trustedDomains?: $ReadOnlyArray<DomainMatcher>,\n|};\n\nexport type BOOLEAN_DEFINITION_TYPE = typeof PROP_TYPE.BOOLEAN;\nexport type STRING_DEFINITION_TYPE = typeof PROP_TYPE.STRING;\nexport type NUMBER_DEFINITION_TYPE = typeof PROP_TYPE.NUMBER;\nexport type FUNCTION_DEFINITION_TYPE = typeof PROP_TYPE.FUNCTION;\nexport type ARRAY_DEFINITION_TYPE = typeof PROP_TYPE.ARRAY;\nexport type OBJECT_DEFINITION_TYPE = typeof PROP_TYPE.OBJECT;\n\nexport type DEFINITION_TYPE =\n  | BOOLEAN_DEFINITION_TYPE\n  | STRING_DEFINITION_TYPE\n  | NUMBER_DEFINITION_TYPE\n  | FUNCTION_DEFINITION_TYPE\n  | ARRAY_DEFINITION_TYPE\n  | OBJECT_DEFINITION_TYPE;\n\nexport type BooleanPropDefinitionType<T: boolean, P, X> = PropDefinitionType<\n  T,\n  P,\n  BOOLEAN_DEFINITION_TYPE,\n  X\n>;\nexport type StringPropDefinitionType<T: string, P, X> = PropDefinitionType<\n  T,\n  P,\n  STRING_DEFINITION_TYPE,\n  X\n>;\nexport type NumberPropDefinitionType<T: number, P, X> = PropDefinitionType<\n  T,\n  P,\n  NUMBER_DEFINITION_TYPE,\n  X\n>;\nexport type FunctionPropDefinitionType<T: Function, P, X> = PropDefinitionType<\n  T,\n  P,\n  FUNCTION_DEFINITION_TYPE,\n  X\n>;\nexport type ArrayPropDefinitionType<\n  // eslint-disable-next-line flowtype/no-mutable-array\n  T: Array<*> | $ReadOnlyArray<*>,\n  P,\n  X\n> = PropDefinitionType<T, P, ARRAY_DEFINITION_TYPE, X>;\nexport type ObjectPropDefinitionType<T: Object, P, X> = PropDefinitionType<\n  T,\n  P,\n  OBJECT_DEFINITION_TYPE,\n  X\n>;\n\nexport type MixedPropDefinitionType<P, X> =\n  | BooleanPropDefinitionType<*, P, X>\n  | StringPropDefinitionType<*, P, X>\n  | NumberPropDefinitionType<*, P, X>\n  | FunctionPropDefinitionType<*, P, X>\n  | ObjectPropDefinitionType<*, P, X>\n  | ArrayPropDefinitionType<*, P, X>;\n\nexport type UserPropsDefinitionType<P, X> = {|\n  [string]: MixedPropDefinitionType<P, X>,\n|};\n\nexport type BuiltInPropsDefinitionType<P, X> = {|\n  timeout: NumberPropDefinitionType<timeoutPropType, P, X>,\n  window: ObjectPropDefinitionType<windowPropType, P, X>,\n  close: FunctionPropDefinitionType<closePropType, P, X>,\n  focus: FunctionPropDefinitionType<focusPropType, P, X>,\n  resize: FunctionPropDefinitionType<resizePropType, P, X>,\n  uid: StringPropDefinitionType<uidPropType, P, X>,\n  tag: StringPropDefinitionType<tagPropType, P, X>,\n  cspNonce: StringPropDefinitionType<cspNoncePropType, P, X>,\n  getParent: FunctionPropDefinitionType<getParentPropType, P, X>,\n  getParentDomain: FunctionPropDefinitionType<getParentDomainPropType, P, X>,\n  hide: FunctionPropDefinitionType<hidePropType, P, X>,\n  show: FunctionPropDefinitionType<showPropType, P, X>,\n  export: FunctionPropDefinitionType<exportPropType<X>, P, X>,\n  getSiblings: FunctionPropDefinitionType<getSiblingsPropType, P, X>,\n\n  onDisplay: FunctionPropDefinitionType<onDisplayPropType, P, X>,\n  onRendered: FunctionPropDefinitionType<onRenderedPropType, P, X>,\n  onRender: FunctionPropDefinitionType<onRenderPropType, P, X>,\n  onPrerendered: FunctionPropDefinitionType<onPrerenderedPropType, P, X>,\n  onPrerender: FunctionPropDefinitionType<onPrerenderPropType, P, X>,\n  onClose: FunctionPropDefinitionType<onClosePropType, P, X>,\n  onDestroy: FunctionPropDefinitionType<onDestroyPropType, P, X>,\n  onResize: FunctionPropDefinitionType<onClosePropType, P, X>,\n  onFocus: FunctionPropDefinitionType<onFocusPropType, P, X>,\n  onBfcacheCache: FunctionPropDefinitionType<onBfcacheCachePropType, P, X>,\n  onBfcacheRestore: FunctionPropDefinitionType<onBfcacheRestorePropType, P, X>,\n  onError: FunctionPropDefinitionType<onErrorPropType, P, X>,\n  onProps: FunctionPropDefinitionType<onPropsPropType<P>, P, X>,\n|};\n\nexport type PropsDefinitionType<P, X> = {|\n  ...BuiltInPropsDefinitionType<P, X>,\n  [string]: MixedPropDefinitionType<P, X>,\n|};\n\nconst defaultNoop = () => noop;\n// eslint-disable-next-line flowtype/require-exact-type\nconst decorateOnce = <F: Function>({ value }: { value: F }): F => once(value);\n\nexport function getBuiltInProps<P, X>(): BuiltInPropsDefinitionType<P, X> {\n  return {\n    window: {\n      type: PROP_TYPE.OBJECT,\n      sendToChild: false,\n      required: false,\n      allowDelegate: true,\n      validate: ({ value }) => {\n        if (!isWindow(value) && !ProxyWindow.isProxyWindow(value)) {\n          throw new Error(`Expected Window or ProxyWindow`);\n        }\n\n        if (isWindow(value)) {\n          // $FlowFixMe\n          if (isWindowClosed(value)) {\n            throw new Error(`Window is closed`);\n          }\n\n          // $FlowFixMe\n          if (!isSameDomain(value)) {\n            throw new Error(`Window is not same domain`);\n          }\n        }\n      },\n      decorate: ({ value }) => {\n        return toProxyWindow(value);\n      },\n    },\n\n    timeout: {\n      type: PROP_TYPE.NUMBER,\n      required: false,\n      sendToChild: false,\n    },\n\n    cspNonce: {\n      type: PROP_TYPE.STRING,\n      required: false,\n    },\n\n    onDisplay: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onRendered: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onRender: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onPrerendered: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onPrerender: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onClose: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onDestroy: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n      decorate: decorateOnce,\n    },\n\n    onResize: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n    },\n\n    onFocus: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n    },\n\n    // Note: decorateOnce is intentionally omitted for bfcache events.\n    // Unlike other lifecycle props, these can fire multiple times as the page\n    // transitions in and out of bfcache (cache -> restore -> cache -> restore).\n    onBfcacheCache: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n    },\n\n    onBfcacheRestore: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      allowDelegate: true,\n      default: defaultNoop,\n    },\n\n    close: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ close }) => close,\n    },\n\n    focus: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ focus }) => focus,\n    },\n\n    resize: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ resize }) => resize,\n    },\n\n    uid: {\n      type: PROP_TYPE.STRING,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ uid }) => uid,\n    },\n\n    tag: {\n      type: PROP_TYPE.STRING,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ tag }) => tag,\n    },\n\n    getParent: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ getParent }) => getParent,\n    },\n\n    getParentDomain: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ getParentDomain }) => getParentDomain,\n    },\n\n    show: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ show }) => show,\n    },\n\n    hide: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ hide }) => hide,\n    },\n\n    export: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ export: xport }) => xport,\n    },\n\n    onError: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ onError }) => onError,\n    },\n\n    onProps: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ onProps }) => onProps,\n    },\n\n    getSiblings: {\n      type: PROP_TYPE.FUNCTION,\n      required: false,\n      sendToChild: false,\n      childDecorate: ({ getSiblings }) => getSiblings,\n    },\n  };\n}\n\ntype PropCallback<P, X, R> = ((\n  string,\n  BooleanPropDefinitionType<boolean, P, X> | void,\n  boolean\n) => R) &\n  ((string, StringPropDefinitionType<string, P, X> | void, string) => R) &\n  ((string, NumberPropDefinitionType<number, P, X> | void, number) => R) &\n  ((string, FunctionPropDefinitionType<Function, P, X> | void, Function) => R) &\n  ((\n    string,\n    ArrayPropDefinitionType<$ReadOnlyArray<*> | $ReadOnlyArray<*>, P, X> | void,\n    $ReadOnlyArray<*> | $ReadOnlyArray<*>\n  ) => R) &\n  ((string, ObjectPropDefinitionType<Object, P, X> | void, Object) => R);\n\nexport function eachProp<P, X>(\n  props: PropsType<P>,\n  propsDef: PropsDefinitionType<P, X>,\n  handler: PropCallback<P, X, void>\n) {\n  // $FlowFixMe[cannot-spread-indexer]\n  for (const key of Object.keys({ ...props, ...propsDef })) {\n    const propDef = propsDef[key];\n    const value = props[key];\n\n    // $FlowFixMe[incompatible-call]\n    handler(key, propDef, value);\n  }\n}\n\nexport function mapProps<P, X, T>(\n  props: PropsType<P>,\n  propsDef: PropsDefinitionType<P, X>,\n  handler: PropCallback<P, X, T>\n): $ReadOnlyArray<T> {\n  const results = [];\n\n  eachProp(props, propsDef, (key, propDef, value) => {\n    // $FlowFixMe[incompatible-call]\n    const result = handler(key, propDef, value);\n    results.push(result);\n  });\n  return results;\n}\n"
  },
  {
    "path": "src/component/templates/component.js",
    "content": "/* @flow */\n/* eslint react/react-in-jsx-scope: off */\n\nimport { type RenderOptionsType } from \"../../parent/parent\";\n\nexport function defaultPrerenderTemplate<P>({\n  doc,\n  props,\n}: RenderOptionsType<P>): ?HTMLElement {\n  if (__ZOID__.__DEFAULT_PRERENDER__) {\n    const html = doc.createElement(\"html\");\n    const body = doc.createElement(\"body\");\n    const style = doc.createElement(\"style\");\n    const spinner = doc.createElement(\"div\");\n    spinner.classList.add(\"spinner\");\n\n    if (props.cspNonce) {\n      style.setAttribute(\"nonce\", props.cspNonce);\n    }\n\n    html.appendChild(body);\n    body.appendChild(spinner);\n    body.appendChild(style);\n    style.appendChild(\n      doc.createTextNode(`\n            html, body {\n                width: 100%;\n                height: 100%;\n            }\n\n            .spinner {\n                position: fixed;\n                max-height: 60vmin;\n                max-width: 60vmin;\n                height: 40px;\n                width: 40px;\n                top: 50%;\n                left: 50%;\n                box-sizing: border-box;\n                border: 3px solid rgba(0, 0, 0, .2);\n                border-top-color: rgba(33, 128, 192, 0.8);\n                border-radius: 100%;\n                animation: rotation .7s infinite linear;\n            }\n\n            @keyframes rotation {\n                from {\n                    transform: translateX(-50%) translateY(-50%) rotate(0deg);\n                }\n                to {\n                    transform: translateX(-50%) translateY(-50%) rotate(359deg);\n                }\n            }\n        `)\n    );\n\n    return html;\n  }\n}\n"
  },
  {
    "path": "src/component/templates/container.js",
    "content": "/* @flow */\n/* eslint react/react-in-jsx-scope: off */\n\nimport { destroyElement, toCSS } from \"@krakenjs/belter/src\";\n\nimport { type RenderOptionsType } from \"../../parent/parent\";\nimport { EVENT } from \"../../constants\";\n\nconst CLASS = {\n  VISIBLE: \"zoid-visible\",\n  INVISIBLE: \"zoid-invisible\",\n};\n\nexport function defaultContainerTemplate<P>({\n  uid,\n  frame,\n  prerenderFrame,\n  doc,\n  props,\n  event,\n  dimensions,\n}: RenderOptionsType<P>): ?HTMLElement {\n  const { width, height } = dimensions;\n\n  if (__ZOID__.__DEFAULT_CONTAINER__) {\n    if (!frame || !prerenderFrame) {\n      return;\n    }\n\n    const div = doc.createElement(\"div\");\n    div.setAttribute(\"id\", uid);\n    const style = doc.createElement(\"style\");\n    if (props.cspNonce) {\n      style.setAttribute(\"nonce\", props.cspNonce);\n    }\n\n    style.appendChild(\n      doc.createTextNode(`\n            #${uid} {\n                display: inline-block;\n                position: relative;\n                width: ${width};\n                height: ${height};\n            }\n\n            #${uid} > iframe {\n                display: inline-block;\n                position: absolute;\n                width: 100%;\n                height: 100%;\n                top: 0;\n                left: 0;\n                transition: opacity .2s ease-in-out;\n            }\n\n            #${uid} > iframe.${CLASS.INVISIBLE} {\n                opacity: 0;\n            }\n\n            #${uid} > iframe.${CLASS.VISIBLE} {\n                opacity: 1;\n        }\n        `)\n    );\n\n    div.appendChild(frame);\n    div.appendChild(prerenderFrame);\n    div.appendChild(style);\n\n    prerenderFrame.classList.add(CLASS.VISIBLE);\n    frame.classList.add(CLASS.INVISIBLE);\n\n    event.on(EVENT.RENDERED, () => {\n      prerenderFrame.classList.remove(CLASS.VISIBLE);\n      prerenderFrame.classList.add(CLASS.INVISIBLE);\n\n      frame.classList.remove(CLASS.INVISIBLE);\n      frame.classList.add(CLASS.VISIBLE);\n\n      setTimeout(() => {\n        destroyElement(prerenderFrame);\n      }, 1);\n    });\n\n    event.on(EVENT.RESIZE, ({ width: newWidth, height: newHeight }) => {\n      if (typeof newWidth === \"number\") {\n        div.style.width = toCSS(newWidth);\n      }\n\n      if (typeof newHeight === \"number\") {\n        div.style.height = toCSS(newHeight);\n      }\n    });\n\n    return div;\n  }\n}\n"
  },
  {
    "path": "src/component/templates/index.js",
    "content": "/* @flow */\n\nexport * from \"./container\";\nexport * from \"./component\";\n"
  },
  {
    "path": "src/component/validate.js",
    "content": "/* @flow */\n\nimport { isPerc, isPx, values } from \"@krakenjs/belter/src\";\n\nimport { CONTEXT, PROP_TYPE } from \"../constants\";\n\nimport type { ComponentOptionsType } from \"./index\";\n\nfunction validatepropsDefinitions<P, X, C, ExtType>(\n  options: ComponentOptionsType<P, X, C, ExtType>\n) {\n  if (options.props && !(typeof options.props === \"object\")) {\n    throw new Error(`Expected options.props to be an object`);\n  }\n\n  const PROP_TYPE_LIST = values(PROP_TYPE);\n\n  if (options.props) {\n    for (const key of Object.keys(options.props)) {\n      const prop = options.props[key];\n\n      if (!prop || !(typeof prop === \"object\")) {\n        throw new Error(`Expected options.props.${key} to be an object`);\n      }\n\n      if (!prop.type) {\n        throw new Error(`Expected prop.type`);\n      }\n\n      if (PROP_TYPE_LIST.indexOf(prop.type) === -1) {\n        throw new Error(\n          `Expected prop.type to be one of ${PROP_TYPE_LIST.join(\", \")}`\n        );\n      }\n\n      if (prop.required && prop.default) {\n        throw new Error(`Required prop can not have a default value`);\n      }\n\n      if (\n        prop.type === PROP_TYPE.FUNCTION &&\n        prop.queryParam &&\n        !prop.queryValue\n      ) {\n        throw new Error(`Do not pass queryParam for function prop`);\n      }\n    }\n  }\n}\n\n// eslint-disable-next-line complexity\nexport function validateOptions<P, X, C, ExtType>(\n  options: ?ComponentOptionsType<P, X, C, ExtType>\n) {\n  // eslint-ignore-line\n\n  if (!options) {\n    throw new Error(`Expected options to be passed`);\n  }\n\n  // eslint-disable-next-line security/detect-unsafe-regex\n  if (!options.tag || !options.tag.match(/^([a-z0-9][a-z0-9-]*)+[a-z0-9]+$/)) {\n    throw new Error(`Invalid options.tag: ${options.tag}`);\n  }\n\n  validatepropsDefinitions(options);\n\n  const { dimensions } = options;\n\n  if (dimensions) {\n    if (typeof dimensions === \"function\") {\n      // pass\n    } else if (typeof dimensions === \"object\" && dimensions !== null) {\n      if (!isPx(dimensions.height) && !isPerc(dimensions.height)) {\n        throw new Error(\n          `Expected options.dimensions.height to be a px or % string value`\n        );\n      }\n\n      if (!isPx(dimensions.width) && !isPerc(dimensions.width)) {\n        throw new Error(\n          `Expected options.dimensions.width to be a px or % string value`\n        );\n      }\n    } else {\n      throw new Error(`Expected dimensions to be a function or object`);\n    }\n  }\n\n  if (options.defaultContext) {\n    if (\n      options.defaultContext !== CONTEXT.IFRAME &&\n      options.defaultContext !== CONTEXT.POPUP\n    ) {\n      throw new Error(\n        `Unsupported context type: ${options.defaultContext || \"unknown\"}`\n      );\n    }\n  }\n\n  if (!options.url) {\n    throw new Error(`Must pass url`);\n  }\n\n  if (typeof options.url !== \"string\" && typeof options.url !== \"function\") {\n    throw new TypeError(`Expected url to be string or function`);\n  }\n\n  if (\n    options.prerenderTemplate &&\n    typeof options.prerenderTemplate !== \"function\"\n  ) {\n    throw new Error(`Expected options.prerenderTemplate to be a function`);\n  }\n\n  if (\n    (options.containerTemplate || !__ZOID__.__DEFAULT_CONTAINER__) &&\n    typeof options.containerTemplate !== \"function\"\n  ) {\n    throw new Error(`Expected options.containerTemplate to be a function`);\n  }\n}\n"
  },
  {
    "path": "src/constants.js",
    "content": "/* @flow */\n\nimport { WINDOW_TYPE } from \"@krakenjs/cross-domain-utils/src\";\n\nexport const ZOID = `zoid`;\n\nexport const POST_MESSAGE = {\n  DELEGATE: `${ZOID}_delegate`,\n  ALLOW_DELEGATE: `${ZOID}_allow_delegate`,\n};\n\nexport const COMPONENT_ERROR = {\n  NAVIGATED_AWAY: \"Window navigated away\",\n  COMPONENT_DESTROYED: \"Component destroyed\",\n  COMPONENT_CLOSED: \"Component closed\",\n  WINDOW_CLOSED: \"Detected component window close\",\n  IFRAME_CLOSE: \"Detected iframe close\",\n};\n\nexport const PROP_TYPE = {\n  STRING: (\"string\": \"string\"),\n  OBJECT: (\"object\": \"object\"),\n  FUNCTION: (\"function\": \"function\"),\n  BOOLEAN: (\"boolean\": \"boolean\"),\n  NUMBER: (\"number\": \"number\"),\n  ARRAY: (\"array\": \"array\"),\n};\n\nexport const WINDOW_REFERENCE = {\n  OPENER: (\"opener\": \"opener\"),\n  PARENT: (\"parent\": \"parent\"),\n  GLOBAL: (\"global\": \"global\"),\n  NAME: (\"name\": \"name\"),\n};\n\nexport const PROP_SERIALIZATION = {\n  JSON: (\"json\": \"json\"),\n  DOTIFY: (\"dotify\": \"dotify\"),\n  BASE64: (\"base64\": \"base64\"),\n};\n\nexport const CONTEXT = WINDOW_TYPE;\n\nexport const WILDCARD = \"*\";\n\nexport const DEFAULT_DIMENSIONS = {\n  WIDTH: \"300px\",\n  HEIGHT: \"150px\",\n};\n\nexport const EVENT = {\n  RENDER: \"zoid-render\",\n  RENDERED: \"zoid-rendered\",\n  PRERENDER: \"zoid-prerender\",\n  PRERENDERED: \"zoid-prerendered\",\n  DISPLAY: \"zoid-display\",\n  ERROR: \"zoid-error\",\n  CLOSE: \"zoid-close\",\n  DESTROY: \"zoid-destroy\",\n  PROPS: \"zoid-props\",\n  RESIZE: \"zoid-resize\",\n  FOCUS: \"zoid-focus\",\n  BFCACHE_CACHE: \"zoid-bfcache-cache\",\n  BFCACHE_RESTORE: \"zoid-bfcache-restore\",\n};\n\nexport const METHOD = {\n  GET: (\"get\": \"get\"),\n  POST: (\"post\": \"post\"),\n};\n"
  },
  {
    "path": "src/declarations.js",
    "content": "/* @flow */\n\ndeclare var __ZOID__: {|\n  __VERSION__: string,\n  __GLOBAL_KEY__: string,\n  __POPUP_SUPPORT__: boolean,\n  __IFRAME_SUPPORT__: boolean,\n  __FRAMEWORK_SUPPORT__: boolean,\n  __DEFAULT_CONTAINER__: boolean,\n  __DEFAULT_PRERENDER__: boolean,\n  __SCRIPT_NAMESPACE__: boolean,\n|};\n\ndeclare var __DEBUG__: boolean;\n"
  },
  {
    "path": "src/drivers/angular.js",
    "content": "/* @flow */\n\nimport { dasherizeToCamel, replaceObject, noop } from \"@krakenjs/belter/src\";\n\nimport type { ComponentDriverType } from \"../component\";\nimport { CONTEXT } from \"../constants\";\n\ntype AngularModule = {|\n  directive: (\n    string,\n    () => {|\n      scope: { [string]: \"=\" | \"@\" },\n      restrict: string,\n      controller: $ReadOnlyArray<string | Function>,\n    |}\n  ) => AngularModule,\n|};\n\ntype Angular = {|\n  module: (string, $ReadOnlyArray<string>) => AngularModule,\n|};\n\nexport const angular: ComponentDriverType<*, Angular, AngularModule, *, *> = {\n  register: (tag, propsDef, init, ng) => {\n    const module = ng.module(tag, []).directive(dasherizeToCamel(tag), () => {\n      const scope = {};\n\n      for (const key of Object.keys(propsDef)) {\n        scope[key] = \"=\";\n      }\n\n      scope.props = \"=\";\n\n      return {\n        scope,\n\n        restrict: \"E\",\n\n        controller: [\n          \"$scope\",\n          \"$element\",\n          ($scope, $element) => {\n            function safeApply() {\n              if (\n                $scope.$root.$$phase !== \"$apply\" &&\n                $scope.$root.$$phase !== \"$digest\"\n              ) {\n                try {\n                  $scope.$apply();\n                } catch (err) {\n                  // pass\n                }\n              }\n            }\n\n            const getProps = () => {\n              return replaceObject($scope.props, (item) => {\n                if (typeof item === \"function\") {\n                  return function angularWrapped(): mixed {\n                    // $FlowFixMe\n                    const result = item.apply(this, arguments);\n                    safeApply();\n                    return result;\n                  };\n                }\n                return item;\n              });\n            };\n\n            const instance = init(getProps());\n            instance.render($element[0], CONTEXT.IFRAME);\n\n            $scope.$watch(() => {\n              instance.updateProps(getProps()).catch(noop);\n            });\n          },\n        ],\n      };\n    });\n\n    return module;\n  },\n};\n"
  },
  {
    "path": "src/drivers/angular2.js",
    "content": "/* @flow */\n/* eslint new-cap: 0 */\n\nimport { replaceObject } from \"@krakenjs/belter/src\";\n\nimport type { ComponentDriverType } from \"../component\";\nimport { CONTEXT } from \"../constants\";\n\ntype Angular2Injection = {||};\n\ntype Angular2Component = {||};\n\ntype Angular2Module = {| annotations: Object, name: string |};\n\ntype Angular2 = {|\n  Component: ({|\n    selector: string,\n    template: string,\n    inputs: $ReadOnlyArray<string>,\n  |}) => {|\n    Class: ({|\n      constructor: $ReadOnlyArray<Angular2Injection | Function>,\n      ngOnInit: () => void,\n      ngDoCheck: () => void,\n    |}) => Angular2Component,\n  |},\n  NgModule: ({|\n    declarations: $ReadOnlyArray<*>,\n    exports: $ReadOnlyArray<*>,\n  |}) => {|\n    Class: ({| constructor: () => void |}) => Angular2Module,\n  |},\n  ElementRef: Angular2Injection,\n  NgZone: Angular2Injection,\n  Inject: Function,\n|};\n\nconst equals = (obj1, obj2) => {\n  const checked = {};\n\n  for (const key in obj1) {\n    if (obj1.hasOwnProperty(key)) {\n      checked[key] = true;\n\n      if (obj1[key] !== obj2[key]) {\n        return false;\n      }\n    }\n  }\n\n  for (const key in obj2) {\n    if (!checked[key]) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nexport const angular2: ComponentDriverType<*, Angular2, Angular2Module, *, *> =\n  {\n    register: (\n      tag,\n      propsDef,\n      init,\n      { Component: AngularComponent, NgModule, ElementRef, NgZone, Inject }\n    ) => {\n      class ComponentInstance {\n        elementRef: Object;\n        internalProps: Object;\n        parent: Object;\n        props: Object;\n        zone: Object;\n        _props: Object;\n\n        static annotations: $ReadOnlyArray<*>;\n        static parameters: $ReadOnlyArray<*>;\n\n        constructor(elementRef, zone) {\n          this._props = {};\n          this.elementRef = elementRef;\n          this.zone = zone;\n        }\n\n        getProps(): Object {\n          return replaceObject(\n            { ...this.internalProps, ...this.props },\n            (item) => {\n              if (typeof item === \"function\") {\n                const { zone } = this;\n                return function angular2Wrapped(): void {\n                  // $FlowFixMe\n                  return zone.run(() => item.apply(this, arguments));\n                };\n              }\n              return item;\n            }\n          );\n        }\n\n        ngOnInit() {\n          const targetElement = this.elementRef.nativeElement;\n          this.parent = init(this.getProps());\n          this.parent.render(targetElement, CONTEXT.IFRAME);\n        }\n\n        ngDoCheck() {\n          if (this.parent && !equals(this._props, this.props)) {\n            this._props = { ...this.props };\n            this.parent.updateProps(this.getProps());\n          }\n        }\n      }\n\n      ComponentInstance.parameters = [\n        [new Inject(ElementRef)],\n        [new Inject(NgZone)],\n      ];\n\n      ComponentInstance.annotations = [\n        new AngularComponent({\n          selector: tag,\n          template: `<div></div>`,\n          inputs: [\"props\"],\n        }),\n      ];\n\n      class ModuleInstance {\n        static annotations: $ReadOnlyArray<*>;\n      }\n\n      ModuleInstance.annotations = [\n        new NgModule({\n          declarations: [ComponentInstance],\n          exports: [ComponentInstance],\n        }),\n      ];\n\n      return ModuleInstance;\n    },\n  };\n"
  },
  {
    "path": "src/drivers/index.js",
    "content": "/* @flow */\n\nexport * from \"./react\";\nexport * from \"./vue\";\nexport * from \"./vue3\";\nexport * from \"./angular\";\nexport * from \"./angular2\";\n"
  },
  {
    "path": "src/drivers/react.js",
    "content": "/* @flow */\n/* eslint react/no-deprecated: off, react/no-find-dom-node: off, react/display-name: off, react/no-did-mount-set-state: off, react/destructuring-assignment: off, react/prop-types: off */\n\nimport { extend, noop } from \"@krakenjs/belter/src\";\n\nimport type { ComponentDriverType } from \"../component\";\nimport { CONTEXT } from \"../constants\";\n\ndeclare class ReactClassType {}\ndeclare class __ReactComponent {}\n\ntype ReactElementType = {||};\n\ntype ReactType = {|\n  Component: __ReactComponent,\n  createClass: ({|\n    render: () => ReactElementType,\n    componentDidMount: () => void,\n    componentDidUpdate: () => void,\n  |}) => typeof ReactClassType,\n  createElement: (\n    string,\n    ?{ [string]: mixed },\n    ...children: $ReadOnlyArray<ReactElementType>\n  ) => ReactElementType,\n|};\n\ntype ReactDomType = {|\n  findDOMNode: (typeof ReactClassType) => HTMLElement,\n|};\n\ntype ReactLibraryType = {|\n  React: ReactType,\n  ReactDOM: ReactDomType,\n|};\n\nexport const react: ComponentDriverType<\n  *,\n  ReactLibraryType,\n  typeof ReactClassType,\n  *,\n  *\n> = {\n  register: (tag, propsDef, init, { React, ReactDOM }) => {\n    // $FlowFixMe\n    return class extends React.Component {\n      render(): ReactElementType {\n        return React.createElement(\"div\", null);\n      }\n\n      componentDidMount() {\n        // $FlowFixMe\n        const el = ReactDOM.findDOMNode(this);\n        const parent = init(extend({}, this.props));\n        parent.render(el, CONTEXT.IFRAME);\n        this.setState({ parent });\n      }\n\n      componentDidUpdate() {\n        if (this.state && this.state.parent) {\n          this.state.parent.updateProps(extend({}, this.props)).catch(noop);\n        }\n      }\n    };\n  },\n};\n"
  },
  {
    "path": "src/drivers/vue.js",
    "content": "/* @flow */\n\nimport { noop, dasherizeToCamel } from \"@krakenjs/belter/src\";\n\nimport type { ComponentDriverType } from \"../component\";\nimport { CONTEXT } from \"../constants\";\n\ntype VueComponent = {|\n  render: (Function) => Element,\n  inheritAttrs: boolean,\n  mounted: () => void,\n  watch: {|\n    $attrs: {|\n      deep: boolean,\n      handler: () => void,\n    |},\n  |},\n|};\n\ntype RegisteredVueComponent = {||};\n\ntype VueType = {|\n  component: (string, VueComponent) => RegisteredVueComponent,\n|};\n\nfunction propsToCamelCase(props: Object): Object {\n  return Object.keys(props).reduce((acc, key) => {\n    const value = props[key];\n    // In vue `style` is a reserved prop name\n    if (key === \"style-object\" || key === \"styleObject\") {\n      acc.style = value;\n      // To keep zoid as generic as possible, passing in the original prop name as well\n      acc.styleObject = value;\n    } else if (key.includes(\"-\")) {\n      acc[dasherizeToCamel(key)] = value;\n    } else {\n      acc[key] = value;\n    }\n    return acc;\n  }, {});\n}\n\nexport const vue: ComponentDriverType<\n  *,\n  VueType,\n  RegisteredVueComponent,\n  *,\n  *\n> = {\n  register: (tag, propsDef, init, Vue) => {\n    return Vue.component(tag, {\n      render(createElement): Element {\n        return createElement(\"div\");\n      },\n\n      inheritAttrs: false,\n\n      mounted() {\n        // $FlowFixMe[object-this-reference]\n        const el = this.$el;\n        // $FlowFixMe[object-this-reference]\n        this.parent = init({ ...propsToCamelCase(this.$attrs) });\n        // $FlowFixMe[object-this-reference]\n        this.parent.render(el, CONTEXT.IFRAME);\n      },\n\n      watch: {\n        $attrs: {\n          handler: function handler() {\n            if (this.parent && this.$attrs) {\n              this.parent.updateProps({ ...this.$attrs }).catch(noop);\n            }\n          },\n          deep: true,\n        },\n      },\n    });\n  },\n};\n"
  },
  {
    "path": "src/drivers/vue3.js",
    "content": "/* @flow */\nimport { dasherizeToCamel, noop } from \"@krakenjs/belter/src\";\n\nimport type { ComponentDriverType } from \"../component\";\nimport { CONTEXT } from \"../constants\";\n\nfunction propsToCamelCase(props: Object): Object {\n  return Object.keys(props).reduce((acc, key) => {\n    const value = props[key];\n    // In vue `style` is a reserved prop name\n    if (key === \"style-object\" || key === \"styleObject\") {\n      acc.style = value;\n      // To keep zoid as generic as possible, passing in the original prop name as well\n      acc.styleObject = value;\n    } else if (key.includes(\"-\")) {\n      acc[dasherizeToCamel(key)] = value;\n    } else {\n      acc[key] = value;\n    }\n    return acc;\n  }, {});\n}\n\nexport const vue3: ComponentDriverType<*, *, *, *, *> = {\n  register: (tag, propsDef, init) => {\n    return {\n      template: `<div></div>`,\n\n      inheritAttrs: false,\n\n      mounted() {\n        // $FlowFixMe[object-this-reference]\n        const el = this.$el;\n        // $FlowFixMe[object-this-reference]\n        this.parent = init({ ...propsToCamelCase(this.$attrs) });\n        // $FlowFixMe[object-this-reference]\n        this.parent.render(el, CONTEXT.IFRAME);\n      },\n\n      watch: {\n        $attrs: {\n          handler: function handler() {\n            if (this.parent && this.$attrs) {\n              this.parent.updateProps({ ...this.$attrs }).catch(noop);\n            }\n          },\n          deep: true,\n        },\n      },\n    };\n  },\n};\n"
  },
  {
    "path": "src/index.js",
    "content": "/* @flow */\n\nimport typeof { PopupOpenError } from \"@krakenjs/belter/src\";\n\nimport type { CreateZoidComponent } from \"./component\";\n// eslint-disable-next-line no-duplicate-imports\nimport typeof { destroy, destroyComponents, destroyAll } from \"./component\";\nimport typeof {\n  PROP_TYPE,\n  PROP_SERIALIZATION,\n  CONTEXT,\n  EVENT,\n} from \"./constants\";\n\nexport { PopupOpenError } from \"@krakenjs/belter/src\";\n\nexport type {\n  ZoidComponent,\n  ZoidComponentInstance,\n  ZoidProps,\n} from \"./component\";\nexport type { RenderOptionsType } from \"./parent\";\n\nexport { create, destroy, destroyComponents, destroyAll } from \"./component\";\nexport { PROP_TYPE, PROP_SERIALIZATION, CONTEXT, EVENT } from \"./constants\";\n\nexport type Zoid = {|\n  create: CreateZoidComponent,\n  destroy: destroy,\n  destroyComponents: destroyComponents,\n  destroyAll: destroyAll,\n  PROP_TYPE: PROP_TYPE,\n  PROP_SERIALIZATION: PROP_SERIALIZATION,\n  CONTEXT: CONTEXT,\n  EVENT: EVENT,\n  PopupOpenError: PopupOpenError,\n|};\n"
  },
  {
    "path": "src/lib/global.js",
    "content": "/* @flow */\n\nimport {\n  isSameDomain,\n  type CrossDomainWindowType,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport { getCurrentScriptUID } from \"@krakenjs/belter/src\";\n\nexport function getGlobalKey(): string {\n  if (__ZOID__.__SCRIPT_NAMESPACE__) {\n    return `${__ZOID__.__GLOBAL_KEY__}_${getCurrentScriptUID()}`;\n  } else {\n    return __ZOID__.__GLOBAL_KEY__;\n  }\n}\n\nexport function getGlobal<T>(win: CrossDomainWindowType): T {\n  const globalKey = getGlobalKey();\n\n  if (!isSameDomain(win)) {\n    throw new Error(`Can not get global for window on different domain`);\n  }\n\n  if (!win[globalKey]) {\n    win[globalKey] = {};\n  }\n\n  return win[globalKey];\n}\n\nexport function tryGlobal<T, R>(\n  win: CrossDomainWindowType,\n  handler: (T) => R\n): ?R {\n  try {\n    return handler(getGlobal(win));\n  } catch (err) {\n    // pass\n  }\n}\n\nexport function destroyGlobal() {\n  const globalKey = getGlobalKey();\n  delete window[globalKey];\n}\n"
  },
  {
    "path": "src/lib/index.js",
    "content": "/* @flow */\n\nexport * from \"./global\";\nexport * from \"./serialize\";\nexport * from \"./window\";\n"
  },
  {
    "path": "src/lib/serialize.js",
    "content": "/* @flow */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport {\n  serializeMessage,\n  deserializeMessage,\n  toProxyWindow,\n  type ProxyWindow,\n} from \"@krakenjs/post-robot/src\";\nimport { uniqueID, base64encode, base64decode } from \"@krakenjs/belter/src\";\nimport type {\n  CrossDomainWindowType,\n  DomainMatcher,\n} from \"@krakenjs/cross-domain-utils/src\";\n\nimport { getGlobal } from \"./global\";\n\nexport type ProxyObject<T> = {|\n  get: () => ZalgoPromise<T>,\n|};\n\nexport function getProxyObject<T>(obj: T): ProxyObject<T> {\n  return {\n    get(): ZalgoPromise<T> {\n      return ZalgoPromise.try(() => {\n        // $FlowFixMe[object-this-reference]\n        if (this.source && this.source !== window) {\n          throw new Error(\n            `Can not call get on proxy object from a remote window`\n          );\n        }\n\n        return obj;\n      });\n    },\n  };\n}\n\nexport function basicSerialize<T>(data: T): string {\n  return base64encode(JSON.stringify(data));\n}\n\nexport function basicDeserialize<T>(serializedData: string): T {\n  return JSON.parse(base64decode(serializedData));\n}\n\nexport const REFERENCE_TYPE = {\n  UID: (\"uid\": \"uid\"),\n  RAW: (\"raw\": \"raw\"),\n};\n\nexport type UIDReferenceType = {|\n  type: typeof REFERENCE_TYPE.UID,\n  uid: string,\n|};\nexport type RawReferenceType<T> = {| type: typeof REFERENCE_TYPE.RAW, val: T |};\n\nexport type ReferenceType<T> = UIDReferenceType | RawReferenceType<T>;\n\nexport function getUIDRefStore<T>(win: CrossDomainWindowType): { [string]: T } {\n  const global = getGlobal(win);\n  global.references = global.references || {};\n  return global.references;\n}\n\nexport function getUIDRef<T>(val: T): ReferenceType<T> {\n  const uid = uniqueID();\n  const references = getUIDRefStore(window);\n  references[uid] = val;\n  return { type: REFERENCE_TYPE.UID, uid };\n}\n\nexport function getRawRef<T>(val: T): ReferenceType<T> {\n  return { type: REFERENCE_TYPE.RAW, val };\n}\n\nexport function getRefValue<T>(\n  win: CrossDomainWindowType,\n  ref: ReferenceType<T>\n): T {\n  if (ref.type === REFERENCE_TYPE.RAW) {\n    return ref.val;\n  }\n\n  if (ref.type === REFERENCE_TYPE.UID) {\n    const references = getUIDRefStore(win);\n    return references[ref.uid];\n  }\n\n  throw new Error(`Unsupported ref type: ${ref.type}`);\n}\n\nexport function cleanupRef<T>(\n  win: CrossDomainWindowType,\n  ref: ReferenceType<T>\n) {\n  if (ref.type === REFERENCE_TYPE.UID) {\n    const references = getUIDRefStore(win);\n    delete references[ref.uid];\n  }\n}\n\ntype Message<T, M> = {|\n  sender: {|\n    domain: string,\n  |},\n  metaData: M,\n  reference: ReferenceType<T>,\n|};\n\ntype CrossDomainSerializeOptions<T, M> = {|\n  data: T,\n  metaData: M,\n  sender: {|\n    domain: string,\n  |},\n  receiver: {|\n    win: ProxyWindow | CrossDomainWindowType,\n    domain: DomainMatcher,\n  |},\n  passByReference?: boolean,\n  basic?: boolean,\n|};\n\ntype CrossDomainSerializedMessage = {|\n  serializedData: string,\n  cleanReference: () => void,\n|};\n\nexport function crossDomainSerialize<T, M>({\n  data,\n  metaData,\n  sender,\n  receiver,\n  passByReference = false,\n  basic = false,\n}: CrossDomainSerializeOptions<T, M>): CrossDomainSerializedMessage {\n  const proxyWin = toProxyWindow(receiver.win);\n  const serializedMessage = basic\n    ? JSON.stringify(data)\n    : serializeMessage(proxyWin, receiver.domain, data);\n\n  const reference = passByReference\n    ? getUIDRef(serializedMessage)\n    : getRawRef(serializedMessage);\n\n  const message: Message<string, M> = {\n    sender: {\n      domain: sender.domain,\n    },\n    metaData,\n    reference,\n  };\n\n  const cleanReference = () => {\n    cleanupRef(window, reference);\n  };\n\n  return {\n    serializedData: basicSerialize(message),\n    cleanReference,\n  };\n}\n\ntype CrossDomainDeserializeOptions<M> = {|\n  data: string,\n  sender: {|\n    win: CrossDomainWindowType | (({| metaData: M |}) => CrossDomainWindowType),\n    domain?: string | (({| metaData: M |}) => string),\n  |},\n  basic?: boolean,\n|};\n\ntype CrossDomainDeserializedMessage<T, M> = {|\n  data: T,\n  metaData: M,\n  sender: {|\n    domain: string,\n    win: CrossDomainWindowType,\n  |},\n  reference: ReferenceType<string>,\n|};\n\nexport function crossDomainDeserialize<T, M>({\n  data,\n  sender,\n  basic = false,\n}: CrossDomainDeserializeOptions<M>): CrossDomainDeserializedMessage<T, M> {\n  const message: Message<string, M> = basicDeserialize(data);\n\n  const { reference, metaData } = message;\n\n  let win;\n  if (typeof sender.win === \"function\") {\n    win = sender.win({ metaData });\n  } else {\n    win = sender.win;\n  }\n\n  let domain;\n  if (typeof sender.domain === \"function\") {\n    domain = sender.domain({ metaData });\n  } else if (typeof sender.domain === \"string\") {\n    domain = sender.domain;\n  } else {\n    domain = message.sender.domain;\n  }\n\n  const serializedData = getRefValue(win, reference);\n  const deserializedData = basic\n    ? JSON.parse(serializedData)\n    : deserializeMessage(win, domain, serializedData);\n\n  return {\n    data: deserializedData,\n    metaData,\n    sender: { win, domain },\n    reference,\n  };\n}\n"
  },
  {
    "path": "src/lib/window.js",
    "content": "/* @flow */\n\nimport { assertExists, memoize } from \"@krakenjs/belter/src\";\nimport {\n  isSameDomain,\n  getOpener,\n  getNthParentFromTop,\n  getAncestor,\n  getAllFramesInWindow,\n  getParent,\n  isTop,\n  findFrameByName,\n  getDomain,\n  assertSameDomain,\n  type CrossDomainWindowType,\n  getDistanceFromTop,\n} from \"@krakenjs/cross-domain-utils/src\";\n\nimport { ZOID, WINDOW_REFERENCE } from \"../constants\";\nimport type { InitialChildPayload, WindowRef } from \"../parent\";\n\nimport {\n  crossDomainDeserialize,\n  crossDomainSerialize,\n  REFERENCE_TYPE,\n  type ReferenceType,\n} from \"./serialize\";\nimport { tryGlobal } from \"./global\";\n\nfunction getWindowByRef(windowRef: WindowRef): CrossDomainWindowType {\n  if (windowRef.type === WINDOW_REFERENCE.OPENER) {\n    return assertExists(\"opener\", getOpener(window));\n  } else if (\n    windowRef.type === WINDOW_REFERENCE.PARENT &&\n    typeof windowRef.distance === \"number\"\n  ) {\n    return assertExists(\n      \"parent\",\n      getNthParentFromTop(window, windowRef.distance)\n    );\n  } else if (\n    windowRef.type === WINDOW_REFERENCE.GLOBAL &&\n    windowRef.uid &&\n    typeof windowRef.uid === \"string\"\n  ) {\n    const { uid } = windowRef;\n    const ancestor = getAncestor(window);\n\n    if (!ancestor) {\n      throw new Error(`Can not find ancestor window`);\n    }\n\n    for (const frame of getAllFramesInWindow(ancestor)) {\n      if (isSameDomain(frame)) {\n        const win = tryGlobal(\n          frame,\n          (global) => global.windows && global.windows[uid]\n        );\n\n        if (win) {\n          return win;\n        }\n      }\n    }\n  } else if (windowRef.type === WINDOW_REFERENCE.NAME) {\n    const { name } = windowRef;\n    return assertExists(\n      \"namedWindow\",\n      findFrameByName(assertExists(\"ancestor\", getAncestor(window)), name)\n    );\n  }\n\n  throw new Error(`Unable to find ${windowRef.type} parent component window`);\n}\n\nexport function buildChildWindowName({\n  name,\n  serializedPayload,\n}: {|\n  name: string,\n  serializedPayload: string,\n|}): string {\n  return `__${ZOID}__${name}__${serializedPayload}__`;\n}\n\nfunction parseWindowName(windowName: string): {|\n  name: string,\n  serializedInitialPayload: string,\n|} {\n  if (!windowName) {\n    throw new Error(`No window name`);\n  }\n\n  const [, zoidcomp, name, serializedInitialPayload] = windowName.split(\"__\");\n\n  if (zoidcomp !== ZOID) {\n    throw new Error(`Window not rendered by zoid - got ${zoidcomp}`);\n  }\n\n  if (!name) {\n    throw new Error(`Expected component name`);\n  }\n\n  if (!serializedInitialPayload) {\n    throw new Error(`Expected serialized payload ref`);\n  }\n\n  return { name, serializedInitialPayload };\n}\n\nexport type InitialParentPayload<P, X> = {|\n  parent: {|\n    domain: string,\n    win: CrossDomainWindowType,\n  |},\n  payload: InitialChildPayload<P, X>,\n  reference: ReferenceType<string>,\n|};\n\nconst parseInitialParentPayload = memoize(\n  <P, X>(windowName: string): InitialParentPayload<P, X> => {\n    const { serializedInitialPayload } = parseWindowName(windowName);\n\n    const {\n      data: payload,\n      sender: parent,\n      reference,\n    } = crossDomainDeserialize({\n      data: serializedInitialPayload,\n      sender: {\n        win: ({ metaData: { windowRef } }) => getWindowByRef(windowRef),\n      },\n    });\n\n    return {\n      parent,\n      payload,\n      reference,\n    };\n  }\n);\n\nexport function getInitialParentPayload<P, X>(): InitialParentPayload<P, X> {\n  return parseInitialParentPayload(window.name);\n}\n\nexport function isChildComponentWindow(name: string): boolean {\n  try {\n    return parseWindowName(window.name).name === name;\n  } catch (err) {\n    // pass\n  }\n\n  return false;\n}\n\nexport function getWindowRef(\n  targetWindow: CrossDomainWindowType,\n  currentWindow?: CrossDomainWindowType = window\n): ?WindowRef {\n  if (targetWindow === getParent(currentWindow)) {\n    return {\n      type: WINDOW_REFERENCE.PARENT,\n      distance: getDistanceFromTop(targetWindow),\n    };\n  }\n\n  if (targetWindow === getOpener(currentWindow)) {\n    return { type: WINDOW_REFERENCE.OPENER };\n  }\n\n  if (isSameDomain(targetWindow) && !isTop(targetWindow)) {\n    const windowName = assertSameDomain(targetWindow).name;\n    if (windowName) {\n      return { type: WINDOW_REFERENCE.NAME, name: windowName };\n    }\n  }\n}\n\ntype UpdateChildWindowNameWithRefOptions = {|\n  componentName: string,\n  parentComponentWindow: CrossDomainWindowType,\n|};\n\nexport function updateChildWindowNameWithRef({\n  componentName,\n  parentComponentWindow,\n}: UpdateChildWindowNameWithRefOptions): ?string {\n  const { serializedInitialPayload } = parseWindowName(window.name);\n\n  const { data, sender, reference, metaData } = crossDomainDeserialize({\n    data: serializedInitialPayload,\n    sender: {\n      win: parentComponentWindow,\n    },\n    basic: true,\n  });\n\n  if (\n    reference.type === REFERENCE_TYPE.UID ||\n    metaData.windowRef.type === WINDOW_REFERENCE.GLOBAL\n  ) {\n    const windowRef = getWindowRef(parentComponentWindow);\n\n    const { serializedData: serializedPayload } = crossDomainSerialize({\n      data,\n      metaData: {\n        windowRef,\n      },\n      sender: {\n        domain: sender.domain,\n      },\n      receiver: {\n        win: window,\n        domain: getDomain(),\n      },\n      basic: true,\n    });\n\n    const childWindowName = buildChildWindowName({\n      name: componentName,\n      serializedPayload,\n    });\n\n    window.name = childWindowName;\n    return childWindowName;\n  }\n}\n"
  },
  {
    "path": "src/parent/index.js",
    "content": "/* @flow */\n\nexport * from \"./parent\";\n"
  },
  {
    "path": "src/parent/parent.js",
    "content": "/* @flow */\n/* eslint max-lines: 0 */\n\nimport {\n  send,\n  bridge,\n  ProxyWindow,\n  toProxyWindow,\n  type CrossDomainFunctionType,\n  cleanUpWindow,\n} from \"@krakenjs/post-robot/src\";\nimport {\n  isSameDomain,\n  matchDomain,\n  getDomainFromUrl,\n  isBlankDomain,\n  getAncestor,\n  getDomain,\n  type CrossDomainWindowType,\n  getDistanceFromTop,\n  normalizeMockUrl,\n  assertSameDomain,\n  closeWindow,\n  onCloseWindow,\n  isWindowClosed,\n  isSameTopWindow,\n  type DomainMatcher,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport {\n  addEventListener,\n  uniqueID,\n  elementReady,\n  writeElementToWindow,\n  eventEmitter,\n  type EventEmitterType,\n  noop,\n  onResize,\n  extendUrl,\n  appendChild,\n  cleanup,\n  stringifyError,\n  destroyElement,\n  getElementSafe,\n  showElement,\n  hideElement,\n  iframe,\n  memoize,\n  isElementClosed,\n  awaitFrameWindow,\n  popup,\n  normalizeDimension,\n  watchElementForClose,\n  isShadowElement,\n  insertShadowSlot,\n  extend,\n} from \"@krakenjs/belter/src\";\n\nimport {\n  ZOID,\n  POST_MESSAGE,\n  CONTEXT,\n  EVENT,\n  METHOD,\n  WINDOW_REFERENCE,\n  DEFAULT_DIMENSIONS,\n  COMPONENT_ERROR,\n} from \"../constants\";\nimport {\n  getGlobal,\n  getProxyObject,\n  crossDomainSerialize,\n  buildChildWindowName,\n  type ProxyObject,\n} from \"../lib\";\nimport type { PropsInputType, PropsType } from \"../component/props\";\nimport type { ChildExportsType } from \"../child\";\nimport type { CssDimensionsType, ContainerReferenceType } from \"../types\";\nimport type {\n  NormalizedComponentOptionsType,\n  AttributesType,\n} from \"../component\";\n\nimport { serializeProps, extendProps } from \"./props\";\n\nexport type RenderOptionsType<P> = {|\n  uid: string,\n  props: PropsType<P>,\n  tag: string,\n  context: $Values<typeof CONTEXT>,\n  close: (?string) => ZalgoPromise<void>,\n  focus: () => ZalgoPromise<void>,\n  doc: Document,\n  container?: HTMLElement,\n  dimensions: CssDimensionsType,\n  state: Object,\n  event: EventEmitterType,\n  frame: ?HTMLIFrameElement,\n  prerenderFrame: ?HTMLIFrameElement,\n|};\n\nexport type ParentExportsType<P, X> = {|\n  init: (ChildExportsType<P>) => ZalgoPromise<void>,\n  close: () => ZalgoPromise<void>,\n  checkClose: CrossDomainFunctionType<[], boolean>,\n  resize: CrossDomainFunctionType<\n    [{| width?: ?number, height?: ?number |}],\n    void\n  >,\n  onError: (mixed) => ZalgoPromise<void>,\n  show: () => ZalgoPromise<void>,\n  hide: () => ZalgoPromise<void>,\n  export: (X) => ZalgoPromise<void>,\n|};\n\nexport type WindowRef =\n  | {| type: typeof WINDOW_REFERENCE.OPENER |}\n  | {| type: typeof WINDOW_REFERENCE.PARENT, distance: number |}\n  | {| type: typeof WINDOW_REFERENCE.GLOBAL, uid: string |}\n  | {| type: typeof WINDOW_REFERENCE.NAME, name: string |};\n\nexport type InitialChildPayload<P, X> = {|\n  uid: string,\n  tag: string,\n  version: string,\n  context: $Values<typeof CONTEXT>,\n  childDomainMatch: DomainMatcher,\n  props: PropsType<P>,\n  exports: ParentExportsType<P, X>,\n|};\n\nexport type InitialChildPayloadMetadata = {|\n  windowRef: WindowRef,\n|};\n\nexport type StateType = Object;\n\nexport type ParentHelpers<P> = {|\n  state: StateType,\n  close: () => ZalgoPromise<void>,\n  focus: () => ZalgoPromise<void>,\n  resize: ({| width: ?number, height: ?number |}) => ZalgoPromise<void>,\n  onError: (mixed) => ZalgoPromise<void>,\n  updateProps: (PropsInputType<P>) => ZalgoPromise<void>,\n  event: EventEmitterType,\n  show: () => ZalgoPromise<void>,\n  hide: () => ZalgoPromise<void>,\n|};\n\nfunction getDefaultProps<P>(): PropsType<P> {\n  // $FlowFixMe\n  return {};\n}\n\ntype InternalState = {|\n  visible: boolean,\n|};\n\ntype Rerender = () => ZalgoPromise<void>;\n\ntype RenderContainerOptions = {|\n  context: $Values<typeof CONTEXT>,\n  proxyFrame: ?ProxyObject<HTMLIFrameElement>,\n  proxyPrerenderFrame: ?ProxyObject<HTMLIFrameElement>,\n  rerender: Rerender,\n|};\n\ntype ResolveInitPromise = () => ZalgoPromise<void>;\ntype RejectInitPromise = (mixed) => ZalgoPromise<void>;\ntype GetProxyContainer = (\n  container: ContainerReferenceType\n) => ZalgoPromise<ProxyObject<HTMLElement>>;\ntype Show = () => ZalgoPromise<void>;\ntype Hide = () => ZalgoPromise<void>;\ntype Close = () => ZalgoPromise<void>;\ntype OnError = (mixed) => ZalgoPromise<void>;\ntype RenderContainer = (\n  proxyContainer: ProxyObject<HTMLElement>,\n  RenderContainerOptions\n) => ZalgoPromise<?ProxyObject<HTMLElement>>;\ntype SetProxyWin = (ProxyWindow) => ZalgoPromise<void>;\ntype GetProxyWindow = () => ZalgoPromise<ProxyWindow>;\ntype OpenFrame = (\n  context: $Values<typeof CONTEXT>,\n  {| windowName: string |}\n) => ZalgoPromise<?ProxyObject<HTMLIFrameElement>>;\ntype OpenPrerenderFrame = (\n  context: $Values<typeof CONTEXT>\n) => ZalgoPromise<?ProxyObject<HTMLIFrameElement>>;\ntype Prerender = (\n  proxyPrerenderWin: ProxyWindow,\n  {| context: $Values<typeof CONTEXT> |}\n) => ZalgoPromise<void>;\ntype Open = (\n  context: $Values<typeof CONTEXT>,\n  {|\n    proxyWin: ProxyWindow,\n    proxyFrame: ?ProxyObject<HTMLIFrameElement>,\n    windowName: string,\n  |}\n) => ZalgoPromise<ProxyWindow>;\ntype OpenPrerender = (\n  context: $Values<typeof CONTEXT>,\n  proxyWin: ProxyWindow,\n  proxyPrerenderFrame: ?ProxyObject<HTMLIFrameElement>\n) => ZalgoPromise<ProxyWindow>;\ntype WatchForUnload = () => ZalgoPromise<void>;\ntype GetInternalState = () => ZalgoPromise<InternalState>;\ntype SetInternalState = (InternalState) => ZalgoPromise<InternalState>;\n\ntype ParentDelegateOverrides<P> = {|\n  props: PropsType<P>,\n  event: EventEmitterType,\n  close: Close,\n  onError: OnError,\n  getProxyContainer: GetProxyContainer,\n  show: Show,\n  hide: Hide,\n  renderContainer: RenderContainer,\n  getProxyWindow: GetProxyWindow,\n  setProxyWin: SetProxyWin,\n  openFrame: OpenFrame,\n  openPrerenderFrame: OpenPrerenderFrame,\n  prerender: Prerender,\n  open: Open,\n  openPrerender: OpenPrerender,\n  watchForUnload: WatchForUnload,\n  getInternalState: GetInternalState,\n  setInternalState: SetInternalState,\n  resolveInitPromise: ResolveInitPromise,\n  rejectInitPromise: RejectInitPromise,\n|};\n\ntype DelegateOverrides = {|\n  getProxyContainer: GetProxyContainer,\n  show: Show,\n  hide: Hide,\n  renderContainer: RenderContainer,\n  getProxyWindow: GetProxyWindow,\n  setProxyWin: SetProxyWin,\n  openFrame: OpenFrame,\n  openPrerenderFrame: OpenPrerenderFrame,\n  prerender: Prerender,\n  open: Open,\n  openPrerender: OpenPrerender,\n  watchForUnload: WatchForUnload,\n|};\n\ntype RenderOptions = {|\n  target: CrossDomainWindowType,\n  container: ContainerReferenceType,\n  context: $Values<typeof CONTEXT>,\n  rerender: Rerender,\n|};\n\nexport type ParentComponent<P, X> = {|\n  init: () => void,\n  render: (RenderOptions) => ZalgoPromise<void>,\n  getProps: () => PropsType<P>,\n  setProps: (newProps: PropsInputType<P>, isUpdate?: boolean) => void,\n  export: (X) => ZalgoPromise<void>,\n  destroy: (err?: mixed) => ZalgoPromise<void>,\n  getHelpers: () => ParentHelpers<P>,\n  getDelegateOverrides: () => ZalgoPromise<DelegateOverrides>,\n  getExports: () => X,\n|};\n\nconst getDefaultOverrides = <P>(): ParentDelegateOverrides<P> => {\n  // $FlowFixMe\n  return {};\n};\n\ntype ParentOptions<P, X, C, ExtType> = {|\n  uid: string,\n  options: NormalizedComponentOptionsType<P, X, C, ExtType>,\n  overrides?: ParentDelegateOverrides<P>,\n  parentWin?: CrossDomainWindowType,\n|};\n\nexport function parentComponent<P, X, C, ExtType>({\n  uid,\n  options,\n  overrides = getDefaultOverrides(),\n  parentWin = window,\n}: ParentOptions<P, X, C, ExtType>): ParentComponent<P, X> {\n  const {\n    propsDef,\n    containerTemplate,\n    prerenderTemplate,\n    tag,\n    name,\n    attributes,\n    dimensions,\n    autoResize,\n    url,\n    domain: domainMatch,\n    validate,\n    exports: xports,\n  } = options;\n\n  const initPromise = new ZalgoPromise();\n  const handledErrors = [];\n  const clean = cleanup();\n  const state = {};\n  const inputProps = {};\n  let internalState = {\n    visible: true,\n  };\n  const event = overrides.event ? overrides.event : eventEmitter();\n  const props: PropsType<P> = overrides.props\n    ? overrides.props\n    : getDefaultProps();\n\n  let currentProxyWin: ?ProxyWindow;\n  let currentProxyContainer: ?ProxyObject<HTMLElement>;\n  let childComponent: ?ChildExportsType<P>;\n  let currentChildDomain: ?string;\n  let currentContainer: HTMLElement | void;\n  let isRenderFinished: boolean = false;\n\n  const onErrorOverride: ?OnError = overrides.onError;\n  let getProxyContainerOverride: ?GetProxyContainer =\n    overrides.getProxyContainer;\n  let showOverride: ?Show = overrides.show;\n  let hideOverride: ?Hide = overrides.hide;\n  const closeOverride: ?Close = overrides.close;\n  let renderContainerOverride: ?RenderContainer = overrides.renderContainer;\n  let getProxyWindowOverride: ?GetProxyWindow = overrides.getProxyWindow;\n  let setProxyWinOverride: ?SetProxyWin = overrides.setProxyWin;\n  let openFrameOverride: ?OpenFrame = overrides.openFrame;\n  let openPrerenderFrameOverride: ?OpenPrerenderFrame =\n    overrides.openPrerenderFrame;\n  let prerenderOverride: ?Prerender = overrides.prerender;\n  let openOverride: ?Open = overrides.open;\n  let openPrerenderOverride: ?OpenPrerender = overrides.openPrerender;\n  let watchForUnloadOverride: ?WatchForUnload = overrides.watchForUnload;\n  const getInternalStateOverride: ?GetInternalState =\n    overrides.getInternalState;\n  const setInternalStateOverride: ?SetInternalState =\n    overrides.setInternalState;\n\n  const getDimensions = (): CssDimensionsType => {\n    if (typeof dimensions === \"function\") {\n      return dimensions({ props });\n    }\n    return dimensions;\n  };\n\n  const resolveInitPromise = () => {\n    return ZalgoPromise.try(() => {\n      if (overrides.resolveInitPromise) {\n        return overrides.resolveInitPromise();\n      }\n\n      return initPromise.resolve();\n    });\n  };\n\n  const rejectInitPromise = (err: mixed) => {\n    return ZalgoPromise.try(() => {\n      if (overrides.rejectInitPromise) {\n        return overrides.rejectInitPromise(err);\n      }\n\n      return initPromise.reject(err);\n    });\n  };\n\n  const getPropsForChild = (\n    initialChildDomain: string\n  ): ZalgoPromise<PropsType<P>> => {\n    const result = {};\n\n    for (const key of Object.keys(props)) {\n      const prop = propsDef[key];\n\n      if (prop && prop.sendToChild === false) {\n        continue;\n      }\n\n      const trustedChild: boolean =\n        prop && prop.trustedDomains && prop.trustedDomains.length > 0\n          ? prop.trustedDomains.reduce((acc, val) => {\n              return acc || matchDomain(val, initialChildDomain);\n            }, false)\n          : matchDomain(initialChildDomain, getDomain(window));\n\n      // let trustedDomains override sameDomain prop\n      if (prop && prop.sameDomain && !trustedChild) {\n        continue;\n      }\n\n      // sameDomain was not set and trusted domains must match\n      if (prop && prop.trustedDomains && !trustedChild) {\n        continue;\n      }\n\n      result[key] = props[key];\n    }\n\n    // $FlowFixMe\n    return ZalgoPromise.hash(result);\n  };\n\n  const setupEvents = () => {\n    event.on(EVENT.RENDER, () => props.onRender());\n    event.on(EVENT.PRERENDER, () => props.onPrerender());\n    event.on(EVENT.DISPLAY, () => props.onDisplay());\n    event.on(EVENT.RENDERED, () => props.onRendered());\n    event.on(EVENT.PRERENDERED, () => props.onPrerendered());\n    event.on(EVENT.CLOSE, () => props.onClose());\n    event.on(EVENT.DESTROY, () => props.onDestroy());\n    event.on(EVENT.RESIZE, () => props.onResize());\n    event.on(EVENT.FOCUS, () => props.onFocus());\n    event.on(EVENT.BFCACHE_CACHE, () => props.onBfcacheCache());\n    event.on(EVENT.BFCACHE_RESTORE, (data) => props.onBfcacheRestore(data));\n    event.on(EVENT.PROPS, (newProps) => props.onProps(newProps));\n    event.on(EVENT.ERROR, (err) => {\n      if (props && props.onError) {\n        return props.onError(err);\n      } else {\n        return rejectInitPromise(err).then(() => {\n          setTimeout(() => {\n            throw err;\n          }, 1);\n        });\n      }\n    });\n\n    clean.register(event.reset);\n  };\n\n  const getInternalState = () => {\n    return ZalgoPromise.try(() => {\n      if (getInternalStateOverride) {\n        return getInternalStateOverride();\n      }\n\n      return internalState;\n    });\n  };\n\n  const setInternalState = (newInternalState) => {\n    return ZalgoPromise.try(() => {\n      if (setInternalStateOverride) {\n        return setInternalStateOverride(newInternalState);\n      }\n\n      internalState = { ...internalState, ...newInternalState };\n      return internalState;\n    });\n  };\n\n  const getProxyWindow = (): ZalgoPromise<ProxyWindow> => {\n    if (getProxyWindowOverride) {\n      return getProxyWindowOverride();\n    }\n\n    return ZalgoPromise.try(() => {\n      const windowProp = props.window;\n\n      if (windowProp) {\n        const proxyWin = toProxyWindow(windowProp);\n        clean.register(() => windowProp.close());\n        return proxyWin;\n      }\n\n      return new ProxyWindow({ send });\n    });\n  };\n\n  const setProxyWin = (proxyWin: ProxyWindow): ZalgoPromise<void> => {\n    if (setProxyWinOverride) {\n      return setProxyWinOverride(proxyWin);\n    }\n\n    return ZalgoPromise.try(() => {\n      currentProxyWin = proxyWin;\n    });\n  };\n\n  const show = (): ZalgoPromise<void> => {\n    if (showOverride) {\n      return showOverride();\n    }\n\n    return ZalgoPromise.hash({\n      setState: setInternalState({ visible: true }),\n      showElement: currentProxyContainer\n        ? currentProxyContainer.get().then(showElement)\n        : null,\n    }).then(noop);\n  };\n\n  const hide = (): ZalgoPromise<void> => {\n    if (hideOverride) {\n      return hideOverride();\n    }\n\n    return ZalgoPromise.hash({\n      setState: setInternalState({ visible: false }),\n      showElement: currentProxyContainer\n        ? currentProxyContainer.get().then(hideElement)\n        : null,\n    }).then(noop);\n  };\n\n  const getUrl = (): string => {\n    if (typeof url === \"function\") {\n      return url({ props });\n    }\n\n    return url;\n  };\n\n  const getAttributes = (): AttributesType => {\n    if (typeof attributes === \"function\") {\n      return attributes({ props });\n    }\n\n    return attributes;\n  };\n\n  const buildQuery = (): ZalgoPromise<{| [string]: string | boolean |}> => {\n    return serializeProps(propsDef, props, METHOD.GET);\n  };\n\n  const buildBody = (): ZalgoPromise<{| [string]: string | boolean |}> => {\n    return serializeProps(propsDef, props, METHOD.POST);\n  };\n\n  const buildUrl = (): ZalgoPromise<string> => {\n    return buildQuery().then((query) => {\n      return extendUrl(normalizeMockUrl(getUrl()), { query });\n    });\n  };\n\n  const getInitialChildDomain = (): string => {\n    return getDomainFromUrl(getUrl());\n  };\n\n  const getDomainMatcher = (): DomainMatcher => {\n    if (domainMatch) {\n      return domainMatch;\n    }\n\n    return getInitialChildDomain();\n  };\n\n  const openFrame = (\n    context: $Values<typeof CONTEXT>,\n    { windowName }: {| windowName: string |}\n  ): ZalgoPromise<?ProxyObject<HTMLIFrameElement>> => {\n    if (openFrameOverride) {\n      return openFrameOverride(context, { windowName });\n    }\n\n    return ZalgoPromise.try(() => {\n      if (context === CONTEXT.IFRAME && __ZOID__.__IFRAME_SUPPORT__) {\n        // $FlowFixMe\n        const attrs = {\n          name: windowName,\n          title: name,\n          ...getAttributes().iframe,\n        };\n\n        return getProxyObject(iframe({ attributes: attrs }));\n      }\n    });\n  };\n\n  const openPrerenderFrame = (\n    context: $Values<typeof CONTEXT>\n  ): ZalgoPromise<?ProxyObject<HTMLIFrameElement>> => {\n    if (openPrerenderFrameOverride) {\n      return openPrerenderFrameOverride(context);\n    }\n\n    return ZalgoPromise.try(() => {\n      if (context === CONTEXT.IFRAME && __ZOID__.__IFRAME_SUPPORT__) {\n        // $FlowFixMe\n        const attrs = {\n          name: `__${ZOID}_prerender_frame__${name}_${uniqueID()}__`,\n          title: `prerender__${name}`,\n          ...getAttributes().iframe,\n        };\n        return getProxyObject(\n          iframe({\n            attributes: attrs,\n          })\n        );\n      }\n    });\n  };\n\n  const openPrerender = (\n    context: $Values<typeof CONTEXT>,\n    proxyWin: ProxyWindow,\n    proxyPrerenderFrame: ?ProxyObject<HTMLIFrameElement>\n  ): ZalgoPromise<ProxyWindow> => {\n    if (openPrerenderOverride) {\n      return openPrerenderOverride(context, proxyWin, proxyPrerenderFrame);\n    }\n\n    return ZalgoPromise.try(() => {\n      if (context === CONTEXT.IFRAME && __ZOID__.__IFRAME_SUPPORT__) {\n        if (!proxyPrerenderFrame) {\n          throw new Error(`Expected proxy frame to be passed`);\n        }\n\n        return proxyPrerenderFrame.get().then((prerenderFrame) => {\n          clean.register(() => destroyElement(prerenderFrame));\n\n          return awaitFrameWindow(prerenderFrame)\n            .then((prerenderFrameWindow) => {\n              return assertSameDomain(prerenderFrameWindow);\n            })\n            .then((win) => {\n              return toProxyWindow(win);\n            });\n        });\n      } else if (context === CONTEXT.POPUP && __ZOID__.__POPUP_SUPPORT__) {\n        return proxyWin;\n      } else {\n        throw new Error(`No render context available for ${context}`);\n      }\n    });\n  };\n\n  const focus = (): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      if (currentProxyWin) {\n        return ZalgoPromise.all([\n          event.trigger(EVENT.FOCUS),\n          currentProxyWin.focus(),\n        ]).then(noop);\n      }\n    });\n  };\n\n  const getCurrentWindowReferenceUID = (): string => {\n    const global = getGlobal(window);\n    global.windows = global.windows || {};\n    global.windows[uid] = window;\n    clean.register(() => {\n      delete global.windows[uid];\n    });\n    return uid;\n  };\n\n  const getWindowRef = (\n    target: CrossDomainWindowType,\n    initialChildDomain: string,\n    context: $Values<typeof CONTEXT>,\n    proxyWin: ProxyWindow\n  ): WindowRef => {\n    if (initialChildDomain === getDomain(window)) {\n      return {\n        type: WINDOW_REFERENCE.GLOBAL,\n        uid: getCurrentWindowReferenceUID(),\n      };\n    }\n\n    if (target !== window) {\n      throw new Error(\n        `Can not construct cross-domain window reference for different target window`\n      );\n    }\n\n    if (props.window) {\n      const actualComponentWindow = proxyWin.getWindow();\n      if (!actualComponentWindow) {\n        throw new Error(\n          `Can not construct cross-domain window reference for lazy window prop`\n        );\n      }\n\n      if (getAncestor(actualComponentWindow) !== window) {\n        throw new Error(\n          `Can not construct cross-domain window reference for window prop with different ancestor`\n        );\n      }\n    }\n\n    if (context === CONTEXT.POPUP) {\n      return { type: WINDOW_REFERENCE.OPENER };\n    } else if (context === CONTEXT.IFRAME) {\n      return {\n        type: WINDOW_REFERENCE.PARENT,\n        distance: getDistanceFromTop(window),\n      };\n    }\n\n    throw new Error(`Can not construct window reference for child`);\n  };\n\n  const runTimeout = (): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      const timeout = props.timeout;\n\n      if (timeout) {\n        return initPromise.timeout(\n          timeout,\n          new Error(`Loading component timed out after ${timeout} milliseconds`)\n        );\n      }\n    });\n  };\n\n  const initChild = (\n    childDomain: string,\n    childExports: ChildExportsType<P>\n  ): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      currentChildDomain = childDomain;\n      childComponent = childExports;\n\n      currentProxyWin\n        ?.isPopup()\n        .then((isPopup) => {\n          if (childExports?.name !== \"\" && isPopup) {\n            currentProxyWin?.setName(childExports?.name);\n          }\n        })\n        .finally(() => {\n          resolveInitPromise();\n          clean.register(() => childExports.close.fireAndForget().catch(noop));\n        });\n    });\n  };\n\n  const resize = ({\n    width,\n    height,\n  }: {|\n    width?: ?number,\n    height?: ?number,\n  |}): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      event.trigger(EVENT.RESIZE, { width, height });\n    });\n  };\n\n  const destroy = (err: mixed): ZalgoPromise<void> => {\n    // eslint-disable-next-line promise/no-promise-in-callback\n    return ZalgoPromise.try(() => {\n      return event.trigger(EVENT.DESTROY);\n    })\n      .catch(noop)\n      .then(() => {\n        return clean.all(err);\n      })\n      .then(() => {\n        const error = err || new Error(COMPONENT_ERROR.COMPONENT_DESTROYED);\n        if (\n          (currentContainer && isElementClosed(currentContainer)) ||\n          // $FlowFixMe\n          Object.values(COMPONENT_ERROR).includes(error.message)\n        ) {\n          initPromise.resolve();\n        } else {\n          initPromise.asyncReject(error);\n        }\n      });\n  };\n\n  const close = memoize((err?: mixed): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      if (closeOverride) {\n        // $FlowFixMe\n        const source = closeOverride.__source__;\n\n        if (isWindowClosed(source)) {\n          return;\n        }\n\n        return closeOverride();\n      }\n\n      return ZalgoPromise.try(() => {\n        return event.trigger(EVENT.CLOSE);\n      }).then(() => {\n        return destroy(err || new Error(COMPONENT_ERROR.COMPONENT_CLOSED));\n      });\n    });\n  });\n\n  const open = (\n    context: $Values<typeof CONTEXT>,\n    {\n      proxyWin,\n      proxyFrame,\n      windowName,\n    }: {|\n      proxyWin: ProxyWindow,\n      proxyFrame: ?ProxyObject<HTMLIFrameElement>,\n      windowName: string,\n    |}\n  ): ZalgoPromise<ProxyWindow> => {\n    if (openOverride) {\n      return openOverride(context, { proxyWin, proxyFrame, windowName });\n    }\n\n    return ZalgoPromise.try(() => {\n      if (context === CONTEXT.IFRAME && __ZOID__.__IFRAME_SUPPORT__) {\n        if (!proxyFrame) {\n          throw new Error(`Expected proxy frame to be passed`);\n        }\n\n        return proxyFrame.get().then((frame) => {\n          return awaitFrameWindow(frame).then((win) => {\n            clean.register(() => destroyElement(frame));\n            clean.register(() => cleanUpWindow(win));\n            return win;\n          });\n        });\n      } else if (context === CONTEXT.POPUP && __ZOID__.__POPUP_SUPPORT__) {\n        let {\n          width = DEFAULT_DIMENSIONS.WIDTH,\n          height = DEFAULT_DIMENSIONS.HEIGHT,\n        } = getDimensions();\n\n        width = normalizeDimension(width, window.outerWidth);\n        height = normalizeDimension(height, window.outerWidth);\n\n        // $FlowFixMe\n        const attrs = {\n          name: windowName,\n          width,\n          height,\n          ...getAttributes().popup,\n        };\n\n        const win = popup(\"\", attrs);\n\n        clean.register(() => closeWindow(win));\n        clean.register(() => cleanUpWindow(win));\n\n        return win;\n      } else {\n        throw new Error(`No render context available for ${context}`);\n      }\n    }).then((win) => {\n      proxyWin.setWindow(win, { send });\n      return proxyWin.setName(windowName).then(() => {\n        return proxyWin;\n      });\n    });\n  };\n\n  const watchForUnload = () => {\n    return ZalgoPromise.try(() => {\n      const eventname = \"onpagehide\" in window ? \"pagehide\" : \"unload\";\n      let bfcacheEnterTime: ?number = null;\n\n      const unloadWindowListener = addEventListener(\n        window,\n        eventname,\n        (evt) => {\n          const persisted = evt instanceof PageTransitionEvent && evt.persisted;\n          if (persisted) {\n            bfcacheEnterTime = Date.now();\n            event.trigger(EVENT.BFCACHE_CACHE);\n          }\n          destroy(new Error(COMPONENT_ERROR.NAVIGATED_AWAY));\n        }\n      );\n\n      if (\"onpageshow\" in window) {\n        const pageshowListener = addEventListener(window, \"pageshow\", (evt) => {\n          const persisted = evt instanceof PageTransitionEvent && evt.persisted;\n          if (persisted) {\n            // Flow can't narrow ?number through closures in ternaries, so capture locally first\n            const enterTime = bfcacheEnterTime;\n            const cachedDurationMs =\n              enterTime !== null && enterTime !== undefined\n                ? Date.now() - enterTime\n                : null;\n            bfcacheEnterTime = null;\n            event.trigger(EVENT.BFCACHE_RESTORE, { cachedDurationMs });\n          }\n        });\n        clean.register(pageshowListener.cancel);\n      }\n\n      const closeParentWindowListener = onCloseWindow(parentWin, destroy, 3000);\n      clean.register(closeParentWindowListener.cancel);\n      clean.register(unloadWindowListener.cancel);\n\n      if (watchForUnloadOverride) {\n        return watchForUnloadOverride();\n      }\n    });\n  };\n\n  const watchForClose = (\n    proxyWin: ProxyWindow,\n    context: $Values<typeof CONTEXT>\n  ): ZalgoPromise<void> => {\n    let cancelled = false;\n\n    clean.register(() => {\n      cancelled = true;\n    });\n\n    return ZalgoPromise.delay(2000)\n      .then(() => {\n        return proxyWin.isClosed();\n      })\n      .then((isClosed) => {\n        if (!cancelled) {\n          if (context === CONTEXT.POPUP && isClosed) {\n            return close(new Error(\"Detected popup close\"));\n          }\n\n          const isCurrentContainerClosed: boolean = Boolean(\n            currentContainer && isElementClosed(currentContainer)\n          );\n\n          if (\n            context === CONTEXT.IFRAME &&\n            isClosed &&\n            (isCurrentContainerClosed || isRenderFinished)\n          ) {\n            return close(new Error(COMPONENT_ERROR.IFRAME_CLOSE));\n          }\n\n          return watchForClose(proxyWin, context);\n        }\n      });\n  };\n\n  const checkWindowClose = (proxyWin: ProxyWindow): ZalgoPromise<boolean> => {\n    let closed = false;\n\n    return proxyWin\n      .isClosed()\n      .then((isClosed) => {\n        if (isClosed) {\n          closed = true;\n          return close(new Error(COMPONENT_ERROR.WINDOW_CLOSED));\n        }\n\n        return ZalgoPromise.delay(200)\n          .then(() => proxyWin.isClosed())\n          .then((secondIsClosed) => {\n            if (secondIsClosed) {\n              closed = true;\n              return close(new Error(COMPONENT_ERROR.WINDOW_CLOSED));\n            }\n          });\n      })\n      .then(() => {\n        return closed;\n      });\n  };\n\n  const onError = (err: mixed): ZalgoPromise<void> => {\n    if (onErrorOverride) {\n      return onErrorOverride(err);\n    }\n\n    return ZalgoPromise.try(() => {\n      if (handledErrors.indexOf(err) !== -1) {\n        return;\n      }\n\n      handledErrors.push(err);\n      initPromise.asyncReject(err);\n\n      return event.trigger(EVENT.ERROR, err);\n    });\n  };\n\n  const exportsPromise: ZalgoPromise<X> = new ZalgoPromise();\n\n  const getExports = (): X => {\n    return xports({\n      getExports: () => exportsPromise,\n    });\n  };\n\n  const xport = (actualExports: X): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      exportsPromise.resolve(actualExports);\n    });\n  };\n\n  initChild.onError = onError;\n\n  const buildParentExports = (win: ProxyWindow): ParentExportsType<P, X> => {\n    const checkClose = () => checkWindowClose(win);\n    function init(childExports: ChildExportsType<P>): ZalgoPromise<void> {\n      return initChild(this.origin, childExports);\n    }\n    return {\n      init,\n      close,\n      checkClose,\n      resize,\n      onError,\n      show,\n      hide,\n      export: xport,\n    };\n  };\n\n  const buildInitialChildPayload = ({\n    proxyWin,\n    initialChildDomain,\n    childDomainMatch,\n    context,\n  }: {|\n    proxyWin: ProxyWindow,\n    initialChildDomain: string,\n    childDomainMatch: DomainMatcher,\n    context: $Values<typeof CONTEXT>,\n  |} = {}): ZalgoPromise<InitialChildPayload<P, X>> => {\n    return getPropsForChild(initialChildDomain).then((childProps) => {\n      return {\n        uid,\n        context,\n        tag,\n        childDomainMatch,\n        version: __ZOID__.__VERSION__,\n        props: childProps,\n        exports: buildParentExports(proxyWin),\n      };\n    });\n  };\n\n  const buildSerializedChildPayload = ({\n    proxyWin,\n    initialChildDomain,\n    childDomainMatch,\n    target = window,\n    context,\n  }: {|\n    proxyWin: ProxyWindow,\n    initialChildDomain: string,\n    childDomainMatch: DomainMatcher,\n    target: CrossDomainWindowType,\n    context: $Values<typeof CONTEXT>,\n  |} = {}): ZalgoPromise<string> => {\n    return buildInitialChildPayload({\n      proxyWin,\n      initialChildDomain,\n      childDomainMatch,\n      context,\n    }).then((childPayload) => {\n      const { serializedData, cleanReference } = crossDomainSerialize({\n        data: childPayload,\n        metaData: {\n          windowRef: getWindowRef(\n            target,\n            initialChildDomain,\n            context,\n            proxyWin\n          ),\n        },\n        sender: {\n          domain: getDomain(window),\n        },\n        receiver: {\n          win: proxyWin,\n          domain: childDomainMatch,\n        },\n        passByReference: initialChildDomain === getDomain(),\n      });\n\n      clean.register(cleanReference);\n      return serializedData;\n    });\n  };\n\n  const buildWindowName = ({\n    proxyWin,\n    initialChildDomain,\n    childDomainMatch,\n    target,\n    context,\n  }: {|\n    proxyWin: ProxyWindow,\n    initialChildDomain: string,\n    childDomainMatch: DomainMatcher,\n    target: CrossDomainWindowType,\n    context: $Values<typeof CONTEXT>,\n  |}): ZalgoPromise<string> => {\n    return buildSerializedChildPayload({\n      proxyWin,\n      initialChildDomain,\n      childDomainMatch,\n      target,\n      context,\n    }).then((serializedPayload) => {\n      return buildChildWindowName({ name, serializedPayload });\n    });\n  };\n\n  const renderTemplate = (\n    renderer: (RenderOptionsType<P>) => ?HTMLElement,\n    {\n      context,\n      container,\n      doc,\n      frame,\n      prerenderFrame,\n    }: {|\n      context: $Values<typeof CONTEXT>,\n      container?: HTMLElement,\n      doc: Document,\n      frame?: ?HTMLIFrameElement,\n      prerenderFrame?: ?HTMLIFrameElement,\n    |}\n  ): ?HTMLElement => {\n    return renderer({\n      uid,\n      container,\n      context,\n      doc,\n      frame,\n      prerenderFrame,\n      focus,\n      close,\n      state,\n      props,\n      tag,\n      dimensions: getDimensions(),\n      event,\n    });\n  };\n\n  const prerender = (\n    proxyPrerenderWin: ProxyWindow,\n    { context }: {| context: $Values<typeof CONTEXT> |}\n  ): ZalgoPromise<void> => {\n    if (prerenderOverride) {\n      return prerenderOverride(proxyPrerenderWin, { context });\n    }\n\n    return ZalgoPromise.try(() => {\n      if (!prerenderTemplate) {\n        return;\n      }\n\n      event.trigger(EVENT.PRERENDER);\n\n      let prerenderWindow = proxyPrerenderWin.getWindow();\n\n      if (\n        !prerenderWindow ||\n        !isSameDomain(prerenderWindow) ||\n        !isBlankDomain(prerenderWindow)\n      ) {\n        return;\n      }\n\n      prerenderWindow = assertSameDomain(prerenderWindow);\n\n      const doc = prerenderWindow.document;\n      const el = renderTemplate(prerenderTemplate, { context, doc });\n\n      if (!el) {\n        return;\n      }\n\n      if (el.ownerDocument !== doc) {\n        throw new Error(\n          `Expected prerender template to have been created with document from child window`\n        );\n      }\n\n      writeElementToWindow(prerenderWindow, el);\n\n      let { width = false, height = false, element = \"body\" } = autoResize;\n      element = getElementSafe(element, doc);\n\n      if (element && (width || height)) {\n        const prerenderResizeListener = onResize(\n          element,\n          ({ width: newWidth, height: newHeight }) => {\n            resize({\n              width: width ? newWidth : undefined,\n              height: height ? newHeight : undefined,\n            });\n          },\n          { width, height, win: prerenderWindow }\n        );\n\n        event.on(EVENT.RENDERED, prerenderResizeListener.cancel);\n      }\n      event.trigger(EVENT.PRERENDERED);\n    });\n  };\n  const renderContainer: RenderContainer = (\n    proxyContainer: ProxyObject<HTMLElement>,\n    {\n      proxyFrame,\n      proxyPrerenderFrame,\n      context,\n      rerender,\n    }: RenderContainerOptions\n  ): ZalgoPromise<?ProxyObject<HTMLElement>> => {\n    if (renderContainerOverride) {\n      return renderContainerOverride(proxyContainer, {\n        proxyFrame,\n        proxyPrerenderFrame,\n        context,\n        rerender,\n      });\n    }\n\n    return ZalgoPromise.hash({\n      container: proxyContainer.get(),\n      // $FlowFixMe\n      frame: proxyFrame ? proxyFrame.get() : null,\n      // $FlowFixMe\n      prerenderFrame: proxyPrerenderFrame ? proxyPrerenderFrame.get() : null,\n      internalState: getInternalState(),\n    }).then(\n      ({ container, frame, prerenderFrame, internalState: { visible } }) => {\n        const innerContainer = renderTemplate(containerTemplate, {\n          context,\n          container,\n          frame,\n          prerenderFrame,\n          doc: document,\n        });\n        if (innerContainer) {\n          if (!visible) {\n            hideElement(innerContainer);\n          }\n          appendChild(container, innerContainer);\n          const containerWatcher = watchElementForClose(innerContainer, () => {\n            const removeError = new Error(\n              `Detected container element removed from DOM`\n            );\n            return ZalgoPromise.delay(1).then(() => {\n              if (isElementClosed(innerContainer)) {\n                close(removeError);\n              } else {\n                clean.all(removeError);\n                return rerender().then(resolveInitPromise, rejectInitPromise);\n              }\n            });\n          });\n\n          clean.register(() => containerWatcher.cancel());\n          clean.register(() => destroyElement(innerContainer));\n          currentProxyContainer = getProxyObject(innerContainer);\n          return currentProxyContainer;\n        }\n      }\n    );\n  };\n\n  const getBridgeUrl = (): ?string => {\n    if (typeof options.bridgeUrl === \"function\") {\n      return options.bridgeUrl({ props });\n    }\n\n    return options.bridgeUrl;\n  };\n\n  const openBridge = (\n    proxyWin: ProxyWindow,\n    initialChildDomain: string,\n    context: $Values<typeof CONTEXT>\n  ): ?ZalgoPromise<?CrossDomainWindowType> => {\n    if (__POST_ROBOT__.__IE_POPUP_SUPPORT__) {\n      return ZalgoPromise.try(() => {\n        return proxyWin.awaitWindow();\n      }).then((win) => {\n        if (\n          !bridge ||\n          !bridge.needsBridge({ win, domain: initialChildDomain }) ||\n          bridge.hasBridge(initialChildDomain, initialChildDomain)\n        ) {\n          return;\n        }\n\n        const bridgeUrl = getBridgeUrl();\n\n        if (!bridgeUrl) {\n          throw new Error(`Bridge needed to render ${context}`);\n        }\n\n        const bridgeDomain = getDomainFromUrl(bridgeUrl);\n        bridge.linkUrl(win, initialChildDomain);\n        return bridge.openBridge(normalizeMockUrl(bridgeUrl), bridgeDomain);\n      });\n    }\n  };\n\n  const getHelpers = (): ParentHelpers<P> => {\n    return {\n      state,\n      event,\n      close,\n      focus,\n      resize,\n      onError,\n      // eslint-disable-next-line no-use-before-define\n      updateProps,\n      show,\n      hide,\n    };\n  };\n\n  const getProps = () => props;\n\n  const getDefaultPropsInput = (): PropsInputType<P> => {\n    // $FlowFixMe\n    return {};\n  };\n\n  const setProps = (\n    newInputProps: PropsInputType<P> = getDefaultPropsInput()\n  ) => {\n    if (__DEBUG__ && validate) {\n      validate({ props: newInputProps });\n    }\n\n    const container = currentContainer;\n    const helpers = getHelpers();\n    extend(inputProps, newInputProps);\n\n    // $FlowFixMe\n    extendProps(propsDef, props, inputProps, helpers, container);\n  };\n\n  const updateProps = (newProps: PropsInputType<P>): ZalgoPromise<void> => {\n    setProps(newProps);\n\n    return initPromise.then(() => {\n      const child = childComponent;\n      const proxyWin = currentProxyWin;\n      const childDomain = currentChildDomain;\n\n      if (!child || !proxyWin || !childDomain) {\n        return;\n      }\n\n      return getPropsForChild(childDomain).then((childProps) => {\n        return child.updateProps(childProps).catch((err) => {\n          return checkWindowClose(proxyWin).then((closed) => {\n            if (!closed) {\n              throw err;\n            }\n          });\n        });\n      });\n    });\n  };\n\n  const getProxyContainer: GetProxyContainer = (\n    container: ContainerReferenceType\n  ): ZalgoPromise<ProxyObject<HTMLElement>> => {\n    if (getProxyContainerOverride) {\n      return getProxyContainerOverride(container);\n    }\n\n    return ZalgoPromise.try(() => {\n      return elementReady(container);\n    }).then((containerElement) => {\n      if (isShadowElement(containerElement)) {\n        containerElement = insertShadowSlot(containerElement);\n      }\n\n      currentContainer = containerElement;\n      return getProxyObject(containerElement);\n    });\n  };\n\n  const delegate = (\n    context: $Values<typeof CONTEXT>,\n    target: CrossDomainWindowType\n  ): ZalgoPromise<DelegateOverrides> => {\n    const delegateProps = {};\n    for (const propName of Object.keys(props)) {\n      const propDef = propsDef[propName];\n      if (propDef && propDef.allowDelegate) {\n        delegateProps[propName] = props[propName];\n      }\n    }\n\n    const childOverridesPromise = send(\n      target,\n      `${POST_MESSAGE.DELEGATE}_${name}`,\n      {\n        uid,\n        overrides: {\n          props: delegateProps,\n          event,\n          close,\n          onError,\n          getInternalState,\n          setInternalState,\n          resolveInitPromise,\n          rejectInitPromise,\n        },\n      }\n    )\n      .then(({ data: { parent } }) => {\n        const parentComp: ParentComponent<P, X> = parent;\n\n        clean.register((err) => {\n          if (!isWindowClosed(target)) {\n            return parentComp.destroy(err);\n          }\n        });\n        return parentComp.getDelegateOverrides();\n      })\n      .catch((err) => {\n        throw new Error(\n          `Unable to delegate rendering. Possibly the component is not loaded in the target window.\\n\\n${stringifyError(\n            err\n          )}`\n        );\n      });\n\n    getProxyContainerOverride = (...args) =>\n      childOverridesPromise.then((childOverrides) =>\n        childOverrides.getProxyContainer(...args)\n      );\n    renderContainerOverride = (...args) =>\n      childOverridesPromise.then((childOverrides) =>\n        childOverrides.renderContainer(...args)\n      );\n    showOverride = (...args) =>\n      childOverridesPromise.then((childOverrides) =>\n        childOverrides.show(...args)\n      );\n    hideOverride = (...args) =>\n      childOverridesPromise.then((childOverrides) =>\n        childOverrides.hide(...args)\n      );\n    watchForUnloadOverride = (...args) =>\n      childOverridesPromise.then((childOverrides) =>\n        childOverrides.watchForUnload(...args)\n      );\n\n    if (context === CONTEXT.IFRAME && __ZOID__.__IFRAME_SUPPORT__) {\n      getProxyWindowOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.getProxyWindow(...args)\n        );\n      openFrameOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.openFrame(...args)\n        );\n      openPrerenderFrameOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.openPrerenderFrame(...args)\n        );\n      prerenderOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.prerender(...args)\n        );\n      openOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.open(...args)\n        );\n      openPrerenderOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.openPrerender(...args)\n        );\n    } else if (context === CONTEXT.POPUP && __ZOID__.__POPUP_SUPPORT__) {\n      setProxyWinOverride = (...args) =>\n        childOverridesPromise.then((childOverrides) =>\n          childOverrides.setProxyWin(...args)\n        );\n    }\n\n    return childOverridesPromise;\n  };\n\n  const getDelegateOverrides = (): ZalgoPromise<DelegateOverrides> => {\n    return ZalgoPromise.try(() => {\n      return {\n        getProxyContainer,\n        show,\n        hide,\n        renderContainer,\n        getProxyWindow,\n        watchForUnload,\n        openFrame,\n        openPrerenderFrame,\n        prerender,\n        open,\n        openPrerender,\n        setProxyWin,\n      };\n    });\n  };\n\n  const checkAllowRender = (\n    target: CrossDomainWindowType,\n    childDomainMatch: DomainMatcher,\n    container: ContainerReferenceType\n  ) => {\n    if (target === window) {\n      return;\n    }\n\n    if (!isSameTopWindow(window, target)) {\n      throw new Error(`Can only renderTo an adjacent frame`);\n    }\n\n    const origin = getDomain();\n\n    if (!matchDomain(childDomainMatch, origin) && !isSameDomain(target)) {\n      throw new Error(\n        `Can not render remotely to ${childDomainMatch.toString()} - can only render to ${origin}`\n      );\n    }\n\n    if (container && typeof container !== \"string\") {\n      throw new Error(\n        `Container passed to renderTo must be a string selector, got ${typeof container} }`\n      );\n    }\n  };\n\n  const init = () => {\n    setupEvents();\n  };\n\n  const render = ({\n    target,\n    container,\n    context,\n    rerender,\n  }: RenderOptions): ZalgoPromise<void> => {\n    return ZalgoPromise.try(() => {\n      const initialChildDomain = getInitialChildDomain();\n      const childDomainMatch = getDomainMatcher();\n\n      checkAllowRender(target, childDomainMatch, container);\n\n      const delegatePromise = ZalgoPromise.try(() => {\n        if (target !== window) {\n          return delegate(context, target);\n        }\n      });\n\n      const windowProp = props.window;\n\n      const watchForUnloadPromise = watchForUnload();\n\n      const buildBodyPromise = buildBody();\n      const onRenderPromise = event.trigger(EVENT.RENDER);\n\n      const getProxyContainerPromise = getProxyContainer(container);\n      const getProxyWindowPromise = getProxyWindow();\n\n      const finalSetPropsPromise = getProxyContainerPromise.then(() => {\n        return setProps();\n      });\n\n      const buildUrlPromise = finalSetPropsPromise.then(() => {\n        return buildUrl();\n      });\n\n      const buildWindowNamePromise = getProxyWindowPromise.then((proxyWin) => {\n        return buildWindowName({\n          proxyWin,\n          initialChildDomain,\n          childDomainMatch,\n          target,\n          context,\n        });\n      });\n\n      const openFramePromise = buildWindowNamePromise.then((windowName) =>\n        openFrame(context, { windowName })\n      );\n      const openPrerenderFramePromise = openPrerenderFrame(context);\n\n      const renderContainerPromise = ZalgoPromise.hash({\n        proxyContainer: getProxyContainerPromise,\n        proxyFrame: openFramePromise,\n        proxyPrerenderFrame: openPrerenderFramePromise,\n      })\n        .then(({ proxyContainer, proxyFrame, proxyPrerenderFrame }) => {\n          return renderContainer(proxyContainer, {\n            context,\n            proxyFrame,\n            proxyPrerenderFrame,\n            rerender,\n          });\n        })\n        .then((proxyContainer) => {\n          return proxyContainer;\n        });\n\n      const openPromise = ZalgoPromise.hash({\n        windowName: buildWindowNamePromise,\n        proxyFrame: openFramePromise,\n        proxyWin: getProxyWindowPromise,\n      }).then(({ windowName, proxyWin, proxyFrame }) => {\n        return windowProp\n          ? proxyWin\n          : open(context, { windowName, proxyWin, proxyFrame });\n      });\n\n      const openPrerenderPromise = ZalgoPromise.hash({\n        proxyWin: openPromise,\n        proxyPrerenderFrame: openPrerenderFramePromise,\n      }).then(({ proxyWin, proxyPrerenderFrame }) => {\n        return openPrerender(context, proxyWin, proxyPrerenderFrame);\n      });\n\n      const setStatePromise = openPromise.then((proxyWin) => {\n        currentProxyWin = proxyWin;\n        return setProxyWin(proxyWin);\n      });\n\n      const prerenderPromise = ZalgoPromise.hash({\n        proxyPrerenderWin: openPrerenderPromise,\n        state: setStatePromise,\n      }).then(({ proxyPrerenderWin }) => {\n        return prerender(proxyPrerenderWin, { context });\n      });\n\n      const setWindowNamePromise = ZalgoPromise.hash({\n        proxyWin: openPromise,\n        windowName: buildWindowNamePromise,\n      }).then(({ proxyWin, windowName }) => {\n        if (windowProp) {\n          return proxyWin.setName(windowName);\n        }\n      });\n\n      const getMethodPromise = ZalgoPromise.hash({\n        body: buildBodyPromise,\n      }).then(({ body }) => {\n        if (options.method) {\n          return options.method;\n        }\n\n        if (Object.keys(body).length) {\n          return METHOD.POST;\n        }\n\n        return METHOD.GET;\n      });\n\n      const loadUrlPromise = ZalgoPromise.hash({\n        proxyWin: openPromise,\n        windowUrl: buildUrlPromise,\n        body: buildBodyPromise,\n        method: getMethodPromise,\n        windowName: setWindowNamePromise,\n        prerender: prerenderPromise,\n      }).then(({ proxyWin, windowUrl, body, method }) => {\n        return proxyWin.setLocation(windowUrl, { method, body });\n      });\n\n      const watchForClosePromise = openPromise.then((proxyWin) => {\n        watchForClose(proxyWin, context);\n      });\n\n      const onDisplayPromise = ZalgoPromise.hash({\n        container: renderContainerPromise,\n        prerender: prerenderPromise,\n      }).then(() => {\n        return event.trigger(EVENT.DISPLAY);\n      });\n\n      const openBridgePromise = openPromise.then((proxyWin) => {\n        return openBridge(proxyWin, initialChildDomain, context);\n      });\n\n      const runTimeoutPromise = loadUrlPromise.then(() => {\n        return runTimeout();\n      });\n\n      const onRenderedPromise = initPromise.then(() => {\n        isRenderFinished = true;\n        return event.trigger(EVENT.RENDERED);\n      });\n\n      return ZalgoPromise.hash({\n        initPromise,\n        buildUrlPromise,\n        onRenderPromise,\n        getProxyContainerPromise,\n        openFramePromise,\n        openPrerenderFramePromise,\n        renderContainerPromise,\n        openPromise,\n        openPrerenderPromise,\n        setStatePromise,\n        prerenderPromise,\n        loadUrlPromise,\n        buildWindowNamePromise,\n        setWindowNamePromise,\n        watchForClosePromise,\n        onDisplayPromise,\n        openBridgePromise,\n        runTimeoutPromise,\n        onRenderedPromise,\n        delegatePromise,\n        watchForUnloadPromise,\n        finalSetPropsPromise,\n      });\n    })\n      .catch((err) => {\n        return ZalgoPromise.all([onError(err), destroy(err)]).then(\n          () => {\n            throw err;\n          },\n          () => {\n            throw err;\n          }\n        );\n      })\n      .then(noop);\n  };\n\n  return {\n    init,\n    render,\n    destroy,\n    getProps,\n    setProps,\n    export: xport,\n    getHelpers,\n    getDelegateOverrides,\n    getExports,\n  };\n}\n"
  },
  {
    "path": "src/parent/props.js",
    "content": "/* @flow */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { dotify, isDefined, base64encode, noop } from \"@krakenjs/belter/src\";\n\nimport {\n  eachProp,\n  mapProps,\n  type PropsInputType,\n  type PropsType,\n  type PropsDefinitionType,\n} from \"../component/props\";\nimport { PROP_SERIALIZATION, METHOD, PROP_TYPE } from \"../constants\";\n\nimport type { ParentHelpers } from \"./index\";\n\nexport function extendProps<P, X>(\n  propsDef: PropsDefinitionType<P, X>,\n  existingProps: PropsType<P>,\n  inputProps: PropsInputType<P>,\n  helpers: ParentHelpers<P>,\n  container: HTMLElement | void\n) {\n  const { state, close, focus, event, onError } = helpers;\n\n  // $FlowFixMe\n  eachProp(inputProps, propsDef, (key, propDef, val) => {\n    let valueDetermined = false;\n    let value = val;\n\n    const getDerivedValue = () => {\n      if (!propDef) {\n        return value;\n      }\n\n      const alias = propDef.alias;\n      if (alias && !isDefined(val) && isDefined(inputProps[alias])) {\n        value = inputProps[alias];\n      }\n\n      if (propDef.value) {\n        value = propDef.value({\n          props: existingProps,\n          state,\n          close,\n          focus,\n          event,\n          onError,\n          container,\n        });\n      }\n\n      if (propDef.default && !isDefined(value) && !isDefined(inputProps[key])) {\n        value = propDef.default({\n          props: existingProps,\n          state,\n          close,\n          focus,\n          event,\n          onError,\n          container,\n        });\n      }\n\n      if (isDefined(value)) {\n        if (\n          propDef.type === PROP_TYPE.ARRAY\n            ? !Array.isArray(value)\n            : typeof value !== propDef.type\n        ) {\n          throw new TypeError(`Prop is not of type ${propDef.type}: ${key}`);\n        }\n      } else {\n        if (propDef.required !== false && !isDefined(inputProps[key])) {\n          throw new Error(`Expected prop \"${key}\" to be defined`);\n        }\n      }\n\n      if (__DEBUG__ && isDefined(value) && propDef.validate) {\n        // $FlowFixMe\n        propDef.validate({ value, props: inputProps });\n      }\n\n      if (isDefined(value) && propDef.decorate) {\n        // $FlowFixMe\n        value = propDef.decorate({\n          // $FlowFixMe\n          value,\n          props: existingProps,\n          state,\n          close,\n          focus,\n          event,\n          onError,\n          container,\n        });\n      }\n\n      return value;\n    };\n\n    const getter = () => {\n      if (valueDetermined) {\n        return value;\n      }\n\n      valueDetermined = true;\n      return getDerivedValue();\n    };\n\n    Object.defineProperty(existingProps, key, {\n      configurable: true,\n      enumerable: true,\n      get: getter,\n    });\n  });\n\n  // $FlowFixMe\n  eachProp(existingProps, propsDef, noop);\n}\n\nexport function serializeProps<P, X>(\n  propsDef: PropsDefinitionType<P, X>,\n  props: PropsType<P>,\n  method: $Values<typeof METHOD>\n): ZalgoPromise<{ [string]: string | boolean }> {\n  const params = {};\n\n  return ZalgoPromise.all(\n    mapProps(props, propsDef, (key, propDef, value) => {\n      return ZalgoPromise.resolve().then(() => {\n        if (value === null || typeof value === \"undefined\" || !propDef) {\n          return;\n        }\n\n        const getParam = {\n          [METHOD.GET]: propDef.queryParam,\n          [METHOD.POST]: propDef.bodyParam,\n        }[method];\n\n        const getValue = {\n          [METHOD.GET]: propDef.queryValue,\n          [METHOD.POST]: propDef.bodyValue,\n        }[method];\n\n        if (!getParam) {\n          return;\n        }\n\n        return ZalgoPromise.hash({\n          finalParam: ZalgoPromise.try(() => {\n            if (typeof getParam === \"function\") {\n              // $FlowFixMe[incompatible-call]\n              return getParam({ value });\n            } else if (typeof getParam === \"string\") {\n              return getParam;\n            } else {\n              return key;\n            }\n          }),\n\n          finalValue: ZalgoPromise.try(() => {\n            if (typeof getValue === \"function\" && isDefined(value)) {\n              // $FlowFixMe[incompatible-call]\n              // $FlowFixMe[incompatible-return]\n              return getValue({ value });\n            } else {\n              // $FlowFixMe[incompatible-return]\n              return value;\n            }\n          }),\n        }).then(({ finalParam, finalValue }) => {\n          let result;\n\n          if (typeof finalValue === \"boolean\") {\n            result = finalValue.toString();\n          } else if (typeof finalValue === \"string\") {\n            result = finalValue.toString();\n          } else if (typeof finalValue === \"object\" && finalValue !== null) {\n            if (propDef.serialization === PROP_SERIALIZATION.JSON) {\n              result = JSON.stringify(finalValue);\n            } else if (propDef.serialization === PROP_SERIALIZATION.BASE64) {\n              result = base64encode(JSON.stringify(finalValue));\n            } else if (\n              propDef.serialization === PROP_SERIALIZATION.DOTIFY ||\n              !propDef.serialization\n            ) {\n              result = dotify(finalValue, key);\n\n              for (const dotkey of Object.keys(result)) {\n                params[dotkey] = result[dotkey];\n              }\n\n              return;\n            }\n          } else if (typeof finalValue === \"number\") {\n            result = finalValue.toString();\n          }\n\n          params[finalParam] = result;\n        });\n      });\n    })\n  ).then(() => {\n    return params;\n  });\n}\n"
  },
  {
    "path": "src/types.js",
    "content": "/* @flow */\n\n// export something to force webpack to see this as an ES module\nexport const TYPES = true;\n\nexport type DimensionsType = {|\n  width: number,\n  height: number,\n|};\n\nexport type CssDimensionsType = {|\n  width: string,\n  height: string,\n|};\n\nexport type CancelableType = {|\n  cancel: () => void,\n|};\n\nexport type StringMatcherType = string | $ReadOnlyArray<string> | RegExp;\n\nexport type ContainerReferenceType = string | HTMLElement;\n"
  },
  {
    "path": "test/babel.config.js",
    "content": "/* @flow */\n\n// eslint-disable-next-line import/no-commonjs\nmodule.exports = {\n  extends: \"@krakenjs/babel-config-grumbler/babelrc-browser\",\n};\n"
  },
  {
    "path": "test/common.js",
    "content": "/* @flow */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport {\n  isWindowClosed,\n  type CrossDomainWindowType,\n  type SameDomainWindowType,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport { createElement, destroyElement, uniqueID } from \"@krakenjs/belter/src\";\n\nexport function monkeyPatchFunction<T, A>(\n  obj: Object,\n  name: string,\n  handler: ({| call: () => T, args: A |}) => void\n): {| cancel: () => void |} {\n  const original = obj[name];\n\n  if (!original.monkeyPatch) {\n    original.monkeyPatch = {\n      handlers: [],\n    };\n\n    obj[name] = function monkeyPatched(): T {\n      let called = false;\n      let result;\n\n      const call = () => {\n        if (!called) {\n          called = true;\n          result = original.apply(this, arguments);\n        }\n\n        return result;\n      };\n\n      for (const monkeyHandler of original.monkeyPatch.handlers) {\n        monkeyHandler({ args: arguments, call });\n      }\n\n      return call();\n    };\n  }\n\n  original.monkeyPatch.handlers.push(handler);\n\n  const cancel = () => {\n    original.monkeyPatch.handlers.splice(\n      original.monkeyPatch.handlers.indexOf(handler),\n      1\n    );\n  };\n\n  return {\n    cancel,\n  };\n}\n\ntype OnWindowOpenOptions = {|\n  win?: SameDomainWindowType,\n  doc?: HTMLElement,\n  time?: number,\n  namePattern?: RegExp,\n|};\n\ntype OnWindowOpenResult = {|\n  win: SameDomainWindowType,\n  url: ?string,\n  name: ?string,\n  iframe: ?{|\n    element: HTMLIFrameElement,\n  |},\n  popup: ?{|\n    args: [string, ?string, ?string],\n  |},\n|};\n\nexport function onWindowOpen({\n  win = window,\n  doc = win.document,\n  time = 500,\n  namePattern = /.*/,\n}: OnWindowOpenOptions = {}): ZalgoPromise<OnWindowOpenResult> {\n  return new ZalgoPromise((resolve, reject) => {\n    const winOpenMonkeyPatch = monkeyPatchFunction(\n      win,\n      \"open\",\n      ({ call, args }) => {\n        const popup = call();\n        const [url, name] = args;\n\n        if (name.match(namePattern)) {\n          resolve({ win: popup, url, name, popup: { args }, iframe: null });\n          winOpenMonkeyPatch.cancel();\n        }\n      }\n    );\n\n    const createElementMonkeyPatch = monkeyPatchFunction(\n      doc,\n      \"createElement\",\n      ({ call, args: [tagName] }) => {\n        const el = call();\n\n        if (tagName && tagName.toLowerCase() === \"iframe\") {\n          // eslint-disable-next-line prefer-const\n          let timeout;\n\n          const cleanup = () => {\n            createElementMonkeyPatch.cancel();\n            // eslint-disable-next-line no-use-before-define\n            appendChildMonkeyPatch.cancel();\n            clearTimeout(timeout);\n          };\n\n          const check = () => {\n            if (\n              el.contentWindow &&\n              el.name.match(/^__zoid_/) &&\n              el.name.match(namePattern)\n            ) {\n              cleanup();\n              resolve({\n                win: el.contentWindow,\n                url: el.src,\n                name: el.name,\n                iframe: { element: el },\n                popup: null,\n              });\n            }\n          };\n\n          const appendChildMonkeyPatch = monkeyPatchFunction(\n            win.HTMLElement.prototype,\n            \"appendChild\",\n            ({ call: callAppend }) => {\n              callAppend();\n              check();\n            }\n          );\n\n          timeout = setTimeout(() => {\n            cleanup();\n            return reject(new Error(`Window not opened in ${time}ms`));\n          }, time);\n        }\n      }\n    );\n  }).then(({ win: openedWindow, iframe, popup, name, url }) => {\n    if (!openedWindow || isWindowClosed(openedWindow)) {\n      throw new Error(`Expected win to be open`);\n    }\n\n    return { win: openedWindow, name, url, iframe, popup };\n  });\n}\n\nlet isClick = false;\nlet clickTimeout;\n\nfunction doClick() {\n  isClick = true;\n\n  clearTimeout(clickTimeout);\n  clickTimeout = setTimeout(() => {\n    isClick = false;\n  }, 1);\n}\n\nconst HTMLElementClick = window.HTMLElement.prototype.click;\nwindow.HTMLElement.prototype.click = function overrideHTMLElementClick(): void {\n  doClick();\n  return HTMLElementClick.apply(this, arguments);\n};\n\nconst windowOpen = window.open;\nwindow.open = function patchedWindowOpen(): CrossDomainWindowType {\n  if (!isClick) {\n    const win: Object = {\n      closed: true,\n      close() {\n        // pass\n      },\n      location: {\n        href: \"\",\n        pathname: \"\",\n        protocol: \"\",\n        host: \"\",\n        hostname: \"\",\n      },\n    };\n\n    win.parent = win.top = win;\n    win.opener = window;\n\n    return win;\n  }\n\n  return windowOpen.apply(this, arguments);\n};\n\nexport function runOnClick<T>(handler: () => T): T {\n  const testButton = createElement(\n    \"button\",\n    { id: \"testButton\" },\n    document.body\n  );\n  let didError = false;\n  let result;\n  let error;\n  testButton.addEventListener(\"click\", () => {\n    try {\n      result = handler();\n    } catch (err) {\n      didError = true;\n      error = err;\n    }\n  });\n  testButton.click();\n  destroyElement(testButton);\n  if (didError) {\n    throw error;\n  } else {\n    // $FlowFixMe\n    return result;\n  }\n}\n\nexport function getContainer({\n  parent,\n  shadow = false,\n  slots = false,\n  nested = false,\n}: {|\n  parent?: ?HTMLElement,\n  shadow?: boolean,\n  slots?: boolean,\n  nested?: boolean,\n|} = {}): {| container: HTMLElement, destroy: () => void |} {\n  const parentContainer = (parent = parent || document.body);\n\n  if (!parentContainer) {\n    throw new Error(`Expected body to be present`);\n  }\n\n  const container = document.createElement(\"div\");\n  parentContainer.appendChild(container);\n\n  if (!shadow) {\n    return {\n      container,\n      destroy: () => {\n        parentContainer.removeChild(container);\n      },\n    };\n  }\n\n  const customElementName = `zoid-custom-element-${uniqueID()}`;\n  const customSlotName = `zoid-custom-slot-${uniqueID()}`;\n  const innerWrapperName = `zoid-inner-wrapper-${uniqueID()}`;\n\n  const shadowContainer = document.createElement(slots ? \"slot\" : \"div\");\n  shadowContainer.setAttribute(\"name\", customSlotName);\n\n  customElements.define(\n    customElementName,\n    class extends HTMLElement {\n      connectedCallback() {\n        this.attachShadow({ mode: \"open\" });\n\n        const shadowRoot = this.shadowRoot;\n\n        if (!shadowRoot) {\n          throw new Error(`Expected container to have shadowRoot`);\n        }\n\n        shadowRoot.appendChild(shadowContainer);\n      }\n    }\n  );\n\n  customElements.define(\n    innerWrapperName,\n    class extends HTMLElement {\n      connectedCallback() {\n        const shadowRoot = this.attachShadow({ mode: \"open\" });\n        shadowRoot.appendChild(shadowContainer);\n      }\n    }\n  );\n\n  const customElement = document.createElement(customElementName);\n  parentContainer.appendChild(customElement);\n\n  if (nested) {\n    const innerWrapper = document.createElement(innerWrapperName);\n\n    const customElementShadowRoot = customElement.shadowRoot;\n\n    if (customElementShadowRoot) {\n      customElementShadowRoot.appendChild(innerWrapper);\n    }\n\n    const innerWrapperShadowRoot = innerWrapper.shadowRoot;\n    const innerWrapperContainer = document.createElement(\"div\");\n\n    if (innerWrapperShadowRoot) {\n      innerWrapperShadowRoot.appendChild(innerWrapperContainer);\n    }\n\n    return {\n      container: innerWrapperContainer,\n      destroy: () => {\n        parentContainer.removeChild(customElement);\n      },\n    };\n  }\n\n  if (!slots) {\n    return {\n      container: shadowContainer,\n      destroy: () => {\n        parentContainer.removeChild(customElement);\n      },\n    };\n  }\n\n  const slotProviderElement = document.createElement(\"div\");\n  slotProviderElement.setAttribute(\"slot\", customSlotName);\n  parentContainer.appendChild(slotProviderElement);\n\n  return {\n    container: slotProviderElement,\n    destroy: () => {\n      parentContainer.removeChild(slotProviderElement);\n      parentContainer.removeChild(customElement);\n    },\n  };\n}\n\nexport function getBody(win?: SameDomainWindowType = window): HTMLBodyElement {\n  if (!win.document.body) {\n    throw new Error(`Window has no body`);\n  }\n\n  return win.document.body;\n}\n\n// eslint-disable-next-line no-restricted-globals, promise/no-native\nexport function loadScript(url: string): Promise<void> {\n  const scriptElement = document.createElement(\"script\");\n  scriptElement.setAttribute(\"src\", url);\n  getBody().prepend(scriptElement);\n\n  // eslint-disable-next-line no-restricted-globals, promise/no-native\n  const scriptPromise = new Promise((resolve) => {\n    scriptElement.addEventListener(\"load\", () => resolve());\n  });\n\n  return scriptPromise;\n}\n"
  },
  {
    "path": "test/index.js",
    "content": "/* @flow */\n\nimport \"./test\";\n"
  },
  {
    "path": "test/lib/angular-12/angular-12-common.js",
    "content": "/**\n * @license Angular v12.2.1\n * (c) 2010-2021 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :\n    typeof define === 'function' && define.amd ? define('@angular/common', ['exports', '@angular/core'], factory) :\n    (global = global || self, factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core));\n}(this, (function (exports, i0) { 'use strict';\n\n    /**\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://angular.io/license\n     */\n    var _DOM = null;\n    function getDOM() {\n        return _DOM;\n    }\n    function setDOM(adapter) {\n        _DOM = adapter;\n    }\n    function setRootDomAdapter(adapter) {\n        if (!_DOM) {\n            _DOM = adapter;\n        }\n    }\n    /* tslint:disable:requireParameterType */\n    /**\n     * Provides DOM operations in an environment-agnostic way.\n     *\n     * @security Tread carefully! Interacting with the DOM directly is dangerous and\n     * can introduce XSS risks.\n     */\n    var DomAdapter = /** @class */ (function () {\n        function DomAdapter() {\n        }\n        return DomAdapter;\n    }());\n\n    /*! *****************************************************************************\n    Copyright (c) Microsoft Corporation.\n\n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n    PERFORMANCE OF THIS SOFTWARE.\n    ***************************************************************************** */\n    /* global Reflect, Promise */\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b)\n                if (Object.prototype.hasOwnProperty.call(b, p))\n                    d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    function __extends(d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    }\n    var __assign = function () {\n        __assign = Object.assign || function __assign(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s)\n                    if (Object.prototype.hasOwnProperty.call(s, p))\n                        t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign.apply(this, arguments);\n    };\n    function __rest(s, e) {\n        var t = {};\n        for (var p in s)\n            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n                t[p] = s[p];\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                    t[p[i]] = s[p[i]];\n            }\n        return t;\n    }\n    function __decorate(decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n            r = Reflect.decorate(decorators, target, key, desc);\n        else\n            for (var i = decorators.length - 1; i >= 0; i--)\n                if (d = decorators[i])\n                    r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    }\n    function __param(paramIndex, decorator) {\n        return function (target, key) { decorator(target, key, paramIndex); };\n    }\n    function __metadata(metadataKey, metadataValue) {\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n            return Reflect.metadata(metadataKey, metadataValue);\n    }\n    function __awaiter(thisArg, _arguments, P, generator) {\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n        return new (P || (P = Promise))(function (resolve, reject) {\n            function fulfilled(value) { try {\n                step(generator.next(value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function rejected(value) { try {\n                step(generator[\"throw\"](value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\n        });\n    }\n    function __generator(thisArg, body) {\n        var _ = { label: 0, sent: function () { if (t[0] & 1)\n                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n        function verb(n) { return function (v) { return step([n, v]); }; }\n        function step(op) {\n            if (f)\n                throw new TypeError(\"Generator is already executing.\");\n            while (_)\n                try {\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)\n                        return t;\n                    if (y = 0, t)\n                        op = [op[0] & 2, t.value];\n                    switch (op[0]) {\n                        case 0:\n                        case 1:\n                            t = op;\n                            break;\n                        case 4:\n                            _.label++;\n                            return { value: op[1], done: false };\n                        case 5:\n                            _.label++;\n                            y = op[1];\n                            op = [0];\n                            continue;\n                        case 7:\n                            op = _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                        default:\n                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n                                _ = 0;\n                                continue;\n                            }\n                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n                                _.label = op[1];\n                                break;\n                            }\n                            if (op[0] === 6 && _.label < t[1]) {\n                                _.label = t[1];\n                                t = op;\n                                break;\n                            }\n                            if (t && _.label < t[2]) {\n                                _.label = t[2];\n                                _.ops.push(op);\n                                break;\n                            }\n                            if (t[2])\n                                _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                    }\n                    op = body.call(thisArg, _);\n                }\n                catch (e) {\n                    op = [6, e];\n                    y = 0;\n                }\n                finally {\n                    f = t = 0;\n                }\n            if (op[0] & 5)\n                throw op[1];\n            return { value: op[0] ? op[1] : void 0, done: true };\n        }\n    }\n    var __createBinding = Object.create ? (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n    }) : (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        o[k2] = m[k];\n    });\n    function __exportStar(m, o) {\n        for (var p in m)\n            if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n                __createBinding(o, m, p);\n    }\n    function __values(o) {\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n        if (m)\n            return m.call(o);\n        if (o && typeof o.length === \"number\")\n            return {\n                next: function () {\n                    if (o && i >= o.length)\n                        o = void 0;\n                    return { value: o && o[i++], done: !o };\n                }\n            };\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n    }\n    function __read(o, n) {\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n        if (!m)\n            return o;\n        var i = m.call(o), r, ar = [], e;\n        try {\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n                ar.push(r.value);\n        }\n        catch (error) {\n            e = { error: error };\n        }\n        finally {\n            try {\n                if (r && !r.done && (m = i[\"return\"]))\n                    m.call(i);\n            }\n            finally {\n                if (e)\n                    throw e.error;\n            }\n        }\n        return ar;\n    }\n    /** @deprecated */\n    function __spread() {\n        for (var ar = [], i = 0; i < arguments.length; i++)\n            ar = ar.concat(__read(arguments[i]));\n        return ar;\n    }\n    /** @deprecated */\n    function __spreadArrays() {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n            s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    }\n    function __spreadArray(to, from, pack) {\n        if (pack || arguments.length === 2)\n            for (var i = 0, l = from.length, ar; i < l; i++) {\n                if (ar || !(i in from)) {\n                    if (!ar)\n                        ar = Array.prototype.slice.call(from, 0, i);\n                    ar[i] = from[i];\n                }\n            }\n        return to.concat(ar || from);\n    }\n    function __await(v) {\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\n    }\n    function __asyncGenerator(thisArg, _arguments, generator) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n        function verb(n) { if (g[n])\n            i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n        function resume(n, v) { try {\n            step(g[n](v));\n        }\n        catch (e) {\n            settle(q[0][3], e);\n        } }\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n        function fulfill(value) { resume(\"next\", value); }\n        function reject(value) { resume(\"throw\", value); }\n        function settle(f, v) { if (f(v), q.shift(), q.length)\n            resume(q[0][0], q[0][1]); }\n    }\n    function __asyncDelegator(o) {\n        var i, p;\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\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; }\n    }\n    function __asyncValues(o) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n    }\n    function __makeTemplateObject(cooked, raw) {\n        if (Object.defineProperty) {\n            Object.defineProperty(cooked, \"raw\", { value: raw });\n        }\n        else {\n            cooked.raw = raw;\n        }\n        return cooked;\n    }\n    ;\n    var __setModuleDefault = Object.create ? (function (o, v) {\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n    }) : function (o, v) {\n        o[\"default\"] = v;\n    };\n    function __importStar(mod) {\n        if (mod && mod.__esModule)\n            return mod;\n        var result = {};\n        if (mod != null)\n            for (var k in mod)\n                if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n                    __createBinding(result, mod, k);\n        __setModuleDefault(result, mod);\n        return result;\n    }\n    function __importDefault(mod) {\n        return (mod && mod.__esModule) ? mod : { default: mod };\n    }\n    function __classPrivateFieldGet(receiver, state, kind, f) {\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a getter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n    }\n    function __classPrivateFieldSet(receiver, state, value, kind, f) {\n        if (kind === \"m\")\n            throw new TypeError(\"Private method is not writable\");\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a setter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n     *\n     * Note: Document might not be available in the Application Context when Application and Rendering\n     * Contexts are not the same (e.g. when running the application in a Web Worker).\n     *\n     * @publicApi\n     */\n    var DOCUMENT = new i0.InjectionToken('DocumentToken');\n\n    /**\n     * This class should not be used directly by an application developer. Instead, use\n     * {@link Location}.\n     *\n     * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be\n     * platform-agnostic.\n     * This means that we can have different implementation of `PlatformLocation` for the different\n     * platforms that Angular supports. For example, `@angular/platform-browser` provides an\n     * implementation specific to the browser environment, while `@angular/platform-server` provides\n     * one suitable for use with server-side rendering.\n     *\n     * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}\n     * when they need to interact with the DOM APIs like pushState, popState, etc.\n     *\n     * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly\n     * by the {@link Router} in order to navigate between routes. Since all interactions between {@link\n     * Router} /\n     * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`\n     * class, they are all platform-agnostic.\n     *\n     * @publicApi\n     */\n    var PlatformLocation = /** @class */ (function () {\n        function PlatformLocation() {\n        }\n        PlatformLocation.prototype.historyGo = function (relativePosition) {\n            throw new Error('Not implemented');\n        };\n        return PlatformLocation;\n    }());\n    PlatformLocation.ɵprov = i0.ɵɵdefineInjectable({ factory: useBrowserPlatformLocation, token: PlatformLocation, providedIn: \"platform\" });\n    PlatformLocation.decorators = [\n        { type: i0.Injectable, args: [{\n                    providedIn: 'platform',\n                    // See #23917\n                    useFactory: useBrowserPlatformLocation\n                },] }\n    ];\n    function useBrowserPlatformLocation() {\n        return i0.ɵɵinject(BrowserPlatformLocation);\n    }\n    /**\n     * @description\n     * Indicates when a location is initialized.\n     *\n     * @publicApi\n     */\n    var LOCATION_INITIALIZED = new i0.InjectionToken('Location Initialized');\n    /**\n     * `PlatformLocation` encapsulates all of the direct calls to platform APIs.\n     * This class should not be used directly by an application developer. Instead, use\n     * {@link Location}.\n     */\n    var BrowserPlatformLocation = /** @class */ (function (_super) {\n        __extends(BrowserPlatformLocation, _super);\n        function BrowserPlatformLocation(_doc) {\n            var _this = _super.call(this) || this;\n            _this._doc = _doc;\n            _this._init();\n            return _this;\n        }\n        // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it\n        /** @internal */\n        BrowserPlatformLocation.prototype._init = function () {\n            this.location = window.location;\n            this._history = window.history;\n        };\n        BrowserPlatformLocation.prototype.getBaseHrefFromDOM = function () {\n            return getDOM().getBaseHref(this._doc);\n        };\n        BrowserPlatformLocation.prototype.onPopState = function (fn) {\n            var window = getDOM().getGlobalEventTarget(this._doc, 'window');\n            window.addEventListener('popstate', fn, false);\n            return function () { return window.removeEventListener('popstate', fn); };\n        };\n        BrowserPlatformLocation.prototype.onHashChange = function (fn) {\n            var window = getDOM().getGlobalEventTarget(this._doc, 'window');\n            window.addEventListener('hashchange', fn, false);\n            return function () { return window.removeEventListener('hashchange', fn); };\n        };\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"href\", {\n            get: function () {\n                return this.location.href;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"protocol\", {\n            get: function () {\n                return this.location.protocol;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"hostname\", {\n            get: function () {\n                return this.location.hostname;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"port\", {\n            get: function () {\n                return this.location.port;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"pathname\", {\n            get: function () {\n                return this.location.pathname;\n            },\n            set: function (newPath) {\n                this.location.pathname = newPath;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"search\", {\n            get: function () {\n                return this.location.search;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(BrowserPlatformLocation.prototype, \"hash\", {\n            get: function () {\n                return this.location.hash;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        BrowserPlatformLocation.prototype.pushState = function (state, title, url) {\n            if (supportsState()) {\n                this._history.pushState(state, title, url);\n            }\n            else {\n                this.location.hash = url;\n            }\n        };\n        BrowserPlatformLocation.prototype.replaceState = function (state, title, url) {\n            if (supportsState()) {\n                this._history.replaceState(state, title, url);\n            }\n            else {\n                this.location.hash = url;\n            }\n        };\n        BrowserPlatformLocation.prototype.forward = function () {\n            this._history.forward();\n        };\n        BrowserPlatformLocation.prototype.back = function () {\n            this._history.back();\n        };\n        BrowserPlatformLocation.prototype.historyGo = function (relativePosition) {\n            if (relativePosition === void 0) { relativePosition = 0; }\n            this._history.go(relativePosition);\n        };\n        BrowserPlatformLocation.prototype.getState = function () {\n            return this._history.state;\n        };\n        return BrowserPlatformLocation;\n    }(PlatformLocation));\n    BrowserPlatformLocation.ɵprov = i0.ɵɵdefineInjectable({ factory: createBrowserPlatformLocation, token: BrowserPlatformLocation, providedIn: \"platform\" });\n    BrowserPlatformLocation.decorators = [\n        { type: i0.Injectable, args: [{\n                    providedIn: 'platform',\n                    // See #23917\n                    useFactory: createBrowserPlatformLocation,\n                },] }\n    ];\n    BrowserPlatformLocation.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [DOCUMENT,] }] }\n    ]; };\n    function supportsState() {\n        return !!window.history.pushState;\n    }\n    function createBrowserPlatformLocation() {\n        return new BrowserPlatformLocation(i0.ɵɵinject(DOCUMENT));\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Joins two parts of a URL with a slash if needed.\n     *\n     * @param start  URL string\n     * @param end    URL string\n     *\n     *\n     * @returns The joined URL string.\n     */\n    function joinWithSlash(start, end) {\n        if (start.length == 0) {\n            return end;\n        }\n        if (end.length == 0) {\n            return start;\n        }\n        var slashes = 0;\n        if (start.endsWith('/')) {\n            slashes++;\n        }\n        if (end.startsWith('/')) {\n            slashes++;\n        }\n        if (slashes == 2) {\n            return start + end.substring(1);\n        }\n        if (slashes == 1) {\n            return start + end;\n        }\n        return start + '/' + end;\n    }\n    /**\n     * Removes a trailing slash from a URL string if needed.\n     * Looks for the first occurrence of either `#`, `?`, or the end of the\n     * line as `/` characters and removes the trailing slash if one exists.\n     *\n     * @param url URL string.\n     *\n     * @returns The URL string, modified if needed.\n     */\n    function stripTrailingSlash(url) {\n        var match = url.match(/#|\\?|$/);\n        var pathEndIdx = match && match.index || url.length;\n        var droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n        return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n    }\n    /**\n     * Normalizes URL parameters by prepending with `?` if needed.\n     *\n     * @param  params String of URL parameters.\n     *\n     * @returns The normalized URL parameters string.\n     */\n    function normalizeQueryParams(params) {\n        return params && params[0] !== '?' ? '?' + params : params;\n    }\n\n    /**\n     * Enables the `Location` service to read route state from the browser's URL.\n     * Angular provides two strategies:\n     * `HashLocationStrategy` and `PathLocationStrategy`.\n     *\n     * Applications should use the `Router` or `Location` services to\n     * interact with application route state.\n     *\n     * For instance, `HashLocationStrategy` produces URLs like\n     * <code class=\"no-auto-link\">http://example.com#/foo</code>,\n     * and `PathLocationStrategy` produces\n     * <code class=\"no-auto-link\">http://example.com/foo</code> as an equivalent URL.\n     *\n     * See these two classes for more.\n     *\n     * @publicApi\n     */\n    var LocationStrategy = /** @class */ (function () {\n        function LocationStrategy() {\n        }\n        LocationStrategy.prototype.historyGo = function (relativePosition) {\n            throw new Error('Not implemented');\n        };\n        return LocationStrategy;\n    }());\n    LocationStrategy.ɵprov = i0.ɵɵdefineInjectable({ factory: provideLocationStrategy, token: LocationStrategy, providedIn: \"root\" });\n    LocationStrategy.decorators = [\n        { type: i0.Injectable, args: [{ providedIn: 'root', useFactory: provideLocationStrategy },] }\n    ];\n    function provideLocationStrategy(platformLocation) {\n        // See #23917\n        var location = i0.ɵɵinject(DOCUMENT).location;\n        return new PathLocationStrategy(i0.ɵɵinject(PlatformLocation), location && location.origin || '');\n    }\n    /**\n     * A predefined [DI token](guide/glossary#di-token) for the base href\n     * to be used with the `PathLocationStrategy`.\n     * The base href is the URL prefix that should be preserved when generating\n     * and recognizing URLs.\n     *\n     * @usageNotes\n     *\n     * The following example shows how to use this token to configure the root app injector\n     * with a base href value, so that the DI framework can supply the dependency anywhere in the app.\n     *\n     * ```typescript\n     * import {Component, NgModule} from '@angular/core';\n     * import {APP_BASE_HREF} from '@angular/common';\n     *\n     * @NgModule({\n     *   providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n     * })\n     * class AppModule {}\n     * ```\n     *\n     * @publicApi\n     */\n    var APP_BASE_HREF = new i0.InjectionToken('appBaseHref');\n    /**\n     * @description\n     * A {@link LocationStrategy} used to configure the {@link Location} service to\n     * represent its state in the\n     * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n     * browser's URL.\n     *\n     * If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF}\n     * or add a `<base href>` element to the document.\n     *\n     * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call\n     * `location.go('/foo')`, the browser's URL will become\n     * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,\n     * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`.\n     *\n     * Similarly, if you add `<base href='/my/app/'/>` to the document and call\n     * `location.go('/foo')`, the browser's URL will become\n     * `example.com/my/app/foo`.\n     *\n     * Note that when using `PathLocationStrategy`, neither the query nor\n     * the fragment in the `<base href>` will be preserved, as outlined\n     * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).\n     *\n     * @usageNotes\n     *\n     * ### Example\n     *\n     * {@example common/location/ts/path_location_component.ts region='LocationComponent'}\n     *\n     * @publicApi\n     */\n    var PathLocationStrategy = /** @class */ (function (_super) {\n        __extends(PathLocationStrategy, _super);\n        function PathLocationStrategy(_platformLocation, href) {\n            var _this = _super.call(this) || this;\n            _this._platformLocation = _platformLocation;\n            _this._removeListenerFns = [];\n            if (href == null) {\n                href = _this._platformLocation.getBaseHrefFromDOM();\n            }\n            if (href == null) {\n                throw new Error(\"No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.\");\n            }\n            _this._baseHref = href;\n            return _this;\n        }\n        PathLocationStrategy.prototype.ngOnDestroy = function () {\n            while (this._removeListenerFns.length) {\n                this._removeListenerFns.pop()();\n            }\n        };\n        PathLocationStrategy.prototype.onPopState = function (fn) {\n            this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));\n        };\n        PathLocationStrategy.prototype.getBaseHref = function () {\n            return this._baseHref;\n        };\n        PathLocationStrategy.prototype.prepareExternalUrl = function (internal) {\n            return joinWithSlash(this._baseHref, internal);\n        };\n        PathLocationStrategy.prototype.path = function (includeHash) {\n            if (includeHash === void 0) { includeHash = false; }\n            var pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);\n            var hash = this._platformLocation.hash;\n            return hash && includeHash ? \"\" + pathname + hash : pathname;\n        };\n        PathLocationStrategy.prototype.pushState = function (state, title, url, queryParams) {\n            var externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n            this._platformLocation.pushState(state, title, externalUrl);\n        };\n        PathLocationStrategy.prototype.replaceState = function (state, title, url, queryParams) {\n            var externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n            this._platformLocation.replaceState(state, title, externalUrl);\n        };\n        PathLocationStrategy.prototype.forward = function () {\n            this._platformLocation.forward();\n        };\n        PathLocationStrategy.prototype.back = function () {\n            this._platformLocation.back();\n        };\n        PathLocationStrategy.prototype.historyGo = function (relativePosition) {\n            if (relativePosition === void 0) { relativePosition = 0; }\n            var _a, _b;\n            (_b = (_a = this._platformLocation).historyGo) === null || _b === void 0 ? void 0 : _b.call(_a, relativePosition);\n        };\n        return PathLocationStrategy;\n    }(LocationStrategy));\n    PathLocationStrategy.decorators = [\n        { type: i0.Injectable }\n    ];\n    PathLocationStrategy.ctorParameters = function () { return [\n        { type: PlatformLocation },\n        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [APP_BASE_HREF,] }] }\n    ]; };\n\n    /**\n     * @description\n     * A {@link LocationStrategy} used to configure the {@link Location} service to\n     * represent its state in the\n     * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)\n     * of the browser's URL.\n     *\n     * For instance, if you call `location.go('/foo')`, the browser's URL will become\n     * `example.com#/foo`.\n     *\n     * @usageNotes\n     *\n     * ### Example\n     *\n     * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}\n     *\n     * @publicApi\n     */\n    var HashLocationStrategy = /** @class */ (function (_super) {\n        __extends(HashLocationStrategy, _super);\n        function HashLocationStrategy(_platformLocation, _baseHref) {\n            var _this = _super.call(this) || this;\n            _this._platformLocation = _platformLocation;\n            _this._baseHref = '';\n            _this._removeListenerFns = [];\n            if (_baseHref != null) {\n                _this._baseHref = _baseHref;\n            }\n            return _this;\n        }\n        HashLocationStrategy.prototype.ngOnDestroy = function () {\n            while (this._removeListenerFns.length) {\n                this._removeListenerFns.pop()();\n            }\n        };\n        HashLocationStrategy.prototype.onPopState = function (fn) {\n            this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));\n        };\n        HashLocationStrategy.prototype.getBaseHref = function () {\n            return this._baseHref;\n        };\n        HashLocationStrategy.prototype.path = function (includeHash) {\n            if (includeHash === void 0) { includeHash = false; }\n            // the hash value is always prefixed with a `#`\n            // and if it is empty then it will stay empty\n            var path = this._platformLocation.hash;\n            if (path == null)\n                path = '#';\n            return path.length > 0 ? path.substring(1) : path;\n        };\n        HashLocationStrategy.prototype.prepareExternalUrl = function (internal) {\n            var url = joinWithSlash(this._baseHref, internal);\n            return url.length > 0 ? ('#' + url) : url;\n        };\n        HashLocationStrategy.prototype.pushState = function (state, title, path, queryParams) {\n            var url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));\n            if (url.length == 0) {\n                url = this._platformLocation.pathname;\n            }\n            this._platformLocation.pushState(state, title, url);\n        };\n        HashLocationStrategy.prototype.replaceState = function (state, title, path, queryParams) {\n            var url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));\n            if (url.length == 0) {\n                url = this._platformLocation.pathname;\n            }\n            this._platformLocation.replaceState(state, title, url);\n        };\n        HashLocationStrategy.prototype.forward = function () {\n            this._platformLocation.forward();\n        };\n        HashLocationStrategy.prototype.back = function () {\n            this._platformLocation.back();\n        };\n        HashLocationStrategy.prototype.historyGo = function (relativePosition) {\n            if (relativePosition === void 0) { relativePosition = 0; }\n            var _a, _b;\n            (_b = (_a = this._platformLocation).historyGo) === null || _b === void 0 ? void 0 : _b.call(_a, relativePosition);\n        };\n        return HashLocationStrategy;\n    }(LocationStrategy));\n    HashLocationStrategy.decorators = [\n        { type: i0.Injectable }\n    ];\n    HashLocationStrategy.ctorParameters = function () { return [\n        { type: PlatformLocation },\n        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [APP_BASE_HREF,] }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @description\n     *\n     * A service that applications can use to interact with a browser's URL.\n     *\n     * Depending on the `LocationStrategy` used, `Location` persists\n     * to the URL's path or the URL's hash segment.\n     *\n     * @usageNotes\n     *\n     * It's better to use the `Router.navigate()` service to trigger route changes. Use\n     * `Location` only if you need to interact with or create normalized URLs outside of\n     * routing.\n     *\n     * `Location` is responsible for normalizing the URL against the application's base href.\n     * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n     * trailing slash:\n     * - `/my/app/user/123` is normalized\n     * - `my/app/user/123` **is not** normalized\n     * - `/my/app/user/123/` **is not** normalized\n     *\n     * ### Example\n     *\n     * <code-example path='common/location/ts/path_location_component.ts'\n     * region='LocationComponent'></code-example>\n     *\n     * @publicApi\n     */\n    var Location = /** @class */ (function () {\n        function Location(platformStrategy, platformLocation) {\n            var _this = this;\n            /** @internal */\n            this._subject = new i0.EventEmitter();\n            /** @internal */\n            this._urlChangeListeners = [];\n            this._platformStrategy = platformStrategy;\n            var browserBaseHref = this._platformStrategy.getBaseHref();\n            this._platformLocation = platformLocation;\n            this._baseHref = stripTrailingSlash(_stripIndexHtml(browserBaseHref));\n            this._platformStrategy.onPopState(function (ev) {\n                _this._subject.emit({\n                    'url': _this.path(true),\n                    'pop': true,\n                    'state': ev.state,\n                    'type': ev.type,\n                });\n            });\n        }\n        /**\n         * Normalizes the URL path for this location.\n         *\n         * @param includeHash True to include an anchor fragment in the path.\n         *\n         * @returns The normalized URL path.\n         */\n        // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is\n        // removed.\n        Location.prototype.path = function (includeHash) {\n            if (includeHash === void 0) { includeHash = false; }\n            return this.normalize(this._platformStrategy.path(includeHash));\n        };\n        /**\n         * Reports the current state of the location history.\n         * @returns The current value of the `history.state` object.\n         */\n        Location.prototype.getState = function () {\n            return this._platformLocation.getState();\n        };\n        /**\n         * Normalizes the given path and compares to the current normalized path.\n         *\n         * @param path The given URL path.\n         * @param query Query parameters.\n         *\n         * @returns True if the given URL path is equal to the current normalized path, false\n         * otherwise.\n         */\n        Location.prototype.isCurrentPathEqualTo = function (path, query) {\n            if (query === void 0) { query = ''; }\n            return this.path() == this.normalize(path + normalizeQueryParams(query));\n        };\n        /**\n         * Normalizes a URL path by stripping any trailing slashes.\n         *\n         * @param url String representing a URL.\n         *\n         * @returns The normalized URL string.\n         */\n        Location.prototype.normalize = function (url) {\n            return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));\n        };\n        /**\n         * Normalizes an external URL path.\n         * If the given URL doesn't begin with a leading slash (`'/'`), adds one\n         * before normalizing. Adds a hash if `HashLocationStrategy` is\n         * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n         *\n         * @param url String representing a URL.\n         *\n         * @returns  A normalized platform-specific URL.\n         */\n        Location.prototype.prepareExternalUrl = function (url) {\n            if (url && url[0] !== '/') {\n                url = '/' + url;\n            }\n            return this._platformStrategy.prepareExternalUrl(url);\n        };\n        // TODO: rename this method to pushState\n        /**\n         * Changes the browser's URL to a normalized version of a given URL, and pushes a\n         * new item onto the platform's history.\n         *\n         * @param path  URL path to normalize.\n         * @param query Query parameters.\n         * @param state Location history state.\n         *\n         */\n        Location.prototype.go = function (path, query, state) {\n            if (query === void 0) { query = ''; }\n            if (state === void 0) { state = null; }\n            this._platformStrategy.pushState(state, '', path, query);\n            this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n        };\n        /**\n         * Changes the browser's URL to a normalized version of the given URL, and replaces\n         * the top item on the platform's history stack.\n         *\n         * @param path  URL path to normalize.\n         * @param query Query parameters.\n         * @param state Location history state.\n         */\n        Location.prototype.replaceState = function (path, query, state) {\n            if (query === void 0) { query = ''; }\n            if (state === void 0) { state = null; }\n            this._platformStrategy.replaceState(state, '', path, query);\n            this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n        };\n        /**\n         * Navigates forward in the platform's history.\n         */\n        Location.prototype.forward = function () {\n            this._platformStrategy.forward();\n        };\n        /**\n         * Navigates back in the platform's history.\n         */\n        Location.prototype.back = function () {\n            this._platformStrategy.back();\n        };\n        /**\n         * Navigate to a specific page from session history, identified by its relative position to the\n         * current page.\n         *\n         * @param relativePosition  Position of the target page in the history relative to the current\n         *     page.\n         * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`\n         * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go\n         * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs\n         * when `relativePosition` equals 0.\n         * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history\n         */\n        Location.prototype.historyGo = function (relativePosition) {\n            if (relativePosition === void 0) { relativePosition = 0; }\n            var _a, _b;\n            (_b = (_a = this._platformStrategy).historyGo) === null || _b === void 0 ? void 0 : _b.call(_a, relativePosition);\n        };\n        /**\n         * Registers a URL change listener. Use to catch updates performed by the Angular\n         * framework that are not detectible through \"popstate\" or \"hashchange\" events.\n         *\n         * @param fn The change handler function, which take a URL and a location history state.\n         */\n        Location.prototype.onUrlChange = function (fn) {\n            var _this = this;\n            this._urlChangeListeners.push(fn);\n            if (!this._urlChangeSubscription) {\n                this._urlChangeSubscription = this.subscribe(function (v) {\n                    _this._notifyUrlChangeListeners(v.url, v.state);\n                });\n            }\n        };\n        /** @internal */\n        Location.prototype._notifyUrlChangeListeners = function (url, state) {\n            if (url === void 0) { url = ''; }\n            this._urlChangeListeners.forEach(function (fn) { return fn(url, state); });\n        };\n        /**\n         * Subscribes to the platform's `popState` events.\n         *\n         * Note: `Location.go()` does not trigger the `popState` event in the browser. Use\n         * `Location.onUrlChange()` to subscribe to URL changes instead.\n         *\n         * @param value Event that is triggered when the state history changes.\n         * @param exception The exception to throw.\n         *\n         * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)\n         *\n         * @returns Subscribed events.\n         */\n        Location.prototype.subscribe = function (onNext, onThrow, onReturn) {\n            return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });\n        };\n        return Location;\n    }());\n    /**\n     * Normalizes URL parameters by prepending with `?` if needed.\n     *\n     * @param  params String of URL parameters.\n     *\n     * @returns The normalized URL parameters string.\n     */\n    Location.normalizeQueryParams = normalizeQueryParams;\n    /**\n     * Joins two parts of a URL with a slash if needed.\n     *\n     * @param start  URL string\n     * @param end    URL string\n     *\n     *\n     * @returns The joined URL string.\n     */\n    Location.joinWithSlash = joinWithSlash;\n    /**\n     * Removes a trailing slash from a URL string if needed.\n     * Looks for the first occurrence of either `#`, `?`, or the end of the\n     * line as `/` characters and removes the trailing slash if one exists.\n     *\n     * @param url URL string.\n     *\n     * @returns The URL string, modified if needed.\n     */\n    Location.stripTrailingSlash = stripTrailingSlash;\n    Location.ɵprov = i0.ɵɵdefineInjectable({ factory: createLocation, token: Location, providedIn: \"root\" });\n    Location.decorators = [\n        { type: i0.Injectable, args: [{\n                    providedIn: 'root',\n                    // See #23917\n                    useFactory: createLocation,\n                },] }\n    ];\n    Location.ctorParameters = function () { return [\n        { type: LocationStrategy },\n        { type: PlatformLocation }\n    ]; };\n    function createLocation() {\n        return new Location(i0.ɵɵinject(LocationStrategy), i0.ɵɵinject(PlatformLocation));\n    }\n    function _stripBaseHref(baseHref, url) {\n        return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;\n    }\n    function _stripIndexHtml(url) {\n        return url.replace(/\\/index.html$/, '');\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /** @internal */\n    var CURRENCIES_EN = { \"ADP\": [undefined, undefined, 0], \"AFN\": [undefined, undefined, 0], \"ALL\": [undefined, undefined, 0], \"AMD\": [undefined, undefined, 2], \"AOA\": [undefined, \"Kz\"], \"ARS\": [undefined, \"$\"], \"AUD\": [\"A$\", \"$\"], \"BAM\": [undefined, \"KM\"], \"BBD\": [undefined, \"$\"], \"BDT\": [undefined, \"৳\"], \"BHD\": [undefined, undefined, 3], \"BIF\": [undefined, undefined, 0], \"BMD\": [undefined, \"$\"], \"BND\": [undefined, \"$\"], \"BOB\": [undefined, \"Bs\"], \"BRL\": [\"R$\"], \"BSD\": [undefined, \"$\"], \"BWP\": [undefined, \"P\"], \"BYN\": [undefined, \"р.\", 2], \"BYR\": [undefined, undefined, 0], \"BZD\": [undefined, \"$\"], \"CAD\": [\"CA$\", \"$\", 2], \"CHF\": [undefined, undefined, 2], \"CLF\": [undefined, undefined, 4], \"CLP\": [undefined, \"$\", 0], \"CNY\": [\"CN¥\", \"¥\"], \"COP\": [undefined, \"$\", 2], \"CRC\": [undefined, \"₡\", 2], \"CUC\": [undefined, \"$\"], \"CUP\": [undefined, \"$\"], \"CZK\": [undefined, \"Kč\", 2], \"DJF\": [undefined, undefined, 0], \"DKK\": [undefined, \"kr\", 2], \"DOP\": [undefined, \"$\"], \"EGP\": [undefined, \"E£\"], \"ESP\": [undefined, \"₧\", 0], \"EUR\": [\"€\"], \"FJD\": [undefined, \"$\"], \"FKP\": [undefined, \"£\"], \"GBP\": [\"£\"], \"GEL\": [undefined, \"₾\"], \"GIP\": [undefined, \"£\"], \"GNF\": [undefined, \"FG\", 0], \"GTQ\": [undefined, \"Q\"], \"GYD\": [undefined, \"$\", 2], \"HKD\": [\"HK$\", \"$\"], \"HNL\": [undefined, \"L\"], \"HRK\": [undefined, \"kn\"], \"HUF\": [undefined, \"Ft\", 2], \"IDR\": [undefined, \"Rp\", 2], \"ILS\": [\"₪\"], \"INR\": [\"₹\"], \"IQD\": [undefined, undefined, 0], \"IRR\": [undefined, undefined, 0], \"ISK\": [undefined, \"kr\", 0], \"ITL\": [undefined, undefined, 0], \"JMD\": [undefined, \"$\"], \"JOD\": [undefined, undefined, 3], \"JPY\": [\"¥\", undefined, 0], \"KHR\": [undefined, \"៛\"], \"KMF\": [undefined, \"CF\", 0], \"KPW\": [undefined, \"₩\", 0], \"KRW\": [\"₩\", undefined, 0], \"KWD\": [undefined, undefined, 3], \"KYD\": [undefined, \"$\"], \"KZT\": [undefined, \"₸\"], \"LAK\": [undefined, \"₭\", 0], \"LBP\": [undefined, \"L£\", 0], \"LKR\": [undefined, \"Rs\"], \"LRD\": [undefined, \"$\"], \"LTL\": [undefined, \"Lt\"], \"LUF\": [undefined, undefined, 0], \"LVL\": [undefined, \"Ls\"], \"LYD\": [undefined, undefined, 3], \"MGA\": [undefined, \"Ar\", 0], \"MGF\": [undefined, undefined, 0], \"MMK\": [undefined, \"K\", 0], \"MNT\": [undefined, \"₮\", 2], \"MRO\": [undefined, undefined, 0], \"MUR\": [undefined, \"Rs\", 2], \"MXN\": [\"MX$\", \"$\"], \"MYR\": [undefined, \"RM\"], \"NAD\": [undefined, \"$\"], \"NGN\": [undefined, \"₦\"], \"NIO\": [undefined, \"C$\"], \"NOK\": [undefined, \"kr\", 2], \"NPR\": [undefined, \"Rs\"], \"NZD\": [\"NZ$\", \"$\"], \"OMR\": [undefined, undefined, 3], \"PHP\": [undefined, \"₱\"], \"PKR\": [undefined, \"Rs\", 2], \"PLN\": [undefined, \"zł\"], \"PYG\": [undefined, \"₲\", 0], \"RON\": [undefined, \"lei\"], \"RSD\": [undefined, undefined, 0], \"RUB\": [undefined, \"₽\"], \"RUR\": [undefined, \"р.\"], \"RWF\": [undefined, \"RF\", 0], \"SBD\": [undefined, \"$\"], \"SEK\": [undefined, \"kr\", 2], \"SGD\": [undefined, \"$\"], \"SHP\": [undefined, \"£\"], \"SLL\": [undefined, undefined, 0], \"SOS\": [undefined, undefined, 0], \"SRD\": [undefined, \"$\"], \"SSP\": [undefined, \"£\"], \"STD\": [undefined, undefined, 0], \"STN\": [undefined, \"Db\"], \"SYP\": [undefined, \"£\", 0], \"THB\": [undefined, \"฿\"], \"TMM\": [undefined, undefined, 0], \"TND\": [undefined, undefined, 3], \"TOP\": [undefined, \"T$\"], \"TRL\": [undefined, undefined, 0], \"TRY\": [undefined, \"₺\"], \"TTD\": [undefined, \"$\"], \"TWD\": [\"NT$\", \"$\", 2], \"TZS\": [undefined, undefined, 2], \"UAH\": [undefined, \"₴\"], \"UGX\": [undefined, undefined, 0], \"USD\": [\"$\"], \"UYI\": [undefined, undefined, 0], \"UYU\": [undefined, \"$\"], \"UYW\": [undefined, undefined, 4], \"UZS\": [undefined, undefined, 2], \"VEF\": [undefined, \"Bs\", 2], \"VND\": [\"₫\", undefined, 0], \"VUV\": [undefined, undefined, 0], \"XAF\": [\"FCFA\", undefined, 0], \"XCD\": [\"EC$\", \"$\"], \"XOF\": [\"CFA\", undefined, 0], \"XPF\": [\"CFPF\", undefined, 0], \"XXX\": [\"¤\"], \"YER\": [undefined, undefined, 0], \"ZAR\": [undefined, \"R\"], \"ZMK\": [undefined, undefined, 0], \"ZMW\": [undefined, \"ZK\"], \"ZWD\": [undefined, undefined, 0] };\n\n    (function (NumberFormatStyle) {\n        NumberFormatStyle[NumberFormatStyle[\"Decimal\"] = 0] = \"Decimal\";\n        NumberFormatStyle[NumberFormatStyle[\"Percent\"] = 1] = \"Percent\";\n        NumberFormatStyle[NumberFormatStyle[\"Currency\"] = 2] = \"Currency\";\n        NumberFormatStyle[NumberFormatStyle[\"Scientific\"] = 3] = \"Scientific\";\n    })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {}));\n    (function (Plural) {\n        Plural[Plural[\"Zero\"] = 0] = \"Zero\";\n        Plural[Plural[\"One\"] = 1] = \"One\";\n        Plural[Plural[\"Two\"] = 2] = \"Two\";\n        Plural[Plural[\"Few\"] = 3] = \"Few\";\n        Plural[Plural[\"Many\"] = 4] = \"Many\";\n        Plural[Plural[\"Other\"] = 5] = \"Other\";\n    })(exports.Plural || (exports.Plural = {}));\n    (function (FormStyle) {\n        FormStyle[FormStyle[\"Format\"] = 0] = \"Format\";\n        FormStyle[FormStyle[\"Standalone\"] = 1] = \"Standalone\";\n    })(exports.FormStyle || (exports.FormStyle = {}));\n    (function (TranslationWidth) {\n        /** 1 character for `en-US`. For example: 'S' */\n        TranslationWidth[TranslationWidth[\"Narrow\"] = 0] = \"Narrow\";\n        /** 3 characters for `en-US`. For example: 'Sun' */\n        TranslationWidth[TranslationWidth[\"Abbreviated\"] = 1] = \"Abbreviated\";\n        /** Full length for `en-US`. For example: \"Sunday\" */\n        TranslationWidth[TranslationWidth[\"Wide\"] = 2] = \"Wide\";\n        /** 2 characters for `en-US`, For example: \"Su\" */\n        TranslationWidth[TranslationWidth[\"Short\"] = 3] = \"Short\";\n    })(exports.TranslationWidth || (exports.TranslationWidth = {}));\n    (function (FormatWidth) {\n        /**\n         * For `en-US`, 'M/d/yy, h:mm a'`\n         * (Example: `6/15/15, 9:03 AM`)\n         */\n        FormatWidth[FormatWidth[\"Short\"] = 0] = \"Short\";\n        /**\n         * For `en-US`, `'MMM d, y, h:mm:ss a'`\n         * (Example: `Jun 15, 2015, 9:03:01 AM`)\n         */\n        FormatWidth[FormatWidth[\"Medium\"] = 1] = \"Medium\";\n        /**\n         * For `en-US`, `'MMMM d, y, h:mm:ss a z'`\n         * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`)\n         */\n        FormatWidth[FormatWidth[\"Long\"] = 2] = \"Long\";\n        /**\n         * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'`\n         * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`)\n         */\n        FormatWidth[FormatWidth[\"Full\"] = 3] = \"Full\";\n    })(exports.FormatWidth || (exports.FormatWidth = {}));\n    (function (NumberSymbol) {\n        /**\n         * Decimal separator.\n         * For `en-US`, the dot character.\n         * Example: 2,345`.`67\n         */\n        NumberSymbol[NumberSymbol[\"Decimal\"] = 0] = \"Decimal\";\n        /**\n         * Grouping separator, typically for thousands.\n         * For `en-US`, the comma character.\n         * Example: 2`,`345.67\n         */\n        NumberSymbol[NumberSymbol[\"Group\"] = 1] = \"Group\";\n        /**\n         * List-item separator.\n         * Example: \"one, two, and three\"\n         */\n        NumberSymbol[NumberSymbol[\"List\"] = 2] = \"List\";\n        /**\n         * Sign for percentage (out of 100).\n         * Example: 23.4%\n         */\n        NumberSymbol[NumberSymbol[\"PercentSign\"] = 3] = \"PercentSign\";\n        /**\n         * Sign for positive numbers.\n         * Example: +23\n         */\n        NumberSymbol[NumberSymbol[\"PlusSign\"] = 4] = \"PlusSign\";\n        /**\n         * Sign for negative numbers.\n         * Example: -23\n         */\n        NumberSymbol[NumberSymbol[\"MinusSign\"] = 5] = \"MinusSign\";\n        /**\n         * Computer notation for exponential value (n times a power of 10).\n         * Example: 1.2E3\n         */\n        NumberSymbol[NumberSymbol[\"Exponential\"] = 6] = \"Exponential\";\n        /**\n         * Human-readable format of exponential.\n         * Example: 1.2x103\n         */\n        NumberSymbol[NumberSymbol[\"SuperscriptingExponent\"] = 7] = \"SuperscriptingExponent\";\n        /**\n         * Sign for permille (out of 1000).\n         * Example: 23.4‰\n         */\n        NumberSymbol[NumberSymbol[\"PerMille\"] = 8] = \"PerMille\";\n        /**\n         * Infinity, can be used with plus and minus.\n         * Example: ∞, +∞, -∞\n         */\n        NumberSymbol[NumberSymbol[\"Infinity\"] = 9] = \"Infinity\";\n        /**\n         * Not a number.\n         * Example: NaN\n         */\n        NumberSymbol[NumberSymbol[\"NaN\"] = 10] = \"NaN\";\n        /**\n         * Symbol used between time units.\n         * Example: 10:52\n         */\n        NumberSymbol[NumberSymbol[\"TimeSeparator\"] = 11] = \"TimeSeparator\";\n        /**\n         * Decimal separator for currency values (fallback to `Decimal`).\n         * Example: $2,345.67\n         */\n        NumberSymbol[NumberSymbol[\"CurrencyDecimal\"] = 12] = \"CurrencyDecimal\";\n        /**\n         * Group separator for currency values (fallback to `Group`).\n         * Example: $2,345.67\n         */\n        NumberSymbol[NumberSymbol[\"CurrencyGroup\"] = 13] = \"CurrencyGroup\";\n    })(exports.NumberSymbol || (exports.NumberSymbol = {}));\n    (function (WeekDay) {\n        WeekDay[WeekDay[\"Sunday\"] = 0] = \"Sunday\";\n        WeekDay[WeekDay[\"Monday\"] = 1] = \"Monday\";\n        WeekDay[WeekDay[\"Tuesday\"] = 2] = \"Tuesday\";\n        WeekDay[WeekDay[\"Wednesday\"] = 3] = \"Wednesday\";\n        WeekDay[WeekDay[\"Thursday\"] = 4] = \"Thursday\";\n        WeekDay[WeekDay[\"Friday\"] = 5] = \"Friday\";\n        WeekDay[WeekDay[\"Saturday\"] = 6] = \"Saturday\";\n    })(exports.WeekDay || (exports.WeekDay = {}));\n    /**\n     * Retrieves the locale ID from the currently loaded locale.\n     * The loaded locale could be, for example, a global one rather than a regional one.\n     * @param locale A locale code, such as `fr-FR`.\n     * @returns The locale code. For example, `fr`.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleId(locale) {\n        return i0.ɵfindLocaleData(locale)[i0.ɵLocaleDataIndex.LocaleId];\n    }\n    /**\n     * Retrieves day period strings for the given locale.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param formStyle The required grammatical form.\n     * @param width The required character width.\n     * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleDayPeriods(locale, formStyle, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        var amPmData = [\n            data[i0.ɵLocaleDataIndex.DayPeriodsFormat], data[i0.ɵLocaleDataIndex.DayPeriodsStandalone]\n        ];\n        var amPm = getLastDefinedValue(amPmData, formStyle);\n        return getLastDefinedValue(amPm, width);\n    }\n    /**\n     * Retrieves days of the week for the given locale, using the Gregorian calendar.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param formStyle The required grammatical form.\n     * @param width The required character width.\n     * @returns An array of localized name strings.\n     * For example,`[Sunday, Monday, ... Saturday]` for `en-US`.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleDayNames(locale, formStyle, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        var daysData = [data[i0.ɵLocaleDataIndex.DaysFormat], data[i0.ɵLocaleDataIndex.DaysStandalone]];\n        var days = getLastDefinedValue(daysData, formStyle);\n        return getLastDefinedValue(days, width);\n    }\n    /**\n     * Retrieves months of the year for the given locale, using the Gregorian calendar.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param formStyle The required grammatical form.\n     * @param width The required character width.\n     * @returns An array of localized name strings.\n     * For example,  `[January, February, ...]` for `en-US`.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleMonthNames(locale, formStyle, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        var monthsData = [data[i0.ɵLocaleDataIndex.MonthsFormat], data[i0.ɵLocaleDataIndex.MonthsStandalone]];\n        var months = getLastDefinedValue(monthsData, formStyle);\n        return getLastDefinedValue(months, width);\n    }\n    /**\n     * Retrieves Gregorian-calendar eras for the given locale.\n     * @param locale A locale code for the locale format rules to use.\n     * @param width The required character width.\n\n     * @returns An array of localized era strings.\n     * For example, `[AD, BC]` for `en-US`.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleEraNames(locale, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        var erasData = data[i0.ɵLocaleDataIndex.Eras];\n        return getLastDefinedValue(erasData, width);\n    }\n    /**\n     * Retrieves the first day of the week for the given locale.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @returns A day index number, using the 0-based week-day index for `en-US`\n     * (Sunday = 0, Monday = 1, ...).\n     * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleFirstDayOfWeek(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.FirstDayOfWeek];\n    }\n    /**\n     * Range of week days that are considered the week-end for the given locale.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @returns The range of day values, `[startDay, endDay]`.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleWeekEndRange(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.WeekendRange];\n    }\n    /**\n     * Retrieves a localized date-value formating string.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param width The format type.\n     * @returns The localized formating string.\n     * @see `FormatWidth`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleDateFormat(locale, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        return getLastDefinedValue(data[i0.ɵLocaleDataIndex.DateFormat], width);\n    }\n    /**\n     * Retrieves a localized time-value formatting string.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param width The format type.\n     * @returns The localized formatting string.\n     * @see `FormatWidth`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n\n     * @publicApi\n     */\n    function getLocaleTimeFormat(locale, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        return getLastDefinedValue(data[i0.ɵLocaleDataIndex.TimeFormat], width);\n    }\n    /**\n     * Retrieves a localized date-time formatting string.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param width The format type.\n     * @returns The localized formatting string.\n     * @see `FormatWidth`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleDateTimeFormat(locale, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        var dateTimeFormatData = data[i0.ɵLocaleDataIndex.DateTimeFormat];\n        return getLastDefinedValue(dateTimeFormatData, width);\n    }\n    /**\n     * Retrieves a localized number symbol that can be used to replace placeholders in number formats.\n     * @param locale The locale code.\n     * @param symbol The symbol to localize.\n     * @returns The character for the localized symbol.\n     * @see `NumberSymbol`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleNumberSymbol(locale, symbol) {\n        var data = i0.ɵfindLocaleData(locale);\n        var res = data[i0.ɵLocaleDataIndex.NumberSymbols][symbol];\n        if (typeof res === 'undefined') {\n            if (symbol === exports.NumberSymbol.CurrencyDecimal) {\n                return data[i0.ɵLocaleDataIndex.NumberSymbols][exports.NumberSymbol.Decimal];\n            }\n            else if (symbol === exports.NumberSymbol.CurrencyGroup) {\n                return data[i0.ɵLocaleDataIndex.NumberSymbols][exports.NumberSymbol.Group];\n            }\n        }\n        return res;\n    }\n    /**\n     * Retrieves a number format for a given locale.\n     *\n     * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`\n     * when used to format the number 12345.678 could result in \"12'345,678\". That would happen if the\n     * grouping separator for your language is an apostrophe, and the decimal separator is a comma.\n     *\n     * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders\n     * that stand for the decimal separator, and so on, and are NOT real characters.\n     * You must NOT \"translate\" the placeholders. For example, don't change `.` to `,` even though in\n     * your language the decimal point is written with a comma. The symbols should be replaced by the\n     * local equivalents, using the appropriate `NumberSymbol` for your language.\n     *\n     * Here are the special characters used in number patterns:\n     *\n     * | Symbol | Meaning |\n     * |--------|---------|\n     * | . | Replaced automatically by the character used for the decimal point. |\n     * | , | Replaced by the \"grouping\" (thousands) separator. |\n     * | 0 | Replaced by a digit (or zero if there aren't enough digits). |\n     * | # | Replaced by a digit (or nothing if there aren't enough). |\n     * | ¤ | Replaced by a currency symbol, such as $ or USD. |\n     * | % | Marks a percent format. The % symbol may change position, but must be retained. |\n     * | E | Marks a scientific format. The E symbol may change position, but must be retained. |\n     * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.)\n     * @returns The localized format string.\n     * @see `NumberFormatStyle`\n     * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns)\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleNumberFormat(locale, type) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.NumberFormats][type];\n    }\n    /**\n     * Retrieves the symbol used to represent the currency for the main country\n     * corresponding to a given locale. For example, '$' for `en-US`.\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @returns The localized symbol character,\n     * or `null` if the main country cannot be determined.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleCurrencySymbol(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.CurrencySymbol] || null;\n    }\n    /**\n     * Retrieves the name of the currency for the main country corresponding\n     * to a given locale. For example, 'US Dollar' for `en-US`.\n     * @param locale A locale code for the locale format rules to use.\n     * @returns The currency name,\n     * or `null` if the main country cannot be determined.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleCurrencyName(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.CurrencyName] || null;\n    }\n    /**\n     * Retrieves the default currency code for the given locale.\n     *\n     * The default is defined as the first currency which is still in use.\n     *\n     * @param locale The code of the locale whose currency code we want.\n     * @returns The code of the default currency for the given locale.\n     *\n     * @publicApi\n     */\n    function getLocaleCurrencyCode(locale) {\n        return i0.ɵgetLocaleCurrencyCode(locale);\n    }\n    /**\n     * Retrieves the currency values for a given locale.\n     * @param locale A locale code for the locale format rules to use.\n     * @returns The currency values.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     */\n    function getLocaleCurrencies(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.Currencies];\n    }\n    /**\n     * @alias core/ɵgetLocalePluralCase\n     * @publicApi\n     */\n    var getLocalePluralCase = i0.ɵgetLocalePluralCase;\n    function checkFullData(data) {\n        if (!data[i0.ɵLocaleDataIndex.ExtraData]) {\n            throw new Error(\"Missing extra locale data for the locale \\\"\" + data[i0.ɵLocaleDataIndex\n                .LocaleId] + \"\\\". Use \\\"registerLocaleData\\\" to load new data. See the \\\"I18n guide\\\" on angular.io to know more.\");\n        }\n    }\n    /**\n     * Retrieves locale-specific rules used to determine which day period to use\n     * when more than one period is defined for a locale.\n     *\n     * There is a rule for each defined day period. The\n     * first rule is applied to the first day period and so on.\n     * Fall back to AM/PM when no rules are available.\n     *\n     * A rule can specify a period as time range, or as a single time value.\n     *\n     * This functionality is only available when you have loaded the full locale data.\n     * See the [\"I18n guide\"](guide/i18n#i18n-pipes).\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @returns The rules for the locale, a single time value or array of *from-time, to-time*,\n     * or null if no periods are available.\n     *\n     * @see `getLocaleExtraDayPeriods()`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleExtraDayPeriodRules(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        checkFullData(data);\n        var rules = data[i0.ɵLocaleDataIndex.ExtraData][2 /* ExtraDayPeriodsRules */] || [];\n        return rules.map(function (rule) {\n            if (typeof rule === 'string') {\n                return extractTime(rule);\n            }\n            return [extractTime(rule[0]), extractTime(rule[1])];\n        });\n    }\n    /**\n     * Retrieves locale-specific day periods, which indicate roughly how a day is broken up\n     * in different languages.\n     * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight.\n     *\n     * This functionality is only available when you have loaded the full locale data.\n     * See the [\"I18n guide\"](guide/i18n#i18n-pipes).\n     *\n     * @param locale A locale code for the locale format rules to use.\n     * @param formStyle The required grammatical form.\n     * @param width The required character width.\n     * @returns The translated day-period strings.\n     * @see `getLocaleExtraDayPeriodRules()`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLocaleExtraDayPeriods(locale, formStyle, width) {\n        var data = i0.ɵfindLocaleData(locale);\n        checkFullData(data);\n        var dayPeriodsData = [\n            data[i0.ɵLocaleDataIndex.ExtraData][0 /* ExtraDayPeriodFormats */],\n            data[i0.ɵLocaleDataIndex.ExtraData][1 /* ExtraDayPeriodStandalone */]\n        ];\n        var dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];\n        return getLastDefinedValue(dayPeriods, width) || [];\n    }\n    /**\n     * Retrieves the writing direction of a specified locale\n     * @param locale A locale code for the locale format rules to use.\n     * @publicApi\n     * @returns 'rtl' or 'ltr'\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     */\n    function getLocaleDirection(locale) {\n        var data = i0.ɵfindLocaleData(locale);\n        return data[i0.ɵLocaleDataIndex.Directionality];\n    }\n    /**\n     * Retrieves the first value that is defined in an array, going backwards from an index position.\n     *\n     * To avoid repeating the same data (as when the \"format\" and \"standalone\" forms are the same)\n     * add the first value to the locale data arrays, and add other values only if they are different.\n     *\n     * @param data The data array to retrieve from.\n     * @param index A 0-based index into the array to start from.\n     * @returns The value immediately before the given index position.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getLastDefinedValue(data, index) {\n        for (var i = index; i > -1; i--) {\n            if (typeof data[i] !== 'undefined') {\n                return data[i];\n            }\n        }\n        throw new Error('Locale data API: locale data undefined');\n    }\n    /**\n     * Extracts the hours and minutes from a string like \"15:45\"\n     */\n    function extractTime(time) {\n        var _a = __read(time.split(':'), 2), h = _a[0], m = _a[1];\n        return { hours: +h, minutes: +m };\n    }\n    /**\n     * Retrieves the currency symbol for a given currency code.\n     *\n     * For example, for the default `en-US` locale, the code `USD` can\n     * be represented by the narrow symbol `$` or the wide symbol `US$`.\n     *\n     * @param code The currency code.\n     * @param format The format, `wide` or `narrow`.\n     * @param locale A locale code for the locale format rules to use.\n     *\n     * @returns The symbol, or the currency code if no symbol is available.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getCurrencySymbol(code, format, locale) {\n        if (locale === void 0) { locale = 'en'; }\n        var currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];\n        var symbolNarrow = currency[1 /* SymbolNarrow */];\n        if (format === 'narrow' && typeof symbolNarrow === 'string') {\n            return symbolNarrow;\n        }\n        return currency[0 /* Symbol */] || code;\n    }\n    // Most currencies have cents, that's why the default is 2\n    var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;\n    /**\n     * Reports the number of decimal digits for a given currency.\n     * The value depends upon the presence of cents in that particular currency.\n     *\n     * @param code The currency code.\n     * @returns The number of decimal digits, typically 0 or 2.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function getNumberOfCurrencyDigits(code) {\n        var digits;\n        var currency = CURRENCIES_EN[code];\n        if (currency) {\n            digits = currency[2 /* NbOfDigits */];\n        }\n        return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;\n    }\n\n    var ISO8601_DATE_REGEX = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n    //    1        2       3         4          5          6          7          8  9     10      11\n    var NAMED_FORMATS = {};\n    var DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\\s\\S]*)/;\n    var ZoneWidth;\n    (function (ZoneWidth) {\n        ZoneWidth[ZoneWidth[\"Short\"] = 0] = \"Short\";\n        ZoneWidth[ZoneWidth[\"ShortGMT\"] = 1] = \"ShortGMT\";\n        ZoneWidth[ZoneWidth[\"Long\"] = 2] = \"Long\";\n        ZoneWidth[ZoneWidth[\"Extended\"] = 3] = \"Extended\";\n    })(ZoneWidth || (ZoneWidth = {}));\n    var DateType;\n    (function (DateType) {\n        DateType[DateType[\"FullYear\"] = 0] = \"FullYear\";\n        DateType[DateType[\"Month\"] = 1] = \"Month\";\n        DateType[DateType[\"Date\"] = 2] = \"Date\";\n        DateType[DateType[\"Hours\"] = 3] = \"Hours\";\n        DateType[DateType[\"Minutes\"] = 4] = \"Minutes\";\n        DateType[DateType[\"Seconds\"] = 5] = \"Seconds\";\n        DateType[DateType[\"FractionalSeconds\"] = 6] = \"FractionalSeconds\";\n        DateType[DateType[\"Day\"] = 7] = \"Day\";\n    })(DateType || (DateType = {}));\n    var TranslationType;\n    (function (TranslationType) {\n        TranslationType[TranslationType[\"DayPeriods\"] = 0] = \"DayPeriods\";\n        TranslationType[TranslationType[\"Days\"] = 1] = \"Days\";\n        TranslationType[TranslationType[\"Months\"] = 2] = \"Months\";\n        TranslationType[TranslationType[\"Eras\"] = 3] = \"Eras\";\n    })(TranslationType || (TranslationType = {}));\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Formats a date according to locale rules.\n     *\n     * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch)\n     * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime).\n     * @param format The date-time components to include. See `DatePipe` for details.\n     * @param locale A locale code for the locale format rules to use.\n     * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`),\n     * or a standard UTC/GMT or continental US time zone abbreviation.\n     * If not specified, uses host system settings.\n     *\n     * @returns The formatted date string.\n     *\n     * @see `DatePipe`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function formatDate(value, format, locale, timezone) {\n        var date = toDate(value);\n        var namedFormat = getNamedFormat(locale, format);\n        format = namedFormat || format;\n        var parts = [];\n        var match;\n        while (format) {\n            match = DATE_FORMATS_SPLIT.exec(format);\n            if (match) {\n                parts = parts.concat(match.slice(1));\n                var part = parts.pop();\n                if (!part) {\n                    break;\n                }\n                format = part;\n            }\n            else {\n                parts.push(format);\n                break;\n            }\n        }\n        var dateTimezoneOffset = date.getTimezoneOffset();\n        if (timezone) {\n            dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n            date = convertTimezoneToLocal(date, timezone, true);\n        }\n        var text = '';\n        parts.forEach(function (value) {\n            var dateFormatter = getDateFormatter(value);\n            text += dateFormatter ?\n                dateFormatter(date, locale, dateTimezoneOffset) :\n                value === '\\'\\'' ? '\\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n        });\n        return text;\n    }\n    /**\n     * Create a new Date object with the given date value, and the time set to midnight.\n     *\n     * We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.\n     * See: https://github.com/angular/angular/issues/40377\n     *\n     * Note that this function returns a Date object whose time is midnight in the current locale's\n     * timezone. In the future we might want to change this to be midnight in UTC, but this would be a\n     * considerable breaking change.\n     */\n    function createDate(year, month, date) {\n        // The `newDate` is set to midnight (UTC) on January 1st 1970.\n        // - In PST this will be December 31st 1969 at 4pm.\n        // - In GMT this will be January 1st 1970 at 1am.\n        // Note that they even have different years, dates and months!\n        var newDate = new Date(0);\n        // `setFullYear()` allows years like 0001 to be set correctly. This function does not\n        // change the internal time of the date.\n        // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).\n        // - In PST this will now be September 20, 2019 at 4pm\n        // - In GMT this will now be September 20, 2019 at 1am\n        newDate.setFullYear(year, month, date);\n        // We want the final date to be at local midnight, so we reset the time.\n        // - In PST this will now be September 20, 2019 at 12am\n        // - In GMT this will now be September 20, 2019 at 12am\n        newDate.setHours(0, 0, 0);\n        return newDate;\n    }\n    function getNamedFormat(locale, format) {\n        var localeId = getLocaleId(locale);\n        NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};\n        if (NAMED_FORMATS[localeId][format]) {\n            return NAMED_FORMATS[localeId][format];\n        }\n        var formatValue = '';\n        switch (format) {\n            case 'shortDate':\n                formatValue = getLocaleDateFormat(locale, exports.FormatWidth.Short);\n                break;\n            case 'mediumDate':\n                formatValue = getLocaleDateFormat(locale, exports.FormatWidth.Medium);\n                break;\n            case 'longDate':\n                formatValue = getLocaleDateFormat(locale, exports.FormatWidth.Long);\n                break;\n            case 'fullDate':\n                formatValue = getLocaleDateFormat(locale, exports.FormatWidth.Full);\n                break;\n            case 'shortTime':\n                formatValue = getLocaleTimeFormat(locale, exports.FormatWidth.Short);\n                break;\n            case 'mediumTime':\n                formatValue = getLocaleTimeFormat(locale, exports.FormatWidth.Medium);\n                break;\n            case 'longTime':\n                formatValue = getLocaleTimeFormat(locale, exports.FormatWidth.Long);\n                break;\n            case 'fullTime':\n                formatValue = getLocaleTimeFormat(locale, exports.FormatWidth.Full);\n                break;\n            case 'short':\n                var shortTime = getNamedFormat(locale, 'shortTime');\n                var shortDate = getNamedFormat(locale, 'shortDate');\n                formatValue = formatDateTime(getLocaleDateTimeFormat(locale, exports.FormatWidth.Short), [shortTime, shortDate]);\n                break;\n            case 'medium':\n                var mediumTime = getNamedFormat(locale, 'mediumTime');\n                var mediumDate = getNamedFormat(locale, 'mediumDate');\n                formatValue = formatDateTime(getLocaleDateTimeFormat(locale, exports.FormatWidth.Medium), [mediumTime, mediumDate]);\n                break;\n            case 'long':\n                var longTime = getNamedFormat(locale, 'longTime');\n                var longDate = getNamedFormat(locale, 'longDate');\n                formatValue =\n                    formatDateTime(getLocaleDateTimeFormat(locale, exports.FormatWidth.Long), [longTime, longDate]);\n                break;\n            case 'full':\n                var fullTime = getNamedFormat(locale, 'fullTime');\n                var fullDate = getNamedFormat(locale, 'fullDate');\n                formatValue =\n                    formatDateTime(getLocaleDateTimeFormat(locale, exports.FormatWidth.Full), [fullTime, fullDate]);\n                break;\n        }\n        if (formatValue) {\n            NAMED_FORMATS[localeId][format] = formatValue;\n        }\n        return formatValue;\n    }\n    function formatDateTime(str, opt_values) {\n        if (opt_values) {\n            str = str.replace(/\\{([^}]+)}/g, function (match, key) {\n                return (opt_values != null && key in opt_values) ? opt_values[key] : match;\n            });\n        }\n        return str;\n    }\n    function padNumber(num, digits, minusSign, trim, negWrap) {\n        if (minusSign === void 0) { minusSign = '-'; }\n        var neg = '';\n        if (num < 0 || (negWrap && num <= 0)) {\n            if (negWrap) {\n                num = -num + 1;\n            }\n            else {\n                num = -num;\n                neg = minusSign;\n            }\n        }\n        var strNum = String(num);\n        while (strNum.length < digits) {\n            strNum = '0' + strNum;\n        }\n        if (trim) {\n            strNum = strNum.substr(strNum.length - digits);\n        }\n        return neg + strNum;\n    }\n    function formatFractionalSeconds(milliseconds, digits) {\n        var strMs = padNumber(milliseconds, 3);\n        return strMs.substr(0, digits);\n    }\n    /**\n     * Returns a date formatter that transforms a date into its locale digit representation\n     */\n    function dateGetter(name, size, offset, trim, negWrap) {\n        if (offset === void 0) { offset = 0; }\n        if (trim === void 0) { trim = false; }\n        if (negWrap === void 0) { negWrap = false; }\n        return function (date, locale) {\n            var part = getDatePart(name, date);\n            if (offset > 0 || part > -offset) {\n                part += offset;\n            }\n            if (name === DateType.Hours) {\n                if (part === 0 && offset === -12) {\n                    part = 12;\n                }\n            }\n            else if (name === DateType.FractionalSeconds) {\n                return formatFractionalSeconds(part, size);\n            }\n            var localeMinus = getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign);\n            return padNumber(part, size, localeMinus, trim, negWrap);\n        };\n    }\n    function getDatePart(part, date) {\n        switch (part) {\n            case DateType.FullYear:\n                return date.getFullYear();\n            case DateType.Month:\n                return date.getMonth();\n            case DateType.Date:\n                return date.getDate();\n            case DateType.Hours:\n                return date.getHours();\n            case DateType.Minutes:\n                return date.getMinutes();\n            case DateType.Seconds:\n                return date.getSeconds();\n            case DateType.FractionalSeconds:\n                return date.getMilliseconds();\n            case DateType.Day:\n                return date.getDay();\n            default:\n                throw new Error(\"Unknown DateType value \\\"\" + part + \"\\\".\");\n        }\n    }\n    /**\n     * Returns a date formatter that transforms a date into its locale string representation\n     */\n    function dateStrGetter(name, width, form, extended) {\n        if (form === void 0) { form = exports.FormStyle.Format; }\n        if (extended === void 0) { extended = false; }\n        return function (date, locale) {\n            return getDateTranslation(date, locale, name, width, form, extended);\n        };\n    }\n    /**\n     * Returns the locale translation of a date for a given form, type and width\n     */\n    function getDateTranslation(date, locale, name, width, form, extended) {\n        switch (name) {\n            case TranslationType.Months:\n                return getLocaleMonthNames(locale, form, width)[date.getMonth()];\n            case TranslationType.Days:\n                return getLocaleDayNames(locale, form, width)[date.getDay()];\n            case TranslationType.DayPeriods:\n                var currentHours_1 = date.getHours();\n                var currentMinutes_1 = date.getMinutes();\n                if (extended) {\n                    var rules = getLocaleExtraDayPeriodRules(locale);\n                    var dayPeriods = getLocaleExtraDayPeriods(locale, form, width);\n                    var index = rules.findIndex(function (rule) {\n                        if (Array.isArray(rule)) {\n                            // morning, afternoon, evening, night\n                            var _a = __read(rule, 2), from = _a[0], to = _a[1];\n                            var afterFrom = currentHours_1 >= from.hours && currentMinutes_1 >= from.minutes;\n                            var beforeTo = (currentHours_1 < to.hours ||\n                                (currentHours_1 === to.hours && currentMinutes_1 < to.minutes));\n                            // We must account for normal rules that span a period during the day (e.g. 6am-9am)\n                            // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g.\n                            // 10pm - 5am) where `from` is greater (later!) than `to`.\n                            //\n                            // In the first case the current time must be BOTH after `from` AND before `to`\n                            // (e.g. 8am is after 6am AND before 10am).\n                            //\n                            // In the second case the current time must be EITHER after `from` OR before `to`\n                            // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is\n                            // after 10pm).\n                            if (from.hours < to.hours) {\n                                if (afterFrom && beforeTo) {\n                                    return true;\n                                }\n                            }\n                            else if (afterFrom || beforeTo) {\n                                return true;\n                            }\n                        }\n                        else { // noon or midnight\n                            if (rule.hours === currentHours_1 && rule.minutes === currentMinutes_1) {\n                                return true;\n                            }\n                        }\n                        return false;\n                    });\n                    if (index !== -1) {\n                        return dayPeriods[index];\n                    }\n                }\n                // if no rules for the day periods, we use am/pm by default\n                return getLocaleDayPeriods(locale, form, width)[currentHours_1 < 12 ? 0 : 1];\n            case TranslationType.Eras:\n                return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];\n            default:\n                // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n                // However Closure Compiler does not understand that and reports an error in typed mode.\n                // The `throw new Error` below works around the problem, and the unexpected: never variable\n                // makes sure tsc still checks this code is unreachable.\n                var unexpected = name;\n                throw new Error(\"unexpected translation type \" + unexpected);\n        }\n    }\n    /**\n     * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or\n     * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,\n     * extended = +04:30)\n     */\n    function timeZoneGetter(width) {\n        return function (date, locale, offset) {\n            var zone = -1 * offset;\n            var minusSign = getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign);\n            var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n            switch (width) {\n                case ZoneWidth.Short:\n                    return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n                        padNumber(Math.abs(zone % 60), 2, minusSign);\n                case ZoneWidth.ShortGMT:\n                    return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n                case ZoneWidth.Long:\n                    return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n                        padNumber(Math.abs(zone % 60), 2, minusSign);\n                case ZoneWidth.Extended:\n                    if (offset === 0) {\n                        return 'Z';\n                    }\n                    else {\n                        return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n                            padNumber(Math.abs(zone % 60), 2, minusSign);\n                    }\n                default:\n                    throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n            }\n        };\n    }\n    var JANUARY = 0;\n    var THURSDAY = 4;\n    function getFirstThursdayOfYear(year) {\n        var firstDayOfYear = createDate(year, JANUARY, 1).getDay();\n        return createDate(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);\n    }\n    function getThursdayThisWeek(datetime) {\n        return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));\n    }\n    function weekGetter(size, monthBased) {\n        if (monthBased === void 0) { monthBased = false; }\n        return function (date, locale) {\n            var result;\n            if (monthBased) {\n                var nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;\n                var today = date.getDate();\n                result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);\n            }\n            else {\n                var thisThurs = getThursdayThisWeek(date);\n                // Some days of a year are part of next year according to ISO 8601.\n                // Compute the firstThurs from the year of this week's Thursday\n                var firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());\n                var diff = thisThurs.getTime() - firstThurs.getTime();\n                result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n            }\n            return padNumber(result, size, getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign));\n        };\n    }\n    /**\n     * Returns a date formatter that provides the week-numbering year for the input date.\n     */\n    function weekNumberingYearGetter(size, trim) {\n        if (trim === void 0) { trim = false; }\n        return function (date, locale) {\n            var thisThurs = getThursdayThisWeek(date);\n            var weekNumberingYear = thisThurs.getFullYear();\n            return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign), trim);\n        };\n    }\n    var DATE_FORMATS = {};\n    // Based on CLDR formats:\n    // See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n    // See also explanations: http://cldr.unicode.org/translation/date-time\n    // TODO(ocombe): support all missing cldr formats: U, Q, D, F, e, j, J, C, A, v, V, X, x\n    function getDateFormatter(format) {\n        if (DATE_FORMATS[format]) {\n            return DATE_FORMATS[format];\n        }\n        var formatter;\n        switch (format) {\n            // Era name (AD/BC)\n            case 'G':\n            case 'GG':\n            case 'GGG':\n                formatter = dateStrGetter(TranslationType.Eras, exports.TranslationWidth.Abbreviated);\n                break;\n            case 'GGGG':\n                formatter = dateStrGetter(TranslationType.Eras, exports.TranslationWidth.Wide);\n                break;\n            case 'GGGGG':\n                formatter = dateStrGetter(TranslationType.Eras, exports.TranslationWidth.Narrow);\n                break;\n            // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)\n            case 'y':\n                formatter = dateGetter(DateType.FullYear, 1, 0, false, true);\n                break;\n            // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n            case 'yy':\n                formatter = dateGetter(DateType.FullYear, 2, 0, true, true);\n                break;\n            // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)\n            case 'yyy':\n                formatter = dateGetter(DateType.FullYear, 3, 0, false, true);\n                break;\n            // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)\n            case 'yyyy':\n                formatter = dateGetter(DateType.FullYear, 4, 0, false, true);\n                break;\n            // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)\n            case 'Y':\n                formatter = weekNumberingYearGetter(1);\n                break;\n            // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD\n            // 2010 => 10)\n            case 'YY':\n                formatter = weekNumberingYearGetter(2, true);\n                break;\n            // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD\n            // 2010 => 2010)\n            case 'YYY':\n                formatter = weekNumberingYearGetter(3);\n                break;\n            // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)\n            case 'YYYY':\n                formatter = weekNumberingYearGetter(4);\n                break;\n            // Month of the year (1-12), numeric\n            case 'M':\n            case 'L':\n                formatter = dateGetter(DateType.Month, 1, 1);\n                break;\n            case 'MM':\n            case 'LL':\n                formatter = dateGetter(DateType.Month, 2, 1);\n                break;\n            // Month of the year (January, ...), string, format\n            case 'MMM':\n                formatter = dateStrGetter(TranslationType.Months, exports.TranslationWidth.Abbreviated);\n                break;\n            case 'MMMM':\n                formatter = dateStrGetter(TranslationType.Months, exports.TranslationWidth.Wide);\n                break;\n            case 'MMMMM':\n                formatter = dateStrGetter(TranslationType.Months, exports.TranslationWidth.Narrow);\n                break;\n            // Month of the year (January, ...), string, standalone\n            case 'LLL':\n                formatter =\n                    dateStrGetter(TranslationType.Months, exports.TranslationWidth.Abbreviated, exports.FormStyle.Standalone);\n                break;\n            case 'LLLL':\n                formatter =\n                    dateStrGetter(TranslationType.Months, exports.TranslationWidth.Wide, exports.FormStyle.Standalone);\n                break;\n            case 'LLLLL':\n                formatter =\n                    dateStrGetter(TranslationType.Months, exports.TranslationWidth.Narrow, exports.FormStyle.Standalone);\n                break;\n            // Week of the year (1, ... 52)\n            case 'w':\n                formatter = weekGetter(1);\n                break;\n            case 'ww':\n                formatter = weekGetter(2);\n                break;\n            // Week of the month (1, ...)\n            case 'W':\n                formatter = weekGetter(1, true);\n                break;\n            // Day of the month (1-31)\n            case 'd':\n                formatter = dateGetter(DateType.Date, 1);\n                break;\n            case 'dd':\n                formatter = dateGetter(DateType.Date, 2);\n                break;\n            // Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo)\n            case 'c':\n            case 'cc':\n                formatter = dateGetter(DateType.Day, 1);\n                break;\n            case 'ccc':\n                formatter =\n                    dateStrGetter(TranslationType.Days, exports.TranslationWidth.Abbreviated, exports.FormStyle.Standalone);\n                break;\n            case 'cccc':\n                formatter = dateStrGetter(TranslationType.Days, exports.TranslationWidth.Wide, exports.FormStyle.Standalone);\n                break;\n            case 'ccccc':\n                formatter =\n                    dateStrGetter(TranslationType.Days, exports.TranslationWidth.Narrow, exports.FormStyle.Standalone);\n                break;\n            case 'cccccc':\n                formatter = dateStrGetter(TranslationType.Days, exports.TranslationWidth.Short, exports.FormStyle.Standalone);\n                break;\n            // Day of the Week\n            case 'E':\n            case 'EE':\n            case 'EEE':\n                formatter = dateStrGetter(TranslationType.Days, exports.TranslationWidth.Abbreviated);\n                break;\n            case 'EEEE':\n                formatter = dateStrGetter(TranslationType.Days, exports.TranslationWidth.Wide);\n                break;\n            case 'EEEEE':\n                formatter = dateStrGetter(TranslationType.Days, exports.TranslationWidth.Narrow);\n                break;\n            case 'EEEEEE':\n                formatter = dateStrGetter(TranslationType.Days, exports.TranslationWidth.Short);\n                break;\n            // Generic period of the day (am-pm)\n            case 'a':\n            case 'aa':\n            case 'aaa':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Abbreviated);\n                break;\n            case 'aaaa':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Wide);\n                break;\n            case 'aaaaa':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Narrow);\n                break;\n            // Extended period of the day (midnight, at night, ...), standalone\n            case 'b':\n            case 'bb':\n            case 'bbb':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Abbreviated, exports.FormStyle.Standalone, true);\n                break;\n            case 'bbbb':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Wide, exports.FormStyle.Standalone, true);\n                break;\n            case 'bbbbb':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Narrow, exports.FormStyle.Standalone, true);\n                break;\n            // Extended period of the day (midnight, night, ...), standalone\n            case 'B':\n            case 'BB':\n            case 'BBB':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Abbreviated, exports.FormStyle.Format, true);\n                break;\n            case 'BBBB':\n                formatter =\n                    dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Wide, exports.FormStyle.Format, true);\n                break;\n            case 'BBBBB':\n                formatter = dateStrGetter(TranslationType.DayPeriods, exports.TranslationWidth.Narrow, exports.FormStyle.Format, true);\n                break;\n            // Hour in AM/PM, (1-12)\n            case 'h':\n                formatter = dateGetter(DateType.Hours, 1, -12);\n                break;\n            case 'hh':\n                formatter = dateGetter(DateType.Hours, 2, -12);\n                break;\n            // Hour of the day (0-23)\n            case 'H':\n                formatter = dateGetter(DateType.Hours, 1);\n                break;\n            // Hour in day, padded (00-23)\n            case 'HH':\n                formatter = dateGetter(DateType.Hours, 2);\n                break;\n            // Minute of the hour (0-59)\n            case 'm':\n                formatter = dateGetter(DateType.Minutes, 1);\n                break;\n            case 'mm':\n                formatter = dateGetter(DateType.Minutes, 2);\n                break;\n            // Second of the minute (0-59)\n            case 's':\n                formatter = dateGetter(DateType.Seconds, 1);\n                break;\n            case 'ss':\n                formatter = dateGetter(DateType.Seconds, 2);\n                break;\n            // Fractional second\n            case 'S':\n                formatter = dateGetter(DateType.FractionalSeconds, 1);\n                break;\n            case 'SS':\n                formatter = dateGetter(DateType.FractionalSeconds, 2);\n                break;\n            case 'SSS':\n                formatter = dateGetter(DateType.FractionalSeconds, 3);\n                break;\n            // Timezone ISO8601 short format (-0430)\n            case 'Z':\n            case 'ZZ':\n            case 'ZZZ':\n                formatter = timeZoneGetter(ZoneWidth.Short);\n                break;\n            // Timezone ISO8601 extended format (-04:30)\n            case 'ZZZZZ':\n                formatter = timeZoneGetter(ZoneWidth.Extended);\n                break;\n            // Timezone GMT short format (GMT+4)\n            case 'O':\n            case 'OO':\n            case 'OOO':\n            // Should be location, but fallback to format O instead because we don't have the data yet\n            case 'z':\n            case 'zz':\n            case 'zzz':\n                formatter = timeZoneGetter(ZoneWidth.ShortGMT);\n                break;\n            // Timezone GMT long format (GMT+0430)\n            case 'OOOO':\n            case 'ZZZZ':\n            // Should be location, but fallback to format O instead because we don't have the data yet\n            case 'zzzz':\n                formatter = timeZoneGetter(ZoneWidth.Long);\n                break;\n            default:\n                return null;\n        }\n        DATE_FORMATS[format] = formatter;\n        return formatter;\n    }\n    function timezoneToOffset(timezone, fallback) {\n        // Support: IE 11 only, Edge 13-15+\n        // IE/Edge do not \"understand\" colon (`:`) in timezone\n        timezone = timezone.replace(/:/g, '');\n        var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n        return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n    }\n    function addDateMinutes(date, minutes) {\n        date = new Date(date.getTime());\n        date.setMinutes(date.getMinutes() + minutes);\n        return date;\n    }\n    function convertTimezoneToLocal(date, timezone, reverse) {\n        var reverseValue = reverse ? -1 : 1;\n        var dateTimezoneOffset = date.getTimezoneOffset();\n        var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n        return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));\n    }\n    /**\n     * Converts a value to date.\n     *\n     * Supported input formats:\n     * - `Date`\n     * - number: timestamp\n     * - string: numeric (e.g. \"1234\"), ISO and date strings in a format supported by\n     *   [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\n     *   Note: ISO strings without time return a date without timeoffset.\n     *\n     * Throws if unable to convert to a date.\n     */\n    function toDate(value) {\n        if (isDate(value)) {\n            return value;\n        }\n        if (typeof value === 'number' && !isNaN(value)) {\n            return new Date(value);\n        }\n        if (typeof value === 'string') {\n            value = value.trim();\n            if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n                /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n                before Date creation to avoid time offset and errors in the new Date.\n                If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n                date, some browsers (e.g. IE 9) will throw an invalid Date error.\n                If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n                is applied.\n                Note: ISO months are 0 for January, 1 for February, ... */\n                var _a = __read(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], _b = _a[1], m = _b === void 0 ? 1 : _b, _c = _a[2], d = _c === void 0 ? 1 : _c;\n                return createDate(y, m - 1, d);\n            }\n            var parsedNb = parseFloat(value);\n            // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n            if (!isNaN(value - parsedNb)) {\n                return new Date(parsedNb);\n            }\n            var match = void 0;\n            if (match = value.match(ISO8601_DATE_REGEX)) {\n                return isoStringToDate(match);\n            }\n        }\n        var date = new Date(value);\n        if (!isDate(date)) {\n            throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n        }\n        return date;\n    }\n    /**\n     * Converts a date in ISO8601 to a Date.\n     * Used instead of `Date.parse` because of browser discrepancies.\n     */\n    function isoStringToDate(match) {\n        var date = new Date(0);\n        var tzHour = 0;\n        var tzMin = 0;\n        // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n        var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n        var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n        // if there is a timezone defined like \"+01:00\" or \"+0100\"\n        if (match[9]) {\n            tzHour = Number(match[9] + match[10]);\n            tzMin = Number(match[9] + match[11]);\n        }\n        dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n        var h = Number(match[4] || 0) - tzHour;\n        var m = Number(match[5] || 0) - tzMin;\n        var s = Number(match[6] || 0);\n        // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n        // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n        // becomes `999ms`.\n        var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n        timeSetter.call(date, h, m, s, ms);\n        return date;\n    }\n    function isDate(value) {\n        return value instanceof Date && !isNaN(value.valueOf());\n    }\n\n    /**\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://angular.io/license\n     */\n    var NUMBER_FORMAT_REGEXP = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\n    var MAX_DIGITS = 22;\n    var DECIMAL_SEP = '.';\n    var ZERO_CHAR = '0';\n    var PATTERN_SEP = ';';\n    var GROUP_SEP = ',';\n    var DIGIT_CHAR = '#';\n    var CURRENCY_CHAR = '¤';\n    var PERCENT_CHAR = '%';\n    /**\n     * Transforms a number to a locale string based on a style and a format.\n     */\n    function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent) {\n        if (isPercent === void 0) { isPercent = false; }\n        var formattedText = '';\n        var isZero = false;\n        if (!isFinite(value)) {\n            formattedText = getLocaleNumberSymbol(locale, exports.NumberSymbol.Infinity);\n        }\n        else {\n            var parsedNumber = parseNumber(value);\n            if (isPercent) {\n                parsedNumber = toPercent(parsedNumber);\n            }\n            var minInt = pattern.minInt;\n            var minFraction = pattern.minFrac;\n            var maxFraction = pattern.maxFrac;\n            if (digitsInfo) {\n                var parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);\n                if (parts === null) {\n                    throw new Error(digitsInfo + \" is not a valid digit info\");\n                }\n                var minIntPart = parts[1];\n                var minFractionPart = parts[3];\n                var maxFractionPart = parts[5];\n                if (minIntPart != null) {\n                    minInt = parseIntAutoRadix(minIntPart);\n                }\n                if (minFractionPart != null) {\n                    minFraction = parseIntAutoRadix(minFractionPart);\n                }\n                if (maxFractionPart != null) {\n                    maxFraction = parseIntAutoRadix(maxFractionPart);\n                }\n                else if (minFractionPart != null && minFraction > maxFraction) {\n                    maxFraction = minFraction;\n                }\n            }\n            roundNumber(parsedNumber, minFraction, maxFraction);\n            var digits = parsedNumber.digits;\n            var integerLen = parsedNumber.integerLen;\n            var exponent = parsedNumber.exponent;\n            var decimals = [];\n            isZero = digits.every(function (d) { return !d; });\n            // pad zeros for small numbers\n            for (; integerLen < minInt; integerLen++) {\n                digits.unshift(0);\n            }\n            // pad zeros for small numbers\n            for (; integerLen < 0; integerLen++) {\n                digits.unshift(0);\n            }\n            // extract decimals digits\n            if (integerLen > 0) {\n                decimals = digits.splice(integerLen, digits.length);\n            }\n            else {\n                decimals = digits;\n                digits = [0];\n            }\n            // format the integer digits with grouping separators\n            var groups = [];\n            if (digits.length >= pattern.lgSize) {\n                groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n            }\n            while (digits.length > pattern.gSize) {\n                groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n            }\n            if (digits.length) {\n                groups.unshift(digits.join(''));\n            }\n            formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));\n            // append the decimal digits\n            if (decimals.length) {\n                formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');\n            }\n            if (exponent) {\n                formattedText += getLocaleNumberSymbol(locale, exports.NumberSymbol.Exponential) + '+' + exponent;\n            }\n        }\n        if (value < 0 && !isZero) {\n            formattedText = pattern.negPre + formattedText + pattern.negSuf;\n        }\n        else {\n            formattedText = pattern.posPre + formattedText + pattern.posSuf;\n        }\n        return formattedText;\n    }\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Formats a number as currency using locale rules.\n     *\n     * @param value The number to format.\n     * @param locale A locale code for the locale format rules to use.\n     * @param currency A string containing the currency symbol or its name,\n     * such as \"$\" or \"Canadian Dollar\". Used in output string, but does not affect the operation\n     * of the function.\n     * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)\n     * currency code, such as `USD` for the US dollar and `EUR` for the euro.\n     * Used to determine the number of digits in the decimal part.\n     * @param digitsInfo Decimal representation options, specified by a string in the following format:\n     * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n     *\n     * @returns The formatted currency value.\n     *\n     * @see `formatNumber()`\n     * @see `DecimalPipe`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {\n        var format = getLocaleNumberFormat(locale, exports.NumberFormatStyle.Currency);\n        var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign));\n        pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);\n        pattern.maxFrac = pattern.minFrac;\n        var res = formatNumberToLocaleString(value, pattern, locale, exports.NumberSymbol.CurrencyGroup, exports.NumberSymbol.CurrencyDecimal, digitsInfo);\n        return res\n            .replace(CURRENCY_CHAR, currency)\n            // if we have 2 time the currency character, the second one is ignored\n            .replace(CURRENCY_CHAR, '')\n            // If there is a spacing between currency character and the value and\n            // the currency character is supressed by passing an empty string, the\n            // spacing character would remain as part of the string. Then we\n            // should remove it.\n            .trim();\n    }\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Formats a number as a percentage according to locale rules.\n     *\n     * @param value The number to format.\n     * @param locale A locale code for the locale format rules to use.\n     * @param digitsInfo Decimal representation options, specified by a string in the following format:\n     * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n     *\n     * @returns The formatted percentage value.\n     *\n     * @see `formatNumber()`\n     * @see `DecimalPipe`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     * @publicApi\n     *\n     */\n    function formatPercent(value, locale, digitsInfo) {\n        var format = getLocaleNumberFormat(locale, exports.NumberFormatStyle.Percent);\n        var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign));\n        var res = formatNumberToLocaleString(value, pattern, locale, exports.NumberSymbol.Group, exports.NumberSymbol.Decimal, digitsInfo, true);\n        return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, exports.NumberSymbol.PercentSign));\n    }\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Formats a number as text, with group sizing, separator, and other\n     * parameters based on the locale.\n     *\n     * @param value The number to format.\n     * @param locale A locale code for the locale format rules to use.\n     * @param digitsInfo Decimal representation options, specified by a string in the following format:\n     * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n     *\n     * @returns The formatted text string.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     *\n     * @publicApi\n     */\n    function formatNumber(value, locale, digitsInfo) {\n        var format = getLocaleNumberFormat(locale, exports.NumberFormatStyle.Decimal);\n        var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, exports.NumberSymbol.MinusSign));\n        return formatNumberToLocaleString(value, pattern, locale, exports.NumberSymbol.Group, exports.NumberSymbol.Decimal, digitsInfo);\n    }\n    function parseNumberFormat(format, minusSign) {\n        if (minusSign === void 0) { minusSign = '-'; }\n        var p = {\n            minInt: 1,\n            minFrac: 0,\n            maxFrac: 0,\n            posPre: '',\n            posSuf: '',\n            negPre: '',\n            negSuf: '',\n            gSize: 0,\n            lgSize: 0\n        };\n        var patternParts = format.split(PATTERN_SEP);\n        var positive = patternParts[0];\n        var negative = patternParts[1];\n        var positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ?\n            positive.split(DECIMAL_SEP) :\n            [\n                positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1),\n                positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)\n            ], integer = positiveParts[0], fraction = positiveParts[1] || '';\n        p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR));\n        for (var i = 0; i < fraction.length; i++) {\n            var ch = fraction.charAt(i);\n            if (ch === ZERO_CHAR) {\n                p.minFrac = p.maxFrac = i + 1;\n            }\n            else if (ch === DIGIT_CHAR) {\n                p.maxFrac = i + 1;\n            }\n            else {\n                p.posSuf += ch;\n            }\n        }\n        var groups = integer.split(GROUP_SEP);\n        p.gSize = groups[1] ? groups[1].length : 0;\n        p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0;\n        if (negative) {\n            var trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);\n            p.negPre = negative.substr(0, pos).replace(/'/g, '');\n            p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, '');\n        }\n        else {\n            p.negPre = minusSign + p.posPre;\n            p.negSuf = p.posSuf;\n        }\n        return p;\n    }\n    // Transforms a parsed number into a percentage by multiplying it by 100\n    function toPercent(parsedNumber) {\n        // if the number is 0, don't do anything\n        if (parsedNumber.digits[0] === 0) {\n            return parsedNumber;\n        }\n        // Getting the current number of decimals\n        var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n        if (parsedNumber.exponent) {\n            parsedNumber.exponent += 2;\n        }\n        else {\n            if (fractionLen === 0) {\n                parsedNumber.digits.push(0, 0);\n            }\n            else if (fractionLen === 1) {\n                parsedNumber.digits.push(0);\n            }\n            parsedNumber.integerLen += 2;\n        }\n        return parsedNumber;\n    }\n    /**\n     * Parses a number.\n     * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/\n     */\n    function parseNumber(num) {\n        var numStr = Math.abs(num) + '';\n        var exponent = 0, digits, integerLen;\n        var i, j, zeros;\n        // Decimal point?\n        if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n            numStr = numStr.replace(DECIMAL_SEP, '');\n        }\n        // Exponential form?\n        if ((i = numStr.search(/e/i)) > 0) {\n            // Work out the exponent.\n            if (integerLen < 0)\n                integerLen = i;\n            integerLen += +numStr.slice(i + 1);\n            numStr = numStr.substring(0, i);\n        }\n        else if (integerLen < 0) {\n            // There was no decimal point or exponent so it is an integer.\n            integerLen = numStr.length;\n        }\n        // Count the number of leading zeros.\n        for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n        }\n        if (i === (zeros = numStr.length)) {\n            // The digits are all zero.\n            digits = [0];\n            integerLen = 1;\n        }\n        else {\n            // Count the number of trailing zeros\n            zeros--;\n            while (numStr.charAt(zeros) === ZERO_CHAR)\n                zeros--;\n            // Trailing zeros are insignificant so ignore them\n            integerLen -= i;\n            digits = [];\n            // Convert string to array of digits without leading/trailing zeros.\n            for (j = 0; i <= zeros; i++, j++) {\n                digits[j] = Number(numStr.charAt(i));\n            }\n        }\n        // If the number overflows the maximum allowed digits then use an exponent.\n        if (integerLen > MAX_DIGITS) {\n            digits = digits.splice(0, MAX_DIGITS - 1);\n            exponent = integerLen - 1;\n            integerLen = 1;\n        }\n        return { digits: digits, exponent: exponent, integerLen: integerLen };\n    }\n    /**\n     * Round the parsed number to the specified number of decimal places\n     * This function changes the parsedNumber in-place\n     */\n    function roundNumber(parsedNumber, minFrac, maxFrac) {\n        if (minFrac > maxFrac) {\n            throw new Error(\"The minimum number of digits after fraction (\" + minFrac + \") is higher than the maximum (\" + maxFrac + \").\");\n        }\n        var digits = parsedNumber.digits;\n        var fractionLen = digits.length - parsedNumber.integerLen;\n        var fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);\n        // The index of the digit to where rounding is to occur\n        var roundAt = fractionSize + parsedNumber.integerLen;\n        var digit = digits[roundAt];\n        if (roundAt > 0) {\n            // Drop fractional digits beyond `roundAt`\n            digits.splice(Math.max(parsedNumber.integerLen, roundAt));\n            // Set non-fractional digits beyond `roundAt` to 0\n            for (var j = roundAt; j < digits.length; j++) {\n                digits[j] = 0;\n            }\n        }\n        else {\n            // We rounded to zero so reset the parsedNumber\n            fractionLen = Math.max(0, fractionLen);\n            parsedNumber.integerLen = 1;\n            digits.length = Math.max(1, roundAt = fractionSize + 1);\n            digits[0] = 0;\n            for (var i = 1; i < roundAt; i++)\n                digits[i] = 0;\n        }\n        if (digit >= 5) {\n            if (roundAt - 1 < 0) {\n                for (var k = 0; k > roundAt; k--) {\n                    digits.unshift(0);\n                    parsedNumber.integerLen++;\n                }\n                digits.unshift(1);\n                parsedNumber.integerLen++;\n            }\n            else {\n                digits[roundAt - 1]++;\n            }\n        }\n        // Pad out with zeros to get the required fraction length\n        for (; fractionLen < Math.max(0, fractionSize); fractionLen++)\n            digits.push(0);\n        var dropTrailingZeros = fractionSize !== 0;\n        // Minimal length = nb of decimals required + current nb of integers\n        // Any number besides that is optional and can be removed if it's a trailing 0\n        var minLen = minFrac + parsedNumber.integerLen;\n        // Do any carrying, e.g. a digit was rounded up to 10\n        var carry = digits.reduceRight(function (carry, d, i, digits) {\n            d = d + carry;\n            digits[i] = d < 10 ? d : d - 10; // d % 10\n            if (dropTrailingZeros) {\n                // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\n                if (digits[i] === 0 && i >= minLen) {\n                    digits.pop();\n                }\n                else {\n                    dropTrailingZeros = false;\n                }\n            }\n            return d >= 10 ? 1 : 0; // Math.floor(d / 10);\n        }, 0);\n        if (carry) {\n            digits.unshift(carry);\n            parsedNumber.integerLen++;\n        }\n    }\n    function parseIntAutoRadix(text) {\n        var result = parseInt(text);\n        if (isNaN(result)) {\n            throw new Error('Invalid integer literal when parsing ' + text);\n        }\n        return result;\n    }\n\n    /**\n     * @publicApi\n     */\n    var NgLocalization = /** @class */ (function () {\n        function NgLocalization() {\n        }\n        return NgLocalization;\n    }());\n    /**\n     * Returns the plural category for a given value.\n     * - \"=value\" when the case exists,\n     * - the plural category otherwise\n     */\n    function getPluralCategory(value, cases, ngLocalization, locale) {\n        var key = \"=\" + value;\n        if (cases.indexOf(key) > -1) {\n            return key;\n        }\n        key = ngLocalization.getPluralCategory(value, locale);\n        if (cases.indexOf(key) > -1) {\n            return key;\n        }\n        if (cases.indexOf('other') > -1) {\n            return 'other';\n        }\n        throw new Error(\"No plural message found for value \\\"\" + value + \"\\\"\");\n    }\n    /**\n     * Returns the plural case based on the locale\n     *\n     * @publicApi\n     */\n    var NgLocaleLocalization = /** @class */ (function (_super) {\n        __extends(NgLocaleLocalization, _super);\n        function NgLocaleLocalization(locale) {\n            var _this = _super.call(this) || this;\n            _this.locale = locale;\n            return _this;\n        }\n        NgLocaleLocalization.prototype.getPluralCategory = function (value, locale) {\n            var plural = getLocalePluralCase(locale || this.locale)(value);\n            switch (plural) {\n                case exports.Plural.Zero:\n                    return 'zero';\n                case exports.Plural.One:\n                    return 'one';\n                case exports.Plural.Two:\n                    return 'two';\n                case exports.Plural.Few:\n                    return 'few';\n                case exports.Plural.Many:\n                    return 'many';\n                default:\n                    return 'other';\n            }\n        };\n        return NgLocaleLocalization;\n    }(NgLocalization));\n    NgLocaleLocalization.decorators = [\n        { type: i0.Injectable }\n    ];\n    NgLocaleLocalization.ctorParameters = function () { return [\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Register global data to be used internally by Angular. See the\n     * [\"I18n guide\"](guide/i18n#i18n-pipes) to know how to import additional locale data.\n     *\n     * The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1\n     *\n     * @publicApi\n     */\n    function registerLocaleData(data, localeId, extraData) {\n        return i0.ɵregisterLocaleData(data, localeId, extraData);\n    }\n\n    /**\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://angular.io/license\n     */\n    function parseCookieValue(cookieStr, name) {\n        var e_1, _a;\n        name = encodeURIComponent(name);\n        try {\n            for (var _b = __values(cookieStr.split(';')), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var cookie = _c.value;\n                var eqIndex = cookie.indexOf('=');\n                var _d = __read(eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)], 2), cookieName = _d[0], cookieValue = _d[1];\n                if (cookieName.trim() === name) {\n                    return decodeURIComponent(cookieValue);\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return null;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     *\n     * @usageNotes\n     * ```\n     *     <some-element [ngClass]=\"'first second'\">...</some-element>\n     *\n     *     <some-element [ngClass]=\"['first', 'second']\">...</some-element>\n     *\n     *     <some-element [ngClass]=\"{'first': true, 'second': true, 'third': false}\">...</some-element>\n     *\n     *     <some-element [ngClass]=\"stringExp|arrayExp|objExp\">...</some-element>\n     *\n     *     <some-element [ngClass]=\"{'class1 class2 class3' : true}\">...</some-element>\n     * ```\n     *\n     * @description\n     *\n     * Adds and removes CSS classes on an HTML element.\n     *\n     * The CSS classes are updated as follows, depending on the type of the expression evaluation:\n     * - `string` - the CSS classes listed in the string (space delimited) are added,\n     * - `Array` - the CSS classes declared as Array elements are added,\n     * - `Object` - keys are CSS classes that get added when the expression given in the value\n     *              evaluates to a truthy value, otherwise they are removed.\n     *\n     * @publicApi\n     */\n    var NgClass = /** @class */ (function () {\n        function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {\n            this._iterableDiffers = _iterableDiffers;\n            this._keyValueDiffers = _keyValueDiffers;\n            this._ngEl = _ngEl;\n            this._renderer = _renderer;\n            this._iterableDiffer = null;\n            this._keyValueDiffer = null;\n            this._initialClasses = [];\n            this._rawClass = null;\n        }\n        Object.defineProperty(NgClass.prototype, \"klass\", {\n            set: function (value) {\n                this._removeClasses(this._initialClasses);\n                this._initialClasses = typeof value === 'string' ? value.split(/\\s+/) : [];\n                this._applyClasses(this._initialClasses);\n                this._applyClasses(this._rawClass);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgClass.prototype, \"ngClass\", {\n            set: function (value) {\n                this._removeClasses(this._rawClass);\n                this._applyClasses(this._initialClasses);\n                this._iterableDiffer = null;\n                this._keyValueDiffer = null;\n                this._rawClass = typeof value === 'string' ? value.split(/\\s+/) : value;\n                if (this._rawClass) {\n                    if (i0.ɵisListLikeIterable(this._rawClass)) {\n                        this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();\n                    }\n                    else {\n                        this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();\n                    }\n                }\n            },\n            enumerable: false,\n            configurable: true\n        });\n        NgClass.prototype.ngDoCheck = function () {\n            if (this._iterableDiffer) {\n                var iterableChanges = this._iterableDiffer.diff(this._rawClass);\n                if (iterableChanges) {\n                    this._applyIterableChanges(iterableChanges);\n                }\n            }\n            else if (this._keyValueDiffer) {\n                var keyValueChanges = this._keyValueDiffer.diff(this._rawClass);\n                if (keyValueChanges) {\n                    this._applyKeyValueChanges(keyValueChanges);\n                }\n            }\n        };\n        NgClass.prototype._applyKeyValueChanges = function (changes) {\n            var _this = this;\n            changes.forEachAddedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n            changes.forEachChangedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n            changes.forEachRemovedItem(function (record) {\n                if (record.previousValue) {\n                    _this._toggleClass(record.key, false);\n                }\n            });\n        };\n        NgClass.prototype._applyIterableChanges = function (changes) {\n            var _this = this;\n            changes.forEachAddedItem(function (record) {\n                if (typeof record.item === 'string') {\n                    _this._toggleClass(record.item, true);\n                }\n                else {\n                    throw new Error(\"NgClass can only toggle CSS classes expressed as strings, got \" + i0.ɵstringify(record.item));\n                }\n            });\n            changes.forEachRemovedItem(function (record) { return _this._toggleClass(record.item, false); });\n        };\n        /**\n         * Applies a collection of CSS classes to the DOM element.\n         *\n         * For argument of type Set and Array CSS class names contained in those collections are always\n         * added.\n         * For argument of type Map CSS class name in the map's key is toggled based on the value (added\n         * for truthy and removed for falsy).\n         */\n        NgClass.prototype._applyClasses = function (rawClassVal) {\n            var _this = this;\n            if (rawClassVal) {\n                if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n                    rawClassVal.forEach(function (klass) { return _this._toggleClass(klass, true); });\n                }\n                else {\n                    Object.keys(rawClassVal).forEach(function (klass) { return _this._toggleClass(klass, !!rawClassVal[klass]); });\n                }\n            }\n        };\n        /**\n         * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup\n         * purposes.\n         */\n        NgClass.prototype._removeClasses = function (rawClassVal) {\n            var _this = this;\n            if (rawClassVal) {\n                if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n                    rawClassVal.forEach(function (klass) { return _this._toggleClass(klass, false); });\n                }\n                else {\n                    Object.keys(rawClassVal).forEach(function (klass) { return _this._toggleClass(klass, false); });\n                }\n            }\n        };\n        NgClass.prototype._toggleClass = function (klass, enabled) {\n            var _this = this;\n            klass = klass.trim();\n            if (klass) {\n                klass.split(/\\s+/g).forEach(function (klass) {\n                    if (enabled) {\n                        _this._renderer.addClass(_this._ngEl.nativeElement, klass);\n                    }\n                    else {\n                        _this._renderer.removeClass(_this._ngEl.nativeElement, klass);\n                    }\n                });\n            }\n        };\n        return NgClass;\n    }());\n    NgClass.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngClass]' },] }\n    ];\n    NgClass.ctorParameters = function () { return [\n        { type: i0.IterableDiffers },\n        { type: i0.KeyValueDiffers },\n        { type: i0.ElementRef },\n        { type: i0.Renderer2 }\n    ]; };\n    NgClass.propDecorators = {\n        klass: [{ type: i0.Input, args: ['class',] }],\n        ngClass: [{ type: i0.Input, args: ['ngClass',] }]\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Instantiates a single {@link Component} type and inserts its Host View into current View.\n     * `NgComponentOutlet` provides a declarative approach for dynamic component creation.\n     *\n     * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and\n     * any existing component will get destroyed.\n     *\n     * @usageNotes\n     *\n     * ### Fine tune control\n     *\n     * You can control the component creation process by using the following optional attributes:\n     *\n     * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for\n     * the Component. Defaults to the injector of the current view container.\n     *\n     * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content\n     * section of the component, if exists.\n     *\n     * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other\n     * module, then load a component from that module.\n     *\n     * ### Syntax\n     *\n     * Simple\n     * ```\n     * <ng-container *ngComponentOutlet=\"componentTypeExpression\"></ng-container>\n     * ```\n     *\n     * Customized injector/content\n     * ```\n     * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n     *                                   injector: injectorExpression;\n     *                                   content: contentNodesExpression;\">\n     * </ng-container>\n     * ```\n     *\n     * Customized ngModuleFactory\n     * ```\n     * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n     *                                   ngModuleFactory: moduleFactory;\">\n     * </ng-container>\n     * ```\n     *\n     * ### A simple example\n     *\n     * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}\n     *\n     * A more complete example with additional options:\n     *\n     * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}\n     *\n     * @publicApi\n     * @ngModule CommonModule\n     */\n    var NgComponentOutlet = /** @class */ (function () {\n        function NgComponentOutlet(_viewContainerRef) {\n            this._viewContainerRef = _viewContainerRef;\n            this._componentRef = null;\n            this._moduleRef = null;\n        }\n        NgComponentOutlet.prototype.ngOnChanges = function (changes) {\n            this._viewContainerRef.clear();\n            this._componentRef = null;\n            if (this.ngComponentOutlet) {\n                var elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;\n                if (changes['ngComponentOutletNgModuleFactory']) {\n                    if (this._moduleRef)\n                        this._moduleRef.destroy();\n                    if (this.ngComponentOutletNgModuleFactory) {\n                        var parentModule = elInjector.get(i0.NgModuleRef);\n                        this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);\n                    }\n                    else {\n                        this._moduleRef = null;\n                    }\n                }\n                var componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :\n                    elInjector.get(i0.ComponentFactoryResolver);\n                var componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);\n                this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);\n            }\n        };\n        NgComponentOutlet.prototype.ngOnDestroy = function () {\n            if (this._moduleRef)\n                this._moduleRef.destroy();\n        };\n        return NgComponentOutlet;\n    }());\n    NgComponentOutlet.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngComponentOutlet]' },] }\n    ];\n    NgComponentOutlet.ctorParameters = function () { return [\n        { type: i0.ViewContainerRef }\n    ]; };\n    NgComponentOutlet.propDecorators = {\n        ngComponentOutlet: [{ type: i0.Input }],\n        ngComponentOutletInjector: [{ type: i0.Input }],\n        ngComponentOutletContent: [{ type: i0.Input }],\n        ngComponentOutletNgModuleFactory: [{ type: i0.Input }]\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @publicApi\n     */\n    var NgForOfContext = /** @class */ (function () {\n        function NgForOfContext($implicit, ngForOf, index, count) {\n            this.$implicit = $implicit;\n            this.ngForOf = ngForOf;\n            this.index = index;\n            this.count = count;\n        }\n        Object.defineProperty(NgForOfContext.prototype, \"first\", {\n            get: function () {\n                return this.index === 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgForOfContext.prototype, \"last\", {\n            get: function () {\n                return this.index === this.count - 1;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgForOfContext.prototype, \"even\", {\n            get: function () {\n                return this.index % 2 === 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgForOfContext.prototype, \"odd\", {\n            get: function () {\n                return !this.even;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return NgForOfContext;\n    }());\n    /**\n     * A [structural directive](guide/structural-directives) that renders\n     * a template for each item in a collection.\n     * The directive is placed on an element, which becomes the parent\n     * of the cloned templates.\n     *\n     * The `ngForOf` directive is generally used in the\n     * [shorthand form](guide/structural-directives#asterisk) `*ngFor`.\n     * In this form, the template to be rendered for each iteration is the content\n     * of an anchor element containing the directive.\n     *\n     * The following example shows the shorthand syntax with some options,\n     * contained in an `<li>` element.\n     *\n     * ```\n     * <li *ngFor=\"let item of items; index as i; trackBy: trackByFn\">...</li>\n     * ```\n     *\n     * The shorthand form expands into a long form that uses the `ngForOf` selector\n     * on an `<ng-template>` element.\n     * The content of the `<ng-template>` element is the `<li>` element that held the\n     * short-form directive.\n     *\n     * Here is the expanded version of the short-form example.\n     *\n     * ```\n     * <ng-template ngFor let-item [ngForOf]=\"items\" let-i=\"index\" [ngForTrackBy]=\"trackByFn\">\n     *   <li>...</li>\n     * </ng-template>\n     * ```\n     *\n     * Angular automatically expands the shorthand syntax as it compiles the template.\n     * The context for each embedded view is logically merged to the current component\n     * context according to its lexical position.\n     *\n     * When using the shorthand syntax, Angular allows only [one structural directive\n     * on an element](guide/built-in-directives#one-per-element).\n     * If you want to iterate conditionally, for example,\n     * put the `*ngIf` on a container element that wraps the `*ngFor` element.\n     * For futher discussion, see\n     * [Structural Directives](guide/built-in-directives#one-per-element).\n     *\n     * @usageNotes\n     *\n     * ### Local variables\n     *\n     * `NgForOf` provides exported values that can be aliased to local variables.\n     * For example:\n     *\n     *  ```\n     * <li *ngFor=\"let user of users; index as i; first as isFirst\">\n     *    {{i}}/{{users.length}}. {{user}} <span *ngIf=\"isFirst\">default</span>\n     * </li>\n     * ```\n     *\n     * The following exported values can be aliased to local variables:\n     *\n     * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).\n     * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is\n     * more complex then a property access, for example when using the async pipe (`userStreams |\n     * async`).\n     * - `index: number`: The index of the current item in the iterable.\n     * - `count: number`: The length of the iterable.\n     * - `first: boolean`: True when the item is the first item in the iterable.\n     * - `last: boolean`: True when the item is the last item in the iterable.\n     * - `even: boolean`: True when the item has an even index in the iterable.\n     * - `odd: boolean`: True when the item has an odd index in the iterable.\n     *\n     * ### Change propagation\n     *\n     * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:\n     *\n     * * When an item is added, a new instance of the template is added to the DOM.\n     * * When an item is removed, its template instance is removed from the DOM.\n     * * When items are reordered, their respective templates are reordered in the DOM.\n     *\n     * Angular uses object identity to track insertions and deletions within the iterator and reproduce\n     * those changes in the DOM. This has important implications for animations and any stateful\n     * controls that are present, such as `<input>` elements that accept user input. Inserted rows can\n     * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state\n     * such as user input.\n     * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers).\n     *\n     * The identities of elements in the iterator can change while the data does not.\n     * This can happen, for example, if the iterator is produced from an RPC to the server, and that\n     * RPC is re-run. Even if the data hasn't changed, the second response produces objects with\n     * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old\n     * elements were deleted and all new elements inserted).\n     *\n     * To avoid this expensive operation, you can customize the default tracking algorithm.\n     * by supplying the `trackBy` option to `NgForOf`.\n     * `trackBy` takes a function that has two arguments: `index` and `item`.\n     * If `trackBy` is given, Angular tracks changes by the return value of the function.\n     *\n     * @see [Structural Directives](guide/structural-directives)\n     * @ngModule CommonModule\n     * @publicApi\n     */\n    var NgForOf = /** @class */ (function () {\n        function NgForOf(_viewContainer, _template, _differs) {\n            this._viewContainer = _viewContainer;\n            this._template = _template;\n            this._differs = _differs;\n            this._ngForOf = null;\n            this._ngForOfDirty = true;\n            this._differ = null;\n        }\n        Object.defineProperty(NgForOf.prototype, \"ngForOf\", {\n            /**\n             * The value of the iterable expression, which can be used as a\n             * [template input variable](guide/structural-directives#shorthand).\n             */\n            set: function (ngForOf) {\n                this._ngForOf = ngForOf;\n                this._ngForOfDirty = true;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgForOf.prototype, \"ngForTrackBy\", {\n            get: function () {\n                return this._trackByFn;\n            },\n            /**\n             * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.\n             *\n             * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object\n             * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n             * as the key.\n             *\n             * `NgForOf` uses the computed key to associate items in an iterable with DOM elements\n             * it produces for these items.\n             *\n             * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an\n             * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a\n             * primary key), and this iterable could be updated with new object instances that still\n             * represent the same underlying entity (for example, when data is re-fetched from the server,\n             * and the iterable is recreated and re-rendered, but most of the data is still the same).\n             *\n             * @see `TrackByFunction`\n             */\n            set: function (fn) {\n                if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {\n                    // TODO(vicb): use a log service once there is a public one available\n                    if (console && console.warn) {\n                        console.warn(\"trackBy must be a function, but received \" + JSON.stringify(fn) + \". \" +\n                            \"See https://angular.io/api/common/NgForOf#change-propagation for more information.\");\n                    }\n                }\n                this._trackByFn = fn;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgForOf.prototype, \"ngForTemplate\", {\n            /**\n             * A reference to the template that is stamped out for each item in the iterable.\n             * @see [template reference variable](guide/template-reference-variables)\n             */\n            set: function (value) {\n                // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1\n                // The current type is too restrictive; a template that just uses index, for example,\n                // should be acceptable.\n                if (value) {\n                    this._template = value;\n                }\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Applies the changes when needed.\n         */\n        NgForOf.prototype.ngDoCheck = function () {\n            if (this._ngForOfDirty) {\n                this._ngForOfDirty = false;\n                // React on ngForOf changes only once all inputs have been initialized\n                var value = this._ngForOf;\n                if (!this._differ && value) {\n                    try {\n                        this._differ = this._differs.find(value).create(this.ngForTrackBy);\n                    }\n                    catch (_a) {\n                        throw new Error(\"Cannot find a differ supporting object '\" + value + \"' of type '\" + getTypeName(value) + \"'. NgFor only supports binding to Iterables such as Arrays.\");\n                    }\n                }\n            }\n            if (this._differ) {\n                var changes = this._differ.diff(this._ngForOf);\n                if (changes)\n                    this._applyChanges(changes);\n            }\n        };\n        NgForOf.prototype._applyChanges = function (changes) {\n            var _this = this;\n            var insertTuples = [];\n            changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {\n                if (item.previousIndex == null) {\n                    // NgForOf is never \"null\" or \"undefined\" here because the differ detected\n                    // that a new item needs to be inserted from the iterable. This implies that\n                    // there is an iterable value for \"_ngForOf\".\n                    var view = _this._viewContainer.createEmbeddedView(_this._template, new NgForOfContext(null, _this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);\n                    var tuple = new RecordViewTuple(item, view);\n                    insertTuples.push(tuple);\n                }\n                else if (currentIndex == null) {\n                    _this._viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);\n                }\n                else if (adjustedPreviousIndex !== null) {\n                    var view = _this._viewContainer.get(adjustedPreviousIndex);\n                    _this._viewContainer.move(view, currentIndex);\n                    var tuple = new RecordViewTuple(item, view);\n                    insertTuples.push(tuple);\n                }\n            });\n            for (var i = 0; i < insertTuples.length; i++) {\n                this._perViewChange(insertTuples[i].view, insertTuples[i].record);\n            }\n            for (var i = 0, ilen = this._viewContainer.length; i < ilen; i++) {\n                var viewRef = this._viewContainer.get(i);\n                viewRef.context.index = i;\n                viewRef.context.count = ilen;\n                viewRef.context.ngForOf = this._ngForOf;\n            }\n            changes.forEachIdentityChange(function (record) {\n                var viewRef = _this._viewContainer.get(record.currentIndex);\n                viewRef.context.$implicit = record.item;\n            });\n        };\n        NgForOf.prototype._perViewChange = function (view, record) {\n            view.context.$implicit = record.item;\n        };\n        /**\n         * Asserts the correct type of the context for the template that `NgForOf` will render.\n         *\n         * The presence of this method is a signal to the Ivy template type-check compiler that the\n         * `NgForOf` structural directive renders its template with a specific context type.\n         */\n        NgForOf.ngTemplateContextGuard = function (dir, ctx) {\n            return true;\n        };\n        return NgForOf;\n    }());\n    NgForOf.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngFor][ngForOf]' },] }\n    ];\n    NgForOf.ctorParameters = function () { return [\n        { type: i0.ViewContainerRef },\n        { type: i0.TemplateRef },\n        { type: i0.IterableDiffers }\n    ]; };\n    NgForOf.propDecorators = {\n        ngForOf: [{ type: i0.Input }],\n        ngForTrackBy: [{ type: i0.Input }],\n        ngForTemplate: [{ type: i0.Input }]\n    };\n    var RecordViewTuple = /** @class */ (function () {\n        function RecordViewTuple(record, view) {\n            this.record = record;\n            this.view = view;\n        }\n        return RecordViewTuple;\n    }());\n    function getTypeName(type) {\n        return type['name'] || typeof type;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A structural directive that conditionally includes a template based on the value of\n     * an expression coerced to Boolean.\n     * When the expression evaluates to true, Angular renders the template\n     * provided in a `then` clause, and when  false or null,\n     * Angular renders the template provided in an optional `else` clause. The default\n     * template for the `else` clause is blank.\n     *\n     * A [shorthand form](guide/structural-directives#asterisk) of the directive,\n     * `*ngIf=\"condition\"`, is generally used, provided\n     * as an attribute of the anchor element for the inserted template.\n     * Angular expands this into a more explicit version, in which the anchor element\n     * is contained in an `<ng-template>` element.\n     *\n     * Simple form with shorthand syntax:\n     *\n     * ```\n     * <div *ngIf=\"condition\">Content to render when condition is true.</div>\n     * ```\n     *\n     * Simple form with expanded syntax:\n     *\n     * ```\n     * <ng-template [ngIf]=\"condition\"><div>Content to render when condition is\n     * true.</div></ng-template>\n     * ```\n     *\n     * Form with an \"else\" block:\n     *\n     * ```\n     * <div *ngIf=\"condition; else elseBlock\">Content to render when condition is true.</div>\n     * <ng-template #elseBlock>Content to render when condition is false.</ng-template>\n     * ```\n     *\n     * Shorthand form with \"then\" and \"else\" blocks:\n     *\n     * ```\n     * <div *ngIf=\"condition; then thenBlock else elseBlock\"></div>\n     * <ng-template #thenBlock>Content to render when condition is true.</ng-template>\n     * <ng-template #elseBlock>Content to render when condition is false.</ng-template>\n     * ```\n     *\n     * Form with storing the value locally:\n     *\n     * ```\n     * <div *ngIf=\"condition as value; else elseBlock\">{{value}}</div>\n     * <ng-template #elseBlock>Content to render when value is null.</ng-template>\n     * ```\n     *\n     * @usageNotes\n     *\n     * The `*ngIf` directive is most commonly used to conditionally show an inline template,\n     * as seen in the following  example.\n     * The default `else` template is blank.\n     *\n     * {@example common/ngIf/ts/module.ts region='NgIfSimple'}\n     *\n     * ### Showing an alternative template using `else`\n     *\n     * To display a template when `expression` evaluates to false, use an `else` template\n     * binding as shown in the following example.\n     * The `else` binding points to an `<ng-template>`  element labeled `#elseBlock`.\n     * The template can be defined anywhere in the component view, but is typically placed right after\n     * `ngIf` for readability.\n     *\n     * {@example common/ngIf/ts/module.ts region='NgIfElse'}\n     *\n     * ### Using an external `then` template\n     *\n     * In the previous example, the then-clause template is specified inline, as the content of the\n     * tag that contains the `ngIf` directive. You can also specify a template that is defined\n     * externally, by referencing a labeled `<ng-template>` element. When you do this, you can\n     * change which template to use at runtime, as shown in the following example.\n     *\n     * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}\n     *\n     * ### Storing a conditional result in a variable\n     *\n     * You might want to show a set of properties from the same object. If you are waiting\n     * for asynchronous data, the object can be undefined.\n     * In this case, you can use `ngIf` and store the result of the condition in a local\n     * variable as shown in the following example.\n     *\n     * {@example common/ngIf/ts/module.ts region='NgIfAs'}\n     *\n     * This code uses only one `AsyncPipe`, so only one subscription is created.\n     * The conditional statement stores the result of `userStream|async` in the local variable `user`.\n     * You can then bind the local `user` repeatedly.\n     *\n     * The conditional displays the data only if `userStream` returns a value,\n     * so you don't need to use the\n     * safe-navigation-operator (`?.`)\n     * to guard against null values when accessing properties.\n     * You can display an alternative template while waiting for the data.\n     *\n     * ### Shorthand syntax\n     *\n     * The shorthand syntax `*ngIf` expands into two separate template specifications\n     * for the \"then\" and \"else\" clauses. For example, consider the following shorthand statement,\n     * that is meant to show a loading page while waiting for data to be loaded.\n     *\n     * ```\n     * <div class=\"hero-list\" *ngIf=\"heroes else loading\">\n     *  ...\n     * </div>\n     *\n     * <ng-template #loading>\n     *  <div>Loading...</div>\n     * </ng-template>\n     * ```\n     *\n     * You can see that the \"else\" clause references the `<ng-template>`\n     * with the `#loading` label, and the template for the \"then\" clause\n     * is provided as the content of the anchor element.\n     *\n     * However, when Angular expands the shorthand syntax, it creates\n     * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives.\n     * The anchor element containing the template for the \"then\" clause becomes\n     * the content of this unlabeled `<ng-template>` tag.\n     *\n     * ```\n     * <ng-template [ngIf]=\"heroes\" [ngIfElse]=\"loading\">\n     *  <div class=\"hero-list\">\n     *   ...\n     *  </div>\n     * </ng-template>\n     *\n     * <ng-template #loading>\n     *  <div>Loading...</div>\n     * </ng-template>\n     * ```\n     *\n     * The presence of the implicit template object has implications for the nesting of\n     * structural directives. For more on this subject, see\n     * [Structural Directives](https://angular.io/guide/built-in-directives#one-per-element).\n     *\n     * @ngModule CommonModule\n     * @publicApi\n     */\n    var NgIf = /** @class */ (function () {\n        function NgIf(_viewContainer, templateRef) {\n            this._viewContainer = _viewContainer;\n            this._context = new NgIfContext();\n            this._thenTemplateRef = null;\n            this._elseTemplateRef = null;\n            this._thenViewRef = null;\n            this._elseViewRef = null;\n            this._thenTemplateRef = templateRef;\n        }\n        Object.defineProperty(NgIf.prototype, \"ngIf\", {\n            /**\n             * The Boolean expression to evaluate as the condition for showing a template.\n             */\n            set: function (condition) {\n                this._context.$implicit = this._context.ngIf = condition;\n                this._updateView();\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgIf.prototype, \"ngIfThen\", {\n            /**\n             * A template to show if the condition expression evaluates to true.\n             */\n            set: function (templateRef) {\n                assertTemplate('ngIfThen', templateRef);\n                this._thenTemplateRef = templateRef;\n                this._thenViewRef = null; // clear previous view if any.\n                this._updateView();\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgIf.prototype, \"ngIfElse\", {\n            /**\n             * A template to show if the condition expression evaluates to false.\n             */\n            set: function (templateRef) {\n                assertTemplate('ngIfElse', templateRef);\n                this._elseTemplateRef = templateRef;\n                this._elseViewRef = null; // clear previous view if any.\n                this._updateView();\n            },\n            enumerable: false,\n            configurable: true\n        });\n        NgIf.prototype._updateView = function () {\n            if (this._context.$implicit) {\n                if (!this._thenViewRef) {\n                    this._viewContainer.clear();\n                    this._elseViewRef = null;\n                    if (this._thenTemplateRef) {\n                        this._thenViewRef =\n                            this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);\n                    }\n                }\n            }\n            else {\n                if (!this._elseViewRef) {\n                    this._viewContainer.clear();\n                    this._thenViewRef = null;\n                    if (this._elseTemplateRef) {\n                        this._elseViewRef =\n                            this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);\n                    }\n                }\n            }\n        };\n        /**\n         * Asserts the correct type of the context for the template that `NgIf` will render.\n         *\n         * The presence of this method is a signal to the Ivy template type-check compiler that the\n         * `NgIf` structural directive renders its template with a specific context type.\n         */\n        NgIf.ngTemplateContextGuard = function (dir, ctx) {\n            return true;\n        };\n        return NgIf;\n    }());\n    NgIf.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngIf]' },] }\n    ];\n    NgIf.ctorParameters = function () { return [\n        { type: i0.ViewContainerRef },\n        { type: i0.TemplateRef }\n    ]; };\n    NgIf.propDecorators = {\n        ngIf: [{ type: i0.Input }],\n        ngIfThen: [{ type: i0.Input }],\n        ngIfElse: [{ type: i0.Input }]\n    };\n    /**\n     * @publicApi\n     */\n    var NgIfContext = /** @class */ (function () {\n        function NgIfContext() {\n            this.$implicit = null;\n            this.ngIf = null;\n        }\n        return NgIfContext;\n    }());\n    function assertTemplate(property, templateRef) {\n        var isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);\n        if (!isTemplateRefOrNull) {\n            throw new Error(property + \" must be a TemplateRef, but received '\" + i0.ɵstringify(templateRef) + \"'.\");\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var SwitchView = /** @class */ (function () {\n        function SwitchView(_viewContainerRef, _templateRef) {\n            this._viewContainerRef = _viewContainerRef;\n            this._templateRef = _templateRef;\n            this._created = false;\n        }\n        SwitchView.prototype.create = function () {\n            this._created = true;\n            this._viewContainerRef.createEmbeddedView(this._templateRef);\n        };\n        SwitchView.prototype.destroy = function () {\n            this._created = false;\n            this._viewContainerRef.clear();\n        };\n        SwitchView.prototype.enforceState = function (created) {\n            if (created && !this._created) {\n                this.create();\n            }\n            else if (!created && this._created) {\n                this.destroy();\n            }\n        };\n        return SwitchView;\n    }());\n    /**\n     * @ngModule CommonModule\n     *\n     * @description\n     * The `[ngSwitch]` directive on a container specifies an expression to match against.\n     * The expressions to match are provided by `ngSwitchCase` directives on views within the container.\n     * - Every view that matches is rendered.\n     * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.\n     * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`\n     * or `ngSwitchDefault` directive are preserved at the location.\n     *\n     * @usageNotes\n     * Define a container element for the directive, and specify the switch expression\n     * to match against as an attribute:\n     *\n     * ```\n     * <container-element [ngSwitch]=\"switch_expression\">\n     * ```\n     *\n     * Within the container, `*ngSwitchCase` statements specify the match expressions\n     * as attributes. Include `*ngSwitchDefault` as the final case.\n     *\n     * ```\n     * <container-element [ngSwitch]=\"switch_expression\">\n     *    <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n     * ...\n     *    <some-element *ngSwitchDefault>...</some-element>\n     * </container-element>\n     * ```\n     *\n     * ### Usage Examples\n     *\n     * The following example shows how to use more than one case to display the same view:\n     *\n     * ```\n     * <container-element [ngSwitch]=\"switch_expression\">\n     *   <!-- the same view can be shown in more than one case -->\n     *   <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n     *   <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n     *   <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n     *   <!--default case when there are no matches -->\n     *   <some-element *ngSwitchDefault>...</some-element>\n     * </container-element>\n     * ```\n     *\n     * The following example shows how cases can be nested:\n     * ```\n     * <container-element [ngSwitch]=\"switch_expression\">\n     *       <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n     *       <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n     *       <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n     *       <ng-container *ngSwitchCase=\"match_expression_3\">\n     *         <!-- use a ng-container to group multiple root nodes -->\n     *         <inner-element></inner-element>\n     *         <inner-other-element></inner-other-element>\n     *       </ng-container>\n     *       <some-element *ngSwitchDefault>...</some-element>\n     *     </container-element>\n     * ```\n     *\n     * @publicApi\n     * @see `NgSwitchCase`\n     * @see `NgSwitchDefault`\n     * @see [Structural Directives](guide/structural-directives)\n     *\n     */\n    var NgSwitch = /** @class */ (function () {\n        function NgSwitch() {\n            this._defaultUsed = false;\n            this._caseCount = 0;\n            this._lastCaseCheckIndex = 0;\n            this._lastCasesMatched = false;\n        }\n        Object.defineProperty(NgSwitch.prototype, \"ngSwitch\", {\n            set: function (newValue) {\n                this._ngSwitch = newValue;\n                if (this._caseCount === 0) {\n                    this._updateDefaultCases(true);\n                }\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /** @internal */\n        NgSwitch.prototype._addCase = function () {\n            return this._caseCount++;\n        };\n        /** @internal */\n        NgSwitch.prototype._addDefault = function (view) {\n            if (!this._defaultViews) {\n                this._defaultViews = [];\n            }\n            this._defaultViews.push(view);\n        };\n        /** @internal */\n        NgSwitch.prototype._matchCase = function (value) {\n            var matched = value == this._ngSwitch;\n            this._lastCasesMatched = this._lastCasesMatched || matched;\n            this._lastCaseCheckIndex++;\n            if (this._lastCaseCheckIndex === this._caseCount) {\n                this._updateDefaultCases(!this._lastCasesMatched);\n                this._lastCaseCheckIndex = 0;\n                this._lastCasesMatched = false;\n            }\n            return matched;\n        };\n        NgSwitch.prototype._updateDefaultCases = function (useDefault) {\n            if (this._defaultViews && useDefault !== this._defaultUsed) {\n                this._defaultUsed = useDefault;\n                for (var i = 0; i < this._defaultViews.length; i++) {\n                    var defaultView = this._defaultViews[i];\n                    defaultView.enforceState(useDefault);\n                }\n            }\n        };\n        return NgSwitch;\n    }());\n    NgSwitch.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngSwitch]' },] }\n    ];\n    NgSwitch.propDecorators = {\n        ngSwitch: [{ type: i0.Input }]\n    };\n    /**\n     * @ngModule CommonModule\n     *\n     * @description\n     * Provides a switch case expression to match against an enclosing `ngSwitch` expression.\n     * When the expressions match, the given `NgSwitchCase` template is rendered.\n     * If multiple match expressions match the switch expression value, all of them are displayed.\n     *\n     * @usageNotes\n     *\n     * Within a switch container, `*ngSwitchCase` statements specify the match expressions\n     * as attributes. Include `*ngSwitchDefault` as the final case.\n     *\n     * ```\n     * <container-element [ngSwitch]=\"switch_expression\">\n     *   <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n     *   ...\n     *   <some-element *ngSwitchDefault>...</some-element>\n     * </container-element>\n     * ```\n     *\n     * Each switch-case statement contains an in-line HTML template or template reference\n     * that defines the subtree to be selected if the value of the match expression\n     * matches the value of the switch expression.\n     *\n     * Unlike JavaScript, which uses strict equality, Angular uses loose equality.\n     * This means that the empty string, `\"\"` matches 0.\n     *\n     * @publicApi\n     * @see `NgSwitch`\n     * @see `NgSwitchDefault`\n     *\n     */\n    var NgSwitchCase = /** @class */ (function () {\n        function NgSwitchCase(viewContainer, templateRef, ngSwitch) {\n            this.ngSwitch = ngSwitch;\n            if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {\n                throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase');\n            }\n            ngSwitch._addCase();\n            this._view = new SwitchView(viewContainer, templateRef);\n        }\n        /**\n         * Performs case matching. For internal use only.\n         */\n        NgSwitchCase.prototype.ngDoCheck = function () {\n            this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));\n        };\n        return NgSwitchCase;\n    }());\n    NgSwitchCase.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngSwitchCase]' },] }\n    ];\n    NgSwitchCase.ctorParameters = function () { return [\n        { type: i0.ViewContainerRef },\n        { type: i0.TemplateRef },\n        { type: NgSwitch, decorators: [{ type: i0.Optional }, { type: i0.Host }] }\n    ]; };\n    NgSwitchCase.propDecorators = {\n        ngSwitchCase: [{ type: i0.Input }]\n    };\n    /**\n     * @ngModule CommonModule\n     *\n     * @description\n     *\n     * Creates a view that is rendered when no `NgSwitchCase` expressions\n     * match the `NgSwitch` expression.\n     * This statement should be the final case in an `NgSwitch`.\n     *\n     * @publicApi\n     * @see `NgSwitch`\n     * @see `NgSwitchCase`\n     *\n     */\n    var NgSwitchDefault = /** @class */ (function () {\n        function NgSwitchDefault(viewContainer, templateRef, ngSwitch) {\n            if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {\n                throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault');\n            }\n            ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));\n        }\n        return NgSwitchDefault;\n    }());\n    NgSwitchDefault.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngSwitchDefault]' },] }\n    ];\n    NgSwitchDefault.ctorParameters = function () { return [\n        { type: i0.ViewContainerRef },\n        { type: i0.TemplateRef },\n        { type: NgSwitch, decorators: [{ type: i0.Optional }, { type: i0.Host }] }\n    ]; };\n    function throwNgSwitchProviderNotFoundError(attrName, directiveName) {\n        throw new i0.ɵRuntimeError(\"305\" /* TEMPLATE_STRUCTURE_ERROR */, \"An element with the \\\"\" + attrName + \"\\\" attribute \" +\n            (\"(matching the \\\"\" + directiveName + \"\\\" directive) must be located inside an element with the \\\"ngSwitch\\\" attribute \") +\n            \"(matching \\\"NgSwitch\\\" directive)\");\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     *\n     * @usageNotes\n     * ```\n     * <some-element [ngPlural]=\"value\">\n     *   <ng-template ngPluralCase=\"=0\">there is nothing</ng-template>\n     *   <ng-template ngPluralCase=\"=1\">there is one</ng-template>\n     *   <ng-template ngPluralCase=\"few\">there are a few</ng-template>\n     * </some-element>\n     * ```\n     *\n     * @description\n     *\n     * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.\n     *\n     * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees\n     * that match the switch expression's pluralization category.\n     *\n     * To use this directive you must provide a container element that sets the `[ngPlural]` attribute\n     * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their\n     * expression:\n     * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value\n     *   matches the switch expression exactly,\n     * - otherwise, the view will be treated as a \"category match\", and will only display if exact\n     *   value matches aren't found and the value maps to its category for the defined locale.\n     *\n     * See http://cldr.unicode.org/index/cldr-spec/plural-rules\n     *\n     * @publicApi\n     */\n    var NgPlural = /** @class */ (function () {\n        function NgPlural(_localization) {\n            this._localization = _localization;\n            this._caseViews = {};\n        }\n        Object.defineProperty(NgPlural.prototype, \"ngPlural\", {\n            set: function (value) {\n                this._switchValue = value;\n                this._updateView();\n            },\n            enumerable: false,\n            configurable: true\n        });\n        NgPlural.prototype.addCase = function (value, switchView) {\n            this._caseViews[value] = switchView;\n        };\n        NgPlural.prototype._updateView = function () {\n            this._clearViews();\n            var cases = Object.keys(this._caseViews);\n            var key = getPluralCategory(this._switchValue, cases, this._localization);\n            this._activateView(this._caseViews[key]);\n        };\n        NgPlural.prototype._clearViews = function () {\n            if (this._activeView)\n                this._activeView.destroy();\n        };\n        NgPlural.prototype._activateView = function (view) {\n            if (view) {\n                this._activeView = view;\n                this._activeView.create();\n            }\n        };\n        return NgPlural;\n    }());\n    NgPlural.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngPlural]' },] }\n    ];\n    NgPlural.ctorParameters = function () { return [\n        { type: NgLocalization }\n    ]; };\n    NgPlural.propDecorators = {\n        ngPlural: [{ type: i0.Input }]\n    };\n    /**\n     * @ngModule CommonModule\n     *\n     * @description\n     *\n     * Creates a view that will be added/removed from the parent {@link NgPlural} when the\n     * given expression matches the plural expression according to CLDR rules.\n     *\n     * @usageNotes\n     * ```\n     * <some-element [ngPlural]=\"value\">\n     *   <ng-template ngPluralCase=\"=0\">...</ng-template>\n     *   <ng-template ngPluralCase=\"other\">...</ng-template>\n     * </some-element>\n     *```\n     *\n     * See {@link NgPlural} for more details and example.\n     *\n     * @publicApi\n     */\n    var NgPluralCase = /** @class */ (function () {\n        function NgPluralCase(value, template, viewContainer, ngPlural) {\n            this.value = value;\n            var isANumber = !isNaN(Number(value));\n            ngPlural.addCase(isANumber ? \"=\" + value : value, new SwitchView(viewContainer, template));\n        }\n        return NgPluralCase;\n    }());\n    NgPluralCase.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngPluralCase]' },] }\n    ];\n    NgPluralCase.ctorParameters = function () { return [\n        { type: String, decorators: [{ type: i0.Attribute, args: ['ngPluralCase',] }] },\n        { type: i0.TemplateRef },\n        { type: i0.ViewContainerRef },\n        { type: NgPlural, decorators: [{ type: i0.Host }] }\n    ]; };\n\n    /**\n     * @ngModule CommonModule\n     *\n     * @usageNotes\n     *\n     * Set the font of the containing element to the result of an expression.\n     *\n     * ```\n     * <some-element [ngStyle]=\"{'font-style': styleExp}\">...</some-element>\n     * ```\n     *\n     * Set the width of the containing element to a pixel value returned by an expression.\n     *\n     * ```\n     * <some-element [ngStyle]=\"{'max-width.px': widthExp}\">...</some-element>\n     * ```\n     *\n     * Set a collection of style values using an expression that returns key-value pairs.\n     *\n     * ```\n     * <some-element [ngStyle]=\"objExp\">...</some-element>\n     * ```\n     *\n     * @description\n     *\n     * An attribute directive that updates styles for the containing HTML element.\n     * Sets one or more style properties, specified as colon-separated key-value pairs.\n     * The key is a style name, with an optional `.<unit>` suffix\n     * (such as 'top.px', 'font-style.em').\n     * The value is an expression to be evaluated.\n     * The resulting non-null value, expressed in the given unit,\n     * is assigned to the given style property.\n     * If the result of evaluation is null, the corresponding style is removed.\n     *\n     * @publicApi\n     */\n    var NgStyle = /** @class */ (function () {\n        function NgStyle(_ngEl, _differs, _renderer) {\n            this._ngEl = _ngEl;\n            this._differs = _differs;\n            this._renderer = _renderer;\n            this._ngStyle = null;\n            this._differ = null;\n        }\n        Object.defineProperty(NgStyle.prototype, \"ngStyle\", {\n            set: function (values) {\n                this._ngStyle = values;\n                if (!this._differ && values) {\n                    this._differ = this._differs.find(values).create();\n                }\n            },\n            enumerable: false,\n            configurable: true\n        });\n        NgStyle.prototype.ngDoCheck = function () {\n            if (this._differ) {\n                var changes = this._differ.diff(this._ngStyle);\n                if (changes) {\n                    this._applyChanges(changes);\n                }\n            }\n        };\n        NgStyle.prototype._setStyle = function (nameAndUnit, value) {\n            var _a = __read(nameAndUnit.split('.'), 2), name = _a[0], unit = _a[1];\n            value = value != null && unit ? \"\" + value + unit : value;\n            if (value != null) {\n                this._renderer.setStyle(this._ngEl.nativeElement, name, value);\n            }\n            else {\n                this._renderer.removeStyle(this._ngEl.nativeElement, name);\n            }\n        };\n        NgStyle.prototype._applyChanges = function (changes) {\n            var _this = this;\n            changes.forEachRemovedItem(function (record) { return _this._setStyle(record.key, null); });\n            changes.forEachAddedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n            changes.forEachChangedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n        };\n        return NgStyle;\n    }());\n    NgStyle.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngStyle]' },] }\n    ];\n    NgStyle.ctorParameters = function () { return [\n        { type: i0.ElementRef },\n        { type: i0.KeyValueDiffers },\n        { type: i0.Renderer2 }\n    ]; };\n    NgStyle.propDecorators = {\n        ngStyle: [{ type: i0.Input, args: ['ngStyle',] }]\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     *\n     * @description\n     *\n     * Inserts an embedded view from a prepared `TemplateRef`.\n     *\n     * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.\n     * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding\n     * by the local template `let` declarations.\n     *\n     * @usageNotes\n     * ```\n     * <ng-container *ngTemplateOutlet=\"templateRefExp; context: contextExp\"></ng-container>\n     * ```\n     *\n     * Using the key `$implicit` in the context object will set its value as default.\n     *\n     * ### Example\n     *\n     * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}\n     *\n     * @publicApi\n     */\n    var NgTemplateOutlet = /** @class */ (function () {\n        function NgTemplateOutlet(_viewContainerRef) {\n            this._viewContainerRef = _viewContainerRef;\n            this._viewRef = null;\n            /**\n             * A context object to attach to the {@link EmbeddedViewRef}. This should be an\n             * object, the object's keys will be available for binding by the local template `let`\n             * declarations.\n             * Using the key `$implicit` in the context object will set its value as default.\n             */\n            this.ngTemplateOutletContext = null;\n            /**\n             * A string defining the template reference and optionally the context object for the template.\n             */\n            this.ngTemplateOutlet = null;\n        }\n        NgTemplateOutlet.prototype.ngOnChanges = function (changes) {\n            if (changes['ngTemplateOutlet']) {\n                var viewContainerRef = this._viewContainerRef;\n                if (this._viewRef) {\n                    viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));\n                }\n                this._viewRef = this.ngTemplateOutlet ?\n                    viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext) :\n                    null;\n            }\n            else if (this._viewRef && changes['ngTemplateOutletContext'] && this.ngTemplateOutletContext) {\n                this._viewRef.context = this.ngTemplateOutletContext;\n            }\n        };\n        return NgTemplateOutlet;\n    }());\n    NgTemplateOutlet.decorators = [\n        { type: i0.Directive, args: [{ selector: '[ngTemplateOutlet]' },] }\n    ];\n    NgTemplateOutlet.ctorParameters = function () { return [\n        { type: i0.ViewContainerRef }\n    ]; };\n    NgTemplateOutlet.propDecorators = {\n        ngTemplateOutletContext: [{ type: i0.Input }],\n        ngTemplateOutlet: [{ type: i0.Input }]\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A collection of Angular directives that are likely to be used in each and every Angular\n     * application.\n     */\n    var COMMON_DIRECTIVES = [\n        NgClass,\n        NgComponentOutlet,\n        NgForOf,\n        NgIf,\n        NgTemplateOutlet,\n        NgStyle,\n        NgSwitch,\n        NgSwitchCase,\n        NgSwitchDefault,\n        NgPlural,\n        NgPluralCase,\n    ];\n\n    /**\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://angular.io/license\n     */\n    function invalidPipeArgumentError(type, value) {\n        return Error(\"InvalidPipeArgument: '\" + value + \"' for pipe '\" + i0.ɵstringify(type) + \"'\");\n    }\n\n    /**\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://angular.io/license\n     */\n    var SubscribableStrategy = /** @class */ (function () {\n        function SubscribableStrategy() {\n        }\n        SubscribableStrategy.prototype.createSubscription = function (async, updateLatestValue) {\n            return async.subscribe({\n                next: updateLatestValue,\n                error: function (e) {\n                    throw e;\n                }\n            });\n        };\n        SubscribableStrategy.prototype.dispose = function (subscription) {\n            subscription.unsubscribe();\n        };\n        SubscribableStrategy.prototype.onDestroy = function (subscription) {\n            subscription.unsubscribe();\n        };\n        return SubscribableStrategy;\n    }());\n    var PromiseStrategy = /** @class */ (function () {\n        function PromiseStrategy() {\n        }\n        PromiseStrategy.prototype.createSubscription = function (async, updateLatestValue) {\n            return async.then(updateLatestValue, function (e) {\n                throw e;\n            });\n        };\n        PromiseStrategy.prototype.dispose = function (subscription) { };\n        PromiseStrategy.prototype.onDestroy = function (subscription) { };\n        return PromiseStrategy;\n    }());\n    var _promiseStrategy = new PromiseStrategy();\n    var _subscribableStrategy = new SubscribableStrategy();\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Unwraps a value from an asynchronous primitive.\n     *\n     * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has\n     * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for\n     * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid\n     * potential memory leaks.\n     *\n     * @usageNotes\n     *\n     * ### Examples\n     *\n     * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the\n     * promise.\n     *\n     * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}\n     *\n     * It's also possible to use `async` with Observables. The example below binds the `time` Observable\n     * to the view. The Observable continuously updates the view with the current time.\n     *\n     * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}\n     *\n     * @publicApi\n     */\n    var AsyncPipe = /** @class */ (function () {\n        function AsyncPipe(_ref) {\n            this._ref = _ref;\n            this._latestValue = null;\n            this._subscription = null;\n            this._obj = null;\n            this._strategy = null;\n        }\n        AsyncPipe.prototype.ngOnDestroy = function () {\n            if (this._subscription) {\n                this._dispose();\n            }\n        };\n        AsyncPipe.prototype.transform = function (obj) {\n            if (!this._obj) {\n                if (obj) {\n                    this._subscribe(obj);\n                }\n                return this._latestValue;\n            }\n            if (obj !== this._obj) {\n                this._dispose();\n                return this.transform(obj);\n            }\n            return this._latestValue;\n        };\n        AsyncPipe.prototype._subscribe = function (obj) {\n            var _this = this;\n            this._obj = obj;\n            this._strategy = this._selectStrategy(obj);\n            this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });\n        };\n        AsyncPipe.prototype._selectStrategy = function (obj) {\n            if (i0.ɵisPromise(obj)) {\n                return _promiseStrategy;\n            }\n            if (i0.ɵisSubscribable(obj)) {\n                return _subscribableStrategy;\n            }\n            throw invalidPipeArgumentError(AsyncPipe, obj);\n        };\n        AsyncPipe.prototype._dispose = function () {\n            this._strategy.dispose(this._subscription);\n            this._latestValue = null;\n            this._subscription = null;\n            this._obj = null;\n        };\n        AsyncPipe.prototype._updateLatestValue = function (async, value) {\n            if (async === this._obj) {\n                this._latestValue = value;\n                this._ref.markForCheck();\n            }\n        };\n        return AsyncPipe;\n    }());\n    AsyncPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'async', pure: false },] }\n    ];\n    AsyncPipe.ctorParameters = function () { return [\n        { type: i0.ChangeDetectorRef }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Transforms text to all lower case.\n     *\n     * @see `UpperCasePipe`\n     * @see `TitleCasePipe`\n     * @usageNotes\n     *\n     * The following example defines a view that allows the user to enter\n     * text, and then uses the pipe to convert the input text to all lower case.\n     *\n     * <code-example path=\"common/pipes/ts/lowerupper_pipe.ts\" region='LowerUpperPipe'></code-example>\n     *\n     * @ngModule CommonModule\n     * @publicApi\n     */\n    var LowerCasePipe = /** @class */ (function () {\n        function LowerCasePipe() {\n        }\n        LowerCasePipe.prototype.transform = function (value) {\n            if (value == null)\n                return null;\n            if (typeof value !== 'string') {\n                throw invalidPipeArgumentError(LowerCasePipe, value);\n            }\n            return value.toLowerCase();\n        };\n        return LowerCasePipe;\n    }());\n    LowerCasePipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'lowercase' },] }\n    ];\n    //\n    // Regex below matches any Unicode word and compatible with ES5. In ES2018 the same result\n    // can be achieved by using /\\p{L}\\S*/gu and also known as Unicode Property Escapes\n    // (https://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no\n    // transpilation of this functionality down to ES5 without external tool, the only solution is\n    // to use already transpiled form. Example can be found here -\n    // https://mothereff.in/regexpu#input=var+regex+%3D+/%5Cp%7BL%7D/u%3B&unicodePropertyEscape=1\n    //\n    var unicodeWordMatch = /(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D])\\S*/g;\n    /**\n     * Transforms text to title case.\n     * Capitalizes the first letter of each word and transforms the\n     * rest of the word to lower case.\n     * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.\n     *\n     * @see `LowerCasePipe`\n     * @see `UpperCasePipe`\n     *\n     * @usageNotes\n     * The following example shows the result of transforming various strings into title case.\n     *\n     * <code-example path=\"common/pipes/ts/titlecase_pipe.ts\" region='TitleCasePipe'></code-example>\n     *\n     * @ngModule CommonModule\n     * @publicApi\n     */\n    var TitleCasePipe = /** @class */ (function () {\n        function TitleCasePipe() {\n        }\n        TitleCasePipe.prototype.transform = function (value) {\n            if (value == null)\n                return null;\n            if (typeof value !== 'string') {\n                throw invalidPipeArgumentError(TitleCasePipe, value);\n            }\n            return value.replace(unicodeWordMatch, (function (txt) { return txt[0].toUpperCase() + txt.substr(1).toLowerCase(); }));\n        };\n        return TitleCasePipe;\n    }());\n    TitleCasePipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'titlecase' },] }\n    ];\n    /**\n     * Transforms text to all upper case.\n     * @see `LowerCasePipe`\n     * @see `TitleCasePipe`\n     *\n     * @ngModule CommonModule\n     * @publicApi\n     */\n    var UpperCasePipe = /** @class */ (function () {\n        function UpperCasePipe() {\n        }\n        UpperCasePipe.prototype.transform = function (value) {\n            if (value == null)\n                return null;\n            if (typeof value !== 'string') {\n                throw invalidPipeArgumentError(UpperCasePipe, value);\n            }\n            return value.toUpperCase();\n        };\n        return UpperCasePipe;\n    }());\n    UpperCasePipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'uppercase' },] }\n    ];\n\n    /**\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://angular.io/license\n     */\n    // clang-format off\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Formats a date value according to locale rules.\n     *\n     * `DatePipe` is executed only when it detects a pure change to the input value.\n     * A pure change is either a change to a primitive input value\n     * (such as `String`, `Number`, `Boolean`, or `Symbol`),\n     * or a changed object reference (such as `Date`, `Array`, `Function`, or `Object`).\n     *\n     * Note that mutating a `Date` object does not cause the pipe to be rendered again.\n     * To ensure that the pipe is executed, you must create a new `Date` object.\n     *\n     * Only the `en-US` locale data comes with Angular. To localize dates\n     * in another language, you must import the corresponding locale data.\n     * See the [I18n guide](guide/i18n#i18n-pipes) for more information.\n     *\n     * @see `formatDate()`\n     *\n     *\n     * @usageNotes\n     *\n     * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to\n     * reformat the date on every change-detection cycle, treat the date as an immutable object\n     * and change the reference when the pipe needs to run again.\n     *\n     * ### Pre-defined format options\n     *\n     * | Option        | Equivalent to                       | Examples (given in `en-US` locale)              |\n     * |---------------|-------------------------------------|-------------------------------------------------|\n     * | `'short'`     | `'M/d/yy, h:mm a'`                  | `6/15/15, 9:03 AM`                              |\n     * | `'medium'`    | `'MMM d, y, h:mm:ss a'`             | `Jun 15, 2015, 9:03:01 AM`                      |\n     * | `'long'`      | `'MMMM d, y, h:mm:ss a z'`          | `June 15, 2015 at 9:03:01 AM GMT+1`             |\n     * | `'full'`      | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |\n     * | `'shortDate'` | `'M/d/yy'`                          | `6/15/15`                                       |\n     * | `'mediumDate'`| `'MMM d, y'`                        | `Jun 15, 2015`                                  |\n     * | `'longDate'`  | `'MMMM d, y'`                       | `June 15, 2015`                                 |\n     * | `'fullDate'`  | `'EEEE, MMMM d, y'`                 | `Monday, June 15, 2015`                         |\n     * | `'shortTime'` | `'h:mm a'`                          | `9:03 AM`                                       |\n     * | `'mediumTime'`| `'h:mm:ss a'`                       | `9:03:01 AM`                                    |\n     * | `'longTime'`  | `'h:mm:ss a z'`                     | `9:03:01 AM GMT+1`                              |\n     * | `'fullTime'`  | `'h:mm:ss a zzzz'`                  | `9:03:01 AM GMT+01:00`                          |\n     *\n     * ### Custom format options\n     *\n     * You can construct a format string using symbols to specify the components\n     * of a date-time value, as described in the following table.\n     * Format details depend on the locale.\n     * Fields marked with (*) are only available in the extra data set for the given locale.\n     *\n     *  | Field type          | Format      | Description                                                   | Example Value                                              |\n     *  |-------------------- |-------------|---------------------------------------------------------------|------------------------------------------------------------|\n     *  | Era                 | G, GG & GGG | Abbreviated                                                   | AD                                                         |\n     *  |                     | GGGG        | Wide                                                          | Anno Domini                                                |\n     *  |                     | GGGGG       | Narrow                                                        | A                                                          |\n     *  | Year                | y           | Numeric: minimum digits                                       | 2, 20, 201, 2017, 20173                                    |\n     *  |                     | yy          | Numeric: 2 digits + zero padded                               | 02, 20, 01, 17, 73                                         |\n     *  |                     | yyy         | Numeric: 3 digits + zero padded                               | 002, 020, 201, 2017, 20173                                 |\n     *  |                     | yyyy        | Numeric: 4 digits or more + zero padded                       | 0002, 0020, 0201, 2017, 20173                              |\n     *  | Week-numbering year | Y           | Numeric: minimum digits                                       | 2, 20, 201, 2017, 20173                                    |\n     *  |                     | YY          | Numeric: 2 digits + zero padded                               | 02, 20, 01, 17, 73                                         |\n     *  |                     | YYY         | Numeric: 3 digits + zero padded                               | 002, 020, 201, 2017, 20173                                 |\n     *  |                     | YYYY        | Numeric: 4 digits or more + zero padded                       | 0002, 0020, 0201, 2017, 20173                              |\n     *  | Month               | M           | Numeric: 1 digit                                              | 9, 12                                                      |\n     *  |                     | MM          | Numeric: 2 digits + zero padded                               | 09, 12                                                     |\n     *  |                     | MMM         | Abbreviated                                                   | Sep                                                        |\n     *  |                     | MMMM        | Wide                                                          | September                                                  |\n     *  |                     | MMMMM       | Narrow                                                        | S                                                          |\n     *  | Month standalone    | L           | Numeric: 1 digit                                              | 9, 12                                                      |\n     *  |                     | LL          | Numeric: 2 digits + zero padded                               | 09, 12                                                     |\n     *  |                     | LLL         | Abbreviated                                                   | Sep                                                        |\n     *  |                     | LLLL        | Wide                                                          | September                                                  |\n     *  |                     | LLLLL       | Narrow                                                        | S                                                          |\n     *  | Week of year        | w           | Numeric: minimum digits                                       | 1... 53                                                    |\n     *  |                     | ww          | Numeric: 2 digits + zero padded                               | 01... 53                                                   |\n     *  | Week of month       | W           | Numeric: 1 digit                                              | 1... 5                                                     |\n     *  | Day of month        | d           | Numeric: minimum digits                                       | 1                                                          |\n     *  |                     | dd          | Numeric: 2 digits + zero padded                               | 01                                                         |\n     *  | Week day            | E, EE & EEE | Abbreviated                                                   | Tue                                                        |\n     *  |                     | EEEE        | Wide                                                          | Tuesday                                                    |\n     *  |                     | EEEEE       | Narrow                                                        | T                                                          |\n     *  |                     | EEEEEE      | Short                                                         | Tu                                                         |\n     *  | Week day standalone | c, cc       | Numeric: 1 digit                                              | 2                                                          |\n     *  |                     | ccc         | Abbreviated                                                   | Tue                                                        |\n     *  |                     | cccc        | Wide                                                          | Tuesday                                                    |\n     *  |                     | ccccc       | Narrow                                                        | T                                                          |\n     *  |                     | cccccc      | Short                                                         | Tu                                                         |\n     *  | Period              | a, aa & aaa | Abbreviated                                                   | am/pm or AM/PM                                             |\n     *  |                     | aaaa        | Wide (fallback to `a` when missing)                           | ante meridiem/post meridiem                                |\n     *  |                     | aaaaa       | Narrow                                                        | a/p                                                        |\n     *  | Period*             | B, BB & BBB | Abbreviated                                                   | mid.                                                       |\n     *  |                     | BBBB        | Wide                                                          | am, pm, midnight, noon, morning, afternoon, evening, night |\n     *  |                     | BBBBB       | Narrow                                                        | md                                                         |\n     *  | Period standalone*  | b, bb & bbb | Abbreviated                                                   | mid.                                                       |\n     *  |                     | bbbb        | Wide                                                          | am, pm, midnight, noon, morning, afternoon, evening, night |\n     *  |                     | bbbbb       | Narrow                                                        | md                                                         |\n     *  | Hour 1-12           | h           | Numeric: minimum digits                                       | 1, 12                                                      |\n     *  |                     | hh          | Numeric: 2 digits + zero padded                               | 01, 12                                                     |\n     *  | Hour 0-23           | H           | Numeric: minimum digits                                       | 0, 23                                                      |\n     *  |                     | HH          | Numeric: 2 digits + zero padded                               | 00, 23                                                     |\n     *  | Minute              | m           | Numeric: minimum digits                                       | 8, 59                                                      |\n     *  |                     | mm          | Numeric: 2 digits + zero padded                               | 08, 59                                                     |\n     *  | Second              | s           | Numeric: minimum digits                                       | 0... 59                                                    |\n     *  |                     | ss          | Numeric: 2 digits + zero padded                               | 00... 59                                                   |\n     *  | Fractional seconds  | S           | Numeric: 1 digit                                              | 0... 9                                                     |\n     *  |                     | SS          | Numeric: 2 digits + zero padded                               | 00... 99                                                   |\n     *  |                     | SSS         | Numeric: 3 digits + zero padded (= milliseconds)              | 000... 999                                                 |\n     *  | Zone                | z, zz & zzz | Short specific non location format (fallback to O)            | GMT-8                                                      |\n     *  |                     | zzzz        | Long specific non location format (fallback to OOOO)          | GMT-08:00                                                  |\n     *  |                     | Z, ZZ & ZZZ | ISO8601 basic format                                          | -0800                                                      |\n     *  |                     | ZZZZ        | Long localized GMT format                                     | GMT-8:00                                                   |\n     *  |                     | ZZZZZ       | ISO8601 extended format + Z indicator for offset 0 (= XXXXX)  | -08:00                                                     |\n     *  |                     | O, OO & OOO | Short localized GMT format                                    | GMT-8                                                      |\n     *  |                     | OOOO        | Long localized GMT format                                     | GMT-08:00                                                  |\n     *\n     *\n     * ### Format examples\n     *\n     * These examples transform a date into various formats,\n     * assuming that `dateObj` is a JavaScript `Date` object for\n     * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,\n     * given in the local time for the `en-US` locale.\n     *\n     * ```\n     * {{ dateObj | date }}               // output is 'Jun 15, 2015'\n     * {{ dateObj | date:'medium' }}      // output is 'Jun 15, 2015, 9:43:11 PM'\n     * {{ dateObj | date:'shortTime' }}   // output is '9:43 PM'\n     * {{ dateObj | date:'mm:ss' }}       // output is '43:11'\n     * ```\n     *\n     * ### Usage example\n     *\n     * The following component uses a date pipe to display the current date in different formats.\n     *\n     * ```\n     * @Component({\n     *  selector: 'date-pipe',\n     *  template: `<div>\n     *    <p>Today is {{today | date}}</p>\n     *    <p>Or if you prefer, {{today | date:'fullDate'}}</p>\n     *    <p>The time is {{today | date:'h:mm a z'}}</p>\n     *  </div>`\n     * })\n     * // Get the current date and time as a date-time value.\n     * export class DatePipeComponent {\n     *   today: number = Date.now();\n     * }\n     * ```\n     *\n     * @publicApi\n     */\n    // clang-format on\n    var DatePipe = /** @class */ (function () {\n        function DatePipe(locale) {\n            this.locale = locale;\n        }\n        DatePipe.prototype.transform = function (value, format, timezone, locale) {\n            if (format === void 0) { format = 'mediumDate'; }\n            if (value == null || value === '' || value !== value)\n                return null;\n            try {\n                return formatDate(value, format, locale || this.locale, timezone);\n            }\n            catch (error) {\n                throw invalidPipeArgumentError(DatePipe, error.message);\n            }\n        };\n        return DatePipe;\n    }());\n    DatePipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'date', pure: true },] }\n    ];\n    DatePipe.ctorParameters = function () { return [\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    var _INTERPOLATION_REGEXP = /#/g;\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Maps a value to a string that pluralizes the value according to locale rules.\n     *\n     * @usageNotes\n     *\n     * ### Example\n     *\n     * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}\n     *\n     * @publicApi\n     */\n    var I18nPluralPipe = /** @class */ (function () {\n        function I18nPluralPipe(_localization) {\n            this._localization = _localization;\n        }\n        /**\n         * @param value the number to be formatted\n         * @param pluralMap an object that mimics the ICU format, see\n         * http://userguide.icu-project.org/formatparse/messages.\n         * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by\n         * default).\n         */\n        I18nPluralPipe.prototype.transform = function (value, pluralMap, locale) {\n            if (value == null)\n                return '';\n            if (typeof pluralMap !== 'object' || pluralMap === null) {\n                throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);\n            }\n            var key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);\n            return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());\n        };\n        return I18nPluralPipe;\n    }());\n    I18nPluralPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'i18nPlural', pure: true },] }\n    ];\n    I18nPluralPipe.ctorParameters = function () { return [\n        { type: NgLocalization }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Generic selector that displays the string that matches the current value.\n     *\n     * If none of the keys of the `mapping` match the `value`, then the content\n     * of the `other` key is returned when present, otherwise an empty string is returned.\n     *\n     * @usageNotes\n     *\n     * ### Example\n     *\n     * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}\n     *\n     * @publicApi\n     */\n    var I18nSelectPipe = /** @class */ (function () {\n        function I18nSelectPipe() {\n        }\n        /**\n         * @param value a string to be internationalized.\n         * @param mapping an object that indicates the text that should be displayed\n         * for different values of the provided `value`.\n         */\n        I18nSelectPipe.prototype.transform = function (value, mapping) {\n            if (value == null)\n                return '';\n            if (typeof mapping !== 'object' || typeof value !== 'string') {\n                throw invalidPipeArgumentError(I18nSelectPipe, mapping);\n            }\n            if (mapping.hasOwnProperty(value)) {\n                return mapping[value];\n            }\n            if (mapping.hasOwnProperty('other')) {\n                return mapping['other'];\n            }\n            return '';\n        };\n        return I18nSelectPipe;\n    }());\n    I18nSelectPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'i18nSelect', pure: true },] }\n    ];\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Converts a value into its JSON-format representation.  Useful for debugging.\n     *\n     * @usageNotes\n     *\n     * The following component uses a JSON pipe to convert an object\n     * to JSON format, and displays the string in both formats for comparison.\n     *\n     * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}\n     *\n     * @publicApi\n     */\n    var JsonPipe = /** @class */ (function () {\n        function JsonPipe() {\n        }\n        /**\n         * @param value A value of any type to convert into a JSON-format string.\n         */\n        JsonPipe.prototype.transform = function (value) {\n            return JSON.stringify(value, null, 2);\n        };\n        return JsonPipe;\n    }());\n    JsonPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'json', pure: false },] }\n    ];\n\n    /**\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://angular.io/license\n     */\n    function makeKeyValuePair(key, value) {\n        return { key: key, value: value };\n    }\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Transforms Object or Map into an array of key value pairs.\n     *\n     * The output array will be ordered by keys.\n     * By default the comparator will be by Unicode point value.\n     * You can optionally pass a compareFn if your keys are complex types.\n     *\n     * @usageNotes\n     * ### Examples\n     *\n     * This examples show how an Object or a Map can be iterated by ngFor with the use of this\n     * keyvalue pipe.\n     *\n     * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}\n     *\n     * @publicApi\n     */\n    var KeyValuePipe = /** @class */ (function () {\n        function KeyValuePipe(differs) {\n            this.differs = differs;\n            this.keyValues = [];\n            this.compareFn = defaultComparator;\n        }\n        KeyValuePipe.prototype.transform = function (input, compareFn) {\n            var _this = this;\n            if (compareFn === void 0) { compareFn = defaultComparator; }\n            if (!input || (!(input instanceof Map) && typeof input !== 'object')) {\n                return null;\n            }\n            if (!this.differ) {\n                // make a differ for whatever type we've been passed in\n                this.differ = this.differs.find(input).create();\n            }\n            var differChanges = this.differ.diff(input);\n            var compareFnChanged = compareFn !== this.compareFn;\n            if (differChanges) {\n                this.keyValues = [];\n                differChanges.forEachItem(function (r) {\n                    _this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));\n                });\n            }\n            if (differChanges || compareFnChanged) {\n                this.keyValues.sort(compareFn);\n                this.compareFn = compareFn;\n            }\n            return this.keyValues;\n        };\n        return KeyValuePipe;\n    }());\n    KeyValuePipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'keyvalue', pure: false },] }\n    ];\n    KeyValuePipe.ctorParameters = function () { return [\n        { type: i0.KeyValueDiffers }\n    ]; };\n    function defaultComparator(keyValueA, keyValueB) {\n        var a = keyValueA.key;\n        var b = keyValueB.key;\n        // if same exit with 0;\n        if (a === b)\n            return 0;\n        // make sure that undefined are at the end of the sort.\n        if (a === undefined)\n            return 1;\n        if (b === undefined)\n            return -1;\n        // make sure that nulls are at the end of the sort.\n        if (a === null)\n            return 1;\n        if (b === null)\n            return -1;\n        if (typeof a == 'string' && typeof b == 'string') {\n            return a < b ? -1 : 1;\n        }\n        if (typeof a == 'number' && typeof b == 'number') {\n            return a - b;\n        }\n        if (typeof a == 'boolean' && typeof b == 'boolean') {\n            return a < b ? -1 : 1;\n        }\n        // `a` and `b` are of different types. Compare their string values.\n        var aString = String(a);\n        var bString = String(b);\n        return aString == bString ? 0 : aString < bString ? -1 : 1;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Formats a value according to digit options and locale rules.\n     * Locale determines group sizing and separator,\n     * decimal point character, and other locale-specific configurations.\n     *\n     * @see `formatNumber()`\n     *\n     * @usageNotes\n     *\n     * ### digitsInfo\n     *\n     * The value's decimal representation is specified by the `digitsInfo`\n     * parameter, written in the following format:<br>\n     *\n     * ```\n     * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}\n     * ```\n     *\n     *  - `minIntegerDigits`:\n     * The minimum number of integer digits before the decimal point.\n     * Default is 1.\n     *\n     * - `minFractionDigits`:\n     * The minimum number of digits after the decimal point.\n     * Default is 0.\n     *\n     *  - `maxFractionDigits`:\n     * The maximum number of digits after the decimal point.\n     * Default is 3.\n     *\n     * If the formatted value is truncated it will be rounded using the \"to-nearest\" method:\n     *\n     * ```\n     * {{3.6 | number: '1.0-0'}}\n     * <!--will output '4'-->\n     *\n     * {{-3.6 | number:'1.0-0'}}\n     * <!--will output '-4'-->\n     * ```\n     *\n     * ### locale\n     *\n     * `locale` will format a value according to locale rules.\n     * Locale determines group sizing and separator,\n     * decimal point character, and other locale-specific configurations.\n     *\n     * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.\n     *\n     * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).\n     *\n     * ### Example\n     *\n     * The following code shows how the pipe transforms values\n     * according to various format specifications,\n     * where the caller's default locale is `en-US`.\n     *\n     * <code-example path=\"common/pipes/ts/number_pipe.ts\" region='NumberPipe'></code-example>\n     *\n     * @publicApi\n     */\n    var DecimalPipe = /** @class */ (function () {\n        function DecimalPipe(_locale) {\n            this._locale = _locale;\n        }\n        /**\n         * @param value The value to be formatted.\n         * @param digitsInfo Sets digit and decimal representation.\n         * [See more](#digitsinfo).\n         * @param locale Specifies what locale format rules to use.\n         * [See more](#locale).\n         */\n        DecimalPipe.prototype.transform = function (value, digitsInfo, locale) {\n            if (!isValue(value))\n                return null;\n            locale = locale || this._locale;\n            try {\n                var num = strToNumber(value);\n                return formatNumber(num, locale, digitsInfo);\n            }\n            catch (error) {\n                throw invalidPipeArgumentError(DecimalPipe, error.message);\n            }\n        };\n        return DecimalPipe;\n    }());\n    DecimalPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'number' },] }\n    ];\n    DecimalPipe.ctorParameters = function () { return [\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }\n    ]; };\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Transforms a number to a percentage\n     * string, formatted according to locale rules that determine group sizing and\n     * separator, decimal-point character, and other locale-specific\n     * configurations.\n     *\n     * @see `formatPercent()`\n     *\n     * @usageNotes\n     * The following code shows how the pipe transforms numbers\n     * into text strings, according to various format specifications,\n     * where the caller's default locale is `en-US`.\n     *\n     * <code-example path=\"common/pipes/ts/percent_pipe.ts\" region='PercentPipe'></code-example>\n     *\n     * @publicApi\n     */\n    var PercentPipe = /** @class */ (function () {\n        function PercentPipe(_locale) {\n            this._locale = _locale;\n        }\n        /**\n         *\n         * @param value The number to be formatted as a percentage.\n         * @param digitsInfo Decimal representation options, specified by a string\n         * in the following format:<br>\n         * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.\n         *   - `minIntegerDigits`: The minimum number of integer digits before the decimal point.\n         * Default is `1`.\n         *   - `minFractionDigits`: The minimum number of digits after the decimal point.\n         * Default is `0`.\n         *   - `maxFractionDigits`: The maximum number of digits after the decimal point.\n         * Default is `0`.\n         * @param locale A locale code for the locale format rules to use.\n         * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.\n         * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).\n         */\n        PercentPipe.prototype.transform = function (value, digitsInfo, locale) {\n            if (!isValue(value))\n                return null;\n            locale = locale || this._locale;\n            try {\n                var num = strToNumber(value);\n                return formatPercent(num, locale, digitsInfo);\n            }\n            catch (error) {\n                throw invalidPipeArgumentError(PercentPipe, error.message);\n            }\n        };\n        return PercentPipe;\n    }());\n    PercentPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'percent' },] }\n    ];\n    PercentPipe.ctorParameters = function () { return [\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }\n    ]; };\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Transforms a number to a currency string, formatted according to locale rules\n     * that determine group sizing and separator, decimal-point character,\n     * and other locale-specific configurations.\n     *\n     * {@a currency-code-deprecation}\n     * <div class=\"alert is-helpful\">\n     *\n     * **Deprecation notice:**\n     *\n     * The default currency code is currently always `USD` but this is deprecated from v9.\n     *\n     * **In v11 the default currency code will be taken from the current locale identified by\n     * the `LOCALE_ID` token. See the [i18n guide](guide/i18n#setting-up-the-locale-of-your-app) for\n     * more information.**\n     *\n     * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n     * your application `NgModule`:\n     *\n     * ```ts\n     * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n     * ```\n     *\n     * </div>\n     *\n     * @see `getCurrencySymbol()`\n     * @see `formatCurrency()`\n     *\n     * @usageNotes\n     * The following code shows how the pipe transforms numbers\n     * into text strings, according to various format specifications,\n     * where the caller's default locale is `en-US`.\n     *\n     * <code-example path=\"common/pipes/ts/currency_pipe.ts\" region='CurrencyPipe'></code-example>\n     *\n     * @publicApi\n     */\n    var CurrencyPipe = /** @class */ (function () {\n        function CurrencyPipe(_locale, _defaultCurrencyCode) {\n            if (_defaultCurrencyCode === void 0) { _defaultCurrencyCode = 'USD'; }\n            this._locale = _locale;\n            this._defaultCurrencyCode = _defaultCurrencyCode;\n        }\n        /**\n         *\n         * @param value The number to be formatted as currency.\n         * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code,\n         * such as `USD` for the US dollar and `EUR` for the euro. The default currency code can be\n         * configured using the `DEFAULT_CURRENCY_CODE` injection token.\n         * @param display The format for the currency indicator. One of the following:\n         *   - `code`: Show the code (such as `USD`).\n         *   - `symbol`(default): Show the symbol (such as `$`).\n         *   - `symbol-narrow`: Use the narrow symbol for locales that have two symbols for their\n         * currency.\n         * For example, the Canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`. If the\n         * locale has no narrow symbol, uses the standard symbol for the locale.\n         *   - String: Use the given string value instead of a code or a symbol.\n         * For example, an empty string will suppress the currency & symbol.\n         *   - Boolean (marked deprecated in v5): `true` for symbol and false for `code`.\n         *\n         * @param digitsInfo Decimal representation options, specified by a string\n         * in the following format:<br>\n         * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.\n         *   - `minIntegerDigits`: The minimum number of integer digits before the decimal point.\n         * Default is `1`.\n         *   - `minFractionDigits`: The minimum number of digits after the decimal point.\n         * Default is `2`.\n         *   - `maxFractionDigits`: The maximum number of digits after the decimal point.\n         * Default is `2`.\n         * If not provided, the number will be formatted with the proper amount of digits,\n         * depending on what the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) specifies.\n         * For example, the Canadian dollar has 2 digits, whereas the Chilean peso has none.\n         * @param locale A locale code for the locale format rules to use.\n         * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.\n         * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).\n         */\n        CurrencyPipe.prototype.transform = function (value, currencyCode, display, digitsInfo, locale) {\n            if (currencyCode === void 0) { currencyCode = this._defaultCurrencyCode; }\n            if (display === void 0) { display = 'symbol'; }\n            if (!isValue(value))\n                return null;\n            locale = locale || this._locale;\n            if (typeof display === 'boolean') {\n                if ((typeof ngDevMode === 'undefined' || ngDevMode) && console && console.warn) {\n                    console.warn(\"Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \\\"code\\\", \\\"symbol\\\" or \\\"symbol-narrow\\\".\");\n                }\n                display = display ? 'symbol' : 'code';\n            }\n            var currency = currencyCode || this._defaultCurrencyCode;\n            if (display !== 'code') {\n                if (display === 'symbol' || display === 'symbol-narrow') {\n                    currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);\n                }\n                else {\n                    currency = display;\n                }\n            }\n            try {\n                var num = strToNumber(value);\n                return formatCurrency(num, locale, currency, currencyCode, digitsInfo);\n            }\n            catch (error) {\n                throw invalidPipeArgumentError(CurrencyPipe, error.message);\n            }\n        };\n        return CurrencyPipe;\n    }());\n    CurrencyPipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'currency' },] }\n    ];\n    CurrencyPipe.ctorParameters = function () { return [\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] },\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.DEFAULT_CURRENCY_CODE,] }] }\n    ]; };\n    function isValue(value) {\n        return !(value == null || value === '' || value !== value);\n    }\n    /**\n     * Transforms a string into a number (if needed).\n     */\n    function strToNumber(value) {\n        // Convert strings to numbers\n        if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {\n            return Number(value);\n        }\n        if (typeof value !== 'number') {\n            throw new Error(value + \" is not a number\");\n        }\n        return value;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @ngModule CommonModule\n     * @description\n     *\n     * Creates a new `Array` or `String` containing a subset (slice) of the elements.\n     *\n     * @usageNotes\n     *\n     * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`\n     * and `String.prototype.slice()`.\n     *\n     * When operating on an `Array`, the returned `Array` is always a copy even when all\n     * the elements are being returned.\n     *\n     * When operating on a blank value, the pipe returns the blank value.\n     *\n     * ### List Example\n     *\n     * This `ngFor` example:\n     *\n     * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}\n     *\n     * produces the following:\n     *\n     * ```html\n     * <li>b</li>\n     * <li>c</li>\n     * ```\n     *\n     * ### String Examples\n     *\n     * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}\n     *\n     * @publicApi\n     */\n    var SlicePipe = /** @class */ (function () {\n        function SlicePipe() {\n        }\n        SlicePipe.prototype.transform = function (value, start, end) {\n            if (value == null)\n                return null;\n            if (!this.supports(value)) {\n                throw invalidPipeArgumentError(SlicePipe, value);\n            }\n            return value.slice(start, end);\n        };\n        SlicePipe.prototype.supports = function (obj) {\n            return typeof obj === 'string' || Array.isArray(obj);\n        };\n        return SlicePipe;\n    }());\n    SlicePipe.decorators = [\n        { type: i0.Pipe, args: [{ name: 'slice', pure: false },] }\n    ];\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A collection of Angular pipes that are likely to be used in each and every application.\n     */\n    var COMMON_PIPES = [\n        AsyncPipe,\n        UpperCasePipe,\n        LowerCasePipe,\n        JsonPipe,\n        SlicePipe,\n        DecimalPipe,\n        PercentPipe,\n        TitleCasePipe,\n        CurrencyPipe,\n        DatePipe,\n        I18nPluralPipe,\n        I18nSelectPipe,\n        KeyValuePipe,\n    ];\n\n    /**\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://angular.io/license\n     */\n    // Note: This does not contain the location providers,\n    // as they need some platform specific implementations to work.\n    /**\n     * Exports all the basic Angular directives and pipes,\n     * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.\n     * Re-exported by `BrowserModule`, which is included automatically in the root\n     * `AppModule` when you create a new app with the CLI `new` command.\n     *\n     * * The `providers` options configure the NgModule's injector to provide\n     * localization dependencies to members.\n     * * The `exports` options make the declared directives and pipes available for import\n     * by other NgModules.\n     *\n     * @publicApi\n     */\n    var CommonModule = /** @class */ (function () {\n        function CommonModule() {\n        }\n        return CommonModule;\n    }());\n    CommonModule.decorators = [\n        { type: i0.NgModule, args: [{\n                    declarations: [COMMON_DIRECTIVES, COMMON_PIPES],\n                    exports: [COMMON_DIRECTIVES, COMMON_PIPES],\n                    providers: [\n                        { provide: NgLocalization, useClass: NgLocaleLocalization },\n                    ],\n                },] }\n    ];\n\n    /**\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://angular.io/license\n     */\n    var PLATFORM_BROWSER_ID = 'browser';\n    var PLATFORM_SERVER_ID = 'server';\n    var PLATFORM_WORKER_APP_ID = 'browserWorkerApp';\n    var PLATFORM_WORKER_UI_ID = 'browserWorkerUi';\n    /**\n     * Returns whether a platform id represents a browser platform.\n     * @publicApi\n     */\n    function isPlatformBrowser(platformId) {\n        return platformId === PLATFORM_BROWSER_ID;\n    }\n    /**\n     * Returns whether a platform id represents a server platform.\n     * @publicApi\n     */\n    function isPlatformServer(platformId) {\n        return platformId === PLATFORM_SERVER_ID;\n    }\n    /**\n     * Returns whether a platform id represents a web worker app platform.\n     * @publicApi\n     */\n    function isPlatformWorkerApp(platformId) {\n        return platformId === PLATFORM_WORKER_APP_ID;\n    }\n    /**\n     * Returns whether a platform id represents a web worker UI platform.\n     * @publicApi\n     */\n    function isPlatformWorkerUi(platformId) {\n        return platformId === PLATFORM_WORKER_UI_ID;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @publicApi\n     */\n    var VERSION = new i0.Version('12.2.1');\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.\n     *\n     * @publicApi\n     */\n    var ViewportScroller = /** @class */ (function () {\n        function ViewportScroller() {\n        }\n        return ViewportScroller;\n    }());\n    // De-sugared tree-shakable injection\n    // See #23917\n    /** @nocollapse */\n    ViewportScroller.ɵprov = i0.ɵɵdefineInjectable({\n        token: ViewportScroller,\n        providedIn: 'root',\n        factory: function () { return new BrowserViewportScroller(i0.ɵɵinject(DOCUMENT), window); }\n    });\n    /**\n     * Manages the scroll position for a browser window.\n     */\n    var BrowserViewportScroller = /** @class */ (function () {\n        function BrowserViewportScroller(document, window) {\n            this.document = document;\n            this.window = window;\n            this.offset = function () { return [0, 0]; };\n        }\n        /**\n         * Configures the top offset used when scrolling to an anchor.\n         * @param offset A position in screen coordinates (a tuple with x and y values)\n         * or a function that returns the top offset position.\n         *\n         */\n        BrowserViewportScroller.prototype.setOffset = function (offset) {\n            if (Array.isArray(offset)) {\n                this.offset = function () { return offset; };\n            }\n            else {\n                this.offset = offset;\n            }\n        };\n        /**\n         * Retrieves the current scroll position.\n         * @returns The position in screen coordinates.\n         */\n        BrowserViewportScroller.prototype.getScrollPosition = function () {\n            if (this.supportsScrolling()) {\n                return [this.window.pageXOffset, this.window.pageYOffset];\n            }\n            else {\n                return [0, 0];\n            }\n        };\n        /**\n         * Sets the scroll position.\n         * @param position The new position in screen coordinates.\n         */\n        BrowserViewportScroller.prototype.scrollToPosition = function (position) {\n            if (this.supportsScrolling()) {\n                this.window.scrollTo(position[0], position[1]);\n            }\n        };\n        /**\n         * Scrolls to an element and attempts to focus the element.\n         *\n         * Note that the function name here is misleading in that the target string may be an ID for a\n         * non-anchor element.\n         *\n         * @param target The ID of an element or name of the anchor.\n         *\n         * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document\n         * @see https://html.spec.whatwg.org/#scroll-to-fragid\n         */\n        BrowserViewportScroller.prototype.scrollToAnchor = function (target) {\n            if (!this.supportsScrolling()) {\n                return;\n            }\n            // TODO(atscott): The correct behavior for `getElementsByName` would be to also verify that the\n            // element is an anchor. However, this could be considered a breaking change and should be\n            // done in a major version.\n            var elSelected = findAnchorFromDocument(this.document, target);\n            if (elSelected) {\n                this.scrollToElement(elSelected);\n                // After scrolling to the element, the spec dictates that we follow the focus steps for the\n                // target. Rather than following the robust steps, simply attempt focus.\n                this.attemptFocus(elSelected);\n            }\n        };\n        /**\n         * Disables automatic scroll restoration provided by the browser.\n         */\n        BrowserViewportScroller.prototype.setHistoryScrollRestoration = function (scrollRestoration) {\n            if (this.supportScrollRestoration()) {\n                var history = this.window.history;\n                if (history && history.scrollRestoration) {\n                    history.scrollRestoration = scrollRestoration;\n                }\n            }\n        };\n        /**\n         * Scrolls to an element using the native offset and the specified offset set on this scroller.\n         *\n         * The offset can be used when we know that there is a floating header and scrolling naively to an\n         * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.\n         */\n        BrowserViewportScroller.prototype.scrollToElement = function (el) {\n            var rect = el.getBoundingClientRect();\n            var left = rect.left + this.window.pageXOffset;\n            var top = rect.top + this.window.pageYOffset;\n            var offset = this.offset();\n            this.window.scrollTo(left - offset[0], top - offset[1]);\n        };\n        /**\n         * Calls `focus` on the `focusTarget` and returns `true` if the element was focused successfully.\n         *\n         * If `false`, further steps may be necessary to determine a valid substitute to be focused\n         * instead.\n         *\n         * @see https://html.spec.whatwg.org/#get-the-focusable-area\n         * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus\n         * @see https://html.spec.whatwg.org/#focusable-area\n         */\n        BrowserViewportScroller.prototype.attemptFocus = function (focusTarget) {\n            focusTarget.focus();\n            return this.document.activeElement === focusTarget;\n        };\n        /**\n         * We only support scroll restoration when we can get a hold of window.\n         * This means that we do not support this behavior when running in a web worker.\n         *\n         * Lifting this restriction right now would require more changes in the dom adapter.\n         * Since webworkers aren't widely used, we will lift it once RouterScroller is\n         * battle-tested.\n         */\n        BrowserViewportScroller.prototype.supportScrollRestoration = function () {\n            try {\n                if (!this.supportsScrolling()) {\n                    return false;\n                }\n                // The `scrollRestoration` property could be on the `history` instance or its prototype.\n                var scrollRestorationDescriptor = getScrollRestorationProperty(this.window.history) ||\n                    getScrollRestorationProperty(Object.getPrototypeOf(this.window.history));\n                // We can write to the `scrollRestoration` property if it is a writable data field or it has a\n                // setter function.\n                return !!scrollRestorationDescriptor &&\n                    !!(scrollRestorationDescriptor.writable || scrollRestorationDescriptor.set);\n            }\n            catch (_a) {\n                return false;\n            }\n        };\n        BrowserViewportScroller.prototype.supportsScrolling = function () {\n            try {\n                return !!this.window && !!this.window.scrollTo && 'pageXOffset' in this.window;\n            }\n            catch (_a) {\n                return false;\n            }\n        };\n        return BrowserViewportScroller;\n    }());\n    function getScrollRestorationProperty(obj) {\n        return Object.getOwnPropertyDescriptor(obj, 'scrollRestoration');\n    }\n    function findAnchorFromDocument(document, target) {\n        var documentResult = document.getElementById(target) || document.getElementsByName(target)[0];\n        if (documentResult) {\n            return documentResult;\n        }\n        // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we\n        // have to traverse the DOM manually and do the lookup through the shadow roots.\n        if (typeof document.createTreeWalker === 'function' && document.body &&\n            (document.body.createShadowRoot || document.body.attachShadow)) {\n            var treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);\n            var currentNode = treeWalker.currentNode;\n            while (currentNode) {\n                var shadowRoot = currentNode.shadowRoot;\n                if (shadowRoot) {\n                    // Note that `ShadowRoot` doesn't support `getElementsByName`\n                    // so we have to fall back to `querySelector`.\n                    var result = shadowRoot.getElementById(target) || shadowRoot.querySelector(\"[name=\\\"\" + target + \"\\\"]\");\n                    if (result) {\n                        return result;\n                    }\n                }\n                currentNode = treeWalker.nextNode();\n            }\n        }\n        return null;\n    }\n    /**\n     * Provides an empty implementation of the viewport scroller.\n     */\n    var NullViewportScroller = /** @class */ (function () {\n        function NullViewportScroller() {\n        }\n        /**\n         * Empty implementation\n         */\n        NullViewportScroller.prototype.setOffset = function (offset) { };\n        /**\n         * Empty implementation\n         */\n        NullViewportScroller.prototype.getScrollPosition = function () {\n            return [0, 0];\n        };\n        /**\n         * Empty implementation\n         */\n        NullViewportScroller.prototype.scrollToPosition = function (position) { };\n        /**\n         * Empty implementation\n         */\n        NullViewportScroller.prototype.scrollToAnchor = function (anchor) { };\n        /**\n         * Empty implementation\n         */\n        NullViewportScroller.prototype.setHistoryScrollRestoration = function (scrollRestoration) { };\n        return NullViewportScroller;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A wrapper around the `XMLHttpRequest` constructor.\n     *\n     * @publicApi\n     */\n    var XhrFactory = /** @class */ (function () {\n        function XhrFactory() {\n        }\n        return XhrFactory;\n    }());\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    // This file only reexports content of the `src` folder. Keep it that way.\n\n    /**\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://angular.io/license\n     */\n\n    /**\n     * Generated bundle index. Do not edit.\n     */\n\n    exports.APP_BASE_HREF = APP_BASE_HREF;\n    exports.AsyncPipe = AsyncPipe;\n    exports.CommonModule = CommonModule;\n    exports.CurrencyPipe = CurrencyPipe;\n    exports.DOCUMENT = DOCUMENT;\n    exports.DatePipe = DatePipe;\n    exports.DecimalPipe = DecimalPipe;\n    exports.HashLocationStrategy = HashLocationStrategy;\n    exports.I18nPluralPipe = I18nPluralPipe;\n    exports.I18nSelectPipe = I18nSelectPipe;\n    exports.JsonPipe = JsonPipe;\n    exports.KeyValuePipe = KeyValuePipe;\n    exports.LOCATION_INITIALIZED = LOCATION_INITIALIZED;\n    exports.Location = Location;\n    exports.LocationStrategy = LocationStrategy;\n    exports.LowerCasePipe = LowerCasePipe;\n    exports.NgClass = NgClass;\n    exports.NgComponentOutlet = NgComponentOutlet;\n    exports.NgForOf = NgForOf;\n    exports.NgForOfContext = NgForOfContext;\n    exports.NgIf = NgIf;\n    exports.NgIfContext = NgIfContext;\n    exports.NgLocaleLocalization = NgLocaleLocalization;\n    exports.NgLocalization = NgLocalization;\n    exports.NgPlural = NgPlural;\n    exports.NgPluralCase = NgPluralCase;\n    exports.NgStyle = NgStyle;\n    exports.NgSwitch = NgSwitch;\n    exports.NgSwitchCase = NgSwitchCase;\n    exports.NgSwitchDefault = NgSwitchDefault;\n    exports.NgTemplateOutlet = NgTemplateOutlet;\n    exports.PathLocationStrategy = PathLocationStrategy;\n    exports.PercentPipe = PercentPipe;\n    exports.PlatformLocation = PlatformLocation;\n    exports.SlicePipe = SlicePipe;\n    exports.TitleCasePipe = TitleCasePipe;\n    exports.UpperCasePipe = UpperCasePipe;\n    exports.VERSION = VERSION;\n    exports.ViewportScroller = ViewportScroller;\n    exports.XhrFactory = XhrFactory;\n    exports.formatCurrency = formatCurrency;\n    exports.formatDate = formatDate;\n    exports.formatNumber = formatNumber;\n    exports.formatPercent = formatPercent;\n    exports.getCurrencySymbol = getCurrencySymbol;\n    exports.getLocaleCurrencyCode = getLocaleCurrencyCode;\n    exports.getLocaleCurrencyName = getLocaleCurrencyName;\n    exports.getLocaleCurrencySymbol = getLocaleCurrencySymbol;\n    exports.getLocaleDateFormat = getLocaleDateFormat;\n    exports.getLocaleDateTimeFormat = getLocaleDateTimeFormat;\n    exports.getLocaleDayNames = getLocaleDayNames;\n    exports.getLocaleDayPeriods = getLocaleDayPeriods;\n    exports.getLocaleDirection = getLocaleDirection;\n    exports.getLocaleEraNames = getLocaleEraNames;\n    exports.getLocaleExtraDayPeriodRules = getLocaleExtraDayPeriodRules;\n    exports.getLocaleExtraDayPeriods = getLocaleExtraDayPeriods;\n    exports.getLocaleFirstDayOfWeek = getLocaleFirstDayOfWeek;\n    exports.getLocaleId = getLocaleId;\n    exports.getLocaleMonthNames = getLocaleMonthNames;\n    exports.getLocaleNumberFormat = getLocaleNumberFormat;\n    exports.getLocaleNumberSymbol = getLocaleNumberSymbol;\n    exports.getLocalePluralCase = getLocalePluralCase;\n    exports.getLocaleTimeFormat = getLocaleTimeFormat;\n    exports.getLocaleWeekEndRange = getLocaleWeekEndRange;\n    exports.getNumberOfCurrencyDigits = getNumberOfCurrencyDigits;\n    exports.isPlatformBrowser = isPlatformBrowser;\n    exports.isPlatformServer = isPlatformServer;\n    exports.isPlatformWorkerApp = isPlatformWorkerApp;\n    exports.isPlatformWorkerUi = isPlatformWorkerUi;\n    exports.registerLocaleData = registerLocaleData;\n    exports.ɵBrowserPlatformLocation = BrowserPlatformLocation;\n    exports.ɵDomAdapter = DomAdapter;\n    exports.ɵNullViewportScroller = NullViewportScroller;\n    exports.ɵPLATFORM_BROWSER_ID = PLATFORM_BROWSER_ID;\n    exports.ɵPLATFORM_SERVER_ID = PLATFORM_SERVER_ID;\n    exports.ɵPLATFORM_WORKER_APP_ID = PLATFORM_WORKER_APP_ID;\n    exports.ɵPLATFORM_WORKER_UI_ID = PLATFORM_WORKER_UI_ID;\n    exports.ɵangular_packages_common_common_a = useBrowserPlatformLocation;\n    exports.ɵangular_packages_common_common_b = createBrowserPlatformLocation;\n    exports.ɵangular_packages_common_common_c = createLocation;\n    exports.ɵangular_packages_common_common_d = provideLocationStrategy;\n    exports.ɵangular_packages_common_common_e = COMMON_DIRECTIVES;\n    exports.ɵangular_packages_common_common_f = COMMON_PIPES;\n    exports.ɵgetDOM = getDOM;\n    exports.ɵparseCookieValue = parseCookieValue;\n    exports.ɵsetRootDomAdapter = setRootDomAdapter;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=common.umd.js.map"
  },
  {
    "path": "test/lib/angular-12/angular-12-compiler.js",
    "content": "/**\n * @license Angular v12.2.1\n * (c) 2010-2021 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n    typeof define === 'function' && define.amd ? define('@angular/compiler', ['exports'], factory) :\n    (global = global || self, factory((global.ng = global.ng || {}, global.ng.compiler = {})));\n}(this, (function (exports) { 'use strict';\n\n    /*! *****************************************************************************\n    Copyright (c) Microsoft Corporation.\n\n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n    PERFORMANCE OF THIS SOFTWARE.\n    ***************************************************************************** */\n    /* global Reflect, Promise */\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b)\n                if (Object.prototype.hasOwnProperty.call(b, p))\n                    d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    function __extends(d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    }\n    var __assign = function () {\n        __assign = Object.assign || function __assign(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s)\n                    if (Object.prototype.hasOwnProperty.call(s, p))\n                        t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign.apply(this, arguments);\n    };\n    function __rest(s, e) {\n        var t = {};\n        for (var p in s)\n            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n                t[p] = s[p];\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                    t[p[i]] = s[p[i]];\n            }\n        return t;\n    }\n    function __decorate(decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n            r = Reflect.decorate(decorators, target, key, desc);\n        else\n            for (var i = decorators.length - 1; i >= 0; i--)\n                if (d = decorators[i])\n                    r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    }\n    function __param(paramIndex, decorator) {\n        return function (target, key) { decorator(target, key, paramIndex); };\n    }\n    function __metadata(metadataKey, metadataValue) {\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n            return Reflect.metadata(metadataKey, metadataValue);\n    }\n    function __awaiter(thisArg, _arguments, P, generator) {\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n        return new (P || (P = Promise))(function (resolve, reject) {\n            function fulfilled(value) { try {\n                step(generator.next(value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function rejected(value) { try {\n                step(generator[\"throw\"](value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\n        });\n    }\n    function __generator(thisArg, body) {\n        var _ = { label: 0, sent: function () { if (t[0] & 1)\n                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n        function verb(n) { return function (v) { return step([n, v]); }; }\n        function step(op) {\n            if (f)\n                throw new TypeError(\"Generator is already executing.\");\n            while (_)\n                try {\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)\n                        return t;\n                    if (y = 0, t)\n                        op = [op[0] & 2, t.value];\n                    switch (op[0]) {\n                        case 0:\n                        case 1:\n                            t = op;\n                            break;\n                        case 4:\n                            _.label++;\n                            return { value: op[1], done: false };\n                        case 5:\n                            _.label++;\n                            y = op[1];\n                            op = [0];\n                            continue;\n                        case 7:\n                            op = _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                        default:\n                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n                                _ = 0;\n                                continue;\n                            }\n                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n                                _.label = op[1];\n                                break;\n                            }\n                            if (op[0] === 6 && _.label < t[1]) {\n                                _.label = t[1];\n                                t = op;\n                                break;\n                            }\n                            if (t && _.label < t[2]) {\n                                _.label = t[2];\n                                _.ops.push(op);\n                                break;\n                            }\n                            if (t[2])\n                                _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                    }\n                    op = body.call(thisArg, _);\n                }\n                catch (e) {\n                    op = [6, e];\n                    y = 0;\n                }\n                finally {\n                    f = t = 0;\n                }\n            if (op[0] & 5)\n                throw op[1];\n            return { value: op[0] ? op[1] : void 0, done: true };\n        }\n    }\n    var __createBinding = Object.create ? (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n    }) : (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        o[k2] = m[k];\n    });\n    function __exportStar(m, o) {\n        for (var p in m)\n            if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n                __createBinding(o, m, p);\n    }\n    function __values(o) {\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n        if (m)\n            return m.call(o);\n        if (o && typeof o.length === \"number\")\n            return {\n                next: function () {\n                    if (o && i >= o.length)\n                        o = void 0;\n                    return { value: o && o[i++], done: !o };\n                }\n            };\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n    }\n    function __read(o, n) {\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n        if (!m)\n            return o;\n        var i = m.call(o), r, ar = [], e;\n        try {\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n                ar.push(r.value);\n        }\n        catch (error) {\n            e = { error: error };\n        }\n        finally {\n            try {\n                if (r && !r.done && (m = i[\"return\"]))\n                    m.call(i);\n            }\n            finally {\n                if (e)\n                    throw e.error;\n            }\n        }\n        return ar;\n    }\n    /** @deprecated */\n    function __spread() {\n        for (var ar = [], i = 0; i < arguments.length; i++)\n            ar = ar.concat(__read(arguments[i]));\n        return ar;\n    }\n    /** @deprecated */\n    function __spreadArrays() {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n            s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    }\n    function __spreadArray(to, from, pack) {\n        if (pack || arguments.length === 2)\n            for (var i = 0, l = from.length, ar; i < l; i++) {\n                if (ar || !(i in from)) {\n                    if (!ar)\n                        ar = Array.prototype.slice.call(from, 0, i);\n                    ar[i] = from[i];\n                }\n            }\n        return to.concat(ar || from);\n    }\n    function __await(v) {\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\n    }\n    function __asyncGenerator(thisArg, _arguments, generator) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n        function verb(n) { if (g[n])\n            i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n        function resume(n, v) { try {\n            step(g[n](v));\n        }\n        catch (e) {\n            settle(q[0][3], e);\n        } }\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n        function fulfill(value) { resume(\"next\", value); }\n        function reject(value) { resume(\"throw\", value); }\n        function settle(f, v) { if (f(v), q.shift(), q.length)\n            resume(q[0][0], q[0][1]); }\n    }\n    function __asyncDelegator(o) {\n        var i, p;\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\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; }\n    }\n    function __asyncValues(o) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n    }\n    function __makeTemplateObject(cooked, raw) {\n        if (Object.defineProperty) {\n            Object.defineProperty(cooked, \"raw\", { value: raw });\n        }\n        else {\n            cooked.raw = raw;\n        }\n        return cooked;\n    }\n    ;\n    var __setModuleDefault = Object.create ? (function (o, v) {\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n    }) : function (o, v) {\n        o[\"default\"] = v;\n    };\n    function __importStar(mod) {\n        if (mod && mod.__esModule)\n            return mod;\n        var result = {};\n        if (mod != null)\n            for (var k in mod)\n                if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n                    __createBinding(result, mod, k);\n        __setModuleDefault(result, mod);\n        return result;\n    }\n    function __importDefault(mod) {\n        return (mod && mod.__esModule) ? mod : { default: mod };\n    }\n    function __classPrivateFieldGet(receiver, state, kind, f) {\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a getter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n    }\n    function __classPrivateFieldSet(receiver, state, value, kind, f) {\n        if (kind === \"m\")\n            throw new TypeError(\"Private method is not writable\");\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a setter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n    }\n\n    /**\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://angular.io/license\n     */\n    (function (TagContentType) {\n        TagContentType[TagContentType[\"RAW_TEXT\"] = 0] = \"RAW_TEXT\";\n        TagContentType[TagContentType[\"ESCAPABLE_RAW_TEXT\"] = 1] = \"ESCAPABLE_RAW_TEXT\";\n        TagContentType[TagContentType[\"PARSABLE_DATA\"] = 2] = \"PARSABLE_DATA\";\n    })(exports.TagContentType || (exports.TagContentType = {}));\n    function splitNsName(elementName) {\n        if (elementName[0] != ':') {\n            return [null, elementName];\n        }\n        var colonIndex = elementName.indexOf(':', 1);\n        if (colonIndex == -1) {\n            throw new Error(\"Unsupported format \\\"\" + elementName + \"\\\" expecting \\\":namespace:name\\\"\");\n        }\n        return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];\n    }\n    // `<ng-container>` tags work the same regardless the namespace\n    function isNgContainer(tagName) {\n        return splitNsName(tagName)[1] === 'ng-container';\n    }\n    // `<ng-content>` tags work the same regardless the namespace\n    function isNgContent(tagName) {\n        return splitNsName(tagName)[1] === 'ng-content';\n    }\n    // `<ng-template>` tags work the same regardless the namespace\n    function isNgTemplate(tagName) {\n        return splitNsName(tagName)[1] === 'ng-template';\n    }\n    function getNsPrefix(fullName) {\n        return fullName === null ? null : splitNsName(fullName)[0];\n    }\n    function mergeNsAndName(prefix, localName) {\n        return prefix ? \":\" + prefix + \":\" + localName : localName;\n    }\n\n    /**\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://angular.io/license\n     */\n    var HtmlTagDefinition = /** @class */ (function () {\n        function HtmlTagDefinition(_c) {\n            var _this = this;\n            var _d = _c === void 0 ? {} : _c, closedByChildren = _d.closedByChildren, implicitNamespacePrefix = _d.implicitNamespacePrefix, _e = _d.contentType, contentType = _e === void 0 ? exports.TagContentType.PARSABLE_DATA : _e, _f = _d.closedByParent, closedByParent = _f === void 0 ? false : _f, _g = _d.isVoid, isVoid = _g === void 0 ? false : _g, _h = _d.ignoreFirstLf, ignoreFirstLf = _h === void 0 ? false : _h, _j = _d.preventNamespaceInheritance, preventNamespaceInheritance = _j === void 0 ? false : _j;\n            this.closedByChildren = {};\n            this.closedByParent = false;\n            this.canSelfClose = false;\n            if (closedByChildren && closedByChildren.length > 0) {\n                closedByChildren.forEach(function (tagName) { return _this.closedByChildren[tagName] = true; });\n            }\n            this.isVoid = isVoid;\n            this.closedByParent = closedByParent || isVoid;\n            this.implicitNamespacePrefix = implicitNamespacePrefix || null;\n            this.contentType = contentType;\n            this.ignoreFirstLf = ignoreFirstLf;\n            this.preventNamespaceInheritance = preventNamespaceInheritance;\n        }\n        HtmlTagDefinition.prototype.isClosedByChild = function (name) {\n            return this.isVoid || name.toLowerCase() in this.closedByChildren;\n        };\n        HtmlTagDefinition.prototype.getContentType = function (prefix) {\n            if (typeof this.contentType === 'object') {\n                var overrideType = prefix == null ? undefined : this.contentType[prefix];\n                return overrideType !== null && overrideType !== void 0 ? overrideType : this.contentType.default;\n            }\n            return this.contentType;\n        };\n        return HtmlTagDefinition;\n    }());\n    var _DEFAULT_TAG_DEFINITION;\n    // see https://www.w3.org/TR/html51/syntax.html#optional-tags\n    // This implementation does not fully conform to the HTML5 spec.\n    var TAG_DEFINITIONS;\n    function getHtmlTagDefinition(tagName) {\n        var _a, _b;\n        if (!TAG_DEFINITIONS) {\n            _DEFAULT_TAG_DEFINITION = new HtmlTagDefinition();\n            TAG_DEFINITIONS = {\n                'base': new HtmlTagDefinition({ isVoid: true }),\n                'meta': new HtmlTagDefinition({ isVoid: true }),\n                'area': new HtmlTagDefinition({ isVoid: true }),\n                'embed': new HtmlTagDefinition({ isVoid: true }),\n                'link': new HtmlTagDefinition({ isVoid: true }),\n                'img': new HtmlTagDefinition({ isVoid: true }),\n                'input': new HtmlTagDefinition({ isVoid: true }),\n                'param': new HtmlTagDefinition({ isVoid: true }),\n                'hr': new HtmlTagDefinition({ isVoid: true }),\n                'br': new HtmlTagDefinition({ isVoid: true }),\n                'source': new HtmlTagDefinition({ isVoid: true }),\n                'track': new HtmlTagDefinition({ isVoid: true }),\n                'wbr': new HtmlTagDefinition({ isVoid: true }),\n                'p': new HtmlTagDefinition({\n                    closedByChildren: [\n                        'address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset',\n                        'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5',\n                        'h6', 'header', 'hgroup', 'hr', 'main', 'nav', 'ol',\n                        'p', 'pre', 'section', 'table', 'ul'\n                    ],\n                    closedByParent: true\n                }),\n                'thead': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'] }),\n                'tbody': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'], closedByParent: true }),\n                'tfoot': new HtmlTagDefinition({ closedByChildren: ['tbody'], closedByParent: true }),\n                'tr': new HtmlTagDefinition({ closedByChildren: ['tr'], closedByParent: true }),\n                'td': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),\n                'th': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),\n                'col': new HtmlTagDefinition({ isVoid: true }),\n                'svg': new HtmlTagDefinition({ implicitNamespacePrefix: 'svg' }),\n                'foreignObject': new HtmlTagDefinition({\n                    // Usually the implicit namespace here would be redundant since it will be inherited from\n                    // the parent `svg`, but we have to do it for `foreignObject`, because the way the parser\n                    // works is that the parent node of an end tag is its own start tag which means that\n                    // the `preventNamespaceInheritance` on `foreignObject` would have it default to the\n                    // implicit namespace which is `html`, unless specified otherwise.\n                    implicitNamespacePrefix: 'svg',\n                    // We want to prevent children of foreignObject from inheriting its namespace, because\n                    // the point of the element is to allow nodes from other namespaces to be inserted.\n                    preventNamespaceInheritance: true,\n                }),\n                'math': new HtmlTagDefinition({ implicitNamespacePrefix: 'math' }),\n                'li': new HtmlTagDefinition({ closedByChildren: ['li'], closedByParent: true }),\n                'dt': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'] }),\n                'dd': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'], closedByParent: true }),\n                'rb': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n                'rt': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n                'rtc': new HtmlTagDefinition({ closedByChildren: ['rb', 'rtc', 'rp'], closedByParent: true }),\n                'rp': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n                'optgroup': new HtmlTagDefinition({ closedByChildren: ['optgroup'], closedByParent: true }),\n                'option': new HtmlTagDefinition({ closedByChildren: ['option', 'optgroup'], closedByParent: true }),\n                'pre': new HtmlTagDefinition({ ignoreFirstLf: true }),\n                'listing': new HtmlTagDefinition({ ignoreFirstLf: true }),\n                'style': new HtmlTagDefinition({ contentType: exports.TagContentType.RAW_TEXT }),\n                'script': new HtmlTagDefinition({ contentType: exports.TagContentType.RAW_TEXT }),\n                'title': new HtmlTagDefinition({\n                    // The browser supports two separate `title` tags which have to use\n                    // a different content type: `HTMLTitleElement` and `SVGTitleElement`\n                    contentType: { default: exports.TagContentType.ESCAPABLE_RAW_TEXT, svg: exports.TagContentType.PARSABLE_DATA }\n                }),\n                'textarea': new HtmlTagDefinition({ contentType: exports.TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true }),\n            };\n        }\n        // We have to make both a case-sensitive and a case-insesitive lookup, because\n        // HTML tag names are case insensitive, whereas some SVG tags are case sensitive.\n        return (_b = (_a = TAG_DEFINITIONS[tagName]) !== null && _a !== void 0 ? _a : TAG_DEFINITIONS[tagName.toLowerCase()]) !== null && _b !== void 0 ? _b : _DEFAULT_TAG_DEFINITION;\n    }\n\n    /**\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://angular.io/license\n     */\n    var _SELECTOR_REGEXP = new RegExp('(\\\\:not\\\\()|' + // 1: \":not(\"\n        '(([\\\\.\\\\#]?)[-\\\\w]+)|' + // 2: \"tag\"; 3: \".\"/\"#\";\n        // \"-\" should appear first in the regexp below as FF31 parses \"[.-\\w]\" as a range\n        // 4: attribute; 5: attribute_string; 6: attribute_value\n        '(?:\\\\[([-.\\\\w*\\\\\\\\$]+)(?:=([\\\"\\']?)([^\\\\]\\\"\\']*)\\\\5)?\\\\])|' + // \"[name]\", \"[name=value]\",\n        // \"[name=\"value\"]\",\n        // \"[name='value']\"\n        '(\\\\))|' + // 7: \")\"\n        '(\\\\s*,\\\\s*)', // 8: \",\"\n    'g');\n    /**\n     * A css selector contains an element name,\n     * css classes and attribute/value pairs with the purpose\n     * of selecting subsets out of them.\n     */\n    var CssSelector = /** @class */ (function () {\n        function CssSelector() {\n            this.element = null;\n            this.classNames = [];\n            /**\n             * The selectors are encoded in pairs where:\n             * - even locations are attribute names\n             * - odd locations are attribute values.\n             *\n             * Example:\n             * Selector: `[key1=value1][key2]` would parse to:\n             * ```\n             * ['key1', 'value1', 'key2', '']\n             * ```\n             */\n            this.attrs = [];\n            this.notSelectors = [];\n        }\n        CssSelector.parse = function (selector) {\n            var results = [];\n            var _addResult = function (res, cssSel) {\n                if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&\n                    cssSel.attrs.length == 0) {\n                    cssSel.element = '*';\n                }\n                res.push(cssSel);\n            };\n            var cssSelector = new CssSelector();\n            var match;\n            var current = cssSelector;\n            var inNot = false;\n            _SELECTOR_REGEXP.lastIndex = 0;\n            while (match = _SELECTOR_REGEXP.exec(selector)) {\n                if (match[1 /* NOT */]) {\n                    if (inNot) {\n                        throw new Error('Nesting :not in a selector is not allowed');\n                    }\n                    inNot = true;\n                    current = new CssSelector();\n                    cssSelector.notSelectors.push(current);\n                }\n                var tag = match[2 /* TAG */];\n                if (tag) {\n                    var prefix = match[3 /* PREFIX */];\n                    if (prefix === '#') {\n                        // #hash\n                        current.addAttribute('id', tag.substr(1));\n                    }\n                    else if (prefix === '.') {\n                        // Class\n                        current.addClassName(tag.substr(1));\n                    }\n                    else {\n                        // Element\n                        current.setElement(tag);\n                    }\n                }\n                var attribute = match[4 /* ATTRIBUTE */];\n                if (attribute) {\n                    current.addAttribute(current.unescapeAttribute(attribute), match[6 /* ATTRIBUTE_VALUE */]);\n                }\n                if (match[7 /* NOT_END */]) {\n                    inNot = false;\n                    current = cssSelector;\n                }\n                if (match[8 /* SEPARATOR */]) {\n                    if (inNot) {\n                        throw new Error('Multiple selectors in :not are not supported');\n                    }\n                    _addResult(results, cssSelector);\n                    cssSelector = current = new CssSelector();\n                }\n            }\n            _addResult(results, cssSelector);\n            return results;\n        };\n        /**\n         * Unescape `\\$` sequences from the CSS attribute selector.\n         *\n         * This is needed because `$` can have a special meaning in CSS selectors,\n         * but we might want to match an attribute that contains `$`.\n         * [MDN web link for more\n         * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).\n         * @param attr the attribute to unescape.\n         * @returns the unescaped string.\n         */\n        CssSelector.prototype.unescapeAttribute = function (attr) {\n            var result = '';\n            var escaping = false;\n            for (var i = 0; i < attr.length; i++) {\n                var char = attr.charAt(i);\n                if (char === '\\\\') {\n                    escaping = true;\n                    continue;\n                }\n                if (char === '$' && !escaping) {\n                    throw new Error(\"Error in attribute selector \\\"\" + attr + \"\\\". \" +\n                        \"Unescaped \\\"$\\\" is not supported. Please escape with \\\"\\\\$\\\".\");\n                }\n                escaping = false;\n                result += char;\n            }\n            return result;\n        };\n        /**\n         * Escape `$` sequences from the CSS attribute selector.\n         *\n         * This is needed because `$` can have a special meaning in CSS selectors,\n         * with this method we are escaping `$` with `\\$'.\n         * [MDN web link for more\n         * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).\n         * @param attr the attribute to escape.\n         * @returns the escaped string.\n         */\n        CssSelector.prototype.escapeAttribute = function (attr) {\n            return attr.replace(/\\\\/g, '\\\\\\\\').replace(/\\$/g, '\\\\$');\n        };\n        CssSelector.prototype.isElementSelector = function () {\n            return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&\n                this.notSelectors.length === 0;\n        };\n        CssSelector.prototype.hasElementSelector = function () {\n            return !!this.element;\n        };\n        CssSelector.prototype.setElement = function (element) {\n            if (element === void 0) { element = null; }\n            this.element = element;\n        };\n        /** Gets a template string for an element that matches the selector. */\n        CssSelector.prototype.getMatchingElementTemplate = function () {\n            var tagName = this.element || 'div';\n            var classAttr = this.classNames.length > 0 ? \" class=\\\"\" + this.classNames.join(' ') + \"\\\"\" : '';\n            var attrs = '';\n            for (var i = 0; i < this.attrs.length; i += 2) {\n                var attrName = this.attrs[i];\n                var attrValue = this.attrs[i + 1] !== '' ? \"=\\\"\" + this.attrs[i + 1] + \"\\\"\" : '';\n                attrs += \" \" + attrName + attrValue;\n            }\n            return getHtmlTagDefinition(tagName).isVoid ? \"<\" + tagName + classAttr + attrs + \"/>\" :\n                \"<\" + tagName + classAttr + attrs + \"></\" + tagName + \">\";\n        };\n        CssSelector.prototype.getAttrs = function () {\n            var result = [];\n            if (this.classNames.length > 0) {\n                result.push('class', this.classNames.join(' '));\n            }\n            return result.concat(this.attrs);\n        };\n        CssSelector.prototype.addAttribute = function (name, value) {\n            if (value === void 0) { value = ''; }\n            this.attrs.push(name, value && value.toLowerCase() || '');\n        };\n        CssSelector.prototype.addClassName = function (name) {\n            this.classNames.push(name.toLowerCase());\n        };\n        CssSelector.prototype.toString = function () {\n            var res = this.element || '';\n            if (this.classNames) {\n                this.classNames.forEach(function (klass) { return res += \".\" + klass; });\n            }\n            if (this.attrs) {\n                for (var i = 0; i < this.attrs.length; i += 2) {\n                    var name = this.escapeAttribute(this.attrs[i]);\n                    var value = this.attrs[i + 1];\n                    res += \"[\" + name + (value ? '=' + value : '') + \"]\";\n                }\n            }\n            this.notSelectors.forEach(function (notSelector) { return res += \":not(\" + notSelector + \")\"; });\n            return res;\n        };\n        return CssSelector;\n    }());\n    /**\n     * Reads a list of CssSelectors and allows to calculate which ones\n     * are contained in a given CssSelector.\n     */\n    var SelectorMatcher = /** @class */ (function () {\n        function SelectorMatcher() {\n            this._elementMap = new Map();\n            this._elementPartialMap = new Map();\n            this._classMap = new Map();\n            this._classPartialMap = new Map();\n            this._attrValueMap = new Map();\n            this._attrValuePartialMap = new Map();\n            this._listContexts = [];\n        }\n        SelectorMatcher.createNotMatcher = function (notSelectors) {\n            var notMatcher = new SelectorMatcher();\n            notMatcher.addSelectables(notSelectors, null);\n            return notMatcher;\n        };\n        SelectorMatcher.prototype.addSelectables = function (cssSelectors, callbackCtxt) {\n            var listContext = null;\n            if (cssSelectors.length > 1) {\n                listContext = new SelectorListContext(cssSelectors);\n                this._listContexts.push(listContext);\n            }\n            for (var i = 0; i < cssSelectors.length; i++) {\n                this._addSelectable(cssSelectors[i], callbackCtxt, listContext);\n            }\n        };\n        /**\n         * Add an object that can be found later on by calling `match`.\n         * @param cssSelector A css selector\n         * @param callbackCtxt An opaque object that will be given to the callback of the `match` function\n         */\n        SelectorMatcher.prototype._addSelectable = function (cssSelector, callbackCtxt, listContext) {\n            var matcher = this;\n            var element = cssSelector.element;\n            var classNames = cssSelector.classNames;\n            var attrs = cssSelector.attrs;\n            var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n            if (element) {\n                var isTerminal = attrs.length === 0 && classNames.length === 0;\n                if (isTerminal) {\n                    this._addTerminal(matcher._elementMap, element, selectable);\n                }\n                else {\n                    matcher = this._addPartial(matcher._elementPartialMap, element);\n                }\n            }\n            if (classNames) {\n                for (var i = 0; i < classNames.length; i++) {\n                    var isTerminal = attrs.length === 0 && i === classNames.length - 1;\n                    var className = classNames[i];\n                    if (isTerminal) {\n                        this._addTerminal(matcher._classMap, className, selectable);\n                    }\n                    else {\n                        matcher = this._addPartial(matcher._classPartialMap, className);\n                    }\n                }\n            }\n            if (attrs) {\n                for (var i = 0; i < attrs.length; i += 2) {\n                    var isTerminal = i === attrs.length - 2;\n                    var name = attrs[i];\n                    var value = attrs[i + 1];\n                    if (isTerminal) {\n                        var terminalMap = matcher._attrValueMap;\n                        var terminalValuesMap = terminalMap.get(name);\n                        if (!terminalValuesMap) {\n                            terminalValuesMap = new Map();\n                            terminalMap.set(name, terminalValuesMap);\n                        }\n                        this._addTerminal(terminalValuesMap, value, selectable);\n                    }\n                    else {\n                        var partialMap = matcher._attrValuePartialMap;\n                        var partialValuesMap = partialMap.get(name);\n                        if (!partialValuesMap) {\n                            partialValuesMap = new Map();\n                            partialMap.set(name, partialValuesMap);\n                        }\n                        matcher = this._addPartial(partialValuesMap, value);\n                    }\n                }\n            }\n        };\n        SelectorMatcher.prototype._addTerminal = function (map, name, selectable) {\n            var terminalList = map.get(name);\n            if (!terminalList) {\n                terminalList = [];\n                map.set(name, terminalList);\n            }\n            terminalList.push(selectable);\n        };\n        SelectorMatcher.prototype._addPartial = function (map, name) {\n            var matcher = map.get(name);\n            if (!matcher) {\n                matcher = new SelectorMatcher();\n                map.set(name, matcher);\n            }\n            return matcher;\n        };\n        /**\n         * Find the objects that have been added via `addSelectable`\n         * whose css selector is contained in the given css selector.\n         * @param cssSelector A css selector\n         * @param matchedCallback This callback will be called with the object handed into `addSelectable`\n         * @return boolean true if a match was found\n         */\n        SelectorMatcher.prototype.match = function (cssSelector, matchedCallback) {\n            var result = false;\n            var element = cssSelector.element;\n            var classNames = cssSelector.classNames;\n            var attrs = cssSelector.attrs;\n            for (var i = 0; i < this._listContexts.length; i++) {\n                this._listContexts[i].alreadyMatched = false;\n            }\n            result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;\n            result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) ||\n                result;\n            if (classNames) {\n                for (var i = 0; i < classNames.length; i++) {\n                    var className = classNames[i];\n                    result =\n                        this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;\n                    result =\n                        this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||\n                            result;\n                }\n            }\n            if (attrs) {\n                for (var i = 0; i < attrs.length; i += 2) {\n                    var name = attrs[i];\n                    var value = attrs[i + 1];\n                    var terminalValuesMap = this._attrValueMap.get(name);\n                    if (value) {\n                        result =\n                            this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;\n                    }\n                    result =\n                        this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;\n                    var partialValuesMap = this._attrValuePartialMap.get(name);\n                    if (value) {\n                        result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;\n                    }\n                    result =\n                        this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;\n                }\n            }\n            return result;\n        };\n        /** @internal */\n        SelectorMatcher.prototype._matchTerminal = function (map, name, cssSelector, matchedCallback) {\n            if (!map || typeof name !== 'string') {\n                return false;\n            }\n            var selectables = map.get(name) || [];\n            var starSelectables = map.get('*');\n            if (starSelectables) {\n                selectables = selectables.concat(starSelectables);\n            }\n            if (selectables.length === 0) {\n                return false;\n            }\n            var selectable;\n            var result = false;\n            for (var i = 0; i < selectables.length; i++) {\n                selectable = selectables[i];\n                result = selectable.finalize(cssSelector, matchedCallback) || result;\n            }\n            return result;\n        };\n        /** @internal */\n        SelectorMatcher.prototype._matchPartial = function (map, name, cssSelector, matchedCallback) {\n            if (!map || typeof name !== 'string') {\n                return false;\n            }\n            var nestedSelector = map.get(name);\n            if (!nestedSelector) {\n                return false;\n            }\n            // TODO(perf): get rid of recursion and measure again\n            // TODO(perf): don't pass the whole selector into the recursion,\n            // but only the not processed parts\n            return nestedSelector.match(cssSelector, matchedCallback);\n        };\n        return SelectorMatcher;\n    }());\n    var SelectorListContext = /** @class */ (function () {\n        function SelectorListContext(selectors) {\n            this.selectors = selectors;\n            this.alreadyMatched = false;\n        }\n        return SelectorListContext;\n    }());\n    // Store context to pass back selector and context when a selector is matched\n    var SelectorContext = /** @class */ (function () {\n        function SelectorContext(selector, cbContext, listContext) {\n            this.selector = selector;\n            this.cbContext = cbContext;\n            this.listContext = listContext;\n            this.notSelectors = selector.notSelectors;\n        }\n        SelectorContext.prototype.finalize = function (cssSelector, callback) {\n            var result = true;\n            if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n                var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);\n                result = !notMatcher.match(cssSelector, null);\n            }\n            if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {\n                if (this.listContext) {\n                    this.listContext.alreadyMatched = true;\n                }\n                callback(this.selector, this.cbContext);\n            }\n            return result;\n        };\n        return SelectorContext;\n    }());\n\n    var createInject = makeMetadataFactory('Inject', function (token) { return ({ token: token }); });\n    var createInjectionToken = makeMetadataFactory('InjectionToken', function (desc) { return ({ _desc: desc, ɵprov: undefined }); });\n    var createAttribute = makeMetadataFactory('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });\n    // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n    // explicitly set.\n    var emitDistinctChangesOnlyDefaultValue = true;\n    var createContentChildren = makeMetadataFactory('ContentChildren', function (selector, data) {\n        if (data === void 0) { data = {}; }\n        return (Object.assign({ selector: selector, first: false, isViewQuery: false, descendants: false, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));\n    });\n    var createContentChild = makeMetadataFactory('ContentChild', function (selector, data) {\n        if (data === void 0) { data = {}; }\n        return (Object.assign({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));\n    });\n    var createViewChildren = makeMetadataFactory('ViewChildren', function (selector, data) {\n        if (data === void 0) { data = {}; }\n        return (Object.assign({ selector: selector, first: false, isViewQuery: true, descendants: true, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));\n    });\n    var createViewChild = makeMetadataFactory('ViewChild', function (selector, data) { return (Object.assign({ selector: selector, first: true, isViewQuery: true, descendants: true }, data)); });\n    var createDirective = makeMetadataFactory('Directive', function (dir) {\n        if (dir === void 0) { dir = {}; }\n        return dir;\n    });\n    var ViewEncapsulation;\n    (function (ViewEncapsulation) {\n        ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n        // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n        ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n        ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n    })(ViewEncapsulation || (ViewEncapsulation = {}));\n    var ChangeDetectionStrategy;\n    (function (ChangeDetectionStrategy) {\n        ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n        ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n    })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\n    var createComponent = makeMetadataFactory('Component', function (c) {\n        if (c === void 0) { c = {}; }\n        return (Object.assign({ changeDetection: ChangeDetectionStrategy.Default }, c));\n    });\n    var createPipe = makeMetadataFactory('Pipe', function (p) { return (Object.assign({ pure: true }, p)); });\n    var createInput = makeMetadataFactory('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });\n    var createOutput = makeMetadataFactory('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });\n    var createHostBinding = makeMetadataFactory('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });\n    var createHostListener = makeMetadataFactory('HostListener', function (eventName, args) { return ({ eventName: eventName, args: args }); });\n    var createNgModule = makeMetadataFactory('NgModule', function (ngModule) { return ngModule; });\n    var createInjectable = makeMetadataFactory('Injectable', function (injectable) {\n        if (injectable === void 0) { injectable = {}; }\n        return injectable;\n    });\n    var CUSTOM_ELEMENTS_SCHEMA = {\n        name: 'custom-elements'\n    };\n    var NO_ERRORS_SCHEMA = {\n        name: 'no-errors-schema'\n    };\n    var createOptional = makeMetadataFactory('Optional');\n    var createSelf = makeMetadataFactory('Self');\n    var createSkipSelf = makeMetadataFactory('SkipSelf');\n    var createHost = makeMetadataFactory('Host');\n    var Type = Function;\n    var SecurityContext;\n    (function (SecurityContext) {\n        SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n        SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n        SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n        SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n        SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n        SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n    })(SecurityContext || (SecurityContext = {}));\n    var MissingTranslationStrategy;\n    (function (MissingTranslationStrategy) {\n        MissingTranslationStrategy[MissingTranslationStrategy[\"Error\"] = 0] = \"Error\";\n        MissingTranslationStrategy[MissingTranslationStrategy[\"Warning\"] = 1] = \"Warning\";\n        MissingTranslationStrategy[MissingTranslationStrategy[\"Ignore\"] = 2] = \"Ignore\";\n    })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));\n    function makeMetadataFactory(name, props) {\n        // This must be declared as a function, not a fat arrow, so that ES2015 devmode produces code\n        // that works with the static_reflector.ts in the ViewEngine compiler.\n        // In particular, `_registerDecoratorOrConstructor` assumes that the value returned here can be\n        // new'ed.\n        function factory() {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            var values = props ? props.apply(void 0, __spreadArray([], __read(args))) : {};\n            return Object.assign({ ngMetadataName: name }, values);\n        }\n        factory.isTypeOf = function (obj) { return obj && obj.ngMetadataName === name; };\n        factory.ngMetadataName = name;\n        return factory;\n    }\n    function parserSelectorToSimpleSelector(selector) {\n        var classes = selector.classNames && selector.classNames.length ? __spreadArray([8 /* CLASS */], __read(selector.classNames)) :\n            [];\n        var elementName = selector.element && selector.element !== '*' ? selector.element : '';\n        return __spreadArray(__spreadArray([elementName], __read(selector.attrs)), __read(classes));\n    }\n    function parserSelectorToNegativeSelector(selector) {\n        var classes = selector.classNames && selector.classNames.length ? __spreadArray([8 /* CLASS */], __read(selector.classNames)) :\n            [];\n        if (selector.element) {\n            return __spreadArray(__spreadArray([\n                1 /* NOT */ | 4 /* ELEMENT */, selector.element\n            ], __read(selector.attrs)), __read(classes));\n        }\n        else if (selector.attrs.length) {\n            return __spreadArray(__spreadArray([1 /* NOT */ | 2 /* ATTRIBUTE */], __read(selector.attrs)), __read(classes));\n        }\n        else {\n            return selector.classNames && selector.classNames.length ? __spreadArray([1 /* NOT */ | 8 /* CLASS */], __read(selector.classNames)) :\n                [];\n        }\n    }\n    function parserSelectorToR3Selector(selector) {\n        var positive = parserSelectorToSimpleSelector(selector);\n        var negative = selector.notSelectors && selector.notSelectors.length ?\n            selector.notSelectors.map(function (notSelector) { return parserSelectorToNegativeSelector(notSelector); }) :\n            [];\n        return positive.concat.apply(positive, __spreadArray([], __read(negative)));\n    }\n    function parseSelectorToR3Selector(selector) {\n        return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];\n    }\n\n    var core = /*#__PURE__*/Object.freeze({\n        __proto__: null,\n        createInject: createInject,\n        createInjectionToken: createInjectionToken,\n        createAttribute: createAttribute,\n        emitDistinctChangesOnlyDefaultValue: emitDistinctChangesOnlyDefaultValue,\n        createContentChildren: createContentChildren,\n        createContentChild: createContentChild,\n        createViewChildren: createViewChildren,\n        createViewChild: createViewChild,\n        createDirective: createDirective,\n        get ViewEncapsulation () { return ViewEncapsulation; },\n        get ChangeDetectionStrategy () { return ChangeDetectionStrategy; },\n        createComponent: createComponent,\n        createPipe: createPipe,\n        createInput: createInput,\n        createOutput: createOutput,\n        createHostBinding: createHostBinding,\n        createHostListener: createHostListener,\n        createNgModule: createNgModule,\n        createInjectable: createInjectable,\n        CUSTOM_ELEMENTS_SCHEMA: CUSTOM_ELEMENTS_SCHEMA,\n        NO_ERRORS_SCHEMA: NO_ERRORS_SCHEMA,\n        createOptional: createOptional,\n        createSelf: createSelf,\n        createSkipSelf: createSkipSelf,\n        createHost: createHost,\n        Type: Type,\n        get SecurityContext () { return SecurityContext; },\n        get MissingTranslationStrategy () { return MissingTranslationStrategy; },\n        parseSelectorToR3Selector: parseSelectorToR3Selector\n    });\n\n    /**\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://angular.io/license\n     */\n    //// Types\n    var TypeModifier;\n    (function (TypeModifier) {\n        TypeModifier[TypeModifier[\"Const\"] = 0] = \"Const\";\n    })(TypeModifier || (TypeModifier = {}));\n    var Type$1 = /** @class */ (function () {\n        function Type(modifiers) {\n            if (modifiers === void 0) { modifiers = []; }\n            this.modifiers = modifiers;\n        }\n        Type.prototype.hasModifier = function (modifier) {\n            return this.modifiers.indexOf(modifier) !== -1;\n        };\n        return Type;\n    }());\n    (function (BuiltinTypeName) {\n        BuiltinTypeName[BuiltinTypeName[\"Dynamic\"] = 0] = \"Dynamic\";\n        BuiltinTypeName[BuiltinTypeName[\"Bool\"] = 1] = \"Bool\";\n        BuiltinTypeName[BuiltinTypeName[\"String\"] = 2] = \"String\";\n        BuiltinTypeName[BuiltinTypeName[\"Int\"] = 3] = \"Int\";\n        BuiltinTypeName[BuiltinTypeName[\"Number\"] = 4] = \"Number\";\n        BuiltinTypeName[BuiltinTypeName[\"Function\"] = 5] = \"Function\";\n        BuiltinTypeName[BuiltinTypeName[\"Inferred\"] = 6] = \"Inferred\";\n        BuiltinTypeName[BuiltinTypeName[\"None\"] = 7] = \"None\";\n    })(exports.BuiltinTypeName || (exports.BuiltinTypeName = {}));\n    var BuiltinType = /** @class */ (function (_super) {\n        __extends(BuiltinType, _super);\n        function BuiltinType(name, modifiers) {\n            var _this = _super.call(this, modifiers) || this;\n            _this.name = name;\n            return _this;\n        }\n        BuiltinType.prototype.visitType = function (visitor, context) {\n            return visitor.visitBuiltinType(this, context);\n        };\n        return BuiltinType;\n    }(Type$1));\n    var ExpressionType = /** @class */ (function (_super) {\n        __extends(ExpressionType, _super);\n        function ExpressionType(value, modifiers, typeParams) {\n            if (typeParams === void 0) { typeParams = null; }\n            var _this = _super.call(this, modifiers) || this;\n            _this.value = value;\n            _this.typeParams = typeParams;\n            return _this;\n        }\n        ExpressionType.prototype.visitType = function (visitor, context) {\n            return visitor.visitExpressionType(this, context);\n        };\n        return ExpressionType;\n    }(Type$1));\n    var ArrayType = /** @class */ (function (_super) {\n        __extends(ArrayType, _super);\n        function ArrayType(of, modifiers) {\n            var _this = _super.call(this, modifiers) || this;\n            _this.of = of;\n            return _this;\n        }\n        ArrayType.prototype.visitType = function (visitor, context) {\n            return visitor.visitArrayType(this, context);\n        };\n        return ArrayType;\n    }(Type$1));\n    var MapType = /** @class */ (function (_super) {\n        __extends(MapType, _super);\n        function MapType(valueType, modifiers) {\n            var _this = _super.call(this, modifiers) || this;\n            _this.valueType = valueType || null;\n            return _this;\n        }\n        MapType.prototype.visitType = function (visitor, context) {\n            return visitor.visitMapType(this, context);\n        };\n        return MapType;\n    }(Type$1));\n    var DYNAMIC_TYPE = new BuiltinType(exports.BuiltinTypeName.Dynamic);\n    var INFERRED_TYPE = new BuiltinType(exports.BuiltinTypeName.Inferred);\n    var BOOL_TYPE = new BuiltinType(exports.BuiltinTypeName.Bool);\n    var INT_TYPE = new BuiltinType(exports.BuiltinTypeName.Int);\n    var NUMBER_TYPE = new BuiltinType(exports.BuiltinTypeName.Number);\n    var STRING_TYPE = new BuiltinType(exports.BuiltinTypeName.String);\n    var FUNCTION_TYPE = new BuiltinType(exports.BuiltinTypeName.Function);\n    var NONE_TYPE = new BuiltinType(exports.BuiltinTypeName.None);\n    (function (UnaryOperator) {\n        UnaryOperator[UnaryOperator[\"Minus\"] = 0] = \"Minus\";\n        UnaryOperator[UnaryOperator[\"Plus\"] = 1] = \"Plus\";\n    })(exports.UnaryOperator || (exports.UnaryOperator = {}));\n    (function (BinaryOperator) {\n        BinaryOperator[BinaryOperator[\"Equals\"] = 0] = \"Equals\";\n        BinaryOperator[BinaryOperator[\"NotEquals\"] = 1] = \"NotEquals\";\n        BinaryOperator[BinaryOperator[\"Identical\"] = 2] = \"Identical\";\n        BinaryOperator[BinaryOperator[\"NotIdentical\"] = 3] = \"NotIdentical\";\n        BinaryOperator[BinaryOperator[\"Minus\"] = 4] = \"Minus\";\n        BinaryOperator[BinaryOperator[\"Plus\"] = 5] = \"Plus\";\n        BinaryOperator[BinaryOperator[\"Divide\"] = 6] = \"Divide\";\n        BinaryOperator[BinaryOperator[\"Multiply\"] = 7] = \"Multiply\";\n        BinaryOperator[BinaryOperator[\"Modulo\"] = 8] = \"Modulo\";\n        BinaryOperator[BinaryOperator[\"And\"] = 9] = \"And\";\n        BinaryOperator[BinaryOperator[\"Or\"] = 10] = \"Or\";\n        BinaryOperator[BinaryOperator[\"BitwiseAnd\"] = 11] = \"BitwiseAnd\";\n        BinaryOperator[BinaryOperator[\"Lower\"] = 12] = \"Lower\";\n        BinaryOperator[BinaryOperator[\"LowerEquals\"] = 13] = \"LowerEquals\";\n        BinaryOperator[BinaryOperator[\"Bigger\"] = 14] = \"Bigger\";\n        BinaryOperator[BinaryOperator[\"BiggerEquals\"] = 15] = \"BiggerEquals\";\n        BinaryOperator[BinaryOperator[\"NullishCoalesce\"] = 16] = \"NullishCoalesce\";\n    })(exports.BinaryOperator || (exports.BinaryOperator = {}));\n    function nullSafeIsEquivalent(base, other) {\n        if (base == null || other == null) {\n            return base == other;\n        }\n        return base.isEquivalent(other);\n    }\n    function areAllEquivalentPredicate(base, other, equivalentPredicate) {\n        var len = base.length;\n        if (len !== other.length) {\n            return false;\n        }\n        for (var i = 0; i < len; i++) {\n            if (!equivalentPredicate(base[i], other[i])) {\n                return false;\n            }\n        }\n        return true;\n    }\n    function areAllEquivalent(base, other) {\n        return areAllEquivalentPredicate(base, other, function (baseElement, otherElement) { return baseElement.isEquivalent(otherElement); });\n    }\n    var Expression = /** @class */ (function () {\n        function Expression(type, sourceSpan) {\n            this.type = type || null;\n            this.sourceSpan = sourceSpan || null;\n        }\n        Expression.prototype.prop = function (name, sourceSpan) {\n            return new ReadPropExpr(this, name, null, sourceSpan);\n        };\n        Expression.prototype.key = function (index, type, sourceSpan) {\n            return new ReadKeyExpr(this, index, type, sourceSpan);\n        };\n        Expression.prototype.callMethod = function (name, params, sourceSpan) {\n            return new InvokeMethodExpr(this, name, params, null, sourceSpan);\n        };\n        Expression.prototype.callFn = function (params, sourceSpan, pure) {\n            return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);\n        };\n        Expression.prototype.instantiate = function (params, type, sourceSpan) {\n            return new InstantiateExpr(this, params, type, sourceSpan);\n        };\n        Expression.prototype.conditional = function (trueCase, falseCase, sourceSpan) {\n            if (falseCase === void 0) { falseCase = null; }\n            return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);\n        };\n        Expression.prototype.equals = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Equals, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.notEquals = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.NotEquals, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.identical = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Identical, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.notIdentical = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.minus = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Minus, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.plus = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Plus, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.divide = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Divide, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.multiply = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Multiply, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.modulo = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Modulo, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.and = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.And, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.bitwiseAnd = function (rhs, sourceSpan, parens) {\n            if (parens === void 0) { parens = true; }\n            return new BinaryOperatorExpr(exports.BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan, parens);\n        };\n        Expression.prototype.or = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Or, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.lower = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Lower, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.lowerEquals = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.bigger = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.Bigger, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.biggerEquals = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.isBlank = function (sourceSpan) {\n            // Note: We use equals by purpose here to compare to null and undefined in JS.\n            // We use the typed null to allow strictNullChecks to narrow types.\n            return this.equals(TYPED_NULL_EXPR, sourceSpan);\n        };\n        Expression.prototype.cast = function (type, sourceSpan) {\n            return new CastExpr(this, type, sourceSpan);\n        };\n        Expression.prototype.nullishCoalesce = function (rhs, sourceSpan) {\n            return new BinaryOperatorExpr(exports.BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);\n        };\n        Expression.prototype.toStmt = function () {\n            return new ExpressionStatement(this, null);\n        };\n        return Expression;\n    }());\n    (function (BuiltinVar) {\n        BuiltinVar[BuiltinVar[\"This\"] = 0] = \"This\";\n        BuiltinVar[BuiltinVar[\"Super\"] = 1] = \"Super\";\n        BuiltinVar[BuiltinVar[\"CatchError\"] = 2] = \"CatchError\";\n        BuiltinVar[BuiltinVar[\"CatchStack\"] = 3] = \"CatchStack\";\n    })(exports.BuiltinVar || (exports.BuiltinVar = {}));\n    var ReadVarExpr = /** @class */ (function (_super) {\n        __extends(ReadVarExpr, _super);\n        function ReadVarExpr(name, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            if (typeof name === 'string') {\n                _this.name = name;\n                _this.builtin = null;\n            }\n            else {\n                _this.name = null;\n                _this.builtin = name;\n            }\n            return _this;\n        }\n        ReadVarExpr.prototype.isEquivalent = function (e) {\n            return e instanceof ReadVarExpr && this.name === e.name && this.builtin === e.builtin;\n        };\n        ReadVarExpr.prototype.isConstant = function () {\n            return false;\n        };\n        ReadVarExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitReadVarExpr(this, context);\n        };\n        ReadVarExpr.prototype.set = function (value) {\n            if (!this.name) {\n                throw new Error(\"Built in variable \" + this.builtin + \" can not be assigned to.\");\n            }\n            return new WriteVarExpr(this.name, value, null, this.sourceSpan);\n        };\n        return ReadVarExpr;\n    }(Expression));\n    var TypeofExpr = /** @class */ (function (_super) {\n        __extends(TypeofExpr, _super);\n        function TypeofExpr(expr, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.expr = expr;\n            return _this;\n        }\n        TypeofExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitTypeofExpr(this, context);\n        };\n        TypeofExpr.prototype.isEquivalent = function (e) {\n            return e instanceof TypeofExpr && e.expr.isEquivalent(this.expr);\n        };\n        TypeofExpr.prototype.isConstant = function () {\n            return this.expr.isConstant();\n        };\n        return TypeofExpr;\n    }(Expression));\n    var WrappedNodeExpr = /** @class */ (function (_super) {\n        __extends(WrappedNodeExpr, _super);\n        function WrappedNodeExpr(node, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.node = node;\n            return _this;\n        }\n        WrappedNodeExpr.prototype.isEquivalent = function (e) {\n            return e instanceof WrappedNodeExpr && this.node === e.node;\n        };\n        WrappedNodeExpr.prototype.isConstant = function () {\n            return false;\n        };\n        WrappedNodeExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitWrappedNodeExpr(this, context);\n        };\n        return WrappedNodeExpr;\n    }(Expression));\n    var WriteVarExpr = /** @class */ (function (_super) {\n        __extends(WriteVarExpr, _super);\n        function WriteVarExpr(name, value, type, sourceSpan) {\n            var _this = _super.call(this, type || value.type, sourceSpan) || this;\n            _this.name = name;\n            _this.value = value;\n            return _this;\n        }\n        WriteVarExpr.prototype.isEquivalent = function (e) {\n            return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);\n        };\n        WriteVarExpr.prototype.isConstant = function () {\n            return false;\n        };\n        WriteVarExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitWriteVarExpr(this, context);\n        };\n        WriteVarExpr.prototype.toDeclStmt = function (type, modifiers) {\n            return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);\n        };\n        WriteVarExpr.prototype.toConstDecl = function () {\n            return this.toDeclStmt(INFERRED_TYPE, [exports.StmtModifier.Final]);\n        };\n        return WriteVarExpr;\n    }(Expression));\n    var WriteKeyExpr = /** @class */ (function (_super) {\n        __extends(WriteKeyExpr, _super);\n        function WriteKeyExpr(receiver, index, value, type, sourceSpan) {\n            var _this = _super.call(this, type || value.type, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.index = index;\n            _this.value = value;\n            return _this;\n        }\n        WriteKeyExpr.prototype.isEquivalent = function (e) {\n            return e instanceof WriteKeyExpr && this.receiver.isEquivalent(e.receiver) &&\n                this.index.isEquivalent(e.index) && this.value.isEquivalent(e.value);\n        };\n        WriteKeyExpr.prototype.isConstant = function () {\n            return false;\n        };\n        WriteKeyExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitWriteKeyExpr(this, context);\n        };\n        return WriteKeyExpr;\n    }(Expression));\n    var WritePropExpr = /** @class */ (function (_super) {\n        __extends(WritePropExpr, _super);\n        function WritePropExpr(receiver, name, value, type, sourceSpan) {\n            var _this = _super.call(this, type || value.type, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            _this.value = value;\n            return _this;\n        }\n        WritePropExpr.prototype.isEquivalent = function (e) {\n            return e instanceof WritePropExpr && this.receiver.isEquivalent(e.receiver) &&\n                this.name === e.name && this.value.isEquivalent(e.value);\n        };\n        WritePropExpr.prototype.isConstant = function () {\n            return false;\n        };\n        WritePropExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitWritePropExpr(this, context);\n        };\n        return WritePropExpr;\n    }(Expression));\n    (function (BuiltinMethod) {\n        BuiltinMethod[BuiltinMethod[\"ConcatArray\"] = 0] = \"ConcatArray\";\n        BuiltinMethod[BuiltinMethod[\"SubscribeObservable\"] = 1] = \"SubscribeObservable\";\n        BuiltinMethod[BuiltinMethod[\"Bind\"] = 2] = \"Bind\";\n    })(exports.BuiltinMethod || (exports.BuiltinMethod = {}));\n    var InvokeMethodExpr = /** @class */ (function (_super) {\n        __extends(InvokeMethodExpr, _super);\n        function InvokeMethodExpr(receiver, method, args, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.args = args;\n            if (typeof method === 'string') {\n                _this.name = method;\n                _this.builtin = null;\n            }\n            else {\n                _this.name = null;\n                _this.builtin = method;\n            }\n            return _this;\n        }\n        InvokeMethodExpr.prototype.isEquivalent = function (e) {\n            return e instanceof InvokeMethodExpr && this.receiver.isEquivalent(e.receiver) &&\n                this.name === e.name && this.builtin === e.builtin && areAllEquivalent(this.args, e.args);\n        };\n        InvokeMethodExpr.prototype.isConstant = function () {\n            return false;\n        };\n        InvokeMethodExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitInvokeMethodExpr(this, context);\n        };\n        return InvokeMethodExpr;\n    }(Expression));\n    var InvokeFunctionExpr = /** @class */ (function (_super) {\n        __extends(InvokeFunctionExpr, _super);\n        function InvokeFunctionExpr(fn, args, type, sourceSpan, pure) {\n            if (pure === void 0) { pure = false; }\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.fn = fn;\n            _this.args = args;\n            _this.pure = pure;\n            return _this;\n        }\n        InvokeFunctionExpr.prototype.isEquivalent = function (e) {\n            return e instanceof InvokeFunctionExpr && this.fn.isEquivalent(e.fn) &&\n                areAllEquivalent(this.args, e.args) && this.pure === e.pure;\n        };\n        InvokeFunctionExpr.prototype.isConstant = function () {\n            return false;\n        };\n        InvokeFunctionExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitInvokeFunctionExpr(this, context);\n        };\n        return InvokeFunctionExpr;\n    }(Expression));\n    var TaggedTemplateExpr = /** @class */ (function (_super) {\n        __extends(TaggedTemplateExpr, _super);\n        function TaggedTemplateExpr(tag, template, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.tag = tag;\n            _this.template = template;\n            return _this;\n        }\n        TaggedTemplateExpr.prototype.isEquivalent = function (e) {\n            return e instanceof TaggedTemplateExpr && this.tag.isEquivalent(e.tag) &&\n                areAllEquivalentPredicate(this.template.elements, e.template.elements, function (a, b) { return a.text === b.text; }) &&\n                areAllEquivalent(this.template.expressions, e.template.expressions);\n        };\n        TaggedTemplateExpr.prototype.isConstant = function () {\n            return false;\n        };\n        TaggedTemplateExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitTaggedTemplateExpr(this, context);\n        };\n        return TaggedTemplateExpr;\n    }(Expression));\n    var InstantiateExpr = /** @class */ (function (_super) {\n        __extends(InstantiateExpr, _super);\n        function InstantiateExpr(classExpr, args, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.classExpr = classExpr;\n            _this.args = args;\n            return _this;\n        }\n        InstantiateExpr.prototype.isEquivalent = function (e) {\n            return e instanceof InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) &&\n                areAllEquivalent(this.args, e.args);\n        };\n        InstantiateExpr.prototype.isConstant = function () {\n            return false;\n        };\n        InstantiateExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitInstantiateExpr(this, context);\n        };\n        return InstantiateExpr;\n    }(Expression));\n    var LiteralExpr = /** @class */ (function (_super) {\n        __extends(LiteralExpr, _super);\n        function LiteralExpr(value, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.value = value;\n            return _this;\n        }\n        LiteralExpr.prototype.isEquivalent = function (e) {\n            return e instanceof LiteralExpr && this.value === e.value;\n        };\n        LiteralExpr.prototype.isConstant = function () {\n            return true;\n        };\n        LiteralExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitLiteralExpr(this, context);\n        };\n        return LiteralExpr;\n    }(Expression));\n    var TemplateLiteral = /** @class */ (function () {\n        function TemplateLiteral(elements, expressions) {\n            this.elements = elements;\n            this.expressions = expressions;\n        }\n        return TemplateLiteral;\n    }());\n    var TemplateLiteralElement = /** @class */ (function () {\n        function TemplateLiteralElement(text, sourceSpan, rawText) {\n            var _a;\n            this.text = text;\n            this.sourceSpan = sourceSpan;\n            // If `rawText` is not provided, try to extract the raw string from its\n            // associated `sourceSpan`. If that is also not available, \"fake\" the raw\n            // string instead by escaping the following control sequences:\n            // - \"\\\" would otherwise indicate that the next character is a control character.\n            // - \"`\" and \"${\" are template string control sequences that would otherwise prematurely\n            // indicate the end of the template literal element.\n            this.rawText =\n                (_a = rawText !== null && rawText !== void 0 ? rawText : sourceSpan === null || sourceSpan === void 0 ? void 0 : sourceSpan.toString()) !== null && _a !== void 0 ? _a : escapeForTemplateLiteral(escapeSlashes(text));\n        }\n        return TemplateLiteralElement;\n    }());\n    var MessagePiece = /** @class */ (function () {\n        function MessagePiece(text, sourceSpan) {\n            this.text = text;\n            this.sourceSpan = sourceSpan;\n        }\n        return MessagePiece;\n    }());\n    var LiteralPiece = /** @class */ (function (_super) {\n        __extends(LiteralPiece, _super);\n        function LiteralPiece() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        return LiteralPiece;\n    }(MessagePiece));\n    var PlaceholderPiece = /** @class */ (function (_super) {\n        __extends(PlaceholderPiece, _super);\n        function PlaceholderPiece() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        return PlaceholderPiece;\n    }(MessagePiece));\n    var LocalizedString = /** @class */ (function (_super) {\n        __extends(LocalizedString, _super);\n        function LocalizedString(metaBlock, messageParts, placeHolderNames, expressions, sourceSpan) {\n            var _this = _super.call(this, STRING_TYPE, sourceSpan) || this;\n            _this.metaBlock = metaBlock;\n            _this.messageParts = messageParts;\n            _this.placeHolderNames = placeHolderNames;\n            _this.expressions = expressions;\n            return _this;\n        }\n        LocalizedString.prototype.isEquivalent = function (e) {\n            // return e instanceof LocalizedString && this.message === e.message;\n            return false;\n        };\n        LocalizedString.prototype.isConstant = function () {\n            return false;\n        };\n        LocalizedString.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitLocalizedString(this, context);\n        };\n        /**\n         * Serialize the given `meta` and `messagePart` into \"cooked\" and \"raw\" strings that can be used\n         * in a `$localize` tagged string. The format of the metadata is the same as that parsed by\n         * `parseI18nMeta()`.\n         *\n         * @param meta The metadata to serialize\n         * @param messagePart The first part of the tagged string\n         */\n        LocalizedString.prototype.serializeI18nHead = function () {\n            var MEANING_SEPARATOR = '|';\n            var ID_SEPARATOR = '@@';\n            var LEGACY_ID_INDICATOR = '␟';\n            var metaBlock = this.metaBlock.description || '';\n            if (this.metaBlock.meaning) {\n                metaBlock = \"\" + this.metaBlock.meaning + MEANING_SEPARATOR + metaBlock;\n            }\n            if (this.metaBlock.customId) {\n                metaBlock = \"\" + metaBlock + ID_SEPARATOR + this.metaBlock.customId;\n            }\n            if (this.metaBlock.legacyIds) {\n                this.metaBlock.legacyIds.forEach(function (legacyId) {\n                    metaBlock = \"\" + metaBlock + LEGACY_ID_INDICATOR + legacyId;\n                });\n            }\n            return createCookedRawString(metaBlock, this.messageParts[0].text, this.getMessagePartSourceSpan(0));\n        };\n        LocalizedString.prototype.getMessagePartSourceSpan = function (i) {\n            var _a, _b;\n            return (_b = (_a = this.messageParts[i]) === null || _a === void 0 ? void 0 : _a.sourceSpan) !== null && _b !== void 0 ? _b : this.sourceSpan;\n        };\n        LocalizedString.prototype.getPlaceholderSourceSpan = function (i) {\n            var _a, _b, _c, _d;\n            return (_d = (_b = (_a = this.placeHolderNames[i]) === null || _a === void 0 ? void 0 : _a.sourceSpan) !== null && _b !== void 0 ? _b : (_c = this.expressions[i]) === null || _c === void 0 ? void 0 : _c.sourceSpan) !== null && _d !== void 0 ? _d : this.sourceSpan;\n        };\n        /**\n         * Serialize the given `placeholderName` and `messagePart` into \"cooked\" and \"raw\" strings that\n         * can be used in a `$localize` tagged string.\n         *\n         * @param placeholderName The placeholder name to serialize\n         * @param messagePart The following message string after this placeholder\n         */\n        LocalizedString.prototype.serializeI18nTemplatePart = function (partIndex) {\n            var placeholderName = this.placeHolderNames[partIndex - 1].text;\n            var messagePart = this.messageParts[partIndex];\n            return createCookedRawString(placeholderName, messagePart.text, this.getMessagePartSourceSpan(partIndex));\n        };\n        return LocalizedString;\n    }(Expression));\n    var escapeSlashes = function (str) { return str.replace(/\\\\/g, '\\\\\\\\'); };\n    var escapeStartingColon = function (str) { return str.replace(/^:/, '\\\\:'); };\n    var escapeColons = function (str) { return str.replace(/:/g, '\\\\:'); };\n    var escapeForTemplateLiteral = function (str) { return str.replace(/`/g, '\\\\`').replace(/\\${/g, '$\\\\{'); };\n    /**\n     * Creates a `{cooked, raw}` object from the `metaBlock` and `messagePart`.\n     *\n     * The `raw` text must have various character sequences escaped:\n     * * \"\\\" would otherwise indicate that the next character is a control character.\n     * * \"`\" and \"${\" are template string control sequences that would otherwise prematurely indicate\n     *   the end of a message part.\n     * * \":\" inside a metablock would prematurely indicate the end of the metablock.\n     * * \":\" at the start of a messagePart with no metablock would erroneously indicate the start of a\n     *   metablock.\n     *\n     * @param metaBlock Any metadata that should be prepended to the string\n     * @param messagePart The message part of the string\n     */\n    function createCookedRawString(metaBlock, messagePart, range) {\n        if (metaBlock === '') {\n            return {\n                cooked: messagePart,\n                raw: escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))),\n                range: range,\n            };\n        }\n        else {\n            return {\n                cooked: \":\" + metaBlock + \":\" + messagePart,\n                raw: escapeForTemplateLiteral(\":\" + escapeColons(escapeSlashes(metaBlock)) + \":\" + escapeSlashes(messagePart)),\n                range: range,\n            };\n        }\n    }\n    var ExternalExpr = /** @class */ (function (_super) {\n        __extends(ExternalExpr, _super);\n        function ExternalExpr(value, type, typeParams, sourceSpan) {\n            if (typeParams === void 0) { typeParams = null; }\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.value = value;\n            _this.typeParams = typeParams;\n            return _this;\n        }\n        ExternalExpr.prototype.isEquivalent = function (e) {\n            return e instanceof ExternalExpr && this.value.name === e.value.name &&\n                this.value.moduleName === e.value.moduleName && this.value.runtime === e.value.runtime;\n        };\n        ExternalExpr.prototype.isConstant = function () {\n            return false;\n        };\n        ExternalExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitExternalExpr(this, context);\n        };\n        return ExternalExpr;\n    }(Expression));\n    var ExternalReference = /** @class */ (function () {\n        function ExternalReference(moduleName, name, runtime) {\n            this.moduleName = moduleName;\n            this.name = name;\n            this.runtime = runtime;\n        }\n        return ExternalReference;\n    }());\n    var ConditionalExpr = /** @class */ (function (_super) {\n        __extends(ConditionalExpr, _super);\n        function ConditionalExpr(condition, trueCase, falseCase, type, sourceSpan) {\n            if (falseCase === void 0) { falseCase = null; }\n            var _this = _super.call(this, type || trueCase.type, sourceSpan) || this;\n            _this.condition = condition;\n            _this.falseCase = falseCase;\n            _this.trueCase = trueCase;\n            return _this;\n        }\n        ConditionalExpr.prototype.isEquivalent = function (e) {\n            return e instanceof ConditionalExpr && this.condition.isEquivalent(e.condition) &&\n                this.trueCase.isEquivalent(e.trueCase) && nullSafeIsEquivalent(this.falseCase, e.falseCase);\n        };\n        ConditionalExpr.prototype.isConstant = function () {\n            return false;\n        };\n        ConditionalExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitConditionalExpr(this, context);\n        };\n        return ConditionalExpr;\n    }(Expression));\n    var NotExpr = /** @class */ (function (_super) {\n        __extends(NotExpr, _super);\n        function NotExpr(condition, sourceSpan) {\n            var _this = _super.call(this, BOOL_TYPE, sourceSpan) || this;\n            _this.condition = condition;\n            return _this;\n        }\n        NotExpr.prototype.isEquivalent = function (e) {\n            return e instanceof NotExpr && this.condition.isEquivalent(e.condition);\n        };\n        NotExpr.prototype.isConstant = function () {\n            return false;\n        };\n        NotExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitNotExpr(this, context);\n        };\n        return NotExpr;\n    }(Expression));\n    var AssertNotNull = /** @class */ (function (_super) {\n        __extends(AssertNotNull, _super);\n        function AssertNotNull(condition, sourceSpan) {\n            var _this = _super.call(this, condition.type, sourceSpan) || this;\n            _this.condition = condition;\n            return _this;\n        }\n        AssertNotNull.prototype.isEquivalent = function (e) {\n            return e instanceof AssertNotNull && this.condition.isEquivalent(e.condition);\n        };\n        AssertNotNull.prototype.isConstant = function () {\n            return false;\n        };\n        AssertNotNull.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitAssertNotNullExpr(this, context);\n        };\n        return AssertNotNull;\n    }(Expression));\n    var CastExpr = /** @class */ (function (_super) {\n        __extends(CastExpr, _super);\n        function CastExpr(value, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.value = value;\n            return _this;\n        }\n        CastExpr.prototype.isEquivalent = function (e) {\n            return e instanceof CastExpr && this.value.isEquivalent(e.value);\n        };\n        CastExpr.prototype.isConstant = function () {\n            return false;\n        };\n        CastExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitCastExpr(this, context);\n        };\n        return CastExpr;\n    }(Expression));\n    var FnParam = /** @class */ (function () {\n        function FnParam(name, type) {\n            if (type === void 0) { type = null; }\n            this.name = name;\n            this.type = type;\n        }\n        FnParam.prototype.isEquivalent = function (param) {\n            return this.name === param.name;\n        };\n        return FnParam;\n    }());\n    var FunctionExpr = /** @class */ (function (_super) {\n        __extends(FunctionExpr, _super);\n        function FunctionExpr(params, statements, type, sourceSpan, name) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.params = params;\n            _this.statements = statements;\n            _this.name = name;\n            return _this;\n        }\n        FunctionExpr.prototype.isEquivalent = function (e) {\n            return e instanceof FunctionExpr && areAllEquivalent(this.params, e.params) &&\n                areAllEquivalent(this.statements, e.statements);\n        };\n        FunctionExpr.prototype.isConstant = function () {\n            return false;\n        };\n        FunctionExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitFunctionExpr(this, context);\n        };\n        FunctionExpr.prototype.toDeclStmt = function (name, modifiers) {\n            return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);\n        };\n        return FunctionExpr;\n    }(Expression));\n    var UnaryOperatorExpr = /** @class */ (function (_super) {\n        __extends(UnaryOperatorExpr, _super);\n        function UnaryOperatorExpr(operator, expr, type, sourceSpan, parens) {\n            if (parens === void 0) { parens = true; }\n            var _this = _super.call(this, type || NUMBER_TYPE, sourceSpan) || this;\n            _this.operator = operator;\n            _this.expr = expr;\n            _this.parens = parens;\n            return _this;\n        }\n        UnaryOperatorExpr.prototype.isEquivalent = function (e) {\n            return e instanceof UnaryOperatorExpr && this.operator === e.operator &&\n                this.expr.isEquivalent(e.expr);\n        };\n        UnaryOperatorExpr.prototype.isConstant = function () {\n            return false;\n        };\n        UnaryOperatorExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitUnaryOperatorExpr(this, context);\n        };\n        return UnaryOperatorExpr;\n    }(Expression));\n    var BinaryOperatorExpr = /** @class */ (function (_super) {\n        __extends(BinaryOperatorExpr, _super);\n        function BinaryOperatorExpr(operator, lhs, rhs, type, sourceSpan, parens) {\n            if (parens === void 0) { parens = true; }\n            var _this = _super.call(this, type || lhs.type, sourceSpan) || this;\n            _this.operator = operator;\n            _this.rhs = rhs;\n            _this.parens = parens;\n            _this.lhs = lhs;\n            return _this;\n        }\n        BinaryOperatorExpr.prototype.isEquivalent = function (e) {\n            return e instanceof BinaryOperatorExpr && this.operator === e.operator &&\n                this.lhs.isEquivalent(e.lhs) && this.rhs.isEquivalent(e.rhs);\n        };\n        BinaryOperatorExpr.prototype.isConstant = function () {\n            return false;\n        };\n        BinaryOperatorExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitBinaryOperatorExpr(this, context);\n        };\n        return BinaryOperatorExpr;\n    }(Expression));\n    var ReadPropExpr = /** @class */ (function (_super) {\n        __extends(ReadPropExpr, _super);\n        function ReadPropExpr(receiver, name, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            return _this;\n        }\n        ReadPropExpr.prototype.isEquivalent = function (e) {\n            return e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) &&\n                this.name === e.name;\n        };\n        ReadPropExpr.prototype.isConstant = function () {\n            return false;\n        };\n        ReadPropExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitReadPropExpr(this, context);\n        };\n        ReadPropExpr.prototype.set = function (value) {\n            return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan);\n        };\n        return ReadPropExpr;\n    }(Expression));\n    var ReadKeyExpr = /** @class */ (function (_super) {\n        __extends(ReadKeyExpr, _super);\n        function ReadKeyExpr(receiver, index, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.index = index;\n            return _this;\n        }\n        ReadKeyExpr.prototype.isEquivalent = function (e) {\n            return e instanceof ReadKeyExpr && this.receiver.isEquivalent(e.receiver) &&\n                this.index.isEquivalent(e.index);\n        };\n        ReadKeyExpr.prototype.isConstant = function () {\n            return false;\n        };\n        ReadKeyExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitReadKeyExpr(this, context);\n        };\n        ReadKeyExpr.prototype.set = function (value) {\n            return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan);\n        };\n        return ReadKeyExpr;\n    }(Expression));\n    var LiteralArrayExpr = /** @class */ (function (_super) {\n        __extends(LiteralArrayExpr, _super);\n        function LiteralArrayExpr(entries, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.entries = entries;\n            return _this;\n        }\n        LiteralArrayExpr.prototype.isConstant = function () {\n            return this.entries.every(function (e) { return e.isConstant(); });\n        };\n        LiteralArrayExpr.prototype.isEquivalent = function (e) {\n            return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);\n        };\n        LiteralArrayExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitLiteralArrayExpr(this, context);\n        };\n        return LiteralArrayExpr;\n    }(Expression));\n    var LiteralMapEntry = /** @class */ (function () {\n        function LiteralMapEntry(key, value, quoted) {\n            this.key = key;\n            this.value = value;\n            this.quoted = quoted;\n        }\n        LiteralMapEntry.prototype.isEquivalent = function (e) {\n            return this.key === e.key && this.value.isEquivalent(e.value);\n        };\n        return LiteralMapEntry;\n    }());\n    var LiteralMapExpr = /** @class */ (function (_super) {\n        __extends(LiteralMapExpr, _super);\n        function LiteralMapExpr(entries, type, sourceSpan) {\n            var _this = _super.call(this, type, sourceSpan) || this;\n            _this.entries = entries;\n            _this.valueType = null;\n            if (type) {\n                _this.valueType = type.valueType;\n            }\n            return _this;\n        }\n        LiteralMapExpr.prototype.isEquivalent = function (e) {\n            return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries);\n        };\n        LiteralMapExpr.prototype.isConstant = function () {\n            return this.entries.every(function (e) { return e.value.isConstant(); });\n        };\n        LiteralMapExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitLiteralMapExpr(this, context);\n        };\n        return LiteralMapExpr;\n    }(Expression));\n    var CommaExpr = /** @class */ (function (_super) {\n        __extends(CommaExpr, _super);\n        function CommaExpr(parts, sourceSpan) {\n            var _this = _super.call(this, parts[parts.length - 1].type, sourceSpan) || this;\n            _this.parts = parts;\n            return _this;\n        }\n        CommaExpr.prototype.isEquivalent = function (e) {\n            return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts);\n        };\n        CommaExpr.prototype.isConstant = function () {\n            return false;\n        };\n        CommaExpr.prototype.visitExpression = function (visitor, context) {\n            return visitor.visitCommaExpr(this, context);\n        };\n        return CommaExpr;\n    }(Expression));\n    var THIS_EXPR = new ReadVarExpr(exports.BuiltinVar.This, null, null);\n    var SUPER_EXPR = new ReadVarExpr(exports.BuiltinVar.Super, null, null);\n    var CATCH_ERROR_VAR = new ReadVarExpr(exports.BuiltinVar.CatchError, null, null);\n    var CATCH_STACK_VAR = new ReadVarExpr(exports.BuiltinVar.CatchStack, null, null);\n    var NULL_EXPR = new LiteralExpr(null, null, null);\n    var TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);\n    (function (StmtModifier) {\n        StmtModifier[StmtModifier[\"Final\"] = 0] = \"Final\";\n        StmtModifier[StmtModifier[\"Private\"] = 1] = \"Private\";\n        StmtModifier[StmtModifier[\"Exported\"] = 2] = \"Exported\";\n        StmtModifier[StmtModifier[\"Static\"] = 3] = \"Static\";\n    })(exports.StmtModifier || (exports.StmtModifier = {}));\n    var LeadingComment = /** @class */ (function () {\n        function LeadingComment(text, multiline, trailingNewline) {\n            this.text = text;\n            this.multiline = multiline;\n            this.trailingNewline = trailingNewline;\n        }\n        LeadingComment.prototype.toString = function () {\n            return this.multiline ? \" \" + this.text + \" \" : this.text;\n        };\n        return LeadingComment;\n    }());\n    var JSDocComment = /** @class */ (function (_super) {\n        __extends(JSDocComment, _super);\n        function JSDocComment(tags) {\n            var _this = _super.call(this, '', /* multiline */ true, /* trailingNewline */ true) || this;\n            _this.tags = tags;\n            return _this;\n        }\n        JSDocComment.prototype.toString = function () {\n            return serializeTags(this.tags);\n        };\n        return JSDocComment;\n    }(LeadingComment));\n    var Statement = /** @class */ (function () {\n        function Statement(modifiers, sourceSpan, leadingComments) {\n            if (modifiers === void 0) { modifiers = []; }\n            if (sourceSpan === void 0) { sourceSpan = null; }\n            this.modifiers = modifiers;\n            this.sourceSpan = sourceSpan;\n            this.leadingComments = leadingComments;\n        }\n        Statement.prototype.hasModifier = function (modifier) {\n            return this.modifiers.indexOf(modifier) !== -1;\n        };\n        Statement.prototype.addLeadingComment = function (leadingComment) {\n            var _a;\n            this.leadingComments = (_a = this.leadingComments) !== null && _a !== void 0 ? _a : [];\n            this.leadingComments.push(leadingComment);\n        };\n        return Statement;\n    }());\n    var DeclareVarStmt = /** @class */ (function (_super) {\n        __extends(DeclareVarStmt, _super);\n        function DeclareVarStmt(name, value, type, modifiers, sourceSpan, leadingComments) {\n            var _this = _super.call(this, modifiers, sourceSpan, leadingComments) || this;\n            _this.name = name;\n            _this.value = value;\n            _this.type = type || (value && value.type) || null;\n            return _this;\n        }\n        DeclareVarStmt.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof DeclareVarStmt && this.name === stmt.name &&\n                (this.value ? !!stmt.value && this.value.isEquivalent(stmt.value) : !stmt.value);\n        };\n        DeclareVarStmt.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitDeclareVarStmt(this, context);\n        };\n        return DeclareVarStmt;\n    }(Statement));\n    var DeclareFunctionStmt = /** @class */ (function (_super) {\n        __extends(DeclareFunctionStmt, _super);\n        function DeclareFunctionStmt(name, params, statements, type, modifiers, sourceSpan, leadingComments) {\n            var _this = _super.call(this, modifiers, sourceSpan, leadingComments) || this;\n            _this.name = name;\n            _this.params = params;\n            _this.statements = statements;\n            _this.type = type || null;\n            return _this;\n        }\n        DeclareFunctionStmt.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof DeclareFunctionStmt && areAllEquivalent(this.params, stmt.params) &&\n                areAllEquivalent(this.statements, stmt.statements);\n        };\n        DeclareFunctionStmt.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitDeclareFunctionStmt(this, context);\n        };\n        return DeclareFunctionStmt;\n    }(Statement));\n    var ExpressionStatement = /** @class */ (function (_super) {\n        __extends(ExpressionStatement, _super);\n        function ExpressionStatement(expr, sourceSpan, leadingComments) {\n            var _this = _super.call(this, [], sourceSpan, leadingComments) || this;\n            _this.expr = expr;\n            return _this;\n        }\n        ExpressionStatement.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);\n        };\n        ExpressionStatement.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitExpressionStmt(this, context);\n        };\n        return ExpressionStatement;\n    }(Statement));\n    var ReturnStatement = /** @class */ (function (_super) {\n        __extends(ReturnStatement, _super);\n        function ReturnStatement(value, sourceSpan, leadingComments) {\n            if (sourceSpan === void 0) { sourceSpan = null; }\n            var _this = _super.call(this, [], sourceSpan, leadingComments) || this;\n            _this.value = value;\n            return _this;\n        }\n        ReturnStatement.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value);\n        };\n        ReturnStatement.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitReturnStmt(this, context);\n        };\n        return ReturnStatement;\n    }(Statement));\n    var AbstractClassPart = /** @class */ (function () {\n        function AbstractClassPart(type, modifiers) {\n            if (type === void 0) { type = null; }\n            if (modifiers === void 0) { modifiers = []; }\n            this.type = type;\n            this.modifiers = modifiers;\n        }\n        AbstractClassPart.prototype.hasModifier = function (modifier) {\n            return this.modifiers.indexOf(modifier) !== -1;\n        };\n        return AbstractClassPart;\n    }());\n    var ClassField = /** @class */ (function (_super) {\n        __extends(ClassField, _super);\n        function ClassField(name, type, modifiers, initializer) {\n            var _this = _super.call(this, type, modifiers) || this;\n            _this.name = name;\n            _this.initializer = initializer;\n            return _this;\n        }\n        ClassField.prototype.isEquivalent = function (f) {\n            return this.name === f.name;\n        };\n        return ClassField;\n    }(AbstractClassPart));\n    var ClassMethod = /** @class */ (function (_super) {\n        __extends(ClassMethod, _super);\n        function ClassMethod(name, params, body, type, modifiers) {\n            var _this = _super.call(this, type, modifiers) || this;\n            _this.name = name;\n            _this.params = params;\n            _this.body = body;\n            return _this;\n        }\n        ClassMethod.prototype.isEquivalent = function (m) {\n            return this.name === m.name && areAllEquivalent(this.body, m.body);\n        };\n        return ClassMethod;\n    }(AbstractClassPart));\n    var ClassGetter = /** @class */ (function (_super) {\n        __extends(ClassGetter, _super);\n        function ClassGetter(name, body, type, modifiers) {\n            var _this = _super.call(this, type, modifiers) || this;\n            _this.name = name;\n            _this.body = body;\n            return _this;\n        }\n        ClassGetter.prototype.isEquivalent = function (m) {\n            return this.name === m.name && areAllEquivalent(this.body, m.body);\n        };\n        return ClassGetter;\n    }(AbstractClassPart));\n    var ClassStmt = /** @class */ (function (_super) {\n        __extends(ClassStmt, _super);\n        function ClassStmt(name, parent, fields, getters, constructorMethod, methods, modifiers, sourceSpan, leadingComments) {\n            var _this = _super.call(this, modifiers, sourceSpan, leadingComments) || this;\n            _this.name = name;\n            _this.parent = parent;\n            _this.fields = fields;\n            _this.getters = getters;\n            _this.constructorMethod = constructorMethod;\n            _this.methods = methods;\n            return _this;\n        }\n        ClassStmt.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof ClassStmt && this.name === stmt.name &&\n                nullSafeIsEquivalent(this.parent, stmt.parent) &&\n                areAllEquivalent(this.fields, stmt.fields) &&\n                areAllEquivalent(this.getters, stmt.getters) &&\n                this.constructorMethod.isEquivalent(stmt.constructorMethod) &&\n                areAllEquivalent(this.methods, stmt.methods);\n        };\n        ClassStmt.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitDeclareClassStmt(this, context);\n        };\n        return ClassStmt;\n    }(Statement));\n    var IfStmt = /** @class */ (function (_super) {\n        __extends(IfStmt, _super);\n        function IfStmt(condition, trueCase, falseCase, sourceSpan, leadingComments) {\n            if (falseCase === void 0) { falseCase = []; }\n            var _this = _super.call(this, [], sourceSpan, leadingComments) || this;\n            _this.condition = condition;\n            _this.trueCase = trueCase;\n            _this.falseCase = falseCase;\n            return _this;\n        }\n        IfStmt.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof IfStmt && this.condition.isEquivalent(stmt.condition) &&\n                areAllEquivalent(this.trueCase, stmt.trueCase) &&\n                areAllEquivalent(this.falseCase, stmt.falseCase);\n        };\n        IfStmt.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitIfStmt(this, context);\n        };\n        return IfStmt;\n    }(Statement));\n    var TryCatchStmt = /** @class */ (function (_super) {\n        __extends(TryCatchStmt, _super);\n        function TryCatchStmt(bodyStmts, catchStmts, sourceSpan, leadingComments) {\n            if (sourceSpan === void 0) { sourceSpan = null; }\n            var _this = _super.call(this, [], sourceSpan, leadingComments) || this;\n            _this.bodyStmts = bodyStmts;\n            _this.catchStmts = catchStmts;\n            return _this;\n        }\n        TryCatchStmt.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof TryCatchStmt && areAllEquivalent(this.bodyStmts, stmt.bodyStmts) &&\n                areAllEquivalent(this.catchStmts, stmt.catchStmts);\n        };\n        TryCatchStmt.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitTryCatchStmt(this, context);\n        };\n        return TryCatchStmt;\n    }(Statement));\n    var ThrowStmt = /** @class */ (function (_super) {\n        __extends(ThrowStmt, _super);\n        function ThrowStmt(error, sourceSpan, leadingComments) {\n            if (sourceSpan === void 0) { sourceSpan = null; }\n            var _this = _super.call(this, [], sourceSpan, leadingComments) || this;\n            _this.error = error;\n            return _this;\n        }\n        ThrowStmt.prototype.isEquivalent = function (stmt) {\n            return stmt instanceof TryCatchStmt && this.error.isEquivalent(stmt.error);\n        };\n        ThrowStmt.prototype.visitStatement = function (visitor, context) {\n            return visitor.visitThrowStmt(this, context);\n        };\n        return ThrowStmt;\n    }(Statement));\n    var AstTransformer = /** @class */ (function () {\n        function AstTransformer() {\n        }\n        AstTransformer.prototype.transformExpr = function (expr, context) {\n            return expr;\n        };\n        AstTransformer.prototype.transformStmt = function (stmt, context) {\n            return stmt;\n        };\n        AstTransformer.prototype.visitReadVarExpr = function (ast, context) {\n            return this.transformExpr(ast, context);\n        };\n        AstTransformer.prototype.visitWrappedNodeExpr = function (ast, context) {\n            return this.transformExpr(ast, context);\n        };\n        AstTransformer.prototype.visitTypeofExpr = function (expr, context) {\n            return this.transformExpr(new TypeofExpr(expr.expr.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitWriteVarExpr = function (expr, context) {\n            return this.transformExpr(new WriteVarExpr(expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitWriteKeyExpr = function (expr, context) {\n            return this.transformExpr(new WriteKeyExpr(expr.receiver.visitExpression(this, context), expr.index.visitExpression(this, context), expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitWritePropExpr = function (expr, context) {\n            return this.transformExpr(new WritePropExpr(expr.receiver.visitExpression(this, context), expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitInvokeMethodExpr = function (ast, context) {\n            var method = ast.builtin || ast.name;\n            return this.transformExpr(new InvokeMethodExpr(ast.receiver.visitExpression(this, context), method, this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitInvokeFunctionExpr = function (ast, context) {\n            return this.transformExpr(new InvokeFunctionExpr(ast.fn.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitTaggedTemplateExpr = function (ast, context) {\n            var _this = this;\n            return this.transformExpr(new TaggedTemplateExpr(ast.tag.visitExpression(this, context), new TemplateLiteral(ast.template.elements, ast.template.expressions.map(function (e) { return e.visitExpression(_this, context); })), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitInstantiateExpr = function (ast, context) {\n            return this.transformExpr(new InstantiateExpr(ast.classExpr.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitLiteralExpr = function (ast, context) {\n            return this.transformExpr(ast, context);\n        };\n        AstTransformer.prototype.visitLocalizedString = function (ast, context) {\n            return this.transformExpr(new LocalizedString(ast.metaBlock, ast.messageParts, ast.placeHolderNames, this.visitAllExpressions(ast.expressions, context), ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitExternalExpr = function (ast, context) {\n            return this.transformExpr(ast, context);\n        };\n        AstTransformer.prototype.visitConditionalExpr = function (ast, context) {\n            return this.transformExpr(new ConditionalExpr(ast.condition.visitExpression(this, context), ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitNotExpr = function (ast, context) {\n            return this.transformExpr(new NotExpr(ast.condition.visitExpression(this, context), ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitAssertNotNullExpr = function (ast, context) {\n            return this.transformExpr(new AssertNotNull(ast.condition.visitExpression(this, context), ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitCastExpr = function (ast, context) {\n            return this.transformExpr(new CastExpr(ast.value.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitFunctionExpr = function (ast, context) {\n            return this.transformExpr(new FunctionExpr(ast.params, this.visitAllStatements(ast.statements, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitUnaryOperatorExpr = function (ast, context) {\n            return this.transformExpr(new UnaryOperatorExpr(ast.operator, ast.expr.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitBinaryOperatorExpr = function (ast, context) {\n            return this.transformExpr(new BinaryOperatorExpr(ast.operator, ast.lhs.visitExpression(this, context), ast.rhs.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitReadPropExpr = function (ast, context) {\n            return this.transformExpr(new ReadPropExpr(ast.receiver.visitExpression(this, context), ast.name, ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitReadKeyExpr = function (ast, context) {\n            return this.transformExpr(new ReadKeyExpr(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitLiteralArrayExpr = function (ast, context) {\n            return this.transformExpr(new LiteralArrayExpr(this.visitAllExpressions(ast.entries, context), ast.type, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitLiteralMapExpr = function (ast, context) {\n            var _this = this;\n            var entries = ast.entries.map(function (entry) { return new LiteralMapEntry(entry.key, entry.value.visitExpression(_this, context), entry.quoted); });\n            var mapType = new MapType(ast.valueType);\n            return this.transformExpr(new LiteralMapExpr(entries, mapType, ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitCommaExpr = function (ast, context) {\n            return this.transformExpr(new CommaExpr(this.visitAllExpressions(ast.parts, context), ast.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitAllExpressions = function (exprs, context) {\n            var _this = this;\n            return exprs.map(function (expr) { return expr.visitExpression(_this, context); });\n        };\n        AstTransformer.prototype.visitDeclareVarStmt = function (stmt, context) {\n            var value = stmt.value && stmt.value.visitExpression(this, context);\n            return this.transformStmt(new DeclareVarStmt(stmt.name, value, stmt.type, stmt.modifiers, stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitDeclareFunctionStmt = function (stmt, context) {\n            return this.transformStmt(new DeclareFunctionStmt(stmt.name, stmt.params, this.visitAllStatements(stmt.statements, context), stmt.type, stmt.modifiers, stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitExpressionStmt = function (stmt, context) {\n            return this.transformStmt(new ExpressionStatement(stmt.expr.visitExpression(this, context), stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitReturnStmt = function (stmt, context) {\n            return this.transformStmt(new ReturnStatement(stmt.value.visitExpression(this, context), stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitDeclareClassStmt = function (stmt, context) {\n            var _this = this;\n            var parent = stmt.parent.visitExpression(this, context);\n            var getters = stmt.getters.map(function (getter) { return new ClassGetter(getter.name, _this.visitAllStatements(getter.body, context), getter.type, getter.modifiers); });\n            var ctorMethod = stmt.constructorMethod &&\n                new ClassMethod(stmt.constructorMethod.name, stmt.constructorMethod.params, this.visitAllStatements(stmt.constructorMethod.body, context), stmt.constructorMethod.type, stmt.constructorMethod.modifiers);\n            var methods = stmt.methods.map(function (method) { return new ClassMethod(method.name, method.params, _this.visitAllStatements(method.body, context), method.type, method.modifiers); });\n            return this.transformStmt(new ClassStmt(stmt.name, parent, stmt.fields, getters, ctorMethod, methods, stmt.modifiers, stmt.sourceSpan), context);\n        };\n        AstTransformer.prototype.visitIfStmt = function (stmt, context) {\n            return this.transformStmt(new IfStmt(stmt.condition.visitExpression(this, context), this.visitAllStatements(stmt.trueCase, context), this.visitAllStatements(stmt.falseCase, context), stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitTryCatchStmt = function (stmt, context) {\n            return this.transformStmt(new TryCatchStmt(this.visitAllStatements(stmt.bodyStmts, context), this.visitAllStatements(stmt.catchStmts, context), stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitThrowStmt = function (stmt, context) {\n            return this.transformStmt(new ThrowStmt(stmt.error.visitExpression(this, context), stmt.sourceSpan, stmt.leadingComments), context);\n        };\n        AstTransformer.prototype.visitAllStatements = function (stmts, context) {\n            var _this = this;\n            return stmts.map(function (stmt) { return stmt.visitStatement(_this, context); });\n        };\n        return AstTransformer;\n    }());\n    var RecursiveAstVisitor = /** @class */ (function () {\n        function RecursiveAstVisitor() {\n        }\n        RecursiveAstVisitor.prototype.visitType = function (ast, context) {\n            return ast;\n        };\n        RecursiveAstVisitor.prototype.visitExpression = function (ast, context) {\n            if (ast.type) {\n                ast.type.visitType(this, context);\n            }\n            return ast;\n        };\n        RecursiveAstVisitor.prototype.visitBuiltinType = function (type, context) {\n            return this.visitType(type, context);\n        };\n        RecursiveAstVisitor.prototype.visitExpressionType = function (type, context) {\n            var _this = this;\n            type.value.visitExpression(this, context);\n            if (type.typeParams !== null) {\n                type.typeParams.forEach(function (param) { return _this.visitType(param, context); });\n            }\n            return this.visitType(type, context);\n        };\n        RecursiveAstVisitor.prototype.visitArrayType = function (type, context) {\n            return this.visitType(type, context);\n        };\n        RecursiveAstVisitor.prototype.visitMapType = function (type, context) {\n            return this.visitType(type, context);\n        };\n        RecursiveAstVisitor.prototype.visitWrappedNodeExpr = function (ast, context) {\n            return ast;\n        };\n        RecursiveAstVisitor.prototype.visitTypeofExpr = function (ast, context) {\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitReadVarExpr = function (ast, context) {\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitWriteVarExpr = function (ast, context) {\n            ast.value.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitWriteKeyExpr = function (ast, context) {\n            ast.receiver.visitExpression(this, context);\n            ast.index.visitExpression(this, context);\n            ast.value.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitWritePropExpr = function (ast, context) {\n            ast.receiver.visitExpression(this, context);\n            ast.value.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitInvokeMethodExpr = function (ast, context) {\n            ast.receiver.visitExpression(this, context);\n            this.visitAllExpressions(ast.args, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitInvokeFunctionExpr = function (ast, context) {\n            ast.fn.visitExpression(this, context);\n            this.visitAllExpressions(ast.args, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitTaggedTemplateExpr = function (ast, context) {\n            ast.tag.visitExpression(this, context);\n            this.visitAllExpressions(ast.template.expressions, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitInstantiateExpr = function (ast, context) {\n            ast.classExpr.visitExpression(this, context);\n            this.visitAllExpressions(ast.args, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitLiteralExpr = function (ast, context) {\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitLocalizedString = function (ast, context) {\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitExternalExpr = function (ast, context) {\n            var _this = this;\n            if (ast.typeParams) {\n                ast.typeParams.forEach(function (type) { return type.visitType(_this, context); });\n            }\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitConditionalExpr = function (ast, context) {\n            ast.condition.visitExpression(this, context);\n            ast.trueCase.visitExpression(this, context);\n            ast.falseCase.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitNotExpr = function (ast, context) {\n            ast.condition.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitAssertNotNullExpr = function (ast, context) {\n            ast.condition.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitCastExpr = function (ast, context) {\n            ast.value.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitFunctionExpr = function (ast, context) {\n            this.visitAllStatements(ast.statements, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitUnaryOperatorExpr = function (ast, context) {\n            ast.expr.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitBinaryOperatorExpr = function (ast, context) {\n            ast.lhs.visitExpression(this, context);\n            ast.rhs.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitReadPropExpr = function (ast, context) {\n            ast.receiver.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitReadKeyExpr = function (ast, context) {\n            ast.receiver.visitExpression(this, context);\n            ast.index.visitExpression(this, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitLiteralArrayExpr = function (ast, context) {\n            this.visitAllExpressions(ast.entries, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitLiteralMapExpr = function (ast, context) {\n            var _this = this;\n            ast.entries.forEach(function (entry) { return entry.value.visitExpression(_this, context); });\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitCommaExpr = function (ast, context) {\n            this.visitAllExpressions(ast.parts, context);\n            return this.visitExpression(ast, context);\n        };\n        RecursiveAstVisitor.prototype.visitAllExpressions = function (exprs, context) {\n            var _this = this;\n            exprs.forEach(function (expr) { return expr.visitExpression(_this, context); });\n        };\n        RecursiveAstVisitor.prototype.visitDeclareVarStmt = function (stmt, context) {\n            if (stmt.value) {\n                stmt.value.visitExpression(this, context);\n            }\n            if (stmt.type) {\n                stmt.type.visitType(this, context);\n            }\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitDeclareFunctionStmt = function (stmt, context) {\n            this.visitAllStatements(stmt.statements, context);\n            if (stmt.type) {\n                stmt.type.visitType(this, context);\n            }\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitExpressionStmt = function (stmt, context) {\n            stmt.expr.visitExpression(this, context);\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitReturnStmt = function (stmt, context) {\n            stmt.value.visitExpression(this, context);\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitDeclareClassStmt = function (stmt, context) {\n            var _this = this;\n            stmt.parent.visitExpression(this, context);\n            stmt.getters.forEach(function (getter) { return _this.visitAllStatements(getter.body, context); });\n            if (stmt.constructorMethod) {\n                this.visitAllStatements(stmt.constructorMethod.body, context);\n            }\n            stmt.methods.forEach(function (method) { return _this.visitAllStatements(method.body, context); });\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitIfStmt = function (stmt, context) {\n            stmt.condition.visitExpression(this, context);\n            this.visitAllStatements(stmt.trueCase, context);\n            this.visitAllStatements(stmt.falseCase, context);\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitTryCatchStmt = function (stmt, context) {\n            this.visitAllStatements(stmt.bodyStmts, context);\n            this.visitAllStatements(stmt.catchStmts, context);\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitThrowStmt = function (stmt, context) {\n            stmt.error.visitExpression(this, context);\n            return stmt;\n        };\n        RecursiveAstVisitor.prototype.visitAllStatements = function (stmts, context) {\n            var _this = this;\n            stmts.forEach(function (stmt) { return stmt.visitStatement(_this, context); });\n        };\n        return RecursiveAstVisitor;\n    }());\n    function findReadVarNames(stmts) {\n        var visitor = new _ReadVarVisitor();\n        visitor.visitAllStatements(stmts, null);\n        return visitor.varNames;\n    }\n    var _ReadVarVisitor = /** @class */ (function (_super) {\n        __extends(_ReadVarVisitor, _super);\n        function _ReadVarVisitor() {\n            var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n            _this.varNames = new Set();\n            return _this;\n        }\n        _ReadVarVisitor.prototype.visitDeclareFunctionStmt = function (stmt, context) {\n            // Don't descend into nested functions\n            return stmt;\n        };\n        _ReadVarVisitor.prototype.visitDeclareClassStmt = function (stmt, context) {\n            // Don't descend into nested classes\n            return stmt;\n        };\n        _ReadVarVisitor.prototype.visitReadVarExpr = function (ast, context) {\n            if (ast.name) {\n                this.varNames.add(ast.name);\n            }\n            return null;\n        };\n        return _ReadVarVisitor;\n    }(RecursiveAstVisitor));\n    function collectExternalReferences(stmts) {\n        var visitor = new _FindExternalReferencesVisitor();\n        visitor.visitAllStatements(stmts, null);\n        return visitor.externalReferences;\n    }\n    var _FindExternalReferencesVisitor = /** @class */ (function (_super) {\n        __extends(_FindExternalReferencesVisitor, _super);\n        function _FindExternalReferencesVisitor() {\n            var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n            _this.externalReferences = [];\n            return _this;\n        }\n        _FindExternalReferencesVisitor.prototype.visitExternalExpr = function (e, context) {\n            this.externalReferences.push(e.value);\n            return _super.prototype.visitExternalExpr.call(this, e, context);\n        };\n        return _FindExternalReferencesVisitor;\n    }(RecursiveAstVisitor));\n    function applySourceSpanToStatementIfNeeded(stmt, sourceSpan) {\n        if (!sourceSpan) {\n            return stmt;\n        }\n        var transformer = new _ApplySourceSpanTransformer(sourceSpan);\n        return stmt.visitStatement(transformer, null);\n    }\n    function applySourceSpanToExpressionIfNeeded(expr, sourceSpan) {\n        if (!sourceSpan) {\n            return expr;\n        }\n        var transformer = new _ApplySourceSpanTransformer(sourceSpan);\n        return expr.visitExpression(transformer, null);\n    }\n    var _ApplySourceSpanTransformer = /** @class */ (function (_super) {\n        __extends(_ApplySourceSpanTransformer, _super);\n        function _ApplySourceSpanTransformer(sourceSpan) {\n            var _this = _super.call(this) || this;\n            _this.sourceSpan = sourceSpan;\n            return _this;\n        }\n        _ApplySourceSpanTransformer.prototype._clone = function (obj) {\n            var e_1, _e;\n            var clone = Object.create(obj.constructor.prototype);\n            try {\n                for (var _f = __values(Object.keys(obj)), _g = _f.next(); !_g.done; _g = _f.next()) {\n                    var prop = _g.value;\n                    clone[prop] = obj[prop];\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_g && !_g.done && (_e = _f.return)) _e.call(_f);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return clone;\n        };\n        _ApplySourceSpanTransformer.prototype.transformExpr = function (expr, context) {\n            if (!expr.sourceSpan) {\n                expr = this._clone(expr);\n                expr.sourceSpan = this.sourceSpan;\n            }\n            return expr;\n        };\n        _ApplySourceSpanTransformer.prototype.transformStmt = function (stmt, context) {\n            if (!stmt.sourceSpan) {\n                stmt = this._clone(stmt);\n                stmt.sourceSpan = this.sourceSpan;\n            }\n            return stmt;\n        };\n        return _ApplySourceSpanTransformer;\n    }(AstTransformer));\n    function leadingComment(text, multiline, trailingNewline) {\n        if (multiline === void 0) { multiline = false; }\n        if (trailingNewline === void 0) { trailingNewline = true; }\n        return new LeadingComment(text, multiline, trailingNewline);\n    }\n    function jsDocComment(tags) {\n        if (tags === void 0) { tags = []; }\n        return new JSDocComment(tags);\n    }\n    function variable(name, type, sourceSpan) {\n        return new ReadVarExpr(name, type, sourceSpan);\n    }\n    function importExpr(id, typeParams, sourceSpan) {\n        if (typeParams === void 0) { typeParams = null; }\n        return new ExternalExpr(id, null, typeParams, sourceSpan);\n    }\n    function importType(id, typeParams, typeModifiers) {\n        return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;\n    }\n    function expressionType(expr, typeModifiers, typeParams) {\n        return new ExpressionType(expr, typeModifiers, typeParams);\n    }\n    function typeofExpr(expr) {\n        return new TypeofExpr(expr);\n    }\n    function literalArr(values, type, sourceSpan) {\n        return new LiteralArrayExpr(values, type, sourceSpan);\n    }\n    function literalMap(values, type) {\n        if (type === void 0) { type = null; }\n        return new LiteralMapExpr(values.map(function (e) { return new LiteralMapEntry(e.key, e.value, e.quoted); }), type, null);\n    }\n    function unary(operator, expr, type, sourceSpan) {\n        return new UnaryOperatorExpr(operator, expr, type, sourceSpan);\n    }\n    function not(expr, sourceSpan) {\n        return new NotExpr(expr, sourceSpan);\n    }\n    function assertNotNull(expr, sourceSpan) {\n        return new AssertNotNull(expr, sourceSpan);\n    }\n    function fn(params, body, type, sourceSpan, name) {\n        return new FunctionExpr(params, body, type, sourceSpan, name);\n    }\n    function ifStmt(condition, thenClause, elseClause, sourceSpan, leadingComments) {\n        return new IfStmt(condition, thenClause, elseClause, sourceSpan, leadingComments);\n    }\n    function taggedTemplate(tag, template, type, sourceSpan) {\n        return new TaggedTemplateExpr(tag, template, type, sourceSpan);\n    }\n    function literal(value, type, sourceSpan) {\n        return new LiteralExpr(value, type, sourceSpan);\n    }\n    function localizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan) {\n        return new LocalizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan);\n    }\n    function isNull(exp) {\n        return exp instanceof LiteralExpr && exp.value === null;\n    }\n    /*\n     * Serializes a `Tag` into a string.\n     * Returns a string like \" @foo {bar} baz\" (note the leading whitespace before `@foo`).\n     */\n    function tagToString(tag) {\n        var out = '';\n        if (tag.tagName) {\n            out += \" @\" + tag.tagName;\n        }\n        if (tag.text) {\n            if (tag.text.match(/\\/\\*|\\*\\//)) {\n                throw new Error('JSDoc text cannot contain \"/*\" and \"*/\"');\n            }\n            out += ' ' + tag.text.replace(/@/g, '\\\\@');\n        }\n        return out;\n    }\n    function serializeTags(tags) {\n        var e_2, _e;\n        if (tags.length === 0)\n            return '';\n        if (tags.length === 1 && tags[0].tagName && !tags[0].text) {\n            // The JSDOC comment is a single simple tag: e.g `/** @tagname */`.\n            return \"*\" + tagToString(tags[0]) + \" \";\n        }\n        var out = '*\\n';\n        try {\n            for (var tags_1 = __values(tags), tags_1_1 = tags_1.next(); !tags_1_1.done; tags_1_1 = tags_1.next()) {\n                var tag = tags_1_1.value;\n                out += ' *';\n                // If the tagToString is multi-line, insert \" * \" prefixes on lines.\n                out += tagToString(tag).replace(/\\n/g, '\\n * ');\n                out += '\\n';\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (tags_1_1 && !tags_1_1.done && (_e = tags_1.return)) _e.call(tags_1);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        out += ' ';\n        return out;\n    }\n\n    var CONSTANT_PREFIX = '_c';\n    /**\n     * `ConstantPool` tries to reuse literal factories when two or more literals are identical.\n     * We determine whether literals are identical by creating a key out of their AST using the\n     * `KeyVisitor`. This constant is used to replace dynamic expressions which can't be safely\n     * converted into a key. E.g. given an expression `{foo: bar()}`, since we don't know what\n     * the result of `bar` will be, we create a key that looks like `{foo: <unknown>}`. Note\n     * that we use a variable, rather than something like `null` in order to avoid collisions.\n     */\n    var UNKNOWN_VALUE_KEY = variable('<unknown>');\n    /**\n     * Context to use when producing a key.\n     *\n     * This ensures we see the constant not the reference variable when producing\n     * a key.\n     */\n    var KEY_CONTEXT = {};\n    /**\n     * Generally all primitive values are excluded from the `ConstantPool`, but there is an exclusion\n     * for strings that reach a certain length threshold. This constant defines the length threshold for\n     * strings.\n     */\n    var POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS = 50;\n    /**\n     * A node that is a place-holder that allows the node to be replaced when the actual\n     * node is known.\n     *\n     * This allows the constant pool to change an expression from a direct reference to\n     * a constant to a shared constant. It returns a fix-up node that is later allowed to\n     * change the referenced expression.\n     */\n    var FixupExpression = /** @class */ (function (_super) {\n        __extends(FixupExpression, _super);\n        function FixupExpression(resolved) {\n            var _this = _super.call(this, resolved.type) || this;\n            _this.resolved = resolved;\n            _this.original = resolved;\n            return _this;\n        }\n        FixupExpression.prototype.visitExpression = function (visitor, context) {\n            if (context === KEY_CONTEXT) {\n                // When producing a key we want to traverse the constant not the\n                // variable used to refer to it.\n                return this.original.visitExpression(visitor, context);\n            }\n            else {\n                return this.resolved.visitExpression(visitor, context);\n            }\n        };\n        FixupExpression.prototype.isEquivalent = function (e) {\n            return e instanceof FixupExpression && this.resolved.isEquivalent(e.resolved);\n        };\n        FixupExpression.prototype.isConstant = function () {\n            return true;\n        };\n        FixupExpression.prototype.fixup = function (expression) {\n            this.resolved = expression;\n            this.shared = true;\n        };\n        return FixupExpression;\n    }(Expression));\n    /**\n     * A constant pool allows a code emitter to share constant in an output context.\n     *\n     * The constant pool also supports sharing access to ivy definitions references.\n     */\n    var ConstantPool = /** @class */ (function () {\n        function ConstantPool(isClosureCompilerEnabled) {\n            if (isClosureCompilerEnabled === void 0) { isClosureCompilerEnabled = false; }\n            this.isClosureCompilerEnabled = isClosureCompilerEnabled;\n            this.statements = [];\n            this.literals = new Map();\n            this.literalFactories = new Map();\n            this.injectorDefinitions = new Map();\n            this.directiveDefinitions = new Map();\n            this.componentDefinitions = new Map();\n            this.pipeDefinitions = new Map();\n            this.nextNameIndex = 0;\n        }\n        ConstantPool.prototype.getConstLiteral = function (literal, forceShared) {\n            if ((literal instanceof LiteralExpr && !isLongStringLiteral(literal)) ||\n                literal instanceof FixupExpression) {\n                // Do no put simple literals into the constant pool or try to produce a constant for a\n                // reference to a constant.\n                return literal;\n            }\n            var key = this.keyOf(literal);\n            var fixup = this.literals.get(key);\n            var newValue = false;\n            if (!fixup) {\n                fixup = new FixupExpression(literal);\n                this.literals.set(key, fixup);\n                newValue = true;\n            }\n            if ((!newValue && !fixup.shared) || (newValue && forceShared)) {\n                // Replace the expression with a variable\n                var name = this.freshName();\n                var definition = void 0;\n                var usage = void 0;\n                if (this.isClosureCompilerEnabled && isLongStringLiteral(literal)) {\n                    // For string literals, Closure will **always** inline the string at\n                    // **all** usages, duplicating it each time. For large strings, this\n                    // unnecessarily bloats bundle size. To work around this restriction, we\n                    // wrap the string in a function, and call that function for each usage.\n                    // This tricks Closure into using inline logic for functions instead of\n                    // string literals. Function calls are only inlined if the body is small\n                    // enough to be worth it. By doing this, very large strings will be\n                    // shared across multiple usages, rather than duplicating the string at\n                    // each usage site.\n                    //\n                    // const myStr = function() { return \"very very very long string\"; };\n                    // const usage1 = myStr();\n                    // const usage2 = myStr();\n                    definition = variable(name).set(new FunctionExpr([], // Params.\n                    [\n                        // Statements.\n                        new ReturnStatement(literal),\n                    ]));\n                    usage = variable(name).callFn([]);\n                }\n                else {\n                    // Just declare and use the variable directly, without a function call\n                    // indirection. This saves a few bytes and avoids an unncessary call.\n                    definition = variable(name).set(literal);\n                    usage = variable(name);\n                }\n                this.statements.push(definition.toDeclStmt(INFERRED_TYPE, [exports.StmtModifier.Final]));\n                fixup.fixup(usage);\n            }\n            return fixup;\n        };\n        ConstantPool.prototype.getDefinition = function (type, kind, ctx, forceShared) {\n            if (forceShared === void 0) { forceShared = false; }\n            var definitions = this.definitionsOf(kind);\n            var fixup = definitions.get(type);\n            var newValue = false;\n            if (!fixup) {\n                var property = this.propertyNameOf(kind);\n                fixup = new FixupExpression(ctx.importExpr(type).prop(property));\n                definitions.set(type, fixup);\n                newValue = true;\n            }\n            if ((!newValue && !fixup.shared) || (newValue && forceShared)) {\n                var name = this.freshName();\n                this.statements.push(variable(name).set(fixup.resolved).toDeclStmt(INFERRED_TYPE, [exports.StmtModifier.Final]));\n                fixup.fixup(variable(name));\n            }\n            return fixup;\n        };\n        ConstantPool.prototype.getLiteralFactory = function (literal) {\n            // Create a pure function that builds an array of a mix of constant and variable expressions\n            if (literal instanceof LiteralArrayExpr) {\n                var argumentsForKey = literal.entries.map(function (e) { return e.isConstant() ? e : UNKNOWN_VALUE_KEY; });\n                var key = this.keyOf(literalArr(argumentsForKey));\n                return this._getLiteralFactory(key, literal.entries, function (entries) { return literalArr(entries); });\n            }\n            else {\n                var expressionForKey = literalMap(literal.entries.map(function (e) { return ({\n                    key: e.key,\n                    value: e.value.isConstant() ? e.value : UNKNOWN_VALUE_KEY,\n                    quoted: e.quoted\n                }); }));\n                var key = this.keyOf(expressionForKey);\n                return this._getLiteralFactory(key, literal.entries.map(function (e) { return e.value; }), function (entries) { return literalMap(entries.map(function (value, index) { return ({\n                    key: literal.entries[index].key,\n                    value: value,\n                    quoted: literal.entries[index].quoted\n                }); })); });\n            }\n        };\n        ConstantPool.prototype._getLiteralFactory = function (key, values, resultMap) {\n            var _this = this;\n            var literalFactory = this.literalFactories.get(key);\n            var literalFactoryArguments = values.filter((function (e) { return !e.isConstant(); }));\n            if (!literalFactory) {\n                var resultExpressions = values.map(function (e, index) { return e.isConstant() ? _this.getConstLiteral(e, true) : variable(\"a\" + index); });\n                var parameters = resultExpressions.filter(isVariable).map(function (e) { return new FnParam(e.name, DYNAMIC_TYPE); });\n                var pureFunctionDeclaration = fn(parameters, [new ReturnStatement(resultMap(resultExpressions))], INFERRED_TYPE);\n                var name = this.freshName();\n                this.statements.push(variable(name).set(pureFunctionDeclaration).toDeclStmt(INFERRED_TYPE, [\n                    exports.StmtModifier.Final\n                ]));\n                literalFactory = variable(name);\n                this.literalFactories.set(key, literalFactory);\n            }\n            return { literalFactory: literalFactory, literalFactoryArguments: literalFactoryArguments };\n        };\n        /**\n         * Produce a unique name.\n         *\n         * The name might be unique among different prefixes if any of the prefixes end in\n         * a digit so the prefix should be a constant string (not based on user input) and\n         * must not end in a digit.\n         */\n        ConstantPool.prototype.uniqueName = function (prefix) {\n            return \"\" + prefix + this.nextNameIndex++;\n        };\n        ConstantPool.prototype.definitionsOf = function (kind) {\n            switch (kind) {\n                case 2 /* Component */:\n                    return this.componentDefinitions;\n                case 1 /* Directive */:\n                    return this.directiveDefinitions;\n                case 0 /* Injector */:\n                    return this.injectorDefinitions;\n                case 3 /* Pipe */:\n                    return this.pipeDefinitions;\n            }\n        };\n        ConstantPool.prototype.propertyNameOf = function (kind) {\n            switch (kind) {\n                case 2 /* Component */:\n                    return 'ɵcmp';\n                case 1 /* Directive */:\n                    return 'ɵdir';\n                case 0 /* Injector */:\n                    return 'ɵinj';\n                case 3 /* Pipe */:\n                    return 'ɵpipe';\n            }\n        };\n        ConstantPool.prototype.freshName = function () {\n            return this.uniqueName(CONSTANT_PREFIX);\n        };\n        ConstantPool.prototype.keyOf = function (expression) {\n            return expression.visitExpression(new KeyVisitor(), KEY_CONTEXT);\n        };\n        return ConstantPool;\n    }());\n    /**\n     * Visitor used to determine if 2 expressions are equivalent and can be shared in the\n     * `ConstantPool`.\n     *\n     * When the id (string) generated by the visitor is equal, expressions are considered equivalent.\n     */\n    var KeyVisitor = /** @class */ (function () {\n        function KeyVisitor() {\n            this.visitWrappedNodeExpr = invalid;\n            this.visitWriteVarExpr = invalid;\n            this.visitWriteKeyExpr = invalid;\n            this.visitWritePropExpr = invalid;\n            this.visitInvokeMethodExpr = invalid;\n            this.visitInvokeFunctionExpr = invalid;\n            this.visitTaggedTemplateExpr = invalid;\n            this.visitInstantiateExpr = invalid;\n            this.visitConditionalExpr = invalid;\n            this.visitNotExpr = invalid;\n            this.visitAssertNotNullExpr = invalid;\n            this.visitCastExpr = invalid;\n            this.visitFunctionExpr = invalid;\n            this.visitUnaryOperatorExpr = invalid;\n            this.visitBinaryOperatorExpr = invalid;\n            this.visitReadPropExpr = invalid;\n            this.visitReadKeyExpr = invalid;\n            this.visitCommaExpr = invalid;\n            this.visitLocalizedString = invalid;\n        }\n        KeyVisitor.prototype.visitLiteralExpr = function (ast) {\n            return \"\" + (typeof ast.value === 'string' ? '\"' + ast.value + '\"' : ast.value);\n        };\n        KeyVisitor.prototype.visitLiteralArrayExpr = function (ast, context) {\n            var _this = this;\n            return \"[\" + ast.entries.map(function (entry) { return entry.visitExpression(_this, context); }).join(',') + \"]\";\n        };\n        KeyVisitor.prototype.visitLiteralMapExpr = function (ast, context) {\n            var _this = this;\n            var mapKey = function (entry) {\n                var quote = entry.quoted ? '\"' : '';\n                return \"\" + quote + entry.key + quote;\n            };\n            var mapEntry = function (entry) { return mapKey(entry) + \":\" + entry.value.visitExpression(_this, context); };\n            return \"{\" + ast.entries.map(mapEntry).join(',');\n        };\n        KeyVisitor.prototype.visitExternalExpr = function (ast) {\n            return ast.value.moduleName ? \"EX:\" + ast.value.moduleName + \":\" + ast.value.name :\n                \"EX:\" + ast.value.runtime.name;\n        };\n        KeyVisitor.prototype.visitReadVarExpr = function (node) {\n            return \"VAR:\" + node.name;\n        };\n        KeyVisitor.prototype.visitTypeofExpr = function (node, context) {\n            return \"TYPEOF:\" + node.expr.visitExpression(this, context);\n        };\n        return KeyVisitor;\n    }());\n    function invalid(arg) {\n        throw new Error(\"Invalid state: Visitor \" + this.constructor.name + \" doesn't handle \" + arg.constructor.name);\n    }\n    function isVariable(e) {\n        return e instanceof ReadVarExpr;\n    }\n    function isLongStringLiteral(expr) {\n        return expr instanceof LiteralExpr && typeof expr.value === 'string' &&\n            expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;\n    }\n\n    /**\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://angular.io/license\n     */\n    var CORE = '@angular/core';\n    var Identifiers = /** @class */ (function () {\n        function Identifiers() {\n        }\n        return Identifiers;\n    }());\n    /* Methods */\n    Identifiers.NEW_METHOD = 'factory';\n    Identifiers.TRANSFORM_METHOD = 'transform';\n    Identifiers.PATCH_DEPS = 'patchedDeps';\n    Identifiers.core = { name: null, moduleName: CORE };\n    /* Instructions */\n    Identifiers.namespaceHTML = { name: 'ɵɵnamespaceHTML', moduleName: CORE };\n    Identifiers.namespaceMathML = { name: 'ɵɵnamespaceMathML', moduleName: CORE };\n    Identifiers.namespaceSVG = { name: 'ɵɵnamespaceSVG', moduleName: CORE };\n    Identifiers.element = { name: 'ɵɵelement', moduleName: CORE };\n    Identifiers.elementStart = { name: 'ɵɵelementStart', moduleName: CORE };\n    Identifiers.elementEnd = { name: 'ɵɵelementEnd', moduleName: CORE };\n    Identifiers.advance = { name: 'ɵɵadvance', moduleName: CORE };\n    Identifiers.syntheticHostProperty = { name: 'ɵɵsyntheticHostProperty', moduleName: CORE };\n    Identifiers.syntheticHostListener = { name: 'ɵɵsyntheticHostListener', moduleName: CORE };\n    Identifiers.attribute = { name: 'ɵɵattribute', moduleName: CORE };\n    Identifiers.attributeInterpolate1 = { name: 'ɵɵattributeInterpolate1', moduleName: CORE };\n    Identifiers.attributeInterpolate2 = { name: 'ɵɵattributeInterpolate2', moduleName: CORE };\n    Identifiers.attributeInterpolate3 = { name: 'ɵɵattributeInterpolate3', moduleName: CORE };\n    Identifiers.attributeInterpolate4 = { name: 'ɵɵattributeInterpolate4', moduleName: CORE };\n    Identifiers.attributeInterpolate5 = { name: 'ɵɵattributeInterpolate5', moduleName: CORE };\n    Identifiers.attributeInterpolate6 = { name: 'ɵɵattributeInterpolate6', moduleName: CORE };\n    Identifiers.attributeInterpolate7 = { name: 'ɵɵattributeInterpolate7', moduleName: CORE };\n    Identifiers.attributeInterpolate8 = { name: 'ɵɵattributeInterpolate8', moduleName: CORE };\n    Identifiers.attributeInterpolateV = { name: 'ɵɵattributeInterpolateV', moduleName: CORE };\n    Identifiers.classProp = { name: 'ɵɵclassProp', moduleName: CORE };\n    Identifiers.elementContainerStart = { name: 'ɵɵelementContainerStart', moduleName: CORE };\n    Identifiers.elementContainerEnd = { name: 'ɵɵelementContainerEnd', moduleName: CORE };\n    Identifiers.elementContainer = { name: 'ɵɵelementContainer', moduleName: CORE };\n    Identifiers.styleMap = { name: 'ɵɵstyleMap', moduleName: CORE };\n    Identifiers.styleMapInterpolate1 = { name: 'ɵɵstyleMapInterpolate1', moduleName: CORE };\n    Identifiers.styleMapInterpolate2 = { name: 'ɵɵstyleMapInterpolate2', moduleName: CORE };\n    Identifiers.styleMapInterpolate3 = { name: 'ɵɵstyleMapInterpolate3', moduleName: CORE };\n    Identifiers.styleMapInterpolate4 = { name: 'ɵɵstyleMapInterpolate4', moduleName: CORE };\n    Identifiers.styleMapInterpolate5 = { name: 'ɵɵstyleMapInterpolate5', moduleName: CORE };\n    Identifiers.styleMapInterpolate6 = { name: 'ɵɵstyleMapInterpolate6', moduleName: CORE };\n    Identifiers.styleMapInterpolate7 = { name: 'ɵɵstyleMapInterpolate7', moduleName: CORE };\n    Identifiers.styleMapInterpolate8 = { name: 'ɵɵstyleMapInterpolate8', moduleName: CORE };\n    Identifiers.styleMapInterpolateV = { name: 'ɵɵstyleMapInterpolateV', moduleName: CORE };\n    Identifiers.classMap = { name: 'ɵɵclassMap', moduleName: CORE };\n    Identifiers.classMapInterpolate1 = { name: 'ɵɵclassMapInterpolate1', moduleName: CORE };\n    Identifiers.classMapInterpolate2 = { name: 'ɵɵclassMapInterpolate2', moduleName: CORE };\n    Identifiers.classMapInterpolate3 = { name: 'ɵɵclassMapInterpolate3', moduleName: CORE };\n    Identifiers.classMapInterpolate4 = { name: 'ɵɵclassMapInterpolate4', moduleName: CORE };\n    Identifiers.classMapInterpolate5 = { name: 'ɵɵclassMapInterpolate5', moduleName: CORE };\n    Identifiers.classMapInterpolate6 = { name: 'ɵɵclassMapInterpolate6', moduleName: CORE };\n    Identifiers.classMapInterpolate7 = { name: 'ɵɵclassMapInterpolate7', moduleName: CORE };\n    Identifiers.classMapInterpolate8 = { name: 'ɵɵclassMapInterpolate8', moduleName: CORE };\n    Identifiers.classMapInterpolateV = { name: 'ɵɵclassMapInterpolateV', moduleName: CORE };\n    Identifiers.styleProp = { name: 'ɵɵstyleProp', moduleName: CORE };\n    Identifiers.stylePropInterpolate1 = { name: 'ɵɵstylePropInterpolate1', moduleName: CORE };\n    Identifiers.stylePropInterpolate2 = { name: 'ɵɵstylePropInterpolate2', moduleName: CORE };\n    Identifiers.stylePropInterpolate3 = { name: 'ɵɵstylePropInterpolate3', moduleName: CORE };\n    Identifiers.stylePropInterpolate4 = { name: 'ɵɵstylePropInterpolate4', moduleName: CORE };\n    Identifiers.stylePropInterpolate5 = { name: 'ɵɵstylePropInterpolate5', moduleName: CORE };\n    Identifiers.stylePropInterpolate6 = { name: 'ɵɵstylePropInterpolate6', moduleName: CORE };\n    Identifiers.stylePropInterpolate7 = { name: 'ɵɵstylePropInterpolate7', moduleName: CORE };\n    Identifiers.stylePropInterpolate8 = { name: 'ɵɵstylePropInterpolate8', moduleName: CORE };\n    Identifiers.stylePropInterpolateV = { name: 'ɵɵstylePropInterpolateV', moduleName: CORE };\n    Identifiers.nextContext = { name: 'ɵɵnextContext', moduleName: CORE };\n    Identifiers.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };\n    Identifiers.text = { name: 'ɵɵtext', moduleName: CORE };\n    Identifiers.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };\n    Identifiers.disableBindings = { name: 'ɵɵdisableBindings', moduleName: CORE };\n    Identifiers.getCurrentView = { name: 'ɵɵgetCurrentView', moduleName: CORE };\n    Identifiers.textInterpolate = { name: 'ɵɵtextInterpolate', moduleName: CORE };\n    Identifiers.textInterpolate1 = { name: 'ɵɵtextInterpolate1', moduleName: CORE };\n    Identifiers.textInterpolate2 = { name: 'ɵɵtextInterpolate2', moduleName: CORE };\n    Identifiers.textInterpolate3 = { name: 'ɵɵtextInterpolate3', moduleName: CORE };\n    Identifiers.textInterpolate4 = { name: 'ɵɵtextInterpolate4', moduleName: CORE };\n    Identifiers.textInterpolate5 = { name: 'ɵɵtextInterpolate5', moduleName: CORE };\n    Identifiers.textInterpolate6 = { name: 'ɵɵtextInterpolate6', moduleName: CORE };\n    Identifiers.textInterpolate7 = { name: 'ɵɵtextInterpolate7', moduleName: CORE };\n    Identifiers.textInterpolate8 = { name: 'ɵɵtextInterpolate8', moduleName: CORE };\n    Identifiers.textInterpolateV = { name: 'ɵɵtextInterpolateV', moduleName: CORE };\n    Identifiers.restoreView = { name: 'ɵɵrestoreView', moduleName: CORE };\n    Identifiers.pureFunction0 = { name: 'ɵɵpureFunction0', moduleName: CORE };\n    Identifiers.pureFunction1 = { name: 'ɵɵpureFunction1', moduleName: CORE };\n    Identifiers.pureFunction2 = { name: 'ɵɵpureFunction2', moduleName: CORE };\n    Identifiers.pureFunction3 = { name: 'ɵɵpureFunction3', moduleName: CORE };\n    Identifiers.pureFunction4 = { name: 'ɵɵpureFunction4', moduleName: CORE };\n    Identifiers.pureFunction5 = { name: 'ɵɵpureFunction5', moduleName: CORE };\n    Identifiers.pureFunction6 = { name: 'ɵɵpureFunction6', moduleName: CORE };\n    Identifiers.pureFunction7 = { name: 'ɵɵpureFunction7', moduleName: CORE };\n    Identifiers.pureFunction8 = { name: 'ɵɵpureFunction8', moduleName: CORE };\n    Identifiers.pureFunctionV = { name: 'ɵɵpureFunctionV', moduleName: CORE };\n    Identifiers.pipeBind1 = { name: 'ɵɵpipeBind1', moduleName: CORE };\n    Identifiers.pipeBind2 = { name: 'ɵɵpipeBind2', moduleName: CORE };\n    Identifiers.pipeBind3 = { name: 'ɵɵpipeBind3', moduleName: CORE };\n    Identifiers.pipeBind4 = { name: 'ɵɵpipeBind4', moduleName: CORE };\n    Identifiers.pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE };\n    Identifiers.hostProperty = { name: 'ɵɵhostProperty', moduleName: CORE };\n    Identifiers.property = { name: 'ɵɵproperty', moduleName: CORE };\n    Identifiers.propertyInterpolate = { name: 'ɵɵpropertyInterpolate', moduleName: CORE };\n    Identifiers.propertyInterpolate1 = { name: 'ɵɵpropertyInterpolate1', moduleName: CORE };\n    Identifiers.propertyInterpolate2 = { name: 'ɵɵpropertyInterpolate2', moduleName: CORE };\n    Identifiers.propertyInterpolate3 = { name: 'ɵɵpropertyInterpolate3', moduleName: CORE };\n    Identifiers.propertyInterpolate4 = { name: 'ɵɵpropertyInterpolate4', moduleName: CORE };\n    Identifiers.propertyInterpolate5 = { name: 'ɵɵpropertyInterpolate5', moduleName: CORE };\n    Identifiers.propertyInterpolate6 = { name: 'ɵɵpropertyInterpolate6', moduleName: CORE };\n    Identifiers.propertyInterpolate7 = { name: 'ɵɵpropertyInterpolate7', moduleName: CORE };\n    Identifiers.propertyInterpolate8 = { name: 'ɵɵpropertyInterpolate8', moduleName: CORE };\n    Identifiers.propertyInterpolateV = { name: 'ɵɵpropertyInterpolateV', moduleName: CORE };\n    Identifiers.i18n = { name: 'ɵɵi18n', moduleName: CORE };\n    Identifiers.i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE };\n    Identifiers.i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE };\n    Identifiers.i18nStart = { name: 'ɵɵi18nStart', moduleName: CORE };\n    Identifiers.i18nEnd = { name: 'ɵɵi18nEnd', moduleName: CORE };\n    Identifiers.i18nApply = { name: 'ɵɵi18nApply', moduleName: CORE };\n    Identifiers.i18nPostprocess = { name: 'ɵɵi18nPostprocess', moduleName: CORE };\n    Identifiers.pipe = { name: 'ɵɵpipe', moduleName: CORE };\n    Identifiers.projection = { name: 'ɵɵprojection', moduleName: CORE };\n    Identifiers.projectionDef = { name: 'ɵɵprojectionDef', moduleName: CORE };\n    Identifiers.reference = { name: 'ɵɵreference', moduleName: CORE };\n    Identifiers.inject = { name: 'ɵɵinject', moduleName: CORE };\n    Identifiers.injectAttribute = { name: 'ɵɵinjectAttribute', moduleName: CORE };\n    Identifiers.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE };\n    Identifiers.invalidFactory = { name: 'ɵɵinvalidFactory', moduleName: CORE };\n    Identifiers.invalidFactoryDep = { name: 'ɵɵinvalidFactoryDep', moduleName: CORE };\n    Identifiers.templateRefExtractor = { name: 'ɵɵtemplateRefExtractor', moduleName: CORE };\n    Identifiers.forwardRef = { name: 'forwardRef', moduleName: CORE };\n    Identifiers.resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE };\n    Identifiers.ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE };\n    Identifiers.declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE };\n    Identifiers.InjectableDeclaration = { name: 'ɵɵInjectableDeclaration', moduleName: CORE };\n    Identifiers.resolveWindow = { name: 'ɵɵresolveWindow', moduleName: CORE };\n    Identifiers.resolveDocument = { name: 'ɵɵresolveDocument', moduleName: CORE };\n    Identifiers.resolveBody = { name: 'ɵɵresolveBody', moduleName: CORE };\n    Identifiers.defineComponent = { name: 'ɵɵdefineComponent', moduleName: CORE };\n    Identifiers.declareComponent = { name: 'ɵɵngDeclareComponent', moduleName: CORE };\n    Identifiers.setComponentScope = { name: 'ɵɵsetComponentScope', moduleName: CORE };\n    Identifiers.ChangeDetectionStrategy = {\n        name: 'ChangeDetectionStrategy',\n        moduleName: CORE,\n    };\n    Identifiers.ViewEncapsulation = {\n        name: 'ViewEncapsulation',\n        moduleName: CORE,\n    };\n    Identifiers.ComponentDeclaration = {\n        name: 'ɵɵComponentDeclaration',\n        moduleName: CORE,\n    };\n    Identifiers.FactoryDeclaration = {\n        name: 'ɵɵFactoryDeclaration',\n        moduleName: CORE,\n    };\n    Identifiers.declareFactory = { name: 'ɵɵngDeclareFactory', moduleName: CORE };\n    Identifiers.FactoryTarget = { name: 'ɵɵFactoryTarget', moduleName: CORE };\n    Identifiers.defineDirective = { name: 'ɵɵdefineDirective', moduleName: CORE };\n    Identifiers.declareDirective = { name: 'ɵɵngDeclareDirective', moduleName: CORE };\n    Identifiers.DirectiveDeclaration = {\n        name: 'ɵɵDirectiveDeclaration',\n        moduleName: CORE,\n    };\n    Identifiers.InjectorDef = { name: 'ɵɵInjectorDef', moduleName: CORE };\n    Identifiers.InjectorDeclaration = { name: 'ɵɵInjectorDeclaration', moduleName: CORE };\n    Identifiers.defineInjector = { name: 'ɵɵdefineInjector', moduleName: CORE };\n    Identifiers.declareInjector = { name: 'ɵɵngDeclareInjector', moduleName: CORE };\n    Identifiers.NgModuleDeclaration = {\n        name: 'ɵɵNgModuleDeclaration',\n        moduleName: CORE,\n    };\n    Identifiers.ModuleWithProviders = {\n        name: 'ModuleWithProviders',\n        moduleName: CORE,\n    };\n    Identifiers.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };\n    Identifiers.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };\n    Identifiers.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };\n    Identifiers.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };\n    Identifiers.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };\n    Identifiers.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };\n    Identifiers.declareClassMetadata = { name: 'ɵɵngDeclareClassMetadata', moduleName: CORE };\n    Identifiers.setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE };\n    Identifiers.queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE };\n    Identifiers.viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE };\n    Identifiers.loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE };\n    Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };\n    Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };\n    Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };\n    Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };\n    Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };\n    Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };\n    Identifiers.getInheritedFactory = {\n        name: 'ɵɵgetInheritedFactory',\n        moduleName: CORE,\n    };\n    // sanitization-related functions\n    Identifiers.sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE };\n    Identifiers.sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE };\n    Identifiers.sanitizeResourceUrl = { name: 'ɵɵsanitizeResourceUrl', moduleName: CORE };\n    Identifiers.sanitizeScript = { name: 'ɵɵsanitizeScript', moduleName: CORE };\n    Identifiers.sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE };\n    Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };\n    Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };\n    Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };\n\n    /**\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://angular.io/license\n     */\n    var DASH_CASE_REGEXP = /-+([a-z0-9])/g;\n    function dashCaseToCamelCase(input) {\n        return input.replace(DASH_CASE_REGEXP, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            return m[1].toUpperCase();\n        });\n    }\n    function splitAtColon(input, defaultValues) {\n        return _splitAt(input, ':', defaultValues);\n    }\n    function splitAtPeriod(input, defaultValues) {\n        return _splitAt(input, '.', defaultValues);\n    }\n    function _splitAt(input, character, defaultValues) {\n        var characterIndex = input.indexOf(character);\n        if (characterIndex == -1)\n            return defaultValues;\n        return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];\n    }\n    function visitValue(value, visitor, context) {\n        if (Array.isArray(value)) {\n            return visitor.visitArray(value, context);\n        }\n        if (isStrictStringMap(value)) {\n            return visitor.visitStringMap(value, context);\n        }\n        if (value == null || typeof value == 'string' || typeof value == 'number' ||\n            typeof value == 'boolean') {\n            return visitor.visitPrimitive(value, context);\n        }\n        return visitor.visitOther(value, context);\n    }\n    function isDefined(val) {\n        return val !== null && val !== undefined;\n    }\n    function noUndefined(val) {\n        return val === undefined ? null : val;\n    }\n    var ValueTransformer = /** @class */ (function () {\n        function ValueTransformer() {\n        }\n        ValueTransformer.prototype.visitArray = function (arr, context) {\n            var _this = this;\n            return arr.map(function (value) { return visitValue(value, _this, context); });\n        };\n        ValueTransformer.prototype.visitStringMap = function (map, context) {\n            var _this = this;\n            var result = {};\n            Object.keys(map).forEach(function (key) {\n                result[key] = visitValue(map[key], _this, context);\n            });\n            return result;\n        };\n        ValueTransformer.prototype.visitPrimitive = function (value, context) {\n            return value;\n        };\n        ValueTransformer.prototype.visitOther = function (value, context) {\n            return value;\n        };\n        return ValueTransformer;\n    }());\n    var SyncAsync = {\n        assertSync: function (value) {\n            if (isPromise(value)) {\n                throw new Error(\"Illegal state: value cannot be a promise\");\n            }\n            return value;\n        },\n        then: function (value, cb) {\n            return isPromise(value) ? value.then(cb) : cb(value);\n        },\n        all: function (syncAsyncValues) {\n            return syncAsyncValues.some(isPromise) ? Promise.all(syncAsyncValues) : syncAsyncValues;\n        }\n    };\n    function error(msg) {\n        throw new Error(\"Internal Error: \" + msg);\n    }\n    function syntaxError(msg, parseErrors) {\n        var error = Error(msg);\n        error[ERROR_SYNTAX_ERROR] = true;\n        if (parseErrors)\n            error[ERROR_PARSE_ERRORS] = parseErrors;\n        return error;\n    }\n    var ERROR_SYNTAX_ERROR = 'ngSyntaxError';\n    var ERROR_PARSE_ERRORS = 'ngParseErrors';\n    function isSyntaxError(error) {\n        return error[ERROR_SYNTAX_ERROR];\n    }\n    function getParseErrors(error) {\n        return error[ERROR_PARSE_ERRORS] || [];\n    }\n    // Escape characters that have a special meaning in Regular Expressions\n    function escapeRegExp(s) {\n        return s.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n    }\n    var STRING_MAP_PROTO = Object.getPrototypeOf({});\n    function isStrictStringMap(obj) {\n        return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;\n    }\n    function utf8Encode(str) {\n        var encoded = [];\n        for (var index = 0; index < str.length; index++) {\n            var codePoint = str.charCodeAt(index);\n            // decode surrogate\n            // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n            if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {\n                var low = str.charCodeAt(index + 1);\n                if (low >= 0xdc00 && low <= 0xdfff) {\n                    index++;\n                    codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;\n                }\n            }\n            if (codePoint <= 0x7f) {\n                encoded.push(codePoint);\n            }\n            else if (codePoint <= 0x7ff) {\n                encoded.push(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);\n            }\n            else if (codePoint <= 0xffff) {\n                encoded.push((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n            }\n            else if (codePoint <= 0x1fffff) {\n                encoded.push(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n            }\n        }\n        return encoded;\n    }\n    function stringify(token) {\n        if (typeof token === 'string') {\n            return token;\n        }\n        if (Array.isArray(token)) {\n            return '[' + token.map(stringify).join(', ') + ']';\n        }\n        if (token == null) {\n            return '' + token;\n        }\n        if (token.overriddenName) {\n            return \"\" + token.overriddenName;\n        }\n        if (token.name) {\n            return \"\" + token.name;\n        }\n        if (!token.toString) {\n            return 'object';\n        }\n        // WARNING: do not try to `JSON.stringify(token)` here\n        // see https://github.com/angular/angular/issues/23440\n        var res = token.toString();\n        if (res == null) {\n            return '' + res;\n        }\n        var newLineIndex = res.indexOf('\\n');\n        return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n    }\n    /**\n     * Lazily retrieves the reference value from a forwardRef.\n     */\n    function resolveForwardRef(type) {\n        if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__')) {\n            return type();\n        }\n        else {\n            return type;\n        }\n    }\n    /**\n     * Determine if the argument is shaped like a Promise\n     */\n    function isPromise(obj) {\n        // allow any Promise/A+ compliant thenable.\n        // It's up to the caller to ensure that obj.then conforms to the spec\n        return !!obj && typeof obj.then === 'function';\n    }\n    var Version = /** @class */ (function () {\n        function Version(full) {\n            this.full = full;\n            var splits = full.split('.');\n            this.major = splits[0];\n            this.minor = splits[1];\n            this.patch = splits.slice(2).join('.');\n        }\n        return Version;\n    }());\n    var __window = typeof window !== 'undefined' && window;\n    var __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n        self instanceof WorkerGlobalScope && self;\n    var __global = typeof global !== 'undefined' && global;\n    // Check __global first, because in Node tests both __global and __window may be defined and _global\n    // should be __global in that case.\n    var _global = __global || __window || __self;\n    function newArray(size, value) {\n        var list = [];\n        for (var i = 0; i < size; i++) {\n            list.push(value);\n        }\n        return list;\n    }\n    /**\n     * Partitions a given array into 2 arrays, based on a boolean value returned by the condition\n     * function.\n     *\n     * @param arr Input array that should be partitioned\n     * @param conditionFn Condition function that is called for each item in a given array and returns a\n     * boolean value.\n     */\n    function partitionArray(arr, conditionFn) {\n        var e_1, _a;\n        var truthy = [];\n        var falsy = [];\n        try {\n            for (var arr_1 = __values(arr), arr_1_1 = arr_1.next(); !arr_1_1.done; arr_1_1 = arr_1.next()) {\n                var item = arr_1_1.value;\n                (conditionFn(item) ? truthy : falsy).push(item);\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (arr_1_1 && !arr_1_1.done && (_a = arr_1.return)) _a.call(arr_1);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return [truthy, falsy];\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently\n     * require the implementation of a visitor for Comments as they are only collected at\n     * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`\n     * is true.\n     */\n    var Comment = /** @class */ (function () {\n        function Comment(value, sourceSpan) {\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        Comment.prototype.visit = function (_visitor) {\n            throw new Error('visit() not implemented for Comment');\n        };\n        return Comment;\n    }());\n    var Text = /** @class */ (function () {\n        function Text(value, sourceSpan) {\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        Text.prototype.visit = function (visitor) {\n            return visitor.visitText(this);\n        };\n        return Text;\n    }());\n    var BoundText = /** @class */ (function () {\n        function BoundText(value, sourceSpan, i18n) {\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n            this.i18n = i18n;\n        }\n        BoundText.prototype.visit = function (visitor) {\n            return visitor.visitBoundText(this);\n        };\n        return BoundText;\n    }());\n    /**\n     * Represents a text attribute in the template.\n     *\n     * `valueSpan` may not be present in cases where there is no value `<div a></div>`.\n     * `keySpan` may also not be present for synthetic attributes from ICU expansions.\n     */\n    var TextAttribute = /** @class */ (function () {\n        function TextAttribute(name, value, sourceSpan, keySpan, valueSpan, i18n) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n            this.i18n = i18n;\n        }\n        TextAttribute.prototype.visit = function (visitor) {\n            return visitor.visitTextAttribute(this);\n        };\n        return TextAttribute;\n    }());\n    var BoundAttribute = /** @class */ (function () {\n        function BoundAttribute(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan, i18n) {\n            this.name = name;\n            this.type = type;\n            this.securityContext = securityContext;\n            this.value = value;\n            this.unit = unit;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n            this.i18n = i18n;\n        }\n        BoundAttribute.fromBoundElementProperty = function (prop, i18n) {\n            if (prop.keySpan === undefined) {\n                throw new Error(\"Unexpected state: keySpan must be defined for bound attributes but was not for \" + prop.name + \": \" + prop.sourceSpan);\n            }\n            return new BoundAttribute(prop.name, prop.type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n);\n        };\n        BoundAttribute.prototype.visit = function (visitor) {\n            return visitor.visitBoundAttribute(this);\n        };\n        return BoundAttribute;\n    }());\n    var BoundEvent = /** @class */ (function () {\n        function BoundEvent(name, type, handler, target, phase, sourceSpan, handlerSpan, keySpan) {\n            this.name = name;\n            this.type = type;\n            this.handler = handler;\n            this.target = target;\n            this.phase = phase;\n            this.sourceSpan = sourceSpan;\n            this.handlerSpan = handlerSpan;\n            this.keySpan = keySpan;\n        }\n        BoundEvent.fromParsedEvent = function (event) {\n            var target = event.type === 0 /* Regular */ ? event.targetOrPhase : null;\n            var phase = event.type === 1 /* Animation */ ? event.targetOrPhase : null;\n            if (event.keySpan === undefined) {\n                throw new Error(\"Unexpected state: keySpan must be defined for bound event but was not for \" + event.name + \": \" + event.sourceSpan);\n            }\n            return new BoundEvent(event.name, event.type, event.handler, target, phase, event.sourceSpan, event.handlerSpan, event.keySpan);\n        };\n        BoundEvent.prototype.visit = function (visitor) {\n            return visitor.visitBoundEvent(this);\n        };\n        return BoundEvent;\n    }());\n    var Element = /** @class */ (function () {\n        function Element(name, attributes, inputs, outputs, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n            this.name = name;\n            this.attributes = attributes;\n            this.inputs = inputs;\n            this.outputs = outputs;\n            this.children = children;\n            this.references = references;\n            this.sourceSpan = sourceSpan;\n            this.startSourceSpan = startSourceSpan;\n            this.endSourceSpan = endSourceSpan;\n            this.i18n = i18n;\n        }\n        Element.prototype.visit = function (visitor) {\n            return visitor.visitElement(this);\n        };\n        return Element;\n    }());\n    var Template = /** @class */ (function () {\n        function Template(tagName, attributes, inputs, outputs, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n            this.tagName = tagName;\n            this.attributes = attributes;\n            this.inputs = inputs;\n            this.outputs = outputs;\n            this.templateAttrs = templateAttrs;\n            this.children = children;\n            this.references = references;\n            this.variables = variables;\n            this.sourceSpan = sourceSpan;\n            this.startSourceSpan = startSourceSpan;\n            this.endSourceSpan = endSourceSpan;\n            this.i18n = i18n;\n        }\n        Template.prototype.visit = function (visitor) {\n            return visitor.visitTemplate(this);\n        };\n        return Template;\n    }());\n    var Content = /** @class */ (function () {\n        function Content(selector, attributes, sourceSpan, i18n) {\n            this.selector = selector;\n            this.attributes = attributes;\n            this.sourceSpan = sourceSpan;\n            this.i18n = i18n;\n            this.name = 'ng-content';\n        }\n        Content.prototype.visit = function (visitor) {\n            return visitor.visitContent(this);\n        };\n        return Content;\n    }());\n    var Variable = /** @class */ (function () {\n        function Variable(name, value, sourceSpan, keySpan, valueSpan) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n        }\n        Variable.prototype.visit = function (visitor) {\n            return visitor.visitVariable(this);\n        };\n        return Variable;\n    }());\n    var Reference = /** @class */ (function () {\n        function Reference(name, value, sourceSpan, keySpan, valueSpan) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n        }\n        Reference.prototype.visit = function (visitor) {\n            return visitor.visitReference(this);\n        };\n        return Reference;\n    }());\n    var Icu = /** @class */ (function () {\n        function Icu(vars, placeholders, sourceSpan, i18n) {\n            this.vars = vars;\n            this.placeholders = placeholders;\n            this.sourceSpan = sourceSpan;\n            this.i18n = i18n;\n        }\n        Icu.prototype.visit = function (visitor) {\n            return visitor.visitIcu(this);\n        };\n        return Icu;\n    }());\n    var NullVisitor = /** @class */ (function () {\n        function NullVisitor() {\n        }\n        NullVisitor.prototype.visitElement = function (element) { };\n        NullVisitor.prototype.visitTemplate = function (template) { };\n        NullVisitor.prototype.visitContent = function (content) { };\n        NullVisitor.prototype.visitVariable = function (variable) { };\n        NullVisitor.prototype.visitReference = function (reference) { };\n        NullVisitor.prototype.visitTextAttribute = function (attribute) { };\n        NullVisitor.prototype.visitBoundAttribute = function (attribute) { };\n        NullVisitor.prototype.visitBoundEvent = function (attribute) { };\n        NullVisitor.prototype.visitText = function (text) { };\n        NullVisitor.prototype.visitBoundText = function (text) { };\n        NullVisitor.prototype.visitIcu = function (icu) { };\n        return NullVisitor;\n    }());\n    var RecursiveVisitor = /** @class */ (function () {\n        function RecursiveVisitor() {\n        }\n        RecursiveVisitor.prototype.visitElement = function (element) {\n            visitAll(this, element.attributes);\n            visitAll(this, element.inputs);\n            visitAll(this, element.outputs);\n            visitAll(this, element.children);\n            visitAll(this, element.references);\n        };\n        RecursiveVisitor.prototype.visitTemplate = function (template) {\n            visitAll(this, template.attributes);\n            visitAll(this, template.inputs);\n            visitAll(this, template.outputs);\n            visitAll(this, template.children);\n            visitAll(this, template.references);\n            visitAll(this, template.variables);\n        };\n        RecursiveVisitor.prototype.visitContent = function (content) { };\n        RecursiveVisitor.prototype.visitVariable = function (variable) { };\n        RecursiveVisitor.prototype.visitReference = function (reference) { };\n        RecursiveVisitor.prototype.visitTextAttribute = function (attribute) { };\n        RecursiveVisitor.prototype.visitBoundAttribute = function (attribute) { };\n        RecursiveVisitor.prototype.visitBoundEvent = function (attribute) { };\n        RecursiveVisitor.prototype.visitText = function (text) { };\n        RecursiveVisitor.prototype.visitBoundText = function (text) { };\n        RecursiveVisitor.prototype.visitIcu = function (icu) { };\n        return RecursiveVisitor;\n    }());\n    var TransformVisitor = /** @class */ (function () {\n        function TransformVisitor() {\n        }\n        TransformVisitor.prototype.visitElement = function (element) {\n            var newAttributes = transformAll(this, element.attributes);\n            var newInputs = transformAll(this, element.inputs);\n            var newOutputs = transformAll(this, element.outputs);\n            var newChildren = transformAll(this, element.children);\n            var newReferences = transformAll(this, element.references);\n            if (newAttributes != element.attributes || newInputs != element.inputs ||\n                newOutputs != element.outputs || newChildren != element.children ||\n                newReferences != element.references) {\n                return new Element(element.name, newAttributes, newInputs, newOutputs, newChildren, newReferences, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n            }\n            return element;\n        };\n        TransformVisitor.prototype.visitTemplate = function (template) {\n            var newAttributes = transformAll(this, template.attributes);\n            var newInputs = transformAll(this, template.inputs);\n            var newOutputs = transformAll(this, template.outputs);\n            var newTemplateAttrs = transformAll(this, template.templateAttrs);\n            var newChildren = transformAll(this, template.children);\n            var newReferences = transformAll(this, template.references);\n            var newVariables = transformAll(this, template.variables);\n            if (newAttributes != template.attributes || newInputs != template.inputs ||\n                newOutputs != template.outputs || newTemplateAttrs != template.templateAttrs ||\n                newChildren != template.children || newReferences != template.references ||\n                newVariables != template.variables) {\n                return new Template(template.tagName, newAttributes, newInputs, newOutputs, newTemplateAttrs, newChildren, newReferences, newVariables, template.sourceSpan, template.startSourceSpan, template.endSourceSpan);\n            }\n            return template;\n        };\n        TransformVisitor.prototype.visitContent = function (content) {\n            return content;\n        };\n        TransformVisitor.prototype.visitVariable = function (variable) {\n            return variable;\n        };\n        TransformVisitor.prototype.visitReference = function (reference) {\n            return reference;\n        };\n        TransformVisitor.prototype.visitTextAttribute = function (attribute) {\n            return attribute;\n        };\n        TransformVisitor.prototype.visitBoundAttribute = function (attribute) {\n            return attribute;\n        };\n        TransformVisitor.prototype.visitBoundEvent = function (attribute) {\n            return attribute;\n        };\n        TransformVisitor.prototype.visitText = function (text) {\n            return text;\n        };\n        TransformVisitor.prototype.visitBoundText = function (text) {\n            return text;\n        };\n        TransformVisitor.prototype.visitIcu = function (icu) {\n            return icu;\n        };\n        return TransformVisitor;\n    }());\n    function visitAll(visitor, nodes) {\n        var e_1, _a, e_2, _b;\n        var result = [];\n        if (visitor.visit) {\n            try {\n                for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {\n                    var node = nodes_1_1.value;\n                    var newNode = visitor.visit(node) || node.visit(visitor);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        }\n        else {\n            try {\n                for (var nodes_2 = __values(nodes), nodes_2_1 = nodes_2.next(); !nodes_2_1.done; nodes_2_1 = nodes_2.next()) {\n                    var node = nodes_2_1.value;\n                    var newNode = node.visit(visitor);\n                    if (newNode) {\n                        result.push(newNode);\n                    }\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (nodes_2_1 && !nodes_2_1.done && (_b = nodes_2.return)) _b.call(nodes_2);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n        }\n        return result;\n    }\n    function transformAll(visitor, nodes) {\n        var e_3, _a;\n        var result = [];\n        var changed = false;\n        try {\n            for (var nodes_3 = __values(nodes), nodes_3_1 = nodes_3.next(); !nodes_3_1.done; nodes_3_1 = nodes_3.next()) {\n                var node = nodes_3_1.value;\n                var newNode = node.visit(visitor);\n                if (newNode) {\n                    result.push(newNode);\n                }\n                changed = changed || newNode != node;\n            }\n        }\n        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n        finally {\n            try {\n                if (nodes_3_1 && !nodes_3_1.done && (_a = nodes_3.return)) _a.call(nodes_3);\n            }\n            finally { if (e_3) throw e_3.error; }\n        }\n        return changed ? result : nodes;\n    }\n\n    /**\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://angular.io/license\n     */\n    var Message = /** @class */ (function () {\n        /**\n         * @param nodes message AST\n         * @param placeholders maps placeholder names to static content and their source spans\n         * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)\n         * @param meaning\n         * @param description\n         * @param customId\n         */\n        function Message(nodes, placeholders, placeholderToMessage, meaning, description, customId) {\n            this.nodes = nodes;\n            this.placeholders = placeholders;\n            this.placeholderToMessage = placeholderToMessage;\n            this.meaning = meaning;\n            this.description = description;\n            this.customId = customId;\n            this.id = this.customId;\n            /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */\n            this.legacyIds = [];\n            if (nodes.length) {\n                this.sources = [{\n                        filePath: nodes[0].sourceSpan.start.file.url,\n                        startLine: nodes[0].sourceSpan.start.line + 1,\n                        startCol: nodes[0].sourceSpan.start.col + 1,\n                        endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,\n                        endCol: nodes[0].sourceSpan.start.col + 1\n                    }];\n            }\n            else {\n                this.sources = [];\n            }\n        }\n        return Message;\n    }());\n    var Text$1 = /** @class */ (function () {\n        function Text(value, sourceSpan) {\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        Text.prototype.visit = function (visitor, context) {\n            return visitor.visitText(this, context);\n        };\n        return Text;\n    }());\n    // TODO(vicb): do we really need this node (vs an array) ?\n    var Container = /** @class */ (function () {\n        function Container(children, sourceSpan) {\n            this.children = children;\n            this.sourceSpan = sourceSpan;\n        }\n        Container.prototype.visit = function (visitor, context) {\n            return visitor.visitContainer(this, context);\n        };\n        return Container;\n    }());\n    var Icu$1 = /** @class */ (function () {\n        function Icu(expression, type, cases, sourceSpan) {\n            this.expression = expression;\n            this.type = type;\n            this.cases = cases;\n            this.sourceSpan = sourceSpan;\n        }\n        Icu.prototype.visit = function (visitor, context) {\n            return visitor.visitIcu(this, context);\n        };\n        return Icu;\n    }());\n    var TagPlaceholder = /** @class */ (function () {\n        function TagPlaceholder(tag, attrs, startName, closeName, children, isVoid, \n        // TODO sourceSpan should cover all (we need a startSourceSpan and endSourceSpan)\n        sourceSpan, startSourceSpan, endSourceSpan) {\n            this.tag = tag;\n            this.attrs = attrs;\n            this.startName = startName;\n            this.closeName = closeName;\n            this.children = children;\n            this.isVoid = isVoid;\n            this.sourceSpan = sourceSpan;\n            this.startSourceSpan = startSourceSpan;\n            this.endSourceSpan = endSourceSpan;\n        }\n        TagPlaceholder.prototype.visit = function (visitor, context) {\n            return visitor.visitTagPlaceholder(this, context);\n        };\n        return TagPlaceholder;\n    }());\n    var Placeholder = /** @class */ (function () {\n        function Placeholder(value, name, sourceSpan) {\n            this.value = value;\n            this.name = name;\n            this.sourceSpan = sourceSpan;\n        }\n        Placeholder.prototype.visit = function (visitor, context) {\n            return visitor.visitPlaceholder(this, context);\n        };\n        return Placeholder;\n    }());\n    var IcuPlaceholder = /** @class */ (function () {\n        function IcuPlaceholder(value, name, sourceSpan) {\n            this.value = value;\n            this.name = name;\n            this.sourceSpan = sourceSpan;\n        }\n        IcuPlaceholder.prototype.visit = function (visitor, context) {\n            return visitor.visitIcuPlaceholder(this, context);\n        };\n        return IcuPlaceholder;\n    }());\n    // Clone the AST\n    var CloneVisitor = /** @class */ (function () {\n        function CloneVisitor() {\n        }\n        CloneVisitor.prototype.visitText = function (text, context) {\n            return new Text$1(text.value, text.sourceSpan);\n        };\n        CloneVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            var children = container.children.map(function (n) { return n.visit(_this, context); });\n            return new Container(children, container.sourceSpan);\n        };\n        CloneVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var cases = {};\n            Object.keys(icu.cases).forEach(function (key) { return cases[key] = icu.cases[key].visit(_this, context); });\n            var msg = new Icu$1(icu.expression, icu.type, cases, icu.sourceSpan);\n            msg.expressionPlaceholder = icu.expressionPlaceholder;\n            return msg;\n        };\n        CloneVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var _this = this;\n            var children = ph.children.map(function (n) { return n.visit(_this, context); });\n            return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);\n        };\n        CloneVisitor.prototype.visitPlaceholder = function (ph, context) {\n            return new Placeholder(ph.value, ph.name, ph.sourceSpan);\n        };\n        CloneVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);\n        };\n        return CloneVisitor;\n    }());\n    // Visit all the nodes recursively\n    var RecurseVisitor = /** @class */ (function () {\n        function RecurseVisitor() {\n        }\n        RecurseVisitor.prototype.visitText = function (text, context) { };\n        RecurseVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            container.children.forEach(function (child) { return child.visit(_this); });\n        };\n        RecurseVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            Object.keys(icu.cases).forEach(function (k) {\n                icu.cases[k].visit(_this);\n            });\n        };\n        RecurseVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var _this = this;\n            ph.children.forEach(function (child) { return child.visit(_this); });\n        };\n        RecurseVisitor.prototype.visitPlaceholder = function (ph, context) { };\n        RecurseVisitor.prototype.visitIcuPlaceholder = function (ph, context) { };\n        return RecurseVisitor;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Represents a big integer using a buffer of its individual digits, with the least significant\n     * digit stored at the beginning of the array (little endian).\n     *\n     * For performance reasons, each instance is mutable. The addition operation can be done in-place\n     * to reduce memory pressure of allocation for the digits array.\n     */\n    var BigInteger = /** @class */ (function () {\n        /**\n         * Creates a big integer using its individual digits in little endian storage.\n         */\n        function BigInteger(digits) {\n            this.digits = digits;\n        }\n        BigInteger.zero = function () {\n            return new BigInteger([0]);\n        };\n        BigInteger.one = function () {\n            return new BigInteger([1]);\n        };\n        /**\n         * Creates a clone of this instance.\n         */\n        BigInteger.prototype.clone = function () {\n            return new BigInteger(this.digits.slice());\n        };\n        /**\n         * Returns a new big integer with the sum of `this` and `other` as its value. This does not mutate\n         * `this` but instead returns a new instance, unlike `addToSelf`.\n         */\n        BigInteger.prototype.add = function (other) {\n            var result = this.clone();\n            result.addToSelf(other);\n            return result;\n        };\n        /**\n         * Adds `other` to the instance itself, thereby mutating its value.\n         */\n        BigInteger.prototype.addToSelf = function (other) {\n            var maxNrOfDigits = Math.max(this.digits.length, other.digits.length);\n            var carry = 0;\n            for (var i = 0; i < maxNrOfDigits; i++) {\n                var digitSum = carry;\n                if (i < this.digits.length) {\n                    digitSum += this.digits[i];\n                }\n                if (i < other.digits.length) {\n                    digitSum += other.digits[i];\n                }\n                if (digitSum >= 10) {\n                    this.digits[i] = digitSum - 10;\n                    carry = 1;\n                }\n                else {\n                    this.digits[i] = digitSum;\n                    carry = 0;\n                }\n            }\n            // Apply a remaining carry if needed.\n            if (carry > 0) {\n                this.digits[maxNrOfDigits] = 1;\n            }\n        };\n        /**\n         * Builds the decimal string representation of the big integer. As this is stored in\n         * little endian, the digits are concatenated in reverse order.\n         */\n        BigInteger.prototype.toString = function () {\n            var res = '';\n            for (var i = this.digits.length - 1; i >= 0; i--) {\n                res += this.digits[i];\n            }\n            return res;\n        };\n        return BigInteger;\n    }());\n    /**\n     * Represents a big integer which is optimized for multiplication operations, as its power-of-twos\n     * are memoized. See `multiplyBy()` for details on the multiplication algorithm.\n     */\n    var BigIntForMultiplication = /** @class */ (function () {\n        function BigIntForMultiplication(value) {\n            this.powerOfTwos = [value];\n        }\n        /**\n         * Returns the big integer itself.\n         */\n        BigIntForMultiplication.prototype.getValue = function () {\n            return this.powerOfTwos[0];\n        };\n        /**\n         * Computes the value for `num * b`, where `num` is a JS number and `b` is a big integer. The\n         * value for `b` is represented by a storage model that is optimized for this computation.\n         *\n         * This operation is implemented in N(log2(num)) by continuous halving of the number, where the\n         * least-significant bit (LSB) is tested in each iteration. If the bit is set, the bit's index is\n         * used as exponent into the power-of-two multiplication of `b`.\n         *\n         * As an example, consider the multiplication num=42, b=1337. In binary 42 is 0b00101010 and the\n         * algorithm unrolls into the following iterations:\n         *\n         *  Iteration | num        | LSB  | b * 2^iter | Add? | product\n         * -----------|------------|------|------------|------|--------\n         *  0         | 0b00101010 | 0    | 1337       | No   | 0\n         *  1         | 0b00010101 | 1    | 2674       | Yes  | 2674\n         *  2         | 0b00001010 | 0    | 5348       | No   | 2674\n         *  3         | 0b00000101 | 1    | 10696      | Yes  | 13370\n         *  4         | 0b00000010 | 0    | 21392      | No   | 13370\n         *  5         | 0b00000001 | 1    | 42784      | Yes  | 56154\n         *  6         | 0b00000000 | 0    | 85568      | No   | 56154\n         *\n         * The computed product of 56154 is indeed the correct result.\n         *\n         * The `BigIntForMultiplication` representation for a big integer provides memoized access to the\n         * power-of-two values to reduce the workload in computing those values.\n         */\n        BigIntForMultiplication.prototype.multiplyBy = function (num) {\n            var product = BigInteger.zero();\n            this.multiplyByAndAddTo(num, product);\n            return product;\n        };\n        /**\n         * See `multiplyBy()` for details. This function allows for the computed product to be added\n         * directly to the provided result big integer.\n         */\n        BigIntForMultiplication.prototype.multiplyByAndAddTo = function (num, result) {\n            for (var exponent = 0; num !== 0; num = num >>> 1, exponent++) {\n                if (num & 1) {\n                    var value = this.getMultipliedByPowerOfTwo(exponent);\n                    result.addToSelf(value);\n                }\n            }\n        };\n        /**\n         * Computes and memoizes the big integer value for `this.number * 2^exponent`.\n         */\n        BigIntForMultiplication.prototype.getMultipliedByPowerOfTwo = function (exponent) {\n            // Compute the powers up until the requested exponent, where each value is computed from its\n            // predecessor. This is simple as `this.number * 2^(exponent - 1)` only has to be doubled (i.e.\n            // added to itself) to reach `this.number * 2^exponent`.\n            for (var i = this.powerOfTwos.length; i <= exponent; i++) {\n                var previousPower = this.powerOfTwos[i - 1];\n                this.powerOfTwos[i] = previousPower.add(previousPower);\n            }\n            return this.powerOfTwos[exponent];\n        };\n        return BigIntForMultiplication;\n    }());\n    /**\n     * Represents an exponentiation operation for the provided base, of which exponents are computed and\n     * memoized. The results are represented by a `BigIntForMultiplication` which is tailored for\n     * multiplication operations by memoizing the power-of-twos. This effectively results in a matrix\n     * representation that is lazily computed upon request.\n     */\n    var BigIntExponentiation = /** @class */ (function () {\n        function BigIntExponentiation(base) {\n            this.base = base;\n            this.exponents = [new BigIntForMultiplication(BigInteger.one())];\n        }\n        /**\n         * Compute the value for `this.base^exponent`, resulting in a big integer that is optimized for\n         * further multiplication operations.\n         */\n        BigIntExponentiation.prototype.toThePowerOf = function (exponent) {\n            // Compute the results up until the requested exponent, where every value is computed from its\n            // predecessor. This is because `this.base^(exponent - 1)` only has to be multiplied by `base`\n            // to reach `this.base^exponent`.\n            for (var i = this.exponents.length; i <= exponent; i++) {\n                var value = this.exponents[i - 1].multiplyBy(this.base);\n                this.exponents[i] = new BigIntForMultiplication(value);\n            }\n            return this.exponents[exponent];\n        };\n        return BigIntExponentiation;\n    }());\n\n    /**\n     * Return the message id or compute it using the XLIFF1 digest.\n     */\n    function digest(message) {\n        return message.id || computeDigest(message);\n    }\n    /**\n     * Compute the message id using the XLIFF1 digest.\n     */\n    function computeDigest(message) {\n        return sha1(serializeNodes(message.nodes).join('') + (\"[\" + message.meaning + \"]\"));\n    }\n    /**\n     * Return the message id or compute it using the XLIFF2/XMB/$localize digest.\n     */\n    function decimalDigest(message) {\n        return message.id || computeDecimalDigest(message);\n    }\n    /**\n     * Compute the message id using the XLIFF2/XMB/$localize digest.\n     */\n    function computeDecimalDigest(message) {\n        var visitor = new _SerializerIgnoreIcuExpVisitor();\n        var parts = message.nodes.map(function (a) { return a.visit(visitor, null); });\n        return computeMsgId(parts.join(''), message.meaning);\n    }\n    /**\n     * Serialize the i18n ast to something xml-like in order to generate an UID.\n     *\n     * The visitor is also used in the i18n parser tests\n     *\n     * @internal\n     */\n    var _SerializerVisitor = /** @class */ (function () {\n        function _SerializerVisitor() {\n        }\n        _SerializerVisitor.prototype.visitText = function (text, context) {\n            return text.value;\n        };\n        _SerializerVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            return \"[\" + container.children.map(function (child) { return child.visit(_this); }).join(', ') + \"]\";\n        };\n        _SerializerVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var strCases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n            return \"{\" + icu.expression + \", \" + icu.type + \", \" + strCases.join(', ') + \"}\";\n        };\n        _SerializerVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var _this = this;\n            return ph.isVoid ?\n                \"<ph tag name=\\\"\" + ph.startName + \"\\\"/>\" :\n                \"<ph tag name=\\\"\" + ph.startName + \"\\\">\" + ph.children.map(function (child) { return child.visit(_this); }).join(', ') + \"</ph name=\\\"\" + ph.closeName + \"\\\">\";\n        };\n        _SerializerVisitor.prototype.visitPlaceholder = function (ph, context) {\n            return ph.value ? \"<ph name=\\\"\" + ph.name + \"\\\">\" + ph.value + \"</ph>\" : \"<ph name=\\\"\" + ph.name + \"\\\"/>\";\n        };\n        _SerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            return \"<ph icu name=\\\"\" + ph.name + \"\\\">\" + ph.value.visit(this) + \"</ph>\";\n        };\n        return _SerializerVisitor;\n    }());\n    var serializerVisitor = new _SerializerVisitor();\n    function serializeNodes(nodes) {\n        return nodes.map(function (a) { return a.visit(serializerVisitor, null); });\n    }\n    /**\n     * Serialize the i18n ast to something xml-like in order to generate an UID.\n     *\n     * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.\n     *\n     * @internal\n     */\n    var _SerializerIgnoreIcuExpVisitor = /** @class */ (function (_super) {\n        __extends(_SerializerIgnoreIcuExpVisitor, _super);\n        function _SerializerIgnoreIcuExpVisitor() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        _SerializerIgnoreIcuExpVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var strCases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n            // Do not take the expression into account\n            return \"{\" + icu.type + \", \" + strCases.join(', ') + \"}\";\n        };\n        return _SerializerIgnoreIcuExpVisitor;\n    }(_SerializerVisitor));\n    /**\n     * Compute the SHA1 of the given string\n     *\n     * see https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\n     *\n     * WARNING: this function has not been designed not tested with security in mind.\n     *          DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.\n     */\n    function sha1(str) {\n        var utf8 = utf8Encode(str);\n        var words32 = bytesToWords32(utf8, Endian.Big);\n        var len = utf8.length * 8;\n        var w = newArray(80);\n        var a = 0x67452301, b = 0xefcdab89, c = 0x98badcfe, d = 0x10325476, e = 0xc3d2e1f0;\n        words32[len >> 5] |= 0x80 << (24 - len % 32);\n        words32[((len + 64 >> 9) << 4) + 15] = len;\n        for (var i = 0; i < words32.length; i += 16) {\n            var h0 = a, h1 = b, h2 = c, h3 = d, h4 = e;\n            for (var j = 0; j < 80; j++) {\n                if (j < 16) {\n                    w[j] = words32[i + j];\n                }\n                else {\n                    w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n                }\n                var fkVal = fk(j, b, c, d);\n                var f = fkVal[0];\n                var k = fkVal[1];\n                var temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);\n                e = d;\n                d = c;\n                c = rol32(b, 30);\n                b = a;\n                a = temp;\n            }\n            a = add32(a, h0);\n            b = add32(b, h1);\n            c = add32(c, h2);\n            d = add32(d, h3);\n            e = add32(e, h4);\n        }\n        return bytesToHexString(words32ToByteString([a, b, c, d, e]));\n    }\n    function fk(index, b, c, d) {\n        if (index < 20) {\n            return [(b & c) | (~b & d), 0x5a827999];\n        }\n        if (index < 40) {\n            return [b ^ c ^ d, 0x6ed9eba1];\n        }\n        if (index < 60) {\n            return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];\n        }\n        return [b ^ c ^ d, 0xca62c1d6];\n    }\n    /**\n     * Compute the fingerprint of the given string\n     *\n     * The output is 64 bit number encoded as a decimal string\n     *\n     * based on:\n     * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java\n     */\n    function fingerprint(str) {\n        var utf8 = utf8Encode(str);\n        var hi = hash32(utf8, 0);\n        var lo = hash32(utf8, 102072);\n        if (hi == 0 && (lo == 0 || lo == 1)) {\n            hi = hi ^ 0x130f9bef;\n            lo = lo ^ -0x6b5f56d8;\n        }\n        return [hi, lo];\n    }\n    function computeMsgId(msg, meaning) {\n        if (meaning === void 0) { meaning = ''; }\n        var msgFingerprint = fingerprint(msg);\n        if (meaning) {\n            var meaningFingerprint = fingerprint(meaning);\n            msgFingerprint = add64(rol64(msgFingerprint, 1), meaningFingerprint);\n        }\n        var hi = msgFingerprint[0];\n        var lo = msgFingerprint[1];\n        return wordsToDecimalString(hi & 0x7fffffff, lo);\n    }\n    function hash32(bytes, c) {\n        var a = 0x9e3779b9, b = 0x9e3779b9;\n        var i;\n        var len = bytes.length;\n        for (i = 0; i + 12 <= len; i += 12) {\n            a = add32(a, wordAt(bytes, i, Endian.Little));\n            b = add32(b, wordAt(bytes, i + 4, Endian.Little));\n            c = add32(c, wordAt(bytes, i + 8, Endian.Little));\n            var res = mix(a, b, c);\n            a = res[0], b = res[1], c = res[2];\n        }\n        a = add32(a, wordAt(bytes, i, Endian.Little));\n        b = add32(b, wordAt(bytes, i + 4, Endian.Little));\n        // the first byte of c is reserved for the length\n        c = add32(c, len);\n        c = add32(c, wordAt(bytes, i + 8, Endian.Little) << 8);\n        return mix(a, b, c)[2];\n    }\n    // clang-format off\n    function mix(a, b, c) {\n        a = sub32(a, b);\n        a = sub32(a, c);\n        a ^= c >>> 13;\n        b = sub32(b, c);\n        b = sub32(b, a);\n        b ^= a << 8;\n        c = sub32(c, a);\n        c = sub32(c, b);\n        c ^= b >>> 13;\n        a = sub32(a, b);\n        a = sub32(a, c);\n        a ^= c >>> 12;\n        b = sub32(b, c);\n        b = sub32(b, a);\n        b ^= a << 16;\n        c = sub32(c, a);\n        c = sub32(c, b);\n        c ^= b >>> 5;\n        a = sub32(a, b);\n        a = sub32(a, c);\n        a ^= c >>> 3;\n        b = sub32(b, c);\n        b = sub32(b, a);\n        b ^= a << 10;\n        c = sub32(c, a);\n        c = sub32(c, b);\n        c ^= b >>> 15;\n        return [a, b, c];\n    }\n    // clang-format on\n    // Utils\n    var Endian;\n    (function (Endian) {\n        Endian[Endian[\"Little\"] = 0] = \"Little\";\n        Endian[Endian[\"Big\"] = 1] = \"Big\";\n    })(Endian || (Endian = {}));\n    function add32(a, b) {\n        return add32to64(a, b)[1];\n    }\n    function add32to64(a, b) {\n        var low = (a & 0xffff) + (b & 0xffff);\n        var high = (a >>> 16) + (b >>> 16) + (low >>> 16);\n        return [high >>> 16, (high << 16) | (low & 0xffff)];\n    }\n    function add64(a, b) {\n        var ah = a[0], al = a[1];\n        var bh = b[0], bl = b[1];\n        var result = add32to64(al, bl);\n        var carry = result[0];\n        var l = result[1];\n        var h = add32(add32(ah, bh), carry);\n        return [h, l];\n    }\n    function sub32(a, b) {\n        var low = (a & 0xffff) - (b & 0xffff);\n        var high = (a >> 16) - (b >> 16) + (low >> 16);\n        return (high << 16) | (low & 0xffff);\n    }\n    // Rotate a 32b number left `count` position\n    function rol32(a, count) {\n        return (a << count) | (a >>> (32 - count));\n    }\n    // Rotate a 64b number left `count` position\n    function rol64(num, count) {\n        var hi = num[0], lo = num[1];\n        var h = (hi << count) | (lo >>> (32 - count));\n        var l = (lo << count) | (hi >>> (32 - count));\n        return [h, l];\n    }\n    function bytesToWords32(bytes, endian) {\n        var size = (bytes.length + 3) >>> 2;\n        var words32 = [];\n        for (var i = 0; i < size; i++) {\n            words32[i] = wordAt(bytes, i * 4, endian);\n        }\n        return words32;\n    }\n    function byteAt(bytes, index) {\n        return index >= bytes.length ? 0 : bytes[index];\n    }\n    function wordAt(bytes, index, endian) {\n        var word = 0;\n        if (endian === Endian.Big) {\n            for (var i = 0; i < 4; i++) {\n                word += byteAt(bytes, index + i) << (24 - 8 * i);\n            }\n        }\n        else {\n            for (var i = 0; i < 4; i++) {\n                word += byteAt(bytes, index + i) << 8 * i;\n            }\n        }\n        return word;\n    }\n    function words32ToByteString(words32) {\n        return words32.reduce(function (bytes, word) { return bytes.concat(word32ToByteString(word)); }, []);\n    }\n    function word32ToByteString(word) {\n        var bytes = [];\n        for (var i = 0; i < 4; i++) {\n            bytes.push((word >>> 8 * (3 - i)) & 0xff);\n        }\n        return bytes;\n    }\n    function bytesToHexString(bytes) {\n        var hex = '';\n        for (var i = 0; i < bytes.length; i++) {\n            var b = byteAt(bytes, i);\n            hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);\n        }\n        return hex.toLowerCase();\n    }\n    /**\n     * Create a shared exponentiation pool for base-256 computations. This shared pool provides memoized\n     * power-of-256 results with memoized power-of-two computations for efficient multiplication.\n     *\n     * For our purposes, this can be safely stored as a global without memory concerns. The reason is\n     * that we encode two words, so only need the 0th (for the low word) and 4th (for the high word)\n     * exponent.\n     */\n    var base256 = new BigIntExponentiation(256);\n    /**\n     * Represents two 32-bit words as a single decimal number. This requires a big integer storage\n     * model as JS numbers are not accurate enough to represent the 64-bit number.\n     *\n     * Based on https://www.danvk.org/hex2dec.html\n     */\n    function wordsToDecimalString(hi, lo) {\n        // Encode the four bytes in lo in the lower digits of the decimal number.\n        // Note: the multiplication results in lo itself but represented by a big integer using its\n        // decimal digits.\n        var decimal = base256.toThePowerOf(0).multiplyBy(lo);\n        // Encode the four bytes in hi above the four lo bytes. lo is a maximum of (2^8)^4, which is why\n        // this multiplication factor is applied.\n        base256.toThePowerOf(4).multiplyByAndAddTo(hi, decimal);\n        return decimal.toString();\n    }\n\n    var Serializer = /** @class */ (function () {\n        function Serializer() {\n        }\n        // Creates a name mapper, see `PlaceholderMapper`\n        // Returning `null` means that no name mapping is used.\n        Serializer.prototype.createNameMapper = function (message) {\n            return null;\n        };\n        return Serializer;\n    }());\n    /**\n     * A simple mapper that take a function to transform an internal name to a public name\n     */\n    var SimplePlaceholderMapper = /** @class */ (function (_super) {\n        __extends(SimplePlaceholderMapper, _super);\n        // create a mapping from the message\n        function SimplePlaceholderMapper(message, mapName) {\n            var _this = _super.call(this) || this;\n            _this.mapName = mapName;\n            _this.internalToPublic = {};\n            _this.publicToNextId = {};\n            _this.publicToInternal = {};\n            message.nodes.forEach(function (node) { return node.visit(_this); });\n            return _this;\n        }\n        SimplePlaceholderMapper.prototype.toPublicName = function (internalName) {\n            return this.internalToPublic.hasOwnProperty(internalName) ?\n                this.internalToPublic[internalName] :\n                null;\n        };\n        SimplePlaceholderMapper.prototype.toInternalName = function (publicName) {\n            return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :\n                null;\n        };\n        SimplePlaceholderMapper.prototype.visitText = function (text, context) {\n            return null;\n        };\n        SimplePlaceholderMapper.prototype.visitTagPlaceholder = function (ph, context) {\n            this.visitPlaceholderName(ph.startName);\n            _super.prototype.visitTagPlaceholder.call(this, ph, context);\n            this.visitPlaceholderName(ph.closeName);\n        };\n        SimplePlaceholderMapper.prototype.visitPlaceholder = function (ph, context) {\n            this.visitPlaceholderName(ph.name);\n        };\n        SimplePlaceholderMapper.prototype.visitIcuPlaceholder = function (ph, context) {\n            this.visitPlaceholderName(ph.name);\n        };\n        // XMB placeholders could only contains A-Z, 0-9 and _\n        SimplePlaceholderMapper.prototype.visitPlaceholderName = function (internalName) {\n            if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n                return;\n            }\n            var publicName = this.mapName(internalName);\n            if (this.publicToInternal.hasOwnProperty(publicName)) {\n                // Create a new XMB when it has already been used\n                var nextId = this.publicToNextId[publicName];\n                this.publicToNextId[publicName] = nextId + 1;\n                publicName = publicName + \"_\" + nextId;\n            }\n            else {\n                this.publicToNextId[publicName] = 1;\n            }\n            this.internalToPublic[internalName] = publicName;\n            this.publicToInternal[publicName] = internalName;\n        };\n        return SimplePlaceholderMapper;\n    }(RecurseVisitor));\n\n    /**\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://angular.io/license\n     */\n    var _Visitor = /** @class */ (function () {\n        function _Visitor() {\n        }\n        _Visitor.prototype.visitTag = function (tag) {\n            var _this = this;\n            var strAttrs = this._serializeAttributes(tag.attrs);\n            if (tag.children.length == 0) {\n                return \"<\" + tag.name + strAttrs + \"/>\";\n            }\n            var strChildren = tag.children.map(function (node) { return node.visit(_this); });\n            return \"<\" + tag.name + strAttrs + \">\" + strChildren.join('') + \"</\" + tag.name + \">\";\n        };\n        _Visitor.prototype.visitText = function (text) {\n            return text.value;\n        };\n        _Visitor.prototype.visitDeclaration = function (decl) {\n            return \"<?xml\" + this._serializeAttributes(decl.attrs) + \" ?>\";\n        };\n        _Visitor.prototype._serializeAttributes = function (attrs) {\n            var strAttrs = Object.keys(attrs).map(function (name) { return name + \"=\\\"\" + attrs[name] + \"\\\"\"; }).join(' ');\n            return strAttrs.length > 0 ? ' ' + strAttrs : '';\n        };\n        _Visitor.prototype.visitDoctype = function (doctype) {\n            return \"<!DOCTYPE \" + doctype.rootTag + \" [\\n\" + doctype.dtd + \"\\n]>\";\n        };\n        return _Visitor;\n    }());\n    var _visitor = new _Visitor();\n    function serialize(nodes) {\n        return nodes.map(function (node) { return node.visit(_visitor); }).join('');\n    }\n    var Declaration = /** @class */ (function () {\n        function Declaration(unescapedAttrs) {\n            var _this = this;\n            this.attrs = {};\n            Object.keys(unescapedAttrs).forEach(function (k) {\n                _this.attrs[k] = escapeXml(unescapedAttrs[k]);\n            });\n        }\n        Declaration.prototype.visit = function (visitor) {\n            return visitor.visitDeclaration(this);\n        };\n        return Declaration;\n    }());\n    var Doctype = /** @class */ (function () {\n        function Doctype(rootTag, dtd) {\n            this.rootTag = rootTag;\n            this.dtd = dtd;\n        }\n        Doctype.prototype.visit = function (visitor) {\n            return visitor.visitDoctype(this);\n        };\n        return Doctype;\n    }());\n    var Tag = /** @class */ (function () {\n        function Tag(name, unescapedAttrs, children) {\n            var _this = this;\n            if (unescapedAttrs === void 0) { unescapedAttrs = {}; }\n            if (children === void 0) { children = []; }\n            this.name = name;\n            this.children = children;\n            this.attrs = {};\n            Object.keys(unescapedAttrs).forEach(function (k) {\n                _this.attrs[k] = escapeXml(unescapedAttrs[k]);\n            });\n        }\n        Tag.prototype.visit = function (visitor) {\n            return visitor.visitTag(this);\n        };\n        return Tag;\n    }());\n    var Text$2 = /** @class */ (function () {\n        function Text(unescapedValue) {\n            this.value = escapeXml(unescapedValue);\n        }\n        Text.prototype.visit = function (visitor) {\n            return visitor.visitText(this);\n        };\n        return Text;\n    }());\n    var CR = /** @class */ (function (_super) {\n        __extends(CR, _super);\n        function CR(ws) {\n            if (ws === void 0) { ws = 0; }\n            return _super.call(this, \"\\n\" + new Array(ws + 1).join(' ')) || this;\n        }\n        return CR;\n    }(Text$2));\n    var _ESCAPED_CHARS = [\n        [/&/g, '&amp;'],\n        [/\"/g, '&quot;'],\n        [/'/g, '&apos;'],\n        [/</g, '&lt;'],\n        [/>/g, '&gt;'],\n    ];\n    // Escape `_ESCAPED_CHARS` characters in the given text with encoded entities\n    function escapeXml(text) {\n        return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n    }\n\n    var _MESSAGES_TAG = 'messagebundle';\n    var _MESSAGE_TAG = 'msg';\n    var _PLACEHOLDER_TAG = 'ph';\n    var _EXAMPLE_TAG = 'ex';\n    var _SOURCE_TAG = 'source';\n    var _DOCTYPE = \"<!ELEMENT messagebundle (msg)*>\\n<!ATTLIST messagebundle class CDATA #IMPLIED>\\n\\n<!ELEMENT msg (#PCDATA|ph|source)*>\\n<!ATTLIST msg id CDATA #IMPLIED>\\n<!ATTLIST msg seq CDATA #IMPLIED>\\n<!ATTLIST msg name CDATA #IMPLIED>\\n<!ATTLIST msg desc CDATA #IMPLIED>\\n<!ATTLIST msg meaning CDATA #IMPLIED>\\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\\n<!ATTLIST msg xml:space (default|preserve) \\\"default\\\">\\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\\n\\n<!ELEMENT source (#PCDATA)>\\n\\n<!ELEMENT ph (#PCDATA|ex)*>\\n<!ATTLIST ph name CDATA #REQUIRED>\\n\\n<!ELEMENT ex (#PCDATA)>\";\n    var Xmb = /** @class */ (function (_super) {\n        __extends(Xmb, _super);\n        function Xmb() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        Xmb.prototype.write = function (messages, locale) {\n            var exampleVisitor = new ExampleVisitor();\n            var visitor = new _Visitor$1();\n            var rootNode = new Tag(_MESSAGES_TAG);\n            messages.forEach(function (message) {\n                var attrs = { id: message.id };\n                if (message.description) {\n                    attrs['desc'] = message.description;\n                }\n                if (message.meaning) {\n                    attrs['meaning'] = message.meaning;\n                }\n                var sourceTags = [];\n                message.sources.forEach(function (source) {\n                    sourceTags.push(new Tag(_SOURCE_TAG, {}, [new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))]));\n                });\n                rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, __spreadArray(__spreadArray([], __read(sourceTags)), __read(visitor.serialize(message.nodes)))));\n            });\n            rootNode.children.push(new CR());\n            return serialize([\n                new Declaration({ version: '1.0', encoding: 'UTF-8' }),\n                new CR(),\n                new Doctype(_MESSAGES_TAG, _DOCTYPE),\n                new CR(),\n                exampleVisitor.addDefaultExamples(rootNode),\n                new CR(),\n            ]);\n        };\n        Xmb.prototype.load = function (content, url) {\n            throw new Error('Unsupported');\n        };\n        Xmb.prototype.digest = function (message) {\n            return digest$1(message);\n        };\n        Xmb.prototype.createNameMapper = function (message) {\n            return new SimplePlaceholderMapper(message, toPublicName);\n        };\n        return Xmb;\n    }(Serializer));\n    var _Visitor$1 = /** @class */ (function () {\n        function _Visitor() {\n        }\n        _Visitor.prototype.visitText = function (text, context) {\n            return [new Text$2(text.value)];\n        };\n        _Visitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            var nodes = [];\n            container.children.forEach(function (node) { return nodes.push.apply(nodes, __spreadArray([], __read(node.visit(_this)))); });\n            return nodes;\n        };\n        _Visitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n            Object.keys(icu.cases).forEach(function (c) {\n                nodes.push.apply(nodes, __spreadArray(__spreadArray([new Text$2(c + \" {\")], __read(icu.cases[c].visit(_this))), [new Text$2(\"} \")]));\n            });\n            nodes.push(new Text$2(\"}\"));\n            return nodes;\n        };\n        _Visitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var startTagAsText = new Text$2(\"<\" + ph.tag + \">\");\n            var startEx = new Tag(_EXAMPLE_TAG, {}, [startTagAsText]);\n            // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n            var startTagPh = new Tag(_PLACEHOLDER_TAG, { name: ph.startName }, [startEx, startTagAsText]);\n            if (ph.isVoid) {\n                // void tags have no children nor closing tags\n                return [startTagPh];\n            }\n            var closeTagAsText = new Text$2(\"</\" + ph.tag + \">\");\n            var closeEx = new Tag(_EXAMPLE_TAG, {}, [closeTagAsText]);\n            // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n            var closeTagPh = new Tag(_PLACEHOLDER_TAG, { name: ph.closeName }, [closeEx, closeTagAsText]);\n            return __spreadArray(__spreadArray([startTagPh], __read(this.serialize(ph.children))), [closeTagPh]);\n        };\n        _Visitor.prototype.visitPlaceholder = function (ph, context) {\n            var interpolationAsText = new Text$2(\"{{\" + ph.value + \"}}\");\n            // Example tag needs to be not-empty for TC.\n            var exTag = new Tag(_EXAMPLE_TAG, {}, [interpolationAsText]);\n            return [\n                // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n                new Tag(_PLACEHOLDER_TAG, { name: ph.name }, [exTag, interpolationAsText])\n            ];\n        };\n        _Visitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            var icuExpression = ph.value.expression;\n            var icuType = ph.value.type;\n            var icuCases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');\n            var icuAsText = new Text$2(\"{\" + icuExpression + \", \" + icuType + \", \" + icuCases + \"}\");\n            var exTag = new Tag(_EXAMPLE_TAG, {}, [icuAsText]);\n            return [\n                // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n                new Tag(_PLACEHOLDER_TAG, { name: ph.name }, [exTag, icuAsText])\n            ];\n        };\n        _Visitor.prototype.serialize = function (nodes) {\n            var _this = this;\n            return [].concat.apply([], __spreadArray([], __read(nodes.map(function (node) { return node.visit(_this); }))));\n        };\n        return _Visitor;\n    }());\n    function digest$1(message) {\n        return decimalDigest(message);\n    }\n    // TC requires at least one non-empty example on placeholders\n    var ExampleVisitor = /** @class */ (function () {\n        function ExampleVisitor() {\n        }\n        ExampleVisitor.prototype.addDefaultExamples = function (node) {\n            node.visit(this);\n            return node;\n        };\n        ExampleVisitor.prototype.visitTag = function (tag) {\n            var _this = this;\n            if (tag.name === _PLACEHOLDER_TAG) {\n                if (!tag.children || tag.children.length == 0) {\n                    var exText = new Text$2(tag.attrs['name'] || '...');\n                    tag.children = [new Tag(_EXAMPLE_TAG, {}, [exText])];\n                }\n            }\n            else if (tag.children) {\n                tag.children.forEach(function (node) { return node.visit(_this); });\n            }\n        };\n        ExampleVisitor.prototype.visitText = function (text) { };\n        ExampleVisitor.prototype.visitDeclaration = function (decl) { };\n        ExampleVisitor.prototype.visitDoctype = function (doctype) { };\n        return ExampleVisitor;\n    }());\n    // XMB/XTB placeholders can only contain A-Z, 0-9 and _\n    function toPublicName(internalName) {\n        return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n    }\n\n    /* Closure variables holding messages must be named `MSG_[A-Z0-9]+` */\n    var CLOSURE_TRANSLATION_VAR_PREFIX = 'MSG_';\n    /**\n     * Prefix for non-`goog.getMsg` i18n-related vars.\n     * Note: the prefix uses lowercase characters intentionally due to a Closure behavior that\n     * considers variables like `I18N_0` as constants and throws an error when their value changes.\n     */\n    var TRANSLATION_VAR_PREFIX = 'i18n_';\n    /** Name of the i18n attributes **/\n    var I18N_ATTR = 'i18n';\n    var I18N_ATTR_PREFIX = 'i18n-';\n    /** Prefix of var expressions used in ICUs */\n    var I18N_ICU_VAR_PREFIX = 'VAR_';\n    /** Prefix of ICU expressions for post processing */\n    var I18N_ICU_MAPPING_PREFIX = 'I18N_EXP_';\n    /** Placeholder wrapper for i18n expressions **/\n    var I18N_PLACEHOLDER_SYMBOL = '�';\n    function isI18nAttribute(name) {\n        return name === I18N_ATTR || name.startsWith(I18N_ATTR_PREFIX);\n    }\n    function isI18nRootNode(meta) {\n        return meta instanceof Message;\n    }\n    function isSingleI18nIcu(meta) {\n        return isI18nRootNode(meta) && meta.nodes.length === 1 && meta.nodes[0] instanceof Icu$1;\n    }\n    function hasI18nMeta(node) {\n        return !!node.i18n;\n    }\n    function hasI18nAttrs(element) {\n        return element.attrs.some(function (attr) { return isI18nAttribute(attr.name); });\n    }\n    function icuFromI18nMessage(message) {\n        return message.nodes[0];\n    }\n    function wrapI18nPlaceholder(content, contextId) {\n        if (contextId === void 0) { contextId = 0; }\n        var blockId = contextId > 0 ? \":\" + contextId : '';\n        return \"\" + I18N_PLACEHOLDER_SYMBOL + content + blockId + I18N_PLACEHOLDER_SYMBOL;\n    }\n    function assembleI18nBoundString(strings, bindingStartIndex, contextId) {\n        if (bindingStartIndex === void 0) { bindingStartIndex = 0; }\n        if (contextId === void 0) { contextId = 0; }\n        if (!strings.length)\n            return '';\n        var acc = '';\n        var lastIdx = strings.length - 1;\n        for (var i = 0; i < lastIdx; i++) {\n            acc += \"\" + strings[i] + wrapI18nPlaceholder(bindingStartIndex + i, contextId);\n        }\n        acc += strings[lastIdx];\n        return acc;\n    }\n    function getSeqNumberGenerator(startsAt) {\n        if (startsAt === void 0) { startsAt = 0; }\n        var current = startsAt;\n        return function () { return current++; };\n    }\n    function placeholdersToParams(placeholders) {\n        var params = {};\n        placeholders.forEach(function (values, key) {\n            params[key] = literal(values.length > 1 ? \"[\" + values.join('|') + \"]\" : values[0]);\n        });\n        return params;\n    }\n    function updatePlaceholderMap(map, name) {\n        var values = [];\n        for (var _i = 2; _i < arguments.length; _i++) {\n            values[_i - 2] = arguments[_i];\n        }\n        var current = map.get(name) || [];\n        current.push.apply(current, __spreadArray([], __read(values)));\n        map.set(name, current);\n    }\n    function assembleBoundTextPlaceholders(meta, bindingStartIndex, contextId) {\n        if (bindingStartIndex === void 0) { bindingStartIndex = 0; }\n        if (contextId === void 0) { contextId = 0; }\n        var startIdx = bindingStartIndex;\n        var placeholders = new Map();\n        var node = meta instanceof Message ? meta.nodes.find(function (node) { return node instanceof Container; }) : meta;\n        if (node) {\n            node\n                .children\n                .filter(function (child) { return child instanceof Placeholder; })\n                .forEach(function (child, idx) {\n                var content = wrapI18nPlaceholder(startIdx + idx, contextId);\n                updatePlaceholderMap(placeholders, child.name, content);\n            });\n        }\n        return placeholders;\n    }\n    /**\n     * Format the placeholder names in a map of placeholders to expressions.\n     *\n     * The placeholder names are converted from \"internal\" format (e.g. `START_TAG_DIV_1`) to \"external\"\n     * format (e.g. `startTagDiv_1`).\n     *\n     * @param params A map of placeholder names to expressions.\n     * @param useCamelCase whether to camelCase the placeholder name when formatting.\n     * @returns A new map of formatted placeholder names to expressions.\n     */\n    function i18nFormatPlaceholderNames(params, useCamelCase) {\n        if (params === void 0) { params = {}; }\n        var _params = {};\n        if (params && Object.keys(params).length) {\n            Object.keys(params).forEach(function (key) { return _params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]; });\n        }\n        return _params;\n    }\n    /**\n     * Converts internal placeholder names to public-facing format\n     * (for example to use in goog.getMsg call).\n     * Example: `START_TAG_DIV_1` is converted to `startTagDiv_1`.\n     *\n     * @param name The placeholder name that should be formatted\n     * @returns Formatted placeholder name\n     */\n    function formatI18nPlaceholderName(name, useCamelCase) {\n        if (useCamelCase === void 0) { useCamelCase = true; }\n        var publicName = toPublicName(name);\n        if (!useCamelCase) {\n            return publicName;\n        }\n        var chunks = publicName.split('_');\n        if (chunks.length === 1) {\n            // if no \"_\" found - just lowercase the value\n            return name.toLowerCase();\n        }\n        var postfix;\n        // eject last element if it's a number\n        if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n            postfix = chunks.pop();\n        }\n        var raw = chunks.shift().toLowerCase();\n        if (chunks.length) {\n            raw += chunks.map(function (c) { return c.charAt(0).toUpperCase() + c.slice(1).toLowerCase(); }).join('');\n        }\n        return postfix ? raw + \"_\" + postfix : raw;\n    }\n    /**\n     * Generates a prefix for translation const name.\n     *\n     * @param extra Additional local prefix that should be injected into translation var name\n     * @returns Complete translation const prefix\n     */\n    function getTranslationConstPrefix(extra) {\n        return (\"\" + CLOSURE_TRANSLATION_VAR_PREFIX + extra).toUpperCase();\n    }\n    /**\n     * Generate AST to declare a variable. E.g. `var I18N_1;`.\n     * @param variable the name of the variable to declare.\n     */\n    function declareI18nVariable(variable) {\n        return new DeclareVarStmt(variable.name, undefined, INFERRED_TYPE, undefined, variable.sourceSpan);\n    }\n\n    /**\n     * Checks whether an object key contains potentially unsafe chars, thus the key should be wrapped in\n     * quotes. Note: we do not wrap all keys into quotes, as it may have impact on minification and may\n     * bot work in some cases when object keys are mangled by minifier.\n     *\n     * TODO(FW-1136): this is a temporary solution, we need to come up with a better way of working with\n     * inputs that contain potentially unsafe chars.\n     */\n    var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;\n    /** Name of the temporary to use during data binding */\n    var TEMPORARY_NAME = '_t';\n    /** Name of the context parameter passed into a template function */\n    var CONTEXT_NAME = 'ctx';\n    /** Name of the RenderFlag passed into a template function */\n    var RENDER_FLAGS = 'rf';\n    /** The prefix reference variables */\n    var REFERENCE_PREFIX = '_r';\n    /** The name of the implicit context reference */\n    var IMPLICIT_REFERENCE = '$implicit';\n    /** Non bindable attribute name **/\n    var NON_BINDABLE_ATTR = 'ngNonBindable';\n    /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */\n    var RESTORED_VIEW_CONTEXT_NAME = 'restoredCtx';\n    /**\n     * Creates an allocator for a temporary variable.\n     *\n     * A variable declaration is added to the statements the first time the allocator is invoked.\n     */\n    function temporaryAllocator(statements, name) {\n        var temp = null;\n        return function () {\n            if (!temp) {\n                statements.push(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE));\n                temp = variable(name);\n            }\n            return temp;\n        };\n    }\n    function unsupported(feature) {\n        if (this) {\n            throw new Error(\"Builder \" + this.constructor.name + \" doesn't support \" + feature + \" yet\");\n        }\n        throw new Error(\"Feature \" + feature + \" is not supported yet\");\n    }\n    function invalid$1(arg) {\n        throw new Error(\"Invalid state: Visitor \" + this.constructor.name + \" doesn't handle \" + arg.constructor.name);\n    }\n    function asLiteral(value) {\n        if (Array.isArray(value)) {\n            return literalArr(value.map(asLiteral));\n        }\n        return literal(value, INFERRED_TYPE);\n    }\n    function conditionallyCreateMapObjectLiteral(keys, keepDeclared) {\n        if (Object.getOwnPropertyNames(keys).length > 0) {\n            return mapToExpression(keys, keepDeclared);\n        }\n        return null;\n    }\n    function mapToExpression(map, keepDeclared) {\n        return literalMap(Object.getOwnPropertyNames(map).map(function (key) {\n            var _a, _b;\n            // canonical syntax: `dirProp: publicProp`\n            // if there is no `:`, use dirProp = elProp\n            var value = map[key];\n            var declaredName;\n            var publicName;\n            var minifiedName;\n            var needsDeclaredName;\n            if (Array.isArray(value)) {\n                _a = __read(value, 2), publicName = _a[0], declaredName = _a[1];\n                minifiedName = key;\n                needsDeclaredName = publicName !== declaredName;\n            }\n            else {\n                _b = __read(splitAtColon(key, [key, value]), 2), declaredName = _b[0], publicName = _b[1];\n                minifiedName = declaredName;\n                // Only include the declared name if extracted from the key, i.e. the key contains a colon.\n                // Otherwise the declared name should be omitted even if it is different from the public name,\n                // as it may have already been minified.\n                needsDeclaredName = publicName !== declaredName && key.includes(':');\n            }\n            return {\n                key: minifiedName,\n                // put quotes around keys that contain potentially unsafe characters\n                quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName),\n                value: (keepDeclared && needsDeclaredName) ?\n                    literalArr([asLiteral(publicName), asLiteral(declaredName)]) :\n                    asLiteral(publicName)\n            };\n        }));\n    }\n    /**\n     *  Remove trailing null nodes as they are implied.\n     */\n    function trimTrailingNulls(parameters) {\n        while (isNull(parameters[parameters.length - 1])) {\n            parameters.pop();\n        }\n        return parameters;\n    }\n    function getQueryPredicate(query, constantPool) {\n        if (Array.isArray(query.predicate)) {\n            var predicate_1 = [];\n            query.predicate.forEach(function (selector) {\n                // Each item in predicates array may contain strings with comma-separated refs\n                // (for ex. 'ref, ref1, ..., refN'), thus we extract individual refs and store them\n                // as separate array entities\n                var selectors = selector.split(',').map(function (token) { return literal(token.trim()); });\n                predicate_1.push.apply(predicate_1, __spreadArray([], __read(selectors)));\n            });\n            return constantPool.getConstLiteral(literalArr(predicate_1), true);\n        }\n        else {\n            return query.predicate;\n        }\n    }\n    /**\n     * A representation for an object literal used during codegen of definition objects. The generic\n     * type `T` allows to reference a documented type of the generated structure, such that the\n     * property names that are set can be resolved to their documented declaration.\n     */\n    var DefinitionMap = /** @class */ (function () {\n        function DefinitionMap() {\n            this.values = [];\n        }\n        DefinitionMap.prototype.set = function (key, value) {\n            if (value) {\n                this.values.push({ key: key, value: value, quoted: false });\n            }\n        };\n        DefinitionMap.prototype.toLiteralMap = function () {\n            return literalMap(this.values);\n        };\n        return DefinitionMap;\n    }());\n    /**\n     * Extract a map of properties to values for a given element or template node, which can be used\n     * by the directive matching machinery.\n     *\n     * @param elOrTpl the element or template in question\n     * @return an object set up for directive matching. For attributes on the element/template, this\n     * object maps a property name to its (static) value. For any bindings, this map simply maps the\n     * property name to an empty string.\n     */\n    function getAttrsForDirectiveMatching(elOrTpl) {\n        var attributesMap = {};\n        if (elOrTpl instanceof Template && elOrTpl.tagName !== 'ng-template') {\n            elOrTpl.templateAttrs.forEach(function (a) { return attributesMap[a.name] = ''; });\n        }\n        else {\n            elOrTpl.attributes.forEach(function (a) {\n                if (!isI18nAttribute(a.name)) {\n                    attributesMap[a.name] = a.value;\n                }\n            });\n            elOrTpl.inputs.forEach(function (i) {\n                attributesMap[i.name] = '';\n            });\n            elOrTpl.outputs.forEach(function (o) {\n                attributesMap[o.name] = '';\n            });\n        }\n        return attributesMap;\n    }\n    /** Returns a call expression to a chained instruction, e.g. `property(params[0])(params[1])`. */\n    function chainedInstruction(reference, calls, span) {\n        var expression = importExpr(reference, null, span);\n        if (calls.length > 0) {\n            for (var i = 0; i < calls.length; i++) {\n                expression = expression.callFn(calls[i], span);\n            }\n        }\n        else {\n            // Add a blank invocation, in case the `calls` array is empty.\n            expression = expression.callFn([], span);\n        }\n        return expression;\n    }\n    /**\n     * Gets the number of arguments expected to be passed to a generated instruction in the case of\n     * interpolation instructions.\n     * @param interpolation An interpolation ast\n     */\n    function getInterpolationArgsLength(interpolation) {\n        var expressions = interpolation.expressions, strings = interpolation.strings;\n        if (expressions.length === 1 && strings.length === 2 && strings[0] === '' && strings[1] === '') {\n            // If the interpolation has one interpolated value, but the prefix and suffix are both empty\n            // strings, we only pass one argument, to a special instruction like `propertyInterpolate` or\n            // `textInterpolate`.\n            return 1;\n        }\n        else {\n            return expressions.length + strings.length;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Creates an array literal expression from the given array, mapping all values to an expression\n     * using the provided mapping function. If the array is empty or null, then null is returned.\n     *\n     * @param values The array to transfer into literal array expression.\n     * @param mapper The logic to use for creating an expression for the array's values.\n     * @returns An array literal expression representing `values`, or null if `values` is empty or\n     * is itself null.\n     */\n    function toOptionalLiteralArray(values, mapper) {\n        if (values === null || values.length === 0) {\n            return null;\n        }\n        return literalArr(values.map(function (value) { return mapper(value); }));\n    }\n    /**\n     * Creates an object literal expression from the given object, mapping all values to an expression\n     * using the provided mapping function. If the object has no keys, then null is returned.\n     *\n     * @param object The object to transfer into an object literal expression.\n     * @param mapper The logic to use for creating an expression for the object's values.\n     * @returns An object literal expression representing `object`, or null if `object` does not have\n     * any keys.\n     */\n    function toOptionalLiteralMap(object, mapper) {\n        var entries = Object.keys(object).map(function (key) {\n            var value = object[key];\n            return { key: key, value: mapper(value), quoted: true };\n        });\n        if (entries.length > 0) {\n            return literalMap(entries);\n        }\n        else {\n            return null;\n        }\n    }\n    function compileDependencies(deps) {\n        if (deps === 'invalid') {\n            // The `deps` can be set to the string \"invalid\"  by the `unwrapConstructorDependencies()`\n            // function, which tries to convert `ConstructorDeps` into `R3DependencyMetadata[]`.\n            return literal('invalid');\n        }\n        else if (deps === null) {\n            return literal(null);\n        }\n        else {\n            return literalArr(deps.map(compileDependency));\n        }\n    }\n    function compileDependency(dep) {\n        var depMeta = new DefinitionMap();\n        depMeta.set('token', dep.token);\n        if (dep.attributeNameType !== null) {\n            depMeta.set('attribute', literal(true));\n        }\n        if (dep.host) {\n            depMeta.set('host', literal(true));\n        }\n        if (dep.optional) {\n            depMeta.set('optional', literal(true));\n        }\n        if (dep.self) {\n            depMeta.set('self', literal(true));\n        }\n        if (dep.skipSelf) {\n            depMeta.set('skipSelf', literal(true));\n        }\n        return depMeta.toLiteralMap();\n    }\n    /**\n     * Generate an expression that has the given `expr` wrapped in the following form:\n     *\n     * ```\n     * forwardRef(() => expr)\n     * ```\n     */\n    function generateForwardRef(expr) {\n        return importExpr(Identifiers.forwardRef).callFn([fn([], [new ReturnStatement(expr)])]);\n    }\n\n    /**\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://angular.io/license\n     */\n    // https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\n    var VERSION = 3;\n    var JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';\n    var SourceMapGenerator = /** @class */ (function () {\n        function SourceMapGenerator(file) {\n            if (file === void 0) { file = null; }\n            this.file = file;\n            this.sourcesContent = new Map();\n            this.lines = [];\n            this.lastCol0 = 0;\n            this.hasMappings = false;\n        }\n        // The content is `null` when the content is expected to be loaded using the URL\n        SourceMapGenerator.prototype.addSource = function (url, content) {\n            if (content === void 0) { content = null; }\n            if (!this.sourcesContent.has(url)) {\n                this.sourcesContent.set(url, content);\n            }\n            return this;\n        };\n        SourceMapGenerator.prototype.addLine = function () {\n            this.lines.push([]);\n            this.lastCol0 = 0;\n            return this;\n        };\n        SourceMapGenerator.prototype.addMapping = function (col0, sourceUrl, sourceLine0, sourceCol0) {\n            if (!this.currentLine) {\n                throw new Error(\"A line must be added before mappings can be added\");\n            }\n            if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {\n                throw new Error(\"Unknown source file \\\"\" + sourceUrl + \"\\\"\");\n            }\n            if (col0 == null) {\n                throw new Error(\"The column in the generated code must be provided\");\n            }\n            if (col0 < this.lastCol0) {\n                throw new Error(\"Mapping should be added in output order\");\n            }\n            if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {\n                throw new Error(\"The source location must be provided when a source url is provided\");\n            }\n            this.hasMappings = true;\n            this.lastCol0 = col0;\n            this.currentLine.push({ col0: col0, sourceUrl: sourceUrl, sourceLine0: sourceLine0, sourceCol0: sourceCol0 });\n            return this;\n        };\n        Object.defineProperty(SourceMapGenerator.prototype, \"currentLine\", {\n            /**\n             * @internal strip this from published d.ts files due to\n             * https://github.com/microsoft/TypeScript/issues/36216\n             */\n            get: function () {\n                return this.lines.slice(-1)[0];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        SourceMapGenerator.prototype.toJSON = function () {\n            var _this = this;\n            if (!this.hasMappings) {\n                return null;\n            }\n            var sourcesIndex = new Map();\n            var sources = [];\n            var sourcesContent = [];\n            Array.from(this.sourcesContent.keys()).forEach(function (url, i) {\n                sourcesIndex.set(url, i);\n                sources.push(url);\n                sourcesContent.push(_this.sourcesContent.get(url) || null);\n            });\n            var mappings = '';\n            var lastCol0 = 0;\n            var lastSourceIndex = 0;\n            var lastSourceLine0 = 0;\n            var lastSourceCol0 = 0;\n            this.lines.forEach(function (segments) {\n                lastCol0 = 0;\n                mappings += segments\n                    .map(function (segment) {\n                    // zero-based starting column of the line in the generated code\n                    var segAsStr = toBase64VLQ(segment.col0 - lastCol0);\n                    lastCol0 = segment.col0;\n                    if (segment.sourceUrl != null) {\n                        // zero-based index into the “sources” list\n                        segAsStr +=\n                            toBase64VLQ(sourcesIndex.get(segment.sourceUrl) - lastSourceIndex);\n                        lastSourceIndex = sourcesIndex.get(segment.sourceUrl);\n                        // the zero-based starting line in the original source\n                        segAsStr += toBase64VLQ(segment.sourceLine0 - lastSourceLine0);\n                        lastSourceLine0 = segment.sourceLine0;\n                        // the zero-based starting column in the original source\n                        segAsStr += toBase64VLQ(segment.sourceCol0 - lastSourceCol0);\n                        lastSourceCol0 = segment.sourceCol0;\n                    }\n                    return segAsStr;\n                })\n                    .join(',');\n                mappings += ';';\n            });\n            mappings = mappings.slice(0, -1);\n            return {\n                'file': this.file || '',\n                'version': VERSION,\n                'sourceRoot': '',\n                'sources': sources,\n                'sourcesContent': sourcesContent,\n                'mappings': mappings,\n            };\n        };\n        SourceMapGenerator.prototype.toJsComment = function () {\n            return this.hasMappings ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) :\n                '';\n        };\n        return SourceMapGenerator;\n    }());\n    function toBase64String(value) {\n        var b64 = '';\n        var encoded = utf8Encode(value);\n        for (var i = 0; i < encoded.length;) {\n            var i1 = encoded[i++];\n            var i2 = i < encoded.length ? encoded[i++] : null;\n            var i3 = i < encoded.length ? encoded[i++] : null;\n            b64 += toBase64Digit(i1 >> 2);\n            b64 += toBase64Digit(((i1 & 3) << 4) | (i2 === null ? 0 : i2 >> 4));\n            b64 += i2 === null ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 === null ? 0 : i3 >> 6));\n            b64 += i2 === null || i3 === null ? '=' : toBase64Digit(i3 & 63);\n        }\n        return b64;\n    }\n    function toBase64VLQ(value) {\n        value = value < 0 ? ((-value) << 1) + 1 : value << 1;\n        var out = '';\n        do {\n            var digit = value & 31;\n            value = value >> 5;\n            if (value > 0) {\n                digit = digit | 32;\n            }\n            out += toBase64Digit(digit);\n        } while (value > 0);\n        return out;\n    }\n    var B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n    function toBase64Digit(value) {\n        if (value < 0 || value >= 64) {\n            throw new Error(\"Can only encode value in the range [0, 63]\");\n        }\n        return B64_DIGITS[value];\n    }\n\n    var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\\\|\\n|\\r|\\$/g;\n    var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;\n    var _INDENT_WITH = '  ';\n    var CATCH_ERROR_VAR$1 = variable('error', null, null);\n    var CATCH_STACK_VAR$1 = variable('stack', null, null);\n    var _EmittedLine = /** @class */ (function () {\n        function _EmittedLine(indent) {\n            this.indent = indent;\n            this.partsLength = 0;\n            this.parts = [];\n            this.srcSpans = [];\n        }\n        return _EmittedLine;\n    }());\n    var EmitterVisitorContext = /** @class */ (function () {\n        function EmitterVisitorContext(_indent) {\n            this._indent = _indent;\n            this._classes = [];\n            this._preambleLineCount = 0;\n            this._lines = [new _EmittedLine(_indent)];\n        }\n        EmitterVisitorContext.createRoot = function () {\n            return new EmitterVisitorContext(0);\n        };\n        Object.defineProperty(EmitterVisitorContext.prototype, \"_currentLine\", {\n            /**\n             * @internal strip this from published d.ts files due to\n             * https://github.com/microsoft/TypeScript/issues/36216\n             */\n            get: function () {\n                return this._lines[this._lines.length - 1];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        EmitterVisitorContext.prototype.println = function (from, lastPart) {\n            if (lastPart === void 0) { lastPart = ''; }\n            this.print(from || null, lastPart, true);\n        };\n        EmitterVisitorContext.prototype.lineIsEmpty = function () {\n            return this._currentLine.parts.length === 0;\n        };\n        EmitterVisitorContext.prototype.lineLength = function () {\n            return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;\n        };\n        EmitterVisitorContext.prototype.print = function (from, part, newLine) {\n            if (newLine === void 0) { newLine = false; }\n            if (part.length > 0) {\n                this._currentLine.parts.push(part);\n                this._currentLine.partsLength += part.length;\n                this._currentLine.srcSpans.push(from && from.sourceSpan || null);\n            }\n            if (newLine) {\n                this._lines.push(new _EmittedLine(this._indent));\n            }\n        };\n        EmitterVisitorContext.prototype.removeEmptyLastLine = function () {\n            if (this.lineIsEmpty()) {\n                this._lines.pop();\n            }\n        };\n        EmitterVisitorContext.prototype.incIndent = function () {\n            this._indent++;\n            if (this.lineIsEmpty()) {\n                this._currentLine.indent = this._indent;\n            }\n        };\n        EmitterVisitorContext.prototype.decIndent = function () {\n            this._indent--;\n            if (this.lineIsEmpty()) {\n                this._currentLine.indent = this._indent;\n            }\n        };\n        EmitterVisitorContext.prototype.pushClass = function (clazz) {\n            this._classes.push(clazz);\n        };\n        EmitterVisitorContext.prototype.popClass = function () {\n            return this._classes.pop();\n        };\n        Object.defineProperty(EmitterVisitorContext.prototype, \"currentClass\", {\n            get: function () {\n                return this._classes.length > 0 ? this._classes[this._classes.length - 1] : null;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        EmitterVisitorContext.prototype.toSource = function () {\n            return this.sourceLines\n                .map(function (l) { return l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''; })\n                .join('\\n');\n        };\n        EmitterVisitorContext.prototype.toSourceMapGenerator = function (genFilePath, startsAtLine) {\n            if (startsAtLine === void 0) { startsAtLine = 0; }\n            var map = new SourceMapGenerator(genFilePath);\n            var firstOffsetMapped = false;\n            var mapFirstOffsetIfNeeded = function () {\n                if (!firstOffsetMapped) {\n                    // Add a single space so that tools won't try to load the file from disk.\n                    // Note: We are using virtual urls like `ng:///`, so we have to\n                    // provide a content here.\n                    map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0);\n                    firstOffsetMapped = true;\n                }\n            };\n            for (var i = 0; i < startsAtLine; i++) {\n                map.addLine();\n                mapFirstOffsetIfNeeded();\n            }\n            this.sourceLines.forEach(function (line, lineIdx) {\n                map.addLine();\n                var spans = line.srcSpans;\n                var parts = line.parts;\n                var col0 = line.indent * _INDENT_WITH.length;\n                var spanIdx = 0;\n                // skip leading parts without source spans\n                while (spanIdx < spans.length && !spans[spanIdx]) {\n                    col0 += parts[spanIdx].length;\n                    spanIdx++;\n                }\n                if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {\n                    firstOffsetMapped = true;\n                }\n                else {\n                    mapFirstOffsetIfNeeded();\n                }\n                while (spanIdx < spans.length) {\n                    var span = spans[spanIdx];\n                    var source = span.start.file;\n                    var sourceLine = span.start.line;\n                    var sourceCol = span.start.col;\n                    map.addSource(source.url, source.content)\n                        .addMapping(col0, source.url, sourceLine, sourceCol);\n                    col0 += parts[spanIdx].length;\n                    spanIdx++;\n                    // assign parts without span or the same span to the previous segment\n                    while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {\n                        col0 += parts[spanIdx].length;\n                        spanIdx++;\n                    }\n                }\n            });\n            return map;\n        };\n        EmitterVisitorContext.prototype.setPreambleLineCount = function (count) {\n            return this._preambleLineCount = count;\n        };\n        EmitterVisitorContext.prototype.spanOf = function (line, column) {\n            var emittedLine = this._lines[line - this._preambleLineCount];\n            if (emittedLine) {\n                var columnsLeft = column - _createIndent(emittedLine.indent).length;\n                for (var partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {\n                    var part = emittedLine.parts[partIndex];\n                    if (part.length > columnsLeft) {\n                        return emittedLine.srcSpans[partIndex];\n                    }\n                    columnsLeft -= part.length;\n                }\n            }\n            return null;\n        };\n        Object.defineProperty(EmitterVisitorContext.prototype, \"sourceLines\", {\n            /**\n             * @internal strip this from published d.ts files due to\n             * https://github.com/microsoft/TypeScript/issues/36216\n             */\n            get: function () {\n                if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {\n                    return this._lines.slice(0, -1);\n                }\n                return this._lines;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return EmitterVisitorContext;\n    }());\n    var AbstractEmitterVisitor = /** @class */ (function () {\n        function AbstractEmitterVisitor(_escapeDollarInStrings) {\n            this._escapeDollarInStrings = _escapeDollarInStrings;\n        }\n        AbstractEmitterVisitor.prototype.printLeadingComments = function (stmt, ctx) {\n            var e_1, _a;\n            if (stmt.leadingComments === undefined) {\n                return;\n            }\n            try {\n                for (var _b = __values(stmt.leadingComments), _c = _b.next(); !_c.done; _c = _b.next()) {\n                    var comment = _c.value;\n                    if (comment instanceof JSDocComment) {\n                        ctx.print(stmt, \"/*\" + comment.toString() + \"*/\", comment.trailingNewline);\n                    }\n                    else {\n                        if (comment.multiline) {\n                            ctx.print(stmt, \"/* \" + comment.text + \" */\", comment.trailingNewline);\n                        }\n                        else {\n                            comment.text.split('\\n').forEach(function (line) {\n                                ctx.println(stmt, \"// \" + line);\n                            });\n                        }\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        };\n        AbstractEmitterVisitor.prototype.visitExpressionStmt = function (stmt, ctx) {\n            this.printLeadingComments(stmt, ctx);\n            stmt.expr.visitExpression(this, ctx);\n            ctx.println(stmt, ';');\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitReturnStmt = function (stmt, ctx) {\n            this.printLeadingComments(stmt, ctx);\n            ctx.print(stmt, \"return \");\n            stmt.value.visitExpression(this, ctx);\n            ctx.println(stmt, ';');\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitIfStmt = function (stmt, ctx) {\n            this.printLeadingComments(stmt, ctx);\n            ctx.print(stmt, \"if (\");\n            stmt.condition.visitExpression(this, ctx);\n            ctx.print(stmt, \") {\");\n            var hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;\n            if (stmt.trueCase.length <= 1 && !hasElseCase) {\n                ctx.print(stmt, \" \");\n                this.visitAllStatements(stmt.trueCase, ctx);\n                ctx.removeEmptyLastLine();\n                ctx.print(stmt, \" \");\n            }\n            else {\n                ctx.println();\n                ctx.incIndent();\n                this.visitAllStatements(stmt.trueCase, ctx);\n                ctx.decIndent();\n                if (hasElseCase) {\n                    ctx.println(stmt, \"} else {\");\n                    ctx.incIndent();\n                    this.visitAllStatements(stmt.falseCase, ctx);\n                    ctx.decIndent();\n                }\n            }\n            ctx.println(stmt, \"}\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitThrowStmt = function (stmt, ctx) {\n            this.printLeadingComments(stmt, ctx);\n            ctx.print(stmt, \"throw \");\n            stmt.error.visitExpression(this, ctx);\n            ctx.println(stmt, \";\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitWriteVarExpr = function (expr, ctx) {\n            var lineWasEmpty = ctx.lineIsEmpty();\n            if (!lineWasEmpty) {\n                ctx.print(expr, '(');\n            }\n            ctx.print(expr, expr.name + \" = \");\n            expr.value.visitExpression(this, ctx);\n            if (!lineWasEmpty) {\n                ctx.print(expr, ')');\n            }\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitWriteKeyExpr = function (expr, ctx) {\n            var lineWasEmpty = ctx.lineIsEmpty();\n            if (!lineWasEmpty) {\n                ctx.print(expr, '(');\n            }\n            expr.receiver.visitExpression(this, ctx);\n            ctx.print(expr, \"[\");\n            expr.index.visitExpression(this, ctx);\n            ctx.print(expr, \"] = \");\n            expr.value.visitExpression(this, ctx);\n            if (!lineWasEmpty) {\n                ctx.print(expr, ')');\n            }\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitWritePropExpr = function (expr, ctx) {\n            var lineWasEmpty = ctx.lineIsEmpty();\n            if (!lineWasEmpty) {\n                ctx.print(expr, '(');\n            }\n            expr.receiver.visitExpression(this, ctx);\n            ctx.print(expr, \".\" + expr.name + \" = \");\n            expr.value.visitExpression(this, ctx);\n            if (!lineWasEmpty) {\n                ctx.print(expr, ')');\n            }\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitInvokeMethodExpr = function (expr, ctx) {\n            expr.receiver.visitExpression(this, ctx);\n            var name = expr.name;\n            if (expr.builtin != null) {\n                name = this.getBuiltinMethodName(expr.builtin);\n                if (name == null) {\n                    // some builtins just mean to skip the call.\n                    return null;\n                }\n            }\n            ctx.print(expr, \".\" + name + \"(\");\n            this.visitAllExpressions(expr.args, ctx, \",\");\n            ctx.print(expr, \")\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr, ctx) {\n            expr.fn.visitExpression(this, ctx);\n            ctx.print(expr, \"(\");\n            this.visitAllExpressions(expr.args, ctx, ',');\n            ctx.print(expr, \")\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitTaggedTemplateExpr = function (expr, ctx) {\n            expr.tag.visitExpression(this, ctx);\n            ctx.print(expr, '`' + expr.template.elements[0].rawText);\n            for (var i = 1; i < expr.template.elements.length; i++) {\n                ctx.print(expr, '${');\n                expr.template.expressions[i - 1].visitExpression(this, ctx);\n                ctx.print(expr, \"}\" + expr.template.elements[i].rawText);\n            }\n            ctx.print(expr, '`');\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitWrappedNodeExpr = function (ast, ctx) {\n            throw new Error('Abstract emitter cannot visit WrappedNodeExpr.');\n        };\n        AbstractEmitterVisitor.prototype.visitTypeofExpr = function (expr, ctx) {\n            ctx.print(expr, 'typeof ');\n            expr.expr.visitExpression(this, ctx);\n        };\n        AbstractEmitterVisitor.prototype.visitReadVarExpr = function (ast, ctx) {\n            var varName = ast.name;\n            if (ast.builtin != null) {\n                switch (ast.builtin) {\n                    case exports.BuiltinVar.Super:\n                        varName = 'super';\n                        break;\n                    case exports.BuiltinVar.This:\n                        varName = 'this';\n                        break;\n                    case exports.BuiltinVar.CatchError:\n                        varName = CATCH_ERROR_VAR$1.name;\n                        break;\n                    case exports.BuiltinVar.CatchStack:\n                        varName = CATCH_STACK_VAR$1.name;\n                        break;\n                    default:\n                        throw new Error(\"Unknown builtin variable \" + ast.builtin);\n                }\n            }\n            ctx.print(ast, varName);\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitInstantiateExpr = function (ast, ctx) {\n            ctx.print(ast, \"new \");\n            ast.classExpr.visitExpression(this, ctx);\n            ctx.print(ast, \"(\");\n            this.visitAllExpressions(ast.args, ctx, ',');\n            ctx.print(ast, \")\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitLiteralExpr = function (ast, ctx) {\n            var value = ast.value;\n            if (typeof value === 'string') {\n                ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));\n            }\n            else {\n                ctx.print(ast, \"\" + value);\n            }\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitLocalizedString = function (ast, ctx) {\n            var head = ast.serializeI18nHead();\n            ctx.print(ast, '$localize `' + head.raw);\n            for (var i = 1; i < ast.messageParts.length; i++) {\n                ctx.print(ast, '${');\n                ast.expressions[i - 1].visitExpression(this, ctx);\n                ctx.print(ast, \"}\" + ast.serializeI18nTemplatePart(i).raw);\n            }\n            ctx.print(ast, '`');\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitConditionalExpr = function (ast, ctx) {\n            ctx.print(ast, \"(\");\n            ast.condition.visitExpression(this, ctx);\n            ctx.print(ast, '? ');\n            ast.trueCase.visitExpression(this, ctx);\n            ctx.print(ast, ': ');\n            ast.falseCase.visitExpression(this, ctx);\n            ctx.print(ast, \")\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitNotExpr = function (ast, ctx) {\n            ctx.print(ast, '!');\n            ast.condition.visitExpression(this, ctx);\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitAssertNotNullExpr = function (ast, ctx) {\n            ast.condition.visitExpression(this, ctx);\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitUnaryOperatorExpr = function (ast, ctx) {\n            var opStr;\n            switch (ast.operator) {\n                case exports.UnaryOperator.Plus:\n                    opStr = '+';\n                    break;\n                case exports.UnaryOperator.Minus:\n                    opStr = '-';\n                    break;\n                default:\n                    throw new Error(\"Unknown operator \" + ast.operator);\n            }\n            if (ast.parens)\n                ctx.print(ast, \"(\");\n            ctx.print(ast, opStr);\n            ast.expr.visitExpression(this, ctx);\n            if (ast.parens)\n                ctx.print(ast, \")\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr = function (ast, ctx) {\n            var opStr;\n            switch (ast.operator) {\n                case exports.BinaryOperator.Equals:\n                    opStr = '==';\n                    break;\n                case exports.BinaryOperator.Identical:\n                    opStr = '===';\n                    break;\n                case exports.BinaryOperator.NotEquals:\n                    opStr = '!=';\n                    break;\n                case exports.BinaryOperator.NotIdentical:\n                    opStr = '!==';\n                    break;\n                case exports.BinaryOperator.And:\n                    opStr = '&&';\n                    break;\n                case exports.BinaryOperator.BitwiseAnd:\n                    opStr = '&';\n                    break;\n                case exports.BinaryOperator.Or:\n                    opStr = '||';\n                    break;\n                case exports.BinaryOperator.Plus:\n                    opStr = '+';\n                    break;\n                case exports.BinaryOperator.Minus:\n                    opStr = '-';\n                    break;\n                case exports.BinaryOperator.Divide:\n                    opStr = '/';\n                    break;\n                case exports.BinaryOperator.Multiply:\n                    opStr = '*';\n                    break;\n                case exports.BinaryOperator.Modulo:\n                    opStr = '%';\n                    break;\n                case exports.BinaryOperator.Lower:\n                    opStr = '<';\n                    break;\n                case exports.BinaryOperator.LowerEquals:\n                    opStr = '<=';\n                    break;\n                case exports.BinaryOperator.Bigger:\n                    opStr = '>';\n                    break;\n                case exports.BinaryOperator.BiggerEquals:\n                    opStr = '>=';\n                    break;\n                case exports.BinaryOperator.NullishCoalesce:\n                    opStr = '??';\n                    break;\n                default:\n                    throw new Error(\"Unknown operator \" + ast.operator);\n            }\n            if (ast.parens)\n                ctx.print(ast, \"(\");\n            ast.lhs.visitExpression(this, ctx);\n            ctx.print(ast, \" \" + opStr + \" \");\n            ast.rhs.visitExpression(this, ctx);\n            if (ast.parens)\n                ctx.print(ast, \")\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitReadPropExpr = function (ast, ctx) {\n            ast.receiver.visitExpression(this, ctx);\n            ctx.print(ast, \".\");\n            ctx.print(ast, ast.name);\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitReadKeyExpr = function (ast, ctx) {\n            ast.receiver.visitExpression(this, ctx);\n            ctx.print(ast, \"[\");\n            ast.index.visitExpression(this, ctx);\n            ctx.print(ast, \"]\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitLiteralArrayExpr = function (ast, ctx) {\n            ctx.print(ast, \"[\");\n            this.visitAllExpressions(ast.entries, ctx, ',');\n            ctx.print(ast, \"]\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitLiteralMapExpr = function (ast, ctx) {\n            var _this = this;\n            ctx.print(ast, \"{\");\n            this.visitAllObjects(function (entry) {\n                ctx.print(ast, escapeIdentifier(entry.key, _this._escapeDollarInStrings, entry.quoted) + \":\");\n                entry.value.visitExpression(_this, ctx);\n            }, ast.entries, ctx, ',');\n            ctx.print(ast, \"}\");\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitCommaExpr = function (ast, ctx) {\n            ctx.print(ast, '(');\n            this.visitAllExpressions(ast.parts, ctx, ',');\n            ctx.print(ast, ')');\n            return null;\n        };\n        AbstractEmitterVisitor.prototype.visitAllExpressions = function (expressions, ctx, separator) {\n            var _this = this;\n            this.visitAllObjects(function (expr) { return expr.visitExpression(_this, ctx); }, expressions, ctx, separator);\n        };\n        AbstractEmitterVisitor.prototype.visitAllObjects = function (handler, expressions, ctx, separator) {\n            var incrementedIndent = false;\n            for (var i = 0; i < expressions.length; i++) {\n                if (i > 0) {\n                    if (ctx.lineLength() > 80) {\n                        ctx.print(null, separator, true);\n                        if (!incrementedIndent) {\n                            // continuation are marked with double indent.\n                            ctx.incIndent();\n                            ctx.incIndent();\n                            incrementedIndent = true;\n                        }\n                    }\n                    else {\n                        ctx.print(null, separator, false);\n                    }\n                }\n                handler(expressions[i]);\n            }\n            if (incrementedIndent) {\n                // continuation are marked with double indent.\n                ctx.decIndent();\n                ctx.decIndent();\n            }\n        };\n        AbstractEmitterVisitor.prototype.visitAllStatements = function (statements, ctx) {\n            var _this = this;\n            statements.forEach(function (stmt) { return stmt.visitStatement(_this, ctx); });\n        };\n        return AbstractEmitterVisitor;\n    }());\n    function escapeIdentifier(input, escapeDollar, alwaysQuote) {\n        if (alwaysQuote === void 0) { alwaysQuote = true; }\n        if (input == null) {\n            return null;\n        }\n        var body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, function () {\n            var match = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                match[_i] = arguments[_i];\n            }\n            if (match[0] == '$') {\n                return escapeDollar ? '\\\\$' : '$';\n            }\n            else if (match[0] == '\\n') {\n                return '\\\\n';\n            }\n            else if (match[0] == '\\r') {\n                return '\\\\r';\n            }\n            else {\n                return \"\\\\\" + match[0];\n            }\n        });\n        var requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);\n        return requiresQuotes ? \"'\" + body + \"'\" : body;\n    }\n    function _createIndent(count) {\n        var res = '';\n        for (var i = 0; i < count; i++) {\n            res += _INDENT_WITH;\n        }\n        return res;\n    }\n\n    /**\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://angular.io/license\n     */\n    function typeWithParameters(type, numParams) {\n        if (numParams === 0) {\n            return expressionType(type);\n        }\n        var params = [];\n        for (var i = 0; i < numParams; i++) {\n            params.push(DYNAMIC_TYPE);\n        }\n        return expressionType(type, undefined, params);\n    }\n    var ANIMATE_SYMBOL_PREFIX = '@';\n    function prepareSyntheticPropertyName(name) {\n        return \"\" + ANIMATE_SYMBOL_PREFIX + name;\n    }\n    function prepareSyntheticListenerName(name, phase) {\n        return \"\" + ANIMATE_SYMBOL_PREFIX + name + \".\" + phase;\n    }\n    function getSafePropertyAccessString(accessor, name) {\n        var escapedName = escapeIdentifier(name, false, false);\n        return escapedName !== name ? accessor + \"[\" + escapedName + \"]\" : accessor + \".\" + name;\n    }\n    function prepareSyntheticListenerFunctionName(name, phase) {\n        return \"animation_\" + name + \"_\" + phase;\n    }\n    function jitOnlyGuardedExpression(expr) {\n        return guardedExpression('ngJitMode', expr);\n    }\n    function devOnlyGuardedExpression(expr) {\n        return guardedExpression('ngDevMode', expr);\n    }\n    function guardedExpression(guard, expr) {\n        var guardExpr = new ExternalExpr({ name: guard, moduleName: null });\n        var guardNotDefined = new BinaryOperatorExpr(exports.BinaryOperator.Identical, new TypeofExpr(guardExpr), literal('undefined'));\n        var guardUndefinedOrTrue = new BinaryOperatorExpr(exports.BinaryOperator.Or, guardNotDefined, guardExpr, /* type */ undefined, \n        /* sourceSpan */ undefined, true);\n        return new BinaryOperatorExpr(exports.BinaryOperator.And, guardUndefinedOrTrue, expr);\n    }\n    function wrapReference(value) {\n        var wrapped = new WrappedNodeExpr(value);\n        return { value: wrapped, type: wrapped };\n    }\n    function refsToArray(refs, shouldForwardDeclare) {\n        var values = literalArr(refs.map(function (ref) { return ref.value; }));\n        return shouldForwardDeclare ? fn([], [new ReturnStatement(values)]) : values;\n    }\n\n    /**\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://angular.io/license\n     */\n    var R3FactoryDelegateType;\n    (function (R3FactoryDelegateType) {\n        R3FactoryDelegateType[R3FactoryDelegateType[\"Class\"] = 0] = \"Class\";\n        R3FactoryDelegateType[R3FactoryDelegateType[\"Function\"] = 1] = \"Function\";\n    })(R3FactoryDelegateType || (R3FactoryDelegateType = {}));\n    (function (FactoryTarget) {\n        FactoryTarget[FactoryTarget[\"Directive\"] = 0] = \"Directive\";\n        FactoryTarget[FactoryTarget[\"Component\"] = 1] = \"Component\";\n        FactoryTarget[FactoryTarget[\"Injectable\"] = 2] = \"Injectable\";\n        FactoryTarget[FactoryTarget[\"Pipe\"] = 3] = \"Pipe\";\n        FactoryTarget[FactoryTarget[\"NgModule\"] = 4] = \"NgModule\";\n    })(exports.FactoryTarget || (exports.FactoryTarget = {}));\n    /**\n     * Construct a factory function expression for the given `R3FactoryMetadata`.\n     */\n    function compileFactoryFunction(meta) {\n        var t = variable('t');\n        var baseFactoryVar = null;\n        // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n        // this type is always created by constructor invocation, then this is the type-to-create\n        // parameter provided by the user (t) if specified, or the current type if not. If there is a\n        // delegated factory (which is used to create the current type) then this is only the type-to-\n        // create parameter (t).\n        var typeForCtor = !isDelegatedFactoryMetadata(meta) ?\n            new BinaryOperatorExpr(exports.BinaryOperator.Or, t, meta.internalType) :\n            t;\n        var ctorExpr = null;\n        if (meta.deps !== null) {\n            // There is a constructor (either explicitly or implicitly defined).\n            if (meta.deps !== 'invalid') {\n                ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.target));\n            }\n        }\n        else {\n            // There is no constructor, use the base class' factory to construct typeForCtor.\n            baseFactoryVar = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n            ctorExpr = baseFactoryVar.callFn([typeForCtor]);\n        }\n        var body = [];\n        var retExpr = null;\n        function makeConditionalFactory(nonCtorExpr) {\n            var r = variable('r');\n            body.push(r.set(NULL_EXPR).toDeclStmt());\n            var ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() :\n                importExpr(Identifiers.invalidFactory).callFn([]).toStmt();\n            body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n            return r;\n        }\n        if (isDelegatedFactoryMetadata(meta)) {\n            // This type is created with a delegated factory. If a type parameter is not specified, call\n            // the factory instead.\n            var delegateArgs = injectDependencies(meta.delegateDeps, meta.target);\n            // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType.\n            var factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n                InstantiateExpr :\n                InvokeFunctionExpr)(meta.delegate, delegateArgs);\n            retExpr = makeConditionalFactory(factoryExpr);\n        }\n        else if (isExpressionFactoryMetadata(meta)) {\n            // TODO(alxhub): decide whether to lower the value here or in the caller\n            retExpr = makeConditionalFactory(meta.expression);\n        }\n        else {\n            retExpr = ctorExpr;\n        }\n        if (retExpr === null) {\n            // The expression cannot be formed so render an `ɵɵinvalidFactory()` call.\n            body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt());\n        }\n        else if (baseFactoryVar !== null) {\n            // This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.\n            var getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.internalType]);\n            // Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`\n            var baseFactory = new BinaryOperatorExpr(exports.BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));\n            body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));\n        }\n        else {\n            // This is straightforward factory, just return it.\n            body.push(new ReturnStatement(retExpr));\n        }\n        var factoryFn = fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, meta.name + \"_Factory\");\n        if (baseFactoryVar !== null) {\n            // There is a base factory variable so wrap its declaration along with the factory function into\n            // an IIFE.\n            factoryFn = fn([], [\n                new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)\n            ]).callFn([], /* sourceSpan */ undefined, /* pure */ true);\n        }\n        return {\n            expression: factoryFn,\n            statements: [],\n            type: createFactoryType(meta),\n        };\n    }\n    function createFactoryType(meta) {\n        var ctorDepsType = meta.deps !== null && meta.deps !== 'invalid' ? createCtorDepsType(meta.deps) : NONE_TYPE;\n        return expressionType(importExpr(Identifiers.FactoryDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType]));\n    }\n    function injectDependencies(deps, target) {\n        return deps.map(function (dep, index) { return compileInjectDependency(dep, target, index); });\n    }\n    function compileInjectDependency(dep, target, index) {\n        // Interpret the dependency according to its resolved type.\n        if (dep.token === null) {\n            return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)]);\n        }\n        else if (dep.attributeNameType === null) {\n            // Build up the injection flags according to the metadata.\n            var flags = 0 /* Default */ | (dep.self ? 2 /* Self */ : 0) |\n                (dep.skipSelf ? 4 /* SkipSelf */ : 0) | (dep.host ? 1 /* Host */ : 0) |\n                (dep.optional ? 8 /* Optional */ : 0) |\n                (target === exports.FactoryTarget.Pipe ? 16 /* ForPipe */ : 0);\n            // If this dependency is optional or otherwise has non-default flags, then additional\n            // parameters describing how to inject the dependency must be passed to the inject function\n            // that's being used.\n            var flagsParam = (flags !== 0 /* Default */ || dep.optional) ? literal(flags) : null;\n            // Build up the arguments to the injectFn call.\n            var injectArgs = [dep.token];\n            if (flagsParam) {\n                injectArgs.push(flagsParam);\n            }\n            var injectFn = getInjectFn(target);\n            return importExpr(injectFn).callFn(injectArgs);\n        }\n        else {\n            // The `dep.attributeTypeName` value is defined, which indicates that this is an `@Attribute()`\n            // type dependency. For the generated JS we still want to use the `dep.token` value in case the\n            // name given for the attribute is not a string literal. For example given `@Attribute(foo())`,\n            // we want to generate `ɵɵinjectAttribute(foo())`.\n            //\n            // The `dep.attributeTypeName` is only actually used (in `createCtorDepType()`) to generate\n            // typings.\n            return importExpr(Identifiers.injectAttribute).callFn([dep.token]);\n        }\n    }\n    function createCtorDepsType(deps) {\n        var hasTypes = false;\n        var attributeTypes = deps.map(function (dep) {\n            var type = createCtorDepType(dep);\n            if (type !== null) {\n                hasTypes = true;\n                return type;\n            }\n            else {\n                return literal(null);\n            }\n        });\n        if (hasTypes) {\n            return expressionType(literalArr(attributeTypes));\n        }\n        else {\n            return NONE_TYPE;\n        }\n    }\n    function createCtorDepType(dep) {\n        var entries = [];\n        if (dep.attributeNameType !== null) {\n            entries.push({ key: 'attribute', value: dep.attributeNameType, quoted: false });\n        }\n        if (dep.optional) {\n            entries.push({ key: 'optional', value: literal(true), quoted: false });\n        }\n        if (dep.host) {\n            entries.push({ key: 'host', value: literal(true), quoted: false });\n        }\n        if (dep.self) {\n            entries.push({ key: 'self', value: literal(true), quoted: false });\n        }\n        if (dep.skipSelf) {\n            entries.push({ key: 'skipSelf', value: literal(true), quoted: false });\n        }\n        return entries.length > 0 ? literalMap(entries) : null;\n    }\n    function isDelegatedFactoryMetadata(meta) {\n        return meta.delegateType !== undefined;\n    }\n    function isExpressionFactoryMetadata(meta) {\n        return meta.expression !== undefined;\n    }\n    function getInjectFn(target) {\n        switch (target) {\n            case exports.FactoryTarget.Component:\n            case exports.FactoryTarget.Directive:\n            case exports.FactoryTarget.Pipe:\n                return Identifiers.directiveInject;\n            case exports.FactoryTarget.NgModule:\n            case exports.FactoryTarget.Injectable:\n            default:\n                return Identifiers.inject;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function createR3ProviderExpression(expression, isForwardRef) {\n        return { expression: expression, isForwardRef: isForwardRef };\n    }\n    function compileInjectable(meta, resolveForwardRefs) {\n        var result = null;\n        var factoryMeta = {\n            name: meta.name,\n            type: meta.type,\n            internalType: meta.internalType,\n            typeArgumentCount: meta.typeArgumentCount,\n            deps: [],\n            target: exports.FactoryTarget.Injectable,\n        };\n        if (meta.useClass !== undefined) {\n            // meta.useClass has two modes of operation. Either deps are specified, in which case `new` is\n            // used to instantiate the class with dependencies injected, or deps are not specified and\n            // the factory of the class is used to instantiate it.\n            //\n            // A special case exists for useClass: Type where Type is the injectable type itself and no\n            // deps are specified, in which case 'useClass' is effectively ignored.\n            var useClassOnSelf = meta.useClass.expression.isEquivalent(meta.internalType);\n            var deps = undefined;\n            if (meta.deps !== undefined) {\n                deps = meta.deps;\n            }\n            if (deps !== undefined) {\n                // factory: () => new meta.useClass(...deps)\n                result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { delegate: meta.useClass.expression, delegateDeps: deps, delegateType: R3FactoryDelegateType.Class }));\n            }\n            else if (useClassOnSelf) {\n                result = compileFactoryFunction(factoryMeta);\n            }\n            else {\n                result = {\n                    statements: [],\n                    expression: delegateToFactory(meta.type.value, meta.useClass.expression, resolveForwardRefs)\n                };\n            }\n        }\n        else if (meta.useFactory !== undefined) {\n            if (meta.deps !== undefined) {\n                result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { delegate: meta.useFactory, delegateDeps: meta.deps || [], delegateType: R3FactoryDelegateType.Function }));\n            }\n            else {\n                result = {\n                    statements: [],\n                    expression: fn([], [new ReturnStatement(meta.useFactory.callFn([]))])\n                };\n            }\n        }\n        else if (meta.useValue !== undefined) {\n            // Note: it's safe to use `meta.useValue` instead of the `USE_VALUE in meta` check used for\n            // client code because meta.useValue is an Expression which will be defined even if the actual\n            // value is undefined.\n            result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: meta.useValue.expression }));\n        }\n        else if (meta.useExisting !== undefined) {\n            // useExisting is an `inject` call on the existing token.\n            result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]) }));\n        }\n        else {\n            result = {\n                statements: [],\n                expression: delegateToFactory(meta.type.value, meta.internalType, resolveForwardRefs)\n            };\n        }\n        var token = meta.internalType;\n        var injectableProps = new DefinitionMap();\n        injectableProps.set('token', token);\n        injectableProps.set('factory', result.expression);\n        // Only generate providedIn property if it has a non-null value\n        if (meta.providedIn.expression.value !== null) {\n            injectableProps.set('providedIn', meta.providedIn.isForwardRef ? generateForwardRef(meta.providedIn.expression) :\n                meta.providedIn.expression);\n        }\n        var expression = importExpr(Identifiers.ɵɵdefineInjectable)\n            .callFn([injectableProps.toLiteralMap()], undefined, true);\n        return {\n            expression: expression,\n            type: createInjectableType(meta),\n            statements: result.statements,\n        };\n    }\n    function createInjectableType(meta) {\n        return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount)]));\n    }\n    function delegateToFactory(type, internalType, unwrapForwardRefs) {\n        if (type.node === internalType.node) {\n            // The types are the same, so we can simply delegate directly to the type's factory.\n            // ```\n            // factory: type.ɵfac\n            // ```\n            return internalType.prop('ɵfac');\n        }\n        if (!unwrapForwardRefs) {\n            // The type is not wrapped in a `forwardRef()`, so we create a simple factory function that\n            // accepts a sub-type as an argument.\n            // ```\n            // factory: function(t) { return internalType.ɵfac(t); }\n            // ```\n            return createFactoryFunction(internalType);\n        }\n        // The internalType is actually wrapped in a `forwardRef()` so we need to resolve that before\n        // calling its factory.\n        // ```\n        // factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }\n        // ```\n        var unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([internalType]);\n        return createFactoryFunction(unwrappedType);\n    }\n    function createFactoryFunction(type) {\n        return fn([new FnParam('t', DYNAMIC_TYPE)], [new ReturnStatement(type.callMethod('ɵfac', [variable('t')]))]);\n    }\n\n    /**\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://angular.io/license\n     */\n    function assertArrayOfStrings(identifier, value) {\n        if (value == null) {\n            return;\n        }\n        if (!Array.isArray(value)) {\n            throw new Error(\"Expected '\" + identifier + \"' to be an array of strings.\");\n        }\n        for (var i = 0; i < value.length; i += 1) {\n            if (typeof value[i] !== 'string') {\n                throw new Error(\"Expected '\" + identifier + \"' to be an array of strings.\");\n            }\n        }\n    }\n    var UNUSABLE_INTERPOLATION_REGEXPS = [\n        /^\\s*$/,\n        /[<>]/,\n        /^[{}]$/,\n        /&(#|[a-z])/i,\n        /^\\/\\//, // comment\n    ];\n    function assertInterpolationSymbols(identifier, value) {\n        if (value != null && !(Array.isArray(value) && value.length == 2)) {\n            throw new Error(\"Expected '\" + identifier + \"' to be an array, [start, end].\");\n        }\n        else if (value != null) {\n            var start_1 = value[0];\n            var end_1 = value[1];\n            // Check for unusable interpolation symbols\n            UNUSABLE_INTERPOLATION_REGEXPS.forEach(function (regexp) {\n                if (regexp.test(start_1) || regexp.test(end_1)) {\n                    throw new Error(\"['\" + start_1 + \"', '\" + end_1 + \"'] contains unusable interpolation symbol.\");\n                }\n            });\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var InterpolationConfig = /** @class */ (function () {\n        function InterpolationConfig(start, end) {\n            this.start = start;\n            this.end = end;\n        }\n        InterpolationConfig.fromArray = function (markers) {\n            if (!markers) {\n                return DEFAULT_INTERPOLATION_CONFIG;\n            }\n            assertInterpolationSymbols('interpolation', markers);\n            return new InterpolationConfig(markers[0], markers[1]);\n        };\n        return InterpolationConfig;\n    }());\n    var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A token representing the a reference to a static type.\n     *\n     * This token is unique for a filePath and name and can be used as a hash table key.\n     */\n    var StaticSymbol = /** @class */ (function () {\n        function StaticSymbol(filePath, name, members) {\n            this.filePath = filePath;\n            this.name = name;\n            this.members = members;\n        }\n        StaticSymbol.prototype.assertNoMembers = function () {\n            if (this.members.length) {\n                throw new Error(\"Illegal state: symbol without members expected, but got \" + JSON.stringify(this) + \".\");\n            }\n        };\n        return StaticSymbol;\n    }());\n    /**\n     * A cache of static symbol used by the StaticReflector to return the same symbol for the\n     * same symbol values.\n     */\n    var StaticSymbolCache = /** @class */ (function () {\n        function StaticSymbolCache() {\n            this.cache = new Map();\n        }\n        StaticSymbolCache.prototype.get = function (declarationFile, name, members) {\n            members = members || [];\n            var memberSuffix = members.length ? \".\" + members.join('.') : '';\n            var key = \"\\\"\" + declarationFile + \"\\\".\" + name + memberSuffix;\n            var result = this.cache.get(key);\n            if (!result) {\n                result = new StaticSymbol(declarationFile, name, members);\n                this.cache.set(key, result);\n            }\n            return result;\n        };\n        return StaticSymbolCache;\n    }());\n\n    /**\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://angular.io/license\n     */\n    // group 0: \"[prop] or (event) or @trigger\"\n    // group 1: \"prop\" from \"[prop]\"\n    // group 2: \"event\" from \"(event)\"\n    // group 3: \"@trigger\" from \"@trigger\"\n    var HOST_REG_EXP = /^(?:(?:\\[([^\\]]+)\\])|(?:\\(([^\\)]+)\\)))|(\\@[-\\w]+)$/;\n    function sanitizeIdentifier(name) {\n        return name.replace(/\\W/g, '_');\n    }\n    var _anonymousTypeIndex = 0;\n    function identifierName(compileIdentifier) {\n        if (!compileIdentifier || !compileIdentifier.reference) {\n            return null;\n        }\n        var ref = compileIdentifier.reference;\n        if (ref instanceof StaticSymbol) {\n            return ref.name;\n        }\n        if (ref['__anonymousType']) {\n            return ref['__anonymousType'];\n        }\n        if (ref['__forward_ref__']) {\n            // We do not want to try to stringify a `forwardRef()` function because that would cause the\n            // inner function to be evaluated too early, defeating the whole point of the `forwardRef`.\n            return '__forward_ref__';\n        }\n        var identifier = stringify(ref);\n        if (identifier.indexOf('(') >= 0) {\n            // case: anonymous functions!\n            identifier = \"anonymous_\" + _anonymousTypeIndex++;\n            ref['__anonymousType'] = identifier;\n        }\n        else {\n            identifier = sanitizeIdentifier(identifier);\n        }\n        return identifier;\n    }\n    function identifierModuleUrl(compileIdentifier) {\n        var ref = compileIdentifier.reference;\n        if (ref instanceof StaticSymbol) {\n            return ref.filePath;\n        }\n        // Runtime type\n        return \"./\" + stringify(ref);\n    }\n    function viewClassName(compType, embeddedTemplateIndex) {\n        return \"View_\" + identifierName({ reference: compType }) + \"_\" + embeddedTemplateIndex;\n    }\n    function rendererTypeName(compType) {\n        return \"RenderType_\" + identifierName({ reference: compType });\n    }\n    function hostViewClassName(compType) {\n        return \"HostView_\" + identifierName({ reference: compType });\n    }\n    function componentFactoryName(compType) {\n        return identifierName({ reference: compType }) + \"NgFactory\";\n    }\n    (function (CompileSummaryKind) {\n        CompileSummaryKind[CompileSummaryKind[\"Pipe\"] = 0] = \"Pipe\";\n        CompileSummaryKind[CompileSummaryKind[\"Directive\"] = 1] = \"Directive\";\n        CompileSummaryKind[CompileSummaryKind[\"NgModule\"] = 2] = \"NgModule\";\n        CompileSummaryKind[CompileSummaryKind[\"Injectable\"] = 3] = \"Injectable\";\n    })(exports.CompileSummaryKind || (exports.CompileSummaryKind = {}));\n    function tokenName(token) {\n        return token.value != null ? sanitizeIdentifier(token.value) : identifierName(token.identifier);\n    }\n    function tokenReference(token) {\n        if (token.identifier != null) {\n            return token.identifier.reference;\n        }\n        else {\n            return token.value;\n        }\n    }\n    /**\n     * Metadata about a stylesheet\n     */\n    var CompileStylesheetMetadata = /** @class */ (function () {\n        function CompileStylesheetMetadata(_a) {\n            var _b = _a === void 0 ? {} : _a, moduleUrl = _b.moduleUrl, styles = _b.styles, styleUrls = _b.styleUrls;\n            this.moduleUrl = moduleUrl || null;\n            this.styles = _normalizeArray(styles);\n            this.styleUrls = _normalizeArray(styleUrls);\n        }\n        return CompileStylesheetMetadata;\n    }());\n    /**\n     * Metadata regarding compilation of a template.\n     */\n    var CompileTemplateMetadata = /** @class */ (function () {\n        function CompileTemplateMetadata(_a) {\n            var encapsulation = _a.encapsulation, template = _a.template, templateUrl = _a.templateUrl, htmlAst = _a.htmlAst, styles = _a.styles, styleUrls = _a.styleUrls, externalStylesheets = _a.externalStylesheets, animations = _a.animations, ngContentSelectors = _a.ngContentSelectors, interpolation = _a.interpolation, isInline = _a.isInline, preserveWhitespaces = _a.preserveWhitespaces;\n            this.encapsulation = encapsulation;\n            this.template = template;\n            this.templateUrl = templateUrl;\n            this.htmlAst = htmlAst;\n            this.styles = _normalizeArray(styles);\n            this.styleUrls = _normalizeArray(styleUrls);\n            this.externalStylesheets = _normalizeArray(externalStylesheets);\n            this.animations = animations ? flatten(animations) : [];\n            this.ngContentSelectors = ngContentSelectors || [];\n            if (interpolation && interpolation.length != 2) {\n                throw new Error(\"'interpolation' should have a start and an end symbol.\");\n            }\n            this.interpolation = interpolation;\n            this.isInline = isInline;\n            this.preserveWhitespaces = preserveWhitespaces;\n        }\n        CompileTemplateMetadata.prototype.toSummary = function () {\n            return {\n                ngContentSelectors: this.ngContentSelectors,\n                encapsulation: this.encapsulation,\n                styles: this.styles,\n                animations: this.animations\n            };\n        };\n        return CompileTemplateMetadata;\n    }());\n    /**\n     * Metadata regarding compilation of a directive.\n     */\n    var CompileDirectiveMetadata = /** @class */ (function () {\n        function CompileDirectiveMetadata(_a) {\n            var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, hostListeners = _a.hostListeners, hostProperties = _a.hostProperties, hostAttributes = _a.hostAttributes, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, guards = _a.guards, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;\n            this.isHost = !!isHost;\n            this.type = type;\n            this.isComponent = isComponent;\n            this.selector = selector;\n            this.exportAs = exportAs;\n            this.changeDetection = changeDetection;\n            this.inputs = inputs;\n            this.outputs = outputs;\n            this.hostListeners = hostListeners;\n            this.hostProperties = hostProperties;\n            this.hostAttributes = hostAttributes;\n            this.providers = _normalizeArray(providers);\n            this.viewProviders = _normalizeArray(viewProviders);\n            this.queries = _normalizeArray(queries);\n            this.guards = guards;\n            this.viewQueries = _normalizeArray(viewQueries);\n            this.entryComponents = _normalizeArray(entryComponents);\n            this.template = template;\n            this.componentViewType = componentViewType;\n            this.rendererType = rendererType;\n            this.componentFactory = componentFactory;\n        }\n        CompileDirectiveMetadata.create = function (_a) {\n            var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, host = _a.host, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, guards = _a.guards, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;\n            var hostListeners = {};\n            var hostProperties = {};\n            var hostAttributes = {};\n            if (host != null) {\n                Object.keys(host).forEach(function (key) {\n                    var value = host[key];\n                    var matches = key.match(HOST_REG_EXP);\n                    if (matches === null) {\n                        hostAttributes[key] = value;\n                    }\n                    else if (matches[1] != null) {\n                        hostProperties[matches[1]] = value;\n                    }\n                    else if (matches[2] != null) {\n                        hostListeners[matches[2]] = value;\n                    }\n                });\n            }\n            var inputsMap = {};\n            if (inputs != null) {\n                inputs.forEach(function (bindConfig) {\n                    // canonical syntax: `dirProp: elProp`\n                    // if there is no `:`, use dirProp = elProp\n                    var parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n                    inputsMap[parts[0]] = parts[1];\n                });\n            }\n            var outputsMap = {};\n            if (outputs != null) {\n                outputs.forEach(function (bindConfig) {\n                    // canonical syntax: `dirProp: elProp`\n                    // if there is no `:`, use dirProp = elProp\n                    var parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n                    outputsMap[parts[0]] = parts[1];\n                });\n            }\n            return new CompileDirectiveMetadata({\n                isHost: isHost,\n                type: type,\n                isComponent: !!isComponent,\n                selector: selector,\n                exportAs: exportAs,\n                changeDetection: changeDetection,\n                inputs: inputsMap,\n                outputs: outputsMap,\n                hostListeners: hostListeners,\n                hostProperties: hostProperties,\n                hostAttributes: hostAttributes,\n                providers: providers,\n                viewProviders: viewProviders,\n                queries: queries,\n                guards: guards,\n                viewQueries: viewQueries,\n                entryComponents: entryComponents,\n                template: template,\n                componentViewType: componentViewType,\n                rendererType: rendererType,\n                componentFactory: componentFactory,\n            });\n        };\n        CompileDirectiveMetadata.prototype.toSummary = function () {\n            return {\n                summaryKind: exports.CompileSummaryKind.Directive,\n                type: this.type,\n                isComponent: this.isComponent,\n                selector: this.selector,\n                exportAs: this.exportAs,\n                inputs: this.inputs,\n                outputs: this.outputs,\n                hostListeners: this.hostListeners,\n                hostProperties: this.hostProperties,\n                hostAttributes: this.hostAttributes,\n                providers: this.providers,\n                viewProviders: this.viewProviders,\n                queries: this.queries,\n                guards: this.guards,\n                viewQueries: this.viewQueries,\n                entryComponents: this.entryComponents,\n                changeDetection: this.changeDetection,\n                template: this.template && this.template.toSummary(),\n                componentViewType: this.componentViewType,\n                rendererType: this.rendererType,\n                componentFactory: this.componentFactory\n            };\n        };\n        return CompileDirectiveMetadata;\n    }());\n    var CompilePipeMetadata = /** @class */ (function () {\n        function CompilePipeMetadata(_a) {\n            var type = _a.type, name = _a.name, pure = _a.pure;\n            this.type = type;\n            this.name = name;\n            this.pure = !!pure;\n        }\n        CompilePipeMetadata.prototype.toSummary = function () {\n            return {\n                summaryKind: exports.CompileSummaryKind.Pipe,\n                type: this.type,\n                name: this.name,\n                pure: this.pure\n            };\n        };\n        return CompilePipeMetadata;\n    }());\n    var CompileShallowModuleMetadata = /** @class */ (function () {\n        function CompileShallowModuleMetadata() {\n        }\n        return CompileShallowModuleMetadata;\n    }());\n    /**\n     * Metadata regarding compilation of a module.\n     */\n    var CompileNgModuleMetadata = /** @class */ (function () {\n        function CompileNgModuleMetadata(_a) {\n            var type = _a.type, providers = _a.providers, declaredDirectives = _a.declaredDirectives, exportedDirectives = _a.exportedDirectives, declaredPipes = _a.declaredPipes, exportedPipes = _a.exportedPipes, entryComponents = _a.entryComponents, bootstrapComponents = _a.bootstrapComponents, importedModules = _a.importedModules, exportedModules = _a.exportedModules, schemas = _a.schemas, transitiveModule = _a.transitiveModule, id = _a.id;\n            this.type = type || null;\n            this.declaredDirectives = _normalizeArray(declaredDirectives);\n            this.exportedDirectives = _normalizeArray(exportedDirectives);\n            this.declaredPipes = _normalizeArray(declaredPipes);\n            this.exportedPipes = _normalizeArray(exportedPipes);\n            this.providers = _normalizeArray(providers);\n            this.entryComponents = _normalizeArray(entryComponents);\n            this.bootstrapComponents = _normalizeArray(bootstrapComponents);\n            this.importedModules = _normalizeArray(importedModules);\n            this.exportedModules = _normalizeArray(exportedModules);\n            this.schemas = _normalizeArray(schemas);\n            this.id = id || null;\n            this.transitiveModule = transitiveModule || null;\n        }\n        CompileNgModuleMetadata.prototype.toSummary = function () {\n            var module = this.transitiveModule;\n            return {\n                summaryKind: exports.CompileSummaryKind.NgModule,\n                type: this.type,\n                entryComponents: module.entryComponents,\n                providers: module.providers,\n                modules: module.modules,\n                exportedDirectives: module.exportedDirectives,\n                exportedPipes: module.exportedPipes\n            };\n        };\n        return CompileNgModuleMetadata;\n    }());\n    var TransitiveCompileNgModuleMetadata = /** @class */ (function () {\n        function TransitiveCompileNgModuleMetadata() {\n            this.directivesSet = new Set();\n            this.directives = [];\n            this.exportedDirectivesSet = new Set();\n            this.exportedDirectives = [];\n            this.pipesSet = new Set();\n            this.pipes = [];\n            this.exportedPipesSet = new Set();\n            this.exportedPipes = [];\n            this.modulesSet = new Set();\n            this.modules = [];\n            this.entryComponentsSet = new Set();\n            this.entryComponents = [];\n            this.providers = [];\n        }\n        TransitiveCompileNgModuleMetadata.prototype.addProvider = function (provider, module) {\n            this.providers.push({ provider: provider, module: module });\n        };\n        TransitiveCompileNgModuleMetadata.prototype.addDirective = function (id) {\n            if (!this.directivesSet.has(id.reference)) {\n                this.directivesSet.add(id.reference);\n                this.directives.push(id);\n            }\n        };\n        TransitiveCompileNgModuleMetadata.prototype.addExportedDirective = function (id) {\n            if (!this.exportedDirectivesSet.has(id.reference)) {\n                this.exportedDirectivesSet.add(id.reference);\n                this.exportedDirectives.push(id);\n            }\n        };\n        TransitiveCompileNgModuleMetadata.prototype.addPipe = function (id) {\n            if (!this.pipesSet.has(id.reference)) {\n                this.pipesSet.add(id.reference);\n                this.pipes.push(id);\n            }\n        };\n        TransitiveCompileNgModuleMetadata.prototype.addExportedPipe = function (id) {\n            if (!this.exportedPipesSet.has(id.reference)) {\n                this.exportedPipesSet.add(id.reference);\n                this.exportedPipes.push(id);\n            }\n        };\n        TransitiveCompileNgModuleMetadata.prototype.addModule = function (id) {\n            if (!this.modulesSet.has(id.reference)) {\n                this.modulesSet.add(id.reference);\n                this.modules.push(id);\n            }\n        };\n        TransitiveCompileNgModuleMetadata.prototype.addEntryComponent = function (ec) {\n            if (!this.entryComponentsSet.has(ec.componentType)) {\n                this.entryComponentsSet.add(ec.componentType);\n                this.entryComponents.push(ec);\n            }\n        };\n        return TransitiveCompileNgModuleMetadata;\n    }());\n    function _normalizeArray(obj) {\n        return obj || [];\n    }\n    var ProviderMeta = /** @class */ (function () {\n        function ProviderMeta(token, _a) {\n            var useClass = _a.useClass, useValue = _a.useValue, useExisting = _a.useExisting, useFactory = _a.useFactory, deps = _a.deps, multi = _a.multi;\n            this.token = token;\n            this.useClass = useClass || null;\n            this.useValue = useValue;\n            this.useExisting = useExisting;\n            this.useFactory = useFactory || null;\n            this.dependencies = deps || null;\n            this.multi = !!multi;\n        }\n        return ProviderMeta;\n    }());\n    function flatten(list) {\n        return list.reduce(function (flat, item) {\n            var flatItem = Array.isArray(item) ? flatten(item) : item;\n            return flat.concat(flatItem);\n        }, []);\n    }\n    function jitSourceUrl(url) {\n        // Note: We need 3 \"/\" so that ng shows up as a separate domain\n        // in the chrome dev tools.\n        return url.replace(/(\\w+:\\/\\/[\\w:-]+)?(\\/+)?/, 'ng:///');\n    }\n    function templateSourceUrl(ngModuleType, compMeta, templateMeta) {\n        var url;\n        if (templateMeta.isInline) {\n            if (compMeta.type.reference instanceof StaticSymbol) {\n                // Note: a .ts file might contain multiple components with inline templates,\n                // so we need to give them unique urls, as these will be used for sourcemaps.\n                url = compMeta.type.reference.filePath + \".\" + compMeta.type.reference.name + \".html\";\n            }\n            else {\n                url = identifierName(ngModuleType) + \"/\" + identifierName(compMeta.type) + \".html\";\n            }\n        }\n        else {\n            url = templateMeta.templateUrl;\n        }\n        return compMeta.type.reference instanceof StaticSymbol ? url : jitSourceUrl(url);\n    }\n    function sharedStylesheetJitUrl(meta, id) {\n        var pathParts = meta.moduleUrl.split(/\\/\\\\/g);\n        var baseName = pathParts[pathParts.length - 1];\n        return jitSourceUrl(\"css/\" + id + baseName + \".ngstyle.js\");\n    }\n    function ngModuleJitUrl(moduleMeta) {\n        return jitSourceUrl(identifierName(moduleMeta.type) + \"/module.ngfactory.js\");\n    }\n    function templateJitUrl(ngModuleType, compMeta) {\n        return jitSourceUrl(identifierName(ngModuleType) + \"/\" + identifierName(compMeta.type) + \".ngfactory.js\");\n    }\n\n    /**\n     * In TypeScript, tagged template functions expect a \"template object\", which is an array of\n     * \"cooked\" strings plus a `raw` property that contains an array of \"raw\" strings. This is\n     * typically constructed with a function called `__makeTemplateObject(cooked, raw)`, but it may not\n     * be available in all environments.\n     *\n     * This is a JavaScript polyfill that uses __makeTemplateObject when it's available, but otherwise\n     * creates an inline helper with the same functionality.\n     *\n     * In the inline function, if `Object.defineProperty` is available we use that to attach the `raw`\n     * array.\n     */\n    var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,\"raw\",{value:t}):e.raw=t,e})';\n    var AbstractJsEmitterVisitor = /** @class */ (function (_super) {\n        __extends(AbstractJsEmitterVisitor, _super);\n        function AbstractJsEmitterVisitor() {\n            return _super.call(this, false) || this;\n        }\n        AbstractJsEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n            var _this = this;\n            ctx.pushClass(stmt);\n            this._visitClassConstructor(stmt, ctx);\n            if (stmt.parent != null) {\n                ctx.print(stmt, stmt.name + \".prototype = Object.create(\");\n                stmt.parent.visitExpression(this, ctx);\n                ctx.println(stmt, \".prototype);\");\n            }\n            stmt.getters.forEach(function (getter) { return _this._visitClassGetter(stmt, getter, ctx); });\n            stmt.methods.forEach(function (method) { return _this._visitClassMethod(stmt, method, ctx); });\n            ctx.popClass();\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype._visitClassConstructor = function (stmt, ctx) {\n            ctx.print(stmt, \"function \" + stmt.name + \"(\");\n            if (stmt.constructorMethod != null) {\n                this._visitParams(stmt.constructorMethod.params, ctx);\n            }\n            ctx.println(stmt, \") {\");\n            ctx.incIndent();\n            if (stmt.constructorMethod != null) {\n                if (stmt.constructorMethod.body.length > 0) {\n                    ctx.println(stmt, \"var self = this;\");\n                    this.visitAllStatements(stmt.constructorMethod.body, ctx);\n                }\n            }\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n        };\n        AbstractJsEmitterVisitor.prototype._visitClassGetter = function (stmt, getter, ctx) {\n            ctx.println(stmt, \"Object.defineProperty(\" + stmt.name + \".prototype, '\" + getter.name + \"', { get: function() {\");\n            ctx.incIndent();\n            if (getter.body.length > 0) {\n                ctx.println(stmt, \"var self = this;\");\n                this.visitAllStatements(getter.body, ctx);\n            }\n            ctx.decIndent();\n            ctx.println(stmt, \"}});\");\n        };\n        AbstractJsEmitterVisitor.prototype._visitClassMethod = function (stmt, method, ctx) {\n            ctx.print(stmt, stmt.name + \".prototype.\" + method.name + \" = function(\");\n            this._visitParams(method.params, ctx);\n            ctx.println(stmt, \") {\");\n            ctx.incIndent();\n            if (method.body.length > 0) {\n                ctx.println(stmt, \"var self = this;\");\n                this.visitAllStatements(method.body, ctx);\n            }\n            ctx.decIndent();\n            ctx.println(stmt, \"};\");\n        };\n        AbstractJsEmitterVisitor.prototype.visitWrappedNodeExpr = function (ast, ctx) {\n            throw new Error('Cannot emit a WrappedNodeExpr in Javascript.');\n        };\n        AbstractJsEmitterVisitor.prototype.visitReadVarExpr = function (ast, ctx) {\n            if (ast.builtin === exports.BuiltinVar.This) {\n                ctx.print(ast, 'self');\n            }\n            else if (ast.builtin === exports.BuiltinVar.Super) {\n                throw new Error(\"'super' needs to be handled at a parent ast node, not at the variable level!\");\n            }\n            else {\n                _super.prototype.visitReadVarExpr.call(this, ast, ctx);\n            }\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n            ctx.print(stmt, \"var \" + stmt.name);\n            if (stmt.value) {\n                ctx.print(stmt, ' = ');\n                stmt.value.visitExpression(this, ctx);\n            }\n            ctx.println(stmt, \";\");\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitCastExpr = function (ast, ctx) {\n            ast.value.visitExpression(this, ctx);\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr, ctx) {\n            var fnExpr = expr.fn;\n            if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === exports.BuiltinVar.Super) {\n                ctx.currentClass.parent.visitExpression(this, ctx);\n                ctx.print(expr, \".call(this\");\n                if (expr.args.length > 0) {\n                    ctx.print(expr, \", \");\n                    this.visitAllExpressions(expr.args, ctx, ',');\n                }\n                ctx.print(expr, \")\");\n            }\n            else {\n                _super.prototype.visitInvokeFunctionExpr.call(this, expr, ctx);\n            }\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitTaggedTemplateExpr = function (ast, ctx) {\n            var _this = this;\n            // The following convoluted piece of code is effectively the downlevelled equivalent of\n            // ```\n            // tag`...`\n            // ```\n            // which is effectively like:\n            // ```\n            // tag(__makeTemplateObject(cooked, raw), expression1, expression2, ...);\n            // ```\n            var elements = ast.template.elements;\n            ast.tag.visitExpression(this, ctx);\n            ctx.print(ast, \"(\" + makeTemplateObjectPolyfill + \"(\");\n            ctx.print(ast, \"[\" + elements.map(function (part) { return escapeIdentifier(part.text, false); }).join(', ') + \"], \");\n            ctx.print(ast, \"[\" + elements.map(function (part) { return escapeIdentifier(part.rawText, false); }).join(', ') + \"])\");\n            ast.template.expressions.forEach(function (expression) {\n                ctx.print(ast, ', ');\n                expression.visitExpression(_this, ctx);\n            });\n            ctx.print(ast, ')');\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) {\n            ctx.print(ast, \"function\" + (ast.name ? ' ' + ast.name : '') + \"(\");\n            this._visitParams(ast.params, ctx);\n            ctx.println(ast, \") {\");\n            ctx.incIndent();\n            this.visitAllStatements(ast.statements, ctx);\n            ctx.decIndent();\n            ctx.print(ast, \"}\");\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n            ctx.print(stmt, \"function \" + stmt.name + \"(\");\n            this._visitParams(stmt.params, ctx);\n            ctx.println(stmt, \") {\");\n            ctx.incIndent();\n            this.visitAllStatements(stmt.statements, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) {\n            ctx.println(stmt, \"try {\");\n            ctx.incIndent();\n            this.visitAllStatements(stmt.bodyStmts, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"} catch (\" + CATCH_ERROR_VAR$1.name + \") {\");\n            ctx.incIndent();\n            var catchStmts = [CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack')).toDeclStmt(null, [\n                    exports.StmtModifier.Final\n                ])].concat(stmt.catchStmts);\n            this.visitAllStatements(catchStmts, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype.visitLocalizedString = function (ast, ctx) {\n            var _this = this;\n            // The following convoluted piece of code is effectively the downlevelled equivalent of\n            // ```\n            // $localize `...`\n            // ```\n            // which is effectively like:\n            // ```\n            // $localize(__makeTemplateObject(cooked, raw), expression1, expression2, ...);\n            // ```\n            ctx.print(ast, \"$localize(\" + makeTemplateObjectPolyfill + \"(\");\n            var parts = [ast.serializeI18nHead()];\n            for (var i = 1; i < ast.messageParts.length; i++) {\n                parts.push(ast.serializeI18nTemplatePart(i));\n            }\n            ctx.print(ast, \"[\" + parts.map(function (part) { return escapeIdentifier(part.cooked, false); }).join(', ') + \"], \");\n            ctx.print(ast, \"[\" + parts.map(function (part) { return escapeIdentifier(part.raw, false); }).join(', ') + \"])\");\n            ast.expressions.forEach(function (expression) {\n                ctx.print(ast, ', ');\n                expression.visitExpression(_this, ctx);\n            });\n            ctx.print(ast, ')');\n            return null;\n        };\n        AbstractJsEmitterVisitor.prototype._visitParams = function (params, ctx) {\n            this.visitAllObjects(function (param) { return ctx.print(null, param.name); }, params, ctx, ',');\n        };\n        AbstractJsEmitterVisitor.prototype.getBuiltinMethodName = function (method) {\n            var name;\n            switch (method) {\n                case exports.BuiltinMethod.ConcatArray:\n                    name = 'concat';\n                    break;\n                case exports.BuiltinMethod.SubscribeObservable:\n                    name = 'subscribe';\n                    break;\n                case exports.BuiltinMethod.Bind:\n                    name = 'bind';\n                    break;\n                default:\n                    throw new Error(\"Unknown builtin method: \" + method);\n            }\n            return name;\n        };\n        return AbstractJsEmitterVisitor;\n    }(AbstractEmitterVisitor));\n\n    /**\n     * The Trusted Types policy, or null if Trusted Types are not\n     * enabled/supported, or undefined if the policy has not been created yet.\n     */\n    var policy;\n    /**\n     * Returns the Trusted Types policy, or null if Trusted Types are not\n     * enabled/supported. The first call to this function will create the policy.\n     */\n    function getPolicy() {\n        if (policy === undefined) {\n            policy = null;\n            if (_global.trustedTypes) {\n                try {\n                    policy =\n                        _global.trustedTypes.createPolicy('angular#unsafe-jit', {\n                            createScript: function (s) { return s; },\n                        });\n                }\n                catch (_a) {\n                    // trustedTypes.createPolicy throws if called with a name that is\n                    // already registered, even in report-only mode. Until the API changes,\n                    // catch the error not to break the applications functionally. In such\n                    // cases, the code will fall back to using strings.\n                }\n            }\n        }\n        return policy;\n    }\n    /**\n     * Unsafely promote a string to a TrustedScript, falling back to strings when\n     * Trusted Types are not available.\n     * @security In particular, it must be assured that the provided string will\n     * never cause an XSS vulnerability if used in a context that will be\n     * interpreted and executed as a script by a browser, e.g. when calling eval.\n     */\n    function trustedScriptFromString(script) {\n        var _a;\n        return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n    }\n    /**\n     * Unsafely call the Function constructor with the given string arguments.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that it\n     * is only called from the JIT compiler, as use in other code can lead to XSS\n     * vulnerabilities.\n     */\n    function newTrustedFunctionForJIT() {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        if (!_global.trustedTypes) {\n            // In environments that don't support Trusted Types, fall back to the most\n            // straightforward implementation:\n            return new (Function.bind.apply(Function, __spreadArray([void 0], __read(args))))();\n        }\n        // Chrome currently does not support passing TrustedScript to the Function\n        // constructor. The following implements the workaround proposed on the page\n        // below, where the Chromium bug is also referenced:\n        // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n        var fnArgs = args.slice(0, -1).join(',');\n        var fnBody = args[args.length - 1];\n        var body = \"(function anonymous(\" + fnArgs + \"\\n) { \" + fnBody + \"\\n})\";\n        // Using eval directly confuses the compiler and prevents this module from\n        // being stripped out of JS binaries even if not used. The global['eval']\n        // indirection fixes that.\n        var fn = _global['eval'](trustedScriptFromString(body));\n        if (fn.bind === undefined) {\n            // Workaround for a browser bug that only exists in Chrome 83, where passing\n            // a TrustedScript to eval just returns the TrustedScript back without\n            // evaluating it. In that case, fall back to the most straightforward\n            // implementation:\n            return new (Function.bind.apply(Function, __spreadArray([void 0], __read(args))))();\n        }\n        // To completely mimic the behavior of calling \"new Function\", two more\n        // things need to happen:\n        // 1. Stringifying the resulting function should return its source code\n        fn.toString = function () { return body; };\n        // 2. When calling the resulting function, `this` should refer to `global`\n        return fn.bind(_global);\n        // When Trusted Types support in Function constructors is widely available,\n        // the implementation of this function can be simplified to:\n        // return new Function(...args.map(a => trustedScriptFromString(a)));\n    }\n\n    /**\n     * A helper class to manage the evaluation of JIT generated code.\n     */\n    var JitEvaluator = /** @class */ (function () {\n        function JitEvaluator() {\n        }\n        /**\n         *\n         * @param sourceUrl The URL of the generated code.\n         * @param statements An array of Angular statement AST nodes to be evaluated.\n         * @param reflector A helper used when converting the statements to executable code.\n         * @param createSourceMaps If true then create a source-map for the generated code and include it\n         * inline as a source-map comment.\n         * @returns A map of all the variables in the generated code.\n         */\n        JitEvaluator.prototype.evaluateStatements = function (sourceUrl, statements, reflector, createSourceMaps) {\n            var converter = new JitEmitterVisitor(reflector);\n            var ctx = EmitterVisitorContext.createRoot();\n            // Ensure generated code is in strict mode\n            if (statements.length > 0 && !isUseStrictStatement(statements[0])) {\n                statements = __spreadArray([\n                    literal('use strict').toStmt()\n                ], __read(statements));\n            }\n            converter.visitAllStatements(statements, ctx);\n            converter.createReturnStmt(ctx);\n            return this.evaluateCode(sourceUrl, ctx, converter.getArgs(), createSourceMaps);\n        };\n        /**\n         * Evaluate a piece of JIT generated code.\n         * @param sourceUrl The URL of this generated code.\n         * @param ctx A context object that contains an AST of the code to be evaluated.\n         * @param vars A map containing the names and values of variables that the evaluated code might\n         * reference.\n         * @param createSourceMap If true then create a source-map for the generated code and include it\n         * inline as a source-map comment.\n         * @returns The result of evaluating the code.\n         */\n        JitEvaluator.prototype.evaluateCode = function (sourceUrl, ctx, vars, createSourceMap) {\n            var fnBody = \"\\\"use strict\\\";\" + ctx.toSource() + \"\\n//# sourceURL=\" + sourceUrl;\n            var fnArgNames = [];\n            var fnArgValues = [];\n            for (var argName in vars) {\n                fnArgValues.push(vars[argName]);\n                fnArgNames.push(argName);\n            }\n            if (createSourceMap) {\n                // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise\n                // E.g. ```\n                // function anonymous(a,b,c\n                // /**/) { ... }```\n                // We don't want to hard code this fact, so we auto detect it via an empty function first.\n                var emptyFn = newTrustedFunctionForJIT.apply(void 0, __spreadArray([], __read(fnArgNames.concat('return null;')))).toString();\n                var headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\\n').length - 1;\n                fnBody += \"\\n\" + ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment();\n            }\n            var fn = newTrustedFunctionForJIT.apply(void 0, __spreadArray([], __read(fnArgNames.concat(fnBody))));\n            return this.executeFunction(fn, fnArgValues);\n        };\n        /**\n         * Execute a JIT generated function by calling it.\n         *\n         * This method can be overridden in tests to capture the functions that are generated\n         * by this `JitEvaluator` class.\n         *\n         * @param fn A function to execute.\n         * @param args The arguments to pass to the function being executed.\n         * @returns The return value of the executed function.\n         */\n        JitEvaluator.prototype.executeFunction = function (fn, args) {\n            return fn.apply(void 0, __spreadArray([], __read(args)));\n        };\n        return JitEvaluator;\n    }());\n    /**\n     * An Angular AST visitor that converts AST nodes into executable JavaScript code.\n     */\n    var JitEmitterVisitor = /** @class */ (function (_super) {\n        __extends(JitEmitterVisitor, _super);\n        function JitEmitterVisitor(reflector) {\n            var _this = _super.call(this) || this;\n            _this.reflector = reflector;\n            _this._evalArgNames = [];\n            _this._evalArgValues = [];\n            _this._evalExportedVars = [];\n            return _this;\n        }\n        JitEmitterVisitor.prototype.createReturnStmt = function (ctx) {\n            var stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map(function (resultVar) { return new LiteralMapEntry(resultVar, variable(resultVar), false); })));\n            stmt.visitStatement(this, ctx);\n        };\n        JitEmitterVisitor.prototype.getArgs = function () {\n            var result = {};\n            for (var i = 0; i < this._evalArgNames.length; i++) {\n                result[this._evalArgNames[i]] = this._evalArgValues[i];\n            }\n            return result;\n        };\n        JitEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) {\n            this._emitReferenceToExternal(ast, this.reflector.resolveExternalReference(ast.value), ctx);\n            return null;\n        };\n        JitEmitterVisitor.prototype.visitWrappedNodeExpr = function (ast, ctx) {\n            this._emitReferenceToExternal(ast, ast.node, ctx);\n            return null;\n        };\n        JitEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                this._evalExportedVars.push(stmt.name);\n            }\n            return _super.prototype.visitDeclareVarStmt.call(this, stmt, ctx);\n        };\n        JitEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                this._evalExportedVars.push(stmt.name);\n            }\n            return _super.prototype.visitDeclareFunctionStmt.call(this, stmt, ctx);\n        };\n        JitEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                this._evalExportedVars.push(stmt.name);\n            }\n            return _super.prototype.visitDeclareClassStmt.call(this, stmt, ctx);\n        };\n        JitEmitterVisitor.prototype._emitReferenceToExternal = function (ast, value, ctx) {\n            var id = this._evalArgValues.indexOf(value);\n            if (id === -1) {\n                id = this._evalArgValues.length;\n                this._evalArgValues.push(value);\n                var name = identifierName({ reference: value }) || 'val';\n                this._evalArgNames.push(\"jit_\" + name + \"_\" + id);\n            }\n            ctx.print(ast, this._evalArgNames[id]);\n        };\n        return JitEmitterVisitor;\n    }(AbstractJsEmitterVisitor));\n    function isUseStrictStatement(statement) {\n        return statement.isEquivalent(literal('use strict').toStmt());\n    }\n\n    /**\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://angular.io/license\n     */\n    var $EOF = 0;\n    var $BSPACE = 8;\n    var $TAB = 9;\n    var $LF = 10;\n    var $VTAB = 11;\n    var $FF = 12;\n    var $CR = 13;\n    var $SPACE = 32;\n    var $BANG = 33;\n    var $DQ = 34;\n    var $HASH = 35;\n    var $$ = 36;\n    var $PERCENT = 37;\n    var $AMPERSAND = 38;\n    var $SQ = 39;\n    var $LPAREN = 40;\n    var $RPAREN = 41;\n    var $STAR = 42;\n    var $PLUS = 43;\n    var $COMMA = 44;\n    var $MINUS = 45;\n    var $PERIOD = 46;\n    var $SLASH = 47;\n    var $COLON = 58;\n    var $SEMICOLON = 59;\n    var $LT = 60;\n    var $EQ = 61;\n    var $GT = 62;\n    var $QUESTION = 63;\n    var $0 = 48;\n    var $7 = 55;\n    var $9 = 57;\n    var $A = 65;\n    var $E = 69;\n    var $F = 70;\n    var $X = 88;\n    var $Z = 90;\n    var $LBRACKET = 91;\n    var $BACKSLASH = 92;\n    var $RBRACKET = 93;\n    var $CARET = 94;\n    var $_ = 95;\n    var $a = 97;\n    var $b = 98;\n    var $e = 101;\n    var $f = 102;\n    var $n = 110;\n    var $r = 114;\n    var $t = 116;\n    var $u = 117;\n    var $v = 118;\n    var $x = 120;\n    var $z = 122;\n    var $LBRACE = 123;\n    var $BAR = 124;\n    var $RBRACE = 125;\n    var $NBSP = 160;\n    var $PIPE = 124;\n    var $TILDA = 126;\n    var $AT = 64;\n    var $BT = 96;\n    function isWhitespace(code) {\n        return (code >= $TAB && code <= $SPACE) || (code == $NBSP);\n    }\n    function isDigit(code) {\n        return $0 <= code && code <= $9;\n    }\n    function isAsciiLetter(code) {\n        return code >= $a && code <= $z || code >= $A && code <= $Z;\n    }\n    function isAsciiHexDigit(code) {\n        return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);\n    }\n    function isNewLine(code) {\n        return code === $LF || code === $CR;\n    }\n    function isOctalDigit(code) {\n        return $0 <= code && code <= $7;\n    }\n\n    /**\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://angular.io/license\n     */\n    var ParseLocation = /** @class */ (function () {\n        function ParseLocation(file, offset, line, col) {\n            this.file = file;\n            this.offset = offset;\n            this.line = line;\n            this.col = col;\n        }\n        ParseLocation.prototype.toString = function () {\n            return this.offset != null ? this.file.url + \"@\" + this.line + \":\" + this.col : this.file.url;\n        };\n        ParseLocation.prototype.moveBy = function (delta) {\n            var source = this.file.content;\n            var len = source.length;\n            var offset = this.offset;\n            var line = this.line;\n            var col = this.col;\n            while (offset > 0 && delta < 0) {\n                offset--;\n                delta++;\n                var ch = source.charCodeAt(offset);\n                if (ch == $LF) {\n                    line--;\n                    var priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));\n                    col = priorLine > 0 ? offset - priorLine : offset;\n                }\n                else {\n                    col--;\n                }\n            }\n            while (offset < len && delta > 0) {\n                var ch = source.charCodeAt(offset);\n                offset++;\n                delta--;\n                if (ch == $LF) {\n                    line++;\n                    col = 0;\n                }\n                else {\n                    col++;\n                }\n            }\n            return new ParseLocation(this.file, offset, line, col);\n        };\n        // Return the source around the location\n        // Up to `maxChars` or `maxLines` on each side of the location\n        ParseLocation.prototype.getContext = function (maxChars, maxLines) {\n            var content = this.file.content;\n            var startOffset = this.offset;\n            if (startOffset != null) {\n                if (startOffset > content.length - 1) {\n                    startOffset = content.length - 1;\n                }\n                var endOffset = startOffset;\n                var ctxChars = 0;\n                var ctxLines = 0;\n                while (ctxChars < maxChars && startOffset > 0) {\n                    startOffset--;\n                    ctxChars++;\n                    if (content[startOffset] == '\\n') {\n                        if (++ctxLines == maxLines) {\n                            break;\n                        }\n                    }\n                }\n                ctxChars = 0;\n                ctxLines = 0;\n                while (ctxChars < maxChars && endOffset < content.length - 1) {\n                    endOffset++;\n                    ctxChars++;\n                    if (content[endOffset] == '\\n') {\n                        if (++ctxLines == maxLines) {\n                            break;\n                        }\n                    }\n                }\n                return {\n                    before: content.substring(startOffset, this.offset),\n                    after: content.substring(this.offset, endOffset + 1),\n                };\n            }\n            return null;\n        };\n        return ParseLocation;\n    }());\n    var ParseSourceFile = /** @class */ (function () {\n        function ParseSourceFile(content, url) {\n            this.content = content;\n            this.url = url;\n        }\n        return ParseSourceFile;\n    }());\n    var ParseSourceSpan = /** @class */ (function () {\n        /**\n         * Create an object that holds information about spans of tokens/nodes captured during\n         * lexing/parsing of text.\n         *\n         * @param start\n         * The location of the start of the span (having skipped leading trivia).\n         * Skipping leading trivia makes source-spans more \"user friendly\", since things like HTML\n         * elements will appear to begin at the start of the opening tag, rather than at the start of any\n         * leading trivia, which could include newlines.\n         *\n         * @param end\n         * The location of the end of the span.\n         *\n         * @param fullStart\n         * The start of the token without skipping the leading trivia.\n         * This is used by tooling that splits tokens further, such as extracting Angular interpolations\n         * from text tokens. Such tooling creates new source-spans relative to the original token's\n         * source-span. If leading trivia characters have been skipped then the new source-spans may be\n         * incorrectly offset.\n         *\n         * @param details\n         * Additional information (such as identifier names) that should be associated with the span.\n         */\n        function ParseSourceSpan(start, end, fullStart, details) {\n            if (fullStart === void 0) { fullStart = start; }\n            if (details === void 0) { details = null; }\n            this.start = start;\n            this.end = end;\n            this.fullStart = fullStart;\n            this.details = details;\n        }\n        ParseSourceSpan.prototype.toString = function () {\n            return this.start.file.content.substring(this.start.offset, this.end.offset);\n        };\n        return ParseSourceSpan;\n    }());\n    (function (ParseErrorLevel) {\n        ParseErrorLevel[ParseErrorLevel[\"WARNING\"] = 0] = \"WARNING\";\n        ParseErrorLevel[ParseErrorLevel[\"ERROR\"] = 1] = \"ERROR\";\n    })(exports.ParseErrorLevel || (exports.ParseErrorLevel = {}));\n    var ParseError = /** @class */ (function () {\n        function ParseError(span, msg, level) {\n            if (level === void 0) { level = exports.ParseErrorLevel.ERROR; }\n            this.span = span;\n            this.msg = msg;\n            this.level = level;\n        }\n        ParseError.prototype.contextualMessage = function () {\n            var ctx = this.span.start.getContext(100, 3);\n            return ctx ? this.msg + \" (\\\"\" + ctx.before + \"[\" + exports.ParseErrorLevel[this.level] + \" ->]\" + ctx.after + \"\\\")\" :\n                this.msg;\n        };\n        ParseError.prototype.toString = function () {\n            var details = this.span.details ? \", \" + this.span.details : '';\n            return this.contextualMessage() + \": \" + this.span.start + details;\n        };\n        return ParseError;\n    }());\n    function typeSourceSpan(kind, type) {\n        var moduleUrl = identifierModuleUrl(type);\n        var sourceFileName = moduleUrl != null ? \"in \" + kind + \" \" + identifierName(type) + \" in \" + moduleUrl :\n            \"in \" + kind + \" \" + identifierName(type);\n        var sourceFile = new ParseSourceFile('', sourceFileName);\n        return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));\n    }\n    /**\n     * Generates Source Span object for a given R3 Type for JIT mode.\n     *\n     * @param kind Component or Directive.\n     * @param typeName name of the Component or Directive.\n     * @param sourceUrl reference to Component or Directive source.\n     * @returns instance of ParseSourceSpan that represent a given Component or Directive.\n     */\n    function r3JitTypeSourceSpan(kind, typeName, sourceUrl) {\n        var sourceFileName = \"in \" + kind + \" \" + typeName + \" in \" + sourceUrl;\n        var sourceFile = new ParseSourceFile('', sourceFileName);\n        return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));\n    }\n\n    /**\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://angular.io/license\n     */\n    function compileInjector(meta) {\n        var definitionMap = new DefinitionMap();\n        if (meta.providers !== null) {\n            definitionMap.set('providers', meta.providers);\n        }\n        if (meta.imports.length > 0) {\n            definitionMap.set('imports', literalArr(meta.imports));\n        }\n        var expression = importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()], undefined, true);\n        var type = createInjectorType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    function createInjectorType(meta) {\n        return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Implementation of `CompileReflector` which resolves references to @angular/core\n     * symbols at runtime, according to a consumer-provided mapping.\n     *\n     * Only supports `resolveExternalReference`, all other methods throw.\n     */\n    var R3JitReflector = /** @class */ (function () {\n        function R3JitReflector(context) {\n            this.context = context;\n        }\n        R3JitReflector.prototype.resolveExternalReference = function (ref) {\n            // This reflector only handles @angular/core imports.\n            if (ref.moduleName !== '@angular/core') {\n                throw new Error(\"Cannot resolve external reference to \" + ref.moduleName + \", only references to @angular/core are supported.\");\n            }\n            if (!this.context.hasOwnProperty(ref.name)) {\n                throw new Error(\"No value provided for @angular/core symbol '\" + ref.name + \"'.\");\n            }\n            return this.context[ref.name];\n        };\n        R3JitReflector.prototype.parameters = function (typeOrFunc) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.annotations = function (typeOrFunc) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.shallowAnnotations = function (typeOrFunc) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.tryAnnotations = function (typeOrFunc) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.propMetadata = function (typeOrFunc) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.guards = function (typeOrFunc) {\n            throw new Error('Not implemented.');\n        };\n        R3JitReflector.prototype.componentModuleUrl = function (type, cmpMetadata) {\n            throw new Error('Not implemented.');\n        };\n        return R3JitReflector;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.\n     */\n    function compileNgModule(meta) {\n        var internalType = meta.internalType, bootstrap = meta.bootstrap, declarations = meta.declarations, imports = meta.imports, exports = meta.exports, schemas = meta.schemas, containsForwardDecls = meta.containsForwardDecls, emitInline = meta.emitInline, id = meta.id;\n        var statements = [];\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('type', internalType);\n        if (bootstrap.length > 0) {\n            definitionMap.set('bootstrap', refsToArray(bootstrap, containsForwardDecls));\n        }\n        // If requested to emit scope information inline, pass the `declarations`, `imports` and `exports`\n        // to the `ɵɵdefineNgModule()` call. The JIT compilation uses this.\n        if (emitInline) {\n            if (declarations.length > 0) {\n                definitionMap.set('declarations', refsToArray(declarations, containsForwardDecls));\n            }\n            if (imports.length > 0) {\n                definitionMap.set('imports', refsToArray(imports, containsForwardDecls));\n            }\n            if (exports.length > 0) {\n                definitionMap.set('exports', refsToArray(exports, containsForwardDecls));\n            }\n        }\n        // If not emitting inline, the scope information is not passed into `ɵɵdefineNgModule` as it would\n        // prevent tree-shaking of the declarations, imports and exports references.\n        else {\n            var setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);\n            if (setNgModuleScopeCall !== null) {\n                statements.push(setNgModuleScopeCall);\n            }\n        }\n        if (schemas !== null && schemas.length > 0) {\n            definitionMap.set('schemas', literalArr(schemas.map(function (ref) { return ref.value; })));\n        }\n        if (id !== null) {\n            definitionMap.set('id', id);\n        }\n        var expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);\n        var type = createNgModuleType(meta);\n        return { expression: expression, type: type, statements: statements };\n    }\n    /**\n     * This function is used in JIT mode to generate the call to `ɵɵdefineNgModule()` from a call to\n     * `ɵɵngDeclareNgModule()`.\n     */\n    function compileNgModuleDeclarationExpression(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('type', new WrappedNodeExpr(meta.type));\n        if (meta.bootstrap !== undefined) {\n            definitionMap.set('bootstrap', new WrappedNodeExpr(meta.bootstrap));\n        }\n        if (meta.declarations !== undefined) {\n            definitionMap.set('declarations', new WrappedNodeExpr(meta.declarations));\n        }\n        if (meta.imports !== undefined) {\n            definitionMap.set('imports', new WrappedNodeExpr(meta.imports));\n        }\n        if (meta.exports !== undefined) {\n            definitionMap.set('exports', new WrappedNodeExpr(meta.exports));\n        }\n        if (meta.schemas !== undefined) {\n            definitionMap.set('schemas', new WrappedNodeExpr(meta.schemas));\n        }\n        if (meta.id !== undefined) {\n            definitionMap.set('id', new WrappedNodeExpr(meta.id));\n        }\n        return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]);\n    }\n    function createNgModuleType(_a) {\n        var moduleType = _a.type, declarations = _a.declarations, imports = _a.imports, exports = _a.exports;\n        return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [\n            new ExpressionType(moduleType.type), tupleTypeOf(declarations), tupleTypeOf(imports),\n            tupleTypeOf(exports)\n        ]));\n    }\n    /**\n     * Generates a function call to `ɵɵsetNgModuleScope` with all necessary information so that the\n     * transitive module scope can be computed during runtime in JIT mode. This call is marked pure\n     * such that the references to declarations, imports and exports may be elided causing these\n     * symbols to become tree-shakeable.\n     */\n    function generateSetNgModuleScopeCall(meta) {\n        var moduleType = meta.adjacentType, declarations = meta.declarations, imports = meta.imports, exports = meta.exports, containsForwardDecls = meta.containsForwardDecls;\n        var scopeMap = new DefinitionMap();\n        if (declarations.length > 0) {\n            scopeMap.set('declarations', refsToArray(declarations, containsForwardDecls));\n        }\n        if (imports.length > 0) {\n            scopeMap.set('imports', refsToArray(imports, containsForwardDecls));\n        }\n        if (exports.length > 0) {\n            scopeMap.set('exports', refsToArray(exports, containsForwardDecls));\n        }\n        if (Object.keys(scopeMap.values).length === 0) {\n            return null;\n        }\n        // setNgModuleScope(...)\n        var fnCall = new InvokeFunctionExpr(\n        /* fn */ importExpr(Identifiers.setNgModuleScope), \n        /* args */ [moduleType, scopeMap.toLiteralMap()]);\n        // (ngJitMode guard) && setNgModuleScope(...)\n        var guardedCall = jitOnlyGuardedExpression(fnCall);\n        // function() { (ngJitMode guard) && setNgModuleScope(...); }\n        var iife = new FunctionExpr(\n        /* params */ [], \n        /* statements */ [guardedCall.toStmt()]);\n        // (function() { (ngJitMode guard) && setNgModuleScope(...); })()\n        var iifeCall = new InvokeFunctionExpr(\n        /* fn */ iife, \n        /* args */ []);\n        return iifeCall.toStmt();\n    }\n    function tupleTypeOf(exp) {\n        var types = exp.map(function (ref) { return typeofExpr(ref.type); });\n        return exp.length > 0 ? expressionType(literalArr(types)) : NONE_TYPE;\n    }\n\n    /**\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://angular.io/license\n     */\n    function compilePipeFromMetadata(metadata) {\n        var definitionMapValues = [];\n        // e.g. `name: 'myPipe'`\n        definitionMapValues.push({ key: 'name', value: literal(metadata.pipeName), quoted: false });\n        // e.g. `type: MyPipe`\n        definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });\n        // e.g. `pure: true`\n        definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });\n        var expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], undefined, true);\n        var type = createPipeType(metadata);\n        return { expression: expression, type: type, statements: [] };\n    }\n    function createPipeType(metadata) {\n        return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [\n            typeWithParameters(metadata.type.type, metadata.typeArgumentCount),\n            new ExpressionType(new LiteralExpr(metadata.pipeName)),\n        ]));\n    }\n\n    /**\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://angular.io/license\n     */\n    var ParserError = /** @class */ (function () {\n        function ParserError(message, input, errLocation, ctxLocation) {\n            this.input = input;\n            this.errLocation = errLocation;\n            this.ctxLocation = ctxLocation;\n            this.message = \"Parser Error: \" + message + \" \" + errLocation + \" [\" + input + \"] in \" + ctxLocation;\n        }\n        return ParserError;\n    }());\n    var ParseSpan = /** @class */ (function () {\n        function ParseSpan(start, end) {\n            this.start = start;\n            this.end = end;\n        }\n        ParseSpan.prototype.toAbsolute = function (absoluteOffset) {\n            return new AbsoluteSourceSpan(absoluteOffset + this.start, absoluteOffset + this.end);\n        };\n        return ParseSpan;\n    }());\n    var AST = /** @class */ (function () {\n        function AST(span, \n        /**\n         * Absolute location of the expression AST in a source code file.\n         */\n        sourceSpan) {\n            this.span = span;\n            this.sourceSpan = sourceSpan;\n        }\n        AST.prototype.toString = function () {\n            return 'AST';\n        };\n        return AST;\n    }());\n    var ASTWithName = /** @class */ (function (_super) {\n        __extends(ASTWithName, _super);\n        function ASTWithName(span, sourceSpan, nameSpan) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.nameSpan = nameSpan;\n            return _this;\n        }\n        return ASTWithName;\n    }(AST));\n    /**\n     * Represents a quoted expression of the form:\n     *\n     * quote = prefix `:` uninterpretedExpression\n     * prefix = identifier\n     * uninterpretedExpression = arbitrary string\n     *\n     * A quoted expression is meant to be pre-processed by an AST transformer that\n     * converts it into another AST that no longer contains quoted expressions.\n     * It is meant to allow third-party developers to extend Angular template\n     * expression language. The `uninterpretedExpression` part of the quote is\n     * therefore not interpreted by the Angular's own expression parser.\n     */\n    var Quote = /** @class */ (function (_super) {\n        __extends(Quote, _super);\n        function Quote(span, sourceSpan, prefix, uninterpretedExpression, location) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.prefix = prefix;\n            _this.uninterpretedExpression = uninterpretedExpression;\n            _this.location = location;\n            return _this;\n        }\n        Quote.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitQuote(this, context);\n        };\n        Quote.prototype.toString = function () {\n            return 'Quote';\n        };\n        return Quote;\n    }(AST));\n    var EmptyExpr = /** @class */ (function (_super) {\n        __extends(EmptyExpr, _super);\n        function EmptyExpr() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        EmptyExpr.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            // do nothing\n        };\n        return EmptyExpr;\n    }(AST));\n    var ImplicitReceiver = /** @class */ (function (_super) {\n        __extends(ImplicitReceiver, _super);\n        function ImplicitReceiver() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        ImplicitReceiver.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitImplicitReceiver(this, context);\n        };\n        return ImplicitReceiver;\n    }(AST));\n    /**\n     * Receiver when something is accessed through `this` (e.g. `this.foo`). Note that this class\n     * inherits from `ImplicitReceiver`, because accessing something through `this` is treated the\n     * same as accessing it implicitly inside of an Angular template (e.g. `[attr.title]=\"this.title\"`\n     * is the same as `[attr.title]=\"title\"`.). Inheriting allows for the `this` accesses to be treated\n     * the same as implicit ones, except for a couple of exceptions like `$event` and `$any`.\n     * TODO: we should find a way for this class not to extend from `ImplicitReceiver` in the future.\n     */\n    var ThisReceiver = /** @class */ (function (_super) {\n        __extends(ThisReceiver, _super);\n        function ThisReceiver() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        ThisReceiver.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            var _a;\n            return (_a = visitor.visitThisReceiver) === null || _a === void 0 ? void 0 : _a.call(visitor, this, context);\n        };\n        return ThisReceiver;\n    }(ImplicitReceiver));\n    /**\n     * Multiple expressions separated by a semicolon.\n     */\n    var Chain = /** @class */ (function (_super) {\n        __extends(Chain, _super);\n        function Chain(span, sourceSpan, expressions) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.expressions = expressions;\n            return _this;\n        }\n        Chain.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitChain(this, context);\n        };\n        return Chain;\n    }(AST));\n    var Conditional = /** @class */ (function (_super) {\n        __extends(Conditional, _super);\n        function Conditional(span, sourceSpan, condition, trueExp, falseExp) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.condition = condition;\n            _this.trueExp = trueExp;\n            _this.falseExp = falseExp;\n            return _this;\n        }\n        Conditional.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitConditional(this, context);\n        };\n        return Conditional;\n    }(AST));\n    var PropertyRead = /** @class */ (function (_super) {\n        __extends(PropertyRead, _super);\n        function PropertyRead(span, sourceSpan, nameSpan, receiver, name) {\n            var _this = _super.call(this, span, sourceSpan, nameSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            return _this;\n        }\n        PropertyRead.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitPropertyRead(this, context);\n        };\n        return PropertyRead;\n    }(ASTWithName));\n    var PropertyWrite = /** @class */ (function (_super) {\n        __extends(PropertyWrite, _super);\n        function PropertyWrite(span, sourceSpan, nameSpan, receiver, name, value) {\n            var _this = _super.call(this, span, sourceSpan, nameSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            _this.value = value;\n            return _this;\n        }\n        PropertyWrite.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitPropertyWrite(this, context);\n        };\n        return PropertyWrite;\n    }(ASTWithName));\n    var SafePropertyRead = /** @class */ (function (_super) {\n        __extends(SafePropertyRead, _super);\n        function SafePropertyRead(span, sourceSpan, nameSpan, receiver, name) {\n            var _this = _super.call(this, span, sourceSpan, nameSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            return _this;\n        }\n        SafePropertyRead.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitSafePropertyRead(this, context);\n        };\n        return SafePropertyRead;\n    }(ASTWithName));\n    var KeyedRead = /** @class */ (function (_super) {\n        __extends(KeyedRead, _super);\n        function KeyedRead(span, sourceSpan, receiver, key) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.key = key;\n            return _this;\n        }\n        KeyedRead.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitKeyedRead(this, context);\n        };\n        return KeyedRead;\n    }(AST));\n    var SafeKeyedRead = /** @class */ (function (_super) {\n        __extends(SafeKeyedRead, _super);\n        function SafeKeyedRead(span, sourceSpan, receiver, key) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.key = key;\n            return _this;\n        }\n        SafeKeyedRead.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitSafeKeyedRead(this, context);\n        };\n        return SafeKeyedRead;\n    }(AST));\n    var KeyedWrite = /** @class */ (function (_super) {\n        __extends(KeyedWrite, _super);\n        function KeyedWrite(span, sourceSpan, receiver, key, value) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.receiver = receiver;\n            _this.key = key;\n            _this.value = value;\n            return _this;\n        }\n        KeyedWrite.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitKeyedWrite(this, context);\n        };\n        return KeyedWrite;\n    }(AST));\n    var BindingPipe = /** @class */ (function (_super) {\n        __extends(BindingPipe, _super);\n        function BindingPipe(span, sourceSpan, exp, name, args, nameSpan) {\n            var _this = _super.call(this, span, sourceSpan, nameSpan) || this;\n            _this.exp = exp;\n            _this.name = name;\n            _this.args = args;\n            return _this;\n        }\n        BindingPipe.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitPipe(this, context);\n        };\n        return BindingPipe;\n    }(ASTWithName));\n    var LiteralPrimitive = /** @class */ (function (_super) {\n        __extends(LiteralPrimitive, _super);\n        function LiteralPrimitive(span, sourceSpan, value) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.value = value;\n            return _this;\n        }\n        LiteralPrimitive.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitLiteralPrimitive(this, context);\n        };\n        return LiteralPrimitive;\n    }(AST));\n    var LiteralArray = /** @class */ (function (_super) {\n        __extends(LiteralArray, _super);\n        function LiteralArray(span, sourceSpan, expressions) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.expressions = expressions;\n            return _this;\n        }\n        LiteralArray.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitLiteralArray(this, context);\n        };\n        return LiteralArray;\n    }(AST));\n    var LiteralMap = /** @class */ (function (_super) {\n        __extends(LiteralMap, _super);\n        function LiteralMap(span, sourceSpan, keys, values) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.keys = keys;\n            _this.values = values;\n            return _this;\n        }\n        LiteralMap.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitLiteralMap(this, context);\n        };\n        return LiteralMap;\n    }(AST));\n    var Interpolation = /** @class */ (function (_super) {\n        __extends(Interpolation, _super);\n        function Interpolation(span, sourceSpan, strings, expressions) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.strings = strings;\n            _this.expressions = expressions;\n            return _this;\n        }\n        Interpolation.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitInterpolation(this, context);\n        };\n        return Interpolation;\n    }(AST));\n    var Binary = /** @class */ (function (_super) {\n        __extends(Binary, _super);\n        function Binary(span, sourceSpan, operation, left, right) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.operation = operation;\n            _this.left = left;\n            _this.right = right;\n            return _this;\n        }\n        Binary.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitBinary(this, context);\n        };\n        return Binary;\n    }(AST));\n    /**\n     * For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST\n     * node that was originally used. This inheritance relation can be deleted in some future major,\n     * after consumers have been given a chance to fully support Unary.\n     */\n    var Unary = /** @class */ (function (_super) {\n        __extends(Unary, _super);\n        /**\n         * During the deprecation period this constructor is private, to avoid consumers from creating\n         * a `Unary` with the fallback properties for `Binary`.\n         */\n        function Unary(span, sourceSpan, operator, expr, binaryOp, binaryLeft, binaryRight) {\n            var _this = _super.call(this, span, sourceSpan, binaryOp, binaryLeft, binaryRight) || this;\n            _this.operator = operator;\n            _this.expr = expr;\n            return _this;\n        }\n        /**\n         * Creates a unary minus expression \"-x\", represented as `Binary` using \"0 - x\".\n         */\n        Unary.createMinus = function (span, sourceSpan, expr) {\n            return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr);\n        };\n        /**\n         * Creates a unary plus expression \"+x\", represented as `Binary` using \"x - 0\".\n         */\n        Unary.createPlus = function (span, sourceSpan, expr) {\n            return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));\n        };\n        Unary.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            if (visitor.visitUnary !== undefined) {\n                return visitor.visitUnary(this, context);\n            }\n            return visitor.visitBinary(this, context);\n        };\n        return Unary;\n    }(Binary));\n    var PrefixNot = /** @class */ (function (_super) {\n        __extends(PrefixNot, _super);\n        function PrefixNot(span, sourceSpan, expression) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.expression = expression;\n            return _this;\n        }\n        PrefixNot.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitPrefixNot(this, context);\n        };\n        return PrefixNot;\n    }(AST));\n    var NonNullAssert = /** @class */ (function (_super) {\n        __extends(NonNullAssert, _super);\n        function NonNullAssert(span, sourceSpan, expression) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.expression = expression;\n            return _this;\n        }\n        NonNullAssert.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitNonNullAssert(this, context);\n        };\n        return NonNullAssert;\n    }(AST));\n    var MethodCall = /** @class */ (function (_super) {\n        __extends(MethodCall, _super);\n        function MethodCall(span, sourceSpan, nameSpan, receiver, name, args, argumentSpan) {\n            var _this = _super.call(this, span, sourceSpan, nameSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            _this.args = args;\n            _this.argumentSpan = argumentSpan;\n            return _this;\n        }\n        MethodCall.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitMethodCall(this, context);\n        };\n        return MethodCall;\n    }(ASTWithName));\n    var SafeMethodCall = /** @class */ (function (_super) {\n        __extends(SafeMethodCall, _super);\n        function SafeMethodCall(span, sourceSpan, nameSpan, receiver, name, args, argumentSpan) {\n            var _this = _super.call(this, span, sourceSpan, nameSpan) || this;\n            _this.receiver = receiver;\n            _this.name = name;\n            _this.args = args;\n            _this.argumentSpan = argumentSpan;\n            return _this;\n        }\n        SafeMethodCall.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitSafeMethodCall(this, context);\n        };\n        return SafeMethodCall;\n    }(ASTWithName));\n    var FunctionCall = /** @class */ (function (_super) {\n        __extends(FunctionCall, _super);\n        function FunctionCall(span, sourceSpan, target, args) {\n            var _this = _super.call(this, span, sourceSpan) || this;\n            _this.target = target;\n            _this.args = args;\n            return _this;\n        }\n        FunctionCall.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            return visitor.visitFunctionCall(this, context);\n        };\n        return FunctionCall;\n    }(AST));\n    /**\n     * Records the absolute position of a text span in a source file, where `start` and `end` are the\n     * starting and ending byte offsets, respectively, of the text span in a source file.\n     */\n    var AbsoluteSourceSpan = /** @class */ (function () {\n        function AbsoluteSourceSpan(start, end) {\n            this.start = start;\n            this.end = end;\n        }\n        return AbsoluteSourceSpan;\n    }());\n    var ASTWithSource = /** @class */ (function (_super) {\n        __extends(ASTWithSource, _super);\n        function ASTWithSource(ast, source, location, absoluteOffset, errors) {\n            var _this = _super.call(this, new ParseSpan(0, source === null ? 0 : source.length), new AbsoluteSourceSpan(absoluteOffset, source === null ? absoluteOffset : absoluteOffset + source.length)) || this;\n            _this.ast = ast;\n            _this.source = source;\n            _this.location = location;\n            _this.errors = errors;\n            return _this;\n        }\n        ASTWithSource.prototype.visit = function (visitor, context) {\n            if (context === void 0) { context = null; }\n            if (visitor.visitASTWithSource) {\n                return visitor.visitASTWithSource(this, context);\n            }\n            return this.ast.visit(visitor, context);\n        };\n        ASTWithSource.prototype.toString = function () {\n            return this.source + \" in \" + this.location;\n        };\n        return ASTWithSource;\n    }(AST));\n    var VariableBinding = /** @class */ (function () {\n        /**\n         * @param sourceSpan entire span of the binding.\n         * @param key name of the LHS along with its span.\n         * @param value optional value for the RHS along with its span.\n         */\n        function VariableBinding(sourceSpan, key, value) {\n            this.sourceSpan = sourceSpan;\n            this.key = key;\n            this.value = value;\n        }\n        return VariableBinding;\n    }());\n    var ExpressionBinding = /** @class */ (function () {\n        /**\n         * @param sourceSpan entire span of the binding.\n         * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its\n         * span. Note that the length of the span may not be the same as\n         * `key.source.length`. For example,\n         * 1. key.source = ngFor, key.span is for \"ngFor\"\n         * 2. key.source = ngForOf, key.span is for \"of\"\n         * 3. key.source = ngForTrackBy, key.span is for \"trackBy\"\n         * @param value optional expression for the RHS.\n         */\n        function ExpressionBinding(sourceSpan, key, value) {\n            this.sourceSpan = sourceSpan;\n            this.key = key;\n            this.value = value;\n        }\n        return ExpressionBinding;\n    }());\n    var RecursiveAstVisitor$1 = /** @class */ (function () {\n        function RecursiveAstVisitor() {\n        }\n        RecursiveAstVisitor.prototype.visit = function (ast, context) {\n            // The default implementation just visits every node.\n            // Classes that extend RecursiveAstVisitor should override this function\n            // to selectively visit the specified node.\n            ast.visit(this, context);\n        };\n        RecursiveAstVisitor.prototype.visitUnary = function (ast, context) {\n            this.visit(ast.expr, context);\n        };\n        RecursiveAstVisitor.prototype.visitBinary = function (ast, context) {\n            this.visit(ast.left, context);\n            this.visit(ast.right, context);\n        };\n        RecursiveAstVisitor.prototype.visitChain = function (ast, context) {\n            this.visitAll(ast.expressions, context);\n        };\n        RecursiveAstVisitor.prototype.visitConditional = function (ast, context) {\n            this.visit(ast.condition, context);\n            this.visit(ast.trueExp, context);\n            this.visit(ast.falseExp, context);\n        };\n        RecursiveAstVisitor.prototype.visitPipe = function (ast, context) {\n            this.visit(ast.exp, context);\n            this.visitAll(ast.args, context);\n        };\n        RecursiveAstVisitor.prototype.visitFunctionCall = function (ast, context) {\n            if (ast.target) {\n                this.visit(ast.target, context);\n            }\n            this.visitAll(ast.args, context);\n        };\n        RecursiveAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { };\n        RecursiveAstVisitor.prototype.visitThisReceiver = function (ast, context) { };\n        RecursiveAstVisitor.prototype.visitInterpolation = function (ast, context) {\n            this.visitAll(ast.expressions, context);\n        };\n        RecursiveAstVisitor.prototype.visitKeyedRead = function (ast, context) {\n            this.visit(ast.receiver, context);\n            this.visit(ast.key, context);\n        };\n        RecursiveAstVisitor.prototype.visitKeyedWrite = function (ast, context) {\n            this.visit(ast.receiver, context);\n            this.visit(ast.key, context);\n            this.visit(ast.value, context);\n        };\n        RecursiveAstVisitor.prototype.visitLiteralArray = function (ast, context) {\n            this.visitAll(ast.expressions, context);\n        };\n        RecursiveAstVisitor.prototype.visitLiteralMap = function (ast, context) {\n            this.visitAll(ast.values, context);\n        };\n        RecursiveAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { };\n        RecursiveAstVisitor.prototype.visitMethodCall = function (ast, context) {\n            this.visit(ast.receiver, context);\n            this.visitAll(ast.args, context);\n        };\n        RecursiveAstVisitor.prototype.visitPrefixNot = function (ast, context) {\n            this.visit(ast.expression, context);\n        };\n        RecursiveAstVisitor.prototype.visitNonNullAssert = function (ast, context) {\n            this.visit(ast.expression, context);\n        };\n        RecursiveAstVisitor.prototype.visitPropertyRead = function (ast, context) {\n            this.visit(ast.receiver, context);\n        };\n        RecursiveAstVisitor.prototype.visitPropertyWrite = function (ast, context) {\n            this.visit(ast.receiver, context);\n            this.visit(ast.value, context);\n        };\n        RecursiveAstVisitor.prototype.visitSafePropertyRead = function (ast, context) {\n            this.visit(ast.receiver, context);\n        };\n        RecursiveAstVisitor.prototype.visitSafeMethodCall = function (ast, context) {\n            this.visit(ast.receiver, context);\n            this.visitAll(ast.args, context);\n        };\n        RecursiveAstVisitor.prototype.visitSafeKeyedRead = function (ast, context) {\n            this.visit(ast.receiver, context);\n            this.visit(ast.key, context);\n        };\n        RecursiveAstVisitor.prototype.visitQuote = function (ast, context) { };\n        // This is not part of the AstVisitor interface, just a helper method\n        RecursiveAstVisitor.prototype.visitAll = function (asts, context) {\n            var e_1, _b;\n            try {\n                for (var asts_1 = __values(asts), asts_1_1 = asts_1.next(); !asts_1_1.done; asts_1_1 = asts_1.next()) {\n                    var ast = asts_1_1.value;\n                    this.visit(ast, context);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (asts_1_1 && !asts_1_1.done && (_b = asts_1.return)) _b.call(asts_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        };\n        return RecursiveAstVisitor;\n    }());\n    var AstTransformer$1 = /** @class */ (function () {\n        function AstTransformer() {\n        }\n        AstTransformer.prototype.visitImplicitReceiver = function (ast, context) {\n            return ast;\n        };\n        AstTransformer.prototype.visitThisReceiver = function (ast, context) {\n            return ast;\n        };\n        AstTransformer.prototype.visitInterpolation = function (ast, context) {\n            return new Interpolation(ast.span, ast.sourceSpan, ast.strings, this.visitAll(ast.expressions));\n        };\n        AstTransformer.prototype.visitLiteralPrimitive = function (ast, context) {\n            return new LiteralPrimitive(ast.span, ast.sourceSpan, ast.value);\n        };\n        AstTransformer.prototype.visitPropertyRead = function (ast, context) {\n            return new PropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name);\n        };\n        AstTransformer.prototype.visitPropertyWrite = function (ast, context) {\n            return new PropertyWrite(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name, ast.value.visit(this));\n        };\n        AstTransformer.prototype.visitSafePropertyRead = function (ast, context) {\n            return new SafePropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name);\n        };\n        AstTransformer.prototype.visitMethodCall = function (ast, context) {\n            return new MethodCall(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name, this.visitAll(ast.args), ast.argumentSpan);\n        };\n        AstTransformer.prototype.visitSafeMethodCall = function (ast, context) {\n            return new SafeMethodCall(ast.span, ast.sourceSpan, ast.nameSpan, ast.receiver.visit(this), ast.name, this.visitAll(ast.args), ast.argumentSpan);\n        };\n        AstTransformer.prototype.visitFunctionCall = function (ast, context) {\n            return new FunctionCall(ast.span, ast.sourceSpan, ast.target.visit(this), this.visitAll(ast.args));\n        };\n        AstTransformer.prototype.visitLiteralArray = function (ast, context) {\n            return new LiteralArray(ast.span, ast.sourceSpan, this.visitAll(ast.expressions));\n        };\n        AstTransformer.prototype.visitLiteralMap = function (ast, context) {\n            return new LiteralMap(ast.span, ast.sourceSpan, ast.keys, this.visitAll(ast.values));\n        };\n        AstTransformer.prototype.visitUnary = function (ast, context) {\n            switch (ast.operator) {\n                case '+':\n                    return Unary.createPlus(ast.span, ast.sourceSpan, ast.expr.visit(this));\n                case '-':\n                    return Unary.createMinus(ast.span, ast.sourceSpan, ast.expr.visit(this));\n                default:\n                    throw new Error(\"Unknown unary operator \" + ast.operator);\n            }\n        };\n        AstTransformer.prototype.visitBinary = function (ast, context) {\n            return new Binary(ast.span, ast.sourceSpan, ast.operation, ast.left.visit(this), ast.right.visit(this));\n        };\n        AstTransformer.prototype.visitPrefixNot = function (ast, context) {\n            return new PrefixNot(ast.span, ast.sourceSpan, ast.expression.visit(this));\n        };\n        AstTransformer.prototype.visitNonNullAssert = function (ast, context) {\n            return new NonNullAssert(ast.span, ast.sourceSpan, ast.expression.visit(this));\n        };\n        AstTransformer.prototype.visitConditional = function (ast, context) {\n            return new Conditional(ast.span, ast.sourceSpan, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));\n        };\n        AstTransformer.prototype.visitPipe = function (ast, context) {\n            return new BindingPipe(ast.span, ast.sourceSpan, ast.exp.visit(this), ast.name, this.visitAll(ast.args), ast.nameSpan);\n        };\n        AstTransformer.prototype.visitKeyedRead = function (ast, context) {\n            return new KeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));\n        };\n        AstTransformer.prototype.visitKeyedWrite = function (ast, context) {\n            return new KeyedWrite(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this), ast.value.visit(this));\n        };\n        AstTransformer.prototype.visitAll = function (asts) {\n            var res = [];\n            for (var i = 0; i < asts.length; ++i) {\n                res[i] = asts[i].visit(this);\n            }\n            return res;\n        };\n        AstTransformer.prototype.visitChain = function (ast, context) {\n            return new Chain(ast.span, ast.sourceSpan, this.visitAll(ast.expressions));\n        };\n        AstTransformer.prototype.visitQuote = function (ast, context) {\n            return new Quote(ast.span, ast.sourceSpan, ast.prefix, ast.uninterpretedExpression, ast.location);\n        };\n        AstTransformer.prototype.visitSafeKeyedRead = function (ast, context) {\n            return new SafeKeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));\n        };\n        return AstTransformer;\n    }());\n    // A transformer that only creates new nodes if the transformer makes a change or\n    // a change is made a child node.\n    var AstMemoryEfficientTransformer = /** @class */ (function () {\n        function AstMemoryEfficientTransformer() {\n        }\n        AstMemoryEfficientTransformer.prototype.visitImplicitReceiver = function (ast, context) {\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitThisReceiver = function (ast, context) {\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitInterpolation = function (ast, context) {\n            var expressions = this.visitAll(ast.expressions);\n            if (expressions !== ast.expressions)\n                return new Interpolation(ast.span, ast.sourceSpan, ast.strings, expressions);\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitLiteralPrimitive = function (ast, context) {\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitPropertyRead = function (ast, context) {\n            var receiver = ast.receiver.visit(this);\n            if (receiver !== ast.receiver) {\n                return new PropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitPropertyWrite = function (ast, context) {\n            var receiver = ast.receiver.visit(this);\n            var value = ast.value.visit(this);\n            if (receiver !== ast.receiver || value !== ast.value) {\n                return new PropertyWrite(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name, value);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitSafePropertyRead = function (ast, context) {\n            var receiver = ast.receiver.visit(this);\n            if (receiver !== ast.receiver) {\n                return new SafePropertyRead(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitMethodCall = function (ast, context) {\n            var receiver = ast.receiver.visit(this);\n            var args = this.visitAll(ast.args);\n            if (receiver !== ast.receiver || args !== ast.args) {\n                return new MethodCall(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name, args, ast.argumentSpan);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitSafeMethodCall = function (ast, context) {\n            var receiver = ast.receiver.visit(this);\n            var args = this.visitAll(ast.args);\n            if (receiver !== ast.receiver || args !== ast.args) {\n                return new SafeMethodCall(ast.span, ast.sourceSpan, ast.nameSpan, receiver, ast.name, args, ast.argumentSpan);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitFunctionCall = function (ast, context) {\n            var target = ast.target && ast.target.visit(this);\n            var args = this.visitAll(ast.args);\n            if (target !== ast.target || args !== ast.args) {\n                return new FunctionCall(ast.span, ast.sourceSpan, target, args);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitLiteralArray = function (ast, context) {\n            var expressions = this.visitAll(ast.expressions);\n            if (expressions !== ast.expressions) {\n                return new LiteralArray(ast.span, ast.sourceSpan, expressions);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitLiteralMap = function (ast, context) {\n            var values = this.visitAll(ast.values);\n            if (values !== ast.values) {\n                return new LiteralMap(ast.span, ast.sourceSpan, ast.keys, values);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitUnary = function (ast, context) {\n            var expr = ast.expr.visit(this);\n            if (expr !== ast.expr) {\n                switch (ast.operator) {\n                    case '+':\n                        return Unary.createPlus(ast.span, ast.sourceSpan, expr);\n                    case '-':\n                        return Unary.createMinus(ast.span, ast.sourceSpan, expr);\n                    default:\n                        throw new Error(\"Unknown unary operator \" + ast.operator);\n                }\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitBinary = function (ast, context) {\n            var left = ast.left.visit(this);\n            var right = ast.right.visit(this);\n            if (left !== ast.left || right !== ast.right) {\n                return new Binary(ast.span, ast.sourceSpan, ast.operation, left, right);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitPrefixNot = function (ast, context) {\n            var expression = ast.expression.visit(this);\n            if (expression !== ast.expression) {\n                return new PrefixNot(ast.span, ast.sourceSpan, expression);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitNonNullAssert = function (ast, context) {\n            var expression = ast.expression.visit(this);\n            if (expression !== ast.expression) {\n                return new NonNullAssert(ast.span, ast.sourceSpan, expression);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitConditional = function (ast, context) {\n            var condition = ast.condition.visit(this);\n            var trueExp = ast.trueExp.visit(this);\n            var falseExp = ast.falseExp.visit(this);\n            if (condition !== ast.condition || trueExp !== ast.trueExp || falseExp !== ast.falseExp) {\n                return new Conditional(ast.span, ast.sourceSpan, condition, trueExp, falseExp);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitPipe = function (ast, context) {\n            var exp = ast.exp.visit(this);\n            var args = this.visitAll(ast.args);\n            if (exp !== ast.exp || args !== ast.args) {\n                return new BindingPipe(ast.span, ast.sourceSpan, exp, ast.name, args, ast.nameSpan);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitKeyedRead = function (ast, context) {\n            var obj = ast.receiver.visit(this);\n            var key = ast.key.visit(this);\n            if (obj !== ast.receiver || key !== ast.key) {\n                return new KeyedRead(ast.span, ast.sourceSpan, obj, key);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitKeyedWrite = function (ast, context) {\n            var obj = ast.receiver.visit(this);\n            var key = ast.key.visit(this);\n            var value = ast.value.visit(this);\n            if (obj !== ast.receiver || key !== ast.key || value !== ast.value) {\n                return new KeyedWrite(ast.span, ast.sourceSpan, obj, key, value);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitAll = function (asts) {\n            var res = [];\n            var modified = false;\n            for (var i = 0; i < asts.length; ++i) {\n                var original = asts[i];\n                var value = original.visit(this);\n                res[i] = value;\n                modified = modified || value !== original;\n            }\n            return modified ? res : asts;\n        };\n        AstMemoryEfficientTransformer.prototype.visitChain = function (ast, context) {\n            var expressions = this.visitAll(ast.expressions);\n            if (expressions !== ast.expressions) {\n                return new Chain(ast.span, ast.sourceSpan, expressions);\n            }\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitQuote = function (ast, context) {\n            return ast;\n        };\n        AstMemoryEfficientTransformer.prototype.visitSafeKeyedRead = function (ast, context) {\n            var obj = ast.receiver.visit(this);\n            var key = ast.key.visit(this);\n            if (obj !== ast.receiver || key !== ast.key) {\n                return new SafeKeyedRead(ast.span, ast.sourceSpan, obj, key);\n            }\n            return ast;\n        };\n        return AstMemoryEfficientTransformer;\n    }());\n    // Bindings\n    var ParsedProperty = /** @class */ (function () {\n        function ParsedProperty(name, expression, type, \n        // TODO(FW-2095): `keySpan` should really be required but allows `undefined` so VE does\n        // not need to be updated. Make `keySpan` required when VE is removed.\n        sourceSpan, keySpan, valueSpan) {\n            this.name = name;\n            this.expression = expression;\n            this.type = type;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n            this.isLiteral = this.type === exports.ParsedPropertyType.LITERAL_ATTR;\n            this.isAnimation = this.type === exports.ParsedPropertyType.ANIMATION;\n        }\n        return ParsedProperty;\n    }());\n    (function (ParsedPropertyType) {\n        ParsedPropertyType[ParsedPropertyType[\"DEFAULT\"] = 0] = \"DEFAULT\";\n        ParsedPropertyType[ParsedPropertyType[\"LITERAL_ATTR\"] = 1] = \"LITERAL_ATTR\";\n        ParsedPropertyType[ParsedPropertyType[\"ANIMATION\"] = 2] = \"ANIMATION\";\n    })(exports.ParsedPropertyType || (exports.ParsedPropertyType = {}));\n    var ParsedEvent = /** @class */ (function () {\n        // Regular events have a target\n        // Animation events have a phase\n        function ParsedEvent(name, targetOrPhase, type, handler, sourceSpan, \n        // TODO(FW-2095): keySpan should be required but was made optional to avoid changing VE\n        handlerSpan, keySpan) {\n            this.name = name;\n            this.targetOrPhase = targetOrPhase;\n            this.type = type;\n            this.handler = handler;\n            this.sourceSpan = sourceSpan;\n            this.handlerSpan = handlerSpan;\n            this.keySpan = keySpan;\n        }\n        return ParsedEvent;\n    }());\n    /**\n     * ParsedVariable represents a variable declaration in a microsyntax expression.\n     */\n    var ParsedVariable = /** @class */ (function () {\n        function ParsedVariable(name, value, sourceSpan, keySpan, valueSpan) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n        }\n        return ParsedVariable;\n    }());\n    var BoundElementProperty = /** @class */ (function () {\n        function BoundElementProperty(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan) {\n            this.name = name;\n            this.type = type;\n            this.securityContext = securityContext;\n            this.value = value;\n            this.unit = unit;\n            this.sourceSpan = sourceSpan;\n            this.keySpan = keySpan;\n            this.valueSpan = valueSpan;\n        }\n        return BoundElementProperty;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var CORE$1 = '@angular/core';\n    var Identifiers$1 = /** @class */ (function () {\n        function Identifiers() {\n        }\n        return Identifiers;\n    }());\n    Identifiers$1.ANALYZE_FOR_ENTRY_COMPONENTS = {\n        name: 'ANALYZE_FOR_ENTRY_COMPONENTS',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.ElementRef = { name: 'ElementRef', moduleName: CORE$1 };\n    Identifiers$1.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE$1 };\n    Identifiers$1.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE$1 };\n    Identifiers$1.ChangeDetectorRef = {\n        name: 'ChangeDetectorRef',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.QueryList = { name: 'QueryList', moduleName: CORE$1 };\n    Identifiers$1.TemplateRef = { name: 'TemplateRef', moduleName: CORE$1 };\n    Identifiers$1.Renderer2 = { name: 'Renderer2', moduleName: CORE$1 };\n    Identifiers$1.CodegenComponentFactoryResolver = {\n        name: 'ɵCodegenComponentFactoryResolver',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.ComponentFactoryResolver = {\n        name: 'ComponentFactoryResolver',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE$1 };\n    Identifiers$1.ComponentRef = { name: 'ComponentRef', moduleName: CORE$1 };\n    Identifiers$1.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE$1 };\n    Identifiers$1.createModuleFactory = {\n        name: 'ɵcmf',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.moduleDef = {\n        name: 'ɵmod',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.moduleProviderDef = {\n        name: 'ɵmpd',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.RegisterModuleFactoryFn = {\n        name: 'ɵregisterModuleFactory',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.inject = { name: 'ɵɵinject', moduleName: CORE$1 };\n    Identifiers$1.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE$1 };\n    Identifiers$1.INJECTOR = { name: 'INJECTOR', moduleName: CORE$1 };\n    Identifiers$1.Injector = { name: 'Injector', moduleName: CORE$1 };\n    Identifiers$1.ViewEncapsulation = {\n        name: 'ViewEncapsulation',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.ChangeDetectionStrategy = {\n        name: 'ChangeDetectionStrategy',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.SecurityContext = {\n        name: 'SecurityContext',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE$1 };\n    Identifiers$1.TRANSLATIONS_FORMAT = {\n        name: 'TRANSLATIONS_FORMAT',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.inlineInterpolate = {\n        name: 'ɵinlineInterpolate',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.interpolate = { name: 'ɵinterpolate', moduleName: CORE$1 };\n    Identifiers$1.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE$1 };\n    Identifiers$1.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE$1 };\n    Identifiers$1.Renderer = { name: 'Renderer', moduleName: CORE$1 };\n    Identifiers$1.viewDef = { name: 'ɵvid', moduleName: CORE$1 };\n    Identifiers$1.elementDef = { name: 'ɵeld', moduleName: CORE$1 };\n    Identifiers$1.anchorDef = { name: 'ɵand', moduleName: CORE$1 };\n    Identifiers$1.textDef = { name: 'ɵted', moduleName: CORE$1 };\n    Identifiers$1.directiveDef = { name: 'ɵdid', moduleName: CORE$1 };\n    Identifiers$1.providerDef = { name: 'ɵprd', moduleName: CORE$1 };\n    Identifiers$1.queryDef = { name: 'ɵqud', moduleName: CORE$1 };\n    Identifiers$1.pureArrayDef = { name: 'ɵpad', moduleName: CORE$1 };\n    Identifiers$1.pureObjectDef = { name: 'ɵpod', moduleName: CORE$1 };\n    Identifiers$1.purePipeDef = { name: 'ɵppd', moduleName: CORE$1 };\n    Identifiers$1.pipeDef = { name: 'ɵpid', moduleName: CORE$1 };\n    Identifiers$1.nodeValue = { name: 'ɵnov', moduleName: CORE$1 };\n    Identifiers$1.ngContentDef = { name: 'ɵncd', moduleName: CORE$1 };\n    Identifiers$1.unwrapValue = { name: 'ɵunv', moduleName: CORE$1 };\n    Identifiers$1.createRendererType2 = { name: 'ɵcrt', moduleName: CORE$1 };\n    // type only\n    Identifiers$1.RendererType2 = {\n        name: 'RendererType2',\n        moduleName: CORE$1,\n    };\n    // type only\n    Identifiers$1.ViewDefinition = {\n        name: 'ɵViewDefinition',\n        moduleName: CORE$1,\n    };\n    Identifiers$1.createComponentFactory = { name: 'ɵccf', moduleName: CORE$1 };\n    function createTokenForReference(reference) {\n        return { identifier: { reference: reference } };\n    }\n    function createTokenForExternalReference(reflector, reference) {\n        return createTokenForReference(reflector.resolveExternalReference(reference));\n    }\n\n    var EventHandlerVars = /** @class */ (function () {\n        function EventHandlerVars() {\n        }\n        return EventHandlerVars;\n    }());\n    EventHandlerVars.event = variable('$event');\n    var ConvertActionBindingResult = /** @class */ (function () {\n        function ConvertActionBindingResult(\n        /**\n         * Render2 compatible statements,\n         */\n        stmts, \n        /**\n         * Variable name used with render2 compatible statements.\n         */\n        allowDefault) {\n            this.stmts = stmts;\n            this.allowDefault = allowDefault;\n            /**\n             * This is bit of a hack. It converts statements which render2 expects to statements which are\n             * expected by render3.\n             *\n             * Example: `<div click=\"doSomething($event)\">` will generate:\n             *\n             * Render3:\n             * ```\n             * const pd_b:any = ((<any>ctx.doSomething($event)) !== false);\n             * return pd_b;\n             * ```\n             *\n             * but render2 expects:\n             * ```\n             * return ctx.doSomething($event);\n             * ```\n             */\n            // TODO(misko): remove this hack once we no longer support ViewEngine.\n            this.render3Stmts = stmts.map(function (statement) {\n                if (statement instanceof DeclareVarStmt && statement.name == allowDefault.name &&\n                    statement.value instanceof BinaryOperatorExpr) {\n                    var lhs = statement.value.lhs;\n                    return new ReturnStatement(lhs.value);\n                }\n                return statement;\n            });\n        }\n        return ConvertActionBindingResult;\n    }());\n    /**\n     * Converts the given expression AST into an executable output AST, assuming the expression is\n     * used in an action binding (e.g. an event handler).\n     */\n    function convertActionBinding(localResolver, implicitReceiver, action, bindingId, interpolationFunction, baseSourceSpan, implicitReceiverAccesses, globals) {\n        if (!localResolver) {\n            localResolver = new DefaultLocalResolver(globals);\n        }\n        var actionWithoutBuiltins = convertPropertyBindingBuiltins({\n            createLiteralArrayConverter: function (argCount) {\n                // Note: no caching for literal arrays in actions.\n                return function (args) { return literalArr(args); };\n            },\n            createLiteralMapConverter: function (keys) {\n                // Note: no caching for literal maps in actions.\n                return function (values) {\n                    var entries = keys.map(function (k, i) { return ({\n                        key: k.key,\n                        value: values[i],\n                        quoted: k.quoted,\n                    }); });\n                    return literalMap(entries);\n                };\n            },\n            createPipeConverter: function (name) {\n                throw new Error(\"Illegal State: Actions are not allowed to contain pipes. Pipe: \" + name);\n            }\n        }, action);\n        var visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, interpolationFunction, baseSourceSpan, implicitReceiverAccesses);\n        var actionStmts = [];\n        flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);\n        prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);\n        if (visitor.usesImplicitReceiver) {\n            localResolver.notifyImplicitReceiverUse();\n        }\n        var lastIndex = actionStmts.length - 1;\n        var preventDefaultVar = null;\n        if (lastIndex >= 0) {\n            var lastStatement = actionStmts[lastIndex];\n            var returnExpr = convertStmtIntoExpression(lastStatement);\n            if (returnExpr) {\n                // Note: We need to cast the result of the method call to dynamic,\n                // as it might be a void method!\n                preventDefaultVar = createPreventDefaultVar(bindingId);\n                actionStmts[lastIndex] =\n                    preventDefaultVar.set(returnExpr.cast(DYNAMIC_TYPE).notIdentical(literal(false)))\n                        .toDeclStmt(null, [exports.StmtModifier.Final]);\n            }\n        }\n        return new ConvertActionBindingResult(actionStmts, preventDefaultVar);\n    }\n    function convertPropertyBindingBuiltins(converterFactory, ast) {\n        return convertBuiltins(converterFactory, ast);\n    }\n    var ConvertPropertyBindingResult = /** @class */ (function () {\n        function ConvertPropertyBindingResult(stmts, currValExpr) {\n            this.stmts = stmts;\n            this.currValExpr = currValExpr;\n        }\n        return ConvertPropertyBindingResult;\n    }());\n    var BindingForm;\n    (function (BindingForm) {\n        // The general form of binding expression, supports all expressions.\n        BindingForm[BindingForm[\"General\"] = 0] = \"General\";\n        // Try to generate a simple binding (no temporaries or statements)\n        // otherwise generate a general binding\n        BindingForm[BindingForm[\"TrySimple\"] = 1] = \"TrySimple\";\n        // Inlines assignment of temporaries into the generated expression. The result may still\n        // have statements attached for declarations of temporary variables.\n        // This is the only relevant form for Ivy, the other forms are only used in ViewEngine.\n        BindingForm[BindingForm[\"Expression\"] = 2] = \"Expression\";\n    })(BindingForm || (BindingForm = {}));\n    /**\n     * Converts the given expression AST into an executable output AST, assuming the expression\n     * is used in property binding. The expression has to be preprocessed via\n     * `convertPropertyBindingBuiltins`.\n     */\n    function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId, form, interpolationFunction) {\n        if (!localResolver) {\n            localResolver = new DefaultLocalResolver();\n        }\n        var visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, interpolationFunction);\n        var outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);\n        var stmts = getStatementsFromVisitor(visitor, bindingId);\n        if (visitor.usesImplicitReceiver) {\n            localResolver.notifyImplicitReceiverUse();\n        }\n        if (visitor.temporaryCount === 0 && form == BindingForm.TrySimple) {\n            return new ConvertPropertyBindingResult([], outputExpr);\n        }\n        else if (form === BindingForm.Expression) {\n            return new ConvertPropertyBindingResult(stmts, outputExpr);\n        }\n        var currValExpr = createCurrValueExpr(bindingId);\n        stmts.push(currValExpr.set(outputExpr).toDeclStmt(DYNAMIC_TYPE, [exports.StmtModifier.Final]));\n        return new ConvertPropertyBindingResult(stmts, currValExpr);\n    }\n    /**\n     * Given some expression, such as a binding or interpolation expression, and a context expression to\n     * look values up on, visit each facet of the given expression resolving values from the context\n     * expression such that a list of arguments can be derived from the found values that can be used as\n     * arguments to an external update instruction.\n     *\n     * @param localResolver The resolver to use to look up expressions by name appropriately\n     * @param contextVariableExpression The expression representing the context variable used to create\n     * the final argument expressions\n     * @param expressionWithArgumentsToExtract The expression to visit to figure out what values need to\n     * be resolved and what arguments list to build.\n     * @param bindingId A name prefix used to create temporary variable names if they're needed for the\n     * arguments generated\n     * @returns An array of expressions that can be passed as arguments to instruction expressions like\n     * `o.importExpr(R3.propertyInterpolate).callFn(result)`\n     */\n    function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) {\n        var visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, undefined);\n        var outputExpr = expressionWithArgumentsToExtract.visit(visitor, _Mode.Expression);\n        if (visitor.usesImplicitReceiver) {\n            localResolver.notifyImplicitReceiverUse();\n        }\n        var stmts = getStatementsFromVisitor(visitor, bindingId);\n        // Removing the first argument, because it was a length for ViewEngine, not Ivy.\n        var args = outputExpr.args.slice(1);\n        if (expressionWithArgumentsToExtract instanceof Interpolation) {\n            // If we're dealing with an interpolation of 1 value with an empty prefix and suffix, reduce the\n            // args returned to just the value, because we're going to pass it to a special instruction.\n            var strings = expressionWithArgumentsToExtract.strings;\n            if (args.length === 3 && strings[0] === '' && strings[1] === '') {\n                // Single argument interpolate instructions.\n                args = [args[1]];\n            }\n            else if (args.length >= 19) {\n                // 19 or more arguments must be passed to the `interpolateV`-style instructions, which accept\n                // an array of arguments\n                args = [literalArr(args)];\n            }\n        }\n        return { stmts: stmts, args: args };\n    }\n    function getStatementsFromVisitor(visitor, bindingId) {\n        var stmts = [];\n        for (var i = 0; i < visitor.temporaryCount; i++) {\n            stmts.push(temporaryDeclaration(bindingId, i));\n        }\n        return stmts;\n    }\n    function convertBuiltins(converterFactory, ast) {\n        var visitor = new _BuiltinAstConverter(converterFactory);\n        return ast.visit(visitor);\n    }\n    function temporaryName(bindingId, temporaryNumber) {\n        return \"tmp_\" + bindingId + \"_\" + temporaryNumber;\n    }\n    function temporaryDeclaration(bindingId, temporaryNumber) {\n        return new DeclareVarStmt(temporaryName(bindingId, temporaryNumber));\n    }\n    function prependTemporaryDecls(temporaryCount, bindingId, statements) {\n        for (var i = temporaryCount - 1; i >= 0; i--) {\n            statements.unshift(temporaryDeclaration(bindingId, i));\n        }\n    }\n    var _Mode;\n    (function (_Mode) {\n        _Mode[_Mode[\"Statement\"] = 0] = \"Statement\";\n        _Mode[_Mode[\"Expression\"] = 1] = \"Expression\";\n    })(_Mode || (_Mode = {}));\n    function ensureStatementMode(mode, ast) {\n        if (mode !== _Mode.Statement) {\n            throw new Error(\"Expected a statement, but saw \" + ast);\n        }\n    }\n    function ensureExpressionMode(mode, ast) {\n        if (mode !== _Mode.Expression) {\n            throw new Error(\"Expected an expression, but saw \" + ast);\n        }\n    }\n    function convertToStatementIfNeeded(mode, expr) {\n        if (mode === _Mode.Statement) {\n            return expr.toStmt();\n        }\n        else {\n            return expr;\n        }\n    }\n    var _BuiltinAstConverter = /** @class */ (function (_super) {\n        __extends(_BuiltinAstConverter, _super);\n        function _BuiltinAstConverter(_converterFactory) {\n            var _this = _super.call(this) || this;\n            _this._converterFactory = _converterFactory;\n            return _this;\n        }\n        _BuiltinAstConverter.prototype.visitPipe = function (ast, context) {\n            var _this = this;\n            var args = __spreadArray([ast.exp], __read(ast.args)).map(function (ast) { return ast.visit(_this, context); });\n            return new BuiltinFunctionCall(ast.span, ast.sourceSpan, args, this._converterFactory.createPipeConverter(ast.name, args.length));\n        };\n        _BuiltinAstConverter.prototype.visitLiteralArray = function (ast, context) {\n            var _this = this;\n            var args = ast.expressions.map(function (ast) { return ast.visit(_this, context); });\n            return new BuiltinFunctionCall(ast.span, ast.sourceSpan, args, this._converterFactory.createLiteralArrayConverter(ast.expressions.length));\n        };\n        _BuiltinAstConverter.prototype.visitLiteralMap = function (ast, context) {\n            var _this = this;\n            var args = ast.values.map(function (ast) { return ast.visit(_this, context); });\n            return new BuiltinFunctionCall(ast.span, ast.sourceSpan, args, this._converterFactory.createLiteralMapConverter(ast.keys));\n        };\n        return _BuiltinAstConverter;\n    }(AstTransformer$1));\n    var _AstToIrVisitor = /** @class */ (function () {\n        function _AstToIrVisitor(_localResolver, _implicitReceiver, bindingId, interpolationFunction, baseSourceSpan, implicitReceiverAccesses) {\n            this._localResolver = _localResolver;\n            this._implicitReceiver = _implicitReceiver;\n            this.bindingId = bindingId;\n            this.interpolationFunction = interpolationFunction;\n            this.baseSourceSpan = baseSourceSpan;\n            this.implicitReceiverAccesses = implicitReceiverAccesses;\n            this._nodeMap = new Map();\n            this._resultMap = new Map();\n            this._currentTemporary = 0;\n            this.temporaryCount = 0;\n            this.usesImplicitReceiver = false;\n        }\n        _AstToIrVisitor.prototype.visitUnary = function (ast, mode) {\n            var op;\n            switch (ast.operator) {\n                case '+':\n                    op = exports.UnaryOperator.Plus;\n                    break;\n                case '-':\n                    op = exports.UnaryOperator.Minus;\n                    break;\n                default:\n                    throw new Error(\"Unsupported operator \" + ast.operator);\n            }\n            return convertToStatementIfNeeded(mode, new UnaryOperatorExpr(op, this._visit(ast.expr, _Mode.Expression), undefined, this.convertSourceSpan(ast.span)));\n        };\n        _AstToIrVisitor.prototype.visitBinary = function (ast, mode) {\n            var op;\n            switch (ast.operation) {\n                case '+':\n                    op = exports.BinaryOperator.Plus;\n                    break;\n                case '-':\n                    op = exports.BinaryOperator.Minus;\n                    break;\n                case '*':\n                    op = exports.BinaryOperator.Multiply;\n                    break;\n                case '/':\n                    op = exports.BinaryOperator.Divide;\n                    break;\n                case '%':\n                    op = exports.BinaryOperator.Modulo;\n                    break;\n                case '&&':\n                    op = exports.BinaryOperator.And;\n                    break;\n                case '||':\n                    op = exports.BinaryOperator.Or;\n                    break;\n                case '==':\n                    op = exports.BinaryOperator.Equals;\n                    break;\n                case '!=':\n                    op = exports.BinaryOperator.NotEquals;\n                    break;\n                case '===':\n                    op = exports.BinaryOperator.Identical;\n                    break;\n                case '!==':\n                    op = exports.BinaryOperator.NotIdentical;\n                    break;\n                case '<':\n                    op = exports.BinaryOperator.Lower;\n                    break;\n                case '>':\n                    op = exports.BinaryOperator.Bigger;\n                    break;\n                case '<=':\n                    op = exports.BinaryOperator.LowerEquals;\n                    break;\n                case '>=':\n                    op = exports.BinaryOperator.BiggerEquals;\n                    break;\n                case '??':\n                    return this.convertNullishCoalesce(ast, mode);\n                default:\n                    throw new Error(\"Unsupported operation \" + ast.operation);\n            }\n            return convertToStatementIfNeeded(mode, new BinaryOperatorExpr(op, this._visit(ast.left, _Mode.Expression), this._visit(ast.right, _Mode.Expression), undefined, this.convertSourceSpan(ast.span)));\n        };\n        _AstToIrVisitor.prototype.visitChain = function (ast, mode) {\n            ensureStatementMode(mode, ast);\n            return this.visitAll(ast.expressions, mode);\n        };\n        _AstToIrVisitor.prototype.visitConditional = function (ast, mode) {\n            var value = this._visit(ast.condition, _Mode.Expression);\n            return convertToStatementIfNeeded(mode, value.conditional(this._visit(ast.trueExp, _Mode.Expression), this._visit(ast.falseExp, _Mode.Expression), this.convertSourceSpan(ast.span)));\n        };\n        _AstToIrVisitor.prototype.visitPipe = function (ast, mode) {\n            throw new Error(\"Illegal state: Pipes should have been converted into functions. Pipe: \" + ast.name);\n        };\n        _AstToIrVisitor.prototype.visitFunctionCall = function (ast, mode) {\n            var convertedArgs = this.visitAll(ast.args, _Mode.Expression);\n            var fnResult;\n            if (ast instanceof BuiltinFunctionCall) {\n                fnResult = ast.converter(convertedArgs);\n            }\n            else {\n                fnResult = this._visit(ast.target, _Mode.Expression)\n                    .callFn(convertedArgs, this.convertSourceSpan(ast.span));\n            }\n            return convertToStatementIfNeeded(mode, fnResult);\n        };\n        _AstToIrVisitor.prototype.visitImplicitReceiver = function (ast, mode) {\n            ensureExpressionMode(mode, ast);\n            this.usesImplicitReceiver = true;\n            return this._implicitReceiver;\n        };\n        _AstToIrVisitor.prototype.visitThisReceiver = function (ast, mode) {\n            return this.visitImplicitReceiver(ast, mode);\n        };\n        _AstToIrVisitor.prototype.visitInterpolation = function (ast, mode) {\n            ensureExpressionMode(mode, ast);\n            var args = [literal(ast.expressions.length)];\n            for (var i = 0; i < ast.strings.length - 1; i++) {\n                args.push(literal(ast.strings[i]));\n                args.push(this._visit(ast.expressions[i], _Mode.Expression));\n            }\n            args.push(literal(ast.strings[ast.strings.length - 1]));\n            if (this.interpolationFunction) {\n                return this.interpolationFunction(args);\n            }\n            return ast.expressions.length <= 9 ?\n                importExpr(Identifiers$1.inlineInterpolate).callFn(args) :\n                importExpr(Identifiers$1.interpolate).callFn([\n                    args[0], literalArr(args.slice(1), undefined, this.convertSourceSpan(ast.span))\n                ]);\n        };\n        _AstToIrVisitor.prototype.visitKeyedRead = function (ast, mode) {\n            var leftMostSafe = this.leftMostSafeNode(ast);\n            if (leftMostSafe) {\n                return this.convertSafeAccess(ast, leftMostSafe, mode);\n            }\n            else {\n                return convertToStatementIfNeeded(mode, this._visit(ast.receiver, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression)));\n            }\n        };\n        _AstToIrVisitor.prototype.visitKeyedWrite = function (ast, mode) {\n            var obj = this._visit(ast.receiver, _Mode.Expression);\n            var key = this._visit(ast.key, _Mode.Expression);\n            var value = this._visit(ast.value, _Mode.Expression);\n            if (obj === this._implicitReceiver) {\n                this._localResolver.maybeRestoreView();\n            }\n            return convertToStatementIfNeeded(mode, obj.key(key).set(value));\n        };\n        _AstToIrVisitor.prototype.visitLiteralArray = function (ast, mode) {\n            throw new Error(\"Illegal State: literal arrays should have been converted into functions\");\n        };\n        _AstToIrVisitor.prototype.visitLiteralMap = function (ast, mode) {\n            throw new Error(\"Illegal State: literal maps should have been converted into functions\");\n        };\n        _AstToIrVisitor.prototype.visitLiteralPrimitive = function (ast, mode) {\n            // For literal values of null, undefined, true, or false allow type interference\n            // to infer the type.\n            var type = ast.value === null || ast.value === undefined || ast.value === true || ast.value === true ?\n                INFERRED_TYPE :\n                undefined;\n            return convertToStatementIfNeeded(mode, literal(ast.value, type, this.convertSourceSpan(ast.span)));\n        };\n        _AstToIrVisitor.prototype._getLocal = function (name, receiver) {\n            var _a;\n            if (((_a = this._localResolver.globals) === null || _a === void 0 ? void 0 : _a.has(name)) && receiver instanceof ThisReceiver) {\n                return null;\n            }\n            return this._localResolver.getLocal(name);\n        };\n        _AstToIrVisitor.prototype.visitMethodCall = function (ast, mode) {\n            if (ast.receiver instanceof ImplicitReceiver &&\n                !(ast.receiver instanceof ThisReceiver) && ast.name === '$any') {\n                var args = this.visitAll(ast.args, _Mode.Expression);\n                if (args.length != 1) {\n                    throw new Error(\"Invalid call to $any, expected 1 argument but received \" + (args.length || 'none'));\n                }\n                return args[0].cast(DYNAMIC_TYPE, this.convertSourceSpan(ast.span));\n            }\n            var leftMostSafe = this.leftMostSafeNode(ast);\n            if (leftMostSafe) {\n                return this.convertSafeAccess(ast, leftMostSafe, mode);\n            }\n            else {\n                var args = this.visitAll(ast.args, _Mode.Expression);\n                var prevUsesImplicitReceiver = this.usesImplicitReceiver;\n                var result = null;\n                var receiver = this._visit(ast.receiver, _Mode.Expression);\n                if (receiver === this._implicitReceiver) {\n                    var varExpr = this._getLocal(ast.name, ast.receiver);\n                    if (varExpr) {\n                        // Restore the previous \"usesImplicitReceiver\" state since the implicit\n                        // receiver has been replaced with a resolved local expression.\n                        this.usesImplicitReceiver = prevUsesImplicitReceiver;\n                        result = varExpr.callFn(args);\n                        this.addImplicitReceiverAccess(ast.name);\n                    }\n                }\n                if (result == null) {\n                    result = receiver.callMethod(ast.name, args, this.convertSourceSpan(ast.span));\n                }\n                return convertToStatementIfNeeded(mode, result);\n            }\n        };\n        _AstToIrVisitor.prototype.visitPrefixNot = function (ast, mode) {\n            return convertToStatementIfNeeded(mode, not(this._visit(ast.expression, _Mode.Expression)));\n        };\n        _AstToIrVisitor.prototype.visitNonNullAssert = function (ast, mode) {\n            return convertToStatementIfNeeded(mode, assertNotNull(this._visit(ast.expression, _Mode.Expression)));\n        };\n        _AstToIrVisitor.prototype.visitPropertyRead = function (ast, mode) {\n            var leftMostSafe = this.leftMostSafeNode(ast);\n            if (leftMostSafe) {\n                return this.convertSafeAccess(ast, leftMostSafe, mode);\n            }\n            else {\n                var result = null;\n                var prevUsesImplicitReceiver = this.usesImplicitReceiver;\n                var receiver = this._visit(ast.receiver, _Mode.Expression);\n                if (receiver === this._implicitReceiver) {\n                    result = this._getLocal(ast.name, ast.receiver);\n                    if (result) {\n                        // Restore the previous \"usesImplicitReceiver\" state since the implicit\n                        // receiver has been replaced with a resolved local expression.\n                        this.usesImplicitReceiver = prevUsesImplicitReceiver;\n                        this.addImplicitReceiverAccess(ast.name);\n                    }\n                }\n                if (result == null) {\n                    result = receiver.prop(ast.name);\n                }\n                return convertToStatementIfNeeded(mode, result);\n            }\n        };\n        _AstToIrVisitor.prototype.visitPropertyWrite = function (ast, mode) {\n            var receiver = this._visit(ast.receiver, _Mode.Expression);\n            var prevUsesImplicitReceiver = this.usesImplicitReceiver;\n            var varExpr = null;\n            if (receiver === this._implicitReceiver) {\n                var localExpr = this._getLocal(ast.name, ast.receiver);\n                if (localExpr) {\n                    if (localExpr instanceof ReadPropExpr) {\n                        // If the local variable is a property read expression, it's a reference\n                        // to a 'context.property' value and will be used as the target of the\n                        // write expression.\n                        varExpr = localExpr;\n                        // Restore the previous \"usesImplicitReceiver\" state since the implicit\n                        // receiver has been replaced with a resolved local expression.\n                        this.usesImplicitReceiver = prevUsesImplicitReceiver;\n                        this.addImplicitReceiverAccess(ast.name);\n                    }\n                    else {\n                        // Otherwise it's an error.\n                        var receiver_1 = ast.name;\n                        var value = (ast.value instanceof PropertyRead) ? ast.value.name : undefined;\n                        throw new Error(\"Cannot assign value \\\"\" + value + \"\\\" to template variable \\\"\" + receiver_1 + \"\\\". Template variables are read-only.\");\n                    }\n                }\n            }\n            // If no local expression could be produced, use the original receiver's\n            // property as the target.\n            if (varExpr === null) {\n                varExpr = receiver.prop(ast.name);\n            }\n            return convertToStatementIfNeeded(mode, varExpr.set(this._visit(ast.value, _Mode.Expression)));\n        };\n        _AstToIrVisitor.prototype.visitSafePropertyRead = function (ast, mode) {\n            return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);\n        };\n        _AstToIrVisitor.prototype.visitSafeMethodCall = function (ast, mode) {\n            return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);\n        };\n        _AstToIrVisitor.prototype.visitSafeKeyedRead = function (ast, mode) {\n            return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);\n        };\n        _AstToIrVisitor.prototype.visitAll = function (asts, mode) {\n            var _this = this;\n            return asts.map(function (ast) { return _this._visit(ast, mode); });\n        };\n        _AstToIrVisitor.prototype.visitQuote = function (ast, mode) {\n            throw new Error(\"Quotes are not supported for evaluation!\\n        Statement: \" + ast.uninterpretedExpression + \" located at \" + ast.location);\n        };\n        _AstToIrVisitor.prototype._visit = function (ast, mode) {\n            var result = this._resultMap.get(ast);\n            if (result)\n                return result;\n            return (this._nodeMap.get(ast) || ast).visit(this, mode);\n        };\n        _AstToIrVisitor.prototype.convertSafeAccess = function (ast, leftMostSafe, mode) {\n            // If the expression contains a safe access node on the left it needs to be converted to\n            // an expression that guards the access to the member by checking the receiver for blank. As\n            // execution proceeds from left to right, the left most part of the expression must be guarded\n            // first but, because member access is left associative, the right side of the expression is at\n            // the top of the AST. The desired result requires lifting a copy of the left part of the\n            // expression up to test it for blank before generating the unguarded version.\n            // Consider, for example the following expression: a?.b.c?.d.e\n            // This results in the ast:\n            //         .\n            //        / \\\n            //       ?.   e\n            //      /  \\\n            //     .    d\n            //    / \\\n            //   ?.  c\n            //  /  \\\n            // a    b\n            // The following tree should be generated:\n            //\n            //        /---- ? ----\\\n            //       /      |      \\\n            //     a   /--- ? ---\\  null\n            //        /     |     \\\n            //       .      .     null\n            //      / \\    / \\\n            //     .  c   .   e\n            //    / \\    / \\\n            //   a   b  .   d\n            //         / \\\n            //        .   c\n            //       / \\\n            //      a   b\n            //\n            // Notice that the first guard condition is the left hand of the left most safe access node\n            // which comes in as leftMostSafe to this routine.\n            var guardedExpression = this._visit(leftMostSafe.receiver, _Mode.Expression);\n            var temporary = undefined;\n            if (this.needsTemporaryInSafeAccess(leftMostSafe.receiver)) {\n                // If the expression has method calls or pipes then we need to save the result into a\n                // temporary variable to avoid calling stateful or impure code more than once.\n                temporary = this.allocateTemporary();\n                // Preserve the result in the temporary variable\n                guardedExpression = temporary.set(guardedExpression);\n                // Ensure all further references to the guarded expression refer to the temporary instead.\n                this._resultMap.set(leftMostSafe.receiver, temporary);\n            }\n            var condition = guardedExpression.isBlank();\n            // Convert the ast to an unguarded access to the receiver's member. The map will substitute\n            // leftMostNode with its unguarded version in the call to `this.visit()`.\n            if (leftMostSafe instanceof SafeMethodCall) {\n                this._nodeMap.set(leftMostSafe, new MethodCall(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.nameSpan, leftMostSafe.receiver, leftMostSafe.name, leftMostSafe.args, leftMostSafe.argumentSpan));\n            }\n            else if (leftMostSafe instanceof SafeKeyedRead) {\n                this._nodeMap.set(leftMostSafe, new KeyedRead(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.receiver, leftMostSafe.key));\n            }\n            else {\n                this._nodeMap.set(leftMostSafe, new PropertyRead(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.nameSpan, leftMostSafe.receiver, leftMostSafe.name));\n            }\n            // Recursively convert the node now without the guarded member access.\n            var access = this._visit(ast, _Mode.Expression);\n            // Remove the mapping. This is not strictly required as the converter only traverses each node\n            // once but is safer if the conversion is changed to traverse the nodes more than once.\n            this._nodeMap.delete(leftMostSafe);\n            // If we allocated a temporary, release it.\n            if (temporary) {\n                this.releaseTemporary(temporary);\n            }\n            // Produce the conditional\n            return convertToStatementIfNeeded(mode, condition.conditional(NULL_EXPR, access));\n        };\n        _AstToIrVisitor.prototype.convertNullishCoalesce = function (ast, mode) {\n            var left = this._visit(ast.left, _Mode.Expression);\n            var right = this._visit(ast.right, _Mode.Expression);\n            var temporary = this.allocateTemporary();\n            this.releaseTemporary(temporary);\n            // Generate the following expression. It is identical to how TS\n            // transpiles binary expressions with a nullish coalescing operator.\n            // let temp;\n            // (temp = a) !== null && temp !== undefined ? temp : b;\n            return convertToStatementIfNeeded(mode, temporary.set(left)\n                .notIdentical(NULL_EXPR)\n                .and(temporary.notIdentical(literal(undefined)))\n                .conditional(temporary, right));\n        };\n        // Given an expression of the form a?.b.c?.d.e then the left most safe node is\n        // the (a?.b). The . and ?. are left associative thus can be rewritten as:\n        // ((((a?.c).b).c)?.d).e. This returns the most deeply nested safe read or\n        // safe method call as this needs to be transformed initially to:\n        //   a == null ? null : a.c.b.c?.d.e\n        // then to:\n        //   a == null ? null : a.b.c == null ? null : a.b.c.d.e\n        _AstToIrVisitor.prototype.leftMostSafeNode = function (ast) {\n            var _this = this;\n            var visit = function (visitor, ast) {\n                return (_this._nodeMap.get(ast) || ast).visit(visitor);\n            };\n            return ast.visit({\n                visitUnary: function (ast) {\n                    return null;\n                },\n                visitBinary: function (ast) {\n                    return null;\n                },\n                visitChain: function (ast) {\n                    return null;\n                },\n                visitConditional: function (ast) {\n                    return null;\n                },\n                visitFunctionCall: function (ast) {\n                    return null;\n                },\n                visitImplicitReceiver: function (ast) {\n                    return null;\n                },\n                visitThisReceiver: function (ast) {\n                    return null;\n                },\n                visitInterpolation: function (ast) {\n                    return null;\n                },\n                visitKeyedRead: function (ast) {\n                    return visit(this, ast.receiver);\n                },\n                visitKeyedWrite: function (ast) {\n                    return null;\n                },\n                visitLiteralArray: function (ast) {\n                    return null;\n                },\n                visitLiteralMap: function (ast) {\n                    return null;\n                },\n                visitLiteralPrimitive: function (ast) {\n                    return null;\n                },\n                visitMethodCall: function (ast) {\n                    return visit(this, ast.receiver);\n                },\n                visitPipe: function (ast) {\n                    return null;\n                },\n                visitPrefixNot: function (ast) {\n                    return null;\n                },\n                visitNonNullAssert: function (ast) {\n                    return null;\n                },\n                visitPropertyRead: function (ast) {\n                    return visit(this, ast.receiver);\n                },\n                visitPropertyWrite: function (ast) {\n                    return null;\n                },\n                visitQuote: function (ast) {\n                    return null;\n                },\n                visitSafeMethodCall: function (ast) {\n                    return visit(this, ast.receiver) || ast;\n                },\n                visitSafePropertyRead: function (ast) {\n                    return visit(this, ast.receiver) || ast;\n                },\n                visitSafeKeyedRead: function (ast) {\n                    return visit(this, ast.receiver) || ast;\n                }\n            });\n        };\n        // Returns true of the AST includes a method or a pipe indicating that, if the\n        // expression is used as the target of a safe property or method access then\n        // the expression should be stored into a temporary variable.\n        _AstToIrVisitor.prototype.needsTemporaryInSafeAccess = function (ast) {\n            var _this = this;\n            var visit = function (visitor, ast) {\n                return ast && (_this._nodeMap.get(ast) || ast).visit(visitor);\n            };\n            var visitSome = function (visitor, ast) {\n                return ast.some(function (ast) { return visit(visitor, ast); });\n            };\n            return ast.visit({\n                visitUnary: function (ast) {\n                    return visit(this, ast.expr);\n                },\n                visitBinary: function (ast) {\n                    return visit(this, ast.left) || visit(this, ast.right);\n                },\n                visitChain: function (ast) {\n                    return false;\n                },\n                visitConditional: function (ast) {\n                    return visit(this, ast.condition) || visit(this, ast.trueExp) || visit(this, ast.falseExp);\n                },\n                visitFunctionCall: function (ast) {\n                    return true;\n                },\n                visitImplicitReceiver: function (ast) {\n                    return false;\n                },\n                visitThisReceiver: function (ast) {\n                    return false;\n                },\n                visitInterpolation: function (ast) {\n                    return visitSome(this, ast.expressions);\n                },\n                visitKeyedRead: function (ast) {\n                    return false;\n                },\n                visitKeyedWrite: function (ast) {\n                    return false;\n                },\n                visitLiteralArray: function (ast) {\n                    return true;\n                },\n                visitLiteralMap: function (ast) {\n                    return true;\n                },\n                visitLiteralPrimitive: function (ast) {\n                    return false;\n                },\n                visitMethodCall: function (ast) {\n                    return true;\n                },\n                visitPipe: function (ast) {\n                    return true;\n                },\n                visitPrefixNot: function (ast) {\n                    return visit(this, ast.expression);\n                },\n                visitNonNullAssert: function (ast) {\n                    return visit(this, ast.expression);\n                },\n                visitPropertyRead: function (ast) {\n                    return false;\n                },\n                visitPropertyWrite: function (ast) {\n                    return false;\n                },\n                visitQuote: function (ast) {\n                    return false;\n                },\n                visitSafeMethodCall: function (ast) {\n                    return true;\n                },\n                visitSafePropertyRead: function (ast) {\n                    return false;\n                },\n                visitSafeKeyedRead: function (ast) {\n                    return false;\n                }\n            });\n        };\n        _AstToIrVisitor.prototype.allocateTemporary = function () {\n            var tempNumber = this._currentTemporary++;\n            this.temporaryCount = Math.max(this._currentTemporary, this.temporaryCount);\n            return new ReadVarExpr(temporaryName(this.bindingId, tempNumber));\n        };\n        _AstToIrVisitor.prototype.releaseTemporary = function (temporary) {\n            this._currentTemporary--;\n            if (temporary.name != temporaryName(this.bindingId, this._currentTemporary)) {\n                throw new Error(\"Temporary \" + temporary.name + \" released out of order\");\n            }\n        };\n        /**\n         * Creates an absolute `ParseSourceSpan` from the relative `ParseSpan`.\n         *\n         * `ParseSpan` objects are relative to the start of the expression.\n         * This method converts these to full `ParseSourceSpan` objects that\n         * show where the span is within the overall source file.\n         *\n         * @param span the relative span to convert.\n         * @returns a `ParseSourceSpan` for the given span or null if no\n         * `baseSourceSpan` was provided to this class.\n         */\n        _AstToIrVisitor.prototype.convertSourceSpan = function (span) {\n            if (this.baseSourceSpan) {\n                var start = this.baseSourceSpan.start.moveBy(span.start);\n                var end = this.baseSourceSpan.start.moveBy(span.end);\n                var fullStart = this.baseSourceSpan.fullStart.moveBy(span.start);\n                return new ParseSourceSpan(start, end, fullStart);\n            }\n            else {\n                return null;\n            }\n        };\n        /** Adds the name of an AST to the list of implicit receiver accesses. */\n        _AstToIrVisitor.prototype.addImplicitReceiverAccess = function (name) {\n            if (this.implicitReceiverAccesses) {\n                this.implicitReceiverAccesses.add(name);\n            }\n        };\n        return _AstToIrVisitor;\n    }());\n    function flattenStatements(arg, output) {\n        if (Array.isArray(arg)) {\n            arg.forEach(function (entry) { return flattenStatements(entry, output); });\n        }\n        else {\n            output.push(arg);\n        }\n    }\n    var DefaultLocalResolver = /** @class */ (function () {\n        function DefaultLocalResolver(globals) {\n            this.globals = globals;\n        }\n        DefaultLocalResolver.prototype.notifyImplicitReceiverUse = function () { };\n        DefaultLocalResolver.prototype.maybeRestoreView = function () { };\n        DefaultLocalResolver.prototype.getLocal = function (name) {\n            if (name === EventHandlerVars.event.name) {\n                return EventHandlerVars.event;\n            }\n            return null;\n        };\n        return DefaultLocalResolver;\n    }());\n    function createCurrValueExpr(bindingId) {\n        return variable(\"currVal_\" + bindingId); // fix syntax highlighting: `\n    }\n    function createPreventDefaultVar(bindingId) {\n        return variable(\"pd_\" + bindingId);\n    }\n    function convertStmtIntoExpression(stmt) {\n        if (stmt instanceof ExpressionStatement) {\n            return stmt.expr;\n        }\n        else if (stmt instanceof ReturnStatement) {\n            return stmt.value;\n        }\n        return null;\n    }\n    var BuiltinFunctionCall = /** @class */ (function (_super) {\n        __extends(BuiltinFunctionCall, _super);\n        function BuiltinFunctionCall(span, sourceSpan, args, converter) {\n            var _this = _super.call(this, span, sourceSpan, null, args) || this;\n            _this.converter = converter;\n            return _this;\n        }\n        return BuiltinFunctionCall;\n    }(FunctionCall));\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This file is a port of shadowCSS from webcomponents.js to TypeScript.\n     *\n     * Please make sure to keep to edits in sync with the source file.\n     *\n     * Source:\n     * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n     *\n     * The original file level comment is reproduced below\n     */\n    /*\n      This is a limited shim for ShadowDOM css styling.\n      https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles\n\n      The intention here is to support only the styling features which can be\n      relatively simply implemented. The goal is to allow users to avoid the\n      most obvious pitfalls and do so without compromising performance significantly.\n      For ShadowDOM styling that's not covered here, a set of best practices\n      can be provided that should allow users to accomplish more complex styling.\n\n      The following is a list of specific ShadowDOM styling features and a brief\n      discussion of the approach used to shim.\n\n      Shimmed features:\n\n      * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host\n      element using the :host rule. To shim this feature, the :host styles are\n      reformatted and prefixed with a given scope name and promoted to a\n      document level stylesheet.\n      For example, given a scope name of .foo, a rule like this:\n\n        :host {\n            background: red;\n          }\n        }\n\n      becomes:\n\n        .foo {\n          background: red;\n        }\n\n      * encapsulation: Styles defined within ShadowDOM, apply only to\n      dom inside the ShadowDOM. Polymer uses one of two techniques to implement\n      this feature.\n\n      By default, rules are prefixed with the host element tag name\n      as a descendant selector. This ensures styling does not leak out of the 'top'\n      of the element's ShadowDOM. For example,\n\n      div {\n          font-weight: bold;\n        }\n\n      becomes:\n\n      x-foo div {\n          font-weight: bold;\n        }\n\n      becomes:\n\n\n      Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then\n      selectors are scoped by adding an attribute selector suffix to each\n      simple selector that contains the host element tag name. Each element\n      in the element's ShadowDOM template is also given the scope attribute.\n      Thus, these rules match only elements that have the scope attribute.\n      For example, given a scope name of x-foo, a rule like this:\n\n        div {\n          font-weight: bold;\n        }\n\n      becomes:\n\n        div[x-foo] {\n          font-weight: bold;\n        }\n\n      Note that elements that are dynamically added to a scope must have the scope\n      selector added to them manually.\n\n      * upper/lower bound encapsulation: Styles which are defined outside a\n      shadowRoot should not cross the ShadowDOM boundary and should not apply\n      inside a shadowRoot.\n\n      This styling behavior is not emulated. Some possible ways to do this that\n      were rejected due to complexity and/or performance concerns include: (1) reset\n      every possible property for every possible selector for a given scope name;\n      (2) re-implement css in javascript.\n\n      As an alternative, users should make sure to use selectors\n      specific to the scope in which they are working.\n\n      * ::distributed: This behavior is not emulated. It's often not necessary\n      to style the contents of a specific insertion point and instead, descendants\n      of the host element can be styled selectively. Users can also create an\n      extra node around an insertion point and style that node's contents\n      via descendent selectors. For example, with a shadowRoot like this:\n\n        <style>\n          ::content(div) {\n            background: red;\n          }\n        </style>\n        <content></content>\n\n      could become:\n\n        <style>\n          / *@polyfill .content-container div * /\n          ::content(div) {\n            background: red;\n          }\n        </style>\n        <div class=\"content-container\">\n          <content></content>\n        </div>\n\n      Note the use of @polyfill in the comment above a ShadowDOM specific style\n      declaration. This is a directive to the styling shim to use the selector\n      in comments in lieu of the next selector when running under polyfill.\n    */\n    var ShadowCss = /** @class */ (function () {\n        function ShadowCss() {\n            this.strictStyling = true;\n        }\n        /*\n         * Shim some cssText with the given selector. Returns cssText that can\n         * be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).\n         *\n         * When strictStyling is true:\n         * - selector is the attribute added to all elements inside the host,\n         * - hostSelector is the attribute added to the host itself.\n         */\n        ShadowCss.prototype.shimCssText = function (cssText, selector, hostSelector) {\n            if (hostSelector === void 0) { hostSelector = ''; }\n            var commentsWithHash = extractCommentsWithHash(cssText);\n            cssText = stripComments(cssText);\n            cssText = this._insertDirectives(cssText);\n            var scopedCssText = this._scopeCssText(cssText, selector, hostSelector);\n            return __spreadArray([scopedCssText], __read(commentsWithHash)).join('\\n');\n        };\n        ShadowCss.prototype._insertDirectives = function (cssText) {\n            cssText = this._insertPolyfillDirectivesInCssText(cssText);\n            return this._insertPolyfillRulesInCssText(cssText);\n        };\n        /*\n         * Process styles to convert native ShadowDOM rules that will trip\n         * up the css parser; we rely on decorating the stylesheet with inert rules.\n         *\n         * For example, we convert this rule:\n         *\n         * polyfill-next-selector { content: ':host menu-item'; }\n         * ::content menu-item {\n         *\n         * to this:\n         *\n         * scopeName menu-item {\n         *\n         **/\n        ShadowCss.prototype._insertPolyfillDirectivesInCssText = function (cssText) {\n            // Difference with webcomponents.js: does not handle comments\n            return cssText.replace(_cssContentNextSelectorRe, function () {\n                var m = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    m[_i] = arguments[_i];\n                }\n                return m[2] + '{';\n            });\n        };\n        /*\n         * Process styles to add rules which will only apply under the polyfill\n         *\n         * For example, we convert this rule:\n         *\n         * polyfill-rule {\n         *   content: ':host menu-item';\n         * ...\n         * }\n         *\n         * to this:\n         *\n         * scopeName menu-item {...}\n         *\n         **/\n        ShadowCss.prototype._insertPolyfillRulesInCssText = function (cssText) {\n            // Difference with webcomponents.js: does not handle comments\n            return cssText.replace(_cssContentRuleRe, function () {\n                var m = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    m[_i] = arguments[_i];\n                }\n                var rule = m[0].replace(m[1], '').replace(m[2], '');\n                return m[4] + rule;\n            });\n        };\n        /* Ensure styles are scoped. Pseudo-scoping takes a rule like:\n         *\n         *  .foo {... }\n         *\n         *  and converts this to\n         *\n         *  scopeName .foo { ... }\n         */\n        ShadowCss.prototype._scopeCssText = function (cssText, scopeSelector, hostSelector) {\n            var unscopedRules = this._extractUnscopedRulesFromCssText(cssText);\n            // replace :host and :host-context -shadowcsshost and -shadowcsshost respectively\n            cssText = this._insertPolyfillHostInCssText(cssText);\n            cssText = this._convertColonHost(cssText);\n            cssText = this._convertColonHostContext(cssText);\n            cssText = this._convertShadowDOMSelectors(cssText);\n            if (scopeSelector) {\n                cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);\n            }\n            cssText = cssText + '\\n' + unscopedRules;\n            return cssText.trim();\n        };\n        /*\n         * Process styles to add rules which will only apply under the polyfill\n         * and do not process via CSSOM. (CSSOM is destructive to rules on rare\n         * occasions, e.g. -webkit-calc on Safari.)\n         * For example, we convert this rule:\n         *\n         * @polyfill-unscoped-rule {\n         *   content: 'menu-item';\n         * ... }\n         *\n         * to this:\n         *\n         * menu-item {...}\n         *\n         **/\n        ShadowCss.prototype._extractUnscopedRulesFromCssText = function (cssText) {\n            // Difference with webcomponents.js: does not handle comments\n            var r = '';\n            var m;\n            _cssContentUnscopedRuleRe.lastIndex = 0;\n            while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {\n                var rule = m[0].replace(m[2], '').replace(m[1], m[4]);\n                r += rule + '\\n\\n';\n            }\n            return r;\n        };\n        /*\n         * convert a rule like :host(.foo) > .bar { }\n         *\n         * to\n         *\n         * .foo<scopeName> > .bar\n         */\n        ShadowCss.prototype._convertColonHost = function (cssText) {\n            return cssText.replace(_cssColonHostRe, function (_, hostSelectors, otherSelectors) {\n                var e_1, _b;\n                if (hostSelectors) {\n                    var convertedSelectors = [];\n                    var hostSelectorArray = hostSelectors.split(',').map(function (p) { return p.trim(); });\n                    try {\n                        for (var hostSelectorArray_1 = __values(hostSelectorArray), hostSelectorArray_1_1 = hostSelectorArray_1.next(); !hostSelectorArray_1_1.done; hostSelectorArray_1_1 = hostSelectorArray_1.next()) {\n                            var hostSelector = hostSelectorArray_1_1.value;\n                            if (!hostSelector)\n                                break;\n                            var convertedSelector = _polyfillHostNoCombinator + hostSelector.replace(_polyfillHost, '') + otherSelectors;\n                            convertedSelectors.push(convertedSelector);\n                        }\n                    }\n                    catch (e_1_1) { e_1 = { error: e_1_1 }; }\n                    finally {\n                        try {\n                            if (hostSelectorArray_1_1 && !hostSelectorArray_1_1.done && (_b = hostSelectorArray_1.return)) _b.call(hostSelectorArray_1);\n                        }\n                        finally { if (e_1) throw e_1.error; }\n                    }\n                    return convertedSelectors.join(',');\n                }\n                else {\n                    return _polyfillHostNoCombinator + otherSelectors;\n                }\n            });\n        };\n        /*\n         * convert a rule like :host-context(.foo) > .bar { }\n         *\n         * to\n         *\n         * .foo<scopeName> > .bar, .foo <scopeName> > .bar { }\n         *\n         * and\n         *\n         * :host-context(.foo:host) .bar { ... }\n         *\n         * to\n         *\n         * .foo<scopeName> .bar { ... }\n         */\n        ShadowCss.prototype._convertColonHostContext = function (cssText) {\n            return cssText.replace(_cssColonHostContextReGlobal, function (selectorText) {\n                // We have captured a selector that contains a `:host-context` rule.\n                var _a;\n                // For backward compatibility `:host-context` may contain a comma separated list of selectors.\n                // Each context selector group will contain a list of host-context selectors that must match\n                // an ancestor of the host.\n                // (Normally `contextSelectorGroups` will only contain a single array of context selectors.)\n                var contextSelectorGroups = [[]];\n                // There may be more than `:host-context` in this selector so `selectorText` could look like:\n                // `:host-context(.one):host-context(.two)`.\n                // Execute `_cssColonHostContextRe` over and over until we have extracted all the\n                // `:host-context` selectors from this selector.\n                var match;\n                while (match = _cssColonHostContextRe.exec(selectorText)) {\n                    // `match` = [':host-context(<selectors>)<rest>', <selectors>, <rest>]\n                    // The `<selectors>` could actually be a comma separated list: `:host-context(.one, .two)`.\n                    var newContextSelectors = ((_a = match[1]) !== null && _a !== void 0 ? _a : '').trim().split(',').map(function (m) { return m.trim(); }).filter(function (m) { return m !== ''; });\n                    // We must duplicate the current selector group for each of these new selectors.\n                    // For example if the current groups are:\n                    // ```\n                    // [\n                    //   ['a', 'b', 'c'],\n                    //   ['x', 'y', 'z'],\n                    // ]\n                    // ```\n                    // And we have a new set of comma separated selectors: `:host-context(m,n)` then the new\n                    // groups are:\n                    // ```\n                    // [\n                    //   ['a', 'b', 'c', 'm'],\n                    //   ['x', 'y', 'z', 'm'],\n                    //   ['a', 'b', 'c', 'n'],\n                    //   ['x', 'y', 'z', 'n'],\n                    // ]\n                    // ```\n                    var contextSelectorGroupsLength = contextSelectorGroups.length;\n                    repeatGroups(contextSelectorGroups, newContextSelectors.length);\n                    for (var i = 0; i < newContextSelectors.length; i++) {\n                        for (var j = 0; j < contextSelectorGroupsLength; j++) {\n                            contextSelectorGroups[j + (i * contextSelectorGroupsLength)].push(newContextSelectors[i]);\n                        }\n                    }\n                    // Update the `selectorText` and see repeat to see if there are more `:host-context`s.\n                    selectorText = match[2];\n                }\n                // The context selectors now must be combined with each other to capture all the possible\n                // selectors that `:host-context` can match. See `combineHostContextSelectors()` for more\n                // info about how this is done.\n                return contextSelectorGroups\n                    .map(function (contextSelectors) { return combineHostContextSelectors(contextSelectors, selectorText); })\n                    .join(', ');\n            });\n        };\n        /*\n         * Convert combinators like ::shadow and pseudo-elements like ::content\n         * by replacing with space.\n         */\n        ShadowCss.prototype._convertShadowDOMSelectors = function (cssText) {\n            return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText);\n        };\n        // change a selector like 'div' to 'name div'\n        ShadowCss.prototype._scopeSelectors = function (cssText, scopeSelector, hostSelector) {\n            var _this = this;\n            return processRules(cssText, function (rule) {\n                var selector = rule.selector;\n                var content = rule.content;\n                if (rule.selector[0] !== '@') {\n                    selector =\n                        _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling);\n                }\n                else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n                    rule.selector.startsWith('@document')) {\n                    content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n                }\n                else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {\n                    content = _this._stripScopingSelectors(rule.content);\n                }\n                return new CssRule(selector, content);\n            });\n        };\n        /**\n         * Handle a css text that is within a rule that should not contain scope selectors by simply\n         * removing them! An example of such a rule is `@font-face`.\n         *\n         * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector.\n         * Normally this would be a syntax error by the author of the styles. But in some rare cases, such\n         * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we\n         * can end up with broken css if the imported styles happen to contain @font-face rules.\n         *\n         * For example:\n         *\n         * ```\n         * :host ::ng-deep {\n         *   import 'some/lib/containing/font-face';\n         * }\n         *\n         * Similar logic applies to `@page` rules which can contain a particular set of properties,\n         * as well as some specific at-rules. Since they can't be encapsulated, we have to strip\n         * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3\n         * ```\n         */\n        ShadowCss.prototype._stripScopingSelectors = function (cssText) {\n            return processRules(cssText, function (rule) {\n                var selector = rule.selector.replace(_shadowDeepSelectors, ' ')\n                    .replace(_polyfillHostNoCombinatorRe, ' ');\n                return new CssRule(selector, rule.content);\n            });\n        };\n        ShadowCss.prototype._scopeSelector = function (selector, scopeSelector, hostSelector, strict) {\n            var _this = this;\n            return selector.split(',')\n                .map(function (part) { return part.trim().split(_shadowDeepSelectors); })\n                .map(function (deepParts) {\n                var _b = __read(deepParts), shallowPart = _b[0], otherParts = _b.slice(1);\n                var applyScope = function (shallowPart) {\n                    if (_this._selectorNeedsScoping(shallowPart, scopeSelector)) {\n                        return strict ?\n                            _this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :\n                            _this._applySelectorScope(shallowPart, scopeSelector, hostSelector);\n                    }\n                    else {\n                        return shallowPart;\n                    }\n                };\n                return __spreadArray([applyScope(shallowPart)], __read(otherParts)).join(' ');\n            })\n                .join(', ');\n        };\n        ShadowCss.prototype._selectorNeedsScoping = function (selector, scopeSelector) {\n            var re = this._makeScopeMatcher(scopeSelector);\n            return !re.test(selector);\n        };\n        ShadowCss.prototype._makeScopeMatcher = function (scopeSelector) {\n            var lre = /\\[/g;\n            var rre = /\\]/g;\n            scopeSelector = scopeSelector.replace(lre, '\\\\[').replace(rre, '\\\\]');\n            return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');\n        };\n        ShadowCss.prototype._applySelectorScope = function (selector, scopeSelector, hostSelector) {\n            // Difference from webcomponents.js: scopeSelector could not be an array\n            return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);\n        };\n        // scope via name and [is=name]\n        ShadowCss.prototype._applySimpleSelectorScope = function (selector, scopeSelector, hostSelector) {\n            // In Android browser, the lastIndex is not reset when the regex is used in String.replace()\n            _polyfillHostRe.lastIndex = 0;\n            if (_polyfillHostRe.test(selector)) {\n                var replaceBy_1 = this.strictStyling ? \"[\" + hostSelector + \"]\" : scopeSelector;\n                return selector\n                    .replace(_polyfillHostNoCombinatorRe, function (hnc, selector) {\n                    return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) {\n                        return before + replaceBy_1 + colon + after;\n                    });\n                })\n                    .replace(_polyfillHostRe, replaceBy_1 + ' ');\n            }\n            return scopeSelector + ' ' + selector;\n        };\n        // return a selector with [name] suffix on each simple selector\n        // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name]  /** @internal */\n        ShadowCss.prototype._applyStrictSelectorScope = function (selector, scopeSelector, hostSelector) {\n            var _this = this;\n            var isRe = /\\[is=([^\\]]*)\\]/g;\n            scopeSelector = scopeSelector.replace(isRe, function (_) {\n                var parts = [];\n                for (var _i = 1; _i < arguments.length; _i++) {\n                    parts[_i - 1] = arguments[_i];\n                }\n                return parts[0];\n            });\n            var attrName = '[' + scopeSelector + ']';\n            var _scopeSelectorPart = function (p) {\n                var scopedP = p.trim();\n                if (!scopedP) {\n                    return '';\n                }\n                if (p.indexOf(_polyfillHostNoCombinator) > -1) {\n                    scopedP = _this._applySimpleSelectorScope(p, scopeSelector, hostSelector);\n                }\n                else {\n                    // remove :host since it should be unnecessary\n                    var t = p.replace(_polyfillHostRe, '');\n                    if (t.length > 0) {\n                        var matches = t.match(/([^:]*)(:*)(.*)/);\n                        if (matches) {\n                            scopedP = matches[1] + attrName + matches[2] + matches[3];\n                        }\n                    }\n                }\n                return scopedP;\n            };\n            var safeContent = new SafeSelector(selector);\n            selector = safeContent.content();\n            var scopedSelector = '';\n            var startIndex = 0;\n            var res;\n            var sep = /( |>|\\+|~(?!=))\\s*/g;\n            // If a selector appears before :host it should not be shimmed as it\n            // matches on ancestor elements and not on elements in the host's shadow\n            // `:host-context(div)` is transformed to\n            // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`\n            // the `div` is not part of the component in the 2nd selectors and should not be scoped.\n            // Historically `component-tag:host` was matching the component so we also want to preserve\n            // this behavior to avoid breaking legacy apps (it should not match).\n            // The behavior should be:\n            // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)\n            // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a\n            //   `:host-context(tag)`)\n            var hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;\n            // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present\n            var shouldScope = !hasHost;\n            while ((res = sep.exec(selector)) !== null) {\n                var separator = res[1];\n                var part_1 = selector.slice(startIndex, res.index).trim();\n                shouldScope = shouldScope || part_1.indexOf(_polyfillHostNoCombinator) > -1;\n                var scopedPart = shouldScope ? _scopeSelectorPart(part_1) : part_1;\n                scopedSelector += scopedPart + \" \" + separator + \" \";\n                startIndex = sep.lastIndex;\n            }\n            var part = selector.substring(startIndex);\n            shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;\n            scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;\n            // replace the placeholders with their original values\n            return safeContent.restore(scopedSelector);\n        };\n        ShadowCss.prototype._insertPolyfillHostInCssText = function (selector) {\n            return selector.replace(_colonHostContextRe, _polyfillHostContext)\n                .replace(_colonHostRe, _polyfillHost);\n        };\n        return ShadowCss;\n    }());\n    var SafeSelector = /** @class */ (function () {\n        function SafeSelector(selector) {\n            var _this = this;\n            this.placeholders = [];\n            this.index = 0;\n            // Replaces attribute selectors with placeholders.\n            // The WS in [attr=\"va lue\"] would otherwise be interpreted as a selector separator.\n            selector = this._escapeRegexMatches(selector, /(\\[[^\\]]*\\])/g);\n            // CSS allows for certain special characters to be used in selectors if they're escaped.\n            // E.g. `.foo:blue` won't match a class called `foo:blue`, because the colon denotes a\n            // pseudo-class, but writing `.foo\\:blue` will match, because the colon was escaped.\n            // Replace all escape sequences (`\\` followed by a character) with a placeholder so\n            // that our handling of pseudo-selectors doesn't mess with them.\n            selector = this._escapeRegexMatches(selector, /(\\\\.)/g);\n            // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.\n            // WS and \"+\" would otherwise be interpreted as selector separators.\n            this._content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, function (_, pseudo, exp) {\n                var replaceBy = \"__ph-\" + _this.index + \"__\";\n                _this.placeholders.push(exp);\n                _this.index++;\n                return pseudo + replaceBy;\n            });\n        }\n        SafeSelector.prototype.restore = function (content) {\n            var _this = this;\n            return content.replace(/__ph-(\\d+)__/g, function (_ph, index) { return _this.placeholders[+index]; });\n        };\n        SafeSelector.prototype.content = function () {\n            return this._content;\n        };\n        /**\n         * Replaces all of the substrings that match a regex within a\n         * special string (e.g. `__ph-0__`, `__ph-1__`, etc).\n         */\n        SafeSelector.prototype._escapeRegexMatches = function (content, pattern) {\n            var _this = this;\n            return content.replace(pattern, function (_, keep) {\n                var replaceBy = \"__ph-\" + _this.index + \"__\";\n                _this.placeholders.push(keep);\n                _this.index++;\n                return replaceBy;\n            });\n        };\n        return SafeSelector;\n    }());\n    var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\\s]*?(['\"])(.*?)\\1[;\\s]*}([^{]*?){/gim;\n    var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\n    var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\n    var _polyfillHost = '-shadowcsshost';\n    // note: :host-context pre-processed to -shadowcsshostcontext.\n    var _polyfillHostContext = '-shadowcsscontext';\n    var _parenSuffix = '(?:\\\\((' +\n        '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n        ')\\\\))?([^,{]*)';\n    var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix, 'gim');\n    var _cssColonHostContextReGlobal = new RegExp(_polyfillHostContext + _parenSuffix, 'gim');\n    var _cssColonHostContextRe = new RegExp(_polyfillHostContext + _parenSuffix, 'im');\n    var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';\n    var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s]*)/;\n    var _shadowDOMSelectorsRe = [\n        /::shadow/g,\n        /::content/g,\n        // Deprecated selectors\n        /\\/shadow-deep\\//g,\n        /\\/shadow\\//g,\n    ];\n    // The deep combinator is deprecated in the CSS spec\n    // Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future.\n    // see https://github.com/angular/angular/pull/17677\n    var _shadowDeepSelectors = /(?:>>>)|(?:\\/deep\\/)|(?:::ng-deep)/g;\n    var _selectorReSuffix = '([>\\\\s~+[.,{:][\\\\s\\\\S]*)?$';\n    var _polyfillHostRe = /-shadowcsshost/gim;\n    var _colonHostRe = /:host/gim;\n    var _colonHostContextRe = /:host-context/gim;\n    var _commentRe = /\\/\\*\\s*[\\s\\S]*?\\*\\//g;\n    function stripComments(input) {\n        return input.replace(_commentRe, '');\n    }\n    var _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=[\\s\\S]+?\\*\\//g;\n    function extractCommentsWithHash(input) {\n        return input.match(_commentWithHashRe) || [];\n    }\n    var BLOCK_PLACEHOLDER = '%BLOCK%';\n    var QUOTE_PLACEHOLDER = '%QUOTED%';\n    var _ruleRe = /(\\s*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))/g;\n    var _quotedRe = /%QUOTED%/g;\n    var CONTENT_PAIRS = new Map([['{', '}']]);\n    var QUOTE_PAIRS = new Map([[\"\\\"\", \"\\\"\"], [\"'\", \"'\"]]);\n    var CssRule = /** @class */ (function () {\n        function CssRule(selector, content) {\n            this.selector = selector;\n            this.content = content;\n        }\n        return CssRule;\n    }());\n    function processRules(input, ruleCallback) {\n        var inputWithEscapedQuotes = escapeBlocks(input, QUOTE_PAIRS, QUOTE_PLACEHOLDER);\n        var inputWithEscapedBlocks = escapeBlocks(inputWithEscapedQuotes.escapedString, CONTENT_PAIRS, BLOCK_PLACEHOLDER);\n        var nextBlockIndex = 0;\n        var nextQuoteIndex = 0;\n        return inputWithEscapedBlocks.escapedString\n            .replace(_ruleRe, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            var selector = m[2];\n            var content = '';\n            var suffix = m[4];\n            var contentPrefix = '';\n            if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {\n                content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n                suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n                contentPrefix = '{';\n            }\n            var rule = ruleCallback(new CssRule(selector, content));\n            return \"\" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix;\n        })\n            .replace(_quotedRe, function () { return inputWithEscapedQuotes.blocks[nextQuoteIndex++]; });\n    }\n    var StringWithEscapedBlocks = /** @class */ (function () {\n        function StringWithEscapedBlocks(escapedString, blocks) {\n            this.escapedString = escapedString;\n            this.blocks = blocks;\n        }\n        return StringWithEscapedBlocks;\n    }());\n    function escapeBlocks(input, charPairs, placeholder) {\n        var resultParts = [];\n        var escapedBlocks = [];\n        var openCharCount = 0;\n        var nonBlockStartIndex = 0;\n        var blockStartIndex = -1;\n        var openChar;\n        var closeChar;\n        for (var i = 0; i < input.length; i++) {\n            var char = input[i];\n            if (char === '\\\\') {\n                i++;\n            }\n            else if (char === closeChar) {\n                openCharCount--;\n                if (openCharCount === 0) {\n                    escapedBlocks.push(input.substring(blockStartIndex, i));\n                    resultParts.push(placeholder);\n                    nonBlockStartIndex = i;\n                    blockStartIndex = -1;\n                    openChar = closeChar = undefined;\n                }\n            }\n            else if (char === openChar) {\n                openCharCount++;\n            }\n            else if (openCharCount === 0 && charPairs.has(char)) {\n                openChar = char;\n                closeChar = charPairs.get(char);\n                openCharCount = 1;\n                blockStartIndex = i + 1;\n                resultParts.push(input.substring(nonBlockStartIndex, blockStartIndex));\n            }\n        }\n        if (blockStartIndex !== -1) {\n            escapedBlocks.push(input.substring(blockStartIndex));\n            resultParts.push(placeholder);\n        }\n        else {\n            resultParts.push(input.substring(nonBlockStartIndex));\n        }\n        return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);\n    }\n    /**\n     * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`\n     * to create a selector that matches the same as `:host-context()`.\n     *\n     * Given a single context selector `A` we need to output selectors that match on the host and as an\n     * ancestor of the host:\n     *\n     * ```\n     * A <hostMarker>, A<hostMarker> {}\n     * ```\n     *\n     * When there is more than one context selector we also have to create combinations of those\n     * selectors with each other. For example if there are `A` and `B` selectors the output is:\n     *\n     * ```\n     * AB<hostMarker>, AB <hostMarker>, A B<hostMarker>,\n     * B A<hostMarker>, A B <hostMarker>, B A <hostMarker> {}\n     * ```\n     *\n     * And so on...\n     *\n     * @param hostMarker the string that selects the host element.\n     * @param contextSelectors an array of context selectors that will be combined.\n     * @param otherSelectors the rest of the selectors that are not context selectors.\n     */\n    function combineHostContextSelectors(contextSelectors, otherSelectors) {\n        var hostMarker = _polyfillHostNoCombinator;\n        _polyfillHostRe.lastIndex = 0; // reset the regex to ensure we get an accurate test\n        var otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);\n        // If there are no context selectors then just output a host marker\n        if (contextSelectors.length === 0) {\n            return hostMarker + otherSelectors;\n        }\n        var combined = [contextSelectors.pop() || ''];\n        while (contextSelectors.length > 0) {\n            var length = combined.length;\n            var contextSelector = contextSelectors.pop();\n            for (var i = 0; i < length; i++) {\n                var previousSelectors = combined[i];\n                // Add the new selector as a descendant of the previous selectors\n                combined[length * 2 + i] = previousSelectors + ' ' + contextSelector;\n                // Add the new selector as an ancestor of the previous selectors\n                combined[length + i] = contextSelector + ' ' + previousSelectors;\n                // Add the new selector to act on the same element as the previous selectors\n                combined[i] = contextSelector + previousSelectors;\n            }\n        }\n        // Finally connect the selector to the `hostMarker`s: either acting directly on the host\n        // (A<hostMarker>) or as an ancestor (A <hostMarker>).\n        return combined\n            .map(function (s) { return otherSelectorsHasHost ?\n            \"\" + s + otherSelectors :\n            \"\" + s + hostMarker + otherSelectors + \", \" + s + \" \" + hostMarker + otherSelectors; })\n            .join(',');\n    }\n    /**\n     * Mutate the given `groups` array so that there are `multiples` clones of the original array\n     * stored.\n     *\n     * For example `repeatGroups([a, b], 3)` will result in `[a, b, a, b, a, b]` - but importantly the\n     * newly added groups will be clones of the original.\n     *\n     * @param groups An array of groups of strings that will be repeated. This array is mutated\n     *     in-place.\n     * @param multiples The number of times the current groups should appear.\n     */\n    function repeatGroups(groups, multiples) {\n        var length = groups.length;\n        for (var i = 1; i < multiples; i++) {\n            for (var j = 0; j < length; j++) {\n                groups[j + (i * length)] = groups[j].slice(0);\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var COMPONENT_VARIABLE = '%COMP%';\n    var HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\n    var CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\n    var StylesCompileDependency = /** @class */ (function () {\n        function StylesCompileDependency(name, moduleUrl, setValue) {\n            this.name = name;\n            this.moduleUrl = moduleUrl;\n            this.setValue = setValue;\n        }\n        return StylesCompileDependency;\n    }());\n    var CompiledStylesheet = /** @class */ (function () {\n        function CompiledStylesheet(outputCtx, stylesVar, dependencies, isShimmed, meta) {\n            this.outputCtx = outputCtx;\n            this.stylesVar = stylesVar;\n            this.dependencies = dependencies;\n            this.isShimmed = isShimmed;\n            this.meta = meta;\n        }\n        return CompiledStylesheet;\n    }());\n    var StyleCompiler = /** @class */ (function () {\n        function StyleCompiler(_urlResolver) {\n            this._urlResolver = _urlResolver;\n            this._shadowCss = new ShadowCss();\n        }\n        StyleCompiler.prototype.compileComponent = function (outputCtx, comp) {\n            var template = comp.template;\n            return this._compileStyles(outputCtx, comp, new CompileStylesheetMetadata({\n                styles: template.styles,\n                styleUrls: template.styleUrls,\n                moduleUrl: identifierModuleUrl(comp.type)\n            }), this.needsStyleShim(comp), true);\n        };\n        StyleCompiler.prototype.compileStyles = function (outputCtx, comp, stylesheet, shim) {\n            if (shim === void 0) { shim = this.needsStyleShim(comp); }\n            return this._compileStyles(outputCtx, comp, stylesheet, shim, false);\n        };\n        StyleCompiler.prototype.needsStyleShim = function (comp) {\n            return comp.template.encapsulation === ViewEncapsulation.Emulated;\n        };\n        StyleCompiler.prototype._compileStyles = function (outputCtx, comp, stylesheet, shim, isComponentStylesheet) {\n            var _this = this;\n            var styleExpressions = stylesheet.styles.map(function (plainStyle) { return literal(_this._shimIfNeeded(plainStyle, shim)); });\n            var dependencies = [];\n            stylesheet.styleUrls.forEach(function (styleUrl) {\n                var exprIndex = styleExpressions.length;\n                // Note: This placeholder will be filled later.\n                styleExpressions.push(null);\n                dependencies.push(new StylesCompileDependency(getStylesVarName(null), styleUrl, function (value) { return styleExpressions[exprIndex] = outputCtx.importExpr(value); }));\n            });\n            // styles variable contains plain strings and arrays of other styles arrays (recursive),\n            // so we set its type to dynamic.\n            var stylesVar = getStylesVarName(isComponentStylesheet ? comp : null);\n            var stmt = variable(stylesVar)\n                .set(literalArr(styleExpressions, new ArrayType(DYNAMIC_TYPE, [TypeModifier.Const])))\n                .toDeclStmt(null, isComponentStylesheet ? [exports.StmtModifier.Final] : [\n                exports.StmtModifier.Final, exports.StmtModifier.Exported\n            ]);\n            outputCtx.statements.push(stmt);\n            return new CompiledStylesheet(outputCtx, stylesVar, dependencies, shim, stylesheet);\n        };\n        StyleCompiler.prototype._shimIfNeeded = function (style, shim) {\n            return shim ? this._shadowCss.shimCssText(style, CONTENT_ATTR, HOST_ATTR) : style;\n        };\n        return StyleCompiler;\n    }());\n    function getStylesVarName(component) {\n        var result = \"styles\";\n        if (component) {\n            result += \"_\" + identifierName(component.type);\n        }\n        return result;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A path is an ordered set of elements. Typically a path is to  a\n     * particular offset in a source file. The head of the list is the top\n     * most node. The tail is the node that contains the offset directly.\n     *\n     * For example, the expression `a + b + c` might have an ast that looks\n     * like:\n     *     +\n     *    / \\\n     *   a   +\n     *      / \\\n     *     b   c\n     *\n     * The path to the node at offset 9 would be `['+' at 1-10, '+' at 7-10,\n     * 'c' at 9-10]` and the path the node at offset 1 would be\n     * `['+' at 1-10, 'a' at 1-2]`.\n     */\n    var AstPath = /** @class */ (function () {\n        function AstPath(path, position) {\n            if (position === void 0) { position = -1; }\n            this.path = path;\n            this.position = position;\n        }\n        Object.defineProperty(AstPath.prototype, \"empty\", {\n            get: function () {\n                return !this.path || !this.path.length;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(AstPath.prototype, \"head\", {\n            get: function () {\n                return this.path[0];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(AstPath.prototype, \"tail\", {\n            get: function () {\n                return this.path[this.path.length - 1];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        AstPath.prototype.parentOf = function (node) {\n            return node && this.path[this.path.indexOf(node) - 1];\n        };\n        AstPath.prototype.childOf = function (node) {\n            return this.path[this.path.indexOf(node) + 1];\n        };\n        AstPath.prototype.first = function (ctor) {\n            for (var i = this.path.length - 1; i >= 0; i--) {\n                var item = this.path[i];\n                if (item instanceof ctor)\n                    return item;\n            }\n        };\n        AstPath.prototype.push = function (node) {\n            this.path.push(node);\n        };\n        AstPath.prototype.pop = function () {\n            return this.path.pop();\n        };\n        return AstPath;\n    }());\n\n    var NodeWithI18n = /** @class */ (function () {\n        function NodeWithI18n(sourceSpan, i18n) {\n            this.sourceSpan = sourceSpan;\n            this.i18n = i18n;\n        }\n        return NodeWithI18n;\n    }());\n    var Text$3 = /** @class */ (function (_super) {\n        __extends(Text, _super);\n        function Text(value, sourceSpan, i18n) {\n            var _this = _super.call(this, sourceSpan, i18n) || this;\n            _this.value = value;\n            return _this;\n        }\n        Text.prototype.visit = function (visitor, context) {\n            return visitor.visitText(this, context);\n        };\n        return Text;\n    }(NodeWithI18n));\n    var Expansion = /** @class */ (function (_super) {\n        __extends(Expansion, _super);\n        function Expansion(switchValue, type, cases, sourceSpan, switchValueSourceSpan, i18n) {\n            var _this = _super.call(this, sourceSpan, i18n) || this;\n            _this.switchValue = switchValue;\n            _this.type = type;\n            _this.cases = cases;\n            _this.switchValueSourceSpan = switchValueSourceSpan;\n            return _this;\n        }\n        Expansion.prototype.visit = function (visitor, context) {\n            return visitor.visitExpansion(this, context);\n        };\n        return Expansion;\n    }(NodeWithI18n));\n    var ExpansionCase = /** @class */ (function () {\n        function ExpansionCase(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {\n            this.value = value;\n            this.expression = expression;\n            this.sourceSpan = sourceSpan;\n            this.valueSourceSpan = valueSourceSpan;\n            this.expSourceSpan = expSourceSpan;\n        }\n        ExpansionCase.prototype.visit = function (visitor, context) {\n            return visitor.visitExpansionCase(this, context);\n        };\n        return ExpansionCase;\n    }());\n    var Attribute = /** @class */ (function (_super) {\n        __extends(Attribute, _super);\n        function Attribute(name, value, sourceSpan, keySpan, valueSpan, i18n) {\n            var _this = _super.call(this, sourceSpan, i18n) || this;\n            _this.name = name;\n            _this.value = value;\n            _this.keySpan = keySpan;\n            _this.valueSpan = valueSpan;\n            return _this;\n        }\n        Attribute.prototype.visit = function (visitor, context) {\n            return visitor.visitAttribute(this, context);\n        };\n        return Attribute;\n    }(NodeWithI18n));\n    var Element$1 = /** @class */ (function (_super) {\n        __extends(Element, _super);\n        function Element(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n            if (endSourceSpan === void 0) { endSourceSpan = null; }\n            var _this = _super.call(this, sourceSpan, i18n) || this;\n            _this.name = name;\n            _this.attrs = attrs;\n            _this.children = children;\n            _this.startSourceSpan = startSourceSpan;\n            _this.endSourceSpan = endSourceSpan;\n            return _this;\n        }\n        Element.prototype.visit = function (visitor, context) {\n            return visitor.visitElement(this, context);\n        };\n        return Element;\n    }(NodeWithI18n));\n    var Comment$1 = /** @class */ (function () {\n        function Comment(value, sourceSpan) {\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        Comment.prototype.visit = function (visitor, context) {\n            return visitor.visitComment(this, context);\n        };\n        return Comment;\n    }());\n    function visitAll$1(visitor, nodes, context) {\n        if (context === void 0) { context = null; }\n        var result = [];\n        var visit = visitor.visit ?\n            function (ast) { return visitor.visit(ast, context) || ast.visit(visitor, context); } :\n            function (ast) { return ast.visit(visitor, context); };\n        nodes.forEach(function (ast) {\n            var astResult = visit(ast);\n            if (astResult) {\n                result.push(astResult);\n            }\n        });\n        return result;\n    }\n    var RecursiveVisitor$1 = /** @class */ (function () {\n        function RecursiveVisitor() {\n        }\n        RecursiveVisitor.prototype.visitElement = function (ast, context) {\n            this.visitChildren(context, function (visit) {\n                visit(ast.attrs);\n                visit(ast.children);\n            });\n        };\n        RecursiveVisitor.prototype.visitAttribute = function (ast, context) { };\n        RecursiveVisitor.prototype.visitText = function (ast, context) { };\n        RecursiveVisitor.prototype.visitComment = function (ast, context) { };\n        RecursiveVisitor.prototype.visitExpansion = function (ast, context) {\n            return this.visitChildren(context, function (visit) {\n                visit(ast.cases);\n            });\n        };\n        RecursiveVisitor.prototype.visitExpansionCase = function (ast, context) { };\n        RecursiveVisitor.prototype.visitChildren = function (context, cb) {\n            var results = [];\n            var t = this;\n            function visit(children) {\n                if (children)\n                    results.push(visitAll$1(t, children, context));\n            }\n            cb(visit);\n            return Array.prototype.concat.apply([], results);\n        };\n        return RecursiveVisitor;\n    }());\n    function spanOf(ast) {\n        var start = ast.sourceSpan.start.offset;\n        var end = ast.sourceSpan.end.offset;\n        if (ast instanceof Element$1) {\n            if (ast.endSourceSpan) {\n                end = ast.endSourceSpan.end.offset;\n            }\n            else if (ast.children && ast.children.length) {\n                end = spanOf(ast.children[ast.children.length - 1]).end;\n            }\n        }\n        return { start: start, end: end };\n    }\n    function findNode(nodes, position) {\n        var path = [];\n        var visitor = new /** @class */ (function (_super) {\n            __extends(class_1, _super);\n            function class_1() {\n                return _super !== null && _super.apply(this, arguments) || this;\n            }\n            class_1.prototype.visit = function (ast, context) {\n                var span = spanOf(ast);\n                if (span.start <= position && position < span.end) {\n                    path.push(ast);\n                }\n                else {\n                    // Returning a value here will result in the children being skipped.\n                    return true;\n                }\n            };\n            return class_1;\n        }(RecursiveVisitor$1));\n        visitAll$1(visitor, nodes);\n        return new AstPath(path, position);\n    }\n\n    /**\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://angular.io/license\n     */\n    // Mapping between all HTML entity names and their unicode representation.\n    // Generated from https://html.spec.whatwg.org/multipage/entities.json by stripping\n    // the `&` and `;` from the keys and removing the duplicates.\n    // see https://www.w3.org/TR/html51/syntax.html#named-character-references\n    var NAMED_ENTITIES = {\n        'AElig': '\\u00C6',\n        'AMP': '\\u0026',\n        'amp': '\\u0026',\n        'Aacute': '\\u00C1',\n        'Abreve': '\\u0102',\n        'Acirc': '\\u00C2',\n        'Acy': '\\u0410',\n        'Afr': '\\uD835\\uDD04',\n        'Agrave': '\\u00C0',\n        'Alpha': '\\u0391',\n        'Amacr': '\\u0100',\n        'And': '\\u2A53',\n        'Aogon': '\\u0104',\n        'Aopf': '\\uD835\\uDD38',\n        'ApplyFunction': '\\u2061',\n        'af': '\\u2061',\n        'Aring': '\\u00C5',\n        'angst': '\\u00C5',\n        'Ascr': '\\uD835\\uDC9C',\n        'Assign': '\\u2254',\n        'colone': '\\u2254',\n        'coloneq': '\\u2254',\n        'Atilde': '\\u00C3',\n        'Auml': '\\u00C4',\n        'Backslash': '\\u2216',\n        'setminus': '\\u2216',\n        'setmn': '\\u2216',\n        'smallsetminus': '\\u2216',\n        'ssetmn': '\\u2216',\n        'Barv': '\\u2AE7',\n        'Barwed': '\\u2306',\n        'doublebarwedge': '\\u2306',\n        'Bcy': '\\u0411',\n        'Because': '\\u2235',\n        'becaus': '\\u2235',\n        'because': '\\u2235',\n        'Bernoullis': '\\u212C',\n        'Bscr': '\\u212C',\n        'bernou': '\\u212C',\n        'Beta': '\\u0392',\n        'Bfr': '\\uD835\\uDD05',\n        'Bopf': '\\uD835\\uDD39',\n        'Breve': '\\u02D8',\n        'breve': '\\u02D8',\n        'Bumpeq': '\\u224E',\n        'HumpDownHump': '\\u224E',\n        'bump': '\\u224E',\n        'CHcy': '\\u0427',\n        'COPY': '\\u00A9',\n        'copy': '\\u00A9',\n        'Cacute': '\\u0106',\n        'Cap': '\\u22D2',\n        'CapitalDifferentialD': '\\u2145',\n        'DD': '\\u2145',\n        'Cayleys': '\\u212D',\n        'Cfr': '\\u212D',\n        'Ccaron': '\\u010C',\n        'Ccedil': '\\u00C7',\n        'Ccirc': '\\u0108',\n        'Cconint': '\\u2230',\n        'Cdot': '\\u010A',\n        'Cedilla': '\\u00B8',\n        'cedil': '\\u00B8',\n        'CenterDot': '\\u00B7',\n        'centerdot': '\\u00B7',\n        'middot': '\\u00B7',\n        'Chi': '\\u03A7',\n        'CircleDot': '\\u2299',\n        'odot': '\\u2299',\n        'CircleMinus': '\\u2296',\n        'ominus': '\\u2296',\n        'CirclePlus': '\\u2295',\n        'oplus': '\\u2295',\n        'CircleTimes': '\\u2297',\n        'otimes': '\\u2297',\n        'ClockwiseContourIntegral': '\\u2232',\n        'cwconint': '\\u2232',\n        'CloseCurlyDoubleQuote': '\\u201D',\n        'rdquo': '\\u201D',\n        'rdquor': '\\u201D',\n        'CloseCurlyQuote': '\\u2019',\n        'rsquo': '\\u2019',\n        'rsquor': '\\u2019',\n        'Colon': '\\u2237',\n        'Proportion': '\\u2237',\n        'Colone': '\\u2A74',\n        'Congruent': '\\u2261',\n        'equiv': '\\u2261',\n        'Conint': '\\u222F',\n        'DoubleContourIntegral': '\\u222F',\n        'ContourIntegral': '\\u222E',\n        'conint': '\\u222E',\n        'oint': '\\u222E',\n        'Copf': '\\u2102',\n        'complexes': '\\u2102',\n        'Coproduct': '\\u2210',\n        'coprod': '\\u2210',\n        'CounterClockwiseContourIntegral': '\\u2233',\n        'awconint': '\\u2233',\n        'Cross': '\\u2A2F',\n        'Cscr': '\\uD835\\uDC9E',\n        'Cup': '\\u22D3',\n        'CupCap': '\\u224D',\n        'asympeq': '\\u224D',\n        'DDotrahd': '\\u2911',\n        'DJcy': '\\u0402',\n        'DScy': '\\u0405',\n        'DZcy': '\\u040F',\n        'Dagger': '\\u2021',\n        'ddagger': '\\u2021',\n        'Darr': '\\u21A1',\n        'Dashv': '\\u2AE4',\n        'DoubleLeftTee': '\\u2AE4',\n        'Dcaron': '\\u010E',\n        'Dcy': '\\u0414',\n        'Del': '\\u2207',\n        'nabla': '\\u2207',\n        'Delta': '\\u0394',\n        'Dfr': '\\uD835\\uDD07',\n        'DiacriticalAcute': '\\u00B4',\n        'acute': '\\u00B4',\n        'DiacriticalDot': '\\u02D9',\n        'dot': '\\u02D9',\n        'DiacriticalDoubleAcute': '\\u02DD',\n        'dblac': '\\u02DD',\n        'DiacriticalGrave': '\\u0060',\n        'grave': '\\u0060',\n        'DiacriticalTilde': '\\u02DC',\n        'tilde': '\\u02DC',\n        'Diamond': '\\u22C4',\n        'diam': '\\u22C4',\n        'diamond': '\\u22C4',\n        'DifferentialD': '\\u2146',\n        'dd': '\\u2146',\n        'Dopf': '\\uD835\\uDD3B',\n        'Dot': '\\u00A8',\n        'DoubleDot': '\\u00A8',\n        'die': '\\u00A8',\n        'uml': '\\u00A8',\n        'DotDot': '\\u20DC',\n        'DotEqual': '\\u2250',\n        'doteq': '\\u2250',\n        'esdot': '\\u2250',\n        'DoubleDownArrow': '\\u21D3',\n        'Downarrow': '\\u21D3',\n        'dArr': '\\u21D3',\n        'DoubleLeftArrow': '\\u21D0',\n        'Leftarrow': '\\u21D0',\n        'lArr': '\\u21D0',\n        'DoubleLeftRightArrow': '\\u21D4',\n        'Leftrightarrow': '\\u21D4',\n        'hArr': '\\u21D4',\n        'iff': '\\u21D4',\n        'DoubleLongLeftArrow': '\\u27F8',\n        'Longleftarrow': '\\u27F8',\n        'xlArr': '\\u27F8',\n        'DoubleLongLeftRightArrow': '\\u27FA',\n        'Longleftrightarrow': '\\u27FA',\n        'xhArr': '\\u27FA',\n        'DoubleLongRightArrow': '\\u27F9',\n        'Longrightarrow': '\\u27F9',\n        'xrArr': '\\u27F9',\n        'DoubleRightArrow': '\\u21D2',\n        'Implies': '\\u21D2',\n        'Rightarrow': '\\u21D2',\n        'rArr': '\\u21D2',\n        'DoubleRightTee': '\\u22A8',\n        'vDash': '\\u22A8',\n        'DoubleUpArrow': '\\u21D1',\n        'Uparrow': '\\u21D1',\n        'uArr': '\\u21D1',\n        'DoubleUpDownArrow': '\\u21D5',\n        'Updownarrow': '\\u21D5',\n        'vArr': '\\u21D5',\n        'DoubleVerticalBar': '\\u2225',\n        'par': '\\u2225',\n        'parallel': '\\u2225',\n        'shortparallel': '\\u2225',\n        'spar': '\\u2225',\n        'DownArrow': '\\u2193',\n        'ShortDownArrow': '\\u2193',\n        'darr': '\\u2193',\n        'downarrow': '\\u2193',\n        'DownArrowBar': '\\u2913',\n        'DownArrowUpArrow': '\\u21F5',\n        'duarr': '\\u21F5',\n        'DownBreve': '\\u0311',\n        'DownLeftRightVector': '\\u2950',\n        'DownLeftTeeVector': '\\u295E',\n        'DownLeftVector': '\\u21BD',\n        'leftharpoondown': '\\u21BD',\n        'lhard': '\\u21BD',\n        'DownLeftVectorBar': '\\u2956',\n        'DownRightTeeVector': '\\u295F',\n        'DownRightVector': '\\u21C1',\n        'rhard': '\\u21C1',\n        'rightharpoondown': '\\u21C1',\n        'DownRightVectorBar': '\\u2957',\n        'DownTee': '\\u22A4',\n        'top': '\\u22A4',\n        'DownTeeArrow': '\\u21A7',\n        'mapstodown': '\\u21A7',\n        'Dscr': '\\uD835\\uDC9F',\n        'Dstrok': '\\u0110',\n        'ENG': '\\u014A',\n        'ETH': '\\u00D0',\n        'Eacute': '\\u00C9',\n        'Ecaron': '\\u011A',\n        'Ecirc': '\\u00CA',\n        'Ecy': '\\u042D',\n        'Edot': '\\u0116',\n        'Efr': '\\uD835\\uDD08',\n        'Egrave': '\\u00C8',\n        'Element': '\\u2208',\n        'in': '\\u2208',\n        'isin': '\\u2208',\n        'isinv': '\\u2208',\n        'Emacr': '\\u0112',\n        'EmptySmallSquare': '\\u25FB',\n        'EmptyVerySmallSquare': '\\u25AB',\n        'Eogon': '\\u0118',\n        'Eopf': '\\uD835\\uDD3C',\n        'Epsilon': '\\u0395',\n        'Equal': '\\u2A75',\n        'EqualTilde': '\\u2242',\n        'eqsim': '\\u2242',\n        'esim': '\\u2242',\n        'Equilibrium': '\\u21CC',\n        'rightleftharpoons': '\\u21CC',\n        'rlhar': '\\u21CC',\n        'Escr': '\\u2130',\n        'expectation': '\\u2130',\n        'Esim': '\\u2A73',\n        'Eta': '\\u0397',\n        'Euml': '\\u00CB',\n        'Exists': '\\u2203',\n        'exist': '\\u2203',\n        'ExponentialE': '\\u2147',\n        'ee': '\\u2147',\n        'exponentiale': '\\u2147',\n        'Fcy': '\\u0424',\n        'Ffr': '\\uD835\\uDD09',\n        'FilledSmallSquare': '\\u25FC',\n        'FilledVerySmallSquare': '\\u25AA',\n        'blacksquare': '\\u25AA',\n        'squarf': '\\u25AA',\n        'squf': '\\u25AA',\n        'Fopf': '\\uD835\\uDD3D',\n        'ForAll': '\\u2200',\n        'forall': '\\u2200',\n        'Fouriertrf': '\\u2131',\n        'Fscr': '\\u2131',\n        'GJcy': '\\u0403',\n        'GT': '\\u003E',\n        'gt': '\\u003E',\n        'Gamma': '\\u0393',\n        'Gammad': '\\u03DC',\n        'Gbreve': '\\u011E',\n        'Gcedil': '\\u0122',\n        'Gcirc': '\\u011C',\n        'Gcy': '\\u0413',\n        'Gdot': '\\u0120',\n        'Gfr': '\\uD835\\uDD0A',\n        'Gg': '\\u22D9',\n        'ggg': '\\u22D9',\n        'Gopf': '\\uD835\\uDD3E',\n        'GreaterEqual': '\\u2265',\n        'ge': '\\u2265',\n        'geq': '\\u2265',\n        'GreaterEqualLess': '\\u22DB',\n        'gel': '\\u22DB',\n        'gtreqless': '\\u22DB',\n        'GreaterFullEqual': '\\u2267',\n        'gE': '\\u2267',\n        'geqq': '\\u2267',\n        'GreaterGreater': '\\u2AA2',\n        'GreaterLess': '\\u2277',\n        'gl': '\\u2277',\n        'gtrless': '\\u2277',\n        'GreaterSlantEqual': '\\u2A7E',\n        'geqslant': '\\u2A7E',\n        'ges': '\\u2A7E',\n        'GreaterTilde': '\\u2273',\n        'gsim': '\\u2273',\n        'gtrsim': '\\u2273',\n        'Gscr': '\\uD835\\uDCA2',\n        'Gt': '\\u226B',\n        'NestedGreaterGreater': '\\u226B',\n        'gg': '\\u226B',\n        'HARDcy': '\\u042A',\n        'Hacek': '\\u02C7',\n        'caron': '\\u02C7',\n        'Hat': '\\u005E',\n        'Hcirc': '\\u0124',\n        'Hfr': '\\u210C',\n        'Poincareplane': '\\u210C',\n        'HilbertSpace': '\\u210B',\n        'Hscr': '\\u210B',\n        'hamilt': '\\u210B',\n        'Hopf': '\\u210D',\n        'quaternions': '\\u210D',\n        'HorizontalLine': '\\u2500',\n        'boxh': '\\u2500',\n        'Hstrok': '\\u0126',\n        'HumpEqual': '\\u224F',\n        'bumpe': '\\u224F',\n        'bumpeq': '\\u224F',\n        'IEcy': '\\u0415',\n        'IJlig': '\\u0132',\n        'IOcy': '\\u0401',\n        'Iacute': '\\u00CD',\n        'Icirc': '\\u00CE',\n        'Icy': '\\u0418',\n        'Idot': '\\u0130',\n        'Ifr': '\\u2111',\n        'Im': '\\u2111',\n        'image': '\\u2111',\n        'imagpart': '\\u2111',\n        'Igrave': '\\u00CC',\n        'Imacr': '\\u012A',\n        'ImaginaryI': '\\u2148',\n        'ii': '\\u2148',\n        'Int': '\\u222C',\n        'Integral': '\\u222B',\n        'int': '\\u222B',\n        'Intersection': '\\u22C2',\n        'bigcap': '\\u22C2',\n        'xcap': '\\u22C2',\n        'InvisibleComma': '\\u2063',\n        'ic': '\\u2063',\n        'InvisibleTimes': '\\u2062',\n        'it': '\\u2062',\n        'Iogon': '\\u012E',\n        'Iopf': '\\uD835\\uDD40',\n        'Iota': '\\u0399',\n        'Iscr': '\\u2110',\n        'imagline': '\\u2110',\n        'Itilde': '\\u0128',\n        'Iukcy': '\\u0406',\n        'Iuml': '\\u00CF',\n        'Jcirc': '\\u0134',\n        'Jcy': '\\u0419',\n        'Jfr': '\\uD835\\uDD0D',\n        'Jopf': '\\uD835\\uDD41',\n        'Jscr': '\\uD835\\uDCA5',\n        'Jsercy': '\\u0408',\n        'Jukcy': '\\u0404',\n        'KHcy': '\\u0425',\n        'KJcy': '\\u040C',\n        'Kappa': '\\u039A',\n        'Kcedil': '\\u0136',\n        'Kcy': '\\u041A',\n        'Kfr': '\\uD835\\uDD0E',\n        'Kopf': '\\uD835\\uDD42',\n        'Kscr': '\\uD835\\uDCA6',\n        'LJcy': '\\u0409',\n        'LT': '\\u003C',\n        'lt': '\\u003C',\n        'Lacute': '\\u0139',\n        'Lambda': '\\u039B',\n        'Lang': '\\u27EA',\n        'Laplacetrf': '\\u2112',\n        'Lscr': '\\u2112',\n        'lagran': '\\u2112',\n        'Larr': '\\u219E',\n        'twoheadleftarrow': '\\u219E',\n        'Lcaron': '\\u013D',\n        'Lcedil': '\\u013B',\n        'Lcy': '\\u041B',\n        'LeftAngleBracket': '\\u27E8',\n        'lang': '\\u27E8',\n        'langle': '\\u27E8',\n        'LeftArrow': '\\u2190',\n        'ShortLeftArrow': '\\u2190',\n        'larr': '\\u2190',\n        'leftarrow': '\\u2190',\n        'slarr': '\\u2190',\n        'LeftArrowBar': '\\u21E4',\n        'larrb': '\\u21E4',\n        'LeftArrowRightArrow': '\\u21C6',\n        'leftrightarrows': '\\u21C6',\n        'lrarr': '\\u21C6',\n        'LeftCeiling': '\\u2308',\n        'lceil': '\\u2308',\n        'LeftDoubleBracket': '\\u27E6',\n        'lobrk': '\\u27E6',\n        'LeftDownTeeVector': '\\u2961',\n        'LeftDownVector': '\\u21C3',\n        'dharl': '\\u21C3',\n        'downharpoonleft': '\\u21C3',\n        'LeftDownVectorBar': '\\u2959',\n        'LeftFloor': '\\u230A',\n        'lfloor': '\\u230A',\n        'LeftRightArrow': '\\u2194',\n        'harr': '\\u2194',\n        'leftrightarrow': '\\u2194',\n        'LeftRightVector': '\\u294E',\n        'LeftTee': '\\u22A3',\n        'dashv': '\\u22A3',\n        'LeftTeeArrow': '\\u21A4',\n        'mapstoleft': '\\u21A4',\n        'LeftTeeVector': '\\u295A',\n        'LeftTriangle': '\\u22B2',\n        'vartriangleleft': '\\u22B2',\n        'vltri': '\\u22B2',\n        'LeftTriangleBar': '\\u29CF',\n        'LeftTriangleEqual': '\\u22B4',\n        'ltrie': '\\u22B4',\n        'trianglelefteq': '\\u22B4',\n        'LeftUpDownVector': '\\u2951',\n        'LeftUpTeeVector': '\\u2960',\n        'LeftUpVector': '\\u21BF',\n        'uharl': '\\u21BF',\n        'upharpoonleft': '\\u21BF',\n        'LeftUpVectorBar': '\\u2958',\n        'LeftVector': '\\u21BC',\n        'leftharpoonup': '\\u21BC',\n        'lharu': '\\u21BC',\n        'LeftVectorBar': '\\u2952',\n        'LessEqualGreater': '\\u22DA',\n        'leg': '\\u22DA',\n        'lesseqgtr': '\\u22DA',\n        'LessFullEqual': '\\u2266',\n        'lE': '\\u2266',\n        'leqq': '\\u2266',\n        'LessGreater': '\\u2276',\n        'lessgtr': '\\u2276',\n        'lg': '\\u2276',\n        'LessLess': '\\u2AA1',\n        'LessSlantEqual': '\\u2A7D',\n        'leqslant': '\\u2A7D',\n        'les': '\\u2A7D',\n        'LessTilde': '\\u2272',\n        'lesssim': '\\u2272',\n        'lsim': '\\u2272',\n        'Lfr': '\\uD835\\uDD0F',\n        'Ll': '\\u22D8',\n        'Lleftarrow': '\\u21DA',\n        'lAarr': '\\u21DA',\n        'Lmidot': '\\u013F',\n        'LongLeftArrow': '\\u27F5',\n        'longleftarrow': '\\u27F5',\n        'xlarr': '\\u27F5',\n        'LongLeftRightArrow': '\\u27F7',\n        'longleftrightarrow': '\\u27F7',\n        'xharr': '\\u27F7',\n        'LongRightArrow': '\\u27F6',\n        'longrightarrow': '\\u27F6',\n        'xrarr': '\\u27F6',\n        'Lopf': '\\uD835\\uDD43',\n        'LowerLeftArrow': '\\u2199',\n        'swarr': '\\u2199',\n        'swarrow': '\\u2199',\n        'LowerRightArrow': '\\u2198',\n        'searr': '\\u2198',\n        'searrow': '\\u2198',\n        'Lsh': '\\u21B0',\n        'lsh': '\\u21B0',\n        'Lstrok': '\\u0141',\n        'Lt': '\\u226A',\n        'NestedLessLess': '\\u226A',\n        'll': '\\u226A',\n        'Map': '\\u2905',\n        'Mcy': '\\u041C',\n        'MediumSpace': '\\u205F',\n        'Mellintrf': '\\u2133',\n        'Mscr': '\\u2133',\n        'phmmat': '\\u2133',\n        'Mfr': '\\uD835\\uDD10',\n        'MinusPlus': '\\u2213',\n        'mnplus': '\\u2213',\n        'mp': '\\u2213',\n        'Mopf': '\\uD835\\uDD44',\n        'Mu': '\\u039C',\n        'NJcy': '\\u040A',\n        'Nacute': '\\u0143',\n        'Ncaron': '\\u0147',\n        'Ncedil': '\\u0145',\n        'Ncy': '\\u041D',\n        'NegativeMediumSpace': '\\u200B',\n        'NegativeThickSpace': '\\u200B',\n        'NegativeThinSpace': '\\u200B',\n        'NegativeVeryThinSpace': '\\u200B',\n        'ZeroWidthSpace': '\\u200B',\n        'NewLine': '\\u000A',\n        'Nfr': '\\uD835\\uDD11',\n        'NoBreak': '\\u2060',\n        'NonBreakingSpace': '\\u00A0',\n        'nbsp': '\\u00A0',\n        'Nopf': '\\u2115',\n        'naturals': '\\u2115',\n        'Not': '\\u2AEC',\n        'NotCongruent': '\\u2262',\n        'nequiv': '\\u2262',\n        'NotCupCap': '\\u226D',\n        'NotDoubleVerticalBar': '\\u2226',\n        'npar': '\\u2226',\n        'nparallel': '\\u2226',\n        'nshortparallel': '\\u2226',\n        'nspar': '\\u2226',\n        'NotElement': '\\u2209',\n        'notin': '\\u2209',\n        'notinva': '\\u2209',\n        'NotEqual': '\\u2260',\n        'ne': '\\u2260',\n        'NotEqualTilde': '\\u2242\\u0338',\n        'nesim': '\\u2242\\u0338',\n        'NotExists': '\\u2204',\n        'nexist': '\\u2204',\n        'nexists': '\\u2204',\n        'NotGreater': '\\u226F',\n        'ngt': '\\u226F',\n        'ngtr': '\\u226F',\n        'NotGreaterEqual': '\\u2271',\n        'nge': '\\u2271',\n        'ngeq': '\\u2271',\n        'NotGreaterFullEqual': '\\u2267\\u0338',\n        'ngE': '\\u2267\\u0338',\n        'ngeqq': '\\u2267\\u0338',\n        'NotGreaterGreater': '\\u226B\\u0338',\n        'nGtv': '\\u226B\\u0338',\n        'NotGreaterLess': '\\u2279',\n        'ntgl': '\\u2279',\n        'NotGreaterSlantEqual': '\\u2A7E\\u0338',\n        'ngeqslant': '\\u2A7E\\u0338',\n        'nges': '\\u2A7E\\u0338',\n        'NotGreaterTilde': '\\u2275',\n        'ngsim': '\\u2275',\n        'NotHumpDownHump': '\\u224E\\u0338',\n        'nbump': '\\u224E\\u0338',\n        'NotHumpEqual': '\\u224F\\u0338',\n        'nbumpe': '\\u224F\\u0338',\n        'NotLeftTriangle': '\\u22EA',\n        'nltri': '\\u22EA',\n        'ntriangleleft': '\\u22EA',\n        'NotLeftTriangleBar': '\\u29CF\\u0338',\n        'NotLeftTriangleEqual': '\\u22EC',\n        'nltrie': '\\u22EC',\n        'ntrianglelefteq': '\\u22EC',\n        'NotLess': '\\u226E',\n        'nless': '\\u226E',\n        'nlt': '\\u226E',\n        'NotLessEqual': '\\u2270',\n        'nle': '\\u2270',\n        'nleq': '\\u2270',\n        'NotLessGreater': '\\u2278',\n        'ntlg': '\\u2278',\n        'NotLessLess': '\\u226A\\u0338',\n        'nLtv': '\\u226A\\u0338',\n        'NotLessSlantEqual': '\\u2A7D\\u0338',\n        'nleqslant': '\\u2A7D\\u0338',\n        'nles': '\\u2A7D\\u0338',\n        'NotLessTilde': '\\u2274',\n        'nlsim': '\\u2274',\n        'NotNestedGreaterGreater': '\\u2AA2\\u0338',\n        'NotNestedLessLess': '\\u2AA1\\u0338',\n        'NotPrecedes': '\\u2280',\n        'npr': '\\u2280',\n        'nprec': '\\u2280',\n        'NotPrecedesEqual': '\\u2AAF\\u0338',\n        'npre': '\\u2AAF\\u0338',\n        'npreceq': '\\u2AAF\\u0338',\n        'NotPrecedesSlantEqual': '\\u22E0',\n        'nprcue': '\\u22E0',\n        'NotReverseElement': '\\u220C',\n        'notni': '\\u220C',\n        'notniva': '\\u220C',\n        'NotRightTriangle': '\\u22EB',\n        'nrtri': '\\u22EB',\n        'ntriangleright': '\\u22EB',\n        'NotRightTriangleBar': '\\u29D0\\u0338',\n        'NotRightTriangleEqual': '\\u22ED',\n        'nrtrie': '\\u22ED',\n        'ntrianglerighteq': '\\u22ED',\n        'NotSquareSubset': '\\u228F\\u0338',\n        'NotSquareSubsetEqual': '\\u22E2',\n        'nsqsube': '\\u22E2',\n        'NotSquareSuperset': '\\u2290\\u0338',\n        'NotSquareSupersetEqual': '\\u22E3',\n        'nsqsupe': '\\u22E3',\n        'NotSubset': '\\u2282\\u20D2',\n        'nsubset': '\\u2282\\u20D2',\n        'vnsub': '\\u2282\\u20D2',\n        'NotSubsetEqual': '\\u2288',\n        'nsube': '\\u2288',\n        'nsubseteq': '\\u2288',\n        'NotSucceeds': '\\u2281',\n        'nsc': '\\u2281',\n        'nsucc': '\\u2281',\n        'NotSucceedsEqual': '\\u2AB0\\u0338',\n        'nsce': '\\u2AB0\\u0338',\n        'nsucceq': '\\u2AB0\\u0338',\n        'NotSucceedsSlantEqual': '\\u22E1',\n        'nsccue': '\\u22E1',\n        'NotSucceedsTilde': '\\u227F\\u0338',\n        'NotSuperset': '\\u2283\\u20D2',\n        'nsupset': '\\u2283\\u20D2',\n        'vnsup': '\\u2283\\u20D2',\n        'NotSupersetEqual': '\\u2289',\n        'nsupe': '\\u2289',\n        'nsupseteq': '\\u2289',\n        'NotTilde': '\\u2241',\n        'nsim': '\\u2241',\n        'NotTildeEqual': '\\u2244',\n        'nsime': '\\u2244',\n        'nsimeq': '\\u2244',\n        'NotTildeFullEqual': '\\u2247',\n        'ncong': '\\u2247',\n        'NotTildeTilde': '\\u2249',\n        'nap': '\\u2249',\n        'napprox': '\\u2249',\n        'NotVerticalBar': '\\u2224',\n        'nmid': '\\u2224',\n        'nshortmid': '\\u2224',\n        'nsmid': '\\u2224',\n        'Nscr': '\\uD835\\uDCA9',\n        'Ntilde': '\\u00D1',\n        'Nu': '\\u039D',\n        'OElig': '\\u0152',\n        'Oacute': '\\u00D3',\n        'Ocirc': '\\u00D4',\n        'Ocy': '\\u041E',\n        'Odblac': '\\u0150',\n        'Ofr': '\\uD835\\uDD12',\n        'Ograve': '\\u00D2',\n        'Omacr': '\\u014C',\n        'Omega': '\\u03A9',\n        'ohm': '\\u03A9',\n        'Omicron': '\\u039F',\n        'Oopf': '\\uD835\\uDD46',\n        'OpenCurlyDoubleQuote': '\\u201C',\n        'ldquo': '\\u201C',\n        'OpenCurlyQuote': '\\u2018',\n        'lsquo': '\\u2018',\n        'Or': '\\u2A54',\n        'Oscr': '\\uD835\\uDCAA',\n        'Oslash': '\\u00D8',\n        'Otilde': '\\u00D5',\n        'Otimes': '\\u2A37',\n        'Ouml': '\\u00D6',\n        'OverBar': '\\u203E',\n        'oline': '\\u203E',\n        'OverBrace': '\\u23DE',\n        'OverBracket': '\\u23B4',\n        'tbrk': '\\u23B4',\n        'OverParenthesis': '\\u23DC',\n        'PartialD': '\\u2202',\n        'part': '\\u2202',\n        'Pcy': '\\u041F',\n        'Pfr': '\\uD835\\uDD13',\n        'Phi': '\\u03A6',\n        'Pi': '\\u03A0',\n        'PlusMinus': '\\u00B1',\n        'plusmn': '\\u00B1',\n        'pm': '\\u00B1',\n        'Popf': '\\u2119',\n        'primes': '\\u2119',\n        'Pr': '\\u2ABB',\n        'Precedes': '\\u227A',\n        'pr': '\\u227A',\n        'prec': '\\u227A',\n        'PrecedesEqual': '\\u2AAF',\n        'pre': '\\u2AAF',\n        'preceq': '\\u2AAF',\n        'PrecedesSlantEqual': '\\u227C',\n        'prcue': '\\u227C',\n        'preccurlyeq': '\\u227C',\n        'PrecedesTilde': '\\u227E',\n        'precsim': '\\u227E',\n        'prsim': '\\u227E',\n        'Prime': '\\u2033',\n        'Product': '\\u220F',\n        'prod': '\\u220F',\n        'Proportional': '\\u221D',\n        'prop': '\\u221D',\n        'propto': '\\u221D',\n        'varpropto': '\\u221D',\n        'vprop': '\\u221D',\n        'Pscr': '\\uD835\\uDCAB',\n        'Psi': '\\u03A8',\n        'QUOT': '\\u0022',\n        'quot': '\\u0022',\n        'Qfr': '\\uD835\\uDD14',\n        'Qopf': '\\u211A',\n        'rationals': '\\u211A',\n        'Qscr': '\\uD835\\uDCAC',\n        'RBarr': '\\u2910',\n        'drbkarow': '\\u2910',\n        'REG': '\\u00AE',\n        'circledR': '\\u00AE',\n        'reg': '\\u00AE',\n        'Racute': '\\u0154',\n        'Rang': '\\u27EB',\n        'Rarr': '\\u21A0',\n        'twoheadrightarrow': '\\u21A0',\n        'Rarrtl': '\\u2916',\n        'Rcaron': '\\u0158',\n        'Rcedil': '\\u0156',\n        'Rcy': '\\u0420',\n        'Re': '\\u211C',\n        'Rfr': '\\u211C',\n        'real': '\\u211C',\n        'realpart': '\\u211C',\n        'ReverseElement': '\\u220B',\n        'SuchThat': '\\u220B',\n        'ni': '\\u220B',\n        'niv': '\\u220B',\n        'ReverseEquilibrium': '\\u21CB',\n        'leftrightharpoons': '\\u21CB',\n        'lrhar': '\\u21CB',\n        'ReverseUpEquilibrium': '\\u296F',\n        'duhar': '\\u296F',\n        'Rho': '\\u03A1',\n        'RightAngleBracket': '\\u27E9',\n        'rang': '\\u27E9',\n        'rangle': '\\u27E9',\n        'RightArrow': '\\u2192',\n        'ShortRightArrow': '\\u2192',\n        'rarr': '\\u2192',\n        'rightarrow': '\\u2192',\n        'srarr': '\\u2192',\n        'RightArrowBar': '\\u21E5',\n        'rarrb': '\\u21E5',\n        'RightArrowLeftArrow': '\\u21C4',\n        'rightleftarrows': '\\u21C4',\n        'rlarr': '\\u21C4',\n        'RightCeiling': '\\u2309',\n        'rceil': '\\u2309',\n        'RightDoubleBracket': '\\u27E7',\n        'robrk': '\\u27E7',\n        'RightDownTeeVector': '\\u295D',\n        'RightDownVector': '\\u21C2',\n        'dharr': '\\u21C2',\n        'downharpoonright': '\\u21C2',\n        'RightDownVectorBar': '\\u2955',\n        'RightFloor': '\\u230B',\n        'rfloor': '\\u230B',\n        'RightTee': '\\u22A2',\n        'vdash': '\\u22A2',\n        'RightTeeArrow': '\\u21A6',\n        'map': '\\u21A6',\n        'mapsto': '\\u21A6',\n        'RightTeeVector': '\\u295B',\n        'RightTriangle': '\\u22B3',\n        'vartriangleright': '\\u22B3',\n        'vrtri': '\\u22B3',\n        'RightTriangleBar': '\\u29D0',\n        'RightTriangleEqual': '\\u22B5',\n        'rtrie': '\\u22B5',\n        'trianglerighteq': '\\u22B5',\n        'RightUpDownVector': '\\u294F',\n        'RightUpTeeVector': '\\u295C',\n        'RightUpVector': '\\u21BE',\n        'uharr': '\\u21BE',\n        'upharpoonright': '\\u21BE',\n        'RightUpVectorBar': '\\u2954',\n        'RightVector': '\\u21C0',\n        'rharu': '\\u21C0',\n        'rightharpoonup': '\\u21C0',\n        'RightVectorBar': '\\u2953',\n        'Ropf': '\\u211D',\n        'reals': '\\u211D',\n        'RoundImplies': '\\u2970',\n        'Rrightarrow': '\\u21DB',\n        'rAarr': '\\u21DB',\n        'Rscr': '\\u211B',\n        'realine': '\\u211B',\n        'Rsh': '\\u21B1',\n        'rsh': '\\u21B1',\n        'RuleDelayed': '\\u29F4',\n        'SHCHcy': '\\u0429',\n        'SHcy': '\\u0428',\n        'SOFTcy': '\\u042C',\n        'Sacute': '\\u015A',\n        'Sc': '\\u2ABC',\n        'Scaron': '\\u0160',\n        'Scedil': '\\u015E',\n        'Scirc': '\\u015C',\n        'Scy': '\\u0421',\n        'Sfr': '\\uD835\\uDD16',\n        'ShortUpArrow': '\\u2191',\n        'UpArrow': '\\u2191',\n        'uarr': '\\u2191',\n        'uparrow': '\\u2191',\n        'Sigma': '\\u03A3',\n        'SmallCircle': '\\u2218',\n        'compfn': '\\u2218',\n        'Sopf': '\\uD835\\uDD4A',\n        'Sqrt': '\\u221A',\n        'radic': '\\u221A',\n        'Square': '\\u25A1',\n        'squ': '\\u25A1',\n        'square': '\\u25A1',\n        'SquareIntersection': '\\u2293',\n        'sqcap': '\\u2293',\n        'SquareSubset': '\\u228F',\n        'sqsub': '\\u228F',\n        'sqsubset': '\\u228F',\n        'SquareSubsetEqual': '\\u2291',\n        'sqsube': '\\u2291',\n        'sqsubseteq': '\\u2291',\n        'SquareSuperset': '\\u2290',\n        'sqsup': '\\u2290',\n        'sqsupset': '\\u2290',\n        'SquareSupersetEqual': '\\u2292',\n        'sqsupe': '\\u2292',\n        'sqsupseteq': '\\u2292',\n        'SquareUnion': '\\u2294',\n        'sqcup': '\\u2294',\n        'Sscr': '\\uD835\\uDCAE',\n        'Star': '\\u22C6',\n        'sstarf': '\\u22C6',\n        'Sub': '\\u22D0',\n        'Subset': '\\u22D0',\n        'SubsetEqual': '\\u2286',\n        'sube': '\\u2286',\n        'subseteq': '\\u2286',\n        'Succeeds': '\\u227B',\n        'sc': '\\u227B',\n        'succ': '\\u227B',\n        'SucceedsEqual': '\\u2AB0',\n        'sce': '\\u2AB0',\n        'succeq': '\\u2AB0',\n        'SucceedsSlantEqual': '\\u227D',\n        'sccue': '\\u227D',\n        'succcurlyeq': '\\u227D',\n        'SucceedsTilde': '\\u227F',\n        'scsim': '\\u227F',\n        'succsim': '\\u227F',\n        'Sum': '\\u2211',\n        'sum': '\\u2211',\n        'Sup': '\\u22D1',\n        'Supset': '\\u22D1',\n        'Superset': '\\u2283',\n        'sup': '\\u2283',\n        'supset': '\\u2283',\n        'SupersetEqual': '\\u2287',\n        'supe': '\\u2287',\n        'supseteq': '\\u2287',\n        'THORN': '\\u00DE',\n        'TRADE': '\\u2122',\n        'trade': '\\u2122',\n        'TSHcy': '\\u040B',\n        'TScy': '\\u0426',\n        'Tab': '\\u0009',\n        'Tau': '\\u03A4',\n        'Tcaron': '\\u0164',\n        'Tcedil': '\\u0162',\n        'Tcy': '\\u0422',\n        'Tfr': '\\uD835\\uDD17',\n        'Therefore': '\\u2234',\n        'there4': '\\u2234',\n        'therefore': '\\u2234',\n        'Theta': '\\u0398',\n        'ThickSpace': '\\u205F\\u200A',\n        'ThinSpace': '\\u2009',\n        'thinsp': '\\u2009',\n        'Tilde': '\\u223C',\n        'sim': '\\u223C',\n        'thicksim': '\\u223C',\n        'thksim': '\\u223C',\n        'TildeEqual': '\\u2243',\n        'sime': '\\u2243',\n        'simeq': '\\u2243',\n        'TildeFullEqual': '\\u2245',\n        'cong': '\\u2245',\n        'TildeTilde': '\\u2248',\n        'ap': '\\u2248',\n        'approx': '\\u2248',\n        'asymp': '\\u2248',\n        'thickapprox': '\\u2248',\n        'thkap': '\\u2248',\n        'Topf': '\\uD835\\uDD4B',\n        'TripleDot': '\\u20DB',\n        'tdot': '\\u20DB',\n        'Tscr': '\\uD835\\uDCAF',\n        'Tstrok': '\\u0166',\n        'Uacute': '\\u00DA',\n        'Uarr': '\\u219F',\n        'Uarrocir': '\\u2949',\n        'Ubrcy': '\\u040E',\n        'Ubreve': '\\u016C',\n        'Ucirc': '\\u00DB',\n        'Ucy': '\\u0423',\n        'Udblac': '\\u0170',\n        'Ufr': '\\uD835\\uDD18',\n        'Ugrave': '\\u00D9',\n        'Umacr': '\\u016A',\n        'UnderBar': '\\u005F',\n        'lowbar': '\\u005F',\n        'UnderBrace': '\\u23DF',\n        'UnderBracket': '\\u23B5',\n        'bbrk': '\\u23B5',\n        'UnderParenthesis': '\\u23DD',\n        'Union': '\\u22C3',\n        'bigcup': '\\u22C3',\n        'xcup': '\\u22C3',\n        'UnionPlus': '\\u228E',\n        'uplus': '\\u228E',\n        'Uogon': '\\u0172',\n        'Uopf': '\\uD835\\uDD4C',\n        'UpArrowBar': '\\u2912',\n        'UpArrowDownArrow': '\\u21C5',\n        'udarr': '\\u21C5',\n        'UpDownArrow': '\\u2195',\n        'updownarrow': '\\u2195',\n        'varr': '\\u2195',\n        'UpEquilibrium': '\\u296E',\n        'udhar': '\\u296E',\n        'UpTee': '\\u22A5',\n        'bot': '\\u22A5',\n        'bottom': '\\u22A5',\n        'perp': '\\u22A5',\n        'UpTeeArrow': '\\u21A5',\n        'mapstoup': '\\u21A5',\n        'UpperLeftArrow': '\\u2196',\n        'nwarr': '\\u2196',\n        'nwarrow': '\\u2196',\n        'UpperRightArrow': '\\u2197',\n        'nearr': '\\u2197',\n        'nearrow': '\\u2197',\n        'Upsi': '\\u03D2',\n        'upsih': '\\u03D2',\n        'Upsilon': '\\u03A5',\n        'Uring': '\\u016E',\n        'Uscr': '\\uD835\\uDCB0',\n        'Utilde': '\\u0168',\n        'Uuml': '\\u00DC',\n        'VDash': '\\u22AB',\n        'Vbar': '\\u2AEB',\n        'Vcy': '\\u0412',\n        'Vdash': '\\u22A9',\n        'Vdashl': '\\u2AE6',\n        'Vee': '\\u22C1',\n        'bigvee': '\\u22C1',\n        'xvee': '\\u22C1',\n        'Verbar': '\\u2016',\n        'Vert': '\\u2016',\n        'VerticalBar': '\\u2223',\n        'mid': '\\u2223',\n        'shortmid': '\\u2223',\n        'smid': '\\u2223',\n        'VerticalLine': '\\u007C',\n        'verbar': '\\u007C',\n        'vert': '\\u007C',\n        'VerticalSeparator': '\\u2758',\n        'VerticalTilde': '\\u2240',\n        'wr': '\\u2240',\n        'wreath': '\\u2240',\n        'VeryThinSpace': '\\u200A',\n        'hairsp': '\\u200A',\n        'Vfr': '\\uD835\\uDD19',\n        'Vopf': '\\uD835\\uDD4D',\n        'Vscr': '\\uD835\\uDCB1',\n        'Vvdash': '\\u22AA',\n        'Wcirc': '\\u0174',\n        'Wedge': '\\u22C0',\n        'bigwedge': '\\u22C0',\n        'xwedge': '\\u22C0',\n        'Wfr': '\\uD835\\uDD1A',\n        'Wopf': '\\uD835\\uDD4E',\n        'Wscr': '\\uD835\\uDCB2',\n        'Xfr': '\\uD835\\uDD1B',\n        'Xi': '\\u039E',\n        'Xopf': '\\uD835\\uDD4F',\n        'Xscr': '\\uD835\\uDCB3',\n        'YAcy': '\\u042F',\n        'YIcy': '\\u0407',\n        'YUcy': '\\u042E',\n        'Yacute': '\\u00DD',\n        'Ycirc': '\\u0176',\n        'Ycy': '\\u042B',\n        'Yfr': '\\uD835\\uDD1C',\n        'Yopf': '\\uD835\\uDD50',\n        'Yscr': '\\uD835\\uDCB4',\n        'Yuml': '\\u0178',\n        'ZHcy': '\\u0416',\n        'Zacute': '\\u0179',\n        'Zcaron': '\\u017D',\n        'Zcy': '\\u0417',\n        'Zdot': '\\u017B',\n        'Zeta': '\\u0396',\n        'Zfr': '\\u2128',\n        'zeetrf': '\\u2128',\n        'Zopf': '\\u2124',\n        'integers': '\\u2124',\n        'Zscr': '\\uD835\\uDCB5',\n        'aacute': '\\u00E1',\n        'abreve': '\\u0103',\n        'ac': '\\u223E',\n        'mstpos': '\\u223E',\n        'acE': '\\u223E\\u0333',\n        'acd': '\\u223F',\n        'acirc': '\\u00E2',\n        'acy': '\\u0430',\n        'aelig': '\\u00E6',\n        'afr': '\\uD835\\uDD1E',\n        'agrave': '\\u00E0',\n        'alefsym': '\\u2135',\n        'aleph': '\\u2135',\n        'alpha': '\\u03B1',\n        'amacr': '\\u0101',\n        'amalg': '\\u2A3F',\n        'and': '\\u2227',\n        'wedge': '\\u2227',\n        'andand': '\\u2A55',\n        'andd': '\\u2A5C',\n        'andslope': '\\u2A58',\n        'andv': '\\u2A5A',\n        'ang': '\\u2220',\n        'angle': '\\u2220',\n        'ange': '\\u29A4',\n        'angmsd': '\\u2221',\n        'measuredangle': '\\u2221',\n        'angmsdaa': '\\u29A8',\n        'angmsdab': '\\u29A9',\n        'angmsdac': '\\u29AA',\n        'angmsdad': '\\u29AB',\n        'angmsdae': '\\u29AC',\n        'angmsdaf': '\\u29AD',\n        'angmsdag': '\\u29AE',\n        'angmsdah': '\\u29AF',\n        'angrt': '\\u221F',\n        'angrtvb': '\\u22BE',\n        'angrtvbd': '\\u299D',\n        'angsph': '\\u2222',\n        'angzarr': '\\u237C',\n        'aogon': '\\u0105',\n        'aopf': '\\uD835\\uDD52',\n        'apE': '\\u2A70',\n        'apacir': '\\u2A6F',\n        'ape': '\\u224A',\n        'approxeq': '\\u224A',\n        'apid': '\\u224B',\n        'apos': '\\u0027',\n        'aring': '\\u00E5',\n        'ascr': '\\uD835\\uDCB6',\n        'ast': '\\u002A',\n        'midast': '\\u002A',\n        'atilde': '\\u00E3',\n        'auml': '\\u00E4',\n        'awint': '\\u2A11',\n        'bNot': '\\u2AED',\n        'backcong': '\\u224C',\n        'bcong': '\\u224C',\n        'backepsilon': '\\u03F6',\n        'bepsi': '\\u03F6',\n        'backprime': '\\u2035',\n        'bprime': '\\u2035',\n        'backsim': '\\u223D',\n        'bsim': '\\u223D',\n        'backsimeq': '\\u22CD',\n        'bsime': '\\u22CD',\n        'barvee': '\\u22BD',\n        'barwed': '\\u2305',\n        'barwedge': '\\u2305',\n        'bbrktbrk': '\\u23B6',\n        'bcy': '\\u0431',\n        'bdquo': '\\u201E',\n        'ldquor': '\\u201E',\n        'bemptyv': '\\u29B0',\n        'beta': '\\u03B2',\n        'beth': '\\u2136',\n        'between': '\\u226C',\n        'twixt': '\\u226C',\n        'bfr': '\\uD835\\uDD1F',\n        'bigcirc': '\\u25EF',\n        'xcirc': '\\u25EF',\n        'bigodot': '\\u2A00',\n        'xodot': '\\u2A00',\n        'bigoplus': '\\u2A01',\n        'xoplus': '\\u2A01',\n        'bigotimes': '\\u2A02',\n        'xotime': '\\u2A02',\n        'bigsqcup': '\\u2A06',\n        'xsqcup': '\\u2A06',\n        'bigstar': '\\u2605',\n        'starf': '\\u2605',\n        'bigtriangledown': '\\u25BD',\n        'xdtri': '\\u25BD',\n        'bigtriangleup': '\\u25B3',\n        'xutri': '\\u25B3',\n        'biguplus': '\\u2A04',\n        'xuplus': '\\u2A04',\n        'bkarow': '\\u290D',\n        'rbarr': '\\u290D',\n        'blacklozenge': '\\u29EB',\n        'lozf': '\\u29EB',\n        'blacktriangle': '\\u25B4',\n        'utrif': '\\u25B4',\n        'blacktriangledown': '\\u25BE',\n        'dtrif': '\\u25BE',\n        'blacktriangleleft': '\\u25C2',\n        'ltrif': '\\u25C2',\n        'blacktriangleright': '\\u25B8',\n        'rtrif': '\\u25B8',\n        'blank': '\\u2423',\n        'blk12': '\\u2592',\n        'blk14': '\\u2591',\n        'blk34': '\\u2593',\n        'block': '\\u2588',\n        'bne': '\\u003D\\u20E5',\n        'bnequiv': '\\u2261\\u20E5',\n        'bnot': '\\u2310',\n        'bopf': '\\uD835\\uDD53',\n        'bowtie': '\\u22C8',\n        'boxDL': '\\u2557',\n        'boxDR': '\\u2554',\n        'boxDl': '\\u2556',\n        'boxDr': '\\u2553',\n        'boxH': '\\u2550',\n        'boxHD': '\\u2566',\n        'boxHU': '\\u2569',\n        'boxHd': '\\u2564',\n        'boxHu': '\\u2567',\n        'boxUL': '\\u255D',\n        'boxUR': '\\u255A',\n        'boxUl': '\\u255C',\n        'boxUr': '\\u2559',\n        'boxV': '\\u2551',\n        'boxVH': '\\u256C',\n        'boxVL': '\\u2563',\n        'boxVR': '\\u2560',\n        'boxVh': '\\u256B',\n        'boxVl': '\\u2562',\n        'boxVr': '\\u255F',\n        'boxbox': '\\u29C9',\n        'boxdL': '\\u2555',\n        'boxdR': '\\u2552',\n        'boxdl': '\\u2510',\n        'boxdr': '\\u250C',\n        'boxhD': '\\u2565',\n        'boxhU': '\\u2568',\n        'boxhd': '\\u252C',\n        'boxhu': '\\u2534',\n        'boxminus': '\\u229F',\n        'minusb': '\\u229F',\n        'boxplus': '\\u229E',\n        'plusb': '\\u229E',\n        'boxtimes': '\\u22A0',\n        'timesb': '\\u22A0',\n        'boxuL': '\\u255B',\n        'boxuR': '\\u2558',\n        'boxul': '\\u2518',\n        'boxur': '\\u2514',\n        'boxv': '\\u2502',\n        'boxvH': '\\u256A',\n        'boxvL': '\\u2561',\n        'boxvR': '\\u255E',\n        'boxvh': '\\u253C',\n        'boxvl': '\\u2524',\n        'boxvr': '\\u251C',\n        'brvbar': '\\u00A6',\n        'bscr': '\\uD835\\uDCB7',\n        'bsemi': '\\u204F',\n        'bsol': '\\u005C',\n        'bsolb': '\\u29C5',\n        'bsolhsub': '\\u27C8',\n        'bull': '\\u2022',\n        'bullet': '\\u2022',\n        'bumpE': '\\u2AAE',\n        'cacute': '\\u0107',\n        'cap': '\\u2229',\n        'capand': '\\u2A44',\n        'capbrcup': '\\u2A49',\n        'capcap': '\\u2A4B',\n        'capcup': '\\u2A47',\n        'capdot': '\\u2A40',\n        'caps': '\\u2229\\uFE00',\n        'caret': '\\u2041',\n        'ccaps': '\\u2A4D',\n        'ccaron': '\\u010D',\n        'ccedil': '\\u00E7',\n        'ccirc': '\\u0109',\n        'ccups': '\\u2A4C',\n        'ccupssm': '\\u2A50',\n        'cdot': '\\u010B',\n        'cemptyv': '\\u29B2',\n        'cent': '\\u00A2',\n        'cfr': '\\uD835\\uDD20',\n        'chcy': '\\u0447',\n        'check': '\\u2713',\n        'checkmark': '\\u2713',\n        'chi': '\\u03C7',\n        'cir': '\\u25CB',\n        'cirE': '\\u29C3',\n        'circ': '\\u02C6',\n        'circeq': '\\u2257',\n        'cire': '\\u2257',\n        'circlearrowleft': '\\u21BA',\n        'olarr': '\\u21BA',\n        'circlearrowright': '\\u21BB',\n        'orarr': '\\u21BB',\n        'circledS': '\\u24C8',\n        'oS': '\\u24C8',\n        'circledast': '\\u229B',\n        'oast': '\\u229B',\n        'circledcirc': '\\u229A',\n        'ocir': '\\u229A',\n        'circleddash': '\\u229D',\n        'odash': '\\u229D',\n        'cirfnint': '\\u2A10',\n        'cirmid': '\\u2AEF',\n        'cirscir': '\\u29C2',\n        'clubs': '\\u2663',\n        'clubsuit': '\\u2663',\n        'colon': '\\u003A',\n        'comma': '\\u002C',\n        'commat': '\\u0040',\n        'comp': '\\u2201',\n        'complement': '\\u2201',\n        'congdot': '\\u2A6D',\n        'copf': '\\uD835\\uDD54',\n        'copysr': '\\u2117',\n        'crarr': '\\u21B5',\n        'cross': '\\u2717',\n        'cscr': '\\uD835\\uDCB8',\n        'csub': '\\u2ACF',\n        'csube': '\\u2AD1',\n        'csup': '\\u2AD0',\n        'csupe': '\\u2AD2',\n        'ctdot': '\\u22EF',\n        'cudarrl': '\\u2938',\n        'cudarrr': '\\u2935',\n        'cuepr': '\\u22DE',\n        'curlyeqprec': '\\u22DE',\n        'cuesc': '\\u22DF',\n        'curlyeqsucc': '\\u22DF',\n        'cularr': '\\u21B6',\n        'curvearrowleft': '\\u21B6',\n        'cularrp': '\\u293D',\n        'cup': '\\u222A',\n        'cupbrcap': '\\u2A48',\n        'cupcap': '\\u2A46',\n        'cupcup': '\\u2A4A',\n        'cupdot': '\\u228D',\n        'cupor': '\\u2A45',\n        'cups': '\\u222A\\uFE00',\n        'curarr': '\\u21B7',\n        'curvearrowright': '\\u21B7',\n        'curarrm': '\\u293C',\n        'curlyvee': '\\u22CE',\n        'cuvee': '\\u22CE',\n        'curlywedge': '\\u22CF',\n        'cuwed': '\\u22CF',\n        'curren': '\\u00A4',\n        'cwint': '\\u2231',\n        'cylcty': '\\u232D',\n        'dHar': '\\u2965',\n        'dagger': '\\u2020',\n        'daleth': '\\u2138',\n        'dash': '\\u2010',\n        'hyphen': '\\u2010',\n        'dbkarow': '\\u290F',\n        'rBarr': '\\u290F',\n        'dcaron': '\\u010F',\n        'dcy': '\\u0434',\n        'ddarr': '\\u21CA',\n        'downdownarrows': '\\u21CA',\n        'ddotseq': '\\u2A77',\n        'eDDot': '\\u2A77',\n        'deg': '\\u00B0',\n        'delta': '\\u03B4',\n        'demptyv': '\\u29B1',\n        'dfisht': '\\u297F',\n        'dfr': '\\uD835\\uDD21',\n        'diamondsuit': '\\u2666',\n        'diams': '\\u2666',\n        'digamma': '\\u03DD',\n        'gammad': '\\u03DD',\n        'disin': '\\u22F2',\n        'div': '\\u00F7',\n        'divide': '\\u00F7',\n        'divideontimes': '\\u22C7',\n        'divonx': '\\u22C7',\n        'djcy': '\\u0452',\n        'dlcorn': '\\u231E',\n        'llcorner': '\\u231E',\n        'dlcrop': '\\u230D',\n        'dollar': '\\u0024',\n        'dopf': '\\uD835\\uDD55',\n        'doteqdot': '\\u2251',\n        'eDot': '\\u2251',\n        'dotminus': '\\u2238',\n        'minusd': '\\u2238',\n        'dotplus': '\\u2214',\n        'plusdo': '\\u2214',\n        'dotsquare': '\\u22A1',\n        'sdotb': '\\u22A1',\n        'drcorn': '\\u231F',\n        'lrcorner': '\\u231F',\n        'drcrop': '\\u230C',\n        'dscr': '\\uD835\\uDCB9',\n        'dscy': '\\u0455',\n        'dsol': '\\u29F6',\n        'dstrok': '\\u0111',\n        'dtdot': '\\u22F1',\n        'dtri': '\\u25BF',\n        'triangledown': '\\u25BF',\n        'dwangle': '\\u29A6',\n        'dzcy': '\\u045F',\n        'dzigrarr': '\\u27FF',\n        'eacute': '\\u00E9',\n        'easter': '\\u2A6E',\n        'ecaron': '\\u011B',\n        'ecir': '\\u2256',\n        'eqcirc': '\\u2256',\n        'ecirc': '\\u00EA',\n        'ecolon': '\\u2255',\n        'eqcolon': '\\u2255',\n        'ecy': '\\u044D',\n        'edot': '\\u0117',\n        'efDot': '\\u2252',\n        'fallingdotseq': '\\u2252',\n        'efr': '\\uD835\\uDD22',\n        'eg': '\\u2A9A',\n        'egrave': '\\u00E8',\n        'egs': '\\u2A96',\n        'eqslantgtr': '\\u2A96',\n        'egsdot': '\\u2A98',\n        'el': '\\u2A99',\n        'elinters': '\\u23E7',\n        'ell': '\\u2113',\n        'els': '\\u2A95',\n        'eqslantless': '\\u2A95',\n        'elsdot': '\\u2A97',\n        'emacr': '\\u0113',\n        'empty': '\\u2205',\n        'emptyset': '\\u2205',\n        'emptyv': '\\u2205',\n        'varnothing': '\\u2205',\n        'emsp13': '\\u2004',\n        'emsp14': '\\u2005',\n        'emsp': '\\u2003',\n        'eng': '\\u014B',\n        'ensp': '\\u2002',\n        'eogon': '\\u0119',\n        'eopf': '\\uD835\\uDD56',\n        'epar': '\\u22D5',\n        'eparsl': '\\u29E3',\n        'eplus': '\\u2A71',\n        'epsi': '\\u03B5',\n        'epsilon': '\\u03B5',\n        'epsiv': '\\u03F5',\n        'straightepsilon': '\\u03F5',\n        'varepsilon': '\\u03F5',\n        'equals': '\\u003D',\n        'equest': '\\u225F',\n        'questeq': '\\u225F',\n        'equivDD': '\\u2A78',\n        'eqvparsl': '\\u29E5',\n        'erDot': '\\u2253',\n        'risingdotseq': '\\u2253',\n        'erarr': '\\u2971',\n        'escr': '\\u212F',\n        'eta': '\\u03B7',\n        'eth': '\\u00F0',\n        'euml': '\\u00EB',\n        'euro': '\\u20AC',\n        'excl': '\\u0021',\n        'fcy': '\\u0444',\n        'female': '\\u2640',\n        'ffilig': '\\uFB03',\n        'fflig': '\\uFB00',\n        'ffllig': '\\uFB04',\n        'ffr': '\\uD835\\uDD23',\n        'filig': '\\uFB01',\n        'fjlig': '\\u0066\\u006A',\n        'flat': '\\u266D',\n        'fllig': '\\uFB02',\n        'fltns': '\\u25B1',\n        'fnof': '\\u0192',\n        'fopf': '\\uD835\\uDD57',\n        'fork': '\\u22D4',\n        'pitchfork': '\\u22D4',\n        'forkv': '\\u2AD9',\n        'fpartint': '\\u2A0D',\n        'frac12': '\\u00BD',\n        'half': '\\u00BD',\n        'frac13': '\\u2153',\n        'frac14': '\\u00BC',\n        'frac15': '\\u2155',\n        'frac16': '\\u2159',\n        'frac18': '\\u215B',\n        'frac23': '\\u2154',\n        'frac25': '\\u2156',\n        'frac34': '\\u00BE',\n        'frac35': '\\u2157',\n        'frac38': '\\u215C',\n        'frac45': '\\u2158',\n        'frac56': '\\u215A',\n        'frac58': '\\u215D',\n        'frac78': '\\u215E',\n        'frasl': '\\u2044',\n        'frown': '\\u2322',\n        'sfrown': '\\u2322',\n        'fscr': '\\uD835\\uDCBB',\n        'gEl': '\\u2A8C',\n        'gtreqqless': '\\u2A8C',\n        'gacute': '\\u01F5',\n        'gamma': '\\u03B3',\n        'gap': '\\u2A86',\n        'gtrapprox': '\\u2A86',\n        'gbreve': '\\u011F',\n        'gcirc': '\\u011D',\n        'gcy': '\\u0433',\n        'gdot': '\\u0121',\n        'gescc': '\\u2AA9',\n        'gesdot': '\\u2A80',\n        'gesdoto': '\\u2A82',\n        'gesdotol': '\\u2A84',\n        'gesl': '\\u22DB\\uFE00',\n        'gesles': '\\u2A94',\n        'gfr': '\\uD835\\uDD24',\n        'gimel': '\\u2137',\n        'gjcy': '\\u0453',\n        'glE': '\\u2A92',\n        'gla': '\\u2AA5',\n        'glj': '\\u2AA4',\n        'gnE': '\\u2269',\n        'gneqq': '\\u2269',\n        'gnap': '\\u2A8A',\n        'gnapprox': '\\u2A8A',\n        'gne': '\\u2A88',\n        'gneq': '\\u2A88',\n        'gnsim': '\\u22E7',\n        'gopf': '\\uD835\\uDD58',\n        'gscr': '\\u210A',\n        'gsime': '\\u2A8E',\n        'gsiml': '\\u2A90',\n        'gtcc': '\\u2AA7',\n        'gtcir': '\\u2A7A',\n        'gtdot': '\\u22D7',\n        'gtrdot': '\\u22D7',\n        'gtlPar': '\\u2995',\n        'gtquest': '\\u2A7C',\n        'gtrarr': '\\u2978',\n        'gvertneqq': '\\u2269\\uFE00',\n        'gvnE': '\\u2269\\uFE00',\n        'hardcy': '\\u044A',\n        'harrcir': '\\u2948',\n        'harrw': '\\u21AD',\n        'leftrightsquigarrow': '\\u21AD',\n        'hbar': '\\u210F',\n        'hslash': '\\u210F',\n        'planck': '\\u210F',\n        'plankv': '\\u210F',\n        'hcirc': '\\u0125',\n        'hearts': '\\u2665',\n        'heartsuit': '\\u2665',\n        'hellip': '\\u2026',\n        'mldr': '\\u2026',\n        'hercon': '\\u22B9',\n        'hfr': '\\uD835\\uDD25',\n        'hksearow': '\\u2925',\n        'searhk': '\\u2925',\n        'hkswarow': '\\u2926',\n        'swarhk': '\\u2926',\n        'hoarr': '\\u21FF',\n        'homtht': '\\u223B',\n        'hookleftarrow': '\\u21A9',\n        'larrhk': '\\u21A9',\n        'hookrightarrow': '\\u21AA',\n        'rarrhk': '\\u21AA',\n        'hopf': '\\uD835\\uDD59',\n        'horbar': '\\u2015',\n        'hscr': '\\uD835\\uDCBD',\n        'hstrok': '\\u0127',\n        'hybull': '\\u2043',\n        'iacute': '\\u00ED',\n        'icirc': '\\u00EE',\n        'icy': '\\u0438',\n        'iecy': '\\u0435',\n        'iexcl': '\\u00A1',\n        'ifr': '\\uD835\\uDD26',\n        'igrave': '\\u00EC',\n        'iiiint': '\\u2A0C',\n        'qint': '\\u2A0C',\n        'iiint': '\\u222D',\n        'tint': '\\u222D',\n        'iinfin': '\\u29DC',\n        'iiota': '\\u2129',\n        'ijlig': '\\u0133',\n        'imacr': '\\u012B',\n        'imath': '\\u0131',\n        'inodot': '\\u0131',\n        'imof': '\\u22B7',\n        'imped': '\\u01B5',\n        'incare': '\\u2105',\n        'infin': '\\u221E',\n        'infintie': '\\u29DD',\n        'intcal': '\\u22BA',\n        'intercal': '\\u22BA',\n        'intlarhk': '\\u2A17',\n        'intprod': '\\u2A3C',\n        'iprod': '\\u2A3C',\n        'iocy': '\\u0451',\n        'iogon': '\\u012F',\n        'iopf': '\\uD835\\uDD5A',\n        'iota': '\\u03B9',\n        'iquest': '\\u00BF',\n        'iscr': '\\uD835\\uDCBE',\n        'isinE': '\\u22F9',\n        'isindot': '\\u22F5',\n        'isins': '\\u22F4',\n        'isinsv': '\\u22F3',\n        'itilde': '\\u0129',\n        'iukcy': '\\u0456',\n        'iuml': '\\u00EF',\n        'jcirc': '\\u0135',\n        'jcy': '\\u0439',\n        'jfr': '\\uD835\\uDD27',\n        'jmath': '\\u0237',\n        'jopf': '\\uD835\\uDD5B',\n        'jscr': '\\uD835\\uDCBF',\n        'jsercy': '\\u0458',\n        'jukcy': '\\u0454',\n        'kappa': '\\u03BA',\n        'kappav': '\\u03F0',\n        'varkappa': '\\u03F0',\n        'kcedil': '\\u0137',\n        'kcy': '\\u043A',\n        'kfr': '\\uD835\\uDD28',\n        'kgreen': '\\u0138',\n        'khcy': '\\u0445',\n        'kjcy': '\\u045C',\n        'kopf': '\\uD835\\uDD5C',\n        'kscr': '\\uD835\\uDCC0',\n        'lAtail': '\\u291B',\n        'lBarr': '\\u290E',\n        'lEg': '\\u2A8B',\n        'lesseqqgtr': '\\u2A8B',\n        'lHar': '\\u2962',\n        'lacute': '\\u013A',\n        'laemptyv': '\\u29B4',\n        'lambda': '\\u03BB',\n        'langd': '\\u2991',\n        'lap': '\\u2A85',\n        'lessapprox': '\\u2A85',\n        'laquo': '\\u00AB',\n        'larrbfs': '\\u291F',\n        'larrfs': '\\u291D',\n        'larrlp': '\\u21AB',\n        'looparrowleft': '\\u21AB',\n        'larrpl': '\\u2939',\n        'larrsim': '\\u2973',\n        'larrtl': '\\u21A2',\n        'leftarrowtail': '\\u21A2',\n        'lat': '\\u2AAB',\n        'latail': '\\u2919',\n        'late': '\\u2AAD',\n        'lates': '\\u2AAD\\uFE00',\n        'lbarr': '\\u290C',\n        'lbbrk': '\\u2772',\n        'lbrace': '\\u007B',\n        'lcub': '\\u007B',\n        'lbrack': '\\u005B',\n        'lsqb': '\\u005B',\n        'lbrke': '\\u298B',\n        'lbrksld': '\\u298F',\n        'lbrkslu': '\\u298D',\n        'lcaron': '\\u013E',\n        'lcedil': '\\u013C',\n        'lcy': '\\u043B',\n        'ldca': '\\u2936',\n        'ldrdhar': '\\u2967',\n        'ldrushar': '\\u294B',\n        'ldsh': '\\u21B2',\n        'le': '\\u2264',\n        'leq': '\\u2264',\n        'leftleftarrows': '\\u21C7',\n        'llarr': '\\u21C7',\n        'leftthreetimes': '\\u22CB',\n        'lthree': '\\u22CB',\n        'lescc': '\\u2AA8',\n        'lesdot': '\\u2A7F',\n        'lesdoto': '\\u2A81',\n        'lesdotor': '\\u2A83',\n        'lesg': '\\u22DA\\uFE00',\n        'lesges': '\\u2A93',\n        'lessdot': '\\u22D6',\n        'ltdot': '\\u22D6',\n        'lfisht': '\\u297C',\n        'lfr': '\\uD835\\uDD29',\n        'lgE': '\\u2A91',\n        'lharul': '\\u296A',\n        'lhblk': '\\u2584',\n        'ljcy': '\\u0459',\n        'llhard': '\\u296B',\n        'lltri': '\\u25FA',\n        'lmidot': '\\u0140',\n        'lmoust': '\\u23B0',\n        'lmoustache': '\\u23B0',\n        'lnE': '\\u2268',\n        'lneqq': '\\u2268',\n        'lnap': '\\u2A89',\n        'lnapprox': '\\u2A89',\n        'lne': '\\u2A87',\n        'lneq': '\\u2A87',\n        'lnsim': '\\u22E6',\n        'loang': '\\u27EC',\n        'loarr': '\\u21FD',\n        'longmapsto': '\\u27FC',\n        'xmap': '\\u27FC',\n        'looparrowright': '\\u21AC',\n        'rarrlp': '\\u21AC',\n        'lopar': '\\u2985',\n        'lopf': '\\uD835\\uDD5D',\n        'loplus': '\\u2A2D',\n        'lotimes': '\\u2A34',\n        'lowast': '\\u2217',\n        'loz': '\\u25CA',\n        'lozenge': '\\u25CA',\n        'lpar': '\\u0028',\n        'lparlt': '\\u2993',\n        'lrhard': '\\u296D',\n        'lrm': '\\u200E',\n        'lrtri': '\\u22BF',\n        'lsaquo': '\\u2039',\n        'lscr': '\\uD835\\uDCC1',\n        'lsime': '\\u2A8D',\n        'lsimg': '\\u2A8F',\n        'lsquor': '\\u201A',\n        'sbquo': '\\u201A',\n        'lstrok': '\\u0142',\n        'ltcc': '\\u2AA6',\n        'ltcir': '\\u2A79',\n        'ltimes': '\\u22C9',\n        'ltlarr': '\\u2976',\n        'ltquest': '\\u2A7B',\n        'ltrPar': '\\u2996',\n        'ltri': '\\u25C3',\n        'triangleleft': '\\u25C3',\n        'lurdshar': '\\u294A',\n        'luruhar': '\\u2966',\n        'lvertneqq': '\\u2268\\uFE00',\n        'lvnE': '\\u2268\\uFE00',\n        'mDDot': '\\u223A',\n        'macr': '\\u00AF',\n        'strns': '\\u00AF',\n        'male': '\\u2642',\n        'malt': '\\u2720',\n        'maltese': '\\u2720',\n        'marker': '\\u25AE',\n        'mcomma': '\\u2A29',\n        'mcy': '\\u043C',\n        'mdash': '\\u2014',\n        'mfr': '\\uD835\\uDD2A',\n        'mho': '\\u2127',\n        'micro': '\\u00B5',\n        'midcir': '\\u2AF0',\n        'minus': '\\u2212',\n        'minusdu': '\\u2A2A',\n        'mlcp': '\\u2ADB',\n        'models': '\\u22A7',\n        'mopf': '\\uD835\\uDD5E',\n        'mscr': '\\uD835\\uDCC2',\n        'mu': '\\u03BC',\n        'multimap': '\\u22B8',\n        'mumap': '\\u22B8',\n        'nGg': '\\u22D9\\u0338',\n        'nGt': '\\u226B\\u20D2',\n        'nLeftarrow': '\\u21CD',\n        'nlArr': '\\u21CD',\n        'nLeftrightarrow': '\\u21CE',\n        'nhArr': '\\u21CE',\n        'nLl': '\\u22D8\\u0338',\n        'nLt': '\\u226A\\u20D2',\n        'nRightarrow': '\\u21CF',\n        'nrArr': '\\u21CF',\n        'nVDash': '\\u22AF',\n        'nVdash': '\\u22AE',\n        'nacute': '\\u0144',\n        'nang': '\\u2220\\u20D2',\n        'napE': '\\u2A70\\u0338',\n        'napid': '\\u224B\\u0338',\n        'napos': '\\u0149',\n        'natur': '\\u266E',\n        'natural': '\\u266E',\n        'ncap': '\\u2A43',\n        'ncaron': '\\u0148',\n        'ncedil': '\\u0146',\n        'ncongdot': '\\u2A6D\\u0338',\n        'ncup': '\\u2A42',\n        'ncy': '\\u043D',\n        'ndash': '\\u2013',\n        'neArr': '\\u21D7',\n        'nearhk': '\\u2924',\n        'nedot': '\\u2250\\u0338',\n        'nesear': '\\u2928',\n        'toea': '\\u2928',\n        'nfr': '\\uD835\\uDD2B',\n        'nharr': '\\u21AE',\n        'nleftrightarrow': '\\u21AE',\n        'nhpar': '\\u2AF2',\n        'nis': '\\u22FC',\n        'nisd': '\\u22FA',\n        'njcy': '\\u045A',\n        'nlE': '\\u2266\\u0338',\n        'nleqq': '\\u2266\\u0338',\n        'nlarr': '\\u219A',\n        'nleftarrow': '\\u219A',\n        'nldr': '\\u2025',\n        'nopf': '\\uD835\\uDD5F',\n        'not': '\\u00AC',\n        'notinE': '\\u22F9\\u0338',\n        'notindot': '\\u22F5\\u0338',\n        'notinvb': '\\u22F7',\n        'notinvc': '\\u22F6',\n        'notnivb': '\\u22FE',\n        'notnivc': '\\u22FD',\n        'nparsl': '\\u2AFD\\u20E5',\n        'npart': '\\u2202\\u0338',\n        'npolint': '\\u2A14',\n        'nrarr': '\\u219B',\n        'nrightarrow': '\\u219B',\n        'nrarrc': '\\u2933\\u0338',\n        'nrarrw': '\\u219D\\u0338',\n        'nscr': '\\uD835\\uDCC3',\n        'nsub': '\\u2284',\n        'nsubE': '\\u2AC5\\u0338',\n        'nsubseteqq': '\\u2AC5\\u0338',\n        'nsup': '\\u2285',\n        'nsupE': '\\u2AC6\\u0338',\n        'nsupseteqq': '\\u2AC6\\u0338',\n        'ntilde': '\\u00F1',\n        'nu': '\\u03BD',\n        'num': '\\u0023',\n        'numero': '\\u2116',\n        'numsp': '\\u2007',\n        'nvDash': '\\u22AD',\n        'nvHarr': '\\u2904',\n        'nvap': '\\u224D\\u20D2',\n        'nvdash': '\\u22AC',\n        'nvge': '\\u2265\\u20D2',\n        'nvgt': '\\u003E\\u20D2',\n        'nvinfin': '\\u29DE',\n        'nvlArr': '\\u2902',\n        'nvle': '\\u2264\\u20D2',\n        'nvlt': '\\u003C\\u20D2',\n        'nvltrie': '\\u22B4\\u20D2',\n        'nvrArr': '\\u2903',\n        'nvrtrie': '\\u22B5\\u20D2',\n        'nvsim': '\\u223C\\u20D2',\n        'nwArr': '\\u21D6',\n        'nwarhk': '\\u2923',\n        'nwnear': '\\u2927',\n        'oacute': '\\u00F3',\n        'ocirc': '\\u00F4',\n        'ocy': '\\u043E',\n        'odblac': '\\u0151',\n        'odiv': '\\u2A38',\n        'odsold': '\\u29BC',\n        'oelig': '\\u0153',\n        'ofcir': '\\u29BF',\n        'ofr': '\\uD835\\uDD2C',\n        'ogon': '\\u02DB',\n        'ograve': '\\u00F2',\n        'ogt': '\\u29C1',\n        'ohbar': '\\u29B5',\n        'olcir': '\\u29BE',\n        'olcross': '\\u29BB',\n        'olt': '\\u29C0',\n        'omacr': '\\u014D',\n        'omega': '\\u03C9',\n        'omicron': '\\u03BF',\n        'omid': '\\u29B6',\n        'oopf': '\\uD835\\uDD60',\n        'opar': '\\u29B7',\n        'operp': '\\u29B9',\n        'or': '\\u2228',\n        'vee': '\\u2228',\n        'ord': '\\u2A5D',\n        'order': '\\u2134',\n        'orderof': '\\u2134',\n        'oscr': '\\u2134',\n        'ordf': '\\u00AA',\n        'ordm': '\\u00BA',\n        'origof': '\\u22B6',\n        'oror': '\\u2A56',\n        'orslope': '\\u2A57',\n        'orv': '\\u2A5B',\n        'oslash': '\\u00F8',\n        'osol': '\\u2298',\n        'otilde': '\\u00F5',\n        'otimesas': '\\u2A36',\n        'ouml': '\\u00F6',\n        'ovbar': '\\u233D',\n        'para': '\\u00B6',\n        'parsim': '\\u2AF3',\n        'parsl': '\\u2AFD',\n        'pcy': '\\u043F',\n        'percnt': '\\u0025',\n        'period': '\\u002E',\n        'permil': '\\u2030',\n        'pertenk': '\\u2031',\n        'pfr': '\\uD835\\uDD2D',\n        'phi': '\\u03C6',\n        'phiv': '\\u03D5',\n        'straightphi': '\\u03D5',\n        'varphi': '\\u03D5',\n        'phone': '\\u260E',\n        'pi': '\\u03C0',\n        'piv': '\\u03D6',\n        'varpi': '\\u03D6',\n        'planckh': '\\u210E',\n        'plus': '\\u002B',\n        'plusacir': '\\u2A23',\n        'pluscir': '\\u2A22',\n        'plusdu': '\\u2A25',\n        'pluse': '\\u2A72',\n        'plussim': '\\u2A26',\n        'plustwo': '\\u2A27',\n        'pointint': '\\u2A15',\n        'popf': '\\uD835\\uDD61',\n        'pound': '\\u00A3',\n        'prE': '\\u2AB3',\n        'prap': '\\u2AB7',\n        'precapprox': '\\u2AB7',\n        'precnapprox': '\\u2AB9',\n        'prnap': '\\u2AB9',\n        'precneqq': '\\u2AB5',\n        'prnE': '\\u2AB5',\n        'precnsim': '\\u22E8',\n        'prnsim': '\\u22E8',\n        'prime': '\\u2032',\n        'profalar': '\\u232E',\n        'profline': '\\u2312',\n        'profsurf': '\\u2313',\n        'prurel': '\\u22B0',\n        'pscr': '\\uD835\\uDCC5',\n        'psi': '\\u03C8',\n        'puncsp': '\\u2008',\n        'qfr': '\\uD835\\uDD2E',\n        'qopf': '\\uD835\\uDD62',\n        'qprime': '\\u2057',\n        'qscr': '\\uD835\\uDCC6',\n        'quatint': '\\u2A16',\n        'quest': '\\u003F',\n        'rAtail': '\\u291C',\n        'rHar': '\\u2964',\n        'race': '\\u223D\\u0331',\n        'racute': '\\u0155',\n        'raemptyv': '\\u29B3',\n        'rangd': '\\u2992',\n        'range': '\\u29A5',\n        'raquo': '\\u00BB',\n        'rarrap': '\\u2975',\n        'rarrbfs': '\\u2920',\n        'rarrc': '\\u2933',\n        'rarrfs': '\\u291E',\n        'rarrpl': '\\u2945',\n        'rarrsim': '\\u2974',\n        'rarrtl': '\\u21A3',\n        'rightarrowtail': '\\u21A3',\n        'rarrw': '\\u219D',\n        'rightsquigarrow': '\\u219D',\n        'ratail': '\\u291A',\n        'ratio': '\\u2236',\n        'rbbrk': '\\u2773',\n        'rbrace': '\\u007D',\n        'rcub': '\\u007D',\n        'rbrack': '\\u005D',\n        'rsqb': '\\u005D',\n        'rbrke': '\\u298C',\n        'rbrksld': '\\u298E',\n        'rbrkslu': '\\u2990',\n        'rcaron': '\\u0159',\n        'rcedil': '\\u0157',\n        'rcy': '\\u0440',\n        'rdca': '\\u2937',\n        'rdldhar': '\\u2969',\n        'rdsh': '\\u21B3',\n        'rect': '\\u25AD',\n        'rfisht': '\\u297D',\n        'rfr': '\\uD835\\uDD2F',\n        'rharul': '\\u296C',\n        'rho': '\\u03C1',\n        'rhov': '\\u03F1',\n        'varrho': '\\u03F1',\n        'rightrightarrows': '\\u21C9',\n        'rrarr': '\\u21C9',\n        'rightthreetimes': '\\u22CC',\n        'rthree': '\\u22CC',\n        'ring': '\\u02DA',\n        'rlm': '\\u200F',\n        'rmoust': '\\u23B1',\n        'rmoustache': '\\u23B1',\n        'rnmid': '\\u2AEE',\n        'roang': '\\u27ED',\n        'roarr': '\\u21FE',\n        'ropar': '\\u2986',\n        'ropf': '\\uD835\\uDD63',\n        'roplus': '\\u2A2E',\n        'rotimes': '\\u2A35',\n        'rpar': '\\u0029',\n        'rpargt': '\\u2994',\n        'rppolint': '\\u2A12',\n        'rsaquo': '\\u203A',\n        'rscr': '\\uD835\\uDCC7',\n        'rtimes': '\\u22CA',\n        'rtri': '\\u25B9',\n        'triangleright': '\\u25B9',\n        'rtriltri': '\\u29CE',\n        'ruluhar': '\\u2968',\n        'rx': '\\u211E',\n        'sacute': '\\u015B',\n        'scE': '\\u2AB4',\n        'scap': '\\u2AB8',\n        'succapprox': '\\u2AB8',\n        'scaron': '\\u0161',\n        'scedil': '\\u015F',\n        'scirc': '\\u015D',\n        'scnE': '\\u2AB6',\n        'succneqq': '\\u2AB6',\n        'scnap': '\\u2ABA',\n        'succnapprox': '\\u2ABA',\n        'scnsim': '\\u22E9',\n        'succnsim': '\\u22E9',\n        'scpolint': '\\u2A13',\n        'scy': '\\u0441',\n        'sdot': '\\u22C5',\n        'sdote': '\\u2A66',\n        'seArr': '\\u21D8',\n        'sect': '\\u00A7',\n        'semi': '\\u003B',\n        'seswar': '\\u2929',\n        'tosa': '\\u2929',\n        'sext': '\\u2736',\n        'sfr': '\\uD835\\uDD30',\n        'sharp': '\\u266F',\n        'shchcy': '\\u0449',\n        'shcy': '\\u0448',\n        'shy': '\\u00AD',\n        'sigma': '\\u03C3',\n        'sigmaf': '\\u03C2',\n        'sigmav': '\\u03C2',\n        'varsigma': '\\u03C2',\n        'simdot': '\\u2A6A',\n        'simg': '\\u2A9E',\n        'simgE': '\\u2AA0',\n        'siml': '\\u2A9D',\n        'simlE': '\\u2A9F',\n        'simne': '\\u2246',\n        'simplus': '\\u2A24',\n        'simrarr': '\\u2972',\n        'smashp': '\\u2A33',\n        'smeparsl': '\\u29E4',\n        'smile': '\\u2323',\n        'ssmile': '\\u2323',\n        'smt': '\\u2AAA',\n        'smte': '\\u2AAC',\n        'smtes': '\\u2AAC\\uFE00',\n        'softcy': '\\u044C',\n        'sol': '\\u002F',\n        'solb': '\\u29C4',\n        'solbar': '\\u233F',\n        'sopf': '\\uD835\\uDD64',\n        'spades': '\\u2660',\n        'spadesuit': '\\u2660',\n        'sqcaps': '\\u2293\\uFE00',\n        'sqcups': '\\u2294\\uFE00',\n        'sscr': '\\uD835\\uDCC8',\n        'star': '\\u2606',\n        'sub': '\\u2282',\n        'subset': '\\u2282',\n        'subE': '\\u2AC5',\n        'subseteqq': '\\u2AC5',\n        'subdot': '\\u2ABD',\n        'subedot': '\\u2AC3',\n        'submult': '\\u2AC1',\n        'subnE': '\\u2ACB',\n        'subsetneqq': '\\u2ACB',\n        'subne': '\\u228A',\n        'subsetneq': '\\u228A',\n        'subplus': '\\u2ABF',\n        'subrarr': '\\u2979',\n        'subsim': '\\u2AC7',\n        'subsub': '\\u2AD5',\n        'subsup': '\\u2AD3',\n        'sung': '\\u266A',\n        'sup1': '\\u00B9',\n        'sup2': '\\u00B2',\n        'sup3': '\\u00B3',\n        'supE': '\\u2AC6',\n        'supseteqq': '\\u2AC6',\n        'supdot': '\\u2ABE',\n        'supdsub': '\\u2AD8',\n        'supedot': '\\u2AC4',\n        'suphsol': '\\u27C9',\n        'suphsub': '\\u2AD7',\n        'suplarr': '\\u297B',\n        'supmult': '\\u2AC2',\n        'supnE': '\\u2ACC',\n        'supsetneqq': '\\u2ACC',\n        'supne': '\\u228B',\n        'supsetneq': '\\u228B',\n        'supplus': '\\u2AC0',\n        'supsim': '\\u2AC8',\n        'supsub': '\\u2AD4',\n        'supsup': '\\u2AD6',\n        'swArr': '\\u21D9',\n        'swnwar': '\\u292A',\n        'szlig': '\\u00DF',\n        'target': '\\u2316',\n        'tau': '\\u03C4',\n        'tcaron': '\\u0165',\n        'tcedil': '\\u0163',\n        'tcy': '\\u0442',\n        'telrec': '\\u2315',\n        'tfr': '\\uD835\\uDD31',\n        'theta': '\\u03B8',\n        'thetasym': '\\u03D1',\n        'thetav': '\\u03D1',\n        'vartheta': '\\u03D1',\n        'thorn': '\\u00FE',\n        'times': '\\u00D7',\n        'timesbar': '\\u2A31',\n        'timesd': '\\u2A30',\n        'topbot': '\\u2336',\n        'topcir': '\\u2AF1',\n        'topf': '\\uD835\\uDD65',\n        'topfork': '\\u2ADA',\n        'tprime': '\\u2034',\n        'triangle': '\\u25B5',\n        'utri': '\\u25B5',\n        'triangleq': '\\u225C',\n        'trie': '\\u225C',\n        'tridot': '\\u25EC',\n        'triminus': '\\u2A3A',\n        'triplus': '\\u2A39',\n        'trisb': '\\u29CD',\n        'tritime': '\\u2A3B',\n        'trpezium': '\\u23E2',\n        'tscr': '\\uD835\\uDCC9',\n        'tscy': '\\u0446',\n        'tshcy': '\\u045B',\n        'tstrok': '\\u0167',\n        'uHar': '\\u2963',\n        'uacute': '\\u00FA',\n        'ubrcy': '\\u045E',\n        'ubreve': '\\u016D',\n        'ucirc': '\\u00FB',\n        'ucy': '\\u0443',\n        'udblac': '\\u0171',\n        'ufisht': '\\u297E',\n        'ufr': '\\uD835\\uDD32',\n        'ugrave': '\\u00F9',\n        'uhblk': '\\u2580',\n        'ulcorn': '\\u231C',\n        'ulcorner': '\\u231C',\n        'ulcrop': '\\u230F',\n        'ultri': '\\u25F8',\n        'umacr': '\\u016B',\n        'uogon': '\\u0173',\n        'uopf': '\\uD835\\uDD66',\n        'upsi': '\\u03C5',\n        'upsilon': '\\u03C5',\n        'upuparrows': '\\u21C8',\n        'uuarr': '\\u21C8',\n        'urcorn': '\\u231D',\n        'urcorner': '\\u231D',\n        'urcrop': '\\u230E',\n        'uring': '\\u016F',\n        'urtri': '\\u25F9',\n        'uscr': '\\uD835\\uDCCA',\n        'utdot': '\\u22F0',\n        'utilde': '\\u0169',\n        'uuml': '\\u00FC',\n        'uwangle': '\\u29A7',\n        'vBar': '\\u2AE8',\n        'vBarv': '\\u2AE9',\n        'vangrt': '\\u299C',\n        'varsubsetneq': '\\u228A\\uFE00',\n        'vsubne': '\\u228A\\uFE00',\n        'varsubsetneqq': '\\u2ACB\\uFE00',\n        'vsubnE': '\\u2ACB\\uFE00',\n        'varsupsetneq': '\\u228B\\uFE00',\n        'vsupne': '\\u228B\\uFE00',\n        'varsupsetneqq': '\\u2ACC\\uFE00',\n        'vsupnE': '\\u2ACC\\uFE00',\n        'vcy': '\\u0432',\n        'veebar': '\\u22BB',\n        'veeeq': '\\u225A',\n        'vellip': '\\u22EE',\n        'vfr': '\\uD835\\uDD33',\n        'vopf': '\\uD835\\uDD67',\n        'vscr': '\\uD835\\uDCCB',\n        'vzigzag': '\\u299A',\n        'wcirc': '\\u0175',\n        'wedbar': '\\u2A5F',\n        'wedgeq': '\\u2259',\n        'weierp': '\\u2118',\n        'wp': '\\u2118',\n        'wfr': '\\uD835\\uDD34',\n        'wopf': '\\uD835\\uDD68',\n        'wscr': '\\uD835\\uDCCC',\n        'xfr': '\\uD835\\uDD35',\n        'xi': '\\u03BE',\n        'xnis': '\\u22FB',\n        'xopf': '\\uD835\\uDD69',\n        'xscr': '\\uD835\\uDCCD',\n        'yacute': '\\u00FD',\n        'yacy': '\\u044F',\n        'ycirc': '\\u0177',\n        'ycy': '\\u044B',\n        'yen': '\\u00A5',\n        'yfr': '\\uD835\\uDD36',\n        'yicy': '\\u0457',\n        'yopf': '\\uD835\\uDD6A',\n        'yscr': '\\uD835\\uDCCE',\n        'yucy': '\\u044E',\n        'yuml': '\\u00FF',\n        'zacute': '\\u017A',\n        'zcaron': '\\u017E',\n        'zcy': '\\u0437',\n        'zdot': '\\u017C',\n        'zeta': '\\u03B6',\n        'zfr': '\\uD835\\uDD37',\n        'zhcy': '\\u0436',\n        'zigrarr': '\\u21DD',\n        'zopf': '\\uD835\\uDD6B',\n        'zscr': '\\uD835\\uDCCF',\n        'zwj': '\\u200D',\n        'zwnj': '\\u200C'\n    };\n    // The &ngsp; pseudo-entity is denoting a space. see:\n    // https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart\n    var NGSP_UNICODE = '\\uE500';\n    NAMED_ENTITIES['ngsp'] = NGSP_UNICODE;\n\n    var TokenType;\n    (function (TokenType) {\n        TokenType[TokenType[\"TAG_OPEN_START\"] = 0] = \"TAG_OPEN_START\";\n        TokenType[TokenType[\"TAG_OPEN_END\"] = 1] = \"TAG_OPEN_END\";\n        TokenType[TokenType[\"TAG_OPEN_END_VOID\"] = 2] = \"TAG_OPEN_END_VOID\";\n        TokenType[TokenType[\"TAG_CLOSE\"] = 3] = \"TAG_CLOSE\";\n        TokenType[TokenType[\"INCOMPLETE_TAG_OPEN\"] = 4] = \"INCOMPLETE_TAG_OPEN\";\n        TokenType[TokenType[\"TEXT\"] = 5] = \"TEXT\";\n        TokenType[TokenType[\"ESCAPABLE_RAW_TEXT\"] = 6] = \"ESCAPABLE_RAW_TEXT\";\n        TokenType[TokenType[\"RAW_TEXT\"] = 7] = \"RAW_TEXT\";\n        TokenType[TokenType[\"COMMENT_START\"] = 8] = \"COMMENT_START\";\n        TokenType[TokenType[\"COMMENT_END\"] = 9] = \"COMMENT_END\";\n        TokenType[TokenType[\"CDATA_START\"] = 10] = \"CDATA_START\";\n        TokenType[TokenType[\"CDATA_END\"] = 11] = \"CDATA_END\";\n        TokenType[TokenType[\"ATTR_NAME\"] = 12] = \"ATTR_NAME\";\n        TokenType[TokenType[\"ATTR_QUOTE\"] = 13] = \"ATTR_QUOTE\";\n        TokenType[TokenType[\"ATTR_VALUE\"] = 14] = \"ATTR_VALUE\";\n        TokenType[TokenType[\"DOC_TYPE\"] = 15] = \"DOC_TYPE\";\n        TokenType[TokenType[\"EXPANSION_FORM_START\"] = 16] = \"EXPANSION_FORM_START\";\n        TokenType[TokenType[\"EXPANSION_CASE_VALUE\"] = 17] = \"EXPANSION_CASE_VALUE\";\n        TokenType[TokenType[\"EXPANSION_CASE_EXP_START\"] = 18] = \"EXPANSION_CASE_EXP_START\";\n        TokenType[TokenType[\"EXPANSION_CASE_EXP_END\"] = 19] = \"EXPANSION_CASE_EXP_END\";\n        TokenType[TokenType[\"EXPANSION_FORM_END\"] = 20] = \"EXPANSION_FORM_END\";\n        TokenType[TokenType[\"EOF\"] = 21] = \"EOF\";\n    })(TokenType || (TokenType = {}));\n    var Token = /** @class */ (function () {\n        function Token(type, parts, sourceSpan) {\n            this.type = type;\n            this.parts = parts;\n            this.sourceSpan = sourceSpan;\n        }\n        return Token;\n    }());\n    var TokenError = /** @class */ (function (_super) {\n        __extends(TokenError, _super);\n        function TokenError(errorMsg, tokenType, span) {\n            var _this = _super.call(this, span, errorMsg) || this;\n            _this.tokenType = tokenType;\n            return _this;\n        }\n        return TokenError;\n    }(ParseError));\n    var TokenizeResult = /** @class */ (function () {\n        function TokenizeResult(tokens, errors, nonNormalizedIcuExpressions) {\n            this.tokens = tokens;\n            this.errors = errors;\n            this.nonNormalizedIcuExpressions = nonNormalizedIcuExpressions;\n        }\n        return TokenizeResult;\n    }());\n    function tokenize(source, url, getTagDefinition, options) {\n        if (options === void 0) { options = {}; }\n        var tokenizer = new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, options);\n        tokenizer.tokenize();\n        return new TokenizeResult(mergeTextTokens(tokenizer.tokens), tokenizer.errors, tokenizer.nonNormalizedIcuExpressions);\n    }\n    var _CR_OR_CRLF_REGEXP = /\\r\\n?/g;\n    function _unexpectedCharacterErrorMsg(charCode) {\n        var char = charCode === $EOF ? 'EOF' : String.fromCharCode(charCode);\n        return \"Unexpected character \\\"\" + char + \"\\\"\";\n    }\n    function _unknownEntityErrorMsg(entitySrc) {\n        return \"Unknown entity \\\"\" + entitySrc + \"\\\" - use the \\\"&#<decimal>;\\\" or  \\\"&#x<hex>;\\\" syntax\";\n    }\n    function _unparsableEntityErrorMsg(type, entityStr) {\n        return \"Unable to parse entity \\\"\" + entityStr + \"\\\" - \" + type + \" character reference entities must end with \\\";\\\"\";\n    }\n    var CharacterReferenceType;\n    (function (CharacterReferenceType) {\n        CharacterReferenceType[\"HEX\"] = \"hexadecimal\";\n        CharacterReferenceType[\"DEC\"] = \"decimal\";\n    })(CharacterReferenceType || (CharacterReferenceType = {}));\n    var _ControlFlowError = /** @class */ (function () {\n        function _ControlFlowError(error) {\n            this.error = error;\n        }\n        return _ControlFlowError;\n    }());\n    // See https://www.w3.org/TR/html51/syntax.html#writing-html-documents\n    var _Tokenizer = /** @class */ (function () {\n        /**\n         * @param _file The html source file being tokenized.\n         * @param _getTagDefinition A function that will retrieve a tag definition for a given tag name.\n         * @param options Configuration of the tokenization.\n         */\n        function _Tokenizer(_file, _getTagDefinition, options) {\n            this._getTagDefinition = _getTagDefinition;\n            this._currentTokenStart = null;\n            this._currentTokenType = null;\n            this._expansionCaseStack = [];\n            this._inInterpolation = false;\n            this.tokens = [];\n            this.errors = [];\n            this.nonNormalizedIcuExpressions = [];\n            this._tokenizeIcu = options.tokenizeExpansionForms || false;\n            this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;\n            this._leadingTriviaCodePoints =\n                options.leadingTriviaChars && options.leadingTriviaChars.map(function (c) { return c.codePointAt(0) || 0; });\n            var range = options.range || { endPos: _file.content.length, startPos: 0, startLine: 0, startCol: 0 };\n            this._cursor = options.escapedString ? new EscapedCharacterCursor(_file, range) :\n                new PlainCharacterCursor(_file, range);\n            this._preserveLineEndings = options.preserveLineEndings || false;\n            this._escapedString = options.escapedString || false;\n            this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;\n            try {\n                this._cursor.init();\n            }\n            catch (e) {\n                this.handleError(e);\n            }\n        }\n        _Tokenizer.prototype._processCarriageReturns = function (content) {\n            if (this._preserveLineEndings) {\n                return content;\n            }\n            // https://www.w3.org/TR/html51/syntax.html#preprocessing-the-input-stream\n            // In order to keep the original position in the source, we can not\n            // pre-process it.\n            // Instead CRs are processed right before instantiating the tokens.\n            return content.replace(_CR_OR_CRLF_REGEXP, '\\n');\n        };\n        _Tokenizer.prototype.tokenize = function () {\n            while (this._cursor.peek() !== $EOF) {\n                var start = this._cursor.clone();\n                try {\n                    if (this._attemptCharCode($LT)) {\n                        if (this._attemptCharCode($BANG)) {\n                            if (this._attemptCharCode($LBRACKET)) {\n                                this._consumeCdata(start);\n                            }\n                            else if (this._attemptCharCode($MINUS)) {\n                                this._consumeComment(start);\n                            }\n                            else {\n                                this._consumeDocType(start);\n                            }\n                        }\n                        else if (this._attemptCharCode($SLASH)) {\n                            this._consumeTagClose(start);\n                        }\n                        else {\n                            this._consumeTagOpen(start);\n                        }\n                    }\n                    else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {\n                        this._consumeText();\n                    }\n                }\n                catch (e) {\n                    this.handleError(e);\n                }\n            }\n            this._beginToken(TokenType.EOF);\n            this._endToken([]);\n        };\n        /**\n         * @returns whether an ICU token has been created\n         * @internal\n         */\n        _Tokenizer.prototype._tokenizeExpansionForm = function () {\n            if (this.isExpansionFormStart()) {\n                this._consumeExpansionFormStart();\n                return true;\n            }\n            if (isExpansionCaseStart(this._cursor.peek()) && this._isInExpansionForm()) {\n                this._consumeExpansionCaseStart();\n                return true;\n            }\n            if (this._cursor.peek() === $RBRACE) {\n                if (this._isInExpansionCase()) {\n                    this._consumeExpansionCaseEnd();\n                    return true;\n                }\n                if (this._isInExpansionForm()) {\n                    this._consumeExpansionFormEnd();\n                    return true;\n                }\n            }\n            return false;\n        };\n        _Tokenizer.prototype._beginToken = function (type, start) {\n            if (start === void 0) { start = this._cursor.clone(); }\n            this._currentTokenStart = start;\n            this._currentTokenType = type;\n        };\n        _Tokenizer.prototype._endToken = function (parts, end) {\n            if (this._currentTokenStart === null) {\n                throw new TokenError('Programming error - attempted to end a token when there was no start to the token', this._currentTokenType, this._cursor.getSpan(end));\n            }\n            if (this._currentTokenType === null) {\n                throw new TokenError('Programming error - attempted to end a token which has no token type', null, this._cursor.getSpan(this._currentTokenStart));\n            }\n            var token = new Token(this._currentTokenType, parts, this._cursor.getSpan(this._currentTokenStart, this._leadingTriviaCodePoints));\n            this.tokens.push(token);\n            this._currentTokenStart = null;\n            this._currentTokenType = null;\n            return token;\n        };\n        _Tokenizer.prototype._createError = function (msg, span) {\n            if (this._isInExpansionForm()) {\n                msg += \" (Do you have an unescaped \\\"{\\\" in your template? Use \\\"{{ '{' }}\\\") to escape it.)\";\n            }\n            var error = new TokenError(msg, this._currentTokenType, span);\n            this._currentTokenStart = null;\n            this._currentTokenType = null;\n            return new _ControlFlowError(error);\n        };\n        _Tokenizer.prototype.handleError = function (e) {\n            if (e instanceof CursorError) {\n                e = this._createError(e.msg, this._cursor.getSpan(e.cursor));\n            }\n            if (e instanceof _ControlFlowError) {\n                this.errors.push(e.error);\n            }\n            else {\n                throw e;\n            }\n        };\n        _Tokenizer.prototype._attemptCharCode = function (charCode) {\n            if (this._cursor.peek() === charCode) {\n                this._cursor.advance();\n                return true;\n            }\n            return false;\n        };\n        _Tokenizer.prototype._attemptCharCodeCaseInsensitive = function (charCode) {\n            if (compareCharCodeCaseInsensitive(this._cursor.peek(), charCode)) {\n                this._cursor.advance();\n                return true;\n            }\n            return false;\n        };\n        _Tokenizer.prototype._requireCharCode = function (charCode) {\n            var location = this._cursor.clone();\n            if (!this._attemptCharCode(charCode)) {\n                throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location));\n            }\n        };\n        _Tokenizer.prototype._attemptStr = function (chars) {\n            var len = chars.length;\n            if (this._cursor.charsLeft() < len) {\n                return false;\n            }\n            var initialPosition = this._cursor.clone();\n            for (var i = 0; i < len; i++) {\n                if (!this._attemptCharCode(chars.charCodeAt(i))) {\n                    // If attempting to parse the string fails, we want to reset the parser\n                    // to where it was before the attempt\n                    this._cursor = initialPosition;\n                    return false;\n                }\n            }\n            return true;\n        };\n        _Tokenizer.prototype._attemptStrCaseInsensitive = function (chars) {\n            for (var i = 0; i < chars.length; i++) {\n                if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {\n                    return false;\n                }\n            }\n            return true;\n        };\n        _Tokenizer.prototype._requireStr = function (chars) {\n            var location = this._cursor.clone();\n            if (!this._attemptStr(chars)) {\n                throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location));\n            }\n        };\n        _Tokenizer.prototype._attemptCharCodeUntilFn = function (predicate) {\n            while (!predicate(this._cursor.peek())) {\n                this._cursor.advance();\n            }\n        };\n        _Tokenizer.prototype._requireCharCodeUntilFn = function (predicate, len) {\n            var start = this._cursor.clone();\n            this._attemptCharCodeUntilFn(predicate);\n            if (this._cursor.diff(start) < len) {\n                throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));\n            }\n        };\n        _Tokenizer.prototype._attemptUntilChar = function (char) {\n            while (this._cursor.peek() !== char) {\n                this._cursor.advance();\n            }\n        };\n        _Tokenizer.prototype._readChar = function (decodeEntities) {\n            if (decodeEntities && this._cursor.peek() === $AMPERSAND) {\n                return this._decodeEntity();\n            }\n            else {\n                // Don't rely upon reading directly from `_input` as the actual char value\n                // may have been generated from an escape sequence.\n                var char = String.fromCodePoint(this._cursor.peek());\n                this._cursor.advance();\n                return char;\n            }\n        };\n        _Tokenizer.prototype._decodeEntity = function () {\n            var start = this._cursor.clone();\n            this._cursor.advance();\n            if (this._attemptCharCode($HASH)) {\n                var isHex = this._attemptCharCode($x) || this._attemptCharCode($X);\n                var codeStart = this._cursor.clone();\n                this._attemptCharCodeUntilFn(isDigitEntityEnd);\n                if (this._cursor.peek() != $SEMICOLON) {\n                    // Advance cursor to include the peeked character in the string provided to the error\n                    // message.\n                    this._cursor.advance();\n                    var entityType = isHex ? CharacterReferenceType.HEX : CharacterReferenceType.DEC;\n                    throw this._createError(_unparsableEntityErrorMsg(entityType, this._cursor.getChars(start)), this._cursor.getSpan());\n                }\n                var strNum = this._cursor.getChars(codeStart);\n                this._cursor.advance();\n                try {\n                    var charCode = parseInt(strNum, isHex ? 16 : 10);\n                    return String.fromCharCode(charCode);\n                }\n                catch (_a) {\n                    throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)), this._cursor.getSpan());\n                }\n            }\n            else {\n                var nameStart = this._cursor.clone();\n                this._attemptCharCodeUntilFn(isNamedEntityEnd);\n                if (this._cursor.peek() != $SEMICOLON) {\n                    this._cursor = nameStart;\n                    return '&';\n                }\n                var name = this._cursor.getChars(nameStart);\n                this._cursor.advance();\n                var char = NAMED_ENTITIES[name];\n                if (!char) {\n                    throw this._createError(_unknownEntityErrorMsg(name), this._cursor.getSpan(start));\n                }\n                return char;\n            }\n        };\n        _Tokenizer.prototype._consumeRawText = function (decodeEntities, endMarkerPredicate) {\n            this._beginToken(decodeEntities ? TokenType.ESCAPABLE_RAW_TEXT : TokenType.RAW_TEXT);\n            var parts = [];\n            while (true) {\n                var tagCloseStart = this._cursor.clone();\n                var foundEndMarker = endMarkerPredicate();\n                this._cursor = tagCloseStart;\n                if (foundEndMarker) {\n                    break;\n                }\n                parts.push(this._readChar(decodeEntities));\n            }\n            return this._endToken([this._processCarriageReturns(parts.join(''))]);\n        };\n        _Tokenizer.prototype._consumeComment = function (start) {\n            var _this = this;\n            this._beginToken(TokenType.COMMENT_START, start);\n            this._requireCharCode($MINUS);\n            this._endToken([]);\n            this._consumeRawText(false, function () { return _this._attemptStr('-->'); });\n            this._beginToken(TokenType.COMMENT_END);\n            this._requireStr('-->');\n            this._endToken([]);\n        };\n        _Tokenizer.prototype._consumeCdata = function (start) {\n            var _this = this;\n            this._beginToken(TokenType.CDATA_START, start);\n            this._requireStr('CDATA[');\n            this._endToken([]);\n            this._consumeRawText(false, function () { return _this._attemptStr(']]>'); });\n            this._beginToken(TokenType.CDATA_END);\n            this._requireStr(']]>');\n            this._endToken([]);\n        };\n        _Tokenizer.prototype._consumeDocType = function (start) {\n            this._beginToken(TokenType.DOC_TYPE, start);\n            var contentStart = this._cursor.clone();\n            this._attemptUntilChar($GT);\n            var content = this._cursor.getChars(contentStart);\n            this._cursor.advance();\n            this._endToken([content]);\n        };\n        _Tokenizer.prototype._consumePrefixAndName = function () {\n            var nameOrPrefixStart = this._cursor.clone();\n            var prefix = '';\n            while (this._cursor.peek() !== $COLON && !isPrefixEnd(this._cursor.peek())) {\n                this._cursor.advance();\n            }\n            var nameStart;\n            if (this._cursor.peek() === $COLON) {\n                prefix = this._cursor.getChars(nameOrPrefixStart);\n                this._cursor.advance();\n                nameStart = this._cursor.clone();\n            }\n            else {\n                nameStart = nameOrPrefixStart;\n            }\n            this._requireCharCodeUntilFn(isNameEnd, prefix === '' ? 0 : 1);\n            var name = this._cursor.getChars(nameStart);\n            return [prefix, name];\n        };\n        _Tokenizer.prototype._consumeTagOpen = function (start) {\n            var tagName;\n            var prefix;\n            var openTagToken;\n            try {\n                if (!isAsciiLetter(this._cursor.peek())) {\n                    throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));\n                }\n                openTagToken = this._consumeTagOpenStart(start);\n                prefix = openTagToken.parts[0];\n                tagName = openTagToken.parts[1];\n                this._attemptCharCodeUntilFn(isNotWhitespace);\n                while (this._cursor.peek() !== $SLASH && this._cursor.peek() !== $GT &&\n                    this._cursor.peek() !== $LT && this._cursor.peek() !== $EOF) {\n                    this._consumeAttributeName();\n                    this._attemptCharCodeUntilFn(isNotWhitespace);\n                    if (this._attemptCharCode($EQ)) {\n                        this._attemptCharCodeUntilFn(isNotWhitespace);\n                        this._consumeAttributeValue();\n                    }\n                    this._attemptCharCodeUntilFn(isNotWhitespace);\n                }\n                this._consumeTagOpenEnd();\n            }\n            catch (e) {\n                if (e instanceof _ControlFlowError) {\n                    if (openTagToken) {\n                        // We errored before we could close the opening tag, so it is incomplete.\n                        openTagToken.type = TokenType.INCOMPLETE_TAG_OPEN;\n                    }\n                    else {\n                        // When the start tag is invalid, assume we want a \"<\" as text.\n                        // Back to back text tokens are merged at the end.\n                        this._beginToken(TokenType.TEXT, start);\n                        this._endToken(['<']);\n                    }\n                    return;\n                }\n                throw e;\n            }\n            var contentTokenType = this._getTagDefinition(tagName).getContentType(prefix);\n            if (contentTokenType === exports.TagContentType.RAW_TEXT) {\n                this._consumeRawTextWithTagClose(prefix, tagName, false);\n            }\n            else if (contentTokenType === exports.TagContentType.ESCAPABLE_RAW_TEXT) {\n                this._consumeRawTextWithTagClose(prefix, tagName, true);\n            }\n        };\n        _Tokenizer.prototype._consumeRawTextWithTagClose = function (prefix, tagName, decodeEntities) {\n            var _this = this;\n            this._consumeRawText(decodeEntities, function () {\n                if (!_this._attemptCharCode($LT))\n                    return false;\n                if (!_this._attemptCharCode($SLASH))\n                    return false;\n                _this._attemptCharCodeUntilFn(isNotWhitespace);\n                if (!_this._attemptStrCaseInsensitive(tagName))\n                    return false;\n                _this._attemptCharCodeUntilFn(isNotWhitespace);\n                return _this._attemptCharCode($GT);\n            });\n            this._beginToken(TokenType.TAG_CLOSE);\n            this._requireCharCodeUntilFn(function (code) { return code === $GT; }, 3);\n            this._cursor.advance(); // Consume the `>`\n            this._endToken([prefix, tagName]);\n        };\n        _Tokenizer.prototype._consumeTagOpenStart = function (start) {\n            this._beginToken(TokenType.TAG_OPEN_START, start);\n            var parts = this._consumePrefixAndName();\n            return this._endToken(parts);\n        };\n        _Tokenizer.prototype._consumeAttributeName = function () {\n            var attrNameStart = this._cursor.peek();\n            if (attrNameStart === $SQ || attrNameStart === $DQ) {\n                throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());\n            }\n            this._beginToken(TokenType.ATTR_NAME);\n            var prefixAndName = this._consumePrefixAndName();\n            this._endToken(prefixAndName);\n        };\n        _Tokenizer.prototype._consumeAttributeValue = function () {\n            var value;\n            if (this._cursor.peek() === $SQ || this._cursor.peek() === $DQ) {\n                this._beginToken(TokenType.ATTR_QUOTE);\n                var quoteChar = this._cursor.peek();\n                this._cursor.advance();\n                this._endToken([String.fromCodePoint(quoteChar)]);\n                this._beginToken(TokenType.ATTR_VALUE);\n                var parts = [];\n                while (this._cursor.peek() !== quoteChar) {\n                    parts.push(this._readChar(true));\n                }\n                value = parts.join('');\n                this._endToken([this._processCarriageReturns(value)]);\n                this._beginToken(TokenType.ATTR_QUOTE);\n                this._cursor.advance();\n                this._endToken([String.fromCodePoint(quoteChar)]);\n            }\n            else {\n                this._beginToken(TokenType.ATTR_VALUE);\n                var valueStart = this._cursor.clone();\n                this._requireCharCodeUntilFn(isNameEnd, 1);\n                value = this._cursor.getChars(valueStart);\n                this._endToken([this._processCarriageReturns(value)]);\n            }\n        };\n        _Tokenizer.prototype._consumeTagOpenEnd = function () {\n            var tokenType = this._attemptCharCode($SLASH) ? TokenType.TAG_OPEN_END_VOID : TokenType.TAG_OPEN_END;\n            this._beginToken(tokenType);\n            this._requireCharCode($GT);\n            this._endToken([]);\n        };\n        _Tokenizer.prototype._consumeTagClose = function (start) {\n            this._beginToken(TokenType.TAG_CLOSE, start);\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            var prefixAndName = this._consumePrefixAndName();\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            this._requireCharCode($GT);\n            this._endToken(prefixAndName);\n        };\n        _Tokenizer.prototype._consumeExpansionFormStart = function () {\n            this._beginToken(TokenType.EXPANSION_FORM_START);\n            this._requireCharCode($LBRACE);\n            this._endToken([]);\n            this._expansionCaseStack.push(TokenType.EXPANSION_FORM_START);\n            this._beginToken(TokenType.RAW_TEXT);\n            var condition = this._readUntil($COMMA);\n            var normalizedCondition = this._processCarriageReturns(condition);\n            if (this._i18nNormalizeLineEndingsInICUs) {\n                // We explicitly want to normalize line endings for this text.\n                this._endToken([normalizedCondition]);\n            }\n            else {\n                // We are not normalizing line endings.\n                var conditionToken = this._endToken([condition]);\n                if (normalizedCondition !== condition) {\n                    this.nonNormalizedIcuExpressions.push(conditionToken);\n                }\n            }\n            this._requireCharCode($COMMA);\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            this._beginToken(TokenType.RAW_TEXT);\n            var type = this._readUntil($COMMA);\n            this._endToken([type]);\n            this._requireCharCode($COMMA);\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n        };\n        _Tokenizer.prototype._consumeExpansionCaseStart = function () {\n            this._beginToken(TokenType.EXPANSION_CASE_VALUE);\n            var value = this._readUntil($LBRACE).trim();\n            this._endToken([value]);\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            this._beginToken(TokenType.EXPANSION_CASE_EXP_START);\n            this._requireCharCode($LBRACE);\n            this._endToken([]);\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            this._expansionCaseStack.push(TokenType.EXPANSION_CASE_EXP_START);\n        };\n        _Tokenizer.prototype._consumeExpansionCaseEnd = function () {\n            this._beginToken(TokenType.EXPANSION_CASE_EXP_END);\n            this._requireCharCode($RBRACE);\n            this._endToken([]);\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            this._expansionCaseStack.pop();\n        };\n        _Tokenizer.prototype._consumeExpansionFormEnd = function () {\n            this._beginToken(TokenType.EXPANSION_FORM_END);\n            this._requireCharCode($RBRACE);\n            this._endToken([]);\n            this._expansionCaseStack.pop();\n        };\n        _Tokenizer.prototype._consumeText = function () {\n            var start = this._cursor.clone();\n            this._beginToken(TokenType.TEXT, start);\n            var parts = [];\n            do {\n                if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {\n                    parts.push(this._interpolationConfig.start);\n                    this._inInterpolation = true;\n                }\n                else if (this._interpolationConfig && this._inInterpolation &&\n                    this._attemptStr(this._interpolationConfig.end)) {\n                    parts.push(this._interpolationConfig.end);\n                    this._inInterpolation = false;\n                }\n                else {\n                    parts.push(this._readChar(true));\n                }\n            } while (!this._isTextEnd());\n            // It is possible that an interpolation was started but not ended inside this text token.\n            // Make sure that we reset the state of the lexer correctly.\n            this._inInterpolation = false;\n            this._endToken([this._processCarriageReturns(parts.join(''))]);\n        };\n        _Tokenizer.prototype._isTextEnd = function () {\n            if (this._isTagStart() || this._cursor.peek() === $EOF) {\n                return true;\n            }\n            if (this._tokenizeIcu && !this._inInterpolation) {\n                if (this.isExpansionFormStart()) {\n                    // start of an expansion form\n                    return true;\n                }\n                if (this._cursor.peek() === $RBRACE && this._isInExpansionCase()) {\n                    // end of and expansion case\n                    return true;\n                }\n            }\n            return false;\n        };\n        /**\n         * Returns true if the current cursor is pointing to the start of a tag\n         * (opening/closing/comments/cdata/etc).\n         */\n        _Tokenizer.prototype._isTagStart = function () {\n            if (this._cursor.peek() === $LT) {\n                // We assume that `<` followed by whitespace is not the start of an HTML element.\n                var tmp = this._cursor.clone();\n                tmp.advance();\n                // If the next character is alphabetic, ! nor / then it is a tag start\n                var code = tmp.peek();\n                if (($a <= code && code <= $z) || ($A <= code && code <= $Z) ||\n                    code === $SLASH || code === $BANG) {\n                    return true;\n                }\n            }\n            return false;\n        };\n        _Tokenizer.prototype._readUntil = function (char) {\n            var start = this._cursor.clone();\n            this._attemptUntilChar(char);\n            return this._cursor.getChars(start);\n        };\n        _Tokenizer.prototype._isInExpansionCase = function () {\n            return this._expansionCaseStack.length > 0 &&\n                this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n                    TokenType.EXPANSION_CASE_EXP_START;\n        };\n        _Tokenizer.prototype._isInExpansionForm = function () {\n            return this._expansionCaseStack.length > 0 &&\n                this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n                    TokenType.EXPANSION_FORM_START;\n        };\n        _Tokenizer.prototype.isExpansionFormStart = function () {\n            if (this._cursor.peek() !== $LBRACE) {\n                return false;\n            }\n            if (this._interpolationConfig) {\n                var start = this._cursor.clone();\n                var isInterpolation = this._attemptStr(this._interpolationConfig.start);\n                this._cursor = start;\n                return !isInterpolation;\n            }\n            return true;\n        };\n        return _Tokenizer;\n    }());\n    function isNotWhitespace(code) {\n        return !isWhitespace(code) || code === $EOF;\n    }\n    function isNameEnd(code) {\n        return isWhitespace(code) || code === $GT || code === $LT ||\n            code === $SLASH || code === $SQ || code === $DQ || code === $EQ ||\n            code === $EOF;\n    }\n    function isPrefixEnd(code) {\n        return (code < $a || $z < code) && (code < $A || $Z < code) &&\n            (code < $0 || code > $9);\n    }\n    function isDigitEntityEnd(code) {\n        return code == $SEMICOLON || code == $EOF || !isAsciiHexDigit(code);\n    }\n    function isNamedEntityEnd(code) {\n        return code == $SEMICOLON || code == $EOF || !isAsciiLetter(code);\n    }\n    function isExpansionCaseStart(peek) {\n        return peek !== $RBRACE;\n    }\n    function compareCharCodeCaseInsensitive(code1, code2) {\n        return toUpperCaseCharCode(code1) == toUpperCaseCharCode(code2);\n    }\n    function toUpperCaseCharCode(code) {\n        return code >= $a && code <= $z ? code - $a + $A : code;\n    }\n    function mergeTextTokens(srcTokens) {\n        var dstTokens = [];\n        var lastDstToken = undefined;\n        for (var i = 0; i < srcTokens.length; i++) {\n            var token = srcTokens[i];\n            if (lastDstToken && lastDstToken.type == TokenType.TEXT && token.type == TokenType.TEXT) {\n                lastDstToken.parts[0] += token.parts[0];\n                lastDstToken.sourceSpan.end = token.sourceSpan.end;\n            }\n            else {\n                lastDstToken = token;\n                dstTokens.push(lastDstToken);\n            }\n        }\n        return dstTokens;\n    }\n    var PlainCharacterCursor = /** @class */ (function () {\n        function PlainCharacterCursor(fileOrCursor, range) {\n            if (fileOrCursor instanceof PlainCharacterCursor) {\n                this.file = fileOrCursor.file;\n                this.input = fileOrCursor.input;\n                this.end = fileOrCursor.end;\n                var state = fileOrCursor.state;\n                // Note: avoid using `{...fileOrCursor.state}` here as that has a severe performance penalty.\n                // In ES5 bundles the object spread operator is translated into the `__assign` helper, which\n                // is not optimized by VMs as efficiently as a raw object literal. Since this constructor is\n                // called in tight loops, this difference matters.\n                this.state = {\n                    peek: state.peek,\n                    offset: state.offset,\n                    line: state.line,\n                    column: state.column,\n                };\n            }\n            else {\n                if (!range) {\n                    throw new Error('Programming error: the range argument must be provided with a file argument.');\n                }\n                this.file = fileOrCursor;\n                this.input = fileOrCursor.content;\n                this.end = range.endPos;\n                this.state = {\n                    peek: -1,\n                    offset: range.startPos,\n                    line: range.startLine,\n                    column: range.startCol,\n                };\n            }\n        }\n        PlainCharacterCursor.prototype.clone = function () {\n            return new PlainCharacterCursor(this);\n        };\n        PlainCharacterCursor.prototype.peek = function () {\n            return this.state.peek;\n        };\n        PlainCharacterCursor.prototype.charsLeft = function () {\n            return this.end - this.state.offset;\n        };\n        PlainCharacterCursor.prototype.diff = function (other) {\n            return this.state.offset - other.state.offset;\n        };\n        PlainCharacterCursor.prototype.advance = function () {\n            this.advanceState(this.state);\n        };\n        PlainCharacterCursor.prototype.init = function () {\n            this.updatePeek(this.state);\n        };\n        PlainCharacterCursor.prototype.getSpan = function (start, leadingTriviaCodePoints) {\n            start = start || this;\n            var fullStart = start;\n            if (leadingTriviaCodePoints) {\n                while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {\n                    if (fullStart === start) {\n                        start = start.clone();\n                    }\n                    start.advance();\n                }\n            }\n            var startLocation = this.locationFromCursor(start);\n            var endLocation = this.locationFromCursor(this);\n            var fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;\n            return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);\n        };\n        PlainCharacterCursor.prototype.getChars = function (start) {\n            return this.input.substring(start.state.offset, this.state.offset);\n        };\n        PlainCharacterCursor.prototype.charAt = function (pos) {\n            return this.input.charCodeAt(pos);\n        };\n        PlainCharacterCursor.prototype.advanceState = function (state) {\n            if (state.offset >= this.end) {\n                this.state = state;\n                throw new CursorError('Unexpected character \"EOF\"', this);\n            }\n            var currentChar = this.charAt(state.offset);\n            if (currentChar === $LF) {\n                state.line++;\n                state.column = 0;\n            }\n            else if (!isNewLine(currentChar)) {\n                state.column++;\n            }\n            state.offset++;\n            this.updatePeek(state);\n        };\n        PlainCharacterCursor.prototype.updatePeek = function (state) {\n            state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);\n        };\n        PlainCharacterCursor.prototype.locationFromCursor = function (cursor) {\n            return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);\n        };\n        return PlainCharacterCursor;\n    }());\n    var EscapedCharacterCursor = /** @class */ (function (_super) {\n        __extends(EscapedCharacterCursor, _super);\n        function EscapedCharacterCursor(fileOrCursor, range) {\n            var _this = this;\n            if (fileOrCursor instanceof EscapedCharacterCursor) {\n                _this = _super.call(this, fileOrCursor) || this;\n                _this.internalState = Object.assign({}, fileOrCursor.internalState);\n            }\n            else {\n                _this = _super.call(this, fileOrCursor, range) || this;\n                _this.internalState = _this.state;\n            }\n            return _this;\n        }\n        EscapedCharacterCursor.prototype.advance = function () {\n            this.state = this.internalState;\n            _super.prototype.advance.call(this);\n            this.processEscapeSequence();\n        };\n        EscapedCharacterCursor.prototype.init = function () {\n            _super.prototype.init.call(this);\n            this.processEscapeSequence();\n        };\n        EscapedCharacterCursor.prototype.clone = function () {\n            return new EscapedCharacterCursor(this);\n        };\n        EscapedCharacterCursor.prototype.getChars = function (start) {\n            var cursor = start.clone();\n            var chars = '';\n            while (cursor.internalState.offset < this.internalState.offset) {\n                chars += String.fromCodePoint(cursor.peek());\n                cursor.advance();\n            }\n            return chars;\n        };\n        /**\n         * Process the escape sequence that starts at the current position in the text.\n         *\n         * This method is called to ensure that `peek` has the unescaped value of escape sequences.\n         */\n        EscapedCharacterCursor.prototype.processEscapeSequence = function () {\n            var _this = this;\n            var peek = function () { return _this.internalState.peek; };\n            if (peek() === $BACKSLASH) {\n                // We have hit an escape sequence so we need the internal state to become independent\n                // of the external state.\n                this.internalState = Object.assign({}, this.state);\n                // Move past the backslash\n                this.advanceState(this.internalState);\n                // First check for standard control char sequences\n                if (peek() === $n) {\n                    this.state.peek = $LF;\n                }\n                else if (peek() === $r) {\n                    this.state.peek = $CR;\n                }\n                else if (peek() === $v) {\n                    this.state.peek = $VTAB;\n                }\n                else if (peek() === $t) {\n                    this.state.peek = $TAB;\n                }\n                else if (peek() === $b) {\n                    this.state.peek = $BSPACE;\n                }\n                else if (peek() === $f) {\n                    this.state.peek = $FF;\n                }\n                // Now consider more complex sequences\n                else if (peek() === $u) {\n                    // Unicode code-point sequence\n                    this.advanceState(this.internalState); // advance past the `u` char\n                    if (peek() === $LBRACE) {\n                        // Variable length Unicode, e.g. `\\x{123}`\n                        this.advanceState(this.internalState); // advance past the `{` char\n                        // Advance past the variable number of hex digits until we hit a `}` char\n                        var digitStart = this.clone();\n                        var length = 0;\n                        while (peek() !== $RBRACE) {\n                            this.advanceState(this.internalState);\n                            length++;\n                        }\n                        this.state.peek = this.decodeHexDigits(digitStart, length);\n                    }\n                    else {\n                        // Fixed length Unicode, e.g. `\\u1234`\n                        var digitStart = this.clone();\n                        this.advanceState(this.internalState);\n                        this.advanceState(this.internalState);\n                        this.advanceState(this.internalState);\n                        this.state.peek = this.decodeHexDigits(digitStart, 4);\n                    }\n                }\n                else if (peek() === $x) {\n                    // Hex char code, e.g. `\\x2F`\n                    this.advanceState(this.internalState); // advance past the `x` char\n                    var digitStart = this.clone();\n                    this.advanceState(this.internalState);\n                    this.state.peek = this.decodeHexDigits(digitStart, 2);\n                }\n                else if (isOctalDigit(peek())) {\n                    // Octal char code, e.g. `\\012`,\n                    var octal = '';\n                    var length = 0;\n                    var previous = this.clone();\n                    while (isOctalDigit(peek()) && length < 3) {\n                        previous = this.clone();\n                        octal += String.fromCodePoint(peek());\n                        this.advanceState(this.internalState);\n                        length++;\n                    }\n                    this.state.peek = parseInt(octal, 8);\n                    // Backup one char\n                    this.internalState = previous.internalState;\n                }\n                else if (isNewLine(this.internalState.peek)) {\n                    // Line continuation `\\` followed by a new line\n                    this.advanceState(this.internalState); // advance over the newline\n                    this.state = this.internalState;\n                }\n                else {\n                    // If none of the `if` blocks were executed then we just have an escaped normal character.\n                    // In that case we just, effectively, skip the backslash from the character.\n                    this.state.peek = this.internalState.peek;\n                }\n            }\n        };\n        EscapedCharacterCursor.prototype.decodeHexDigits = function (start, length) {\n            var hex = this.input.substr(start.internalState.offset, length);\n            var charCode = parseInt(hex, 16);\n            if (!isNaN(charCode)) {\n                return charCode;\n            }\n            else {\n                start.state = start.internalState;\n                throw new CursorError('Invalid hexadecimal escape sequence', start);\n            }\n        };\n        return EscapedCharacterCursor;\n    }(PlainCharacterCursor));\n    var CursorError = /** @class */ (function () {\n        function CursorError(msg, cursor) {\n            this.msg = msg;\n            this.cursor = cursor;\n        }\n        return CursorError;\n    }());\n\n    var TreeError = /** @class */ (function (_super) {\n        __extends(TreeError, _super);\n        function TreeError(elementName, span, msg) {\n            var _this = _super.call(this, span, msg) || this;\n            _this.elementName = elementName;\n            return _this;\n        }\n        TreeError.create = function (elementName, span, msg) {\n            return new TreeError(elementName, span, msg);\n        };\n        return TreeError;\n    }(ParseError));\n    var ParseTreeResult = /** @class */ (function () {\n        function ParseTreeResult(rootNodes, errors) {\n            this.rootNodes = rootNodes;\n            this.errors = errors;\n        }\n        return ParseTreeResult;\n    }());\n    var Parser = /** @class */ (function () {\n        function Parser(getTagDefinition) {\n            this.getTagDefinition = getTagDefinition;\n        }\n        Parser.prototype.parse = function (source, url, options) {\n            var tokenizeResult = tokenize(source, url, this.getTagDefinition, options);\n            var parser = new _TreeBuilder(tokenizeResult.tokens, this.getTagDefinition);\n            parser.build();\n            return new ParseTreeResult(parser.rootNodes, tokenizeResult.errors.concat(parser.errors));\n        };\n        return Parser;\n    }());\n    var _TreeBuilder = /** @class */ (function () {\n        function _TreeBuilder(tokens, getTagDefinition) {\n            this.tokens = tokens;\n            this.getTagDefinition = getTagDefinition;\n            this._index = -1;\n            this._elementStack = [];\n            this.rootNodes = [];\n            this.errors = [];\n            this._advance();\n        }\n        _TreeBuilder.prototype.build = function () {\n            while (this._peek.type !== TokenType.EOF) {\n                if (this._peek.type === TokenType.TAG_OPEN_START ||\n                    this._peek.type === TokenType.INCOMPLETE_TAG_OPEN) {\n                    this._consumeStartTag(this._advance());\n                }\n                else if (this._peek.type === TokenType.TAG_CLOSE) {\n                    this._consumeEndTag(this._advance());\n                }\n                else if (this._peek.type === TokenType.CDATA_START) {\n                    this._closeVoidElement();\n                    this._consumeCdata(this._advance());\n                }\n                else if (this._peek.type === TokenType.COMMENT_START) {\n                    this._closeVoidElement();\n                    this._consumeComment(this._advance());\n                }\n                else if (this._peek.type === TokenType.TEXT || this._peek.type === TokenType.RAW_TEXT ||\n                    this._peek.type === TokenType.ESCAPABLE_RAW_TEXT) {\n                    this._closeVoidElement();\n                    this._consumeText(this._advance());\n                }\n                else if (this._peek.type === TokenType.EXPANSION_FORM_START) {\n                    this._consumeExpansion(this._advance());\n                }\n                else {\n                    // Skip all other tokens...\n                    this._advance();\n                }\n            }\n        };\n        _TreeBuilder.prototype._advance = function () {\n            var prev = this._peek;\n            if (this._index < this.tokens.length - 1) {\n                // Note: there is always an EOF token at the end\n                this._index++;\n            }\n            this._peek = this.tokens[this._index];\n            return prev;\n        };\n        _TreeBuilder.prototype._advanceIf = function (type) {\n            if (this._peek.type === type) {\n                return this._advance();\n            }\n            return null;\n        };\n        _TreeBuilder.prototype._consumeCdata = function (_startToken) {\n            this._consumeText(this._advance());\n            this._advanceIf(TokenType.CDATA_END);\n        };\n        _TreeBuilder.prototype._consumeComment = function (token) {\n            var text = this._advanceIf(TokenType.RAW_TEXT);\n            this._advanceIf(TokenType.COMMENT_END);\n            var value = text != null ? text.parts[0].trim() : null;\n            this._addToParent(new Comment$1(value, token.sourceSpan));\n        };\n        _TreeBuilder.prototype._consumeExpansion = function (token) {\n            var switchValue = this._advance();\n            var type = this._advance();\n            var cases = [];\n            // read =\n            while (this._peek.type === TokenType.EXPANSION_CASE_VALUE) {\n                var expCase = this._parseExpansionCase();\n                if (!expCase)\n                    return; // error\n                cases.push(expCase);\n            }\n            // read the final }\n            if (this._peek.type !== TokenType.EXPANSION_FORM_END) {\n                this.errors.push(TreeError.create(null, this._peek.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                return;\n            }\n            var sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);\n            this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));\n            this._advance();\n        };\n        _TreeBuilder.prototype._parseExpansionCase = function () {\n            var value = this._advance();\n            // read {\n            if (this._peek.type !== TokenType.EXPANSION_CASE_EXP_START) {\n                this.errors.push(TreeError.create(null, this._peek.sourceSpan, \"Invalid ICU message. Missing '{'.\"));\n                return null;\n            }\n            // read until }\n            var start = this._advance();\n            var exp = this._collectExpansionExpTokens(start);\n            if (!exp)\n                return null;\n            var end = this._advance();\n            exp.push(new Token(TokenType.EOF, [], end.sourceSpan));\n            // parse everything in between { and }\n            var expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);\n            expansionCaseParser.build();\n            if (expansionCaseParser.errors.length > 0) {\n                this.errors = this.errors.concat(expansionCaseParser.errors);\n                return null;\n            }\n            var sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);\n            var expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);\n            return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);\n        };\n        _TreeBuilder.prototype._collectExpansionExpTokens = function (start) {\n            var exp = [];\n            var expansionFormStack = [TokenType.EXPANSION_CASE_EXP_START];\n            while (true) {\n                if (this._peek.type === TokenType.EXPANSION_FORM_START ||\n                    this._peek.type === TokenType.EXPANSION_CASE_EXP_START) {\n                    expansionFormStack.push(this._peek.type);\n                }\n                if (this._peek.type === TokenType.EXPANSION_CASE_EXP_END) {\n                    if (lastOnStack(expansionFormStack, TokenType.EXPANSION_CASE_EXP_START)) {\n                        expansionFormStack.pop();\n                        if (expansionFormStack.length == 0)\n                            return exp;\n                    }\n                    else {\n                        this.errors.push(TreeError.create(null, start.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                        return null;\n                    }\n                }\n                if (this._peek.type === TokenType.EXPANSION_FORM_END) {\n                    if (lastOnStack(expansionFormStack, TokenType.EXPANSION_FORM_START)) {\n                        expansionFormStack.pop();\n                    }\n                    else {\n                        this.errors.push(TreeError.create(null, start.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                        return null;\n                    }\n                }\n                if (this._peek.type === TokenType.EOF) {\n                    this.errors.push(TreeError.create(null, start.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                    return null;\n                }\n                exp.push(this._advance());\n            }\n        };\n        _TreeBuilder.prototype._consumeText = function (token) {\n            var text = token.parts[0];\n            if (text.length > 0 && text[0] == '\\n') {\n                var parent = this._getParentElement();\n                if (parent != null && parent.children.length == 0 &&\n                    this.getTagDefinition(parent.name).ignoreFirstLf) {\n                    text = text.substring(1);\n                }\n            }\n            if (text.length > 0) {\n                this._addToParent(new Text$3(text, token.sourceSpan));\n            }\n        };\n        _TreeBuilder.prototype._closeVoidElement = function () {\n            var el = this._getParentElement();\n            if (el && this.getTagDefinition(el.name).isVoid) {\n                this._elementStack.pop();\n            }\n        };\n        _TreeBuilder.prototype._consumeStartTag = function (startTagToken) {\n            var _a = __read(startTagToken.parts, 2), prefix = _a[0], name = _a[1];\n            var attrs = [];\n            while (this._peek.type === TokenType.ATTR_NAME) {\n                attrs.push(this._consumeAttr(this._advance()));\n            }\n            var fullName = this._getElementFullName(prefix, name, this._getParentElement());\n            var selfClosing = false;\n            // Note: There could have been a tokenizer error\n            // so that we don't get a token for the end tag...\n            if (this._peek.type === TokenType.TAG_OPEN_END_VOID) {\n                this._advance();\n                selfClosing = true;\n                var tagDef = this.getTagDefinition(fullName);\n                if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {\n                    this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, \"Only void and foreign elements can be self closed \\\"\" + startTagToken.parts[1] + \"\\\"\"));\n                }\n            }\n            else if (this._peek.type === TokenType.TAG_OPEN_END) {\n                this._advance();\n                selfClosing = false;\n            }\n            var end = this._peek.sourceSpan.fullStart;\n            var span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);\n            // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n            var startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);\n            var el = new Element$1(fullName, attrs, [], span, startSpan, undefined);\n            this._pushElement(el);\n            if (selfClosing) {\n                // Elements that are self-closed have their `endSourceSpan` set to the full span, as the\n                // element start tag also represents the end tag.\n                this._popElement(fullName, span);\n            }\n            else if (startTagToken.type === TokenType.INCOMPLETE_TAG_OPEN) {\n                // We already know the opening tag is not complete, so it is unlikely it has a corresponding\n                // close tag. Let's optimistically parse it as a full element and emit an error.\n                this._popElement(fullName, null);\n                this.errors.push(TreeError.create(fullName, span, \"Opening tag \\\"\" + fullName + \"\\\" not terminated.\"));\n            }\n        };\n        _TreeBuilder.prototype._pushElement = function (el) {\n            var parentEl = this._getParentElement();\n            if (parentEl && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {\n                this._elementStack.pop();\n            }\n            this._addToParent(el);\n            this._elementStack.push(el);\n        };\n        _TreeBuilder.prototype._consumeEndTag = function (endTagToken) {\n            var fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement());\n            if (this.getTagDefinition(fullName).isVoid) {\n                this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, \"Void elements do not have end tags \\\"\" + endTagToken.parts[1] + \"\\\"\"));\n            }\n            else if (!this._popElement(fullName, endTagToken.sourceSpan)) {\n                var errMsg = \"Unexpected closing tag \\\"\" + fullName + \"\\\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags\";\n                this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));\n            }\n        };\n        /**\n         * Closes the nearest element with the tag name `fullName` in the parse tree.\n         * `endSourceSpan` is the span of the closing tag, or null if the element does\n         * not have a closing tag (for example, this happens when an incomplete\n         * opening tag is recovered).\n         */\n        _TreeBuilder.prototype._popElement = function (fullName, endSourceSpan) {\n            var unexpectedCloseTagDetected = false;\n            for (var stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n                var el = this._elementStack[stackIndex];\n                if (el.name == fullName) {\n                    // Record the parse span with the element that is being closed. Any elements that are\n                    // removed from the element stack at this point are closed implicitly, so they won't get\n                    // an end source span (as there is no explicit closing element).\n                    el.endSourceSpan = endSourceSpan;\n                    el.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : el.sourceSpan.end;\n                    this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);\n                    return !unexpectedCloseTagDetected;\n                }\n                if (!this.getTagDefinition(el.name).closedByParent) {\n                    // Note that we encountered an unexpected close tag but continue processing the element\n                    // stack so we can assign an `endSourceSpan` if there is a corresponding start tag for this\n                    // end tag in the stack.\n                    unexpectedCloseTagDetected = true;\n                }\n            }\n            return false;\n        };\n        _TreeBuilder.prototype._consumeAttr = function (attrName) {\n            var fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);\n            var end = attrName.sourceSpan.end;\n            var value = '';\n            var valueSpan = undefined;\n            if (this._peek.type === TokenType.ATTR_QUOTE) {\n                this._advance();\n            }\n            if (this._peek.type === TokenType.ATTR_VALUE) {\n                var valueToken = this._advance();\n                value = valueToken.parts[0];\n                end = valueToken.sourceSpan.end;\n                valueSpan = valueToken.sourceSpan;\n            }\n            if (this._peek.type === TokenType.ATTR_QUOTE) {\n                var quoteToken = this._advance();\n                end = quoteToken.sourceSpan.end;\n            }\n            var keySpan = new ParseSourceSpan(attrName.sourceSpan.start, attrName.sourceSpan.end);\n            return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end, attrName.sourceSpan.fullStart), keySpan, valueSpan);\n        };\n        _TreeBuilder.prototype._getParentElement = function () {\n            return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;\n        };\n        _TreeBuilder.prototype._addToParent = function (node) {\n            var parent = this._getParentElement();\n            if (parent != null) {\n                parent.children.push(node);\n            }\n            else {\n                this.rootNodes.push(node);\n            }\n        };\n        _TreeBuilder.prototype._getElementFullName = function (prefix, localName, parentElement) {\n            if (prefix === '') {\n                prefix = this.getTagDefinition(localName).implicitNamespacePrefix || '';\n                if (prefix === '' && parentElement != null) {\n                    var parentTagName = splitNsName(parentElement.name)[1];\n                    var parentTagDefinition = this.getTagDefinition(parentTagName);\n                    if (!parentTagDefinition.preventNamespaceInheritance) {\n                        prefix = getNsPrefix(parentElement.name);\n                    }\n                }\n            }\n            return mergeNsAndName(prefix, localName);\n        };\n        return _TreeBuilder;\n    }());\n    function lastOnStack(stack, element) {\n        return stack.length > 0 && stack[stack.length - 1] === element;\n    }\n\n    var HtmlParser = /** @class */ (function (_super) {\n        __extends(HtmlParser, _super);\n        function HtmlParser() {\n            return _super.call(this, getHtmlTagDefinition) || this;\n        }\n        HtmlParser.prototype.parse = function (source, url, options) {\n            return _super.prototype.parse.call(this, source, url, options);\n        };\n        return HtmlParser;\n    }(Parser));\n\n    /**\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://angular.io/license\n     */\n    var PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';\n    var SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);\n    // Equivalent to \\s with \\u00a0 (non-breaking space) excluded.\n    // Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n    var WS_CHARS = ' \\f\\n\\r\\t\\v\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';\n    var NO_WS_REGEXP = new RegExp(\"[^\" + WS_CHARS + \"]\");\n    var WS_REPLACE_REGEXP = new RegExp(\"[\" + WS_CHARS + \"]{2,}\", 'g');\n    function hasPreserveWhitespacesAttr(attrs) {\n        return attrs.some(function (attr) { return attr.name === PRESERVE_WS_ATTR_NAME; });\n    }\n    /**\n     * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:\n     * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32\n     * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character\n     * and later on replaced by a space. We are re-implementing the same idea here.\n     */\n    function replaceNgsp(value) {\n        // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE\n        return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');\n    }\n    /**\n     * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:\n     * - consider spaces, tabs and new lines as whitespace characters;\n     * - drop text nodes consisting of whitespace characters only;\n     * - for all other text nodes replace consecutive whitespace characters with one space;\n     * - convert &ngsp; pseudo-entity to a single space;\n     *\n     * Removal and trimming of whitespaces have positive performance impact (less code to generate\n     * while compiling templates, faster view creation). At the same time it can be \"destructive\"\n     * in some cases (whitespaces can influence layout). Because of the potential of breaking layout\n     * this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for\n     * whitespace removal. The default option for whitespace removal will be revisited in Angular 6\n     * and might be changed to \"on\" by default.\n     */\n    var WhitespaceVisitor = /** @class */ (function () {\n        function WhitespaceVisitor() {\n        }\n        WhitespaceVisitor.prototype.visitElement = function (element, context) {\n            if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {\n                // don't descent into elements where we need to preserve whitespaces\n                // but still visit all attributes to eliminate one used as a market to preserve WS\n                return new Element$1(element.name, visitAll$1(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);\n            }\n            return new Element$1(element.name, element.attrs, visitAllWithSiblings(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);\n        };\n        WhitespaceVisitor.prototype.visitAttribute = function (attribute, context) {\n            return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;\n        };\n        WhitespaceVisitor.prototype.visitText = function (text, context) {\n            var isNotBlank = text.value.match(NO_WS_REGEXP);\n            var hasExpansionSibling = context &&\n                (context.prev instanceof Expansion || context.next instanceof Expansion);\n            if (isNotBlank || hasExpansionSibling) {\n                return new Text$3(replaceNgsp(text.value).replace(WS_REPLACE_REGEXP, ' '), text.sourceSpan, text.i18n);\n            }\n            return null;\n        };\n        WhitespaceVisitor.prototype.visitComment = function (comment, context) {\n            return comment;\n        };\n        WhitespaceVisitor.prototype.visitExpansion = function (expansion, context) {\n            return expansion;\n        };\n        WhitespaceVisitor.prototype.visitExpansionCase = function (expansionCase, context) {\n            return expansionCase;\n        };\n        return WhitespaceVisitor;\n    }());\n    function removeWhitespaces(htmlAstWithErrors) {\n        return new ParseTreeResult(visitAll$1(new WhitespaceVisitor(), htmlAstWithErrors.rootNodes), htmlAstWithErrors.errors);\n    }\n    function visitAllWithSiblings(visitor, nodes) {\n        var result = [];\n        nodes.forEach(function (ast, i) {\n            var context = { prev: nodes[i - 1], next: nodes[i + 1] };\n            var astResult = ast.visit(visitor, context);\n            if (astResult) {\n                result.push(astResult);\n            }\n        });\n        return result;\n    }\n\n    // http://cldr.unicode.org/index/cldr-spec/plural-rules\n    var PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n    /**\n     * Expands special forms into elements.\n     *\n     * For example,\n     *\n     * ```\n     * { messages.length, plural,\n     *   =0 {zero}\n     *   =1 {one}\n     *   other {more than one}\n     * }\n     * ```\n     *\n     * will be expanded into\n     *\n     * ```\n     * <ng-container [ngPlural]=\"messages.length\">\n     *   <ng-template ngPluralCase=\"=0\">zero</ng-template>\n     *   <ng-template ngPluralCase=\"=1\">one</ng-template>\n     *   <ng-template ngPluralCase=\"other\">more than one</ng-template>\n     * </ng-container>\n     * ```\n     */\n    function expandNodes(nodes) {\n        var expander = new _Expander();\n        return new ExpansionResult(visitAll$1(expander, nodes), expander.isExpanded, expander.errors);\n    }\n    var ExpansionResult = /** @class */ (function () {\n        function ExpansionResult(nodes, expanded, errors) {\n            this.nodes = nodes;\n            this.expanded = expanded;\n            this.errors = errors;\n        }\n        return ExpansionResult;\n    }());\n    var ExpansionError = /** @class */ (function (_super) {\n        __extends(ExpansionError, _super);\n        function ExpansionError(span, errorMsg) {\n            return _super.call(this, span, errorMsg) || this;\n        }\n        return ExpansionError;\n    }(ParseError));\n    /**\n     * Expand expansion forms (plural, select) to directives\n     *\n     * @internal\n     */\n    var _Expander = /** @class */ (function () {\n        function _Expander() {\n            this.isExpanded = false;\n            this.errors = [];\n        }\n        _Expander.prototype.visitElement = function (element, context) {\n            return new Element$1(element.name, element.attrs, visitAll$1(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n        };\n        _Expander.prototype.visitAttribute = function (attribute, context) {\n            return attribute;\n        };\n        _Expander.prototype.visitText = function (text, context) {\n            return text;\n        };\n        _Expander.prototype.visitComment = function (comment, context) {\n            return comment;\n        };\n        _Expander.prototype.visitExpansion = function (icu, context) {\n            this.isExpanded = true;\n            return icu.type == 'plural' ? _expandPluralForm(icu, this.errors) :\n                _expandDefaultForm(icu, this.errors);\n        };\n        _Expander.prototype.visitExpansionCase = function (icuCase, context) {\n            throw new Error('Should not be reached');\n        };\n        return _Expander;\n    }());\n    // Plural forms are expanded to `NgPlural` and `NgPluralCase`s\n    function _expandPluralForm(ast, errors) {\n        var children = ast.cases.map(function (c) {\n            if (PLURAL_CASES.indexOf(c.value) == -1 && !c.value.match(/^=\\d+$/)) {\n                errors.push(new ExpansionError(c.valueSourceSpan, \"Plural cases should be \\\"=<number>\\\" or one of \" + PLURAL_CASES.join(', ')));\n            }\n            var expansionResult = expandNodes(c.expression);\n            errors.push.apply(errors, __spreadArray([], __read(expansionResult.errors)));\n            return new Element$1(\"ng-template\", [new Attribute('ngPluralCase', \"\" + c.value, c.valueSourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n        });\n        var switchAttr = new Attribute('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */);\n        return new Element$1('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n    }\n    // ICU messages (excluding plural form) are expanded to `NgSwitch`  and `NgSwitchCase`s\n    function _expandDefaultForm(ast, errors) {\n        var children = ast.cases.map(function (c) {\n            var expansionResult = expandNodes(c.expression);\n            errors.push.apply(errors, __spreadArray([], __read(expansionResult.errors)));\n            if (c.value === 'other') {\n                // other is the default case when no values match\n                return new Element$1(\"ng-template\", [new Attribute('ngSwitchDefault', '', c.valueSourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n            }\n            return new Element$1(\"ng-template\", [new Attribute('ngSwitchCase', \"\" + c.value, c.valueSourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n        });\n        var switchAttr = new Attribute('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */);\n        return new Element$1('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n    }\n\n    var _a;\n    /**\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://angular.io/license\n     */\n    /**\n     * A segment of text within the template.\n     */\n    var TextAst = /** @class */ (function () {\n        function TextAst(value, ngContentIndex, sourceSpan) {\n            this.value = value;\n            this.ngContentIndex = ngContentIndex;\n            this.sourceSpan = sourceSpan;\n        }\n        TextAst.prototype.visit = function (visitor, context) {\n            return visitor.visitText(this, context);\n        };\n        return TextAst;\n    }());\n    /**\n     * A bound expression within the text of a template.\n     */\n    var BoundTextAst = /** @class */ (function () {\n        function BoundTextAst(value, ngContentIndex, sourceSpan) {\n            this.value = value;\n            this.ngContentIndex = ngContentIndex;\n            this.sourceSpan = sourceSpan;\n        }\n        BoundTextAst.prototype.visit = function (visitor, context) {\n            return visitor.visitBoundText(this, context);\n        };\n        return BoundTextAst;\n    }());\n    /**\n     * A plain attribute on an element.\n     */\n    var AttrAst = /** @class */ (function () {\n        function AttrAst(name, value, sourceSpan) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        AttrAst.prototype.visit = function (visitor, context) {\n            return visitor.visitAttr(this, context);\n        };\n        return AttrAst;\n    }());\n    var BoundPropertyMapping = (_a = {},\n        _a[4 /* Animation */] = 4 /* Animation */,\n        _a[1 /* Attribute */] = 1 /* Attribute */,\n        _a[2 /* Class */] = 2 /* Class */,\n        _a[0 /* Property */] = 0 /* Property */,\n        _a[3 /* Style */] = 3 /* Style */,\n        _a);\n    /**\n     * A binding for an element property (e.g. `[property]=\"expression\"`) or an animation trigger (e.g.\n     * `[@trigger]=\"stateExp\"`)\n     */\n    var BoundElementPropertyAst = /** @class */ (function () {\n        function BoundElementPropertyAst(name, type, securityContext, value, unit, sourceSpan) {\n            this.name = name;\n            this.type = type;\n            this.securityContext = securityContext;\n            this.value = value;\n            this.unit = unit;\n            this.sourceSpan = sourceSpan;\n            this.isAnimation = this.type === 4 /* Animation */;\n        }\n        BoundElementPropertyAst.fromBoundProperty = function (prop) {\n            var type = BoundPropertyMapping[prop.type];\n            return new BoundElementPropertyAst(prop.name, type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan);\n        };\n        BoundElementPropertyAst.prototype.visit = function (visitor, context) {\n            return visitor.visitElementProperty(this, context);\n        };\n        return BoundElementPropertyAst;\n    }());\n    /**\n     * A binding for an element event (e.g. `(event)=\"handler()\"`) or an animation trigger event (e.g.\n     * `(@trigger.phase)=\"callback($event)\"`).\n     */\n    var BoundEventAst = /** @class */ (function () {\n        function BoundEventAst(name, target, phase, handler, sourceSpan, handlerSpan) {\n            this.name = name;\n            this.target = target;\n            this.phase = phase;\n            this.handler = handler;\n            this.sourceSpan = sourceSpan;\n            this.handlerSpan = handlerSpan;\n            this.fullName = BoundEventAst.calcFullName(this.name, this.target, this.phase);\n            this.isAnimation = !!this.phase;\n        }\n        BoundEventAst.calcFullName = function (name, target, phase) {\n            if (target) {\n                return target + \":\" + name;\n            }\n            if (phase) {\n                return \"@\" + name + \".\" + phase;\n            }\n            return name;\n        };\n        BoundEventAst.fromParsedEvent = function (event) {\n            var target = event.type === 0 /* Regular */ ? event.targetOrPhase : null;\n            var phase = event.type === 1 /* Animation */ ? event.targetOrPhase : null;\n            return new BoundEventAst(event.name, target, phase, event.handler, event.sourceSpan, event.handlerSpan);\n        };\n        BoundEventAst.prototype.visit = function (visitor, context) {\n            return visitor.visitEvent(this, context);\n        };\n        return BoundEventAst;\n    }());\n    /**\n     * A reference declaration on an element (e.g. `let someName=\"expression\"`).\n     */\n    var ReferenceAst = /** @class */ (function () {\n        function ReferenceAst(name, value, originalValue, sourceSpan) {\n            this.name = name;\n            this.value = value;\n            this.originalValue = originalValue;\n            this.sourceSpan = sourceSpan;\n        }\n        ReferenceAst.prototype.visit = function (visitor, context) {\n            return visitor.visitReference(this, context);\n        };\n        return ReferenceAst;\n    }());\n    /**\n     * A variable declaration on a <ng-template> (e.g. `var-someName=\"someLocalName\"`).\n     */\n    var VariableAst = /** @class */ (function () {\n        function VariableAst(name, value, sourceSpan, valueSpan) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n            this.valueSpan = valueSpan;\n        }\n        VariableAst.fromParsedVariable = function (v) {\n            return new VariableAst(v.name, v.value, v.sourceSpan, v.valueSpan);\n        };\n        VariableAst.prototype.visit = function (visitor, context) {\n            return visitor.visitVariable(this, context);\n        };\n        return VariableAst;\n    }());\n    /**\n     * An element declaration in a template.\n     */\n    var ElementAst = /** @class */ (function () {\n        function ElementAst(name, attrs, inputs, outputs, references, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan, endSourceSpan) {\n            this.name = name;\n            this.attrs = attrs;\n            this.inputs = inputs;\n            this.outputs = outputs;\n            this.references = references;\n            this.directives = directives;\n            this.providers = providers;\n            this.hasViewContainer = hasViewContainer;\n            this.queryMatches = queryMatches;\n            this.children = children;\n            this.ngContentIndex = ngContentIndex;\n            this.sourceSpan = sourceSpan;\n            this.endSourceSpan = endSourceSpan;\n        }\n        ElementAst.prototype.visit = function (visitor, context) {\n            return visitor.visitElement(this, context);\n        };\n        return ElementAst;\n    }());\n    /**\n     * A `<ng-template>` element included in an Angular template.\n     */\n    var EmbeddedTemplateAst = /** @class */ (function () {\n        function EmbeddedTemplateAst(attrs, outputs, references, variables, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan) {\n            this.attrs = attrs;\n            this.outputs = outputs;\n            this.references = references;\n            this.variables = variables;\n            this.directives = directives;\n            this.providers = providers;\n            this.hasViewContainer = hasViewContainer;\n            this.queryMatches = queryMatches;\n            this.children = children;\n            this.ngContentIndex = ngContentIndex;\n            this.sourceSpan = sourceSpan;\n        }\n        EmbeddedTemplateAst.prototype.visit = function (visitor, context) {\n            return visitor.visitEmbeddedTemplate(this, context);\n        };\n        return EmbeddedTemplateAst;\n    }());\n    /**\n     * A directive property with a bound value (e.g. `*ngIf=\"condition\").\n     */\n    var BoundDirectivePropertyAst = /** @class */ (function () {\n        function BoundDirectivePropertyAst(directiveName, templateName, value, sourceSpan) {\n            this.directiveName = directiveName;\n            this.templateName = templateName;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        BoundDirectivePropertyAst.prototype.visit = function (visitor, context) {\n            return visitor.visitDirectiveProperty(this, context);\n        };\n        return BoundDirectivePropertyAst;\n    }());\n    /**\n     * A directive declared on an element.\n     */\n    var DirectiveAst = /** @class */ (function () {\n        function DirectiveAst(directive, inputs, hostProperties, hostEvents, contentQueryStartId, sourceSpan) {\n            this.directive = directive;\n            this.inputs = inputs;\n            this.hostProperties = hostProperties;\n            this.hostEvents = hostEvents;\n            this.contentQueryStartId = contentQueryStartId;\n            this.sourceSpan = sourceSpan;\n        }\n        DirectiveAst.prototype.visit = function (visitor, context) {\n            return visitor.visitDirective(this, context);\n        };\n        return DirectiveAst;\n    }());\n    /**\n     * A provider declared on an element\n     */\n    var ProviderAst = /** @class */ (function () {\n        function ProviderAst(token, multiProvider, eager, providers, providerType, lifecycleHooks, sourceSpan, isModule) {\n            this.token = token;\n            this.multiProvider = multiProvider;\n            this.eager = eager;\n            this.providers = providers;\n            this.providerType = providerType;\n            this.lifecycleHooks = lifecycleHooks;\n            this.sourceSpan = sourceSpan;\n            this.isModule = isModule;\n        }\n        ProviderAst.prototype.visit = function (visitor, context) {\n            // No visit method in the visitor for now...\n            return null;\n        };\n        return ProviderAst;\n    }());\n    (function (ProviderAstType) {\n        ProviderAstType[ProviderAstType[\"PublicService\"] = 0] = \"PublicService\";\n        ProviderAstType[ProviderAstType[\"PrivateService\"] = 1] = \"PrivateService\";\n        ProviderAstType[ProviderAstType[\"Component\"] = 2] = \"Component\";\n        ProviderAstType[ProviderAstType[\"Directive\"] = 3] = \"Directive\";\n        ProviderAstType[ProviderAstType[\"Builtin\"] = 4] = \"Builtin\";\n    })(exports.ProviderAstType || (exports.ProviderAstType = {}));\n    /**\n     * Position where content is to be projected (instance of `<ng-content>` in a template).\n     */\n    var NgContentAst = /** @class */ (function () {\n        function NgContentAst(index, ngContentIndex, sourceSpan) {\n            this.index = index;\n            this.ngContentIndex = ngContentIndex;\n            this.sourceSpan = sourceSpan;\n        }\n        NgContentAst.prototype.visit = function (visitor, context) {\n            return visitor.visitNgContent(this, context);\n        };\n        return NgContentAst;\n    }());\n    /**\n     * A visitor that accepts each node but doesn't do anything. It is intended to be used\n     * as the base class for a visitor that is only interested in a subset of the node types.\n     */\n    var NullTemplateVisitor = /** @class */ (function () {\n        function NullTemplateVisitor() {\n        }\n        NullTemplateVisitor.prototype.visitNgContent = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitEmbeddedTemplate = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitElement = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitReference = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitVariable = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitEvent = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitElementProperty = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitAttr = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitBoundText = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitText = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitDirective = function (ast, context) { };\n        NullTemplateVisitor.prototype.visitDirectiveProperty = function (ast, context) { };\n        return NullTemplateVisitor;\n    }());\n    /**\n     * Base class that can be used to build a visitor that visits each node\n     * in an template ast recursively.\n     */\n    var RecursiveTemplateAstVisitor = /** @class */ (function (_super) {\n        __extends(RecursiveTemplateAstVisitor, _super);\n        function RecursiveTemplateAstVisitor() {\n            return _super.call(this) || this;\n        }\n        // Nodes with children\n        RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate = function (ast, context) {\n            return this.visitChildren(context, function (visit) {\n                visit(ast.attrs);\n                visit(ast.references);\n                visit(ast.variables);\n                visit(ast.directives);\n                visit(ast.providers);\n                visit(ast.children);\n            });\n        };\n        RecursiveTemplateAstVisitor.prototype.visitElement = function (ast, context) {\n            return this.visitChildren(context, function (visit) {\n                visit(ast.attrs);\n                visit(ast.inputs);\n                visit(ast.outputs);\n                visit(ast.references);\n                visit(ast.directives);\n                visit(ast.providers);\n                visit(ast.children);\n            });\n        };\n        RecursiveTemplateAstVisitor.prototype.visitDirective = function (ast, context) {\n            return this.visitChildren(context, function (visit) {\n                visit(ast.inputs);\n                visit(ast.hostProperties);\n                visit(ast.hostEvents);\n            });\n        };\n        RecursiveTemplateAstVisitor.prototype.visitChildren = function (context, cb) {\n            var results = [];\n            var t = this;\n            function visit(children) {\n                if (children && children.length)\n                    results.push(templateVisitAll(t, children, context));\n            }\n            cb(visit);\n            return Array.prototype.concat.apply([], results);\n        };\n        return RecursiveTemplateAstVisitor;\n    }(NullTemplateVisitor));\n    /**\n     * Visit every node in a list of {@link TemplateAst}s with the given {@link TemplateAstVisitor}.\n     */\n    function templateVisitAll(visitor, asts, context) {\n        if (context === void 0) { context = null; }\n        var result = [];\n        var visit = visitor.visit ?\n            function (ast) { return visitor.visit(ast, context) || ast.visit(visitor, context); } :\n            function (ast) { return ast.visit(visitor, context); };\n        asts.forEach(function (ast) {\n            var astResult = visit(ast);\n            if (astResult) {\n                result.push(astResult);\n            }\n        });\n        return result;\n    }\n\n    var ProviderError = /** @class */ (function (_super) {\n        __extends(ProviderError, _super);\n        function ProviderError(message, span) {\n            return _super.call(this, span, message) || this;\n        }\n        return ProviderError;\n    }(ParseError));\n    var ProviderViewContext = /** @class */ (function () {\n        function ProviderViewContext(reflector, component) {\n            var _this = this;\n            this.reflector = reflector;\n            this.component = component;\n            this.errors = [];\n            this.viewQueries = _getViewQueries(component);\n            this.viewProviders = new Map();\n            component.viewProviders.forEach(function (provider) {\n                if (_this.viewProviders.get(tokenReference(provider.token)) == null) {\n                    _this.viewProviders.set(tokenReference(provider.token), true);\n                }\n            });\n        }\n        return ProviderViewContext;\n    }());\n    var ProviderElementContext = /** @class */ (function () {\n        function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {\n            var _this = this;\n            this.viewContext = viewContext;\n            this._parent = _parent;\n            this._isViewRoot = _isViewRoot;\n            this._directiveAsts = _directiveAsts;\n            this._sourceSpan = _sourceSpan;\n            this._transformedProviders = new Map();\n            this._seenProviders = new Map();\n            this._queriedTokens = new Map();\n            this.transformedHasViewContainer = false;\n            this._attrs = {};\n            attrs.forEach(function (attrAst) { return _this._attrs[attrAst.name] = attrAst.value; });\n            var directivesMeta = _directiveAsts.map(function (directiveAst) { return directiveAst.directive; });\n            this._allProviders =\n                _resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);\n            this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);\n            Array.from(this._allProviders.values()).forEach(function (provider) {\n                _this._addQueryReadsTo(provider.token, provider.token, _this._queriedTokens);\n            });\n            if (isTemplate) {\n                var templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers$1.TemplateRef);\n                this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);\n            }\n            refs.forEach(function (refAst) {\n                var defaultQueryValue = refAst.value ||\n                    createTokenForExternalReference(_this.viewContext.reflector, Identifiers$1.ElementRef);\n                _this._addQueryReadsTo({ value: refAst.name }, defaultQueryValue, _this._queriedTokens);\n            });\n            if (this._queriedTokens.get(this.viewContext.reflector.resolveExternalReference(Identifiers$1.ViewContainerRef))) {\n                this.transformedHasViewContainer = true;\n            }\n            // create the providers that we know are eager first\n            Array.from(this._allProviders.values()).forEach(function (provider) {\n                var eager = provider.eager || _this._queriedTokens.get(tokenReference(provider.token));\n                if (eager) {\n                    _this._getOrCreateLocalProvider(provider.providerType, provider.token, true);\n                }\n            });\n        }\n        ProviderElementContext.prototype.afterElement = function () {\n            var _this = this;\n            // collect lazy providers\n            Array.from(this._allProviders.values()).forEach(function (provider) {\n                _this._getOrCreateLocalProvider(provider.providerType, provider.token, false);\n            });\n        };\n        Object.defineProperty(ProviderElementContext.prototype, \"transformProviders\", {\n            get: function () {\n                // Note: Maps keep their insertion order.\n                var lazyProviders = [];\n                var eagerProviders = [];\n                this._transformedProviders.forEach(function (provider) {\n                    if (provider.eager) {\n                        eagerProviders.push(provider);\n                    }\n                    else {\n                        lazyProviders.push(provider);\n                    }\n                });\n                return lazyProviders.concat(eagerProviders);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ProviderElementContext.prototype, \"transformedDirectiveAsts\", {\n            get: function () {\n                var sortedProviderTypes = this.transformProviders.map(function (provider) { return provider.token.identifier; });\n                var sortedDirectives = this._directiveAsts.slice();\n                sortedDirectives.sort(function (dir1, dir2) { return sortedProviderTypes.indexOf(dir1.directive.type) -\n                    sortedProviderTypes.indexOf(dir2.directive.type); });\n                return sortedDirectives;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ProviderElementContext.prototype, \"queryMatches\", {\n            get: function () {\n                var allMatches = [];\n                this._queriedTokens.forEach(function (matches) {\n                    allMatches.push.apply(allMatches, __spreadArray([], __read(matches)));\n                });\n                return allMatches;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ProviderElementContext.prototype._addQueryReadsTo = function (token, defaultValue, queryReadTokens) {\n            this._getQueriesFor(token).forEach(function (query) {\n                var queryValue = query.meta.read || defaultValue;\n                var tokenRef = tokenReference(queryValue);\n                var queryMatches = queryReadTokens.get(tokenRef);\n                if (!queryMatches) {\n                    queryMatches = [];\n                    queryReadTokens.set(tokenRef, queryMatches);\n                }\n                queryMatches.push({ queryId: query.queryId, value: queryValue });\n            });\n        };\n        ProviderElementContext.prototype._getQueriesFor = function (token) {\n            var result = [];\n            var currentEl = this;\n            var distance = 0;\n            var queries;\n            while (currentEl !== null) {\n                queries = currentEl._contentQueries.get(tokenReference(token));\n                if (queries) {\n                    result.push.apply(result, __spreadArray([], __read(queries.filter(function (query) { return query.meta.descendants || distance <= 1; }))));\n                }\n                if (currentEl._directiveAsts.length > 0) {\n                    distance++;\n                }\n                currentEl = currentEl._parent;\n            }\n            queries = this.viewContext.viewQueries.get(tokenReference(token));\n            if (queries) {\n                result.push.apply(result, __spreadArray([], __read(queries)));\n            }\n            return result;\n        };\n        ProviderElementContext.prototype._getOrCreateLocalProvider = function (requestingProviderType, token, eager) {\n            var _this = this;\n            var resolvedProvider = this._allProviders.get(tokenReference(token));\n            if (!resolvedProvider ||\n                ((requestingProviderType === exports.ProviderAstType.Directive ||\n                    requestingProviderType === exports.ProviderAstType.PublicService) &&\n                    resolvedProvider.providerType === exports.ProviderAstType.PrivateService) ||\n                ((requestingProviderType === exports.ProviderAstType.PrivateService ||\n                    requestingProviderType === exports.ProviderAstType.PublicService) &&\n                    resolvedProvider.providerType === exports.ProviderAstType.Builtin)) {\n                return null;\n            }\n            var transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n            if (transformedProviderAst) {\n                return transformedProviderAst;\n            }\n            if (this._seenProviders.get(tokenReference(token)) != null) {\n                this.viewContext.errors.push(new ProviderError(\"Cannot instantiate cyclic dependency! \" + tokenName(token), this._sourceSpan));\n                return null;\n            }\n            this._seenProviders.set(tokenReference(token), true);\n            var transformedProviders = resolvedProvider.providers.map(function (provider) {\n                var transformedUseValue = provider.useValue;\n                var transformedUseExisting = provider.useExisting;\n                var transformedDeps = undefined;\n                if (provider.useExisting != null) {\n                    var existingDiDep = _this._getDependency(resolvedProvider.providerType, { token: provider.useExisting }, eager);\n                    if (existingDiDep.token != null) {\n                        transformedUseExisting = existingDiDep.token;\n                    }\n                    else {\n                        transformedUseExisting = null;\n                        transformedUseValue = existingDiDep.value;\n                    }\n                }\n                else if (provider.useFactory) {\n                    var deps = provider.deps || provider.useFactory.diDeps;\n                    transformedDeps =\n                        deps.map(function (dep) { return _this._getDependency(resolvedProvider.providerType, dep, eager); });\n                }\n                else if (provider.useClass) {\n                    var deps = provider.deps || provider.useClass.diDeps;\n                    transformedDeps =\n                        deps.map(function (dep) { return _this._getDependency(resolvedProvider.providerType, dep, eager); });\n                }\n                return _transformProvider(provider, {\n                    useExisting: transformedUseExisting,\n                    useValue: transformedUseValue,\n                    deps: transformedDeps\n                });\n            });\n            transformedProviderAst =\n                _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n            this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n            return transformedProviderAst;\n        };\n        ProviderElementContext.prototype._getLocalDependency = function (requestingProviderType, dep, eager) {\n            if (eager === void 0) { eager = false; }\n            if (dep.isAttribute) {\n                var attrValue = this._attrs[dep.token.value];\n                return { isValue: true, value: attrValue == null ? null : attrValue };\n            }\n            if (dep.token != null) {\n                // access builtints\n                if ((requestingProviderType === exports.ProviderAstType.Directive ||\n                    requestingProviderType === exports.ProviderAstType.Component)) {\n                    if (tokenReference(dep.token) ===\n                        this.viewContext.reflector.resolveExternalReference(Identifiers$1.Renderer) ||\n                        tokenReference(dep.token) ===\n                            this.viewContext.reflector.resolveExternalReference(Identifiers$1.ElementRef) ||\n                        tokenReference(dep.token) ===\n                            this.viewContext.reflector.resolveExternalReference(Identifiers$1.ChangeDetectorRef) ||\n                        tokenReference(dep.token) ===\n                            this.viewContext.reflector.resolveExternalReference(Identifiers$1.TemplateRef)) {\n                        return dep;\n                    }\n                    if (tokenReference(dep.token) ===\n                        this.viewContext.reflector.resolveExternalReference(Identifiers$1.ViewContainerRef)) {\n                        this.transformedHasViewContainer = true;\n                    }\n                }\n                // access the injector\n                if (tokenReference(dep.token) ===\n                    this.viewContext.reflector.resolveExternalReference(Identifiers$1.Injector)) {\n                    return dep;\n                }\n                // access providers\n                if (this._getOrCreateLocalProvider(requestingProviderType, dep.token, eager) != null) {\n                    return dep;\n                }\n            }\n            return null;\n        };\n        ProviderElementContext.prototype._getDependency = function (requestingProviderType, dep, eager) {\n            if (eager === void 0) { eager = false; }\n            var currElement = this;\n            var currEager = eager;\n            var result = null;\n            if (!dep.isSkipSelf) {\n                result = this._getLocalDependency(requestingProviderType, dep, eager);\n            }\n            if (dep.isSelf) {\n                if (!result && dep.isOptional) {\n                    result = { isValue: true, value: null };\n                }\n            }\n            else {\n                // check parent elements\n                while (!result && currElement._parent) {\n                    var prevElement = currElement;\n                    currElement = currElement._parent;\n                    if (prevElement._isViewRoot) {\n                        currEager = false;\n                    }\n                    result = currElement._getLocalDependency(exports.ProviderAstType.PublicService, dep, currEager);\n                }\n                // check @Host restriction\n                if (!result) {\n                    if (!dep.isHost || this.viewContext.component.isHost ||\n                        this.viewContext.component.type.reference === tokenReference(dep.token) ||\n                        this.viewContext.viewProviders.get(tokenReference(dep.token)) != null) {\n                        result = dep;\n                    }\n                    else {\n                        result = dep.isOptional ? { isValue: true, value: null } : null;\n                    }\n                }\n            }\n            if (!result) {\n                this.viewContext.errors.push(new ProviderError(\"No provider for \" + tokenName(dep.token), this._sourceSpan));\n            }\n            return result;\n        };\n        return ProviderElementContext;\n    }());\n    var NgModuleProviderAnalyzer = /** @class */ (function () {\n        function NgModuleProviderAnalyzer(reflector, ngModule, extraProviders, sourceSpan) {\n            var _this = this;\n            this.reflector = reflector;\n            this._transformedProviders = new Map();\n            this._seenProviders = new Map();\n            this._errors = [];\n            this._allProviders = new Map();\n            ngModule.transitiveModule.modules.forEach(function (ngModuleType) {\n                var ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };\n                _resolveProviders([ngModuleProvider], exports.ProviderAstType.PublicService, true, sourceSpan, _this._errors, _this._allProviders, /* isModule */ true);\n            });\n            _resolveProviders(ngModule.transitiveModule.providers.map(function (entry) { return entry.provider; }).concat(extraProviders), exports.ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders, \n            /* isModule */ false);\n        }\n        NgModuleProviderAnalyzer.prototype.parse = function () {\n            var _this = this;\n            Array.from(this._allProviders.values()).forEach(function (provider) {\n                _this._getOrCreateLocalProvider(provider.token, provider.eager);\n            });\n            if (this._errors.length > 0) {\n                var errorString = this._errors.join('\\n');\n                throw new Error(\"Provider parse errors:\\n\" + errorString);\n            }\n            // Note: Maps keep their insertion order.\n            var lazyProviders = [];\n            var eagerProviders = [];\n            this._transformedProviders.forEach(function (provider) {\n                if (provider.eager) {\n                    eagerProviders.push(provider);\n                }\n                else {\n                    lazyProviders.push(provider);\n                }\n            });\n            return lazyProviders.concat(eagerProviders);\n        };\n        NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider = function (token, eager) {\n            var _this = this;\n            var resolvedProvider = this._allProviders.get(tokenReference(token));\n            if (!resolvedProvider) {\n                return null;\n            }\n            var transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n            if (transformedProviderAst) {\n                return transformedProviderAst;\n            }\n            if (this._seenProviders.get(tokenReference(token)) != null) {\n                this._errors.push(new ProviderError(\"Cannot instantiate cyclic dependency! \" + tokenName(token), resolvedProvider.sourceSpan));\n                return null;\n            }\n            this._seenProviders.set(tokenReference(token), true);\n            var transformedProviders = resolvedProvider.providers.map(function (provider) {\n                var transformedUseValue = provider.useValue;\n                var transformedUseExisting = provider.useExisting;\n                var transformedDeps = undefined;\n                if (provider.useExisting != null) {\n                    var existingDiDep = _this._getDependency({ token: provider.useExisting }, eager, resolvedProvider.sourceSpan);\n                    if (existingDiDep.token != null) {\n                        transformedUseExisting = existingDiDep.token;\n                    }\n                    else {\n                        transformedUseExisting = null;\n                        transformedUseValue = existingDiDep.value;\n                    }\n                }\n                else if (provider.useFactory) {\n                    var deps = provider.deps || provider.useFactory.diDeps;\n                    transformedDeps =\n                        deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n                }\n                else if (provider.useClass) {\n                    var deps = provider.deps || provider.useClass.diDeps;\n                    transformedDeps =\n                        deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n                }\n                return _transformProvider(provider, {\n                    useExisting: transformedUseExisting,\n                    useValue: transformedUseValue,\n                    deps: transformedDeps\n                });\n            });\n            transformedProviderAst =\n                _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n            this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n            return transformedProviderAst;\n        };\n        NgModuleProviderAnalyzer.prototype._getDependency = function (dep, eager, requestorSourceSpan) {\n            if (eager === void 0) { eager = false; }\n            var foundLocal = false;\n            if (!dep.isSkipSelf && dep.token != null) {\n                // access the injector\n                if (tokenReference(dep.token) ===\n                    this.reflector.resolveExternalReference(Identifiers$1.Injector) ||\n                    tokenReference(dep.token) ===\n                        this.reflector.resolveExternalReference(Identifiers$1.ComponentFactoryResolver)) {\n                    foundLocal = true;\n                    // access providers\n                }\n                else if (this._getOrCreateLocalProvider(dep.token, eager) != null) {\n                    foundLocal = true;\n                }\n            }\n            return dep;\n        };\n        return NgModuleProviderAnalyzer;\n    }());\n    function _transformProvider(provider, _a) {\n        var useExisting = _a.useExisting, useValue = _a.useValue, deps = _a.deps;\n        return {\n            token: provider.token,\n            useClass: provider.useClass,\n            useExisting: useExisting,\n            useFactory: provider.useFactory,\n            useValue: useValue,\n            deps: deps,\n            multi: provider.multi\n        };\n    }\n    function _transformProviderAst(provider, _a) {\n        var eager = _a.eager, providers = _a.providers;\n        return new ProviderAst(provider.token, provider.multiProvider, provider.eager || eager, providers, provider.providerType, provider.lifecycleHooks, provider.sourceSpan, provider.isModule);\n    }\n    function _resolveProvidersFromDirectives(directives, sourceSpan, targetErrors) {\n        var providersByToken = new Map();\n        directives.forEach(function (directive) {\n            var dirProvider = { token: { identifier: directive.type }, useClass: directive.type };\n            _resolveProviders([dirProvider], directive.isComponent ? exports.ProviderAstType.Component : exports.ProviderAstType.Directive, true, sourceSpan, targetErrors, providersByToken, /* isModule */ false);\n        });\n        // Note: directives need to be able to overwrite providers of a component!\n        var directivesWithComponentFirst = directives.filter(function (dir) { return dir.isComponent; }).concat(directives.filter(function (dir) { return !dir.isComponent; }));\n        directivesWithComponentFirst.forEach(function (directive) {\n            _resolveProviders(directive.providers, exports.ProviderAstType.PublicService, false, sourceSpan, targetErrors, providersByToken, /* isModule */ false);\n            _resolveProviders(directive.viewProviders, exports.ProviderAstType.PrivateService, false, sourceSpan, targetErrors, providersByToken, /* isModule */ false);\n        });\n        return providersByToken;\n    }\n    function _resolveProviders(providers, providerType, eager, sourceSpan, targetErrors, targetProvidersByToken, isModule) {\n        providers.forEach(function (provider) {\n            var resolvedProvider = targetProvidersByToken.get(tokenReference(provider.token));\n            if (resolvedProvider != null && !!resolvedProvider.multiProvider !== !!provider.multi) {\n                targetErrors.push(new ProviderError(\"Mixing multi and non multi provider is not possible for token \" + tokenName(resolvedProvider.token), sourceSpan));\n            }\n            if (!resolvedProvider) {\n                var lifecycleHooks = provider.token.identifier &&\n                    provider.token.identifier.lifecycleHooks ?\n                    provider.token.identifier.lifecycleHooks :\n                    [];\n                var isUseValue = !(provider.useClass || provider.useExisting || provider.useFactory);\n                resolvedProvider = new ProviderAst(provider.token, !!provider.multi, eager || isUseValue, [provider], providerType, lifecycleHooks, sourceSpan, isModule);\n                targetProvidersByToken.set(tokenReference(provider.token), resolvedProvider);\n            }\n            else {\n                if (!provider.multi) {\n                    resolvedProvider.providers.length = 0;\n                }\n                resolvedProvider.providers.push(provider);\n            }\n        });\n    }\n    function _getViewQueries(component) {\n        // Note: queries start with id 1 so we can use the number in a Bloom filter!\n        var viewQueryId = 1;\n        var viewQueries = new Map();\n        if (component.viewQueries) {\n            component.viewQueries.forEach(function (query) { return _addQueryToTokenMap(viewQueries, { meta: query, queryId: viewQueryId++ }); });\n        }\n        return viewQueries;\n    }\n    function _getContentQueries(contentQueryStartId, directives) {\n        var contentQueryId = contentQueryStartId;\n        var contentQueries = new Map();\n        directives.forEach(function (directive, directiveIndex) {\n            if (directive.queries) {\n                directive.queries.forEach(function (query) { return _addQueryToTokenMap(contentQueries, { meta: query, queryId: contentQueryId++ }); });\n            }\n        });\n        return contentQueries;\n    }\n    function _addQueryToTokenMap(map, query) {\n        query.meta.selectors.forEach(function (token) {\n            var entry = map.get(tokenReference(token));\n            if (!entry) {\n                entry = [];\n                map.set(tokenReference(token), entry);\n            }\n            entry.push(query);\n        });\n    }\n\n    /**\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://angular.io/license\n     */\n    var StyleWithImports = /** @class */ (function () {\n        function StyleWithImports(style, styleUrls) {\n            this.style = style;\n            this.styleUrls = styleUrls;\n        }\n        return StyleWithImports;\n    }());\n    function isStyleUrlResolvable(url) {\n        if (url == null || url.length === 0 || url[0] == '/')\n            return false;\n        var schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);\n        return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';\n    }\n    /**\n     * Rewrites stylesheets by resolving and removing the @import urls that\n     * are either relative or don't have a `package:` scheme\n     */\n    function extractStyleUrls(resolver, baseUrl, cssText) {\n        var foundUrls = [];\n        var modifiedCssText = cssText.replace(CSS_STRIPPABLE_COMMENT_REGEXP, '')\n            .replace(CSS_IMPORT_REGEXP, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            var url = m[1] || m[2];\n            if (!isStyleUrlResolvable(url)) {\n                // Do not attempt to resolve non-package absolute URLs with URI\n                // scheme\n                return m[0];\n            }\n            foundUrls.push(resolver.resolve(baseUrl, url));\n            return '';\n        });\n        return new StyleWithImports(modifiedCssText, foundUrls);\n    }\n    var CSS_IMPORT_REGEXP = /@import\\s+(?:url\\()?\\s*(?:(?:['\"]([^'\"]*))|([^;\\)\\s]*))[^;]*;?/g;\n    var CSS_STRIPPABLE_COMMENT_REGEXP = /\\/\\*(?!#\\s*(?:sourceURL|sourceMappingURL)=)[\\s\\S]+?\\*\\//g;\n    var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;\n\n    var PROPERTY_PARTS_SEPARATOR = '.';\n    var ATTRIBUTE_PREFIX = 'attr';\n    var CLASS_PREFIX = 'class';\n    var STYLE_PREFIX = 'style';\n    var TEMPLATE_ATTR_PREFIX = '*';\n    var ANIMATE_PROP_PREFIX = 'animate-';\n    /**\n     * Parses bindings in templates and in the directive host area.\n     */\n    var BindingParser = /** @class */ (function () {\n        function BindingParser(_exprParser, _interpolationConfig, _schemaRegistry, pipes, errors) {\n            this._exprParser = _exprParser;\n            this._interpolationConfig = _interpolationConfig;\n            this._schemaRegistry = _schemaRegistry;\n            this.errors = errors;\n            this.pipesByName = null;\n            this._usedPipes = new Map();\n            // When the `pipes` parameter is `null`, do not check for used pipes\n            // This is used in IVY when we might not know the available pipes at compile time\n            if (pipes) {\n                var pipesByName_1 = new Map();\n                pipes.forEach(function (pipe) { return pipesByName_1.set(pipe.name, pipe); });\n                this.pipesByName = pipesByName_1;\n            }\n        }\n        Object.defineProperty(BindingParser.prototype, \"interpolationConfig\", {\n            get: function () {\n                return this._interpolationConfig;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        BindingParser.prototype.getUsedPipes = function () {\n            return Array.from(this._usedPipes.values());\n        };\n        BindingParser.prototype.createBoundHostProperties = function (dirMeta, sourceSpan) {\n            var _this = this;\n            if (dirMeta.hostProperties) {\n                var boundProps_1 = [];\n                Object.keys(dirMeta.hostProperties).forEach(function (propName) {\n                    var expression = dirMeta.hostProperties[propName];\n                    if (typeof expression === 'string') {\n                        _this.parsePropertyBinding(propName, expression, true, sourceSpan, sourceSpan.start.offset, undefined, [], \n                        // Use the `sourceSpan` for  `keySpan`. This isn't really accurate, but neither is the\n                        // sourceSpan, as it represents the sourceSpan of the host itself rather than the\n                        // source of the host binding (which doesn't exist in the template). Regardless,\n                        // neither of these values are used in Ivy but are only here to satisfy the function\n                        // signature. This should likely be refactored in the future so that `sourceSpan`\n                        // isn't being used inaccurately.\n                        boundProps_1, sourceSpan);\n                    }\n                    else {\n                        _this._reportError(\"Value of the host property binding \\\"\" + propName + \"\\\" needs to be a string representing an expression but got \\\"\" + expression + \"\\\" (\" + typeof expression + \")\", sourceSpan);\n                    }\n                });\n                return boundProps_1;\n            }\n            return null;\n        };\n        BindingParser.prototype.createDirectiveHostPropertyAsts = function (dirMeta, elementSelector, sourceSpan) {\n            var _this = this;\n            var boundProps = this.createBoundHostProperties(dirMeta, sourceSpan);\n            return boundProps &&\n                boundProps.map(function (prop) { return _this.createBoundElementProperty(elementSelector, prop); });\n        };\n        BindingParser.prototype.createDirectiveHostEventAsts = function (dirMeta, sourceSpan) {\n            var _this = this;\n            if (dirMeta.hostListeners) {\n                var targetEvents_1 = [];\n                Object.keys(dirMeta.hostListeners).forEach(function (propName) {\n                    var expression = dirMeta.hostListeners[propName];\n                    if (typeof expression === 'string') {\n                        // Use the `sourceSpan` for  `keySpan` and `handlerSpan`. This isn't really accurate, but\n                        // neither is the `sourceSpan`, as it represents the `sourceSpan` of the host itself\n                        // rather than the source of the host binding (which doesn't exist in the template).\n                        // Regardless, neither of these values are used in Ivy but are only here to satisfy the\n                        // function signature. This should likely be refactored in the future so that `sourceSpan`\n                        // isn't being used inaccurately.\n                        _this.parseEvent(propName, expression, sourceSpan, sourceSpan, [], targetEvents_1, sourceSpan);\n                    }\n                    else {\n                        _this._reportError(\"Value of the host listener \\\"\" + propName + \"\\\" needs to be a string representing an expression but got \\\"\" + expression + \"\\\" (\" + typeof expression + \")\", sourceSpan);\n                    }\n                });\n                return targetEvents_1;\n            }\n            return null;\n        };\n        BindingParser.prototype.parseInterpolation = function (value, sourceSpan) {\n            var sourceInfo = sourceSpan.start.toString();\n            var absoluteOffset = sourceSpan.fullStart.offset;\n            try {\n                var ast = this._exprParser.parseInterpolation(value, sourceInfo, absoluteOffset, this._interpolationConfig);\n                if (ast)\n                    this._reportExpressionParserErrors(ast.errors, sourceSpan);\n                this._checkPipes(ast, sourceSpan);\n                return ast;\n            }\n            catch (e) {\n                this._reportError(\"\" + e, sourceSpan);\n                return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n            }\n        };\n        /**\n         * Similar to `parseInterpolation`, but treats the provided string as a single expression\n         * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).\n         * This is used for parsing the switch expression in ICUs.\n         */\n        BindingParser.prototype.parseInterpolationExpression = function (expression, sourceSpan) {\n            var sourceInfo = sourceSpan.start.toString();\n            var absoluteOffset = sourceSpan.start.offset;\n            try {\n                var ast = this._exprParser.parseInterpolationExpression(expression, sourceInfo, absoluteOffset);\n                if (ast)\n                    this._reportExpressionParserErrors(ast.errors, sourceSpan);\n                this._checkPipes(ast, sourceSpan);\n                return ast;\n            }\n            catch (e) {\n                this._reportError(\"\" + e, sourceSpan);\n                return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n            }\n        };\n        /**\n         * Parses the bindings in a microsyntax expression, and converts them to\n         * `ParsedProperty` or `ParsedVariable`.\n         *\n         * @param tplKey template binding name\n         * @param tplValue template binding value\n         * @param sourceSpan span of template binding relative to entire the template\n         * @param absoluteValueOffset start of the tplValue relative to the entire template\n         * @param targetMatchableAttrs potential attributes to match in the template\n         * @param targetProps target property bindings in the template\n         * @param targetVars target variables in the template\n         */\n        BindingParser.prototype.parseInlineTemplateBinding = function (tplKey, tplValue, sourceSpan, absoluteValueOffset, targetMatchableAttrs, targetProps, targetVars, isIvyAst) {\n            var e_1, _a;\n            var absoluteKeyOffset = sourceSpan.start.offset + TEMPLATE_ATTR_PREFIX.length;\n            var bindings = this._parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset);\n            try {\n                for (var bindings_1 = __values(bindings), bindings_1_1 = bindings_1.next(); !bindings_1_1.done; bindings_1_1 = bindings_1.next()) {\n                    var binding = bindings_1_1.value;\n                    // sourceSpan is for the entire HTML attribute. bindingSpan is for a particular\n                    // binding within the microsyntax expression so it's more narrow than sourceSpan.\n                    var bindingSpan = moveParseSourceSpan(sourceSpan, binding.sourceSpan);\n                    var key = binding.key.source;\n                    var keySpan = moveParseSourceSpan(sourceSpan, binding.key.span);\n                    if (binding instanceof VariableBinding) {\n                        var value = binding.value ? binding.value.source : '$implicit';\n                        var valueSpan = binding.value ? moveParseSourceSpan(sourceSpan, binding.value.span) : undefined;\n                        targetVars.push(new ParsedVariable(key, value, bindingSpan, keySpan, valueSpan));\n                    }\n                    else if (binding.value) {\n                        var srcSpan = isIvyAst ? bindingSpan : sourceSpan;\n                        var valueSpan = moveParseSourceSpan(sourceSpan, binding.value.ast.sourceSpan);\n                        this._parsePropertyAst(key, binding.value, srcSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);\n                    }\n                    else {\n                        targetMatchableAttrs.push([key, '' /* value */]);\n                        // Since this is a literal attribute with no RHS, source span should be\n                        // just the key span.\n                        this.parseLiteralAttr(key, null /* value */, keySpan, absoluteValueOffset, undefined /* valueSpan */, targetMatchableAttrs, targetProps, keySpan);\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (bindings_1_1 && !bindings_1_1.done && (_a = bindings_1.return)) _a.call(bindings_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        };\n        /**\n         * Parses the bindings in a microsyntax expression, e.g.\n         * ```\n         *    <tag *tplKey=\"let value1 = prop; let value2 = localVar\">\n         * ```\n         *\n         * @param tplKey template binding name\n         * @param tplValue template binding value\n         * @param sourceSpan span of template binding relative to entire the template\n         * @param absoluteKeyOffset start of the `tplKey`\n         * @param absoluteValueOffset start of the `tplValue`\n         */\n        BindingParser.prototype._parseTemplateBindings = function (tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset) {\n            var _this = this;\n            var sourceInfo = sourceSpan.start.toString();\n            try {\n                var bindingsResult = this._exprParser.parseTemplateBindings(tplKey, tplValue, sourceInfo, absoluteKeyOffset, absoluteValueOffset);\n                this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);\n                bindingsResult.templateBindings.forEach(function (binding) {\n                    if (binding.value instanceof ASTWithSource) {\n                        _this._checkPipes(binding.value, sourceSpan);\n                    }\n                });\n                bindingsResult.warnings.forEach(function (warning) {\n                    _this._reportError(warning, sourceSpan, exports.ParseErrorLevel.WARNING);\n                });\n                return bindingsResult.templateBindings;\n            }\n            catch (e) {\n                this._reportError(\"\" + e, sourceSpan);\n                return [];\n            }\n        };\n        BindingParser.prototype.parseLiteralAttr = function (name, value, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, \n        // TODO(atscott): keySpan is only optional here so VE template parser implementation does not\n        // have to change This should be required when VE is removed.\n        targetProps, keySpan) {\n            if (isAnimationLabel(name)) {\n                name = name.substring(1);\n                if (keySpan !== undefined) {\n                    keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));\n                }\n                if (value) {\n                    this._reportError(\"Assigning animation triggers via @prop=\\\"exp\\\" attributes with an expression is invalid.\" +\n                        \" Use property bindings (e.g. [@prop]=\\\"exp\\\") or use an attribute without a value (e.g. @prop) instead.\", sourceSpan, exports.ParseErrorLevel.ERROR);\n                }\n                this._parseAnimation(name, value, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps);\n            }\n            else {\n                targetProps.push(new ParsedProperty(name, this._exprParser.wrapLiteralPrimitive(value, '', absoluteOffset), exports.ParsedPropertyType.LITERAL_ATTR, sourceSpan, keySpan, valueSpan));\n            }\n        };\n        BindingParser.prototype.parsePropertyBinding = function (name, expression, isHost, sourceSpan, absoluteOffset, valueSpan, \n        // TODO(atscott): keySpan is only optional here so VE template parser implementation does not\n        // have to change This should be required when VE is removed.\n        targetMatchableAttrs, targetProps, keySpan) {\n            if (name.length === 0) {\n                this._reportError(\"Property name is missing in binding\", sourceSpan);\n            }\n            var isAnimationProp = false;\n            if (name.startsWith(ANIMATE_PROP_PREFIX)) {\n                isAnimationProp = true;\n                name = name.substring(ANIMATE_PROP_PREFIX.length);\n                if (keySpan !== undefined) {\n                    keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + ANIMATE_PROP_PREFIX.length, keySpan.end.offset));\n                }\n            }\n            else if (isAnimationLabel(name)) {\n                isAnimationProp = true;\n                name = name.substring(1);\n                if (keySpan !== undefined) {\n                    keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));\n                }\n            }\n            if (isAnimationProp) {\n                this._parseAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps);\n            }\n            else {\n                this._parsePropertyAst(name, this._parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset), sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);\n            }\n        };\n        BindingParser.prototype.parsePropertyInterpolation = function (name, value, sourceSpan, valueSpan, targetMatchableAttrs, \n        // TODO(atscott): keySpan is only optional here so VE template parser implementation does not\n        // have to change This should be required when VE is removed.\n        targetProps, keySpan) {\n            var expr = this.parseInterpolation(value, valueSpan || sourceSpan);\n            if (expr) {\n                this._parsePropertyAst(name, expr, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);\n                return true;\n            }\n            return false;\n        };\n        BindingParser.prototype._parsePropertyAst = function (name, ast, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps) {\n            targetMatchableAttrs.push([name, ast.source]);\n            targetProps.push(new ParsedProperty(name, ast, exports.ParsedPropertyType.DEFAULT, sourceSpan, keySpan, valueSpan));\n        };\n        BindingParser.prototype._parseAnimation = function (name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps) {\n            if (name.length === 0) {\n                this._reportError('Animation trigger is missing', sourceSpan);\n            }\n            // This will occur when a @trigger is not paired with an expression.\n            // For animations it is valid to not have an expression since */void\n            // states will be applied by angular when the element is attached/detached\n            var ast = this._parseBinding(expression || 'undefined', false, valueSpan || sourceSpan, absoluteOffset);\n            targetMatchableAttrs.push([name, ast.source]);\n            targetProps.push(new ParsedProperty(name, ast, exports.ParsedPropertyType.ANIMATION, sourceSpan, keySpan, valueSpan));\n        };\n        BindingParser.prototype._parseBinding = function (value, isHostBinding, sourceSpan, absoluteOffset) {\n            var sourceInfo = (sourceSpan && sourceSpan.start || '(unknown)').toString();\n            try {\n                var ast = isHostBinding ?\n                    this._exprParser.parseSimpleBinding(value, sourceInfo, absoluteOffset, this._interpolationConfig) :\n                    this._exprParser.parseBinding(value, sourceInfo, absoluteOffset, this._interpolationConfig);\n                if (ast)\n                    this._reportExpressionParserErrors(ast.errors, sourceSpan);\n                this._checkPipes(ast, sourceSpan);\n                return ast;\n            }\n            catch (e) {\n                this._reportError(\"\" + e, sourceSpan);\n                return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n            }\n        };\n        BindingParser.prototype.createBoundElementProperty = function (elementSelector, boundProp, skipValidation, mapPropertyName) {\n            if (skipValidation === void 0) { skipValidation = false; }\n            if (mapPropertyName === void 0) { mapPropertyName = true; }\n            if (boundProp.isAnimation) {\n                return new BoundElementProperty(boundProp.name, 4 /* Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);\n            }\n            var unit = null;\n            var bindingType = undefined;\n            var boundPropertyName = null;\n            var parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);\n            var securityContexts = undefined;\n            // Check for special cases (prefix style, attr, class)\n            if (parts.length > 1) {\n                if (parts[0] == ATTRIBUTE_PREFIX) {\n                    boundPropertyName = parts.slice(1).join(PROPERTY_PARTS_SEPARATOR);\n                    if (!skipValidation) {\n                        this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);\n                    }\n                    securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);\n                    var nsSeparatorIdx = boundPropertyName.indexOf(':');\n                    if (nsSeparatorIdx > -1) {\n                        var ns = boundPropertyName.substring(0, nsSeparatorIdx);\n                        var name = boundPropertyName.substring(nsSeparatorIdx + 1);\n                        boundPropertyName = mergeNsAndName(ns, name);\n                    }\n                    bindingType = 1 /* Attribute */;\n                }\n                else if (parts[0] == CLASS_PREFIX) {\n                    boundPropertyName = parts[1];\n                    bindingType = 2 /* Class */;\n                    securityContexts = [SecurityContext.NONE];\n                }\n                else if (parts[0] == STYLE_PREFIX) {\n                    unit = parts.length > 2 ? parts[2] : null;\n                    boundPropertyName = parts[1];\n                    bindingType = 3 /* Style */;\n                    securityContexts = [SecurityContext.STYLE];\n                }\n            }\n            // If not a special case, use the full property name\n            if (boundPropertyName === null) {\n                var mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);\n                boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;\n                securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false);\n                bindingType = 0 /* Property */;\n                if (!skipValidation) {\n                    this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);\n                }\n            }\n            return new BoundElementProperty(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);\n        };\n        // TODO: keySpan should be required but was made optional to avoid changing VE parser.\n        BindingParser.prototype.parseEvent = function (name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {\n            if (name.length === 0) {\n                this._reportError(\"Event name is missing in binding\", sourceSpan);\n            }\n            if (isAnimationLabel(name)) {\n                name = name.substr(1);\n                if (keySpan !== undefined) {\n                    keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));\n                }\n                this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);\n            }\n            else {\n                this._parseRegularEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);\n            }\n        };\n        BindingParser.prototype.calcPossibleSecurityContexts = function (selector, propName, isAttribute) {\n            var prop = this._schemaRegistry.getMappedPropName(propName);\n            return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);\n        };\n        BindingParser.prototype._parseAnimationEvent = function (name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) {\n            var matches = splitAtPeriod(name, [name, '']);\n            var eventName = matches[0];\n            var phase = matches[1].toLowerCase();\n            var ast = this._parseAction(expression, handlerSpan);\n            targetEvents.push(new ParsedEvent(eventName, phase, 1 /* Animation */, ast, sourceSpan, handlerSpan, keySpan));\n            if (eventName.length === 0) {\n                this._reportError(\"Animation event name is missing in binding\", sourceSpan);\n            }\n            if (phase) {\n                if (phase !== 'start' && phase !== 'done') {\n                    this._reportError(\"The provided animation output phase value \\\"\" + phase + \"\\\" for \\\"@\" + eventName + \"\\\" is not supported (use start or done)\", sourceSpan);\n                }\n            }\n            else {\n                this._reportError(\"The animation trigger output event (@\" + eventName + \") is missing its phase value name (start or done are currently supported)\", sourceSpan);\n            }\n        };\n        BindingParser.prototype._parseRegularEvent = function (name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {\n            // long format: 'target: eventName'\n            var _a = __read(splitAtColon(name, [null, name]), 2), target = _a[0], eventName = _a[1];\n            var ast = this._parseAction(expression, handlerSpan);\n            targetMatchableAttrs.push([name, ast.source]);\n            targetEvents.push(new ParsedEvent(eventName, target, 0 /* Regular */, ast, sourceSpan, handlerSpan, keySpan));\n            // Don't detect directives for event names for now,\n            // so don't add the event name to the matchableAttrs\n        };\n        BindingParser.prototype._parseAction = function (value, sourceSpan) {\n            var sourceInfo = (sourceSpan && sourceSpan.start || '(unknown').toString();\n            var absoluteOffset = (sourceSpan && sourceSpan.start) ? sourceSpan.start.offset : 0;\n            try {\n                var ast = this._exprParser.parseAction(value, sourceInfo, absoluteOffset, this._interpolationConfig);\n                if (ast) {\n                    this._reportExpressionParserErrors(ast.errors, sourceSpan);\n                }\n                if (!ast || ast.ast instanceof EmptyExpr) {\n                    this._reportError(\"Empty expressions are not allowed\", sourceSpan);\n                    return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n                }\n                this._checkPipes(ast, sourceSpan);\n                return ast;\n            }\n            catch (e) {\n                this._reportError(\"\" + e, sourceSpan);\n                return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n            }\n        };\n        BindingParser.prototype._reportError = function (message, sourceSpan, level) {\n            if (level === void 0) { level = exports.ParseErrorLevel.ERROR; }\n            this.errors.push(new ParseError(sourceSpan, message, level));\n        };\n        BindingParser.prototype._reportExpressionParserErrors = function (errors, sourceSpan) {\n            var e_2, _a;\n            try {\n                for (var errors_1 = __values(errors), errors_1_1 = errors_1.next(); !errors_1_1.done; errors_1_1 = errors_1.next()) {\n                    var error = errors_1_1.value;\n                    this._reportError(error.message, sourceSpan);\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (errors_1_1 && !errors_1_1.done && (_a = errors_1.return)) _a.call(errors_1);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n        };\n        // Make sure all the used pipes are known in `this.pipesByName`\n        BindingParser.prototype._checkPipes = function (ast, sourceSpan) {\n            var _this = this;\n            if (ast && this.pipesByName) {\n                var collector = new PipeCollector();\n                ast.visit(collector);\n                collector.pipes.forEach(function (ast, pipeName) {\n                    var pipeMeta = _this.pipesByName.get(pipeName);\n                    if (!pipeMeta) {\n                        _this._reportError(\"The pipe '\" + pipeName + \"' could not be found\", new ParseSourceSpan(sourceSpan.start.moveBy(ast.span.start), sourceSpan.start.moveBy(ast.span.end)));\n                    }\n                    else {\n                        _this._usedPipes.set(pipeName, pipeMeta);\n                    }\n                });\n            }\n        };\n        /**\n         * @param propName the name of the property / attribute\n         * @param sourceSpan\n         * @param isAttr true when binding to an attribute\n         */\n        BindingParser.prototype._validatePropertyOrAttributeName = function (propName, sourceSpan, isAttr) {\n            var report = isAttr ? this._schemaRegistry.validateAttribute(propName) :\n                this._schemaRegistry.validateProperty(propName);\n            if (report.error) {\n                this._reportError(report.msg, sourceSpan, exports.ParseErrorLevel.ERROR);\n            }\n        };\n        return BindingParser;\n    }());\n    var PipeCollector = /** @class */ (function (_super) {\n        __extends(PipeCollector, _super);\n        function PipeCollector() {\n            var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n            _this.pipes = new Map();\n            return _this;\n        }\n        PipeCollector.prototype.visitPipe = function (ast, context) {\n            this.pipes.set(ast.name, ast);\n            ast.exp.visit(this);\n            this.visitAll(ast.args, context);\n            return null;\n        };\n        return PipeCollector;\n    }(RecursiveAstVisitor$1));\n    function isAnimationLabel(name) {\n        return name[0] == '@';\n    }\n    function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {\n        var ctxs = [];\n        CssSelector.parse(selector).forEach(function (selector) {\n            var elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();\n            var notElementNames = new Set(selector.notSelectors.filter(function (selector) { return selector.isElementSelector(); })\n                .map(function (selector) { return selector.element; }));\n            var possibleElementNames = elementNames.filter(function (elementName) { return !notElementNames.has(elementName); });\n            ctxs.push.apply(ctxs, __spreadArray([], __read(possibleElementNames.map(function (elementName) { return registry.securityContext(elementName, propName, isAttribute); }))));\n        });\n        return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();\n    }\n    /**\n     * Compute a new ParseSourceSpan based off an original `sourceSpan` by using\n     * absolute offsets from the specified `absoluteSpan`.\n     *\n     * @param sourceSpan original source span\n     * @param absoluteSpan absolute source span to move to\n     */\n    function moveParseSourceSpan(sourceSpan, absoluteSpan) {\n        // The difference of two absolute offsets provide the relative offset\n        var startDiff = absoluteSpan.start - sourceSpan.start.offset;\n        var endDiff = absoluteSpan.end - sourceSpan.end.offset;\n        return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);\n    }\n\n    /**\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://angular.io/license\n     */\n    var NG_CONTENT_SELECT_ATTR = 'select';\n    var LINK_ELEMENT = 'link';\n    var LINK_STYLE_REL_ATTR = 'rel';\n    var LINK_STYLE_HREF_ATTR = 'href';\n    var LINK_STYLE_REL_VALUE = 'stylesheet';\n    var STYLE_ELEMENT = 'style';\n    var SCRIPT_ELEMENT = 'script';\n    var NG_NON_BINDABLE_ATTR = 'ngNonBindable';\n    var NG_PROJECT_AS = 'ngProjectAs';\n    function preparseElement(ast) {\n        var selectAttr = null;\n        var hrefAttr = null;\n        var relAttr = null;\n        var nonBindable = false;\n        var projectAs = '';\n        ast.attrs.forEach(function (attr) {\n            var lcAttrName = attr.name.toLowerCase();\n            if (lcAttrName == NG_CONTENT_SELECT_ATTR) {\n                selectAttr = attr.value;\n            }\n            else if (lcAttrName == LINK_STYLE_HREF_ATTR) {\n                hrefAttr = attr.value;\n            }\n            else if (lcAttrName == LINK_STYLE_REL_ATTR) {\n                relAttr = attr.value;\n            }\n            else if (attr.name == NG_NON_BINDABLE_ATTR) {\n                nonBindable = true;\n            }\n            else if (attr.name == NG_PROJECT_AS) {\n                if (attr.value.length > 0) {\n                    projectAs = attr.value;\n                }\n            }\n        });\n        selectAttr = normalizeNgContentSelect(selectAttr);\n        var nodeName = ast.name.toLowerCase();\n        var type = PreparsedElementType.OTHER;\n        if (isNgContent(nodeName)) {\n            type = PreparsedElementType.NG_CONTENT;\n        }\n        else if (nodeName == STYLE_ELEMENT) {\n            type = PreparsedElementType.STYLE;\n        }\n        else if (nodeName == SCRIPT_ELEMENT) {\n            type = PreparsedElementType.SCRIPT;\n        }\n        else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {\n            type = PreparsedElementType.STYLESHEET;\n        }\n        return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);\n    }\n    var PreparsedElementType;\n    (function (PreparsedElementType) {\n        PreparsedElementType[PreparsedElementType[\"NG_CONTENT\"] = 0] = \"NG_CONTENT\";\n        PreparsedElementType[PreparsedElementType[\"STYLE\"] = 1] = \"STYLE\";\n        PreparsedElementType[PreparsedElementType[\"STYLESHEET\"] = 2] = \"STYLESHEET\";\n        PreparsedElementType[PreparsedElementType[\"SCRIPT\"] = 3] = \"SCRIPT\";\n        PreparsedElementType[PreparsedElementType[\"OTHER\"] = 4] = \"OTHER\";\n    })(PreparsedElementType || (PreparsedElementType = {}));\n    var PreparsedElement = /** @class */ (function () {\n        function PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs) {\n            this.type = type;\n            this.selectAttr = selectAttr;\n            this.hrefAttr = hrefAttr;\n            this.nonBindable = nonBindable;\n            this.projectAs = projectAs;\n        }\n        return PreparsedElement;\n    }());\n    function normalizeNgContentSelect(selectAttr) {\n        if (selectAttr === null || selectAttr.length === 0) {\n            return '*';\n        }\n        return selectAttr;\n    }\n\n    var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*))|\\[\\(([^\\)]+)\\)\\]|\\[([^\\]]+)\\]|\\(([^\\)]+)\\))$/;\n    // Group 1 = \"bind-\"\n    var KW_BIND_IDX = 1;\n    // Group 2 = \"let-\"\n    var KW_LET_IDX = 2;\n    // Group 3 = \"ref-/#\"\n    var KW_REF_IDX = 3;\n    // Group 4 = \"on-\"\n    var KW_ON_IDX = 4;\n    // Group 5 = \"bindon-\"\n    var KW_BINDON_IDX = 5;\n    // Group 6 = \"@\"\n    var KW_AT_IDX = 6;\n    // Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\n    var IDENT_KW_IDX = 7;\n    // Group 8 = identifier inside [()]\n    var IDENT_BANANA_BOX_IDX = 8;\n    // Group 9 = identifier inside []\n    var IDENT_PROPERTY_IDX = 9;\n    // Group 10 = identifier inside ()\n    var IDENT_EVENT_IDX = 10;\n    var TEMPLATE_ATTR_PREFIX$1 = '*';\n    var CLASS_ATTR = 'class';\n    var _TEXT_CSS_SELECTOR;\n    function TEXT_CSS_SELECTOR() {\n        if (!_TEXT_CSS_SELECTOR) {\n            _TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];\n        }\n        return _TEXT_CSS_SELECTOR;\n    }\n    var TemplateParseError = /** @class */ (function (_super) {\n        __extends(TemplateParseError, _super);\n        function TemplateParseError(message, span, level) {\n            return _super.call(this, span, message, level) || this;\n        }\n        return TemplateParseError;\n    }(ParseError));\n    var TemplateParseResult = /** @class */ (function () {\n        function TemplateParseResult(templateAst, usedPipes, errors) {\n            this.templateAst = templateAst;\n            this.usedPipes = usedPipes;\n            this.errors = errors;\n        }\n        return TemplateParseResult;\n    }());\n    var TemplateParser = /** @class */ (function () {\n        function TemplateParser(_config, _reflector, _exprParser, _schemaRegistry, _htmlParser, _console, transforms) {\n            this._config = _config;\n            this._reflector = _reflector;\n            this._exprParser = _exprParser;\n            this._schemaRegistry = _schemaRegistry;\n            this._htmlParser = _htmlParser;\n            this._console = _console;\n            this.transforms = transforms;\n        }\n        Object.defineProperty(TemplateParser.prototype, \"expressionParser\", {\n            get: function () {\n                return this._exprParser;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        TemplateParser.prototype.parse = function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {\n            var _a;\n            var result = this.tryParse(component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces);\n            var warnings = result.errors.filter(function (error) { return error.level === exports.ParseErrorLevel.WARNING; });\n            var errors = result.errors.filter(function (error) { return error.level === exports.ParseErrorLevel.ERROR; });\n            if (warnings.length > 0) {\n                (_a = this._console) === null || _a === void 0 ? void 0 : _a.warn(\"Template parse warnings:\\n\" + warnings.join('\\n'));\n            }\n            if (errors.length > 0) {\n                var errorString = errors.join('\\n');\n                throw syntaxError(\"Template parse errors:\\n\" + errorString, errors);\n            }\n            return { template: result.templateAst, pipes: result.usedPipes };\n        };\n        TemplateParser.prototype.tryParse = function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {\n            var htmlParseResult = typeof template === 'string' ?\n                this._htmlParser.parse(template, templateUrl, {\n                    tokenizeExpansionForms: true,\n                    interpolationConfig: this.getInterpolationConfig(component)\n                }) :\n                template;\n            if (!preserveWhitespaces) {\n                htmlParseResult = removeWhitespaces(htmlParseResult);\n            }\n            return this.tryParseHtml(this.expandHtml(htmlParseResult), component, directives, pipes, schemas);\n        };\n        TemplateParser.prototype.tryParseHtml = function (htmlAstWithErrors, component, directives, pipes, schemas) {\n            var result;\n            var errors = htmlAstWithErrors.errors;\n            var usedPipes = [];\n            if (htmlAstWithErrors.rootNodes.length > 0) {\n                var uniqDirectives = removeSummaryDuplicates(directives);\n                var uniqPipes = removeSummaryDuplicates(pipes);\n                var providerViewContext = new ProviderViewContext(this._reflector, component);\n                var interpolationConfig = undefined;\n                if (component.template && component.template.interpolation) {\n                    interpolationConfig = {\n                        start: component.template.interpolation[0],\n                        end: component.template.interpolation[1]\n                    };\n                }\n                var bindingParser = new BindingParser(this._exprParser, interpolationConfig, this._schemaRegistry, uniqPipes, errors);\n                var parseVisitor = new TemplateParseVisitor(this._reflector, this._config, providerViewContext, uniqDirectives, bindingParser, this._schemaRegistry, schemas, errors);\n                result = visitAll$1(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);\n                errors.push.apply(errors, __spreadArray([], __read(providerViewContext.errors)));\n                usedPipes.push.apply(usedPipes, __spreadArray([], __read(bindingParser.getUsedPipes())));\n            }\n            else {\n                result = [];\n            }\n            this._assertNoReferenceDuplicationOnTemplate(result, errors);\n            if (errors.length > 0) {\n                return new TemplateParseResult(result, usedPipes, errors);\n            }\n            if (this.transforms) {\n                this.transforms.forEach(function (transform) {\n                    result = templateVisitAll(transform, result);\n                });\n            }\n            return new TemplateParseResult(result, usedPipes, errors);\n        };\n        TemplateParser.prototype.expandHtml = function (htmlAstWithErrors, forced) {\n            if (forced === void 0) { forced = false; }\n            var errors = htmlAstWithErrors.errors;\n            if (errors.length == 0 || forced) {\n                // Transform ICU messages to angular directives\n                var expandedHtmlAst = expandNodes(htmlAstWithErrors.rootNodes);\n                errors.push.apply(errors, __spreadArray([], __read(expandedHtmlAst.errors)));\n                htmlAstWithErrors = new ParseTreeResult(expandedHtmlAst.nodes, errors);\n            }\n            return htmlAstWithErrors;\n        };\n        TemplateParser.prototype.getInterpolationConfig = function (component) {\n            if (component.template) {\n                return InterpolationConfig.fromArray(component.template.interpolation);\n            }\n            return undefined;\n        };\n        /** @internal */\n        TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate = function (result, errors) {\n            var existingReferences = [];\n            result.filter(function (element) { return !!element.references; })\n                .forEach(function (element) { return element.references.forEach(function (reference) {\n                var name = reference.name;\n                if (existingReferences.indexOf(name) < 0) {\n                    existingReferences.push(name);\n                }\n                else {\n                    var error = new TemplateParseError(\"Reference \\\"#\" + name + \"\\\" is defined several times\", reference.sourceSpan, exports.ParseErrorLevel.ERROR);\n                    errors.push(error);\n                }\n            }); });\n        };\n        return TemplateParser;\n    }());\n    var TemplateParseVisitor = /** @class */ (function () {\n        function TemplateParseVisitor(reflector, config, providerViewContext, directives, _bindingParser, _schemaRegistry, _schemas, _targetErrors) {\n            var _this = this;\n            this.reflector = reflector;\n            this.config = config;\n            this.providerViewContext = providerViewContext;\n            this._bindingParser = _bindingParser;\n            this._schemaRegistry = _schemaRegistry;\n            this._schemas = _schemas;\n            this._targetErrors = _targetErrors;\n            this.selectorMatcher = new SelectorMatcher();\n            this.directivesIndex = new Map();\n            this.ngContentCount = 0;\n            // Note: queries start with id 1 so we can use the number in a Bloom filter!\n            this.contentQueryStartId = providerViewContext.component.viewQueries.length + 1;\n            directives.forEach(function (directive, index) {\n                var selector = CssSelector.parse(directive.selector);\n                _this.selectorMatcher.addSelectables(selector, directive);\n                _this.directivesIndex.set(directive, index);\n            });\n        }\n        TemplateParseVisitor.prototype.visitExpansion = function (expansion, context) {\n            return null;\n        };\n        TemplateParseVisitor.prototype.visitExpansionCase = function (expansionCase, context) {\n            return null;\n        };\n        TemplateParseVisitor.prototype.visitText = function (text, parent) {\n            var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR());\n            var valueNoNgsp = replaceNgsp(text.value);\n            var expr = this._bindingParser.parseInterpolation(valueNoNgsp, text.sourceSpan);\n            return expr ? new BoundTextAst(expr, ngContentIndex, text.sourceSpan) :\n                new TextAst(valueNoNgsp, ngContentIndex, text.sourceSpan);\n        };\n        TemplateParseVisitor.prototype.visitAttribute = function (attribute, context) {\n            return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);\n        };\n        TemplateParseVisitor.prototype.visitComment = function (comment, context) {\n            return null;\n        };\n        TemplateParseVisitor.prototype.visitElement = function (element, parent) {\n            var _this = this;\n            var queryStartIndex = this.contentQueryStartId;\n            var elName = element.name;\n            var preparsedElement = preparseElement(element);\n            if (preparsedElement.type === PreparsedElementType.SCRIPT ||\n                preparsedElement.type === PreparsedElementType.STYLE) {\n                // Skipping <script> for security reasons\n                // Skipping <style> as we already processed them\n                // in the StyleCompiler\n                return null;\n            }\n            if (preparsedElement.type === PreparsedElementType.STYLESHEET &&\n                isStyleUrlResolvable(preparsedElement.hrefAttr)) {\n                // Skipping stylesheets with either relative urls or package scheme as we already processed\n                // them in the StyleCompiler\n                return null;\n            }\n            var matchableAttrs = [];\n            var elementOrDirectiveProps = [];\n            var elementOrDirectiveRefs = [];\n            var elementVars = [];\n            var events = [];\n            var templateElementOrDirectiveProps = [];\n            var templateMatchableAttrs = [];\n            var templateElementVars = [];\n            var hasInlineTemplates = false;\n            var attrs = [];\n            var isTemplateElement = isNgTemplate(element.name);\n            element.attrs.forEach(function (attr) {\n                var parsedVariables = [];\n                var hasBinding = _this._parseAttr(isTemplateElement, attr, matchableAttrs, elementOrDirectiveProps, events, elementOrDirectiveRefs, elementVars);\n                elementVars.push.apply(elementVars, __spreadArray([], __read(parsedVariables.map(function (v) { return VariableAst.fromParsedVariable(v); }))));\n                var templateValue;\n                var templateKey;\n                var normalizedName = _this._normalizeAttributeName(attr.name);\n                if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX$1)) {\n                    templateValue = attr.value;\n                    templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX$1.length);\n                }\n                var hasTemplateBinding = templateValue != null;\n                if (hasTemplateBinding) {\n                    if (hasInlineTemplates) {\n                        _this._reportError(\"Can't have multiple template bindings on one element. Use only one attribute prefixed with *\", attr.sourceSpan);\n                    }\n                    hasInlineTemplates = true;\n                    var parsedVariables_1 = [];\n                    var absoluteOffset = (attr.valueSpan || attr.sourceSpan).start.offset;\n                    _this._bindingParser.parseInlineTemplateBinding(templateKey, templateValue, attr.sourceSpan, absoluteOffset, templateMatchableAttrs, templateElementOrDirectiveProps, parsedVariables_1, false /* isIvyAst */);\n                    templateElementVars.push.apply(templateElementVars, __spreadArray([], __read(parsedVariables_1.map(function (v) { return VariableAst.fromParsedVariable(v); }))));\n                }\n                if (!hasBinding && !hasTemplateBinding) {\n                    // don't include the bindings as attributes as well in the AST\n                    attrs.push(_this.visitAttribute(attr, null));\n                    matchableAttrs.push([attr.name, attr.value]);\n                }\n            });\n            var elementCssSelector = createElementCssSelector(elName, matchableAttrs);\n            var _b = this._parseDirectives(this.selectorMatcher, elementCssSelector), directiveMetas = _b.directives, matchElement = _b.matchElement;\n            var references = [];\n            var boundDirectivePropNames = new Set();\n            var directiveAsts = this._createDirectiveAsts(isTemplateElement, element.name, directiveMetas, elementOrDirectiveProps, elementOrDirectiveRefs, element.sourceSpan, references, boundDirectivePropNames);\n            var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, boundDirectivePropNames);\n            var isViewRoot = parent.isTemplateElement || hasInlineTemplates;\n            var providerContext = new ProviderElementContext(this.providerViewContext, parent.providerContext, isViewRoot, directiveAsts, attrs, references, isTemplateElement, queryStartIndex, element.sourceSpan);\n            var children = visitAll$1(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, ElementContext.create(isTemplateElement, directiveAsts, isTemplateElement ? parent.providerContext : providerContext));\n            providerContext.afterElement();\n            // Override the actual selector when the `ngProjectAs` attribute is provided\n            var projectionSelector = preparsedElement.projectAs != '' ?\n                CssSelector.parse(preparsedElement.projectAs)[0] :\n                elementCssSelector;\n            var ngContentIndex = parent.findNgContentIndex(projectionSelector);\n            var parsedElement;\n            if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {\n                // `<ng-content>` element\n                if (element.children && !element.children.every(_isEmptyTextNode)) {\n                    this._reportError(\"<ng-content> element cannot have content.\", element.sourceSpan);\n                }\n                parsedElement = new NgContentAst(this.ngContentCount++, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan);\n            }\n            else if (isTemplateElement) {\n                // `<ng-template>` element\n                this._assertAllEventsPublishedByDirectives(directiveAsts, events);\n                this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts, elementProps, element.sourceSpan);\n                parsedElement = new EmbeddedTemplateAst(attrs, events, references, elementVars, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan);\n            }\n            else {\n                // element other than `<ng-content>` and `<ng-template>`\n                this._assertElementExists(matchElement, element);\n                this._assertOnlyOneComponent(directiveAsts, element.sourceSpan);\n                var ngContentIndex_1 = hasInlineTemplates ? null : parent.findNgContentIndex(projectionSelector);\n                parsedElement = new ElementAst(elName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan, element.endSourceSpan || null);\n            }\n            if (hasInlineTemplates) {\n                // The element as a *-attribute\n                var templateQueryStartIndex = this.contentQueryStartId;\n                var templateSelector = createElementCssSelector('ng-template', templateMatchableAttrs);\n                var directives = this._parseDirectives(this.selectorMatcher, templateSelector).directives;\n                var templateBoundDirectivePropNames = new Set();\n                var templateDirectiveAsts = this._createDirectiveAsts(true, elName, directives, templateElementOrDirectiveProps, [], element.sourceSpan, [], templateBoundDirectivePropNames);\n                var templateElementProps = this._createElementPropertyAsts(elName, templateElementOrDirectiveProps, templateBoundDirectivePropNames);\n                this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts, templateElementProps, element.sourceSpan);\n                var templateProviderContext = new ProviderElementContext(this.providerViewContext, parent.providerContext, parent.isTemplateElement, templateDirectiveAsts, [], [], true, templateQueryStartIndex, element.sourceSpan);\n                templateProviderContext.afterElement();\n                parsedElement = new EmbeddedTemplateAst([], [], [], templateElementVars, templateProviderContext.transformedDirectiveAsts, templateProviderContext.transformProviders, templateProviderContext.transformedHasViewContainer, templateProviderContext.queryMatches, [parsedElement], ngContentIndex, element.sourceSpan);\n            }\n            return parsedElement;\n        };\n        TemplateParseVisitor.prototype._parseAttr = function (isTemplateElement, attr, targetMatchableAttrs, targetProps, targetEvents, targetRefs, targetVars) {\n            var name = this._normalizeAttributeName(attr.name);\n            var value = attr.value;\n            var srcSpan = attr.sourceSpan;\n            var absoluteOffset = attr.valueSpan ? attr.valueSpan.start.offset : srcSpan.start.offset;\n            var boundEvents = [];\n            var bindParts = name.match(BIND_NAME_REGEXP);\n            var hasBinding = false;\n            if (bindParts !== null) {\n                hasBinding = true;\n                if (bindParts[KW_BIND_IDX] != null) {\n                    this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, absoluteOffset, attr.valueSpan, targetMatchableAttrs, targetProps);\n                }\n                else if (bindParts[KW_LET_IDX]) {\n                    if (isTemplateElement) {\n                        var identifier = bindParts[IDENT_KW_IDX];\n                        this._parseVariable(identifier, value, srcSpan, targetVars);\n                    }\n                    else {\n                        this._reportError(\"\\\"let-\\\" is only supported on ng-template elements.\", srcSpan);\n                    }\n                }\n                else if (bindParts[KW_REF_IDX]) {\n                    var identifier = bindParts[IDENT_KW_IDX];\n                    this._parseReference(identifier, value, srcSpan, targetRefs);\n                }\n                else if (bindParts[KW_ON_IDX]) {\n                    this._bindingParser.parseEvent(bindParts[IDENT_KW_IDX], value, srcSpan, attr.valueSpan || srcSpan, targetMatchableAttrs, boundEvents);\n                }\n                else if (bindParts[KW_BINDON_IDX]) {\n                    this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, absoluteOffset, attr.valueSpan, targetMatchableAttrs, targetProps);\n                    this._parseAssignmentEvent(bindParts[IDENT_KW_IDX], value, srcSpan, attr.valueSpan || srcSpan, targetMatchableAttrs, boundEvents);\n                }\n                else if (bindParts[KW_AT_IDX]) {\n                    this._bindingParser.parseLiteralAttr(name, value, srcSpan, absoluteOffset, attr.valueSpan, targetMatchableAttrs, targetProps);\n                }\n                else if (bindParts[IDENT_BANANA_BOX_IDX]) {\n                    this._bindingParser.parsePropertyBinding(bindParts[IDENT_BANANA_BOX_IDX], value, false, srcSpan, absoluteOffset, attr.valueSpan, targetMatchableAttrs, targetProps);\n                    this._parseAssignmentEvent(bindParts[IDENT_BANANA_BOX_IDX], value, srcSpan, attr.valueSpan || srcSpan, targetMatchableAttrs, boundEvents);\n                }\n                else if (bindParts[IDENT_PROPERTY_IDX]) {\n                    this._bindingParser.parsePropertyBinding(bindParts[IDENT_PROPERTY_IDX], value, false, srcSpan, absoluteOffset, attr.valueSpan, targetMatchableAttrs, targetProps);\n                }\n                else if (bindParts[IDENT_EVENT_IDX]) {\n                    this._bindingParser.parseEvent(bindParts[IDENT_EVENT_IDX], value, srcSpan, attr.valueSpan || srcSpan, targetMatchableAttrs, boundEvents);\n                }\n            }\n            else {\n                hasBinding = this._bindingParser.parsePropertyInterpolation(name, value, srcSpan, attr.valueSpan, targetMatchableAttrs, targetProps);\n            }\n            if (!hasBinding) {\n                this._bindingParser.parseLiteralAttr(name, value, srcSpan, absoluteOffset, attr.valueSpan, targetMatchableAttrs, targetProps);\n            }\n            targetEvents.push.apply(targetEvents, __spreadArray([], __read(boundEvents.map(function (e) { return BoundEventAst.fromParsedEvent(e); }))));\n            return hasBinding;\n        };\n        TemplateParseVisitor.prototype._normalizeAttributeName = function (attrName) {\n            return /^data-/i.test(attrName) ? attrName.substring(5) : attrName;\n        };\n        TemplateParseVisitor.prototype._parseVariable = function (identifier, value, sourceSpan, targetVars) {\n            if (identifier.indexOf('-') > -1) {\n                this._reportError(\"\\\"-\\\" is not allowed in variable names\", sourceSpan);\n            }\n            else if (identifier.length === 0) {\n                this._reportError(\"Variable does not have a name\", sourceSpan);\n            }\n            targetVars.push(new VariableAst(identifier, value, sourceSpan));\n        };\n        TemplateParseVisitor.prototype._parseReference = function (identifier, value, sourceSpan, targetRefs) {\n            if (identifier.indexOf('-') > -1) {\n                this._reportError(\"\\\"-\\\" is not allowed in reference names\", sourceSpan);\n            }\n            else if (identifier.length === 0) {\n                this._reportError(\"Reference does not have a name\", sourceSpan);\n            }\n            targetRefs.push(new ElementOrDirectiveRef(identifier, value, sourceSpan));\n        };\n        TemplateParseVisitor.prototype._parseAssignmentEvent = function (name, expression, sourceSpan, valueSpan, targetMatchableAttrs, targetEvents) {\n            this._bindingParser.parseEvent(name + \"Change\", expression + \"=$event\", sourceSpan, valueSpan, targetMatchableAttrs, targetEvents);\n        };\n        TemplateParseVisitor.prototype._parseDirectives = function (selectorMatcher, elementCssSelector) {\n            var _this = this;\n            // Need to sort the directives so that we get consistent results throughout,\n            // as selectorMatcher uses Maps inside.\n            // Also deduplicate directives as they might match more than one time!\n            var directives = newArray(this.directivesIndex.size);\n            // Whether any directive selector matches on the element name\n            var matchElement = false;\n            selectorMatcher.match(elementCssSelector, function (selector, directive) {\n                directives[_this.directivesIndex.get(directive)] = directive;\n                matchElement = matchElement || selector.hasElementSelector();\n            });\n            return {\n                directives: directives.filter(function (dir) { return !!dir; }),\n                matchElement: matchElement,\n            };\n        };\n        TemplateParseVisitor.prototype._createDirectiveAsts = function (isTemplateElement, elementName, directives, props, elementOrDirectiveRefs, elementSourceSpan, targetReferences, targetBoundDirectivePropNames) {\n            var _this = this;\n            var matchedReferences = new Set();\n            var component = null;\n            var directiveAsts = directives.map(function (directive) {\n                var sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, elementSourceSpan.fullStart, \"Directive \" + identifierName(directive.type));\n                if (directive.isComponent) {\n                    component = directive;\n                }\n                var directiveProperties = [];\n                var boundProperties = _this._bindingParser.createDirectiveHostPropertyAsts(directive, elementName, sourceSpan);\n                var hostProperties = boundProperties.map(function (prop) { return BoundElementPropertyAst.fromBoundProperty(prop); });\n                // Note: We need to check the host properties here as well,\n                // as we don't know the element name in the DirectiveWrapperCompiler yet.\n                hostProperties = _this._checkPropertiesInSchema(elementName, hostProperties);\n                var parsedEvents = _this._bindingParser.createDirectiveHostEventAsts(directive, sourceSpan);\n                _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties, targetBoundDirectivePropNames);\n                elementOrDirectiveRefs.forEach(function (elOrDirRef) {\n                    if ((elOrDirRef.value.length === 0 && directive.isComponent) ||\n                        (elOrDirRef.isReferenceToDirective(directive))) {\n                        targetReferences.push(new ReferenceAst(elOrDirRef.name, createTokenForReference(directive.type.reference), elOrDirRef.value, elOrDirRef.sourceSpan));\n                        matchedReferences.add(elOrDirRef.name);\n                    }\n                });\n                var hostEvents = parsedEvents.map(function (e) { return BoundEventAst.fromParsedEvent(e); });\n                var contentQueryStartId = _this.contentQueryStartId;\n                _this.contentQueryStartId += directive.queries.length;\n                return new DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, contentQueryStartId, sourceSpan);\n            });\n            elementOrDirectiveRefs.forEach(function (elOrDirRef) {\n                if (elOrDirRef.value.length > 0) {\n                    if (!matchedReferences.has(elOrDirRef.name)) {\n                        _this._reportError(\"There is no directive with \\\"exportAs\\\" set to \\\"\" + elOrDirRef.value + \"\\\"\", elOrDirRef.sourceSpan);\n                    }\n                }\n                else if (!component) {\n                    var refToken = null;\n                    if (isTemplateElement) {\n                        refToken = createTokenForExternalReference(_this.reflector, Identifiers$1.TemplateRef);\n                    }\n                    targetReferences.push(new ReferenceAst(elOrDirRef.name, refToken, elOrDirRef.value, elOrDirRef.sourceSpan));\n                }\n            });\n            return directiveAsts;\n        };\n        TemplateParseVisitor.prototype._createDirectivePropertyAsts = function (directiveProperties, boundProps, targetBoundDirectiveProps, targetBoundDirectivePropNames) {\n            if (directiveProperties) {\n                var boundPropsByName_1 = new Map();\n                boundProps.forEach(function (boundProp) {\n                    var prevValue = boundPropsByName_1.get(boundProp.name);\n                    if (!prevValue || prevValue.isLiteral) {\n                        // give [a]=\"b\" a higher precedence than a=\"b\" on the same element\n                        boundPropsByName_1.set(boundProp.name, boundProp);\n                    }\n                });\n                Object.keys(directiveProperties).forEach(function (dirProp) {\n                    var elProp = directiveProperties[dirProp];\n                    var boundProp = boundPropsByName_1.get(elProp);\n                    // Bindings are optional, so this binding only needs to be set up if an expression is given.\n                    if (boundProp) {\n                        targetBoundDirectivePropNames.add(boundProp.name);\n                        if (!isEmptyExpression(boundProp.expression)) {\n                            targetBoundDirectiveProps.push(new BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceSpan));\n                        }\n                    }\n                });\n            }\n        };\n        TemplateParseVisitor.prototype._createElementPropertyAsts = function (elementName, props, boundDirectivePropNames) {\n            var _this = this;\n            var boundElementProps = [];\n            props.forEach(function (prop) {\n                if (!prop.isLiteral && !boundDirectivePropNames.has(prop.name)) {\n                    var boundProp = _this._bindingParser.createBoundElementProperty(elementName, prop);\n                    boundElementProps.push(BoundElementPropertyAst.fromBoundProperty(boundProp));\n                }\n            });\n            return this._checkPropertiesInSchema(elementName, boundElementProps);\n        };\n        TemplateParseVisitor.prototype._findComponentDirectives = function (directives) {\n            return directives.filter(function (directive) { return directive.directive.isComponent; });\n        };\n        TemplateParseVisitor.prototype._findComponentDirectiveNames = function (directives) {\n            return this._findComponentDirectives(directives)\n                .map(function (directive) { return identifierName(directive.directive.type); });\n        };\n        TemplateParseVisitor.prototype._assertOnlyOneComponent = function (directives, sourceSpan) {\n            var componentTypeNames = this._findComponentDirectiveNames(directives);\n            if (componentTypeNames.length > 1) {\n                this._reportError(\"More than one component matched on this element.\\n\" +\n                    \"Make sure that only one component's selector can match a given element.\\n\" +\n                    (\"Conflicting components: \" + componentTypeNames.join(',')), sourceSpan);\n            }\n        };\n        /**\n         * Make sure that non-angular tags conform to the schemas.\n         *\n         * Note: An element is considered an angular tag when at least one directive selector matches the\n         * tag name.\n         *\n         * @param matchElement Whether any directive has matched on the tag name\n         * @param element the html element\n         */\n        TemplateParseVisitor.prototype._assertElementExists = function (matchElement, element) {\n            var elName = element.name.replace(/^:xhtml:/, '');\n            if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n                var errorMsg = \"'\" + elName + \"' is not a known element:\\n\";\n                errorMsg += \"1. If '\" + elName + \"' is an Angular component, then verify that it is part of this module.\\n\";\n                if (elName.indexOf('-') > -1) {\n                    errorMsg += \"2. If '\" + elName + \"' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\";\n                }\n                else {\n                    errorMsg +=\n                        \"2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n                }\n                this._reportError(errorMsg, element.sourceSpan);\n            }\n        };\n        TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function (directives, elementProps, sourceSpan) {\n            var _this = this;\n            var componentTypeNames = this._findComponentDirectiveNames(directives);\n            if (componentTypeNames.length > 0) {\n                this._reportError(\"Components on an embedded template: \" + componentTypeNames.join(','), sourceSpan);\n            }\n            elementProps.forEach(function (prop) {\n                _this._reportError(\"Property binding \" + prop.name + \" not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \\\"@NgModule.declarations\\\".\", sourceSpan);\n            });\n        };\n        TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function (directives, events) {\n            var _this = this;\n            var allDirectiveEvents = new Set();\n            directives.forEach(function (directive) {\n                Object.keys(directive.directive.outputs).forEach(function (k) {\n                    var eventName = directive.directive.outputs[k];\n                    allDirectiveEvents.add(eventName);\n                });\n            });\n            events.forEach(function (event) {\n                if (event.target != null || !allDirectiveEvents.has(event.name)) {\n                    _this._reportError(\"Event binding \" + event\n                        .fullName + \" not emitted by any directive on an embedded template. Make sure that the event name is spelled correctly and all directives are listed in the \\\"@NgModule.declarations\\\".\", event.sourceSpan);\n                }\n            });\n        };\n        TemplateParseVisitor.prototype._checkPropertiesInSchema = function (elementName, boundProps) {\n            var _this = this;\n            // Note: We can't filter out empty expressions before this method,\n            // as we still want to validate them!\n            return boundProps.filter(function (boundProp) {\n                if (boundProp.type === 0 /* Property */ &&\n                    !_this._schemaRegistry.hasProperty(elementName, boundProp.name, _this._schemas)) {\n                    var errorMsg = \"Can't bind to '\" + boundProp.name + \"' since it isn't a known property of '\" + elementName + \"'.\";\n                    if (elementName.startsWith('ng-')) {\n                        errorMsg +=\n                            \"\\n1. If '\" + boundProp\n                                .name + \"' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.\" +\n                                \"\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n                    }\n                    else if (elementName.indexOf('-') > -1) {\n                        errorMsg +=\n                            \"\\n1. If '\" + elementName + \"' is an Angular component and it has '\" + boundProp.name + \"' input, then verify that it is part of this module.\" +\n                                (\"\\n2. If '\" + elementName + \"' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\") +\n                                \"\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n                    }\n                    _this._reportError(errorMsg, boundProp.sourceSpan);\n                }\n                return !isEmptyExpression(boundProp.value);\n            });\n        };\n        TemplateParseVisitor.prototype._reportError = function (message, sourceSpan, level) {\n            if (level === void 0) { level = exports.ParseErrorLevel.ERROR; }\n            this._targetErrors.push(new ParseError(sourceSpan, message, level));\n        };\n        return TemplateParseVisitor;\n    }());\n    var NonBindableVisitor = /** @class */ (function () {\n        function NonBindableVisitor() {\n        }\n        NonBindableVisitor.prototype.visitElement = function (ast, parent) {\n            var preparsedElement = preparseElement(ast);\n            if (preparsedElement.type === PreparsedElementType.SCRIPT ||\n                preparsedElement.type === PreparsedElementType.STYLE ||\n                preparsedElement.type === PreparsedElementType.STYLESHEET) {\n                // Skipping <script> for security reasons\n                // Skipping <style> and stylesheets as we already processed them\n                // in the StyleCompiler\n                return null;\n            }\n            var attrNameAndValues = ast.attrs.map(function (attr) { return [attr.name, attr.value]; });\n            var selector = createElementCssSelector(ast.name, attrNameAndValues);\n            var ngContentIndex = parent.findNgContentIndex(selector);\n            var children = visitAll$1(this, ast.children, EMPTY_ELEMENT_CONTEXT);\n            return new ElementAst(ast.name, visitAll$1(this, ast.attrs), [], [], [], [], [], false, [], children, ngContentIndex, ast.sourceSpan, ast.endSourceSpan);\n        };\n        NonBindableVisitor.prototype.visitComment = function (comment, context) {\n            return null;\n        };\n        NonBindableVisitor.prototype.visitAttribute = function (attribute, context) {\n            return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);\n        };\n        NonBindableVisitor.prototype.visitText = function (text, parent) {\n            var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR());\n            return new TextAst(text.value, ngContentIndex, text.sourceSpan);\n        };\n        NonBindableVisitor.prototype.visitExpansion = function (expansion, context) {\n            return expansion;\n        };\n        NonBindableVisitor.prototype.visitExpansionCase = function (expansionCase, context) {\n            return expansionCase;\n        };\n        return NonBindableVisitor;\n    }());\n    /**\n     * A reference to an element or directive in a template. E.g., the reference in this template:\n     *\n     * <div #myMenu=\"coolMenu\">\n     *\n     * would be {name: 'myMenu', value: 'coolMenu', sourceSpan: ...}\n     */\n    var ElementOrDirectiveRef = /** @class */ (function () {\n        function ElementOrDirectiveRef(name, value, sourceSpan) {\n            this.name = name;\n            this.value = value;\n            this.sourceSpan = sourceSpan;\n        }\n        /** Gets whether this is a reference to the given directive. */\n        ElementOrDirectiveRef.prototype.isReferenceToDirective = function (directive) {\n            return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;\n        };\n        return ElementOrDirectiveRef;\n    }());\n    /** Splits a raw, potentially comma-delimited `exportAs` value into an array of names. */\n    function splitExportAs(exportAs) {\n        return exportAs ? exportAs.split(',').map(function (e) { return e.trim(); }) : [];\n    }\n    function splitClasses(classAttrValue) {\n        return classAttrValue.trim().split(/\\s+/g);\n    }\n    var ElementContext = /** @class */ (function () {\n        function ElementContext(isTemplateElement, _ngContentIndexMatcher, _wildcardNgContentIndex, providerContext) {\n            this.isTemplateElement = isTemplateElement;\n            this._ngContentIndexMatcher = _ngContentIndexMatcher;\n            this._wildcardNgContentIndex = _wildcardNgContentIndex;\n            this.providerContext = providerContext;\n        }\n        ElementContext.create = function (isTemplateElement, directives, providerContext) {\n            var matcher = new SelectorMatcher();\n            var wildcardNgContentIndex = null;\n            var component = directives.find(function (directive) { return directive.directive.isComponent; });\n            if (component) {\n                var ngContentSelectors = component.directive.template.ngContentSelectors;\n                for (var i = 0; i < ngContentSelectors.length; i++) {\n                    var selector = ngContentSelectors[i];\n                    if (selector === '*') {\n                        wildcardNgContentIndex = i;\n                    }\n                    else {\n                        matcher.addSelectables(CssSelector.parse(ngContentSelectors[i]), i);\n                    }\n                }\n            }\n            return new ElementContext(isTemplateElement, matcher, wildcardNgContentIndex, providerContext);\n        };\n        ElementContext.prototype.findNgContentIndex = function (selector) {\n            var ngContentIndices = [];\n            this._ngContentIndexMatcher.match(selector, function (selector, ngContentIndex) {\n                ngContentIndices.push(ngContentIndex);\n            });\n            ngContentIndices.sort();\n            if (this._wildcardNgContentIndex != null) {\n                ngContentIndices.push(this._wildcardNgContentIndex);\n            }\n            return ngContentIndices.length > 0 ? ngContentIndices[0] : null;\n        };\n        return ElementContext;\n    }());\n    function createElementCssSelector(elementName, attributes) {\n        var cssSelector = new CssSelector();\n        var elNameNoNs = splitNsName(elementName)[1];\n        cssSelector.setElement(elNameNoNs);\n        for (var i = 0; i < attributes.length; i++) {\n            var attrName = attributes[i][0];\n            var attrNameNoNs = splitNsName(attrName)[1];\n            var attrValue = attributes[i][1];\n            cssSelector.addAttribute(attrNameNoNs, attrValue);\n            if (attrName.toLowerCase() == CLASS_ATTR) {\n                var classes = splitClasses(attrValue);\n                classes.forEach(function (className) { return cssSelector.addClassName(className); });\n            }\n        }\n        return cssSelector;\n    }\n    var EMPTY_ELEMENT_CONTEXT = new ElementContext(true, new SelectorMatcher(), null, null);\n    var NON_BINDABLE_VISITOR = new NonBindableVisitor();\n    function _isEmptyTextNode(node) {\n        return node instanceof Text$3 && node.value.trim().length == 0;\n    }\n    function removeSummaryDuplicates(items) {\n        var map = new Map();\n        items.forEach(function (item) {\n            if (!map.get(item.type.reference)) {\n                map.set(item.type.reference, item);\n            }\n        });\n        return Array.from(map.values());\n    }\n    function isEmptyExpression(ast) {\n        if (ast instanceof ASTWithSource) {\n            ast = ast.ast;\n        }\n        return ast instanceof EmptyExpr;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Parses string representation of a style and converts it into object literal.\n     *\n     * @param value string representation of style as used in the `style` attribute in HTML.\n     *   Example: `color: red; height: auto`.\n     * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height',\n     * 'auto']`\n     */\n    function parse(value) {\n        // we use a string array here instead of a string map\n        // because a string-map is not guaranteed to retain the\n        // order of the entries whereas a string array can be\n        // constructed in a [key, value, key, value] format.\n        var styles = [];\n        var i = 0;\n        var parenDepth = 0;\n        var quote = 0 /* QuoteNone */;\n        var valueStart = 0;\n        var propStart = 0;\n        var currentProp = null;\n        var valueHasQuotes = false;\n        while (i < value.length) {\n            var token = value.charCodeAt(i++);\n            switch (token) {\n                case 40 /* OpenParen */:\n                    parenDepth++;\n                    break;\n                case 41 /* CloseParen */:\n                    parenDepth--;\n                    break;\n                case 39 /* QuoteSingle */:\n                    // valueStart needs to be there since prop values don't\n                    // have quotes in CSS\n                    valueHasQuotes = valueHasQuotes || valueStart > 0;\n                    if (quote === 0 /* QuoteNone */) {\n                        quote = 39 /* QuoteSingle */;\n                    }\n                    else if (quote === 39 /* QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {\n                        quote = 0 /* QuoteNone */;\n                    }\n                    break;\n                case 34 /* QuoteDouble */:\n                    // same logic as above\n                    valueHasQuotes = valueHasQuotes || valueStart > 0;\n                    if (quote === 0 /* QuoteNone */) {\n                        quote = 34 /* QuoteDouble */;\n                    }\n                    else if (quote === 34 /* QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {\n                        quote = 0 /* QuoteNone */;\n                    }\n                    break;\n                case 58 /* Colon */:\n                    if (!currentProp && parenDepth === 0 && quote === 0 /* QuoteNone */) {\n                        currentProp = hyphenate(value.substring(propStart, i - 1).trim());\n                        valueStart = i;\n                    }\n                    break;\n                case 59 /* Semicolon */:\n                    if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* QuoteNone */) {\n                        var styleVal = value.substring(valueStart, i - 1).trim();\n                        styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);\n                        propStart = i;\n                        valueStart = 0;\n                        currentProp = null;\n                        valueHasQuotes = false;\n                    }\n                    break;\n            }\n        }\n        if (currentProp && valueStart) {\n            var styleVal = value.substr(valueStart).trim();\n            styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);\n        }\n        return styles;\n    }\n    function stripUnnecessaryQuotes(value) {\n        var qS = value.charCodeAt(0);\n        var qE = value.charCodeAt(value.length - 1);\n        if (qS == qE && (qS == 39 /* QuoteSingle */ || qS == 34 /* QuoteDouble */)) {\n            var tempValue = value.substring(1, value.length - 1);\n            // special case to avoid using a multi-quoted string that was just chomped\n            // (e.g. `font-family: \"Verdana\", \"sans-serif\"`)\n            if (tempValue.indexOf('\\'') == -1 && tempValue.indexOf('\"') == -1) {\n                value = tempValue;\n            }\n        }\n        return value;\n    }\n    function hyphenate(value) {\n        return value\n            .replace(/[a-z][A-Z]/g, function (v) {\n            return v.charAt(0) + '-' + v.charAt(1);\n        })\n            .toLowerCase();\n    }\n\n    var IMPORTANT_FLAG = '!important';\n    /**\n     * Minimum amount of binding slots required in the runtime for style/class bindings.\n     *\n     * Styling in Angular uses up two slots in the runtime LView/TData data structures to\n     * record binding data, property information and metadata.\n     *\n     * When a binding is registered it will place the following information in the `LView`:\n     *\n     * slot 1) binding value\n     * slot 2) cached value (all other values collected before it in string form)\n     *\n     * When a binding is registered it will place the following information in the `TData`:\n     *\n     * slot 1) prop name\n     * slot 2) binding index that points to the previous style/class binding (and some extra config\n     * values)\n     *\n     * Let's imagine we have a binding that looks like so:\n     *\n     * ```\n     * <div [style.width]=\"x\" [style.height]=\"y\">\n     * ```\n     *\n     * Our `LView` and `TData` data-structures look like so:\n     *\n     * ```typescript\n     * LView = [\n     *   // ...\n     *   x, // value of x\n     *   \"width: x\",\n     *\n     *   y, // value of y\n     *   \"width: x; height: y\",\n     *   // ...\n     * ];\n     *\n     * TData = [\n     *   // ...\n     *   \"width\", // binding slot 20\n     *   0,\n     *\n     *   \"height\",\n     *   20,\n     *   // ...\n     * ];\n     * ```\n     *\n     * */\n    var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;\n    /**\n     * Produces creation/update instructions for all styling bindings (class and style)\n     *\n     * It also produces the creation instruction to register all initial styling values\n     * (which are all the static class=\"...\" and style=\"...\" attribute values that exist\n     * on an element within a template).\n     *\n     * The builder class below handles producing instructions for the following cases:\n     *\n     * - Static style/class attributes (style=\"...\" and class=\"...\")\n     * - Dynamic style/class map bindings ([style]=\"map\" and [class]=\"map|string\")\n     * - Dynamic style/class property bindings ([style.prop]=\"exp\" and [class.name]=\"exp\")\n     *\n     * Due to the complex relationship of all of these cases, the instructions generated\n     * for these attributes/properties/bindings must be done so in the correct order. The\n     * order which these must be generated is as follows:\n     *\n     * if (createMode) {\n     *   styling(...)\n     * }\n     * if (updateMode) {\n     *   styleMap(...)\n     *   classMap(...)\n     *   styleProp(...)\n     *   classProp(...)\n     * }\n     *\n     * The creation/update methods within the builder class produce these instructions.\n     */\n    var StylingBuilder = /** @class */ (function () {\n        function StylingBuilder(_directiveExpr) {\n            this._directiveExpr = _directiveExpr;\n            /** Whether or not there are any static styling values present */\n            this._hasInitialValues = false;\n            /**\n             *  Whether or not there are any styling bindings present\n             *  (i.e. `[style]`, `[class]`, `[style.prop]` or `[class.name]`)\n             */\n            this.hasBindings = false;\n            this.hasBindingsWithPipes = false;\n            /** the input for [class] (if it exists) */\n            this._classMapInput = null;\n            /** the input for [style] (if it exists) */\n            this._styleMapInput = null;\n            /** an array of each [style.prop] input */\n            this._singleStyleInputs = null;\n            /** an array of each [class.name] input */\n            this._singleClassInputs = null;\n            this._lastStylingInput = null;\n            this._firstStylingInput = null;\n            // maps are used instead of hash maps because a Map will\n            // retain the ordering of the keys\n            /**\n             * Represents the location of each style binding in the template\n             * (e.g. `<div [style.width]=\"w\" [style.height]=\"h\">` implies\n             * that `width=0` and `height=1`)\n             */\n            this._stylesIndex = new Map();\n            /**\n             * Represents the location of each class binding in the template\n             * (e.g. `<div [class.big]=\"b\" [class.hidden]=\"h\">` implies\n             * that `big=0` and `hidden=1`)\n             */\n            this._classesIndex = new Map();\n            this._initialStyleValues = [];\n            this._initialClassValues = [];\n        }\n        /**\n         * Registers a given input to the styling builder to be later used when producing AOT code.\n         *\n         * The code below will only accept the input if it is somehow tied to styling (whether it be\n         * style/class bindings or static style/class attributes).\n         */\n        StylingBuilder.prototype.registerBoundInput = function (input) {\n            // [attr.style] or [attr.class] are skipped in the code below,\n            // they should not be treated as styling-based bindings since\n            // they are intended to be written directly to the attr and\n            // will therefore skip all style/class resolution that is present\n            // with style=\"\", [style]=\"\" and [style.prop]=\"\", class=\"\",\n            // [class.prop]=\"\". [class]=\"\" assignments\n            var binding = null;\n            var name = input.name;\n            switch (input.type) {\n                case 0 /* Property */:\n                    binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);\n                    break;\n                case 3 /* Style */:\n                    binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);\n                    break;\n                case 2 /* Class */:\n                    binding = this.registerClassInput(name, false, input.value, input.sourceSpan);\n                    break;\n            }\n            return binding ? true : false;\n        };\n        StylingBuilder.prototype.registerInputBasedOnName = function (name, expression, sourceSpan) {\n            var binding = null;\n            var prefix = name.substring(0, 6);\n            var isStyle = name === 'style' || prefix === 'style.' || prefix === 'style!';\n            var isClass = !isStyle && (name === 'class' || prefix === 'class.' || prefix === 'class!');\n            if (isStyle || isClass) {\n                var isMapBased = name.charAt(5) !== '.'; // style.prop or class.prop makes this a no\n                var property = name.substr(isMapBased ? 5 : 6); // the dot explains why there's a +1\n                if (isStyle) {\n                    binding = this.registerStyleInput(property, isMapBased, expression, sourceSpan);\n                }\n                else {\n                    binding = this.registerClassInput(property, isMapBased, expression, sourceSpan);\n                }\n            }\n            return binding;\n        };\n        StylingBuilder.prototype.registerStyleInput = function (name, isMapBased, value, sourceSpan, suffix) {\n            if (isEmptyExpression(value)) {\n                return null;\n            }\n            // CSS custom properties are case-sensitive so we shouldn't normalize them.\n            // See: https://www.w3.org/TR/css-variables-1/#defining-variables\n            if (!isCssCustomProperty(name)) {\n                name = hyphenate(name);\n            }\n            var _a = parseProperty(name), property = _a.property, hasOverrideFlag = _a.hasOverrideFlag, bindingSuffix = _a.suffix;\n            suffix = typeof suffix === 'string' && suffix.length !== 0 ? suffix : bindingSuffix;\n            var entry = { name: property, suffix: suffix, value: value, sourceSpan: sourceSpan, hasOverrideFlag: hasOverrideFlag };\n            if (isMapBased) {\n                this._styleMapInput = entry;\n            }\n            else {\n                (this._singleStyleInputs = this._singleStyleInputs || []).push(entry);\n                registerIntoMap(this._stylesIndex, property);\n            }\n            this._lastStylingInput = entry;\n            this._firstStylingInput = this._firstStylingInput || entry;\n            this._checkForPipes(value);\n            this.hasBindings = true;\n            return entry;\n        };\n        StylingBuilder.prototype.registerClassInput = function (name, isMapBased, value, sourceSpan) {\n            if (isEmptyExpression(value)) {\n                return null;\n            }\n            var _a = parseProperty(name), property = _a.property, hasOverrideFlag = _a.hasOverrideFlag;\n            var entry = { name: property, value: value, sourceSpan: sourceSpan, hasOverrideFlag: hasOverrideFlag, suffix: null };\n            if (isMapBased) {\n                this._classMapInput = entry;\n            }\n            else {\n                (this._singleClassInputs = this._singleClassInputs || []).push(entry);\n                registerIntoMap(this._classesIndex, property);\n            }\n            this._lastStylingInput = entry;\n            this._firstStylingInput = this._firstStylingInput || entry;\n            this._checkForPipes(value);\n            this.hasBindings = true;\n            return entry;\n        };\n        StylingBuilder.prototype._checkForPipes = function (value) {\n            if ((value instanceof ASTWithSource) && (value.ast instanceof BindingPipe)) {\n                this.hasBindingsWithPipes = true;\n            }\n        };\n        /**\n         * Registers the element's static style string value to the builder.\n         *\n         * @param value the style string (e.g. `width:100px; height:200px;`)\n         */\n        StylingBuilder.prototype.registerStyleAttr = function (value) {\n            this._initialStyleValues = parse(value);\n            this._hasInitialValues = true;\n        };\n        /**\n         * Registers the element's static class string value to the builder.\n         *\n         * @param value the className string (e.g. `disabled gold zoom`)\n         */\n        StylingBuilder.prototype.registerClassAttr = function (value) {\n            this._initialClassValues = value.trim().split(/\\s+/g);\n            this._hasInitialValues = true;\n        };\n        /**\n         * Appends all styling-related expressions to the provided attrs array.\n         *\n         * @param attrs an existing array where each of the styling expressions\n         * will be inserted into.\n         */\n        StylingBuilder.prototype.populateInitialStylingAttrs = function (attrs) {\n            // [CLASS_MARKER, 'foo', 'bar', 'baz' ...]\n            if (this._initialClassValues.length) {\n                attrs.push(literal(1 /* Classes */));\n                for (var i = 0; i < this._initialClassValues.length; i++) {\n                    attrs.push(literal(this._initialClassValues[i]));\n                }\n            }\n            // [STYLE_MARKER, 'width', '200px', 'height', '100px', ...]\n            if (this._initialStyleValues.length) {\n                attrs.push(literal(2 /* Styles */));\n                for (var i = 0; i < this._initialStyleValues.length; i += 2) {\n                    attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));\n                }\n            }\n        };\n        /**\n         * Builds an instruction with all the expressions and parameters for `elementHostAttrs`.\n         *\n         * The instruction generation code below is used for producing the AOT statement code which is\n         * responsible for registering initial styles (within a directive hostBindings' creation block),\n         * as well as any of the provided attribute values, to the directive host element.\n         */\n        StylingBuilder.prototype.assignHostAttrs = function (attrs, definitionMap) {\n            if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {\n                this.populateInitialStylingAttrs(attrs);\n                definitionMap.set('hostAttrs', literalArr(attrs));\n            }\n        };\n        /**\n         * Builds an instruction with all the expressions and parameters for `classMap`.\n         *\n         * The instruction data will contain all expressions for `classMap` to function\n         * which includes the `[class]` expression params.\n         */\n        StylingBuilder.prototype.buildClassMapInstruction = function (valueConverter) {\n            if (this._classMapInput) {\n                return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);\n            }\n            return null;\n        };\n        /**\n         * Builds an instruction with all the expressions and parameters for `styleMap`.\n         *\n         * The instruction data will contain all expressions for `styleMap` to function\n         * which includes the `[style]` expression params.\n         */\n        StylingBuilder.prototype.buildStyleMapInstruction = function (valueConverter) {\n            if (this._styleMapInput) {\n                return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);\n            }\n            return null;\n        };\n        StylingBuilder.prototype._buildMapBasedInstruction = function (valueConverter, isClassBased, stylingInput) {\n            // each styling binding value is stored in the LView\n            // map-based bindings allocate two slots: one for the\n            // previous binding value and another for the previous\n            // className or style attribute value.\n            var totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;\n            // these values must be outside of the update block so that they can\n            // be evaluated (the AST visit call) during creation time so that any\n            // pipes can be picked up in time before the template is built\n            var mapValue = stylingInput.value.visit(valueConverter);\n            var reference;\n            if (mapValue instanceof Interpolation) {\n                totalBindingSlotsRequired += mapValue.expressions.length;\n                reference = isClassBased ? getClassMapInterpolationExpression(mapValue) :\n                    getStyleMapInterpolationExpression(mapValue);\n            }\n            else {\n                reference = isClassBased ? Identifiers.classMap : Identifiers.styleMap;\n            }\n            return {\n                reference: reference,\n                calls: [{\n                        supportsInterpolation: true,\n                        sourceSpan: stylingInput.sourceSpan,\n                        allocateBindingSlots: totalBindingSlotsRequired,\n                        params: function (convertFn) {\n                            var convertResult = convertFn(mapValue);\n                            var params = Array.isArray(convertResult) ? convertResult : [convertResult];\n                            return params;\n                        }\n                    }]\n            };\n        };\n        StylingBuilder.prototype._buildSingleInputs = function (reference, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {\n            var instructions = [];\n            inputs.forEach(function (input) {\n                var previousInstruction = instructions[instructions.length - 1];\n                var value = input.value.visit(valueConverter);\n                var referenceForCall = reference;\n                // each styling binding value is stored in the LView\n                // but there are two values stored for each binding:\n                //   1) the value itself\n                //   2) an intermediate value (concatenation of style up to this point).\n                //      We need to store the intermediate value so that we don't allocate\n                //      the strings on each CD.\n                var totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;\n                if (value instanceof Interpolation) {\n                    totalBindingSlotsRequired += value.expressions.length;\n                    if (getInterpolationExpressionFn) {\n                        referenceForCall = getInterpolationExpressionFn(value);\n                    }\n                }\n                var call = {\n                    sourceSpan: input.sourceSpan,\n                    allocateBindingSlots: totalBindingSlotsRequired,\n                    supportsInterpolation: !!getInterpolationExpressionFn,\n                    params: function (convertFn) {\n                        // params => stylingProp(propName, value, suffix)\n                        var params = [];\n                        params.push(literal(input.name));\n                        var convertResult = convertFn(value);\n                        if (Array.isArray(convertResult)) {\n                            params.push.apply(params, __spreadArray([], __read(convertResult)));\n                        }\n                        else {\n                            params.push(convertResult);\n                        }\n                        // [style.prop] bindings may use suffix values (e.g. px, em, etc...), therefore,\n                        // if that is detected then we need to pass that in as an optional param.\n                        if (!isClassBased && input.suffix !== null) {\n                            params.push(literal(input.suffix));\n                        }\n                        return params;\n                    }\n                };\n                // If we ended up generating a call to the same instruction as the previous styling property\n                // we can chain the calls together safely to save some bytes, otherwise we have to generate\n                // a separate instruction call. This is primarily a concern with interpolation instructions\n                // where we may start off with one `reference`, but end up using another based on the\n                // number of interpolations.\n                if (previousInstruction && previousInstruction.reference === referenceForCall) {\n                    previousInstruction.calls.push(call);\n                }\n                else {\n                    instructions.push({ reference: referenceForCall, calls: [call] });\n                }\n            });\n            return instructions;\n        };\n        StylingBuilder.prototype._buildClassInputs = function (valueConverter) {\n            if (this._singleClassInputs) {\n                return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);\n            }\n            return [];\n        };\n        StylingBuilder.prototype._buildStyleInputs = function (valueConverter) {\n            if (this._singleStyleInputs) {\n                return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);\n            }\n            return [];\n        };\n        /**\n         * Constructs all instructions which contain the expressions that will be placed\n         * into the update block of a template function or a directive hostBindings function.\n         */\n        StylingBuilder.prototype.buildUpdateLevelInstructions = function (valueConverter) {\n            var instructions = [];\n            if (this.hasBindings) {\n                var styleMapInstruction = this.buildStyleMapInstruction(valueConverter);\n                if (styleMapInstruction) {\n                    instructions.push(styleMapInstruction);\n                }\n                var classMapInstruction = this.buildClassMapInstruction(valueConverter);\n                if (classMapInstruction) {\n                    instructions.push(classMapInstruction);\n                }\n                instructions.push.apply(instructions, __spreadArray([], __read(this._buildStyleInputs(valueConverter))));\n                instructions.push.apply(instructions, __spreadArray([], __read(this._buildClassInputs(valueConverter))));\n            }\n            return instructions;\n        };\n        return StylingBuilder;\n    }());\n    function registerIntoMap(map, key) {\n        if (!map.has(key)) {\n            map.set(key, map.size);\n        }\n    }\n    function parseProperty(name) {\n        var hasOverrideFlag = false;\n        var overrideIndex = name.indexOf(IMPORTANT_FLAG);\n        if (overrideIndex !== -1) {\n            name = overrideIndex > 0 ? name.substring(0, overrideIndex) : '';\n            hasOverrideFlag = true;\n        }\n        var suffix = null;\n        var property = name;\n        var unitIndex = name.lastIndexOf('.');\n        if (unitIndex > 0) {\n            suffix = name.substr(unitIndex + 1);\n            property = name.substring(0, unitIndex);\n        }\n        return { property: property, suffix: suffix, hasOverrideFlag: hasOverrideFlag };\n    }\n    /**\n     * Gets the instruction to generate for an interpolated class map.\n     * @param interpolation An Interpolation AST\n     */\n    function getClassMapInterpolationExpression(interpolation) {\n        switch (getInterpolationArgsLength(interpolation)) {\n            case 1:\n                return Identifiers.classMap;\n            case 3:\n                return Identifiers.classMapInterpolate1;\n            case 5:\n                return Identifiers.classMapInterpolate2;\n            case 7:\n                return Identifiers.classMapInterpolate3;\n            case 9:\n                return Identifiers.classMapInterpolate4;\n            case 11:\n                return Identifiers.classMapInterpolate5;\n            case 13:\n                return Identifiers.classMapInterpolate6;\n            case 15:\n                return Identifiers.classMapInterpolate7;\n            case 17:\n                return Identifiers.classMapInterpolate8;\n            default:\n                return Identifiers.classMapInterpolateV;\n        }\n    }\n    /**\n     * Gets the instruction to generate for an interpolated style map.\n     * @param interpolation An Interpolation AST\n     */\n    function getStyleMapInterpolationExpression(interpolation) {\n        switch (getInterpolationArgsLength(interpolation)) {\n            case 1:\n                return Identifiers.styleMap;\n            case 3:\n                return Identifiers.styleMapInterpolate1;\n            case 5:\n                return Identifiers.styleMapInterpolate2;\n            case 7:\n                return Identifiers.styleMapInterpolate3;\n            case 9:\n                return Identifiers.styleMapInterpolate4;\n            case 11:\n                return Identifiers.styleMapInterpolate5;\n            case 13:\n                return Identifiers.styleMapInterpolate6;\n            case 15:\n                return Identifiers.styleMapInterpolate7;\n            case 17:\n                return Identifiers.styleMapInterpolate8;\n            default:\n                return Identifiers.styleMapInterpolateV;\n        }\n    }\n    /**\n     * Gets the instruction to generate for an interpolated style prop.\n     * @param interpolation An Interpolation AST\n     */\n    function getStylePropInterpolationExpression(interpolation) {\n        switch (getInterpolationArgsLength(interpolation)) {\n            case 1:\n                return Identifiers.styleProp;\n            case 3:\n                return Identifiers.stylePropInterpolate1;\n            case 5:\n                return Identifiers.stylePropInterpolate2;\n            case 7:\n                return Identifiers.stylePropInterpolate3;\n            case 9:\n                return Identifiers.stylePropInterpolate4;\n            case 11:\n                return Identifiers.stylePropInterpolate5;\n            case 13:\n                return Identifiers.stylePropInterpolate6;\n            case 15:\n                return Identifiers.stylePropInterpolate7;\n            case 17:\n                return Identifiers.stylePropInterpolate8;\n            default:\n                return Identifiers.stylePropInterpolateV;\n        }\n    }\n    /**\n     * Checks whether property name is a custom CSS property.\n     * See: https://www.w3.org/TR/css-variables-1\n     */\n    function isCssCustomProperty(name) {\n        return name.startsWith('--');\n    }\n\n    /**\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://angular.io/license\n     */\n    (function (TokenType) {\n        TokenType[TokenType[\"Character\"] = 0] = \"Character\";\n        TokenType[TokenType[\"Identifier\"] = 1] = \"Identifier\";\n        TokenType[TokenType[\"PrivateIdentifier\"] = 2] = \"PrivateIdentifier\";\n        TokenType[TokenType[\"Keyword\"] = 3] = \"Keyword\";\n        TokenType[TokenType[\"String\"] = 4] = \"String\";\n        TokenType[TokenType[\"Operator\"] = 5] = \"Operator\";\n        TokenType[TokenType[\"Number\"] = 6] = \"Number\";\n        TokenType[TokenType[\"Error\"] = 7] = \"Error\";\n    })(exports.TokenType || (exports.TokenType = {}));\n    var KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];\n    var Lexer = /** @class */ (function () {\n        function Lexer() {\n        }\n        Lexer.prototype.tokenize = function (text) {\n            var scanner = new _Scanner(text);\n            var tokens = [];\n            var token = scanner.scanToken();\n            while (token != null) {\n                tokens.push(token);\n                token = scanner.scanToken();\n            }\n            return tokens;\n        };\n        return Lexer;\n    }());\n    var Token$1 = /** @class */ (function () {\n        function Token(index, end, type, numValue, strValue) {\n            this.index = index;\n            this.end = end;\n            this.type = type;\n            this.numValue = numValue;\n            this.strValue = strValue;\n        }\n        Token.prototype.isCharacter = function (code) {\n            return this.type == exports.TokenType.Character && this.numValue == code;\n        };\n        Token.prototype.isNumber = function () {\n            return this.type == exports.TokenType.Number;\n        };\n        Token.prototype.isString = function () {\n            return this.type == exports.TokenType.String;\n        };\n        Token.prototype.isOperator = function (operator) {\n            return this.type == exports.TokenType.Operator && this.strValue == operator;\n        };\n        Token.prototype.isIdentifier = function () {\n            return this.type == exports.TokenType.Identifier;\n        };\n        Token.prototype.isPrivateIdentifier = function () {\n            return this.type == exports.TokenType.PrivateIdentifier;\n        };\n        Token.prototype.isKeyword = function () {\n            return this.type == exports.TokenType.Keyword;\n        };\n        Token.prototype.isKeywordLet = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'let';\n        };\n        Token.prototype.isKeywordAs = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'as';\n        };\n        Token.prototype.isKeywordNull = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'null';\n        };\n        Token.prototype.isKeywordUndefined = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'undefined';\n        };\n        Token.prototype.isKeywordTrue = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'true';\n        };\n        Token.prototype.isKeywordFalse = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'false';\n        };\n        Token.prototype.isKeywordThis = function () {\n            return this.type == exports.TokenType.Keyword && this.strValue == 'this';\n        };\n        Token.prototype.isError = function () {\n            return this.type == exports.TokenType.Error;\n        };\n        Token.prototype.toNumber = function () {\n            return this.type == exports.TokenType.Number ? this.numValue : -1;\n        };\n        Token.prototype.toString = function () {\n            switch (this.type) {\n                case exports.TokenType.Character:\n                case exports.TokenType.Identifier:\n                case exports.TokenType.Keyword:\n                case exports.TokenType.Operator:\n                case exports.TokenType.PrivateIdentifier:\n                case exports.TokenType.String:\n                case exports.TokenType.Error:\n                    return this.strValue;\n                case exports.TokenType.Number:\n                    return this.numValue.toString();\n                default:\n                    return null;\n            }\n        };\n        return Token;\n    }());\n    function newCharacterToken(index, end, code) {\n        return new Token$1(index, end, exports.TokenType.Character, code, String.fromCharCode(code));\n    }\n    function newIdentifierToken(index, end, text) {\n        return new Token$1(index, end, exports.TokenType.Identifier, 0, text);\n    }\n    function newPrivateIdentifierToken(index, end, text) {\n        return new Token$1(index, end, exports.TokenType.PrivateIdentifier, 0, text);\n    }\n    function newKeywordToken(index, end, text) {\n        return new Token$1(index, end, exports.TokenType.Keyword, 0, text);\n    }\n    function newOperatorToken(index, end, text) {\n        return new Token$1(index, end, exports.TokenType.Operator, 0, text);\n    }\n    function newStringToken(index, end, text) {\n        return new Token$1(index, end, exports.TokenType.String, 0, text);\n    }\n    function newNumberToken(index, end, n) {\n        return new Token$1(index, end, exports.TokenType.Number, n, '');\n    }\n    function newErrorToken(index, end, message) {\n        return new Token$1(index, end, exports.TokenType.Error, 0, message);\n    }\n    var EOF = new Token$1(-1, -1, exports.TokenType.Character, 0, '');\n    var _Scanner = /** @class */ (function () {\n        function _Scanner(input) {\n            this.input = input;\n            this.peek = 0;\n            this.index = -1;\n            this.length = input.length;\n            this.advance();\n        }\n        _Scanner.prototype.advance = function () {\n            this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);\n        };\n        _Scanner.prototype.scanToken = function () {\n            var input = this.input, length = this.length;\n            var peek = this.peek, index = this.index;\n            // Skip whitespace.\n            while (peek <= $SPACE) {\n                if (++index >= length) {\n                    peek = $EOF;\n                    break;\n                }\n                else {\n                    peek = input.charCodeAt(index);\n                }\n            }\n            this.peek = peek;\n            this.index = index;\n            if (index >= length) {\n                return null;\n            }\n            // Handle identifiers and numbers.\n            if (isIdentifierStart(peek))\n                return this.scanIdentifier();\n            if (isDigit(peek))\n                return this.scanNumber(index);\n            var start = index;\n            switch (peek) {\n                case $PERIOD:\n                    this.advance();\n                    return isDigit(this.peek) ? this.scanNumber(start) :\n                        newCharacterToken(start, this.index, $PERIOD);\n                case $LPAREN:\n                case $RPAREN:\n                case $LBRACE:\n                case $RBRACE:\n                case $LBRACKET:\n                case $RBRACKET:\n                case $COMMA:\n                case $COLON:\n                case $SEMICOLON:\n                    return this.scanCharacter(start, peek);\n                case $SQ:\n                case $DQ:\n                    return this.scanString();\n                case $HASH:\n                    return this.scanPrivateIdentifier();\n                case $PLUS:\n                case $MINUS:\n                case $STAR:\n                case $SLASH:\n                case $PERCENT:\n                case $CARET:\n                    return this.scanOperator(start, String.fromCharCode(peek));\n                case $QUESTION:\n                    return this.scanQuestion(start);\n                case $LT:\n                case $GT:\n                    return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');\n                case $BANG:\n                case $EQ:\n                    return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');\n                case $AMPERSAND:\n                    return this.scanComplexOperator(start, '&', $AMPERSAND, '&');\n                case $BAR:\n                    return this.scanComplexOperator(start, '|', $BAR, '|');\n                case $NBSP:\n                    while (isWhitespace(this.peek))\n                        this.advance();\n                    return this.scanToken();\n            }\n            this.advance();\n            return this.error(\"Unexpected character [\" + String.fromCharCode(peek) + \"]\", 0);\n        };\n        _Scanner.prototype.scanCharacter = function (start, code) {\n            this.advance();\n            return newCharacterToken(start, this.index, code);\n        };\n        _Scanner.prototype.scanOperator = function (start, str) {\n            this.advance();\n            return newOperatorToken(start, this.index, str);\n        };\n        /**\n         * Tokenize a 2/3 char long operator\n         *\n         * @param start start index in the expression\n         * @param one first symbol (always part of the operator)\n         * @param twoCode code point for the second symbol\n         * @param two second symbol (part of the operator when the second code point matches)\n         * @param threeCode code point for the third symbol\n         * @param three third symbol (part of the operator when provided and matches source expression)\n         */\n        _Scanner.prototype.scanComplexOperator = function (start, one, twoCode, two, threeCode, three) {\n            this.advance();\n            var str = one;\n            if (this.peek == twoCode) {\n                this.advance();\n                str += two;\n            }\n            if (threeCode != null && this.peek == threeCode) {\n                this.advance();\n                str += three;\n            }\n            return newOperatorToken(start, this.index, str);\n        };\n        _Scanner.prototype.scanIdentifier = function () {\n            var start = this.index;\n            this.advance();\n            while (isIdentifierPart(this.peek))\n                this.advance();\n            var str = this.input.substring(start, this.index);\n            return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, this.index, str) :\n                newIdentifierToken(start, this.index, str);\n        };\n        /** Scans an ECMAScript private identifier. */\n        _Scanner.prototype.scanPrivateIdentifier = function () {\n            var start = this.index;\n            this.advance();\n            if (!isIdentifierStart(this.peek)) {\n                return this.error('Invalid character [#]', -1);\n            }\n            while (isIdentifierPart(this.peek))\n                this.advance();\n            var identifierName = this.input.substring(start, this.index);\n            return newPrivateIdentifierToken(start, this.index, identifierName);\n        };\n        _Scanner.prototype.scanNumber = function (start) {\n            var simple = (this.index === start);\n            var hasSeparators = false;\n            this.advance(); // Skip initial digit.\n            while (true) {\n                if (isDigit(this.peek)) {\n                    // Do nothing.\n                }\n                else if (this.peek === $_) {\n                    // Separators are only valid when they're surrounded by digits. E.g. `1_0_1` is\n                    // valid while `_101` and `101_` are not. The separator can't be next to the decimal\n                    // point or another separator either. Note that it's unlikely that we'll hit a case where\n                    // the underscore is at the start, because that's a valid identifier and it will be picked\n                    // up earlier in the parsing. We validate for it anyway just in case.\n                    if (!isDigit(this.input.charCodeAt(this.index - 1)) ||\n                        !isDigit(this.input.charCodeAt(this.index + 1))) {\n                        return this.error('Invalid numeric separator', 0);\n                    }\n                    hasSeparators = true;\n                }\n                else if (this.peek === $PERIOD) {\n                    simple = false;\n                }\n                else if (isExponentStart(this.peek)) {\n                    this.advance();\n                    if (isExponentSign(this.peek))\n                        this.advance();\n                    if (!isDigit(this.peek))\n                        return this.error('Invalid exponent', -1);\n                    simple = false;\n                }\n                else {\n                    break;\n                }\n                this.advance();\n            }\n            var str = this.input.substring(start, this.index);\n            if (hasSeparators) {\n                str = str.replace(/_/g, '');\n            }\n            var value = simple ? parseIntAutoRadix(str) : parseFloat(str);\n            return newNumberToken(start, this.index, value);\n        };\n        _Scanner.prototype.scanString = function () {\n            var start = this.index;\n            var quote = this.peek;\n            this.advance(); // Skip initial quote.\n            var buffer = '';\n            var marker = this.index;\n            var input = this.input;\n            while (this.peek != quote) {\n                if (this.peek == $BACKSLASH) {\n                    buffer += input.substring(marker, this.index);\n                    this.advance();\n                    var unescapedCode = void 0;\n                    // Workaround for TS2.1-introduced type strictness\n                    this.peek = this.peek;\n                    if (this.peek == $u) {\n                        // 4 character hex code for unicode character.\n                        var hex = input.substring(this.index + 1, this.index + 5);\n                        if (/^[0-9a-f]+$/i.test(hex)) {\n                            unescapedCode = parseInt(hex, 16);\n                        }\n                        else {\n                            return this.error(\"Invalid unicode escape [\\\\u\" + hex + \"]\", 0);\n                        }\n                        for (var i = 0; i < 5; i++) {\n                            this.advance();\n                        }\n                    }\n                    else {\n                        unescapedCode = unescape(this.peek);\n                        this.advance();\n                    }\n                    buffer += String.fromCharCode(unescapedCode);\n                    marker = this.index;\n                }\n                else if (this.peek == $EOF) {\n                    return this.error('Unterminated quote', 0);\n                }\n                else {\n                    this.advance();\n                }\n            }\n            var last = input.substring(marker, this.index);\n            this.advance(); // Skip terminating quote.\n            return newStringToken(start, this.index, buffer + last);\n        };\n        _Scanner.prototype.scanQuestion = function (start) {\n            this.advance();\n            var str = '?';\n            // Either `a ?? b` or 'a?.b'.\n            if (this.peek === $QUESTION || this.peek === $PERIOD) {\n                str += this.peek === $PERIOD ? '.' : '?';\n                this.advance();\n            }\n            return newOperatorToken(start, this.index, str);\n        };\n        _Scanner.prototype.error = function (message, offset) {\n            var position = this.index + offset;\n            return newErrorToken(position, this.index, \"Lexer Error: \" + message + \" at column \" + position + \" in expression [\" + this.input + \"]\");\n        };\n        return _Scanner;\n    }());\n    function isIdentifierStart(code) {\n        return ($a <= code && code <= $z) || ($A <= code && code <= $Z) ||\n            (code == $_) || (code == $$);\n    }\n    function isIdentifier(input) {\n        if (input.length == 0)\n            return false;\n        var scanner = new _Scanner(input);\n        if (!isIdentifierStart(scanner.peek))\n            return false;\n        scanner.advance();\n        while (scanner.peek !== $EOF) {\n            if (!isIdentifierPart(scanner.peek))\n                return false;\n            scanner.advance();\n        }\n        return true;\n    }\n    function isIdentifierPart(code) {\n        return isAsciiLetter(code) || isDigit(code) || (code == $_) ||\n            (code == $$);\n    }\n    function isExponentStart(code) {\n        return code == $e || code == $E;\n    }\n    function isExponentSign(code) {\n        return code == $MINUS || code == $PLUS;\n    }\n    function isQuote(code) {\n        return code === $SQ || code === $DQ || code === $BT;\n    }\n    function unescape(code) {\n        switch (code) {\n            case $n:\n                return $LF;\n            case $f:\n                return $FF;\n            case $r:\n                return $CR;\n            case $t:\n                return $TAB;\n            case $v:\n                return $VTAB;\n            default:\n                return code;\n        }\n    }\n    function parseIntAutoRadix(text) {\n        var result = parseInt(text);\n        if (isNaN(result)) {\n            throw new Error('Invalid integer literal when parsing ' + text);\n        }\n        return result;\n    }\n\n    var SplitInterpolation = /** @class */ (function () {\n        function SplitInterpolation(strings, expressions, offsets) {\n            this.strings = strings;\n            this.expressions = expressions;\n            this.offsets = offsets;\n        }\n        return SplitInterpolation;\n    }());\n    var TemplateBindingParseResult = /** @class */ (function () {\n        function TemplateBindingParseResult(templateBindings, warnings, errors) {\n            this.templateBindings = templateBindings;\n            this.warnings = warnings;\n            this.errors = errors;\n        }\n        return TemplateBindingParseResult;\n    }());\n    var Parser$1 = /** @class */ (function () {\n        function Parser(_lexer) {\n            this._lexer = _lexer;\n            this.errors = [];\n            this.simpleExpressionChecker = SimpleExpressionChecker;\n        }\n        Parser.prototype.parseAction = function (input, location, absoluteOffset, interpolationConfig) {\n            if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n            this._checkNoInterpolation(input, location, interpolationConfig);\n            var sourceToLex = this._stripComments(input);\n            var tokens = this._lexer.tokenize(this._stripComments(input));\n            var ast = new _ParseAST(input, location, absoluteOffset, tokens, sourceToLex.length, true, this.errors, input.length - sourceToLex.length)\n                .parseChain();\n            return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);\n        };\n        Parser.prototype.parseBinding = function (input, location, absoluteOffset, interpolationConfig) {\n            if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n            var ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig);\n            return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);\n        };\n        Parser.prototype.checkSimpleExpression = function (ast) {\n            var checker = new this.simpleExpressionChecker();\n            ast.visit(checker);\n            return checker.errors;\n        };\n        Parser.prototype.parseSimpleBinding = function (input, location, absoluteOffset, interpolationConfig) {\n            if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n            var ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig);\n            var errors = this.checkSimpleExpression(ast);\n            if (errors.length > 0) {\n                this._reportError(\"Host binding expression cannot contain \" + errors.join(' '), input, location);\n            }\n            return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);\n        };\n        Parser.prototype._reportError = function (message, input, errLocation, ctxLocation) {\n            this.errors.push(new ParserError(message, input, errLocation, ctxLocation));\n        };\n        Parser.prototype._parseBindingAst = function (input, location, absoluteOffset, interpolationConfig) {\n            // Quotes expressions use 3rd-party expression language. We don't want to use\n            // our lexer or parser for that, so we check for that ahead of time.\n            var quote = this._parseQuote(input, location, absoluteOffset);\n            if (quote != null) {\n                return quote;\n            }\n            this._checkNoInterpolation(input, location, interpolationConfig);\n            var sourceToLex = this._stripComments(input);\n            var tokens = this._lexer.tokenize(sourceToLex);\n            return new _ParseAST(input, location, absoluteOffset, tokens, sourceToLex.length, false, this.errors, input.length - sourceToLex.length)\n                .parseChain();\n        };\n        Parser.prototype._parseQuote = function (input, location, absoluteOffset) {\n            if (input == null)\n                return null;\n            var prefixSeparatorIndex = input.indexOf(':');\n            if (prefixSeparatorIndex == -1)\n                return null;\n            var prefix = input.substring(0, prefixSeparatorIndex).trim();\n            if (!isIdentifier(prefix))\n                return null;\n            var uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);\n            var span = new ParseSpan(0, input.length);\n            return new Quote(span, span.toAbsolute(absoluteOffset), prefix, uninterpretedExpression, location);\n        };\n        /**\n         * Parse microsyntax template expression and return a list of bindings or\n         * parsing errors in case the given expression is invalid.\n         *\n         * For example,\n         * ```\n         *   <div *ngFor=\"let item of items\">\n         *         ^      ^ absoluteValueOffset for `templateValue`\n         *         absoluteKeyOffset for `templateKey`\n         * ```\n         * contains three bindings:\n         * 1. ngFor -> null\n         * 2. item -> NgForOfContext.$implicit\n         * 3. ngForOf -> items\n         *\n         * This is apparent from the de-sugared template:\n         * ```\n         *   <ng-template ngFor let-item [ngForOf]=\"items\">\n         * ```\n         *\n         * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor\n         * @param templateValue RHS of the microsyntax attribute\n         * @param templateUrl template filename if it's external, component filename if it's inline\n         * @param absoluteKeyOffset start of the `templateKey`\n         * @param absoluteValueOffset start of the `templateValue`\n         */\n        Parser.prototype.parseTemplateBindings = function (templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {\n            var tokens = this._lexer.tokenize(templateValue);\n            var parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, templateValue.length, false /* parseAction */, this.errors, 0 /* relative offset */);\n            return parser.parseTemplateBindings({\n                source: templateKey,\n                span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),\n            });\n        };\n        Parser.prototype.parseInterpolation = function (input, location, absoluteOffset, interpolationConfig) {\n            if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n            var _b = this.splitInterpolation(input, location, interpolationConfig), strings = _b.strings, expressions = _b.expressions, offsets = _b.offsets;\n            if (expressions.length === 0)\n                return null;\n            var expressionNodes = [];\n            for (var i = 0; i < expressions.length; ++i) {\n                var expressionText = expressions[i].text;\n                var sourceToLex = this._stripComments(expressionText);\n                var tokens = this._lexer.tokenize(sourceToLex);\n                var ast = new _ParseAST(input, location, absoluteOffset, tokens, sourceToLex.length, false, this.errors, offsets[i] + (expressionText.length - sourceToLex.length))\n                    .parseChain();\n                expressionNodes.push(ast);\n            }\n            return this.createInterpolationAst(strings.map(function (s) { return s.text; }), expressionNodes, input, location, absoluteOffset);\n        };\n        /**\n         * Similar to `parseInterpolation`, but treats the provided string as a single expression\n         * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).\n         * This is used for parsing the switch expression in ICUs.\n         */\n        Parser.prototype.parseInterpolationExpression = function (expression, location, absoluteOffset) {\n            var sourceToLex = this._stripComments(expression);\n            var tokens = this._lexer.tokenize(sourceToLex);\n            var ast = new _ParseAST(expression, location, absoluteOffset, tokens, sourceToLex.length, \n            /* parseAction */ false, this.errors, 0)\n                .parseChain();\n            var strings = ['', '']; // The prefix and suffix strings are both empty\n            return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);\n        };\n        Parser.prototype.createInterpolationAst = function (strings, expressions, input, location, absoluteOffset) {\n            var span = new ParseSpan(0, input.length);\n            var interpolation = new Interpolation(span, span.toAbsolute(absoluteOffset), strings, expressions);\n            return new ASTWithSource(interpolation, input, location, absoluteOffset, this.errors);\n        };\n        /**\n         * Splits a string of text into \"raw\" text segments and expressions present in interpolations in\n         * the string.\n         * Returns `null` if there are no interpolations, otherwise a\n         * `SplitInterpolation` with splits that look like\n         *   <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>\n         */\n        Parser.prototype.splitInterpolation = function (input, location, interpolationConfig) {\n            if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n            var strings = [];\n            var expressions = [];\n            var offsets = [];\n            var i = 0;\n            var atInterpolation = false;\n            var extendLastString = false;\n            var interpStart = interpolationConfig.start, interpEnd = interpolationConfig.end;\n            while (i < input.length) {\n                if (!atInterpolation) {\n                    // parse until starting {{\n                    var start = i;\n                    i = input.indexOf(interpStart, i);\n                    if (i === -1) {\n                        i = input.length;\n                    }\n                    var text = input.substring(start, i);\n                    strings.push({ text: text, start: start, end: i });\n                    atInterpolation = true;\n                }\n                else {\n                    // parse from starting {{ to ending }} while ignoring content inside quotes.\n                    var fullStart = i;\n                    var exprStart = fullStart + interpStart.length;\n                    var exprEnd = this._getInterpolationEndIndex(input, interpEnd, exprStart);\n                    if (exprEnd === -1) {\n                        // Could not find the end of the interpolation; do not parse an expression.\n                        // Instead we should extend the content on the last raw string.\n                        atInterpolation = false;\n                        extendLastString = true;\n                        break;\n                    }\n                    var fullEnd = exprEnd + interpEnd.length;\n                    var text = input.substring(exprStart, exprEnd);\n                    if (text.trim().length === 0) {\n                        this._reportError('Blank expressions are not allowed in interpolated strings', input, \"at column \" + i + \" in\", location);\n                    }\n                    expressions.push({ text: text, start: fullStart, end: fullEnd });\n                    offsets.push(exprStart);\n                    i = fullEnd;\n                    atInterpolation = false;\n                }\n            }\n            if (!atInterpolation) {\n                // If we are now at a text section, add the remaining content as a raw string.\n                if (extendLastString) {\n                    var piece = strings[strings.length - 1];\n                    piece.text += input.substring(i);\n                    piece.end = input.length;\n                }\n                else {\n                    strings.push({ text: input.substring(i), start: i, end: input.length });\n                }\n            }\n            return new SplitInterpolation(strings, expressions, offsets);\n        };\n        Parser.prototype.wrapLiteralPrimitive = function (input, location, absoluteOffset) {\n            var span = new ParseSpan(0, input == null ? 0 : input.length);\n            return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, location, absoluteOffset, this.errors);\n        };\n        Parser.prototype._stripComments = function (input) {\n            var i = this._commentStart(input);\n            return i != null ? input.substring(0, i).trim() : input;\n        };\n        Parser.prototype._commentStart = function (input) {\n            var outerQuote = null;\n            for (var i = 0; i < input.length - 1; i++) {\n                var char = input.charCodeAt(i);\n                var nextChar = input.charCodeAt(i + 1);\n                if (char === $SLASH && nextChar == $SLASH && outerQuote == null)\n                    return i;\n                if (outerQuote === char) {\n                    outerQuote = null;\n                }\n                else if (outerQuote == null && isQuote(char)) {\n                    outerQuote = char;\n                }\n            }\n            return null;\n        };\n        Parser.prototype._checkNoInterpolation = function (input, location, _b) {\n            var e_1, _c;\n            var start = _b.start, end = _b.end;\n            var startIndex = -1;\n            var endIndex = -1;\n            try {\n                for (var _d = __values(this._forEachUnquotedChar(input, 0)), _e = _d.next(); !_e.done; _e = _d.next()) {\n                    var charIndex = _e.value;\n                    if (startIndex === -1) {\n                        if (input.startsWith(start)) {\n                            startIndex = charIndex;\n                        }\n                    }\n                    else {\n                        endIndex = this._getInterpolationEndIndex(input, end, charIndex);\n                        if (endIndex > -1) {\n                            break;\n                        }\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_e && !_e.done && (_c = _d.return)) _c.call(_d);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            if (startIndex > -1 && endIndex > -1) {\n                this._reportError(\"Got interpolation (\" + start + end + \") where expression was expected\", input, \"at column \" + startIndex + \" in\", location);\n            }\n        };\n        /**\n         * Finds the index of the end of an interpolation expression\n         * while ignoring comments and quoted content.\n         */\n        Parser.prototype._getInterpolationEndIndex = function (input, expressionEnd, start) {\n            var e_2, _b;\n            try {\n                for (var _c = __values(this._forEachUnquotedChar(input, start)), _d = _c.next(); !_d.done; _d = _c.next()) {\n                    var charIndex = _d.value;\n                    if (input.startsWith(expressionEnd, charIndex)) {\n                        return charIndex;\n                    }\n                    // Nothing else in the expression matters after we've\n                    // hit a comment so look directly for the end token.\n                    if (input.startsWith('//', charIndex)) {\n                        return input.indexOf(expressionEnd, charIndex);\n                    }\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n            return -1;\n        };\n        /**\n         * Generator used to iterate over the character indexes of a string that are outside of quotes.\n         * @param input String to loop through.\n         * @param start Index within the string at which to start.\n         */\n        Parser.prototype._forEachUnquotedChar = function (input, start) {\n            var currentQuote, escapeCount, i, char;\n            return __generator(this, function (_b) {\n                switch (_b.label) {\n                    case 0:\n                        currentQuote = null;\n                        escapeCount = 0;\n                        i = start;\n                        _b.label = 1;\n                    case 1:\n                        if (!(i < input.length)) return [3 /*break*/, 6];\n                        char = input[i];\n                        if (!(isQuote(input.charCodeAt(i)) && (currentQuote === null || currentQuote === char) &&\n                            escapeCount % 2 === 0)) return [3 /*break*/, 2];\n                        currentQuote = currentQuote === null ? char : null;\n                        return [3 /*break*/, 4];\n                    case 2:\n                        if (!(currentQuote === null)) return [3 /*break*/, 4];\n                        return [4 /*yield*/, i];\n                    case 3:\n                        _b.sent();\n                        _b.label = 4;\n                    case 4:\n                        escapeCount = char === '\\\\' ? escapeCount + 1 : 0;\n                        _b.label = 5;\n                    case 5:\n                        i++;\n                        return [3 /*break*/, 1];\n                    case 6: return [2 /*return*/];\n                }\n            });\n        };\n        return Parser;\n    }());\n    var IvyParser = /** @class */ (function (_super) {\n        __extends(IvyParser, _super);\n        function IvyParser() {\n            var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n            _this.simpleExpressionChecker = IvySimpleExpressionChecker;\n            return _this;\n        }\n        return IvyParser;\n    }(Parser$1));\n    /** Describes a stateful context an expression parser is in. */\n    var ParseContextFlags;\n    (function (ParseContextFlags) {\n        ParseContextFlags[ParseContextFlags[\"None\"] = 0] = \"None\";\n        /**\n         * A Writable context is one in which a value may be written to an lvalue.\n         * For example, after we see a property access, we may expect a write to the\n         * property via the \"=\" operator.\n         *   prop\n         *        ^ possible \"=\" after\n         */\n        ParseContextFlags[ParseContextFlags[\"Writable\"] = 1] = \"Writable\";\n    })(ParseContextFlags || (ParseContextFlags = {}));\n    var _ParseAST = /** @class */ (function () {\n        function _ParseAST(input, location, absoluteOffset, tokens, inputLength, parseAction, errors, offset) {\n            this.input = input;\n            this.location = location;\n            this.absoluteOffset = absoluteOffset;\n            this.tokens = tokens;\n            this.inputLength = inputLength;\n            this.parseAction = parseAction;\n            this.errors = errors;\n            this.offset = offset;\n            this.rparensExpected = 0;\n            this.rbracketsExpected = 0;\n            this.rbracesExpected = 0;\n            this.context = ParseContextFlags.None;\n            // Cache of expression start and input indeces to the absolute source span they map to, used to\n            // prevent creating superfluous source spans in `sourceSpan`.\n            // A serial of the expression start and input index is used for mapping because both are stateful\n            // and may change for subsequent expressions visited by the parser.\n            this.sourceSpanCache = new Map();\n            this.index = 0;\n        }\n        _ParseAST.prototype.peek = function (offset) {\n            var i = this.index + offset;\n            return i < this.tokens.length ? this.tokens[i] : EOF;\n        };\n        Object.defineProperty(_ParseAST.prototype, \"next\", {\n            get: function () {\n                return this.peek(0);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(_ParseAST.prototype, \"atEOF\", {\n            /** Whether all the parser input has been processed. */\n            get: function () {\n                return this.index >= this.tokens.length;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(_ParseAST.prototype, \"inputIndex\", {\n            /**\n             * Index of the next token to be processed, or the end of the last token if all have been\n             * processed.\n             */\n            get: function () {\n                return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(_ParseAST.prototype, \"currentEndIndex\", {\n            /**\n             * End index of the last processed token, or the start of the first token if none have been\n             * processed.\n             */\n            get: function () {\n                if (this.index > 0) {\n                    var curToken = this.peek(-1);\n                    return curToken.end + this.offset;\n                }\n                // No tokens have been processed yet; return the next token's start or the length of the input\n                // if there is no token.\n                if (this.tokens.length === 0) {\n                    return this.inputLength + this.offset;\n                }\n                return this.next.index + this.offset;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(_ParseAST.prototype, \"currentAbsoluteOffset\", {\n            /**\n             * Returns the absolute offset of the start of the current token.\n             */\n            get: function () {\n                return this.absoluteOffset + this.inputIndex;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Retrieve a `ParseSpan` from `start` to the current position (or to `artificialEndIndex` if\n         * provided).\n         *\n         * @param start Position from which the `ParseSpan` will start.\n         * @param artificialEndIndex Optional ending index to be used if provided (and if greater than the\n         *     natural ending index)\n         */\n        _ParseAST.prototype.span = function (start, artificialEndIndex) {\n            var endIndex = this.currentEndIndex;\n            if (artificialEndIndex !== undefined && artificialEndIndex > this.currentEndIndex) {\n                endIndex = artificialEndIndex;\n            }\n            // In some unusual parsing scenarios (like when certain tokens are missing and an `EmptyExpr` is\n            // being created), the current token may already be advanced beyond the `currentEndIndex`. This\n            // appears to be a deep-seated parser bug.\n            //\n            // As a workaround for now, swap the start and end indices to ensure a valid `ParseSpan`.\n            // TODO(alxhub): fix the bug upstream in the parser state, and remove this workaround.\n            if (start > endIndex) {\n                var tmp = endIndex;\n                endIndex = start;\n                start = tmp;\n            }\n            return new ParseSpan(start, endIndex);\n        };\n        _ParseAST.prototype.sourceSpan = function (start, artificialEndIndex) {\n            var serial = start + \"@\" + this.inputIndex + \":\" + artificialEndIndex;\n            if (!this.sourceSpanCache.has(serial)) {\n                this.sourceSpanCache.set(serial, this.span(start, artificialEndIndex).toAbsolute(this.absoluteOffset));\n            }\n            return this.sourceSpanCache.get(serial);\n        };\n        _ParseAST.prototype.advance = function () {\n            this.index++;\n        };\n        /**\n         * Executes a callback in the provided context.\n         */\n        _ParseAST.prototype.withContext = function (context, cb) {\n            this.context |= context;\n            var ret = cb();\n            this.context ^= context;\n            return ret;\n        };\n        _ParseAST.prototype.consumeOptionalCharacter = function (code) {\n            if (this.next.isCharacter(code)) {\n                this.advance();\n                return true;\n            }\n            else {\n                return false;\n            }\n        };\n        _ParseAST.prototype.peekKeywordLet = function () {\n            return this.next.isKeywordLet();\n        };\n        _ParseAST.prototype.peekKeywordAs = function () {\n            return this.next.isKeywordAs();\n        };\n        /**\n         * Consumes an expected character, otherwise emits an error about the missing expected character\n         * and skips over the token stream until reaching a recoverable point.\n         *\n         * See `this.error` and `this.skip` for more details.\n         */\n        _ParseAST.prototype.expectCharacter = function (code) {\n            if (this.consumeOptionalCharacter(code))\n                return;\n            this.error(\"Missing expected \" + String.fromCharCode(code));\n        };\n        _ParseAST.prototype.consumeOptionalOperator = function (op) {\n            if (this.next.isOperator(op)) {\n                this.advance();\n                return true;\n            }\n            else {\n                return false;\n            }\n        };\n        _ParseAST.prototype.expectOperator = function (operator) {\n            if (this.consumeOptionalOperator(operator))\n                return;\n            this.error(\"Missing expected operator \" + operator);\n        };\n        _ParseAST.prototype.prettyPrintToken = function (tok) {\n            return tok === EOF ? 'end of input' : \"token \" + tok;\n        };\n        _ParseAST.prototype.expectIdentifierOrKeyword = function () {\n            var n = this.next;\n            if (!n.isIdentifier() && !n.isKeyword()) {\n                if (n.isPrivateIdentifier()) {\n                    this._reportErrorForPrivateIdentifier(n, 'expected identifier or keyword');\n                }\n                else {\n                    this.error(\"Unexpected \" + this.prettyPrintToken(n) + \", expected identifier or keyword\");\n                }\n                return null;\n            }\n            this.advance();\n            return n.toString();\n        };\n        _ParseAST.prototype.expectIdentifierOrKeywordOrString = function () {\n            var n = this.next;\n            if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {\n                if (n.isPrivateIdentifier()) {\n                    this._reportErrorForPrivateIdentifier(n, 'expected identifier, keyword or string');\n                }\n                else {\n                    this.error(\"Unexpected \" + this.prettyPrintToken(n) + \", expected identifier, keyword, or string\");\n                }\n                return '';\n            }\n            this.advance();\n            return n.toString();\n        };\n        _ParseAST.prototype.parseChain = function () {\n            var exprs = [];\n            var start = this.inputIndex;\n            while (this.index < this.tokens.length) {\n                var expr = this.parsePipe();\n                exprs.push(expr);\n                if (this.consumeOptionalCharacter($SEMICOLON)) {\n                    if (!this.parseAction) {\n                        this.error('Binding expression cannot contain chained expression');\n                    }\n                    while (this.consumeOptionalCharacter($SEMICOLON)) {\n                    } // read all semicolons\n                }\n                else if (this.index < this.tokens.length) {\n                    this.error(\"Unexpected token '\" + this.next + \"'\");\n                }\n            }\n            if (exprs.length == 0) {\n                // We have no expressions so create an empty expression that spans the entire input length\n                var artificialStart = this.offset;\n                var artificialEnd = this.offset + this.inputLength;\n                return new EmptyExpr(this.span(artificialStart, artificialEnd), this.sourceSpan(artificialStart, artificialEnd));\n            }\n            if (exprs.length == 1)\n                return exprs[0];\n            return new Chain(this.span(start), this.sourceSpan(start), exprs);\n        };\n        _ParseAST.prototype.parsePipe = function () {\n            var start = this.inputIndex;\n            var result = this.parseExpression();\n            if (this.consumeOptionalOperator('|')) {\n                if (this.parseAction) {\n                    this.error('Cannot have a pipe in an action expression');\n                }\n                do {\n                    var nameStart = this.inputIndex;\n                    var nameId = this.expectIdentifierOrKeyword();\n                    var nameSpan = void 0;\n                    var fullSpanEnd = undefined;\n                    if (nameId !== null) {\n                        nameSpan = this.sourceSpan(nameStart);\n                    }\n                    else {\n                        // No valid identifier was found, so we'll assume an empty pipe name ('').\n                        nameId = '';\n                        // However, there may have been whitespace present between the pipe character and the next\n                        // token in the sequence (or the end of input). We want to track this whitespace so that\n                        // the `BindingPipe` we produce covers not just the pipe character, but any trailing\n                        // whitespace beyond it. Another way of thinking about this is that the zero-length name\n                        // is assumed to be at the end of any whitespace beyond the pipe character.\n                        //\n                        // Therefore, we push the end of the `ParseSpan` for this pipe all the way up to the\n                        // beginning of the next token, or until the end of input if the next token is EOF.\n                        fullSpanEnd = this.next.index !== -1 ? this.next.index : this.inputLength + this.offset;\n                        // The `nameSpan` for an empty pipe name is zero-length at the end of any whitespace\n                        // beyond the pipe character.\n                        nameSpan = new ParseSpan(fullSpanEnd, fullSpanEnd).toAbsolute(this.absoluteOffset);\n                    }\n                    var args = [];\n                    while (this.consumeOptionalCharacter($COLON)) {\n                        args.push(this.parseExpression());\n                        // If there are additional expressions beyond the name, then the artificial end for the\n                        // name is no longer relevant.\n                    }\n                    result = new BindingPipe(this.span(start), this.sourceSpan(start, fullSpanEnd), result, nameId, args, nameSpan);\n                } while (this.consumeOptionalOperator('|'));\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseExpression = function () {\n            return this.parseConditional();\n        };\n        _ParseAST.prototype.parseConditional = function () {\n            var start = this.inputIndex;\n            var result = this.parseLogicalOr();\n            if (this.consumeOptionalOperator('?')) {\n                var yes = this.parsePipe();\n                var no = void 0;\n                if (!this.consumeOptionalCharacter($COLON)) {\n                    var end = this.inputIndex;\n                    var expression = this.input.substring(start, end);\n                    this.error(\"Conditional expression \" + expression + \" requires all 3 expressions\");\n                    no = new EmptyExpr(this.span(start), this.sourceSpan(start));\n                }\n                else {\n                    no = this.parsePipe();\n                }\n                return new Conditional(this.span(start), this.sourceSpan(start), result, yes, no);\n            }\n            else {\n                return result;\n            }\n        };\n        _ParseAST.prototype.parseLogicalOr = function () {\n            // '||'\n            var start = this.inputIndex;\n            var result = this.parseLogicalAnd();\n            while (this.consumeOptionalOperator('||')) {\n                var right = this.parseLogicalAnd();\n                result = new Binary(this.span(start), this.sourceSpan(start), '||', result, right);\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseLogicalAnd = function () {\n            // '&&'\n            var start = this.inputIndex;\n            var result = this.parseNullishCoalescing();\n            while (this.consumeOptionalOperator('&&')) {\n                var right = this.parseNullishCoalescing();\n                result = new Binary(this.span(start), this.sourceSpan(start), '&&', result, right);\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseNullishCoalescing = function () {\n            // '??'\n            var start = this.inputIndex;\n            var result = this.parseEquality();\n            while (this.consumeOptionalOperator('??')) {\n                var right = this.parseEquality();\n                result = new Binary(this.span(start), this.sourceSpan(start), '??', result, right);\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseEquality = function () {\n            // '==','!=','===','!=='\n            var start = this.inputIndex;\n            var result = this.parseRelational();\n            while (this.next.type == exports.TokenType.Operator) {\n                var operator = this.next.strValue;\n                switch (operator) {\n                    case '==':\n                    case '===':\n                    case '!=':\n                    case '!==':\n                        this.advance();\n                        var right = this.parseRelational();\n                        result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n                        continue;\n                }\n                break;\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseRelational = function () {\n            // '<', '>', '<=', '>='\n            var start = this.inputIndex;\n            var result = this.parseAdditive();\n            while (this.next.type == exports.TokenType.Operator) {\n                var operator = this.next.strValue;\n                switch (operator) {\n                    case '<':\n                    case '>':\n                    case '<=':\n                    case '>=':\n                        this.advance();\n                        var right = this.parseAdditive();\n                        result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n                        continue;\n                }\n                break;\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseAdditive = function () {\n            // '+', '-'\n            var start = this.inputIndex;\n            var result = this.parseMultiplicative();\n            while (this.next.type == exports.TokenType.Operator) {\n                var operator = this.next.strValue;\n                switch (operator) {\n                    case '+':\n                    case '-':\n                        this.advance();\n                        var right = this.parseMultiplicative();\n                        result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n                        continue;\n                }\n                break;\n            }\n            return result;\n        };\n        _ParseAST.prototype.parseMultiplicative = function () {\n            // '*', '%', '/'\n            var start = this.inputIndex;\n            var result = this.parsePrefix();\n            while (this.next.type == exports.TokenType.Operator) {\n                var operator = this.next.strValue;\n                switch (operator) {\n                    case '*':\n                    case '%':\n                    case '/':\n                        this.advance();\n                        var right = this.parsePrefix();\n                        result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n                        continue;\n                }\n                break;\n            }\n            return result;\n        };\n        _ParseAST.prototype.parsePrefix = function () {\n            if (this.next.type == exports.TokenType.Operator) {\n                var start = this.inputIndex;\n                var operator = this.next.strValue;\n                var result = void 0;\n                switch (operator) {\n                    case '+':\n                        this.advance();\n                        result = this.parsePrefix();\n                        return Unary.createPlus(this.span(start), this.sourceSpan(start), result);\n                    case '-':\n                        this.advance();\n                        result = this.parsePrefix();\n                        return Unary.createMinus(this.span(start), this.sourceSpan(start), result);\n                    case '!':\n                        this.advance();\n                        result = this.parsePrefix();\n                        return new PrefixNot(this.span(start), this.sourceSpan(start), result);\n                }\n            }\n            return this.parseCallChain();\n        };\n        _ParseAST.prototype.parseCallChain = function () {\n            var start = this.inputIndex;\n            var result = this.parsePrimary();\n            while (true) {\n                if (this.consumeOptionalCharacter($PERIOD)) {\n                    result = this.parseAccessMemberOrMethodCall(result, start, false);\n                }\n                else if (this.consumeOptionalOperator('?.')) {\n                    result = this.consumeOptionalCharacter($LBRACKET) ?\n                        this.parseKeyedReadOrWrite(result, start, true) :\n                        this.parseAccessMemberOrMethodCall(result, start, true);\n                }\n                else if (this.consumeOptionalCharacter($LBRACKET)) {\n                    result = this.parseKeyedReadOrWrite(result, start, false);\n                }\n                else if (this.consumeOptionalCharacter($LPAREN)) {\n                    this.rparensExpected++;\n                    var args = this.parseCallArguments();\n                    this.rparensExpected--;\n                    this.expectCharacter($RPAREN);\n                    result = new FunctionCall(this.span(start), this.sourceSpan(start), result, args);\n                }\n                else if (this.consumeOptionalOperator('!')) {\n                    result = new NonNullAssert(this.span(start), this.sourceSpan(start), result);\n                }\n                else {\n                    return result;\n                }\n            }\n        };\n        _ParseAST.prototype.parsePrimary = function () {\n            var start = this.inputIndex;\n            if (this.consumeOptionalCharacter($LPAREN)) {\n                this.rparensExpected++;\n                var result = this.parsePipe();\n                this.rparensExpected--;\n                this.expectCharacter($RPAREN);\n                return result;\n            }\n            else if (this.next.isKeywordNull()) {\n                this.advance();\n                return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);\n            }\n            else if (this.next.isKeywordUndefined()) {\n                this.advance();\n                return new LiteralPrimitive(this.span(start), this.sourceSpan(start), void 0);\n            }\n            else if (this.next.isKeywordTrue()) {\n                this.advance();\n                return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true);\n            }\n            else if (this.next.isKeywordFalse()) {\n                this.advance();\n                return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false);\n            }\n            else if (this.next.isKeywordThis()) {\n                this.advance();\n                return new ThisReceiver(this.span(start), this.sourceSpan(start));\n            }\n            else if (this.consumeOptionalCharacter($LBRACKET)) {\n                this.rbracketsExpected++;\n                var elements = this.parseExpressionList($RBRACKET);\n                this.rbracketsExpected--;\n                this.expectCharacter($RBRACKET);\n                return new LiteralArray(this.span(start), this.sourceSpan(start), elements);\n            }\n            else if (this.next.isCharacter($LBRACE)) {\n                return this.parseLiteralMap();\n            }\n            else if (this.next.isIdentifier()) {\n                return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start), this.sourceSpan(start)), start, false);\n            }\n            else if (this.next.isNumber()) {\n                var value = this.next.toNumber();\n                this.advance();\n                return new LiteralPrimitive(this.span(start), this.sourceSpan(start), value);\n            }\n            else if (this.next.isString()) {\n                var literalValue = this.next.toString();\n                this.advance();\n                return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);\n            }\n            else if (this.next.isPrivateIdentifier()) {\n                this._reportErrorForPrivateIdentifier(this.next, null);\n                return new EmptyExpr(this.span(start), this.sourceSpan(start));\n            }\n            else if (this.index >= this.tokens.length) {\n                this.error(\"Unexpected end of expression: \" + this.input);\n                return new EmptyExpr(this.span(start), this.sourceSpan(start));\n            }\n            else {\n                this.error(\"Unexpected token \" + this.next);\n                return new EmptyExpr(this.span(start), this.sourceSpan(start));\n            }\n        };\n        _ParseAST.prototype.parseExpressionList = function (terminator) {\n            var result = [];\n            do {\n                if (!this.next.isCharacter(terminator)) {\n                    result.push(this.parsePipe());\n                }\n                else {\n                    break;\n                }\n            } while (this.consumeOptionalCharacter($COMMA));\n            return result;\n        };\n        _ParseAST.prototype.parseLiteralMap = function () {\n            var keys = [];\n            var values = [];\n            var start = this.inputIndex;\n            this.expectCharacter($LBRACE);\n            if (!this.consumeOptionalCharacter($RBRACE)) {\n                this.rbracesExpected++;\n                do {\n                    var keyStart = this.inputIndex;\n                    var quoted = this.next.isString();\n                    var key = this.expectIdentifierOrKeywordOrString();\n                    keys.push({ key: key, quoted: quoted });\n                    // Properties with quoted keys can't use the shorthand syntax.\n                    if (quoted) {\n                        this.expectCharacter($COLON);\n                        values.push(this.parsePipe());\n                    }\n                    else if (this.consumeOptionalCharacter($COLON)) {\n                        values.push(this.parsePipe());\n                    }\n                    else {\n                        var span = this.span(keyStart);\n                        var sourceSpan = this.sourceSpan(keyStart);\n                        values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));\n                    }\n                } while (this.consumeOptionalCharacter($COMMA));\n                this.rbracesExpected--;\n                this.expectCharacter($RBRACE);\n            }\n            return new LiteralMap(this.span(start), this.sourceSpan(start), keys, values);\n        };\n        _ParseAST.prototype.parseAccessMemberOrMethodCall = function (receiver, start, isSafe) {\n            var _this = this;\n            var nameStart = this.inputIndex;\n            var id = this.withContext(ParseContextFlags.Writable, function () {\n                var _a;\n                var id = (_a = _this.expectIdentifierOrKeyword()) !== null && _a !== void 0 ? _a : '';\n                if (id.length === 0) {\n                    _this.error(\"Expected identifier for property access\", receiver.span.end);\n                }\n                return id;\n            });\n            var nameSpan = this.sourceSpan(nameStart);\n            if (this.consumeOptionalCharacter($LPAREN)) {\n                var argumentStart = this.inputIndex;\n                this.rparensExpected++;\n                var args = this.parseCallArguments();\n                var argumentSpan = this.span(argumentStart, this.inputIndex).toAbsolute(this.absoluteOffset);\n                this.expectCharacter($RPAREN);\n                this.rparensExpected--;\n                var span = this.span(start);\n                var sourceSpan = this.sourceSpan(start);\n                return isSafe ?\n                    new SafeMethodCall(span, sourceSpan, nameSpan, receiver, id, args, argumentSpan) :\n                    new MethodCall(span, sourceSpan, nameSpan, receiver, id, args, argumentSpan);\n            }\n            else {\n                if (isSafe) {\n                    if (this.consumeOptionalOperator('=')) {\n                        this.error('The \\'?.\\' operator cannot be used in the assignment');\n                        return new EmptyExpr(this.span(start), this.sourceSpan(start));\n                    }\n                    else {\n                        return new SafePropertyRead(this.span(start), this.sourceSpan(start), nameSpan, receiver, id);\n                    }\n                }\n                else {\n                    if (this.consumeOptionalOperator('=')) {\n                        if (!this.parseAction) {\n                            this.error('Bindings cannot contain assignments');\n                            return new EmptyExpr(this.span(start), this.sourceSpan(start));\n                        }\n                        var value = this.parseConditional();\n                        return new PropertyWrite(this.span(start), this.sourceSpan(start), nameSpan, receiver, id, value);\n                    }\n                    else {\n                        return new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, receiver, id);\n                    }\n                }\n            }\n        };\n        _ParseAST.prototype.parseCallArguments = function () {\n            if (this.next.isCharacter($RPAREN))\n                return [];\n            var positionals = [];\n            do {\n                positionals.push(this.parsePipe());\n            } while (this.consumeOptionalCharacter($COMMA));\n            return positionals;\n        };\n        /**\n         * Parses an identifier, a keyword, a string with an optional `-` in between,\n         * and returns the string along with its absolute source span.\n         */\n        _ParseAST.prototype.expectTemplateBindingKey = function () {\n            var result = '';\n            var operatorFound = false;\n            var start = this.currentAbsoluteOffset;\n            do {\n                result += this.expectIdentifierOrKeywordOrString();\n                operatorFound = this.consumeOptionalOperator('-');\n                if (operatorFound) {\n                    result += '-';\n                }\n            } while (operatorFound);\n            return {\n                source: result,\n                span: new AbsoluteSourceSpan(start, start + result.length),\n            };\n        };\n        /**\n         * Parse microsyntax template expression and return a list of bindings or\n         * parsing errors in case the given expression is invalid.\n         *\n         * For example,\n         * ```\n         *   <div *ngFor=\"let item of items; index as i; trackBy: func\">\n         * ```\n         * contains five bindings:\n         * 1. ngFor -> null\n         * 2. item -> NgForOfContext.$implicit\n         * 3. ngForOf -> items\n         * 4. i -> NgForOfContext.index\n         * 5. ngForTrackBy -> func\n         *\n         * For a full description of the microsyntax grammar, see\n         * https://gist.github.com/mhevery/d3530294cff2e4a1b3fe15ff75d08855\n         *\n         * @param templateKey name of the microsyntax directive, like ngIf, ngFor,\n         * without the *, along with its absolute span.\n         */\n        _ParseAST.prototype.parseTemplateBindings = function (templateKey) {\n            var bindings = [];\n            // The first binding is for the template key itself\n            // In *ngFor=\"let item of items\", key = \"ngFor\", value = null\n            // In *ngIf=\"cond | pipe\", key = \"ngIf\", value = \"cond | pipe\"\n            bindings.push.apply(bindings, __spreadArray([], __read(this.parseDirectiveKeywordBindings(templateKey))));\n            while (this.index < this.tokens.length) {\n                // If it starts with 'let', then this must be variable declaration\n                var letBinding = this.parseLetBinding();\n                if (letBinding) {\n                    bindings.push(letBinding);\n                }\n                else {\n                    // Two possible cases here, either `value \"as\" key` or\n                    // \"directive-keyword expression\". We don't know which case, but both\n                    // \"value\" and \"directive-keyword\" are template binding key, so consume\n                    // the key first.\n                    var key = this.expectTemplateBindingKey();\n                    // Peek at the next token, if it is \"as\" then this must be variable\n                    // declaration.\n                    var binding = this.parseAsBinding(key);\n                    if (binding) {\n                        bindings.push(binding);\n                    }\n                    else {\n                        // Otherwise the key must be a directive keyword, like \"of\". Transform\n                        // the key to actual key. Eg. of -> ngForOf, trackBy -> ngForTrackBy\n                        key.source =\n                            templateKey.source + key.source.charAt(0).toUpperCase() + key.source.substring(1);\n                        bindings.push.apply(bindings, __spreadArray([], __read(this.parseDirectiveKeywordBindings(key))));\n                    }\n                }\n                this.consumeStatementTerminator();\n            }\n            return new TemplateBindingParseResult(bindings, [] /* warnings */, this.errors);\n        };\n        _ParseAST.prototype.parseKeyedReadOrWrite = function (receiver, start, isSafe) {\n            var _this = this;\n            return this.withContext(ParseContextFlags.Writable, function () {\n                _this.rbracketsExpected++;\n                var key = _this.parsePipe();\n                if (key instanceof EmptyExpr) {\n                    _this.error(\"Key access cannot be empty\");\n                }\n                _this.rbracketsExpected--;\n                _this.expectCharacter($RBRACKET);\n                if (_this.consumeOptionalOperator('=')) {\n                    if (isSafe) {\n                        _this.error('The \\'?.\\' operator cannot be used in the assignment');\n                    }\n                    else {\n                        var value = _this.parseConditional();\n                        return new KeyedWrite(_this.span(start), _this.sourceSpan(start), receiver, key, value);\n                    }\n                }\n                else {\n                    return isSafe ? new SafeKeyedRead(_this.span(start), _this.sourceSpan(start), receiver, key) :\n                        new KeyedRead(_this.span(start), _this.sourceSpan(start), receiver, key);\n                }\n                return new EmptyExpr(_this.span(start), _this.sourceSpan(start));\n            });\n        };\n        /**\n         * Parse a directive keyword, followed by a mandatory expression.\n         * For example, \"of items\", \"trackBy: func\".\n         * The bindings are: ngForOf -> items, ngForTrackBy -> func\n         * There could be an optional \"as\" binding that follows the expression.\n         * For example,\n         * ```\n         *   *ngFor=\"let item of items | slice:0:1 as collection\".\n         *                    ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^\n         *               keyword    bound target   optional 'as' binding\n         * ```\n         *\n         * @param key binding key, for example, ngFor, ngIf, ngForOf, along with its\n         * absolute span.\n         */\n        _ParseAST.prototype.parseDirectiveKeywordBindings = function (key) {\n            var bindings = [];\n            this.consumeOptionalCharacter($COLON); // trackBy: trackByFunction\n            var value = this.getDirectiveBoundTarget();\n            var spanEnd = this.currentAbsoluteOffset;\n            // The binding could optionally be followed by \"as\". For example,\n            // *ngIf=\"cond | pipe as x\". In this case, the key in the \"as\" binding\n            // is \"x\" and the value is the template key itself (\"ngIf\"). Note that the\n            // 'key' in the current context now becomes the \"value\" in the next binding.\n            var asBinding = this.parseAsBinding(key);\n            if (!asBinding) {\n                this.consumeStatementTerminator();\n                spanEnd = this.currentAbsoluteOffset;\n            }\n            var sourceSpan = new AbsoluteSourceSpan(key.span.start, spanEnd);\n            bindings.push(new ExpressionBinding(sourceSpan, key, value));\n            if (asBinding) {\n                bindings.push(asBinding);\n            }\n            return bindings;\n        };\n        /**\n         * Return the expression AST for the bound target of a directive keyword\n         * binding. For example,\n         * ```\n         *   *ngIf=\"condition | pipe\"\n         *          ^^^^^^^^^^^^^^^^ bound target for \"ngIf\"\n         *   *ngFor=\"let item of items\"\n         *                       ^^^^^ bound target for \"ngForOf\"\n         * ```\n         */\n        _ParseAST.prototype.getDirectiveBoundTarget = function () {\n            if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n                return null;\n            }\n            var ast = this.parsePipe(); // example: \"condition | async\"\n            var _b = ast.span, start = _b.start, end = _b.end;\n            var value = this.input.substring(start, end);\n            return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n        };\n        /**\n         * Return the binding for a variable declared using `as`. Note that the order\n         * of the key-value pair in this declaration is reversed. For example,\n         * ```\n         *   *ngFor=\"let item of items; index as i\"\n         *                              ^^^^^    ^\n         *                              value    key\n         * ```\n         *\n         * @param value name of the value in the declaration, \"ngIf\" in the example\n         * above, along with its absolute span.\n         */\n        _ParseAST.prototype.parseAsBinding = function (value) {\n            if (!this.peekKeywordAs()) {\n                return null;\n            }\n            this.advance(); // consume the 'as' keyword\n            var key = this.expectTemplateBindingKey();\n            this.consumeStatementTerminator();\n            var sourceSpan = new AbsoluteSourceSpan(value.span.start, this.currentAbsoluteOffset);\n            return new VariableBinding(sourceSpan, key, value);\n        };\n        /**\n         * Return the binding for a variable declared using `let`. For example,\n         * ```\n         *   *ngFor=\"let item of items; let i=index;\"\n         *           ^^^^^^^^           ^^^^^^^^^^^\n         * ```\n         * In the first binding, `item` is bound to `NgForOfContext.$implicit`.\n         * In the second binding, `i` is bound to `NgForOfContext.index`.\n         */\n        _ParseAST.prototype.parseLetBinding = function () {\n            if (!this.peekKeywordLet()) {\n                return null;\n            }\n            var spanStart = this.currentAbsoluteOffset;\n            this.advance(); // consume the 'let' keyword\n            var key = this.expectTemplateBindingKey();\n            var value = null;\n            if (this.consumeOptionalOperator('=')) {\n                value = this.expectTemplateBindingKey();\n            }\n            this.consumeStatementTerminator();\n            var sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset);\n            return new VariableBinding(sourceSpan, key, value);\n        };\n        /**\n         * Consume the optional statement terminator: semicolon or comma.\n         */\n        _ParseAST.prototype.consumeStatementTerminator = function () {\n            this.consumeOptionalCharacter($SEMICOLON) || this.consumeOptionalCharacter($COMMA);\n        };\n        /**\n         * Records an error and skips over the token stream until reaching a recoverable point. See\n         * `this.skip` for more details on token skipping.\n         */\n        _ParseAST.prototype.error = function (message, index) {\n            if (index === void 0) { index = null; }\n            this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));\n            this.skip();\n        };\n        _ParseAST.prototype.locationText = function (index) {\n            if (index === void 0) { index = null; }\n            if (index == null)\n                index = this.index;\n            return (index < this.tokens.length) ? \"at column \" + (this.tokens[index].index + 1) + \" in\" :\n                \"at the end of the expression\";\n        };\n        /**\n         * Records an error for an unexpected private identifier being discovered.\n         * @param token Token representing a private identifier.\n         * @param extraMessage Optional additional message being appended to the error.\n         */\n        _ParseAST.prototype._reportErrorForPrivateIdentifier = function (token, extraMessage) {\n            var errorMessage = \"Private identifiers are not supported. Unexpected private identifier: \" + token;\n            if (extraMessage !== null) {\n                errorMessage += \", \" + extraMessage;\n            }\n            this.error(errorMessage);\n        };\n        /**\n         * Error recovery should skip tokens until it encounters a recovery point.\n         *\n         * The following are treated as unconditional recovery points:\n         *   - end of input\n         *   - ';' (parseChain() is always the root production, and it expects a ';')\n         *   - '|' (since pipes may be chained and each pipe expression may be treated independently)\n         *\n         * The following are conditional recovery points:\n         *   - ')', '}', ']' if one of calling productions is expecting one of these symbols\n         *     - This allows skip() to recover from errors such as '(a.) + 1' allowing more of the AST to\n         *       be retained (it doesn't skip any tokens as the ')' is retained because of the '(' begins\n         *       an '(' <expr> ')' production).\n         *       The recovery points of grouping symbols must be conditional as they must be skipped if\n         *       none of the calling productions are not expecting the closing token else we will never\n         *       make progress in the case of an extraneous group closing symbol (such as a stray ')').\n         *       That is, we skip a closing symbol if we are not in a grouping production.\n         *   - '=' in a `Writable` context\n         *     - In this context, we are able to recover after seeing the `=` operator, which\n         *       signals the presence of an independent rvalue expression following the `=` operator.\n         *\n         * If a production expects one of these token it increments the corresponding nesting count,\n         * and then decrements it just prior to checking if the token is in the input.\n         */\n        _ParseAST.prototype.skip = function () {\n            var n = this.next;\n            while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) &&\n                !n.isOperator('|') && (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&\n                (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&\n                (this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET)) &&\n                (!(this.context & ParseContextFlags.Writable) || !n.isOperator('='))) {\n                if (this.next.isError()) {\n                    this.errors.push(new ParserError(this.next.toString(), this.input, this.locationText(), this.location));\n                }\n                this.advance();\n                n = this.next;\n            }\n        };\n        return _ParseAST;\n    }());\n    var SimpleExpressionChecker = /** @class */ (function () {\n        function SimpleExpressionChecker() {\n            this.errors = [];\n        }\n        SimpleExpressionChecker.prototype.visitImplicitReceiver = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitThisReceiver = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitInterpolation = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitLiteralPrimitive = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitPropertyRead = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitPropertyWrite = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitSafePropertyRead = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitMethodCall = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitSafeMethodCall = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitFunctionCall = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitLiteralArray = function (ast, context) {\n            this.visitAll(ast.expressions, context);\n        };\n        SimpleExpressionChecker.prototype.visitLiteralMap = function (ast, context) {\n            this.visitAll(ast.values, context);\n        };\n        SimpleExpressionChecker.prototype.visitUnary = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitBinary = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitPrefixNot = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitNonNullAssert = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitConditional = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitPipe = function (ast, context) {\n            this.errors.push('pipes');\n        };\n        SimpleExpressionChecker.prototype.visitKeyedRead = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitKeyedWrite = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitAll = function (asts, context) {\n            var _this = this;\n            return asts.map(function (node) { return node.visit(_this, context); });\n        };\n        SimpleExpressionChecker.prototype.visitChain = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitQuote = function (ast, context) { };\n        SimpleExpressionChecker.prototype.visitSafeKeyedRead = function (ast, context) { };\n        return SimpleExpressionChecker;\n    }());\n    /**\n     * This class implements SimpleExpressionChecker used in View Engine and performs more strict checks\n     * to make sure host bindings do not contain pipes. In View Engine, having pipes in host bindings is\n     * not supported as well, but in some cases (like `!(value | async)`) the error is not triggered at\n     * compile time. In order to preserve View Engine behavior, more strict checks are introduced for\n     * Ivy mode only.\n     */\n    var IvySimpleExpressionChecker = /** @class */ (function (_super) {\n        __extends(IvySimpleExpressionChecker, _super);\n        function IvySimpleExpressionChecker() {\n            var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n            _this.errors = [];\n            return _this;\n        }\n        IvySimpleExpressionChecker.prototype.visitPipe = function () {\n            this.errors.push('pipes');\n        };\n        return IvySimpleExpressionChecker;\n    }(RecursiveAstVisitor$1));\n\n    /**\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://angular.io/license\n     */\n    function mapEntry(key, value) {\n        return { key: key, value: value, quoted: false };\n    }\n    function mapLiteral(obj, quoted) {\n        if (quoted === void 0) { quoted = false; }\n        return literalMap(Object.keys(obj).map(function (key) { return ({\n            key: key,\n            quoted: quoted,\n            value: obj[key],\n        }); }));\n    }\n\n    // =================================================================================================\n    // =================================================================================================\n    // =========== S T O P   -  S T O P   -  S T O P   -  S T O P   -  S T O P   -  S T O P  ===========\n    // =================================================================================================\n    // =================================================================================================\n    //\n    //        DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!\n    //                               Reach out to mprobst for details.\n    //\n    // =================================================================================================\n    /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */\n    var _SECURITY_SCHEMA;\n    function SECURITY_SCHEMA() {\n        if (!_SECURITY_SCHEMA) {\n            _SECURITY_SCHEMA = {};\n            // Case is insignificant below, all element and attribute names are lower-cased for lookup.\n            registerContext(SecurityContext.HTML, [\n                'iframe|srcdoc',\n                '*|innerHTML',\n                '*|outerHTML',\n            ]);\n            registerContext(SecurityContext.STYLE, ['*|style']);\n            // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.\n            registerContext(SecurityContext.URL, [\n                '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',\n                'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',\n                'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',\n                'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',\n            ]);\n            registerContext(SecurityContext.RESOURCE_URL, [\n                'applet|code',\n                'applet|codebase',\n                'base|href',\n                'embed|src',\n                'frame|src',\n                'head|profile',\n                'html|manifest',\n                'iframe|src',\n                'link|href',\n                'media|src',\n                'object|codebase',\n                'object|data',\n                'script|src',\n            ]);\n        }\n        return _SECURITY_SCHEMA;\n    }\n    function registerContext(ctx, specs) {\n        var e_1, _a;\n        try {\n            for (var specs_1 = __values(specs), specs_1_1 = specs_1.next(); !specs_1_1.done; specs_1_1 = specs_1.next()) {\n                var spec = specs_1_1.value;\n                _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (specs_1_1 && !specs_1_1.done && (_a = specs_1.return)) _a.call(specs_1);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var ElementSchemaRegistry = /** @class */ (function () {\n        function ElementSchemaRegistry() {\n        }\n        return ElementSchemaRegistry;\n    }());\n\n    var BOOLEAN = 'boolean';\n    var NUMBER = 'number';\n    var STRING = 'string';\n    var OBJECT = 'object';\n    /**\n     * This array represents the DOM schema. It encodes inheritance, properties, and events.\n     *\n     * ## Overview\n     *\n     * Each line represents one kind of element. The `element_inheritance` and properties are joined\n     * using `element_inheritance|properties` syntax.\n     *\n     * ## Element Inheritance\n     *\n     * The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`.\n     * Here the individual elements are separated by `,` (commas). Every element in the list\n     * has identical properties.\n     *\n     * An `element` may inherit additional properties from `parentElement` If no `^parentElement` is\n     * specified then `\"\"` (blank) element is assumed.\n     *\n     * NOTE: The blank element inherits from root `[Element]` element, the super element of all\n     * elements.\n     *\n     * NOTE an element prefix such as `:svg:` has no special meaning to the schema.\n     *\n     * ## Properties\n     *\n     * Each element has a set of properties separated by `,` (commas). Each property can be prefixed\n     * by a special character designating its type:\n     *\n     * - (no prefix): property is a string.\n     * - `*`: property represents an event.\n     * - `!`: property is a boolean.\n     * - `#`: property is a number.\n     * - `%`: property is an object.\n     *\n     * ## Query\n     *\n     * The class creates an internal squas representation which allows to easily answer the query of\n     * if a given property exist on a given element.\n     *\n     * NOTE: We don't yet support querying for types or events.\n     * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder,\n     *       see dom_element_schema_registry_spec.ts\n     */\n    // =================================================================================================\n    // =================================================================================================\n    // =========== S T O P   -  S T O P   -  S T O P   -  S T O P   -  S T O P   -  S T O P  ===========\n    // =================================================================================================\n    // =================================================================================================\n    //\n    //                       DO NOT EDIT THIS DOM SCHEMA WITHOUT A SECURITY REVIEW!\n    //\n    // Newly added properties must be security reviewed and assigned an appropriate SecurityContext in\n    // dom_security_schema.ts. Reach out to mprobst & rjamet for details.\n    //\n    // =================================================================================================\n    var SCHEMA = [\n        '[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop,slot' +\n            /* added manually to avoid breaking changes */\n            ',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',\n        '[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',\n        'abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',\n        'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,src,%srcObject,#volume',\n        ':svg:^[HTMLElement]|*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',\n        ':svg:graphics^:svg:|',\n        ':svg:animation^:svg:|*begin,*end,*repeat',\n        ':svg:geometry^:svg:|',\n        ':svg:componentTransferFunction^:svg:|',\n        ':svg:gradient^:svg:|',\n        ':svg:textContent^:svg:graphics|',\n        ':svg:textPositioning^:svg:textContent|',\n        'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username',\n        'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,search,shape,target,username',\n        'audio^media|',\n        'br^[HTMLElement]|clear',\n        'base^[HTMLElement]|href,target',\n        'body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',\n        'button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',\n        'canvas^[HTMLElement]|#height,#width',\n        'content^[HTMLElement]|select',\n        'dl^[HTMLElement]|!compact',\n        'datalist^[HTMLElement]|',\n        'details^[HTMLElement]|!open',\n        'dialog^[HTMLElement]|!open,returnValue',\n        'dir^[HTMLElement]|!compact',\n        'div^[HTMLElement]|align',\n        'embed^[HTMLElement]|align,height,name,src,type,width',\n        'fieldset^[HTMLElement]|!disabled,name',\n        'font^[HTMLElement]|color,face,size',\n        'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',\n        'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',\n        'frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',\n        'hr^[HTMLElement]|align,color,!noShade,size,width',\n        'head^[HTMLElement]|',\n        'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',\n        'html^[HTMLElement]|version',\n        'iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',\n        'img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',\n        'input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',\n        'li^[HTMLElement]|type,#value',\n        'label^[HTMLElement]|htmlFor',\n        'legend^[HTMLElement]|align',\n        'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',\n        'map^[HTMLElement]|name',\n        'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',\n        'menu^[HTMLElement]|!compact',\n        'meta^[HTMLElement]|content,httpEquiv,name,scheme',\n        'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',\n        'ins,del^[HTMLElement]|cite,dateTime',\n        'ol^[HTMLElement]|!compact,!reversed,#start,type',\n        'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',\n        'optgroup^[HTMLElement]|!disabled,label',\n        'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value',\n        'output^[HTMLElement]|defaultValue,%htmlFor,name,value',\n        'p^[HTMLElement]|align',\n        'param^[HTMLElement]|name,type,value,valueType',\n        'picture^[HTMLElement]|',\n        'pre^[HTMLElement]|#width',\n        'progress^[HTMLElement]|#max,#value',\n        'q,blockquote,cite^[HTMLElement]|',\n        'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',\n        'select^[HTMLElement]|autocomplete,!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',\n        'shadow^[HTMLElement]|',\n        'slot^[HTMLElement]|name',\n        'source^[HTMLElement]|media,sizes,src,srcset,type',\n        'span^[HTMLElement]|',\n        'style^[HTMLElement]|!disabled,media,type',\n        'caption^[HTMLElement]|align',\n        'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',\n        'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width',\n        'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',\n        'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',\n        'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',\n        'template^[HTMLElement]|',\n        'textarea^[HTMLElement]|autocapitalize,autocomplete,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',\n        'title^[HTMLElement]|text',\n        'track^[HTMLElement]|!default,kind,label,src,srclang',\n        'ul^[HTMLElement]|!compact,type',\n        'unknown^[HTMLElement]|',\n        'video^media|#height,poster,#width',\n        ':svg:a^:svg:graphics|',\n        ':svg:animate^:svg:animation|',\n        ':svg:animateMotion^:svg:animation|',\n        ':svg:animateTransform^:svg:animation|',\n        ':svg:circle^:svg:geometry|',\n        ':svg:clipPath^:svg:graphics|',\n        ':svg:defs^:svg:graphics|',\n        ':svg:desc^:svg:|',\n        ':svg:discard^:svg:|',\n        ':svg:ellipse^:svg:geometry|',\n        ':svg:feBlend^:svg:|',\n        ':svg:feColorMatrix^:svg:|',\n        ':svg:feComponentTransfer^:svg:|',\n        ':svg:feComposite^:svg:|',\n        ':svg:feConvolveMatrix^:svg:|',\n        ':svg:feDiffuseLighting^:svg:|',\n        ':svg:feDisplacementMap^:svg:|',\n        ':svg:feDistantLight^:svg:|',\n        ':svg:feDropShadow^:svg:|',\n        ':svg:feFlood^:svg:|',\n        ':svg:feFuncA^:svg:componentTransferFunction|',\n        ':svg:feFuncB^:svg:componentTransferFunction|',\n        ':svg:feFuncG^:svg:componentTransferFunction|',\n        ':svg:feFuncR^:svg:componentTransferFunction|',\n        ':svg:feGaussianBlur^:svg:|',\n        ':svg:feImage^:svg:|',\n        ':svg:feMerge^:svg:|',\n        ':svg:feMergeNode^:svg:|',\n        ':svg:feMorphology^:svg:|',\n        ':svg:feOffset^:svg:|',\n        ':svg:fePointLight^:svg:|',\n        ':svg:feSpecularLighting^:svg:|',\n        ':svg:feSpotLight^:svg:|',\n        ':svg:feTile^:svg:|',\n        ':svg:feTurbulence^:svg:|',\n        ':svg:filter^:svg:|',\n        ':svg:foreignObject^:svg:graphics|',\n        ':svg:g^:svg:graphics|',\n        ':svg:image^:svg:graphics|',\n        ':svg:line^:svg:geometry|',\n        ':svg:linearGradient^:svg:gradient|',\n        ':svg:mpath^:svg:|',\n        ':svg:marker^:svg:|',\n        ':svg:mask^:svg:|',\n        ':svg:metadata^:svg:|',\n        ':svg:path^:svg:geometry|',\n        ':svg:pattern^:svg:|',\n        ':svg:polygon^:svg:geometry|',\n        ':svg:polyline^:svg:geometry|',\n        ':svg:radialGradient^:svg:gradient|',\n        ':svg:rect^:svg:geometry|',\n        ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',\n        ':svg:script^:svg:|type',\n        ':svg:set^:svg:animation|',\n        ':svg:stop^:svg:|',\n        ':svg:style^:svg:|!disabled,media,title,type',\n        ':svg:switch^:svg:graphics|',\n        ':svg:symbol^:svg:|',\n        ':svg:tspan^:svg:textPositioning|',\n        ':svg:text^:svg:textPositioning|',\n        ':svg:textPath^:svg:textContent|',\n        ':svg:title^:svg:|',\n        ':svg:use^:svg:graphics|',\n        ':svg:view^:svg:|#zoomAndPan',\n        'data^[HTMLElement]|value',\n        'keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name',\n        'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default',\n        'summary^[HTMLElement]|',\n        'time^[HTMLElement]|dateTime',\n        ':svg:cursor^:svg:|',\n    ];\n    var _ATTR_TO_PROP = {\n        'class': 'className',\n        'for': 'htmlFor',\n        'formaction': 'formAction',\n        'innerHtml': 'innerHTML',\n        'readonly': 'readOnly',\n        'tabindex': 'tabIndex',\n    };\n    // Invert _ATTR_TO_PROP.\n    var _PROP_TO_ATTR = Object.keys(_ATTR_TO_PROP).reduce(function (inverted, attr) {\n        inverted[_ATTR_TO_PROP[attr]] = attr;\n        return inverted;\n    }, {});\n    var DomElementSchemaRegistry = /** @class */ (function (_super) {\n        __extends(DomElementSchemaRegistry, _super);\n        function DomElementSchemaRegistry() {\n            var _this = _super.call(this) || this;\n            _this._schema = {};\n            SCHEMA.forEach(function (encodedType) {\n                var type = {};\n                var _b = __read(encodedType.split('|'), 2), strType = _b[0], strProperties = _b[1];\n                var properties = strProperties.split(',');\n                var _c = __read(strType.split('^'), 2), typeNames = _c[0], superName = _c[1];\n                typeNames.split(',').forEach(function (tag) { return _this._schema[tag.toLowerCase()] = type; });\n                var superType = superName && _this._schema[superName.toLowerCase()];\n                if (superType) {\n                    Object.keys(superType).forEach(function (prop) {\n                        type[prop] = superType[prop];\n                    });\n                }\n                properties.forEach(function (property) {\n                    if (property.length > 0) {\n                        switch (property[0]) {\n                            case '*':\n                                // We don't yet support events.\n                                // If ever allowing to bind to events, GO THROUGH A SECURITY REVIEW, allowing events\n                                // will\n                                // almost certainly introduce bad XSS vulnerabilities.\n                                // type[property.substring(1)] = EVENT;\n                                break;\n                            case '!':\n                                type[property.substring(1)] = BOOLEAN;\n                                break;\n                            case '#':\n                                type[property.substring(1)] = NUMBER;\n                                break;\n                            case '%':\n                                type[property.substring(1)] = OBJECT;\n                                break;\n                            default:\n                                type[property] = STRING;\n                        }\n                    }\n                });\n            });\n            return _this;\n        }\n        DomElementSchemaRegistry.prototype.hasProperty = function (tagName, propName, schemaMetas) {\n            if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {\n                return true;\n            }\n            if (tagName.indexOf('-') > -1) {\n                if (isNgContainer(tagName) || isNgContent(tagName)) {\n                    return false;\n                }\n                if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {\n                    // Can't tell now as we don't know which properties a custom element will get\n                    // once it is instantiated\n                    return true;\n                }\n            }\n            var elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];\n            return !!elementProperties[propName];\n        };\n        DomElementSchemaRegistry.prototype.hasElement = function (tagName, schemaMetas) {\n            if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {\n                return true;\n            }\n            if (tagName.indexOf('-') > -1) {\n                if (isNgContainer(tagName) || isNgContent(tagName)) {\n                    return true;\n                }\n                if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {\n                    // Allow any custom elements\n                    return true;\n                }\n            }\n            return !!this._schema[tagName.toLowerCase()];\n        };\n        /**\n         * securityContext returns the security context for the given property on the given DOM tag.\n         *\n         * Tag and property name are statically known and cannot change at runtime, i.e. it is not\n         * possible to bind a value into a changing attribute or tag name.\n         *\n         * The filtering is based on a list of allowed tags|attributes. All attributes in the schema\n         * above are assumed to have the 'NONE' security context, i.e. that they are safe inert\n         * string values. Only specific well known attack vectors are assigned their appropriate context.\n         */\n        DomElementSchemaRegistry.prototype.securityContext = function (tagName, propName, isAttribute) {\n            if (isAttribute) {\n                // NB: For security purposes, use the mapped property name, not the attribute name.\n                propName = this.getMappedPropName(propName);\n            }\n            // Make sure comparisons are case insensitive, so that case differences between attribute and\n            // property names do not have a security impact.\n            tagName = tagName.toLowerCase();\n            propName = propName.toLowerCase();\n            var ctx = SECURITY_SCHEMA()[tagName + '|' + propName];\n            if (ctx) {\n                return ctx;\n            }\n            ctx = SECURITY_SCHEMA()['*|' + propName];\n            return ctx ? ctx : SecurityContext.NONE;\n        };\n        DomElementSchemaRegistry.prototype.getMappedPropName = function (propName) {\n            return _ATTR_TO_PROP[propName] || propName;\n        };\n        DomElementSchemaRegistry.prototype.getDefaultComponentElementName = function () {\n            return 'ng-component';\n        };\n        DomElementSchemaRegistry.prototype.validateProperty = function (name) {\n            if (name.toLowerCase().startsWith('on')) {\n                var msg = \"Binding to event property '\" + name + \"' is disallowed for security reasons, \" +\n                    (\"please use (\" + name.slice(2) + \")=...\") +\n                    (\"\\nIf '\" + name + \"' is a directive input, make sure the directive is imported by the\") +\n                    \" current module.\";\n                return { error: true, msg: msg };\n            }\n            else {\n                return { error: false };\n            }\n        };\n        DomElementSchemaRegistry.prototype.validateAttribute = function (name) {\n            if (name.toLowerCase().startsWith('on')) {\n                var msg = \"Binding to event attribute '\" + name + \"' is disallowed for security reasons, \" +\n                    (\"please use (\" + name.slice(2) + \")=...\");\n                return { error: true, msg: msg };\n            }\n            else {\n                return { error: false };\n            }\n        };\n        DomElementSchemaRegistry.prototype.allKnownElementNames = function () {\n            return Object.keys(this._schema);\n        };\n        DomElementSchemaRegistry.prototype.allKnownAttributesOfElement = function (tagName) {\n            var elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];\n            // Convert properties to attributes.\n            return Object.keys(elementProperties).map(function (prop) { var _a; return (_a = _PROP_TO_ATTR[prop]) !== null && _a !== void 0 ? _a : prop; });\n        };\n        DomElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = function (propName) {\n            return dashCaseToCamelCase(propName);\n        };\n        DomElementSchemaRegistry.prototype.normalizeAnimationStyleValue = function (camelCaseProp, userProvidedProp, val) {\n            var unit = '';\n            var strVal = val.toString().trim();\n            var errorMsg = null;\n            if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') {\n                if (typeof val === 'number') {\n                    unit = 'px';\n                }\n                else {\n                    var valAndSuffixMatch = val.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n                    if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n                        errorMsg = \"Please provide a CSS unit value for \" + userProvidedProp + \":\" + val;\n                    }\n                }\n            }\n            return { error: errorMsg, value: strVal + unit };\n        };\n        return DomElementSchemaRegistry;\n    }(ElementSchemaRegistry));\n    function _isPixelDimensionStyle(prop) {\n        switch (prop) {\n            case 'width':\n            case 'height':\n            case 'minWidth':\n            case 'minHeight':\n            case 'maxWidth':\n            case 'maxHeight':\n            case 'left':\n            case 'top':\n            case 'bottom':\n            case 'right':\n            case 'fontSize':\n            case 'outlineWidth':\n            case 'outlineOffset':\n            case 'paddingTop':\n            case 'paddingLeft':\n            case 'paddingBottom':\n            case 'paddingRight':\n            case 'marginTop':\n            case 'marginLeft':\n            case 'marginBottom':\n            case 'marginRight':\n            case 'borderRadius':\n            case 'borderWidth':\n            case 'borderTopWidth':\n            case 'borderLeftWidth':\n            case 'borderRightWidth':\n            case 'borderBottomWidth':\n            case 'textIndent':\n                return true;\n            default:\n                return false;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Set of tagName|propertyName corresponding to Trusted Types sinks. Properties applying to all\n     * tags use '*'.\n     *\n     * Extracted from, and should be kept in sync with\n     * https://w3c.github.io/webappsec-trusted-types/dist/spec/#integrations\n     */\n    var TRUSTED_TYPES_SINKS = new Set([\n        // NOTE: All strings in this set *must* be lowercase!\n        // TrustedHTML\n        'iframe|srcdoc',\n        '*|innerhtml',\n        '*|outerhtml',\n        // NB: no TrustedScript here, as the corresponding tags are stripped by the compiler.\n        // TrustedScriptURL\n        'embed|src',\n        'object|codebase',\n        'object|data',\n    ]);\n    /**\n     * isTrustedTypesSink returns true if the given property on the given DOM tag is a Trusted Types\n     * sink. In that case, use `ElementSchemaRegistry.securityContext` to determine which particular\n     * Trusted Type is required for values passed to the sink:\n     * - SecurityContext.HTML corresponds to TrustedHTML\n     * - SecurityContext.RESOURCE_URL corresponds to TrustedScriptURL\n     */\n    function isTrustedTypesSink(tagName, propName) {\n        // Make sure comparisons are case insensitive, so that case differences between attribute and\n        // property names do not have a security impact.\n        tagName = tagName.toLowerCase();\n        propName = propName.toLowerCase();\n        return TRUSTED_TYPES_SINKS.has(tagName + '|' + propName) ||\n            TRUSTED_TYPES_SINKS.has('*|' + propName);\n    }\n\n    var BIND_NAME_REGEXP$1 = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;\n    // Group 1 = \"bind-\"\n    var KW_BIND_IDX$1 = 1;\n    // Group 2 = \"let-\"\n    var KW_LET_IDX$1 = 2;\n    // Group 3 = \"ref-/#\"\n    var KW_REF_IDX$1 = 3;\n    // Group 4 = \"on-\"\n    var KW_ON_IDX$1 = 4;\n    // Group 5 = \"bindon-\"\n    var KW_BINDON_IDX$1 = 5;\n    // Group 6 = \"@\"\n    var KW_AT_IDX$1 = 6;\n    // Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\n    var IDENT_KW_IDX$1 = 7;\n    var BINDING_DELIMS = {\n        BANANA_BOX: { start: '[(', end: ')]' },\n        PROPERTY: { start: '[', end: ']' },\n        EVENT: { start: '(', end: ')' },\n    };\n    var TEMPLATE_ATTR_PREFIX$2 = '*';\n    function htmlAstToRender3Ast(htmlNodes, bindingParser, options) {\n        var transformer = new HtmlAstToIvyAst(bindingParser, options);\n        var ivyNodes = visitAll$1(transformer, htmlNodes);\n        // Errors might originate in either the binding parser or the html to ivy transformer\n        var allErrors = bindingParser.errors.concat(transformer.errors);\n        var result = {\n            nodes: ivyNodes,\n            errors: allErrors,\n            styleUrls: transformer.styleUrls,\n            styles: transformer.styles,\n            ngContentSelectors: transformer.ngContentSelectors\n        };\n        if (options.collectCommentNodes) {\n            result.commentNodes = transformer.commentNodes;\n        }\n        return result;\n    }\n    var HtmlAstToIvyAst = /** @class */ (function () {\n        function HtmlAstToIvyAst(bindingParser, options) {\n            this.bindingParser = bindingParser;\n            this.options = options;\n            this.errors = [];\n            this.styles = [];\n            this.styleUrls = [];\n            this.ngContentSelectors = [];\n            // This array will be populated if `Render3ParseOptions['collectCommentNodes']` is true\n            this.commentNodes = [];\n            this.inI18nBlock = false;\n        }\n        // HTML visitor\n        HtmlAstToIvyAst.prototype.visitElement = function (element) {\n            var e_1, _a;\n            var _this = this;\n            var isI18nRootElement = isI18nRootNode(element.i18n);\n            if (isI18nRootElement) {\n                if (this.inI18nBlock) {\n                    this.reportError('Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.', element.sourceSpan);\n                }\n                this.inI18nBlock = true;\n            }\n            var preparsedElement = preparseElement(element);\n            if (preparsedElement.type === PreparsedElementType.SCRIPT) {\n                return null;\n            }\n            else if (preparsedElement.type === PreparsedElementType.STYLE) {\n                var contents = textContents(element);\n                if (contents !== null) {\n                    this.styles.push(contents);\n                }\n                return null;\n            }\n            else if (preparsedElement.type === PreparsedElementType.STYLESHEET &&\n                isStyleUrlResolvable(preparsedElement.hrefAttr)) {\n                this.styleUrls.push(preparsedElement.hrefAttr);\n                return null;\n            }\n            // Whether the element is a `<ng-template>`\n            var isTemplateElement = isNgTemplate(element.name);\n            var parsedProperties = [];\n            var boundEvents = [];\n            var variables = [];\n            var references = [];\n            var attributes = [];\n            var i18nAttrsMeta = {};\n            var templateParsedProperties = [];\n            var templateVariables = [];\n            // Whether the element has any *-attribute\n            var elementHasInlineTemplate = false;\n            try {\n                for (var _b = __values(element.attrs), _c = _b.next(); !_c.done; _c = _b.next()) {\n                    var attribute = _c.value;\n                    var hasBinding = false;\n                    var normalizedName = normalizeAttributeName(attribute.name);\n                    // `*attr` defines template bindings\n                    var isTemplateBinding = false;\n                    if (attribute.i18n) {\n                        i18nAttrsMeta[attribute.name] = attribute.i18n;\n                    }\n                    if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX$2)) {\n                        // *-attributes\n                        if (elementHasInlineTemplate) {\n                            this.reportError(\"Can't have multiple template bindings on one element. Use only one attribute prefixed with *\", attribute.sourceSpan);\n                        }\n                        isTemplateBinding = true;\n                        elementHasInlineTemplate = true;\n                        var templateValue = attribute.value;\n                        var templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX$2.length);\n                        var parsedVariables = [];\n                        var absoluteValueOffset = attribute.valueSpan ?\n                            attribute.valueSpan.start.offset :\n                            // If there is no value span the attribute does not have a value, like `attr` in\n                            //`<div attr></div>`. In this case, point to one character beyond the last character of\n                            // the attribute name.\n                            attribute.sourceSpan.start.offset + attribute.name.length;\n                        this.bindingParser.parseInlineTemplateBinding(templateKey, templateValue, attribute.sourceSpan, absoluteValueOffset, [], templateParsedProperties, parsedVariables, true /* isIvyAst */);\n                        templateVariables.push.apply(templateVariables, __spreadArray([], __read(parsedVariables.map(function (v) { return new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan); }))));\n                    }\n                    else {\n                        // Check for variables, events, property bindings, interpolation\n                        hasBinding = this.parseAttribute(isTemplateElement, attribute, [], parsedProperties, boundEvents, variables, references);\n                    }\n                    if (!hasBinding && !isTemplateBinding) {\n                        // don't include the bindings as attributes as well in the AST\n                        attributes.push(this.visitAttribute(attribute));\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            var children = visitAll$1(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR$1 : this, element.children);\n            var parsedElement;\n            if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {\n                // `<ng-content>`\n                if (element.children &&\n                    !element.children.every(function (node) { return isEmptyTextNode(node) || isCommentNode(node); })) {\n                    this.reportError(\"<ng-content> element cannot have content.\", element.sourceSpan);\n                }\n                var selector = preparsedElement.selectAttr;\n                var attrs = element.attrs.map(function (attr) { return _this.visitAttribute(attr); });\n                parsedElement = new Content(selector, attrs, element.sourceSpan, element.i18n);\n                this.ngContentSelectors.push(selector);\n            }\n            else if (isTemplateElement) {\n                // `<ng-template>`\n                var attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);\n                parsedElement = new Template(element.name, attributes, attrs.bound, boundEvents, [ /* no template attributes */], children, references, variables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);\n            }\n            else {\n                var attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);\n                parsedElement = new Element(element.name, attributes, attrs.bound, boundEvents, children, references, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);\n            }\n            if (elementHasInlineTemplate) {\n                // If this node is an inline-template (e.g. has *ngFor) then we need to create a template\n                // node that contains this node.\n                // Moreover, if the node is an element, then we need to hoist its attributes to the template\n                // node for matching against content projection selectors.\n                var attrs = this.extractAttributes('ng-template', templateParsedProperties, i18nAttrsMeta);\n                var templateAttrs_1 = [];\n                attrs.literal.forEach(function (attr) { return templateAttrs_1.push(attr); });\n                attrs.bound.forEach(function (attr) { return templateAttrs_1.push(attr); });\n                var hoistedAttrs = parsedElement instanceof Element ?\n                    {\n                        attributes: parsedElement.attributes,\n                        inputs: parsedElement.inputs,\n                        outputs: parsedElement.outputs,\n                    } :\n                    { attributes: [], inputs: [], outputs: [] };\n                // For <ng-template>s with structural directives on them, avoid passing i18n information to\n                // the wrapping template to prevent unnecessary i18n instructions from being generated. The\n                // necessary i18n meta information will be extracted from child elements.\n                var i18n = isTemplateElement && isI18nRootElement ? undefined : element.i18n;\n                // TODO(pk): test for this case\n                parsedElement = new Template(parsedElement.name, hoistedAttrs.attributes, hoistedAttrs.inputs, hoistedAttrs.outputs, templateAttrs_1, [parsedElement], [ /* no references */], templateVariables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, i18n);\n            }\n            if (isI18nRootElement) {\n                this.inI18nBlock = false;\n            }\n            return parsedElement;\n        };\n        HtmlAstToIvyAst.prototype.visitAttribute = function (attribute) {\n            return new TextAttribute(attribute.name, attribute.value, attribute.sourceSpan, attribute.keySpan, attribute.valueSpan, attribute.i18n);\n        };\n        HtmlAstToIvyAst.prototype.visitText = function (text) {\n            return this._visitTextWithInterpolation(text.value, text.sourceSpan, text.i18n);\n        };\n        HtmlAstToIvyAst.prototype.visitExpansion = function (expansion) {\n            var _this = this;\n            if (!expansion.i18n) {\n                // do not generate Icu in case it was created\n                // outside of i18n block in a template\n                return null;\n            }\n            if (!isI18nRootNode(expansion.i18n)) {\n                throw new Error(\"Invalid type \\\"\" + expansion.i18n.constructor + \"\\\" for \\\"i18n\\\" property of \" + expansion.sourceSpan.toString() + \". Expected a \\\"Message\\\"\");\n            }\n            var message = expansion.i18n;\n            var vars = {};\n            var placeholders = {};\n            // extract VARs from ICUs - we process them separately while\n            // assembling resulting message via goog.getMsg function, since\n            // we need to pass them to top-level goog.getMsg call\n            Object.keys(message.placeholders).forEach(function (key) {\n                var value = message.placeholders[key];\n                if (key.startsWith(I18N_ICU_VAR_PREFIX)) {\n                    // Currently when the `plural` or `select` keywords in an ICU contain trailing spaces (e.g.\n                    // `{count, select , ...}`), these spaces are also included into the key names in ICU vars\n                    // (e.g. \"VAR_SELECT \"). These trailing spaces are not desirable, since they will later be\n                    // converted into `_` symbols while normalizing placeholder names, which might lead to\n                    // mismatches at runtime (i.e. placeholder will not be replaced with the correct value).\n                    var formattedKey = key.trim();\n                    var ast = _this.bindingParser.parseInterpolationExpression(value.text, value.sourceSpan);\n                    vars[formattedKey] = new BoundText(ast, value.sourceSpan);\n                }\n                else {\n                    placeholders[key] = _this._visitTextWithInterpolation(value.text, value.sourceSpan);\n                }\n            });\n            return new Icu(vars, placeholders, expansion.sourceSpan, message);\n        };\n        HtmlAstToIvyAst.prototype.visitExpansionCase = function (expansionCase) {\n            return null;\n        };\n        HtmlAstToIvyAst.prototype.visitComment = function (comment) {\n            if (this.options.collectCommentNodes) {\n                this.commentNodes.push(new Comment(comment.value || '', comment.sourceSpan));\n            }\n            return null;\n        };\n        // convert view engine `ParsedProperty` to a format suitable for IVY\n        HtmlAstToIvyAst.prototype.extractAttributes = function (elementName, properties, i18nPropsMeta) {\n            var _this = this;\n            var bound = [];\n            var literal = [];\n            properties.forEach(function (prop) {\n                var i18n = i18nPropsMeta[prop.name];\n                if (prop.isLiteral) {\n                    literal.push(new TextAttribute(prop.name, prop.expression.source || '', prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n));\n                }\n                else {\n                    // Note that validation is skipped and property mapping is disabled\n                    // due to the fact that we need to make sure a given prop is not an\n                    // input of a directive and directive matching happens at runtime.\n                    var bep = _this.bindingParser.createBoundElementProperty(elementName, prop, /* skipValidation */ true, /* mapPropertyName */ false);\n                    bound.push(BoundAttribute.fromBoundElementProperty(bep, i18n));\n                }\n            });\n            return { bound: bound, literal: literal };\n        };\n        HtmlAstToIvyAst.prototype.parseAttribute = function (isTemplateElement, attribute, matchableAttributes, parsedProperties, boundEvents, variables, references) {\n            var name = normalizeAttributeName(attribute.name);\n            var value = attribute.value;\n            var srcSpan = attribute.sourceSpan;\n            var absoluteOffset = attribute.valueSpan ? attribute.valueSpan.start.offset : srcSpan.start.offset;\n            function createKeySpan(srcSpan, prefix, identifier) {\n                // We need to adjust the start location for the keySpan to account for the removed 'data-'\n                // prefix from `normalizeAttributeName`.\n                var normalizationAdjustment = attribute.name.length - name.length;\n                var keySpanStart = srcSpan.start.moveBy(prefix.length + normalizationAdjustment);\n                var keySpanEnd = keySpanStart.moveBy(identifier.length);\n                return new ParseSourceSpan(keySpanStart, keySpanEnd, keySpanStart, identifier);\n            }\n            var bindParts = name.match(BIND_NAME_REGEXP$1);\n            if (bindParts) {\n                if (bindParts[KW_BIND_IDX$1] != null) {\n                    var identifier = bindParts[IDENT_KW_IDX$1];\n                    var keySpan_1 = createKeySpan(srcSpan, bindParts[KW_BIND_IDX$1], identifier);\n                    this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan_1);\n                }\n                else if (bindParts[KW_LET_IDX$1]) {\n                    if (isTemplateElement) {\n                        var identifier = bindParts[IDENT_KW_IDX$1];\n                        var keySpan_2 = createKeySpan(srcSpan, bindParts[KW_LET_IDX$1], identifier);\n                        this.parseVariable(identifier, value, srcSpan, keySpan_2, attribute.valueSpan, variables);\n                    }\n                    else {\n                        this.reportError(\"\\\"let-\\\" is only supported on ng-template elements.\", srcSpan);\n                    }\n                }\n                else if (bindParts[KW_REF_IDX$1]) {\n                    var identifier = bindParts[IDENT_KW_IDX$1];\n                    var keySpan_3 = createKeySpan(srcSpan, bindParts[KW_REF_IDX$1], identifier);\n                    this.parseReference(identifier, value, srcSpan, keySpan_3, attribute.valueSpan, references);\n                }\n                else if (bindParts[KW_ON_IDX$1]) {\n                    var events = [];\n                    var identifier = bindParts[IDENT_KW_IDX$1];\n                    var keySpan_4 = createKeySpan(srcSpan, bindParts[KW_ON_IDX$1], identifier);\n                    this.bindingParser.parseEvent(identifier, value, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan_4);\n                    addEvents(events, boundEvents);\n                }\n                else if (bindParts[KW_BINDON_IDX$1]) {\n                    var identifier = bindParts[IDENT_KW_IDX$1];\n                    var keySpan_5 = createKeySpan(srcSpan, bindParts[KW_BINDON_IDX$1], identifier);\n                    this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan_5);\n                    this.parseAssignmentEvent(identifier, value, srcSpan, attribute.valueSpan, matchableAttributes, boundEvents, keySpan_5);\n                }\n                else if (bindParts[KW_AT_IDX$1]) {\n                    var keySpan_6 = createKeySpan(srcSpan, '', name);\n                    this.bindingParser.parseLiteralAttr(name, value, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan_6);\n                }\n                return true;\n            }\n            // We didn't see a kw-prefixed property binding, but we have not yet checked\n            // for the []/()/[()] syntax.\n            var delims = null;\n            if (name.startsWith(BINDING_DELIMS.BANANA_BOX.start)) {\n                delims = BINDING_DELIMS.BANANA_BOX;\n            }\n            else if (name.startsWith(BINDING_DELIMS.PROPERTY.start)) {\n                delims = BINDING_DELIMS.PROPERTY;\n            }\n            else if (name.startsWith(BINDING_DELIMS.EVENT.start)) {\n                delims = BINDING_DELIMS.EVENT;\n            }\n            if (delims !== null &&\n                // NOTE: older versions of the parser would match a start/end delimited\n                // binding iff the property name was terminated by the ending delimiter\n                // and the identifier in the binding was non-empty.\n                // TODO(ayazhafiz): update this to handle malformed bindings.\n                name.endsWith(delims.end) && name.length > delims.start.length + delims.end.length) {\n                var identifier = name.substring(delims.start.length, name.length - delims.end.length);\n                var keySpan_7 = createKeySpan(srcSpan, delims.start, identifier);\n                if (delims.start === BINDING_DELIMS.BANANA_BOX.start) {\n                    this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan_7);\n                    this.parseAssignmentEvent(identifier, value, srcSpan, attribute.valueSpan, matchableAttributes, boundEvents, keySpan_7);\n                }\n                else if (delims.start === BINDING_DELIMS.PROPERTY.start) {\n                    this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan_7);\n                }\n                else {\n                    var events = [];\n                    this.bindingParser.parseEvent(identifier, value, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan_7);\n                    addEvents(events, boundEvents);\n                }\n                return true;\n            }\n            // No explicit binding found.\n            var keySpan = createKeySpan(srcSpan, '' /* prefix */, name);\n            var hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan);\n            return hasBinding;\n        };\n        HtmlAstToIvyAst.prototype._visitTextWithInterpolation = function (value, sourceSpan, i18n) {\n            var valueNoNgsp = replaceNgsp(value);\n            var expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan);\n            return expr ? new BoundText(expr, sourceSpan, i18n) : new Text(valueNoNgsp, sourceSpan);\n        };\n        HtmlAstToIvyAst.prototype.parseVariable = function (identifier, value, sourceSpan, keySpan, valueSpan, variables) {\n            if (identifier.indexOf('-') > -1) {\n                this.reportError(\"\\\"-\\\" is not allowed in variable names\", sourceSpan);\n            }\n            else if (identifier.length === 0) {\n                this.reportError(\"Variable does not have a name\", sourceSpan);\n            }\n            variables.push(new Variable(identifier, value, sourceSpan, keySpan, valueSpan));\n        };\n        HtmlAstToIvyAst.prototype.parseReference = function (identifier, value, sourceSpan, keySpan, valueSpan, references) {\n            if (identifier.indexOf('-') > -1) {\n                this.reportError(\"\\\"-\\\" is not allowed in reference names\", sourceSpan);\n            }\n            else if (identifier.length === 0) {\n                this.reportError(\"Reference does not have a name\", sourceSpan);\n            }\n            else if (references.some(function (reference) { return reference.name === identifier; })) {\n                this.reportError(\"Reference \\\"#\" + identifier + \"\\\" is defined more than once\", sourceSpan);\n            }\n            references.push(new Reference(identifier, value, sourceSpan, keySpan, valueSpan));\n        };\n        HtmlAstToIvyAst.prototype.parseAssignmentEvent = function (name, expression, sourceSpan, valueSpan, targetMatchableAttrs, boundEvents, keySpan) {\n            var events = [];\n            this.bindingParser.parseEvent(name + \"Change\", expression + \"=$event\", sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);\n            addEvents(events, boundEvents);\n        };\n        HtmlAstToIvyAst.prototype.reportError = function (message, sourceSpan, level) {\n            if (level === void 0) { level = exports.ParseErrorLevel.ERROR; }\n            this.errors.push(new ParseError(sourceSpan, message, level));\n        };\n        return HtmlAstToIvyAst;\n    }());\n    var NonBindableVisitor$1 = /** @class */ (function () {\n        function NonBindableVisitor() {\n        }\n        NonBindableVisitor.prototype.visitElement = function (ast) {\n            var preparsedElement = preparseElement(ast);\n            if (preparsedElement.type === PreparsedElementType.SCRIPT ||\n                preparsedElement.type === PreparsedElementType.STYLE ||\n                preparsedElement.type === PreparsedElementType.STYLESHEET) {\n                // Skipping <script> for security reasons\n                // Skipping <style> and stylesheets as we already processed them\n                // in the StyleCompiler\n                return null;\n            }\n            var children = visitAll$1(this, ast.children, null);\n            return new Element(ast.name, visitAll$1(this, ast.attrs), \n            /* inputs */ [], /* outputs */ [], children, /* references */ [], ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);\n        };\n        NonBindableVisitor.prototype.visitComment = function (comment) {\n            return null;\n        };\n        NonBindableVisitor.prototype.visitAttribute = function (attribute) {\n            return new TextAttribute(attribute.name, attribute.value, attribute.sourceSpan, attribute.keySpan, attribute.valueSpan, attribute.i18n);\n        };\n        NonBindableVisitor.prototype.visitText = function (text) {\n            return new Text(text.value, text.sourceSpan);\n        };\n        NonBindableVisitor.prototype.visitExpansion = function (expansion) {\n            return null;\n        };\n        NonBindableVisitor.prototype.visitExpansionCase = function (expansionCase) {\n            return null;\n        };\n        return NonBindableVisitor;\n    }());\n    var NON_BINDABLE_VISITOR$1 = new NonBindableVisitor$1();\n    function normalizeAttributeName(attrName) {\n        return /^data-/i.test(attrName) ? attrName.substring(5) : attrName;\n    }\n    function addEvents(events, boundEvents) {\n        boundEvents.push.apply(boundEvents, __spreadArray([], __read(events.map(function (e) { return BoundEvent.fromParsedEvent(e); }))));\n    }\n    function isEmptyTextNode(node) {\n        return node instanceof Text$3 && node.value.trim().length == 0;\n    }\n    function isCommentNode(node) {\n        return node instanceof Comment$1;\n    }\n    function textContents(node) {\n        if (node.children.length !== 1 || !(node.children[0] instanceof Text$3)) {\n            return null;\n        }\n        else {\n            return node.children[0].value;\n        }\n    }\n\n    var TagType;\n    (function (TagType) {\n        TagType[TagType[\"ELEMENT\"] = 0] = \"ELEMENT\";\n        TagType[TagType[\"TEMPLATE\"] = 1] = \"TEMPLATE\";\n    })(TagType || (TagType = {}));\n    /**\n     * Generates an object that is used as a shared state between parent and all child contexts.\n     */\n    function setupRegistry() {\n        return { getUniqueId: getSeqNumberGenerator(), icus: new Map() };\n    }\n    /**\n     * I18nContext is a helper class which keeps track of all i18n-related aspects\n     * (accumulates placeholders, bindings, etc) between i18nStart and i18nEnd instructions.\n     *\n     * When we enter a nested template, the top-level context is being passed down\n     * to the nested component, which uses this context to generate a child instance\n     * of I18nContext class (to handle nested template) and at the end, reconciles it back\n     * with the parent context.\n     *\n     * @param index Instruction index of i18nStart, which initiates this context\n     * @param ref Reference to a translation const that represents the content if thus context\n     * @param level Nestng level defined for child contexts\n     * @param templateIndex Instruction index of a template which this context belongs to\n     * @param meta Meta information (id, meaning, description, etc) associated with this context\n     */\n    var I18nContext = /** @class */ (function () {\n        function I18nContext(index, ref, level, templateIndex, meta, registry) {\n            if (level === void 0) { level = 0; }\n            if (templateIndex === void 0) { templateIndex = null; }\n            this.index = index;\n            this.ref = ref;\n            this.level = level;\n            this.templateIndex = templateIndex;\n            this.meta = meta;\n            this.registry = registry;\n            this.bindings = new Set();\n            this.placeholders = new Map();\n            this.isEmitted = false;\n            this._unresolvedCtxCount = 0;\n            this._registry = registry || setupRegistry();\n            this.id = this._registry.getUniqueId();\n        }\n        I18nContext.prototype.appendTag = function (type, node, index, closed) {\n            if (node.isVoid && closed) {\n                return; // ignore \"close\" for void tags\n            }\n            var ph = node.isVoid || !closed ? node.startName : node.closeName;\n            var content = { type: type, index: index, ctx: this.id, isVoid: node.isVoid, closed: closed };\n            updatePlaceholderMap(this.placeholders, ph, content);\n        };\n        Object.defineProperty(I18nContext.prototype, \"icus\", {\n            get: function () {\n                return this._registry.icus;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(I18nContext.prototype, \"isRoot\", {\n            get: function () {\n                return this.level === 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(I18nContext.prototype, \"isResolved\", {\n            get: function () {\n                return this._unresolvedCtxCount === 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        I18nContext.prototype.getSerializedPlaceholders = function () {\n            var result = new Map();\n            this.placeholders.forEach(function (values, key) { return result.set(key, values.map(serializePlaceholderValue)); });\n            return result;\n        };\n        // public API to accumulate i18n-related content\n        I18nContext.prototype.appendBinding = function (binding) {\n            this.bindings.add(binding);\n        };\n        I18nContext.prototype.appendIcu = function (name, ref) {\n            updatePlaceholderMap(this._registry.icus, name, ref);\n        };\n        I18nContext.prototype.appendBoundText = function (node) {\n            var _this = this;\n            var phs = assembleBoundTextPlaceholders(node, this.bindings.size, this.id);\n            phs.forEach(function (values, key) { return updatePlaceholderMap.apply(void 0, __spreadArray([_this.placeholders, key], __read(values))); });\n        };\n        I18nContext.prototype.appendTemplate = function (node, index) {\n            // add open and close tags at the same time,\n            // since we process nested templates separately\n            this.appendTag(TagType.TEMPLATE, node, index, false);\n            this.appendTag(TagType.TEMPLATE, node, index, true);\n            this._unresolvedCtxCount++;\n        };\n        I18nContext.prototype.appendElement = function (node, index, closed) {\n            this.appendTag(TagType.ELEMENT, node, index, closed);\n        };\n        I18nContext.prototype.appendProjection = function (node, index) {\n            // Add open and close tags at the same time, since `<ng-content>` has no content,\n            // so when we come across `<ng-content>` we can register both open and close tags.\n            // Note: runtime i18n logic doesn't distinguish `<ng-content>` tag placeholders and\n            // regular element tag placeholders, so we generate element placeholders for both types.\n            this.appendTag(TagType.ELEMENT, node, index, false);\n            this.appendTag(TagType.ELEMENT, node, index, true);\n        };\n        /**\n         * Generates an instance of a child context based on the root one,\n         * when we enter a nested template within I18n section.\n         *\n         * @param index Instruction index of corresponding i18nStart, which initiates this context\n         * @param templateIndex Instruction index of a template which this context belongs to\n         * @param meta Meta information (id, meaning, description, etc) associated with this context\n         *\n         * @returns I18nContext instance\n         */\n        I18nContext.prototype.forkChildContext = function (index, templateIndex, meta) {\n            return new I18nContext(index, this.ref, this.level + 1, templateIndex, meta, this._registry);\n        };\n        /**\n         * Reconciles child context into parent one once the end of the i18n block is reached (i18nEnd).\n         *\n         * @param context Child I18nContext instance to be reconciled with parent context.\n         */\n        I18nContext.prototype.reconcileChildContext = function (context) {\n            var _this = this;\n            // set the right context id for open and close\n            // template tags, so we can use it as sub-block ids\n            ['start', 'close'].forEach(function (op) {\n                var key = context.meta[op + \"Name\"];\n                var phs = _this.placeholders.get(key) || [];\n                var tag = phs.find(findTemplateFn(_this.id, context.templateIndex));\n                if (tag) {\n                    tag.ctx = context.id;\n                }\n            });\n            // reconcile placeholders\n            var childPhs = context.placeholders;\n            childPhs.forEach(function (values, key) {\n                var phs = _this.placeholders.get(key);\n                if (!phs) {\n                    _this.placeholders.set(key, values);\n                    return;\n                }\n                // try to find matching template...\n                var tmplIdx = phs.findIndex(findTemplateFn(context.id, context.templateIndex));\n                if (tmplIdx >= 0) {\n                    // ... if found - replace it with nested template content\n                    var isCloseTag = key.startsWith('CLOSE');\n                    var isTemplateTag = key.endsWith('NG-TEMPLATE');\n                    if (isTemplateTag) {\n                        // current template's content is placed before or after\n                        // parent template tag, depending on the open/close atrribute\n                        phs.splice.apply(phs, __spreadArray([tmplIdx + (isCloseTag ? 0 : 1), 0], __read(values)));\n                    }\n                    else {\n                        var idx = isCloseTag ? values.length - 1 : 0;\n                        values[idx].tmpl = phs[tmplIdx];\n                        phs.splice.apply(phs, __spreadArray([tmplIdx, 1], __read(values)));\n                    }\n                }\n                else {\n                    // ... otherwise just append content to placeholder value\n                    phs.push.apply(phs, __spreadArray([], __read(values)));\n                }\n                _this.placeholders.set(key, phs);\n            });\n            this._unresolvedCtxCount--;\n        };\n        return I18nContext;\n    }());\n    //\n    // Helper methods\n    //\n    function wrap(symbol, index, contextId, closed) {\n        var state = closed ? '/' : '';\n        return wrapI18nPlaceholder(\"\" + state + symbol + index, contextId);\n    }\n    function wrapTag(symbol, _a, closed) {\n        var index = _a.index, ctx = _a.ctx, isVoid = _a.isVoid;\n        return isVoid ? wrap(symbol, index, ctx) + wrap(symbol, index, ctx, true) :\n            wrap(symbol, index, ctx, closed);\n    }\n    function findTemplateFn(ctx, templateIndex) {\n        return function (token) { return typeof token === 'object' && token.type === TagType.TEMPLATE &&\n            token.index === templateIndex && token.ctx === ctx; };\n    }\n    function serializePlaceholderValue(value) {\n        var element = function (data, closed) { return wrapTag('#', data, closed); };\n        var template = function (data, closed) { return wrapTag('*', data, closed); };\n        var projection = function (data, closed) { return wrapTag('!', data, closed); };\n        switch (value.type) {\n            case TagType.ELEMENT:\n                // close element tag\n                if (value.closed) {\n                    return element(value, true) + (value.tmpl ? template(value.tmpl, true) : '');\n                }\n                // open element tag that also initiates a template\n                if (value.tmpl) {\n                    return template(value.tmpl) + element(value) +\n                        (value.isVoid ? template(value.tmpl, true) : '');\n                }\n                return element(value);\n            case TagType.TEMPLATE:\n                return template(value, value.closed);\n            default:\n                return value;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var IcuSerializerVisitor = /** @class */ (function () {\n        function IcuSerializerVisitor() {\n        }\n        IcuSerializerVisitor.prototype.visitText = function (text) {\n            return text.value;\n        };\n        IcuSerializerVisitor.prototype.visitContainer = function (container) {\n            var _this = this;\n            return container.children.map(function (child) { return child.visit(_this); }).join('');\n        };\n        IcuSerializerVisitor.prototype.visitIcu = function (icu) {\n            var _this = this;\n            var strCases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n            var result = \"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \" + strCases.join(' ') + \"}\";\n            return result;\n        };\n        IcuSerializerVisitor.prototype.visitTagPlaceholder = function (ph) {\n            var _this = this;\n            return ph.isVoid ?\n                this.formatPh(ph.startName) :\n                \"\" + this.formatPh(ph.startName) + ph.children.map(function (child) { return child.visit(_this); }).join('') + this.formatPh(ph.closeName);\n        };\n        IcuSerializerVisitor.prototype.visitPlaceholder = function (ph) {\n            return this.formatPh(ph.name);\n        };\n        IcuSerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            return this.formatPh(ph.name);\n        };\n        IcuSerializerVisitor.prototype.formatPh = function (value) {\n            return \"{\" + formatI18nPlaceholderName(value, /* useCamelCase */ false) + \"}\";\n        };\n        return IcuSerializerVisitor;\n    }());\n    var serializer = new IcuSerializerVisitor();\n    function serializeIcuNode(icu) {\n        return icu.visit(serializer);\n    }\n\n    /**\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://angular.io/license\n     */\n    var TAG_TO_PLACEHOLDER_NAMES = {\n        'A': 'LINK',\n        'B': 'BOLD_TEXT',\n        'BR': 'LINE_BREAK',\n        'EM': 'EMPHASISED_TEXT',\n        'H1': 'HEADING_LEVEL1',\n        'H2': 'HEADING_LEVEL2',\n        'H3': 'HEADING_LEVEL3',\n        'H4': 'HEADING_LEVEL4',\n        'H5': 'HEADING_LEVEL5',\n        'H6': 'HEADING_LEVEL6',\n        'HR': 'HORIZONTAL_RULE',\n        'I': 'ITALIC_TEXT',\n        'LI': 'LIST_ITEM',\n        'LINK': 'MEDIA_LINK',\n        'OL': 'ORDERED_LIST',\n        'P': 'PARAGRAPH',\n        'Q': 'QUOTATION',\n        'S': 'STRIKETHROUGH_TEXT',\n        'SMALL': 'SMALL_TEXT',\n        'SUB': 'SUBSTRIPT',\n        'SUP': 'SUPERSCRIPT',\n        'TBODY': 'TABLE_BODY',\n        'TD': 'TABLE_CELL',\n        'TFOOT': 'TABLE_FOOTER',\n        'TH': 'TABLE_HEADER_CELL',\n        'THEAD': 'TABLE_HEADER',\n        'TR': 'TABLE_ROW',\n        'TT': 'MONOSPACED_TEXT',\n        'U': 'UNDERLINED_TEXT',\n        'UL': 'UNORDERED_LIST',\n    };\n    /**\n     * Creates unique names for placeholder with different content.\n     *\n     * Returns the same placeholder name when the content is identical.\n     */\n    var PlaceholderRegistry = /** @class */ (function () {\n        function PlaceholderRegistry() {\n            // Count the occurrence of the base name top generate a unique name\n            this._placeHolderNameCounts = {};\n            // Maps signature to placeholder names\n            this._signatureToName = {};\n        }\n        PlaceholderRegistry.prototype.getStartTagPlaceholderName = function (tag, attrs, isVoid) {\n            var signature = this._hashTag(tag, attrs, isVoid);\n            if (this._signatureToName[signature]) {\n                return this._signatureToName[signature];\n            }\n            var upperTag = tag.toUpperCase();\n            var baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || \"TAG_\" + upperTag;\n            var name = this._generateUniqueName(isVoid ? baseName : \"START_\" + baseName);\n            this._signatureToName[signature] = name;\n            return name;\n        };\n        PlaceholderRegistry.prototype.getCloseTagPlaceholderName = function (tag) {\n            var signature = this._hashClosingTag(tag);\n            if (this._signatureToName[signature]) {\n                return this._signatureToName[signature];\n            }\n            var upperTag = tag.toUpperCase();\n            var baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || \"TAG_\" + upperTag;\n            var name = this._generateUniqueName(\"CLOSE_\" + baseName);\n            this._signatureToName[signature] = name;\n            return name;\n        };\n        PlaceholderRegistry.prototype.getPlaceholderName = function (name, content) {\n            var upperName = name.toUpperCase();\n            var signature = \"PH: \" + upperName + \"=\" + content;\n            if (this._signatureToName[signature]) {\n                return this._signatureToName[signature];\n            }\n            var uniqueName = this._generateUniqueName(upperName);\n            this._signatureToName[signature] = uniqueName;\n            return uniqueName;\n        };\n        PlaceholderRegistry.prototype.getUniquePlaceholder = function (name) {\n            return this._generateUniqueName(name.toUpperCase());\n        };\n        // Generate a hash for a tag - does not take attribute order into account\n        PlaceholderRegistry.prototype._hashTag = function (tag, attrs, isVoid) {\n            var start = \"<\" + tag;\n            var strAttrs = Object.keys(attrs).sort().map(function (name) { return \" \" + name + \"=\" + attrs[name]; }).join('');\n            var end = isVoid ? '/>' : \"></\" + tag + \">\";\n            return start + strAttrs + end;\n        };\n        PlaceholderRegistry.prototype._hashClosingTag = function (tag) {\n            return this._hashTag(\"/\" + tag, {}, false);\n        };\n        PlaceholderRegistry.prototype._generateUniqueName = function (base) {\n            var seen = this._placeHolderNameCounts.hasOwnProperty(base);\n            if (!seen) {\n                this._placeHolderNameCounts[base] = 1;\n                return base;\n            }\n            var id = this._placeHolderNameCounts[base];\n            this._placeHolderNameCounts[base] = id + 1;\n            return base + \"_\" + id;\n        };\n        return PlaceholderRegistry;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var _expParser = new Parser$1(new Lexer());\n    /**\n     * Returns a function converting html nodes to an i18n Message given an interpolationConfig\n     */\n    function createI18nMessageFactory(interpolationConfig) {\n        var visitor = new _I18nVisitor(_expParser, interpolationConfig);\n        return function (nodes, meaning, description, customId, visitNodeFn) { return visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn); };\n    }\n    function noopVisitNodeFn(_html, i18n) {\n        return i18n;\n    }\n    var _I18nVisitor = /** @class */ (function () {\n        function _I18nVisitor(_expressionParser, _interpolationConfig) {\n            this._expressionParser = _expressionParser;\n            this._interpolationConfig = _interpolationConfig;\n        }\n        _I18nVisitor.prototype.toI18nMessage = function (nodes, meaning, description, customId, visitNodeFn) {\n            if (meaning === void 0) { meaning = ''; }\n            if (description === void 0) { description = ''; }\n            if (customId === void 0) { customId = ''; }\n            var context = {\n                isIcu: nodes.length == 1 && nodes[0] instanceof Expansion,\n                icuDepth: 0,\n                placeholderRegistry: new PlaceholderRegistry(),\n                placeholderToContent: {},\n                placeholderToMessage: {},\n                visitNodeFn: visitNodeFn || noopVisitNodeFn,\n            };\n            var i18nodes = visitAll$1(this, nodes, context);\n            return new Message(i18nodes, context.placeholderToContent, context.placeholderToMessage, meaning, description, customId);\n        };\n        _I18nVisitor.prototype.visitElement = function (el, context) {\n            var _a;\n            var children = visitAll$1(this, el.children, context);\n            var attrs = {};\n            el.attrs.forEach(function (attr) {\n                // Do not visit the attributes, translatable ones are top-level ASTs\n                attrs[attr.name] = attr.value;\n            });\n            var isVoid = getHtmlTagDefinition(el.name).isVoid;\n            var startPhName = context.placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);\n            context.placeholderToContent[startPhName] = {\n                text: el.startSourceSpan.toString(),\n                sourceSpan: el.startSourceSpan,\n            };\n            var closePhName = '';\n            if (!isVoid) {\n                closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(el.name);\n                context.placeholderToContent[closePhName] = {\n                    text: \"</\" + el.name + \">\",\n                    sourceSpan: (_a = el.endSourceSpan) !== null && _a !== void 0 ? _a : el.sourceSpan,\n                };\n            }\n            var node = new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n            return context.visitNodeFn(el, node);\n        };\n        _I18nVisitor.prototype.visitAttribute = function (attribute, context) {\n            var node = this._visitTextWithInterpolation(attribute.value, attribute.valueSpan || attribute.sourceSpan, context, attribute.i18n);\n            return context.visitNodeFn(attribute, node);\n        };\n        _I18nVisitor.prototype.visitText = function (text, context) {\n            var node = this._visitTextWithInterpolation(text.value, text.sourceSpan, context, text.i18n);\n            return context.visitNodeFn(text, node);\n        };\n        _I18nVisitor.prototype.visitComment = function (comment, context) {\n            return null;\n        };\n        _I18nVisitor.prototype.visitExpansion = function (icu, context) {\n            var _this = this;\n            context.icuDepth++;\n            var i18nIcuCases = {};\n            var i18nIcu = new Icu$1(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);\n            icu.cases.forEach(function (caze) {\n                i18nIcuCases[caze.value] = new Container(caze.expression.map(function (node) { return node.visit(_this, context); }), caze.expSourceSpan);\n            });\n            context.icuDepth--;\n            if (context.isIcu || context.icuDepth > 0) {\n                // Returns an ICU node when:\n                // - the message (vs a part of the message) is an ICU message, or\n                // - the ICU message is nested.\n                var expPh = context.placeholderRegistry.getUniquePlaceholder(\"VAR_\" + icu.type);\n                i18nIcu.expressionPlaceholder = expPh;\n                context.placeholderToContent[expPh] = {\n                    text: icu.switchValue,\n                    sourceSpan: icu.switchValueSourceSpan,\n                };\n                return context.visitNodeFn(icu, i18nIcu);\n            }\n            // Else returns a placeholder\n            // ICU placeholders should not be replaced with their original content but with the their\n            // translations.\n            // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg\n            var phName = context.placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());\n            context.placeholderToMessage[phName] = this.toI18nMessage([icu], '', '', '', undefined);\n            var node = new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);\n            return context.visitNodeFn(icu, node);\n        };\n        _I18nVisitor.prototype.visitExpansionCase = function (_icuCase, _context) {\n            throw new Error('Unreachable code');\n        };\n        /**\n         * Split the, potentially interpolated, text up into text and placeholder pieces.\n         *\n         * @param text The potentially interpolated string to be split.\n         * @param sourceSpan The span of the whole of the `text` string.\n         * @param context The current context of the visitor, used to compute and store placeholders.\n         * @param previousI18n Any i18n metadata associated with this `text` from a previous pass.\n         */\n        _I18nVisitor.prototype._visitTextWithInterpolation = function (text, sourceSpan, context, previousI18n) {\n            var _b = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig), strings = _b.strings, expressions = _b.expressions;\n            // No expressions, return a single text.\n            if (expressions.length === 0) {\n                return new Text$1(text, sourceSpan);\n            }\n            // Return a sequence of `Text` and `Placeholder` nodes grouped in a `Container`.\n            var nodes = [];\n            for (var i = 0; i < strings.length - 1; i++) {\n                this._addText(nodes, strings[i], sourceSpan);\n                this._addPlaceholder(nodes, context, expressions[i], sourceSpan);\n            }\n            // The last index contains no expression\n            this._addText(nodes, strings[strings.length - 1], sourceSpan);\n            // Whitespace removal may have invalidated the interpolation source-spans.\n            reusePreviousSourceSpans(nodes, previousI18n);\n            return new Container(nodes, sourceSpan);\n        };\n        /**\n         * Create a new `Text` node from the `textPiece` and add it to the `nodes` collection.\n         *\n         * @param nodes The nodes to which the created `Text` node should be added.\n         * @param textPiece The text and relative span information for this `Text` node.\n         * @param interpolationSpan The span of the whole interpolated text.\n         */\n        _I18nVisitor.prototype._addText = function (nodes, textPiece, interpolationSpan) {\n            if (textPiece.text.length > 0) {\n                // No need to add empty strings\n                var stringSpan = getOffsetSourceSpan(interpolationSpan, textPiece);\n                nodes.push(new Text$1(textPiece.text, stringSpan));\n            }\n        };\n        /**\n         * Create a new `Placeholder` node from the `expression` and add it to the `nodes` collection.\n         *\n         * @param nodes The nodes to which the created `Text` node should be added.\n         * @param context The current context of the visitor, used to compute and store placeholders.\n         * @param expression The expression text and relative span information for this `Placeholder`\n         *     node.\n         * @param interpolationSpan The span of the whole interpolated text.\n         */\n        _I18nVisitor.prototype._addPlaceholder = function (nodes, context, expression, interpolationSpan) {\n            var sourceSpan = getOffsetSourceSpan(interpolationSpan, expression);\n            var baseName = extractPlaceholderName(expression.text) || 'INTERPOLATION';\n            var phName = context.placeholderRegistry.getPlaceholderName(baseName, expression.text);\n            var text = this._interpolationConfig.start + expression.text + this._interpolationConfig.end;\n            context.placeholderToContent[phName] = { text: text, sourceSpan: sourceSpan };\n            nodes.push(new Placeholder(expression.text, phName, sourceSpan));\n        };\n        return _I18nVisitor;\n    }());\n    /**\n     * Re-use the source-spans from `previousI18n` metadata for the `nodes`.\n     *\n     * Whitespace removal can invalidate the source-spans of interpolation nodes, so we\n     * reuse the source-span stored from a previous pass before the whitespace was removed.\n     *\n     * @param nodes The `Text` and `Placeholder` nodes to be processed.\n     * @param previousI18n Any i18n metadata for these `nodes` stored from a previous pass.\n     */\n    function reusePreviousSourceSpans(nodes, previousI18n) {\n        if (previousI18n instanceof Message) {\n            // The `previousI18n` is an i18n `Message`, so we are processing an `Attribute` with i18n\n            // metadata. The `Message` should consist only of a single `Container` that contains the\n            // parts (`Text` and `Placeholder`) to process.\n            assertSingleContainerMessage(previousI18n);\n            previousI18n = previousI18n.nodes[0];\n        }\n        if (previousI18n instanceof Container) {\n            // The `previousI18n` is a `Container`, which means that this is a second i18n extraction pass\n            // after whitespace has been removed from the AST ndoes.\n            assertEquivalentNodes(previousI18n.children, nodes);\n            // Reuse the source-spans from the first pass.\n            for (var i = 0; i < nodes.length; i++) {\n                nodes[i].sourceSpan = previousI18n.children[i].sourceSpan;\n            }\n        }\n    }\n    /**\n     * Asserts that the `message` contains exactly one `Container` node.\n     */\n    function assertSingleContainerMessage(message) {\n        var nodes = message.nodes;\n        if (nodes.length !== 1 || !(nodes[0] instanceof Container)) {\n            throw new Error('Unexpected previous i18n message - expected it to consist of only a single `Container` node.');\n        }\n    }\n    /**\n     * Asserts that the `previousNodes` and `node` collections have the same number of elements and\n     * corresponding elements have the same node type.\n     */\n    function assertEquivalentNodes(previousNodes, nodes) {\n        if (previousNodes.length !== nodes.length) {\n            throw new Error('The number of i18n message children changed between first and second pass.');\n        }\n        if (previousNodes.some(function (node, i) { return nodes[i].constructor !== node.constructor; })) {\n            throw new Error('The types of the i18n message children changed between first and second pass.');\n        }\n    }\n    /**\n     * Create a new `ParseSourceSpan` from the `sourceSpan`, offset by the `start` and `end` values.\n     */\n    function getOffsetSourceSpan(sourceSpan, _b) {\n        var start = _b.start, end = _b.end;\n        return new ParseSourceSpan(sourceSpan.fullStart.moveBy(start), sourceSpan.fullStart.moveBy(end));\n    }\n    var _CUSTOM_PH_EXP = /\\/\\/[\\s\\S]*i18n[\\s\\S]*\\([\\s\\S]*ph[\\s\\S]*=[\\s\\S]*(\"|')([\\s\\S]*?)\\1[\\s\\S]*\\)/g;\n    function extractPlaceholderName(input) {\n        return input.split(_CUSTOM_PH_EXP)[2];\n    }\n\n    /**\n     * An i18n error.\n     */\n    var I18nError = /** @class */ (function (_super) {\n        __extends(I18nError, _super);\n        function I18nError(span, msg) {\n            return _super.call(this, span, msg) || this;\n        }\n        return I18nError;\n    }(ParseError));\n\n    var setI18nRefs = function (htmlNode, i18nNode) {\n        if (htmlNode instanceof NodeWithI18n) {\n            if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {\n                // This html node represents an ICU but this is a second processing pass, and the legacy id\n                // was computed in the previous pass and stored in the `i18n` property as a message.\n                // We are about to wipe out that property so capture the previous message to be reused when\n                // generating the message for this ICU later. See `_generateI18nMessage()`.\n                i18nNode.previousMessage = htmlNode.i18n;\n            }\n            htmlNode.i18n = i18nNode;\n        }\n        return i18nNode;\n    };\n    /**\n     * This visitor walks over HTML parse tree and converts information stored in\n     * i18n-related attributes (\"i18n\" and \"i18n-*\") into i18n meta object that is\n     * stored with other element's and attribute's information.\n     */\n    var I18nMetaVisitor = /** @class */ (function () {\n        function I18nMetaVisitor(interpolationConfig, keepI18nAttrs, enableI18nLegacyMessageIdFormat) {\n            if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n            if (keepI18nAttrs === void 0) { keepI18nAttrs = false; }\n            if (enableI18nLegacyMessageIdFormat === void 0) { enableI18nLegacyMessageIdFormat = false; }\n            this.interpolationConfig = interpolationConfig;\n            this.keepI18nAttrs = keepI18nAttrs;\n            this.enableI18nLegacyMessageIdFormat = enableI18nLegacyMessageIdFormat;\n            // whether visited nodes contain i18n information\n            this.hasI18nMeta = false;\n            this._errors = [];\n            // i18n message generation factory\n            this._createI18nMessage = createI18nMessageFactory(this.interpolationConfig);\n        }\n        I18nMetaVisitor.prototype._generateI18nMessage = function (nodes, meta, visitNodeFn) {\n            if (meta === void 0) { meta = ''; }\n            var _a = this._parseMetadata(meta), meaning = _a.meaning, description = _a.description, customId = _a.customId;\n            var message = this._createI18nMessage(nodes, meaning, description, customId, visitNodeFn);\n            this._setMessageId(message, meta);\n            this._setLegacyIds(message, meta);\n            return message;\n        };\n        I18nMetaVisitor.prototype.visitAllWithErrors = function (nodes) {\n            var _this = this;\n            var result = nodes.map(function (node) { return node.visit(_this, null); });\n            return new ParseTreeResult(result, this._errors);\n        };\n        I18nMetaVisitor.prototype.visitElement = function (element) {\n            var e_1, _a, e_2, _b;\n            if (hasI18nAttrs(element)) {\n                this.hasI18nMeta = true;\n                var attrs = [];\n                var attrsMeta = {};\n                try {\n                    for (var _c = __values(element.attrs), _d = _c.next(); !_d.done; _d = _c.next()) {\n                        var attr = _d.value;\n                        if (attr.name === I18N_ATTR) {\n                            // root 'i18n' node attribute\n                            var i18n_1 = element.i18n || attr.value;\n                            var message = this._generateI18nMessage(element.children, i18n_1, setI18nRefs);\n                            // do not assign empty i18n meta\n                            if (message.nodes.length) {\n                                element.i18n = message;\n                            }\n                        }\n                        else if (attr.name.startsWith(I18N_ATTR_PREFIX)) {\n                            // 'i18n-*' attributes\n                            var name = attr.name.slice(I18N_ATTR_PREFIX.length);\n                            if (isTrustedTypesSink(element.name, name)) {\n                                this._reportError(attr, \"Translating attribute '\" + name + \"' is disallowed for security reasons.\");\n                            }\n                            else {\n                                attrsMeta[name] = attr.value;\n                            }\n                        }\n                        else {\n                            // non-i18n attributes\n                            attrs.push(attr);\n                        }\n                    }\n                }\n                catch (e_1_1) { e_1 = { error: e_1_1 }; }\n                finally {\n                    try {\n                        if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n                    }\n                    finally { if (e_1) throw e_1.error; }\n                }\n                // set i18n meta for attributes\n                if (Object.keys(attrsMeta).length) {\n                    try {\n                        for (var attrs_1 = __values(attrs), attrs_1_1 = attrs_1.next(); !attrs_1_1.done; attrs_1_1 = attrs_1.next()) {\n                            var attr = attrs_1_1.value;\n                            var meta = attrsMeta[attr.name];\n                            // do not create translation for empty attributes\n                            if (meta !== undefined && attr.value) {\n                                attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta);\n                            }\n                        }\n                    }\n                    catch (e_2_1) { e_2 = { error: e_2_1 }; }\n                    finally {\n                        try {\n                            if (attrs_1_1 && !attrs_1_1.done && (_b = attrs_1.return)) _b.call(attrs_1);\n                        }\n                        finally { if (e_2) throw e_2.error; }\n                    }\n                }\n                if (!this.keepI18nAttrs) {\n                    // update element's attributes,\n                    // keeping only non-i18n related ones\n                    element.attrs = attrs;\n                }\n            }\n            visitAll$1(this, element.children, element.i18n);\n            return element;\n        };\n        I18nMetaVisitor.prototype.visitExpansion = function (expansion, currentMessage) {\n            var message;\n            var meta = expansion.i18n;\n            this.hasI18nMeta = true;\n            if (meta instanceof IcuPlaceholder) {\n                // set ICU placeholder name (e.g. \"ICU_1\"),\n                // generated while processing root element contents,\n                // so we can reference it when we output translation\n                var name = meta.name;\n                message = this._generateI18nMessage([expansion], meta);\n                var icu = icuFromI18nMessage(message);\n                icu.name = name;\n            }\n            else {\n                // ICU is a top level message, try to use metadata from container element if provided via\n                // `context` argument. Note: context may not be available for standalone ICUs (without\n                // wrapping element), so fallback to ICU metadata in this case.\n                message = this._generateI18nMessage([expansion], currentMessage || meta);\n            }\n            expansion.i18n = message;\n            return expansion;\n        };\n        I18nMetaVisitor.prototype.visitText = function (text) {\n            return text;\n        };\n        I18nMetaVisitor.prototype.visitAttribute = function (attribute) {\n            return attribute;\n        };\n        I18nMetaVisitor.prototype.visitComment = function (comment) {\n            return comment;\n        };\n        I18nMetaVisitor.prototype.visitExpansionCase = function (expansionCase) {\n            return expansionCase;\n        };\n        /**\n         * Parse the general form `meta` passed into extract the explicit metadata needed to create a\n         * `Message`.\n         *\n         * There are three possibilities for the `meta` variable\n         * 1) a string from an `i18n` template attribute: parse it to extract the metadata values.\n         * 2) a `Message` from a previous processing pass: reuse the metadata values in the message.\n         * 4) other: ignore this and just process the message metadata as normal\n         *\n         * @param meta the bucket that holds information about the message\n         * @returns the parsed metadata.\n         */\n        I18nMetaVisitor.prototype._parseMetadata = function (meta) {\n            return typeof meta === 'string' ? parseI18nMeta(meta) :\n                meta instanceof Message ? meta : {};\n        };\n        /**\n         * Generate (or restore) message id if not specified already.\n         */\n        I18nMetaVisitor.prototype._setMessageId = function (message, meta) {\n            if (!message.id) {\n                message.id = meta instanceof Message && meta.id || decimalDigest(message);\n            }\n        };\n        /**\n         * Update the `message` with a `legacyId` if necessary.\n         *\n         * @param message the message whose legacy id should be set\n         * @param meta information about the message being processed\n         */\n        I18nMetaVisitor.prototype._setLegacyIds = function (message, meta) {\n            if (this.enableI18nLegacyMessageIdFormat) {\n                message.legacyIds = [computeDigest(message), computeDecimalDigest(message)];\n            }\n            else if (typeof meta !== 'string') {\n                // This occurs if we are doing the 2nd pass after whitespace removal (see `parseTemplate()` in\n                // `packages/compiler/src/render3/view/template.ts`).\n                // In that case we want to reuse the legacy message generated in the 1st pass (see\n                // `setI18nRefs()`).\n                var previousMessage = meta instanceof Message ?\n                    meta :\n                    meta instanceof IcuPlaceholder ? meta.previousMessage : undefined;\n                message.legacyIds = previousMessage ? previousMessage.legacyIds : [];\n            }\n        };\n        I18nMetaVisitor.prototype._reportError = function (node, msg) {\n            this._errors.push(new I18nError(node.sourceSpan, msg));\n        };\n        return I18nMetaVisitor;\n    }());\n    /** I18n separators for metadata **/\n    var I18N_MEANING_SEPARATOR = '|';\n    var I18N_ID_SEPARATOR = '@@';\n    /**\n     * Parses i18n metas like:\n     *  - \"@@id\",\n     *  - \"description[@@id]\",\n     *  - \"meaning|description[@@id]\"\n     * and returns an object with parsed output.\n     *\n     * @param meta String that represents i18n meta\n     * @returns Object with id, meaning and description fields\n     */\n    function parseI18nMeta(meta) {\n        var _a, _b;\n        if (meta === void 0) { meta = ''; }\n        var customId;\n        var meaning;\n        var description;\n        meta = meta.trim();\n        if (meta) {\n            var idIndex = meta.indexOf(I18N_ID_SEPARATOR);\n            var descIndex = meta.indexOf(I18N_MEANING_SEPARATOR);\n            var meaningAndDesc = void 0;\n            _a = __read((idIndex > -1) ? [meta.slice(0, idIndex), meta.slice(idIndex + 2)] : [meta, ''], 2), meaningAndDesc = _a[0], customId = _a[1];\n            _b = __read((descIndex > -1) ?\n                [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :\n                ['', meaningAndDesc], 2), meaning = _b[0], description = _b[1];\n        }\n        return { customId: customId, meaning: meaning, description: description };\n    }\n    // Converts i18n meta information for a message (id, description, meaning)\n    // to a JsDoc statement formatted as expected by the Closure compiler.\n    function i18nMetaToJSDoc(meta) {\n        var tags = [];\n        if (meta.description) {\n            tags.push({ tagName: \"desc\" /* Desc */, text: meta.description });\n        }\n        if (meta.meaning) {\n            tags.push({ tagName: \"meaning\" /* Meaning */, text: meta.meaning });\n        }\n        return tags.length == 0 ? null : jsDocComment(tags);\n    }\n\n    /** Closure uses `goog.getMsg(message)` to lookup translations */\n    var GOOG_GET_MSG = 'goog.getMsg';\n    function createGoogleGetMsgStatements(variable$1, message, closureVar, params) {\n        var messageString = serializeI18nMessageForGetMsg(message);\n        var args = [literal(messageString)];\n        if (Object.keys(params).length) {\n            args.push(mapLiteral(params, true));\n        }\n        // /**\n        //  * @desc description of message\n        //  * @meaning meaning of message\n        //  */\n        // const MSG_... = goog.getMsg(..);\n        // I18N_X = MSG_...;\n        var googGetMsgStmt = closureVar.set(variable(GOOG_GET_MSG).callFn(args)).toConstDecl();\n        var metaComment = i18nMetaToJSDoc(message);\n        if (metaComment !== null) {\n            googGetMsgStmt.addLeadingComment(metaComment);\n        }\n        var i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar));\n        return [googGetMsgStmt, i18nAssignmentStmt];\n    }\n    /**\n     * This visitor walks over i18n tree and generates its string representation, including ICUs and\n     * placeholders in `{$placeholder}` (for plain messages) or `{PLACEHOLDER}` (inside ICUs) format.\n     */\n    var GetMsgSerializerVisitor = /** @class */ (function () {\n        function GetMsgSerializerVisitor() {\n        }\n        GetMsgSerializerVisitor.prototype.formatPh = function (value) {\n            return \"{$\" + formatI18nPlaceholderName(value) + \"}\";\n        };\n        GetMsgSerializerVisitor.prototype.visitText = function (text) {\n            return text.value;\n        };\n        GetMsgSerializerVisitor.prototype.visitContainer = function (container) {\n            var _this = this;\n            return container.children.map(function (child) { return child.visit(_this); }).join('');\n        };\n        GetMsgSerializerVisitor.prototype.visitIcu = function (icu) {\n            return serializeIcuNode(icu);\n        };\n        GetMsgSerializerVisitor.prototype.visitTagPlaceholder = function (ph) {\n            var _this = this;\n            return ph.isVoid ?\n                this.formatPh(ph.startName) :\n                \"\" + this.formatPh(ph.startName) + ph.children.map(function (child) { return child.visit(_this); }).join('') + this.formatPh(ph.closeName);\n        };\n        GetMsgSerializerVisitor.prototype.visitPlaceholder = function (ph) {\n            return this.formatPh(ph.name);\n        };\n        GetMsgSerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            return this.formatPh(ph.name);\n        };\n        return GetMsgSerializerVisitor;\n    }());\n    var serializerVisitor$1 = new GetMsgSerializerVisitor();\n    function serializeI18nMessageForGetMsg(message) {\n        return message.nodes.map(function (node) { return node.visit(serializerVisitor$1, null); }).join('');\n    }\n\n    function createLocalizeStatements(variable, message, params) {\n        var _c = serializeI18nMessageForLocalize(message), messageParts = _c.messageParts, placeHolders = _c.placeHolders;\n        var sourceSpan = getSourceSpan(message);\n        var expressions = placeHolders.map(function (ph) { return params[ph.text]; });\n        var localizedString$1 = localizedString(message, messageParts, placeHolders, expressions, sourceSpan);\n        var variableInitialization = variable.set(localizedString$1);\n        return [new ExpressionStatement(variableInitialization)];\n    }\n    /**\n     * This visitor walks over an i18n tree, capturing literal strings and placeholders.\n     *\n     * The result can be used for generating the `$localize` tagged template literals.\n     */\n    var LocalizeSerializerVisitor = /** @class */ (function () {\n        function LocalizeSerializerVisitor() {\n        }\n        LocalizeSerializerVisitor.prototype.visitText = function (text, context) {\n            if (context[context.length - 1] instanceof LiteralPiece) {\n                // Two literal pieces in a row means that there was some comment node in-between.\n                context[context.length - 1].text += text.value;\n            }\n            else {\n                context.push(new LiteralPiece(text.value, text.sourceSpan));\n            }\n        };\n        LocalizeSerializerVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            container.children.forEach(function (child) { return child.visit(_this, context); });\n        };\n        LocalizeSerializerVisitor.prototype.visitIcu = function (icu, context) {\n            context.push(new LiteralPiece(serializeIcuNode(icu), icu.sourceSpan));\n        };\n        LocalizeSerializerVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var _this = this;\n            var _a, _b;\n            context.push(this.createPlaceholderPiece(ph.startName, (_a = ph.startSourceSpan) !== null && _a !== void 0 ? _a : ph.sourceSpan));\n            if (!ph.isVoid) {\n                ph.children.forEach(function (child) { return child.visit(_this, context); });\n                context.push(this.createPlaceholderPiece(ph.closeName, (_b = ph.endSourceSpan) !== null && _b !== void 0 ? _b : ph.sourceSpan));\n            }\n        };\n        LocalizeSerializerVisitor.prototype.visitPlaceholder = function (ph, context) {\n            context.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan));\n        };\n        LocalizeSerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            context.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan));\n        };\n        LocalizeSerializerVisitor.prototype.createPlaceholderPiece = function (name, sourceSpan) {\n            return new PlaceholderPiece(formatI18nPlaceholderName(name, /* useCamelCase */ false), sourceSpan);\n        };\n        return LocalizeSerializerVisitor;\n    }());\n    var serializerVisitor$2 = new LocalizeSerializerVisitor();\n    /**\n     * Serialize an i18n message into two arrays: messageParts and placeholders.\n     *\n     * These arrays will be used to generate `$localize` tagged template literals.\n     *\n     * @param message The message to be serialized.\n     * @returns an object containing the messageParts and placeholders.\n     */\n    function serializeI18nMessageForLocalize(message) {\n        var pieces = [];\n        message.nodes.forEach(function (node) { return node.visit(serializerVisitor$2, pieces); });\n        return processMessagePieces(pieces);\n    }\n    function getSourceSpan(message) {\n        var startNode = message.nodes[0];\n        var endNode = message.nodes[message.nodes.length - 1];\n        return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details);\n    }\n    /**\n     * Convert the list of serialized MessagePieces into two arrays.\n     *\n     * One contains the literal string pieces and the other the placeholders that will be replaced by\n     * expressions when rendering `$localize` tagged template literals.\n     *\n     * @param pieces The pieces to process.\n     * @returns an object containing the messageParts and placeholders.\n     */\n    function processMessagePieces(pieces) {\n        var messageParts = [];\n        var placeHolders = [];\n        if (pieces[0] instanceof PlaceholderPiece) {\n            // The first piece was a placeholder so we need to add an initial empty message part.\n            messageParts.push(createEmptyMessagePart(pieces[0].sourceSpan.start));\n        }\n        for (var i = 0; i < pieces.length; i++) {\n            var part = pieces[i];\n            if (part instanceof LiteralPiece) {\n                messageParts.push(part);\n            }\n            else {\n                placeHolders.push(part);\n                if (pieces[i - 1] instanceof PlaceholderPiece) {\n                    // There were two placeholders in a row, so we need to add an empty message part.\n                    messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));\n                }\n            }\n        }\n        if (pieces[pieces.length - 1] instanceof PlaceholderPiece) {\n            // The last piece was a placeholder so we need to add a final empty message part.\n            messageParts.push(createEmptyMessagePart(pieces[pieces.length - 1].sourceSpan.end));\n        }\n        return { messageParts: messageParts, placeHolders: placeHolders };\n    }\n    function createEmptyMessagePart(location) {\n        return new LiteralPiece('', new ParseSourceSpan(location, location));\n    }\n\n    // Selector attribute name of `<ng-content>`\n    var NG_CONTENT_SELECT_ATTR$1 = 'select';\n    // Attribute name of `ngProjectAs`.\n    var NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';\n    // Global symbols available only inside event bindings.\n    var EVENT_BINDING_SCOPE_GLOBALS = new Set(['$event']);\n    // List of supported global targets for event listeners\n    var GLOBAL_TARGET_RESOLVERS = new Map([['window', Identifiers.resolveWindow], ['document', Identifiers.resolveDocument], ['body', Identifiers.resolveBody]]);\n    var LEADING_TRIVIA_CHARS = [' ', '\\n', '\\r', '\\t'];\n    //  if (rf & flags) { .. }\n    function renderFlagCheckIfStmt(flags, statements) {\n        return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements);\n    }\n    function prepareEventListenerParameters(eventAst, handlerName, scope) {\n        if (handlerName === void 0) { handlerName = null; }\n        if (scope === void 0) { scope = null; }\n        var type = eventAst.type, name = eventAst.name, target = eventAst.target, phase = eventAst.phase, handler = eventAst.handler;\n        if (target && !GLOBAL_TARGET_RESOLVERS.has(target)) {\n            throw new Error(\"Unexpected global target '\" + target + \"' defined for '\" + name + \"' event.\\n        Supported list of global targets: \" + Array.from(GLOBAL_TARGET_RESOLVERS.keys()) + \".\");\n        }\n        var eventArgumentName = '$event';\n        var implicitReceiverAccesses = new Set();\n        var implicitReceiverExpr = (scope === null || scope.bindingLevel === 0) ?\n            variable(CONTEXT_NAME) :\n            scope.getOrCreateSharedContextVar(0);\n        var bindingExpr = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', function () { return error('Unexpected interpolation'); }, eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);\n        var statements = [];\n        if (scope) {\n            // `variableDeclarations` needs to run first, because\n            // `restoreViewStatement` depends on the result.\n            statements.push.apply(statements, __spreadArray([], __read(scope.variableDeclarations())));\n            statements.unshift.apply(statements, __spreadArray([], __read(scope.restoreViewStatement())));\n        }\n        statements.push.apply(statements, __spreadArray([], __read(bindingExpr.render3Stmts)));\n        var eventName = type === 1 /* Animation */ ? prepareSyntheticListenerName(name, phase) : name;\n        var fnName = handlerName && sanitizeIdentifier(handlerName);\n        var fnArgs = [];\n        if (implicitReceiverAccesses.has(eventArgumentName)) {\n            fnArgs.push(new FnParam(eventArgumentName, DYNAMIC_TYPE));\n        }\n        var handlerFn = fn(fnArgs, statements, INFERRED_TYPE, null, fnName);\n        var params = [literal(eventName), handlerFn];\n        if (target) {\n            params.push(literal(false), // `useCapture` flag, defaults to `false`\n            importExpr(GLOBAL_TARGET_RESOLVERS.get(target)));\n        }\n        return params;\n    }\n    function createComponentDefConsts() {\n        return {\n            prepareStatements: [],\n            constExpressions: [],\n            i18nVarRefsCache: new Map(),\n        };\n    }\n    var TemplateDefinitionBuilder = /** @class */ (function () {\n        function TemplateDefinitionBuilder(constantPool, parentBindingScope, level, contextName, i18nContext, templateIndex, templateName, directiveMatcher, directives, pipeTypeByName, pipes, _namespace, relativeContextFilePath, i18nUseExternalIds, _constants) {\n            var _this = this;\n            if (level === void 0) { level = 0; }\n            if (_constants === void 0) { _constants = createComponentDefConsts(); }\n            this.constantPool = constantPool;\n            this.level = level;\n            this.contextName = contextName;\n            this.i18nContext = i18nContext;\n            this.templateIndex = templateIndex;\n            this.templateName = templateName;\n            this.directiveMatcher = directiveMatcher;\n            this.directives = directives;\n            this.pipeTypeByName = pipeTypeByName;\n            this.pipes = pipes;\n            this._namespace = _namespace;\n            this.i18nUseExternalIds = i18nUseExternalIds;\n            this._constants = _constants;\n            this._dataIndex = 0;\n            this._bindingContext = 0;\n            this._prefixCode = [];\n            /**\n             * List of callbacks to generate creation mode instructions. We store them here as we process\n             * the template so bindings in listeners are resolved only once all nodes have been visited.\n             * This ensures all local refs and context variables are available for matching.\n             */\n            this._creationCodeFns = [];\n            /**\n             * List of callbacks to generate update mode instructions. We store them here as we process\n             * the template so bindings are resolved only once all nodes have been visited. This ensures\n             * all local refs and context variables are available for matching.\n             */\n            this._updateCodeFns = [];\n            /** Index of the currently-selected node. */\n            this._currentIndex = 0;\n            /** Temporary variable declarations generated from visiting pipes, literals, etc. */\n            this._tempVariables = [];\n            /**\n             * List of callbacks to build nested templates. Nested templates must not be visited until\n             * after the parent template has finished visiting all of its nodes. This ensures that all\n             * local ref bindings in nested templates are able to find local ref values if the refs\n             * are defined after the template declaration.\n             */\n            this._nestedTemplateFns = [];\n            this._unsupported = unsupported;\n            // i18n context local to this template\n            this.i18n = null;\n            // Number of slots to reserve for pureFunctions\n            this._pureFunctionSlots = 0;\n            // Number of binding slots\n            this._bindingSlots = 0;\n            // Projection slots found in the template. Projection slots can distribute projected\n            // nodes based on a selector, or can just use the wildcard selector to match\n            // all nodes which aren't matching any selector.\n            this._ngContentReservedSlots = [];\n            // Number of non-default selectors found in all parent templates of this template. We need to\n            // track it to properly adjust projection slot index in the `projection` instruction.\n            this._ngContentSelectorsOffset = 0;\n            // Expression that should be used as implicit receiver when converting template\n            // expressions to output AST.\n            this._implicitReceiverExpr = null;\n            // These should be handled in the template or element directly.\n            this.visitReference = invalid$1;\n            this.visitVariable = invalid$1;\n            this.visitTextAttribute = invalid$1;\n            this.visitBoundAttribute = invalid$1;\n            this.visitBoundEvent = invalid$1;\n            this._bindingScope = parentBindingScope.nestedScope(level);\n            // Turn the relative context file path into an identifier by replacing non-alphanumeric\n            // characters with underscores.\n            this.fileBasedI18nSuffix = relativeContextFilePath.replace(/[^A-Za-z0-9]/g, '_') + '_';\n            this._valueConverter = new ValueConverter(constantPool, function () { return _this.allocateDataSlot(); }, function (numSlots) { return _this.allocatePureFunctionSlots(numSlots); }, function (name, localName, slot, value) {\n                var pipeType = pipeTypeByName.get(name);\n                if (pipeType) {\n                    _this.pipes.add(pipeType);\n                }\n                _this._bindingScope.set(_this.level, localName, value);\n                _this.creationInstruction(null, Identifiers.pipe, [literal(slot), literal(name)]);\n            });\n        }\n        TemplateDefinitionBuilder.prototype.buildTemplateFunction = function (nodes, variables, ngContentSelectorsOffset, i18n) {\n            var _this = this;\n            if (ngContentSelectorsOffset === void 0) { ngContentSelectorsOffset = 0; }\n            this._ngContentSelectorsOffset = ngContentSelectorsOffset;\n            if (this._namespace !== Identifiers.namespaceHTML) {\n                this.creationInstruction(null, this._namespace);\n            }\n            // Create variable bindings\n            variables.forEach(function (v) { return _this.registerContextVariables(v); });\n            // Initiate i18n context in case:\n            // - this template has parent i18n context\n            // - or the template has i18n meta associated with it,\n            //   but it's not initiated by the Element (e.g. <ng-template i18n>)\n            var initI18nContext = this.i18nContext ||\n                (isI18nRootNode(i18n) && !isSingleI18nIcu(i18n) &&\n                    !(isSingleElementTemplate(nodes) && nodes[0].i18n === i18n));\n            var selfClosingI18nInstruction = hasTextChildrenOnly(nodes);\n            if (initI18nContext) {\n                this.i18nStart(null, i18n, selfClosingI18nInstruction);\n            }\n            // This is the initial pass through the nodes of this template. In this pass, we\n            // queue all creation mode and update mode instructions for generation in the second\n            // pass. It's necessary to separate the passes to ensure local refs are defined before\n            // resolving bindings. We also count bindings in this pass as we walk bound expressions.\n            visitAll(this, nodes);\n            // Add total binding count to pure function count so pure function instructions are\n            // generated with the correct slot offset when update instructions are processed.\n            this._pureFunctionSlots += this._bindingSlots;\n            // Pipes are walked in the first pass (to enqueue `pipe()` creation instructions and\n            // `pipeBind` update instructions), so we have to update the slot offsets manually\n            // to account for bindings.\n            this._valueConverter.updatePipeSlotOffsets(this._bindingSlots);\n            // Nested templates must be processed before creation instructions so template()\n            // instructions can be generated with the correct internal const count.\n            this._nestedTemplateFns.forEach(function (buildTemplateFn) { return buildTemplateFn(); });\n            // Output the `projectionDef` instruction when some `<ng-content>` tags are present.\n            // The `projectionDef` instruction is only emitted for the component template and\n            // is skipped for nested templates (<ng-template> tags).\n            if (this.level === 0 && this._ngContentReservedSlots.length) {\n                var parameters = [];\n                // By default the `projectionDef` instructions creates one slot for the wildcard\n                // selector if no parameters are passed. Therefore we only want to allocate a new\n                // array for the projection slots if the default projection slot is not sufficient.\n                if (this._ngContentReservedSlots.length > 1 || this._ngContentReservedSlots[0] !== '*') {\n                    var r3ReservedSlots = this._ngContentReservedSlots.map(function (s) { return s !== '*' ? parseSelectorToR3Selector(s) : s; });\n                    parameters.push(this.constantPool.getConstLiteral(asLiteral(r3ReservedSlots), true));\n                }\n                // Since we accumulate ngContent selectors while processing template elements,\n                // we *prepend* `projectionDef` to creation instructions block, to put it before\n                // any `projection` instructions\n                this.creationInstruction(null, Identifiers.projectionDef, parameters, /* prepend */ true);\n            }\n            if (initI18nContext) {\n                this.i18nEnd(null, selfClosingI18nInstruction);\n            }\n            // Generate all the creation mode instructions (e.g. resolve bindings in listeners)\n            var creationStatements = this._creationCodeFns.map(function (fn) { return fn(); });\n            // Generate all the update mode instructions (e.g. resolve property or text bindings)\n            var updateStatements = this._updateCodeFns.map(function (fn) { return fn(); });\n            //  Variable declaration must occur after binding resolution so we can generate context\n            //  instructions that build on each other.\n            // e.g. const b = nextContext().$implicit(); const b = nextContext();\n            var creationVariables = this._bindingScope.viewSnapshotStatements();\n            var updateVariables = this._bindingScope.variableDeclarations().concat(this._tempVariables);\n            var creationBlock = creationStatements.length > 0 ?\n                [renderFlagCheckIfStmt(1 /* Create */, creationVariables.concat(creationStatements))] :\n                [];\n            var updateBlock = updateStatements.length > 0 ?\n                [renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(updateStatements))] :\n                [];\n            return fn(\n            // i.e. (rf: RenderFlags, ctx: any)\n            [new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], __spreadArray(__spreadArray(__spreadArray([], __read(this._prefixCode)), __read(creationBlock)), __read(updateBlock)), INFERRED_TYPE, null, this.templateName);\n        };\n        // LocalResolver\n        TemplateDefinitionBuilder.prototype.getLocal = function (name) {\n            return this._bindingScope.get(name);\n        };\n        // LocalResolver\n        TemplateDefinitionBuilder.prototype.notifyImplicitReceiverUse = function () {\n            this._bindingScope.notifyImplicitReceiverUse();\n        };\n        // LocalResolver\n        TemplateDefinitionBuilder.prototype.maybeRestoreView = function () {\n            this._bindingScope.maybeRestoreView();\n        };\n        TemplateDefinitionBuilder.prototype.i18nTranslate = function (message, params, ref, transformFn) {\n            var _c;\n            if (params === void 0) { params = {}; }\n            var _ref = ref || this.i18nGenerateMainBlockVar();\n            // Closure Compiler requires const names to start with `MSG_` but disallows any other const to\n            // start with `MSG_`. We define a variable starting with `MSG_` just for the `goog.getMsg` call\n            var closureVar = this.i18nGenerateClosureVar(message.id);\n            var statements = getTranslationDeclStmts(message, _ref, closureVar, params, transformFn);\n            (_c = this._constants.prepareStatements).push.apply(_c, __spreadArray([], __read(statements)));\n            return _ref;\n        };\n        TemplateDefinitionBuilder.prototype.registerContextVariables = function (variable$1) {\n            var scopedName = this._bindingScope.freshReferenceName();\n            var retrievalLevel = this.level;\n            var lhs = variable(variable$1.name + scopedName);\n            this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* CONTEXT */, function (scope, relativeLevel) {\n                var rhs;\n                if (scope.bindingLevel === retrievalLevel) {\n                    if (scope.isListenerScope() && scope.hasRestoreViewVariable()) {\n                        // e.g. restoredCtx.\n                        // We have to get the context from a view reference, if one is available, because\n                        // the context that was passed in during creation may not be correct anymore.\n                        // For more information see: https://github.com/angular/angular/pull/40360.\n                        rhs = variable(RESTORED_VIEW_CONTEXT_NAME);\n                        scope.notifyRestoredViewContextUse();\n                    }\n                    else {\n                        // e.g. ctx\n                        rhs = variable(CONTEXT_NAME);\n                    }\n                }\n                else {\n                    var sharedCtxVar = scope.getSharedContextName(retrievalLevel);\n                    // e.g. ctx_r0   OR  x(2);\n                    rhs = sharedCtxVar ? sharedCtxVar : generateNextContextExpr(relativeLevel);\n                }\n                // e.g. const $item$ = x(2).$implicit;\n                return [lhs.set(rhs.prop(variable$1.value || IMPLICIT_REFERENCE)).toConstDecl()];\n            });\n        };\n        TemplateDefinitionBuilder.prototype.i18nAppendBindings = function (expressions) {\n            var _this = this;\n            if (expressions.length > 0) {\n                expressions.forEach(function (expression) { return _this.i18n.appendBinding(expression); });\n            }\n        };\n        TemplateDefinitionBuilder.prototype.i18nBindProps = function (props) {\n            var _this = this;\n            var bound = {};\n            Object.keys(props).forEach(function (key) {\n                var prop = props[key];\n                if (prop instanceof Text) {\n                    bound[key] = literal(prop.value);\n                }\n                else {\n                    var value = prop.value.visit(_this._valueConverter);\n                    _this.allocateBindingSlots(value);\n                    if (value instanceof Interpolation) {\n                        var strings = value.strings, expressions = value.expressions;\n                        var _c = _this.i18n, id = _c.id, bindings = _c.bindings;\n                        var label = assembleI18nBoundString(strings, bindings.size, id);\n                        _this.i18nAppendBindings(expressions);\n                        bound[key] = literal(label);\n                    }\n                }\n            });\n            return bound;\n        };\n        // Generates top level vars for i18n blocks (i.e. `i18n_N`).\n        TemplateDefinitionBuilder.prototype.i18nGenerateMainBlockVar = function () {\n            return variable(this.constantPool.uniqueName(TRANSLATION_VAR_PREFIX));\n        };\n        // Generates vars with Closure-specific names for i18n blocks (i.e. `MSG_XXX`).\n        TemplateDefinitionBuilder.prototype.i18nGenerateClosureVar = function (messageId) {\n            var name;\n            var suffix = this.fileBasedI18nSuffix.toUpperCase();\n            if (this.i18nUseExternalIds) {\n                var prefix = getTranslationConstPrefix(\"EXTERNAL_\");\n                var uniqueSuffix = this.constantPool.uniqueName(suffix);\n                name = \"\" + prefix + sanitizeIdentifier(messageId) + \"$$\" + uniqueSuffix;\n            }\n            else {\n                var prefix = getTranslationConstPrefix(suffix);\n                name = this.constantPool.uniqueName(prefix);\n            }\n            return variable(name);\n        };\n        TemplateDefinitionBuilder.prototype.i18nUpdateRef = function (context) {\n            var icus = context.icus, meta = context.meta, isRoot = context.isRoot, isResolved = context.isResolved, isEmitted = context.isEmitted;\n            if (isRoot && isResolved && !isEmitted && !isSingleI18nIcu(meta)) {\n                context.isEmitted = true;\n                var placeholders = context.getSerializedPlaceholders();\n                var icuMapping_1 = {};\n                var params_1 = placeholders.size ? placeholdersToParams(placeholders) : {};\n                if (icus.size) {\n                    icus.forEach(function (refs, key) {\n                        if (refs.length === 1) {\n                            // if we have one ICU defined for a given\n                            // placeholder - just output its reference\n                            params_1[key] = refs[0];\n                        }\n                        else {\n                            // ... otherwise we need to activate post-processing\n                            // to replace ICU placeholders with proper values\n                            var placeholder = wrapI18nPlaceholder(\"\" + I18N_ICU_MAPPING_PREFIX + key);\n                            params_1[key] = literal(placeholder);\n                            icuMapping_1[key] = literalArr(refs);\n                        }\n                    });\n                }\n                // translation requires post processing in 2 cases:\n                // - if we have placeholders with multiple values (ex. `START_DIV`: [�#1�, �#2�, ...])\n                // - if we have multiple ICUs that refer to the same placeholder name\n                var needsPostprocessing = Array.from(placeholders.values()).some(function (value) { return value.length > 1; }) ||\n                    Object.keys(icuMapping_1).length;\n                var transformFn = void 0;\n                if (needsPostprocessing) {\n                    transformFn = function (raw) {\n                        var args = [raw];\n                        if (Object.keys(icuMapping_1).length) {\n                            args.push(mapLiteral(icuMapping_1, true));\n                        }\n                        return instruction(null, Identifiers.i18nPostprocess, args);\n                    };\n                }\n                this.i18nTranslate(meta, params_1, context.ref, transformFn);\n            }\n        };\n        TemplateDefinitionBuilder.prototype.i18nStart = function (span, meta, selfClosing) {\n            if (span === void 0) { span = null; }\n            var index = this.allocateDataSlot();\n            this.i18n = this.i18nContext ?\n                this.i18nContext.forkChildContext(index, this.templateIndex, meta) :\n                new I18nContext(index, this.i18nGenerateMainBlockVar(), 0, this.templateIndex, meta);\n            // generate i18nStart instruction\n            var _c = this.i18n, id = _c.id, ref = _c.ref;\n            var params = [literal(index), this.addToConsts(ref)];\n            if (id > 0) {\n                // do not push 3rd argument (sub-block id)\n                // into i18nStart call for top level i18n context\n                params.push(literal(id));\n            }\n            this.creationInstruction(span, selfClosing ? Identifiers.i18n : Identifiers.i18nStart, params);\n        };\n        TemplateDefinitionBuilder.prototype.i18nEnd = function (span, selfClosing) {\n            var _this = this;\n            if (span === void 0) { span = null; }\n            if (!this.i18n) {\n                throw new Error('i18nEnd is executed with no i18n context present');\n            }\n            if (this.i18nContext) {\n                this.i18nContext.reconcileChildContext(this.i18n);\n                this.i18nUpdateRef(this.i18nContext);\n            }\n            else {\n                this.i18nUpdateRef(this.i18n);\n            }\n            // setup accumulated bindings\n            var _c = this.i18n, index = _c.index, bindings = _c.bindings;\n            if (bindings.size) {\n                var chainBindings_1 = [];\n                bindings.forEach(function (binding) {\n                    chainBindings_1.push({ sourceSpan: span, value: function () { return _this.convertPropertyBinding(binding); } });\n                });\n                // for i18n block, advance to the most recent element index (by taking the current number of\n                // elements and subtracting one) before invoking `i18nExp` instructions, to make sure the\n                // necessary lifecycle hooks of components/directives are properly flushed.\n                this.updateInstructionChainWithAdvance(this.getConstCount() - 1, Identifiers.i18nExp, chainBindings_1);\n                this.updateInstruction(span, Identifiers.i18nApply, [literal(index)]);\n            }\n            if (!selfClosing) {\n                this.creationInstruction(span, Identifiers.i18nEnd);\n            }\n            this.i18n = null; // reset local i18n context\n        };\n        TemplateDefinitionBuilder.prototype.i18nAttributesInstruction = function (nodeIndex, attrs, sourceSpan) {\n            var _this = this;\n            var hasBindings = false;\n            var i18nAttrArgs = [];\n            var bindings = [];\n            attrs.forEach(function (attr) {\n                var message = attr.i18n;\n                var converted = attr.value.visit(_this._valueConverter);\n                _this.allocateBindingSlots(converted);\n                if (converted instanceof Interpolation) {\n                    var placeholders = assembleBoundTextPlaceholders(message);\n                    var params = placeholdersToParams(placeholders);\n                    i18nAttrArgs.push(literal(attr.name), _this.i18nTranslate(message, params));\n                    converted.expressions.forEach(function (expression) {\n                        hasBindings = true;\n                        bindings.push({\n                            sourceSpan: sourceSpan,\n                            value: function () { return _this.convertPropertyBinding(expression); },\n                        });\n                    });\n                }\n            });\n            if (bindings.length > 0) {\n                this.updateInstructionChainWithAdvance(nodeIndex, Identifiers.i18nExp, bindings);\n            }\n            if (i18nAttrArgs.length > 0) {\n                var index = literal(this.allocateDataSlot());\n                var constIndex = this.addToConsts(literalArr(i18nAttrArgs));\n                this.creationInstruction(sourceSpan, Identifiers.i18nAttributes, [index, constIndex]);\n                if (hasBindings) {\n                    this.updateInstruction(sourceSpan, Identifiers.i18nApply, [index]);\n                }\n            }\n        };\n        TemplateDefinitionBuilder.prototype.getNamespaceInstruction = function (namespaceKey) {\n            switch (namespaceKey) {\n                case 'math':\n                    return Identifiers.namespaceMathML;\n                case 'svg':\n                    return Identifiers.namespaceSVG;\n                default:\n                    return Identifiers.namespaceHTML;\n            }\n        };\n        TemplateDefinitionBuilder.prototype.addNamespaceInstruction = function (nsInstruction, element) {\n            this._namespace = nsInstruction;\n            this.creationInstruction(element.startSourceSpan, nsInstruction);\n        };\n        /**\n         * Adds an update instruction for an interpolated property or attribute, such as\n         * `prop=\"{{value}}\"` or `attr.title=\"{{value}}\"`\n         */\n        TemplateDefinitionBuilder.prototype.interpolatedUpdateInstruction = function (instruction, elementIndex, attrName, input, value, params) {\n            var _this = this;\n            this.updateInstructionWithAdvance(elementIndex, input.sourceSpan, instruction, function () { return __spreadArray(__spreadArray([literal(attrName)], __read(_this.getUpdateInstructionArguments(value))), __read(params)); });\n        };\n        TemplateDefinitionBuilder.prototype.visitContent = function (ngContent) {\n            var slot = this.allocateDataSlot();\n            var projectionSlotIdx = this._ngContentSelectorsOffset + this._ngContentReservedSlots.length;\n            var parameters = [literal(slot)];\n            this._ngContentReservedSlots.push(ngContent.selector);\n            var nonContentSelectAttributes = ngContent.attributes.filter(function (attr) { return attr.name.toLowerCase() !== NG_CONTENT_SELECT_ATTR$1; });\n            var attributes = this.getAttributeExpressions(ngContent.name, nonContentSelectAttributes, [], []);\n            if (attributes.length > 0) {\n                parameters.push(literal(projectionSlotIdx), literalArr(attributes));\n            }\n            else if (projectionSlotIdx !== 0) {\n                parameters.push(literal(projectionSlotIdx));\n            }\n            this.creationInstruction(ngContent.sourceSpan, Identifiers.projection, parameters);\n            if (this.i18n) {\n                this.i18n.appendProjection(ngContent.i18n, slot);\n            }\n        };\n        TemplateDefinitionBuilder.prototype.visitElement = function (element) {\n            var e_1, _c;\n            var _this = this;\n            var _a, _b;\n            var elementIndex = this.allocateDataSlot();\n            var stylingBuilder = new StylingBuilder(null);\n            var isNonBindableMode = false;\n            var isI18nRootElement = isI18nRootNode(element.i18n) && !isSingleI18nIcu(element.i18n);\n            var outputAttrs = [];\n            var _d = __read(splitNsName(element.name), 2), namespaceKey = _d[0], elementName = _d[1];\n            var isNgContainer$1 = isNgContainer(element.name);\n            try {\n                // Handle styling, i18n, ngNonBindable attributes\n                for (var _e = __values(element.attributes), _f = _e.next(); !_f.done; _f = _e.next()) {\n                    var attr = _f.value;\n                    var name = attr.name, value = attr.value;\n                    if (name === NON_BINDABLE_ATTR) {\n                        isNonBindableMode = true;\n                    }\n                    else if (name === 'style') {\n                        stylingBuilder.registerStyleAttr(value);\n                    }\n                    else if (name === 'class') {\n                        stylingBuilder.registerClassAttr(value);\n                    }\n                    else {\n                        outputAttrs.push(attr);\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            // Match directives on non i18n attributes\n            this.matchDirectives(element.name, element);\n            // Regular element or ng-container creation mode\n            var parameters = [literal(elementIndex)];\n            if (!isNgContainer$1) {\n                parameters.push(literal(elementName));\n            }\n            // Add the attributes\n            var allOtherInputs = [];\n            var boundI18nAttrs = [];\n            element.inputs.forEach(function (input) {\n                var stylingInputWasSet = stylingBuilder.registerBoundInput(input);\n                if (!stylingInputWasSet) {\n                    if (input.type === 0 /* Property */ && input.i18n) {\n                        boundI18nAttrs.push(input);\n                    }\n                    else {\n                        allOtherInputs.push(input);\n                    }\n                }\n            });\n            // add attributes for directive and projection matching purposes\n            var attributes = this.getAttributeExpressions(element.name, outputAttrs, allOtherInputs, element.outputs, stylingBuilder, [], boundI18nAttrs);\n            parameters.push(this.addAttrsToConsts(attributes));\n            // local refs (ex.: <div #foo #bar=\"baz\">)\n            var refs = this.prepareRefsArray(element.references);\n            parameters.push(this.addToConsts(refs));\n            var wasInNamespace = this._namespace;\n            var currentNamespace = this.getNamespaceInstruction(namespaceKey);\n            // If the namespace is changing now, include an instruction to change it\n            // during element creation.\n            if (currentNamespace !== wasInNamespace) {\n                this.addNamespaceInstruction(currentNamespace, element);\n            }\n            if (this.i18n) {\n                this.i18n.appendElement(element.i18n, elementIndex);\n            }\n            // Note that we do not append text node instructions and ICUs inside i18n section,\n            // so we exclude them while calculating whether current element has children\n            var hasChildren = (!isI18nRootElement && this.i18n) ? !hasTextChildrenOnly(element.children) :\n                element.children.length > 0;\n            var createSelfClosingInstruction = !stylingBuilder.hasBindingsWithPipes &&\n                element.outputs.length === 0 && boundI18nAttrs.length === 0 && !hasChildren;\n            var createSelfClosingI18nInstruction = !createSelfClosingInstruction && hasTextChildrenOnly(element.children);\n            if (createSelfClosingInstruction) {\n                this.creationInstruction(element.sourceSpan, isNgContainer$1 ? Identifiers.elementContainer : Identifiers.element, trimTrailingNulls(parameters));\n            }\n            else {\n                this.creationInstruction(element.startSourceSpan, isNgContainer$1 ? Identifiers.elementContainerStart : Identifiers.elementStart, trimTrailingNulls(parameters));\n                if (isNonBindableMode) {\n                    this.creationInstruction(element.startSourceSpan, Identifiers.disableBindings);\n                }\n                if (boundI18nAttrs.length > 0) {\n                    this.i18nAttributesInstruction(elementIndex, boundI18nAttrs, (_a = element.startSourceSpan) !== null && _a !== void 0 ? _a : element.sourceSpan);\n                }\n                // Generate Listeners (outputs)\n                if (element.outputs.length > 0) {\n                    var listeners = element.outputs.map(function (outputAst) { return ({\n                        sourceSpan: outputAst.sourceSpan,\n                        params: _this.prepareListenerParameter(element.name, outputAst, elementIndex)\n                    }); });\n                    this.creationInstructionChain(Identifiers.listener, listeners);\n                }\n                // Note: it's important to keep i18n/i18nStart instructions after i18nAttributes and\n                // listeners, to make sure i18nAttributes instruction targets current element at runtime.\n                if (isI18nRootElement) {\n                    this.i18nStart(element.startSourceSpan, element.i18n, createSelfClosingI18nInstruction);\n                }\n            }\n            // the code here will collect all update-level styling instructions and add them to the\n            // update block of the template function AOT code. Instructions like `styleProp`,\n            // `styleMap`, `classMap`, `classProp`\n            // are all generated and assigned in the code below.\n            var stylingInstructions = stylingBuilder.buildUpdateLevelInstructions(this._valueConverter);\n            var limit = stylingInstructions.length - 1;\n            for (var i = 0; i <= limit; i++) {\n                var instruction_1 = stylingInstructions[i];\n                this._bindingSlots += this.processStylingUpdateInstruction(elementIndex, instruction_1);\n            }\n            // the reason why `undefined` is used is because the renderer understands this as a\n            // special value to symbolize that there is no RHS to this binding\n            // TODO (matsko): revisit this once FW-959 is approached\n            var emptyValueBindInstruction = literal(undefined);\n            var propertyBindings = [];\n            var attributeBindings = [];\n            // Generate element input bindings\n            allOtherInputs.forEach(function (input) {\n                var inputType = input.type;\n                if (inputType === 4 /* Animation */) {\n                    var value_1 = input.value.visit(_this._valueConverter);\n                    // animation bindings can be presented in the following formats:\n                    // 1. [@binding]=\"fooExp\"\n                    // 2. [@binding]=\"{value:fooExp, params:{...}}\"\n                    // 3. [@binding]\n                    // 4. @binding\n                    // All formats will be valid for when a synthetic binding is created.\n                    // The reasoning for this is because the renderer should get each\n                    // synthetic binding value in the order of the array that they are\n                    // defined in...\n                    var hasValue_1 = value_1 instanceof LiteralPrimitive ? !!value_1.value : true;\n                    _this.allocateBindingSlots(value_1);\n                    propertyBindings.push({\n                        name: prepareSyntheticPropertyName(input.name),\n                        sourceSpan: input.sourceSpan,\n                        value: function () { return hasValue_1 ? _this.convertPropertyBinding(value_1) : emptyValueBindInstruction; }\n                    });\n                }\n                else {\n                    // we must skip attributes with associated i18n context, since these attributes are handled\n                    // separately and corresponding `i18nExp` and `i18nApply` instructions will be generated\n                    if (input.i18n)\n                        return;\n                    var value_2 = input.value.visit(_this._valueConverter);\n                    if (value_2 !== undefined) {\n                        var params_2 = [];\n                        var _c = __read(splitNsName(input.name), 2), attrNamespace = _c[0], attrName_1 = _c[1];\n                        var isAttributeBinding = inputType === 1 /* Attribute */;\n                        var sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);\n                        if (sanitizationRef)\n                            params_2.push(sanitizationRef);\n                        if (attrNamespace) {\n                            var namespaceLiteral = literal(attrNamespace);\n                            if (sanitizationRef) {\n                                params_2.push(namespaceLiteral);\n                            }\n                            else {\n                                // If there wasn't a sanitization ref, we need to add\n                                // an extra param so that we can pass in the namespace.\n                                params_2.push(literal(null), namespaceLiteral);\n                            }\n                        }\n                        _this.allocateBindingSlots(value_2);\n                        if (inputType === 0 /* Property */) {\n                            if (value_2 instanceof Interpolation) {\n                                // prop=\"{{value}}\" and friends\n                                _this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value_2), elementIndex, attrName_1, input, value_2, params_2);\n                            }\n                            else {\n                                // [prop]=\"value\"\n                                // Collect all the properties so that we can chain into a single function at the end.\n                                propertyBindings.push({\n                                    name: attrName_1,\n                                    sourceSpan: input.sourceSpan,\n                                    value: function () { return _this.convertPropertyBinding(value_2); },\n                                    params: params_2\n                                });\n                            }\n                        }\n                        else if (inputType === 1 /* Attribute */) {\n                            if (value_2 instanceof Interpolation && getInterpolationArgsLength(value_2) > 1) {\n                                // attr.name=\"text{{value}}\" and friends\n                                _this.interpolatedUpdateInstruction(getAttributeInterpolationExpression(value_2), elementIndex, attrName_1, input, value_2, params_2);\n                            }\n                            else {\n                                var boundValue_1 = value_2 instanceof Interpolation ? value_2.expressions[0] : value_2;\n                                // [attr.name]=\"value\" or attr.name=\"{{value}}\"\n                                // Collect the attribute bindings so that they can be chained at the end.\n                                attributeBindings.push({\n                                    name: attrName_1,\n                                    sourceSpan: input.sourceSpan,\n                                    value: function () { return _this.convertPropertyBinding(boundValue_1); },\n                                    params: params_2\n                                });\n                            }\n                        }\n                        else {\n                            // class prop\n                            _this.updateInstructionWithAdvance(elementIndex, input.sourceSpan, Identifiers.classProp, function () {\n                                return __spreadArray([\n                                    literal(elementIndex), literal(attrName_1), _this.convertPropertyBinding(value_2)\n                                ], __read(params_2));\n                            });\n                        }\n                    }\n                }\n            });\n            if (propertyBindings.length > 0) {\n                this.updateInstructionChainWithAdvance(elementIndex, Identifiers.property, propertyBindings);\n            }\n            if (attributeBindings.length > 0) {\n                this.updateInstructionChainWithAdvance(elementIndex, Identifiers.attribute, attributeBindings);\n            }\n            // Traverse element child nodes\n            visitAll(this, element.children);\n            if (!isI18nRootElement && this.i18n) {\n                this.i18n.appendElement(element.i18n, elementIndex, true);\n            }\n            if (!createSelfClosingInstruction) {\n                // Finish element construction mode.\n                var span = (_b = element.endSourceSpan) !== null && _b !== void 0 ? _b : element.sourceSpan;\n                if (isI18nRootElement) {\n                    this.i18nEnd(span, createSelfClosingI18nInstruction);\n                }\n                if (isNonBindableMode) {\n                    this.creationInstruction(span, Identifiers.enableBindings);\n                }\n                this.creationInstruction(span, isNgContainer$1 ? Identifiers.elementContainerEnd : Identifiers.elementEnd);\n            }\n        };\n        TemplateDefinitionBuilder.prototype.visitTemplate = function (template) {\n            var _this = this;\n            var _a;\n            var NG_TEMPLATE_TAG_NAME = 'ng-template';\n            var templateIndex = this.allocateDataSlot();\n            if (this.i18n) {\n                this.i18n.appendTemplate(template.i18n, templateIndex);\n            }\n            var tagNameWithoutNamespace = template.tagName ? splitNsName(template.tagName)[1] : template.tagName;\n            var contextName = \"\" + this.contextName + (template.tagName ? '_' + sanitizeIdentifier(template.tagName) : '') + \"_\" + templateIndex;\n            var templateName = contextName + \"_Template\";\n            var parameters = [\n                literal(templateIndex),\n                variable(templateName),\n                // We don't care about the tag's namespace here, because we infer\n                // it based on the parent nodes inside the template instruction.\n                literal(tagNameWithoutNamespace),\n            ];\n            // find directives matching on a given <ng-template> node\n            this.matchDirectives(NG_TEMPLATE_TAG_NAME, template);\n            // prepare attributes parameter (including attributes used for directive matching)\n            var attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME, template.attributes, template.inputs, template.outputs, undefined /* styles */, template.templateAttrs);\n            parameters.push(this.addAttrsToConsts(attrsExprs));\n            // local refs (ex.: <ng-template #foo>)\n            if (template.references && template.references.length) {\n                var refs = this.prepareRefsArray(template.references);\n                parameters.push(this.addToConsts(refs));\n                parameters.push(importExpr(Identifiers.templateRefExtractor));\n            }\n            // Create the template function\n            var templateVisitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, templateIndex, templateName, this.directiveMatcher, this.directives, this.pipeTypeByName, this.pipes, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this._constants);\n            // Nested templates must not be visited until after their parent templates have completed\n            // processing, so they are queued here until after the initial pass. Otherwise, we wouldn't\n            // be able to support bindings in nested templates to local refs that occur after the\n            // template definition. e.g. <div *ngIf=\"showing\">{{ foo }}</div>  <div #foo></div>\n            this._nestedTemplateFns.push(function () {\n                var _c;\n                var templateFunctionExpr = templateVisitor.buildTemplateFunction(template.children, template.variables, _this._ngContentReservedSlots.length + _this._ngContentSelectorsOffset, template.i18n);\n                _this.constantPool.statements.push(templateFunctionExpr.toDeclStmt(templateName));\n                if (templateVisitor._ngContentReservedSlots.length) {\n                    (_c = _this._ngContentReservedSlots).push.apply(_c, __spreadArray([], __read(templateVisitor._ngContentReservedSlots)));\n                }\n            });\n            // e.g. template(1, MyComp_Template_1)\n            this.creationInstruction(template.sourceSpan, Identifiers.templateCreate, function () {\n                parameters.splice(2, 0, literal(templateVisitor.getConstCount()), literal(templateVisitor.getVarCount()));\n                return trimTrailingNulls(parameters);\n            });\n            // handle property bindings e.g. ɵɵproperty('ngForOf', ctx.items), et al;\n            this.templatePropertyBindings(templateIndex, template.templateAttrs);\n            // Only add normal input/output binding instructions on explicit <ng-template> elements.\n            if (tagNameWithoutNamespace === NG_TEMPLATE_TAG_NAME) {\n                var _c = __read(partitionArray(template.inputs, hasI18nMeta), 2), i18nInputs = _c[0], inputs = _c[1];\n                // Add i18n attributes that may act as inputs to directives. If such attributes are present,\n                // generate `i18nAttributes` instruction. Note: we generate it only for explicit <ng-template>\n                // elements, in case of inline templates, corresponding instructions will be generated in the\n                // nested template function.\n                if (i18nInputs.length > 0) {\n                    this.i18nAttributesInstruction(templateIndex, i18nInputs, (_a = template.startSourceSpan) !== null && _a !== void 0 ? _a : template.sourceSpan);\n                }\n                // Add the input bindings\n                if (inputs.length > 0) {\n                    this.templatePropertyBindings(templateIndex, inputs);\n                }\n                // Generate listeners for directive output\n                if (template.outputs.length > 0) {\n                    var listeners = template.outputs.map(function (outputAst) { return ({\n                        sourceSpan: outputAst.sourceSpan,\n                        params: _this.prepareListenerParameter('ng_template', outputAst, templateIndex)\n                    }); });\n                    this.creationInstructionChain(Identifiers.listener, listeners);\n                }\n            }\n        };\n        TemplateDefinitionBuilder.prototype.visitBoundText = function (text) {\n            var _this = this;\n            if (this.i18n) {\n                var value_3 = text.value.visit(this._valueConverter);\n                this.allocateBindingSlots(value_3);\n                if (value_3 instanceof Interpolation) {\n                    this.i18n.appendBoundText(text.i18n);\n                    this.i18nAppendBindings(value_3.expressions);\n                }\n                return;\n            }\n            var nodeIndex = this.allocateDataSlot();\n            this.creationInstruction(text.sourceSpan, Identifiers.text, [literal(nodeIndex)]);\n            var value = text.value.visit(this._valueConverter);\n            this.allocateBindingSlots(value);\n            if (value instanceof Interpolation) {\n                this.updateInstructionWithAdvance(nodeIndex, text.sourceSpan, getTextInterpolationExpression(value), function () { return _this.getUpdateInstructionArguments(value); });\n            }\n            else {\n                error('Text nodes should be interpolated and never bound directly.');\n            }\n        };\n        TemplateDefinitionBuilder.prototype.visitText = function (text) {\n            // when a text element is located within a translatable\n            // block, we exclude this text element from instructions set,\n            // since it will be captured in i18n content and processed at runtime\n            if (!this.i18n) {\n                this.creationInstruction(text.sourceSpan, Identifiers.text, [literal(this.allocateDataSlot()), literal(text.value)]);\n            }\n        };\n        TemplateDefinitionBuilder.prototype.visitIcu = function (icu) {\n            var initWasInvoked = false;\n            // if an ICU was created outside of i18n block, we still treat\n            // it as a translatable entity and invoke i18nStart and i18nEnd\n            // to generate i18n context and the necessary instructions\n            if (!this.i18n) {\n                initWasInvoked = true;\n                this.i18nStart(null, icu.i18n, true);\n            }\n            var i18n = this.i18n;\n            var vars = this.i18nBindProps(icu.vars);\n            var placeholders = this.i18nBindProps(icu.placeholders);\n            // output ICU directly and keep ICU reference in context\n            var message = icu.i18n;\n            // we always need post-processing function for ICUs, to make sure that:\n            // - all placeholders in a form of {PLACEHOLDER} are replaced with actual values (note:\n            // `goog.getMsg` does not process ICUs and uses the `{PLACEHOLDER}` format for placeholders\n            // inside ICUs)\n            // - all ICU vars (such as `VAR_SELECT` or `VAR_PLURAL`) are replaced with correct values\n            var transformFn = function (raw) {\n                var params = Object.assign(Object.assign({}, vars), placeholders);\n                var formatted = i18nFormatPlaceholderNames(params, /* useCamelCase */ false);\n                return instruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);\n            };\n            // in case the whole i18n message is a single ICU - we do not need to\n            // create a separate top-level translation, we can use the root ref instead\n            // and make this ICU a top-level translation\n            // note: ICU placeholders are replaced with actual values in `i18nPostprocess` function\n            // separately, so we do not pass placeholders into `i18nTranslate` function.\n            if (isSingleI18nIcu(i18n.meta)) {\n                this.i18nTranslate(message, /* placeholders */ {}, i18n.ref, transformFn);\n            }\n            else {\n                // output ICU directly and keep ICU reference in context\n                var ref = this.i18nTranslate(message, /* placeholders */ {}, /* ref */ undefined, transformFn);\n                i18n.appendIcu(icuFromI18nMessage(message).name, ref);\n            }\n            if (initWasInvoked) {\n                this.i18nEnd(null, true);\n            }\n            return null;\n        };\n        TemplateDefinitionBuilder.prototype.allocateDataSlot = function () {\n            return this._dataIndex++;\n        };\n        TemplateDefinitionBuilder.prototype.getConstCount = function () {\n            return this._dataIndex;\n        };\n        TemplateDefinitionBuilder.prototype.getVarCount = function () {\n            return this._pureFunctionSlots;\n        };\n        TemplateDefinitionBuilder.prototype.getConsts = function () {\n            return this._constants;\n        };\n        TemplateDefinitionBuilder.prototype.getNgContentSelectors = function () {\n            return this._ngContentReservedSlots.length ?\n                this.constantPool.getConstLiteral(asLiteral(this._ngContentReservedSlots), true) :\n                null;\n        };\n        TemplateDefinitionBuilder.prototype.bindingContext = function () {\n            return \"\" + this._bindingContext++;\n        };\n        TemplateDefinitionBuilder.prototype.templatePropertyBindings = function (templateIndex, attrs) {\n            var _this = this;\n            var propertyBindings = [];\n            attrs.forEach(function (input) {\n                if (input instanceof BoundAttribute) {\n                    var value_4 = input.value.visit(_this._valueConverter);\n                    if (value_4 !== undefined) {\n                        _this.allocateBindingSlots(value_4);\n                        if (value_4 instanceof Interpolation) {\n                            // Params typically contain attribute namespace and value sanitizer, which is applicable\n                            // for regular HTML elements, but not applicable for <ng-template> (since props act as\n                            // inputs to directives), so keep params array empty.\n                            var params = [];\n                            // prop=\"{{value}}\" case\n                            _this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value_4), templateIndex, input.name, input, value_4, params);\n                        }\n                        else {\n                            // [prop]=\"value\" case\n                            propertyBindings.push({\n                                name: input.name,\n                                sourceSpan: input.sourceSpan,\n                                value: function () { return _this.convertPropertyBinding(value_4); }\n                            });\n                        }\n                    }\n                }\n            });\n            if (propertyBindings.length > 0) {\n                this.updateInstructionChainWithAdvance(templateIndex, Identifiers.property, propertyBindings);\n            }\n        };\n        // Bindings must only be resolved after all local refs have been visited, so all\n        // instructions are queued in callbacks that execute once the initial pass has completed.\n        // Otherwise, we wouldn't be able to support local refs that are defined after their\n        // bindings. e.g. {{ foo }} <div #foo></div>\n        TemplateDefinitionBuilder.prototype.instructionFn = function (fns, span, reference, paramsOrFn, prepend) {\n            if (prepend === void 0) { prepend = false; }\n            fns[prepend ? 'unshift' : 'push'](function () {\n                var params = Array.isArray(paramsOrFn) ? paramsOrFn : paramsOrFn();\n                return instruction(span, reference, params).toStmt();\n            });\n        };\n        TemplateDefinitionBuilder.prototype.processStylingUpdateInstruction = function (elementIndex, instruction) {\n            var _this = this;\n            var allocateBindingSlots = 0;\n            if (instruction) {\n                var calls_1 = [];\n                instruction.calls.forEach(function (call) {\n                    allocateBindingSlots += call.allocateBindingSlots;\n                    calls_1.push({\n                        sourceSpan: call.sourceSpan,\n                        value: function () {\n                            return call.params(function (value) { return (call.supportsInterpolation && value instanceof Interpolation) ?\n                                _this.getUpdateInstructionArguments(value) :\n                                _this.convertPropertyBinding(value); });\n                        }\n                    });\n                });\n                this.updateInstructionChainWithAdvance(elementIndex, instruction.reference, calls_1);\n            }\n            return allocateBindingSlots;\n        };\n        TemplateDefinitionBuilder.prototype.creationInstruction = function (span, reference, paramsOrFn, prepend) {\n            this.instructionFn(this._creationCodeFns, span, reference, paramsOrFn || [], prepend);\n        };\n        TemplateDefinitionBuilder.prototype.creationInstructionChain = function (reference, calls) {\n            var span = calls.length ? calls[0].sourceSpan : null;\n            this._creationCodeFns.push(function () {\n                return chainedInstruction(reference, calls.map(function (call) { return call.params(); }), span).toStmt();\n            });\n        };\n        TemplateDefinitionBuilder.prototype.updateInstructionWithAdvance = function (nodeIndex, span, reference, paramsOrFn) {\n            this.addAdvanceInstructionIfNecessary(nodeIndex, span);\n            this.updateInstruction(span, reference, paramsOrFn);\n        };\n        TemplateDefinitionBuilder.prototype.updateInstruction = function (span, reference, paramsOrFn) {\n            this.instructionFn(this._updateCodeFns, span, reference, paramsOrFn || []);\n        };\n        TemplateDefinitionBuilder.prototype.updateInstructionChain = function (reference, bindings) {\n            var span = bindings.length ? bindings[0].sourceSpan : null;\n            this._updateCodeFns.push(function () {\n                var calls = bindings.map(function (property) {\n                    var value = property.value();\n                    var fnParams = Array.isArray(value) ? value : [value];\n                    if (property.params) {\n                        fnParams.push.apply(fnParams, __spreadArray([], __read(property.params)));\n                    }\n                    if (property.name) {\n                        // We want the property name to always be the first function parameter.\n                        fnParams.unshift(literal(property.name));\n                    }\n                    return fnParams;\n                });\n                return chainedInstruction(reference, calls, span).toStmt();\n            });\n        };\n        TemplateDefinitionBuilder.prototype.updateInstructionChainWithAdvance = function (nodeIndex, reference, bindings) {\n            this.addAdvanceInstructionIfNecessary(nodeIndex, bindings.length ? bindings[0].sourceSpan : null);\n            this.updateInstructionChain(reference, bindings);\n        };\n        TemplateDefinitionBuilder.prototype.addAdvanceInstructionIfNecessary = function (nodeIndex, span) {\n            if (nodeIndex !== this._currentIndex) {\n                var delta = nodeIndex - this._currentIndex;\n                if (delta < 1) {\n                    throw new Error('advance instruction can only go forwards');\n                }\n                this.instructionFn(this._updateCodeFns, span, Identifiers.advance, [literal(delta)]);\n                this._currentIndex = nodeIndex;\n            }\n        };\n        TemplateDefinitionBuilder.prototype.allocatePureFunctionSlots = function (numSlots) {\n            var originalSlots = this._pureFunctionSlots;\n            this._pureFunctionSlots += numSlots;\n            return originalSlots;\n        };\n        TemplateDefinitionBuilder.prototype.allocateBindingSlots = function (value) {\n            this._bindingSlots += value instanceof Interpolation ? value.expressions.length : 1;\n        };\n        /**\n         * Gets an expression that refers to the implicit receiver. The implicit\n         * receiver is always the root level context.\n         */\n        TemplateDefinitionBuilder.prototype.getImplicitReceiverExpr = function () {\n            if (this._implicitReceiverExpr) {\n                return this._implicitReceiverExpr;\n            }\n            return this._implicitReceiverExpr = this.level === 0 ?\n                variable(CONTEXT_NAME) :\n                this._bindingScope.getOrCreateSharedContextVar(0);\n        };\n        TemplateDefinitionBuilder.prototype.convertPropertyBinding = function (value) {\n            var _c;\n            var convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext(), BindingForm.Expression, function () { return error('Unexpected interpolation'); });\n            var valExpr = convertedPropertyBinding.currValExpr;\n            (_c = this._tempVariables).push.apply(_c, __spreadArray([], __read(convertedPropertyBinding.stmts)));\n            return valExpr;\n        };\n        /**\n         * Gets a list of argument expressions to pass to an update instruction expression. Also updates\n         * the temp variables state with temp variables that were identified as needing to be created\n         * while visiting the arguments.\n         * @param value The original expression we will be resolving an arguments list from.\n         */\n        TemplateDefinitionBuilder.prototype.getUpdateInstructionArguments = function (value) {\n            var _c;\n            var _d = convertUpdateArguments(this, this.getImplicitReceiverExpr(), value, this.bindingContext()), args = _d.args, stmts = _d.stmts;\n            (_c = this._tempVariables).push.apply(_c, __spreadArray([], __read(stmts)));\n            return args;\n        };\n        TemplateDefinitionBuilder.prototype.matchDirectives = function (elementName, elOrTpl) {\n            var _this = this;\n            if (this.directiveMatcher) {\n                var selector = createCssSelector(elementName, getAttrsForDirectiveMatching(elOrTpl));\n                this.directiveMatcher.match(selector, function (cssSelector, staticType) {\n                    _this.directives.add(staticType);\n                });\n            }\n        };\n        /**\n         * Prepares all attribute expression values for the `TAttributes` array.\n         *\n         * The purpose of this function is to properly construct an attributes array that\n         * is passed into the `elementStart` (or just `element`) functions. Because there\n         * are many different types of attributes, the array needs to be constructed in a\n         * special way so that `elementStart` can properly evaluate them.\n         *\n         * The format looks like this:\n         *\n         * ```\n         * attrs = [prop, value, prop2, value2,\n         *   PROJECT_AS, selector,\n         *   CLASSES, class1, class2,\n         *   STYLES, style1, value1, style2, value2,\n         *   BINDINGS, name1, name2, name3,\n         *   TEMPLATE, name4, name5, name6,\n         *   I18N, name7, name8, ...]\n         * ```\n         *\n         * Note that this function will fully ignore all synthetic (@foo) attribute values\n         * because those values are intended to always be generated as property instructions.\n         */\n        TemplateDefinitionBuilder.prototype.getAttributeExpressions = function (elementName, renderAttributes, inputs, outputs, styles, templateAttrs, boundI18nAttrs) {\n            var e_2, _c;\n            if (templateAttrs === void 0) { templateAttrs = []; }\n            if (boundI18nAttrs === void 0) { boundI18nAttrs = []; }\n            var alreadySeen = new Set();\n            var attrExprs = [];\n            var ngProjectAsAttr;\n            try {\n                for (var renderAttributes_1 = __values(renderAttributes), renderAttributes_1_1 = renderAttributes_1.next(); !renderAttributes_1_1.done; renderAttributes_1_1 = renderAttributes_1.next()) {\n                    var attr = renderAttributes_1_1.value;\n                    if (attr.name === NG_PROJECT_AS_ATTR_NAME) {\n                        ngProjectAsAttr = attr;\n                    }\n                    // Note that static i18n attributes aren't in the i18n array,\n                    // because they're treated in the same way as regular attributes.\n                    if (attr.i18n) {\n                        // When i18n attributes are present on elements with structural directives\n                        // (e.g. `<div *ngIf title=\"Hello\" i18n-title>`), we want to avoid generating\n                        // duplicate i18n translation blocks for `ɵɵtemplate` and `ɵɵelement` instruction\n                        // attributes. So we do a cache lookup to see if suitable i18n translation block\n                        // already exists.\n                        var i18nVarRefsCache = this._constants.i18nVarRefsCache;\n                        var i18nVarRef = void 0;\n                        if (i18nVarRefsCache.has(attr.i18n)) {\n                            i18nVarRef = i18nVarRefsCache.get(attr.i18n);\n                        }\n                        else {\n                            i18nVarRef = this.i18nTranslate(attr.i18n);\n                            i18nVarRefsCache.set(attr.i18n, i18nVarRef);\n                        }\n                        attrExprs.push(literal(attr.name), i18nVarRef);\n                    }\n                    else {\n                        attrExprs.push.apply(attrExprs, __spreadArray(__spreadArray([], __read(getAttributeNameLiterals(attr.name))), [trustedConstAttribute(elementName, attr)]));\n                    }\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (renderAttributes_1_1 && !renderAttributes_1_1.done && (_c = renderAttributes_1.return)) _c.call(renderAttributes_1);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n            // Keep ngProjectAs next to the other name, value pairs so we can verify that we match\n            // ngProjectAs marker in the attribute name slot.\n            if (ngProjectAsAttr) {\n                attrExprs.push.apply(attrExprs, __spreadArray([], __read(getNgProjectAsLiteral(ngProjectAsAttr))));\n            }\n            function addAttrExpr(key, value) {\n                if (typeof key === 'string') {\n                    if (!alreadySeen.has(key)) {\n                        attrExprs.push.apply(attrExprs, __spreadArray([], __read(getAttributeNameLiterals(key))));\n                        value !== undefined && attrExprs.push(value);\n                        alreadySeen.add(key);\n                    }\n                }\n                else {\n                    attrExprs.push(literal(key));\n                }\n            }\n            // it's important that this occurs before BINDINGS and TEMPLATE because once `elementStart`\n            // comes across the BINDINGS or TEMPLATE markers then it will continue reading each value as\n            // as single property value cell by cell.\n            if (styles) {\n                styles.populateInitialStylingAttrs(attrExprs);\n            }\n            if (inputs.length || outputs.length) {\n                var attrsLengthBeforeInputs = attrExprs.length;\n                for (var i = 0; i < inputs.length; i++) {\n                    var input = inputs[i];\n                    // We don't want the animation and attribute bindings in the\n                    // attributes array since they aren't used for directive matching.\n                    if (input.type !== 4 /* Animation */ && input.type !== 1 /* Attribute */) {\n                        addAttrExpr(input.name);\n                    }\n                }\n                for (var i = 0; i < outputs.length; i++) {\n                    var output = outputs[i];\n                    if (output.type !== 1 /* Animation */) {\n                        addAttrExpr(output.name);\n                    }\n                }\n                // this is a cheap way of adding the marker only after all the input/output\n                // values have been filtered (by not including the animation ones) and added\n                // to the expressions. The marker is important because it tells the runtime\n                // code that this is where attributes without values start...\n                if (attrExprs.length !== attrsLengthBeforeInputs) {\n                    attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* Bindings */));\n                }\n            }\n            if (templateAttrs.length) {\n                attrExprs.push(literal(4 /* Template */));\n                templateAttrs.forEach(function (attr) { return addAttrExpr(attr.name); });\n            }\n            if (boundI18nAttrs.length) {\n                attrExprs.push(literal(6 /* I18n */));\n                boundI18nAttrs.forEach(function (attr) { return addAttrExpr(attr.name); });\n            }\n            return attrExprs;\n        };\n        TemplateDefinitionBuilder.prototype.addToConsts = function (expression) {\n            if (isNull(expression)) {\n                return TYPED_NULL_EXPR;\n            }\n            var consts = this._constants.constExpressions;\n            // Try to reuse a literal that's already in the array, if possible.\n            for (var i = 0; i < consts.length; i++) {\n                if (consts[i].isEquivalent(expression)) {\n                    return literal(i);\n                }\n            }\n            return literal(consts.push(expression) - 1);\n        };\n        TemplateDefinitionBuilder.prototype.addAttrsToConsts = function (attrs) {\n            return attrs.length > 0 ? this.addToConsts(literalArr(attrs)) : TYPED_NULL_EXPR;\n        };\n        TemplateDefinitionBuilder.prototype.prepareRefsArray = function (references) {\n            var _this = this;\n            if (!references || references.length === 0) {\n                return TYPED_NULL_EXPR;\n            }\n            var refsParam = flatten(references.map(function (reference) {\n                var slot = _this.allocateDataSlot();\n                // Generate the update temporary.\n                var variableName = _this._bindingScope.freshReferenceName();\n                var retrievalLevel = _this.level;\n                var lhs = variable(variableName);\n                _this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DEFAULT */, function (scope, relativeLevel) {\n                    // e.g. nextContext(2);\n                    var nextContextStmt = relativeLevel > 0 ? [generateNextContextExpr(relativeLevel).toStmt()] : [];\n                    // e.g. const $foo$ = reference(1);\n                    var refExpr = lhs.set(importExpr(Identifiers.reference).callFn([literal(slot)]));\n                    return nextContextStmt.concat(refExpr.toConstDecl());\n                }, true);\n                return [reference.name, reference.value];\n            }));\n            return asLiteral(refsParam);\n        };\n        TemplateDefinitionBuilder.prototype.prepareListenerParameter = function (tagName, outputAst, index) {\n            var _this = this;\n            return function () {\n                var eventName = outputAst.name;\n                var bindingFnName = outputAst.type === 1 /* Animation */ ?\n                    // synthetic @listener.foo values are treated the exact same as are standard listeners\n                    prepareSyntheticListenerFunctionName(eventName, outputAst.phase) :\n                    sanitizeIdentifier(eventName);\n                var handlerName = _this.templateName + \"_\" + tagName + \"_\" + bindingFnName + \"_\" + index + \"_listener\";\n                var scope = _this._bindingScope.nestedScope(_this._bindingScope.bindingLevel, EVENT_BINDING_SCOPE_GLOBALS);\n                return prepareEventListenerParameters(outputAst, handlerName, scope);\n            };\n        };\n        return TemplateDefinitionBuilder;\n    }());\n    var ValueConverter = /** @class */ (function (_super) {\n        __extends(ValueConverter, _super);\n        function ValueConverter(constantPool, allocateSlot, allocatePureFunctionSlots, definePipe) {\n            var _this = _super.call(this) || this;\n            _this.constantPool = constantPool;\n            _this.allocateSlot = allocateSlot;\n            _this.allocatePureFunctionSlots = allocatePureFunctionSlots;\n            _this.definePipe = definePipe;\n            _this._pipeBindExprs = [];\n            return _this;\n        }\n        // AstMemoryEfficientTransformer\n        ValueConverter.prototype.visitPipe = function (pipe, context) {\n            // Allocate a slot to create the pipe\n            var slot = this.allocateSlot();\n            var slotPseudoLocal = \"PIPE:\" + slot;\n            // Allocate one slot for the result plus one slot per pipe argument\n            var pureFunctionSlot = this.allocatePureFunctionSlots(2 + pipe.args.length);\n            var target = new PropertyRead(pipe.span, pipe.sourceSpan, pipe.nameSpan, new ImplicitReceiver(pipe.span, pipe.sourceSpan), slotPseudoLocal);\n            var _c = pipeBindingCallInfo(pipe.args), identifier = _c.identifier, isVarLength = _c.isVarLength;\n            this.definePipe(pipe.name, slotPseudoLocal, slot, importExpr(identifier));\n            var args = __spreadArray([pipe.exp], __read(pipe.args));\n            var convertedArgs = isVarLength ?\n                this.visitAll([new LiteralArray(pipe.span, pipe.sourceSpan, args)]) :\n                this.visitAll(args);\n            var pipeBindExpr = new FunctionCall(pipe.span, pipe.sourceSpan, target, __spreadArray([\n                new LiteralPrimitive(pipe.span, pipe.sourceSpan, slot),\n                new LiteralPrimitive(pipe.span, pipe.sourceSpan, pureFunctionSlot)\n            ], __read(convertedArgs)));\n            this._pipeBindExprs.push(pipeBindExpr);\n            return pipeBindExpr;\n        };\n        ValueConverter.prototype.updatePipeSlotOffsets = function (bindingSlots) {\n            this._pipeBindExprs.forEach(function (pipe) {\n                // update the slot offset arg (index 1) to account for binding slots\n                var slotOffset = pipe.args[1];\n                slotOffset.value += bindingSlots;\n            });\n        };\n        ValueConverter.prototype.visitLiteralArray = function (array, context) {\n            var _this = this;\n            return new BuiltinFunctionCall(array.span, array.sourceSpan, this.visitAll(array.expressions), function (values) {\n                // If the literal has calculated (non-literal) elements transform it into\n                // calls to literal factories that compose the literal and will cache intermediate\n                // values.\n                var literal = literalArr(values);\n                return getLiteralFactory(_this.constantPool, literal, _this.allocatePureFunctionSlots);\n            });\n        };\n        ValueConverter.prototype.visitLiteralMap = function (map, context) {\n            var _this = this;\n            return new BuiltinFunctionCall(map.span, map.sourceSpan, this.visitAll(map.values), function (values) {\n                // If the literal has calculated (non-literal) elements  transform it into\n                // calls to literal factories that compose the literal and will cache intermediate\n                // values.\n                var literal = literalMap(values.map(function (value, index) { return ({ key: map.keys[index].key, value: value, quoted: map.keys[index].quoted }); }));\n                return getLiteralFactory(_this.constantPool, literal, _this.allocatePureFunctionSlots);\n            });\n        };\n        return ValueConverter;\n    }(AstMemoryEfficientTransformer));\n    // Pipes always have at least one parameter, the value they operate on\n    var pipeBindingIdentifiers = [Identifiers.pipeBind1, Identifiers.pipeBind2, Identifiers.pipeBind3, Identifiers.pipeBind4];\n    function pipeBindingCallInfo(args) {\n        var identifier = pipeBindingIdentifiers[args.length];\n        return {\n            identifier: identifier || Identifiers.pipeBindV,\n            isVarLength: !identifier,\n        };\n    }\n    var pureFunctionIdentifiers = [\n        Identifiers.pureFunction0, Identifiers.pureFunction1, Identifiers.pureFunction2, Identifiers.pureFunction3, Identifiers.pureFunction4,\n        Identifiers.pureFunction5, Identifiers.pureFunction6, Identifiers.pureFunction7, Identifiers.pureFunction8\n    ];\n    function pureFunctionCallInfo(args) {\n        var identifier = pureFunctionIdentifiers[args.length];\n        return {\n            identifier: identifier || Identifiers.pureFunctionV,\n            isVarLength: !identifier,\n        };\n    }\n    function instruction(span, reference, params) {\n        return importExpr(reference, null, span).callFn(params, span);\n    }\n    // e.g. x(2);\n    function generateNextContextExpr(relativeLevelDiff) {\n        return importExpr(Identifiers.nextContext)\n            .callFn(relativeLevelDiff > 1 ? [literal(relativeLevelDiff)] : []);\n    }\n    function getLiteralFactory(constantPool, literal$1, allocateSlots) {\n        var _c = constantPool.getLiteralFactory(literal$1), literalFactory = _c.literalFactory, literalFactoryArguments = _c.literalFactoryArguments;\n        // Allocate 1 slot for the result plus 1 per argument\n        var startSlot = allocateSlots(1 + literalFactoryArguments.length);\n        var _d = pureFunctionCallInfo(literalFactoryArguments), identifier = _d.identifier, isVarLength = _d.isVarLength;\n        // Literal factories are pure functions that only need to be re-invoked when the parameters\n        // change.\n        var args = [literal(startSlot), literalFactory];\n        if (isVarLength) {\n            args.push(literalArr(literalFactoryArguments));\n        }\n        else {\n            args.push.apply(args, __spreadArray([], __read(literalFactoryArguments)));\n        }\n        return importExpr(identifier).callFn(args);\n    }\n    /**\n     * Gets an array of literals that can be added to an expression\n     * to represent the name and namespace of an attribute. E.g.\n     * `:xlink:href` turns into `[AttributeMarker.NamespaceURI, 'xlink', 'href']`.\n     *\n     * @param name Name of the attribute, including the namespace.\n     */\n    function getAttributeNameLiterals(name) {\n        var _c = __read(splitNsName(name), 2), attributeNamespace = _c[0], attributeName = _c[1];\n        var nameLiteral = literal(attributeName);\n        if (attributeNamespace) {\n            return [\n                literal(0 /* NamespaceURI */), literal(attributeNamespace), nameLiteral\n            ];\n        }\n        return [nameLiteral];\n    }\n    /** The prefix used to get a shared context in BindingScope's map. */\n    var SHARED_CONTEXT_KEY = '$$shared_ctx$$';\n    var BindingScope = /** @class */ (function () {\n        function BindingScope(bindingLevel, parent, globals) {\n            var e_3, _c;\n            if (bindingLevel === void 0) { bindingLevel = 0; }\n            if (parent === void 0) { parent = null; }\n            this.bindingLevel = bindingLevel;\n            this.parent = parent;\n            this.globals = globals;\n            /** Keeps a map from local variables to their BindingData. */\n            this.map = new Map();\n            this.referenceNameIndex = 0;\n            this.restoreViewVariable = null;\n            this.usesRestoredViewContext = false;\n            if (globals !== undefined) {\n                try {\n                    for (var globals_1 = __values(globals), globals_1_1 = globals_1.next(); !globals_1_1.done; globals_1_1 = globals_1.next()) {\n                        var name = globals_1_1.value;\n                        this.set(0, name, variable(name));\n                    }\n                }\n                catch (e_3_1) { e_3 = { error: e_3_1 }; }\n                finally {\n                    try {\n                        if (globals_1_1 && !globals_1_1.done && (_c = globals_1.return)) _c.call(globals_1);\n                    }\n                    finally { if (e_3) throw e_3.error; }\n                }\n            }\n        }\n        BindingScope.createRootScope = function () {\n            return new BindingScope();\n        };\n        BindingScope.prototype.get = function (name) {\n            var current = this;\n            while (current) {\n                var value = current.map.get(name);\n                if (value != null) {\n                    if (current !== this) {\n                        // make a local copy and reset the `declare` state\n                        value = {\n                            retrievalLevel: value.retrievalLevel,\n                            lhs: value.lhs,\n                            declareLocalCallback: value.declareLocalCallback,\n                            declare: false,\n                            priority: value.priority\n                        };\n                        // Cache the value locally.\n                        this.map.set(name, value);\n                        // Possibly generate a shared context var\n                        this.maybeGenerateSharedContextVar(value);\n                        this.maybeRestoreView();\n                    }\n                    if (value.declareLocalCallback && !value.declare) {\n                        value.declare = true;\n                    }\n                    return value.lhs;\n                }\n                current = current.parent;\n            }\n            // If we get to this point, we are looking for a property on the top level component\n            // - If level === 0, we are on the top and don't need to re-declare `ctx`.\n            // - If level > 0, we are in an embedded view. We need to retrieve the name of the\n            // local var we used to store the component context, e.g. const $comp$ = x();\n            return this.bindingLevel === 0 ? null : this.getComponentProperty(name);\n        };\n        /**\n         * Create a local variable for later reference.\n         *\n         * @param retrievalLevel The level from which this value can be retrieved\n         * @param name Name of the variable.\n         * @param lhs AST representing the left hand side of the `let lhs = rhs;`.\n         * @param priority The sorting priority of this var\n         * @param declareLocalCallback The callback to invoke when declaring this local var\n         * @param localRef Whether or not this is a local ref\n         */\n        BindingScope.prototype.set = function (retrievalLevel, name, lhs, priority /* DEFAULT */, declareLocalCallback, localRef) {\n            if (priority === void 0) { priority = 0; }\n            if (this.map.has(name)) {\n                if (localRef) {\n                    // Do not throw an error if it's a local ref and do not update existing value,\n                    // so the first defined ref is always returned.\n                    return this;\n                }\n                error(\"The name \" + name + \" is already defined in scope to be \" + this.map.get(name));\n            }\n            this.map.set(name, {\n                retrievalLevel: retrievalLevel,\n                lhs: lhs,\n                declare: false,\n                declareLocalCallback: declareLocalCallback,\n                priority: priority,\n            });\n            return this;\n        };\n        // Implemented as part of LocalResolver.\n        BindingScope.prototype.getLocal = function (name) {\n            return this.get(name);\n        };\n        // Implemented as part of LocalResolver.\n        BindingScope.prototype.notifyImplicitReceiverUse = function () {\n            if (this.bindingLevel !== 0) {\n                // Since the implicit receiver is accessed in an embedded view, we need to\n                // ensure that we declare a shared context variable for the current template\n                // in the update variables.\n                this.map.get(SHARED_CONTEXT_KEY + 0).declare = true;\n            }\n        };\n        BindingScope.prototype.nestedScope = function (level, globals) {\n            var newScope = new BindingScope(level, this, globals);\n            if (level > 0)\n                newScope.generateSharedContextVar(0);\n            return newScope;\n        };\n        /**\n         * Gets or creates a shared context variable and returns its expression. Note that\n         * this does not mean that the shared variable will be declared. Variables in the\n         * binding scope will be only declared if they are used.\n         */\n        BindingScope.prototype.getOrCreateSharedContextVar = function (retrievalLevel) {\n            var bindingKey = SHARED_CONTEXT_KEY + retrievalLevel;\n            if (!this.map.has(bindingKey)) {\n                this.generateSharedContextVar(retrievalLevel);\n            }\n            // Shared context variables are always generated as \"ReadVarExpr\".\n            return this.map.get(bindingKey).lhs;\n        };\n        BindingScope.prototype.getSharedContextName = function (retrievalLevel) {\n            var sharedCtxObj = this.map.get(SHARED_CONTEXT_KEY + retrievalLevel);\n            // Shared context variables are always generated as \"ReadVarExpr\".\n            return sharedCtxObj && sharedCtxObj.declare ? sharedCtxObj.lhs : null;\n        };\n        BindingScope.prototype.maybeGenerateSharedContextVar = function (value) {\n            if (value.priority === 1 /* CONTEXT */ &&\n                value.retrievalLevel < this.bindingLevel) {\n                var sharedCtxObj = this.map.get(SHARED_CONTEXT_KEY + value.retrievalLevel);\n                if (sharedCtxObj) {\n                    sharedCtxObj.declare = true;\n                }\n                else {\n                    this.generateSharedContextVar(value.retrievalLevel);\n                }\n            }\n        };\n        BindingScope.prototype.generateSharedContextVar = function (retrievalLevel) {\n            var lhs = variable(CONTEXT_NAME + this.freshReferenceName());\n            this.map.set(SHARED_CONTEXT_KEY + retrievalLevel, {\n                retrievalLevel: retrievalLevel,\n                lhs: lhs,\n                declareLocalCallback: function (scope, relativeLevel) {\n                    // const ctx_r0 = nextContext(2);\n                    return [lhs.set(generateNextContextExpr(relativeLevel)).toConstDecl()];\n                },\n                declare: false,\n                priority: 2 /* SHARED_CONTEXT */,\n            });\n        };\n        BindingScope.prototype.getComponentProperty = function (name) {\n            var componentValue = this.map.get(SHARED_CONTEXT_KEY + 0);\n            componentValue.declare = true;\n            this.maybeRestoreView();\n            return componentValue.lhs.prop(name);\n        };\n        BindingScope.prototype.maybeRestoreView = function () {\n            // View restoration is required for listener instructions inside embedded views, because\n            // they only run in creation mode and they can have references to the context object.\n            // If the context object changes in update mode, the reference will be incorrect, because\n            // it was established during creation.\n            if (this.isListenerScope()) {\n                if (!this.parent.restoreViewVariable) {\n                    // parent saves variable to generate a shared `const $s$ = getCurrentView();` instruction\n                    this.parent.restoreViewVariable = variable(this.parent.freshReferenceName());\n                }\n                this.restoreViewVariable = this.parent.restoreViewVariable;\n            }\n        };\n        BindingScope.prototype.restoreViewStatement = function () {\n            var statements = [];\n            if (this.restoreViewVariable) {\n                var restoreCall = instruction(null, Identifiers.restoreView, [this.restoreViewVariable]);\n                // Either `const restoredCtx = restoreView($state$);` or `restoreView($state$);`\n                // depending on whether it is being used.\n                statements.push(this.usesRestoredViewContext ?\n                    variable(RESTORED_VIEW_CONTEXT_NAME).set(restoreCall).toConstDecl() :\n                    restoreCall.toStmt());\n            }\n            return statements;\n        };\n        BindingScope.prototype.viewSnapshotStatements = function () {\n            // const $state$ = getCurrentView();\n            return this.restoreViewVariable ?\n                [this.restoreViewVariable.set(instruction(null, Identifiers.getCurrentView, [])).toConstDecl()] :\n                [];\n        };\n        BindingScope.prototype.isListenerScope = function () {\n            return this.parent && this.parent.bindingLevel === this.bindingLevel;\n        };\n        BindingScope.prototype.variableDeclarations = function () {\n            var _this = this;\n            var currentContextLevel = 0;\n            return Array.from(this.map.values())\n                .filter(function (value) { return value.declare; })\n                .sort(function (a, b) { return b.retrievalLevel - a.retrievalLevel || b.priority - a.priority; })\n                .reduce(function (stmts, value) {\n                var levelDiff = _this.bindingLevel - value.retrievalLevel;\n                var currStmts = value.declareLocalCallback(_this, levelDiff - currentContextLevel);\n                currentContextLevel = levelDiff;\n                return stmts.concat(currStmts);\n            }, []);\n        };\n        BindingScope.prototype.freshReferenceName = function () {\n            var current = this;\n            // Find the top scope as it maintains the global reference count\n            while (current.parent)\n                current = current.parent;\n            var ref = \"\" + REFERENCE_PREFIX + current.referenceNameIndex++;\n            return ref;\n        };\n        BindingScope.prototype.hasRestoreViewVariable = function () {\n            return !!this.restoreViewVariable;\n        };\n        BindingScope.prototype.notifyRestoredViewContextUse = function () {\n            this.usesRestoredViewContext = true;\n        };\n        return BindingScope;\n    }());\n    /**\n     * Creates a `CssSelector` given a tag name and a map of attributes\n     */\n    function createCssSelector(elementName, attributes) {\n        var cssSelector = new CssSelector();\n        var elementNameNoNs = splitNsName(elementName)[1];\n        cssSelector.setElement(elementNameNoNs);\n        Object.getOwnPropertyNames(attributes).forEach(function (name) {\n            var nameNoNs = splitNsName(name)[1];\n            var value = attributes[name];\n            cssSelector.addAttribute(nameNoNs, value);\n            if (name.toLowerCase() === 'class') {\n                var classes = value.trim().split(/\\s+/);\n                classes.forEach(function (className) { return cssSelector.addClassName(className); });\n            }\n        });\n        return cssSelector;\n    }\n    /**\n     * Creates an array of expressions out of an `ngProjectAs` attributes\n     * which can be added to the instruction parameters.\n     */\n    function getNgProjectAsLiteral(attribute) {\n        // Parse the attribute value into a CssSelectorList. Note that we only take the\n        // first selector, because we don't support multiple selectors in ngProjectAs.\n        var parsedR3Selector = parseSelectorToR3Selector(attribute.value)[0];\n        return [literal(5 /* ProjectAs */), asLiteral(parsedR3Selector)];\n    }\n    /**\n     * Gets the instruction to generate for an interpolated property\n     * @param interpolation An Interpolation AST\n     */\n    function getPropertyInterpolationExpression(interpolation) {\n        switch (getInterpolationArgsLength(interpolation)) {\n            case 1:\n                return Identifiers.propertyInterpolate;\n            case 3:\n                return Identifiers.propertyInterpolate1;\n            case 5:\n                return Identifiers.propertyInterpolate2;\n            case 7:\n                return Identifiers.propertyInterpolate3;\n            case 9:\n                return Identifiers.propertyInterpolate4;\n            case 11:\n                return Identifiers.propertyInterpolate5;\n            case 13:\n                return Identifiers.propertyInterpolate6;\n            case 15:\n                return Identifiers.propertyInterpolate7;\n            case 17:\n                return Identifiers.propertyInterpolate8;\n            default:\n                return Identifiers.propertyInterpolateV;\n        }\n    }\n    /**\n     * Gets the instruction to generate for an interpolated attribute\n     * @param interpolation An Interpolation AST\n     */\n    function getAttributeInterpolationExpression(interpolation) {\n        switch (getInterpolationArgsLength(interpolation)) {\n            case 3:\n                return Identifiers.attributeInterpolate1;\n            case 5:\n                return Identifiers.attributeInterpolate2;\n            case 7:\n                return Identifiers.attributeInterpolate3;\n            case 9:\n                return Identifiers.attributeInterpolate4;\n            case 11:\n                return Identifiers.attributeInterpolate5;\n            case 13:\n                return Identifiers.attributeInterpolate6;\n            case 15:\n                return Identifiers.attributeInterpolate7;\n            case 17:\n                return Identifiers.attributeInterpolate8;\n            default:\n                return Identifiers.attributeInterpolateV;\n        }\n    }\n    /**\n     * Gets the instruction to generate for interpolated text.\n     * @param interpolation An Interpolation AST\n     */\n    function getTextInterpolationExpression(interpolation) {\n        switch (getInterpolationArgsLength(interpolation)) {\n            case 1:\n                return Identifiers.textInterpolate;\n            case 3:\n                return Identifiers.textInterpolate1;\n            case 5:\n                return Identifiers.textInterpolate2;\n            case 7:\n                return Identifiers.textInterpolate3;\n            case 9:\n                return Identifiers.textInterpolate4;\n            case 11:\n                return Identifiers.textInterpolate5;\n            case 13:\n                return Identifiers.textInterpolate6;\n            case 15:\n                return Identifiers.textInterpolate7;\n            case 17:\n                return Identifiers.textInterpolate8;\n            default:\n                return Identifiers.textInterpolateV;\n        }\n    }\n    /**\n     * Parse a template into render3 `Node`s and additional metadata, with no other dependencies.\n     *\n     * @param template text of the template to parse\n     * @param templateUrl URL to use for source mapping of the parsed template\n     * @param options options to modify how the template is parsed\n     */\n    function parseTemplate(template, templateUrl, options) {\n        if (options === void 0) { options = {}; }\n        var interpolationConfig = options.interpolationConfig, preserveWhitespaces = options.preserveWhitespaces, enableI18nLegacyMessageIdFormat = options.enableI18nLegacyMessageIdFormat;\n        var bindingParser = makeBindingParser(interpolationConfig);\n        var htmlParser = new HtmlParser();\n        var parseResult = htmlParser.parse(template, templateUrl, Object.assign(Object.assign({ leadingTriviaChars: LEADING_TRIVIA_CHARS }, options), { tokenizeExpansionForms: true }));\n        if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors &&\n            parseResult.errors.length > 0) {\n            var parsedTemplate_1 = {\n                interpolationConfig: interpolationConfig,\n                preserveWhitespaces: preserveWhitespaces,\n                errors: parseResult.errors,\n                nodes: [],\n                styleUrls: [],\n                styles: [],\n                ngContentSelectors: []\n            };\n            if (options.collectCommentNodes) {\n                parsedTemplate_1.commentNodes = [];\n            }\n            return parsedTemplate_1;\n        }\n        var rootNodes = parseResult.rootNodes;\n        // process i18n meta information (scan attributes, generate ids)\n        // before we run whitespace removal process, because existing i18n\n        // extraction process (ng extract-i18n) relies on a raw content to generate\n        // message ids\n        var i18nMetaVisitor = new I18nMetaVisitor(interpolationConfig, /* keepI18nAttrs */ !preserveWhitespaces, enableI18nLegacyMessageIdFormat);\n        var i18nMetaResult = i18nMetaVisitor.visitAllWithErrors(rootNodes);\n        if (!options.alwaysAttemptHtmlToR3AstConversion && i18nMetaResult.errors &&\n            i18nMetaResult.errors.length > 0) {\n            var parsedTemplate_2 = {\n                interpolationConfig: interpolationConfig,\n                preserveWhitespaces: preserveWhitespaces,\n                errors: i18nMetaResult.errors,\n                nodes: [],\n                styleUrls: [],\n                styles: [],\n                ngContentSelectors: []\n            };\n            if (options.collectCommentNodes) {\n                parsedTemplate_2.commentNodes = [];\n            }\n            return parsedTemplate_2;\n        }\n        rootNodes = i18nMetaResult.rootNodes;\n        if (!preserveWhitespaces) {\n            rootNodes = visitAll$1(new WhitespaceVisitor(), rootNodes);\n            // run i18n meta visitor again in case whitespaces are removed (because that might affect\n            // generated i18n message content) and first pass indicated that i18n content is present in a\n            // template. During this pass i18n IDs generated at the first pass will be preserved, so we can\n            // mimic existing extraction process (ng extract-i18n)\n            if (i18nMetaVisitor.hasI18nMeta) {\n                rootNodes = visitAll$1(new I18nMetaVisitor(interpolationConfig, /* keepI18nAttrs */ false), rootNodes);\n            }\n        }\n        var _c = htmlAstToRender3Ast(rootNodes, bindingParser, { collectCommentNodes: !!options.collectCommentNodes }), nodes = _c.nodes, errors = _c.errors, styleUrls = _c.styleUrls, styles = _c.styles, ngContentSelectors = _c.ngContentSelectors, commentNodes = _c.commentNodes;\n        errors.push.apply(errors, __spreadArray(__spreadArray([], __read(parseResult.errors)), __read(i18nMetaResult.errors)));\n        var parsedTemplate = {\n            interpolationConfig: interpolationConfig,\n            preserveWhitespaces: preserveWhitespaces,\n            errors: errors.length > 0 ? errors : null,\n            nodes: nodes,\n            styleUrls: styleUrls,\n            styles: styles,\n            ngContentSelectors: ngContentSelectors\n        };\n        if (options.collectCommentNodes) {\n            parsedTemplate.commentNodes = commentNodes;\n        }\n        return parsedTemplate;\n    }\n    var elementRegistry = new DomElementSchemaRegistry();\n    /**\n     * Construct a `BindingParser` with a default configuration.\n     */\n    function makeBindingParser(interpolationConfig) {\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        return new BindingParser(new IvyParser(new Lexer()), interpolationConfig, elementRegistry, null, []);\n    }\n    function resolveSanitizationFn(context, isAttribute) {\n        switch (context) {\n            case SecurityContext.HTML:\n                return importExpr(Identifiers.sanitizeHtml);\n            case SecurityContext.SCRIPT:\n                return importExpr(Identifiers.sanitizeScript);\n            case SecurityContext.STYLE:\n                // the compiler does not fill in an instruction for [style.prop?] binding\n                // values because the style algorithm knows internally what props are subject\n                // to sanitization (only [attr.style] values are explicitly sanitized)\n                return isAttribute ? importExpr(Identifiers.sanitizeStyle) : null;\n            case SecurityContext.URL:\n                return importExpr(Identifiers.sanitizeUrl);\n            case SecurityContext.RESOURCE_URL:\n                return importExpr(Identifiers.sanitizeResourceUrl);\n            default:\n                return null;\n        }\n    }\n    function trustedConstAttribute(tagName, attr) {\n        var value = asLiteral(attr.value);\n        if (isTrustedTypesSink(tagName, attr.name)) {\n            switch (elementRegistry.securityContext(tagName, attr.name, /* isAttribute */ true)) {\n                case SecurityContext.HTML:\n                    return taggedTemplate(importExpr(Identifiers.trustConstantHtml), new TemplateLiteral([new TemplateLiteralElement(attr.value)], []), undefined, attr.valueSpan);\n                // NB: no SecurityContext.SCRIPT here, as the corresponding tags are stripped by the compiler.\n                case SecurityContext.RESOURCE_URL:\n                    return taggedTemplate(importExpr(Identifiers.trustConstantResourceUrl), new TemplateLiteral([new TemplateLiteralElement(attr.value)], []), undefined, attr.valueSpan);\n                default:\n                    return value;\n            }\n        }\n        else {\n            return value;\n        }\n    }\n    function isSingleElementTemplate(children) {\n        return children.length === 1 && children[0] instanceof Element;\n    }\n    function isTextNode(node) {\n        return node instanceof Text || node instanceof BoundText || node instanceof Icu;\n    }\n    function hasTextChildrenOnly(children) {\n        return children.every(isTextNode);\n    }\n    /** Name of the global variable that is used to determine if we use Closure translations or not */\n    var NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode';\n    /**\n     * Generate statements that define a given translation message.\n     *\n     * ```\n     * var I18N_1;\n     * if (typeof ngI18nClosureMode !== undefined && ngI18nClosureMode) {\n     *     var MSG_EXTERNAL_XXX = goog.getMsg(\n     *          \"Some message with {$interpolation}!\",\n     *          { \"interpolation\": \"\\uFFFD0\\uFFFD\" }\n     *     );\n     *     I18N_1 = MSG_EXTERNAL_XXX;\n     * }\n     * else {\n     *     I18N_1 = $localize`Some message with ${'\\uFFFD0\\uFFFD'}!`;\n     * }\n     * ```\n     *\n     * @param message The original i18n AST message node\n     * @param variable The variable that will be assigned the translation, e.g. `I18N_1`.\n     * @param closureVar The variable for Closure `goog.getMsg` calls, e.g. `MSG_EXTERNAL_XXX`.\n     * @param params Object mapping placeholder names to their values (e.g.\n     * `{ \"interpolation\": \"\\uFFFD0\\uFFFD\" }`).\n     * @param transformFn Optional transformation function that will be applied to the translation (e.g.\n     * post-processing).\n     * @returns An array of statements that defined a given translation.\n     */\n    function getTranslationDeclStmts(message, variable, closureVar, params, transformFn) {\n        if (params === void 0) { params = {}; }\n        var statements = [\n            declareI18nVariable(variable),\n            ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, i18nFormatPlaceholderNames(params, /* useCamelCase */ true)), createLocalizeStatements(variable, message, i18nFormatPlaceholderNames(params, /* useCamelCase */ false))),\n        ];\n        if (transformFn) {\n            statements.push(new ExpressionStatement(variable.set(transformFn(variable))));\n        }\n        return statements;\n    }\n    /**\n     * Create the expression that will be used to guard the closure mode block\n     * It is equivalent to:\n     *\n     * ```\n     * typeof ngI18nClosureMode !== undefined && ngI18nClosureMode\n     * ```\n     */\n    function createClosureModeGuard() {\n        return typeofExpr(variable(NG_I18N_CLOSURE_MODE))\n            .notIdentical(literal('undefined', STRING_TYPE))\n            .and(variable(NG_I18N_CLOSURE_MODE));\n    }\n\n    // This regex matches any binding names that contain the \"attr.\" prefix, e.g. \"attr.required\"\n    // If there is a match, the first matching group will contain the attribute name to bind.\n    var ATTR_REGEX = /attr\\.([^\\]]+)/;\n    function baseDirectiveFields(meta, constantPool, bindingParser) {\n        var definitionMap = new DefinitionMap();\n        var selectors = parseSelectorToR3Selector(meta.selector);\n        // e.g. `type: MyDirective`\n        definitionMap.set('type', meta.internalType);\n        // e.g. `selectors: [['', 'someDir', '']]`\n        if (selectors.length > 0) {\n            definitionMap.set('selectors', asLiteral(selectors));\n        }\n        if (meta.queries.length > 0) {\n            // e.g. `contentQueries: (rf, ctx, dirIndex) => { ... }\n            definitionMap.set('contentQueries', createContentQueriesFunction(meta.queries, constantPool, meta.name));\n        }\n        if (meta.viewQueries.length) {\n            definitionMap.set('viewQuery', createViewQueriesFunction(meta.viewQueries, constantPool, meta.name));\n        }\n        // e.g. `hostBindings: (rf, ctx) => { ... }\n        definitionMap.set('hostBindings', createHostBindingsFunction(meta.host, meta.typeSourceSpan, bindingParser, constantPool, meta.selector || '', meta.name, definitionMap));\n        // e.g 'inputs: {a: 'a'}`\n        definitionMap.set('inputs', conditionallyCreateMapObjectLiteral(meta.inputs, true));\n        // e.g 'outputs: {a: 'a'}`\n        definitionMap.set('outputs', conditionallyCreateMapObjectLiteral(meta.outputs));\n        if (meta.exportAs !== null) {\n            definitionMap.set('exportAs', literalArr(meta.exportAs.map(function (e) { return literal(e); })));\n        }\n        return definitionMap;\n    }\n    /**\n     * Add features to the definition map.\n     */\n    function addFeatures(definitionMap, meta) {\n        // e.g. `features: [NgOnChangesFeature]`\n        var features = [];\n        var providers = meta.providers;\n        var viewProviders = meta.viewProviders;\n        if (providers || viewProviders) {\n            var args = [providers || new LiteralArrayExpr([])];\n            if (viewProviders) {\n                args.push(viewProviders);\n            }\n            features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));\n        }\n        if (meta.usesInheritance) {\n            features.push(importExpr(Identifiers.InheritDefinitionFeature));\n        }\n        if (meta.fullInheritance) {\n            features.push(importExpr(Identifiers.CopyDefinitionFeature));\n        }\n        if (meta.lifecycle.usesOnChanges) {\n            features.push(importExpr(Identifiers.NgOnChangesFeature));\n        }\n        if (features.length) {\n            definitionMap.set('features', literalArr(features));\n        }\n    }\n    /**\n     * Compile a directive for the render3 runtime as defined by the `R3DirectiveMetadata`.\n     */\n    function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {\n        var definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);\n        addFeatures(definitionMap, meta);\n        var expression = importExpr(Identifiers.defineDirective).callFn([definitionMap.toLiteralMap()], undefined, true);\n        var type = createDirectiveType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Compile a component for the render3 runtime as defined by the `R3ComponentMetadata`.\n     */\n    function compileComponentFromMetadata(meta, constantPool, bindingParser) {\n        var e_1, _a;\n        var definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);\n        addFeatures(definitionMap, meta);\n        var selector = meta.selector && CssSelector.parse(meta.selector);\n        var firstSelector = selector && selector[0];\n        // e.g. `attr: [\"class\", \".my.app\"]`\n        // This is optional an only included if the first selector of a component specifies attributes.\n        if (firstSelector) {\n            var selectorAttributes = firstSelector.getAttrs();\n            if (selectorAttributes.length) {\n                definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) { return value != null ? literal(value) : literal(undefined); })), \n                /* forceShared */ true));\n            }\n        }\n        // Generate the CSS matcher that recognize directive\n        var directiveMatcher = null;\n        if (meta.directives.length > 0) {\n            var matcher = new SelectorMatcher();\n            try {\n                for (var _b = __values(meta.directives), _c = _b.next(); !_c.done; _c = _b.next()) {\n                    var _d = _c.value, selector_1 = _d.selector, type_1 = _d.type;\n                    matcher.addSelectables(CssSelector.parse(selector_1), type_1);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            directiveMatcher = matcher;\n        }\n        // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`\n        var templateTypeName = meta.name;\n        var templateName = templateTypeName ? templateTypeName + \"_Template\" : null;\n        var directivesUsed = new Set();\n        var pipesUsed = new Set();\n        var changeDetection = meta.changeDetection;\n        var template = meta.template;\n        var templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, directiveMatcher, directivesUsed, meta.pipes, pipesUsed, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);\n        var templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);\n        // We need to provide this so that dynamically generated components know what\n        // projected content blocks to pass through to the component when it is instantiated.\n        var ngContentSelectors = templateBuilder.getNgContentSelectors();\n        if (ngContentSelectors) {\n            definitionMap.set('ngContentSelectors', ngContentSelectors);\n        }\n        // e.g. `decls: 2`\n        definitionMap.set('decls', literal(templateBuilder.getConstCount()));\n        // e.g. `vars: 2`\n        definitionMap.set('vars', literal(templateBuilder.getVarCount()));\n        // Generate `consts` section of ComponentDef:\n        // - either as an array:\n        //   `consts: [['one', 'two'], ['three', 'four']]`\n        // - or as a factory function in case additional statements are present (to support i18n):\n        //   `consts: function() { var i18n_0; if (ngI18nClosureMode) {...} else {...} return [i18n_0]; }`\n        var _e = templateBuilder.getConsts(), constExpressions = _e.constExpressions, prepareStatements = _e.prepareStatements;\n        if (constExpressions.length > 0) {\n            var constsExpr = literalArr(constExpressions);\n            // Prepare statements are present - turn `consts` into a function.\n            if (prepareStatements.length > 0) {\n                constsExpr = fn([], __spreadArray(__spreadArray([], __read(prepareStatements)), [new ReturnStatement(constsExpr)]));\n            }\n            definitionMap.set('consts', constsExpr);\n        }\n        definitionMap.set('template', templateFunctionExpression);\n        // e.g. `directives: [MyDirective]`\n        if (directivesUsed.size) {\n            var directivesList = literalArr(Array.from(directivesUsed));\n            var directivesExpr = compileDeclarationList(directivesList, meta.declarationListEmitMode);\n            definitionMap.set('directives', directivesExpr);\n        }\n        // e.g. `pipes: [MyPipe]`\n        if (pipesUsed.size) {\n            var pipesList = literalArr(Array.from(pipesUsed));\n            var pipesExpr = compileDeclarationList(pipesList, meta.declarationListEmitMode);\n            definitionMap.set('pipes', pipesExpr);\n        }\n        if (meta.encapsulation === null) {\n            meta.encapsulation = ViewEncapsulation.Emulated;\n        }\n        // e.g. `styles: [str1, str2]`\n        if (meta.styles && meta.styles.length) {\n            var styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?\n                compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :\n                meta.styles;\n            var strings = styleValues.map(function (str) { return constantPool.getConstLiteral(literal(str)); });\n            definitionMap.set('styles', literalArr(strings));\n        }\n        else if (meta.encapsulation === ViewEncapsulation.Emulated) {\n            // If there is no style, don't generate css selectors on elements\n            meta.encapsulation = ViewEncapsulation.None;\n        }\n        // Only set view encapsulation if it's not the default value\n        if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n            definitionMap.set('encapsulation', literal(meta.encapsulation));\n        }\n        // e.g. `animation: [trigger('123', [])]`\n        if (meta.animations !== null) {\n            definitionMap.set('data', literalMap([{ key: 'animation', value: meta.animations, quoted: false }]));\n        }\n        // Only set the change detection flag if it's defined and it's not the default.\n        if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {\n            definitionMap.set('changeDetection', literal(changeDetection));\n        }\n        var expression = importExpr(Identifiers.defineComponent).callFn([definitionMap.toLiteralMap()], undefined, true);\n        var type = createComponentType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Creates the type specification from the component meta. This type is inserted into .d.ts files\n     * to be consumed by upstream compilations.\n     */\n    function createComponentType(meta) {\n        var typeParams = createDirectiveTypeParams(meta);\n        typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));\n        return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));\n    }\n    /**\n     * Compiles the array literal of declarations into an expression according to the provided emit\n     * mode.\n     */\n    function compileDeclarationList(list, mode) {\n        switch (mode) {\n            case 0 /* Direct */:\n                // directives: [MyDir],\n                return list;\n            case 1 /* Closure */:\n                // directives: function () { return [MyDir]; }\n                return fn([], [new ReturnStatement(list)]);\n            case 2 /* ClosureResolved */:\n                // directives: function () { return [MyDir].map(ng.resolveForwardRef); }\n                var resolvedList = list.callMethod('map', [importExpr(Identifiers.resolveForwardRef)]);\n                return fn([], [new ReturnStatement(resolvedList)]);\n        }\n    }\n    function prepareQueryParams(query, constantPool) {\n        var parameters = [getQueryPredicate(query, constantPool), literal(toQueryFlags(query))];\n        if (query.read) {\n            parameters.push(query.read);\n        }\n        return parameters;\n    }\n    /**\n     * Translates query flags into `TQueryFlags` type in packages/core/src/render3/interfaces/query.ts\n     * @param query\n     */\n    function toQueryFlags(query) {\n        return (query.descendants ? 1 /* descendants */ : 0 /* none */) |\n            (query.static ? 2 /* isStatic */ : 0 /* none */) |\n            (query.emitDistinctChangesOnly ? 4 /* emitDistinctChangesOnly */ : 0 /* none */);\n    }\n    function convertAttributesToExpressions(attributes) {\n        var e_2, _a;\n        var values = [];\n        try {\n            for (var _b = __values(Object.getOwnPropertyNames(attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var key = _c.value;\n                var value = attributes[key];\n                values.push(literal(key), value);\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        return values;\n    }\n    // Define and update any content queries\n    function createContentQueriesFunction(queries, constantPool, name) {\n        var e_3, _a;\n        var createStatements = [];\n        var updateStatements = [];\n        var tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);\n        try {\n            for (var queries_1 = __values(queries), queries_1_1 = queries_1.next(); !queries_1_1.done; queries_1_1 = queries_1.next()) {\n                var query = queries_1_1.value;\n                // creation, e.g. r3.contentQuery(dirIndex, somePredicate, true, null);\n                createStatements.push(importExpr(Identifiers.contentQuery)\n                    .callFn(__spreadArray([variable('dirIndex')], __read(prepareQueryParams(query, constantPool))))\n                    .toStmt());\n                // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));\n                var temporary = tempAllocator();\n                var getQueryList = importExpr(Identifiers.loadQuery).callFn([]);\n                var refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);\n                var updateDirective = variable(CONTEXT_NAME)\n                    .prop(query.propertyName)\n                    .set(query.first ? temporary.prop('first') : temporary);\n                updateStatements.push(refresh.and(updateDirective).toStmt());\n            }\n        }\n        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n        finally {\n            try {\n                if (queries_1_1 && !queries_1_1.done && (_a = queries_1.return)) _a.call(queries_1);\n            }\n            finally { if (e_3) throw e_3.error; }\n        }\n        var contentQueriesFnName = name ? name + \"_ContentQueries\" : null;\n        return fn([\n            new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null),\n            new FnParam('dirIndex', null)\n        ], [\n            renderFlagCheckIfStmt(1 /* Create */, createStatements),\n            renderFlagCheckIfStmt(2 /* Update */, updateStatements)\n        ], INFERRED_TYPE, null, contentQueriesFnName);\n    }\n    function stringAsType(str) {\n        return expressionType(literal(str));\n    }\n    function stringMapAsType(map) {\n        var mapValues = Object.keys(map).map(function (key) {\n            var value = Array.isArray(map[key]) ? map[key][0] : map[key];\n            return {\n                key: key,\n                value: literal(value),\n                quoted: true,\n            };\n        });\n        return expressionType(literalMap(mapValues));\n    }\n    function stringArrayAsType(arr) {\n        return arr.length > 0 ? expressionType(literalArr(arr.map(function (value) { return literal(value); }))) :\n            NONE_TYPE;\n    }\n    function createDirectiveTypeParams(meta) {\n        // On the type side, remove newlines from the selector as it will need to fit into a TypeScript\n        // string literal, which must be on one line.\n        var selectorForType = meta.selector !== null ? meta.selector.replace(/\\n/g, '') : null;\n        return [\n            typeWithParameters(meta.type.type, meta.typeArgumentCount),\n            selectorForType !== null ? stringAsType(selectorForType) : NONE_TYPE,\n            meta.exportAs !== null ? stringArrayAsType(meta.exportAs) : NONE_TYPE,\n            stringMapAsType(meta.inputs),\n            stringMapAsType(meta.outputs),\n            stringArrayAsType(meta.queries.map(function (q) { return q.propertyName; })),\n        ];\n    }\n    /**\n     * Creates the type specification from the directive meta. This type is inserted into .d.ts files\n     * to be consumed by upstream compilations.\n     */\n    function createDirectiveType(meta) {\n        var typeParams = createDirectiveTypeParams(meta);\n        return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));\n    }\n    // Define and update any view queries\n    function createViewQueriesFunction(viewQueries, constantPool, name) {\n        var createStatements = [];\n        var updateStatements = [];\n        var tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);\n        viewQueries.forEach(function (query) {\n            // creation, e.g. r3.viewQuery(somePredicate, true);\n            var queryDefinition = importExpr(Identifiers.viewQuery).callFn(prepareQueryParams(query, constantPool));\n            createStatements.push(queryDefinition.toStmt());\n            // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));\n            var temporary = tempAllocator();\n            var getQueryList = importExpr(Identifiers.loadQuery).callFn([]);\n            var refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);\n            var updateDirective = variable(CONTEXT_NAME)\n                .prop(query.propertyName)\n                .set(query.first ? temporary.prop('first') : temporary);\n            updateStatements.push(refresh.and(updateDirective).toStmt());\n        });\n        var viewQueryFnName = name ? name + \"_Query\" : null;\n        return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [\n            renderFlagCheckIfStmt(1 /* Create */, createStatements),\n            renderFlagCheckIfStmt(2 /* Update */, updateStatements)\n        ], INFERRED_TYPE, null, viewQueryFnName);\n    }\n    // Return a host binding function or null if one is not necessary.\n    function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindingParser, constantPool, selector, name, definitionMap) {\n        var bindingContext = variable(CONTEXT_NAME);\n        var styleBuilder = new StylingBuilder(bindingContext);\n        var _a = hostBindingsMetadata.specialAttributes, styleAttr = _a.styleAttr, classAttr = _a.classAttr;\n        if (styleAttr !== undefined) {\n            styleBuilder.registerStyleAttr(styleAttr);\n        }\n        if (classAttr !== undefined) {\n            styleBuilder.registerClassAttr(classAttr);\n        }\n        var createStatements = [];\n        var updateStatements = [];\n        var hostBindingSourceSpan = typeSourceSpan;\n        var directiveSummary = metadataAsSummary(hostBindingsMetadata);\n        // Calculate host event bindings\n        var eventBindings = bindingParser.createDirectiveHostEventAsts(directiveSummary, hostBindingSourceSpan);\n        if (eventBindings && eventBindings.length) {\n            var listeners = createHostListeners(eventBindings, name);\n            createStatements.push.apply(createStatements, __spreadArray([], __read(listeners)));\n        }\n        // Calculate the host property bindings\n        var bindings = bindingParser.createBoundHostProperties(directiveSummary, hostBindingSourceSpan);\n        var allOtherBindings = [];\n        // We need to calculate the total amount of binding slots required by\n        // all the instructions together before any value conversions happen.\n        // Value conversions may require additional slots for interpolation and\n        // bindings with pipes. These calculates happen after this block.\n        var totalHostVarsCount = 0;\n        bindings && bindings.forEach(function (binding) {\n            var stylingInputWasSet = styleBuilder.registerInputBasedOnName(binding.name, binding.expression, hostBindingSourceSpan);\n            if (stylingInputWasSet) {\n                totalHostVarsCount += MIN_STYLING_BINDING_SLOTS_REQUIRED;\n            }\n            else {\n                allOtherBindings.push(binding);\n                totalHostVarsCount++;\n            }\n        });\n        var valueConverter;\n        var getValueConverter = function () {\n            if (!valueConverter) {\n                var hostVarsCountFn = function (numSlots) {\n                    var originalVarsCount = totalHostVarsCount;\n                    totalHostVarsCount += numSlots;\n                    return originalVarsCount;\n                };\n                valueConverter = new ValueConverter(constantPool, function () { return error('Unexpected node'); }, // new nodes are illegal here\n                hostVarsCountFn, function () { return error('Unexpected pipe'); }); // pipes are illegal here\n            }\n            return valueConverter;\n        };\n        var propertyBindings = [];\n        var attributeBindings = [];\n        var syntheticHostBindings = [];\n        allOtherBindings.forEach(function (binding) {\n            // resolve literal arrays and literal objects\n            var value = binding.expression.visit(getValueConverter());\n            var bindingExpr = bindingFn(bindingContext, value);\n            var _a = getBindingNameAndInstruction(binding), bindingName = _a.bindingName, instruction = _a.instruction, isAttribute = _a.isAttribute;\n            var securityContexts = bindingParser.calcPossibleSecurityContexts(selector, bindingName, isAttribute)\n                .filter(function (context) { return context !== SecurityContext.NONE; });\n            var sanitizerFn = null;\n            if (securityContexts.length) {\n                if (securityContexts.length === 2 &&\n                    securityContexts.indexOf(SecurityContext.URL) > -1 &&\n                    securityContexts.indexOf(SecurityContext.RESOURCE_URL) > -1) {\n                    // Special case for some URL attributes (such as \"src\" and \"href\") that may be a part\n                    // of different security contexts. In this case we use special sanitization function and\n                    // select the actual sanitizer at runtime based on a tag name that is provided while\n                    // invoking sanitization function.\n                    sanitizerFn = importExpr(Identifiers.sanitizeUrlOrResourceUrl);\n                }\n                else {\n                    sanitizerFn = resolveSanitizationFn(securityContexts[0], isAttribute);\n                }\n            }\n            var instructionParams = [literal(bindingName), bindingExpr.currValExpr];\n            if (sanitizerFn) {\n                instructionParams.push(sanitizerFn);\n            }\n            updateStatements.push.apply(updateStatements, __spreadArray([], __read(bindingExpr.stmts)));\n            if (instruction === Identifiers.hostProperty) {\n                propertyBindings.push(instructionParams);\n            }\n            else if (instruction === Identifiers.attribute) {\n                attributeBindings.push(instructionParams);\n            }\n            else if (instruction === Identifiers.syntheticHostProperty) {\n                syntheticHostBindings.push(instructionParams);\n            }\n            else {\n                updateStatements.push(importExpr(instruction).callFn(instructionParams).toStmt());\n            }\n        });\n        if (propertyBindings.length > 0) {\n            updateStatements.push(chainedInstruction(Identifiers.hostProperty, propertyBindings).toStmt());\n        }\n        if (attributeBindings.length > 0) {\n            updateStatements.push(chainedInstruction(Identifiers.attribute, attributeBindings).toStmt());\n        }\n        if (syntheticHostBindings.length > 0) {\n            updateStatements.push(chainedInstruction(Identifiers.syntheticHostProperty, syntheticHostBindings).toStmt());\n        }\n        // since we're dealing with directives/components and both have hostBinding\n        // functions, we need to generate a special hostAttrs instruction that deals\n        // with both the assignment of styling as well as static attributes to the host\n        // element. The instruction below will instruct all initial styling (styling\n        // that is inside of a host binding within a directive/component) to be attached\n        // to the host element alongside any of the provided host attributes that were\n        // collected earlier.\n        var hostAttrs = convertAttributesToExpressions(hostBindingsMetadata.attributes);\n        styleBuilder.assignHostAttrs(hostAttrs, definitionMap);\n        if (styleBuilder.hasBindings) {\n            // finally each binding that was registered in the statement above will need to be added to\n            // the update block of a component/directive templateFn/hostBindingsFn so that the bindings\n            // are evaluated and updated for the element.\n            styleBuilder.buildUpdateLevelInstructions(getValueConverter()).forEach(function (instruction) {\n                if (instruction.calls.length > 0) {\n                    var calls_1 = [];\n                    instruction.calls.forEach(function (call) {\n                        // we subtract a value of `1` here because the binding slot was already allocated\n                        // at the top of this method when all the input bindings were counted.\n                        totalHostVarsCount +=\n                            Math.max(call.allocateBindingSlots - MIN_STYLING_BINDING_SLOTS_REQUIRED, 0);\n                        calls_1.push(convertStylingCall(call, bindingContext, bindingFn));\n                    });\n                    updateStatements.push(chainedInstruction(instruction.reference, calls_1).toStmt());\n                }\n            });\n        }\n        if (totalHostVarsCount) {\n            definitionMap.set('hostVars', literal(totalHostVarsCount));\n        }\n        if (createStatements.length > 0 || updateStatements.length > 0) {\n            var hostBindingsFnName = name ? name + \"_HostBindings\" : null;\n            var statements = [];\n            if (createStatements.length > 0) {\n                statements.push(renderFlagCheckIfStmt(1 /* Create */, createStatements));\n            }\n            if (updateStatements.length > 0) {\n                statements.push(renderFlagCheckIfStmt(2 /* Update */, updateStatements));\n            }\n            return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], statements, INFERRED_TYPE, null, hostBindingsFnName);\n        }\n        return null;\n    }\n    function bindingFn(implicit, value) {\n        return convertPropertyBinding(null, implicit, value, 'b', BindingForm.Expression, function () { return error('Unexpected interpolation'); });\n    }\n    function convertStylingCall(call, bindingContext, bindingFn) {\n        return call.params(function (value) { return bindingFn(bindingContext, value).currValExpr; });\n    }\n    function getBindingNameAndInstruction(binding) {\n        var bindingName = binding.name;\n        var instruction;\n        // Check to see if this is an attr binding or a property binding\n        var attrMatches = bindingName.match(ATTR_REGEX);\n        if (attrMatches) {\n            bindingName = attrMatches[1];\n            instruction = Identifiers.attribute;\n        }\n        else {\n            if (binding.isAnimation) {\n                bindingName = prepareSyntheticPropertyName(bindingName);\n                // host bindings that have a synthetic property (e.g. @foo) should always be rendered\n                // in the context of the component and not the parent. Therefore there is a special\n                // compatibility instruction available for this purpose.\n                instruction = Identifiers.syntheticHostProperty;\n            }\n            else {\n                instruction = Identifiers.hostProperty;\n            }\n        }\n        return { bindingName: bindingName, instruction: instruction, isAttribute: !!attrMatches };\n    }\n    function createHostListeners(eventBindings, name) {\n        var listeners = [];\n        var syntheticListeners = [];\n        var instructions = [];\n        eventBindings.forEach(function (binding) {\n            var bindingName = binding.name && sanitizeIdentifier(binding.name);\n            var bindingFnName = binding.type === 1 /* Animation */ ?\n                prepareSyntheticListenerFunctionName(bindingName, binding.targetOrPhase) :\n                bindingName;\n            var handlerName = name && bindingName ? name + \"_\" + bindingFnName + \"_HostBindingHandler\" : null;\n            var params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding), handlerName);\n            if (binding.type == 1 /* Animation */) {\n                syntheticListeners.push(params);\n            }\n            else {\n                listeners.push(params);\n            }\n        });\n        if (syntheticListeners.length > 0) {\n            instructions.push(chainedInstruction(Identifiers.syntheticHostListener, syntheticListeners).toStmt());\n        }\n        if (listeners.length > 0) {\n            instructions.push(chainedInstruction(Identifiers.listener, listeners).toStmt());\n        }\n        return instructions;\n    }\n    function metadataAsSummary(meta) {\n        // clang-format off\n        return {\n            // This is used by the BindingParser, which only deals with listeners and properties. There's no\n            // need to pass attributes to it.\n            hostAttributes: {},\n            hostListeners: meta.listeners,\n            hostProperties: meta.properties,\n        };\n        // clang-format on\n    }\n    var HOST_REG_EXP$1 = /^(?:\\[([^\\]]+)\\])|(?:\\(([^\\)]+)\\))$/;\n    function parseHostBindings(host) {\n        var e_4, _a;\n        var attributes = {};\n        var listeners = {};\n        var properties = {};\n        var specialAttributes = {};\n        try {\n            for (var _b = __values(Object.keys(host)), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var key = _c.value;\n                var value = host[key];\n                var matches = key.match(HOST_REG_EXP$1);\n                if (matches === null) {\n                    switch (key) {\n                        case 'class':\n                            if (typeof value !== 'string') {\n                                // TODO(alxhub): make this a diagnostic.\n                                throw new Error(\"Class binding must be string\");\n                            }\n                            specialAttributes.classAttr = value;\n                            break;\n                        case 'style':\n                            if (typeof value !== 'string') {\n                                // TODO(alxhub): make this a diagnostic.\n                                throw new Error(\"Style binding must be string\");\n                            }\n                            specialAttributes.styleAttr = value;\n                            break;\n                        default:\n                            if (typeof value === 'string') {\n                                attributes[key] = literal(value);\n                            }\n                            else {\n                                attributes[key] = value;\n                            }\n                    }\n                }\n                else if (matches[1 /* Binding */] != null) {\n                    if (typeof value !== 'string') {\n                        // TODO(alxhub): make this a diagnostic.\n                        throw new Error(\"Property binding must be string\");\n                    }\n                    // synthetic properties (the ones that have a `@` as a prefix)\n                    // are still treated the same as regular properties. Therefore\n                    // there is no point in storing them in a separate map.\n                    properties[matches[1 /* Binding */]] = value;\n                }\n                else if (matches[2 /* Event */] != null) {\n                    if (typeof value !== 'string') {\n                        // TODO(alxhub): make this a diagnostic.\n                        throw new Error(\"Event binding must be string\");\n                    }\n                    listeners[matches[2 /* Event */]] = value;\n                }\n            }\n        }\n        catch (e_4_1) { e_4 = { error: e_4_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_4) throw e_4.error; }\n        }\n        return { attributes: attributes, listeners: listeners, properties: properties, specialAttributes: specialAttributes };\n    }\n    /**\n     * Verifies host bindings and returns the list of errors (if any). Empty array indicates that a\n     * given set of host bindings has no errors.\n     *\n     * @param bindings set of host bindings to verify.\n     * @param sourceSpan source span where host bindings were defined.\n     * @returns array of errors associated with a given set of host bindings.\n     */\n    function verifyHostBindings(bindings, sourceSpan) {\n        var summary = metadataAsSummary(bindings);\n        // TODO: abstract out host bindings verification logic and use it instead of\n        // creating events and properties ASTs to detect errors (FW-996)\n        var bindingParser = makeBindingParser();\n        bindingParser.createDirectiveHostEventAsts(summary, sourceSpan);\n        bindingParser.createBoundHostProperties(summary, sourceSpan);\n        return bindingParser.errors;\n    }\n    function compileStyles(styles, selector, hostSelector) {\n        var shadowCss = new ShadowCss();\n        return styles.map(function (style) {\n            return shadowCss.shimCssText(style, selector, hostSelector);\n        });\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An interface for retrieving documents by URL that the compiler uses to\n     * load templates.\n     *\n     * This is an abstract class, rather than an interface, so that it can be used\n     * as injection token.\n     */\n    var ResourceLoader = /** @class */ (function () {\n        function ResourceLoader() {\n        }\n        return ResourceLoader;\n    }());\n\n    var CompilerFacadeImpl = /** @class */ (function () {\n        function CompilerFacadeImpl(jitEvaluator) {\n            if (jitEvaluator === void 0) { jitEvaluator = new JitEvaluator(); }\n            this.jitEvaluator = jitEvaluator;\n            this.FactoryTarget = exports.FactoryTarget;\n            this.ResourceLoader = ResourceLoader;\n            this.elementSchemaRegistry = new DomElementSchemaRegistry();\n        }\n        CompilerFacadeImpl.prototype.compilePipe = function (angularCoreEnv, sourceMapUrl, facade) {\n            var metadata = {\n                name: facade.name,\n                type: wrapReference(facade.type),\n                internalType: new WrappedNodeExpr(facade.type),\n                typeArgumentCount: 0,\n                deps: null,\n                pipeName: facade.pipeName,\n                pure: facade.pure,\n            };\n            var res = compilePipeFromMetadata(metadata);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);\n        };\n        CompilerFacadeImpl.prototype.compilePipeDeclaration = function (angularCoreEnv, sourceMapUrl, declaration) {\n            var meta = convertDeclarePipeFacadeToMetadata(declaration);\n            var res = compilePipeFromMetadata(meta);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);\n        };\n        CompilerFacadeImpl.prototype.compileInjectable = function (angularCoreEnv, sourceMapUrl, facade) {\n            var _a;\n            var _j = compileInjectable({\n                name: facade.name,\n                type: wrapReference(facade.type),\n                internalType: new WrappedNodeExpr(facade.type),\n                typeArgumentCount: facade.typeArgumentCount,\n                providedIn: computeProvidedIn(facade.providedIn),\n                useClass: convertToProviderExpression(facade, USE_CLASS),\n                useFactory: wrapExpression(facade, USE_FACTORY),\n                useValue: convertToProviderExpression(facade, USE_VALUE),\n                useExisting: convertToProviderExpression(facade, USE_EXISTING),\n                deps: (_a = facade.deps) === null || _a === void 0 ? void 0 : _a.map(convertR3DependencyMetadata),\n            }, \n            /* resolveForwardRefs */ true), expression = _j.expression, statements = _j.statements;\n            return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements);\n        };\n        CompilerFacadeImpl.prototype.compileInjectableDeclaration = function (angularCoreEnv, sourceMapUrl, facade) {\n            var _a;\n            var _j = compileInjectable({\n                name: facade.type.name,\n                type: wrapReference(facade.type),\n                internalType: new WrappedNodeExpr(facade.type),\n                typeArgumentCount: 0,\n                providedIn: computeProvidedIn(facade.providedIn),\n                useClass: convertToProviderExpression(facade, USE_CLASS),\n                useFactory: wrapExpression(facade, USE_FACTORY),\n                useValue: convertToProviderExpression(facade, USE_VALUE),\n                useExisting: convertToProviderExpression(facade, USE_EXISTING),\n                deps: (_a = facade.deps) === null || _a === void 0 ? void 0 : _a.map(convertR3DeclareDependencyMetadata),\n            }, \n            /* resolveForwardRefs */ true), expression = _j.expression, statements = _j.statements;\n            return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements);\n        };\n        CompilerFacadeImpl.prototype.compileInjector = function (angularCoreEnv, sourceMapUrl, facade) {\n            var meta = {\n                name: facade.name,\n                type: wrapReference(facade.type),\n                internalType: new WrappedNodeExpr(facade.type),\n                providers: new WrappedNodeExpr(facade.providers),\n                imports: facade.imports.map(function (i) { return new WrappedNodeExpr(i); }),\n            };\n            var res = compileInjector(meta);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);\n        };\n        CompilerFacadeImpl.prototype.compileInjectorDeclaration = function (angularCoreEnv, sourceMapUrl, declaration) {\n            var meta = convertDeclareInjectorFacadeToMetadata(declaration);\n            var res = compileInjector(meta);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);\n        };\n        CompilerFacadeImpl.prototype.compileNgModule = function (angularCoreEnv, sourceMapUrl, facade) {\n            var meta = {\n                type: wrapReference(facade.type),\n                internalType: new WrappedNodeExpr(facade.type),\n                adjacentType: new WrappedNodeExpr(facade.type),\n                bootstrap: facade.bootstrap.map(wrapReference),\n                declarations: facade.declarations.map(wrapReference),\n                imports: facade.imports.map(wrapReference),\n                exports: facade.exports.map(wrapReference),\n                emitInline: true,\n                containsForwardDecls: false,\n                schemas: facade.schemas ? facade.schemas.map(wrapReference) : null,\n                id: facade.id ? new WrappedNodeExpr(facade.id) : null,\n            };\n            var res = compileNgModule(meta);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);\n        };\n        CompilerFacadeImpl.prototype.compileNgModuleDeclaration = function (angularCoreEnv, sourceMapUrl, declaration) {\n            var expression = compileNgModuleDeclarationExpression(declaration);\n            return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, []);\n        };\n        CompilerFacadeImpl.prototype.compileDirective = function (angularCoreEnv, sourceMapUrl, facade) {\n            var meta = convertDirectiveFacadeToMetadata(facade);\n            return this.compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta);\n        };\n        CompilerFacadeImpl.prototype.compileDirectiveDeclaration = function (angularCoreEnv, sourceMapUrl, declaration) {\n            var typeSourceSpan = this.createParseSourceSpan('Directive', declaration.type.name, sourceMapUrl);\n            var meta = convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan);\n            return this.compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta);\n        };\n        CompilerFacadeImpl.prototype.compileDirectiveFromMeta = function (angularCoreEnv, sourceMapUrl, meta) {\n            var constantPool = new ConstantPool();\n            var bindingParser = makeBindingParser();\n            var res = compileDirectiveFromMetadata(meta, constantPool, bindingParser);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements);\n        };\n        CompilerFacadeImpl.prototype.compileComponent = function (angularCoreEnv, sourceMapUrl, facade) {\n            // Parse the template and check for errors.\n            var _j = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation), template = _j.template, interpolation = _j.interpolation;\n            // Compile the component metadata, including template, into an expression.\n            var meta = Object.assign(Object.assign(Object.assign({}, facade), convertDirectiveFacadeToMetadata(facade)), { selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(), template: template, declarationListEmitMode: 0 /* Direct */, styles: __spreadArray(__spreadArray([], __read(facade.styles)), __read(template.styles)), encapsulation: facade.encapsulation, interpolation: interpolation, changeDetection: facade.changeDetection, animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null, viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) :\n                    null, relativeContextFilePath: '', i18nUseExternalIds: true });\n            var jitExpressionSourceMap = \"ng:///\" + facade.name + \".js\";\n            return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);\n        };\n        CompilerFacadeImpl.prototype.compileComponentDeclaration = function (angularCoreEnv, sourceMapUrl, declaration) {\n            var typeSourceSpan = this.createParseSourceSpan('Component', declaration.type.name, sourceMapUrl);\n            var meta = convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl);\n            return this.compileComponentFromMeta(angularCoreEnv, sourceMapUrl, meta);\n        };\n        CompilerFacadeImpl.prototype.compileComponentFromMeta = function (angularCoreEnv, sourceMapUrl, meta) {\n            var constantPool = new ConstantPool();\n            var bindingParser = makeBindingParser(meta.interpolation);\n            var res = compileComponentFromMetadata(meta, constantPool, bindingParser);\n            return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements);\n        };\n        CompilerFacadeImpl.prototype.compileFactory = function (angularCoreEnv, sourceMapUrl, meta) {\n            var factoryRes = compileFactoryFunction({\n                name: meta.name,\n                type: wrapReference(meta.type),\n                internalType: new WrappedNodeExpr(meta.type),\n                typeArgumentCount: meta.typeArgumentCount,\n                deps: convertR3DependencyMetadataArray(meta.deps),\n                target: meta.target,\n            });\n            return this.jitExpression(factoryRes.expression, angularCoreEnv, sourceMapUrl, factoryRes.statements);\n        };\n        CompilerFacadeImpl.prototype.compileFactoryDeclaration = function (angularCoreEnv, sourceMapUrl, meta) {\n            var factoryRes = compileFactoryFunction({\n                name: meta.type.name,\n                type: wrapReference(meta.type),\n                internalType: new WrappedNodeExpr(meta.type),\n                typeArgumentCount: 0,\n                deps: meta.deps && meta.deps.map(convertR3DeclareDependencyMetadata),\n                target: meta.target,\n            });\n            return this.jitExpression(factoryRes.expression, angularCoreEnv, sourceMapUrl, factoryRes.statements);\n        };\n        CompilerFacadeImpl.prototype.createParseSourceSpan = function (kind, typeName, sourceUrl) {\n            return r3JitTypeSourceSpan(kind, typeName, sourceUrl);\n        };\n        /**\n         * JIT compiles an expression and returns the result of executing that expression.\n         *\n         * @param def the definition which will be compiled and executed to get the value to patch\n         * @param context an object map of @angular/core symbol names to symbols which will be available\n         * in the context of the compiled expression\n         * @param sourceUrl a URL to use for the source map of the compiled expression\n         * @param preStatements a collection of statements that should be evaluated before the expression.\n         */\n        CompilerFacadeImpl.prototype.jitExpression = function (def, context, sourceUrl, preStatements) {\n            // The ConstantPool may contain Statements which declare variables used in the final expression.\n            // Therefore, its statements need to precede the actual JIT operation. The final statement is a\n            // declaration of $def which is set to the expression being compiled.\n            var statements = __spreadArray(__spreadArray([], __read(preStatements)), [\n                new DeclareVarStmt('$def', def, undefined, [exports.StmtModifier.Exported]),\n            ]);\n            var res = this.jitEvaluator.evaluateStatements(sourceUrl, statements, new R3JitReflector(context), /* enableSourceMaps */ true);\n            return res['$def'];\n        };\n        return CompilerFacadeImpl;\n    }());\n    var USE_CLASS = Object.keys({ useClass: null })[0];\n    var USE_FACTORY = Object.keys({ useFactory: null })[0];\n    var USE_VALUE = Object.keys({ useValue: null })[0];\n    var USE_EXISTING = Object.keys({ useExisting: null })[0];\n    function convertToR3QueryMetadata(facade) {\n        return Object.assign(Object.assign({}, facade), { predicate: Array.isArray(facade.predicate) ? facade.predicate :\n                new WrappedNodeExpr(facade.predicate), read: facade.read ? new WrappedNodeExpr(facade.read) : null, static: facade.static, emitDistinctChangesOnly: facade.emitDistinctChangesOnly });\n    }\n    function convertQueryDeclarationToMetadata(declaration) {\n        var _a, _b, _c, _d;\n        return {\n            propertyName: declaration.propertyName,\n            first: (_a = declaration.first) !== null && _a !== void 0 ? _a : false,\n            predicate: Array.isArray(declaration.predicate) ? declaration.predicate :\n                new WrappedNodeExpr(declaration.predicate),\n            descendants: (_b = declaration.descendants) !== null && _b !== void 0 ? _b : false,\n            read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,\n            static: (_c = declaration.static) !== null && _c !== void 0 ? _c : false,\n            emitDistinctChangesOnly: (_d = declaration.emitDistinctChangesOnly) !== null && _d !== void 0 ? _d : true,\n        };\n    }\n    function convertDirectiveFacadeToMetadata(facade) {\n        var inputsFromMetadata = parseInputOutputs(facade.inputs || []);\n        var outputsFromMetadata = parseInputOutputs(facade.outputs || []);\n        var propMetadata = facade.propMetadata;\n        var inputsFromType = {};\n        var outputsFromType = {};\n        var _loop_1 = function (field) {\n            if (propMetadata.hasOwnProperty(field)) {\n                propMetadata[field].forEach(function (ann) {\n                    if (isInput(ann)) {\n                        inputsFromType[field] =\n                            ann.bindingPropertyName ? [ann.bindingPropertyName, field] : field;\n                    }\n                    else if (isOutput(ann)) {\n                        outputsFromType[field] = ann.bindingPropertyName || field;\n                    }\n                });\n            }\n        };\n        for (var field in propMetadata) {\n            _loop_1(field);\n        }\n        return Object.assign(Object.assign({}, facade), { typeArgumentCount: 0, typeSourceSpan: facade.typeSourceSpan, type: wrapReference(facade.type), internalType: new WrappedNodeExpr(facade.type), deps: null, host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host), inputs: Object.assign(Object.assign({}, inputsFromMetadata), inputsFromType), outputs: Object.assign(Object.assign({}, outputsFromMetadata), outputsFromType), queries: facade.queries.map(convertToR3QueryMetadata), providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null, viewQueries: facade.viewQueries.map(convertToR3QueryMetadata), fullInheritance: false });\n    }\n    function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {\n        var _a, _b, _c, _d, _e, _f, _g, _h;\n        return {\n            name: declaration.type.name,\n            type: wrapReference(declaration.type),\n            typeSourceSpan: typeSourceSpan,\n            internalType: new WrappedNodeExpr(declaration.type),\n            selector: (_a = declaration.selector) !== null && _a !== void 0 ? _a : null,\n            inputs: (_b = declaration.inputs) !== null && _b !== void 0 ? _b : {},\n            outputs: (_c = declaration.outputs) !== null && _c !== void 0 ? _c : {},\n            host: convertHostDeclarationToMetadata(declaration.host),\n            queries: ((_d = declaration.queries) !== null && _d !== void 0 ? _d : []).map(convertQueryDeclarationToMetadata),\n            viewQueries: ((_e = declaration.viewQueries) !== null && _e !== void 0 ? _e : []).map(convertQueryDeclarationToMetadata),\n            providers: declaration.providers !== undefined ? new WrappedNodeExpr(declaration.providers) :\n                null,\n            exportAs: (_f = declaration.exportAs) !== null && _f !== void 0 ? _f : null,\n            usesInheritance: (_g = declaration.usesInheritance) !== null && _g !== void 0 ? _g : false,\n            lifecycle: { usesOnChanges: (_h = declaration.usesOnChanges) !== null && _h !== void 0 ? _h : false },\n            deps: null,\n            typeArgumentCount: 0,\n            fullInheritance: false,\n        };\n    }\n    function convertHostDeclarationToMetadata(host) {\n        if (host === void 0) { host = {}; }\n        var _a, _b, _c;\n        return {\n            attributes: convertOpaqueValuesToExpressions((_a = host.attributes) !== null && _a !== void 0 ? _a : {}),\n            listeners: (_b = host.listeners) !== null && _b !== void 0 ? _b : {},\n            properties: (_c = host.properties) !== null && _c !== void 0 ? _c : {},\n            specialAttributes: {\n                classAttr: host.classAttribute,\n                styleAttr: host.styleAttribute,\n            },\n        };\n    }\n    function convertOpaqueValuesToExpressions(obj) {\n        var e_1, _j;\n        var result = {};\n        try {\n            for (var _k = __values(Object.keys(obj)), _l = _k.next(); !_l.done; _l = _k.next()) {\n                var key = _l.value;\n                result[key] = new WrappedNodeExpr(obj[key]);\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (_l && !_l.done && (_j = _k.return)) _j.call(_k);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return result;\n    }\n    function convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl) {\n        var _a, _b, _c, _d, _e, _f;\n        var _j = parseJitTemplate(declaration.template, declaration.type.name, sourceMapUrl, (_a = declaration.preserveWhitespaces) !== null && _a !== void 0 ? _a : false, declaration.interpolation), template = _j.template, interpolation = _j.interpolation;\n        return Object.assign(Object.assign({}, convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan)), { template: template, styles: (_b = declaration.styles) !== null && _b !== void 0 ? _b : [], directives: ((_c = declaration.components) !== null && _c !== void 0 ? _c : [])\n                .concat((_d = declaration.directives) !== null && _d !== void 0 ? _d : [])\n                .map(convertUsedDirectiveDeclarationToMetadata), pipes: convertUsedPipesToMetadata(declaration.pipes), viewProviders: declaration.viewProviders !== undefined ?\n                new WrappedNodeExpr(declaration.viewProviders) :\n                null, animations: declaration.animations !== undefined ? new WrappedNodeExpr(declaration.animations) :\n                null, changeDetection: (_e = declaration.changeDetection) !== null && _e !== void 0 ? _e : ChangeDetectionStrategy.Default, encapsulation: (_f = declaration.encapsulation) !== null && _f !== void 0 ? _f : ViewEncapsulation.Emulated, interpolation: interpolation, declarationListEmitMode: 2 /* ClosureResolved */, relativeContextFilePath: '', i18nUseExternalIds: true });\n    }\n    function convertUsedDirectiveDeclarationToMetadata(declaration) {\n        var _a, _b, _c;\n        return {\n            selector: declaration.selector,\n            type: new WrappedNodeExpr(declaration.type),\n            inputs: (_a = declaration.inputs) !== null && _a !== void 0 ? _a : [],\n            outputs: (_b = declaration.outputs) !== null && _b !== void 0 ? _b : [],\n            exportAs: (_c = declaration.exportAs) !== null && _c !== void 0 ? _c : null,\n        };\n    }\n    function convertUsedPipesToMetadata(declaredPipes) {\n        var e_2, _j;\n        var pipes = new Map();\n        if (declaredPipes === undefined) {\n            return pipes;\n        }\n        try {\n            for (var _k = __values(Object.keys(declaredPipes)), _l = _k.next(); !_l.done; _l = _k.next()) {\n                var pipeName = _l.value;\n                var pipeType = declaredPipes[pipeName];\n                pipes.set(pipeName, new WrappedNodeExpr(pipeType));\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (_l && !_l.done && (_j = _k.return)) _j.call(_k);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        return pipes;\n    }\n    function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, interpolation) {\n        var interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;\n        // Parse the template and check for errors.\n        var parsed = parseTemplate(template, sourceMapUrl, { preserveWhitespaces: preserveWhitespaces, interpolationConfig: interpolationConfig });\n        if (parsed.errors !== null) {\n            var errors = parsed.errors.map(function (err) { return err.toString(); }).join(', ');\n            throw new Error(\"Errors during JIT compilation of template for \" + typeName + \": \" + errors);\n        }\n        return { template: parsed, interpolation: interpolationConfig };\n    }\n    /**\n     * Convert the expression, if present to an `R3ProviderExpression`.\n     *\n     * In JIT mode we do not want the compiler to wrap the expression in a `forwardRef()` call because,\n     * if it is referencing a type that has not yet been defined, it will have already been wrapped in\n     * a `forwardRef()` - either by the application developer or during partial-compilation. Thus we can\n     * set `isForwardRef` to `false`.\n     */\n    function convertToProviderExpression(obj, property) {\n        if (obj.hasOwnProperty(property)) {\n            return createR3ProviderExpression(new WrappedNodeExpr(obj[property]), /* isForwardRef */ false);\n        }\n        else {\n            return undefined;\n        }\n    }\n    function wrapExpression(obj, property) {\n        if (obj.hasOwnProperty(property)) {\n            return new WrappedNodeExpr(obj[property]);\n        }\n        else {\n            return undefined;\n        }\n    }\n    function computeProvidedIn(providedIn) {\n        var expression = (providedIn == null || typeof providedIn === 'string') ?\n            new LiteralExpr(providedIn !== null && providedIn !== void 0 ? providedIn : null) :\n            new WrappedNodeExpr(providedIn);\n        // See `convertToProviderExpression()` for why `isForwardRef` is false.\n        return createR3ProviderExpression(expression, /* isForwardRef */ false);\n    }\n    function convertR3DependencyMetadataArray(facades) {\n        return facades == null ? null : facades.map(convertR3DependencyMetadata);\n    }\n    function convertR3DependencyMetadata(facade) {\n        var isAttributeDep = facade.attribute != null; // both `null` and `undefined`\n        var rawToken = facade.token === null ? null : new WrappedNodeExpr(facade.token);\n        // In JIT mode, if the dep is an `@Attribute()` then we use the attribute name given in\n        // `attribute` rather than the `token`.\n        var token = isAttributeDep ? new WrappedNodeExpr(facade.attribute) : rawToken;\n        return createR3DependencyMetadata(token, isAttributeDep, facade.host, facade.optional, facade.self, facade.skipSelf);\n    }\n    function convertR3DeclareDependencyMetadata(facade) {\n        var _a, _b, _c, _d, _e;\n        var isAttributeDep = (_a = facade.attribute) !== null && _a !== void 0 ? _a : false;\n        var token = facade.token === null ? null : new WrappedNodeExpr(facade.token);\n        return createR3DependencyMetadata(token, isAttributeDep, (_b = facade.host) !== null && _b !== void 0 ? _b : false, (_c = facade.optional) !== null && _c !== void 0 ? _c : false, (_d = facade.self) !== null && _d !== void 0 ? _d : false, (_e = facade.skipSelf) !== null && _e !== void 0 ? _e : false);\n    }\n    function createR3DependencyMetadata(token, isAttributeDep, host, optional, self, skipSelf) {\n        // If the dep is an `@Attribute()` the `attributeNameType` ought to be the `unknown` type.\n        // But types are not available at runtime so we just use a literal `\"<unknown>\"` string as a dummy\n        // marker.\n        var attributeNameType = isAttributeDep ? literal('unknown') : null;\n        return { token: token, attributeNameType: attributeNameType, host: host, optional: optional, self: self, skipSelf: skipSelf };\n    }\n    function extractHostBindings(propMetadata, sourceSpan, host) {\n        // First parse the declarations from the metadata.\n        var bindings = parseHostBindings(host || {});\n        // After that check host bindings for errors\n        var errors = verifyHostBindings(bindings, sourceSpan);\n        if (errors.length) {\n            throw new Error(errors.map(function (error) { return error.msg; }).join('\\n'));\n        }\n        var _loop_2 = function (field) {\n            if (propMetadata.hasOwnProperty(field)) {\n                propMetadata[field].forEach(function (ann) {\n                    if (isHostBinding(ann)) {\n                        // Since this is a decorator, we know that the value is a class member. Always access it\n                        // through `this` so that further down the line it can't be confused for a literal value\n                        // (e.g. if there's a property called `true`).\n                        bindings.properties[ann.hostPropertyName || field] =\n                            getSafePropertyAccessString('this', field);\n                    }\n                    else if (isHostListener(ann)) {\n                        bindings.listeners[ann.eventName || field] = field + \"(\" + (ann.args || []).join(',') + \")\";\n                    }\n                });\n            }\n        };\n        // Next, loop over the properties of the object, looking for @HostBinding and @HostListener.\n        for (var field in propMetadata) {\n            _loop_2(field);\n        }\n        return bindings;\n    }\n    function isHostBinding(value) {\n        return value.ngMetadataName === 'HostBinding';\n    }\n    function isHostListener(value) {\n        return value.ngMetadataName === 'HostListener';\n    }\n    function isInput(value) {\n        return value.ngMetadataName === 'Input';\n    }\n    function isOutput(value) {\n        return value.ngMetadataName === 'Output';\n    }\n    function parseInputOutputs(values) {\n        return values.reduce(function (map, value) {\n            var _j = __read(value.split(',').map(function (piece) { return piece.trim(); }), 2), field = _j[0], property = _j[1];\n            map[field] = property || field;\n            return map;\n        }, {});\n    }\n    function convertDeclarePipeFacadeToMetadata(declaration) {\n        var _a;\n        return {\n            name: declaration.type.name,\n            type: wrapReference(declaration.type),\n            internalType: new WrappedNodeExpr(declaration.type),\n            typeArgumentCount: 0,\n            pipeName: declaration.name,\n            deps: null,\n            pure: (_a = declaration.pure) !== null && _a !== void 0 ? _a : true,\n        };\n    }\n    function convertDeclareInjectorFacadeToMetadata(declaration) {\n        return {\n            name: declaration.type.name,\n            type: wrapReference(declaration.type),\n            internalType: new WrappedNodeExpr(declaration.type),\n            providers: declaration.providers !== undefined ? new WrappedNodeExpr(declaration.providers) :\n                null,\n            imports: declaration.imports !== undefined ?\n                declaration.imports.map(function (i) { return new WrappedNodeExpr(i); }) :\n                [],\n        };\n    }\n    function publishFacade(global) {\n        var ng = global.ng || (global.ng = {});\n        ng.ɵcompilerFacade = new CompilerFacadeImpl();\n    }\n\n    /**\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://angular.io/license\n     */\n    var VERSION$1 = new Version('12.2.1');\n\n    /**\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://angular.io/license\n     */\n    var CompilerConfig = /** @class */ (function () {\n        function CompilerConfig(_a) {\n            var _b = _a === void 0 ? {} : _a, _c = _b.defaultEncapsulation, defaultEncapsulation = _c === void 0 ? ViewEncapsulation.Emulated : _c, _d = _b.useJit, useJit = _d === void 0 ? true : _d, _e = _b.jitDevMode, jitDevMode = _e === void 0 ? false : _e, _f = _b.missingTranslation, missingTranslation = _f === void 0 ? null : _f, preserveWhitespaces = _b.preserveWhitespaces, strictInjectionParameters = _b.strictInjectionParameters;\n            this.defaultEncapsulation = defaultEncapsulation;\n            this.useJit = !!useJit;\n            this.jitDevMode = !!jitDevMode;\n            this.missingTranslation = missingTranslation;\n            this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));\n            this.strictInjectionParameters = strictInjectionParameters === true;\n        }\n        return CompilerConfig;\n    }());\n    function preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting) {\n        if (defaultSetting === void 0) { defaultSetting = false; }\n        return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;\n    }\n\n    var DirectiveNormalizer = /** @class */ (function () {\n        function DirectiveNormalizer(_resourceLoader, _urlResolver, _htmlParser, _config) {\n            this._resourceLoader = _resourceLoader;\n            this._urlResolver = _urlResolver;\n            this._htmlParser = _htmlParser;\n            this._config = _config;\n            this._resourceLoaderCache = new Map();\n        }\n        DirectiveNormalizer.prototype.clearCache = function () {\n            this._resourceLoaderCache.clear();\n        };\n        DirectiveNormalizer.prototype.clearCacheFor = function (normalizedDirective) {\n            var _this = this;\n            if (!normalizedDirective.isComponent) {\n                return;\n            }\n            var template = normalizedDirective.template;\n            this._resourceLoaderCache.delete(template.templateUrl);\n            template.externalStylesheets.forEach(function (stylesheet) {\n                _this._resourceLoaderCache.delete(stylesheet.moduleUrl);\n            });\n        };\n        DirectiveNormalizer.prototype._fetch = function (url) {\n            var result = this._resourceLoaderCache.get(url);\n            if (!result) {\n                result = this._resourceLoader.get(url);\n                this._resourceLoaderCache.set(url, result);\n            }\n            return result;\n        };\n        DirectiveNormalizer.prototype.normalizeTemplate = function (prenormData) {\n            var _this = this;\n            if (isDefined(prenormData.template)) {\n                if (isDefined(prenormData.templateUrl)) {\n                    throw syntaxError(\"'\" + stringify(prenormData\n                        .componentType) + \"' component cannot define both template and templateUrl\");\n                }\n                if (typeof prenormData.template !== 'string') {\n                    throw syntaxError(\"The template specified for component \" + stringify(prenormData.componentType) + \" is not a string\");\n                }\n            }\n            else if (isDefined(prenormData.templateUrl)) {\n                if (typeof prenormData.templateUrl !== 'string') {\n                    throw syntaxError(\"The templateUrl specified for component \" + stringify(prenormData.componentType) + \" is not a string\");\n                }\n            }\n            else {\n                throw syntaxError(\"No template specified for component \" + stringify(prenormData.componentType));\n            }\n            if (isDefined(prenormData.preserveWhitespaces) &&\n                typeof prenormData.preserveWhitespaces !== 'boolean') {\n                throw syntaxError(\"The preserveWhitespaces option for component \" + stringify(prenormData.componentType) + \" must be a boolean\");\n            }\n            return SyncAsync.then(this._preParseTemplate(prenormData), function (preparsedTemplate) { return _this._normalizeTemplateMetadata(prenormData, preparsedTemplate); });\n        };\n        DirectiveNormalizer.prototype._preParseTemplate = function (prenomData) {\n            var _this = this;\n            var template;\n            var templateUrl;\n            if (prenomData.template != null) {\n                template = prenomData.template;\n                templateUrl = prenomData.moduleUrl;\n            }\n            else {\n                templateUrl = this._urlResolver.resolve(prenomData.moduleUrl, prenomData.templateUrl);\n                template = this._fetch(templateUrl);\n            }\n            return SyncAsync.then(template, function (template) { return _this._preparseLoadedTemplate(prenomData, template, templateUrl); });\n        };\n        DirectiveNormalizer.prototype._preparseLoadedTemplate = function (prenormData, template, templateAbsUrl) {\n            var isInline = !!prenormData.template;\n            var interpolationConfig = InterpolationConfig.fromArray(prenormData.interpolation);\n            var templateUrl = templateSourceUrl({ reference: prenormData.ngModuleType }, { type: { reference: prenormData.componentType } }, { isInline: isInline, templateUrl: templateAbsUrl });\n            var rootNodesAndErrors = this._htmlParser.parse(template, templateUrl, { tokenizeExpansionForms: true, interpolationConfig: interpolationConfig });\n            if (rootNodesAndErrors.errors.length > 0) {\n                var errorString = rootNodesAndErrors.errors.join('\\n');\n                throw syntaxError(\"Template parse errors:\\n\" + errorString);\n            }\n            var templateMetadataStyles = this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: prenormData.styles, moduleUrl: prenormData.moduleUrl }));\n            var visitor = new TemplatePreparseVisitor();\n            visitAll$1(visitor, rootNodesAndErrors.rootNodes);\n            var templateStyles = this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: visitor.styles, styleUrls: visitor.styleUrls, moduleUrl: templateAbsUrl }));\n            var styles = templateMetadataStyles.styles.concat(templateStyles.styles);\n            var inlineStyleUrls = templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls);\n            var styleUrls = this\n                ._normalizeStylesheet(new CompileStylesheetMetadata({ styleUrls: prenormData.styleUrls, moduleUrl: prenormData.moduleUrl }))\n                .styleUrls;\n            return {\n                template: template,\n                templateUrl: templateAbsUrl,\n                isInline: isInline,\n                htmlAst: rootNodesAndErrors,\n                styles: styles,\n                inlineStyleUrls: inlineStyleUrls,\n                styleUrls: styleUrls,\n                ngContentSelectors: visitor.ngContentSelectors,\n            };\n        };\n        DirectiveNormalizer.prototype._normalizeTemplateMetadata = function (prenormData, preparsedTemplate) {\n            var _this = this;\n            return SyncAsync.then(this._loadMissingExternalStylesheets(preparsedTemplate.styleUrls.concat(preparsedTemplate.inlineStyleUrls)), function (externalStylesheets) { return _this._normalizeLoadedTemplateMetadata(prenormData, preparsedTemplate, externalStylesheets); });\n        };\n        DirectiveNormalizer.prototype._normalizeLoadedTemplateMetadata = function (prenormData, preparsedTemplate, stylesheets) {\n            var _this = this;\n            // Algorithm:\n            // - produce exactly 1 entry per original styleUrl in\n            // CompileTemplateMetadata.externalStylesheets with all styles inlined\n            // - inline all styles that are referenced by the template into CompileTemplateMetadata.styles.\n            // Reason: be able to determine how many stylesheets there are even without loading\n            // the template nor the stylesheets, so we can create a stub for TypeScript always synchronously\n            // (as resource loading may be async)\n            var styles = __spreadArray([], __read(preparsedTemplate.styles));\n            this._inlineStyles(preparsedTemplate.inlineStyleUrls, stylesheets, styles);\n            var styleUrls = preparsedTemplate.styleUrls;\n            var externalStylesheets = styleUrls.map(function (styleUrl) {\n                var stylesheet = stylesheets.get(styleUrl);\n                var styles = __spreadArray([], __read(stylesheet.styles));\n                _this._inlineStyles(stylesheet.styleUrls, stylesheets, styles);\n                return new CompileStylesheetMetadata({ moduleUrl: styleUrl, styles: styles });\n            });\n            var encapsulation = prenormData.encapsulation;\n            if (encapsulation == null) {\n                encapsulation = this._config.defaultEncapsulation;\n            }\n            if (encapsulation === ViewEncapsulation.Emulated && styles.length === 0 &&\n                styleUrls.length === 0) {\n                encapsulation = ViewEncapsulation.None;\n            }\n            return new CompileTemplateMetadata({\n                encapsulation: encapsulation,\n                template: preparsedTemplate.template,\n                templateUrl: preparsedTemplate.templateUrl,\n                htmlAst: preparsedTemplate.htmlAst,\n                styles: styles,\n                styleUrls: styleUrls,\n                ngContentSelectors: preparsedTemplate.ngContentSelectors,\n                animations: prenormData.animations,\n                interpolation: prenormData.interpolation,\n                isInline: preparsedTemplate.isInline,\n                externalStylesheets: externalStylesheets,\n                preserveWhitespaces: preserveWhitespacesDefault(prenormData.preserveWhitespaces, this._config.preserveWhitespaces),\n            });\n        };\n        DirectiveNormalizer.prototype._inlineStyles = function (styleUrls, stylesheets, targetStyles) {\n            var _this = this;\n            styleUrls.forEach(function (styleUrl) {\n                var stylesheet = stylesheets.get(styleUrl);\n                stylesheet.styles.forEach(function (style) { return targetStyles.push(style); });\n                _this._inlineStyles(stylesheet.styleUrls, stylesheets, targetStyles);\n            });\n        };\n        DirectiveNormalizer.prototype._loadMissingExternalStylesheets = function (styleUrls, loadedStylesheets) {\n            var _this = this;\n            if (loadedStylesheets === void 0) { loadedStylesheets = new Map(); }\n            return SyncAsync.then(SyncAsync.all(styleUrls.filter(function (styleUrl) { return !loadedStylesheets.has(styleUrl); })\n                .map(function (styleUrl) { return SyncAsync.then(_this._fetch(styleUrl), function (loadedStyle) {\n                var stylesheet = _this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: [loadedStyle], moduleUrl: styleUrl }));\n                loadedStylesheets.set(styleUrl, stylesheet);\n                return _this._loadMissingExternalStylesheets(stylesheet.styleUrls, loadedStylesheets);\n            }); })), function (_) { return loadedStylesheets; });\n        };\n        DirectiveNormalizer.prototype._normalizeStylesheet = function (stylesheet) {\n            var _this = this;\n            var moduleUrl = stylesheet.moduleUrl;\n            var allStyleUrls = stylesheet.styleUrls.filter(isStyleUrlResolvable)\n                .map(function (url) { return _this._urlResolver.resolve(moduleUrl, url); });\n            var allStyles = stylesheet.styles.map(function (style) {\n                var styleWithImports = extractStyleUrls(_this._urlResolver, moduleUrl, style);\n                allStyleUrls.push.apply(allStyleUrls, __spreadArray([], __read(styleWithImports.styleUrls)));\n                return styleWithImports.style;\n            });\n            return new CompileStylesheetMetadata({ styles: allStyles, styleUrls: allStyleUrls, moduleUrl: moduleUrl });\n        };\n        return DirectiveNormalizer;\n    }());\n    var TemplatePreparseVisitor = /** @class */ (function () {\n        function TemplatePreparseVisitor() {\n            this.ngContentSelectors = [];\n            this.styles = [];\n            this.styleUrls = [];\n            this.ngNonBindableStackCount = 0;\n        }\n        TemplatePreparseVisitor.prototype.visitElement = function (ast, context) {\n            var preparsedElement = preparseElement(ast);\n            switch (preparsedElement.type) {\n                case PreparsedElementType.NG_CONTENT:\n                    if (this.ngNonBindableStackCount === 0) {\n                        this.ngContentSelectors.push(preparsedElement.selectAttr);\n                    }\n                    break;\n                case PreparsedElementType.STYLE:\n                    var textContent_1 = '';\n                    ast.children.forEach(function (child) {\n                        if (child instanceof Text$3) {\n                            textContent_1 += child.value;\n                        }\n                    });\n                    this.styles.push(textContent_1);\n                    break;\n                case PreparsedElementType.STYLESHEET:\n                    this.styleUrls.push(preparsedElement.hrefAttr);\n                    break;\n                default:\n                    break;\n            }\n            if (preparsedElement.nonBindable) {\n                this.ngNonBindableStackCount++;\n            }\n            visitAll$1(this, ast.children);\n            if (preparsedElement.nonBindable) {\n                this.ngNonBindableStackCount--;\n            }\n            return null;\n        };\n        TemplatePreparseVisitor.prototype.visitExpansion = function (ast, context) {\n            visitAll$1(this, ast.cases);\n        };\n        TemplatePreparseVisitor.prototype.visitExpansionCase = function (ast, context) {\n            visitAll$1(this, ast.expression);\n        };\n        TemplatePreparseVisitor.prototype.visitComment = function (ast, context) {\n            return null;\n        };\n        TemplatePreparseVisitor.prototype.visitAttribute = function (ast, context) {\n            return null;\n        };\n        TemplatePreparseVisitor.prototype.visitText = function (ast, context) {\n            return null;\n        };\n        return TemplatePreparseVisitor;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var QUERY_METADATA_IDENTIFIERS = [\n        createViewChild,\n        createViewChildren,\n        createContentChild,\n        createContentChildren,\n    ];\n    /*\n     * Resolve a `Type` for {@link Directive}.\n     *\n     * This interface can be overridden by the application developer to create custom behavior.\n     *\n     * See {@link Compiler}\n     */\n    var DirectiveResolver = /** @class */ (function () {\n        function DirectiveResolver(_reflector) {\n            this._reflector = _reflector;\n        }\n        DirectiveResolver.prototype.isDirective = function (type) {\n            var typeMetadata = this._reflector.annotations(resolveForwardRef(type));\n            return typeMetadata && typeMetadata.some(isDirectiveMetadata);\n        };\n        DirectiveResolver.prototype.resolve = function (type, throwIfNotFound) {\n            if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n            var typeMetadata = this._reflector.annotations(resolveForwardRef(type));\n            if (typeMetadata) {\n                var metadata = findLast(typeMetadata, isDirectiveMetadata);\n                if (metadata) {\n                    var propertyMetadata = this._reflector.propMetadata(type);\n                    var guards = this._reflector.guards(type);\n                    return this._mergeWithPropertyMetadata(metadata, propertyMetadata, guards, type);\n                }\n            }\n            if (throwIfNotFound) {\n                throw new Error(\"No Directive annotation found on \" + stringify(type));\n            }\n            return null;\n        };\n        DirectiveResolver.prototype._mergeWithPropertyMetadata = function (dm, propertyMetadata, guards, directiveType) {\n            var inputs = [];\n            var outputs = [];\n            var host = {};\n            var queries = {};\n            Object.keys(propertyMetadata).forEach(function (propName) {\n                var input = findLast(propertyMetadata[propName], function (a) { return createInput.isTypeOf(a); });\n                if (input) {\n                    if (input.bindingPropertyName) {\n                        inputs.push(propName + \": \" + input.bindingPropertyName);\n                    }\n                    else {\n                        inputs.push(propName);\n                    }\n                }\n                var output = findLast(propertyMetadata[propName], function (a) { return createOutput.isTypeOf(a); });\n                if (output) {\n                    if (output.bindingPropertyName) {\n                        outputs.push(propName + \": \" + output.bindingPropertyName);\n                    }\n                    else {\n                        outputs.push(propName);\n                    }\n                }\n                var hostBindings = propertyMetadata[propName].filter(function (a) { return createHostBinding.isTypeOf(a); });\n                hostBindings.forEach(function (hostBinding) {\n                    if (hostBinding.hostPropertyName) {\n                        var startWith = hostBinding.hostPropertyName[0];\n                        if (startWith === '(') {\n                            throw new Error(\"@HostBinding can not bind to events. Use @HostListener instead.\");\n                        }\n                        else if (startWith === '[') {\n                            throw new Error(\"@HostBinding parameter should be a property name, 'class.<name>', or 'attr.<name>'.\");\n                        }\n                        host[\"[\" + hostBinding.hostPropertyName + \"]\"] = propName;\n                    }\n                    else {\n                        host[\"[\" + propName + \"]\"] = propName;\n                    }\n                });\n                var hostListeners = propertyMetadata[propName].filter(function (a) { return createHostListener.isTypeOf(a); });\n                hostListeners.forEach(function (hostListener) {\n                    var args = hostListener.args || [];\n                    host[\"(\" + hostListener.eventName + \")\"] = propName + \"(\" + args.join(',') + \")\";\n                });\n                var query = findLast(propertyMetadata[propName], function (a) { return QUERY_METADATA_IDENTIFIERS.some(function (i) { return i.isTypeOf(a); }); });\n                if (query) {\n                    queries[propName] = query;\n                }\n            });\n            return this._merge(dm, inputs, outputs, host, queries, guards, directiveType);\n        };\n        DirectiveResolver.prototype._extractPublicName = function (def) {\n            return splitAtColon(def, [null, def])[1].trim();\n        };\n        DirectiveResolver.prototype._dedupeBindings = function (bindings) {\n            var names = new Set();\n            var publicNames = new Set();\n            var reversedResult = [];\n            // go last to first to allow later entries to overwrite previous entries\n            for (var i = bindings.length - 1; i >= 0; i--) {\n                var binding = bindings[i];\n                var name = this._extractPublicName(binding);\n                publicNames.add(name);\n                if (!names.has(name)) {\n                    names.add(name);\n                    reversedResult.push(binding);\n                }\n            }\n            return reversedResult.reverse();\n        };\n        DirectiveResolver.prototype._merge = function (directive, inputs, outputs, host, queries, guards, directiveType) {\n            var mergedInputs = this._dedupeBindings(directive.inputs ? directive.inputs.concat(inputs) : inputs);\n            var mergedOutputs = this._dedupeBindings(directive.outputs ? directive.outputs.concat(outputs) : outputs);\n            var mergedHost = directive.host ? Object.assign(Object.assign({}, directive.host), host) : host;\n            var mergedQueries = directive.queries ? Object.assign(Object.assign({}, directive.queries), queries) : queries;\n            if (createComponent.isTypeOf(directive)) {\n                var comp = directive;\n                return createComponent({\n                    selector: comp.selector,\n                    inputs: mergedInputs,\n                    outputs: mergedOutputs,\n                    host: mergedHost,\n                    exportAs: comp.exportAs,\n                    moduleId: comp.moduleId,\n                    queries: mergedQueries,\n                    changeDetection: comp.changeDetection,\n                    providers: comp.providers,\n                    viewProviders: comp.viewProviders,\n                    entryComponents: comp.entryComponents,\n                    template: comp.template,\n                    templateUrl: comp.templateUrl,\n                    styles: comp.styles,\n                    styleUrls: comp.styleUrls,\n                    encapsulation: comp.encapsulation,\n                    animations: comp.animations,\n                    interpolation: comp.interpolation,\n                    preserveWhitespaces: directive.preserveWhitespaces,\n                });\n            }\n            else {\n                return createDirective({\n                    selector: directive.selector,\n                    inputs: mergedInputs,\n                    outputs: mergedOutputs,\n                    host: mergedHost,\n                    exportAs: directive.exportAs,\n                    queries: mergedQueries,\n                    providers: directive.providers,\n                    guards: guards\n                });\n            }\n        };\n        return DirectiveResolver;\n    }());\n    function isDirectiveMetadata(type) {\n        return createDirective.isTypeOf(type) || createComponent.isTypeOf(type);\n    }\n    function findLast(arr, condition) {\n        for (var i = arr.length - 1; i >= 0; i--) {\n            if (condition(arr[i])) {\n                return arr[i];\n            }\n        }\n        return null;\n    }\n\n    var _I18N_ATTR = 'i18n';\n    var _I18N_ATTR_PREFIX = 'i18n-';\n    var _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;\n    var MEANING_SEPARATOR = '|';\n    var ID_SEPARATOR = '@@';\n    var i18nCommentsWarned = false;\n    /**\n     * Extract translatable messages from an html AST\n     */\n    function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {\n        var visitor = new _Visitor$2(implicitTags, implicitAttrs);\n        return visitor.extract(nodes, interpolationConfig);\n    }\n    function mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {\n        var visitor = new _Visitor$2(implicitTags, implicitAttrs);\n        return visitor.merge(nodes, translations, interpolationConfig);\n    }\n    var ExtractionResult = /** @class */ (function () {\n        function ExtractionResult(messages, errors) {\n            this.messages = messages;\n            this.errors = errors;\n        }\n        return ExtractionResult;\n    }());\n    var _VisitorMode;\n    (function (_VisitorMode) {\n        _VisitorMode[_VisitorMode[\"Extract\"] = 0] = \"Extract\";\n        _VisitorMode[_VisitorMode[\"Merge\"] = 1] = \"Merge\";\n    })(_VisitorMode || (_VisitorMode = {}));\n    /**\n     * This Visitor is used:\n     * 1. to extract all the translatable strings from an html AST (see `extract()`),\n     * 2. to replace the translatable strings with the actual translations (see `merge()`)\n     *\n     * @internal\n     */\n    var _Visitor$2 = /** @class */ (function () {\n        function _Visitor(_implicitTags, _implicitAttrs) {\n            this._implicitTags = _implicitTags;\n            this._implicitAttrs = _implicitAttrs;\n        }\n        /**\n         * Extracts the messages from the tree\n         */\n        _Visitor.prototype.extract = function (nodes, interpolationConfig) {\n            var _this = this;\n            this._init(_VisitorMode.Extract, interpolationConfig);\n            nodes.forEach(function (node) { return node.visit(_this, null); });\n            if (this._inI18nBlock) {\n                this._reportError(nodes[nodes.length - 1], 'Unclosed block');\n            }\n            return new ExtractionResult(this._messages, this._errors);\n        };\n        /**\n         * Returns a tree where all translatable nodes are translated\n         */\n        _Visitor.prototype.merge = function (nodes, translations, interpolationConfig) {\n            this._init(_VisitorMode.Merge, interpolationConfig);\n            this._translations = translations;\n            // Construct a single fake root element\n            var wrapper = new Element$1('wrapper', [], nodes, undefined, undefined, undefined);\n            var translatedNode = wrapper.visit(this, null);\n            if (this._inI18nBlock) {\n                this._reportError(nodes[nodes.length - 1], 'Unclosed block');\n            }\n            return new ParseTreeResult(translatedNode.children, this._errors);\n        };\n        _Visitor.prototype.visitExpansionCase = function (icuCase, context) {\n            // Parse cases for translatable html attributes\n            var expression = visitAll$1(this, icuCase.expression, context);\n            if (this._mode === _VisitorMode.Merge) {\n                return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);\n            }\n        };\n        _Visitor.prototype.visitExpansion = function (icu, context) {\n            this._mayBeAddBlockChildren(icu);\n            var wasInIcu = this._inIcu;\n            if (!this._inIcu) {\n                // nested ICU messages should not be extracted but top-level translated as a whole\n                if (this._isInTranslatableSection) {\n                    this._addMessage([icu]);\n                }\n                this._inIcu = true;\n            }\n            var cases = visitAll$1(this, icu.cases, context);\n            if (this._mode === _VisitorMode.Merge) {\n                icu = new Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan);\n            }\n            this._inIcu = wasInIcu;\n            return icu;\n        };\n        _Visitor.prototype.visitComment = function (comment, context) {\n            var isOpening = _isOpeningComment(comment);\n            if (isOpening && this._isInTranslatableSection) {\n                this._reportError(comment, 'Could not start a block inside a translatable section');\n                return;\n            }\n            var isClosing = _isClosingComment(comment);\n            if (isClosing && !this._inI18nBlock) {\n                this._reportError(comment, 'Trying to close an unopened block');\n                return;\n            }\n            if (!this._inI18nNode && !this._inIcu) {\n                if (!this._inI18nBlock) {\n                    if (isOpening) {\n                        // deprecated from v5 you should use <ng-container i18n> instead of i18n comments\n                        if (!i18nCommentsWarned && console && console.warn) {\n                            i18nCommentsWarned = true;\n                            var details = comment.sourceSpan.details ? \", \" + comment.sourceSpan.details : '';\n                            // TODO(ocombe): use a log service once there is a public one available\n                            console.warn(\"I18n comments are deprecated, use an <ng-container> element instead (\" + comment.sourceSpan.start + details + \")\");\n                        }\n                        this._inI18nBlock = true;\n                        this._blockStartDepth = this._depth;\n                        this._blockChildren = [];\n                        this._blockMeaningAndDesc =\n                            comment.value.replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim();\n                        this._openTranslatableSection(comment);\n                    }\n                }\n                else {\n                    if (isClosing) {\n                        if (this._depth == this._blockStartDepth) {\n                            this._closeTranslatableSection(comment, this._blockChildren);\n                            this._inI18nBlock = false;\n                            var message = this._addMessage(this._blockChildren, this._blockMeaningAndDesc);\n                            // merge attributes in sections\n                            var nodes = this._translateMessage(comment, message);\n                            return visitAll$1(this, nodes);\n                        }\n                        else {\n                            this._reportError(comment, 'I18N blocks should not cross element boundaries');\n                            return;\n                        }\n                    }\n                }\n            }\n        };\n        _Visitor.prototype.visitText = function (text, context) {\n            if (this._isInTranslatableSection) {\n                this._mayBeAddBlockChildren(text);\n            }\n            return text;\n        };\n        _Visitor.prototype.visitElement = function (el, context) {\n            var _this = this;\n            this._mayBeAddBlockChildren(el);\n            this._depth++;\n            var wasInI18nNode = this._inI18nNode;\n            var wasInImplicitNode = this._inImplicitNode;\n            var childNodes = [];\n            var translatedChildNodes = undefined;\n            // Extract:\n            // - top level nodes with the (implicit) \"i18n\" attribute if not already in a section\n            // - ICU messages\n            var i18nAttr = _getI18nAttr(el);\n            var i18nMeta = i18nAttr ? i18nAttr.value : '';\n            var isImplicit = this._implicitTags.some(function (tag) { return el.name === tag; }) && !this._inIcu &&\n                !this._isInTranslatableSection;\n            var isTopLevelImplicit = !wasInImplicitNode && isImplicit;\n            this._inImplicitNode = wasInImplicitNode || isImplicit;\n            if (!this._isInTranslatableSection && !this._inIcu) {\n                if (i18nAttr || isTopLevelImplicit) {\n                    this._inI18nNode = true;\n                    var message = this._addMessage(el.children, i18nMeta);\n                    translatedChildNodes = this._translateMessage(el, message);\n                }\n                if (this._mode == _VisitorMode.Extract) {\n                    var isTranslatable = i18nAttr || isTopLevelImplicit;\n                    if (isTranslatable)\n                        this._openTranslatableSection(el);\n                    visitAll$1(this, el.children);\n                    if (isTranslatable)\n                        this._closeTranslatableSection(el, el.children);\n                }\n            }\n            else {\n                if (i18nAttr || isTopLevelImplicit) {\n                    this._reportError(el, 'Could not mark an element as translatable inside a translatable section');\n                }\n                if (this._mode == _VisitorMode.Extract) {\n                    // Descend into child nodes for extraction\n                    visitAll$1(this, el.children);\n                }\n            }\n            if (this._mode === _VisitorMode.Merge) {\n                var visitNodes = translatedChildNodes || el.children;\n                visitNodes.forEach(function (child) {\n                    var visited = child.visit(_this, context);\n                    if (visited && !_this._isInTranslatableSection) {\n                        // Do not add the children from translatable sections (= i18n blocks here)\n                        // They will be added later in this loop when the block closes (i.e. on `<!-- /i18n -->`)\n                        childNodes = childNodes.concat(visited);\n                    }\n                });\n            }\n            this._visitAttributesOf(el);\n            this._depth--;\n            this._inI18nNode = wasInI18nNode;\n            this._inImplicitNode = wasInImplicitNode;\n            if (this._mode === _VisitorMode.Merge) {\n                var translatedAttrs = this._translateAttributes(el);\n                return new Element$1(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n            }\n            return null;\n        };\n        _Visitor.prototype.visitAttribute = function (attribute, context) {\n            throw new Error('unreachable code');\n        };\n        _Visitor.prototype._init = function (mode, interpolationConfig) {\n            this._mode = mode;\n            this._inI18nBlock = false;\n            this._inI18nNode = false;\n            this._depth = 0;\n            this._inIcu = false;\n            this._msgCountAtSectionStart = undefined;\n            this._errors = [];\n            this._messages = [];\n            this._inImplicitNode = false;\n            this._createI18nMessage = createI18nMessageFactory(interpolationConfig);\n        };\n        // looks for translatable attributes\n        _Visitor.prototype._visitAttributesOf = function (el) {\n            var _this = this;\n            var explicitAttrNameToValue = {};\n            var implicitAttrNames = this._implicitAttrs[el.name] || [];\n            el.attrs.filter(function (attr) { return attr.name.startsWith(_I18N_ATTR_PREFIX); })\n                .forEach(function (attr) { return explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n                attr.value; });\n            el.attrs.forEach(function (attr) {\n                if (attr.name in explicitAttrNameToValue) {\n                    _this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n                }\n                else if (implicitAttrNames.some(function (name) { return attr.name === name; })) {\n                    _this._addMessage([attr]);\n                }\n            });\n        };\n        // add a translatable message\n        _Visitor.prototype._addMessage = function (ast, msgMeta) {\n            if (ast.length == 0 ||\n                ast.length == 1 && ast[0] instanceof Attribute && !ast[0].value) {\n                // Do not create empty messages\n                return null;\n            }\n            var _a = _parseMessageMeta(msgMeta), meaning = _a.meaning, description = _a.description, id = _a.id;\n            var message = this._createI18nMessage(ast, meaning, description, id);\n            this._messages.push(message);\n            return message;\n        };\n        // Translates the given message given the `TranslationBundle`\n        // This is used for translating elements / blocks - see `_translateAttributes` for attributes\n        // no-op when called in extraction mode (returns [])\n        _Visitor.prototype._translateMessage = function (el, message) {\n            if (message && this._mode === _VisitorMode.Merge) {\n                var nodes = this._translations.get(message);\n                if (nodes) {\n                    return nodes;\n                }\n                this._reportError(el, \"Translation unavailable for message id=\\\"\" + this._translations.digest(message) + \"\\\"\");\n            }\n            return [];\n        };\n        // translate the attributes of an element and remove i18n specific attributes\n        _Visitor.prototype._translateAttributes = function (el) {\n            var _this = this;\n            var attributes = el.attrs;\n            var i18nParsedMessageMeta = {};\n            attributes.forEach(function (attr) {\n                if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n                    i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n                        _parseMessageMeta(attr.value);\n                }\n            });\n            var translatedAttributes = [];\n            attributes.forEach(function (attr) {\n                if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n                    // strip i18n specific attributes\n                    return;\n                }\n                if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {\n                    var _a = i18nParsedMessageMeta[attr.name], meaning = _a.meaning, description = _a.description, id = _a.id;\n                    var message = _this._createI18nMessage([attr], meaning, description, id);\n                    var nodes = _this._translations.get(message);\n                    if (nodes) {\n                        if (nodes.length == 0) {\n                            translatedAttributes.push(new Attribute(attr.name, '', attr.sourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */));\n                        }\n                        else if (nodes[0] instanceof Text$3) {\n                            var value = nodes[0].value;\n                            translatedAttributes.push(new Attribute(attr.name, value, attr.sourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* i18n */));\n                        }\n                        else {\n                            _this._reportError(el, \"Unexpected translation for attribute \\\"\" + attr.name + \"\\\" (id=\\\"\" + (id || _this._translations.digest(message)) + \"\\\")\");\n                        }\n                    }\n                    else {\n                        _this._reportError(el, \"Translation unavailable for attribute \\\"\" + attr.name + \"\\\" (id=\\\"\" + (id || _this._translations.digest(message)) + \"\\\")\");\n                    }\n                }\n                else {\n                    translatedAttributes.push(attr);\n                }\n            });\n            return translatedAttributes;\n        };\n        /**\n         * Add the node as a child of the block when:\n         * - we are in a block,\n         * - we are not inside a ICU message (those are handled separately),\n         * - the node is a \"direct child\" of the block\n         */\n        _Visitor.prototype._mayBeAddBlockChildren = function (node) {\n            if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {\n                this._blockChildren.push(node);\n            }\n        };\n        /**\n         * Marks the start of a section, see `_closeTranslatableSection`\n         */\n        _Visitor.prototype._openTranslatableSection = function (node) {\n            if (this._isInTranslatableSection) {\n                this._reportError(node, 'Unexpected section start');\n            }\n            else {\n                this._msgCountAtSectionStart = this._messages.length;\n            }\n        };\n        Object.defineProperty(_Visitor.prototype, \"_isInTranslatableSection\", {\n            /**\n             * A translatable section could be:\n             * - the content of translatable element,\n             * - nodes between `<!-- i18n -->` and `<!-- /i18n -->` comments\n             */\n            get: function () {\n                return this._msgCountAtSectionStart !== void 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Terminates a section.\n         *\n         * If a section has only one significant children (comments not significant) then we should not\n         * keep the message from this children:\n         *\n         * `<p i18n=\"meaning|description\">{ICU message}</p>` would produce two messages:\n         * - one for the <p> content with meaning and description,\n         * - another one for the ICU message.\n         *\n         * In this case the last message is discarded as it contains less information (the AST is\n         * otherwise identical).\n         *\n         * Note that we should still keep messages extracted from attributes inside the section (ie in the\n         * ICU message here)\n         */\n        _Visitor.prototype._closeTranslatableSection = function (node, directChildren) {\n            if (!this._isInTranslatableSection) {\n                this._reportError(node, 'Unexpected section end');\n                return;\n            }\n            var startIndex = this._msgCountAtSectionStart;\n            var significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment$1 ? 0 : 1); }, 0);\n            if (significantChildren == 1) {\n                for (var i = this._messages.length - 1; i >= startIndex; i--) {\n                    var ast = this._messages[i].nodes;\n                    if (!(ast.length == 1 && ast[0] instanceof Text$1)) {\n                        this._messages.splice(i, 1);\n                        break;\n                    }\n                }\n            }\n            this._msgCountAtSectionStart = undefined;\n        };\n        _Visitor.prototype._reportError = function (node, msg) {\n            this._errors.push(new I18nError(node.sourceSpan, msg));\n        };\n        return _Visitor;\n    }());\n    function _isOpeningComment(n) {\n        return !!(n instanceof Comment$1 && n.value && n.value.startsWith('i18n'));\n    }\n    function _isClosingComment(n) {\n        return !!(n instanceof Comment$1 && n.value && n.value === '/i18n');\n    }\n    function _getI18nAttr(p) {\n        return p.attrs.find(function (attr) { return attr.name === _I18N_ATTR; }) || null;\n    }\n    function _parseMessageMeta(i18n) {\n        if (!i18n)\n            return { meaning: '', description: '', id: '' };\n        var idIndex = i18n.indexOf(ID_SEPARATOR);\n        var descIndex = i18n.indexOf(MEANING_SEPARATOR);\n        var _a = __read((idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], 2), meaningAndDesc = _a[0], id = _a[1];\n        var _b = __read((descIndex > -1) ?\n            [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :\n            ['', meaningAndDesc], 2), meaning = _b[0], description = _b[1];\n        return { meaning: meaning, description: description, id: id.trim() };\n    }\n\n    /**\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://angular.io/license\n     */\n    var XmlTagDefinition = /** @class */ (function () {\n        function XmlTagDefinition() {\n            this.closedByParent = false;\n            this.isVoid = false;\n            this.ignoreFirstLf = false;\n            this.canSelfClose = true;\n            this.preventNamespaceInheritance = false;\n        }\n        XmlTagDefinition.prototype.requireExtraParent = function (currentParent) {\n            return false;\n        };\n        XmlTagDefinition.prototype.isClosedByChild = function (name) {\n            return false;\n        };\n        XmlTagDefinition.prototype.getContentType = function () {\n            return exports.TagContentType.PARSABLE_DATA;\n        };\n        return XmlTagDefinition;\n    }());\n    var _TAG_DEFINITION = new XmlTagDefinition();\n    function getXmlTagDefinition(tagName) {\n        return _TAG_DEFINITION;\n    }\n\n    var XmlParser = /** @class */ (function (_super) {\n        __extends(XmlParser, _super);\n        function XmlParser() {\n            return _super.call(this, getXmlTagDefinition) || this;\n        }\n        XmlParser.prototype.parse = function (source, url, options) {\n            return _super.prototype.parse.call(this, source, url, options);\n        };\n        return XmlParser;\n    }(Parser));\n\n    var _VERSION = '1.2';\n    var _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';\n    // TODO(vicb): make this a param (s/_/-/)\n    var _DEFAULT_SOURCE_LANG = 'en';\n    var _PLACEHOLDER_TAG$1 = 'x';\n    var _MARKER_TAG = 'mrk';\n    var _FILE_TAG = 'file';\n    var _SOURCE_TAG$1 = 'source';\n    var _SEGMENT_SOURCE_TAG = 'seg-source';\n    var _ALT_TRANS_TAG = 'alt-trans';\n    var _TARGET_TAG = 'target';\n    var _UNIT_TAG = 'trans-unit';\n    var _CONTEXT_GROUP_TAG = 'context-group';\n    var _CONTEXT_TAG = 'context';\n    // https://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html\n    // https://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2.html\n    var Xliff = /** @class */ (function (_super) {\n        __extends(Xliff, _super);\n        function Xliff() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        Xliff.prototype.write = function (messages, locale) {\n            var visitor = new _WriteVisitor();\n            var transUnits = [];\n            messages.forEach(function (message) {\n                var _a;\n                var contextTags = [];\n                message.sources.forEach(function (source) {\n                    var contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });\n                    contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new Text$2(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new Text$2(\"\" + source.startLine)]), new CR(8));\n                    contextTags.push(new CR(8), contextGroupTag);\n                });\n                var transUnit = new Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });\n                (_a = transUnit.children).push.apply(_a, __spreadArray([new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes))], __read(contextTags)));\n                if (message.description) {\n                    transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));\n                }\n                if (message.meaning) {\n                    transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));\n                }\n                transUnit.children.push(new CR(6));\n                transUnits.push(new CR(6), transUnit);\n            });\n            var body = new Tag('body', {}, __spreadArray(__spreadArray([], __read(transUnits)), [new CR(4)]));\n            var file = new Tag('file', {\n                'source-language': locale || _DEFAULT_SOURCE_LANG,\n                datatype: 'plaintext',\n                original: 'ng2.template',\n            }, [new CR(4), body, new CR(2)]);\n            var xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new CR(2), file, new CR()]);\n            return serialize([\n                new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n            ]);\n        };\n        Xliff.prototype.load = function (content, url) {\n            // xliff to xml nodes\n            var xliffParser = new XliffParser();\n            var _a = xliffParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n            // xml nodes to i18n nodes\n            var i18nNodesByMsgId = {};\n            var converter = new XmlToI18n();\n            Object.keys(msgIdToHtml).forEach(function (msgId) {\n                var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n                errors.push.apply(errors, __spreadArray([], __read(e)));\n                i18nNodesByMsgId[msgId] = i18nNodes;\n            });\n            if (errors.length) {\n                throw new Error(\"xliff parse errors:\\n\" + errors.join('\\n'));\n            }\n            return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };\n        };\n        Xliff.prototype.digest = function (message) {\n            return digest(message);\n        };\n        return Xliff;\n    }(Serializer));\n    var _WriteVisitor = /** @class */ (function () {\n        function _WriteVisitor() {\n        }\n        _WriteVisitor.prototype.visitText = function (text, context) {\n            return [new Text$2(text.value)];\n        };\n        _WriteVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            var nodes = [];\n            container.children.forEach(function (node) { return nodes.push.apply(nodes, __spreadArray([], __read(node.visit(_this)))); });\n            return nodes;\n        };\n        _WriteVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n            Object.keys(icu.cases).forEach(function (c) {\n                nodes.push.apply(nodes, __spreadArray(__spreadArray([new Text$2(c + \" {\")], __read(icu.cases[c].visit(_this))), [new Text$2(\"} \")]));\n            });\n            nodes.push(new Text$2(\"}\"));\n            return nodes;\n        };\n        _WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var ctype = getCtypeForTag(ph.tag);\n            if (ph.isVoid) {\n                // void tags have no children nor closing tags\n                return [new Tag(_PLACEHOLDER_TAG$1, { id: ph.startName, ctype: ctype, 'equiv-text': \"<\" + ph.tag + \"/>\" })];\n            }\n            var startTagPh = new Tag(_PLACEHOLDER_TAG$1, { id: ph.startName, ctype: ctype, 'equiv-text': \"<\" + ph.tag + \">\" });\n            var closeTagPh = new Tag(_PLACEHOLDER_TAG$1, { id: ph.closeName, ctype: ctype, 'equiv-text': \"</\" + ph.tag + \">\" });\n            return __spreadArray(__spreadArray([startTagPh], __read(this.serialize(ph.children))), [closeTagPh]);\n        };\n        _WriteVisitor.prototype.visitPlaceholder = function (ph, context) {\n            return [new Tag(_PLACEHOLDER_TAG$1, { id: ph.name, 'equiv-text': \"{{\" + ph.value + \"}}\" })];\n        };\n        _WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            var equivText = \"{\" + ph.value.expression + \", \" + ph.value.type + \", \" + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + \"}\";\n            return [new Tag(_PLACEHOLDER_TAG$1, { id: ph.name, 'equiv-text': equivText })];\n        };\n        _WriteVisitor.prototype.serialize = function (nodes) {\n            var _this = this;\n            return [].concat.apply([], __spreadArray([], __read(nodes.map(function (node) { return node.visit(_this); }))));\n        };\n        return _WriteVisitor;\n    }());\n    // TODO(vicb): add error management (structure)\n    // Extract messages as xml nodes from the xliff file\n    var XliffParser = /** @class */ (function () {\n        function XliffParser() {\n            this._locale = null;\n        }\n        XliffParser.prototype.parse = function (xliff, url) {\n            this._unitMlString = null;\n            this._msgIdToHtml = {};\n            var xml = new XmlParser().parse(xliff, url);\n            this._errors = xml.errors;\n            visitAll$1(this, xml.rootNodes, null);\n            return {\n                msgIdToHtml: this._msgIdToHtml,\n                errors: this._errors,\n                locale: this._locale,\n            };\n        };\n        XliffParser.prototype.visitElement = function (element, context) {\n            switch (element.name) {\n                case _UNIT_TAG:\n                    this._unitMlString = null;\n                    var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n                    if (!idAttr) {\n                        this._addError(element, \"<\" + _UNIT_TAG + \"> misses the \\\"id\\\" attribute\");\n                    }\n                    else {\n                        var id = idAttr.value;\n                        if (this._msgIdToHtml.hasOwnProperty(id)) {\n                            this._addError(element, \"Duplicated translations for msg \" + id);\n                        }\n                        else {\n                            visitAll$1(this, element.children, null);\n                            if (typeof this._unitMlString === 'string') {\n                                this._msgIdToHtml[id] = this._unitMlString;\n                            }\n                            else {\n                                this._addError(element, \"Message \" + id + \" misses a translation\");\n                            }\n                        }\n                    }\n                    break;\n                // ignore those tags\n                case _SOURCE_TAG$1:\n                case _SEGMENT_SOURCE_TAG:\n                case _ALT_TRANS_TAG:\n                    break;\n                case _TARGET_TAG:\n                    var innerTextStart = element.startSourceSpan.end.offset;\n                    var innerTextEnd = element.endSourceSpan.start.offset;\n                    var content = element.startSourceSpan.start.file.content;\n                    var innerText = content.slice(innerTextStart, innerTextEnd);\n                    this._unitMlString = innerText;\n                    break;\n                case _FILE_TAG:\n                    var localeAttr = element.attrs.find(function (attr) { return attr.name === 'target-language'; });\n                    if (localeAttr) {\n                        this._locale = localeAttr.value;\n                    }\n                    visitAll$1(this, element.children, null);\n                    break;\n                default:\n                    // TODO(vicb): assert file structure, xliff version\n                    // For now only recurse on unhandled nodes\n                    visitAll$1(this, element.children, null);\n            }\n        };\n        XliffParser.prototype.visitAttribute = function (attribute, context) { };\n        XliffParser.prototype.visitText = function (text, context) { };\n        XliffParser.prototype.visitComment = function (comment, context) { };\n        XliffParser.prototype.visitExpansion = function (expansion, context) { };\n        XliffParser.prototype.visitExpansionCase = function (expansionCase, context) { };\n        XliffParser.prototype._addError = function (node, message) {\n            this._errors.push(new I18nError(node.sourceSpan, message));\n        };\n        return XliffParser;\n    }());\n    // Convert ml nodes (xliff syntax) to i18n nodes\n    var XmlToI18n = /** @class */ (function () {\n        function XmlToI18n() {\n        }\n        XmlToI18n.prototype.convert = function (message, url) {\n            var xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });\n            this._errors = xmlIcu.errors;\n            var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n                [] : [].concat.apply([], __spreadArray([], __read(visitAll$1(this, xmlIcu.rootNodes))));\n            return {\n                i18nNodes: i18nNodes,\n                errors: this._errors,\n            };\n        };\n        XmlToI18n.prototype.visitText = function (text, context) {\n            return new Text$1(text.value, text.sourceSpan);\n        };\n        XmlToI18n.prototype.visitElement = function (el, context) {\n            if (el.name === _PLACEHOLDER_TAG$1) {\n                var nameAttr = el.attrs.find(function (attr) { return attr.name === 'id'; });\n                if (nameAttr) {\n                    return new Placeholder('', nameAttr.value, el.sourceSpan);\n                }\n                this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"id\\\" attribute\");\n                return null;\n            }\n            if (el.name === _MARKER_TAG) {\n                return [].concat.apply([], __spreadArray([], __read(visitAll$1(this, el.children))));\n            }\n            this._addError(el, \"Unexpected tag\");\n            return null;\n        };\n        XmlToI18n.prototype.visitExpansion = function (icu, context) {\n            var caseMap = {};\n            visitAll$1(this, icu.cases).forEach(function (c) {\n                caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n            });\n            return new Icu$1(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n        };\n        XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {\n            return {\n                value: icuCase.value,\n                nodes: visitAll$1(this, icuCase.expression),\n            };\n        };\n        XmlToI18n.prototype.visitComment = function (comment, context) { };\n        XmlToI18n.prototype.visitAttribute = function (attribute, context) { };\n        XmlToI18n.prototype._addError = function (node, message) {\n            this._errors.push(new I18nError(node.sourceSpan, message));\n        };\n        return XmlToI18n;\n    }());\n    function getCtypeForTag(tag) {\n        switch (tag.toLowerCase()) {\n            case 'br':\n                return 'lb';\n            case 'img':\n                return 'image';\n            default:\n                return \"x-\" + tag;\n        }\n    }\n\n    var _VERSION$1 = '2.0';\n    var _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:2.0';\n    // TODO(vicb): make this a param (s/_/-/)\n    var _DEFAULT_SOURCE_LANG$1 = 'en';\n    var _PLACEHOLDER_TAG$2 = 'ph';\n    var _PLACEHOLDER_SPANNING_TAG = 'pc';\n    var _MARKER_TAG$1 = 'mrk';\n    var _XLIFF_TAG = 'xliff';\n    var _SOURCE_TAG$2 = 'source';\n    var _TARGET_TAG$1 = 'target';\n    var _UNIT_TAG$1 = 'unit';\n    // https://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html\n    var Xliff2 = /** @class */ (function (_super) {\n        __extends(Xliff2, _super);\n        function Xliff2() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        Xliff2.prototype.write = function (messages, locale) {\n            var visitor = new _WriteVisitor$1();\n            var units = [];\n            messages.forEach(function (message) {\n                var unit = new Tag(_UNIT_TAG$1, { id: message.id });\n                var notes = new Tag('notes');\n                if (message.description || message.meaning) {\n                    if (message.description) {\n                        notes.children.push(new CR(8), new Tag('note', { category: 'description' }, [new Text$2(message.description)]));\n                    }\n                    if (message.meaning) {\n                        notes.children.push(new CR(8), new Tag('note', { category: 'meaning' }, [new Text$2(message.meaning)]));\n                    }\n                }\n                message.sources.forEach(function (source) {\n                    notes.children.push(new CR(8), new Tag('note', { category: 'location' }, [\n                        new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n                    ]));\n                });\n                notes.children.push(new CR(6));\n                unit.children.push(new CR(6), notes);\n                var segment = new Tag('segment');\n                segment.children.push(new CR(8), new Tag(_SOURCE_TAG$2, {}, visitor.serialize(message.nodes)), new CR(6));\n                unit.children.push(new CR(6), segment, new CR(4));\n                units.push(new CR(4), unit);\n            });\n            var file = new Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, __spreadArray(__spreadArray([], __read(units)), [new CR(2)]));\n            var xliff = new Tag(_XLIFF_TAG, { version: _VERSION$1, xmlns: _XMLNS$1, srcLang: locale || _DEFAULT_SOURCE_LANG$1 }, [new CR(2), file, new CR()]);\n            return serialize([\n                new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n            ]);\n        };\n        Xliff2.prototype.load = function (content, url) {\n            // xliff to xml nodes\n            var xliff2Parser = new Xliff2Parser();\n            var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n            // xml nodes to i18n nodes\n            var i18nNodesByMsgId = {};\n            var converter = new XmlToI18n$1();\n            Object.keys(msgIdToHtml).forEach(function (msgId) {\n                var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n                errors.push.apply(errors, __spreadArray([], __read(e)));\n                i18nNodesByMsgId[msgId] = i18nNodes;\n            });\n            if (errors.length) {\n                throw new Error(\"xliff2 parse errors:\\n\" + errors.join('\\n'));\n            }\n            return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };\n        };\n        Xliff2.prototype.digest = function (message) {\n            return decimalDigest(message);\n        };\n        return Xliff2;\n    }(Serializer));\n    var _WriteVisitor$1 = /** @class */ (function () {\n        function _WriteVisitor() {\n        }\n        _WriteVisitor.prototype.visitText = function (text, context) {\n            return [new Text$2(text.value)];\n        };\n        _WriteVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            var nodes = [];\n            container.children.forEach(function (node) { return nodes.push.apply(nodes, __spreadArray([], __read(node.visit(_this)))); });\n            return nodes;\n        };\n        _WriteVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n            Object.keys(icu.cases).forEach(function (c) {\n                nodes.push.apply(nodes, __spreadArray(__spreadArray([new Text$2(c + \" {\")], __read(icu.cases[c].visit(_this))), [new Text$2(\"} \")]));\n            });\n            nodes.push(new Text$2(\"}\"));\n            return nodes;\n        };\n        _WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var _this = this;\n            var type = getTypeForTag(ph.tag);\n            if (ph.isVoid) {\n                var tagPh = new Tag(_PLACEHOLDER_TAG$2, {\n                    id: (this._nextPlaceholderId++).toString(),\n                    equiv: ph.startName,\n                    type: type,\n                    disp: \"<\" + ph.tag + \"/>\",\n                });\n                return [tagPh];\n            }\n            var tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {\n                id: (this._nextPlaceholderId++).toString(),\n                equivStart: ph.startName,\n                equivEnd: ph.closeName,\n                type: type,\n                dispStart: \"<\" + ph.tag + \">\",\n                dispEnd: \"</\" + ph.tag + \">\",\n            });\n            var nodes = [].concat.apply([], __spreadArray([], __read(ph.children.map(function (node) { return node.visit(_this); }))));\n            if (nodes.length) {\n                nodes.forEach(function (node) { return tagPc.children.push(node); });\n            }\n            else {\n                tagPc.children.push(new Text$2(''));\n            }\n            return [tagPc];\n        };\n        _WriteVisitor.prototype.visitPlaceholder = function (ph, context) {\n            var idStr = (this._nextPlaceholderId++).toString();\n            return [new Tag(_PLACEHOLDER_TAG$2, {\n                    id: idStr,\n                    equiv: ph.name,\n                    disp: \"{{\" + ph.value + \"}}\",\n                })];\n        };\n        _WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            var cases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');\n            var idStr = (this._nextPlaceholderId++).toString();\n            return [new Tag(_PLACEHOLDER_TAG$2, { id: idStr, equiv: ph.name, disp: \"{\" + ph.value.expression + \", \" + ph.value.type + \", \" + cases + \"}\" })];\n        };\n        _WriteVisitor.prototype.serialize = function (nodes) {\n            var _this = this;\n            this._nextPlaceholderId = 0;\n            return [].concat.apply([], __spreadArray([], __read(nodes.map(function (node) { return node.visit(_this); }))));\n        };\n        return _WriteVisitor;\n    }());\n    // Extract messages as xml nodes from the xliff file\n    var Xliff2Parser = /** @class */ (function () {\n        function Xliff2Parser() {\n            this._locale = null;\n        }\n        Xliff2Parser.prototype.parse = function (xliff, url) {\n            this._unitMlString = null;\n            this._msgIdToHtml = {};\n            var xml = new XmlParser().parse(xliff, url);\n            this._errors = xml.errors;\n            visitAll$1(this, xml.rootNodes, null);\n            return {\n                msgIdToHtml: this._msgIdToHtml,\n                errors: this._errors,\n                locale: this._locale,\n            };\n        };\n        Xliff2Parser.prototype.visitElement = function (element, context) {\n            switch (element.name) {\n                case _UNIT_TAG$1:\n                    this._unitMlString = null;\n                    var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n                    if (!idAttr) {\n                        this._addError(element, \"<\" + _UNIT_TAG$1 + \"> misses the \\\"id\\\" attribute\");\n                    }\n                    else {\n                        var id = idAttr.value;\n                        if (this._msgIdToHtml.hasOwnProperty(id)) {\n                            this._addError(element, \"Duplicated translations for msg \" + id);\n                        }\n                        else {\n                            visitAll$1(this, element.children, null);\n                            if (typeof this._unitMlString === 'string') {\n                                this._msgIdToHtml[id] = this._unitMlString;\n                            }\n                            else {\n                                this._addError(element, \"Message \" + id + \" misses a translation\");\n                            }\n                        }\n                    }\n                    break;\n                case _SOURCE_TAG$2:\n                    // ignore source message\n                    break;\n                case _TARGET_TAG$1:\n                    var innerTextStart = element.startSourceSpan.end.offset;\n                    var innerTextEnd = element.endSourceSpan.start.offset;\n                    var content = element.startSourceSpan.start.file.content;\n                    var innerText = content.slice(innerTextStart, innerTextEnd);\n                    this._unitMlString = innerText;\n                    break;\n                case _XLIFF_TAG:\n                    var localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });\n                    if (localeAttr) {\n                        this._locale = localeAttr.value;\n                    }\n                    var versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });\n                    if (versionAttr) {\n                        var version = versionAttr.value;\n                        if (version !== '2.0') {\n                            this._addError(element, \"The XLIFF file version \" + version + \" is not compatible with XLIFF 2.0 serializer\");\n                        }\n                        else {\n                            visitAll$1(this, element.children, null);\n                        }\n                    }\n                    break;\n                default:\n                    visitAll$1(this, element.children, null);\n            }\n        };\n        Xliff2Parser.prototype.visitAttribute = function (attribute, context) { };\n        Xliff2Parser.prototype.visitText = function (text, context) { };\n        Xliff2Parser.prototype.visitComment = function (comment, context) { };\n        Xliff2Parser.prototype.visitExpansion = function (expansion, context) { };\n        Xliff2Parser.prototype.visitExpansionCase = function (expansionCase, context) { };\n        Xliff2Parser.prototype._addError = function (node, message) {\n            this._errors.push(new I18nError(node.sourceSpan, message));\n        };\n        return Xliff2Parser;\n    }());\n    // Convert ml nodes (xliff syntax) to i18n nodes\n    var XmlToI18n$1 = /** @class */ (function () {\n        function XmlToI18n() {\n        }\n        XmlToI18n.prototype.convert = function (message, url) {\n            var xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });\n            this._errors = xmlIcu.errors;\n            var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n                [] : [].concat.apply([], __spreadArray([], __read(visitAll$1(this, xmlIcu.rootNodes))));\n            return {\n                i18nNodes: i18nNodes,\n                errors: this._errors,\n            };\n        };\n        XmlToI18n.prototype.visitText = function (text, context) {\n            return new Text$1(text.value, text.sourceSpan);\n        };\n        XmlToI18n.prototype.visitElement = function (el, context) {\n            var _this = this;\n            switch (el.name) {\n                case _PLACEHOLDER_TAG$2:\n                    var nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });\n                    if (nameAttr) {\n                        return [new Placeholder('', nameAttr.value, el.sourceSpan)];\n                    }\n                    this._addError(el, \"<\" + _PLACEHOLDER_TAG$2 + \"> misses the \\\"equiv\\\" attribute\");\n                    break;\n                case _PLACEHOLDER_SPANNING_TAG:\n                    var startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });\n                    var endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });\n                    if (!startAttr) {\n                        this._addError(el, \"<\" + _PLACEHOLDER_TAG$2 + \"> misses the \\\"equivStart\\\" attribute\");\n                    }\n                    else if (!endAttr) {\n                        this._addError(el, \"<\" + _PLACEHOLDER_TAG$2 + \"> misses the \\\"equivEnd\\\" attribute\");\n                    }\n                    else {\n                        var startId = startAttr.value;\n                        var endId = endAttr.value;\n                        var nodes = [];\n                        return nodes.concat.apply(nodes, __spreadArray(__spreadArray([new Placeholder('', startId, el.sourceSpan)], __read(el.children.map(function (node) { return node.visit(_this, null); }))), [new Placeholder('', endId, el.sourceSpan)]));\n                    }\n                    break;\n                case _MARKER_TAG$1:\n                    return [].concat.apply([], __spreadArray([], __read(visitAll$1(this, el.children))));\n                default:\n                    this._addError(el, \"Unexpected tag\");\n            }\n            return null;\n        };\n        XmlToI18n.prototype.visitExpansion = function (icu, context) {\n            var caseMap = {};\n            visitAll$1(this, icu.cases).forEach(function (c) {\n                caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n            });\n            return new Icu$1(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n        };\n        XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {\n            return {\n                value: icuCase.value,\n                nodes: [].concat.apply([], __spreadArray([], __read(visitAll$1(this, icuCase.expression)))),\n            };\n        };\n        XmlToI18n.prototype.visitComment = function (comment, context) { };\n        XmlToI18n.prototype.visitAttribute = function (attribute, context) { };\n        XmlToI18n.prototype._addError = function (node, message) {\n            this._errors.push(new I18nError(node.sourceSpan, message));\n        };\n        return XmlToI18n;\n    }());\n    function getTypeForTag(tag) {\n        switch (tag.toLowerCase()) {\n            case 'br':\n            case 'b':\n            case 'i':\n            case 'u':\n                return 'fmt';\n            case 'img':\n                return 'image';\n            case 'a':\n                return 'link';\n            default:\n                return 'other';\n        }\n    }\n\n    var _TRANSLATIONS_TAG = 'translationbundle';\n    var _TRANSLATION_TAG = 'translation';\n    var _PLACEHOLDER_TAG$3 = 'ph';\n    var Xtb = /** @class */ (function (_super) {\n        __extends(Xtb, _super);\n        function Xtb() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        Xtb.prototype.write = function (messages, locale) {\n            throw new Error('Unsupported');\n        };\n        Xtb.prototype.load = function (content, url) {\n            // xtb to xml nodes\n            var xtbParser = new XtbParser();\n            var _a = xtbParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n            // xml nodes to i18n nodes\n            var i18nNodesByMsgId = {};\n            var converter = new XmlToI18n$2();\n            // Because we should be able to load xtb files that rely on features not supported by angular,\n            // we need to delay the conversion of html to i18n nodes so that non angular messages are not\n            // converted\n            Object.keys(msgIdToHtml).forEach(function (msgId) {\n                var valueFn = function () {\n                    var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, errors = _a.errors;\n                    if (errors.length) {\n                        throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n                    }\n                    return i18nNodes;\n                };\n                createLazyProperty(i18nNodesByMsgId, msgId, valueFn);\n            });\n            if (errors.length) {\n                throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n            }\n            return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };\n        };\n        Xtb.prototype.digest = function (message) {\n            return digest$1(message);\n        };\n        Xtb.prototype.createNameMapper = function (message) {\n            return new SimplePlaceholderMapper(message, toPublicName);\n        };\n        return Xtb;\n    }(Serializer));\n    function createLazyProperty(messages, id, valueFn) {\n        Object.defineProperty(messages, id, {\n            configurable: true,\n            enumerable: true,\n            get: function () {\n                var value = valueFn();\n                Object.defineProperty(messages, id, { enumerable: true, value: value });\n                return value;\n            },\n            set: function (_) {\n                throw new Error('Could not overwrite an XTB translation');\n            },\n        });\n    }\n    // Extract messages as xml nodes from the xtb file\n    var XtbParser = /** @class */ (function () {\n        function XtbParser() {\n            this._locale = null;\n        }\n        XtbParser.prototype.parse = function (xtb, url) {\n            this._bundleDepth = 0;\n            this._msgIdToHtml = {};\n            // We can not parse the ICU messages at this point as some messages might not originate\n            // from Angular that could not be lex'd.\n            var xml = new XmlParser().parse(xtb, url);\n            this._errors = xml.errors;\n            visitAll$1(this, xml.rootNodes);\n            return {\n                msgIdToHtml: this._msgIdToHtml,\n                errors: this._errors,\n                locale: this._locale,\n            };\n        };\n        XtbParser.prototype.visitElement = function (element, context) {\n            switch (element.name) {\n                case _TRANSLATIONS_TAG:\n                    this._bundleDepth++;\n                    if (this._bundleDepth > 1) {\n                        this._addError(element, \"<\" + _TRANSLATIONS_TAG + \"> elements can not be nested\");\n                    }\n                    var langAttr = element.attrs.find(function (attr) { return attr.name === 'lang'; });\n                    if (langAttr) {\n                        this._locale = langAttr.value;\n                    }\n                    visitAll$1(this, element.children, null);\n                    this._bundleDepth--;\n                    break;\n                case _TRANSLATION_TAG:\n                    var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n                    if (!idAttr) {\n                        this._addError(element, \"<\" + _TRANSLATION_TAG + \"> misses the \\\"id\\\" attribute\");\n                    }\n                    else {\n                        var id = idAttr.value;\n                        if (this._msgIdToHtml.hasOwnProperty(id)) {\n                            this._addError(element, \"Duplicated translations for msg \" + id);\n                        }\n                        else {\n                            var innerTextStart = element.startSourceSpan.end.offset;\n                            var innerTextEnd = element.endSourceSpan.start.offset;\n                            var content = element.startSourceSpan.start.file.content;\n                            var innerText = content.slice(innerTextStart, innerTextEnd);\n                            this._msgIdToHtml[id] = innerText;\n                        }\n                    }\n                    break;\n                default:\n                    this._addError(element, 'Unexpected tag');\n            }\n        };\n        XtbParser.prototype.visitAttribute = function (attribute, context) { };\n        XtbParser.prototype.visitText = function (text, context) { };\n        XtbParser.prototype.visitComment = function (comment, context) { };\n        XtbParser.prototype.visitExpansion = function (expansion, context) { };\n        XtbParser.prototype.visitExpansionCase = function (expansionCase, context) { };\n        XtbParser.prototype._addError = function (node, message) {\n            this._errors.push(new I18nError(node.sourceSpan, message));\n        };\n        return XtbParser;\n    }());\n    // Convert ml nodes (xtb syntax) to i18n nodes\n    var XmlToI18n$2 = /** @class */ (function () {\n        function XmlToI18n() {\n        }\n        XmlToI18n.prototype.convert = function (message, url) {\n            var xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });\n            this._errors = xmlIcu.errors;\n            var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n                [] :\n                visitAll$1(this, xmlIcu.rootNodes);\n            return {\n                i18nNodes: i18nNodes,\n                errors: this._errors,\n            };\n        };\n        XmlToI18n.prototype.visitText = function (text, context) {\n            return new Text$1(text.value, text.sourceSpan);\n        };\n        XmlToI18n.prototype.visitExpansion = function (icu, context) {\n            var caseMap = {};\n            visitAll$1(this, icu.cases).forEach(function (c) {\n                caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n            });\n            return new Icu$1(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n        };\n        XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {\n            return {\n                value: icuCase.value,\n                nodes: visitAll$1(this, icuCase.expression),\n            };\n        };\n        XmlToI18n.prototype.visitElement = function (el, context) {\n            if (el.name === _PLACEHOLDER_TAG$3) {\n                var nameAttr = el.attrs.find(function (attr) { return attr.name === 'name'; });\n                if (nameAttr) {\n                    return new Placeholder('', nameAttr.value, el.sourceSpan);\n                }\n                this._addError(el, \"<\" + _PLACEHOLDER_TAG$3 + \"> misses the \\\"name\\\" attribute\");\n            }\n            else {\n                this._addError(el, \"Unexpected tag\");\n            }\n            return null;\n        };\n        XmlToI18n.prototype.visitComment = function (comment, context) { };\n        XmlToI18n.prototype.visitAttribute = function (attribute, context) { };\n        XmlToI18n.prototype._addError = function (node, message) {\n            this._errors.push(new I18nError(node.sourceSpan, message));\n        };\n        return XmlToI18n;\n    }());\n\n    /**\n     * A container for translated messages\n     */\n    var TranslationBundle = /** @class */ (function () {\n        function TranslationBundle(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console) {\n            if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n            if (missingTranslationStrategy === void 0) { missingTranslationStrategy = MissingTranslationStrategy.Warning; }\n            this._i18nNodesByMsgId = _i18nNodesByMsgId;\n            this.digest = digest;\n            this.mapperFactory = mapperFactory;\n            this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console);\n        }\n        // Creates a `TranslationBundle` by parsing the given `content` with the `serializer`.\n        TranslationBundle.load = function (content, url, serializer, missingTranslationStrategy, console) {\n            var _a = serializer.load(content, url), locale = _a.locale, i18nNodesByMsgId = _a.i18nNodesByMsgId;\n            var digestFn = function (m) { return serializer.digest(m); };\n            var mapperFactory = function (m) { return serializer.createNameMapper(m); };\n            return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);\n        };\n        // Returns the translation as HTML nodes from the given source message.\n        TranslationBundle.prototype.get = function (srcMsg) {\n            var html = this._i18nToHtml.convert(srcMsg);\n            if (html.errors.length) {\n                throw new Error(html.errors.join('\\n'));\n            }\n            return html.nodes;\n        };\n        TranslationBundle.prototype.has = function (srcMsg) {\n            return this.digest(srcMsg) in this._i18nNodesByMsgId;\n        };\n        return TranslationBundle;\n    }());\n    var I18nToHtmlVisitor = /** @class */ (function () {\n        function I18nToHtmlVisitor(_i18nNodesByMsgId, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {\n            if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n            this._i18nNodesByMsgId = _i18nNodesByMsgId;\n            this._locale = _locale;\n            this._digest = _digest;\n            this._mapperFactory = _mapperFactory;\n            this._missingTranslationStrategy = _missingTranslationStrategy;\n            this._console = _console;\n            this._contextStack = [];\n            this._errors = [];\n        }\n        I18nToHtmlVisitor.prototype.convert = function (srcMsg) {\n            this._contextStack.length = 0;\n            this._errors.length = 0;\n            // i18n to text\n            var text = this._convertToText(srcMsg);\n            // text to html\n            var url = srcMsg.nodes[0].sourceSpan.start.file.url;\n            var html = new HtmlParser().parse(text, url, { tokenizeExpansionForms: true });\n            return {\n                nodes: html.rootNodes,\n                errors: __spreadArray(__spreadArray([], __read(this._errors)), __read(html.errors)),\n            };\n        };\n        I18nToHtmlVisitor.prototype.visitText = function (text, context) {\n            // `convert()` uses an `HtmlParser` to return `html.Node`s\n            // we should then make sure that any special characters are escaped\n            return escapeXml(text.value);\n        };\n        I18nToHtmlVisitor.prototype.visitContainer = function (container, context) {\n            var _this = this;\n            return container.children.map(function (n) { return n.visit(_this); }).join('');\n        };\n        I18nToHtmlVisitor.prototype.visitIcu = function (icu, context) {\n            var _this = this;\n            var cases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n            // TODO(vicb): Once all format switch to using expression placeholders\n            // we should throw when the placeholder is not in the source message\n            var exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ?\n                this._srcMsg.placeholders[icu.expression].text :\n                icu.expression;\n            return \"{\" + exp + \", \" + icu.type + \", \" + cases.join(' ') + \"}\";\n        };\n        I18nToHtmlVisitor.prototype.visitPlaceholder = function (ph, context) {\n            var phName = this._mapper(ph.name);\n            if (this._srcMsg.placeholders.hasOwnProperty(phName)) {\n                return this._srcMsg.placeholders[phName].text;\n            }\n            if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {\n                return this._convertToText(this._srcMsg.placeholderToMessage[phName]);\n            }\n            this._addError(ph, \"Unknown placeholder \\\"\" + ph.name + \"\\\"\");\n            return '';\n        };\n        // Loaded message contains only placeholders (vs tag and icu placeholders).\n        // However when a translation can not be found, we need to serialize the source message\n        // which can contain tag placeholders\n        I18nToHtmlVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n            var _this = this;\n            var tag = \"\" + ph.tag;\n            var attrs = Object.keys(ph.attrs).map(function (name) { return name + \"=\\\"\" + ph.attrs[name] + \"\\\"\"; }).join(' ');\n            if (ph.isVoid) {\n                return \"<\" + tag + \" \" + attrs + \"/>\";\n            }\n            var children = ph.children.map(function (c) { return c.visit(_this); }).join('');\n            return \"<\" + tag + \" \" + attrs + \">\" + children + \"</\" + tag + \">\";\n        };\n        // Loaded message contains only placeholders (vs tag and icu placeholders).\n        // However when a translation can not be found, we need to serialize the source message\n        // which can contain tag placeholders\n        I18nToHtmlVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n            // An ICU placeholder references the source message to be serialized\n            return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);\n        };\n        /**\n         * Convert a source message to a translated text string:\n         * - text nodes are replaced with their translation,\n         * - placeholders are replaced with their content,\n         * - ICU nodes are converted to ICU expressions.\n         */\n        I18nToHtmlVisitor.prototype._convertToText = function (srcMsg) {\n            var _this = this;\n            var id = this._digest(srcMsg);\n            var mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;\n            var nodes;\n            this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });\n            this._srcMsg = srcMsg;\n            if (this._i18nNodesByMsgId.hasOwnProperty(id)) {\n                // When there is a translation use its nodes as the source\n                // And create a mapper to convert serialized placeholder names to internal names\n                nodes = this._i18nNodesByMsgId[id];\n                this._mapper = function (name) { return mapper ? mapper.toInternalName(name) : name; };\n            }\n            else {\n                // When no translation has been found\n                // - report an error / a warning / nothing,\n                // - use the nodes from the original message\n                // - placeholders are already internal and need no mapper\n                if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) {\n                    var ctx = this._locale ? \" for locale \\\"\" + this._locale + \"\\\"\" : '';\n                    this._addError(srcMsg.nodes[0], \"Missing translation for message \\\"\" + id + \"\\\"\" + ctx);\n                }\n                else if (this._console &&\n                    this._missingTranslationStrategy === MissingTranslationStrategy.Warning) {\n                    var ctx = this._locale ? \" for locale \\\"\" + this._locale + \"\\\"\" : '';\n                    this._console.warn(\"Missing translation for message \\\"\" + id + \"\\\"\" + ctx);\n                }\n                nodes = srcMsg.nodes;\n                this._mapper = function (name) { return name; };\n            }\n            var text = nodes.map(function (node) { return node.visit(_this); }).join('');\n            var context = this._contextStack.pop();\n            this._srcMsg = context.msg;\n            this._mapper = context.mapper;\n            return text;\n        };\n        I18nToHtmlVisitor.prototype._addError = function (el, msg) {\n            this._errors.push(new I18nError(el.sourceSpan, msg));\n        };\n        return I18nToHtmlVisitor;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var I18NHtmlParser = /** @class */ (function () {\n        function I18NHtmlParser(_htmlParser, translations, translationsFormat, missingTranslation, console) {\n            if (missingTranslation === void 0) { missingTranslation = MissingTranslationStrategy.Warning; }\n            this._htmlParser = _htmlParser;\n            if (translations) {\n                var serializer = createSerializer(translationsFormat);\n                this._translationBundle =\n                    TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console);\n            }\n            else {\n                this._translationBundle =\n                    new TranslationBundle({}, null, digest, undefined, missingTranslation, console);\n            }\n        }\n        I18NHtmlParser.prototype.parse = function (source, url, options) {\n            if (options === void 0) { options = {}; }\n            var interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;\n            var parseResult = this._htmlParser.parse(source, url, Object.assign({ interpolationConfig: interpolationConfig }, options));\n            if (parseResult.errors.length) {\n                return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);\n            }\n            return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});\n        };\n        return I18NHtmlParser;\n    }());\n    function createSerializer(format) {\n        format = (format || 'xlf').toLowerCase();\n        switch (format) {\n            case 'xmb':\n                return new Xmb();\n            case 'xtb':\n                return new Xtb();\n            case 'xliff2':\n            case 'xlf2':\n                return new Xliff2();\n            case 'xliff':\n            case 'xlf':\n            default:\n                return new Xliff();\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var QUOTED_KEYS = '$quoted$';\n    function convertValueToOutputAst(ctx, value, type) {\n        if (type === void 0) { type = null; }\n        return visitValue(value, new _ValueOutputAstTransformer(ctx), type);\n    }\n    var _ValueOutputAstTransformer = /** @class */ (function () {\n        function _ValueOutputAstTransformer(ctx) {\n            this.ctx = ctx;\n        }\n        _ValueOutputAstTransformer.prototype.visitArray = function (arr, type) {\n            var values = [];\n            // Note Array.map() must not be used to convert the values because it will\n            // skip over empty elements in arrays constructed using `new Array(length)`,\n            // resulting in `undefined` elements. This breaks the type guarantee that\n            // all values in `o.LiteralArrayExpr` are of type `o.Expression`.\n            // See test case in `value_util_spec.ts`.\n            for (var i = 0; i < arr.length; ++i) {\n                values.push(visitValue(arr[i], this, null /* context */));\n            }\n            return literalArr(values, type);\n        };\n        _ValueOutputAstTransformer.prototype.visitStringMap = function (map, type) {\n            var _this = this;\n            var entries = [];\n            var quotedSet = new Set(map && map[QUOTED_KEYS]);\n            Object.keys(map).forEach(function (key) {\n                entries.push(new LiteralMapEntry(key, visitValue(map[key], _this, null), quotedSet.has(key)));\n            });\n            return new LiteralMapExpr(entries, type);\n        };\n        _ValueOutputAstTransformer.prototype.visitPrimitive = function (value, type) {\n            return literal(value, type);\n        };\n        _ValueOutputAstTransformer.prototype.visitOther = function (value, type) {\n            if (value instanceof Expression) {\n                return value;\n            }\n            else {\n                return this.ctx.importExpr(value);\n            }\n        };\n        return _ValueOutputAstTransformer;\n    }());\n\n    /**\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://angular.io/license\n     */\n    function mapEntry$1(key, value) {\n        return { key: key, value: value, quoted: false };\n    }\n    var InjectableCompiler = /** @class */ (function () {\n        function InjectableCompiler(reflector, alwaysGenerateDef) {\n            this.reflector = reflector;\n            this.alwaysGenerateDef = alwaysGenerateDef;\n            this.tokenInjector = reflector.resolveExternalReference(Identifiers$1.Injector);\n        }\n        InjectableCompiler.prototype.depsArray = function (deps, ctx) {\n            var _this = this;\n            return deps.map(function (dep) {\n                var token = dep;\n                var args = [token];\n                var flags = 0 /* Default */;\n                if (Array.isArray(dep)) {\n                    for (var i = 0; i < dep.length; i++) {\n                        var v = dep[i];\n                        if (v) {\n                            if (v.ngMetadataName === 'Optional') {\n                                flags |= 8 /* Optional */;\n                            }\n                            else if (v.ngMetadataName === 'SkipSelf') {\n                                flags |= 4 /* SkipSelf */;\n                            }\n                            else if (v.ngMetadataName === 'Self') {\n                                flags |= 2 /* Self */;\n                            }\n                            else if (v.ngMetadataName === 'Inject') {\n                                token = v.token;\n                            }\n                            else {\n                                token = v;\n                            }\n                        }\n                    }\n                }\n                var tokenExpr;\n                if (typeof token === 'string') {\n                    tokenExpr = literal(token);\n                }\n                else if (token === _this.tokenInjector) {\n                    tokenExpr = importExpr(Identifiers$1.INJECTOR);\n                }\n                else {\n                    tokenExpr = ctx.importExpr(token);\n                }\n                if (flags !== 0 /* Default */) {\n                    args = [tokenExpr, literal(flags)];\n                }\n                else {\n                    args = [tokenExpr];\n                }\n                return importExpr(Identifiers$1.inject).callFn(args);\n            });\n        };\n        InjectableCompiler.prototype.factoryFor = function (injectable, ctx) {\n            var retValue;\n            if (injectable.useExisting) {\n                retValue = importExpr(Identifiers$1.inject).callFn([ctx.importExpr(injectable.useExisting)]);\n            }\n            else if (injectable.useFactory) {\n                var deps = injectable.deps || [];\n                if (deps.length > 0) {\n                    retValue = ctx.importExpr(injectable.useFactory).callFn(this.depsArray(deps, ctx));\n                }\n                else {\n                    return ctx.importExpr(injectable.useFactory);\n                }\n            }\n            else if (injectable.useValue) {\n                retValue = convertValueToOutputAst(ctx, injectable.useValue);\n            }\n            else {\n                var clazz = injectable.useClass || injectable.symbol;\n                var depArgs = this.depsArray(this.reflector.parameters(clazz), ctx);\n                retValue = new InstantiateExpr(ctx.importExpr(clazz), depArgs);\n            }\n            return fn([], [new ReturnStatement(retValue)], undefined, undefined, injectable.symbol.name + '_Factory');\n        };\n        InjectableCompiler.prototype.injectableDef = function (injectable, ctx) {\n            var providedIn = NULL_EXPR;\n            if (injectable.providedIn !== undefined) {\n                if (injectable.providedIn === null) {\n                    providedIn = NULL_EXPR;\n                }\n                else if (typeof injectable.providedIn === 'string') {\n                    providedIn = literal(injectable.providedIn);\n                }\n                else {\n                    providedIn = ctx.importExpr(injectable.providedIn);\n                }\n            }\n            var def = [\n                mapEntry$1('factory', this.factoryFor(injectable, ctx)),\n                mapEntry$1('token', ctx.importExpr(injectable.type.reference)),\n                mapEntry$1('providedIn', providedIn),\n            ];\n            return importExpr(Identifiers.ɵɵdefineInjectable).callFn([literalMap(def)], undefined, true);\n        };\n        InjectableCompiler.prototype.compile = function (injectable, ctx) {\n            if (this.alwaysGenerateDef || injectable.providedIn !== undefined) {\n                var className = identifierName(injectable.type);\n                var clazz = new ClassStmt(className, null, [\n                    new ClassField('ɵprov', INFERRED_TYPE, [exports.StmtModifier.Static], this.injectableDef(injectable, ctx)),\n                ], [], new ClassMethod(null, [], []), []);\n                ctx.statements.push(clazz);\n            }\n        };\n        return InjectableCompiler;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var STRIP_SRC_FILE_SUFFIXES = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\n    var GENERATED_FILE = /\\.ngfactory\\.|\\.ngsummary\\./;\n    var JIT_SUMMARY_FILE = /\\.ngsummary\\./;\n    var JIT_SUMMARY_NAME = /NgSummary$/;\n    function ngfactoryFilePath(filePath, forceSourceFile) {\n        if (forceSourceFile === void 0) { forceSourceFile = false; }\n        var urlWithSuffix = splitTypescriptSuffix(filePath, forceSourceFile);\n        return urlWithSuffix[0] + \".ngfactory\" + normalizeGenFileSuffix(urlWithSuffix[1]);\n    }\n    function stripGeneratedFileSuffix(filePath) {\n        return filePath.replace(GENERATED_FILE, '.');\n    }\n    function isGeneratedFile(filePath) {\n        return GENERATED_FILE.test(filePath);\n    }\n    function splitTypescriptSuffix(path, forceSourceFile) {\n        if (forceSourceFile === void 0) { forceSourceFile = false; }\n        if (path.endsWith('.d.ts')) {\n            return [path.slice(0, -5), forceSourceFile ? '.ts' : '.d.ts'];\n        }\n        var lastDot = path.lastIndexOf('.');\n        if (lastDot !== -1) {\n            return [path.substring(0, lastDot), path.substring(lastDot)];\n        }\n        return [path, ''];\n    }\n    function normalizeGenFileSuffix(srcFileSuffix) {\n        return srcFileSuffix === '.tsx' ? '.ts' : srcFileSuffix;\n    }\n    function summaryFileName(fileName) {\n        var fileNameWithoutSuffix = fileName.replace(STRIP_SRC_FILE_SUFFIXES, '');\n        return fileNameWithoutSuffix + \".ngsummary.json\";\n    }\n    function summaryForJitFileName(fileName, forceSourceFile) {\n        if (forceSourceFile === void 0) { forceSourceFile = false; }\n        var urlWithSuffix = splitTypescriptSuffix(stripGeneratedFileSuffix(fileName), forceSourceFile);\n        return urlWithSuffix[0] + \".ngsummary\" + urlWithSuffix[1];\n    }\n    function stripSummaryForJitFileSuffix(filePath) {\n        return filePath.replace(JIT_SUMMARY_FILE, '.');\n    }\n    function summaryForJitName(symbolName) {\n        return symbolName + \"NgSummary\";\n    }\n    function stripSummaryForJitNameSuffix(symbolName) {\n        return symbolName.replace(JIT_SUMMARY_NAME, '');\n    }\n    var LOWERED_SYMBOL = /\\u0275\\d+/;\n    function isLoweredSymbol(name) {\n        return LOWERED_SYMBOL.test(name);\n    }\n    function createLoweredSymbol(id) {\n        return \"\\u0275\" + id;\n    }\n\n    /**\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://angular.io/license\n     */\n    var LifecycleHooks;\n    (function (LifecycleHooks) {\n        LifecycleHooks[LifecycleHooks[\"OnInit\"] = 0] = \"OnInit\";\n        LifecycleHooks[LifecycleHooks[\"OnDestroy\"] = 1] = \"OnDestroy\";\n        LifecycleHooks[LifecycleHooks[\"DoCheck\"] = 2] = \"DoCheck\";\n        LifecycleHooks[LifecycleHooks[\"OnChanges\"] = 3] = \"OnChanges\";\n        LifecycleHooks[LifecycleHooks[\"AfterContentInit\"] = 4] = \"AfterContentInit\";\n        LifecycleHooks[LifecycleHooks[\"AfterContentChecked\"] = 5] = \"AfterContentChecked\";\n        LifecycleHooks[LifecycleHooks[\"AfterViewInit\"] = 6] = \"AfterViewInit\";\n        LifecycleHooks[LifecycleHooks[\"AfterViewChecked\"] = 7] = \"AfterViewChecked\";\n    })(LifecycleHooks || (LifecycleHooks = {}));\n    var LIFECYCLE_HOOKS_VALUES = [\n        LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,\n        LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,\n        LifecycleHooks.AfterViewChecked\n    ];\n    function hasLifecycleHook(reflector, hook, token) {\n        return reflector.hasLifecycleHook(token, getHookName(hook));\n    }\n    function getAllLifecycleHooks(reflector, token) {\n        return LIFECYCLE_HOOKS_VALUES.filter(function (hook) { return hasLifecycleHook(reflector, hook, token); });\n    }\n    function getHookName(hook) {\n        switch (hook) {\n            case LifecycleHooks.OnInit:\n                return 'ngOnInit';\n            case LifecycleHooks.OnDestroy:\n                return 'ngOnDestroy';\n            case LifecycleHooks.DoCheck:\n                return 'ngDoCheck';\n            case LifecycleHooks.OnChanges:\n                return 'ngOnChanges';\n            case LifecycleHooks.AfterContentInit:\n                return 'ngAfterContentInit';\n            case LifecycleHooks.AfterContentChecked:\n                return 'ngAfterContentChecked';\n            case LifecycleHooks.AfterViewInit:\n                return 'ngAfterViewInit';\n            case LifecycleHooks.AfterViewChecked:\n                return 'ngAfterViewChecked';\n            default:\n                // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n                // However Closure Compiler does not understand that and reports an error in typed mode.\n                // The `throw new Error` below works around the problem, and the unexpected: never variable\n                // makes sure tsc still checks this code is unreachable.\n                var unexpected = hook;\n                throw new Error(\"unexpected \" + unexpected);\n        }\n    }\n\n    var ERROR_COMPONENT_TYPE = 'ngComponentType';\n    var MISSING_NG_MODULE_METADATA_ERROR_DATA = 'ngMissingNgModuleMetadataErrorData';\n    function getMissingNgModuleMetadataErrorData(error) {\n        var _a;\n        return (_a = error[MISSING_NG_MODULE_METADATA_ERROR_DATA]) !== null && _a !== void 0 ? _a : null;\n    }\n    // Design notes:\n    // - don't lazily create metadata:\n    //   For some metadata, we need to do async work sometimes,\n    //   so the user has to kick off this loading.\n    //   But we want to report errors even when the async work is\n    //   not required to check that the user would have been able\n    //   to wait correctly.\n    var CompileMetadataResolver = /** @class */ (function () {\n        function CompileMetadataResolver(_config, _htmlParser, _ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _console, _staticSymbolCache, _reflector, _errorCollector) {\n            this._config = _config;\n            this._htmlParser = _htmlParser;\n            this._ngModuleResolver = _ngModuleResolver;\n            this._directiveResolver = _directiveResolver;\n            this._pipeResolver = _pipeResolver;\n            this._summaryResolver = _summaryResolver;\n            this._schemaRegistry = _schemaRegistry;\n            this._directiveNormalizer = _directiveNormalizer;\n            this._console = _console;\n            this._staticSymbolCache = _staticSymbolCache;\n            this._reflector = _reflector;\n            this._errorCollector = _errorCollector;\n            this._nonNormalizedDirectiveCache = new Map();\n            this._directiveCache = new Map();\n            this._summaryCache = new Map();\n            this._pipeCache = new Map();\n            this._ngModuleCache = new Map();\n            this._ngModuleOfTypes = new Map();\n            this._shallowModuleCache = new Map();\n        }\n        CompileMetadataResolver.prototype.getReflector = function () {\n            return this._reflector;\n        };\n        CompileMetadataResolver.prototype.clearCacheFor = function (type) {\n            var dirMeta = this._directiveCache.get(type);\n            this._directiveCache.delete(type);\n            this._nonNormalizedDirectiveCache.delete(type);\n            this._summaryCache.delete(type);\n            this._pipeCache.delete(type);\n            this._ngModuleOfTypes.delete(type);\n            // Clear all of the NgModule as they contain transitive information!\n            this._ngModuleCache.clear();\n            if (dirMeta) {\n                this._directiveNormalizer.clearCacheFor(dirMeta);\n            }\n        };\n        CompileMetadataResolver.prototype.clearCache = function () {\n            this._directiveCache.clear();\n            this._nonNormalizedDirectiveCache.clear();\n            this._summaryCache.clear();\n            this._pipeCache.clear();\n            this._ngModuleCache.clear();\n            this._ngModuleOfTypes.clear();\n            this._directiveNormalizer.clearCache();\n        };\n        CompileMetadataResolver.prototype._createProxyClass = function (baseType, name) {\n            var delegate = null;\n            var proxyClass = function () {\n                if (!delegate) {\n                    throw new Error(\"Illegal state: Class \" + name + \" for type \" + stringify(baseType) + \" is not compiled yet!\");\n                }\n                return delegate.apply(this, arguments);\n            };\n            proxyClass.setDelegate = function (d) {\n                delegate = d;\n                proxyClass.prototype = d.prototype;\n            };\n            // Make stringify work correctly\n            proxyClass.overriddenName = name;\n            return proxyClass;\n        };\n        CompileMetadataResolver.prototype.getGeneratedClass = function (dirType, name) {\n            if (dirType instanceof StaticSymbol) {\n                return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), name);\n            }\n            else {\n                return this._createProxyClass(dirType, name);\n            }\n        };\n        CompileMetadataResolver.prototype.getComponentViewClass = function (dirType) {\n            return this.getGeneratedClass(dirType, viewClassName(dirType, 0));\n        };\n        CompileMetadataResolver.prototype.getHostComponentViewClass = function (dirType) {\n            return this.getGeneratedClass(dirType, hostViewClassName(dirType));\n        };\n        CompileMetadataResolver.prototype.getHostComponentType = function (dirType) {\n            var name = identifierName({ reference: dirType }) + \"_Host\";\n            if (dirType instanceof StaticSymbol) {\n                return this._staticSymbolCache.get(dirType.filePath, name);\n            }\n            return this._createProxyClass(dirType, name);\n        };\n        CompileMetadataResolver.prototype.getRendererType = function (dirType) {\n            if (dirType instanceof StaticSymbol) {\n                return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), rendererTypeName(dirType));\n            }\n            else {\n                // returning an object as proxy,\n                // that we fill later during runtime compilation.\n                return {};\n            }\n        };\n        CompileMetadataResolver.prototype.getComponentFactory = function (selector, dirType, inputs, outputs) {\n            if (dirType instanceof StaticSymbol) {\n                return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), componentFactoryName(dirType));\n            }\n            else {\n                var hostView = this.getHostComponentViewClass(dirType);\n                // Note: ngContentSelectors will be filled later once the template is\n                // loaded.\n                var createComponentFactory = this._reflector.resolveExternalReference(Identifiers$1.createComponentFactory);\n                return createComponentFactory(selector, dirType, hostView, inputs, outputs, []);\n            }\n        };\n        CompileMetadataResolver.prototype.initComponentFactory = function (factory, ngContentSelectors) {\n            var _b;\n            if (!(factory instanceof StaticSymbol)) {\n                (_b = factory.ngContentSelectors).push.apply(_b, __spreadArray([], __read(ngContentSelectors)));\n            }\n        };\n        CompileMetadataResolver.prototype._loadSummary = function (type, kind) {\n            var typeSummary = this._summaryCache.get(type);\n            if (!typeSummary) {\n                var summary = this._summaryResolver.resolveSummary(type);\n                typeSummary = summary ? summary.type : null;\n                this._summaryCache.set(type, typeSummary || null);\n            }\n            return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;\n        };\n        CompileMetadataResolver.prototype.getHostComponentMetadata = function (compMeta, hostViewType) {\n            var hostType = this.getHostComponentType(compMeta.type.reference);\n            if (!hostViewType) {\n                hostViewType = this.getHostComponentViewClass(hostType);\n            }\n            // Note: ! is ok here as this method should only be called with normalized directive\n            // metadata, which always fills in the selector.\n            var template = CssSelector.parse(compMeta.selector)[0].getMatchingElementTemplate();\n            var templateUrl = '';\n            var htmlAst = this._htmlParser.parse(template, templateUrl);\n            return CompileDirectiveMetadata.create({\n                isHost: true,\n                type: { reference: hostType, diDeps: [], lifecycleHooks: [] },\n                template: new CompileTemplateMetadata({\n                    encapsulation: ViewEncapsulation.None,\n                    template: template,\n                    templateUrl: templateUrl,\n                    htmlAst: htmlAst,\n                    styles: [],\n                    styleUrls: [],\n                    ngContentSelectors: [],\n                    animations: [],\n                    isInline: true,\n                    externalStylesheets: [],\n                    interpolation: null,\n                    preserveWhitespaces: false,\n                }),\n                exportAs: null,\n                changeDetection: ChangeDetectionStrategy.Default,\n                inputs: [],\n                outputs: [],\n                host: {},\n                isComponent: true,\n                selector: '*',\n                providers: [],\n                viewProviders: [],\n                queries: [],\n                guards: {},\n                viewQueries: [],\n                componentViewType: hostViewType,\n                rendererType: { id: '__Host__', encapsulation: ViewEncapsulation.None, styles: [], data: {} },\n                entryComponents: [],\n                componentFactory: null\n            });\n        };\n        CompileMetadataResolver.prototype.loadDirectiveMetadata = function (ngModuleType, directiveType, isSync) {\n            var _this = this;\n            if (this._directiveCache.has(directiveType)) {\n                return null;\n            }\n            directiveType = resolveForwardRef(directiveType);\n            var _b = this.getNonNormalizedDirectiveMetadata(directiveType), annotation = _b.annotation, metadata = _b.metadata;\n            var createDirectiveMetadata = function (templateMetadata) {\n                var normalizedDirMeta = new CompileDirectiveMetadata({\n                    isHost: false,\n                    type: metadata.type,\n                    isComponent: metadata.isComponent,\n                    selector: metadata.selector,\n                    exportAs: metadata.exportAs,\n                    changeDetection: metadata.changeDetection,\n                    inputs: metadata.inputs,\n                    outputs: metadata.outputs,\n                    hostListeners: metadata.hostListeners,\n                    hostProperties: metadata.hostProperties,\n                    hostAttributes: metadata.hostAttributes,\n                    providers: metadata.providers,\n                    viewProviders: metadata.viewProviders,\n                    queries: metadata.queries,\n                    guards: metadata.guards,\n                    viewQueries: metadata.viewQueries,\n                    entryComponents: metadata.entryComponents,\n                    componentViewType: metadata.componentViewType,\n                    rendererType: metadata.rendererType,\n                    componentFactory: metadata.componentFactory,\n                    template: templateMetadata\n                });\n                if (templateMetadata) {\n                    _this.initComponentFactory(metadata.componentFactory, templateMetadata.ngContentSelectors);\n                }\n                _this._directiveCache.set(directiveType, normalizedDirMeta);\n                _this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());\n                return null;\n            };\n            if (metadata.isComponent) {\n                var template = metadata.template;\n                var templateMeta = this._directiveNormalizer.normalizeTemplate({\n                    ngModuleType: ngModuleType,\n                    componentType: directiveType,\n                    moduleUrl: this._reflector.componentModuleUrl(directiveType, annotation),\n                    encapsulation: template.encapsulation,\n                    template: template.template,\n                    templateUrl: template.templateUrl,\n                    styles: template.styles,\n                    styleUrls: template.styleUrls,\n                    animations: template.animations,\n                    interpolation: template.interpolation,\n                    preserveWhitespaces: template.preserveWhitespaces\n                });\n                if (isPromise(templateMeta) && isSync) {\n                    this._reportError(componentStillLoadingError(directiveType), directiveType);\n                    return null;\n                }\n                return SyncAsync.then(templateMeta, createDirectiveMetadata);\n            }\n            else {\n                // directive\n                createDirectiveMetadata(null);\n                return null;\n            }\n        };\n        CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = function (directiveType) {\n            var _this = this;\n            directiveType = resolveForwardRef(directiveType);\n            if (!directiveType) {\n                return null;\n            }\n            var cacheEntry = this._nonNormalizedDirectiveCache.get(directiveType);\n            if (cacheEntry) {\n                return cacheEntry;\n            }\n            var dirMeta = this._directiveResolver.resolve(directiveType, false);\n            if (!dirMeta) {\n                return null;\n            }\n            var nonNormalizedTemplateMetadata = undefined;\n            if (createComponent.isTypeOf(dirMeta)) {\n                // component\n                var compMeta = dirMeta;\n                assertArrayOfStrings('styles', compMeta.styles);\n                assertArrayOfStrings('styleUrls', compMeta.styleUrls);\n                assertInterpolationSymbols('interpolation', compMeta.interpolation);\n                var animations = compMeta.animations;\n                nonNormalizedTemplateMetadata = new CompileTemplateMetadata({\n                    encapsulation: noUndefined(compMeta.encapsulation),\n                    template: noUndefined(compMeta.template),\n                    templateUrl: noUndefined(compMeta.templateUrl),\n                    htmlAst: null,\n                    styles: compMeta.styles || [],\n                    styleUrls: compMeta.styleUrls || [],\n                    animations: animations || [],\n                    interpolation: noUndefined(compMeta.interpolation),\n                    isInline: !!compMeta.template,\n                    externalStylesheets: [],\n                    ngContentSelectors: [],\n                    preserveWhitespaces: noUndefined(dirMeta.preserveWhitespaces),\n                });\n            }\n            var changeDetectionStrategy = null;\n            var viewProviders = [];\n            var entryComponentMetadata = [];\n            var selector = dirMeta.selector;\n            if (createComponent.isTypeOf(dirMeta)) {\n                // Component\n                var compMeta = dirMeta;\n                changeDetectionStrategy = compMeta.changeDetection;\n                if (compMeta.viewProviders) {\n                    viewProviders = this._getProvidersMetadata(compMeta.viewProviders, entryComponentMetadata, \"viewProviders for \\\"\" + stringifyType(directiveType) + \"\\\"\", [], directiveType);\n                }\n                if (compMeta.entryComponents) {\n                    entryComponentMetadata = flattenAndDedupeArray(compMeta.entryComponents)\n                        .map(function (type) { return _this._getEntryComponentMetadata(type); })\n                        .concat(entryComponentMetadata);\n                }\n                if (!selector) {\n                    selector = this._schemaRegistry.getDefaultComponentElementName();\n                }\n            }\n            else {\n                // Directive\n                if (!selector) {\n                    selector = null;\n                }\n            }\n            var providers = [];\n            if (dirMeta.providers != null) {\n                providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, \"providers for \\\"\" + stringifyType(directiveType) + \"\\\"\", [], directiveType);\n            }\n            var queries = [];\n            var viewQueries = [];\n            if (dirMeta.queries != null) {\n                queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);\n                viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);\n            }\n            var metadata = CompileDirectiveMetadata.create({\n                isHost: false,\n                selector: selector,\n                exportAs: noUndefined(dirMeta.exportAs),\n                isComponent: !!nonNormalizedTemplateMetadata,\n                type: this._getTypeMetadata(directiveType),\n                template: nonNormalizedTemplateMetadata,\n                changeDetection: changeDetectionStrategy,\n                inputs: dirMeta.inputs || [],\n                outputs: dirMeta.outputs || [],\n                host: dirMeta.host || {},\n                providers: providers || [],\n                viewProviders: viewProviders || [],\n                queries: queries || [],\n                guards: dirMeta.guards || {},\n                viewQueries: viewQueries || [],\n                entryComponents: entryComponentMetadata,\n                componentViewType: nonNormalizedTemplateMetadata ? this.getComponentViewClass(directiveType) :\n                    null,\n                rendererType: nonNormalizedTemplateMetadata ? this.getRendererType(directiveType) : null,\n                componentFactory: null\n            });\n            if (nonNormalizedTemplateMetadata) {\n                metadata.componentFactory =\n                    this.getComponentFactory(selector, directiveType, metadata.inputs, metadata.outputs);\n            }\n            cacheEntry = { metadata: metadata, annotation: dirMeta };\n            this._nonNormalizedDirectiveCache.set(directiveType, cacheEntry);\n            return cacheEntry;\n        };\n        /**\n         * Gets the metadata for the given directive.\n         * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n         */\n        CompileMetadataResolver.prototype.getDirectiveMetadata = function (directiveType) {\n            var dirMeta = this._directiveCache.get(directiveType);\n            if (!dirMeta) {\n                this._reportError(syntaxError(\"Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive \" + stringifyType(directiveType) + \".\"), directiveType);\n            }\n            return dirMeta;\n        };\n        CompileMetadataResolver.prototype.getDirectiveSummary = function (dirType) {\n            var dirSummary = this._loadSummary(dirType, exports.CompileSummaryKind.Directive);\n            if (!dirSummary) {\n                this._reportError(syntaxError(\"Illegal state: Could not load the summary for directive \" + stringifyType(dirType) + \".\"), dirType);\n            }\n            return dirSummary;\n        };\n        CompileMetadataResolver.prototype.isDirective = function (type) {\n            return !!this._loadSummary(type, exports.CompileSummaryKind.Directive) ||\n                this._directiveResolver.isDirective(type);\n        };\n        CompileMetadataResolver.prototype.isAbstractDirective = function (type) {\n            var summary = this._loadSummary(type, exports.CompileSummaryKind.Directive);\n            if (summary && !summary.isComponent) {\n                return !summary.selector;\n            }\n            var meta = this._directiveResolver.resolve(type, false);\n            if (meta && !createComponent.isTypeOf(meta)) {\n                return !meta.selector;\n            }\n            return false;\n        };\n        CompileMetadataResolver.prototype.isPipe = function (type) {\n            return !!this._loadSummary(type, exports.CompileSummaryKind.Pipe) ||\n                this._pipeResolver.isPipe(type);\n        };\n        CompileMetadataResolver.prototype.isNgModule = function (type) {\n            return !!this._loadSummary(type, exports.CompileSummaryKind.NgModule) ||\n                this._ngModuleResolver.isNgModule(type);\n        };\n        CompileMetadataResolver.prototype.getNgModuleSummary = function (moduleType, alreadyCollecting) {\n            if (alreadyCollecting === void 0) { alreadyCollecting = null; }\n            var moduleSummary = this._loadSummary(moduleType, exports.CompileSummaryKind.NgModule);\n            if (!moduleSummary) {\n                var moduleMeta = this.getNgModuleMetadata(moduleType, false, alreadyCollecting);\n                moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;\n                if (moduleSummary) {\n                    this._summaryCache.set(moduleType, moduleSummary);\n                }\n            }\n            return moduleSummary;\n        };\n        /**\n         * Loads the declared directives and pipes of an NgModule.\n         */\n        CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = function (moduleType, isSync, throwIfNotFound) {\n            var _this = this;\n            if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n            var ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);\n            var loading = [];\n            if (ngModule) {\n                ngModule.declaredDirectives.forEach(function (id) {\n                    var promise = _this.loadDirectiveMetadata(moduleType, id.reference, isSync);\n                    if (promise) {\n                        loading.push(promise);\n                    }\n                });\n                ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });\n            }\n            return Promise.all(loading);\n        };\n        CompileMetadataResolver.prototype.getShallowModuleMetadata = function (moduleType) {\n            var compileMeta = this._shallowModuleCache.get(moduleType);\n            if (compileMeta) {\n                return compileMeta;\n            }\n            var ngModuleMeta = findLast(this._reflector.shallowAnnotations(moduleType), createNgModule.isTypeOf);\n            compileMeta = {\n                type: this._getTypeMetadata(moduleType),\n                rawExports: ngModuleMeta.exports,\n                rawImports: ngModuleMeta.imports,\n                rawProviders: ngModuleMeta.providers,\n            };\n            this._shallowModuleCache.set(moduleType, compileMeta);\n            return compileMeta;\n        };\n        CompileMetadataResolver.prototype.getNgModuleMetadata = function (moduleType, throwIfNotFound, alreadyCollecting) {\n            var _this = this;\n            if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n            if (alreadyCollecting === void 0) { alreadyCollecting = null; }\n            moduleType = resolveForwardRef(moduleType);\n            var compileMeta = this._ngModuleCache.get(moduleType);\n            if (compileMeta) {\n                return compileMeta;\n            }\n            var meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);\n            if (!meta) {\n                return null;\n            }\n            var declaredDirectives = [];\n            var exportedNonModuleIdentifiers = [];\n            var declaredPipes = [];\n            var importedModules = [];\n            var exportedModules = [];\n            var providers = [];\n            var entryComponents = [];\n            var bootstrapComponents = [];\n            var schemas = [];\n            if (meta.imports) {\n                flattenAndDedupeArray(meta.imports).forEach(function (importedType) {\n                    var importedModuleType = undefined;\n                    if (isValidType(importedType)) {\n                        importedModuleType = importedType;\n                    }\n                    else if (importedType && importedType.ngModule) {\n                        var moduleWithProviders = importedType;\n                        importedModuleType = moduleWithProviders.ngModule;\n                        if (moduleWithProviders.providers) {\n                            providers.push.apply(providers, __spreadArray([], __read(_this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, \"provider for the NgModule '\" + stringifyType(importedModuleType) + \"'\", [], importedType))));\n                        }\n                    }\n                    if (importedModuleType) {\n                        if (_this._checkSelfImport(moduleType, importedModuleType))\n                            return;\n                        if (!alreadyCollecting)\n                            alreadyCollecting = new Set();\n                        if (alreadyCollecting.has(importedModuleType)) {\n                            _this._reportError(syntaxError(_this._getTypeDescriptor(importedModuleType) + \" '\" + stringifyType(importedType) + \"' is imported recursively by the module '\" + stringifyType(moduleType) + \"'.\"), moduleType);\n                            return;\n                        }\n                        alreadyCollecting.add(importedModuleType);\n                        var importedModuleSummary = _this.getNgModuleSummary(importedModuleType, alreadyCollecting);\n                        alreadyCollecting.delete(importedModuleType);\n                        if (!importedModuleSummary) {\n                            var err = syntaxError(\"Unexpected \" + _this._getTypeDescriptor(importedType) + \" '\" + stringifyType(importedType) + \"' imported by the module '\" + stringifyType(moduleType) + \"'. Please add a @NgModule annotation.\");\n                            // If possible, record additional context for this error to enable more useful\n                            // diagnostics on the compiler side.\n                            if (importedType instanceof StaticSymbol) {\n                                err[MISSING_NG_MODULE_METADATA_ERROR_DATA] = {\n                                    fileName: importedType.filePath,\n                                    className: importedType.name,\n                                };\n                            }\n                            _this._reportError(err, moduleType);\n                            return;\n                        }\n                        importedModules.push(importedModuleSummary);\n                    }\n                    else {\n                        _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(importedType) + \"' imported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                        return;\n                    }\n                });\n            }\n            if (meta.exports) {\n                flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {\n                    if (!isValidType(exportedType)) {\n                        _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(exportedType) + \"' exported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                        return;\n                    }\n                    if (!alreadyCollecting)\n                        alreadyCollecting = new Set();\n                    if (alreadyCollecting.has(exportedType)) {\n                        _this._reportError(syntaxError(_this._getTypeDescriptor(exportedType) + \" '\" + stringify(exportedType) + \"' is exported recursively by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                        return;\n                    }\n                    alreadyCollecting.add(exportedType);\n                    var exportedModuleSummary = _this.getNgModuleSummary(exportedType, alreadyCollecting);\n                    alreadyCollecting.delete(exportedType);\n                    if (exportedModuleSummary) {\n                        exportedModules.push(exportedModuleSummary);\n                    }\n                    else {\n                        exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));\n                    }\n                });\n            }\n            // Note: This will be modified later, so we rely on\n            // getting a new instance every time!\n            var transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);\n            if (meta.declarations) {\n                flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {\n                    if (!isValidType(declaredType)) {\n                        _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(declaredType) + \"' declared by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                        return;\n                    }\n                    var declaredIdentifier = _this._getIdentifierMetadata(declaredType);\n                    if (_this.isDirective(declaredType)) {\n                        if (_this.isAbstractDirective(declaredType)) {\n                            _this._reportError(syntaxError(\"Directive \" + stringifyType(declaredType) + \" has no selector, please add it!\"), declaredType);\n                        }\n                        transitiveModule.addDirective(declaredIdentifier);\n                        declaredDirectives.push(declaredIdentifier);\n                        _this._addTypeToModule(declaredType, moduleType);\n                    }\n                    else if (_this.isPipe(declaredType)) {\n                        transitiveModule.addPipe(declaredIdentifier);\n                        transitiveModule.pipes.push(declaredIdentifier);\n                        declaredPipes.push(declaredIdentifier);\n                        _this._addTypeToModule(declaredType, moduleType);\n                    }\n                    else {\n                        _this._reportError(syntaxError(\"Unexpected \" + _this._getTypeDescriptor(declaredType) + \" '\" + stringifyType(declaredType) + \"' declared by the module '\" + stringifyType(moduleType) + \"'. Please add a @Pipe/@Directive/@Component annotation.\"), moduleType);\n                        return;\n                    }\n                });\n            }\n            var exportedDirectives = [];\n            var exportedPipes = [];\n            exportedNonModuleIdentifiers.forEach(function (exportedId) {\n                if (transitiveModule.directivesSet.has(exportedId.reference)) {\n                    exportedDirectives.push(exportedId);\n                    transitiveModule.addExportedDirective(exportedId);\n                }\n                else if (transitiveModule.pipesSet.has(exportedId.reference)) {\n                    exportedPipes.push(exportedId);\n                    transitiveModule.addExportedPipe(exportedId);\n                }\n                else {\n                    _this._reportError(syntaxError(\"Can't export \" + _this._getTypeDescriptor(exportedId.reference) + \" \" + stringifyType(exportedId.reference) + \" from \" + stringifyType(moduleType) + \" as it was neither declared nor imported!\"), moduleType);\n                    return;\n                }\n            });\n            // The providers of the module have to go last\n            // so that they overwrite any other provider we already added.\n            if (meta.providers) {\n                providers.push.apply(providers, __spreadArray([], __read(this._getProvidersMetadata(meta.providers, entryComponents, \"provider for the NgModule '\" + stringifyType(moduleType) + \"'\", [], moduleType))));\n            }\n            if (meta.entryComponents) {\n                entryComponents.push.apply(entryComponents, __spreadArray([], __read(flattenAndDedupeArray(meta.entryComponents)\n                    .map(function (type) { return _this._getEntryComponentMetadata(type); }))));\n            }\n            if (meta.bootstrap) {\n                flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {\n                    if (!isValidType(type)) {\n                        _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(type) + \"' used in the bootstrap property of module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                        return;\n                    }\n                    bootstrapComponents.push(_this._getIdentifierMetadata(type));\n                });\n            }\n            entryComponents.push.apply(entryComponents, __spreadArray([], __read(bootstrapComponents.map(function (type) { return _this._getEntryComponentMetadata(type.reference); }))));\n            if (meta.schemas) {\n                schemas.push.apply(schemas, __spreadArray([], __read(flattenAndDedupeArray(meta.schemas))));\n            }\n            compileMeta = new CompileNgModuleMetadata({\n                type: this._getTypeMetadata(moduleType),\n                providers: providers,\n                entryComponents: entryComponents,\n                bootstrapComponents: bootstrapComponents,\n                schemas: schemas,\n                declaredDirectives: declaredDirectives,\n                exportedDirectives: exportedDirectives,\n                declaredPipes: declaredPipes,\n                exportedPipes: exportedPipes,\n                importedModules: importedModules,\n                exportedModules: exportedModules,\n                transitiveModule: transitiveModule,\n                id: meta.id || null,\n            });\n            entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });\n            providers.forEach(function (provider) { return transitiveModule.addProvider(provider, compileMeta.type); });\n            transitiveModule.addModule(compileMeta.type);\n            this._ngModuleCache.set(moduleType, compileMeta);\n            return compileMeta;\n        };\n        CompileMetadataResolver.prototype._checkSelfImport = function (moduleType, importedModuleType) {\n            if (moduleType === importedModuleType) {\n                this._reportError(syntaxError(\"'\" + stringifyType(moduleType) + \"' module can't import itself\"), moduleType);\n                return true;\n            }\n            return false;\n        };\n        CompileMetadataResolver.prototype._getTypeDescriptor = function (type) {\n            if (isValidType(type)) {\n                if (this.isDirective(type)) {\n                    return 'directive';\n                }\n                if (this.isPipe(type)) {\n                    return 'pipe';\n                }\n                if (this.isNgModule(type)) {\n                    return 'module';\n                }\n            }\n            if (type.provide) {\n                return 'provider';\n            }\n            return 'value';\n        };\n        CompileMetadataResolver.prototype._addTypeToModule = function (type, moduleType) {\n            var oldModule = this._ngModuleOfTypes.get(type);\n            if (oldModule && oldModule !== moduleType) {\n                this._reportError(syntaxError(\"Type \" + stringifyType(type) + \" is part of the declarations of 2 modules: \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \"! \" +\n                    (\"Please consider moving \" + stringifyType(type) + \" to a higher module that imports \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \". \") +\n                    (\"You can also create a new NgModule that exports and includes \" + stringifyType(type) + \" then import that NgModule in \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \".\")), moduleType);\n                return;\n            }\n            this._ngModuleOfTypes.set(type, moduleType);\n        };\n        CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = function (importedModules, exportedModules) {\n            // collect `providers` / `entryComponents` from all imported and all exported modules\n            var result = new TransitiveCompileNgModuleMetadata();\n            var modulesByToken = new Map();\n            importedModules.concat(exportedModules).forEach(function (modSummary) {\n                modSummary.modules.forEach(function (mod) { return result.addModule(mod); });\n                modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });\n                var addedTokens = new Set();\n                modSummary.providers.forEach(function (entry) {\n                    var tokenRef = tokenReference(entry.provider.token);\n                    var prevModules = modulesByToken.get(tokenRef);\n                    if (!prevModules) {\n                        prevModules = new Set();\n                        modulesByToken.set(tokenRef, prevModules);\n                    }\n                    var moduleRef = entry.module.reference;\n                    // Note: the providers of one module may still contain multiple providers\n                    // per token (e.g. for multi providers), and we need to preserve these.\n                    if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {\n                        prevModules.add(moduleRef);\n                        addedTokens.add(tokenRef);\n                        result.addProvider(entry.provider, entry.module);\n                    }\n                });\n            });\n            exportedModules.forEach(function (modSummary) {\n                modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });\n                modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });\n            });\n            importedModules.forEach(function (modSummary) {\n                modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });\n                modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });\n            });\n            return result;\n        };\n        CompileMetadataResolver.prototype._getIdentifierMetadata = function (type) {\n            type = resolveForwardRef(type);\n            return { reference: type };\n        };\n        CompileMetadataResolver.prototype.isInjectable = function (type) {\n            var annotations = this._reflector.tryAnnotations(type);\n            return annotations.some(function (ann) { return createInjectable.isTypeOf(ann); });\n        };\n        CompileMetadataResolver.prototype.getInjectableSummary = function (type) {\n            return {\n                summaryKind: exports.CompileSummaryKind.Injectable,\n                type: this._getTypeMetadata(type, null, false)\n            };\n        };\n        CompileMetadataResolver.prototype.getInjectableMetadata = function (type, dependencies, throwOnUnknownDeps) {\n            if (dependencies === void 0) { dependencies = null; }\n            if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n            var typeSummary = this._loadSummary(type, exports.CompileSummaryKind.Injectable);\n            var typeMetadata = typeSummary ?\n                typeSummary.type :\n                this._getTypeMetadata(type, dependencies, throwOnUnknownDeps);\n            var annotations = this._reflector.annotations(type).filter(function (ann) { return createInjectable.isTypeOf(ann); });\n            if (annotations.length === 0) {\n                return null;\n            }\n            var meta = annotations[annotations.length - 1];\n            return {\n                symbol: type,\n                type: typeMetadata,\n                providedIn: meta.providedIn,\n                useValue: meta.useValue,\n                useClass: meta.useClass,\n                useExisting: meta.useExisting,\n                useFactory: meta.useFactory,\n                deps: meta.deps,\n            };\n        };\n        CompileMetadataResolver.prototype._getTypeMetadata = function (type, dependencies, throwOnUnknownDeps) {\n            if (dependencies === void 0) { dependencies = null; }\n            if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n            var identifier = this._getIdentifierMetadata(type);\n            return {\n                reference: identifier.reference,\n                diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),\n                lifecycleHooks: getAllLifecycleHooks(this._reflector, identifier.reference),\n            };\n        };\n        CompileMetadataResolver.prototype._getFactoryMetadata = function (factory, dependencies) {\n            if (dependencies === void 0) { dependencies = null; }\n            factory = resolveForwardRef(factory);\n            return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };\n        };\n        /**\n         * Gets the metadata for the given pipe.\n         * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n         */\n        CompileMetadataResolver.prototype.getPipeMetadata = function (pipeType) {\n            var pipeMeta = this._pipeCache.get(pipeType);\n            if (!pipeMeta) {\n                this._reportError(syntaxError(\"Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe \" + stringifyType(pipeType) + \".\"), pipeType);\n            }\n            return pipeMeta || null;\n        };\n        CompileMetadataResolver.prototype.getPipeSummary = function (pipeType) {\n            var pipeSummary = this._loadSummary(pipeType, exports.CompileSummaryKind.Pipe);\n            if (!pipeSummary) {\n                this._reportError(syntaxError(\"Illegal state: Could not load the summary for pipe \" + stringifyType(pipeType) + \".\"), pipeType);\n            }\n            return pipeSummary;\n        };\n        CompileMetadataResolver.prototype.getOrLoadPipeMetadata = function (pipeType) {\n            var pipeMeta = this._pipeCache.get(pipeType);\n            if (!pipeMeta) {\n                pipeMeta = this._loadPipeMetadata(pipeType);\n            }\n            return pipeMeta;\n        };\n        CompileMetadataResolver.prototype._loadPipeMetadata = function (pipeType) {\n            pipeType = resolveForwardRef(pipeType);\n            var pipeAnnotation = this._pipeResolver.resolve(pipeType);\n            var pipeMeta = new CompilePipeMetadata({\n                type: this._getTypeMetadata(pipeType),\n                name: pipeAnnotation.name,\n                pure: !!pipeAnnotation.pure\n            });\n            this._pipeCache.set(pipeType, pipeMeta);\n            this._summaryCache.set(pipeType, pipeMeta.toSummary());\n            return pipeMeta;\n        };\n        CompileMetadataResolver.prototype._getDependenciesMetadata = function (typeOrFunc, dependencies, throwOnUnknownDeps) {\n            var _this = this;\n            if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n            var hasUnknownDeps = false;\n            var params = dependencies || this._reflector.parameters(typeOrFunc) || [];\n            var dependenciesMetadata = params.map(function (param) {\n                var isAttribute = false;\n                var isHost = false;\n                var isSelf = false;\n                var isSkipSelf = false;\n                var isOptional = false;\n                var token = null;\n                if (Array.isArray(param)) {\n                    param.forEach(function (paramEntry) {\n                        if (createHost.isTypeOf(paramEntry)) {\n                            isHost = true;\n                        }\n                        else if (createSelf.isTypeOf(paramEntry)) {\n                            isSelf = true;\n                        }\n                        else if (createSkipSelf.isTypeOf(paramEntry)) {\n                            isSkipSelf = true;\n                        }\n                        else if (createOptional.isTypeOf(paramEntry)) {\n                            isOptional = true;\n                        }\n                        else if (createAttribute.isTypeOf(paramEntry)) {\n                            isAttribute = true;\n                            token = paramEntry.attributeName;\n                        }\n                        else if (createInject.isTypeOf(paramEntry)) {\n                            token = paramEntry.token;\n                        }\n                        else if (createInjectionToken.isTypeOf(paramEntry) ||\n                            paramEntry instanceof StaticSymbol) {\n                            token = paramEntry;\n                        }\n                        else if (isValidType(paramEntry) && token == null) {\n                            token = paramEntry;\n                        }\n                    });\n                }\n                else {\n                    token = param;\n                }\n                if (token == null) {\n                    hasUnknownDeps = true;\n                    return {};\n                }\n                return {\n                    isAttribute: isAttribute,\n                    isHost: isHost,\n                    isSelf: isSelf,\n                    isSkipSelf: isSkipSelf,\n                    isOptional: isOptional,\n                    token: _this._getTokenMetadata(token)\n                };\n            });\n            if (hasUnknownDeps) {\n                var depsTokens = dependenciesMetadata.map(function (dep) { return dep.token ? stringifyType(dep.token) : '?'; }).join(', ');\n                var message = \"Can't resolve all parameters for \" + stringifyType(typeOrFunc) + \": (\" + depsTokens + \").\";\n                if (throwOnUnknownDeps || this._config.strictInjectionParameters) {\n                    this._reportError(syntaxError(message), typeOrFunc);\n                }\n            }\n            return dependenciesMetadata;\n        };\n        CompileMetadataResolver.prototype._getTokenMetadata = function (token) {\n            token = resolveForwardRef(token);\n            var compileToken;\n            if (typeof token === 'string') {\n                compileToken = { value: token };\n            }\n            else {\n                compileToken = { identifier: { reference: token } };\n            }\n            return compileToken;\n        };\n        CompileMetadataResolver.prototype._getProvidersMetadata = function (providers, targetEntryComponents, debugInfo, compileProviders, type) {\n            var _this = this;\n            if (compileProviders === void 0) { compileProviders = []; }\n            providers.forEach(function (provider, providerIdx) {\n                if (Array.isArray(provider)) {\n                    _this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);\n                }\n                else {\n                    provider = resolveForwardRef(provider);\n                    var providerMeta = undefined;\n                    if (provider && typeof provider === 'object' && provider.hasOwnProperty('provide')) {\n                        _this._validateProvider(provider);\n                        providerMeta = new ProviderMeta(provider.provide, provider);\n                    }\n                    else if (isValidType(provider)) {\n                        providerMeta = new ProviderMeta(provider, { useClass: provider });\n                    }\n                    else if (provider === void 0) {\n                        _this._reportError(syntaxError(\"Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.\"));\n                        return;\n                    }\n                    else {\n                        var providersInfo = providers\n                            .reduce(function (soFar, seenProvider, seenProviderIdx) {\n                            if (seenProviderIdx < providerIdx) {\n                                soFar.push(\"\" + stringifyType(seenProvider));\n                            }\n                            else if (seenProviderIdx == providerIdx) {\n                                soFar.push(\"?\" + stringifyType(seenProvider) + \"?\");\n                            }\n                            else if (seenProviderIdx == providerIdx + 1) {\n                                soFar.push('...');\n                            }\n                            return soFar;\n                        }, [])\n                            .join(', ');\n                        _this._reportError(syntaxError(\"Invalid \" + (debugInfo ?\n                            debugInfo :\n                            'provider') + \" - only instances of Provider and Type are allowed, got: [\" + providersInfo + \"]\"), type);\n                        return;\n                    }\n                    if (providerMeta.token ===\n                        _this._reflector.resolveExternalReference(Identifiers$1.ANALYZE_FOR_ENTRY_COMPONENTS)) {\n                        targetEntryComponents.push.apply(targetEntryComponents, __spreadArray([], __read(_this._getEntryComponentsFromProvider(providerMeta, type))));\n                    }\n                    else {\n                        compileProviders.push(_this.getProviderMetadata(providerMeta));\n                    }\n                }\n            });\n            return compileProviders;\n        };\n        CompileMetadataResolver.prototype._validateProvider = function (provider) {\n            if (provider.hasOwnProperty('useClass') && provider.useClass == null) {\n                this._reportError(syntaxError(\"Invalid provider for \" + stringifyType(provider.provide) + \". useClass cannot be \" + provider.useClass + \".\\n           Usually it happens when:\\n           1. There's a circular dependency (might be caused by using index.ts (barrel) files).\\n           2. Class was used before it was declared. Use forwardRef in this case.\"));\n            }\n        };\n        CompileMetadataResolver.prototype._getEntryComponentsFromProvider = function (provider, type) {\n            var _this = this;\n            var components = [];\n            var collectedIdentifiers = [];\n            if (provider.useFactory || provider.useExisting || provider.useClass) {\n                this._reportError(syntaxError(\"The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!\"), type);\n                return [];\n            }\n            if (!provider.multi) {\n                this._reportError(syntaxError(\"The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!\"), type);\n                return [];\n            }\n            extractIdentifiers(provider.useValue, collectedIdentifiers);\n            collectedIdentifiers.forEach(function (identifier) {\n                var entry = _this._getEntryComponentMetadata(identifier.reference, false);\n                if (entry) {\n                    components.push(entry);\n                }\n            });\n            return components;\n        };\n        CompileMetadataResolver.prototype._getEntryComponentMetadata = function (dirType, throwIfNotFound) {\n            if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n            var dirMeta = this.getNonNormalizedDirectiveMetadata(dirType);\n            if (dirMeta && dirMeta.metadata.isComponent) {\n                return { componentType: dirType, componentFactory: dirMeta.metadata.componentFactory };\n            }\n            var dirSummary = this._loadSummary(dirType, exports.CompileSummaryKind.Directive);\n            if (dirSummary && dirSummary.isComponent) {\n                return { componentType: dirType, componentFactory: dirSummary.componentFactory };\n            }\n            if (throwIfNotFound) {\n                throw syntaxError(dirType.name + \" cannot be used as an entry component.\");\n            }\n            return null;\n        };\n        CompileMetadataResolver.prototype._getInjectableTypeMetadata = function (type, dependencies) {\n            if (dependencies === void 0) { dependencies = null; }\n            var typeSummary = this._loadSummary(type, exports.CompileSummaryKind.Injectable);\n            if (typeSummary) {\n                return typeSummary.type;\n            }\n            return this._getTypeMetadata(type, dependencies);\n        };\n        CompileMetadataResolver.prototype.getProviderMetadata = function (provider) {\n            var compileDeps = undefined;\n            var compileTypeMetadata = null;\n            var compileFactoryMetadata = null;\n            var token = this._getTokenMetadata(provider.token);\n            if (provider.useClass) {\n                compileTypeMetadata =\n                    this._getInjectableTypeMetadata(provider.useClass, provider.dependencies);\n                compileDeps = compileTypeMetadata.diDeps;\n                if (provider.token === provider.useClass) {\n                    // use the compileTypeMetadata as it contains information about lifecycleHooks...\n                    token = { identifier: compileTypeMetadata };\n                }\n            }\n            else if (provider.useFactory) {\n                compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);\n                compileDeps = compileFactoryMetadata.diDeps;\n            }\n            return {\n                token: token,\n                useClass: compileTypeMetadata,\n                useValue: provider.useValue,\n                useFactory: compileFactoryMetadata,\n                useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : undefined,\n                deps: compileDeps,\n                multi: provider.multi\n            };\n        };\n        CompileMetadataResolver.prototype._getQueriesMetadata = function (queries, isViewQuery, directiveType) {\n            var _this = this;\n            var res = [];\n            Object.keys(queries).forEach(function (propertyName) {\n                var query = queries[propertyName];\n                if (query.isViewQuery === isViewQuery) {\n                    res.push(_this._getQueryMetadata(query, propertyName, directiveType));\n                }\n            });\n            return res;\n        };\n        CompileMetadataResolver.prototype._queryVarBindings = function (selector) {\n            return selector.split(/\\s*,\\s*/);\n        };\n        CompileMetadataResolver.prototype._getQueryMetadata = function (q, propertyName, typeOrFunc) {\n            var _this = this;\n            var selectors;\n            if (typeof q.selector === 'string') {\n                selectors =\n                    this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });\n            }\n            else {\n                if (!q.selector) {\n                    this._reportError(syntaxError(\"Can't construct a query for the property \\\"\" + propertyName + \"\\\" of \\\"\" + stringifyType(typeOrFunc) + \"\\\" since the query selector wasn't defined.\"), typeOrFunc);\n                    selectors = [];\n                }\n                else {\n                    selectors = [this._getTokenMetadata(q.selector)];\n                }\n            }\n            return {\n                selectors: selectors,\n                first: q.first,\n                descendants: q.descendants,\n                emitDistinctChangesOnly: q.emitDistinctChangesOnly,\n                propertyName: propertyName,\n                read: q.read ? this._getTokenMetadata(q.read) : null,\n                static: q.static\n            };\n        };\n        CompileMetadataResolver.prototype._reportError = function (error, type, otherType) {\n            if (this._errorCollector) {\n                this._errorCollector(error, type);\n                if (otherType) {\n                    this._errorCollector(error, otherType);\n                }\n            }\n            else {\n                throw error;\n            }\n        };\n        return CompileMetadataResolver;\n    }());\n    function flattenArray(tree, out) {\n        if (out === void 0) { out = []; }\n        if (tree) {\n            for (var i = 0; i < tree.length; i++) {\n                var item = resolveForwardRef(tree[i]);\n                if (Array.isArray(item)) {\n                    flattenArray(item, out);\n                }\n                else {\n                    out.push(item);\n                }\n            }\n        }\n        return out;\n    }\n    function dedupeArray(array) {\n        if (array) {\n            return Array.from(new Set(array));\n        }\n        return [];\n    }\n    function flattenAndDedupeArray(tree) {\n        return dedupeArray(flattenArray(tree));\n    }\n    function isValidType(value) {\n        return (value instanceof StaticSymbol) || (value instanceof Type);\n    }\n    function extractIdentifiers(value, targetIdentifiers) {\n        visitValue(value, new _CompileValueConverter(), targetIdentifiers);\n    }\n    var _CompileValueConverter = /** @class */ (function (_super) {\n        __extends(_CompileValueConverter, _super);\n        function _CompileValueConverter() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        _CompileValueConverter.prototype.visitOther = function (value, targetIdentifiers) {\n            targetIdentifiers.push({ reference: value });\n        };\n        return _CompileValueConverter;\n    }(ValueTransformer));\n    function stringifyType(type) {\n        if (type instanceof StaticSymbol) {\n            return type.name + \" in \" + type.filePath;\n        }\n        else {\n            return stringify(type);\n        }\n    }\n    /**\n     * Indicates that a component is still being loaded in a synchronous compile.\n     */\n    function componentStillLoadingError(compType) {\n        var error = Error(\"Can't compile synchronously as \" + stringify(compType) + \" is still being loaded!\");\n        error[ERROR_COMPONENT_TYPE] = compType;\n        return error;\n    }\n\n    /**\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://angular.io/license\n     */\n    function providerDef(ctx, providerAst) {\n        var flags = 0 /* None */;\n        if (!providerAst.eager) {\n            flags |= 4096 /* LazyProvider */;\n        }\n        if (providerAst.providerType === exports.ProviderAstType.PrivateService) {\n            flags |= 8192 /* PrivateProvider */;\n        }\n        if (providerAst.isModule) {\n            flags |= 1073741824 /* TypeModuleProvider */;\n        }\n        providerAst.lifecycleHooks.forEach(function (lifecycleHook) {\n            // for regular providers, we only support ngOnDestroy\n            if (lifecycleHook === LifecycleHooks.OnDestroy ||\n                providerAst.providerType === exports.ProviderAstType.Directive ||\n                providerAst.providerType === exports.ProviderAstType.Component) {\n                flags |= lifecycleHookToNodeFlag(lifecycleHook);\n            }\n        });\n        var _a = providerAst.multiProvider ?\n            multiProviderDef(ctx, flags, providerAst.providers) :\n            singleProviderDef(ctx, flags, providerAst.providerType, providerAst.providers[0]), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;\n        return {\n            providerExpr: providerExpr,\n            flags: providerFlags,\n            depsExpr: depsExpr,\n            tokenExpr: tokenExpr(ctx, providerAst.token),\n        };\n    }\n    function multiProviderDef(ctx, flags, providers) {\n        var allDepDefs = [];\n        var allParams = [];\n        var exprs = providers.map(function (provider, providerIndex) {\n            var expr;\n            if (provider.useClass) {\n                var depExprs = convertDeps(providerIndex, provider.deps || provider.useClass.diDeps);\n                expr = ctx.importExpr(provider.useClass.reference).instantiate(depExprs);\n            }\n            else if (provider.useFactory) {\n                var depExprs = convertDeps(providerIndex, provider.deps || provider.useFactory.diDeps);\n                expr = ctx.importExpr(provider.useFactory.reference).callFn(depExprs);\n            }\n            else if (provider.useExisting) {\n                var depExprs = convertDeps(providerIndex, [{ token: provider.useExisting }]);\n                expr = depExprs[0];\n            }\n            else {\n                expr = convertValueToOutputAst(ctx, provider.useValue);\n            }\n            return expr;\n        });\n        var providerExpr = fn(allParams, [new ReturnStatement(literalArr(exprs))], INFERRED_TYPE);\n        return {\n            providerExpr: providerExpr,\n            flags: flags | 1024 /* TypeFactoryProvider */,\n            depsExpr: literalArr(allDepDefs)\n        };\n        function convertDeps(providerIndex, deps) {\n            return deps.map(function (dep, depIndex) {\n                var paramName = \"p\" + providerIndex + \"_\" + depIndex;\n                allParams.push(new FnParam(paramName, DYNAMIC_TYPE));\n                allDepDefs.push(depDef(ctx, dep));\n                return variable(paramName);\n            });\n        }\n    }\n    function singleProviderDef(ctx, flags, providerType, providerMeta) {\n        var providerExpr;\n        var deps;\n        if (providerType === exports.ProviderAstType.Directive || providerType === exports.ProviderAstType.Component) {\n            providerExpr = ctx.importExpr(providerMeta.useClass.reference);\n            flags |= 16384 /* TypeDirective */;\n            deps = providerMeta.deps || providerMeta.useClass.diDeps;\n        }\n        else {\n            if (providerMeta.useClass) {\n                providerExpr = ctx.importExpr(providerMeta.useClass.reference);\n                flags |= 512 /* TypeClassProvider */;\n                deps = providerMeta.deps || providerMeta.useClass.diDeps;\n            }\n            else if (providerMeta.useFactory) {\n                providerExpr = ctx.importExpr(providerMeta.useFactory.reference);\n                flags |= 1024 /* TypeFactoryProvider */;\n                deps = providerMeta.deps || providerMeta.useFactory.diDeps;\n            }\n            else if (providerMeta.useExisting) {\n                providerExpr = NULL_EXPR;\n                flags |= 2048 /* TypeUseExistingProvider */;\n                deps = [{ token: providerMeta.useExisting }];\n            }\n            else {\n                providerExpr = convertValueToOutputAst(ctx, providerMeta.useValue);\n                flags |= 256 /* TypeValueProvider */;\n                deps = [];\n            }\n        }\n        var depsExpr = literalArr(deps.map(function (dep) { return depDef(ctx, dep); }));\n        return { providerExpr: providerExpr, flags: flags, depsExpr: depsExpr };\n    }\n    function tokenExpr(ctx, tokenMeta) {\n        return tokenMeta.identifier ? ctx.importExpr(tokenMeta.identifier.reference) :\n            literal(tokenMeta.value);\n    }\n    function depDef(ctx, dep) {\n        // Note: the following fields have already been normalized out by provider_analyzer:\n        // - isAttribute, isHost\n        var expr = dep.isValue ? convertValueToOutputAst(ctx, dep.value) : tokenExpr(ctx, dep.token);\n        var flags = 0 /* None */;\n        if (dep.isSkipSelf) {\n            flags |= 1 /* SkipSelf */;\n        }\n        if (dep.isOptional) {\n            flags |= 2 /* Optional */;\n        }\n        if (dep.isSelf) {\n            flags |= 4 /* Self */;\n        }\n        if (dep.isValue) {\n            flags |= 8 /* Value */;\n        }\n        return flags === 0 /* None */ ? expr : literalArr([literal(flags), expr]);\n    }\n    function lifecycleHookToNodeFlag(lifecycleHook) {\n        var nodeFlag = 0 /* None */;\n        switch (lifecycleHook) {\n            case LifecycleHooks.AfterContentChecked:\n                nodeFlag = 2097152 /* AfterContentChecked */;\n                break;\n            case LifecycleHooks.AfterContentInit:\n                nodeFlag = 1048576 /* AfterContentInit */;\n                break;\n            case LifecycleHooks.AfterViewChecked:\n                nodeFlag = 8388608 /* AfterViewChecked */;\n                break;\n            case LifecycleHooks.AfterViewInit:\n                nodeFlag = 4194304 /* AfterViewInit */;\n                break;\n            case LifecycleHooks.DoCheck:\n                nodeFlag = 262144 /* DoCheck */;\n                break;\n            case LifecycleHooks.OnChanges:\n                nodeFlag = 524288 /* OnChanges */;\n                break;\n            case LifecycleHooks.OnDestroy:\n                nodeFlag = 131072 /* OnDestroy */;\n                break;\n            case LifecycleHooks.OnInit:\n                nodeFlag = 65536 /* OnInit */;\n                break;\n        }\n        return nodeFlag;\n    }\n    function componentFactoryResolverProviderDef(reflector, ctx, flags, entryComponents) {\n        var entryComponentFactories = entryComponents.map(function (entryComponent) { return ctx.importExpr(entryComponent.componentFactory); });\n        var token = createTokenForExternalReference(reflector, Identifiers$1.ComponentFactoryResolver);\n        var classMeta = {\n            diDeps: [\n                { isValue: true, value: literalArr(entryComponentFactories) },\n                { token: token, isSkipSelf: true, isOptional: true },\n                { token: createTokenForExternalReference(reflector, Identifiers$1.NgModuleRef) },\n            ],\n            lifecycleHooks: [],\n            reference: reflector.resolveExternalReference(Identifiers$1.CodegenComponentFactoryResolver)\n        };\n        var _a = singleProviderDef(ctx, flags, exports.ProviderAstType.PrivateService, {\n            token: token,\n            multi: false,\n            useClass: classMeta,\n        }), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;\n        return { providerExpr: providerExpr, flags: providerFlags, depsExpr: depsExpr, tokenExpr: tokenExpr(ctx, token) };\n    }\n\n    /**\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://angular.io/license\n     */\n    var NgModuleCompileResult = /** @class */ (function () {\n        function NgModuleCompileResult(ngModuleFactoryVar) {\n            this.ngModuleFactoryVar = ngModuleFactoryVar;\n        }\n        return NgModuleCompileResult;\n    }());\n    var LOG_VAR = variable('_l');\n    var NgModuleCompiler = /** @class */ (function () {\n        function NgModuleCompiler(reflector) {\n            this.reflector = reflector;\n        }\n        NgModuleCompiler.prototype.compile = function (ctx, ngModuleMeta, extraProviders) {\n            var sourceSpan = typeSourceSpan('NgModule', ngModuleMeta.type);\n            var entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;\n            var bootstrapComponents = ngModuleMeta.bootstrapComponents;\n            var providerParser = new NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);\n            var providerDefs = [componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]\n                .concat(providerParser.parse().map(function (provider) { return providerDef(ctx, provider); }))\n                .map(function (_a) {\n                var providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;\n                return importExpr(Identifiers$1.moduleProviderDef).callFn([\n                    literal(flags), tokenExpr, providerExpr, depsExpr\n                ]);\n            });\n            var ngModuleDef = importExpr(Identifiers$1.moduleDef).callFn([literalArr(providerDefs)]);\n            var ngModuleDefFactory = fn([new FnParam(LOG_VAR.name)], [new ReturnStatement(ngModuleDef)], INFERRED_TYPE);\n            var ngModuleFactoryVar = identifierName(ngModuleMeta.type) + \"NgFactory\";\n            this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, importExpr(Identifiers$1.createModuleFactory).callFn([\n                ctx.importExpr(ngModuleMeta.type.reference),\n                literalArr(bootstrapComponents.map(function (id) { return ctx.importExpr(id.reference); })),\n                ngModuleDefFactory\n            ]));\n            if (ngModuleMeta.id) {\n                var id = typeof ngModuleMeta.id === 'string' ? literal(ngModuleMeta.id) :\n                    ctx.importExpr(ngModuleMeta.id);\n                var registerFactoryStmt = importExpr(Identifiers$1.RegisterModuleFactoryFn)\n                    .callFn([id, variable(ngModuleFactoryVar)])\n                    .toStmt();\n                ctx.statements.push(registerFactoryStmt);\n            }\n            return new NgModuleCompileResult(ngModuleFactoryVar);\n        };\n        NgModuleCompiler.prototype.createStub = function (ctx, ngModuleReference) {\n            this._createNgModuleFactory(ctx, ngModuleReference, NULL_EXPR);\n        };\n        NgModuleCompiler.prototype._createNgModuleFactory = function (ctx, reference, value) {\n            var ngModuleFactoryVar = identifierName({ reference: reference }) + \"NgFactory\";\n            var ngModuleFactoryStmt = variable(ngModuleFactoryVar)\n                .set(value)\n                .toDeclStmt(importType(Identifiers$1.NgModuleFactory, [expressionType(ctx.importExpr(reference))], [TypeModifier.Const]), [exports.StmtModifier.Final, exports.StmtModifier.Exported]);\n            ctx.statements.push(ngModuleFactoryStmt);\n        };\n        return NgModuleCompiler;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Resolves types to {@link NgModule}.\n     */\n    var NgModuleResolver = /** @class */ (function () {\n        function NgModuleResolver(_reflector) {\n            this._reflector = _reflector;\n        }\n        NgModuleResolver.prototype.isNgModule = function (type) {\n            return this._reflector.annotations(type).some(createNgModule.isTypeOf);\n        };\n        NgModuleResolver.prototype.resolve = function (type, throwIfNotFound) {\n            if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n            var ngModuleMeta = findLast(this._reflector.annotations(type), createNgModule.isTypeOf);\n            if (ngModuleMeta) {\n                return ngModuleMeta;\n            }\n            else {\n                if (throwIfNotFound) {\n                    throw new Error(\"No NgModule metadata found for '\" + stringify(type) + \"'.\");\n                }\n                return null;\n            }\n        };\n        return NgModuleResolver;\n    }());\n\n    function debugOutputAstAsTypeScript(ast) {\n        var converter = new _TsEmitterVisitor();\n        var ctx = EmitterVisitorContext.createRoot();\n        var asts = Array.isArray(ast) ? ast : [ast];\n        asts.forEach(function (ast) {\n            if (ast instanceof Statement) {\n                ast.visitStatement(converter, ctx);\n            }\n            else if (ast instanceof Expression) {\n                ast.visitExpression(converter, ctx);\n            }\n            else if (ast instanceof Type$1) {\n                ast.visitType(converter, ctx);\n            }\n            else {\n                throw new Error(\"Don't know how to print debug info for \" + ast);\n            }\n        });\n        return ctx.toSource();\n    }\n    var TypeScriptEmitter = /** @class */ (function () {\n        function TypeScriptEmitter() {\n        }\n        TypeScriptEmitter.prototype.emitStatementsAndContext = function (genFilePath, stmts, preamble, emitSourceMaps, referenceFilter, importFilter) {\n            if (preamble === void 0) { preamble = ''; }\n            if (emitSourceMaps === void 0) { emitSourceMaps = true; }\n            var converter = new _TsEmitterVisitor(referenceFilter, importFilter);\n            var ctx = EmitterVisitorContext.createRoot();\n            converter.visitAllStatements(stmts, ctx);\n            var preambleLines = preamble ? preamble.split('\\n') : [];\n            converter.reexports.forEach(function (reexports, exportedModuleName) {\n                var reexportsCode = reexports.map(function (reexport) { return reexport.name + \" as \" + reexport.as; }).join(',');\n                preambleLines.push(\"export {\" + reexportsCode + \"} from '\" + exportedModuleName + \"';\");\n            });\n            converter.importsWithPrefixes.forEach(function (prefix, importedModuleName) {\n                // Note: can't write the real word for import as it screws up system.js auto detection...\n                preambleLines.push(\"imp\" +\n                    (\"ort * as \" + prefix + \" from '\" + importedModuleName + \"';\"));\n            });\n            var sm = emitSourceMaps ?\n                ctx.toSourceMapGenerator(genFilePath, preambleLines.length).toJsComment() :\n                '';\n            var lines = __spreadArray(__spreadArray([], __read(preambleLines)), [ctx.toSource(), sm]);\n            if (sm) {\n                // always add a newline at the end, as some tools have bugs without it.\n                lines.push('');\n            }\n            ctx.setPreambleLineCount(preambleLines.length);\n            return { sourceText: lines.join('\\n'), context: ctx };\n        };\n        TypeScriptEmitter.prototype.emitStatements = function (genFilePath, stmts, preamble) {\n            if (preamble === void 0) { preamble = ''; }\n            return this.emitStatementsAndContext(genFilePath, stmts, preamble).sourceText;\n        };\n        return TypeScriptEmitter;\n    }());\n    var _TsEmitterVisitor = /** @class */ (function (_super) {\n        __extends(_TsEmitterVisitor, _super);\n        function _TsEmitterVisitor(referenceFilter, importFilter) {\n            var _this = _super.call(this, false) || this;\n            _this.referenceFilter = referenceFilter;\n            _this.importFilter = importFilter;\n            _this.typeExpression = 0;\n            _this.importsWithPrefixes = new Map();\n            _this.reexports = new Map();\n            return _this;\n        }\n        _TsEmitterVisitor.prototype.visitType = function (t, ctx, defaultType) {\n            if (defaultType === void 0) { defaultType = 'any'; }\n            if (t) {\n                this.typeExpression++;\n                t.visitType(this, ctx);\n                this.typeExpression--;\n            }\n            else {\n                ctx.print(null, defaultType);\n            }\n        };\n        _TsEmitterVisitor.prototype.visitLiteralExpr = function (ast, ctx) {\n            var value = ast.value;\n            if (value == null && ast.type != INFERRED_TYPE) {\n                ctx.print(ast, \"(\" + value + \" as any)\");\n                return null;\n            }\n            return _super.prototype.visitLiteralExpr.call(this, ast, ctx);\n        };\n        // Temporary workaround to support strictNullCheck enabled consumers of ngc emit.\n        // In SNC mode, [] have the type never[], so we cast here to any[].\n        // TODO: narrow the cast to a more explicit type, or use a pattern that does not\n        // start with [].concat. see https://github.com/angular/angular/pull/11846\n        _TsEmitterVisitor.prototype.visitLiteralArrayExpr = function (ast, ctx) {\n            if (ast.entries.length === 0) {\n                ctx.print(ast, '(');\n            }\n            var result = _super.prototype.visitLiteralArrayExpr.call(this, ast, ctx);\n            if (ast.entries.length === 0) {\n                ctx.print(ast, ' as any[])');\n            }\n            return result;\n        };\n        _TsEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) {\n            this._visitIdentifier(ast.value, ast.typeParams, ctx);\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitAssertNotNullExpr = function (ast, ctx) {\n            var result = _super.prototype.visitAssertNotNullExpr.call(this, ast, ctx);\n            ctx.print(ast, '!');\n            return result;\n        };\n        _TsEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n            if (stmt.hasModifier(exports.StmtModifier.Exported) && stmt.value instanceof ExternalExpr &&\n                !stmt.type) {\n                // check for a reexport\n                var _a = stmt.value.value, name = _a.name, moduleName = _a.moduleName;\n                if (moduleName) {\n                    var reexports = this.reexports.get(moduleName);\n                    if (!reexports) {\n                        reexports = [];\n                        this.reexports.set(moduleName, reexports);\n                    }\n                    reexports.push({ name: name, as: stmt.name });\n                    return null;\n                }\n            }\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                ctx.print(stmt, \"export \");\n            }\n            if (stmt.hasModifier(exports.StmtModifier.Final)) {\n                ctx.print(stmt, \"const\");\n            }\n            else {\n                ctx.print(stmt, \"var\");\n            }\n            ctx.print(stmt, \" \" + stmt.name);\n            this._printColonType(stmt.type, ctx);\n            if (stmt.value) {\n                ctx.print(stmt, \" = \");\n                stmt.value.visitExpression(this, ctx);\n            }\n            ctx.println(stmt, \";\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitWrappedNodeExpr = function (ast, ctx) {\n            throw new Error('Cannot visit a WrappedNodeExpr when outputting Typescript.');\n        };\n        _TsEmitterVisitor.prototype.visitCastExpr = function (ast, ctx) {\n            ctx.print(ast, \"(<\");\n            ast.type.visitType(this, ctx);\n            ctx.print(ast, \">\");\n            ast.value.visitExpression(this, ctx);\n            ctx.print(ast, \")\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitInstantiateExpr = function (ast, ctx) {\n            ctx.print(ast, \"new \");\n            this.typeExpression++;\n            ast.classExpr.visitExpression(this, ctx);\n            this.typeExpression--;\n            ctx.print(ast, \"(\");\n            this.visitAllExpressions(ast.args, ctx, ',');\n            ctx.print(ast, \")\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n            var _this = this;\n            ctx.pushClass(stmt);\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                ctx.print(stmt, \"export \");\n            }\n            ctx.print(stmt, \"class \" + stmt.name);\n            if (stmt.parent != null) {\n                ctx.print(stmt, \" extends \");\n                this.typeExpression++;\n                stmt.parent.visitExpression(this, ctx);\n                this.typeExpression--;\n            }\n            ctx.println(stmt, \" {\");\n            ctx.incIndent();\n            stmt.fields.forEach(function (field) { return _this._visitClassField(field, ctx); });\n            if (stmt.constructorMethod != null) {\n                this._visitClassConstructor(stmt, ctx);\n            }\n            stmt.getters.forEach(function (getter) { return _this._visitClassGetter(getter, ctx); });\n            stmt.methods.forEach(function (method) { return _this._visitClassMethod(method, ctx); });\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n            ctx.popClass();\n            return null;\n        };\n        _TsEmitterVisitor.prototype._visitClassField = function (field, ctx) {\n            if (field.hasModifier(exports.StmtModifier.Private)) {\n                // comment out as a workaround for #10967\n                ctx.print(null, \"/*private*/ \");\n            }\n            if (field.hasModifier(exports.StmtModifier.Static)) {\n                ctx.print(null, 'static ');\n            }\n            ctx.print(null, field.name);\n            this._printColonType(field.type, ctx);\n            if (field.initializer) {\n                ctx.print(null, ' = ');\n                field.initializer.visitExpression(this, ctx);\n            }\n            ctx.println(null, \";\");\n        };\n        _TsEmitterVisitor.prototype._visitClassGetter = function (getter, ctx) {\n            if (getter.hasModifier(exports.StmtModifier.Private)) {\n                ctx.print(null, \"private \");\n            }\n            ctx.print(null, \"get \" + getter.name + \"()\");\n            this._printColonType(getter.type, ctx);\n            ctx.println(null, \" {\");\n            ctx.incIndent();\n            this.visitAllStatements(getter.body, ctx);\n            ctx.decIndent();\n            ctx.println(null, \"}\");\n        };\n        _TsEmitterVisitor.prototype._visitClassConstructor = function (stmt, ctx) {\n            ctx.print(stmt, \"constructor(\");\n            this._visitParams(stmt.constructorMethod.params, ctx);\n            ctx.println(stmt, \") {\");\n            ctx.incIndent();\n            this.visitAllStatements(stmt.constructorMethod.body, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n        };\n        _TsEmitterVisitor.prototype._visitClassMethod = function (method, ctx) {\n            if (method.hasModifier(exports.StmtModifier.Private)) {\n                ctx.print(null, \"private \");\n            }\n            ctx.print(null, method.name + \"(\");\n            this._visitParams(method.params, ctx);\n            ctx.print(null, \")\");\n            this._printColonType(method.type, ctx, 'void');\n            ctx.println(null, \" {\");\n            ctx.incIndent();\n            this.visitAllStatements(method.body, ctx);\n            ctx.decIndent();\n            ctx.println(null, \"}\");\n        };\n        _TsEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) {\n            if (ast.name) {\n                ctx.print(ast, 'function ');\n                ctx.print(ast, ast.name);\n            }\n            ctx.print(ast, \"(\");\n            this._visitParams(ast.params, ctx);\n            ctx.print(ast, \")\");\n            this._printColonType(ast.type, ctx, 'void');\n            if (!ast.name) {\n                ctx.print(ast, \" => \");\n            }\n            ctx.println(ast, '{');\n            ctx.incIndent();\n            this.visitAllStatements(ast.statements, ctx);\n            ctx.decIndent();\n            ctx.print(ast, \"}\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                ctx.print(stmt, \"export \");\n            }\n            ctx.print(stmt, \"function \" + stmt.name + \"(\");\n            this._visitParams(stmt.params, ctx);\n            ctx.print(stmt, \")\");\n            this._printColonType(stmt.type, ctx, 'void');\n            ctx.println(stmt, \" {\");\n            ctx.incIndent();\n            this.visitAllStatements(stmt.statements, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) {\n            ctx.println(stmt, \"try {\");\n            ctx.incIndent();\n            this.visitAllStatements(stmt.bodyStmts, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"} catch (\" + CATCH_ERROR_VAR$1.name + \") {\");\n            ctx.incIndent();\n            var catchStmts = [CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack', null)).toDeclStmt(null, [\n                    exports.StmtModifier.Final\n                ])].concat(stmt.catchStmts);\n            this.visitAllStatements(catchStmts, ctx);\n            ctx.decIndent();\n            ctx.println(stmt, \"}\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitBuiltinType = function (type, ctx) {\n            var typeStr;\n            switch (type.name) {\n                case exports.BuiltinTypeName.Bool:\n                    typeStr = 'boolean';\n                    break;\n                case exports.BuiltinTypeName.Dynamic:\n                    typeStr = 'any';\n                    break;\n                case exports.BuiltinTypeName.Function:\n                    typeStr = 'Function';\n                    break;\n                case exports.BuiltinTypeName.Number:\n                    typeStr = 'number';\n                    break;\n                case exports.BuiltinTypeName.Int:\n                    typeStr = 'number';\n                    break;\n                case exports.BuiltinTypeName.String:\n                    typeStr = 'string';\n                    break;\n                case exports.BuiltinTypeName.None:\n                    typeStr = 'never';\n                    break;\n                default:\n                    throw new Error(\"Unsupported builtin type \" + type.name);\n            }\n            ctx.print(null, typeStr);\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitExpressionType = function (ast, ctx) {\n            var _this = this;\n            ast.value.visitExpression(this, ctx);\n            if (ast.typeParams !== null) {\n                ctx.print(null, '<');\n                this.visitAllObjects(function (type) { return _this.visitType(type, ctx); }, ast.typeParams, ctx, ',');\n                ctx.print(null, '>');\n            }\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitArrayType = function (type, ctx) {\n            this.visitType(type.of, ctx);\n            ctx.print(null, \"[]\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.visitMapType = function (type, ctx) {\n            ctx.print(null, \"{[key: string]:\");\n            this.visitType(type.valueType, ctx);\n            ctx.print(null, \"}\");\n            return null;\n        };\n        _TsEmitterVisitor.prototype.getBuiltinMethodName = function (method) {\n            var name;\n            switch (method) {\n                case exports.BuiltinMethod.ConcatArray:\n                    name = 'concat';\n                    break;\n                case exports.BuiltinMethod.SubscribeObservable:\n                    name = 'subscribe';\n                    break;\n                case exports.BuiltinMethod.Bind:\n                    name = 'bind';\n                    break;\n                default:\n                    throw new Error(\"Unknown builtin method: \" + method);\n            }\n            return name;\n        };\n        _TsEmitterVisitor.prototype._visitParams = function (params, ctx) {\n            var _this = this;\n            this.visitAllObjects(function (param) {\n                ctx.print(null, param.name);\n                _this._printColonType(param.type, ctx);\n            }, params, ctx, ',');\n        };\n        _TsEmitterVisitor.prototype._visitIdentifier = function (value, typeParams, ctx) {\n            var _this = this;\n            var name = value.name, moduleName = value.moduleName;\n            if (this.referenceFilter && this.referenceFilter(value)) {\n                ctx.print(null, '(null as any)');\n                return;\n            }\n            if (moduleName && (!this.importFilter || !this.importFilter(value))) {\n                var prefix = this.importsWithPrefixes.get(moduleName);\n                if (prefix == null) {\n                    prefix = \"i\" + this.importsWithPrefixes.size;\n                    this.importsWithPrefixes.set(moduleName, prefix);\n                }\n                ctx.print(null, prefix + \".\");\n            }\n            ctx.print(null, name);\n            if (this.typeExpression > 0) {\n                // If we are in a type expression that refers to a generic type then supply\n                // the required type parameters. If there were not enough type parameters\n                // supplied, supply any as the type. Outside a type expression the reference\n                // should not supply type parameters and be treated as a simple value reference\n                // to the constructor function itself.\n                var suppliedParameters = typeParams || [];\n                if (suppliedParameters.length > 0) {\n                    ctx.print(null, \"<\");\n                    this.visitAllObjects(function (type) { return type.visitType(_this, ctx); }, typeParams, ctx, ',');\n                    ctx.print(null, \">\");\n                }\n            }\n        };\n        _TsEmitterVisitor.prototype._printColonType = function (type, ctx, defaultType) {\n            if (type !== INFERRED_TYPE) {\n                ctx.print(null, ':');\n                this.visitType(type, ctx, defaultType);\n            }\n        };\n        return _TsEmitterVisitor;\n    }(AbstractEmitterVisitor));\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Resolve a `Type` for {@link Pipe}.\n     *\n     * This interface can be overridden by the application developer to create custom behavior.\n     *\n     * See {@link Compiler}\n     */\n    var PipeResolver = /** @class */ (function () {\n        function PipeResolver(_reflector) {\n            this._reflector = _reflector;\n        }\n        PipeResolver.prototype.isPipe = function (type) {\n            var typeMetadata = this._reflector.annotations(resolveForwardRef(type));\n            return typeMetadata && typeMetadata.some(createPipe.isTypeOf);\n        };\n        /**\n         * Return {@link Pipe} for a given `Type`.\n         */\n        PipeResolver.prototype.resolve = function (type, throwIfNotFound) {\n            if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n            var metas = this._reflector.annotations(resolveForwardRef(type));\n            if (metas) {\n                var annotation = findLast(metas, createPipe.isTypeOf);\n                if (annotation) {\n                    return annotation;\n                }\n            }\n            if (throwIfNotFound) {\n                throw new Error(\"No Pipe decorator found on \" + stringify(type));\n            }\n            return null;\n        };\n        return PipeResolver;\n    }());\n\n    /**\n     * Generates code that is used to type check templates.\n     */\n    var TypeCheckCompiler = /** @class */ (function () {\n        function TypeCheckCompiler(options, reflector) {\n            this.options = options;\n            this.reflector = reflector;\n        }\n        /**\n         * Important notes:\n         * - This must not produce new `import` statements, but only refer to types outside\n         *   of the file via the variables provided via externalReferenceVars.\n         *   This allows Typescript to reuse the old program's structure as no imports have changed.\n         * - This must not produce any exports, as this would pollute the .d.ts file\n         *   and also violate the point above.\n         */\n        TypeCheckCompiler.prototype.compileComponent = function (componentId, component, template, usedPipes, externalReferenceVars, ctx) {\n            var _this = this;\n            var pipes = new Map();\n            usedPipes.forEach(function (p) { return pipes.set(p.name, p.type.reference); });\n            var embeddedViewCount = 0;\n            var viewBuilderFactory = function (parent, guards) {\n                var embeddedViewIndex = embeddedViewCount++;\n                return new ViewBuilder(_this.options, _this.reflector, externalReferenceVars, parent, component.type.reference, component.isHost, embeddedViewIndex, pipes, guards, ctx, viewBuilderFactory);\n            };\n            var visitor = viewBuilderFactory(null, []);\n            visitor.visitAll([], template);\n            return visitor.build(componentId);\n        };\n        return TypeCheckCompiler;\n    }());\n    var DYNAMIC_VAR_NAME = '_any';\n    var TypeCheckLocalResolver = /** @class */ (function () {\n        function TypeCheckLocalResolver() {\n        }\n        TypeCheckLocalResolver.prototype.notifyImplicitReceiverUse = function () { };\n        TypeCheckLocalResolver.prototype.maybeRestoreView = function () { };\n        TypeCheckLocalResolver.prototype.getLocal = function (name) {\n            if (name === EventHandlerVars.event.name) {\n                // References to the event should not be type-checked.\n                // TODO(chuckj): determine a better type for the event.\n                return variable(DYNAMIC_VAR_NAME);\n            }\n            return null;\n        };\n        return TypeCheckLocalResolver;\n    }());\n    var defaultResolver = new TypeCheckLocalResolver();\n    var ViewBuilder = /** @class */ (function () {\n        function ViewBuilder(options, reflector, externalReferenceVars, parent, component, isHostComponent, embeddedViewIndex, pipes, guards, ctx, viewBuilderFactory) {\n            this.options = options;\n            this.reflector = reflector;\n            this.externalReferenceVars = externalReferenceVars;\n            this.parent = parent;\n            this.component = component;\n            this.isHostComponent = isHostComponent;\n            this.embeddedViewIndex = embeddedViewIndex;\n            this.pipes = pipes;\n            this.guards = guards;\n            this.ctx = ctx;\n            this.viewBuilderFactory = viewBuilderFactory;\n            this.refOutputVars = new Map();\n            this.variables = [];\n            this.children = [];\n            this.updates = [];\n            this.actions = [];\n        }\n        ViewBuilder.prototype.getOutputVar = function (type) {\n            var varName;\n            if (type === this.component && this.isHostComponent) {\n                varName = DYNAMIC_VAR_NAME;\n            }\n            else if (type instanceof StaticSymbol) {\n                varName = this.externalReferenceVars.get(type);\n            }\n            else {\n                varName = DYNAMIC_VAR_NAME;\n            }\n            if (!varName) {\n                throw new Error(\"Illegal State: referring to a type without a variable \" + JSON.stringify(type));\n            }\n            return varName;\n        };\n        ViewBuilder.prototype.getTypeGuardExpressions = function (ast) {\n            var e_1, _a, e_2, _b;\n            var result = __spreadArray([], __read(this.guards));\n            try {\n                for (var _c = __values(ast.directives), _d = _c.next(); !_d.done; _d = _c.next()) {\n                    var directive = _d.value;\n                    try {\n                        for (var _e = (e_2 = void 0, __values(directive.inputs)), _f = _e.next(); !_f.done; _f = _e.next()) {\n                            var input = _f.value;\n                            var guard = directive.directive.guards[input.directiveName];\n                            if (guard) {\n                                var useIf = guard === 'UseIf';\n                                result.push({\n                                    guard: guard,\n                                    useIf: useIf,\n                                    expression: {\n                                        context: this.component,\n                                        value: input.value,\n                                        sourceSpan: input.sourceSpan,\n                                    },\n                                });\n                            }\n                        }\n                    }\n                    catch (e_2_1) { e_2 = { error: e_2_1 }; }\n                    finally {\n                        try {\n                            if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n                        }\n                        finally { if (e_2) throw e_2.error; }\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        };\n        ViewBuilder.prototype.visitAll = function (variables, astNodes) {\n            this.variables = variables;\n            templateVisitAll(this, astNodes);\n        };\n        ViewBuilder.prototype.build = function (componentId, targetStatements) {\n            var e_3, _a;\n            var _this = this;\n            if (targetStatements === void 0) { targetStatements = []; }\n            this.children.forEach(function (child) { return child.build(componentId, targetStatements); });\n            var viewStmts = [variable(DYNAMIC_VAR_NAME).set(NULL_EXPR).toDeclStmt(DYNAMIC_TYPE)];\n            var bindingCount = 0;\n            this.updates.forEach(function (expression) {\n                var _a = _this.preprocessUpdateExpression(expression), sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;\n                var bindingId = \"\" + bindingCount++;\n                var nameResolver = context === _this.component ? _this : defaultResolver;\n                var _b = convertPropertyBinding(nameResolver, variable(_this.getOutputVar(context)), value, bindingId, BindingForm.General), stmts = _b.stmts, currValExpr = _b.currValExpr;\n                stmts.push(new ExpressionStatement(currValExpr));\n                viewStmts.push.apply(viewStmts, __spreadArray([], __read(stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }))));\n            });\n            this.actions.forEach(function (_a) {\n                var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;\n                var bindingId = \"\" + bindingCount++;\n                var nameResolver = context === _this.component ? _this : defaultResolver;\n                var stmts = convertActionBinding(nameResolver, variable(_this.getOutputVar(context)), value, bindingId).stmts;\n                viewStmts.push.apply(viewStmts, __spreadArray([], __read(stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }))));\n            });\n            if (this.guards.length) {\n                var guardExpression = undefined;\n                try {\n                    for (var _b = __values(this.guards), _c = _b.next(); !_c.done; _c = _b.next()) {\n                        var guard = _c.value;\n                        var _d = this.preprocessUpdateExpression(guard.expression), context = _d.context, value = _d.value;\n                        var bindingId = \"\" + bindingCount++;\n                        var nameResolver = context === this.component ? this : defaultResolver;\n                        // We only support support simple expressions and ignore others as they\n                        // are unlikely to affect type narrowing.\n                        var _e = convertPropertyBinding(nameResolver, variable(this.getOutputVar(context)), value, bindingId, BindingForm.TrySimple), stmts = _e.stmts, currValExpr = _e.currValExpr;\n                        if (stmts.length == 0) {\n                            var guardClause = guard.useIf ? currValExpr : this.ctx.importExpr(guard.guard).callFn([currValExpr]);\n                            guardExpression = guardExpression ? guardExpression.and(guardClause) : guardClause;\n                        }\n                    }\n                }\n                catch (e_3_1) { e_3 = { error: e_3_1 }; }\n                finally {\n                    try {\n                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                    }\n                    finally { if (e_3) throw e_3.error; }\n                }\n                if (guardExpression) {\n                    viewStmts = [new IfStmt(guardExpression, viewStmts)];\n                }\n            }\n            var viewName = \"_View_\" + componentId + \"_\" + this.embeddedViewIndex;\n            var viewFactory = new DeclareFunctionStmt(viewName, [], viewStmts);\n            targetStatements.push(viewFactory);\n            return targetStatements;\n        };\n        ViewBuilder.prototype.visitBoundText = function (ast, context) {\n            var _this = this;\n            var astWithSource = ast.value;\n            var inter = astWithSource.ast;\n            inter.expressions.forEach(function (expr) { return _this.updates.push({ context: _this.component, value: expr, sourceSpan: ast.sourceSpan }); });\n        };\n        ViewBuilder.prototype.visitEmbeddedTemplate = function (ast, context) {\n            this.visitElementOrTemplate(ast);\n            // Note: The old view compiler used to use an `any` type\n            // for the context in any embedded view.\n            // We keep this behaivor behind a flag for now.\n            if (this.options.fullTemplateTypeCheck) {\n                // Find any applicable type guards. For example, NgIf has a type guard on ngIf\n                // (see NgIf.ngIfTypeGuard) that can be used to indicate that a template is only\n                // stamped out if ngIf is truthy so any bindings in the template can assume that,\n                // if a nullable type is used for ngIf, that expression is not null or undefined.\n                var guards = this.getTypeGuardExpressions(ast);\n                var childVisitor = this.viewBuilderFactory(this, guards);\n                this.children.push(childVisitor);\n                childVisitor.visitAll(ast.variables, ast.children);\n            }\n        };\n        ViewBuilder.prototype.visitElement = function (ast, context) {\n            var _this = this;\n            this.visitElementOrTemplate(ast);\n            var inputDefs = [];\n            var updateRendererExpressions = [];\n            var outputDefs = [];\n            ast.inputs.forEach(function (inputAst) {\n                _this.updates.push({ context: _this.component, value: inputAst.value, sourceSpan: inputAst.sourceSpan });\n            });\n            templateVisitAll(this, ast.children);\n        };\n        ViewBuilder.prototype.visitElementOrTemplate = function (ast) {\n            var _this = this;\n            ast.directives.forEach(function (dirAst) {\n                _this.visitDirective(dirAst);\n            });\n            ast.references.forEach(function (ref) {\n                var outputVarType = null;\n                // Note: The old view compiler used to use an `any` type\n                // for directives exposed via `exportAs`.\n                // We keep this behaivor behind a flag for now.\n                if (ref.value && ref.value.identifier && _this.options.fullTemplateTypeCheck) {\n                    outputVarType = ref.value.identifier.reference;\n                }\n                else {\n                    outputVarType = exports.BuiltinTypeName.Dynamic;\n                }\n                _this.refOutputVars.set(ref.name, outputVarType);\n            });\n            ast.outputs.forEach(function (outputAst) {\n                _this.actions.push({ context: _this.component, value: outputAst.handler, sourceSpan: outputAst.sourceSpan });\n            });\n        };\n        ViewBuilder.prototype.visitDirective = function (dirAst) {\n            var _this = this;\n            var dirType = dirAst.directive.type.reference;\n            dirAst.inputs.forEach(function (input) { return _this.updates.push({ context: _this.component, value: input.value, sourceSpan: input.sourceSpan }); });\n            // Note: The old view compiler used to use an `any` type\n            // for expressions in host properties / events.\n            // We keep this behaivor behind a flag for now.\n            if (this.options.fullTemplateTypeCheck) {\n                dirAst.hostProperties.forEach(function (inputAst) { return _this.updates.push({ context: dirType, value: inputAst.value, sourceSpan: inputAst.sourceSpan }); });\n                dirAst.hostEvents.forEach(function (hostEventAst) { return _this.actions.push({\n                    context: dirType,\n                    value: hostEventAst.handler,\n                    sourceSpan: hostEventAst.sourceSpan\n                }); });\n            }\n        };\n        ViewBuilder.prototype.notifyImplicitReceiverUse = function () { };\n        ViewBuilder.prototype.maybeRestoreView = function () { };\n        ViewBuilder.prototype.getLocal = function (name) {\n            if (name == EventHandlerVars.event.name) {\n                return variable(this.getOutputVar(exports.BuiltinTypeName.Dynamic));\n            }\n            for (var currBuilder = this; currBuilder; currBuilder = currBuilder.parent) {\n                var outputVarType = void 0;\n                // check references\n                outputVarType = currBuilder.refOutputVars.get(name);\n                if (outputVarType == null) {\n                    // check variables\n                    var varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });\n                    if (varAst) {\n                        outputVarType = exports.BuiltinTypeName.Dynamic;\n                    }\n                }\n                if (outputVarType != null) {\n                    return variable(this.getOutputVar(outputVarType));\n                }\n            }\n            return null;\n        };\n        ViewBuilder.prototype.pipeOutputVar = function (name) {\n            var pipe = this.pipes.get(name);\n            if (!pipe) {\n                throw new Error(\"Illegal State: Could not find pipe \" + name + \" in template of \" + this.component);\n            }\n            return this.getOutputVar(pipe);\n        };\n        ViewBuilder.prototype.preprocessUpdateExpression = function (expression) {\n            var _this = this;\n            return {\n                sourceSpan: expression.sourceSpan,\n                context: expression.context,\n                value: convertPropertyBindingBuiltins({\n                    createLiteralArrayConverter: function (argCount) { return function (args) {\n                        var arr = literalArr(args);\n                        // Note: The old view compiler used to use an `any` type\n                        // for arrays.\n                        return _this.options.fullTemplateTypeCheck ? arr : arr.cast(DYNAMIC_TYPE);\n                    }; },\n                    createLiteralMapConverter: function (keys) { return function (values) {\n                        var entries = keys.map(function (k, i) { return ({\n                            key: k.key,\n                            value: values[i],\n                            quoted: k.quoted,\n                        }); });\n                        var map = literalMap(entries);\n                        // Note: The old view compiler used to use an `any` type\n                        // for maps.\n                        return _this.options.fullTemplateTypeCheck ? map : map.cast(DYNAMIC_TYPE);\n                    }; },\n                    createPipeConverter: function (name, argCount) { return function (args) {\n                        // Note: The old view compiler used to use an `any` type\n                        // for pipes.\n                        var pipeExpr = _this.options.fullTemplateTypeCheck ?\n                            variable(_this.pipeOutputVar(name)) :\n                            variable(_this.getOutputVar(exports.BuiltinTypeName.Dynamic));\n                        return pipeExpr.callMethod('transform', args);\n                    }; },\n                }, expression.value)\n            };\n        };\n        ViewBuilder.prototype.visitNgContent = function (ast, context) { };\n        ViewBuilder.prototype.visitText = function (ast, context) { };\n        ViewBuilder.prototype.visitDirectiveProperty = function (ast, context) { };\n        ViewBuilder.prototype.visitReference = function (ast, context) { };\n        ViewBuilder.prototype.visitVariable = function (ast, context) { };\n        ViewBuilder.prototype.visitEvent = function (ast, context) { };\n        ViewBuilder.prototype.visitElementProperty = function (ast, context) { };\n        ViewBuilder.prototype.visitAttr = function (ast, context) { };\n        return ViewBuilder;\n    }());\n\n    var CLASS_ATTR$1 = 'class';\n    var STYLE_ATTR = 'style';\n    var IMPLICIT_TEMPLATE_VAR = '$implicit';\n    var ViewCompileResult = /** @class */ (function () {\n        function ViewCompileResult(viewClassVar, rendererTypeVar) {\n            this.viewClassVar = viewClassVar;\n            this.rendererTypeVar = rendererTypeVar;\n        }\n        return ViewCompileResult;\n    }());\n    var ViewCompiler = /** @class */ (function () {\n        function ViewCompiler(_reflector) {\n            this._reflector = _reflector;\n        }\n        ViewCompiler.prototype.compileComponent = function (outputCtx, component, template, styles, usedPipes) {\n            var _a;\n            var _this = this;\n            var embeddedViewCount = 0;\n            var renderComponentVarName = undefined;\n            if (!component.isHost) {\n                var template_1 = component.template;\n                var customRenderData = [];\n                if (template_1.animations && template_1.animations.length) {\n                    customRenderData.push(new LiteralMapEntry('animation', convertValueToOutputAst(outputCtx, template_1.animations), true));\n                }\n                var renderComponentVar = variable(rendererTypeName(component.type.reference));\n                renderComponentVarName = renderComponentVar.name;\n                outputCtx.statements.push(renderComponentVar\n                    .set(importExpr(Identifiers$1.createRendererType2).callFn([new LiteralMapExpr([\n                        new LiteralMapEntry('encapsulation', literal(template_1.encapsulation), false),\n                        new LiteralMapEntry('styles', styles, false),\n                        new LiteralMapEntry('data', new LiteralMapExpr(customRenderData), false)\n                    ])]))\n                    .toDeclStmt(importType(Identifiers$1.RendererType2), [exports.StmtModifier.Final, exports.StmtModifier.Exported]));\n            }\n            var viewBuilderFactory = function (parent) {\n                var embeddedViewIndex = embeddedViewCount++;\n                return new ViewBuilder$1(_this._reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, viewBuilderFactory);\n            };\n            var visitor = viewBuilderFactory(null);\n            visitor.visitAll([], template);\n            (_a = outputCtx.statements).push.apply(_a, __spreadArray([], __read(visitor.build())));\n            return new ViewCompileResult(visitor.viewName, renderComponentVarName);\n        };\n        return ViewCompiler;\n    }());\n    var LOG_VAR$1 = variable('_l');\n    var VIEW_VAR = variable('_v');\n    var CHECK_VAR = variable('_ck');\n    var COMP_VAR = variable('_co');\n    var EVENT_NAME_VAR = variable('en');\n    var ALLOW_DEFAULT_VAR = variable(\"ad\");\n    var ViewBuilder$1 = /** @class */ (function () {\n        function ViewBuilder(reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, viewBuilderFactory) {\n            this.reflector = reflector;\n            this.outputCtx = outputCtx;\n            this.parent = parent;\n            this.component = component;\n            this.embeddedViewIndex = embeddedViewIndex;\n            this.usedPipes = usedPipes;\n            this.viewBuilderFactory = viewBuilderFactory;\n            this.nodes = [];\n            this.purePipeNodeIndices = Object.create(null);\n            // Need Object.create so that we don't have builtin values...\n            this.refNodeIndices = Object.create(null);\n            this.variables = [];\n            this.children = [];\n            // TODO(tbosch): The old view compiler used to use an `any` type\n            // for the context in any embedded view. We keep this behaivor for now\n            // to be able to introduce the new view compiler without too many errors.\n            this.compType = this.embeddedViewIndex > 0 ?\n                DYNAMIC_TYPE :\n                expressionType(outputCtx.importExpr(this.component.type.reference));\n            this.viewName = viewClassName(this.component.type.reference, this.embeddedViewIndex);\n        }\n        ViewBuilder.prototype.visitAll = function (variables, astNodes) {\n            var _this = this;\n            this.variables = variables;\n            // create the pipes for the pure pipes immediately, so that we know their indices.\n            if (!this.parent) {\n                this.usedPipes.forEach(function (pipe) {\n                    if (pipe.pure) {\n                        _this.purePipeNodeIndices[pipe.name] = _this._createPipe(null, pipe);\n                    }\n                });\n            }\n            if (!this.parent) {\n                this.component.viewQueries.forEach(function (query, queryIndex) {\n                    // Note: queries start with id 1 so we can use the number in a Bloom filter!\n                    var queryId = queryIndex + 1;\n                    var bindingType = query.first ? 0 /* First */ : 1 /* All */;\n                    var flags = 134217728 /* TypeViewQuery */ | calcQueryFlags(query);\n                    _this.nodes.push(function () { return ({\n                        sourceSpan: null,\n                        nodeFlags: flags,\n                        nodeDef: importExpr(Identifiers$1.queryDef).callFn([\n                            literal(flags), literal(queryId),\n                            new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType), false)])\n                        ])\n                    }); });\n                });\n            }\n            templateVisitAll(this, astNodes);\n            if (this.parent && (astNodes.length === 0 || needsAdditionalRootNode(astNodes))) {\n                // if the view is an embedded view, then we need to add an additional root node in some cases\n                this.nodes.push(function () { return ({\n                    sourceSpan: null,\n                    nodeFlags: 1 /* TypeElement */,\n                    nodeDef: importExpr(Identifiers$1.anchorDef).callFn([\n                        literal(0 /* None */), NULL_EXPR, NULL_EXPR, literal(0)\n                    ])\n                }); });\n            }\n        };\n        ViewBuilder.prototype.build = function (targetStatements) {\n            if (targetStatements === void 0) { targetStatements = []; }\n            this.children.forEach(function (child) { return child.build(targetStatements); });\n            var _a = this._createNodeExpressions(), updateRendererStmts = _a.updateRendererStmts, updateDirectivesStmts = _a.updateDirectivesStmts, nodeDefExprs = _a.nodeDefExprs;\n            var updateRendererFn = this._createUpdateFn(updateRendererStmts);\n            var updateDirectivesFn = this._createUpdateFn(updateDirectivesStmts);\n            var viewFlags = 0 /* None */;\n            if (!this.parent && this.component.changeDetection === ChangeDetectionStrategy.OnPush) {\n                viewFlags |= 2 /* OnPush */;\n            }\n            var viewFactory = new DeclareFunctionStmt(this.viewName, [new FnParam(LOG_VAR$1.name)], [new ReturnStatement(importExpr(Identifiers$1.viewDef).callFn([\n                    literal(viewFlags),\n                    literalArr(nodeDefExprs),\n                    updateDirectivesFn,\n                    updateRendererFn,\n                ]))], importType(Identifiers$1.ViewDefinition), this.embeddedViewIndex === 0 ? [exports.StmtModifier.Exported] : []);\n            targetStatements.push(viewFactory);\n            return targetStatements;\n        };\n        ViewBuilder.prototype._createUpdateFn = function (updateStmts) {\n            var updateFn;\n            if (updateStmts.length > 0) {\n                var preStmts = [];\n                if (!this.component.isHost && findReadVarNames(updateStmts).has(COMP_VAR.name)) {\n                    preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));\n                }\n                updateFn = fn([\n                    new FnParam(CHECK_VAR.name, INFERRED_TYPE),\n                    new FnParam(VIEW_VAR.name, INFERRED_TYPE)\n                ], __spreadArray(__spreadArray([], __read(preStmts)), __read(updateStmts)), INFERRED_TYPE);\n            }\n            else {\n                updateFn = NULL_EXPR;\n            }\n            return updateFn;\n        };\n        ViewBuilder.prototype.visitNgContent = function (ast, context) {\n            // ngContentDef(ngContentIndex: number, index: number): NodeDef;\n            this.nodes.push(function () { return ({\n                sourceSpan: ast.sourceSpan,\n                nodeFlags: 8 /* TypeNgContent */,\n                nodeDef: importExpr(Identifiers$1.ngContentDef)\n                    .callFn([literal(ast.ngContentIndex), literal(ast.index)])\n            }); });\n        };\n        ViewBuilder.prototype.visitText = function (ast, context) {\n            // Static text nodes have no check function\n            var checkIndex = -1;\n            this.nodes.push(function () { return ({\n                sourceSpan: ast.sourceSpan,\n                nodeFlags: 2 /* TypeText */,\n                nodeDef: importExpr(Identifiers$1.textDef).callFn([\n                    literal(checkIndex),\n                    literal(ast.ngContentIndex),\n                    literalArr([literal(ast.value)]),\n                ])\n            }); });\n        };\n        ViewBuilder.prototype.visitBoundText = function (ast, context) {\n            var _this = this;\n            var nodeIndex = this.nodes.length;\n            // reserve the space in the nodeDefs array\n            this.nodes.push(null);\n            var astWithSource = ast.value;\n            var inter = astWithSource.ast;\n            var updateRendererExpressions = inter.expressions.map(function (expr, bindingIndex) { return _this._preprocessUpdateExpression({ nodeIndex: nodeIndex, bindingIndex: bindingIndex, sourceSpan: ast.sourceSpan, context: COMP_VAR, value: expr }); });\n            // Check index is the same as the node index during compilation\n            // They might only differ at runtime\n            var checkIndex = nodeIndex;\n            this.nodes[nodeIndex] = function () { return ({\n                sourceSpan: ast.sourceSpan,\n                nodeFlags: 2 /* TypeText */,\n                nodeDef: importExpr(Identifiers$1.textDef).callFn([\n                    literal(checkIndex),\n                    literal(ast.ngContentIndex),\n                    literalArr(inter.strings.map(function (s) { return literal(s); })),\n                ]),\n                updateRenderer: updateRendererExpressions\n            }); };\n        };\n        ViewBuilder.prototype.visitEmbeddedTemplate = function (ast, context) {\n            var _this = this;\n            var nodeIndex = this.nodes.length;\n            // reserve the space in the nodeDefs array\n            this.nodes.push(null);\n            var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, queryMatchesExpr = _a.queryMatchesExpr, hostEvents = _a.hostEvents;\n            var childVisitor = this.viewBuilderFactory(this);\n            this.children.push(childVisitor);\n            childVisitor.visitAll(ast.variables, ast.children);\n            var childCount = this.nodes.length - nodeIndex - 1;\n            // anchorDef(\n            //   flags: NodeFlags, matchedQueries: [string, QueryValueType][], ngContentIndex: number,\n            //   childCount: number, handleEventFn?: ElementHandleEventFn, templateFactory?:\n            //   ViewDefinitionFactory): NodeDef;\n            this.nodes[nodeIndex] = function () { return ({\n                sourceSpan: ast.sourceSpan,\n                nodeFlags: 1 /* TypeElement */ | flags,\n                nodeDef: importExpr(Identifiers$1.anchorDef).callFn([\n                    literal(flags),\n                    queryMatchesExpr,\n                    literal(ast.ngContentIndex),\n                    literal(childCount),\n                    _this._createElementHandleEventFn(nodeIndex, hostEvents),\n                    variable(childVisitor.viewName),\n                ])\n            }); };\n        };\n        ViewBuilder.prototype.visitElement = function (ast, context) {\n            var _this = this;\n            var nodeIndex = this.nodes.length;\n            // reserve the space in the nodeDefs array so we can add children\n            this.nodes.push(null);\n            // Using a null element name creates an anchor.\n            var elName = isNgContainer(ast.name) ? null : ast.name;\n            var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, usedEvents = _a.usedEvents, queryMatchesExpr = _a.queryMatchesExpr, dirHostBindings = _a.hostBindings, hostEvents = _a.hostEvents;\n            var inputDefs = [];\n            var updateRendererExpressions = [];\n            var outputDefs = [];\n            if (elName) {\n                var hostBindings = ast.inputs\n                    .map(function (inputAst) { return ({\n                    context: COMP_VAR,\n                    inputAst: inputAst,\n                    dirAst: null,\n                }); })\n                    .concat(dirHostBindings);\n                if (hostBindings.length) {\n                    updateRendererExpressions =\n                        hostBindings.map(function (hostBinding, bindingIndex) { return _this._preprocessUpdateExpression({\n                            context: hostBinding.context,\n                            nodeIndex: nodeIndex,\n                            bindingIndex: bindingIndex,\n                            sourceSpan: hostBinding.inputAst.sourceSpan,\n                            value: hostBinding.inputAst.value\n                        }); });\n                    inputDefs = hostBindings.map(function (hostBinding) { return elementBindingDef(hostBinding.inputAst, hostBinding.dirAst); });\n                }\n                outputDefs = usedEvents.map(function (_a) {\n                    var _b = __read(_a, 2), target = _b[0], eventName = _b[1];\n                    return literalArr([literal(target), literal(eventName)]);\n                });\n            }\n            templateVisitAll(this, ast.children);\n            var childCount = this.nodes.length - nodeIndex - 1;\n            var compAst = ast.directives.find(function (dirAst) { return dirAst.directive.isComponent; });\n            var compRendererType = NULL_EXPR;\n            var compView = NULL_EXPR;\n            if (compAst) {\n                compView = this.outputCtx.importExpr(compAst.directive.componentViewType);\n                compRendererType = this.outputCtx.importExpr(compAst.directive.rendererType);\n            }\n            // Check index is the same as the node index during compilation\n            // They might only differ at runtime\n            var checkIndex = nodeIndex;\n            this.nodes[nodeIndex] = function () { return ({\n                sourceSpan: ast.sourceSpan,\n                nodeFlags: 1 /* TypeElement */ | flags,\n                nodeDef: importExpr(Identifiers$1.elementDef).callFn([\n                    literal(checkIndex),\n                    literal(flags),\n                    queryMatchesExpr,\n                    literal(ast.ngContentIndex),\n                    literal(childCount),\n                    literal(elName),\n                    elName ? fixedAttrsDef(ast) : NULL_EXPR,\n                    inputDefs.length ? literalArr(inputDefs) : NULL_EXPR,\n                    outputDefs.length ? literalArr(outputDefs) : NULL_EXPR,\n                    _this._createElementHandleEventFn(nodeIndex, hostEvents),\n                    compView,\n                    compRendererType,\n                ]),\n                updateRenderer: updateRendererExpressions\n            }); };\n        };\n        ViewBuilder.prototype._visitElementOrTemplate = function (nodeIndex, ast) {\n            var _this = this;\n            var flags = 0 /* None */;\n            if (ast.hasViewContainer) {\n                flags |= 16777216 /* EmbeddedViews */;\n            }\n            var usedEvents = new Map();\n            ast.outputs.forEach(function (event) {\n                var _a = elementEventNameAndTarget(event, null), name = _a.name, target = _a.target;\n                usedEvents.set(elementEventFullName(target, name), [target, name]);\n            });\n            ast.directives.forEach(function (dirAst) {\n                dirAst.hostEvents.forEach(function (event) {\n                    var _a = elementEventNameAndTarget(event, dirAst), name = _a.name, target = _a.target;\n                    usedEvents.set(elementEventFullName(target, name), [target, name]);\n                });\n            });\n            var hostBindings = [];\n            var hostEvents = [];\n            this._visitComponentFactoryResolverProvider(ast.directives);\n            ast.providers.forEach(function (providerAst) {\n                var dirAst = undefined;\n                ast.directives.forEach(function (localDirAst) {\n                    if (localDirAst.directive.type.reference === tokenReference(providerAst.token)) {\n                        dirAst = localDirAst;\n                    }\n                });\n                if (dirAst) {\n                    var _a = _this._visitDirective(providerAst, dirAst, ast.references, ast.queryMatches, usedEvents), dirHostBindings = _a.hostBindings, dirHostEvents = _a.hostEvents;\n                    hostBindings.push.apply(hostBindings, __spreadArray([], __read(dirHostBindings)));\n                    hostEvents.push.apply(hostEvents, __spreadArray([], __read(dirHostEvents)));\n                }\n                else {\n                    _this._visitProvider(providerAst, ast.queryMatches);\n                }\n            });\n            var queryMatchExprs = [];\n            ast.queryMatches.forEach(function (match) {\n                var valueType = undefined;\n                if (tokenReference(match.value) ===\n                    _this.reflector.resolveExternalReference(Identifiers$1.ElementRef)) {\n                    valueType = 0 /* ElementRef */;\n                }\n                else if (tokenReference(match.value) ===\n                    _this.reflector.resolveExternalReference(Identifiers$1.ViewContainerRef)) {\n                    valueType = 3 /* ViewContainerRef */;\n                }\n                else if (tokenReference(match.value) ===\n                    _this.reflector.resolveExternalReference(Identifiers$1.TemplateRef)) {\n                    valueType = 2 /* TemplateRef */;\n                }\n                if (valueType != null) {\n                    queryMatchExprs.push(literalArr([literal(match.queryId), literal(valueType)]));\n                }\n            });\n            ast.references.forEach(function (ref) {\n                var valueType = undefined;\n                if (!ref.value) {\n                    valueType = 1 /* RenderElement */;\n                }\n                else if (tokenReference(ref.value) ===\n                    _this.reflector.resolveExternalReference(Identifiers$1.TemplateRef)) {\n                    valueType = 2 /* TemplateRef */;\n                }\n                if (valueType != null) {\n                    _this.refNodeIndices[ref.name] = nodeIndex;\n                    queryMatchExprs.push(literalArr([literal(ref.name), literal(valueType)]));\n                }\n            });\n            ast.outputs.forEach(function (outputAst) {\n                hostEvents.push({ context: COMP_VAR, eventAst: outputAst, dirAst: null });\n            });\n            return {\n                flags: flags,\n                usedEvents: Array.from(usedEvents.values()),\n                queryMatchesExpr: queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,\n                hostBindings: hostBindings,\n                hostEvents: hostEvents\n            };\n        };\n        ViewBuilder.prototype._visitDirective = function (providerAst, dirAst, refs, queryMatches, usedEvents) {\n            var _this = this;\n            var nodeIndex = this.nodes.length;\n            // reserve the space in the nodeDefs array so we can add children\n            this.nodes.push(null);\n            dirAst.directive.queries.forEach(function (query, queryIndex) {\n                var queryId = dirAst.contentQueryStartId + queryIndex;\n                var flags = 67108864 /* TypeContentQuery */ | calcQueryFlags(query);\n                var bindingType = query.first ? 0 /* First */ : 1 /* All */;\n                _this.nodes.push(function () { return ({\n                    sourceSpan: dirAst.sourceSpan,\n                    nodeFlags: flags,\n                    nodeDef: importExpr(Identifiers$1.queryDef).callFn([\n                        literal(flags), literal(queryId),\n                        new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType), false)])\n                    ]),\n                }); });\n            });\n            // Note: the operation below might also create new nodeDefs,\n            // but we don't want them to be a child of a directive,\n            // as they might be a provider/pipe on their own.\n            // I.e. we only allow queries as children of directives nodes.\n            var childCount = this.nodes.length - nodeIndex - 1;\n            var _a = this._visitProviderOrDirective(providerAst, queryMatches), flags = _a.flags, queryMatchExprs = _a.queryMatchExprs, providerExpr = _a.providerExpr, depsExpr = _a.depsExpr;\n            refs.forEach(function (ref) {\n                if (ref.value && tokenReference(ref.value) === tokenReference(providerAst.token)) {\n                    _this.refNodeIndices[ref.name] = nodeIndex;\n                    queryMatchExprs.push(literalArr([literal(ref.name), literal(4 /* Provider */)]));\n                }\n            });\n            if (dirAst.directive.isComponent) {\n                flags |= 32768 /* Component */;\n            }\n            var inputDefs = dirAst.inputs.map(function (inputAst, inputIndex) {\n                var mapValue = literalArr([literal(inputIndex), literal(inputAst.directiveName)]);\n                // Note: it's important to not quote the key so that we can capture renames by minifiers!\n                return new LiteralMapEntry(inputAst.directiveName, mapValue, false);\n            });\n            var outputDefs = [];\n            var dirMeta = dirAst.directive;\n            Object.keys(dirMeta.outputs).forEach(function (propName) {\n                var eventName = dirMeta.outputs[propName];\n                if (usedEvents.has(eventName)) {\n                    // Note: it's important to not quote the key so that we can capture renames by minifiers!\n                    outputDefs.push(new LiteralMapEntry(propName, literal(eventName), false));\n                }\n            });\n            var updateDirectiveExpressions = [];\n            if (dirAst.inputs.length || (flags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0) {\n                updateDirectiveExpressions =\n                    dirAst.inputs.map(function (input, bindingIndex) { return _this._preprocessUpdateExpression({\n                        nodeIndex: nodeIndex,\n                        bindingIndex: bindingIndex,\n                        sourceSpan: input.sourceSpan,\n                        context: COMP_VAR,\n                        value: input.value\n                    }); });\n            }\n            var dirContextExpr = importExpr(Identifiers$1.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);\n            var hostBindings = dirAst.hostProperties.map(function (inputAst) { return ({\n                context: dirContextExpr,\n                dirAst: dirAst,\n                inputAst: inputAst,\n            }); });\n            var hostEvents = dirAst.hostEvents.map(function (hostEventAst) { return ({\n                context: dirContextExpr,\n                eventAst: hostEventAst,\n                dirAst: dirAst,\n            }); });\n            // Check index is the same as the node index during compilation\n            // They might only differ at runtime\n            var checkIndex = nodeIndex;\n            this.nodes[nodeIndex] = function () { return ({\n                sourceSpan: dirAst.sourceSpan,\n                nodeFlags: 16384 /* TypeDirective */ | flags,\n                nodeDef: importExpr(Identifiers$1.directiveDef).callFn([\n                    literal(checkIndex),\n                    literal(flags),\n                    queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,\n                    literal(childCount),\n                    providerExpr,\n                    depsExpr,\n                    inputDefs.length ? new LiteralMapExpr(inputDefs) : NULL_EXPR,\n                    outputDefs.length ? new LiteralMapExpr(outputDefs) : NULL_EXPR,\n                ]),\n                updateDirectives: updateDirectiveExpressions,\n                directive: dirAst.directive.type,\n            }); };\n            return { hostBindings: hostBindings, hostEvents: hostEvents };\n        };\n        ViewBuilder.prototype._visitProvider = function (providerAst, queryMatches) {\n            this._addProviderNode(this._visitProviderOrDirective(providerAst, queryMatches));\n        };\n        ViewBuilder.prototype._visitComponentFactoryResolverProvider = function (directives) {\n            var componentDirMeta = directives.find(function (dirAst) { return dirAst.directive.isComponent; });\n            if (componentDirMeta && componentDirMeta.directive.entryComponents.length) {\n                var _a = componentFactoryResolverProviderDef(this.reflector, this.outputCtx, 8192 /* PrivateProvider */, componentDirMeta.directive.entryComponents), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;\n                this._addProviderNode({\n                    providerExpr: providerExpr,\n                    depsExpr: depsExpr,\n                    flags: flags,\n                    tokenExpr: tokenExpr,\n                    queryMatchExprs: [],\n                    sourceSpan: componentDirMeta.sourceSpan\n                });\n            }\n        };\n        ViewBuilder.prototype._addProviderNode = function (data) {\n            // providerDef(\n            //   flags: NodeFlags, matchedQueries: [string, QueryValueType][], token:any,\n            //   value: any, deps: ([DepFlags, any] | any)[]): NodeDef;\n            this.nodes.push(function () { return ({\n                sourceSpan: data.sourceSpan,\n                nodeFlags: data.flags,\n                nodeDef: importExpr(Identifiers$1.providerDef).callFn([\n                    literal(data.flags),\n                    data.queryMatchExprs.length ? literalArr(data.queryMatchExprs) : NULL_EXPR,\n                    data.tokenExpr, data.providerExpr, data.depsExpr\n                ])\n            }); });\n        };\n        ViewBuilder.prototype._visitProviderOrDirective = function (providerAst, queryMatches) {\n            var flags = 0 /* None */;\n            var queryMatchExprs = [];\n            queryMatches.forEach(function (match) {\n                if (tokenReference(match.value) === tokenReference(providerAst.token)) {\n                    queryMatchExprs.push(literalArr([literal(match.queryId), literal(4 /* Provider */)]));\n                }\n            });\n            var _a = providerDef(this.outputCtx, providerAst), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, providerFlags = _a.flags, tokenExpr = _a.tokenExpr;\n            return {\n                flags: flags | providerFlags,\n                queryMatchExprs: queryMatchExprs,\n                providerExpr: providerExpr,\n                depsExpr: depsExpr,\n                tokenExpr: tokenExpr,\n                sourceSpan: providerAst.sourceSpan\n            };\n        };\n        ViewBuilder.prototype.getLocal = function (name) {\n            if (name == EventHandlerVars.event.name) {\n                return EventHandlerVars.event;\n            }\n            var currViewExpr = VIEW_VAR;\n            for (var currBuilder = this; currBuilder; currBuilder = currBuilder.parent,\n                currViewExpr = currViewExpr.prop('parent').cast(DYNAMIC_TYPE)) {\n                // check references\n                var refNodeIndex = currBuilder.refNodeIndices[name];\n                if (refNodeIndex != null) {\n                    return importExpr(Identifiers$1.nodeValue).callFn([currViewExpr, literal(refNodeIndex)]);\n                }\n                // check variables\n                var varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });\n                if (varAst) {\n                    var varValue = varAst.value || IMPLICIT_TEMPLATE_VAR;\n                    return currViewExpr.prop('context').prop(varValue);\n                }\n            }\n            return null;\n        };\n        ViewBuilder.prototype.notifyImplicitReceiverUse = function () {\n            // Not needed in ViewEngine as ViewEngine walks through the generated\n            // expressions to figure out if the implicit receiver is used and needs\n            // to be generated as part of the pre-update statements.\n        };\n        ViewBuilder.prototype.maybeRestoreView = function () {\n            // Not necessary in ViewEngine, because view restoration is an Ivy concept.\n        };\n        ViewBuilder.prototype._createLiteralArrayConverter = function (sourceSpan, argCount) {\n            if (argCount === 0) {\n                var valueExpr_1 = importExpr(Identifiers$1.EMPTY_ARRAY);\n                return function () { return valueExpr_1; };\n            }\n            var checkIndex = this.nodes.length;\n            this.nodes.push(function () { return ({\n                sourceSpan: sourceSpan,\n                nodeFlags: 32 /* TypePureArray */,\n                nodeDef: importExpr(Identifiers$1.pureArrayDef).callFn([\n                    literal(checkIndex),\n                    literal(argCount),\n                ])\n            }); });\n            return function (args) { return callCheckStmt(checkIndex, args); };\n        };\n        ViewBuilder.prototype._createLiteralMapConverter = function (sourceSpan, keys) {\n            if (keys.length === 0) {\n                var valueExpr_2 = importExpr(Identifiers$1.EMPTY_MAP);\n                return function () { return valueExpr_2; };\n            }\n            var map = literalMap(keys.map(function (e, i) { return (Object.assign(Object.assign({}, e), { value: literal(i) })); }));\n            var checkIndex = this.nodes.length;\n            this.nodes.push(function () { return ({\n                sourceSpan: sourceSpan,\n                nodeFlags: 64 /* TypePureObject */,\n                nodeDef: importExpr(Identifiers$1.pureObjectDef).callFn([\n                    literal(checkIndex),\n                    map,\n                ])\n            }); });\n            return function (args) { return callCheckStmt(checkIndex, args); };\n        };\n        ViewBuilder.prototype._createPipeConverter = function (expression, name, argCount) {\n            var pipe = this.usedPipes.find(function (pipeSummary) { return pipeSummary.name === name; });\n            if (pipe.pure) {\n                var checkIndex_1 = this.nodes.length;\n                this.nodes.push(function () { return ({\n                    sourceSpan: expression.sourceSpan,\n                    nodeFlags: 128 /* TypePurePipe */,\n                    nodeDef: importExpr(Identifiers$1.purePipeDef).callFn([\n                        literal(checkIndex_1),\n                        literal(argCount),\n                    ])\n                }); });\n                // find underlying pipe in the component view\n                var compViewExpr = VIEW_VAR;\n                var compBuilder = this;\n                while (compBuilder.parent) {\n                    compBuilder = compBuilder.parent;\n                    compViewExpr = compViewExpr.prop('parent').cast(DYNAMIC_TYPE);\n                }\n                var pipeNodeIndex = compBuilder.purePipeNodeIndices[name];\n                var pipeValueExpr_1 = importExpr(Identifiers$1.nodeValue).callFn([compViewExpr, literal(pipeNodeIndex)]);\n                return function (args) { return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, callCheckStmt(checkIndex_1, [pipeValueExpr_1].concat(args))); };\n            }\n            else {\n                var nodeIndex = this._createPipe(expression.sourceSpan, pipe);\n                var nodeValueExpr_1 = importExpr(Identifiers$1.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);\n                return function (args) { return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, nodeValueExpr_1.callMethod('transform', args)); };\n            }\n        };\n        ViewBuilder.prototype._createPipe = function (sourceSpan, pipe) {\n            var _this = this;\n            var nodeIndex = this.nodes.length;\n            var flags = 0 /* None */;\n            pipe.type.lifecycleHooks.forEach(function (lifecycleHook) {\n                // for pipes, we only support ngOnDestroy\n                if (lifecycleHook === LifecycleHooks.OnDestroy) {\n                    flags |= lifecycleHookToNodeFlag(lifecycleHook);\n                }\n            });\n            var depExprs = pipe.type.diDeps.map(function (diDep) { return depDef(_this.outputCtx, diDep); });\n            // function pipeDef(\n            //   flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef\n            this.nodes.push(function () { return ({\n                sourceSpan: sourceSpan,\n                nodeFlags: 16 /* TypePipe */,\n                nodeDef: importExpr(Identifiers$1.pipeDef).callFn([\n                    literal(flags), _this.outputCtx.importExpr(pipe.type.reference), literalArr(depExprs)\n                ])\n            }); });\n            return nodeIndex;\n        };\n        /**\n         * For the AST in `UpdateExpression.value`:\n         * - create nodes for pipes, literal arrays and, literal maps,\n         * - update the AST to replace pipes, literal arrays and, literal maps with calls to check fn.\n         *\n         * WARNING: This might create new nodeDefs (for pipes and literal arrays and literal maps)!\n         */\n        ViewBuilder.prototype._preprocessUpdateExpression = function (expression) {\n            var _this = this;\n            return {\n                nodeIndex: expression.nodeIndex,\n                bindingIndex: expression.bindingIndex,\n                sourceSpan: expression.sourceSpan,\n                context: expression.context,\n                value: convertPropertyBindingBuiltins({\n                    createLiteralArrayConverter: function (argCount) { return _this._createLiteralArrayConverter(expression.sourceSpan, argCount); },\n                    createLiteralMapConverter: function (keys) { return _this._createLiteralMapConverter(expression.sourceSpan, keys); },\n                    createPipeConverter: function (name, argCount) { return _this._createPipeConverter(expression, name, argCount); }\n                }, expression.value)\n            };\n        };\n        ViewBuilder.prototype._createNodeExpressions = function () {\n            var self = this;\n            var updateBindingCount = 0;\n            var updateRendererStmts = [];\n            var updateDirectivesStmts = [];\n            var nodeDefExprs = this.nodes.map(function (factory, nodeIndex) {\n                var _a = factory(), nodeDef = _a.nodeDef, nodeFlags = _a.nodeFlags, updateDirectives = _a.updateDirectives, updateRenderer = _a.updateRenderer, sourceSpan = _a.sourceSpan;\n                if (updateRenderer) {\n                    updateRendererStmts.push.apply(updateRendererStmts, __spreadArray([], __read(createUpdateStatements(nodeIndex, sourceSpan, updateRenderer, false))));\n                }\n                if (updateDirectives) {\n                    updateDirectivesStmts.push.apply(updateDirectivesStmts, __spreadArray([], __read(createUpdateStatements(nodeIndex, sourceSpan, updateDirectives, (nodeFlags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0))));\n                }\n                // We use a comma expression to call the log function before\n                // the nodeDef function, but still use the result of the nodeDef function\n                // as the value.\n                // Note: We only add the logger to elements / text nodes,\n                // so we don't generate too much code.\n                var logWithNodeDef = nodeFlags & 3 /* CatRenderNode */ ?\n                    new CommaExpr([LOG_VAR$1.callFn([]).callFn([]), nodeDef]) :\n                    nodeDef;\n                return applySourceSpanToExpressionIfNeeded(logWithNodeDef, sourceSpan);\n            });\n            return { updateRendererStmts: updateRendererStmts, updateDirectivesStmts: updateDirectivesStmts, nodeDefExprs: nodeDefExprs };\n            function createUpdateStatements(nodeIndex, sourceSpan, expressions, allowEmptyExprs) {\n                var updateStmts = [];\n                var exprs = expressions.map(function (_a) {\n                    var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;\n                    var bindingId = \"\" + updateBindingCount++;\n                    var nameResolver = context === COMP_VAR ? self : null;\n                    var _b = convertPropertyBinding(nameResolver, context, value, bindingId, BindingForm.General), stmts = _b.stmts, currValExpr = _b.currValExpr;\n                    updateStmts.push.apply(updateStmts, __spreadArray([], __read(stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }))));\n                    return applySourceSpanToExpressionIfNeeded(currValExpr, sourceSpan);\n                });\n                if (expressions.length || allowEmptyExprs) {\n                    updateStmts.push(applySourceSpanToStatementIfNeeded(callCheckStmt(nodeIndex, exprs).toStmt(), sourceSpan));\n                }\n                return updateStmts;\n            }\n        };\n        ViewBuilder.prototype._createElementHandleEventFn = function (nodeIndex, handlers) {\n            var _this = this;\n            var handleEventStmts = [];\n            var handleEventBindingCount = 0;\n            handlers.forEach(function (_a) {\n                var context = _a.context, eventAst = _a.eventAst, dirAst = _a.dirAst;\n                var bindingId = \"\" + handleEventBindingCount++;\n                var nameResolver = context === COMP_VAR ? _this : null;\n                var _b = convertActionBinding(nameResolver, context, eventAst.handler, bindingId), stmts = _b.stmts, allowDefault = _b.allowDefault;\n                var trueStmts = stmts;\n                if (allowDefault) {\n                    trueStmts.push(ALLOW_DEFAULT_VAR.set(allowDefault.and(ALLOW_DEFAULT_VAR)).toStmt());\n                }\n                var _c = elementEventNameAndTarget(eventAst, dirAst), eventTarget = _c.target, eventName = _c.name;\n                var fullEventName = elementEventFullName(eventTarget, eventName);\n                handleEventStmts.push(applySourceSpanToStatementIfNeeded(new IfStmt(literal(fullEventName).identical(EVENT_NAME_VAR), trueStmts), eventAst.sourceSpan));\n            });\n            var handleEventFn;\n            if (handleEventStmts.length > 0) {\n                var preStmts = [ALLOW_DEFAULT_VAR.set(literal(true)).toDeclStmt(BOOL_TYPE)];\n                if (!this.component.isHost && findReadVarNames(handleEventStmts).has(COMP_VAR.name)) {\n                    preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));\n                }\n                handleEventFn = fn([\n                    new FnParam(VIEW_VAR.name, INFERRED_TYPE),\n                    new FnParam(EVENT_NAME_VAR.name, INFERRED_TYPE),\n                    new FnParam(EventHandlerVars.event.name, INFERRED_TYPE)\n                ], __spreadArray(__spreadArray(__spreadArray([], __read(preStmts)), __read(handleEventStmts)), [new ReturnStatement(ALLOW_DEFAULT_VAR)]), INFERRED_TYPE);\n            }\n            else {\n                handleEventFn = NULL_EXPR;\n            }\n            return handleEventFn;\n        };\n        ViewBuilder.prototype.visitDirective = function (ast, context) { };\n        ViewBuilder.prototype.visitDirectiveProperty = function (ast, context) { };\n        ViewBuilder.prototype.visitReference = function (ast, context) { };\n        ViewBuilder.prototype.visitVariable = function (ast, context) { };\n        ViewBuilder.prototype.visitEvent = function (ast, context) { };\n        ViewBuilder.prototype.visitElementProperty = function (ast, context) { };\n        ViewBuilder.prototype.visitAttr = function (ast, context) { };\n        return ViewBuilder;\n    }());\n    function needsAdditionalRootNode(astNodes) {\n        var lastAstNode = astNodes[astNodes.length - 1];\n        if (lastAstNode instanceof EmbeddedTemplateAst) {\n            return lastAstNode.hasViewContainer;\n        }\n        if (lastAstNode instanceof ElementAst) {\n            if (isNgContainer(lastAstNode.name) && lastAstNode.children.length) {\n                return needsAdditionalRootNode(lastAstNode.children);\n            }\n            return lastAstNode.hasViewContainer;\n        }\n        return lastAstNode instanceof NgContentAst;\n    }\n    function elementBindingDef(inputAst, dirAst) {\n        var inputType = inputAst.type;\n        switch (inputType) {\n            case 1 /* Attribute */:\n                return literalArr([\n                    literal(1 /* TypeElementAttribute */), literal(inputAst.name),\n                    literal(inputAst.securityContext)\n                ]);\n            case 0 /* Property */:\n                return literalArr([\n                    literal(8 /* TypeProperty */), literal(inputAst.name),\n                    literal(inputAst.securityContext)\n                ]);\n            case 4 /* Animation */:\n                var bindingType = 8 /* TypeProperty */ |\n                    (dirAst && dirAst.directive.isComponent ? 32 /* SyntheticHostProperty */ :\n                        16 /* SyntheticProperty */);\n                return literalArr([\n                    literal(bindingType), literal('@' + inputAst.name), literal(inputAst.securityContext)\n                ]);\n            case 2 /* Class */:\n                return literalArr([literal(2 /* TypeElementClass */), literal(inputAst.name), NULL_EXPR]);\n            case 3 /* Style */:\n                return literalArr([\n                    literal(4 /* TypeElementStyle */), literal(inputAst.name), literal(inputAst.unit)\n                ]);\n            default:\n                // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n                // However Closure Compiler does not understand that and reports an error in typed mode.\n                // The `throw new Error` below works around the problem, and the unexpected: never variable\n                // makes sure tsc still checks this code is unreachable.\n                var unexpected = inputType;\n                throw new Error(\"unexpected \" + unexpected);\n        }\n    }\n    function fixedAttrsDef(elementAst) {\n        var mapResult = Object.create(null);\n        elementAst.attrs.forEach(function (attrAst) {\n            mapResult[attrAst.name] = attrAst.value;\n        });\n        elementAst.directives.forEach(function (dirAst) {\n            Object.keys(dirAst.directive.hostAttributes).forEach(function (name) {\n                var value = dirAst.directive.hostAttributes[name];\n                var prevValue = mapResult[name];\n                mapResult[name] = prevValue != null ? mergeAttributeValue(name, prevValue, value) : value;\n            });\n        });\n        // Note: We need to sort to get a defined output order\n        // for tests and for caching generated artifacts...\n        return literalArr(Object.keys(mapResult).sort().map(function (attrName) { return literalArr([literal(attrName), literal(mapResult[attrName])]); }));\n    }\n    function mergeAttributeValue(attrName, attrValue1, attrValue2) {\n        if (attrName == CLASS_ATTR$1 || attrName == STYLE_ATTR) {\n            return attrValue1 + \" \" + attrValue2;\n        }\n        else {\n            return attrValue2;\n        }\n    }\n    function callCheckStmt(nodeIndex, exprs) {\n        if (exprs.length > 10) {\n            return CHECK_VAR.callFn([VIEW_VAR, literal(nodeIndex), literal(1 /* Dynamic */), literalArr(exprs)]);\n        }\n        else {\n            return CHECK_VAR.callFn(__spreadArray([VIEW_VAR, literal(nodeIndex), literal(0 /* Inline */)], __read(exprs)));\n        }\n    }\n    function callUnwrapValue(nodeIndex, bindingIdx, expr) {\n        return importExpr(Identifiers$1.unwrapValue).callFn([\n            VIEW_VAR, literal(nodeIndex), literal(bindingIdx), expr\n        ]);\n    }\n    function elementEventNameAndTarget(eventAst, dirAst) {\n        if (eventAst.isAnimation) {\n            return {\n                name: \"@\" + eventAst.name + \".\" + eventAst.phase,\n                target: dirAst && dirAst.directive.isComponent ? 'component' : null\n            };\n        }\n        else {\n            return eventAst;\n        }\n    }\n    function calcQueryFlags(query) {\n        var flags = 0 /* None */;\n        // Note: We only make queries static that query for a single item and the user specifically\n        // set the to be static. This is because of backwards compatibility with the old view compiler...\n        if (query.first && query.static) {\n            flags |= 268435456 /* StaticQuery */;\n        }\n        else {\n            flags |= 536870912 /* DynamicQuery */;\n        }\n        if (query.emitDistinctChangesOnly) {\n            flags |= -2147483648 /* EmitDistinctChangesOnly */;\n        }\n        return flags;\n    }\n    function elementEventFullName(target, name) {\n        return target ? target + \":\" + name : name;\n    }\n\n    /**\n     * A container for message extracted from the templates.\n     */\n    var MessageBundle = /** @class */ (function () {\n        function MessageBundle(_htmlParser, _implicitTags, _implicitAttrs, _locale) {\n            if (_locale === void 0) { _locale = null; }\n            this._htmlParser = _htmlParser;\n            this._implicitTags = _implicitTags;\n            this._implicitAttrs = _implicitAttrs;\n            this._locale = _locale;\n            this._messages = [];\n        }\n        MessageBundle.prototype.updateFromTemplate = function (html, url, interpolationConfig) {\n            var _a;\n            var htmlParserResult = this._htmlParser.parse(html, url, { tokenizeExpansionForms: true, interpolationConfig: interpolationConfig });\n            if (htmlParserResult.errors.length) {\n                return htmlParserResult.errors;\n            }\n            var i18nParserResult = extractMessages(htmlParserResult.rootNodes, interpolationConfig, this._implicitTags, this._implicitAttrs);\n            if (i18nParserResult.errors.length) {\n                return i18nParserResult.errors;\n            }\n            (_a = this._messages).push.apply(_a, __spreadArray([], __read(i18nParserResult.messages)));\n            return [];\n        };\n        // Return the message in the internal format\n        // The public (serialized) format might be different, see the `write` method.\n        MessageBundle.prototype.getMessages = function () {\n            return this._messages;\n        };\n        MessageBundle.prototype.write = function (serializer, filterSources) {\n            var messages = {};\n            var mapperVisitor = new MapPlaceholderNames();\n            // Deduplicate messages based on their ID\n            this._messages.forEach(function (message) {\n                var _a;\n                var id = serializer.digest(message);\n                if (!messages.hasOwnProperty(id)) {\n                    messages[id] = message;\n                }\n                else {\n                    (_a = messages[id].sources).push.apply(_a, __spreadArray([], __read(message.sources)));\n                }\n            });\n            // Transform placeholder names using the serializer mapping\n            var msgList = Object.keys(messages).map(function (id) {\n                var mapper = serializer.createNameMapper(messages[id]);\n                var src = messages[id];\n                var nodes = mapper ? mapperVisitor.convert(src.nodes, mapper) : src.nodes;\n                var transformedMessage = new Message(nodes, {}, {}, src.meaning, src.description, id);\n                transformedMessage.sources = src.sources;\n                if (filterSources) {\n                    transformedMessage.sources.forEach(function (source) { return source.filePath = filterSources(source.filePath); });\n                }\n                return transformedMessage;\n            });\n            return serializer.write(msgList, this._locale);\n        };\n        return MessageBundle;\n    }());\n    // Transform an i18n AST by renaming the placeholder nodes with the given mapper\n    var MapPlaceholderNames = /** @class */ (function (_super) {\n        __extends(MapPlaceholderNames, _super);\n        function MapPlaceholderNames() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        MapPlaceholderNames.prototype.convert = function (nodes, mapper) {\n            var _this = this;\n            return mapper ? nodes.map(function (n) { return n.visit(_this, mapper); }) : nodes;\n        };\n        MapPlaceholderNames.prototype.visitTagPlaceholder = function (ph, mapper) {\n            var _this = this;\n            var startName = mapper.toPublicName(ph.startName);\n            var closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName;\n            var children = ph.children.map(function (n) { return n.visit(_this, mapper); });\n            return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);\n        };\n        MapPlaceholderNames.prototype.visitPlaceholder = function (ph, mapper) {\n            return new Placeholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);\n        };\n        MapPlaceholderNames.prototype.visitIcuPlaceholder = function (ph, mapper) {\n            return new IcuPlaceholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);\n        };\n        return MapPlaceholderNames;\n    }(CloneVisitor));\n\n    /**\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://angular.io/license\n     */\n    var GeneratedFile = /** @class */ (function () {\n        function GeneratedFile(srcFileUrl, genFileUrl, sourceOrStmts) {\n            this.srcFileUrl = srcFileUrl;\n            this.genFileUrl = genFileUrl;\n            if (typeof sourceOrStmts === 'string') {\n                this.source = sourceOrStmts;\n                this.stmts = null;\n            }\n            else {\n                this.source = null;\n                this.stmts = sourceOrStmts;\n            }\n        }\n        GeneratedFile.prototype.isEquivalent = function (other) {\n            if (this.genFileUrl !== other.genFileUrl) {\n                return false;\n            }\n            if (this.source) {\n                return this.source === other.source;\n            }\n            if (other.stmts == null) {\n                return false;\n            }\n            // Note: the constructor guarantees that if this.source is not filled,\n            // then this.stmts is.\n            return areAllEquivalent(this.stmts, other.stmts);\n        };\n        return GeneratedFile;\n    }());\n    function toTypeScript(file, preamble) {\n        if (preamble === void 0) { preamble = ''; }\n        if (!file.stmts) {\n            throw new Error(\"Illegal state: No stmts present on GeneratedFile \" + file.genFileUrl);\n        }\n        return new TypeScriptEmitter().emitStatements(file.genFileUrl, file.stmts, preamble);\n    }\n\n    function listLazyRoutes(moduleMeta, reflector) {\n        var e_1, _a, e_2, _b;\n        var allLazyRoutes = [];\n        try {\n            for (var _c = __values(moduleMeta.transitiveModule.providers), _d = _c.next(); !_d.done; _d = _c.next()) {\n                var _e = _d.value, provider = _e.provider, module = _e.module;\n                if (tokenReference(provider.token) === reflector.ROUTES) {\n                    var loadChildren = _collectLoadChildren(provider.useValue);\n                    try {\n                        for (var loadChildren_1 = (e_2 = void 0, __values(loadChildren)), loadChildren_1_1 = loadChildren_1.next(); !loadChildren_1_1.done; loadChildren_1_1 = loadChildren_1.next()) {\n                            var route = loadChildren_1_1.value;\n                            allLazyRoutes.push(parseLazyRoute(route, reflector, module.reference));\n                        }\n                    }\n                    catch (e_2_1) { e_2 = { error: e_2_1 }; }\n                    finally {\n                        try {\n                            if (loadChildren_1_1 && !loadChildren_1_1.done && (_b = loadChildren_1.return)) _b.call(loadChildren_1);\n                        }\n                        finally { if (e_2) throw e_2.error; }\n                    }\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return allLazyRoutes;\n    }\n    function _collectLoadChildren(routes, target) {\n        var e_3, _a;\n        if (target === void 0) { target = []; }\n        if (typeof routes === 'string') {\n            target.push(routes);\n        }\n        else if (Array.isArray(routes)) {\n            try {\n                for (var routes_1 = __values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {\n                    var route = routes_1_1.value;\n                    _collectLoadChildren(route, target);\n                }\n            }\n            catch (e_3_1) { e_3 = { error: e_3_1 }; }\n            finally {\n                try {\n                    if (routes_1_1 && !routes_1_1.done && (_a = routes_1.return)) _a.call(routes_1);\n                }\n                finally { if (e_3) throw e_3.error; }\n            }\n        }\n        else if (routes.loadChildren) {\n            _collectLoadChildren(routes.loadChildren, target);\n        }\n        else if (routes.children) {\n            _collectLoadChildren(routes.children, target);\n        }\n        return target;\n    }\n    function parseLazyRoute(route, reflector, module) {\n        var _a = __read(route.split('#'), 2), routePath = _a[0], routeName = _a[1];\n        var referencedModule = reflector.resolveExternalReference({\n            moduleName: routePath,\n            name: routeName,\n        }, module ? module.filePath : undefined);\n        return { route: route, module: module || referencedModule, referencedModule: referencedModule };\n    }\n\n    var TS = /^(?!.*\\.d\\.ts$).*\\.ts$/;\n    var ResolvedStaticSymbol = /** @class */ (function () {\n        function ResolvedStaticSymbol(symbol, metadata) {\n            this.symbol = symbol;\n            this.metadata = metadata;\n        }\n        return ResolvedStaticSymbol;\n    }());\n    var SUPPORTED_SCHEMA_VERSION = 4;\n    /**\n     * This class is responsible for loading metadata per symbol,\n     * and normalizing references between symbols.\n     *\n     * Internally, it only uses symbols without members,\n     * and deduces the values for symbols with members based\n     * on these symbols.\n     */\n    var StaticSymbolResolver = /** @class */ (function () {\n        function StaticSymbolResolver(host, staticSymbolCache, summaryResolver, errorRecorder) {\n            this.host = host;\n            this.staticSymbolCache = staticSymbolCache;\n            this.summaryResolver = summaryResolver;\n            this.errorRecorder = errorRecorder;\n            this.metadataCache = new Map();\n            // Note: this will only contain StaticSymbols without members!\n            this.resolvedSymbols = new Map();\n            // Note: this will only contain StaticSymbols without members!\n            this.importAs = new Map();\n            this.symbolResourcePaths = new Map();\n            this.symbolFromFile = new Map();\n            this.knownFileNameToModuleNames = new Map();\n        }\n        StaticSymbolResolver.prototype.resolveSymbol = function (staticSymbol) {\n            if (staticSymbol.members.length > 0) {\n                return this._resolveSymbolMembers(staticSymbol);\n            }\n            // Note: always ask for a summary first,\n            // as we might have read shallow metadata via a .d.ts file\n            // for the symbol.\n            var resultFromSummary = this._resolveSymbolFromSummary(staticSymbol);\n            if (resultFromSummary) {\n                return resultFromSummary;\n            }\n            var resultFromCache = this.resolvedSymbols.get(staticSymbol);\n            if (resultFromCache) {\n                return resultFromCache;\n            }\n            // Note: Some users use libraries that were not compiled with ngc, i.e. they don't\n            // have summaries, only .d.ts files. So we always need to check both, the summary\n            // and metadata.\n            this._createSymbolsOf(staticSymbol.filePath);\n            return this.resolvedSymbols.get(staticSymbol);\n        };\n        /**\n         * getImportAs produces a symbol that can be used to import the given symbol.\n         * The import might be different than the symbol if the symbol is exported from\n         * a library with a summary; in which case we want to import the symbol from the\n         * ngfactory re-export instead of directly to avoid introducing a direct dependency\n         * on an otherwise indirect dependency.\n         *\n         * @param staticSymbol the symbol for which to generate a import symbol\n         */\n        StaticSymbolResolver.prototype.getImportAs = function (staticSymbol, useSummaries) {\n            if (useSummaries === void 0) { useSummaries = true; }\n            if (staticSymbol.members.length) {\n                var baseSymbol = this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name);\n                var baseImportAs = this.getImportAs(baseSymbol, useSummaries);\n                return baseImportAs ?\n                    this.getStaticSymbol(baseImportAs.filePath, baseImportAs.name, staticSymbol.members) :\n                    null;\n            }\n            var summarizedFileName = stripSummaryForJitFileSuffix(staticSymbol.filePath);\n            if (summarizedFileName !== staticSymbol.filePath) {\n                var summarizedName = stripSummaryForJitNameSuffix(staticSymbol.name);\n                var baseSymbol = this.getStaticSymbol(summarizedFileName, summarizedName, staticSymbol.members);\n                var baseImportAs = this.getImportAs(baseSymbol, useSummaries);\n                return baseImportAs ? this.getStaticSymbol(summaryForJitFileName(baseImportAs.filePath), summaryForJitName(baseImportAs.name), baseSymbol.members) :\n                    null;\n            }\n            var result = (useSummaries && this.summaryResolver.getImportAs(staticSymbol)) || null;\n            if (!result) {\n                result = this.importAs.get(staticSymbol);\n            }\n            return result;\n        };\n        /**\n         * getResourcePath produces the path to the original location of the symbol and should\n         * be used to determine the relative location of resource references recorded in\n         * symbol metadata.\n         */\n        StaticSymbolResolver.prototype.getResourcePath = function (staticSymbol) {\n            return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;\n        };\n        /**\n         * getTypeArity returns the number of generic type parameters the given symbol\n         * has. If the symbol is not a type the result is null.\n         */\n        StaticSymbolResolver.prototype.getTypeArity = function (staticSymbol) {\n            // If the file is a factory/ngsummary file, don't resolve the symbol as doing so would\n            // cause the metadata for an factory/ngsummary file to be loaded which doesn't exist.\n            // All references to generated classes must include the correct arity whenever\n            // generating code.\n            if (isGeneratedFile(staticSymbol.filePath)) {\n                return null;\n            }\n            var resolvedSymbol = unwrapResolvedMetadata(this.resolveSymbol(staticSymbol));\n            while (resolvedSymbol && resolvedSymbol.metadata instanceof StaticSymbol) {\n                resolvedSymbol = unwrapResolvedMetadata(this.resolveSymbol(resolvedSymbol.metadata));\n            }\n            return (resolvedSymbol && resolvedSymbol.metadata && resolvedSymbol.metadata.arity) || null;\n        };\n        StaticSymbolResolver.prototype.getKnownModuleName = function (filePath) {\n            return this.knownFileNameToModuleNames.get(filePath) || null;\n        };\n        StaticSymbolResolver.prototype.recordImportAs = function (sourceSymbol, targetSymbol) {\n            sourceSymbol.assertNoMembers();\n            targetSymbol.assertNoMembers();\n            this.importAs.set(sourceSymbol, targetSymbol);\n        };\n        StaticSymbolResolver.prototype.recordModuleNameForFileName = function (fileName, moduleName) {\n            this.knownFileNameToModuleNames.set(fileName, moduleName);\n        };\n        /**\n         * Invalidate all information derived from the given file and return the\n         * static symbols contained in the file.\n         *\n         * @param fileName the file to invalidate\n         */\n        StaticSymbolResolver.prototype.invalidateFile = function (fileName) {\n            var e_1, _a;\n            this.metadataCache.delete(fileName);\n            var symbols = this.symbolFromFile.get(fileName);\n            if (!symbols) {\n                return [];\n            }\n            this.symbolFromFile.delete(fileName);\n            try {\n                for (var symbols_1 = __values(symbols), symbols_1_1 = symbols_1.next(); !symbols_1_1.done; symbols_1_1 = symbols_1.next()) {\n                    var symbol = symbols_1_1.value;\n                    this.resolvedSymbols.delete(symbol);\n                    this.importAs.delete(symbol);\n                    this.symbolResourcePaths.delete(symbol);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (symbols_1_1 && !symbols_1_1.done && (_a = symbols_1.return)) _a.call(symbols_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return symbols;\n        };\n        /** @internal */\n        StaticSymbolResolver.prototype.ignoreErrorsFor = function (cb) {\n            var recorder = this.errorRecorder;\n            this.errorRecorder = function () { };\n            try {\n                return cb();\n            }\n            finally {\n                this.errorRecorder = recorder;\n            }\n        };\n        StaticSymbolResolver.prototype._resolveSymbolMembers = function (staticSymbol) {\n            var members = staticSymbol.members;\n            var baseResolvedSymbol = this.resolveSymbol(this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name));\n            if (!baseResolvedSymbol) {\n                return null;\n            }\n            var baseMetadata = unwrapResolvedMetadata(baseResolvedSymbol.metadata);\n            if (baseMetadata instanceof StaticSymbol) {\n                return new ResolvedStaticSymbol(staticSymbol, this.getStaticSymbol(baseMetadata.filePath, baseMetadata.name, members));\n            }\n            else if (baseMetadata && baseMetadata.__symbolic === 'class') {\n                if (baseMetadata.statics && members.length === 1) {\n                    return new ResolvedStaticSymbol(staticSymbol, baseMetadata.statics[members[0]]);\n                }\n            }\n            else {\n                var value = baseMetadata;\n                for (var i = 0; i < members.length && value; i++) {\n                    value = value[members[i]];\n                }\n                return new ResolvedStaticSymbol(staticSymbol, value);\n            }\n            return null;\n        };\n        StaticSymbolResolver.prototype._resolveSymbolFromSummary = function (staticSymbol) {\n            var summary = this.summaryResolver.resolveSummary(staticSymbol);\n            return summary ? new ResolvedStaticSymbol(staticSymbol, summary.metadata) : null;\n        };\n        /**\n         * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.\n         * All types passed to the StaticResolver should be pseudo-types returned by this method.\n         *\n         * @param declarationFile the absolute path of the file where the symbol is declared\n         * @param name the name of the type.\n         * @param members a symbol for a static member of the named type\n         */\n        StaticSymbolResolver.prototype.getStaticSymbol = function (declarationFile, name, members) {\n            return this.staticSymbolCache.get(declarationFile, name, members);\n        };\n        /**\n         * hasDecorators checks a file's metadata for the presence of decorators without evaluating the\n         * metadata.\n         *\n         * @param filePath the absolute path to examine for decorators.\n         * @returns true if any class in the file has a decorator.\n         */\n        StaticSymbolResolver.prototype.hasDecorators = function (filePath) {\n            var metadata = this.getModuleMetadata(filePath);\n            if (metadata['metadata']) {\n                return Object.keys(metadata['metadata']).some(function (metadataKey) {\n                    var entry = metadata['metadata'][metadataKey];\n                    return entry && entry.__symbolic === 'class' && entry.decorators;\n                });\n            }\n            return false;\n        };\n        StaticSymbolResolver.prototype.getSymbolsOf = function (filePath) {\n            var summarySymbols = this.summaryResolver.getSymbolsOf(filePath);\n            if (summarySymbols) {\n                return summarySymbols;\n            }\n            // Note: Some users use libraries that were not compiled with ngc, i.e. they don't\n            // have summaries, only .d.ts files, but `summaryResolver.isLibraryFile` returns true.\n            this._createSymbolsOf(filePath);\n            return this.symbolFromFile.get(filePath) || [];\n        };\n        StaticSymbolResolver.prototype._createSymbolsOf = function (filePath) {\n            var e_2, _a, e_3, _b;\n            var _this = this;\n            if (this.symbolFromFile.has(filePath)) {\n                return;\n            }\n            var resolvedSymbols = [];\n            var metadata = this.getModuleMetadata(filePath);\n            if (metadata['importAs']) {\n                // Index bundle indices should use the importAs module name defined\n                // in the bundle.\n                this.knownFileNameToModuleNames.set(filePath, metadata['importAs']);\n            }\n            // handle the symbols in one of the re-export location\n            if (metadata['exports']) {\n                var _loop_1 = function (moduleExport) {\n                    // handle the symbols in the list of explicitly re-exported symbols.\n                    if (moduleExport.export) {\n                        moduleExport.export.forEach(function (exportSymbol) {\n                            var symbolName;\n                            if (typeof exportSymbol === 'string') {\n                                symbolName = exportSymbol;\n                            }\n                            else {\n                                symbolName = exportSymbol.as;\n                            }\n                            symbolName = unescapeIdentifier(symbolName);\n                            var symName = symbolName;\n                            if (typeof exportSymbol !== 'string') {\n                                symName = unescapeIdentifier(exportSymbol.name);\n                            }\n                            var resolvedModule = _this.resolveModule(moduleExport.from, filePath);\n                            if (resolvedModule) {\n                                var targetSymbol = _this.getStaticSymbol(resolvedModule, symName);\n                                var sourceSymbol = _this.getStaticSymbol(filePath, symbolName);\n                                resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));\n                            }\n                        });\n                    }\n                    else {\n                        // Handle the symbols loaded by 'export *' directives.\n                        var resolvedModule = this_1.resolveModule(moduleExport.from, filePath);\n                        if (resolvedModule && resolvedModule !== filePath) {\n                            var nestedExports = this_1.getSymbolsOf(resolvedModule);\n                            nestedExports.forEach(function (targetSymbol) {\n                                var sourceSymbol = _this.getStaticSymbol(filePath, targetSymbol.name);\n                                resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));\n                            });\n                        }\n                    }\n                };\n                var this_1 = this;\n                try {\n                    for (var _c = __values(metadata['exports']), _d = _c.next(); !_d.done; _d = _c.next()) {\n                        var moduleExport = _d.value;\n                        _loop_1(moduleExport);\n                    }\n                }\n                catch (e_2_1) { e_2 = { error: e_2_1 }; }\n                finally {\n                    try {\n                        if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n                    }\n                    finally { if (e_2) throw e_2.error; }\n                }\n            }\n            // handle the actual metadata. Has to be after the exports\n            // as there might be collisions in the names, and we want the symbols\n            // of the current module to win ofter reexports.\n            if (metadata['metadata']) {\n                // handle direct declarations of the symbol\n                var topLevelSymbolNames_1 = new Set(Object.keys(metadata['metadata']).map(unescapeIdentifier));\n                var origins_1 = metadata['origins'] || {};\n                Object.keys(metadata['metadata']).forEach(function (metadataKey) {\n                    var symbolMeta = metadata['metadata'][metadataKey];\n                    var name = unescapeIdentifier(metadataKey);\n                    var symbol = _this.getStaticSymbol(filePath, name);\n                    var origin = origins_1.hasOwnProperty(metadataKey) && origins_1[metadataKey];\n                    if (origin) {\n                        // If the symbol is from a bundled index, use the declaration location of the\n                        // symbol so relative references (such as './my.html') will be calculated\n                        // correctly.\n                        var originFilePath = _this.resolveModule(origin, filePath);\n                        if (!originFilePath) {\n                            _this.reportError(new Error(\"Couldn't resolve original symbol for \" + origin + \" from \" + _this.host.getOutputName(filePath)));\n                        }\n                        else {\n                            _this.symbolResourcePaths.set(symbol, originFilePath);\n                        }\n                    }\n                    resolvedSymbols.push(_this.createResolvedSymbol(symbol, filePath, topLevelSymbolNames_1, symbolMeta));\n                });\n            }\n            var uniqueSymbols = new Set();\n            try {\n                for (var resolvedSymbols_1 = __values(resolvedSymbols), resolvedSymbols_1_1 = resolvedSymbols_1.next(); !resolvedSymbols_1_1.done; resolvedSymbols_1_1 = resolvedSymbols_1.next()) {\n                    var resolvedSymbol = resolvedSymbols_1_1.value;\n                    this.resolvedSymbols.set(resolvedSymbol.symbol, resolvedSymbol);\n                    uniqueSymbols.add(resolvedSymbol.symbol);\n                }\n            }\n            catch (e_3_1) { e_3 = { error: e_3_1 }; }\n            finally {\n                try {\n                    if (resolvedSymbols_1_1 && !resolvedSymbols_1_1.done && (_b = resolvedSymbols_1.return)) _b.call(resolvedSymbols_1);\n                }\n                finally { if (e_3) throw e_3.error; }\n            }\n            this.symbolFromFile.set(filePath, Array.from(uniqueSymbols));\n        };\n        StaticSymbolResolver.prototype.createResolvedSymbol = function (sourceSymbol, topLevelPath, topLevelSymbolNames, metadata) {\n            var _this = this;\n            // For classes that don't have Angular summaries / metadata,\n            // we only keep their arity, but nothing else\n            // (e.g. their constructor parameters).\n            // We do this to prevent introducing deep imports\n            // as we didn't generate .ngfactory.ts files with proper reexports.\n            var isTsFile = TS.test(sourceSymbol.filePath);\n            if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) && !isTsFile && metadata &&\n                metadata['__symbolic'] === 'class') {\n                var transformedMeta_1 = { __symbolic: 'class', arity: metadata.arity };\n                return new ResolvedStaticSymbol(sourceSymbol, transformedMeta_1);\n            }\n            var _originalFileMemo;\n            var getOriginalName = function () {\n                if (!_originalFileMemo) {\n                    // Guess what the original file name is from the reference. If it has a `.d.ts` extension\n                    // replace it with `.ts`. If it already has `.ts` just leave it in place. If it doesn't have\n                    // .ts or .d.ts, append `.ts'. Also, if it is in `node_modules`, trim the `node_module`\n                    // location as it is not important to finding the file.\n                    _originalFileMemo =\n                        _this.host.getOutputName(topLevelPath.replace(/((\\.ts)|(\\.d\\.ts)|)$/, '.ts')\n                            .replace(/^.*node_modules[/\\\\]/, ''));\n                }\n                return _originalFileMemo;\n            };\n            var self = this;\n            var ReferenceTransformer = /** @class */ (function (_super) {\n                __extends(ReferenceTransformer, _super);\n                function ReferenceTransformer() {\n                    return _super !== null && _super.apply(this, arguments) || this;\n                }\n                ReferenceTransformer.prototype.visitStringMap = function (map, functionParams) {\n                    var symbolic = map['__symbolic'];\n                    if (symbolic === 'function') {\n                        var oldLen = functionParams.length;\n                        functionParams.push.apply(functionParams, __spreadArray([], __read((map['parameters'] || []))));\n                        var result = _super.prototype.visitStringMap.call(this, map, functionParams);\n                        functionParams.length = oldLen;\n                        return result;\n                    }\n                    else if (symbolic === 'reference') {\n                        var module = map['module'];\n                        var name = map['name'] ? unescapeIdentifier(map['name']) : map['name'];\n                        if (!name) {\n                            return null;\n                        }\n                        var filePath = void 0;\n                        if (module) {\n                            filePath = self.resolveModule(module, sourceSymbol.filePath);\n                            if (!filePath) {\n                                return {\n                                    __symbolic: 'error',\n                                    message: \"Could not resolve \" + module + \" relative to \" + self.host.getMetadataFor(sourceSymbol.filePath) + \".\",\n                                    line: map['line'],\n                                    character: map['character'],\n                                    fileName: getOriginalName()\n                                };\n                            }\n                            return {\n                                __symbolic: 'resolved',\n                                symbol: self.getStaticSymbol(filePath, name),\n                                line: map['line'],\n                                character: map['character'],\n                                fileName: getOriginalName()\n                            };\n                        }\n                        else if (functionParams.indexOf(name) >= 0) {\n                            // reference to a function parameter\n                            return { __symbolic: 'reference', name: name };\n                        }\n                        else {\n                            if (topLevelSymbolNames.has(name)) {\n                                return self.getStaticSymbol(topLevelPath, name);\n                            }\n                            // ambient value\n                            null;\n                        }\n                    }\n                    else if (symbolic === 'error') {\n                        return Object.assign(Object.assign({}, map), { fileName: getOriginalName() });\n                    }\n                    else {\n                        return _super.prototype.visitStringMap.call(this, map, functionParams);\n                    }\n                };\n                return ReferenceTransformer;\n            }(ValueTransformer));\n            var transformedMeta = visitValue(metadata, new ReferenceTransformer(), []);\n            var unwrappedTransformedMeta = unwrapResolvedMetadata(transformedMeta);\n            if (unwrappedTransformedMeta instanceof StaticSymbol) {\n                return this.createExport(sourceSymbol, unwrappedTransformedMeta);\n            }\n            return new ResolvedStaticSymbol(sourceSymbol, transformedMeta);\n        };\n        StaticSymbolResolver.prototype.createExport = function (sourceSymbol, targetSymbol) {\n            sourceSymbol.assertNoMembers();\n            targetSymbol.assertNoMembers();\n            if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) &&\n                this.summaryResolver.isLibraryFile(targetSymbol.filePath)) {\n                // This case is for an ng library importing symbols from a plain ts library\n                // transitively.\n                // Note: We rely on the fact that we discover symbols in the direction\n                // from source files to library files\n                this.importAs.set(targetSymbol, this.getImportAs(sourceSymbol) || sourceSymbol);\n            }\n            return new ResolvedStaticSymbol(sourceSymbol, targetSymbol);\n        };\n        StaticSymbolResolver.prototype.reportError = function (error, context, path) {\n            if (this.errorRecorder) {\n                this.errorRecorder(error, (context && context.filePath) || path);\n            }\n            else {\n                throw error;\n            }\n        };\n        /**\n         * @param module an absolute path to a module file.\n         */\n        StaticSymbolResolver.prototype.getModuleMetadata = function (module) {\n            var moduleMetadata = this.metadataCache.get(module);\n            if (!moduleMetadata) {\n                var moduleMetadatas = this.host.getMetadataFor(module);\n                if (moduleMetadatas) {\n                    var maxVersion_1 = -1;\n                    moduleMetadatas.forEach(function (md) {\n                        if (md && md['version'] > maxVersion_1) {\n                            maxVersion_1 = md['version'];\n                            moduleMetadata = md;\n                        }\n                    });\n                }\n                if (!moduleMetadata) {\n                    moduleMetadata =\n                        { __symbolic: 'module', version: SUPPORTED_SCHEMA_VERSION, module: module, metadata: {} };\n                }\n                if (moduleMetadata['version'] != SUPPORTED_SCHEMA_VERSION) {\n                    var errorMessage = moduleMetadata['version'] == 2 ?\n                        \"Unsupported metadata version \" + moduleMetadata['version'] + \" for module \" + module + \". This module should be compiled with a newer version of ngc\" :\n                        \"Metadata version mismatch for module \" + this.host.getOutputName(module) + \", found version \" + moduleMetadata['version'] + \", expected \" + SUPPORTED_SCHEMA_VERSION;\n                    this.reportError(new Error(errorMessage));\n                }\n                this.metadataCache.set(module, moduleMetadata);\n            }\n            return moduleMetadata;\n        };\n        StaticSymbolResolver.prototype.getSymbolByModule = function (module, symbolName, containingFile) {\n            var filePath = this.resolveModule(module, containingFile);\n            if (!filePath) {\n                this.reportError(new Error(\"Could not resolve module \" + module + (containingFile ? ' relative to ' + this.host.getOutputName(containingFile) : '')));\n                return this.getStaticSymbol(\"ERROR:\" + module, symbolName);\n            }\n            return this.getStaticSymbol(filePath, symbolName);\n        };\n        StaticSymbolResolver.prototype.resolveModule = function (module, containingFile) {\n            try {\n                return this.host.moduleNameToFileName(module, containingFile);\n            }\n            catch (e) {\n                console.error(\"Could not resolve module '\" + module + \"' relative to file \" + containingFile);\n                this.reportError(e, undefined, containingFile);\n            }\n            return null;\n        };\n        return StaticSymbolResolver;\n    }());\n    // Remove extra underscore from escaped identifier.\n    // See https://github.com/Microsoft/TypeScript/blob/master/src/compiler/utilities.ts\n    function unescapeIdentifier(identifier) {\n        return identifier.startsWith('___') ? identifier.substr(1) : identifier;\n    }\n    function unwrapResolvedMetadata(metadata) {\n        if (metadata && metadata.__symbolic === 'resolved') {\n            return metadata.symbol;\n        }\n        return metadata;\n    }\n\n    function serializeSummaries(srcFileName, forJitCtx, summaryResolver, symbolResolver, symbols, types, createExternalSymbolReexports) {\n        if (createExternalSymbolReexports === void 0) { createExternalSymbolReexports = false; }\n        var toJsonSerializer = new ToJsonSerializer(symbolResolver, summaryResolver, srcFileName);\n        // for symbols, we use everything except for the class metadata itself\n        // (we keep the statics though), as the class metadata is contained in the\n        // CompileTypeSummary.\n        symbols.forEach(function (resolvedSymbol) { return toJsonSerializer.addSummary({ symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata }); });\n        // Add type summaries.\n        types.forEach(function (_a) {\n            var summary = _a.summary, metadata = _a.metadata;\n            toJsonSerializer.addSummary({ symbol: summary.type.reference, metadata: undefined, type: summary });\n        });\n        var _a = toJsonSerializer.serialize(createExternalSymbolReexports), json = _a.json, exportAs = _a.exportAs;\n        if (forJitCtx) {\n            var forJitSerializer_1 = new ForJitSerializer(forJitCtx, symbolResolver, summaryResolver);\n            types.forEach(function (_a) {\n                var summary = _a.summary, metadata = _a.metadata;\n                forJitSerializer_1.addSourceType(summary, metadata);\n            });\n            toJsonSerializer.unprocessedSymbolSummariesBySymbol.forEach(function (summary) {\n                if (summaryResolver.isLibraryFile(summary.symbol.filePath) && summary.type) {\n                    forJitSerializer_1.addLibType(summary.type);\n                }\n            });\n            forJitSerializer_1.serialize(exportAs);\n        }\n        return { json: json, exportAs: exportAs };\n    }\n    function deserializeSummaries(symbolCache, summaryResolver, libraryFileName, json) {\n        var deserializer = new FromJsonDeserializer(symbolCache, summaryResolver);\n        return deserializer.deserialize(libraryFileName, json);\n    }\n    function createForJitStub(outputCtx, reference) {\n        return createSummaryForJitFunction(outputCtx, reference, NULL_EXPR);\n    }\n    function createSummaryForJitFunction(outputCtx, reference, value) {\n        var fnName = summaryForJitName(reference.name);\n        outputCtx.statements.push(fn([], [new ReturnStatement(value)], new ArrayType(DYNAMIC_TYPE)).toDeclStmt(fnName, [\n            exports.StmtModifier.Final, exports.StmtModifier.Exported\n        ]));\n    }\n    var ToJsonSerializer = /** @class */ (function (_super) {\n        __extends(ToJsonSerializer, _super);\n        function ToJsonSerializer(symbolResolver, summaryResolver, srcFileName) {\n            var _this = _super.call(this) || this;\n            _this.symbolResolver = symbolResolver;\n            _this.summaryResolver = summaryResolver;\n            _this.srcFileName = srcFileName;\n            // Note: This only contains symbols without members.\n            _this.symbols = [];\n            _this.indexBySymbol = new Map();\n            _this.reexportedBy = new Map();\n            // This now contains a `__symbol: number` in the place of\n            // StaticSymbols, but otherwise has the same shape as the original objects.\n            _this.processedSummaryBySymbol = new Map();\n            _this.processedSummaries = [];\n            _this.unprocessedSymbolSummariesBySymbol = new Map();\n            _this.moduleName = symbolResolver.getKnownModuleName(srcFileName);\n            return _this;\n        }\n        ToJsonSerializer.prototype.addSummary = function (summary) {\n            var _this = this;\n            var unprocessedSummary = this.unprocessedSymbolSummariesBySymbol.get(summary.symbol);\n            var processedSummary = this.processedSummaryBySymbol.get(summary.symbol);\n            if (!unprocessedSummary) {\n                unprocessedSummary = { symbol: summary.symbol, metadata: undefined };\n                this.unprocessedSymbolSummariesBySymbol.set(summary.symbol, unprocessedSummary);\n                processedSummary = { symbol: this.processValue(summary.symbol, 0 /* None */) };\n                this.processedSummaries.push(processedSummary);\n                this.processedSummaryBySymbol.set(summary.symbol, processedSummary);\n            }\n            if (!unprocessedSummary.metadata && summary.metadata) {\n                var metadata_1 = summary.metadata || {};\n                if (metadata_1.__symbolic === 'class') {\n                    // For classes, we keep everything except their class decorators.\n                    // We need to keep e.g. the ctor args, method names, method decorators\n                    // so that the class can be extended in another compilation unit.\n                    // We don't keep the class decorators as\n                    // 1) they refer to data\n                    //   that should not cause a rebuild of downstream compilation units\n                    //   (e.g. inline templates of @Component, or @NgModule.declarations)\n                    // 2) their data is already captured in TypeSummaries, e.g. DirectiveSummary.\n                    var clone_1 = {};\n                    Object.keys(metadata_1).forEach(function (propName) {\n                        if (propName !== 'decorators') {\n                            clone_1[propName] = metadata_1[propName];\n                        }\n                    });\n                    metadata_1 = clone_1;\n                }\n                else if (isCall(metadata_1)) {\n                    if (!isFunctionCall(metadata_1) && !isMethodCallOnVariable(metadata_1)) {\n                        // Don't store complex calls as we won't be able to simplify them anyways later on.\n                        metadata_1 = {\n                            __symbolic: 'error',\n                            message: 'Complex function calls are not supported.',\n                        };\n                    }\n                }\n                // Note: We need to keep storing ctor calls for e.g.\n                // `export const x = new InjectionToken(...)`\n                unprocessedSummary.metadata = metadata_1;\n                processedSummary.metadata = this.processValue(metadata_1, 1 /* ResolveValue */);\n                if (metadata_1 instanceof StaticSymbol &&\n                    this.summaryResolver.isLibraryFile(metadata_1.filePath)) {\n                    var declarationSymbol = this.symbols[this.indexBySymbol.get(metadata_1)];\n                    if (!isLoweredSymbol(declarationSymbol.name)) {\n                        // Note: symbols that were introduced during codegen in the user file can have a reexport\n                        // if a user used `export *`. However, we can't rely on this as tsickle will change\n                        // `export *` into named exports, using only the information from the typechecker.\n                        // As we introduce the new symbols after typecheck, Tsickle does not know about them,\n                        // and omits them when expanding `export *`.\n                        // So we have to keep reexporting these symbols manually via .ngfactory files.\n                        this.reexportedBy.set(declarationSymbol, summary.symbol);\n                    }\n                }\n            }\n            if (!unprocessedSummary.type && summary.type) {\n                unprocessedSummary.type = summary.type;\n                // Note: We don't add the summaries of all referenced symbols as for the ResolvedSymbols,\n                // as the type summaries already contain the transitive data that they require\n                // (in a minimal way).\n                processedSummary.type = this.processValue(summary.type, 0 /* None */);\n                // except for reexported directives / pipes, so we need to store\n                // their summaries explicitly.\n                if (summary.type.summaryKind === exports.CompileSummaryKind.NgModule) {\n                    var ngModuleSummary = summary.type;\n                    ngModuleSummary.exportedDirectives.concat(ngModuleSummary.exportedPipes).forEach(function (id) {\n                        var symbol = id.reference;\n                        if (_this.summaryResolver.isLibraryFile(symbol.filePath) &&\n                            !_this.unprocessedSymbolSummariesBySymbol.has(symbol)) {\n                            var summary_1 = _this.summaryResolver.resolveSummary(symbol);\n                            if (summary_1) {\n                                _this.addSummary(summary_1);\n                            }\n                        }\n                    });\n                }\n            }\n        };\n        /**\n         * @param createExternalSymbolReexports Whether external static symbols should be re-exported.\n         * This can be enabled if external symbols should be re-exported by the current module in\n         * order to avoid dynamically generated module dependencies which can break strict dependency\n         * enforcements (as in Google3). Read more here: https://github.com/angular/angular/issues/25644\n         */\n        ToJsonSerializer.prototype.serialize = function (createExternalSymbolReexports) {\n            var _this = this;\n            var exportAs = [];\n            var json = JSON.stringify({\n                moduleName: this.moduleName,\n                summaries: this.processedSummaries,\n                symbols: this.symbols.map(function (symbol, index) {\n                    symbol.assertNoMembers();\n                    var importAs = undefined;\n                    if (_this.summaryResolver.isLibraryFile(symbol.filePath)) {\n                        var reexportSymbol = _this.reexportedBy.get(symbol);\n                        if (reexportSymbol) {\n                            // In case the given external static symbol is already manually exported by the\n                            // user, we just proxy the external static symbol reference to the manual export.\n                            // This ensures that the AOT compiler imports the external symbol through the\n                            // user export and does not introduce another dependency which is not needed.\n                            importAs = _this.indexBySymbol.get(reexportSymbol);\n                        }\n                        else if (createExternalSymbolReexports) {\n                            // In this case, the given external static symbol is *not* manually exported by\n                            // the user, and we manually create a re-export in the factory file so that we\n                            // don't introduce another module dependency. This is useful when running within\n                            // Bazel so that the AOT compiler does not introduce any module dependencies\n                            // which can break the strict dependency enforcement. (e.g. as in Google3)\n                            // Read more about this here: https://github.com/angular/angular/issues/25644\n                            var summary = _this.unprocessedSymbolSummariesBySymbol.get(symbol);\n                            if (!summary || !summary.metadata || summary.metadata.__symbolic !== 'interface') {\n                                importAs = symbol.name + \"_\" + index;\n                                exportAs.push({ symbol: symbol, exportAs: importAs });\n                            }\n                        }\n                    }\n                    return {\n                        __symbol: index,\n                        name: symbol.name,\n                        filePath: _this.summaryResolver.toSummaryFileName(symbol.filePath, _this.srcFileName),\n                        importAs: importAs\n                    };\n                })\n            });\n            return { json: json, exportAs: exportAs };\n        };\n        ToJsonSerializer.prototype.processValue = function (value, flags) {\n            return visitValue(value, this, flags);\n        };\n        ToJsonSerializer.prototype.visitOther = function (value, context) {\n            if (value instanceof StaticSymbol) {\n                var baseSymbol = this.symbolResolver.getStaticSymbol(value.filePath, value.name);\n                var index = this.visitStaticSymbol(baseSymbol, context);\n                return { __symbol: index, members: value.members };\n            }\n        };\n        /**\n         * Strip line and character numbers from ngsummaries.\n         * Emitting them causes white spaces changes to retrigger upstream\n         * recompilations in bazel.\n         * TODO: find out a way to have line and character numbers in errors without\n         * excessive recompilation in bazel.\n         */\n        ToJsonSerializer.prototype.visitStringMap = function (map, context) {\n            if (map['__symbolic'] === 'resolved') {\n                return visitValue(map['symbol'], this, context);\n            }\n            if (map['__symbolic'] === 'error') {\n                delete map['line'];\n                delete map['character'];\n            }\n            return _super.prototype.visitStringMap.call(this, map, context);\n        };\n        /**\n         * Returns null if the options.resolveValue is true, and the summary for the symbol\n         * resolved to a type or could not be resolved.\n         */\n        ToJsonSerializer.prototype.visitStaticSymbol = function (baseSymbol, flags) {\n            var index = this.indexBySymbol.get(baseSymbol);\n            var summary = null;\n            if (flags & 1 /* ResolveValue */ &&\n                this.summaryResolver.isLibraryFile(baseSymbol.filePath)) {\n                if (this.unprocessedSymbolSummariesBySymbol.has(baseSymbol)) {\n                    // the summary for this symbol was already added\n                    // -> nothing to do.\n                    return index;\n                }\n                summary = this.loadSummary(baseSymbol);\n                if (summary && summary.metadata instanceof StaticSymbol) {\n                    // The summary is a reexport\n                    index = this.visitStaticSymbol(summary.metadata, flags);\n                    // reset the summary as it is just a reexport, so we don't want to store it.\n                    summary = null;\n                }\n            }\n            else if (index != null) {\n                // Note: == on purpose to compare with undefined!\n                // No summary and the symbol is already added -> nothing to do.\n                return index;\n            }\n            // Note: == on purpose to compare with undefined!\n            if (index == null) {\n                index = this.symbols.length;\n                this.symbols.push(baseSymbol);\n            }\n            this.indexBySymbol.set(baseSymbol, index);\n            if (summary) {\n                this.addSummary(summary);\n            }\n            return index;\n        };\n        ToJsonSerializer.prototype.loadSummary = function (symbol) {\n            var summary = this.summaryResolver.resolveSummary(symbol);\n            if (!summary) {\n                // some symbols might originate from a plain typescript library\n                // that just exported .d.ts and .metadata.json files, i.e. where no summary\n                // files were created.\n                var resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);\n                if (resolvedSymbol) {\n                    summary = { symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata };\n                }\n            }\n            return summary;\n        };\n        return ToJsonSerializer;\n    }(ValueTransformer));\n    var ForJitSerializer = /** @class */ (function () {\n        function ForJitSerializer(outputCtx, symbolResolver, summaryResolver) {\n            this.outputCtx = outputCtx;\n            this.symbolResolver = symbolResolver;\n            this.summaryResolver = summaryResolver;\n            this.data = [];\n        }\n        ForJitSerializer.prototype.addSourceType = function (summary, metadata) {\n            this.data.push({ summary: summary, metadata: metadata, isLibrary: false });\n        };\n        ForJitSerializer.prototype.addLibType = function (summary) {\n            this.data.push({ summary: summary, metadata: null, isLibrary: true });\n        };\n        ForJitSerializer.prototype.serialize = function (exportAsArr) {\n            var e_1, _a, e_2, _b, e_3, _c;\n            var _this = this;\n            var exportAsBySymbol = new Map();\n            try {\n                for (var exportAsArr_1 = __values(exportAsArr), exportAsArr_1_1 = exportAsArr_1.next(); !exportAsArr_1_1.done; exportAsArr_1_1 = exportAsArr_1.next()) {\n                    var _d = exportAsArr_1_1.value, symbol = _d.symbol, exportAs = _d.exportAs;\n                    exportAsBySymbol.set(symbol, exportAs);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (exportAsArr_1_1 && !exportAsArr_1_1.done && (_a = exportAsArr_1.return)) _a.call(exportAsArr_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            var ngModuleSymbols = new Set();\n            try {\n                for (var _e = __values(this.data), _f = _e.next(); !_f.done; _f = _e.next()) {\n                    var _g = _f.value, summary = _g.summary, metadata = _g.metadata, isLibrary = _g.isLibrary;\n                    if (summary.summaryKind === exports.CompileSummaryKind.NgModule) {\n                        // collect the symbols that refer to NgModule classes.\n                        // Note: we can't just rely on `summary.type.summaryKind` to determine this as\n                        // we don't add the summaries of all referenced symbols when we serialize type summaries.\n                        // See serializeSummaries for details.\n                        ngModuleSymbols.add(summary.type.reference);\n                        var modSummary = summary;\n                        try {\n                            for (var _h = (e_3 = void 0, __values(modSummary.modules)), _j = _h.next(); !_j.done; _j = _h.next()) {\n                                var mod = _j.value;\n                                ngModuleSymbols.add(mod.reference);\n                            }\n                        }\n                        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n                        finally {\n                            try {\n                                if (_j && !_j.done && (_c = _h.return)) _c.call(_h);\n                            }\n                            finally { if (e_3) throw e_3.error; }\n                        }\n                    }\n                    if (!isLibrary) {\n                        var fnName = summaryForJitName(summary.type.reference.name);\n                        createSummaryForJitFunction(this.outputCtx, summary.type.reference, this.serializeSummaryWithDeps(summary, metadata));\n                    }\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n            ngModuleSymbols.forEach(function (ngModuleSymbol) {\n                if (_this.summaryResolver.isLibraryFile(ngModuleSymbol.filePath)) {\n                    var exportAs = exportAsBySymbol.get(ngModuleSymbol) || ngModuleSymbol.name;\n                    var jitExportAsName = summaryForJitName(exportAs);\n                    _this.outputCtx.statements.push(variable(jitExportAsName)\n                        .set(_this.serializeSummaryRef(ngModuleSymbol))\n                        .toDeclStmt(null, [exports.StmtModifier.Exported]));\n                }\n            });\n        };\n        ForJitSerializer.prototype.serializeSummaryWithDeps = function (summary, metadata) {\n            var _this = this;\n            var expressions = [this.serializeSummary(summary)];\n            var providers = [];\n            if (metadata instanceof CompileNgModuleMetadata) {\n                expressions.push.apply(expressions, __spreadArray([], __read(\n                // For directives / pipes, we only add the declared ones,\n                // and rely on transitively importing NgModules to get the transitive\n                // summaries.\n                metadata.declaredDirectives.concat(metadata.declaredPipes)\n                    .map(function (type) { return type.reference; })\n                    // For modules,\n                    // we also add the summaries for modules\n                    // from libraries.\n                    // This is ok as we produce reexports for all transitive modules.\n                    .concat(metadata.transitiveModule.modules.map(function (type) { return type.reference; })\n                    .filter(function (ref) { return ref !== metadata.type.reference; }))\n                    .map(function (ref) { return _this.serializeSummaryRef(ref); }))));\n                // Note: We don't use `NgModuleSummary.providers`, as that one is transitive,\n                // and we already have transitive modules.\n                providers = metadata.providers;\n            }\n            else if (summary.summaryKind === exports.CompileSummaryKind.Directive) {\n                var dirSummary = summary;\n                providers = dirSummary.providers.concat(dirSummary.viewProviders);\n            }\n            // Note: We can't just refer to the `ngsummary.ts` files for `useClass` providers (as we do for\n            // declaredDirectives / declaredPipes), as we allow\n            // providers without ctor arguments to skip the `@Injectable` decorator,\n            // i.e. we didn't generate .ngsummary.ts files for these.\n            expressions.push.apply(expressions, __spreadArray([], __read(providers.filter(function (provider) { return !!provider.useClass; }).map(function (provider) { return _this.serializeSummary({\n                summaryKind: exports.CompileSummaryKind.Injectable,\n                type: provider.useClass\n            }); }))));\n            return literalArr(expressions);\n        };\n        ForJitSerializer.prototype.serializeSummaryRef = function (typeSymbol) {\n            var jitImportedSymbol = this.symbolResolver.getStaticSymbol(summaryForJitFileName(typeSymbol.filePath), summaryForJitName(typeSymbol.name));\n            return this.outputCtx.importExpr(jitImportedSymbol);\n        };\n        ForJitSerializer.prototype.serializeSummary = function (data) {\n            var outputCtx = this.outputCtx;\n            var Transformer = /** @class */ (function () {\n                function Transformer() {\n                }\n                Transformer.prototype.visitArray = function (arr, context) {\n                    var _this = this;\n                    return literalArr(arr.map(function (entry) { return visitValue(entry, _this, context); }));\n                };\n                Transformer.prototype.visitStringMap = function (map, context) {\n                    var _this = this;\n                    return new LiteralMapExpr(Object.keys(map).map(function (key) { return new LiteralMapEntry(key, visitValue(map[key], _this, context), false); }));\n                };\n                Transformer.prototype.visitPrimitive = function (value, context) {\n                    return literal(value);\n                };\n                Transformer.prototype.visitOther = function (value, context) {\n                    if (value instanceof StaticSymbol) {\n                        return outputCtx.importExpr(value);\n                    }\n                    else {\n                        throw new Error(\"Illegal State: Encountered value \" + value);\n                    }\n                };\n                return Transformer;\n            }());\n            return visitValue(data, new Transformer(), null);\n        };\n        return ForJitSerializer;\n    }());\n    var FromJsonDeserializer = /** @class */ (function (_super) {\n        __extends(FromJsonDeserializer, _super);\n        function FromJsonDeserializer(symbolCache, summaryResolver) {\n            var _this = _super.call(this) || this;\n            _this.symbolCache = symbolCache;\n            _this.summaryResolver = summaryResolver;\n            return _this;\n        }\n        FromJsonDeserializer.prototype.deserialize = function (libraryFileName, json) {\n            var _this = this;\n            var data = JSON.parse(json);\n            var allImportAs = [];\n            this.symbols = data.symbols.map(function (serializedSymbol) { return _this.symbolCache.get(_this.summaryResolver.fromSummaryFileName(serializedSymbol.filePath, libraryFileName), serializedSymbol.name); });\n            data.symbols.forEach(function (serializedSymbol, index) {\n                var symbol = _this.symbols[index];\n                var importAs = serializedSymbol.importAs;\n                if (typeof importAs === 'number') {\n                    allImportAs.push({ symbol: symbol, importAs: _this.symbols[importAs] });\n                }\n                else if (typeof importAs === 'string') {\n                    allImportAs.push({ symbol: symbol, importAs: _this.symbolCache.get(ngfactoryFilePath(libraryFileName), importAs) });\n                }\n            });\n            var summaries = visitValue(data.summaries, this, null);\n            return { moduleName: data.moduleName, summaries: summaries, importAs: allImportAs };\n        };\n        FromJsonDeserializer.prototype.visitStringMap = function (map, context) {\n            if ('__symbol' in map) {\n                var baseSymbol = this.symbols[map['__symbol']];\n                var members = map['members'];\n                return members.length ? this.symbolCache.get(baseSymbol.filePath, baseSymbol.name, members) :\n                    baseSymbol;\n            }\n            else {\n                return _super.prototype.visitStringMap.call(this, map, context);\n            }\n        };\n        return FromJsonDeserializer;\n    }(ValueTransformer));\n    function isCall(metadata) {\n        return metadata && metadata.__symbolic === 'call';\n    }\n    function isFunctionCall(metadata) {\n        return isCall(metadata) && unwrapResolvedMetadata(metadata.expression) instanceof StaticSymbol;\n    }\n    function isMethodCallOnVariable(metadata) {\n        return isCall(metadata) && metadata.expression && metadata.expression.__symbolic === 'select' &&\n            unwrapResolvedMetadata(metadata.expression.expression) instanceof StaticSymbol;\n    }\n\n    var AotCompiler = /** @class */ (function () {\n        function AotCompiler(_config, _options, _host, reflector, _metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _typeCheckCompiler, _ngModuleCompiler, _injectableCompiler, _outputEmitter, _summaryResolver, _symbolResolver) {\n            this._config = _config;\n            this._options = _options;\n            this._host = _host;\n            this.reflector = reflector;\n            this._metadataResolver = _metadataResolver;\n            this._templateParser = _templateParser;\n            this._styleCompiler = _styleCompiler;\n            this._viewCompiler = _viewCompiler;\n            this._typeCheckCompiler = _typeCheckCompiler;\n            this._ngModuleCompiler = _ngModuleCompiler;\n            this._injectableCompiler = _injectableCompiler;\n            this._outputEmitter = _outputEmitter;\n            this._summaryResolver = _summaryResolver;\n            this._symbolResolver = _symbolResolver;\n            this._templateAstCache = new Map();\n            this._analyzedFiles = new Map();\n            this._analyzedFilesForInjectables = new Map();\n        }\n        AotCompiler.prototype.clearCache = function () {\n            this._metadataResolver.clearCache();\n        };\n        AotCompiler.prototype.analyzeModulesSync = function (rootFiles) {\n            var _this = this;\n            var analyzeResult = analyzeAndValidateNgModules(rootFiles, this._host, this._symbolResolver, this._metadataResolver);\n            analyzeResult.ngModules.forEach(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true); });\n            return analyzeResult;\n        };\n        AotCompiler.prototype.analyzeModulesAsync = function (rootFiles) {\n            var _this = this;\n            var analyzeResult = analyzeAndValidateNgModules(rootFiles, this._host, this._symbolResolver, this._metadataResolver);\n            return Promise\n                .all(analyzeResult.ngModules.map(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))\n                .then(function () { return analyzeResult; });\n        };\n        AotCompiler.prototype._analyzeFile = function (fileName) {\n            var analyzedFile = this._analyzedFiles.get(fileName);\n            if (!analyzedFile) {\n                analyzedFile =\n                    analyzeFile(this._host, this._symbolResolver, this._metadataResolver, fileName);\n                this._analyzedFiles.set(fileName, analyzedFile);\n            }\n            return analyzedFile;\n        };\n        AotCompiler.prototype._analyzeFileForInjectables = function (fileName) {\n            var analyzedFile = this._analyzedFilesForInjectables.get(fileName);\n            if (!analyzedFile) {\n                analyzedFile = analyzeFileForInjectables(this._host, this._symbolResolver, this._metadataResolver, fileName);\n                this._analyzedFilesForInjectables.set(fileName, analyzedFile);\n            }\n            return analyzedFile;\n        };\n        AotCompiler.prototype.findGeneratedFileNames = function (fileName) {\n            var _this = this;\n            var genFileNames = [];\n            var file = this._analyzeFile(fileName);\n            // Make sure we create a .ngfactory if we have a injectable/directive/pipe/NgModule\n            // or a reference to a non source file.\n            // Note: This is overestimating the required .ngfactory files as the real calculation is harder.\n            // Only do this for StubEmitFlags.Basic, as adding a type check block\n            // does not change this file (as we generate type check blocks based on NgModules).\n            if (this._options.allowEmptyCodegenFiles || file.directives.length || file.pipes.length ||\n                file.injectables.length || file.ngModules.length || file.exportsNonSourceFiles) {\n                genFileNames.push(ngfactoryFilePath(file.fileName, true));\n                if (this._options.enableSummariesForJit) {\n                    genFileNames.push(summaryForJitFileName(file.fileName, true));\n                }\n            }\n            var fileSuffix = normalizeGenFileSuffix(splitTypescriptSuffix(file.fileName, true)[1]);\n            file.directives.forEach(function (dirSymbol) {\n                var compMeta = _this._metadataResolver.getNonNormalizedDirectiveMetadata(dirSymbol).metadata;\n                if (!compMeta.isComponent) {\n                    return;\n                }\n                // Note: compMeta is a component and therefore template is non null.\n                compMeta.template.styleUrls.forEach(function (styleUrl) {\n                    var normalizedUrl = _this._host.resourceNameToFileName(styleUrl, file.fileName);\n                    if (!normalizedUrl) {\n                        throw syntaxError(\"Couldn't resolve resource \" + styleUrl + \" relative to \" + file.fileName);\n                    }\n                    var needsShim = (compMeta.template.encapsulation ||\n                        _this._config.defaultEncapsulation) === ViewEncapsulation.Emulated;\n                    genFileNames.push(_stylesModuleUrl(normalizedUrl, needsShim, fileSuffix));\n                    if (_this._options.allowEmptyCodegenFiles) {\n                        genFileNames.push(_stylesModuleUrl(normalizedUrl, !needsShim, fileSuffix));\n                    }\n                });\n            });\n            return genFileNames;\n        };\n        AotCompiler.prototype.emitBasicStub = function (genFileName, originalFileName) {\n            var outputCtx = this._createOutputContext(genFileName);\n            if (genFileName.endsWith('.ngfactory.ts')) {\n                if (!originalFileName) {\n                    throw new Error(\"Assertion error: require the original file for .ngfactory.ts stubs. File: \" + genFileName);\n                }\n                var originalFile = this._analyzeFile(originalFileName);\n                this._createNgFactoryStub(outputCtx, originalFile, 1 /* Basic */);\n            }\n            else if (genFileName.endsWith('.ngsummary.ts')) {\n                if (this._options.enableSummariesForJit) {\n                    if (!originalFileName) {\n                        throw new Error(\"Assertion error: require the original file for .ngsummary.ts stubs. File: \" + genFileName);\n                    }\n                    var originalFile = this._analyzeFile(originalFileName);\n                    _createEmptyStub(outputCtx);\n                    originalFile.ngModules.forEach(function (ngModule) {\n                        // create exports that user code can reference\n                        createForJitStub(outputCtx, ngModule.type.reference);\n                    });\n                }\n            }\n            else if (genFileName.endsWith('.ngstyle.ts')) {\n                _createEmptyStub(outputCtx);\n            }\n            // Note: for the stubs, we don't need a property srcFileUrl,\n            // as later on in emitAllImpls we will create the proper GeneratedFiles with the\n            // correct srcFileUrl.\n            // This is good as e.g. for .ngstyle.ts files we can't derive\n            // the url of components based on the genFileUrl.\n            return this._codegenSourceModule('unknown', outputCtx);\n        };\n        AotCompiler.prototype.emitTypeCheckStub = function (genFileName, originalFileName) {\n            var originalFile = this._analyzeFile(originalFileName);\n            var outputCtx = this._createOutputContext(genFileName);\n            if (genFileName.endsWith('.ngfactory.ts')) {\n                this._createNgFactoryStub(outputCtx, originalFile, 2 /* TypeCheck */);\n            }\n            return outputCtx.statements.length > 0 ?\n                this._codegenSourceModule(originalFile.fileName, outputCtx) :\n                null;\n        };\n        AotCompiler.prototype.loadFilesAsync = function (fileNames, tsFiles) {\n            var _this = this;\n            var files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });\n            var loadingPromises = [];\n            files.forEach(function (file) { return file.ngModules.forEach(function (ngModule) { return loadingPromises.push(_this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false)); }); });\n            var analyzedInjectables = tsFiles.map(function (tsFile) { return _this._analyzeFileForInjectables(tsFile); });\n            return Promise.all(loadingPromises).then(function (_) { return ({\n                analyzedModules: mergeAndValidateNgFiles(files),\n                analyzedInjectables: analyzedInjectables,\n            }); });\n        };\n        AotCompiler.prototype.loadFilesSync = function (fileNames, tsFiles) {\n            var _this = this;\n            var files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });\n            files.forEach(function (file) { return file.ngModules.forEach(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true); }); });\n            var analyzedInjectables = tsFiles.map(function (tsFile) { return _this._analyzeFileForInjectables(tsFile); });\n            return {\n                analyzedModules: mergeAndValidateNgFiles(files),\n                analyzedInjectables: analyzedInjectables,\n            };\n        };\n        AotCompiler.prototype._createNgFactoryStub = function (outputCtx, file, emitFlags) {\n            var _this = this;\n            var componentId = 0;\n            file.ngModules.forEach(function (ngModuleMeta, ngModuleIndex) {\n                // Note: the code below needs to executed for StubEmitFlags.Basic and StubEmitFlags.TypeCheck,\n                // so we don't change the .ngfactory file too much when adding the type-check block.\n                // create exports that user code can reference\n                _this._ngModuleCompiler.createStub(outputCtx, ngModuleMeta.type.reference);\n                // add references to the symbols from the metadata.\n                // These can be used by the type check block for components,\n                // and they also cause TypeScript to include these files into the program too,\n                // which will make them part of the analyzedFiles.\n                var externalReferences = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(ngModuleMeta.transitiveModule.directives.map(function (d) { return d.reference; }))), __read(ngModuleMeta.transitiveModule.pipes.map(function (d) { return d.reference; }))), __read(ngModuleMeta.importedModules.map(function (m) { return m.type.reference; }))), __read(ngModuleMeta.exportedModules.map(function (m) { return m.type.reference; }))), __read(_this._externalIdentifierReferences([Identifiers$1.TemplateRef, Identifiers$1.ElementRef])));\n                var externalReferenceVars = new Map();\n                externalReferences.forEach(function (ref, typeIndex) {\n                    externalReferenceVars.set(ref, \"_decl\" + ngModuleIndex + \"_\" + typeIndex);\n                });\n                externalReferenceVars.forEach(function (varName, reference) {\n                    outputCtx.statements.push(variable(varName)\n                        .set(NULL_EXPR.cast(DYNAMIC_TYPE))\n                        .toDeclStmt(expressionType(outputCtx.importExpr(reference, /* typeParams */ null, /* useSummaries */ false))));\n                });\n                if (emitFlags & 2 /* TypeCheck */) {\n                    // add the type-check block for all components of the NgModule\n                    ngModuleMeta.declaredDirectives.forEach(function (dirId) {\n                        var compMeta = _this._metadataResolver.getDirectiveMetadata(dirId.reference);\n                        if (!compMeta.isComponent) {\n                            return;\n                        }\n                        componentId++;\n                        _this._createTypeCheckBlock(outputCtx, compMeta.type.reference.name + \"_Host_\" + componentId, ngModuleMeta, _this._metadataResolver.getHostComponentMetadata(compMeta), [compMeta.type], externalReferenceVars);\n                        _this._createTypeCheckBlock(outputCtx, compMeta.type.reference.name + \"_\" + componentId, ngModuleMeta, compMeta, ngModuleMeta.transitiveModule.directives, externalReferenceVars);\n                    });\n                }\n            });\n            if (outputCtx.statements.length === 0) {\n                _createEmptyStub(outputCtx);\n            }\n        };\n        AotCompiler.prototype._externalIdentifierReferences = function (references) {\n            var e_1, _a;\n            var result = [];\n            try {\n                for (var references_1 = __values(references), references_1_1 = references_1.next(); !references_1_1.done; references_1_1 = references_1.next()) {\n                    var reference = references_1_1.value;\n                    var token = createTokenForExternalReference(this.reflector, reference);\n                    if (token.identifier) {\n                        result.push(token.identifier.reference);\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (references_1_1 && !references_1_1.done && (_a = references_1.return)) _a.call(references_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        };\n        AotCompiler.prototype._createTypeCheckBlock = function (ctx, componentId, moduleMeta, compMeta, directives, externalReferenceVars) {\n            var _a;\n            var _b = this._parseTemplate(compMeta, moduleMeta, directives), parsedTemplate = _b.template, usedPipes = _b.pipes;\n            (_a = ctx.statements).push.apply(_a, __spreadArray([], __read(this._typeCheckCompiler.compileComponent(componentId, compMeta, parsedTemplate, usedPipes, externalReferenceVars, ctx))));\n        };\n        AotCompiler.prototype.emitMessageBundle = function (analyzeResult, locale) {\n            var _this = this;\n            var errors = [];\n            var htmlParser = new HtmlParser();\n            // TODO(vicb): implicit tags & attributes\n            var messageBundle = new MessageBundle(htmlParser, [], {}, locale);\n            analyzeResult.files.forEach(function (file) {\n                var compMetas = [];\n                file.directives.forEach(function (directiveType) {\n                    var dirMeta = _this._metadataResolver.getDirectiveMetadata(directiveType);\n                    if (dirMeta && dirMeta.isComponent) {\n                        compMetas.push(dirMeta);\n                    }\n                });\n                compMetas.forEach(function (compMeta) {\n                    var html = compMeta.template.template;\n                    // Template URL points to either an HTML or TS file depending on whether\n                    // the file is used with `templateUrl:` or `template:`, respectively.\n                    var templateUrl = compMeta.template.templateUrl;\n                    var interpolationConfig = InterpolationConfig.fromArray(compMeta.template.interpolation);\n                    errors.push.apply(errors, __spreadArray([], __read(messageBundle.updateFromTemplate(html, templateUrl, interpolationConfig))));\n                });\n            });\n            if (errors.length) {\n                throw new Error(errors.map(function (e) { return e.toString(); }).join('\\n'));\n            }\n            return messageBundle;\n        };\n        AotCompiler.prototype.emitAllPartialModules2 = function (files) {\n            var _this = this;\n            // Using reduce like this is a select many pattern (where map is a select pattern)\n            return files.reduce(function (r, file) {\n                r.push.apply(r, __spreadArray([], __read(_this._emitPartialModule2(file.fileName, file.injectables))));\n                return r;\n            }, []);\n        };\n        AotCompiler.prototype._emitPartialModule2 = function (fileName, injectables) {\n            var _this = this;\n            var context = this._createOutputContext(fileName);\n            injectables.forEach(function (injectable) { return _this._injectableCompiler.compile(injectable, context); });\n            if (context.statements && context.statements.length > 0) {\n                return [{ fileName: fileName, statements: __spreadArray(__spreadArray([], __read(context.constantPool.statements)), __read(context.statements)) }];\n            }\n            return [];\n        };\n        AotCompiler.prototype.emitAllImpls = function (analyzeResult) {\n            var _this = this;\n            var ngModuleByPipeOrDirective = analyzeResult.ngModuleByPipeOrDirective, files = analyzeResult.files;\n            var sourceModules = files.map(function (file) { return _this._compileImplFile(file.fileName, ngModuleByPipeOrDirective, file.directives, file.pipes, file.ngModules, file.injectables); });\n            return flatten(sourceModules);\n        };\n        AotCompiler.prototype._compileImplFile = function (srcFileUrl, ngModuleByPipeOrDirective, directives, pipes, ngModules, injectables) {\n            var _this = this;\n            var fileSuffix = normalizeGenFileSuffix(splitTypescriptSuffix(srcFileUrl, true)[1]);\n            var generatedFiles = [];\n            var outputCtx = this._createOutputContext(ngfactoryFilePath(srcFileUrl, true));\n            generatedFiles.push.apply(generatedFiles, __spreadArray([], __read(this._createSummary(srcFileUrl, directives, pipes, ngModules, injectables, outputCtx))));\n            // compile all ng modules\n            ngModules.forEach(function (ngModuleMeta) { return _this._compileModule(outputCtx, ngModuleMeta); });\n            // compile components\n            directives.forEach(function (dirType) {\n                var compMeta = _this._metadataResolver.getDirectiveMetadata(dirType);\n                if (!compMeta.isComponent) {\n                    return;\n                }\n                var ngModule = ngModuleByPipeOrDirective.get(dirType);\n                if (!ngModule) {\n                    throw new Error(\"Internal Error: cannot determine the module for component \" + identifierName(compMeta.type) + \"!\");\n                }\n                // compile styles\n                var componentStylesheet = _this._styleCompiler.compileComponent(outputCtx, compMeta);\n                // Note: compMeta is a component and therefore template is non null.\n                compMeta.template.externalStylesheets.forEach(function (stylesheetMeta) {\n                    // Note: fill non shim and shim style files as they might\n                    // be shared by component with and without ViewEncapsulation.\n                    var shim = _this._styleCompiler.needsStyleShim(compMeta);\n                    generatedFiles.push(_this._codegenStyles(srcFileUrl, compMeta, stylesheetMeta, shim, fileSuffix));\n                    if (_this._options.allowEmptyCodegenFiles) {\n                        generatedFiles.push(_this._codegenStyles(srcFileUrl, compMeta, stylesheetMeta, !shim, fileSuffix));\n                    }\n                });\n                // compile components\n                var compViewVars = _this._compileComponent(outputCtx, compMeta, ngModule, ngModule.transitiveModule.directives, componentStylesheet, fileSuffix);\n                _this._compileComponentFactory(outputCtx, compMeta, ngModule, fileSuffix);\n            });\n            if (outputCtx.statements.length > 0 || this._options.allowEmptyCodegenFiles) {\n                var srcModule = this._codegenSourceModule(srcFileUrl, outputCtx);\n                generatedFiles.unshift(srcModule);\n            }\n            return generatedFiles;\n        };\n        AotCompiler.prototype._createSummary = function (srcFileName, directives, pipes, ngModules, injectables, ngFactoryCtx) {\n            var _this = this;\n            var symbolSummaries = this._symbolResolver.getSymbolsOf(srcFileName)\n                .map(function (symbol) { return _this._symbolResolver.resolveSymbol(symbol); });\n            var typeData = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(ngModules.map(function (meta) { return ({\n                summary: _this._metadataResolver.getNgModuleSummary(meta.type.reference),\n                metadata: _this._metadataResolver.getNgModuleMetadata(meta.type.reference)\n            }); }))), __read(directives.map(function (ref) { return ({\n                summary: _this._metadataResolver.getDirectiveSummary(ref),\n                metadata: _this._metadataResolver.getDirectiveMetadata(ref)\n            }); }))), __read(pipes.map(function (ref) { return ({\n                summary: _this._metadataResolver.getPipeSummary(ref),\n                metadata: _this._metadataResolver.getPipeMetadata(ref)\n            }); }))), __read(injectables.map(function (ref) { return ({\n                summary: _this._metadataResolver.getInjectableSummary(ref.symbol),\n                metadata: _this._metadataResolver.getInjectableSummary(ref.symbol).type\n            }); })));\n            var forJitOutputCtx = this._options.enableSummariesForJit ?\n                this._createOutputContext(summaryForJitFileName(srcFileName, true)) :\n                null;\n            var _a = serializeSummaries(srcFileName, forJitOutputCtx, this._summaryResolver, this._symbolResolver, symbolSummaries, typeData, this._options.createExternalSymbolFactoryReexports), json = _a.json, exportAs = _a.exportAs;\n            exportAs.forEach(function (entry) {\n                ngFactoryCtx.statements.push(variable(entry.exportAs).set(ngFactoryCtx.importExpr(entry.symbol)).toDeclStmt(null, [\n                    exports.StmtModifier.Exported\n                ]));\n            });\n            var summaryJson = new GeneratedFile(srcFileName, summaryFileName(srcFileName), json);\n            var result = [summaryJson];\n            if (forJitOutputCtx) {\n                result.push(this._codegenSourceModule(srcFileName, forJitOutputCtx));\n            }\n            return result;\n        };\n        AotCompiler.prototype._compileModule = function (outputCtx, ngModule) {\n            var providers = [];\n            if (this._options.locale) {\n                var normalizedLocale = this._options.locale.replace(/_/g, '-');\n                providers.push({\n                    token: createTokenForExternalReference(this.reflector, Identifiers$1.LOCALE_ID),\n                    useValue: normalizedLocale,\n                });\n            }\n            if (this._options.i18nFormat) {\n                providers.push({\n                    token: createTokenForExternalReference(this.reflector, Identifiers$1.TRANSLATIONS_FORMAT),\n                    useValue: this._options.i18nFormat\n                });\n            }\n            this._ngModuleCompiler.compile(outputCtx, ngModule, providers);\n        };\n        AotCompiler.prototype._compileComponentFactory = function (outputCtx, compMeta, ngModule, fileSuffix) {\n            var hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta);\n            var hostViewFactoryVar = this._compileComponent(outputCtx, hostMeta, ngModule, [compMeta.type], null, fileSuffix)\n                .viewClassVar;\n            var compFactoryVar = componentFactoryName(compMeta.type.reference);\n            var inputsExprs = [];\n            for (var propName in compMeta.inputs) {\n                var templateName = compMeta.inputs[propName];\n                // Don't quote so that the key gets minified...\n                inputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));\n            }\n            var outputsExprs = [];\n            for (var propName in compMeta.outputs) {\n                var templateName = compMeta.outputs[propName];\n                // Don't quote so that the key gets minified...\n                outputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));\n            }\n            outputCtx.statements.push(variable(compFactoryVar)\n                .set(importExpr(Identifiers$1.createComponentFactory).callFn([\n                literal(compMeta.selector), outputCtx.importExpr(compMeta.type.reference),\n                variable(hostViewFactoryVar), new LiteralMapExpr(inputsExprs),\n                new LiteralMapExpr(outputsExprs),\n                literalArr(compMeta.template.ngContentSelectors.map(function (selector) { return literal(selector); }))\n            ]))\n                .toDeclStmt(importType(Identifiers$1.ComponentFactory, [expressionType(outputCtx.importExpr(compMeta.type.reference))], [TypeModifier.Const]), [exports.StmtModifier.Final, exports.StmtModifier.Exported]));\n        };\n        AotCompiler.prototype._compileComponent = function (outputCtx, compMeta, ngModule, directiveIdentifiers, componentStyles, fileSuffix) {\n            var _a = this._parseTemplate(compMeta, ngModule, directiveIdentifiers), parsedTemplate = _a.template, usedPipes = _a.pipes;\n            var stylesExpr = componentStyles ? variable(componentStyles.stylesVar) : literalArr([]);\n            var viewResult = this._viewCompiler.compileComponent(outputCtx, compMeta, parsedTemplate, stylesExpr, usedPipes);\n            if (componentStyles) {\n                _resolveStyleStatements(this._symbolResolver, componentStyles, this._styleCompiler.needsStyleShim(compMeta), fileSuffix);\n            }\n            return viewResult;\n        };\n        AotCompiler.prototype._parseTemplate = function (compMeta, ngModule, directiveIdentifiers) {\n            var _this = this;\n            if (this._templateAstCache.has(compMeta.type.reference)) {\n                return this._templateAstCache.get(compMeta.type.reference);\n            }\n            var preserveWhitespaces = compMeta.template.preserveWhitespaces;\n            var directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });\n            var pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });\n            var result = this._templateParser.parse(compMeta, compMeta.template.htmlAst, directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, compMeta.template), preserveWhitespaces);\n            this._templateAstCache.set(compMeta.type.reference, result);\n            return result;\n        };\n        AotCompiler.prototype._createOutputContext = function (genFilePath) {\n            var _this = this;\n            var importExpr$1 = function (symbol, typeParams, useSummaries) {\n                if (typeParams === void 0) { typeParams = null; }\n                if (useSummaries === void 0) { useSummaries = true; }\n                if (!(symbol instanceof StaticSymbol)) {\n                    throw new Error(\"Internal error: unknown identifier \" + JSON.stringify(symbol));\n                }\n                var arity = _this._symbolResolver.getTypeArity(symbol) || 0;\n                var _a = _this._symbolResolver.getImportAs(symbol, useSummaries) || symbol, filePath = _a.filePath, name = _a.name, members = _a.members;\n                var importModule = _this._fileNameToModuleName(filePath, genFilePath);\n                // It should be good enough to compare filePath to genFilePath and if they are equal\n                // there is a self reference. However, ngfactory files generate to .ts but their\n                // symbols have .d.ts so a simple compare is insufficient. They should be canonical\n                // and is tracked by #17705.\n                var selfReference = _this._fileNameToModuleName(genFilePath, genFilePath);\n                var moduleName = importModule === selfReference ? null : importModule;\n                // If we are in a type expression that refers to a generic type then supply\n                // the required type parameters. If there were not enough type parameters\n                // supplied, supply any as the type. Outside a type expression the reference\n                // should not supply type parameters and be treated as a simple value reference\n                // to the constructor function itself.\n                var suppliedTypeParams = typeParams || [];\n                var missingTypeParamsCount = arity - suppliedTypeParams.length;\n                var allTypeParams = suppliedTypeParams.concat(newArray(missingTypeParamsCount, DYNAMIC_TYPE));\n                return members.reduce(function (expr, memberName) { return expr.prop(memberName); }, importExpr(new ExternalReference(moduleName, name, null), allTypeParams));\n            };\n            return { statements: [], genFilePath: genFilePath, importExpr: importExpr$1, constantPool: new ConstantPool() };\n        };\n        AotCompiler.prototype._fileNameToModuleName = function (importedFilePath, containingFilePath) {\n            return this._summaryResolver.getKnownModuleName(importedFilePath) ||\n                this._symbolResolver.getKnownModuleName(importedFilePath) ||\n                this._host.fileNameToModuleName(importedFilePath, containingFilePath);\n        };\n        AotCompiler.prototype._codegenStyles = function (srcFileUrl, compMeta, stylesheetMetadata, isShimmed, fileSuffix) {\n            var outputCtx = this._createOutputContext(_stylesModuleUrl(stylesheetMetadata.moduleUrl, isShimmed, fileSuffix));\n            var compiledStylesheet = this._styleCompiler.compileStyles(outputCtx, compMeta, stylesheetMetadata, isShimmed);\n            _resolveStyleStatements(this._symbolResolver, compiledStylesheet, isShimmed, fileSuffix);\n            return this._codegenSourceModule(srcFileUrl, outputCtx);\n        };\n        AotCompiler.prototype._codegenSourceModule = function (srcFileUrl, ctx) {\n            return new GeneratedFile(srcFileUrl, ctx.genFilePath, ctx.statements);\n        };\n        AotCompiler.prototype.listLazyRoutes = function (entryRoute, analyzedModules) {\n            var e_2, _a, e_3, _b;\n            var self = this;\n            if (entryRoute) {\n                var symbol = parseLazyRoute(entryRoute, this.reflector).referencedModule;\n                return visitLazyRoute(symbol);\n            }\n            else if (analyzedModules) {\n                var allLazyRoutes = [];\n                try {\n                    for (var _c = __values(analyzedModules.ngModules), _d = _c.next(); !_d.done; _d = _c.next()) {\n                        var ngModule = _d.value;\n                        var lazyRoutes = listLazyRoutes(ngModule, this.reflector);\n                        try {\n                            for (var lazyRoutes_1 = (e_3 = void 0, __values(lazyRoutes)), lazyRoutes_1_1 = lazyRoutes_1.next(); !lazyRoutes_1_1.done; lazyRoutes_1_1 = lazyRoutes_1.next()) {\n                                var lazyRoute = lazyRoutes_1_1.value;\n                                allLazyRoutes.push(lazyRoute);\n                            }\n                        }\n                        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n                        finally {\n                            try {\n                                if (lazyRoutes_1_1 && !lazyRoutes_1_1.done && (_b = lazyRoutes_1.return)) _b.call(lazyRoutes_1);\n                            }\n                            finally { if (e_3) throw e_3.error; }\n                        }\n                    }\n                }\n                catch (e_2_1) { e_2 = { error: e_2_1 }; }\n                finally {\n                    try {\n                        if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n                    }\n                    finally { if (e_2) throw e_2.error; }\n                }\n                return allLazyRoutes;\n            }\n            else {\n                throw new Error(\"Either route or analyzedModules has to be specified!\");\n            }\n            function visitLazyRoute(symbol, seenRoutes, allLazyRoutes) {\n                var e_4, _a;\n                if (seenRoutes === void 0) { seenRoutes = new Set(); }\n                if (allLazyRoutes === void 0) { allLazyRoutes = []; }\n                // Support pointing to default exports, but stop recursing there,\n                // as the StaticReflector does not yet support default exports.\n                if (seenRoutes.has(symbol) || !symbol.name) {\n                    return allLazyRoutes;\n                }\n                seenRoutes.add(symbol);\n                var lazyRoutes = listLazyRoutes(self._metadataResolver.getNgModuleMetadata(symbol, true), self.reflector);\n                try {\n                    for (var lazyRoutes_2 = __values(lazyRoutes), lazyRoutes_2_1 = lazyRoutes_2.next(); !lazyRoutes_2_1.done; lazyRoutes_2_1 = lazyRoutes_2.next()) {\n                        var lazyRoute = lazyRoutes_2_1.value;\n                        allLazyRoutes.push(lazyRoute);\n                        visitLazyRoute(lazyRoute.referencedModule, seenRoutes, allLazyRoutes);\n                    }\n                }\n                catch (e_4_1) { e_4 = { error: e_4_1 }; }\n                finally {\n                    try {\n                        if (lazyRoutes_2_1 && !lazyRoutes_2_1.done && (_a = lazyRoutes_2.return)) _a.call(lazyRoutes_2);\n                    }\n                    finally { if (e_4) throw e_4.error; }\n                }\n                return allLazyRoutes;\n            }\n        };\n        return AotCompiler;\n    }());\n    function _createEmptyStub(outputCtx) {\n        // Note: We need to produce at least one import statement so that\n        // TypeScript knows that the file is an es6 module. Otherwise our generated\n        // exports / imports won't be emitted properly by TypeScript.\n        outputCtx.statements.push(importExpr(Identifiers$1.ComponentFactory).toStmt());\n    }\n    function _resolveStyleStatements(symbolResolver, compileResult, needsShim, fileSuffix) {\n        compileResult.dependencies.forEach(function (dep) {\n            dep.setValue(symbolResolver.getStaticSymbol(_stylesModuleUrl(dep.moduleUrl, needsShim, fileSuffix), dep.name));\n        });\n    }\n    function _stylesModuleUrl(stylesheetUrl, shim, suffix) {\n        return \"\" + stylesheetUrl + (shim ? '.shim' : '') + \".ngstyle\" + suffix;\n    }\n    function analyzeNgModules(fileNames, host, staticSymbolResolver, metadataResolver) {\n        var files = _analyzeFilesIncludingNonProgramFiles(fileNames, host, staticSymbolResolver, metadataResolver);\n        return mergeAnalyzedFiles(files);\n    }\n    function analyzeAndValidateNgModules(fileNames, host, staticSymbolResolver, metadataResolver) {\n        return validateAnalyzedModules(analyzeNgModules(fileNames, host, staticSymbolResolver, metadataResolver));\n    }\n    function validateAnalyzedModules(analyzedModules) {\n        if (analyzedModules.symbolsMissingModule && analyzedModules.symbolsMissingModule.length) {\n            var messages = analyzedModules.symbolsMissingModule.map(function (s) { return \"Cannot determine the module for class \" + s.name + \" in \" + s.filePath + \"! Add \" + s.name + \" to the NgModule to fix it.\"; });\n            throw syntaxError(messages.join('\\n'));\n        }\n        return analyzedModules;\n    }\n    // Analyzes all of the program files,\n    // including files that are not part of the program\n    // but are referenced by an NgModule.\n    function _analyzeFilesIncludingNonProgramFiles(fileNames, host, staticSymbolResolver, metadataResolver) {\n        var seenFiles = new Set();\n        var files = [];\n        var visitFile = function (fileName) {\n            if (seenFiles.has(fileName) || !host.isSourceFile(fileName)) {\n                return false;\n            }\n            seenFiles.add(fileName);\n            var analyzedFile = analyzeFile(host, staticSymbolResolver, metadataResolver, fileName);\n            files.push(analyzedFile);\n            analyzedFile.ngModules.forEach(function (ngModule) {\n                ngModule.transitiveModule.modules.forEach(function (modMeta) { return visitFile(modMeta.reference.filePath); });\n            });\n        };\n        fileNames.forEach(function (fileName) { return visitFile(fileName); });\n        return files;\n    }\n    function analyzeFile(host, staticSymbolResolver, metadataResolver, fileName) {\n        var abstractDirectives = [];\n        var directives = [];\n        var pipes = [];\n        var injectables = [];\n        var ngModules = [];\n        var hasDecorators = staticSymbolResolver.hasDecorators(fileName);\n        var exportsNonSourceFiles = false;\n        var isDeclarationFile = fileName.endsWith('.d.ts');\n        // Don't analyze .d.ts files that have no decorators as a shortcut\n        // to speed up the analysis. This prevents us from\n        // resolving the references in these files.\n        // Note: exportsNonSourceFiles is only needed when compiling with summaries,\n        // which is not the case when .d.ts files are treated as input files.\n        if (!isDeclarationFile || hasDecorators) {\n            staticSymbolResolver.getSymbolsOf(fileName).forEach(function (symbol) {\n                var resolvedSymbol = staticSymbolResolver.resolveSymbol(symbol);\n                var symbolMeta = resolvedSymbol.metadata;\n                if (!symbolMeta || symbolMeta.__symbolic === 'error') {\n                    return;\n                }\n                var isNgSymbol = false;\n                if (symbolMeta.__symbolic === 'class') {\n                    if (metadataResolver.isDirective(symbol)) {\n                        isNgSymbol = true;\n                        // This directive either has a selector or doesn't. Selector-less directives get tracked\n                        // in abstractDirectives, not directives. The compiler doesn't deal with selector-less\n                        // directives at all, really, other than to persist their metadata. This is done so that\n                        // apps will have an easier time migrating to Ivy, which requires the selector-less\n                        // annotations to be applied.\n                        if (!metadataResolver.isAbstractDirective(symbol)) {\n                            // The directive is an ordinary directive.\n                            directives.push(symbol);\n                        }\n                        else {\n                            // The directive has no selector and is an \"abstract\" directive, so track it\n                            // accordingly.\n                            abstractDirectives.push(symbol);\n                        }\n                    }\n                    else if (metadataResolver.isPipe(symbol)) {\n                        isNgSymbol = true;\n                        pipes.push(symbol);\n                    }\n                    else if (metadataResolver.isNgModule(symbol)) {\n                        var ngModule = metadataResolver.getNgModuleMetadata(symbol, false);\n                        if (ngModule) {\n                            isNgSymbol = true;\n                            ngModules.push(ngModule);\n                        }\n                    }\n                    else if (metadataResolver.isInjectable(symbol)) {\n                        isNgSymbol = true;\n                        var injectable = metadataResolver.getInjectableMetadata(symbol, null, false);\n                        if (injectable) {\n                            injectables.push(injectable);\n                        }\n                    }\n                }\n                if (!isNgSymbol) {\n                    exportsNonSourceFiles =\n                        exportsNonSourceFiles || isValueExportingNonSourceFile(host, symbolMeta);\n                }\n            });\n        }\n        return {\n            fileName: fileName,\n            directives: directives,\n            abstractDirectives: abstractDirectives,\n            pipes: pipes,\n            ngModules: ngModules,\n            injectables: injectables,\n            exportsNonSourceFiles: exportsNonSourceFiles,\n        };\n    }\n    function analyzeFileForInjectables(host, staticSymbolResolver, metadataResolver, fileName) {\n        var injectables = [];\n        var shallowModules = [];\n        if (staticSymbolResolver.hasDecorators(fileName)) {\n            staticSymbolResolver.getSymbolsOf(fileName).forEach(function (symbol) {\n                var resolvedSymbol = staticSymbolResolver.resolveSymbol(symbol);\n                var symbolMeta = resolvedSymbol.metadata;\n                if (!symbolMeta || symbolMeta.__symbolic === 'error') {\n                    return;\n                }\n                if (symbolMeta.__symbolic === 'class') {\n                    if (metadataResolver.isInjectable(symbol)) {\n                        var injectable = metadataResolver.getInjectableMetadata(symbol, null, false);\n                        if (injectable) {\n                            injectables.push(injectable);\n                        }\n                    }\n                    else if (metadataResolver.isNgModule(symbol)) {\n                        var module = metadataResolver.getShallowModuleMetadata(symbol);\n                        if (module) {\n                            shallowModules.push(module);\n                        }\n                    }\n                }\n            });\n        }\n        return { fileName: fileName, injectables: injectables, shallowModules: shallowModules };\n    }\n    function isValueExportingNonSourceFile(host, metadata) {\n        var exportsNonSourceFiles = false;\n        var Visitor = /** @class */ (function () {\n            function Visitor() {\n            }\n            Visitor.prototype.visitArray = function (arr, context) {\n                var _this = this;\n                arr.forEach(function (v) { return visitValue(v, _this, context); });\n            };\n            Visitor.prototype.visitStringMap = function (map, context) {\n                var _this = this;\n                Object.keys(map).forEach(function (key) { return visitValue(map[key], _this, context); });\n            };\n            Visitor.prototype.visitPrimitive = function (value, context) { };\n            Visitor.prototype.visitOther = function (value, context) {\n                if (value instanceof StaticSymbol && !host.isSourceFile(value.filePath)) {\n                    exportsNonSourceFiles = true;\n                }\n            };\n            return Visitor;\n        }());\n        visitValue(metadata, new Visitor(), null);\n        return exportsNonSourceFiles;\n    }\n    function mergeAnalyzedFiles(analyzedFiles) {\n        var allNgModules = [];\n        var ngModuleByPipeOrDirective = new Map();\n        var allPipesAndDirectives = new Set();\n        analyzedFiles.forEach(function (af) {\n            af.ngModules.forEach(function (ngModule) {\n                allNgModules.push(ngModule);\n                ngModule.declaredDirectives.forEach(function (d) { return ngModuleByPipeOrDirective.set(d.reference, ngModule); });\n                ngModule.declaredPipes.forEach(function (p) { return ngModuleByPipeOrDirective.set(p.reference, ngModule); });\n            });\n            af.directives.forEach(function (d) { return allPipesAndDirectives.add(d); });\n            af.pipes.forEach(function (p) { return allPipesAndDirectives.add(p); });\n        });\n        var symbolsMissingModule = [];\n        allPipesAndDirectives.forEach(function (ref) {\n            if (!ngModuleByPipeOrDirective.has(ref)) {\n                symbolsMissingModule.push(ref);\n            }\n        });\n        return {\n            ngModules: allNgModules,\n            ngModuleByPipeOrDirective: ngModuleByPipeOrDirective,\n            symbolsMissingModule: symbolsMissingModule,\n            files: analyzedFiles\n        };\n    }\n    function mergeAndValidateNgFiles(files) {\n        return validateAnalyzedModules(mergeAnalyzedFiles(files));\n    }\n\n    var FORMATTED_MESSAGE = 'ngFormattedMessage';\n    function indentStr(level) {\n        if (level <= 0)\n            return '';\n        if (level < 6)\n            return ['', ' ', '  ', '   ', '    ', '     '][level];\n        var half = indentStr(Math.floor(level / 2));\n        return half + half + (level % 2 === 1 ? ' ' : '');\n    }\n    function formatChain(chain, indent) {\n        var e_1, _a;\n        if (indent === void 0) { indent = 0; }\n        if (!chain)\n            return '';\n        var position = chain.position ?\n            chain.position.fileName + \"(\" + (chain.position.line + 1) + \",\" + (chain.position.column + 1) + \")\" :\n            '';\n        var prefix = position && indent === 0 ? position + \": \" : '';\n        var postfix = position && indent !== 0 ? \" at \" + position : '';\n        var message = \"\" + prefix + chain.message + postfix;\n        if (chain.next) {\n            try {\n                for (var _b = __values(chain.next), _c = _b.next(); !_c.done; _c = _b.next()) {\n                    var kid = _c.value;\n                    message += '\\n' + formatChain(kid, indent + 2);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        }\n        return \"\" + indentStr(indent) + message;\n    }\n    function formattedError(chain) {\n        var message = formatChain(chain) + '.';\n        var error = syntaxError(message);\n        error[FORMATTED_MESSAGE] = true;\n        error.chain = chain;\n        error.position = chain.position;\n        return error;\n    }\n    function isFormattedError(error) {\n        return !!error[FORMATTED_MESSAGE];\n    }\n\n    var ANGULAR_CORE = '@angular/core';\n    var ANGULAR_ROUTER = '@angular/router';\n    var HIDDEN_KEY = /^\\$.*\\$$/;\n    var IGNORE = {\n        __symbolic: 'ignore'\n    };\n    var USE_VALUE$1 = 'useValue';\n    var PROVIDE = 'provide';\n    var REFERENCE_SET = new Set([USE_VALUE$1, 'useFactory', 'data', 'id', 'loadChildren']);\n    var TYPEGUARD_POSTFIX = 'TypeGuard';\n    var USE_IF = 'UseIf';\n    function shouldIgnore(value) {\n        return value && value.__symbolic == 'ignore';\n    }\n    /**\n     * A static reflector implements enough of the Reflector API that is necessary to compile\n     * templates statically.\n     */\n    var StaticReflector = /** @class */ (function () {\n        function StaticReflector(summaryResolver, symbolResolver, knownMetadataClasses, knownMetadataFunctions, errorRecorder) {\n            var _this = this;\n            if (knownMetadataClasses === void 0) { knownMetadataClasses = []; }\n            if (knownMetadataFunctions === void 0) { knownMetadataFunctions = []; }\n            this.summaryResolver = summaryResolver;\n            this.symbolResolver = symbolResolver;\n            this.errorRecorder = errorRecorder;\n            this.annotationCache = new Map();\n            this.shallowAnnotationCache = new Map();\n            this.propertyCache = new Map();\n            this.parameterCache = new Map();\n            this.methodCache = new Map();\n            this.staticCache = new Map();\n            this.conversionMap = new Map();\n            this.resolvedExternalReferences = new Map();\n            this.annotationForParentClassWithSummaryKind = new Map();\n            this.initializeConversionMap();\n            knownMetadataClasses.forEach(function (kc) { return _this._registerDecoratorOrConstructor(_this.getStaticSymbol(kc.filePath, kc.name), kc.ctor); });\n            knownMetadataFunctions.forEach(function (kf) { return _this._registerFunction(_this.getStaticSymbol(kf.filePath, kf.name), kf.fn); });\n            this.annotationForParentClassWithSummaryKind.set(exports.CompileSummaryKind.Directive, [createDirective, createComponent]);\n            this.annotationForParentClassWithSummaryKind.set(exports.CompileSummaryKind.Pipe, [createPipe]);\n            this.annotationForParentClassWithSummaryKind.set(exports.CompileSummaryKind.NgModule, [createNgModule]);\n            this.annotationForParentClassWithSummaryKind.set(exports.CompileSummaryKind.Injectable, [createInjectable, createPipe, createDirective, createComponent, createNgModule]);\n        }\n        StaticReflector.prototype.componentModuleUrl = function (typeOrFunc) {\n            var staticSymbol = this.findSymbolDeclaration(typeOrFunc);\n            return this.symbolResolver.getResourcePath(staticSymbol);\n        };\n        /**\n         * Invalidate the specified `symbols` on program change.\n         * @param symbols\n         */\n        StaticReflector.prototype.invalidateSymbols = function (symbols) {\n            var e_1, _a;\n            try {\n                for (var symbols_1 = __values(symbols), symbols_1_1 = symbols_1.next(); !symbols_1_1.done; symbols_1_1 = symbols_1.next()) {\n                    var symbol = symbols_1_1.value;\n                    this.annotationCache.delete(symbol);\n                    this.shallowAnnotationCache.delete(symbol);\n                    this.propertyCache.delete(symbol);\n                    this.parameterCache.delete(symbol);\n                    this.methodCache.delete(symbol);\n                    this.staticCache.delete(symbol);\n                    this.conversionMap.delete(symbol);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (symbols_1_1 && !symbols_1_1.done && (_a = symbols_1.return)) _a.call(symbols_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        };\n        StaticReflector.prototype.resolveExternalReference = function (ref, containingFile) {\n            var key = undefined;\n            if (!containingFile) {\n                key = ref.moduleName + \":\" + ref.name;\n                var declarationSymbol_1 = this.resolvedExternalReferences.get(key);\n                if (declarationSymbol_1)\n                    return declarationSymbol_1;\n            }\n            var refSymbol = this.symbolResolver.getSymbolByModule(ref.moduleName, ref.name, containingFile);\n            var declarationSymbol = this.findSymbolDeclaration(refSymbol);\n            if (!containingFile) {\n                this.symbolResolver.recordModuleNameForFileName(refSymbol.filePath, ref.moduleName);\n                this.symbolResolver.recordImportAs(declarationSymbol, refSymbol);\n            }\n            if (key) {\n                this.resolvedExternalReferences.set(key, declarationSymbol);\n            }\n            return declarationSymbol;\n        };\n        StaticReflector.prototype.findDeclaration = function (moduleUrl, name, containingFile) {\n            return this.findSymbolDeclaration(this.symbolResolver.getSymbolByModule(moduleUrl, name, containingFile));\n        };\n        StaticReflector.prototype.tryFindDeclaration = function (moduleUrl, name, containingFile) {\n            var _this = this;\n            return this.symbolResolver.ignoreErrorsFor(function () { return _this.findDeclaration(moduleUrl, name, containingFile); });\n        };\n        StaticReflector.prototype.findSymbolDeclaration = function (symbol) {\n            var resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);\n            if (resolvedSymbol) {\n                var resolvedMetadata = resolvedSymbol.metadata;\n                if (resolvedMetadata && resolvedMetadata.__symbolic === 'resolved') {\n                    resolvedMetadata = resolvedMetadata.symbol;\n                }\n                if (resolvedMetadata instanceof StaticSymbol) {\n                    return this.findSymbolDeclaration(resolvedSymbol.metadata);\n                }\n            }\n            return symbol;\n        };\n        StaticReflector.prototype.tryAnnotations = function (type) {\n            var originalRecorder = this.errorRecorder;\n            this.errorRecorder = function (error, fileName) { };\n            try {\n                return this.annotations(type);\n            }\n            finally {\n                this.errorRecorder = originalRecorder;\n            }\n        };\n        StaticReflector.prototype.annotations = function (type) {\n            var _this = this;\n            return this._annotations(type, function (type, decorators) { return _this.simplify(type, decorators); }, this.annotationCache);\n        };\n        StaticReflector.prototype.shallowAnnotations = function (type) {\n            var _this = this;\n            return this._annotations(type, function (type, decorators) { return _this.simplify(type, decorators, true); }, this.shallowAnnotationCache);\n        };\n        StaticReflector.prototype._annotations = function (type, simplify, annotationCache) {\n            var annotations = annotationCache.get(type);\n            if (!annotations) {\n                annotations = [];\n                var classMetadata = this.getTypeMetadata(type);\n                var parentType = this.findParentType(type, classMetadata);\n                if (parentType) {\n                    var parentAnnotations = this.annotations(parentType);\n                    annotations.push.apply(annotations, __spreadArray([], __read(parentAnnotations)));\n                }\n                var ownAnnotations_1 = [];\n                if (classMetadata['decorators']) {\n                    ownAnnotations_1 = simplify(type, classMetadata['decorators']);\n                    if (ownAnnotations_1) {\n                        annotations.push.apply(annotations, __spreadArray([], __read(ownAnnotations_1)));\n                    }\n                }\n                if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&\n                    this.summaryResolver.isLibraryFile(parentType.filePath)) {\n                    var summary = this.summaryResolver.resolveSummary(parentType);\n                    if (summary && summary.type) {\n                        var requiredAnnotationTypes = this.annotationForParentClassWithSummaryKind.get(summary.type.summaryKind);\n                        var typeHasRequiredAnnotation = requiredAnnotationTypes.some(function (requiredType) { return ownAnnotations_1.some(function (ann) { return requiredType.isTypeOf(ann); }); });\n                        if (!typeHasRequiredAnnotation) {\n                            this.reportError(formatMetadataError(metadataError(\"Class \" + type.name + \" in \" + type.filePath + \" extends from a \" + exports.CompileSummaryKind[summary.type.summaryKind] + \" in another compilation unit without duplicating the decorator\", \n                            /* summary */ undefined, \"Please add a \" + requiredAnnotationTypes.map(function (type) { return type.ngMetadataName; })\n                                .join(' or ') + \" decorator to the class\"), type), type);\n                        }\n                    }\n                }\n                annotationCache.set(type, annotations.filter(function (ann) { return !!ann; }));\n            }\n            return annotations;\n        };\n        StaticReflector.prototype.propMetadata = function (type) {\n            var _this = this;\n            var propMetadata = this.propertyCache.get(type);\n            if (!propMetadata) {\n                var classMetadata = this.getTypeMetadata(type);\n                propMetadata = {};\n                var parentType = this.findParentType(type, classMetadata);\n                if (parentType) {\n                    var parentPropMetadata_1 = this.propMetadata(parentType);\n                    Object.keys(parentPropMetadata_1).forEach(function (parentProp) {\n                        propMetadata[parentProp] = parentPropMetadata_1[parentProp];\n                    });\n                }\n                var members_1 = classMetadata['members'] || {};\n                Object.keys(members_1).forEach(function (propName) {\n                    var propData = members_1[propName];\n                    var prop = propData\n                        .find(function (a) { return a['__symbolic'] == 'property' || a['__symbolic'] == 'method'; });\n                    var decorators = [];\n                    // hasOwnProperty() is used here to make sure we do not look up methods\n                    // on `Object.prototype`.\n                    if (propMetadata === null || propMetadata === void 0 ? void 0 : propMetadata.hasOwnProperty(propName)) {\n                        decorators.push.apply(decorators, __spreadArray([], __read(propMetadata[propName])));\n                    }\n                    propMetadata[propName] = decorators;\n                    if (prop && prop['decorators']) {\n                        decorators.push.apply(decorators, __spreadArray([], __read(_this.simplify(type, prop['decorators']))));\n                    }\n                });\n                this.propertyCache.set(type, propMetadata);\n            }\n            return propMetadata;\n        };\n        StaticReflector.prototype.parameters = function (type) {\n            var _this = this;\n            if (!(type instanceof StaticSymbol)) {\n                this.reportError(new Error(\"parameters received \" + JSON.stringify(type) + \" which is not a StaticSymbol\"), type);\n                return [];\n            }\n            try {\n                var parameters_1 = this.parameterCache.get(type);\n                if (!parameters_1) {\n                    var classMetadata = this.getTypeMetadata(type);\n                    var parentType = this.findParentType(type, classMetadata);\n                    var members = classMetadata ? classMetadata['members'] : null;\n                    var ctorData = members ? members['__ctor__'] : null;\n                    if (ctorData) {\n                        var ctor = ctorData.find(function (a) { return a['__symbolic'] == 'constructor'; });\n                        var rawParameterTypes = ctor['parameters'] || [];\n                        var parameterDecorators_1 = this.simplify(type, ctor['parameterDecorators'] || []);\n                        parameters_1 = [];\n                        rawParameterTypes.forEach(function (rawParamType, index) {\n                            var nestedResult = [];\n                            var paramType = _this.trySimplify(type, rawParamType);\n                            if (paramType)\n                                nestedResult.push(paramType);\n                            var decorators = parameterDecorators_1 ? parameterDecorators_1[index] : null;\n                            if (decorators) {\n                                nestedResult.push.apply(nestedResult, __spreadArray([], __read(decorators)));\n                            }\n                            parameters_1.push(nestedResult);\n                        });\n                    }\n                    else if (parentType) {\n                        parameters_1 = this.parameters(parentType);\n                    }\n                    if (!parameters_1) {\n                        parameters_1 = [];\n                    }\n                    this.parameterCache.set(type, parameters_1);\n                }\n                return parameters_1;\n            }\n            catch (e) {\n                console.error(\"Failed on type \" + JSON.stringify(type) + \" with error \" + e);\n                throw e;\n            }\n        };\n        StaticReflector.prototype._methodNames = function (type) {\n            var methodNames = this.methodCache.get(type);\n            if (!methodNames) {\n                var classMetadata = this.getTypeMetadata(type);\n                methodNames = {};\n                var parentType = this.findParentType(type, classMetadata);\n                if (parentType) {\n                    var parentMethodNames_1 = this._methodNames(parentType);\n                    Object.keys(parentMethodNames_1).forEach(function (parentProp) {\n                        methodNames[parentProp] = parentMethodNames_1[parentProp];\n                    });\n                }\n                var members_2 = classMetadata['members'] || {};\n                Object.keys(members_2).forEach(function (propName) {\n                    var propData = members_2[propName];\n                    var isMethod = propData.some(function (a) { return a['__symbolic'] == 'method'; });\n                    methodNames[propName] = methodNames[propName] || isMethod;\n                });\n                this.methodCache.set(type, methodNames);\n            }\n            return methodNames;\n        };\n        StaticReflector.prototype._staticMembers = function (type) {\n            var staticMembers = this.staticCache.get(type);\n            if (!staticMembers) {\n                var classMetadata = this.getTypeMetadata(type);\n                var staticMemberData = classMetadata['statics'] || {};\n                staticMembers = Object.keys(staticMemberData);\n                this.staticCache.set(type, staticMembers);\n            }\n            return staticMembers;\n        };\n        StaticReflector.prototype.findParentType = function (type, classMetadata) {\n            var parentType = this.trySimplify(type, classMetadata['extends']);\n            if (parentType instanceof StaticSymbol) {\n                return parentType;\n            }\n        };\n        StaticReflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n            if (!(type instanceof StaticSymbol)) {\n                this.reportError(new Error(\"hasLifecycleHook received \" + JSON.stringify(type) + \" which is not a StaticSymbol\"), type);\n            }\n            try {\n                return !!this._methodNames(type)[lcProperty];\n            }\n            catch (e) {\n                console.error(\"Failed on type \" + JSON.stringify(type) + \" with error \" + e);\n                throw e;\n            }\n        };\n        StaticReflector.prototype.guards = function (type) {\n            var e_2, _a;\n            if (!(type instanceof StaticSymbol)) {\n                this.reportError(new Error(\"guards received \" + JSON.stringify(type) + \" which is not a StaticSymbol\"), type);\n                return {};\n            }\n            var staticMembers = this._staticMembers(type);\n            var result = {};\n            try {\n                for (var staticMembers_1 = __values(staticMembers), staticMembers_1_1 = staticMembers_1.next(); !staticMembers_1_1.done; staticMembers_1_1 = staticMembers_1.next()) {\n                    var name = staticMembers_1_1.value;\n                    if (name.endsWith(TYPEGUARD_POSTFIX)) {\n                        var property = name.substr(0, name.length - TYPEGUARD_POSTFIX.length);\n                        var value = void 0;\n                        if (property.endsWith(USE_IF)) {\n                            property = name.substr(0, property.length - USE_IF.length);\n                            value = USE_IF;\n                        }\n                        else {\n                            value = this.getStaticSymbol(type.filePath, type.name, [name]);\n                        }\n                        result[property] = value;\n                    }\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (staticMembers_1_1 && !staticMembers_1_1.done && (_a = staticMembers_1.return)) _a.call(staticMembers_1);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n            return result;\n        };\n        StaticReflector.prototype._registerDecoratorOrConstructor = function (type, ctor) {\n            this.conversionMap.set(type, function (context, args) { return new (ctor.bind.apply(ctor, __spreadArray([void 0], __read(args))))(); });\n        };\n        StaticReflector.prototype._registerFunction = function (type, fn) {\n            this.conversionMap.set(type, function (context, args) { return fn.apply(undefined, args); });\n        };\n        StaticReflector.prototype.initializeConversionMap = function () {\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Injectable'), createInjectable);\n            this.injectionToken = this.findDeclaration(ANGULAR_CORE, 'InjectionToken');\n            this.opaqueToken = this.findDeclaration(ANGULAR_CORE, 'OpaqueToken');\n            this.ROUTES = this.tryFindDeclaration(ANGULAR_ROUTER, 'ROUTES');\n            this.ANALYZE_FOR_ENTRY_COMPONENTS =\n                this.findDeclaration(ANGULAR_CORE, 'ANALYZE_FOR_ENTRY_COMPONENTS');\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Inject'), createInject);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Attribute'), createAttribute);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChild'), createContentChild);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChildren'), createContentChildren);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChild'), createViewChild);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChildren'), createViewChildren);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Input'), createInput);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Output'), createOutput);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Pipe'), createPipe);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostBinding'), createHostBinding);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostListener'), createHostListener);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Directive'), createDirective);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Component'), createComponent);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'NgModule'), createNgModule);\n            // Note: Some metadata classes can be used directly with Provider.deps.\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);\n            this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);\n        };\n        /**\n         * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.\n         * All types passed to the StaticResolver should be pseudo-types returned by this method.\n         *\n         * @param declarationFile the absolute path of the file where the symbol is declared\n         * @param name the name of the type.\n         */\n        StaticReflector.prototype.getStaticSymbol = function (declarationFile, name, members) {\n            return this.symbolResolver.getStaticSymbol(declarationFile, name, members);\n        };\n        /**\n         * Simplify but discard any errors\n         */\n        StaticReflector.prototype.trySimplify = function (context, value) {\n            var originalRecorder = this.errorRecorder;\n            this.errorRecorder = function (error, fileName) { };\n            var result = this.simplify(context, value);\n            this.errorRecorder = originalRecorder;\n            return result;\n        };\n        /** @internal */\n        StaticReflector.prototype.simplify = function (context, value, lazy) {\n            if (lazy === void 0) { lazy = false; }\n            var self = this;\n            var scope = BindingScope$1.empty;\n            var calling = new Map();\n            var rootContext = context;\n            function simplifyInContext(context, value, depth, references) {\n                function resolveReferenceValue(staticSymbol) {\n                    var resolvedSymbol = self.symbolResolver.resolveSymbol(staticSymbol);\n                    return resolvedSymbol ? resolvedSymbol.metadata : null;\n                }\n                function simplifyEagerly(value) {\n                    return simplifyInContext(context, value, depth, 0);\n                }\n                function simplifyLazily(value) {\n                    return simplifyInContext(context, value, depth, references + 1);\n                }\n                function simplifyNested(nestedContext, value) {\n                    if (nestedContext === context) {\n                        // If the context hasn't changed let the exception propagate unmodified.\n                        return simplifyInContext(nestedContext, value, depth + 1, references);\n                    }\n                    try {\n                        return simplifyInContext(nestedContext, value, depth + 1, references);\n                    }\n                    catch (e) {\n                        if (isMetadataError(e)) {\n                            // Propagate the message text up but add a message to the chain that explains how we got\n                            // here.\n                            // e.chain implies e.symbol\n                            var summaryMsg = e.chain ? 'references \\'' + e.symbol.name + '\\'' : errorSummary(e);\n                            var summary = \"'\" + nestedContext.name + \"' \" + summaryMsg;\n                            var chain = { message: summary, position: e.position, next: e.chain };\n                            // TODO(chuckj): retrieve the position information indirectly from the collectors node\n                            // map if the metadata is from a .ts file.\n                            self.error({\n                                message: e.message,\n                                advise: e.advise,\n                                context: e.context,\n                                chain: chain,\n                                symbol: nestedContext\n                            }, context);\n                        }\n                        else {\n                            // It is probably an internal error.\n                            throw e;\n                        }\n                    }\n                }\n                function simplifyCall(functionSymbol, targetFunction, args, targetExpression) {\n                    if (targetFunction && targetFunction['__symbolic'] == 'function') {\n                        if (calling.get(functionSymbol)) {\n                            self.error({\n                                message: 'Recursion is not supported',\n                                summary: \"called '\" + functionSymbol.name + \"' recursively\",\n                                value: targetFunction\n                            }, functionSymbol);\n                        }\n                        try {\n                            var value_1 = targetFunction['value'];\n                            if (value_1 && (depth != 0 || value_1.__symbolic != 'error')) {\n                                var parameters = targetFunction['parameters'];\n                                var defaults = targetFunction.defaults;\n                                args = args.map(function (arg) { return simplifyNested(context, arg); })\n                                    .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });\n                                if (defaults && defaults.length > args.length) {\n                                    args.push.apply(args, __spreadArray([], __read(defaults.slice(args.length).map(function (value) { return simplify(value); }))));\n                                }\n                                calling.set(functionSymbol, true);\n                                var functionScope = BindingScope$1.build();\n                                for (var i = 0; i < parameters.length; i++) {\n                                    functionScope.define(parameters[i], args[i]);\n                                }\n                                var oldScope = scope;\n                                var result_1;\n                                try {\n                                    scope = functionScope.done();\n                                    result_1 = simplifyNested(functionSymbol, value_1);\n                                }\n                                finally {\n                                    scope = oldScope;\n                                }\n                                return result_1;\n                            }\n                        }\n                        finally {\n                            calling.delete(functionSymbol);\n                        }\n                    }\n                    if (depth === 0) {\n                        // If depth is 0 we are evaluating the top level expression that is describing element\n                        // decorator. In this case, it is a decorator we don't understand, such as a custom\n                        // non-angular decorator, and we should just ignore it.\n                        return IGNORE;\n                    }\n                    var position = undefined;\n                    if (targetExpression && targetExpression.__symbolic == 'resolved') {\n                        var line = targetExpression.line;\n                        var character = targetExpression.character;\n                        var fileName = targetExpression.fileName;\n                        if (fileName != null && line != null && character != null) {\n                            position = { fileName: fileName, line: line, column: character };\n                        }\n                    }\n                    self.error({\n                        message: FUNCTION_CALL_NOT_SUPPORTED,\n                        context: functionSymbol,\n                        value: targetFunction,\n                        position: position\n                    }, context);\n                }\n                function simplify(expression) {\n                    var e_3, _a, e_4, _b;\n                    if (isPrimitive(expression)) {\n                        return expression;\n                    }\n                    if (Array.isArray(expression)) {\n                        var result_2 = [];\n                        try {\n                            for (var expression_1 = __values(expression), expression_1_1 = expression_1.next(); !expression_1_1.done; expression_1_1 = expression_1.next()) {\n                                var item = expression_1_1.value;\n                                // Check for a spread expression\n                                if (item && item.__symbolic === 'spread') {\n                                    // We call with references as 0 because we require the actual value and cannot\n                                    // tolerate a reference here.\n                                    var spreadArray = simplifyEagerly(item.expression);\n                                    if (Array.isArray(spreadArray)) {\n                                        try {\n                                            for (var spreadArray_1 = (e_4 = void 0, __values(spreadArray)), spreadArray_1_1 = spreadArray_1.next(); !spreadArray_1_1.done; spreadArray_1_1 = spreadArray_1.next()) {\n                                                var spreadItem = spreadArray_1_1.value;\n                                                result_2.push(spreadItem);\n                                            }\n                                        }\n                                        catch (e_4_1) { e_4 = { error: e_4_1 }; }\n                                        finally {\n                                            try {\n                                                if (spreadArray_1_1 && !spreadArray_1_1.done && (_b = spreadArray_1.return)) _b.call(spreadArray_1);\n                                            }\n                                            finally { if (e_4) throw e_4.error; }\n                                        }\n                                        continue;\n                                    }\n                                }\n                                var value_2 = simplify(item);\n                                if (shouldIgnore(value_2)) {\n                                    continue;\n                                }\n                                result_2.push(value_2);\n                            }\n                        }\n                        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n                        finally {\n                            try {\n                                if (expression_1_1 && !expression_1_1.done && (_a = expression_1.return)) _a.call(expression_1);\n                            }\n                            finally { if (e_3) throw e_3.error; }\n                        }\n                        return result_2;\n                    }\n                    if (expression instanceof StaticSymbol) {\n                        // Stop simplification at builtin symbols or if we are in a reference context and\n                        // the symbol doesn't have members.\n                        if (expression === self.injectionToken || self.conversionMap.has(expression) ||\n                            (references > 0 && !expression.members.length)) {\n                            return expression;\n                        }\n                        else {\n                            var staticSymbol = expression;\n                            var declarationValue = resolveReferenceValue(staticSymbol);\n                            if (declarationValue != null) {\n                                return simplifyNested(staticSymbol, declarationValue);\n                            }\n                            else {\n                                return staticSymbol;\n                            }\n                        }\n                    }\n                    if (expression) {\n                        if (expression['__symbolic']) {\n                            var staticSymbol = void 0;\n                            switch (expression['__symbolic']) {\n                                case 'binop':\n                                    var left = simplify(expression['left']);\n                                    if (shouldIgnore(left))\n                                        return left;\n                                    var right = simplify(expression['right']);\n                                    if (shouldIgnore(right))\n                                        return right;\n                                    switch (expression['operator']) {\n                                        case '&&':\n                                            return left && right;\n                                        case '||':\n                                            return left || right;\n                                        case '|':\n                                            return left | right;\n                                        case '^':\n                                            return left ^ right;\n                                        case '&':\n                                            return left & right;\n                                        case '==':\n                                            return left == right;\n                                        case '!=':\n                                            return left != right;\n                                        case '===':\n                                            return left === right;\n                                        case '!==':\n                                            return left !== right;\n                                        case '<':\n                                            return left < right;\n                                        case '>':\n                                            return left > right;\n                                        case '<=':\n                                            return left <= right;\n                                        case '>=':\n                                            return left >= right;\n                                        case '<<':\n                                            return left << right;\n                                        case '>>':\n                                            return left >> right;\n                                        case '+':\n                                            return left + right;\n                                        case '-':\n                                            return left - right;\n                                        case '*':\n                                            return left * right;\n                                        case '/':\n                                            return left / right;\n                                        case '%':\n                                            return left % right;\n                                        case '??':\n                                            return left !== null && left !== void 0 ? left : right;\n                                    }\n                                    return null;\n                                case 'if':\n                                    var condition = simplify(expression['condition']);\n                                    return condition ? simplify(expression['thenExpression']) :\n                                        simplify(expression['elseExpression']);\n                                case 'pre':\n                                    var operand = simplify(expression['operand']);\n                                    if (shouldIgnore(operand))\n                                        return operand;\n                                    switch (expression['operator']) {\n                                        case '+':\n                                            return operand;\n                                        case '-':\n                                            return -operand;\n                                        case '!':\n                                            return !operand;\n                                        case '~':\n                                            return ~operand;\n                                    }\n                                    return null;\n                                case 'index':\n                                    var indexTarget = simplifyEagerly(expression['expression']);\n                                    var index = simplifyEagerly(expression['index']);\n                                    if (indexTarget && isPrimitive(index))\n                                        return indexTarget[index];\n                                    return null;\n                                case 'select':\n                                    var member = expression['member'];\n                                    var selectContext = context;\n                                    var selectTarget = simplify(expression['expression']);\n                                    if (selectTarget instanceof StaticSymbol) {\n                                        var members = selectTarget.members.concat(member);\n                                        selectContext =\n                                            self.getStaticSymbol(selectTarget.filePath, selectTarget.name, members);\n                                        var declarationValue = resolveReferenceValue(selectContext);\n                                        if (declarationValue != null) {\n                                            return simplifyNested(selectContext, declarationValue);\n                                        }\n                                        else {\n                                            return selectContext;\n                                        }\n                                    }\n                                    if (selectTarget && isPrimitive(member))\n                                        return simplifyNested(selectContext, selectTarget[member]);\n                                    return null;\n                                case 'reference':\n                                    // Note: This only has to deal with variable references, as symbol references have\n                                    // been converted into 'resolved'\n                                    // in the StaticSymbolResolver.\n                                    var name = expression['name'];\n                                    var localValue = scope.resolve(name);\n                                    if (localValue != BindingScope$1.missing) {\n                                        return localValue;\n                                    }\n                                    break;\n                                case 'resolved':\n                                    try {\n                                        return simplify(expression.symbol);\n                                    }\n                                    catch (e) {\n                                        // If an error is reported evaluating the symbol record the position of the\n                                        // reference in the error so it can\n                                        // be reported in the error message generated from the exception.\n                                        if (isMetadataError(e) && expression.fileName != null &&\n                                            expression.line != null && expression.character != null) {\n                                            e.position = {\n                                                fileName: expression.fileName,\n                                                line: expression.line,\n                                                column: expression.character\n                                            };\n                                        }\n                                        throw e;\n                                    }\n                                case 'class':\n                                    return context;\n                                case 'function':\n                                    return context;\n                                case 'new':\n                                case 'call':\n                                    // Determine if the function is a built-in conversion\n                                    staticSymbol = simplifyInContext(context, expression['expression'], depth + 1, /* references */ 0);\n                                    if (staticSymbol instanceof StaticSymbol) {\n                                        if (staticSymbol === self.injectionToken || staticSymbol === self.opaqueToken) {\n                                            // if somebody calls new InjectionToken, don't create an InjectionToken,\n                                            // but rather return the symbol to which the InjectionToken is assigned to.\n                                            // OpaqueToken is supported too as it is required by the language service to\n                                            // support v4 and prior versions of Angular.\n                                            return context;\n                                        }\n                                        var argExpressions = expression['arguments'] || [];\n                                        var converter = self.conversionMap.get(staticSymbol);\n                                        if (converter) {\n                                            var args = argExpressions.map(function (arg) { return simplifyNested(context, arg); })\n                                                .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });\n                                            return converter(context, args);\n                                        }\n                                        else {\n                                            // Determine if the function is one we can simplify.\n                                            var targetFunction = resolveReferenceValue(staticSymbol);\n                                            return simplifyCall(staticSymbol, targetFunction, argExpressions, expression['expression']);\n                                        }\n                                    }\n                                    return IGNORE;\n                                case 'error':\n                                    var message = expression.message;\n                                    if (expression['line'] != null) {\n                                        self.error({\n                                            message: message,\n                                            context: expression.context,\n                                            value: expression,\n                                            position: {\n                                                fileName: expression['fileName'],\n                                                line: expression['line'],\n                                                column: expression['character']\n                                            }\n                                        }, context);\n                                    }\n                                    else {\n                                        self.error({ message: message, context: expression.context }, context);\n                                    }\n                                    return IGNORE;\n                                case 'ignore':\n                                    return expression;\n                            }\n                            return null;\n                        }\n                        return mapStringMap(expression, function (value, name) {\n                            if (REFERENCE_SET.has(name)) {\n                                if (name === USE_VALUE$1 && PROVIDE in expression) {\n                                    // If this is a provider expression, check for special tokens that need the value\n                                    // during analysis.\n                                    var provide = simplify(expression.provide);\n                                    if (provide === self.ROUTES || provide == self.ANALYZE_FOR_ENTRY_COMPONENTS) {\n                                        return simplify(value);\n                                    }\n                                }\n                                return simplifyLazily(value);\n                            }\n                            return simplify(value);\n                        });\n                    }\n                    return IGNORE;\n                }\n                return simplify(value);\n            }\n            var result;\n            try {\n                result = simplifyInContext(context, value, 0, lazy ? 1 : 0);\n            }\n            catch (e) {\n                if (this.errorRecorder) {\n                    this.reportError(e, context);\n                }\n                else {\n                    throw formatMetadataError(e, context);\n                }\n            }\n            if (shouldIgnore(result)) {\n                return undefined;\n            }\n            return result;\n        };\n        StaticReflector.prototype.getTypeMetadata = function (type) {\n            var resolvedSymbol = this.symbolResolver.resolveSymbol(type);\n            return resolvedSymbol && resolvedSymbol.metadata ? resolvedSymbol.metadata :\n                { __symbolic: 'class' };\n        };\n        StaticReflector.prototype.reportError = function (error, context, path) {\n            if (this.errorRecorder) {\n                this.errorRecorder(formatMetadataError(error, context), (context && context.filePath) || path);\n            }\n            else {\n                throw error;\n            }\n        };\n        StaticReflector.prototype.error = function (_a, reportingContext) {\n            var message = _a.message, summary = _a.summary, advise = _a.advise, position = _a.position, context = _a.context, value = _a.value, symbol = _a.symbol, chain = _a.chain;\n            this.reportError(metadataError(message, summary, advise, position, symbol, context, chain), reportingContext);\n        };\n        return StaticReflector;\n    }());\n    var METADATA_ERROR = 'ngMetadataError';\n    function metadataError(message, summary, advise, position, symbol, context, chain) {\n        var error = syntaxError(message);\n        error[METADATA_ERROR] = true;\n        if (advise)\n            error.advise = advise;\n        if (position)\n            error.position = position;\n        if (summary)\n            error.summary = summary;\n        if (context)\n            error.context = context;\n        if (chain)\n            error.chain = chain;\n        if (symbol)\n            error.symbol = symbol;\n        return error;\n    }\n    function isMetadataError(error) {\n        return !!error[METADATA_ERROR];\n    }\n    var REFERENCE_TO_NONEXPORTED_CLASS = 'Reference to non-exported class';\n    var VARIABLE_NOT_INITIALIZED = 'Variable not initialized';\n    var DESTRUCTURE_NOT_SUPPORTED = 'Destructuring not supported';\n    var COULD_NOT_RESOLVE_TYPE = 'Could not resolve type';\n    var FUNCTION_CALL_NOT_SUPPORTED = 'Function call not supported';\n    var REFERENCE_TO_LOCAL_SYMBOL = 'Reference to a local symbol';\n    var LAMBDA_NOT_SUPPORTED = 'Lambda not supported';\n    function expandedMessage(message, context) {\n        switch (message) {\n            case REFERENCE_TO_NONEXPORTED_CLASS:\n                if (context && context.className) {\n                    return \"References to a non-exported class are not supported in decorators but \" + context.className + \" was referenced.\";\n                }\n                break;\n            case VARIABLE_NOT_INITIALIZED:\n                return 'Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler';\n            case DESTRUCTURE_NOT_SUPPORTED:\n                return 'Referencing an exported destructured variable or constant is not supported in decorators and this value is needed by the template compiler';\n            case COULD_NOT_RESOLVE_TYPE:\n                if (context && context.typeName) {\n                    return \"Could not resolve type \" + context.typeName;\n                }\n                break;\n            case FUNCTION_CALL_NOT_SUPPORTED:\n                if (context && context.name) {\n                    return \"Function calls are not supported in decorators but '\" + context.name + \"' was called\";\n                }\n                return 'Function calls are not supported in decorators';\n            case REFERENCE_TO_LOCAL_SYMBOL:\n                if (context && context.name) {\n                    return \"Reference to a local (non-exported) symbols are not supported in decorators but '\" + context.name + \"' was referenced\";\n                }\n                break;\n            case LAMBDA_NOT_SUPPORTED:\n                return \"Function expressions are not supported in decorators\";\n        }\n        return message;\n    }\n    function messageAdvise(message, context) {\n        switch (message) {\n            case REFERENCE_TO_NONEXPORTED_CLASS:\n                if (context && context.className) {\n                    return \"Consider exporting '\" + context.className + \"'\";\n                }\n                break;\n            case DESTRUCTURE_NOT_SUPPORTED:\n                return 'Consider simplifying to avoid destructuring';\n            case REFERENCE_TO_LOCAL_SYMBOL:\n                if (context && context.name) {\n                    return \"Consider exporting '\" + context.name + \"'\";\n                }\n                break;\n            case LAMBDA_NOT_SUPPORTED:\n                return \"Consider changing the function expression into an exported function\";\n        }\n        return undefined;\n    }\n    function errorSummary(error) {\n        if (error.summary) {\n            return error.summary;\n        }\n        switch (error.message) {\n            case REFERENCE_TO_NONEXPORTED_CLASS:\n                if (error.context && error.context.className) {\n                    return \"references non-exported class \" + error.context.className;\n                }\n                break;\n            case VARIABLE_NOT_INITIALIZED:\n                return 'is not initialized';\n            case DESTRUCTURE_NOT_SUPPORTED:\n                return 'is a destructured variable';\n            case COULD_NOT_RESOLVE_TYPE:\n                return 'could not be resolved';\n            case FUNCTION_CALL_NOT_SUPPORTED:\n                if (error.context && error.context.name) {\n                    return \"calls '\" + error.context.name + \"'\";\n                }\n                return \"calls a function\";\n            case REFERENCE_TO_LOCAL_SYMBOL:\n                if (error.context && error.context.name) {\n                    return \"references local variable \" + error.context.name;\n                }\n                return \"references a local variable\";\n        }\n        return 'contains the error';\n    }\n    function mapStringMap(input, transform) {\n        if (!input)\n            return {};\n        var result = {};\n        Object.keys(input).forEach(function (key) {\n            var value = transform(input[key], key);\n            if (!shouldIgnore(value)) {\n                if (HIDDEN_KEY.test(key)) {\n                    Object.defineProperty(result, key, { enumerable: false, configurable: true, value: value });\n                }\n                else {\n                    result[key] = value;\n                }\n            }\n        });\n        return result;\n    }\n    function isPrimitive(o) {\n        return o === null || (typeof o !== 'function' && typeof o !== 'object');\n    }\n    var BindingScope$1 = /** @class */ (function () {\n        function BindingScope() {\n        }\n        BindingScope.build = function () {\n            var current = new Map();\n            return {\n                define: function (name, value) {\n                    current.set(name, value);\n                    return this;\n                },\n                done: function () {\n                    return current.size > 0 ? new PopulatedScope(current) : BindingScope.empty;\n                }\n            };\n        };\n        return BindingScope;\n    }());\n    BindingScope$1.missing = {};\n    BindingScope$1.empty = { resolve: function (name) { return BindingScope$1.missing; } };\n    var PopulatedScope = /** @class */ (function (_super) {\n        __extends(PopulatedScope, _super);\n        function PopulatedScope(bindings) {\n            var _this = _super.call(this) || this;\n            _this.bindings = bindings;\n            return _this;\n        }\n        PopulatedScope.prototype.resolve = function (name) {\n            return this.bindings.has(name) ? this.bindings.get(name) : BindingScope$1.missing;\n        };\n        return PopulatedScope;\n    }(BindingScope$1));\n    function formatMetadataMessageChain(chain, advise) {\n        var expanded = expandedMessage(chain.message, chain.context);\n        var nesting = chain.symbol ? \" in '\" + chain.symbol.name + \"'\" : '';\n        var message = \"\" + expanded + nesting;\n        var position = chain.position;\n        var next = chain.next ?\n            formatMetadataMessageChain(chain.next, advise) :\n            advise ? { message: advise } : undefined;\n        return { message: message, position: position, next: next ? [next] : undefined };\n    }\n    function formatMetadataError(e, context) {\n        if (isMetadataError(e)) {\n            // Produce a formatted version of the and leaving enough information in the original error\n            // to recover the formatting information to eventually produce a diagnostic error message.\n            var position = e.position;\n            var chain = {\n                message: \"Error during template compile of '\" + context.name + \"'\",\n                position: position,\n                next: { message: e.message, next: e.chain, context: e.context, symbol: e.symbol }\n            };\n            var advise = e.advise || messageAdvise(e.message, e.context);\n            return formattedError(formatMetadataMessageChain(chain, advise));\n        }\n        return e;\n    }\n\n    /**\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://angular.io/license\n     */\n    var AotSummaryResolver = /** @class */ (function () {\n        function AotSummaryResolver(host, staticSymbolCache) {\n            this.host = host;\n            this.staticSymbolCache = staticSymbolCache;\n            // Note: this will only contain StaticSymbols without members!\n            this.summaryCache = new Map();\n            this.loadedFilePaths = new Map();\n            // Note: this will only contain StaticSymbols without members!\n            this.importAs = new Map();\n            this.knownFileNameToModuleNames = new Map();\n        }\n        AotSummaryResolver.prototype.isLibraryFile = function (filePath) {\n            // Note: We need to strip the .ngfactory. file path,\n            // so this method also works for generated files\n            // (for which host.isSourceFile will always return false).\n            return !this.host.isSourceFile(stripGeneratedFileSuffix(filePath));\n        };\n        AotSummaryResolver.prototype.toSummaryFileName = function (filePath, referringSrcFileName) {\n            return this.host.toSummaryFileName(filePath, referringSrcFileName);\n        };\n        AotSummaryResolver.prototype.fromSummaryFileName = function (fileName, referringLibFileName) {\n            return this.host.fromSummaryFileName(fileName, referringLibFileName);\n        };\n        AotSummaryResolver.prototype.resolveSummary = function (staticSymbol) {\n            var rootSymbol = staticSymbol.members.length ?\n                this.staticSymbolCache.get(staticSymbol.filePath, staticSymbol.name) :\n                staticSymbol;\n            var summary = this.summaryCache.get(rootSymbol);\n            if (!summary) {\n                this._loadSummaryFile(staticSymbol.filePath);\n                summary = this.summaryCache.get(staticSymbol);\n            }\n            return (rootSymbol === staticSymbol && summary) || null;\n        };\n        AotSummaryResolver.prototype.getSymbolsOf = function (filePath) {\n            if (this._loadSummaryFile(filePath)) {\n                return Array.from(this.summaryCache.keys()).filter(function (symbol) { return symbol.filePath === filePath; });\n            }\n            return null;\n        };\n        AotSummaryResolver.prototype.getImportAs = function (staticSymbol) {\n            staticSymbol.assertNoMembers();\n            return this.importAs.get(staticSymbol);\n        };\n        /**\n         * Converts a file path to a module name that can be used as an `import`.\n         */\n        AotSummaryResolver.prototype.getKnownModuleName = function (importedFilePath) {\n            return this.knownFileNameToModuleNames.get(importedFilePath) || null;\n        };\n        AotSummaryResolver.prototype.addSummary = function (summary) {\n            this.summaryCache.set(summary.symbol, summary);\n        };\n        AotSummaryResolver.prototype._loadSummaryFile = function (filePath) {\n            var _this = this;\n            var hasSummary = this.loadedFilePaths.get(filePath);\n            if (hasSummary != null) {\n                return hasSummary;\n            }\n            var json = null;\n            if (this.isLibraryFile(filePath)) {\n                var summaryFilePath = summaryFileName(filePath);\n                try {\n                    json = this.host.loadSummary(summaryFilePath);\n                }\n                catch (e) {\n                    console.error(\"Error loading summary file \" + summaryFilePath);\n                    throw e;\n                }\n            }\n            hasSummary = json != null;\n            this.loadedFilePaths.set(filePath, hasSummary);\n            if (json) {\n                var _a = deserializeSummaries(this.staticSymbolCache, this, filePath, json), moduleName = _a.moduleName, summaries = _a.summaries, importAs = _a.importAs;\n                summaries.forEach(function (summary) { return _this.summaryCache.set(summary.symbol, summary); });\n                if (moduleName) {\n                    this.knownFileNameToModuleNames.set(filePath, moduleName);\n                }\n                importAs.forEach(function (importAs) {\n                    _this.importAs.set(importAs.symbol, importAs.importAs);\n                });\n            }\n            return hasSummary;\n        };\n        return AotSummaryResolver;\n    }());\n\n    /**\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://angular.io/license\n     */\n    function createAotUrlResolver(host) {\n        return {\n            resolve: function (basePath, url) {\n                var filePath = host.resourceNameToFileName(url, basePath);\n                if (!filePath) {\n                    throw syntaxError(\"Couldn't resolve resource \" + url + \" from \" + basePath);\n                }\n                return filePath;\n            }\n        };\n    }\n    /**\n     * Creates a new AotCompiler based on options and a host.\n     */\n    function createAotCompiler(compilerHost, options, errorCollector) {\n        var translations = options.translations || '';\n        var urlResolver = createAotUrlResolver(compilerHost);\n        var symbolCache = new StaticSymbolCache();\n        var summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n        var symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n        var staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n        var htmlParser;\n        if (!!options.enableIvy) {\n            // Ivy handles i18n at the compiler level so we must use a regular parser\n            htmlParser = new HtmlParser();\n        }\n        else {\n            htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n        }\n        var config = new CompilerConfig({\n            defaultEncapsulation: ViewEncapsulation.Emulated,\n            useJit: false,\n            missingTranslation: options.missingTranslation,\n            preserveWhitespaces: options.preserveWhitespaces,\n            strictInjectionParameters: options.strictInjectionParameters,\n        });\n        var normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);\n        var expressionParser = new Parser$1(new Lexer());\n        var elementSchemaRegistry = new DomElementSchemaRegistry();\n        var tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n        var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n        // TODO(vicb): do not pass options.i18nFormat here\n        var viewCompiler = new ViewCompiler(staticReflector);\n        var typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n        var compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n        return { compiler: compiler, reflector: staticReflector };\n    }\n\n    var SummaryResolver = /** @class */ (function () {\n        function SummaryResolver() {\n        }\n        return SummaryResolver;\n    }());\n    var JitSummaryResolver = /** @class */ (function () {\n        function JitSummaryResolver() {\n            this._summaries = new Map();\n        }\n        JitSummaryResolver.prototype.isLibraryFile = function () {\n            return false;\n        };\n        JitSummaryResolver.prototype.toSummaryFileName = function (fileName) {\n            return fileName;\n        };\n        JitSummaryResolver.prototype.fromSummaryFileName = function (fileName) {\n            return fileName;\n        };\n        JitSummaryResolver.prototype.resolveSummary = function (reference) {\n            return this._summaries.get(reference) || null;\n        };\n        JitSummaryResolver.prototype.getSymbolsOf = function () {\n            return [];\n        };\n        JitSummaryResolver.prototype.getImportAs = function (reference) {\n            return reference;\n        };\n        JitSummaryResolver.prototype.getKnownModuleName = function (fileName) {\n            return null;\n        };\n        JitSummaryResolver.prototype.addSummary = function (summary) {\n            this._summaries.set(summary.symbol, summary);\n        };\n        return JitSummaryResolver;\n    }());\n\n    function interpretStatements(statements, reflector) {\n        var ctx = new _ExecutionContext(null, null, null, new Map());\n        var visitor = new StatementInterpreter(reflector);\n        visitor.visitAllStatements(statements, ctx);\n        var result = {};\n        ctx.exports.forEach(function (exportName) {\n            result[exportName] = ctx.vars.get(exportName);\n        });\n        return result;\n    }\n    function _executeFunctionStatements(varNames, varValues, statements, ctx, visitor) {\n        var childCtx = ctx.createChildWihtLocalVars();\n        for (var i = 0; i < varNames.length; i++) {\n            childCtx.vars.set(varNames[i], varValues[i]);\n        }\n        var result = visitor.visitAllStatements(statements, childCtx);\n        return result ? result.value : null;\n    }\n    var _ExecutionContext = /** @class */ (function () {\n        function _ExecutionContext(parent, instance, className, vars) {\n            this.parent = parent;\n            this.instance = instance;\n            this.className = className;\n            this.vars = vars;\n            this.exports = [];\n        }\n        _ExecutionContext.prototype.createChildWihtLocalVars = function () {\n            return new _ExecutionContext(this, this.instance, this.className, new Map());\n        };\n        return _ExecutionContext;\n    }());\n    var ReturnValue = /** @class */ (function () {\n        function ReturnValue(value) {\n            this.value = value;\n        }\n        return ReturnValue;\n    }());\n    function createDynamicClass(_classStmt, _ctx, _visitor) {\n        var propertyDescriptors = {};\n        _classStmt.getters.forEach(function (getter) {\n            // Note: use `function` instead of arrow function to capture `this`\n            propertyDescriptors[getter.name] = {\n                configurable: false,\n                get: function () {\n                    var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);\n                    return _executeFunctionStatements([], [], getter.body, instanceCtx, _visitor);\n                }\n            };\n        });\n        _classStmt.methods.forEach(function (method) {\n            var paramNames = method.params.map(function (param) { return param.name; });\n            // Note: use `function` instead of arrow function to capture `this`\n            propertyDescriptors[method.name] = {\n                writable: false,\n                configurable: false,\n                value: function () {\n                    var args = [];\n                    for (var _i = 0; _i < arguments.length; _i++) {\n                        args[_i] = arguments[_i];\n                    }\n                    var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);\n                    return _executeFunctionStatements(paramNames, args, method.body, instanceCtx, _visitor);\n                }\n            };\n        });\n        var ctorParamNames = _classStmt.constructorMethod.params.map(function (param) { return param.name; });\n        // Note: use `function` instead of arrow function to capture `this`\n        var ctor = function () {\n            var _this = this;\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);\n            _classStmt.fields.forEach(function (field) {\n                _this[field.name] = undefined;\n            });\n            _executeFunctionStatements(ctorParamNames, args, _classStmt.constructorMethod.body, instanceCtx, _visitor);\n        };\n        var superClass = _classStmt.parent ? _classStmt.parent.visitExpression(_visitor, _ctx) : Object;\n        ctor.prototype = Object.create(superClass.prototype, propertyDescriptors);\n        return ctor;\n    }\n    var StatementInterpreter = /** @class */ (function () {\n        function StatementInterpreter(reflector) {\n            this.reflector = reflector;\n        }\n        StatementInterpreter.prototype.debugAst = function (ast) {\n            return debugOutputAstAsTypeScript(ast);\n        };\n        StatementInterpreter.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n            var initialValue = stmt.value ? stmt.value.visitExpression(this, ctx) : undefined;\n            ctx.vars.set(stmt.name, initialValue);\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                ctx.exports.push(stmt.name);\n            }\n            return null;\n        };\n        StatementInterpreter.prototype.visitWriteVarExpr = function (expr, ctx) {\n            var value = expr.value.visitExpression(this, ctx);\n            var currCtx = ctx;\n            while (currCtx != null) {\n                if (currCtx.vars.has(expr.name)) {\n                    currCtx.vars.set(expr.name, value);\n                    return value;\n                }\n                currCtx = currCtx.parent;\n            }\n            throw new Error(\"Not declared variable \" + expr.name);\n        };\n        StatementInterpreter.prototype.visitWrappedNodeExpr = function (ast, ctx) {\n            throw new Error('Cannot interpret a WrappedNodeExpr.');\n        };\n        StatementInterpreter.prototype.visitTypeofExpr = function (ast, ctx) {\n            throw new Error('Cannot interpret a TypeofExpr');\n        };\n        StatementInterpreter.prototype.visitReadVarExpr = function (ast, ctx) {\n            var varName = ast.name;\n            if (ast.builtin != null) {\n                switch (ast.builtin) {\n                    case exports.BuiltinVar.Super:\n                        return Object.getPrototypeOf(ctx.instance);\n                    case exports.BuiltinVar.This:\n                        return ctx.instance;\n                    case exports.BuiltinVar.CatchError:\n                        varName = CATCH_ERROR_VAR$2;\n                        break;\n                    case exports.BuiltinVar.CatchStack:\n                        varName = CATCH_STACK_VAR$2;\n                        break;\n                    default:\n                        throw new Error(\"Unknown builtin variable \" + ast.builtin);\n                }\n            }\n            var currCtx = ctx;\n            while (currCtx != null) {\n                if (currCtx.vars.has(varName)) {\n                    return currCtx.vars.get(varName);\n                }\n                currCtx = currCtx.parent;\n            }\n            throw new Error(\"Not declared variable \" + varName);\n        };\n        StatementInterpreter.prototype.visitWriteKeyExpr = function (expr, ctx) {\n            var receiver = expr.receiver.visitExpression(this, ctx);\n            var index = expr.index.visitExpression(this, ctx);\n            var value = expr.value.visitExpression(this, ctx);\n            receiver[index] = value;\n            return value;\n        };\n        StatementInterpreter.prototype.visitWritePropExpr = function (expr, ctx) {\n            var receiver = expr.receiver.visitExpression(this, ctx);\n            var value = expr.value.visitExpression(this, ctx);\n            receiver[expr.name] = value;\n            return value;\n        };\n        StatementInterpreter.prototype.visitInvokeMethodExpr = function (expr, ctx) {\n            var receiver = expr.receiver.visitExpression(this, ctx);\n            var args = this.visitAllExpressions(expr.args, ctx);\n            var result;\n            if (expr.builtin != null) {\n                switch (expr.builtin) {\n                    case exports.BuiltinMethod.ConcatArray:\n                        result = receiver.concat.apply(receiver, __spreadArray([], __read(args)));\n                        break;\n                    case exports.BuiltinMethod.SubscribeObservable:\n                        result = receiver.subscribe({ next: args[0] });\n                        break;\n                    case exports.BuiltinMethod.Bind:\n                        result = receiver.bind.apply(receiver, __spreadArray([], __read(args)));\n                        break;\n                    default:\n                        throw new Error(\"Unknown builtin method \" + expr.builtin);\n                }\n            }\n            else {\n                result = receiver[expr.name].apply(receiver, args);\n            }\n            return result;\n        };\n        StatementInterpreter.prototype.visitInvokeFunctionExpr = function (stmt, ctx) {\n            var args = this.visitAllExpressions(stmt.args, ctx);\n            var fnExpr = stmt.fn;\n            if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === exports.BuiltinVar.Super) {\n                ctx.instance.constructor.prototype.constructor.apply(ctx.instance, args);\n                return null;\n            }\n            else {\n                var fn = stmt.fn.visitExpression(this, ctx);\n                return fn.apply(null, args);\n            }\n        };\n        StatementInterpreter.prototype.visitTaggedTemplateExpr = function (expr, ctx) {\n            var templateElements = expr.template.elements.map(function (e) { return e.text; });\n            Object.defineProperty(templateElements, 'raw', { value: expr.template.elements.map(function (e) { return e.rawText; }) });\n            var args = this.visitAllExpressions(expr.template.expressions, ctx);\n            args.unshift(templateElements);\n            var tag = expr.tag.visitExpression(this, ctx);\n            return tag.apply(null, args);\n        };\n        StatementInterpreter.prototype.visitReturnStmt = function (stmt, ctx) {\n            return new ReturnValue(stmt.value.visitExpression(this, ctx));\n        };\n        StatementInterpreter.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n            var clazz = createDynamicClass(stmt, ctx, this);\n            ctx.vars.set(stmt.name, clazz);\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                ctx.exports.push(stmt.name);\n            }\n            return null;\n        };\n        StatementInterpreter.prototype.visitExpressionStmt = function (stmt, ctx) {\n            return stmt.expr.visitExpression(this, ctx);\n        };\n        StatementInterpreter.prototype.visitIfStmt = function (stmt, ctx) {\n            var condition = stmt.condition.visitExpression(this, ctx);\n            if (condition) {\n                return this.visitAllStatements(stmt.trueCase, ctx);\n            }\n            else if (stmt.falseCase != null) {\n                return this.visitAllStatements(stmt.falseCase, ctx);\n            }\n            return null;\n        };\n        StatementInterpreter.prototype.visitTryCatchStmt = function (stmt, ctx) {\n            try {\n                return this.visitAllStatements(stmt.bodyStmts, ctx);\n            }\n            catch (e) {\n                var childCtx = ctx.createChildWihtLocalVars();\n                childCtx.vars.set(CATCH_ERROR_VAR$2, e);\n                childCtx.vars.set(CATCH_STACK_VAR$2, e.stack);\n                return this.visitAllStatements(stmt.catchStmts, childCtx);\n            }\n        };\n        StatementInterpreter.prototype.visitThrowStmt = function (stmt, ctx) {\n            throw stmt.error.visitExpression(this, ctx);\n        };\n        StatementInterpreter.prototype.visitInstantiateExpr = function (ast, ctx) {\n            var args = this.visitAllExpressions(ast.args, ctx);\n            var clazz = ast.classExpr.visitExpression(this, ctx);\n            return new (clazz.bind.apply(clazz, __spreadArray([void 0], __read(args))))();\n        };\n        StatementInterpreter.prototype.visitLiteralExpr = function (ast, ctx) {\n            return ast.value;\n        };\n        StatementInterpreter.prototype.visitLocalizedString = function (ast, context) {\n            return null;\n        };\n        StatementInterpreter.prototype.visitExternalExpr = function (ast, ctx) {\n            return this.reflector.resolveExternalReference(ast.value);\n        };\n        StatementInterpreter.prototype.visitConditionalExpr = function (ast, ctx) {\n            if (ast.condition.visitExpression(this, ctx)) {\n                return ast.trueCase.visitExpression(this, ctx);\n            }\n            else if (ast.falseCase != null) {\n                return ast.falseCase.visitExpression(this, ctx);\n            }\n            return null;\n        };\n        StatementInterpreter.prototype.visitNotExpr = function (ast, ctx) {\n            return !ast.condition.visitExpression(this, ctx);\n        };\n        StatementInterpreter.prototype.visitAssertNotNullExpr = function (ast, ctx) {\n            return ast.condition.visitExpression(this, ctx);\n        };\n        StatementInterpreter.prototype.visitCastExpr = function (ast, ctx) {\n            return ast.value.visitExpression(this, ctx);\n        };\n        StatementInterpreter.prototype.visitFunctionExpr = function (ast, ctx) {\n            var paramNames = ast.params.map(function (param) { return param.name; });\n            return _declareFn(paramNames, ast.statements, ctx, this);\n        };\n        StatementInterpreter.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n            var paramNames = stmt.params.map(function (param) { return param.name; });\n            ctx.vars.set(stmt.name, _declareFn(paramNames, stmt.statements, ctx, this));\n            if (stmt.hasModifier(exports.StmtModifier.Exported)) {\n                ctx.exports.push(stmt.name);\n            }\n            return null;\n        };\n        StatementInterpreter.prototype.visitUnaryOperatorExpr = function (ast, ctx) {\n            var _this = this;\n            var rhs = function () { return ast.expr.visitExpression(_this, ctx); };\n            switch (ast.operator) {\n                case exports.UnaryOperator.Plus:\n                    return +rhs();\n                case exports.UnaryOperator.Minus:\n                    return -rhs();\n                default:\n                    throw new Error(\"Unknown operator \" + ast.operator);\n            }\n        };\n        StatementInterpreter.prototype.visitBinaryOperatorExpr = function (ast, ctx) {\n            var _this = this;\n            var _a;\n            var lhs = function () { return ast.lhs.visitExpression(_this, ctx); };\n            var rhs = function () { return ast.rhs.visitExpression(_this, ctx); };\n            switch (ast.operator) {\n                case exports.BinaryOperator.Equals:\n                    return lhs() == rhs();\n                case exports.BinaryOperator.Identical:\n                    return lhs() === rhs();\n                case exports.BinaryOperator.NotEquals:\n                    return lhs() != rhs();\n                case exports.BinaryOperator.NotIdentical:\n                    return lhs() !== rhs();\n                case exports.BinaryOperator.And:\n                    return lhs() && rhs();\n                case exports.BinaryOperator.Or:\n                    return lhs() || rhs();\n                case exports.BinaryOperator.Plus:\n                    return lhs() + rhs();\n                case exports.BinaryOperator.Minus:\n                    return lhs() - rhs();\n                case exports.BinaryOperator.Divide:\n                    return lhs() / rhs();\n                case exports.BinaryOperator.Multiply:\n                    return lhs() * rhs();\n                case exports.BinaryOperator.Modulo:\n                    return lhs() % rhs();\n                case exports.BinaryOperator.Lower:\n                    return lhs() < rhs();\n                case exports.BinaryOperator.LowerEquals:\n                    return lhs() <= rhs();\n                case exports.BinaryOperator.Bigger:\n                    return lhs() > rhs();\n                case exports.BinaryOperator.BiggerEquals:\n                    return lhs() >= rhs();\n                case exports.BinaryOperator.NullishCoalesce:\n                    return (_a = lhs()) !== null && _a !== void 0 ? _a : rhs();\n                default:\n                    throw new Error(\"Unknown operator \" + ast.operator);\n            }\n        };\n        StatementInterpreter.prototype.visitReadPropExpr = function (ast, ctx) {\n            var result;\n            var receiver = ast.receiver.visitExpression(this, ctx);\n            result = receiver[ast.name];\n            return result;\n        };\n        StatementInterpreter.prototype.visitReadKeyExpr = function (ast, ctx) {\n            var receiver = ast.receiver.visitExpression(this, ctx);\n            var prop = ast.index.visitExpression(this, ctx);\n            return receiver[prop];\n        };\n        StatementInterpreter.prototype.visitLiteralArrayExpr = function (ast, ctx) {\n            return this.visitAllExpressions(ast.entries, ctx);\n        };\n        StatementInterpreter.prototype.visitLiteralMapExpr = function (ast, ctx) {\n            var _this = this;\n            var result = {};\n            ast.entries.forEach(function (entry) { return result[entry.key] = entry.value.visitExpression(_this, ctx); });\n            return result;\n        };\n        StatementInterpreter.prototype.visitCommaExpr = function (ast, context) {\n            var values = this.visitAllExpressions(ast.parts, context);\n            return values[values.length - 1];\n        };\n        StatementInterpreter.prototype.visitAllExpressions = function (expressions, ctx) {\n            var _this = this;\n            return expressions.map(function (expr) { return expr.visitExpression(_this, ctx); });\n        };\n        StatementInterpreter.prototype.visitAllStatements = function (statements, ctx) {\n            for (var i = 0; i < statements.length; i++) {\n                var stmt = statements[i];\n                var val = stmt.visitStatement(this, ctx);\n                if (val instanceof ReturnValue) {\n                    return val;\n                }\n            }\n            return null;\n        };\n        return StatementInterpreter;\n    }());\n    function _declareFn(varNames, statements, ctx, visitor) {\n        return function () {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            return _executeFunctionStatements(varNames, args, statements, ctx, visitor);\n        };\n    }\n    var CATCH_ERROR_VAR$2 = 'error';\n    var CATCH_STACK_VAR$2 = 'stack';\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An internal module of the Angular compiler that begins with component types,\n     * extracts templates, and eventually produces a compiled version of the component\n     * ready for linking into an application.\n     *\n     * @security  When compiling templates at runtime, you must ensure that the entire template comes\n     * from a trusted source. Attacker-controlled data introduced by a template could expose your\n     * application to XSS risks.  For more detail, see the [Security Guide](https://g.co/ng/security).\n     */\n    var JitCompiler = /** @class */ (function () {\n        function JitCompiler(_metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _summaryResolver, _reflector, _jitEvaluator, _compilerConfig, _console, getExtraNgModuleProviders) {\n            this._metadataResolver = _metadataResolver;\n            this._templateParser = _templateParser;\n            this._styleCompiler = _styleCompiler;\n            this._viewCompiler = _viewCompiler;\n            this._ngModuleCompiler = _ngModuleCompiler;\n            this._summaryResolver = _summaryResolver;\n            this._reflector = _reflector;\n            this._jitEvaluator = _jitEvaluator;\n            this._compilerConfig = _compilerConfig;\n            this._console = _console;\n            this.getExtraNgModuleProviders = getExtraNgModuleProviders;\n            this._compiledTemplateCache = new Map();\n            this._compiledHostTemplateCache = new Map();\n            this._compiledDirectiveWrapperCache = new Map();\n            this._compiledNgModuleCache = new Map();\n            this._sharedStylesheetCount = 0;\n            this._addedAotSummaries = new Set();\n        }\n        JitCompiler.prototype.compileModuleSync = function (moduleType) {\n            return SyncAsync.assertSync(this._compileModuleAndComponents(moduleType, true));\n        };\n        JitCompiler.prototype.compileModuleAsync = function (moduleType) {\n            return Promise.resolve(this._compileModuleAndComponents(moduleType, false));\n        };\n        JitCompiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {\n            return SyncAsync.assertSync(this._compileModuleAndAllComponents(moduleType, true));\n        };\n        JitCompiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {\n            return Promise.resolve(this._compileModuleAndAllComponents(moduleType, false));\n        };\n        JitCompiler.prototype.getComponentFactory = function (component) {\n            var summary = this._metadataResolver.getDirectiveSummary(component);\n            return summary.componentFactory;\n        };\n        JitCompiler.prototype.loadAotSummaries = function (summaries) {\n            this.clearCache();\n            this._addAotSummaries(summaries);\n        };\n        JitCompiler.prototype._addAotSummaries = function (fn) {\n            if (this._addedAotSummaries.has(fn)) {\n                return;\n            }\n            this._addedAotSummaries.add(fn);\n            var summaries = fn();\n            for (var i = 0; i < summaries.length; i++) {\n                var entry = summaries[i];\n                if (typeof entry === 'function') {\n                    this._addAotSummaries(entry);\n                }\n                else {\n                    var summary = entry;\n                    this._summaryResolver.addSummary({ symbol: summary.type.reference, metadata: null, type: summary });\n                }\n            }\n        };\n        JitCompiler.prototype.hasAotSummary = function (ref) {\n            return !!this._summaryResolver.resolveSummary(ref);\n        };\n        JitCompiler.prototype._filterJitIdentifiers = function (ids) {\n            var _this = this;\n            return ids.map(function (mod) { return mod.reference; }).filter(function (ref) { return !_this.hasAotSummary(ref); });\n        };\n        JitCompiler.prototype._compileModuleAndComponents = function (moduleType, isSync) {\n            var _this = this;\n            return SyncAsync.then(this._loadModules(moduleType, isSync), function () {\n                _this._compileComponents(moduleType, null);\n                return _this._compileModule(moduleType);\n            });\n        };\n        JitCompiler.prototype._compileModuleAndAllComponents = function (moduleType, isSync) {\n            var _this = this;\n            return SyncAsync.then(this._loadModules(moduleType, isSync), function () {\n                var componentFactories = [];\n                _this._compileComponents(moduleType, componentFactories);\n                return {\n                    ngModuleFactory: _this._compileModule(moduleType),\n                    componentFactories: componentFactories\n                };\n            });\n        };\n        JitCompiler.prototype._loadModules = function (mainModule, isSync) {\n            var _this = this;\n            var loading = [];\n            var mainNgModule = this._metadataResolver.getNgModuleMetadata(mainModule);\n            // Note: for runtime compilation, we want to transitively compile all modules,\n            // so we also need to load the declared directives / pipes for all nested modules.\n            this._filterJitIdentifiers(mainNgModule.transitiveModule.modules).forEach(function (nestedNgModule) {\n                // getNgModuleMetadata only returns null if the value passed in is not an NgModule\n                var moduleMeta = _this._metadataResolver.getNgModuleMetadata(nestedNgModule);\n                _this._filterJitIdentifiers(moduleMeta.declaredDirectives).forEach(function (ref) {\n                    var promise = _this._metadataResolver.loadDirectiveMetadata(moduleMeta.type.reference, ref, isSync);\n                    if (promise) {\n                        loading.push(promise);\n                    }\n                });\n                _this._filterJitIdentifiers(moduleMeta.declaredPipes)\n                    .forEach(function (ref) { return _this._metadataResolver.getOrLoadPipeMetadata(ref); });\n            });\n            return SyncAsync.all(loading);\n        };\n        JitCompiler.prototype._compileModule = function (moduleType) {\n            var ngModuleFactory = this._compiledNgModuleCache.get(moduleType);\n            if (!ngModuleFactory) {\n                var moduleMeta = this._metadataResolver.getNgModuleMetadata(moduleType);\n                // Always provide a bound Compiler\n                var extraProviders = this.getExtraNgModuleProviders(moduleMeta.type.reference);\n                var outputCtx = createOutputContext();\n                var compileResult = this._ngModuleCompiler.compile(outputCtx, moduleMeta, extraProviders);\n                ngModuleFactory = this._interpretOrJit(ngModuleJitUrl(moduleMeta), outputCtx.statements)[compileResult.ngModuleFactoryVar];\n                this._compiledNgModuleCache.set(moduleMeta.type.reference, ngModuleFactory);\n            }\n            return ngModuleFactory;\n        };\n        /**\n         * @internal\n         */\n        JitCompiler.prototype._compileComponents = function (mainModule, allComponentFactories) {\n            var _this = this;\n            var ngModule = this._metadataResolver.getNgModuleMetadata(mainModule);\n            var moduleByJitDirective = new Map();\n            var templates = new Set();\n            var transJitModules = this._filterJitIdentifiers(ngModule.transitiveModule.modules);\n            transJitModules.forEach(function (localMod) {\n                var localModuleMeta = _this._metadataResolver.getNgModuleMetadata(localMod);\n                _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {\n                    moduleByJitDirective.set(dirRef, localModuleMeta);\n                    var dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);\n                    if (dirMeta.isComponent) {\n                        templates.add(_this._createCompiledTemplate(dirMeta, localModuleMeta));\n                        if (allComponentFactories) {\n                            var template = _this._createCompiledHostTemplate(dirMeta.type.reference, localModuleMeta);\n                            templates.add(template);\n                            allComponentFactories.push(dirMeta.componentFactory);\n                        }\n                    }\n                });\n            });\n            transJitModules.forEach(function (localMod) {\n                var localModuleMeta = _this._metadataResolver.getNgModuleMetadata(localMod);\n                _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {\n                    var dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);\n                    if (dirMeta.isComponent) {\n                        dirMeta.entryComponents.forEach(function (entryComponentType) {\n                            var moduleMeta = moduleByJitDirective.get(entryComponentType.componentType);\n                            templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));\n                        });\n                    }\n                });\n                localModuleMeta.entryComponents.forEach(function (entryComponentType) {\n                    if (!_this.hasAotSummary(entryComponentType.componentType)) {\n                        var moduleMeta = moduleByJitDirective.get(entryComponentType.componentType);\n                        templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));\n                    }\n                });\n            });\n            templates.forEach(function (template) { return _this._compileTemplate(template); });\n        };\n        JitCompiler.prototype.clearCacheFor = function (type) {\n            this._compiledNgModuleCache.delete(type);\n            this._metadataResolver.clearCacheFor(type);\n            this._compiledHostTemplateCache.delete(type);\n            var compiledTemplate = this._compiledTemplateCache.get(type);\n            if (compiledTemplate) {\n                this._compiledTemplateCache.delete(type);\n            }\n        };\n        JitCompiler.prototype.clearCache = function () {\n            // Note: don't clear the _addedAotSummaries, as they don't change!\n            this._metadataResolver.clearCache();\n            this._compiledTemplateCache.clear();\n            this._compiledHostTemplateCache.clear();\n            this._compiledNgModuleCache.clear();\n        };\n        JitCompiler.prototype._createCompiledHostTemplate = function (compType, ngModule) {\n            if (!ngModule) {\n                throw new Error(\"Component \" + stringify(compType) + \" is not part of any NgModule or the module has not been imported into your module.\");\n            }\n            var compiledTemplate = this._compiledHostTemplateCache.get(compType);\n            if (!compiledTemplate) {\n                var compMeta = this._metadataResolver.getDirectiveMetadata(compType);\n                assertComponent(compMeta);\n                var hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta, compMeta.componentFactory.viewDefFactory);\n                compiledTemplate =\n                    new CompiledTemplate(true, compMeta.type, hostMeta, ngModule, [compMeta.type]);\n                this._compiledHostTemplateCache.set(compType, compiledTemplate);\n            }\n            return compiledTemplate;\n        };\n        JitCompiler.prototype._createCompiledTemplate = function (compMeta, ngModule) {\n            var compiledTemplate = this._compiledTemplateCache.get(compMeta.type.reference);\n            if (!compiledTemplate) {\n                assertComponent(compMeta);\n                compiledTemplate = new CompiledTemplate(false, compMeta.type, compMeta, ngModule, ngModule.transitiveModule.directives);\n                this._compiledTemplateCache.set(compMeta.type.reference, compiledTemplate);\n            }\n            return compiledTemplate;\n        };\n        JitCompiler.prototype._compileTemplate = function (template) {\n            var _this = this;\n            if (template.isCompiled) {\n                return;\n            }\n            var compMeta = template.compMeta;\n            var externalStylesheetsByModuleUrl = new Map();\n            var outputContext = createOutputContext();\n            var componentStylesheet = this._styleCompiler.compileComponent(outputContext, compMeta);\n            compMeta.template.externalStylesheets.forEach(function (stylesheetMeta) {\n                var compiledStylesheet = _this._styleCompiler.compileStyles(createOutputContext(), compMeta, stylesheetMeta);\n                externalStylesheetsByModuleUrl.set(stylesheetMeta.moduleUrl, compiledStylesheet);\n            });\n            this._resolveStylesCompileResult(componentStylesheet, externalStylesheetsByModuleUrl);\n            var pipes = template.ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });\n            var _a = this._parseTemplate(compMeta, template.ngModule, template.directives), parsedTemplate = _a.template, usedPipes = _a.pipes;\n            var compileResult = this._viewCompiler.compileComponent(outputContext, compMeta, parsedTemplate, variable(componentStylesheet.stylesVar), usedPipes);\n            var evalResult = this._interpretOrJit(templateJitUrl(template.ngModule.type, template.compMeta), outputContext.statements);\n            var viewClass = evalResult[compileResult.viewClassVar];\n            var rendererType = evalResult[compileResult.rendererTypeVar];\n            template.compiled(viewClass, rendererType);\n        };\n        JitCompiler.prototype._parseTemplate = function (compMeta, ngModule, directiveIdentifiers) {\n            var _this = this;\n            // Note: ! is ok here as components always have a template.\n            var preserveWhitespaces = compMeta.template.preserveWhitespaces;\n            var directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });\n            var pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });\n            return this._templateParser.parse(compMeta, compMeta.template.htmlAst, directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, compMeta.template), preserveWhitespaces);\n        };\n        JitCompiler.prototype._resolveStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {\n            var _this = this;\n            result.dependencies.forEach(function (dep, i) {\n                var nestedCompileResult = externalStylesheetsByModuleUrl.get(dep.moduleUrl);\n                var nestedStylesArr = _this._resolveAndEvalStylesCompileResult(nestedCompileResult, externalStylesheetsByModuleUrl);\n                dep.setValue(nestedStylesArr);\n            });\n        };\n        JitCompiler.prototype._resolveAndEvalStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {\n            this._resolveStylesCompileResult(result, externalStylesheetsByModuleUrl);\n            return this._interpretOrJit(sharedStylesheetJitUrl(result.meta, this._sharedStylesheetCount++), result.outputCtx.statements)[result.stylesVar];\n        };\n        JitCompiler.prototype._interpretOrJit = function (sourceUrl, statements) {\n            if (!this._compilerConfig.useJit) {\n                return interpretStatements(statements, this._reflector);\n            }\n            else {\n                return this._jitEvaluator.evaluateStatements(sourceUrl, statements, this._reflector, this._compilerConfig.jitDevMode);\n            }\n        };\n        return JitCompiler;\n    }());\n    var CompiledTemplate = /** @class */ (function () {\n        function CompiledTemplate(isHost, compType, compMeta, ngModule, directives) {\n            this.isHost = isHost;\n            this.compType = compType;\n            this.compMeta = compMeta;\n            this.ngModule = ngModule;\n            this.directives = directives;\n            this._viewClass = null;\n            this.isCompiled = false;\n        }\n        CompiledTemplate.prototype.compiled = function (viewClass, rendererType) {\n            this._viewClass = viewClass;\n            this.compMeta.componentViewType.setDelegate(viewClass);\n            for (var prop in rendererType) {\n                this.compMeta.rendererType[prop] = rendererType[prop];\n            }\n            this.isCompiled = true;\n        };\n        return CompiledTemplate;\n    }());\n    function assertComponent(meta) {\n        if (!meta.isComponent) {\n            throw new Error(\"Could not compile '\" + identifierName(meta.type) + \"' because it is not a component.\");\n        }\n    }\n    function createOutputContext() {\n        var importExpr$1 = function (symbol) { return importExpr({ name: identifierName(symbol), moduleName: null, runtime: symbol }); };\n        return { statements: [], genFilePath: '', importExpr: importExpr$1, constantPool: new ConstantPool() };\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Provides access to reflection data about symbols that the compiler needs.\n     */\n    var CompileReflector = /** @class */ (function () {\n        function CompileReflector() {\n        }\n        return CompileReflector;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Create a {@link UrlResolver} with no package prefix.\n     */\n    function createUrlResolverWithoutPackagePrefix() {\n        return new UrlResolver();\n    }\n    function createOfflineCompileUrlResolver() {\n        return new UrlResolver('.');\n    }\n    var UrlResolver = /** @class */ (function () {\n        function UrlResolverImpl(_packagePrefix) {\n            if (_packagePrefix === void 0) { _packagePrefix = null; }\n            this._packagePrefix = _packagePrefix;\n        }\n        /**\n         * Resolves the `url` given the `baseUrl`:\n         * - when the `url` is null, the `baseUrl` is returned,\n         * - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of\n         * `baseUrl` and `url`,\n         * - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is\n         * returned as is (ignoring the `baseUrl`)\n         */\n        UrlResolverImpl.prototype.resolve = function (baseUrl, url) {\n            var resolvedUrl = url;\n            if (baseUrl != null && baseUrl.length > 0) {\n                resolvedUrl = _resolveUrl(baseUrl, resolvedUrl);\n            }\n            var resolvedParts = _split(resolvedUrl);\n            var prefix = this._packagePrefix;\n            if (prefix != null && resolvedParts != null &&\n                resolvedParts[_ComponentIndex.Scheme] == 'package') {\n                var path = resolvedParts[_ComponentIndex.Path];\n                prefix = prefix.replace(/\\/+$/, '');\n                path = path.replace(/^\\/+/, '');\n                return prefix + \"/\" + path;\n            }\n            return resolvedUrl;\n        };\n        return UrlResolverImpl;\n    }());\n    /**\n     * Extract the scheme of a URL.\n     */\n    function getUrlScheme(url) {\n        var match = _split(url);\n        return (match && match[_ComponentIndex.Scheme]) || '';\n    }\n    // The code below is adapted from Traceur:\n    // https://github.com/google/traceur-compiler/blob/9511c1dafa972bf0de1202a8a863bad02f0f95a8/src/runtime/url.js\n    /**\n     * Builds a URI string from already-encoded parts.\n     *\n     * No encoding is performed.  Any component may be omitted as either null or\n     * undefined.\n     *\n     * @param opt_scheme The scheme such as 'http'.\n     * @param opt_userInfo The user name before the '@'.\n     * @param opt_domain The domain such as 'www.google.com', already\n     *     URI-encoded.\n     * @param opt_port The port number.\n     * @param opt_path The path, already URI-encoded.  If it is not\n     *     empty, it must begin with a slash.\n     * @param opt_queryData The URI-encoded query data.\n     * @param opt_fragment The URI-encoded fragment identifier.\n     * @return The fully combined URI.\n     */\n    function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {\n        var out = [];\n        if (opt_scheme != null) {\n            out.push(opt_scheme + ':');\n        }\n        if (opt_domain != null) {\n            out.push('//');\n            if (opt_userInfo != null) {\n                out.push(opt_userInfo + '@');\n            }\n            out.push(opt_domain);\n            if (opt_port != null) {\n                out.push(':' + opt_port);\n            }\n        }\n        if (opt_path != null) {\n            out.push(opt_path);\n        }\n        if (opt_queryData != null) {\n            out.push('?' + opt_queryData);\n        }\n        if (opt_fragment != null) {\n            out.push('#' + opt_fragment);\n        }\n        return out.join('');\n    }\n    /**\n     * A regular expression for breaking a URI into its component parts.\n     *\n     * {@link https://tools.ietf.org/html/rfc3986#appendix-B} says\n     * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n     * disambiguation method used by POSIX regular expressions, it is natural and\n     * commonplace to use a regular expression for parsing the potential five\n     * components of a URI reference.\n     *\n     * The following line is the regular expression for breaking-down a\n     * well-formed URI reference into its components.\n     *\n     * <pre>\n     * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n     *  12            3  4          5       6  7        8 9\n     * </pre>\n     *\n     * The numbers in the second line above are only to assist readability; they\n     * indicate the reference points for each subexpression (i.e., each paired\n     * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n     * For example, matching the above expression to\n     * <pre>\n     *     http://www.ics.uci.edu/pub/ietf/uri/#Related\n     * </pre>\n     * results in the following subexpression matches:\n     * <pre>\n     *    $1 = http:\n     *    $2 = http\n     *    $3 = //www.ics.uci.edu\n     *    $4 = www.ics.uci.edu\n     *    $5 = /pub/ietf/uri/\n     *    $6 = <undefined>\n     *    $7 = <undefined>\n     *    $8 = #Related\n     *    $9 = Related\n     * </pre>\n     * where <undefined> indicates that the component is not present, as is the\n     * case for the query component in the above example. Therefore, we can\n     * determine the value of the five components as\n     * <pre>\n     *    scheme    = $2\n     *    authority = $4\n     *    path      = $5\n     *    query     = $7\n     *    fragment  = $9\n     * </pre>\n     *\n     * The regular expression has been modified slightly to expose the\n     * userInfo, domain, and port separately from the authority.\n     * The modified version yields\n     * <pre>\n     *    $1 = http              scheme\n     *    $2 = <undefined>       userInfo -\\\n     *    $3 = www.ics.uci.edu   domain     | authority\n     *    $4 = <undefined>       port     -/\n     *    $5 = /pub/ietf/uri/    path\n     *    $6 = <undefined>       query without ?\n     *    $7 = Related           fragment without #\n     * </pre>\n     * @internal\n     */\n    var _splitRe = new RegExp('^' +\n        '(?:' +\n        '([^:/?#.]+)' + // scheme - ignore special characters\n        // used by other URL parts such as :,\n        // ?, /, #, and .\n        ':)?' +\n        '(?://' +\n        '(?:([^/?#]*)@)?' + // userInfo\n        '([\\\\w\\\\d\\\\-\\\\u0100-\\\\uffff.%]*)' + // domain - restrict to letters,\n        // digits, dashes, dots, percent\n        // escapes, and unicode characters.\n        '(?::([0-9]+))?' + // port\n        ')?' +\n        '([^?#]+)?' + // path\n        '(?:\\\\?([^#]*))?' + // query\n        '(?:#(.*))?' + // fragment\n        '$');\n    /**\n     * The index of each URI component in the return value of goog.uri.utils.split.\n     * @enum {number}\n     */\n    var _ComponentIndex;\n    (function (_ComponentIndex) {\n        _ComponentIndex[_ComponentIndex[\"Scheme\"] = 1] = \"Scheme\";\n        _ComponentIndex[_ComponentIndex[\"UserInfo\"] = 2] = \"UserInfo\";\n        _ComponentIndex[_ComponentIndex[\"Domain\"] = 3] = \"Domain\";\n        _ComponentIndex[_ComponentIndex[\"Port\"] = 4] = \"Port\";\n        _ComponentIndex[_ComponentIndex[\"Path\"] = 5] = \"Path\";\n        _ComponentIndex[_ComponentIndex[\"QueryData\"] = 6] = \"QueryData\";\n        _ComponentIndex[_ComponentIndex[\"Fragment\"] = 7] = \"Fragment\";\n    })(_ComponentIndex || (_ComponentIndex = {}));\n    /**\n     * Splits a URI into its component parts.\n     *\n     * Each component can be accessed via the component indices; for example:\n     * <pre>\n     * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];\n     * </pre>\n     *\n     * @param uri The URI string to examine.\n     * @return Each component still URI-encoded.\n     *     Each component that is present will contain the encoded value, whereas\n     *     components that are not present will be undefined or empty, depending\n     *     on the browser's regular expression implementation.  Never null, since\n     *     arbitrary strings may still look like path names.\n     */\n    function _split(uri) {\n        return uri.match(_splitRe);\n    }\n    /**\n     * Removes dot segments in given path component, as described in\n     * RFC 3986, section 5.2.4.\n     *\n     * @param path A non-empty path component.\n     * @return Path component with removed dot segments.\n     */\n    function _removeDotSegments(path) {\n        if (path == '/')\n            return '/';\n        var leadingSlash = path[0] == '/' ? '/' : '';\n        var trailingSlash = path[path.length - 1] === '/' ? '/' : '';\n        var segments = path.split('/');\n        var out = [];\n        var up = 0;\n        for (var pos = 0; pos < segments.length; pos++) {\n            var segment = segments[pos];\n            switch (segment) {\n                case '':\n                case '.':\n                    break;\n                case '..':\n                    if (out.length > 0) {\n                        out.pop();\n                    }\n                    else {\n                        up++;\n                    }\n                    break;\n                default:\n                    out.push(segment);\n            }\n        }\n        if (leadingSlash == '') {\n            while (up-- > 0) {\n                out.unshift('..');\n            }\n            if (out.length === 0)\n                out.push('.');\n        }\n        return leadingSlash + out.join('/') + trailingSlash;\n    }\n    /**\n     * Takes an array of the parts from split and canonicalizes the path part\n     * and then joins all the parts.\n     */\n    function _joinAndCanonicalizePath(parts) {\n        var path = parts[_ComponentIndex.Path];\n        path = path == null ? '' : _removeDotSegments(path);\n        parts[_ComponentIndex.Path] = path;\n        return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n    }\n    /**\n     * Resolves a URL.\n     * @param base The URL acting as the base URL.\n     * @param to The URL to resolve.\n     */\n    function _resolveUrl(base, url) {\n        var parts = _split(encodeURI(url));\n        var baseParts = _split(base);\n        if (parts[_ComponentIndex.Scheme] != null) {\n            return _joinAndCanonicalizePath(parts);\n        }\n        else {\n            parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme];\n        }\n        for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) {\n            if (parts[i] == null) {\n                parts[i] = baseParts[i];\n            }\n        }\n        if (parts[_ComponentIndex.Path][0] == '/') {\n            return _joinAndCanonicalizePath(parts);\n        }\n        var path = baseParts[_ComponentIndex.Path];\n        if (path == null)\n            path = '/';\n        var index = path.lastIndexOf('/');\n        path = path.substring(0, index + 1) + parts[_ComponentIndex.Path];\n        parts[_ComponentIndex.Path] = path;\n        return _joinAndCanonicalizePath(parts);\n    }\n\n    var Extractor = /** @class */ (function () {\n        function Extractor(host, staticSymbolResolver, messageBundle, metadataResolver) {\n            this.host = host;\n            this.staticSymbolResolver = staticSymbolResolver;\n            this.messageBundle = messageBundle;\n            this.metadataResolver = metadataResolver;\n        }\n        Extractor.prototype.extract = function (rootFiles) {\n            var _this = this;\n            var _a = analyzeAndValidateNgModules(rootFiles, this.host, this.staticSymbolResolver, this.metadataResolver), files = _a.files, ngModules = _a.ngModules;\n            return Promise\n                .all(ngModules.map(function (ngModule) { return _this.metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))\n                .then(function () {\n                var errors = [];\n                files.forEach(function (file) {\n                    var compMetas = [];\n                    file.directives.forEach(function (directiveType) {\n                        var dirMeta = _this.metadataResolver.getDirectiveMetadata(directiveType);\n                        if (dirMeta && dirMeta.isComponent) {\n                            compMetas.push(dirMeta);\n                        }\n                    });\n                    compMetas.forEach(function (compMeta) {\n                        var html = compMeta.template.template;\n                        // Template URL points to either an HTML or TS file depending on\n                        // whether the file is used with `templateUrl:` or `template:`,\n                        // respectively.\n                        var templateUrl = compMeta.template.templateUrl;\n                        var interpolationConfig = InterpolationConfig.fromArray(compMeta.template.interpolation);\n                        errors.push.apply(errors, __spreadArray([], __read(_this.messageBundle.updateFromTemplate(html, templateUrl, interpolationConfig))));\n                    });\n                });\n                if (errors.length) {\n                    throw new Error(errors.map(function (e) { return e.toString(); }).join('\\n'));\n                }\n                return _this.messageBundle;\n            });\n        };\n        Extractor.create = function (host, locale) {\n            var htmlParser = new HtmlParser();\n            var urlResolver = createAotUrlResolver(host);\n            var symbolCache = new StaticSymbolCache();\n            var summaryResolver = new AotSummaryResolver(host, symbolCache);\n            var staticSymbolResolver = new StaticSymbolResolver(host, symbolCache, summaryResolver);\n            var staticReflector = new StaticReflector(summaryResolver, staticSymbolResolver);\n            var config = new CompilerConfig({ defaultEncapsulation: ViewEncapsulation.Emulated, useJit: false });\n            var normalizer = new DirectiveNormalizer({ get: function (url) { return host.loadResource(url); } }, urlResolver, htmlParser, config);\n            var elementSchemaRegistry = new DomElementSchemaRegistry();\n            var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector);\n            // TODO(vicb): implicit tags & attributes\n            var messageBundle = new MessageBundle(htmlParser, [], {}, locale);\n            var extractor = new Extractor(host, staticSymbolResolver, messageBundle, resolver);\n            return { extractor: extractor, staticReflector: staticReflector };\n        };\n        return Extractor;\n    }());\n\n    /**\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://angular.io/license\n     */\n\n    var FactoryTarget;\n    (function (FactoryTarget) {\n        FactoryTarget[FactoryTarget[\"Directive\"] = 0] = \"Directive\";\n        FactoryTarget[FactoryTarget[\"Component\"] = 1] = \"Component\";\n        FactoryTarget[FactoryTarget[\"Injectable\"] = 2] = \"Injectable\";\n        FactoryTarget[FactoryTarget[\"Pipe\"] = 3] = \"Pipe\";\n        FactoryTarget[FactoryTarget[\"NgModule\"] = 4] = \"NgModule\";\n    })(FactoryTarget || (FactoryTarget = {}));\n\n    /**\n     * Processes `Target`s with a given set of directives and performs a binding operation, which\n     * returns an object similar to TypeScript's `ts.TypeChecker` that contains knowledge about the\n     * target.\n     */\n    var R3TargetBinder = /** @class */ (function () {\n        function R3TargetBinder(directiveMatcher) {\n            this.directiveMatcher = directiveMatcher;\n        }\n        /**\n         * Perform a binding operation on the given `Target` and return a `BoundTarget` which contains\n         * metadata about the types referenced in the template.\n         */\n        R3TargetBinder.prototype.bind = function (target) {\n            if (!target.template) {\n                // TODO(alxhub): handle targets which contain things like HostBindings, etc.\n                throw new Error('Binding without a template not yet supported');\n            }\n            // First, parse the template into a `Scope` structure. This operation captures the syntactic\n            // scopes in the template and makes them available for later use.\n            var scope = Scope.apply(target.template);\n            // Use the `Scope` to extract the entities present at every level of the template.\n            var templateEntities = extractTemplateEntities(scope);\n            // Next, perform directive matching on the template using the `DirectiveBinder`. This returns:\n            //   - directives: Map of nodes (elements & ng-templates) to the directives on them.\n            //   - bindings: Map of inputs, outputs, and attributes to the directive/element that claims\n            //     them. TODO(alxhub): handle multiple directives claiming an input/output/etc.\n            //   - references: Map of #references to their targets.\n            var _b = DirectiveBinder.apply(target.template, this.directiveMatcher), directives = _b.directives, bindings = _b.bindings, references = _b.references;\n            // Finally, run the TemplateBinder to bind references, variables, and other entities within the\n            // template. This extracts all the metadata that doesn't depend on directive matching.\n            var _c = TemplateBinder.applyWithScope(target.template, scope), expressions = _c.expressions, symbols = _c.symbols, nestingLevel = _c.nestingLevel, usedPipes = _c.usedPipes;\n            return new R3BoundTarget(target, directives, bindings, references, expressions, symbols, nestingLevel, templateEntities, usedPipes);\n        };\n        return R3TargetBinder;\n    }());\n    /**\n     * Represents a binding scope within a template.\n     *\n     * Any variables, references, or other named entities declared within the template will\n     * be captured and available by name in `namedEntities`. Additionally, child templates will\n     * be analyzed and have their child `Scope`s available in `childScopes`.\n     */\n    var Scope = /** @class */ (function () {\n        function Scope(parentScope, template) {\n            this.parentScope = parentScope;\n            this.template = template;\n            /**\n             * Named members of the `Scope`, such as `Reference`s or `Variable`s.\n             */\n            this.namedEntities = new Map();\n            /**\n             * Child `Scope`s for immediately nested `Template`s.\n             */\n            this.childScopes = new Map();\n        }\n        Scope.newRootScope = function () {\n            return new Scope(null, null);\n        };\n        /**\n         * Process a template (either as a `Template` sub-template with variables, or a plain array of\n         * template `Node`s) and construct its `Scope`.\n         */\n        Scope.apply = function (template) {\n            var scope = Scope.newRootScope();\n            scope.ingest(template);\n            return scope;\n        };\n        /**\n         * Internal method to process the template and populate the `Scope`.\n         */\n        Scope.prototype.ingest = function (template) {\n            var _this = this;\n            if (template instanceof Template) {\n                // Variables on an <ng-template> are defined in the inner scope.\n                template.variables.forEach(function (node) { return _this.visitVariable(node); });\n                // Process the nodes of the template.\n                template.children.forEach(function (node) { return node.visit(_this); });\n            }\n            else {\n                // No overarching `Template` instance, so process the nodes directly.\n                template.forEach(function (node) { return node.visit(_this); });\n            }\n        };\n        Scope.prototype.visitElement = function (element) {\n            var _this = this;\n            // `Element`s in the template may have `Reference`s which are captured in the scope.\n            element.references.forEach(function (node) { return _this.visitReference(node); });\n            // Recurse into the `Element`'s children.\n            element.children.forEach(function (node) { return node.visit(_this); });\n        };\n        Scope.prototype.visitTemplate = function (template) {\n            var _this = this;\n            // References on a <ng-template> are defined in the outer scope, so capture them before\n            // processing the template's child scope.\n            template.references.forEach(function (node) { return _this.visitReference(node); });\n            // Next, create an inner scope and process the template within it.\n            var scope = new Scope(this, template);\n            scope.ingest(template);\n            this.childScopes.set(template, scope);\n        };\n        Scope.prototype.visitVariable = function (variable) {\n            // Declare the variable if it's not already.\n            this.maybeDeclare(variable);\n        };\n        Scope.prototype.visitReference = function (reference) {\n            // Declare the variable if it's not already.\n            this.maybeDeclare(reference);\n        };\n        // Unused visitors.\n        Scope.prototype.visitContent = function (content) { };\n        Scope.prototype.visitBoundAttribute = function (attr) { };\n        Scope.prototype.visitBoundEvent = function (event) { };\n        Scope.prototype.visitBoundText = function (text) { };\n        Scope.prototype.visitText = function (text) { };\n        Scope.prototype.visitTextAttribute = function (attr) { };\n        Scope.prototype.visitIcu = function (icu) { };\n        Scope.prototype.maybeDeclare = function (thing) {\n            // Declare something with a name, as long as that name isn't taken.\n            if (!this.namedEntities.has(thing.name)) {\n                this.namedEntities.set(thing.name, thing);\n            }\n        };\n        /**\n         * Look up a variable within this `Scope`.\n         *\n         * This can recurse into a parent `Scope` if it's available.\n         */\n        Scope.prototype.lookup = function (name) {\n            if (this.namedEntities.has(name)) {\n                // Found in the local scope.\n                return this.namedEntities.get(name);\n            }\n            else if (this.parentScope !== null) {\n                // Not in the local scope, but there's a parent scope so check there.\n                return this.parentScope.lookup(name);\n            }\n            else {\n                // At the top level and it wasn't found.\n                return null;\n            }\n        };\n        /**\n         * Get the child scope for a `Template`.\n         *\n         * This should always be defined.\n         */\n        Scope.prototype.getChildScope = function (template) {\n            var res = this.childScopes.get(template);\n            if (res === undefined) {\n                throw new Error(\"Assertion error: child scope for \" + template + \" not found\");\n            }\n            return res;\n        };\n        return Scope;\n    }());\n    /**\n     * Processes a template and matches directives on nodes (elements and templates).\n     *\n     * Usually used via the static `apply()` method.\n     */\n    var DirectiveBinder = /** @class */ (function () {\n        function DirectiveBinder(matcher, directives, bindings, references) {\n            this.matcher = matcher;\n            this.directives = directives;\n            this.bindings = bindings;\n            this.references = references;\n        }\n        /**\n         * Process a template (list of `Node`s) and perform directive matching against each node.\n         *\n         * @param template the list of template `Node`s to match (recursively).\n         * @param selectorMatcher a `SelectorMatcher` containing the directives that are in scope for\n         * this template.\n         * @returns three maps which contain information about directives in the template: the\n         * `directives` map which lists directives matched on each node, the `bindings` map which\n         * indicates which directives claimed which bindings (inputs, outputs, etc), and the `references`\n         * map which resolves #references (`Reference`s) within the template to the named directive or\n         * template node.\n         */\n        DirectiveBinder.apply = function (template, selectorMatcher) {\n            var directives = new Map();\n            var bindings = new Map();\n            var references = new Map();\n            var matcher = new DirectiveBinder(selectorMatcher, directives, bindings, references);\n            matcher.ingest(template);\n            return { directives: directives, bindings: bindings, references: references };\n        };\n        DirectiveBinder.prototype.ingest = function (template) {\n            var _this = this;\n            template.forEach(function (node) { return node.visit(_this); });\n        };\n        DirectiveBinder.prototype.visitElement = function (element) {\n            this.visitElementOrTemplate(element.name, element);\n        };\n        DirectiveBinder.prototype.visitTemplate = function (template) {\n            this.visitElementOrTemplate('ng-template', template);\n        };\n        DirectiveBinder.prototype.visitElementOrTemplate = function (elementName, node) {\n            var _this = this;\n            // First, determine the HTML shape of the node for the purpose of directive matching.\n            // Do this by building up a `CssSelector` for the node.\n            var cssSelector = createCssSelector(elementName, getAttrsForDirectiveMatching(node));\n            // Next, use the `SelectorMatcher` to get the list of directives on the node.\n            var directives = [];\n            this.matcher.match(cssSelector, function (_, directive) { return directives.push(directive); });\n            if (directives.length > 0) {\n                this.directives.set(node, directives);\n            }\n            // Resolve any references that are created on this node.\n            node.references.forEach(function (ref) {\n                var dirTarget = null;\n                // If the reference expression is empty, then it matches the \"primary\" directive on the node\n                // (if there is one). Otherwise it matches the host node itself (either an element or\n                // <ng-template> node).\n                if (ref.value.trim() === '') {\n                    // This could be a reference to a component if there is one.\n                    dirTarget = directives.find(function (dir) { return dir.isComponent; }) || null;\n                }\n                else {\n                    // This should be a reference to a directive exported via exportAs.\n                    dirTarget =\n                        directives.find(function (dir) { return dir.exportAs !== null && dir.exportAs.some(function (value) { return value === ref.value; }); }) ||\n                            null;\n                    // Check if a matching directive was found.\n                    if (dirTarget === null) {\n                        // No matching directive was found - this reference points to an unknown target. Leave it\n                        // unmapped.\n                        return;\n                    }\n                }\n                if (dirTarget !== null) {\n                    // This reference points to a directive.\n                    _this.references.set(ref, { directive: dirTarget, node: node });\n                }\n                else {\n                    // This reference points to the node itself.\n                    _this.references.set(ref, node);\n                }\n            });\n            var setAttributeBinding = function (attribute, ioType) {\n                var dir = directives.find(function (dir) { return dir[ioType].hasBindingPropertyName(attribute.name); });\n                var binding = dir !== undefined ? dir : node;\n                _this.bindings.set(attribute, binding);\n            };\n            // Node inputs (bound attributes) and text attributes can be bound to an\n            // input on a directive.\n            node.inputs.forEach(function (input) { return setAttributeBinding(input, 'inputs'); });\n            node.attributes.forEach(function (attr) { return setAttributeBinding(attr, 'inputs'); });\n            if (node instanceof Template) {\n                node.templateAttrs.forEach(function (attr) { return setAttributeBinding(attr, 'inputs'); });\n            }\n            // Node outputs (bound events) can be bound to an output on a directive.\n            node.outputs.forEach(function (output) { return setAttributeBinding(output, 'outputs'); });\n            // Recurse into the node's children.\n            node.children.forEach(function (child) { return child.visit(_this); });\n        };\n        // Unused visitors.\n        DirectiveBinder.prototype.visitContent = function (content) { };\n        DirectiveBinder.prototype.visitVariable = function (variable) { };\n        DirectiveBinder.prototype.visitReference = function (reference) { };\n        DirectiveBinder.prototype.visitTextAttribute = function (attribute) { };\n        DirectiveBinder.prototype.visitBoundAttribute = function (attribute) { };\n        DirectiveBinder.prototype.visitBoundEvent = function (attribute) { };\n        DirectiveBinder.prototype.visitBoundAttributeOrEvent = function (node) { };\n        DirectiveBinder.prototype.visitText = function (text) { };\n        DirectiveBinder.prototype.visitBoundText = function (text) { };\n        DirectiveBinder.prototype.visitIcu = function (icu) { };\n        return DirectiveBinder;\n    }());\n    /**\n     * Processes a template and extract metadata about expressions and symbols within.\n     *\n     * This is a companion to the `DirectiveBinder` that doesn't require knowledge of directives matched\n     * within the template in order to operate.\n     *\n     * Expressions are visited by the superclass `RecursiveAstVisitor`, with custom logic provided\n     * by overridden methods from that visitor.\n     */\n    var TemplateBinder = /** @class */ (function (_super) {\n        __extends(TemplateBinder, _super);\n        function TemplateBinder(bindings, symbols, usedPipes, nestingLevel, scope, template, level) {\n            var _this = _super.call(this) || this;\n            _this.bindings = bindings;\n            _this.symbols = symbols;\n            _this.usedPipes = usedPipes;\n            _this.nestingLevel = nestingLevel;\n            _this.scope = scope;\n            _this.template = template;\n            _this.level = level;\n            _this.pipesUsed = [];\n            // Save a bit of processing time by constructing this closure in advance.\n            _this.visitNode = function (node) { return node.visit(_this); };\n            return _this;\n        }\n        // This method is defined to reconcile the type of TemplateBinder since both\n        // RecursiveAstVisitor and Visitor define the visit() method in their\n        // interfaces.\n        TemplateBinder.prototype.visit = function (node, context) {\n            if (node instanceof AST) {\n                node.visit(this, context);\n            }\n            else {\n                node.visit(this);\n            }\n        };\n        /**\n         * Process a template and extract metadata about expressions and symbols within.\n         *\n         * @param template the nodes of the template to process\n         * @param scope the `Scope` of the template being processed.\n         * @returns three maps which contain metadata about the template: `expressions` which interprets\n         * special `AST` nodes in expressions as pointing to references or variables declared within the\n         * template, `symbols` which maps those variables and references to the nested `Template` which\n         * declares them, if any, and `nestingLevel` which associates each `Template` with a integer\n         * nesting level (how many levels deep within the template structure the `Template` is), starting\n         * at 1.\n         */\n        TemplateBinder.applyWithScope = function (template, scope) {\n            var expressions = new Map();\n            var symbols = new Map();\n            var nestingLevel = new Map();\n            var usedPipes = new Set();\n            // The top-level template has nesting level 0.\n            var binder = new TemplateBinder(expressions, symbols, usedPipes, nestingLevel, scope, template instanceof Template ? template : null, 0);\n            binder.ingest(template);\n            return { expressions: expressions, symbols: symbols, nestingLevel: nestingLevel, usedPipes: usedPipes };\n        };\n        TemplateBinder.prototype.ingest = function (template) {\n            if (template instanceof Template) {\n                // For <ng-template>s, process only variables and child nodes. Inputs, outputs, templateAttrs,\n                // and references were all processed in the scope of the containing template.\n                template.variables.forEach(this.visitNode);\n                template.children.forEach(this.visitNode);\n                // Set the nesting level.\n                this.nestingLevel.set(template, this.level);\n            }\n            else {\n                // Visit each node from the top-level template.\n                template.forEach(this.visitNode);\n            }\n        };\n        TemplateBinder.prototype.visitElement = function (element) {\n            // Visit the inputs, outputs, and children of the element.\n            element.inputs.forEach(this.visitNode);\n            element.outputs.forEach(this.visitNode);\n            element.children.forEach(this.visitNode);\n        };\n        TemplateBinder.prototype.visitTemplate = function (template) {\n            // First, visit inputs, outputs and template attributes of the template node.\n            template.inputs.forEach(this.visitNode);\n            template.outputs.forEach(this.visitNode);\n            template.templateAttrs.forEach(this.visitNode);\n            // References are also evaluated in the outer context.\n            template.references.forEach(this.visitNode);\n            // Next, recurse into the template using its scope, and bumping the nesting level up by one.\n            var childScope = this.scope.getChildScope(template);\n            var binder = new TemplateBinder(this.bindings, this.symbols, this.usedPipes, this.nestingLevel, childScope, template, this.level + 1);\n            binder.ingest(template);\n        };\n        TemplateBinder.prototype.visitVariable = function (variable) {\n            // Register the `Variable` as a symbol in the current `Template`.\n            if (this.template !== null) {\n                this.symbols.set(variable, this.template);\n            }\n        };\n        TemplateBinder.prototype.visitReference = function (reference) {\n            // Register the `Reference` as a symbol in the current `Template`.\n            if (this.template !== null) {\n                this.symbols.set(reference, this.template);\n            }\n        };\n        // Unused template visitors\n        TemplateBinder.prototype.visitText = function (text) { };\n        TemplateBinder.prototype.visitContent = function (content) { };\n        TemplateBinder.prototype.visitTextAttribute = function (attribute) { };\n        TemplateBinder.prototype.visitIcu = function (icu) {\n            var _this = this;\n            Object.keys(icu.vars).forEach(function (key) { return icu.vars[key].visit(_this); });\n            Object.keys(icu.placeholders).forEach(function (key) { return icu.placeholders[key].visit(_this); });\n        };\n        // The remaining visitors are concerned with processing AST expressions within template bindings\n        TemplateBinder.prototype.visitBoundAttribute = function (attribute) {\n            attribute.value.visit(this);\n        };\n        TemplateBinder.prototype.visitBoundEvent = function (event) {\n            event.handler.visit(this);\n        };\n        TemplateBinder.prototype.visitBoundText = function (text) {\n            text.value.visit(this);\n        };\n        TemplateBinder.prototype.visitPipe = function (ast, context) {\n            this.usedPipes.add(ast.name);\n            return _super.prototype.visitPipe.call(this, ast, context);\n        };\n        // These five types of AST expressions can refer to expression roots, which could be variables\n        // or references in the current scope.\n        TemplateBinder.prototype.visitPropertyRead = function (ast, context) {\n            this.maybeMap(context, ast, ast.name);\n            return _super.prototype.visitPropertyRead.call(this, ast, context);\n        };\n        TemplateBinder.prototype.visitSafePropertyRead = function (ast, context) {\n            this.maybeMap(context, ast, ast.name);\n            return _super.prototype.visitSafePropertyRead.call(this, ast, context);\n        };\n        TemplateBinder.prototype.visitPropertyWrite = function (ast, context) {\n            this.maybeMap(context, ast, ast.name);\n            return _super.prototype.visitPropertyWrite.call(this, ast, context);\n        };\n        TemplateBinder.prototype.visitMethodCall = function (ast, context) {\n            this.maybeMap(context, ast, ast.name);\n            return _super.prototype.visitMethodCall.call(this, ast, context);\n        };\n        TemplateBinder.prototype.visitSafeMethodCall = function (ast, context) {\n            this.maybeMap(context, ast, ast.name);\n            return _super.prototype.visitSafeMethodCall.call(this, ast, context);\n        };\n        TemplateBinder.prototype.maybeMap = function (scope, ast, name) {\n            // If the receiver of the expression isn't the `ImplicitReceiver`, this isn't the root of an\n            // `AST` expression that maps to a `Variable` or `Reference`.\n            if (!(ast.receiver instanceof ImplicitReceiver)) {\n                return;\n            }\n            // Check whether the name exists in the current scope. If so, map it. Otherwise, the name is\n            // probably a property on the top-level component context.\n            var target = this.scope.lookup(name);\n            if (target !== null) {\n                this.bindings.set(ast, target);\n            }\n        };\n        return TemplateBinder;\n    }(RecursiveAstVisitor$1));\n    /**\n     * Metadata container for a `Target` that allows queries for specific bits of metadata.\n     *\n     * See `BoundTarget` for documentation on the individual methods.\n     */\n    var R3BoundTarget = /** @class */ (function () {\n        function R3BoundTarget(target, directives, bindings, references, exprTargets, symbols, nestingLevel, templateEntities, usedPipes) {\n            this.target = target;\n            this.directives = directives;\n            this.bindings = bindings;\n            this.references = references;\n            this.exprTargets = exprTargets;\n            this.symbols = symbols;\n            this.nestingLevel = nestingLevel;\n            this.templateEntities = templateEntities;\n            this.usedPipes = usedPipes;\n        }\n        R3BoundTarget.prototype.getEntitiesInTemplateScope = function (template) {\n            var _a;\n            return (_a = this.templateEntities.get(template)) !== null && _a !== void 0 ? _a : new Set();\n        };\n        R3BoundTarget.prototype.getDirectivesOfNode = function (node) {\n            return this.directives.get(node) || null;\n        };\n        R3BoundTarget.prototype.getReferenceTarget = function (ref) {\n            return this.references.get(ref) || null;\n        };\n        R3BoundTarget.prototype.getConsumerOfBinding = function (binding) {\n            return this.bindings.get(binding) || null;\n        };\n        R3BoundTarget.prototype.getExpressionTarget = function (expr) {\n            return this.exprTargets.get(expr) || null;\n        };\n        R3BoundTarget.prototype.getTemplateOfSymbol = function (symbol) {\n            return this.symbols.get(symbol) || null;\n        };\n        R3BoundTarget.prototype.getNestingLevel = function (template) {\n            return this.nestingLevel.get(template) || 0;\n        };\n        R3BoundTarget.prototype.getUsedDirectives = function () {\n            var set = new Set();\n            this.directives.forEach(function (dirs) { return dirs.forEach(function (dir) { return set.add(dir); }); });\n            return Array.from(set.values());\n        };\n        R3BoundTarget.prototype.getUsedPipes = function () {\n            return Array.from(this.usedPipes);\n        };\n        return R3BoundTarget;\n    }());\n    function extractTemplateEntities(rootScope) {\n        var e_1, _b, e_2, _c;\n        var entityMap = new Map();\n        function extractScopeEntities(scope) {\n            if (entityMap.has(scope.template)) {\n                return entityMap.get(scope.template);\n            }\n            var currentEntities = scope.namedEntities;\n            var templateEntities;\n            if (scope.parentScope !== null) {\n                templateEntities = new Map(__spreadArray(__spreadArray([], __read(extractScopeEntities(scope.parentScope))), __read(currentEntities)));\n            }\n            else {\n                templateEntities = new Map(currentEntities);\n            }\n            entityMap.set(scope.template, templateEntities);\n            return templateEntities;\n        }\n        var scopesToProcess = [rootScope];\n        while (scopesToProcess.length > 0) {\n            var scope = scopesToProcess.pop();\n            try {\n                for (var _d = (e_1 = void 0, __values(scope.childScopes.values())), _e = _d.next(); !_e.done; _e = _d.next()) {\n                    var childScope = _e.value;\n                    scopesToProcess.push(childScope);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            extractScopeEntities(scope);\n        }\n        var templateEntities = new Map();\n        try {\n            for (var entityMap_1 = __values(entityMap), entityMap_1_1 = entityMap_1.next(); !entityMap_1_1.done; entityMap_1_1 = entityMap_1.next()) {\n                var _f = __read(entityMap_1_1.value, 2), template = _f[0], entities = _f[1];\n                templateEntities.set(template, new Set(entities.values()));\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (entityMap_1_1 && !entityMap_1_1.done && (_c = entityMap_1.return)) _c.call(entityMap_1);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        return templateEntities;\n    }\n\n    /**\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://angular.io/license\n     */\n    function compileClassMetadata(metadata) {\n        var _a, _b;\n        // Generate an ngDevMode guarded call to setClassMetadata with the class identifier and its\n        // metadata.\n        var fnCall = importExpr(Identifiers.setClassMetadata).callFn([\n            metadata.type,\n            metadata.decorators,\n            (_a = metadata.ctorParameters) !== null && _a !== void 0 ? _a : literal(null),\n            (_b = metadata.propDecorators) !== null && _b !== void 0 ? _b : literal(null),\n        ]);\n        var iife = fn([], [devOnlyGuardedExpression(fnCall).toStmt()]);\n        return iife.callFn([]);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION = '12.0.0';\n    function compileDeclareClassMetadata(metadata) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));\n        definitionMap.set('version', literal('12.2.1'));\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        definitionMap.set('type', metadata.type);\n        definitionMap.set('decorators', metadata.decorators);\n        definitionMap.set('ctorParameters', metadata.ctorParameters);\n        definitionMap.set('propDecorators', metadata.propDecorators);\n        return importExpr(Identifiers.declareClassMetadata).callFn([definitionMap.toLiteralMap()]);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION$1 = '12.0.0';\n    /**\n     * Compile a directive declaration defined by the `R3DirectiveMetadata`.\n     */\n    function compileDeclareDirectiveFromMetadata(meta) {\n        var definitionMap = createDirectiveDefinitionMap(meta);\n        var expression = importExpr(Identifiers.declareDirective).callFn([definitionMap.toLiteralMap()]);\n        var type = createDirectiveType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Gathers the declaration fields for a directive into a `DefinitionMap`. This allows for reusing\n     * this logic for components, as they extend the directive metadata.\n     */\n    function createDirectiveDefinitionMap(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));\n        definitionMap.set('version', literal('12.2.1'));\n        // e.g. `type: MyDirective`\n        definitionMap.set('type', meta.internalType);\n        // e.g. `selector: 'some-dir'`\n        if (meta.selector !== null) {\n            definitionMap.set('selector', literal(meta.selector));\n        }\n        definitionMap.set('inputs', conditionallyCreateMapObjectLiteral(meta.inputs, true));\n        definitionMap.set('outputs', conditionallyCreateMapObjectLiteral(meta.outputs));\n        definitionMap.set('host', compileHostMetadata(meta.host));\n        definitionMap.set('providers', meta.providers);\n        if (meta.queries.length > 0) {\n            definitionMap.set('queries', literalArr(meta.queries.map(compileQuery)));\n        }\n        if (meta.viewQueries.length > 0) {\n            definitionMap.set('viewQueries', literalArr(meta.viewQueries.map(compileQuery)));\n        }\n        if (meta.exportAs !== null) {\n            definitionMap.set('exportAs', asLiteral(meta.exportAs));\n        }\n        if (meta.usesInheritance) {\n            definitionMap.set('usesInheritance', literal(true));\n        }\n        if (meta.lifecycle.usesOnChanges) {\n            definitionMap.set('usesOnChanges', literal(true));\n        }\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        return definitionMap;\n    }\n    /**\n     * Compiles the metadata of a single query into its partial declaration form as declared\n     * by `R3DeclareQueryMetadata`.\n     */\n    function compileQuery(query) {\n        var meta = new DefinitionMap();\n        meta.set('propertyName', literal(query.propertyName));\n        if (query.first) {\n            meta.set('first', literal(true));\n        }\n        meta.set('predicate', Array.isArray(query.predicate) ? asLiteral(query.predicate) : query.predicate);\n        if (!query.emitDistinctChangesOnly) {\n            // `emitDistinctChangesOnly` is special because we expect it to be `true`.\n            // Therefore we explicitly emit the field, and explicitly place it only when it's `false`.\n            meta.set('emitDistinctChangesOnly', literal(false));\n        }\n        else {\n            // The linker will assume that an absent `emitDistinctChangesOnly` flag is by default `true`.\n        }\n        if (query.descendants) {\n            meta.set('descendants', literal(true));\n        }\n        meta.set('read', query.read);\n        if (query.static) {\n            meta.set('static', literal(true));\n        }\n        return meta.toLiteralMap();\n    }\n    /**\n     * Compiles the host metadata into its partial declaration form as declared\n     * in `R3DeclareDirectiveMetadata['host']`\n     */\n    function compileHostMetadata(meta) {\n        var hostMetadata = new DefinitionMap();\n        hostMetadata.set('attributes', toOptionalLiteralMap(meta.attributes, function (expression) { return expression; }));\n        hostMetadata.set('listeners', toOptionalLiteralMap(meta.listeners, literal));\n        hostMetadata.set('properties', toOptionalLiteralMap(meta.properties, literal));\n        if (meta.specialAttributes.styleAttr) {\n            hostMetadata.set('styleAttribute', literal(meta.specialAttributes.styleAttr));\n        }\n        if (meta.specialAttributes.classAttr) {\n            hostMetadata.set('classAttribute', literal(meta.specialAttributes.classAttr));\n        }\n        if (hostMetadata.values.length > 0) {\n            return hostMetadata.toLiteralMap();\n        }\n        else {\n            return null;\n        }\n    }\n\n    /**\n     * Compile a component declaration defined by the `R3ComponentMetadata`.\n     */\n    function compileDeclareComponentFromMetadata(meta, template, additionalTemplateInfo) {\n        var definitionMap = createComponentDefinitionMap(meta, template, additionalTemplateInfo);\n        var expression = importExpr(Identifiers.declareComponent).callFn([definitionMap.toLiteralMap()]);\n        var type = createComponentType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Gathers the declaration fields for a component into a `DefinitionMap`.\n     */\n    function createComponentDefinitionMap(meta, template, templateInfo) {\n        var definitionMap = createDirectiveDefinitionMap(meta);\n        definitionMap.set('template', getTemplateExpression(template, templateInfo));\n        if (templateInfo.isInline) {\n            definitionMap.set('isInline', literal(true));\n        }\n        definitionMap.set('styles', toOptionalLiteralArray(meta.styles, literal));\n        definitionMap.set('components', compileUsedDirectiveMetadata(meta, function (directive) { return directive.isComponent === true; }));\n        definitionMap.set('directives', compileUsedDirectiveMetadata(meta, function (directive) { return directive.isComponent !== true; }));\n        definitionMap.set('pipes', compileUsedPipeMetadata(meta));\n        definitionMap.set('viewProviders', meta.viewProviders);\n        definitionMap.set('animations', meta.animations);\n        if (meta.changeDetection !== undefined) {\n            definitionMap.set('changeDetection', importExpr(Identifiers.ChangeDetectionStrategy)\n                .prop(ChangeDetectionStrategy[meta.changeDetection]));\n        }\n        if (meta.encapsulation !== ViewEncapsulation.Emulated) {\n            definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation[meta.encapsulation]));\n        }\n        if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) {\n            definitionMap.set('interpolation', literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)]));\n        }\n        if (template.preserveWhitespaces === true) {\n            definitionMap.set('preserveWhitespaces', literal(true));\n        }\n        return definitionMap;\n    }\n    function getTemplateExpression(template, templateInfo) {\n        // If the template has been defined using a direct literal, we use that expression directly\n        // without any modifications. This is ensures proper source mapping from the partially\n        // compiled code to the source file declaring the template. Note that this does not capture\n        // template literals referenced indirectly through an identifier.\n        if (templateInfo.inlineTemplateLiteralExpression !== null) {\n            return templateInfo.inlineTemplateLiteralExpression;\n        }\n        // If the template is defined inline but not through a literal, the template has been resolved\n        // through static interpretation. We create a literal but cannot provide any source span. Note\n        // that we cannot use the expression defining the template because the linker expects the template\n        // to be defined as a literal in the declaration.\n        if (templateInfo.isInline) {\n            return literal(templateInfo.content, null, null);\n        }\n        // The template is external so we must synthesize an expression node with\n        // the appropriate source-span.\n        var contents = templateInfo.content;\n        var file = new ParseSourceFile(contents, templateInfo.sourceUrl);\n        var start = new ParseLocation(file, 0, 0, 0);\n        var end = computeEndLocation(file, contents);\n        var span = new ParseSourceSpan(start, end);\n        return literal(contents, null, span);\n    }\n    function computeEndLocation(file, contents) {\n        var length = contents.length;\n        var lineStart = 0;\n        var lastLineStart = 0;\n        var line = 0;\n        do {\n            lineStart = contents.indexOf('\\n', lastLineStart);\n            if (lineStart !== -1) {\n                lastLineStart = lineStart + 1;\n                line++;\n            }\n        } while (lineStart !== -1);\n        return new ParseLocation(file, length, line, length - lastLineStart);\n    }\n    /**\n     * Compiles the directives as registered in the component metadata into an array literal of the\n     * individual directives. If the component does not use any directives, then null is returned.\n     */\n    function compileUsedDirectiveMetadata(meta, predicate) {\n        var wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?\n            generateForwardRef :\n            function (expr) { return expr; };\n        var directives = meta.directives.filter(predicate);\n        return toOptionalLiteralArray(directives, function (directive) {\n            var dirMeta = new DefinitionMap();\n            dirMeta.set('type', wrapType(directive.type));\n            dirMeta.set('selector', literal(directive.selector));\n            dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));\n            dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));\n            dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));\n            return dirMeta.toLiteralMap();\n        });\n    }\n    /**\n     * Compiles the pipes as registered in the component metadata into an object literal, where the\n     * pipe's name is used as key and a reference to its type as value. If the component does not use\n     * any pipes, then null is returned.\n     */\n    function compileUsedPipeMetadata(meta) {\n        var e_1, _a;\n        if (meta.pipes.size === 0) {\n            return null;\n        }\n        var wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?\n            generateForwardRef :\n            function (expr) { return expr; };\n        var entries = [];\n        try {\n            for (var _b = __values(meta.pipes), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var _d = __read(_c.value, 2), name = _d[0], pipe = _d[1];\n                entries.push({ key: name, value: wrapType(pipe), quoted: true });\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return literalMap(entries);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION$2 = '12.0.0';\n    function compileDeclareFactoryFunction(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));\n        definitionMap.set('version', literal('12.2.1'));\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        definitionMap.set('type', meta.internalType);\n        definitionMap.set('deps', compileDependencies(meta.deps));\n        definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(exports.FactoryTarget[meta.target]));\n        return {\n            expression: importExpr(Identifiers.declareFactory).callFn([definitionMap.toLiteralMap()]),\n            statements: [],\n            type: createFactoryType(meta),\n        };\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION$3 = '12.0.0';\n    /**\n     * Compile a Injectable declaration defined by the `R3InjectableMetadata`.\n     */\n    function compileDeclareInjectableFromMetadata(meta) {\n        var definitionMap = createInjectableDefinitionMap(meta);\n        var expression = importExpr(Identifiers.declareInjectable).callFn([definitionMap.toLiteralMap()]);\n        var type = createInjectableType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Gathers the declaration fields for a Injectable into a `DefinitionMap`.\n     */\n    function createInjectableDefinitionMap(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));\n        definitionMap.set('version', literal('12.2.1'));\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        definitionMap.set('type', meta.internalType);\n        // Only generate providedIn property if it has a non-null value\n        if (meta.providedIn !== undefined) {\n            var providedIn = convertFromProviderExpression(meta.providedIn);\n            if (providedIn.value !== null) {\n                definitionMap.set('providedIn', providedIn);\n            }\n        }\n        if (meta.useClass !== undefined) {\n            definitionMap.set('useClass', convertFromProviderExpression(meta.useClass));\n        }\n        if (meta.useExisting !== undefined) {\n            definitionMap.set('useExisting', convertFromProviderExpression(meta.useExisting));\n        }\n        if (meta.useValue !== undefined) {\n            definitionMap.set('useValue', convertFromProviderExpression(meta.useValue));\n        }\n        // Factories do not contain `ForwardRef`s since any types are already wrapped in a function call\n        // so the types will not be eagerly evaluated. Therefore we do not need to process this expression\n        // with `convertFromProviderExpression()`.\n        if (meta.useFactory !== undefined) {\n            definitionMap.set('useFactory', meta.useFactory);\n        }\n        if (meta.deps !== undefined) {\n            definitionMap.set('deps', literalArr(meta.deps.map(compileDependency)));\n        }\n        return definitionMap;\n    }\n    /**\n     * Convert an `R3ProviderExpression` to an `Expression`, possibly wrapping its expression in a\n     * `forwardRef()` call.\n     *\n     * If `R3ProviderExpression.isForwardRef` is true then the expression was originally wrapped in a\n     * `forwardRef()` call to prevent the value from being eagerly evaluated in the code.\n     *\n     * Normally, the linker will statically process the code, putting the `expression` inside a factory\n     * function so the `forwardRef()` wrapper is not evaluated before it has been defined. But if the\n     * partial declaration is evaluated by the JIT compiler the `forwardRef()` call is still needed to\n     * prevent eager evaluation of the `expression`.\n     *\n     * So in partial declarations, expressions that could be forward-refs are wrapped in `forwardRef()`\n     * calls, and this is then unwrapped in the linker as necessary.\n     *\n     * See `packages/compiler-cli/src/ngtsc/annotations/src/injectable.ts` and\n     * `packages/compiler/src/jit_compiler_facade.ts` for more information.\n     */\n    function convertFromProviderExpression(_a) {\n        var expression = _a.expression, isForwardRef = _a.isForwardRef;\n        return isForwardRef ? generateForwardRef(expression) : expression;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';\n    function compileDeclareInjectorFromMetadata(meta) {\n        var definitionMap = createInjectorDefinitionMap(meta);\n        var expression = importExpr(Identifiers.declareInjector).callFn([definitionMap.toLiteralMap()]);\n        var type = createInjectorType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Gathers the declaration fields for an Injector into a `DefinitionMap`.\n     */\n    function createInjectorDefinitionMap(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));\n        definitionMap.set('version', literal('12.2.1'));\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        definitionMap.set('type', meta.internalType);\n        definitionMap.set('providers', meta.providers);\n        if (meta.imports.length > 0) {\n            definitionMap.set('imports', literalArr(meta.imports));\n        }\n        return definitionMap;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';\n    function compileDeclareNgModuleFromMetadata(meta) {\n        var definitionMap = createNgModuleDefinitionMap(meta);\n        var expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);\n        var type = createNgModuleType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Gathers the declaration fields for an NgModule into a `DefinitionMap`.\n     */\n    function createNgModuleDefinitionMap(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));\n        definitionMap.set('version', literal('12.2.1'));\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        definitionMap.set('type', meta.internalType);\n        // We only generate the keys in the metadata if the arrays contain values.\n        // We must wrap the arrays inside a function if any of the values are a forward reference to a\n        // not-yet-declared class. This is to support JIT execution of the `ɵɵngDeclareNgModule()` call.\n        // In the linker these wrappers are stripped and then reapplied for the `ɵɵdefineNgModule()` call.\n        if (meta.bootstrap.length > 0) {\n            definitionMap.set('bootstrap', refsToArray(meta.bootstrap, meta.containsForwardDecls));\n        }\n        if (meta.declarations.length > 0) {\n            definitionMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls));\n        }\n        if (meta.imports.length > 0) {\n            definitionMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls));\n        }\n        if (meta.exports.length > 0) {\n            definitionMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls));\n        }\n        if (meta.schemas !== null && meta.schemas.length > 0) {\n            definitionMap.set('schemas', literalArr(meta.schemas.map(function (ref) { return ref.value; })));\n        }\n        if (meta.id !== null) {\n            definitionMap.set('id', meta.id);\n        }\n        return definitionMap;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Every time we make a breaking change to the declaration interface or partial-linker behavior, we\n     * must update this constant to prevent old partial-linkers from incorrectly processing the\n     * declaration.\n     *\n     * Do not include any prerelease in these versions as they are ignored.\n     */\n    var MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';\n    /**\n     * Compile a Pipe declaration defined by the `R3PipeMetadata`.\n     */\n    function compileDeclarePipeFromMetadata(meta) {\n        var definitionMap = createPipeDefinitionMap(meta);\n        var expression = importExpr(Identifiers.declarePipe).callFn([definitionMap.toLiteralMap()]);\n        var type = createPipeType(meta);\n        return { expression: expression, type: type, statements: [] };\n    }\n    /**\n     * Gathers the declaration fields for a Pipe into a `DefinitionMap`.\n     */\n    function createPipeDefinitionMap(meta) {\n        var definitionMap = new DefinitionMap();\n        definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));\n        definitionMap.set('version', literal('12.2.1'));\n        definitionMap.set('ngImport', importExpr(Identifiers.core));\n        // e.g. `type: MyPipe`\n        definitionMap.set('type', meta.internalType);\n        // e.g. `name: \"myPipe\"`\n        definitionMap.set('name', literal(meta.pipeName));\n        if (meta.pure === false) {\n            // e.g. `pure: false`\n            definitionMap.set('pure', literal(meta.pure));\n        }\n        return definitionMap;\n    }\n\n    /**\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://angular.io/license\n     */\n    // This file only reexports content of the `src` folder. Keep it that way.\n    // This function call has a global side effects and publishes the compiler into global namespace for\n    // the late binding of the Compiler to the @angular/core for jit compilation.\n    publishFacade(_global);\n\n    /**\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://angular.io/license\n     */\n    // This file only reexports content of the `src` folder. Keep it that way.\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n\n    exports.AST = AST;\n    exports.ASTWithName = ASTWithName;\n    exports.ASTWithSource = ASTWithSource;\n    exports.AbsoluteSourceSpan = AbsoluteSourceSpan;\n    exports.AotCompiler = AotCompiler;\n    exports.AotSummaryResolver = AotSummaryResolver;\n    exports.ArrayType = ArrayType;\n    exports.AssertNotNull = AssertNotNull;\n    exports.AstMemoryEfficientTransformer = AstMemoryEfficientTransformer;\n    exports.AstPath = AstPath;\n    exports.AstTransformer = AstTransformer$1;\n    exports.AttrAst = AttrAst;\n    exports.Attribute = Attribute;\n    exports.Binary = Binary;\n    exports.BinaryOperatorExpr = BinaryOperatorExpr;\n    exports.BindingPipe = BindingPipe;\n    exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst;\n    exports.BoundElementProperty = BoundElementProperty;\n    exports.BoundElementPropertyAst = BoundElementPropertyAst;\n    exports.BoundEventAst = BoundEventAst;\n    exports.BoundTextAst = BoundTextAst;\n    exports.BuiltinType = BuiltinType;\n    exports.CONTENT_ATTR = CONTENT_ATTR;\n    exports.CUSTOM_ELEMENTS_SCHEMA = CUSTOM_ELEMENTS_SCHEMA;\n    exports.CastExpr = CastExpr;\n    exports.Chain = Chain;\n    exports.ClassField = ClassField;\n    exports.ClassMethod = ClassMethod;\n    exports.ClassStmt = ClassStmt;\n    exports.CommaExpr = CommaExpr;\n    exports.Comment = Comment$1;\n    exports.CompileDirectiveMetadata = CompileDirectiveMetadata;\n    exports.CompileMetadataResolver = CompileMetadataResolver;\n    exports.CompileNgModuleMetadata = CompileNgModuleMetadata;\n    exports.CompilePipeMetadata = CompilePipeMetadata;\n    exports.CompileReflector = CompileReflector;\n    exports.CompileShallowModuleMetadata = CompileShallowModuleMetadata;\n    exports.CompileStylesheetMetadata = CompileStylesheetMetadata;\n    exports.CompileTemplateMetadata = CompileTemplateMetadata;\n    exports.CompiledStylesheet = CompiledStylesheet;\n    exports.CompilerConfig = CompilerConfig;\n    exports.Conditional = Conditional;\n    exports.ConditionalExpr = ConditionalExpr;\n    exports.ConstantPool = ConstantPool;\n    exports.CssSelector = CssSelector;\n    exports.DEFAULT_INTERPOLATION_CONFIG = DEFAULT_INTERPOLATION_CONFIG;\n    exports.DYNAMIC_TYPE = DYNAMIC_TYPE;\n    exports.DeclareFunctionStmt = DeclareFunctionStmt;\n    exports.DeclareVarStmt = DeclareVarStmt;\n    exports.DirectiveAst = DirectiveAst;\n    exports.DirectiveNormalizer = DirectiveNormalizer;\n    exports.DirectiveResolver = DirectiveResolver;\n    exports.DomElementSchemaRegistry = DomElementSchemaRegistry;\n    exports.EOF = EOF;\n    exports.ERROR_COMPONENT_TYPE = ERROR_COMPONENT_TYPE;\n    exports.Element = Element$1;\n    exports.ElementAst = ElementAst;\n    exports.ElementSchemaRegistry = ElementSchemaRegistry;\n    exports.EmbeddedTemplateAst = EmbeddedTemplateAst;\n    exports.EmitterVisitorContext = EmitterVisitorContext;\n    exports.EmptyExpr = EmptyExpr;\n    exports.Expansion = Expansion;\n    exports.ExpansionCase = ExpansionCase;\n    exports.Expression = Expression;\n    exports.ExpressionBinding = ExpressionBinding;\n    exports.ExpressionStatement = ExpressionStatement;\n    exports.ExpressionType = ExpressionType;\n    exports.ExternalExpr = ExternalExpr;\n    exports.ExternalReference = ExternalReference;\n    exports.Extractor = Extractor;\n    exports.FunctionCall = FunctionCall;\n    exports.FunctionExpr = FunctionExpr;\n    exports.GeneratedFile = GeneratedFile;\n    exports.HOST_ATTR = HOST_ATTR;\n    exports.HtmlParser = HtmlParser;\n    exports.HtmlTagDefinition = HtmlTagDefinition;\n    exports.I18NHtmlParser = I18NHtmlParser;\n    exports.Identifiers = Identifiers$1;\n    exports.IfStmt = IfStmt;\n    exports.ImplicitReceiver = ImplicitReceiver;\n    exports.InstantiateExpr = InstantiateExpr;\n    exports.Interpolation = Interpolation;\n    exports.InterpolationConfig = InterpolationConfig;\n    exports.InvokeFunctionExpr = InvokeFunctionExpr;\n    exports.InvokeMethodExpr = InvokeMethodExpr;\n    exports.IvyParser = IvyParser;\n    exports.JSDocComment = JSDocComment;\n    exports.JitCompiler = JitCompiler;\n    exports.JitEvaluator = JitEvaluator;\n    exports.JitSummaryResolver = JitSummaryResolver;\n    exports.KeyedRead = KeyedRead;\n    exports.KeyedWrite = KeyedWrite;\n    exports.LeadingComment = LeadingComment;\n    exports.Lexer = Lexer;\n    exports.LiteralArray = LiteralArray;\n    exports.LiteralArrayExpr = LiteralArrayExpr;\n    exports.LiteralExpr = LiteralExpr;\n    exports.LiteralMap = LiteralMap;\n    exports.LiteralMapExpr = LiteralMapExpr;\n    exports.LiteralPrimitive = LiteralPrimitive;\n    exports.LocalizedString = LocalizedString;\n    exports.MapType = MapType;\n    exports.MessageBundle = MessageBundle;\n    exports.MethodCall = MethodCall;\n    exports.NONE_TYPE = NONE_TYPE;\n    exports.NO_ERRORS_SCHEMA = NO_ERRORS_SCHEMA;\n    exports.NgContentAst = NgContentAst;\n    exports.NgModuleCompiler = NgModuleCompiler;\n    exports.NgModuleResolver = NgModuleResolver;\n    exports.NodeWithI18n = NodeWithI18n;\n    exports.NonNullAssert = NonNullAssert;\n    exports.NotExpr = NotExpr;\n    exports.NullTemplateVisitor = NullTemplateVisitor;\n    exports.ParseError = ParseError;\n    exports.ParseLocation = ParseLocation;\n    exports.ParseSourceFile = ParseSourceFile;\n    exports.ParseSourceSpan = ParseSourceSpan;\n    exports.ParseSpan = ParseSpan;\n    exports.ParseTreeResult = ParseTreeResult;\n    exports.ParsedEvent = ParsedEvent;\n    exports.ParsedProperty = ParsedProperty;\n    exports.ParsedVariable = ParsedVariable;\n    exports.Parser = Parser$1;\n    exports.ParserError = ParserError;\n    exports.PipeResolver = PipeResolver;\n    exports.PrefixNot = PrefixNot;\n    exports.PropertyRead = PropertyRead;\n    exports.PropertyWrite = PropertyWrite;\n    exports.ProviderAst = ProviderAst;\n    exports.ProviderMeta = ProviderMeta;\n    exports.Quote = Quote;\n    exports.R3BoundTarget = R3BoundTarget;\n    exports.R3Identifiers = Identifiers;\n    exports.R3TargetBinder = R3TargetBinder;\n    exports.ReadKeyExpr = ReadKeyExpr;\n    exports.ReadPropExpr = ReadPropExpr;\n    exports.ReadVarExpr = ReadVarExpr;\n    exports.RecursiveAstVisitor = RecursiveAstVisitor$1;\n    exports.RecursiveTemplateAstVisitor = RecursiveTemplateAstVisitor;\n    exports.RecursiveVisitor = RecursiveVisitor$1;\n    exports.ReferenceAst = ReferenceAst;\n    exports.ResolvedStaticSymbol = ResolvedStaticSymbol;\n    exports.ResourceLoader = ResourceLoader;\n    exports.ReturnStatement = ReturnStatement;\n    exports.STRING_TYPE = STRING_TYPE;\n    exports.SafeKeyedRead = SafeKeyedRead;\n    exports.SafeMethodCall = SafeMethodCall;\n    exports.SafePropertyRead = SafePropertyRead;\n    exports.SelectorContext = SelectorContext;\n    exports.SelectorListContext = SelectorListContext;\n    exports.SelectorMatcher = SelectorMatcher;\n    exports.Serializer = Serializer;\n    exports.SplitInterpolation = SplitInterpolation;\n    exports.Statement = Statement;\n    exports.StaticReflector = StaticReflector;\n    exports.StaticSymbol = StaticSymbol;\n    exports.StaticSymbolCache = StaticSymbolCache;\n    exports.StaticSymbolResolver = StaticSymbolResolver;\n    exports.StyleCompiler = StyleCompiler;\n    exports.StylesCompileDependency = StylesCompileDependency;\n    exports.SummaryResolver = SummaryResolver;\n    exports.TaggedTemplateExpr = TaggedTemplateExpr;\n    exports.TemplateBindingParseResult = TemplateBindingParseResult;\n    exports.TemplateLiteral = TemplateLiteral;\n    exports.TemplateLiteralElement = TemplateLiteralElement;\n    exports.TemplateParseError = TemplateParseError;\n    exports.TemplateParseResult = TemplateParseResult;\n    exports.TemplateParser = TemplateParser;\n    exports.Text = Text$3;\n    exports.TextAst = TextAst;\n    exports.ThisReceiver = ThisReceiver;\n    exports.ThrowStmt = ThrowStmt;\n    exports.TmplAstBoundAttribute = BoundAttribute;\n    exports.TmplAstBoundEvent = BoundEvent;\n    exports.TmplAstBoundText = BoundText;\n    exports.TmplAstContent = Content;\n    exports.TmplAstElement = Element;\n    exports.TmplAstIcu = Icu;\n    exports.TmplAstRecursiveVisitor = RecursiveVisitor;\n    exports.TmplAstReference = Reference;\n    exports.TmplAstTemplate = Template;\n    exports.TmplAstText = Text;\n    exports.TmplAstTextAttribute = TextAttribute;\n    exports.TmplAstVariable = Variable;\n    exports.Token = Token$1;\n    exports.TransitiveCompileNgModuleMetadata = TransitiveCompileNgModuleMetadata;\n    exports.TreeError = TreeError;\n    exports.TryCatchStmt = TryCatchStmt;\n    exports.Type = Type$1;\n    exports.TypeScriptEmitter = TypeScriptEmitter;\n    exports.TypeofExpr = TypeofExpr;\n    exports.Unary = Unary;\n    exports.UnaryOperatorExpr = UnaryOperatorExpr;\n    exports.UrlResolver = UrlResolver;\n    exports.VERSION = VERSION$1;\n    exports.VariableAst = VariableAst;\n    exports.VariableBinding = VariableBinding;\n    exports.Version = Version;\n    exports.ViewCompiler = ViewCompiler;\n    exports.WrappedNodeExpr = WrappedNodeExpr;\n    exports.WriteKeyExpr = WriteKeyExpr;\n    exports.WritePropExpr = WritePropExpr;\n    exports.WriteVarExpr = WriteVarExpr;\n    exports.Xliff = Xliff;\n    exports.Xliff2 = Xliff2;\n    exports.Xmb = Xmb;\n    exports.XmlParser = XmlParser;\n    exports.Xtb = Xtb;\n    exports._ParseAST = _ParseAST;\n    exports.analyzeAndValidateNgModules = analyzeAndValidateNgModules;\n    exports.analyzeFile = analyzeFile;\n    exports.analyzeFileForInjectables = analyzeFileForInjectables;\n    exports.analyzeNgModules = analyzeNgModules;\n    exports.collectExternalReferences = collectExternalReferences;\n    exports.compileClassMetadata = compileClassMetadata;\n    exports.compileComponentFromMetadata = compileComponentFromMetadata;\n    exports.compileDeclareClassMetadata = compileDeclareClassMetadata;\n    exports.compileDeclareComponentFromMetadata = compileDeclareComponentFromMetadata;\n    exports.compileDeclareDirectiveFromMetadata = compileDeclareDirectiveFromMetadata;\n    exports.compileDeclareFactoryFunction = compileDeclareFactoryFunction;\n    exports.compileDeclareInjectableFromMetadata = compileDeclareInjectableFromMetadata;\n    exports.compileDeclareInjectorFromMetadata = compileDeclareInjectorFromMetadata;\n    exports.compileDeclareNgModuleFromMetadata = compileDeclareNgModuleFromMetadata;\n    exports.compileDeclarePipeFromMetadata = compileDeclarePipeFromMetadata;\n    exports.compileDirectiveFromMetadata = compileDirectiveFromMetadata;\n    exports.compileFactoryFunction = compileFactoryFunction;\n    exports.compileInjectable = compileInjectable;\n    exports.compileInjector = compileInjector;\n    exports.compileNgModule = compileNgModule;\n    exports.compilePipeFromMetadata = compilePipeFromMetadata;\n    exports.componentFactoryName = componentFactoryName;\n    exports.computeMsgId = computeMsgId;\n    exports.core = core;\n    exports.createAotCompiler = createAotCompiler;\n    exports.createAotUrlResolver = createAotUrlResolver;\n    exports.createElementCssSelector = createElementCssSelector;\n    exports.createInjectableType = createInjectableType;\n    exports.createLoweredSymbol = createLoweredSymbol;\n    exports.createOfflineCompileUrlResolver = createOfflineCompileUrlResolver;\n    exports.createR3ProviderExpression = createR3ProviderExpression;\n    exports.createUrlResolverWithoutPackagePrefix = createUrlResolverWithoutPackagePrefix;\n    exports.debugOutputAstAsTypeScript = debugOutputAstAsTypeScript;\n    exports.devOnlyGuardedExpression = devOnlyGuardedExpression;\n    exports.findNode = findNode;\n    exports.flatten = flatten;\n    exports.formattedError = formattedError;\n    exports.getHtmlTagDefinition = getHtmlTagDefinition;\n    exports.getMissingNgModuleMetadataErrorData = getMissingNgModuleMetadataErrorData;\n    exports.getNsPrefix = getNsPrefix;\n    exports.getParseErrors = getParseErrors;\n    exports.getSafePropertyAccessString = getSafePropertyAccessString;\n    exports.getUrlScheme = getUrlScheme;\n    exports.hostViewClassName = hostViewClassName;\n    exports.identifierModuleUrl = identifierModuleUrl;\n    exports.identifierName = identifierName;\n    exports.isEmptyExpression = isEmptyExpression;\n    exports.isFormattedError = isFormattedError;\n    exports.isIdentifier = isIdentifier;\n    exports.isLoweredSymbol = isLoweredSymbol;\n    exports.isNgContainer = isNgContainer;\n    exports.isNgContent = isNgContent;\n    exports.isNgTemplate = isNgTemplate;\n    exports.isQuote = isQuote;\n    exports.isSyntaxError = isSyntaxError;\n    exports.jsDocComment = jsDocComment;\n    exports.leadingComment = leadingComment;\n    exports.literalMap = literalMap;\n    exports.makeBindingParser = makeBindingParser;\n    exports.mergeAnalyzedFiles = mergeAnalyzedFiles;\n    exports.mergeNsAndName = mergeNsAndName;\n    exports.ngModuleJitUrl = ngModuleJitUrl;\n    exports.parseHostBindings = parseHostBindings;\n    exports.parseTemplate = parseTemplate;\n    exports.preserveWhitespacesDefault = preserveWhitespacesDefault;\n    exports.publishFacade = publishFacade;\n    exports.r3JitTypeSourceSpan = r3JitTypeSourceSpan;\n    exports.removeSummaryDuplicates = removeSummaryDuplicates;\n    exports.rendererTypeName = rendererTypeName;\n    exports.sanitizeIdentifier = sanitizeIdentifier;\n    exports.sharedStylesheetJitUrl = sharedStylesheetJitUrl;\n    exports.splitClasses = splitClasses;\n    exports.splitNsName = splitNsName;\n    exports.syntaxError = syntaxError;\n    exports.templateJitUrl = templateJitUrl;\n    exports.templateSourceUrl = templateSourceUrl;\n    exports.templateVisitAll = templateVisitAll;\n    exports.toTypeScript = toTypeScript;\n    exports.tokenName = tokenName;\n    exports.tokenReference = tokenReference;\n    exports.typeSourceSpan = typeSourceSpan;\n    exports.unescapeIdentifier = unescapeIdentifier;\n    exports.unwrapResolvedMetadata = unwrapResolvedMetadata;\n    exports.verifyHostBindings = verifyHostBindings;\n    exports.viewClassName = viewClassName;\n    exports.visitAll = visitAll$1;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=compiler.umd.js.map"
  },
  {
    "path": "test/lib/angular-12/angular-12-core.js",
    "content": "/**\n * @license Angular v12.2.1\n * (c) 2010-2021 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators')) :\n    typeof define === 'function' && define.amd ? define('@angular/core', ['exports', 'rxjs', 'rxjs/operators'], factory) :\n    (global = global || self, factory((global.ng = global.ng || {}, global.ng.core = {}), global.rxjs, global.rxjs.operators));\n}(this, (function (exports, rxjs, operators) { 'use strict';\n\n    /**\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://angular.io/license\n     */\n    function getClosureSafeProperty(objWithPropertyToExtract) {\n        for (var key in objWithPropertyToExtract) {\n            if (objWithPropertyToExtract[key] === getClosureSafeProperty) {\n                return key;\n            }\n        }\n        throw Error('Could not find renamed property on target object.');\n    }\n    /**\n     * Sets properties on a target object from a source object, but only if\n     * the property doesn't already exist on the target object.\n     * @param target The target to set properties on\n     * @param source The source of the property keys and values to set\n     */\n    function fillProperties(target, source) {\n        for (var key in source) {\n            if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n                target[key] = source[key];\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function stringify(token) {\n        if (typeof token === 'string') {\n            return token;\n        }\n        if (Array.isArray(token)) {\n            return '[' + token.map(stringify).join(', ') + ']';\n        }\n        if (token == null) {\n            return '' + token;\n        }\n        if (token.overriddenName) {\n            return \"\" + token.overriddenName;\n        }\n        if (token.name) {\n            return \"\" + token.name;\n        }\n        var res = token.toString();\n        if (res == null) {\n            return '' + res;\n        }\n        var newLineIndex = res.indexOf('\\n');\n        return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n    }\n    /**\n     * Concatenates two strings with separator, allocating new strings only when necessary.\n     *\n     * @param before before string.\n     * @param separator separator string.\n     * @param after after string.\n     * @returns concatenated string.\n     */\n    function concatStringsWithSpace(before, after) {\n        return (before == null || before === '') ?\n            (after === null ? '' : after) :\n            ((after == null || after === '') ? before : before + ' ' + after);\n    }\n\n    /**\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://angular.io/license\n     */\n    var __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty });\n    /**\n     * Allows to refer to references which are not yet defined.\n     *\n     * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n     * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n     * a query is not yet defined.\n     *\n     * @usageNotes\n     * ### Example\n     * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n     * @publicApi\n     */\n    function forwardRef(forwardRefFn) {\n        forwardRefFn.__forward_ref__ = forwardRef;\n        forwardRefFn.toString = function () {\n            return stringify(this());\n        };\n        return forwardRefFn;\n    }\n    /**\n     * Lazily retrieves the reference value from a forwardRef.\n     *\n     * Acts as the identity function when given a non-forward-ref value.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n     *\n     * @see `forwardRef`\n     * @publicApi\n     */\n    function resolveForwardRef(type) {\n        return isForwardRef(type) ? type() : type;\n    }\n    /** Checks whether a function is wrapped by a `forwardRef`. */\n    function isForwardRef(fn) {\n        return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) &&\n            fn.__forward_ref__ === forwardRef;\n    }\n\n    /*! *****************************************************************************\n    Copyright (c) Microsoft Corporation.\n\n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n    PERFORMANCE OF THIS SOFTWARE.\n    ***************************************************************************** */\n    /* global Reflect, Promise */\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b)\n                if (Object.prototype.hasOwnProperty.call(b, p))\n                    d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    function __extends(d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    }\n    var __assign = function () {\n        __assign = Object.assign || function __assign(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s)\n                    if (Object.prototype.hasOwnProperty.call(s, p))\n                        t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign.apply(this, arguments);\n    };\n    function __rest(s, e) {\n        var t = {};\n        for (var p in s)\n            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n                t[p] = s[p];\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                    t[p[i]] = s[p[i]];\n            }\n        return t;\n    }\n    function __decorate(decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n            r = Reflect.decorate(decorators, target, key, desc);\n        else\n            for (var i = decorators.length - 1; i >= 0; i--)\n                if (d = decorators[i])\n                    r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    }\n    function __param(paramIndex, decorator) {\n        return function (target, key) { decorator(target, key, paramIndex); };\n    }\n    function __metadata(metadataKey, metadataValue) {\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n            return Reflect.metadata(metadataKey, metadataValue);\n    }\n    function __awaiter(thisArg, _arguments, P, generator) {\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n        return new (P || (P = Promise))(function (resolve, reject) {\n            function fulfilled(value) { try {\n                step(generator.next(value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function rejected(value) { try {\n                step(generator[\"throw\"](value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\n        });\n    }\n    function __generator(thisArg, body) {\n        var _ = { label: 0, sent: function () { if (t[0] & 1)\n                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n        function verb(n) { return function (v) { return step([n, v]); }; }\n        function step(op) {\n            if (f)\n                throw new TypeError(\"Generator is already executing.\");\n            while (_)\n                try {\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)\n                        return t;\n                    if (y = 0, t)\n                        op = [op[0] & 2, t.value];\n                    switch (op[0]) {\n                        case 0:\n                        case 1:\n                            t = op;\n                            break;\n                        case 4:\n                            _.label++;\n                            return { value: op[1], done: false };\n                        case 5:\n                            _.label++;\n                            y = op[1];\n                            op = [0];\n                            continue;\n                        case 7:\n                            op = _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                        default:\n                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n                                _ = 0;\n                                continue;\n                            }\n                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n                                _.label = op[1];\n                                break;\n                            }\n                            if (op[0] === 6 && _.label < t[1]) {\n                                _.label = t[1];\n                                t = op;\n                                break;\n                            }\n                            if (t && _.label < t[2]) {\n                                _.label = t[2];\n                                _.ops.push(op);\n                                break;\n                            }\n                            if (t[2])\n                                _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                    }\n                    op = body.call(thisArg, _);\n                }\n                catch (e) {\n                    op = [6, e];\n                    y = 0;\n                }\n                finally {\n                    f = t = 0;\n                }\n            if (op[0] & 5)\n                throw op[1];\n            return { value: op[0] ? op[1] : void 0, done: true };\n        }\n    }\n    var __createBinding = Object.create ? (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n    }) : (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        o[k2] = m[k];\n    });\n    function __exportStar(m, o) {\n        for (var p in m)\n            if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n                __createBinding(o, m, p);\n    }\n    function __values(o) {\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n        if (m)\n            return m.call(o);\n        if (o && typeof o.length === \"number\")\n            return {\n                next: function () {\n                    if (o && i >= o.length)\n                        o = void 0;\n                    return { value: o && o[i++], done: !o };\n                }\n            };\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n    }\n    function __read(o, n) {\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n        if (!m)\n            return o;\n        var i = m.call(o), r, ar = [], e;\n        try {\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n                ar.push(r.value);\n        }\n        catch (error) {\n            e = { error: error };\n        }\n        finally {\n            try {\n                if (r && !r.done && (m = i[\"return\"]))\n                    m.call(i);\n            }\n            finally {\n                if (e)\n                    throw e.error;\n            }\n        }\n        return ar;\n    }\n    /** @deprecated */\n    function __spread() {\n        for (var ar = [], i = 0; i < arguments.length; i++)\n            ar = ar.concat(__read(arguments[i]));\n        return ar;\n    }\n    /** @deprecated */\n    function __spreadArrays() {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n            s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    }\n    function __spreadArray(to, from, pack) {\n        if (pack || arguments.length === 2)\n            for (var i = 0, l = from.length, ar; i < l; i++) {\n                if (ar || !(i in from)) {\n                    if (!ar)\n                        ar = Array.prototype.slice.call(from, 0, i);\n                    ar[i] = from[i];\n                }\n            }\n        return to.concat(ar || from);\n    }\n    function __await(v) {\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\n    }\n    function __asyncGenerator(thisArg, _arguments, generator) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n        function verb(n) { if (g[n])\n            i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n        function resume(n, v) { try {\n            step(g[n](v));\n        }\n        catch (e) {\n            settle(q[0][3], e);\n        } }\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n        function fulfill(value) { resume(\"next\", value); }\n        function reject(value) { resume(\"throw\", value); }\n        function settle(f, v) { if (f(v), q.shift(), q.length)\n            resume(q[0][0], q[0][1]); }\n    }\n    function __asyncDelegator(o) {\n        var i, p;\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\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; }\n    }\n    function __asyncValues(o) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n    }\n    function __makeTemplateObject(cooked, raw) {\n        if (Object.defineProperty) {\n            Object.defineProperty(cooked, \"raw\", { value: raw });\n        }\n        else {\n            cooked.raw = raw;\n        }\n        return cooked;\n    }\n    ;\n    var __setModuleDefault = Object.create ? (function (o, v) {\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n    }) : function (o, v) {\n        o[\"default\"] = v;\n    };\n    function __importStar(mod) {\n        if (mod && mod.__esModule)\n            return mod;\n        var result = {};\n        if (mod != null)\n            for (var k in mod)\n                if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n                    __createBinding(result, mod, k);\n        __setModuleDefault(result, mod);\n        return result;\n    }\n    function __importDefault(mod) {\n        return (mod && mod.__esModule) ? mod : { default: mod };\n    }\n    function __classPrivateFieldGet(receiver, state, kind, f) {\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a getter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n    }\n    function __classPrivateFieldSet(receiver, state, value, kind, f) {\n        if (kind === \"m\")\n            throw new TypeError(\"Private method is not writable\");\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a setter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n    }\n\n    /**\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://angular.io/license\n     */\n    // Base URL for the error details page.\n    // Keep this value in sync with a similar const in\n    // `packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts`.\n    var ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';\n    var RuntimeError = /** @class */ (function (_super) {\n        __extends(RuntimeError, _super);\n        function RuntimeError(code, message) {\n            var _this = _super.call(this, formatRuntimeError(code, message)) || this;\n            _this.code = code;\n            return _this;\n        }\n        return RuntimeError;\n    }(Error));\n    // Contains a set of error messages that have details guides at angular.io.\n    // Full list of available error guides can be found at https://angular.io/errors\n    /* tslint:disable:no-toplevel-property-access */\n    var RUNTIME_ERRORS_WITH_GUIDES = new Set([\n        \"100\" /* EXPRESSION_CHANGED_AFTER_CHECKED */,\n        \"200\" /* CYCLIC_DI_DEPENDENCY */,\n        \"201\" /* PROVIDER_NOT_FOUND */,\n        \"300\" /* MULTIPLE_COMPONENTS_MATCH */,\n        \"301\" /* EXPORT_NOT_FOUND */,\n        \"302\" /* PIPE_NOT_FOUND */,\n    ]);\n    /* tslint:enable:no-toplevel-property-access */\n    /** Called to format a runtime error */\n    function formatRuntimeError(code, message) {\n        var fullCode = code ? \"NG0\" + code + \": \" : '';\n        var errorMessage = \"\" + fullCode + message;\n        // Some runtime errors are still thrown without `ngDevMode` (for example\n        // `throwProviderNotFoundError`), so we add `ngDevMode` check here to avoid pulling\n        // `RUNTIME_ERRORS_WITH_GUIDES` symbol into prod bundles.\n        // TODO: revisit all instances where `RuntimeError` is thrown and see if `ngDevMode` can be added\n        // there instead to tree-shake more devmode-only code (and eventually remove `ngDevMode` check\n        // from this code).\n        if (ngDevMode && RUNTIME_ERRORS_WITH_GUIDES.has(code)) {\n            errorMessage = errorMessage + \". Find more at \" + ERROR_DETAILS_PAGE_BASE_URL + \"/NG0\" + code;\n        }\n        return errorMessage;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Used for stringify render output in Ivy.\n     * Important! This function is very performance-sensitive and we should\n     * be extra careful not to introduce megamorphic reads in it.\n     * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.\n     */\n    function renderStringify(value) {\n        if (typeof value === 'string')\n            return value;\n        if (value == null)\n            return '';\n        // Use `String` so that it invokes the `toString` method of the value. Note that this\n        // appears to be faster than calling `value.toString` (see `render_stringify` benchmark).\n        return String(value);\n    }\n    /**\n     * Used to stringify a value so that it can be displayed in an error message.\n     * Important! This function contains a megamorphic read and should only be\n     * used for error messages.\n     */\n    function stringifyForError(value) {\n        if (typeof value === 'function')\n            return value.name || value.toString();\n        if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n            return value.type.name || value.type.toString();\n        }\n        return renderStringify(value);\n    }\n\n    /** Called when directives inject each other (creating a circular dependency) */\n    function throwCyclicDependencyError(token, path) {\n        var depPath = path ? \". Dependency path: \" + path.join(' > ') + \" > \" + token : '';\n        throw new RuntimeError(\"200\" /* CYCLIC_DI_DEPENDENCY */, \"Circular dependency in DI detected for \" + token + depPath);\n    }\n    function throwMixedMultiProviderError() {\n        throw new Error(\"Cannot mix multi providers and regular providers\");\n    }\n    function throwInvalidProviderError(ngModuleType, providers, provider) {\n        var ngModuleDetail = '';\n        if (ngModuleType && providers) {\n            var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });\n            ngModuleDetail =\n                \" - only instances of Provider and Type are allowed, got: [\" + providerDetail.join(', ') + \"]\";\n        }\n        throw new Error(\"Invalid provider for the NgModule '\" + stringify(ngModuleType) + \"'\" + ngModuleDetail);\n    }\n    /** Throws an error when a token is not found in DI. */\n    function throwProviderNotFoundError(token, injectorName) {\n        var injectorDetails = injectorName ? \" in \" + injectorName : '';\n        throw new RuntimeError(\"201\" /* PROVIDER_NOT_FOUND */, \"No provider for \" + stringifyForError(token) + \" found\" + injectorDetails);\n    }\n\n    /**\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://angular.io/license\n     */\n    function assertNumber(actual, msg) {\n        if (!(typeof actual === 'number')) {\n            throwError(msg, typeof actual, 'number', '===');\n        }\n    }\n    function assertNumberInRange(actual, minInclusive, maxInclusive) {\n        assertNumber(actual, 'Expected a number');\n        assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');\n        assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');\n    }\n    function assertString(actual, msg) {\n        if (!(typeof actual === 'string')) {\n            throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');\n        }\n    }\n    function assertFunction(actual, msg) {\n        if (!(typeof actual === 'function')) {\n            throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');\n        }\n    }\n    function assertEqual(actual, expected, msg) {\n        if (!(actual == expected)) {\n            throwError(msg, actual, expected, '==');\n        }\n    }\n    function assertNotEqual(actual, expected, msg) {\n        if (!(actual != expected)) {\n            throwError(msg, actual, expected, '!=');\n        }\n    }\n    function assertSame(actual, expected, msg) {\n        if (!(actual === expected)) {\n            throwError(msg, actual, expected, '===');\n        }\n    }\n    function assertNotSame(actual, expected, msg) {\n        if (!(actual !== expected)) {\n            throwError(msg, actual, expected, '!==');\n        }\n    }\n    function assertLessThan(actual, expected, msg) {\n        if (!(actual < expected)) {\n            throwError(msg, actual, expected, '<');\n        }\n    }\n    function assertLessThanOrEqual(actual, expected, msg) {\n        if (!(actual <= expected)) {\n            throwError(msg, actual, expected, '<=');\n        }\n    }\n    function assertGreaterThan(actual, expected, msg) {\n        if (!(actual > expected)) {\n            throwError(msg, actual, expected, '>');\n        }\n    }\n    function assertGreaterThanOrEqual(actual, expected, msg) {\n        if (!(actual >= expected)) {\n            throwError(msg, actual, expected, '>=');\n        }\n    }\n    function assertNotDefined(actual, msg) {\n        if (actual != null) {\n            throwError(msg, actual, null, '==');\n        }\n    }\n    function assertDefined(actual, msg) {\n        if (actual == null) {\n            throwError(msg, actual, null, '!=');\n        }\n    }\n    function throwError(msg, actual, expected, comparison) {\n        throw new Error(\"ASSERTION ERROR: \" + msg +\n            (comparison == null ? '' : \" [Expected=> \" + expected + \" \" + comparison + \" \" + actual + \" <=Actual]\"));\n    }\n    function assertDomNode(node) {\n        // If we're in a worker, `Node` will not be defined.\n        if (!(typeof Node !== 'undefined' && node instanceof Node) &&\n            !(typeof node === 'object' && node != null &&\n                node.constructor.name === 'WebWorkerRenderNode')) {\n            throwError(\"The provided value must be an instance of a DOM Node but got \" + stringify(node));\n        }\n    }\n    function assertIndexInRange(arr, index) {\n        assertDefined(arr, 'Array must be defined.');\n        var maxLen = arr.length;\n        if (index < 0 || index >= maxLen) {\n            throwError(\"Index expected to be less than \" + maxLen + \" but got \" + index);\n        }\n    }\n    function assertOneOf(value) {\n        var validValues = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            validValues[_i - 1] = arguments[_i];\n        }\n        if (validValues.indexOf(value) !== -1)\n            return true;\n        throwError(\"Expected value to be one of \" + JSON.stringify(validValues) + \" but was \" + JSON.stringify(value) + \".\");\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Construct an injectable definition which defines how a token will be constructed by the DI\n     * system, and in which injectors (if any) it will be available.\n     *\n     * This should be assigned to a static `ɵprov` field on a type, which will then be an\n     * `InjectableType`.\n     *\n     * Options:\n     * * `providedIn` determines which injectors will include the injectable, by either associating it\n     *   with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n     *   provided in the `'root'` injector, which will be the application-level injector in most apps.\n     * * `factory` gives the zero argument function which will create an instance of the injectable.\n     *   The factory can call `inject` to access the `Injector` and request injection of dependencies.\n     *\n     * @codeGenApi\n     * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.\n     */\n    function ɵɵdefineInjectable(opts) {\n        return {\n            token: opts.token,\n            providedIn: opts.providedIn || null,\n            factory: opts.factory,\n            value: undefined,\n        };\n    }\n    /**\n     * @deprecated in v8, delete after v10. This API should be used only by generated code, and that\n     * code should now use ɵɵdefineInjectable instead.\n     * @publicApi\n     */\n    var defineInjectable = ɵɵdefineInjectable;\n    /**\n     * Construct an `InjectorDef` which configures an injector.\n     *\n     * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an\n     * `InjectorType`.\n     *\n     * Options:\n     *\n     * * `providers`: an optional array of providers to add to the injector. Each provider must\n     *   either have a factory or point to a type which has a `ɵprov` static property (the\n     *   type must be an `InjectableType`).\n     * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n     *   whose providers will also be added to the injector. Locally provided types will override\n     *   providers from imports.\n     *\n     * @codeGenApi\n     */\n    function ɵɵdefineInjector(options) {\n        return { providers: options.providers || [], imports: options.imports || [] };\n    }\n    /**\n     * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading\n     * inherited value.\n     *\n     * @param type A type which may have its own (non-inherited) `ɵprov`.\n     */\n    function getInjectableDef(type) {\n        return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);\n    }\n    /**\n     * Return definition only if it is defined directly on `type` and is not inherited from a base\n     * class of `type`.\n     */\n    function getOwnDefinition(type, field) {\n        return type.hasOwnProperty(field) ? type[field] : null;\n    }\n    /**\n     * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.\n     *\n     * @param type A type which may have `ɵprov`, via inheritance.\n     *\n     * @deprecated Will be removed in a future version of Angular, where an error will occur in the\n     *     scenario if we find the `ɵprov` on an ancestor only.\n     */\n    function getInheritedInjectableDef(type) {\n        var def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);\n        if (def) {\n            var typeName = getTypeName(type);\n            // TODO(FW-1307): Re-add ngDevMode when closure can handle it\n            // ngDevMode &&\n            console.warn(\"DEPRECATED: DI is instantiating a token \\\"\" + typeName + \"\\\" that inherits its @Injectable decorator but does not provide one itself.\\n\" +\n                (\"This will become an error in a future version of Angular. Please add @Injectable() to the \\\"\" + typeName + \"\\\" class.\"));\n            return def;\n        }\n        else {\n            return null;\n        }\n    }\n    /** Gets the name of a type, accounting for some cross-browser differences. */\n    function getTypeName(type) {\n        // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n        // it'll always return the name of the function itself, no matter how many other functions it\n        // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n        // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n        // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n        // the issue by converting the function to a string and parsing its name out that way via a regex.\n        if (type.hasOwnProperty('name')) {\n            return type.name;\n        }\n        var match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n        return match === null ? '' : match[1];\n    }\n    /**\n     * Read the injector def type in a way which is immune to accidentally reading inherited value.\n     *\n     * @param type type which may have an injector def (`ɵinj`)\n     */\n    function getInjectorDef(type) {\n        return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ?\n            type[NG_INJ_DEF] :\n            null;\n    }\n    var NG_PROV_DEF = getClosureSafeProperty({ ɵprov: getClosureSafeProperty });\n    var NG_INJ_DEF = getClosureSafeProperty({ ɵinj: getClosureSafeProperty });\n    // We need to keep these around so we can read off old defs if new defs are unavailable\n    var NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty });\n    var NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty });\n\n    /**\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://angular.io/license\n     */\n    (function (InjectFlags) {\n        // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer\n        // writes exports of it into ngfactory files.\n        /** Check self and check parent injector if needed */\n        InjectFlags[InjectFlags[\"Default\"] = 0] = \"Default\";\n        /**\n         * Specifies that an injector should retrieve a dependency from any injector until reaching the\n         * host element of the current component. (Only used with Element Injector)\n         */\n        InjectFlags[InjectFlags[\"Host\"] = 1] = \"Host\";\n        /** Don't ascend to ancestors of the node requesting injection. */\n        InjectFlags[InjectFlags[\"Self\"] = 2] = \"Self\";\n        /** Skip the node that is requesting injection. */\n        InjectFlags[InjectFlags[\"SkipSelf\"] = 4] = \"SkipSelf\";\n        /** Inject `defaultValue` instead if token not found. */\n        InjectFlags[InjectFlags[\"Optional\"] = 8] = \"Optional\";\n    })(exports.InjectFlags || (exports.InjectFlags = {}));\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Current implementation of inject.\n     *\n     * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n     * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n     * way for two reasons:\n     *  1. `Injector` should not depend on ivy logic.\n     *  2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n     */\n    var _injectImplementation;\n    function getInjectImplementation() {\n        return _injectImplementation;\n    }\n    /**\n     * Sets the current inject implementation.\n     */\n    function setInjectImplementation(impl) {\n        var previous = _injectImplementation;\n        _injectImplementation = impl;\n        return previous;\n    }\n    /**\n     * Injects `root` tokens in limp mode.\n     *\n     * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n     * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n     * injectable definition.\n     */\n    function injectRootLimpMode(token, notFoundValue, flags) {\n        var injectableDef = getInjectableDef(token);\n        if (injectableDef && injectableDef.providedIn == 'root') {\n            return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :\n                injectableDef.value;\n        }\n        if (flags & exports.InjectFlags.Optional)\n            return null;\n        if (notFoundValue !== undefined)\n            return notFoundValue;\n        throwProviderNotFoundError(stringify(token), 'Injector');\n    }\n    /**\n     * Assert that `_injectImplementation` is not `fn`.\n     *\n     * This is useful, to prevent infinite recursion.\n     *\n     * @param fn Function which it should not equal to\n     */\n    function assertInjectImplementationNotEqual(fn) {\n        ngDevMode &&\n            assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Convince closure compiler that the wrapped function has no side-effects.\n     *\n     * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n     * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n     * It is important that the return value for the `noSideEffects` function be assigned\n     * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n     * compiler.\n     */\n    function noSideEffects(fn) {\n        return { toString: fn }.toString();\n    }\n\n    /**\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://angular.io/license\n     */\n    (function (ChangeDetectionStrategy) {\n        /**\n         * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n         * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n         * Change detection can still be explicitly invoked.\n         * This strategy applies to all child directives and cannot be overridden.\n         */\n        ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n        /**\n         * Use the default `CheckAlways` strategy, in which change detection is automatic until\n         * explicitly deactivated.\n         */\n        ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n    })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {}));\n    (function (ChangeDetectorStatus) {\n        /**\n         * A state in which, after calling `detectChanges()`, the change detector\n         * state becomes `Checked`, and must be explicitly invoked or reactivated.\n         */\n        ChangeDetectorStatus[ChangeDetectorStatus[\"CheckOnce\"] = 0] = \"CheckOnce\";\n        /**\n         * A state in which change detection is skipped until the change detector mode\n         * becomes `CheckOnce`.\n         */\n        ChangeDetectorStatus[ChangeDetectorStatus[\"Checked\"] = 1] = \"Checked\";\n        /**\n         * A state in which change detection continues automatically until explicitly\n         * deactivated.\n         */\n        ChangeDetectorStatus[ChangeDetectorStatus[\"CheckAlways\"] = 2] = \"CheckAlways\";\n        /**\n         * A state in which a change detector sub tree is not a part of the main tree and\n         * should be skipped.\n         */\n        ChangeDetectorStatus[ChangeDetectorStatus[\"Detached\"] = 3] = \"Detached\";\n        /**\n         * Indicates that the change detector encountered an error checking a binding\n         * or calling a directive lifecycle method and is now in an inconsistent state. Change\n         * detectors in this state do not detect changes.\n         */\n        ChangeDetectorStatus[ChangeDetectorStatus[\"Errored\"] = 4] = \"Errored\";\n        /**\n         * Indicates that the change detector has been destroyed.\n         */\n        ChangeDetectorStatus[ChangeDetectorStatus[\"Destroyed\"] = 5] = \"Destroyed\";\n    })(exports.ɵChangeDetectorStatus || (exports.ɵChangeDetectorStatus = {}));\n    /**\n     * Reports whether a given strategy is currently the default for change detection.\n     * @param changeDetectionStrategy The strategy to check.\n     * @returns True if the given strategy is the current default, false otherwise.\n     * @see `ChangeDetectorStatus`\n     * @see `ChangeDetectorRef`\n     */\n    function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {\n        return changeDetectionStrategy == null ||\n            changeDetectionStrategy === exports.ChangeDetectionStrategy.Default;\n    }\n\n    /**\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://angular.io/license\n     */\n    (function (ViewEncapsulation) {\n        /**\n         * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host\n         * Element and pre-processing the style rules provided via {@link Component#styles styles} or\n         * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all\n         * selectors.\n         *\n         * This is the default option.\n         */\n        ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n        // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n        /**\n         * Don't provide any template or style encapsulation.\n         */\n        ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n        /**\n         * Use Shadow DOM to encapsulate styles.\n         *\n         * For the DOM this means using modern [Shadow\n         * DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) and\n         * creating a ShadowRoot for Component's Host Element.\n         */\n        ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n    })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {}));\n\n    /**\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://angular.io/license\n     */\n    var __globalThis = typeof globalThis !== 'undefined' && globalThis;\n    var __window = typeof window !== 'undefined' && window;\n    var __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n        self instanceof WorkerGlobalScope && self;\n    var __global = typeof global !== 'undefined' && global;\n    // Always use __globalThis if available, which is the spec-defined global variable across all\n    // environments, then fallback to __global first, because in Node tests both __global and\n    // __window may be defined and _global should be __global in that case.\n    var _global = __globalThis || __global || __window || __self;\n\n    /**\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://angular.io/license\n     */\n    function ngDevModeResetPerfCounters() {\n        var locationString = typeof location !== 'undefined' ? location.toString() : '';\n        var newCounters = {\n            namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1,\n            firstCreatePass: 0,\n            tNode: 0,\n            tView: 0,\n            rendererCreateTextNode: 0,\n            rendererSetText: 0,\n            rendererCreateElement: 0,\n            rendererAddEventListener: 0,\n            rendererSetAttribute: 0,\n            rendererRemoveAttribute: 0,\n            rendererSetProperty: 0,\n            rendererSetClassName: 0,\n            rendererAddClass: 0,\n            rendererRemoveClass: 0,\n            rendererSetStyle: 0,\n            rendererRemoveStyle: 0,\n            rendererDestroy: 0,\n            rendererDestroyNode: 0,\n            rendererMoveNode: 0,\n            rendererRemoveNode: 0,\n            rendererAppendChild: 0,\n            rendererInsertBefore: 0,\n            rendererCreateComment: 0,\n        };\n        // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n        var allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;\n        _global['ngDevMode'] = allowNgDevModeTrue && newCounters;\n        return newCounters;\n    }\n    /**\n     * This function checks to see if the `ngDevMode` has been set. If yes,\n     * then we honor it, otherwise we default to dev mode with additional checks.\n     *\n     * The idea is that unless we are doing production build where we explicitly\n     * set `ngDevMode == false` we should be helping the developer by providing\n     * as much early warning and errors as possible.\n     *\n     * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions\n     * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode\n     * is defined for the entire instruction set.\n     *\n     * When checking `ngDevMode` on toplevel, always init it before referencing it\n     * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can\n     *  get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.\n     *\n     * Details on possible values for `ngDevMode` can be found on its docstring.\n     *\n     * NOTE:\n     * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.\n     */\n    function initNgDevMode() {\n        // The below checks are to ensure that calling `initNgDevMode` multiple times does not\n        // reset the counters.\n        // If the `ngDevMode` is not an object, then it means we have not created the perf counters\n        // yet.\n        if (typeof ngDevMode === 'undefined' || ngDevMode) {\n            if (typeof ngDevMode !== 'object') {\n                ngDevModeResetPerfCounters();\n            }\n            return typeof ngDevMode !== 'undefined' && !!ngDevMode;\n        }\n        return false;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This file contains reuseable \"empty\" symbols that can be used as default return values\n     * in different parts of the rendering code. Because the same symbols are returned, this\n     * allows for identity checks against these values to be consistently used by the framework\n     * code.\n     */\n    var EMPTY_OBJ = {};\n    var EMPTY_ARRAY = [];\n    // freezing the values prevents any code from accidentally inserting new values in\n    if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {\n        // These property accesses can be ignored because ngDevMode will be set to false\n        // when optimizing code and the whole if statement will be dropped.\n        // tslint:disable-next-line:no-toplevel-property-access\n        Object.freeze(EMPTY_OBJ);\n        // tslint:disable-next-line:no-toplevel-property-access\n        Object.freeze(EMPTY_ARRAY);\n    }\n\n    /**\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://angular.io/license\n     */\n    var NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty });\n    var NG_DIR_DEF = getClosureSafeProperty({ ɵdir: getClosureSafeProperty });\n    var NG_PIPE_DEF = getClosureSafeProperty({ ɵpipe: getClosureSafeProperty });\n    var NG_MOD_DEF = getClosureSafeProperty({ ɵmod: getClosureSafeProperty });\n    var NG_LOC_ID_DEF = getClosureSafeProperty({ ɵloc: getClosureSafeProperty });\n    var NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty });\n    /**\n     * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n     * the key and the directive's unique ID as the value. This allows us to map directives to their\n     * bloom filter bit for DI.\n     */\n    // TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.\n    var NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });\n\n    /**\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://angular.io/license\n     */\n    var _renderCompCount = 0;\n    /**\n     * Create a component definition object.\n     *\n     *\n     * # Example\n     * ```\n     * class MyDirective {\n     *   // Generated by Angular Template Compiler\n     *   // [Symbol] syntax will not be supported by TypeScript until v2.7\n     *   static ɵcmp = defineComponent({\n     *     ...\n     *   });\n     * }\n     * ```\n     * @codeGenApi\n     */\n    function ɵɵdefineComponent(componentDefinition) {\n        return noSideEffects(function () {\n            // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n            // See the `initNgDevMode` docstring for more information.\n            (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n            var type = componentDefinition.type;\n            var declaredInputs = {};\n            var def = {\n                type: type,\n                providersResolver: null,\n                decls: componentDefinition.decls,\n                vars: componentDefinition.vars,\n                factory: null,\n                template: componentDefinition.template || null,\n                consts: componentDefinition.consts || null,\n                ngContentSelectors: componentDefinition.ngContentSelectors,\n                hostBindings: componentDefinition.hostBindings || null,\n                hostVars: componentDefinition.hostVars || 0,\n                hostAttrs: componentDefinition.hostAttrs || null,\n                contentQueries: componentDefinition.contentQueries || null,\n                declaredInputs: declaredInputs,\n                inputs: null,\n                outputs: null,\n                exportAs: componentDefinition.exportAs || null,\n                onPush: componentDefinition.changeDetection === exports.ChangeDetectionStrategy.OnPush,\n                directiveDefs: null,\n                pipeDefs: null,\n                selectors: componentDefinition.selectors || EMPTY_ARRAY,\n                viewQuery: componentDefinition.viewQuery || null,\n                features: componentDefinition.features || null,\n                data: componentDefinition.data || {},\n                // TODO(misko): convert ViewEncapsulation into const enum so that it can be used\n                // directly in the next line. Also `None` should be 0 not 2.\n                encapsulation: componentDefinition.encapsulation || exports.ViewEncapsulation.Emulated,\n                id: 'c',\n                styles: componentDefinition.styles || EMPTY_ARRAY,\n                _: null,\n                setInput: null,\n                schemas: componentDefinition.schemas || null,\n                tView: null,\n            };\n            var directiveTypes = componentDefinition.directives;\n            var feature = componentDefinition.features;\n            var pipeTypes = componentDefinition.pipes;\n            def.id += _renderCompCount++;\n            def.inputs = invertObject(componentDefinition.inputs, declaredInputs),\n                def.outputs = invertObject(componentDefinition.outputs),\n                feature && feature.forEach(function (fn) { return fn(def); });\n            def.directiveDefs = directiveTypes ?\n                function () { return (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)\n                    .map(extractDirectiveDef); } :\n                null;\n            def.pipeDefs = pipeTypes ?\n                function () { return (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef); } :\n                null;\n            return def;\n        });\n    }\n    /**\n     * Generated next to NgModules to monkey-patch directive and pipe references onto a component's\n     * definition, when generating a direct reference in the component file would otherwise create an\n     * import cycle.\n     *\n     * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsetComponentScope(type, directives, pipes) {\n        var def = type.ɵcmp;\n        def.directiveDefs = function () { return directives.map(extractDirectiveDef); };\n        def.pipeDefs = function () { return pipes.map(extractPipeDef); };\n    }\n    function extractDirectiveDef(type) {\n        var def = getComponentDef(type) || getDirectiveDef(type);\n        if (ngDevMode && !def) {\n            throw new Error(\"'\" + type.name + \"' is neither 'ComponentType' or 'DirectiveType'.\");\n        }\n        return def;\n    }\n    function extractPipeDef(type) {\n        var def = getPipeDef(type);\n        if (ngDevMode && !def) {\n            throw new Error(\"'\" + type.name + \"' is not a 'PipeType'.\");\n        }\n        return def;\n    }\n    var autoRegisterModuleById = {};\n    /**\n     * @codeGenApi\n     */\n    function ɵɵdefineNgModule(def) {\n        return noSideEffects(function () {\n            var res = {\n                type: def.type,\n                bootstrap: def.bootstrap || EMPTY_ARRAY,\n                declarations: def.declarations || EMPTY_ARRAY,\n                imports: def.imports || EMPTY_ARRAY,\n                exports: def.exports || EMPTY_ARRAY,\n                transitiveCompileScopes: null,\n                schemas: def.schemas || null,\n                id: def.id || null,\n            };\n            if (def.id != null) {\n                autoRegisterModuleById[def.id] = def.type;\n            }\n            return res;\n        });\n    }\n    /**\n     * Adds the module metadata that is necessary to compute the module's transitive scope to an\n     * existing module definition.\n     *\n     * Scope metadata of modules is not used in production builds, so calls to this function can be\n     * marked pure to tree-shake it from the bundle, allowing for all referenced declarations\n     * to become eligible for tree-shaking as well.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsetNgModuleScope(type, scope) {\n        return noSideEffects(function () {\n            var ngModuleDef = getNgModuleDef(type, true);\n            ngModuleDef.declarations = scope.declarations || EMPTY_ARRAY;\n            ngModuleDef.imports = scope.imports || EMPTY_ARRAY;\n            ngModuleDef.exports = scope.exports || EMPTY_ARRAY;\n        });\n    }\n    /**\n     * Inverts an inputs or outputs lookup such that the keys, which were the\n     * minified keys, are part of the values, and the values are parsed so that\n     * the publicName of the property is the new key\n     *\n     * e.g. for\n     *\n     * ```\n     * class Comp {\n     *   @Input()\n     *   propName1: string;\n     *\n     *   @Input('publicName2')\n     *   declaredPropName2: number;\n     * }\n     * ```\n     *\n     * will be serialized as\n     *\n     * ```\n     * {\n     *   propName1: 'propName1',\n     *   declaredPropName2: ['publicName2', 'declaredPropName2'],\n     * }\n     * ```\n     *\n     * which is than translated by the minifier as:\n     *\n     * ```\n     * {\n     *   minifiedPropName1: 'propName1',\n     *   minifiedPropName2: ['publicName2', 'declaredPropName2'],\n     * }\n     * ```\n     *\n     * becomes: (public name => minifiedName)\n     *\n     * ```\n     * {\n     *  'propName1': 'minifiedPropName1',\n     *  'publicName2': 'minifiedPropName2',\n     * }\n     * ```\n     *\n     * Optionally the function can take `secondary` which will result in: (public name => declared name)\n     *\n     * ```\n     * {\n     *  'propName1': 'propName1',\n     *  'publicName2': 'declaredPropName2',\n     * }\n     * ```\n     *\n\n     */\n    function invertObject(obj, secondary) {\n        if (obj == null)\n            return EMPTY_OBJ;\n        var newLookup = {};\n        for (var minifiedKey in obj) {\n            if (obj.hasOwnProperty(minifiedKey)) {\n                var publicName = obj[minifiedKey];\n                var declaredName = publicName;\n                if (Array.isArray(publicName)) {\n                    declaredName = publicName[1];\n                    publicName = publicName[0];\n                }\n                newLookup[publicName] = minifiedKey;\n                if (secondary) {\n                    (secondary[publicName] = declaredName);\n                }\n            }\n        }\n        return newLookup;\n    }\n    /**\n     * Create a directive definition object.\n     *\n     * # Example\n     * ```ts\n     * class MyDirective {\n     *   // Generated by Angular Template Compiler\n     *   // [Symbol] syntax will not be supported by TypeScript until v2.7\n     *   static ɵdir = ɵɵdefineDirective({\n     *     ...\n     *   });\n     * }\n     * ```\n     *\n     * @codeGenApi\n     */\n    var ɵɵdefineDirective = ɵɵdefineComponent;\n    /**\n     * Create a pipe definition object.\n     *\n     * # Example\n     * ```\n     * class MyPipe implements PipeTransform {\n     *   // Generated by Angular Template Compiler\n     *   static ɵpipe = definePipe({\n     *     ...\n     *   });\n     * }\n     * ```\n     * @param pipeDef Pipe definition generated by the compiler\n     *\n     * @codeGenApi\n     */\n    function ɵɵdefinePipe(pipeDef) {\n        return {\n            type: pipeDef.type,\n            name: pipeDef.name,\n            factory: null,\n            pure: pipeDef.pure !== false,\n            onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n        };\n    }\n    /**\n     * The following getter methods retrieve the definition from the type. Currently the retrieval\n     * honors inheritance, but in the future we may change the rule to require that definitions are\n     * explicit. This would require some sort of migration strategy.\n     */\n    function getComponentDef(type) {\n        return type[NG_COMP_DEF] || null;\n    }\n    function getDirectiveDef(type) {\n        return type[NG_DIR_DEF] || null;\n    }\n    function getPipeDef(type) {\n        return type[NG_PIPE_DEF] || null;\n    }\n    function getNgModuleDef(type, throwNotFound) {\n        var ngModuleDef = type[NG_MOD_DEF] || null;\n        if (!ngModuleDef && throwNotFound === true) {\n            throw new Error(\"Type \" + stringify(type) + \" does not have '\\u0275mod' property.\");\n        }\n        return ngModuleDef;\n    }\n    function getNgLocaleIdDef(type) {\n        return type[NG_LOC_ID_DEF] || null;\n    }\n\n    /**\n     * Special location which allows easy identification of type. If we have an array which was\n     * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is\n     * `LContainer`.\n     */\n    var TYPE = 1;\n    /**\n     * Below are constants for LContainer indices to help us look up LContainer members\n     * without having to remember the specific indices.\n     * Uglify will inline these when minifying so there shouldn't be a cost.\n     */\n    /**\n     * Flag to signify that this `LContainer` may have transplanted views which need to be change\n     * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.\n     *\n     * This flag, once set, is never unset for the `LContainer`. This means that when unset we can skip\n     * a lot of work in `refreshEmbeddedViews`. But when set we still need to verify\n     * that the `MOVED_VIEWS` are transplanted and on-push.\n     */\n    var HAS_TRANSPLANTED_VIEWS = 2;\n    // PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5\n    // As we already have these constants in LView, we don't need to re-create them.\n    // T_HOST is index 6\n    // We already have this constants in LView, we don't need to re-create it.\n    var NATIVE = 7;\n    var VIEW_REFS = 8;\n    var MOVED_VIEWS = 9;\n    /**\n     * Size of LContainer's header. Represents the index after which all views in the\n     * container will be inserted. We need to keep a record of current views so we know\n     * which views are already in the DOM (and don't need to be re-added) and so we can\n     * remove views from the DOM when they are no longer required.\n     */\n    var CONTAINER_HEADER_OFFSET = 10;\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd = 1;\n\n    /**\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://angular.io/license\n     */\n    // Below are constants for LView indices to help us look up LView members\n    // without having to remember the specific indices.\n    // Uglify will inline these when minifying so there shouldn't be a cost.\n    var HOST = 0;\n    var TVIEW = 1;\n    var FLAGS = 2;\n    var PARENT = 3;\n    var NEXT = 4;\n    var TRANSPLANTED_VIEWS_TO_REFRESH = 5;\n    var T_HOST = 6;\n    var CLEANUP = 7;\n    var CONTEXT = 8;\n    var INJECTOR = 9;\n    var RENDERER_FACTORY = 10;\n    var RENDERER = 11;\n    var SANITIZER = 12;\n    var CHILD_HEAD = 13;\n    var CHILD_TAIL = 14;\n    // FIXME(misko): Investigate if the three declarations aren't all same thing.\n    var DECLARATION_VIEW = 15;\n    var DECLARATION_COMPONENT_VIEW = 16;\n    var DECLARATION_LCONTAINER = 17;\n    var PREORDER_HOOK_FLAGS = 18;\n    var QUERIES = 19;\n    /**\n     * Size of LView's header. Necessary to adjust for it when setting slots.\n     *\n     * IMPORTANT: `HEADER_OFFSET` should only be referred to the in the `ɵɵ*` instructions to translate\n     * instruction index into `LView` index. All other indexes should be in the `LView` index space and\n     * there should be no need to refer to `HEADER_OFFSET` anywhere else.\n     */\n    var HEADER_OFFSET = 20;\n    /**\n     * Converts `TViewType` into human readable text.\n     * Make sure this matches with `TViewType`\n     */\n    var TViewTypeAsString = [\n        'Root',\n        'Component',\n        'Embedded', // 2\n    ];\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$1 = 1;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * True if `value` is `LView`.\n     * @param value wrapped value of `RNode`, `LView`, `LContainer`\n     */\n    function isLView(value) {\n        return Array.isArray(value) && typeof value[TYPE] === 'object';\n    }\n    /**\n     * True if `value` is `LContainer`.\n     * @param value wrapped value of `RNode`, `LView`, `LContainer`\n     */\n    function isLContainer(value) {\n        return Array.isArray(value) && value[TYPE] === true;\n    }\n    function isContentQueryHost(tNode) {\n        return (tNode.flags & 8 /* hasContentQuery */) !== 0;\n    }\n    function isComponentHost(tNode) {\n        return (tNode.flags & 2 /* isComponentHost */) === 2 /* isComponentHost */;\n    }\n    function isDirectiveHost(tNode) {\n        return (tNode.flags & 1 /* isDirectiveHost */) === 1 /* isDirectiveHost */;\n    }\n    function isComponentDef(def) {\n        return def.template !== null;\n    }\n    function isRootView(target) {\n        return (target[FLAGS] & 512 /* IsRoot */) !== 0;\n    }\n\n    /**\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://angular.io/license\n     */\n    // [Assert functions do not constraint type when they are guarded by a truthy\n    // expression.](https://github.com/microsoft/TypeScript/issues/37295)\n    function assertTNodeForLView(tNode, lView) {\n        assertTNodeForTView(tNode, lView[TVIEW]);\n    }\n    function assertTNodeForTView(tNode, tView) {\n        assertTNode(tNode);\n        tNode.hasOwnProperty('tView_') &&\n            assertEqual(tNode.tView_, tView, 'This TNode does not belong to this TView.');\n    }\n    function assertTNode(tNode) {\n        assertDefined(tNode, 'TNode must be defined');\n        if (!(tNode && typeof tNode === 'object' && tNode.hasOwnProperty('directiveStylingLast'))) {\n            throwError('Not of type TNode, got: ' + tNode);\n        }\n    }\n    function assertTIcu(tIcu) {\n        assertDefined(tIcu, 'Expected TIcu to be defined');\n        if (!(typeof tIcu.currentCaseLViewIndex === 'number')) {\n            throwError('Object is not of TIcu type.');\n        }\n    }\n    function assertComponentType(actual, msg) {\n        if (msg === void 0) { msg = 'Type passed in is not ComponentType, it does not have \\'ɵcmp\\' property.'; }\n        if (!getComponentDef(actual)) {\n            throwError(msg);\n        }\n    }\n    function assertNgModuleType(actual, msg) {\n        if (msg === void 0) { msg = 'Type passed in is not NgModuleType, it does not have \\'ɵmod\\' property.'; }\n        if (!getNgModuleDef(actual)) {\n            throwError(msg);\n        }\n    }\n    function assertCurrentTNodeIsParent(isParent) {\n        assertEqual(isParent, true, 'currentTNode should be a parent');\n    }\n    function assertHasParent(tNode) {\n        assertDefined(tNode, 'currentTNode should exist!');\n        assertDefined(tNode.parent, 'currentTNode should have a parent');\n    }\n    function assertDataNext(lView, index, arr) {\n        if (arr == null)\n            arr = lView;\n        assertEqual(arr.length, index, \"index \" + index + \" expected to be at the end of arr (length \" + arr.length + \")\");\n    }\n    function assertLContainer(value) {\n        assertDefined(value, 'LContainer must be defined');\n        assertEqual(isLContainer(value), true, 'Expecting LContainer');\n    }\n    function assertLViewOrUndefined(value) {\n        value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null');\n    }\n    function assertLView(value) {\n        assertDefined(value, 'LView must be defined');\n        assertEqual(isLView(value), true, 'Expecting LView');\n    }\n    function assertFirstCreatePass(tView, errMessage) {\n        assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.');\n    }\n    function assertFirstUpdatePass(tView, errMessage) {\n        assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.');\n    }\n    /**\n     * This is a basic sanity check that an object is probably a directive def. DirectiveDef is\n     * an interface, so we can't do a direct instanceof check.\n     */\n    function assertDirectiveDef(obj) {\n        if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {\n            throwError(\"Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.\");\n        }\n    }\n    function assertIndexInDeclRange(lView, index) {\n        var tView = lView[1];\n        assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);\n    }\n    function assertIndexInVarsRange(lView, index) {\n        var tView = lView[1];\n        assertBetween(tView.bindingStartIndex, tView.expandoStartIndex, index);\n    }\n    function assertIndexInExpandoRange(lView, index) {\n        var tView = lView[1];\n        assertBetween(tView.expandoStartIndex, lView.length, index);\n    }\n    function assertBetween(lower, upper, index) {\n        if (!(lower <= index && index < upper)) {\n            throwError(\"Index out of range (expecting \" + lower + \" <= \" + index + \" < \" + upper + \")\");\n        }\n    }\n    function assertProjectionSlots(lView, errMessage) {\n        assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');\n        assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage ||\n            'Components with projection nodes (<ng-content>) must have projection slots defined.');\n    }\n    function assertParentView(lView, errMessage) {\n        assertDefined(lView, errMessage || 'Component views should always have a parent view (component\\'s host view)');\n    }\n    /**\n     * This is a basic sanity check that the `injectorIndex` seems to point to what looks like a\n     * NodeInjector data structure.\n     *\n     * @param lView `LView` which should be checked.\n     * @param injectorIndex index into the `LView` where the `NodeInjector` is expected.\n     */\n    function assertNodeInjector(lView, injectorIndex) {\n        assertIndexInExpandoRange(lView, injectorIndex);\n        assertIndexInExpandoRange(lView, injectorIndex + 8 /* PARENT */);\n        assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 3], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 4], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');\n        assertNumber(lView[injectorIndex + 8 /* PARENT */], 'injectorIndex should point to parent injector');\n    }\n\n    /**\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://angular.io/license\n     */\n    function getFactoryDef(type, throwNotFound) {\n        var hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);\n        if (!hasFactoryDef && throwNotFound === true && ngDevMode) {\n            throw new Error(\"Type \" + stringify(type) + \" does not have '\\u0275fac' property.\");\n        }\n        return hasFactoryDef ? type[NG_FACTORY_DEF] : null;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Represents a basic change from a previous to a new value for a single\n     * property on a directive instance. Passed as a value in a\n     * {@link SimpleChanges} object to the `ngOnChanges` hook.\n     *\n     * @see `OnChanges`\n     *\n     * @publicApi\n     */\n    var SimpleChange = /** @class */ (function () {\n        function SimpleChange(previousValue, currentValue, firstChange) {\n            this.previousValue = previousValue;\n            this.currentValue = currentValue;\n            this.firstChange = firstChange;\n        }\n        /**\n         * Check whether the new value is the first value assigned.\n         */\n        SimpleChange.prototype.isFirstChange = function () {\n            return this.firstChange;\n        };\n        return SimpleChange;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n     * lifecycle hook, so it should be included in any component that implements\n     * that hook.\n     *\n     * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n     * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n     * inherited properties will not be propagated to the ngOnChanges lifecycle\n     * hook.\n     *\n     * Example usage:\n     *\n     * ```\n     * static ɵcmp = defineComponent({\n     *   ...\n     *   inputs: {name: 'publicName'},\n     *   features: [NgOnChangesFeature]\n     * });\n     * ```\n     *\n     * @codeGenApi\n     */\n    function ɵɵNgOnChangesFeature() {\n        return NgOnChangesFeatureImpl;\n    }\n    function NgOnChangesFeatureImpl(definition) {\n        if (definition.type.prototype.ngOnChanges) {\n            definition.setInput = ngOnChangesSetInput;\n        }\n        return rememberChangeHistoryAndInvokeOnChangesHook;\n    }\n    // This option ensures that the ngOnChanges lifecycle hook will be inherited\n    // from superclasses (in InheritDefinitionFeature).\n    /** @nocollapse */\n    // tslint:disable-next-line:no-toplevel-property-access\n    ɵɵNgOnChangesFeature.ngInherit = true;\n    /**\n     * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n     * `ngOnChanges`.\n     *\n     * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n     * found it invokes `ngOnChanges` on the component instance.\n     *\n     * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n     *     it is guaranteed to be called with component instance.\n     */\n    function rememberChangeHistoryAndInvokeOnChangesHook() {\n        var simpleChangesStore = getSimpleChangesStore(this);\n        var current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n        if (current) {\n            var previous = simpleChangesStore.previous;\n            if (previous === EMPTY_OBJ) {\n                simpleChangesStore.previous = current;\n            }\n            else {\n                // New changes are copied to the previous store, so that we don't lose history for inputs\n                // which were not changed this time\n                for (var key in current) {\n                    previous[key] = current[key];\n                }\n            }\n            simpleChangesStore.current = null;\n            this.ngOnChanges(current);\n        }\n    }\n    function ngOnChangesSetInput(instance, value, publicName, privateName) {\n        var simpleChangesStore = getSimpleChangesStore(instance) ||\n            setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });\n        var current = simpleChangesStore.current || (simpleChangesStore.current = {});\n        var previous = simpleChangesStore.previous;\n        var declaredName = this.declaredInputs[publicName];\n        var previousChange = previous[declaredName];\n        current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n        instance[privateName] = value;\n    }\n    var SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\n    function getSimpleChangesStore(instance) {\n        return instance[SIMPLE_CHANGES_STORE] || null;\n    }\n    function setSimpleChangesStore(instance, store) {\n        return instance[SIMPLE_CHANGES_STORE] = store;\n    }\n\n    /**\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://angular.io/license\n     */\n    var profilerCallback = null;\n    /**\n     * Sets the callback function which will be invoked before and after performing certain actions at\n     * runtime (for example, before and after running change detection).\n     *\n     * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n     * The contract of the function might be changed in any release and/or the function can be removed\n     * completely.\n     *\n     * @param profiler function provided by the caller or null value to disable profiling.\n     */\n    var setProfiler = function (profiler) {\n        profilerCallback = profiler;\n    };\n    /**\n     * Profiler function which wraps user code executed by the runtime.\n     *\n     * @param event ProfilerEvent corresponding to the execution context\n     * @param instance component instance\n     * @param hookOrListener lifecycle hook function or output listener. The value depends on the\n     *  execution context\n     * @returns\n     */\n    var profiler = function (event, instance, hookOrListener) {\n        if (profilerCallback != null /* both `null` and `undefined` */) {\n            profilerCallback(event, instance, hookOrListener);\n        }\n    };\n\n    /**\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://angular.io/license\n     */\n    var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n    var MATH_ML_NAMESPACE = 'http://www.w3.org/1998/MathML/';\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n     * inject the `DOCUMENT` token and are done.\n     *\n     * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n     * way.\n     *\n     * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n     * Wherever ivy needs the global document, it calls `getDocument()` instead.\n     *\n     * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n     * tell ivy what the global `document` is.\n     *\n     * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)\n     * by calling `setDocument()` when providing the `DOCUMENT` token.\n     */\n    var DOCUMENT = undefined;\n    /**\n     * Tell ivy what the `document` is for this platform.\n     *\n     * It is only necessary to call this if the current platform is not a browser.\n     *\n     * @param document The object representing the global `document` in this environment.\n     */\n    function setDocument(document) {\n        DOCUMENT = document;\n    }\n    /**\n     * Access the object that represents the `document` for this platform.\n     *\n     * Ivy calls this whenever it needs to access the `document` object.\n     * For example to create the renderer or to do sanitization.\n     */\n    function getDocument() {\n        if (DOCUMENT !== undefined) {\n            return DOCUMENT;\n        }\n        else if (typeof document !== 'undefined') {\n            return document;\n        }\n        // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n        // the current platform is not a browser. Since this is not a supported scenario at the moment\n        // this should not happen in Angular apps.\n        // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n        // public API. Meanwhile we just return `undefined` and let the application fail.\n        return undefined;\n    }\n\n    /**\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://angular.io/license\n     */\n    // TODO: cleanup once the code is merged in angular/angular\n    var RendererStyleFlags3;\n    (function (RendererStyleFlags3) {\n        RendererStyleFlags3[RendererStyleFlags3[\"Important\"] = 1] = \"Important\";\n        RendererStyleFlags3[RendererStyleFlags3[\"DashCase\"] = 2] = \"DashCase\";\n    })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));\n    /** Returns whether the `renderer` is a `ProceduralRenderer3` */\n    function isProceduralRenderer(renderer) {\n        return !!(renderer.listen);\n    }\n    var ɵ0 = function (hostElement, rendererType) {\n        return getDocument();\n    };\n    var domRendererFactory3 = {\n        createRenderer: ɵ0\n    };\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$2 = 1;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)\n     * in same location in `LView`. This is because we don't want to pre-allocate space for it\n     * because the storage is sparse. This file contains utilities for dealing with such data types.\n     *\n     * How do we know what is stored at a given location in `LView`.\n     * - `Array.isArray(value) === false` => `RNode` (The normal storage value)\n     * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.\n     *   - `typeof value[TYPE] === 'object'` => `LView`\n     *      - This happens when we have a component at a given location\n     *   - `typeof value[TYPE] === true` => `LContainer`\n     *      - This happens when we have `LContainer` binding at a given location.\n     *\n     *\n     * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.\n     */\n    /**\n     * Returns `RNode`.\n     * @param value wrapped value of `RNode`, `LView`, `LContainer`\n     */\n    function unwrapRNode(value) {\n        while (Array.isArray(value)) {\n            value = value[HOST];\n        }\n        return value;\n    }\n    /**\n     * Returns `LView` or `null` if not found.\n     * @param value wrapped value of `RNode`, `LView`, `LContainer`\n     */\n    function unwrapLView(value) {\n        while (Array.isArray(value)) {\n            // This check is same as `isLView()` but we don't call at as we don't want to call\n            // `Array.isArray()` twice and give JITer more work for inlining.\n            if (typeof value[TYPE] === 'object')\n                return value;\n            value = value[HOST];\n        }\n        return null;\n    }\n    /**\n     * Returns `LContainer` or `null` if not found.\n     * @param value wrapped value of `RNode`, `LView`, `LContainer`\n     */\n    function unwrapLContainer(value) {\n        while (Array.isArray(value)) {\n            // This check is same as `isLContainer()` but we don't call at as we don't want to call\n            // `Array.isArray()` twice and give JITer more work for inlining.\n            if (value[TYPE] === true)\n                return value;\n            value = value[HOST];\n        }\n        return null;\n    }\n    /**\n     * Retrieves an element value from the provided `viewData`, by unwrapping\n     * from any containers, component views, or style contexts.\n     */\n    function getNativeByIndex(index, lView) {\n        ngDevMode && assertIndexInRange(lView, index);\n        ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');\n        return unwrapRNode(lView[index]);\n    }\n    /**\n     * Retrieve an `RNode` for a given `TNode` and `LView`.\n     *\n     * This function guarantees in dev mode to retrieve a non-null `RNode`.\n     *\n     * @param tNode\n     * @param lView\n     */\n    function getNativeByTNode(tNode, lView) {\n        ngDevMode && assertTNodeForLView(tNode, lView);\n        ngDevMode && assertIndexInRange(lView, tNode.index);\n        var node = unwrapRNode(lView[tNode.index]);\n        ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);\n        return node;\n    }\n    /**\n     * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.\n     *\n     * Some `TNode`s don't have associated `RNode`s. For example `Projection`\n     *\n     * @param tNode\n     * @param lView\n     */\n    function getNativeByTNodeOrNull(tNode, lView) {\n        var index = tNode === null ? -1 : tNode.index;\n        if (index !== -1) {\n            ngDevMode && assertTNodeForLView(tNode, lView);\n            var node = unwrapRNode(lView[index]);\n            ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);\n            return node;\n        }\n        return null;\n    }\n    // fixme(misko): The return Type should be `TNode|null`\n    function getTNode(tView, index) {\n        ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n        ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');\n        var tNode = tView.data[index];\n        ngDevMode && tNode !== null && assertTNode(tNode);\n        return tNode;\n    }\n    /** Retrieves a value from any `LView` or `TData`. */\n    function load(view, index) {\n        ngDevMode && assertIndexInRange(view, index);\n        return view[index];\n    }\n    function getComponentLViewByIndex(nodeIndex, hostView) {\n        // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n        ngDevMode && assertIndexInRange(hostView, nodeIndex);\n        var slotValue = hostView[nodeIndex];\n        var lView = isLView(slotValue) ? slotValue : slotValue[HOST];\n        return lView;\n    }\n    /** Checks whether a given view is in creation mode */\n    function isCreationMode(view) {\n        return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;\n    }\n    /**\n     * Returns a boolean for whether the view is attached to the change detection tree.\n     *\n     * Note: This determines whether a view should be checked, not whether it's inserted\n     * into a container. For that, you'll want `viewAttachedToContainer` below.\n     */\n    function viewAttachedToChangeDetector(view) {\n        return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;\n    }\n    /** Returns a boolean for whether the view is attached to a container. */\n    function viewAttachedToContainer(view) {\n        return isLContainer(view[PARENT]);\n    }\n    function getConstant(consts, index) {\n        if (index === null || index === undefined)\n            return null;\n        ngDevMode && assertIndexInRange(consts, index);\n        return consts[index];\n    }\n    /**\n     * Resets the pre-order hook flags of the view.\n     * @param lView the LView on which the flags are reset\n     */\n    function resetPreOrderHookFlags(lView) {\n        lView[PREORDER_HOOK_FLAGS] = 0;\n    }\n    /**\n     * Updates the `TRANSPLANTED_VIEWS_TO_REFRESH` counter on the `LContainer` as well as the parents\n     * whose\n     *  1. counter goes from 0 to 1, indicating that there is a new child that has a view to refresh\n     *  or\n     *  2. counter goes from 1 to 0, indicating there are no more descendant views to refresh\n     */\n    function updateTransplantedViewCount(lContainer, amount) {\n        lContainer[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;\n        var viewOrContainer = lContainer;\n        var parent = lContainer[PARENT];\n        while (parent !== null &&\n            ((amount === 1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 1) ||\n                (amount === -1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 0))) {\n            parent[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;\n            viewOrContainer = parent;\n            parent = parent[PARENT];\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var instructionState = {\n        lFrame: createLFrame(null),\n        bindingsEnabled: true,\n        isInCheckNoChangesMode: false,\n    };\n    /**\n     * Returns true if the instruction state stack is empty.\n     *\n     * Intended to be called from tests only (tree shaken otherwise).\n     */\n    function specOnlyIsInstructionStateEmpty() {\n        return instructionState.lFrame.parent === null;\n    }\n    function getElementDepthCount() {\n        return instructionState.lFrame.elementDepthCount;\n    }\n    function increaseElementDepthCount() {\n        instructionState.lFrame.elementDepthCount++;\n    }\n    function decreaseElementDepthCount() {\n        instructionState.lFrame.elementDepthCount--;\n    }\n    function getBindingsEnabled() {\n        return instructionState.bindingsEnabled;\n    }\n    /**\n     * Enables directive matching on elements.\n     *\n     *  * Example:\n     * ```\n     * <my-comp my-directive>\n     *   Should match component / directive.\n     * </my-comp>\n     * <div ngNonBindable>\n     *   <!-- ɵɵdisableBindings() -->\n     *   <my-comp my-directive>\n     *     Should not match component / directive because we are in ngNonBindable.\n     *   </my-comp>\n     *   <!-- ɵɵenableBindings() -->\n     * </div>\n     * ```\n     *\n     * @codeGenApi\n     */\n    function ɵɵenableBindings() {\n        instructionState.bindingsEnabled = true;\n    }\n    /**\n     * Disables directive matching on element.\n     *\n     *  * Example:\n     * ```\n     * <my-comp my-directive>\n     *   Should match component / directive.\n     * </my-comp>\n     * <div ngNonBindable>\n     *   <!-- ɵɵdisableBindings() -->\n     *   <my-comp my-directive>\n     *     Should not match component / directive because we are in ngNonBindable.\n     *   </my-comp>\n     *   <!-- ɵɵenableBindings() -->\n     * </div>\n     * ```\n     *\n     * @codeGenApi\n     */\n    function ɵɵdisableBindings() {\n        instructionState.bindingsEnabled = false;\n    }\n    /**\n     * Return the current `LView`.\n     */\n    function getLView() {\n        return instructionState.lFrame.lView;\n    }\n    /**\n     * Return the current `TView`.\n     */\n    function getTView() {\n        return instructionState.lFrame.tView;\n    }\n    /**\n     * Restores `contextViewData` to the given OpaqueViewState instance.\n     *\n     * Used in conjunction with the getCurrentView() instruction to save a snapshot\n     * of the current view and restore it when listeners are invoked. This allows\n     * walking the declaration view tree in listeners to get vars from parent views.\n     *\n     * @param viewToRestore The OpaqueViewState instance to restore.\n     * @returns Context of the restored OpaqueViewState instance.\n     *\n     * @codeGenApi\n     */\n    function ɵɵrestoreView(viewToRestore) {\n        instructionState.lFrame.contextLView = viewToRestore;\n        return viewToRestore[CONTEXT];\n    }\n    function getCurrentTNode() {\n        var currentTNode = getCurrentTNodePlaceholderOk();\n        while (currentTNode !== null && currentTNode.type === 64 /* Placeholder */) {\n            currentTNode = currentTNode.parent;\n        }\n        return currentTNode;\n    }\n    function getCurrentTNodePlaceholderOk() {\n        return instructionState.lFrame.currentTNode;\n    }\n    function getCurrentParentTNode() {\n        var lFrame = instructionState.lFrame;\n        var currentTNode = lFrame.currentTNode;\n        return lFrame.isParent ? currentTNode : currentTNode.parent;\n    }\n    function setCurrentTNode(tNode, isParent) {\n        ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);\n        var lFrame = instructionState.lFrame;\n        lFrame.currentTNode = tNode;\n        lFrame.isParent = isParent;\n    }\n    function isCurrentTNodeParent() {\n        return instructionState.lFrame.isParent;\n    }\n    function setCurrentTNodeAsNotParent() {\n        instructionState.lFrame.isParent = false;\n    }\n    function setCurrentTNodeAsParent() {\n        instructionState.lFrame.isParent = true;\n    }\n    function getContextLView() {\n        return instructionState.lFrame.contextLView;\n    }\n    function isInCheckNoChangesMode() {\n        // TODO(misko): remove this from the LView since it is ngDevMode=true mode only.\n        return instructionState.isInCheckNoChangesMode;\n    }\n    function setIsInCheckNoChangesMode(mode) {\n        instructionState.isInCheckNoChangesMode = mode;\n    }\n    // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n    function getBindingRoot() {\n        var lFrame = instructionState.lFrame;\n        var index = lFrame.bindingRootIndex;\n        if (index === -1) {\n            index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n        }\n        return index;\n    }\n    function getBindingIndex() {\n        return instructionState.lFrame.bindingIndex;\n    }\n    function setBindingIndex(value) {\n        return instructionState.lFrame.bindingIndex = value;\n    }\n    function nextBindingIndex() {\n        return instructionState.lFrame.bindingIndex++;\n    }\n    function incrementBindingIndex(count) {\n        var lFrame = instructionState.lFrame;\n        var index = lFrame.bindingIndex;\n        lFrame.bindingIndex = lFrame.bindingIndex + count;\n        return index;\n    }\n    function isInI18nBlock() {\n        return instructionState.lFrame.inI18n;\n    }\n    function setInI18nBlock(isInI18nBlock) {\n        instructionState.lFrame.inI18n = isInI18nBlock;\n    }\n    /**\n     * Set a new binding root index so that host template functions can execute.\n     *\n     * Bindings inside the host template are 0 index. But because we don't know ahead of time\n     * how many host bindings we have we can't pre-compute them. For this reason they are all\n     * 0 index and we just shift the root so that they match next available location in the LView.\n     *\n     * @param bindingRootIndex Root index for `hostBindings`\n     * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive\n     *        whose `hostBindings` are being processed.\n     */\n    function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {\n        var lFrame = instructionState.lFrame;\n        lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;\n        setCurrentDirectiveIndex(currentDirectiveIndex);\n    }\n    /**\n     * When host binding is executing this points to the directive index.\n     * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`\n     * `LView[getCurrentDirectiveIndex()]` is directive instance.\n     */\n    function getCurrentDirectiveIndex() {\n        return instructionState.lFrame.currentDirectiveIndex;\n    }\n    /**\n     * Sets an index of a directive whose `hostBindings` are being processed.\n     *\n     * @param currentDirectiveIndex `TData` index where current directive instance can be found.\n     */\n    function setCurrentDirectiveIndex(currentDirectiveIndex) {\n        instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;\n    }\n    /**\n     * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being\n     * executed.\n     *\n     * @param tData Current `TData` where the `DirectiveDef` will be looked up at.\n     */\n    function getCurrentDirectiveDef(tData) {\n        var currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n        return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n    }\n    function getCurrentQueryIndex() {\n        return instructionState.lFrame.currentQueryIndex;\n    }\n    function setCurrentQueryIndex(value) {\n        instructionState.lFrame.currentQueryIndex = value;\n    }\n    /**\n     * Returns a `TNode` of the location where the current `LView` is declared at.\n     *\n     * @param lView an `LView` that we want to find parent `TNode` for.\n     */\n    function getDeclarationTNode(lView) {\n        var tView = lView[TVIEW];\n        // Return the declaration parent for embedded views\n        if (tView.type === 2 /* Embedded */) {\n            ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n            return tView.declTNode;\n        }\n        // Components don't have `TView.declTNode` because each instance of component could be\n        // inserted in different location, hence `TView.declTNode` is meaningless.\n        // Falling back to `T_HOST` in case we cross component boundary.\n        if (tView.type === 1 /* Component */) {\n            return lView[T_HOST];\n        }\n        // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n        return null;\n    }\n    /**\n     * This is a light weight version of the `enterView` which is needed by the DI system.\n     *\n     * @param lView `LView` location of the DI context.\n     * @param tNode `TNode` for DI context\n     * @param flags DI context flags. if `SkipSelf` flag is set than we walk up the declaration\n     *     tree from `tNode`  until we find parent declared `TElementNode`.\n     * @returns `true` if we have successfully entered DI associated with `tNode` (or with declared\n     *     `TNode` if `flags` has  `SkipSelf`). Failing to enter DI implies that no associated\n     *     `NodeInjector` can be found and we should instead use `ModuleInjector`.\n     *     - If `true` than this call must be fallowed by `leaveDI`\n     *     - If `false` than this call failed and we should NOT call `leaveDI`\n     */\n    function enterDI(lView, tNode, flags) {\n        ngDevMode && assertLViewOrUndefined(lView);\n        if (flags & exports.InjectFlags.SkipSelf) {\n            ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);\n            var parentTNode = tNode;\n            var parentLView = lView;\n            while (true) {\n                ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');\n                parentTNode = parentTNode.parent;\n                if (parentTNode === null && !(flags & exports.InjectFlags.Host)) {\n                    parentTNode = getDeclarationTNode(parentLView);\n                    if (parentTNode === null)\n                        break;\n                    // In this case, a parent exists and is definitely an element. So it will definitely\n                    // have an existing lView as the declaration view, which is why we can assume it's defined.\n                    ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');\n                    parentLView = parentLView[DECLARATION_VIEW];\n                    // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives\n                    // We want to skip those and look only at Elements and ElementContainers to ensure\n                    // we're looking at true parent nodes, and not content or other types.\n                    if (parentTNode.type & (2 /* Element */ | 8 /* ElementContainer */)) {\n                        break;\n                    }\n                }\n                else {\n                    break;\n                }\n            }\n            if (parentTNode === null) {\n                // If we failed to find a parent TNode this means that we should use module injector.\n                return false;\n            }\n            else {\n                tNode = parentTNode;\n                lView = parentLView;\n            }\n        }\n        ngDevMode && assertTNodeForLView(tNode, lView);\n        var lFrame = instructionState.lFrame = allocLFrame();\n        lFrame.currentTNode = tNode;\n        lFrame.lView = lView;\n        return true;\n    }\n    /**\n     * Swap the current lView with a new lView.\n     *\n     * For performance reasons we store the lView in the top level of the module.\n     * This way we minimize the number of properties to read. Whenever a new view\n     * is entered we have to store the lView for later, and when the view is\n     * exited the state has to be restored\n     *\n     * @param newView New lView to become active\n     * @returns the previously active lView;\n     */\n    function enterView(newView) {\n        ngDevMode && assertNotEqual(newView[0], newView[1], '????');\n        ngDevMode && assertLViewOrUndefined(newView);\n        var newLFrame = allocLFrame();\n        if (ngDevMode) {\n            assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');\n            assertEqual(newLFrame.lView, null, 'Expected clean LFrame');\n            assertEqual(newLFrame.tView, null, 'Expected clean LFrame');\n            assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');\n            assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');\n            assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');\n            assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');\n            assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');\n            assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');\n        }\n        var tView = newView[TVIEW];\n        instructionState.lFrame = newLFrame;\n        ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);\n        newLFrame.currentTNode = tView.firstChild;\n        newLFrame.lView = newView;\n        newLFrame.tView = tView;\n        newLFrame.contextLView = newView;\n        newLFrame.bindingIndex = tView.bindingStartIndex;\n        newLFrame.inI18n = false;\n    }\n    /**\n     * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.\n     */\n    function allocLFrame() {\n        var currentLFrame = instructionState.lFrame;\n        var childLFrame = currentLFrame === null ? null : currentLFrame.child;\n        var newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;\n        return newLFrame;\n    }\n    function createLFrame(parent) {\n        var lFrame = {\n            currentTNode: null,\n            isParent: true,\n            lView: null,\n            tView: null,\n            selectedIndex: -1,\n            contextLView: null,\n            elementDepthCount: 0,\n            currentNamespace: null,\n            currentDirectiveIndex: -1,\n            bindingRootIndex: -1,\n            bindingIndex: -1,\n            currentQueryIndex: 0,\n            parent: parent,\n            child: null,\n            inI18n: false,\n        };\n        parent !== null && (parent.child = lFrame); // link the new LFrame for reuse.\n        return lFrame;\n    }\n    /**\n     * A lightweight version of leave which is used with DI.\n     *\n     * This function only resets `currentTNode` and `LView` as those are the only properties\n     * used with DI (`enterDI()`).\n     *\n     * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where\n     * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`.\n     */\n    function leaveViewLight() {\n        var oldLFrame = instructionState.lFrame;\n        instructionState.lFrame = oldLFrame.parent;\n        oldLFrame.currentTNode = null;\n        oldLFrame.lView = null;\n        return oldLFrame;\n    }\n    /**\n     * This is a lightweight version of the `leaveView` which is needed by the DI system.\n     *\n     * NOTE: this function is an alias so that we can change the type of the function to have `void`\n     * return type.\n     */\n    var leaveDI = leaveViewLight;\n    /**\n     * Leave the current `LView`\n     *\n     * This pops the `LFrame` with the associated `LView` from the stack.\n     *\n     * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is\n     * because for performance reasons we don't release `LFrame` but rather keep it for next use.\n     */\n    function leaveView() {\n        var oldLFrame = leaveViewLight();\n        oldLFrame.isParent = true;\n        oldLFrame.tView = null;\n        oldLFrame.selectedIndex = -1;\n        oldLFrame.contextLView = null;\n        oldLFrame.elementDepthCount = 0;\n        oldLFrame.currentDirectiveIndex = -1;\n        oldLFrame.currentNamespace = null;\n        oldLFrame.bindingRootIndex = -1;\n        oldLFrame.bindingIndex = -1;\n        oldLFrame.currentQueryIndex = 0;\n    }\n    function nextContextImpl(level) {\n        var contextLView = instructionState.lFrame.contextLView =\n            walkUpViews(level, instructionState.lFrame.contextLView);\n        return contextLView[CONTEXT];\n    }\n    function walkUpViews(nestingLevel, currentView) {\n        while (nestingLevel > 0) {\n            ngDevMode &&\n                assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');\n            currentView = currentView[DECLARATION_VIEW];\n            nestingLevel--;\n        }\n        return currentView;\n    }\n    /**\n     * Gets the currently selected element index.\n     *\n     * Used with {@link property} instruction (and more in the future) to identify the index in the\n     * current `LView` to act on.\n     */\n    function getSelectedIndex() {\n        return instructionState.lFrame.selectedIndex;\n    }\n    /**\n     * Sets the most recent index passed to {@link select}\n     *\n     * Used with {@link property} instruction (and more in the future) to identify the index in the\n     * current `LView` to act on.\n     *\n     * (Note that if an \"exit function\" was set earlier (via `setElementExitFn()`) then that will be\n     * run if and when the provided `index` value is different from the current selected index value.)\n     */\n    function setSelectedIndex(index) {\n        ngDevMode && index !== -1 &&\n            assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');\n        ngDevMode &&\n            assertLessThan(index, instructionState.lFrame.lView.length, 'Can\\'t set index passed end of LView');\n        instructionState.lFrame.selectedIndex = index;\n    }\n    /**\n     * Gets the `tNode` that represents currently selected element.\n     */\n    function getSelectedTNode() {\n        var lFrame = instructionState.lFrame;\n        return getTNode(lFrame.tView, lFrame.selectedIndex);\n    }\n    /**\n     * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.\n     *\n     * @codeGenApi\n     */\n    function ɵɵnamespaceSVG() {\n        instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n    }\n    /**\n     * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.\n     *\n     * @codeGenApi\n     */\n    function ɵɵnamespaceMathML() {\n        instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;\n    }\n    /**\n     * Sets the namespace used to create elements to `null`, which forces element creation to use\n     * `createElement` rather than `createElementNS`.\n     *\n     * @codeGenApi\n     */\n    function ɵɵnamespaceHTML() {\n        namespaceHTMLInternal();\n    }\n    /**\n     * Sets the namespace used to create elements to `null`, which forces element creation to use\n     * `createElement` rather than `createElementNS`.\n     */\n    function namespaceHTMLInternal() {\n        instructionState.lFrame.currentNamespace = null;\n    }\n    function getNamespace() {\n        return instructionState.lFrame.currentNamespace;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n     *\n     * Must be run *only* on the first template pass.\n     *\n     * Sets up the pre-order hooks on the provided `tView`,\n     * see {@link HookData} for details about the data structure.\n     *\n     * @param directiveIndex The index of the directive in LView\n     * @param directiveDef The definition containing the hooks to setup in tView\n     * @param tView The current TView\n     */\n    function registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n        ngDevMode && assertFirstCreatePass(tView);\n        var _a = directiveDef.type.prototype, ngOnChanges = _a.ngOnChanges, ngOnInit = _a.ngOnInit, ngDoCheck = _a.ngDoCheck;\n        if (ngOnChanges) {\n            var wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n            (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);\n            (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = []))\n                .push(directiveIndex, wrappedOnChanges);\n        }\n        if (ngOnInit) {\n            (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);\n        }\n        if (ngDoCheck) {\n            (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);\n            (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);\n        }\n    }\n    /**\n     *\n     * Loops through the directives on the provided `tNode` and queues hooks to be\n     * run that are not initialization hooks.\n     *\n     * Should be executed during `elementEnd()` and similar to\n     * preserve hook execution order. Content, view, and destroy hooks for projected\n     * components and directives must be called *before* their hosts.\n     *\n     * Sets up the content, view, and destroy hooks on the provided `tView`,\n     * see {@link HookData} for details about the data structure.\n     *\n     * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n     * separately at `elementStart`.\n     *\n     * @param tView The current TView\n     * @param tNode The TNode whose directives are to be searched for hooks to queue\n     */\n    function registerPostOrderHooks(tView, tNode) {\n        ngDevMode && assertFirstCreatePass(tView);\n        // It's necessary to loop through the directives at elementEnd() (rather than processing in\n        // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n        // hooks for projected components and directives must be called *before* their hosts.\n        for (var i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n            var directiveDef = tView.data[i];\n            ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n            var lifecycleHooks = directiveDef.type.prototype;\n            var ngAfterContentInit = lifecycleHooks.ngAfterContentInit, ngAfterContentChecked = lifecycleHooks.ngAfterContentChecked, ngAfterViewInit = lifecycleHooks.ngAfterViewInit, ngAfterViewChecked = lifecycleHooks.ngAfterViewChecked, ngOnDestroy = lifecycleHooks.ngOnDestroy;\n            if (ngAfterContentInit) {\n                (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit);\n            }\n            if (ngAfterContentChecked) {\n                (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked);\n                (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);\n            }\n            if (ngAfterViewInit) {\n                (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit);\n            }\n            if (ngAfterViewChecked) {\n                (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked);\n                (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);\n            }\n            if (ngOnDestroy != null) {\n                (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy);\n            }\n        }\n    }\n    /**\n     * Executing hooks requires complex logic as we need to deal with 2 constraints.\n     *\n     * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n     * once, across many change detection cycles. This must be true even if some hooks throw, or if\n     * some recursively trigger a change detection cycle.\n     * To solve that, it is required to track the state of the execution of these init hooks.\n     * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n     * and the index within that phase. They can be seen as a cursor in the following structure:\n     * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n     * They are are stored as flags in LView[FLAGS].\n     *\n     * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n     * To be able to pause and resume their execution, we also need some state about the hook's array\n     * that is being processed:\n     * - the index of the next hook to be executed\n     * - the number of init hooks already found in the processed part of the  array\n     * They are are stored as flags in LView[PREORDER_HOOK_FLAGS].\n     */\n    /**\n     * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n     * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n     * / write of the init-hooks related flags.\n     * @param lView The LView where hooks are defined\n     * @param hooks Hooks to be run\n     * @param nodeIndex 3 cases depending on the value:\n     * - undefined: all hooks from the array should be executed (post-order case)\n     * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n     * flushing the remaining hooks)\n     * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n     * case, when executing select(number))\n     */\n    function executeCheckHooks(lView, hooks, nodeIndex) {\n        callHooks(lView, hooks, 3 /* InitPhaseCompleted */, nodeIndex);\n    }\n    /**\n     * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n     * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n     * @param lView The LView where hooks are defined\n     * @param hooks Hooks to be run\n     * @param initPhase A phase for which hooks should be run\n     * @param nodeIndex 3 cases depending on the value:\n     * - undefined: all hooks from the array should be executed (post-order case)\n     * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n     * flushing the remaining hooks)\n     * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n     * case, when executing select(number))\n     */\n    function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n        ngDevMode &&\n            assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');\n        if ((lView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {\n            callHooks(lView, hooks, initPhase, nodeIndex);\n        }\n    }\n    function incrementInitPhaseFlags(lView, initPhase) {\n        ngDevMode &&\n            assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');\n        var flags = lView[FLAGS];\n        if ((flags & 3 /* InitPhaseStateMask */) === initPhase) {\n            flags &= 2047 /* IndexWithinInitPhaseReset */;\n            flags += 1 /* InitPhaseStateIncrementer */;\n            lView[FLAGS] = flags;\n        }\n    }\n    /**\n     * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n     * the first LView pass\n     *\n     * @param currentView The current view\n     * @param arr The array in which the hooks are found\n     * @param initPhaseState the current state of the init phase\n     * @param currentNodeIndex 3 cases depending on the value:\n     * - undefined: all hooks from the array should be executed (post-order case)\n     * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n     * flushing the remaining hooks)\n     * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n     * case, when executing select(number))\n     */\n    function callHooks(currentView, arr, initPhase, currentNodeIndex) {\n        ngDevMode &&\n            assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n        var startIndex = currentNodeIndex !== undefined ?\n            (currentView[PREORDER_HOOK_FLAGS] & 65535 /* IndexOfTheNextPreOrderHookMaskMask */) :\n            0;\n        var nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n        var max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n        var lastNodeIndexFound = 0;\n        for (var i = startIndex; i < max; i++) {\n            var hook = arr[i + 1];\n            if (typeof hook === 'number') {\n                lastNodeIndexFound = arr[i];\n                if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n                    break;\n                }\n            }\n            else {\n                var isInitHook = arr[i] < 0;\n                if (isInitHook)\n                    currentView[PREORDER_HOOK_FLAGS] += 65536 /* NumberOfInitHooksCalledIncrementer */;\n                if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n                    callHook(currentView, initPhase, arr, i);\n                    currentView[PREORDER_HOOK_FLAGS] =\n                        (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* NumberOfInitHooksCalledMask */) + i +\n                            2;\n                }\n                i++;\n            }\n        }\n    }\n    /**\n     * Execute one hook against the current `LView`.\n     *\n     * @param currentView The current view\n     * @param initPhaseState the current state of the init phase\n     * @param arr The array in which the hooks are found\n     * @param i The current index within the hook data array\n     */\n    function callHook(currentView, initPhase, arr, i) {\n        var isInitHook = arr[i] < 0;\n        var hook = arr[i + 1];\n        var directiveIndex = isInitHook ? -arr[i] : arr[i];\n        var directive = currentView[directiveIndex];\n        if (isInitHook) {\n            var indexWithintInitPhase = currentView[FLAGS] >> 11 /* IndexWithinInitPhaseShift */;\n            // The init phase state must be always checked here as it may have been recursively updated.\n            if (indexWithintInitPhase <\n                (currentView[PREORDER_HOOK_FLAGS] >> 16 /* NumberOfInitHooksCalledShift */) &&\n                (currentView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {\n                currentView[FLAGS] += 2048 /* IndexWithinInitPhaseIncrementer */;\n                profiler(4 /* LifecycleHookStart */, directive, hook);\n                try {\n                    hook.call(directive);\n                }\n                finally {\n                    profiler(5 /* LifecycleHookEnd */, directive, hook);\n                }\n            }\n        }\n        else {\n            profiler(4 /* LifecycleHookStart */, directive, hook);\n            try {\n                hook.call(directive);\n            }\n            finally {\n                profiler(5 /* LifecycleHookEnd */, directive, hook);\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var NO_PARENT_INJECTOR = -1;\n    /**\n     * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n     * `TView.data`. This allows us to store information about the current node's tokens (which\n     * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n     * shared, so they live in `LView`).\n     *\n     * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n     * determines whether a directive is available on the associated node or not. This prevents us\n     * from searching the directives array at this level unless it's probable the directive is in it.\n     *\n     * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n     *\n     * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n     * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n     * will differ based on where it is flattened into the main array, so it's not possible to know\n     * the indices ahead of time and save their types here. The interfaces are still included here\n     * for documentation purposes.\n     *\n     * export interface LInjector extends Array<any> {\n     *\n     *    // Cumulative bloom for directive IDs 0-31  (IDs are % BLOOM_SIZE)\n     *    [0]: number;\n     *\n     *    // Cumulative bloom for directive IDs 32-63\n     *    [1]: number;\n     *\n     *    // Cumulative bloom for directive IDs 64-95\n     *    [2]: number;\n     *\n     *    // Cumulative bloom for directive IDs 96-127\n     *    [3]: number;\n     *\n     *    // Cumulative bloom for directive IDs 128-159\n     *    [4]: number;\n     *\n     *    // Cumulative bloom for directive IDs 160 - 191\n     *    [5]: number;\n     *\n     *    // Cumulative bloom for directive IDs 192 - 223\n     *    [6]: number;\n     *\n     *    // Cumulative bloom for directive IDs 224 - 255\n     *    [7]: number;\n     *\n     *    // We need to store a reference to the injector's parent so DI can keep looking up\n     *    // the injector tree until it finds the dependency it's looking for.\n     *    [PARENT_INJECTOR]: number;\n     * }\n     *\n     * export interface TInjector extends Array<any> {\n     *\n     *    // Shared node bloom for directive IDs 0-31  (IDs are % BLOOM_SIZE)\n     *    [0]: number;\n     *\n     *    // Shared node bloom for directive IDs 32-63\n     *    [1]: number;\n     *\n     *    // Shared node bloom for directive IDs 64-95\n     *    [2]: number;\n     *\n     *    // Shared node bloom for directive IDs 96-127\n     *    [3]: number;\n     *\n     *    // Shared node bloom for directive IDs 128-159\n     *    [4]: number;\n     *\n     *    // Shared node bloom for directive IDs 160 - 191\n     *    [5]: number;\n     *\n     *    // Shared node bloom for directive IDs 192 - 223\n     *    [6]: number;\n     *\n     *    // Shared node bloom for directive IDs 224 - 255\n     *    [7]: number;\n     *\n     *    // Necessary to find directive indices for a particular node.\n     *    [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n     *  }\n     */\n    /**\n     * Factory for creating instances of injectors in the NodeInjector.\n     *\n     * This factory is complicated by the fact that it can resolve `multi` factories as well.\n     *\n     * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n     * - One without `multi` support (most common)\n     * - One with `multi` values, (rare).\n     *\n     * Since VMs can cache up to 4 inline hidden classes this is OK.\n     *\n     * - Single factory: Only `resolving` and `factory` is defined.\n     * - `providers` factory: `componentProviders` is a number and `index = -1`.\n     * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n     */\n    var NodeInjectorFactory = /** @class */ (function () {\n        function NodeInjectorFactory(\n        /**\n         * Factory to invoke in order to create a new instance.\n         */\n        factory, \n        /**\n         * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n         */\n        isViewProvider, injectImplementation) {\n            this.factory = factory;\n            /**\n             * Marker set to true during factory invocation to see if we get into recursive loop.\n             * Recursive loop causes an error to be displayed.\n             */\n            this.resolving = false;\n            ngDevMode && assertDefined(factory, 'Factory not specified');\n            ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n            this.canSeeViewProviders = isViewProvider;\n            this.injectImpl = injectImplementation;\n        }\n        return NodeInjectorFactory;\n    }());\n    function isFactory(obj) {\n        return obj instanceof NodeInjectorFactory;\n    }\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$3 = 1;\n\n    /**\n     * Converts `TNodeType` into human readable text.\n     * Make sure this matches with `TNodeType`\n     */\n    function toTNodeTypeAsString(tNodeType) {\n        var text = '';\n        (tNodeType & 1 /* Text */) && (text += '|Text');\n        (tNodeType & 2 /* Element */) && (text += '|Element');\n        (tNodeType & 4 /* Container */) && (text += '|Container');\n        (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n        (tNodeType & 16 /* Projection */) && (text += '|Projection');\n        (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n        (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n        return text.length > 0 ? text.substring(1) : text;\n    }\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$4 = 1;\n    /**\n     * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n     *\n     * ```\n     * <div my-dir [class]=\"exp\"></div>\n     * ```\n     * and\n     * ```\n     * @Directive({\n     * })\n     * class MyDirective {\n     *   @Input()\n     *   class: string;\n     * }\n     * ```\n     *\n     * In the above case it is necessary to write the reconciled styling information into the\n     * directive's input.\n     *\n     * @param tNode\n     */\n    function hasClassInput(tNode) {\n        return (tNode.flags & 16 /* hasClassInput */) !== 0;\n    }\n    /**\n     * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n     *\n     * ```\n     * <div my-dir [style]=\"exp\"></div>\n     * ```\n     * and\n     * ```\n     * @Directive({\n     * })\n     * class MyDirective {\n     *   @Input()\n     *   class: string;\n     * }\n     * ```\n     *\n     * In the above case it is necessary to write the reconciled styling information into the\n     * directive's input.\n     *\n     * @param tNode\n     */\n    function hasStyleInput(tNode) {\n        return (tNode.flags & 32 /* hasStyleInput */) !== 0;\n    }\n\n    /**\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://angular.io/license\n     */\n    function assertTNodeType(tNode, expectedTypes, message) {\n        assertDefined(tNode, 'should be called with a TNode');\n        if ((tNode.type & expectedTypes) === 0) {\n            throwError(message ||\n                \"Expected [\" + toTNodeTypeAsString(expectedTypes) + \"] but got \" + toTNodeTypeAsString(tNode.type) + \".\");\n        }\n    }\n    function assertPureTNodeType(type) {\n        if (!(type === 2 /* Element */ || //\n            type === 1 /* Text */ || //\n            type === 4 /* Container */ || //\n            type === 8 /* ElementContainer */ || //\n            type === 32 /* Icu */ || //\n            type === 16 /* Projection */ || //\n            type === 64 /* Placeholder */)) {\n            throwError(\"Expected TNodeType to have only a single type selected, but got \" + toTNodeTypeAsString(type) + \".\");\n        }\n    }\n\n    /**\n     * Assigns all attribute values to the provided element via the inferred renderer.\n     *\n     * This function accepts two forms of attribute entries:\n     *\n     * default: (key, value):\n     *  attrs = [key1, value1, key2, value2]\n     *\n     * namespaced: (NAMESPACE_MARKER, uri, name, value)\n     *  attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n     *\n     * The `attrs` array can contain a mix of both the default and namespaced entries.\n     * The \"default\" values are set without a marker, but if the function comes across\n     * a marker value then it will attempt to set a namespaced value. If the marker is\n     * not of a namespaced value then the function will quit and return the index value\n     * where it stopped during the iteration of the attrs array.\n     *\n     * See [AttributeMarker] to understand what the namespace marker value is.\n     *\n     * Note that this instruction does not support assigning style and class values to\n     * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n     * are applied to an element.\n     * @param renderer The renderer to be used\n     * @param native The element that the attributes will be assigned to\n     * @param attrs The attribute array of values that will be assigned to the element\n     * @returns the index value that was last accessed in the attributes array\n     */\n    function setUpAttributes(renderer, native, attrs) {\n        var isProc = isProceduralRenderer(renderer);\n        var i = 0;\n        while (i < attrs.length) {\n            var value = attrs[i];\n            if (typeof value === 'number') {\n                // only namespaces are supported. Other value types (such as style/class\n                // entries) are not supported in this function.\n                if (value !== 0 /* NamespaceURI */) {\n                    break;\n                }\n                // we just landed on the marker value ... therefore\n                // we should skip to the next entry\n                i++;\n                var namespaceURI = attrs[i++];\n                var attrName = attrs[i++];\n                var attrVal = attrs[i++];\n                ngDevMode && ngDevMode.rendererSetAttribute++;\n                isProc ?\n                    renderer.setAttribute(native, attrName, attrVal, namespaceURI) :\n                    native.setAttributeNS(namespaceURI, attrName, attrVal);\n            }\n            else {\n                // attrName is string;\n                var attrName = value;\n                var attrVal = attrs[++i];\n                // Standard attributes\n                ngDevMode && ngDevMode.rendererSetAttribute++;\n                if (isAnimationProp(attrName)) {\n                    if (isProc) {\n                        renderer.setProperty(native, attrName, attrVal);\n                    }\n                }\n                else {\n                    isProc ?\n                        renderer.setAttribute(native, attrName, attrVal) :\n                        native.setAttribute(attrName, attrVal);\n                }\n                i++;\n            }\n        }\n        // another piece of code may iterate over the same attributes array. Therefore\n        // it may be helpful to return the exact spot where the attributes array exited\n        // whether by running into an unsupported marker or if all the static values were\n        // iterated over.\n        return i;\n    }\n    /**\n     * Test whether the given value is a marker that indicates that the following\n     * attribute values in a `TAttributes` array are only the names of attributes,\n     * and not name-value pairs.\n     * @param marker The attribute marker to test.\n     * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n     */\n    function isNameOnlyAttributeMarker(marker) {\n        return marker === 3 /* Bindings */ || marker === 4 /* Template */ ||\n            marker === 6 /* I18n */;\n    }\n    function isAnimationProp(name) {\n        // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n        // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n        // charCodeAt doesn't allocate memory to return a substring.\n        return name.charCodeAt(0) === 64 /* AT_SIGN */;\n    }\n    /**\n     * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n     *\n     * This merge function keeps the order of attrs same.\n     *\n     * @param dst Location of where the merged `TAttributes` should end up.\n     * @param src `TAttributes` which should be appended to `dst`\n     */\n    function mergeHostAttrs(dst, src) {\n        if (src === null || src.length === 0) {\n            // do nothing\n        }\n        else if (dst === null || dst.length === 0) {\n            // We have source, but dst is empty, just make a copy.\n            dst = src.slice();\n        }\n        else {\n            var srcMarker = -1 /* ImplicitAttributes */;\n            for (var i = 0; i < src.length; i++) {\n                var item = src[i];\n                if (typeof item === 'number') {\n                    srcMarker = item;\n                }\n                else {\n                    if (srcMarker === 0 /* NamespaceURI */) {\n                        // Case where we need to consume `key1`, `key2`, `value` items.\n                    }\n                    else if (srcMarker === -1 /* ImplicitAttributes */ ||\n                        srcMarker === 2 /* Styles */) {\n                        // Case where we have to consume `key1` and `value` only.\n                        mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n                    }\n                    else {\n                        // Case where we have to consume `key1` only.\n                        mergeHostAttribute(dst, srcMarker, item, null, null);\n                    }\n                }\n            }\n        }\n        return dst;\n    }\n    /**\n     * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n     *\n     * @param dst `TAttributes` to append to.\n     * @param marker Region where the `key`/`value` should be added.\n     * @param key1 Key to add to `TAttributes`\n     * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n     * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n     */\n    function mergeHostAttribute(dst, marker, key1, key2, value) {\n        var i = 0;\n        // Assume that new markers will be inserted at the end.\n        var markerInsertPosition = dst.length;\n        // scan until correct type.\n        if (marker === -1 /* ImplicitAttributes */) {\n            markerInsertPosition = -1;\n        }\n        else {\n            while (i < dst.length) {\n                var dstValue = dst[i++];\n                if (typeof dstValue === 'number') {\n                    if (dstValue === marker) {\n                        markerInsertPosition = -1;\n                        break;\n                    }\n                    else if (dstValue > marker) {\n                        // We need to save this as we want the markers to be inserted in specific order.\n                        markerInsertPosition = i - 1;\n                        break;\n                    }\n                }\n            }\n        }\n        // search until you find place of insertion\n        while (i < dst.length) {\n            var item = dst[i];\n            if (typeof item === 'number') {\n                // since `i` started as the index after the marker, we did not find it if we are at the next\n                // marker\n                break;\n            }\n            else if (item === key1) {\n                // We already have same token\n                if (key2 === null) {\n                    if (value !== null) {\n                        dst[i + 1] = value;\n                    }\n                    return;\n                }\n                else if (key2 === dst[i + 1]) {\n                    dst[i + 2] = value;\n                    return;\n                }\n            }\n            // Increment counter.\n            i++;\n            if (key2 !== null)\n                i++;\n            if (value !== null)\n                i++;\n        }\n        // insert at location.\n        if (markerInsertPosition !== -1) {\n            dst.splice(markerInsertPosition, 0, marker);\n            i = markerInsertPosition + 1;\n        }\n        dst.splice(i++, 0, key1);\n        if (key2 !== null) {\n            dst.splice(i++, 0, key2);\n        }\n        if (value !== null) {\n            dst.splice(i++, 0, value);\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /// Parent Injector Utils ///////////////////////////////////////////////////////////////\n    function hasParentInjector(parentLocation) {\n        return parentLocation !== NO_PARENT_INJECTOR;\n    }\n    function getParentInjectorIndex(parentLocation) {\n        ngDevMode && assertNumber(parentLocation, 'Number expected');\n        ngDevMode && assertNotEqual(parentLocation, -1, 'Not a valid state.');\n        var parentInjectorIndex = parentLocation & 32767 /* InjectorIndexMask */;\n        ngDevMode &&\n            assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n        return parentLocation & 32767 /* InjectorIndexMask */;\n    }\n    function getParentInjectorViewOffset(parentLocation) {\n        return parentLocation >> 16 /* ViewOffsetShift */;\n    }\n    /**\n     * Unwraps a parent injector location number to find the view offset from the current injector,\n     * then walks up the declaration view tree until the view is found that contains the parent\n     * injector.\n     *\n     * @param location The location of the parent injector, which contains the view offset\n     * @param startView The LView instance from which to start walking up the view tree\n     * @returns The LView instance that contains the parent injector\n     */\n    function getParentInjectorView(location, startView) {\n        var viewOffset = getParentInjectorViewOffset(location);\n        var parentView = startView;\n        // For most cases, the parent injector can be found on the host node (e.g. for component\n        // or container), but we must keep the loop here to support the rarer case of deeply nested\n        // <ng-template> tags or inline views, where the parent injector might live many views\n        // above the child injector.\n        while (viewOffset > 0) {\n            parentView = parentView[DECLARATION_VIEW];\n            viewOffset--;\n        }\n        return parentView;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Defines if the call to `inject` should include `viewProviders` in its resolution.\n     *\n     * This is set to true when we try to instantiate a component. This value is reset in\n     * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n     * instantiated. This is done so that if we are injecting a token which was declared outside of\n     * `viewProviders` we don't accidentally pull `viewProviders` in.\n     *\n     * Example:\n     *\n     * ```\n     * @Injectable()\n     * class MyService {\n     *   constructor(public value: String) {}\n     * }\n     *\n     * @Component({\n     *   providers: [\n     *     MyService,\n     *     {provide: String, value: 'providers' }\n     *   ]\n     *   viewProviders: [\n     *     {provide: String, value: 'viewProviders'}\n     *   ]\n     * })\n     * class MyComponent {\n     *   constructor(myService: MyService, value: String) {\n     *     // We expect that Component can see into `viewProviders`.\n     *     expect(value).toEqual('viewProviders');\n     *     // `MyService` was not declared in `viewProviders` hence it can't see it.\n     *     expect(myService.value).toEqual('providers');\n     *   }\n     * }\n     *\n     * ```\n     */\n    var includeViewProviders = true;\n    function setIncludeViewProviders(v) {\n        var oldValue = includeViewProviders;\n        includeViewProviders = v;\n        return oldValue;\n    }\n    /**\n     * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n     * directives that will share slots, and thus, the fewer false positives when checking for\n     * the existence of a directive.\n     */\n    var BLOOM_SIZE = 256;\n    var BLOOM_MASK = BLOOM_SIZE - 1;\n    /**\n     * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n     * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n     * number.\n     */\n    var BLOOM_BUCKET_BITS = 5;\n    /** Counter used to generate unique IDs for directives. */\n    var nextNgElementId = 0;\n    /**\n     * Registers this directive as present in its node's injector by flipping the directive's\n     * corresponding bit in the injector's bloom filter.\n     *\n     * @param injectorIndex The index of the node injector where this token should be registered\n     * @param tView The TView for the injector's bloom filters\n     * @param type The directive token to register\n     */\n    function bloomAdd(injectorIndex, tView, type) {\n        ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n        var id;\n        if (typeof type === 'string') {\n            id = type.charCodeAt(0) || 0;\n        }\n        else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n            id = type[NG_ELEMENT_ID];\n        }\n        // Set a unique ID on the directive type, so if something tries to inject the directive,\n        // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n        if (id == null) {\n            id = type[NG_ELEMENT_ID] = nextNgElementId++;\n        }\n        // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n        // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n        var bloomHash = id & BLOOM_MASK;\n        // Create a mask that targets the specific bit associated with the directive.\n        // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n        // to bit positions 0 - 31 in a 32 bit integer.\n        var mask = 1 << bloomHash;\n        // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n        // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n        // should be written to.\n        tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n    }\n    /**\n     * Creates (or gets an existing) injector for a given element or container.\n     *\n     * @param tNode for which an injector should be retrieved / created.\n     * @param lView View where the node is stored\n     * @returns Node injector\n     */\n    function getOrCreateNodeInjectorForNode(tNode, lView) {\n        var existingInjectorIndex = getInjectorIndex(tNode, lView);\n        if (existingInjectorIndex !== -1) {\n            return existingInjectorIndex;\n        }\n        var tView = lView[TVIEW];\n        if (tView.firstCreatePass) {\n            tNode.injectorIndex = lView.length;\n            insertBloom(tView.data, tNode); // foundation for node bloom\n            insertBloom(lView, null); // foundation for cumulative bloom\n            insertBloom(tView.blueprint, null);\n        }\n        var parentLoc = getParentInjectorLocation(tNode, lView);\n        var injectorIndex = tNode.injectorIndex;\n        // If a parent injector can't be found, its location is set to -1.\n        // In that case, we don't need to set up a cumulative bloom\n        if (hasParentInjector(parentLoc)) {\n            var parentIndex = getParentInjectorIndex(parentLoc);\n            var parentLView = getParentInjectorView(parentLoc, lView);\n            var parentData = parentLView[TVIEW].data;\n            // Creates a cumulative bloom filter that merges the parent's bloom filter\n            // and its own cumulative bloom (which contains tokens for all ancestors)\n            for (var i = 0; i < 8 /* BLOOM_SIZE */; i++) {\n                lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n            }\n        }\n        lView[injectorIndex + 8 /* PARENT */] = parentLoc;\n        return injectorIndex;\n    }\n    function insertBloom(arr, footer) {\n        arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n    }\n    function getInjectorIndex(tNode, lView) {\n        if (tNode.injectorIndex === -1 ||\n            // If the injector index is the same as its parent's injector index, then the index has been\n            // copied down from the parent node. No injector has been created yet on this node.\n            (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n            // After the first template pass, the injector index might exist but the parent values\n            // might not have been calculated yet for this instance\n            lView[tNode.injectorIndex + 8 /* PARENT */] === null) {\n            return -1;\n        }\n        else {\n            ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n            return tNode.injectorIndex;\n        }\n    }\n    /**\n     * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n     * parent injector initially.\n     *\n     * @returns Returns a number that is the combination of the number of LViews that we have to go up\n     * to find the LView containing the parent inject AND the index of the injector within that LView.\n     */\n    function getParentInjectorLocation(tNode, lView) {\n        if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n            // If we have a parent `TNode` and there is an injector associated with it we are done, because\n            // the parent injector is within the current `LView`.\n            return tNode.parent.injectorIndex; // ViewOffset is 0\n        }\n        // When parent injector location is computed it may be outside of the current view. (ie it could\n        // be pointing to a declared parent location). This variable stores number of declaration parents\n        // we need to walk up in order to find the parent injector location.\n        var declarationViewOffset = 0;\n        var parentTNode = null;\n        var lViewCursor = lView;\n        // The parent injector is not in the current `LView`. We will have to walk the declared parent\n        // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n        // `NodeInjector`.\n        while (lViewCursor !== null) {\n            // First determine the `parentTNode` location. The parent pointer differs based on `TView.type`.\n            var tView = lViewCursor[TVIEW];\n            var tViewType = tView.type;\n            if (tViewType === 2 /* Embedded */) {\n                ngDevMode &&\n                    assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n                parentTNode = tView.declTNode;\n            }\n            else if (tViewType === 1 /* Component */) {\n                // Components don't have `TView.declTNode` because each instance of component could be\n                // inserted in different location, hence `TView.declTNode` is meaningless.\n                parentTNode = lViewCursor[T_HOST];\n            }\n            else {\n                ngDevMode && assertEqual(tView.type, 0 /* Root */, 'Root type expected');\n                parentTNode = null;\n            }\n            if (parentTNode === null) {\n                // If we have no parent, than we are done.\n                return NO_PARENT_INJECTOR;\n            }\n            ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n            // Every iteration of the loop requires that we go to the declared parent.\n            declarationViewOffset++;\n            lViewCursor = lViewCursor[DECLARATION_VIEW];\n            if (parentTNode.injectorIndex !== -1) {\n                // We found a NodeInjector which points to something.\n                return (parentTNode.injectorIndex |\n                    (declarationViewOffset << 16 /* ViewOffsetShift */));\n            }\n        }\n        return NO_PARENT_INJECTOR;\n    }\n    /**\n     * Makes a type or an injection token public to the DI system by adding it to an\n     * injector's bloom filter.\n     *\n     * @param di The node injector in which a directive will be added\n     * @param token The type or the injection token to be made public\n     */\n    function diPublicInInjector(injectorIndex, tView, token) {\n        bloomAdd(injectorIndex, tView, token);\n    }\n    /**\n     * Inject static attribute value into directive constructor.\n     *\n     * This method is used with `factory` functions which are generated as part of\n     * `defineDirective` or `defineComponent`. The method retrieves the static value\n     * of an attribute. (Dynamic attributes are not supported since they are not resolved\n     *  at the time of injection and can change over time.)\n     *\n     * # Example\n     * Given:\n     * ```\n     * @Component(...)\n     * class MyComponent {\n     *   constructor(@Attribute('title') title: string) { ... }\n     * }\n     * ```\n     * When instantiated with\n     * ```\n     * <my-component title=\"Hello\"></my-component>\n     * ```\n     *\n     * Then factory method generated is:\n     * ```\n     * MyComponent.ɵcmp = defineComponent({\n     *   factory: () => new MyComponent(injectAttribute('title'))\n     *   ...\n     * })\n     * ```\n     *\n     * @publicApi\n     */\n    function injectAttributeImpl(tNode, attrNameToInject) {\n        ngDevMode && assertTNodeType(tNode, 12 /* AnyContainer */ | 3 /* AnyRNode */);\n        ngDevMode && assertDefined(tNode, 'expecting tNode');\n        if (attrNameToInject === 'class') {\n            return tNode.classes;\n        }\n        if (attrNameToInject === 'style') {\n            return tNode.styles;\n        }\n        var attrs = tNode.attrs;\n        if (attrs) {\n            var attrsLength = attrs.length;\n            var i = 0;\n            while (i < attrsLength) {\n                var value = attrs[i];\n                // If we hit a `Bindings` or `Template` marker then we are done.\n                if (isNameOnlyAttributeMarker(value))\n                    break;\n                // Skip namespaced attributes\n                if (value === 0 /* NamespaceURI */) {\n                    // we skip the next two values\n                    // as namespaced attributes looks like\n                    // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n                    // 'existValue', ...]\n                    i = i + 2;\n                }\n                else if (typeof value === 'number') {\n                    // Skip to the first value of the marked attribute.\n                    i++;\n                    while (i < attrsLength && typeof attrs[i] === 'string') {\n                        i++;\n                    }\n                }\n                else if (value === attrNameToInject) {\n                    return attrs[i + 1];\n                }\n                else {\n                    i = i + 2;\n                }\n            }\n        }\n        return null;\n    }\n    function notFoundValueOrThrow(notFoundValue, token, flags) {\n        if (flags & exports.InjectFlags.Optional) {\n            return notFoundValue;\n        }\n        else {\n            throwProviderNotFoundError(token, 'NodeInjector');\n        }\n    }\n    /**\n     * Returns the value associated to the given token from the ModuleInjector or throws exception\n     *\n     * @param lView The `LView` that contains the `tNode`\n     * @param token The token to look for\n     * @param flags Injection flags\n     * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n     * @returns the value from the injector or throws an exception\n     */\n    function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n        if (flags & exports.InjectFlags.Optional && notFoundValue === undefined) {\n            // This must be set or the NullInjector will throw for optional deps\n            notFoundValue = null;\n        }\n        if ((flags & (exports.InjectFlags.Self | exports.InjectFlags.Host)) === 0) {\n            var moduleInjector = lView[INJECTOR];\n            // switch to `injectInjectorOnly` implementation for module injector, since module injector\n            // should not have access to Component/Directive DI scope (that may happen through\n            // `directiveInject` implementation)\n            var previousInjectImplementation = setInjectImplementation(undefined);\n            try {\n                if (moduleInjector) {\n                    return moduleInjector.get(token, notFoundValue, flags & exports.InjectFlags.Optional);\n                }\n                else {\n                    return injectRootLimpMode(token, notFoundValue, flags & exports.InjectFlags.Optional);\n                }\n            }\n            finally {\n                setInjectImplementation(previousInjectImplementation);\n            }\n        }\n        return notFoundValueOrThrow(notFoundValue, token, flags);\n    }\n    /**\n     * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n     *\n     * Look for the injector providing the token by walking up the node injector tree and then\n     * the module injector tree.\n     *\n     * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n     * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n     *\n     * @param tNode The Node where the search for the injector should start\n     * @param lView The `LView` that contains the `tNode`\n     * @param token The token to look for\n     * @param flags Injection flags\n     * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n     * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n     */\n    function getOrCreateInjectable(tNode, lView, token, flags, notFoundValue) {\n        if (flags === void 0) { flags = exports.InjectFlags.Default; }\n        if (tNode !== null) {\n            var bloomHash = bloomHashBitOrFactory(token);\n            // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n            // so just call the factory function to create it.\n            if (typeof bloomHash === 'function') {\n                if (!enterDI(lView, tNode, flags)) {\n                    // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n                    // flag, the module injector is not searched for that token in Ivy.\n                    return (flags & exports.InjectFlags.Host) ?\n                        notFoundValueOrThrow(notFoundValue, token, flags) :\n                        lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n                }\n                try {\n                    var value = bloomHash(flags);\n                    if (value == null && !(flags & exports.InjectFlags.Optional)) {\n                        throwProviderNotFoundError(token);\n                    }\n                    else {\n                        return value;\n                    }\n                }\n                finally {\n                    leaveDI();\n                }\n            }\n            else if (typeof bloomHash === 'number') {\n                // A reference to the previous injector TView that was found while climbing the element\n                // injector tree. This is used to know if viewProviders can be accessed on the current\n                // injector.\n                var previousTView = null;\n                var injectorIndex = getInjectorIndex(tNode, lView);\n                var parentLocation = NO_PARENT_INJECTOR;\n                var hostTElementNode = flags & exports.InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n                // If we should skip this injector, or if there is no injector on this node, start by\n                // searching the parent injector.\n                if (injectorIndex === -1 || flags & exports.InjectFlags.SkipSelf) {\n                    parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :\n                        lView[injectorIndex + 8 /* PARENT */];\n                    if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n                        injectorIndex = -1;\n                    }\n                    else {\n                        previousTView = lView[TVIEW];\n                        injectorIndex = getParentInjectorIndex(parentLocation);\n                        lView = getParentInjectorView(parentLocation, lView);\n                    }\n                }\n                // Traverse up the injector tree until we find a potential match or until we know there\n                // *isn't* a match.\n                while (injectorIndex !== -1) {\n                    ngDevMode && assertNodeInjector(lView, injectorIndex);\n                    // Check the current injector. If it matches, see if it contains token.\n                    var tView = lView[TVIEW];\n                    ngDevMode &&\n                        assertTNodeForLView(tView.data[injectorIndex + 8 /* TNODE */], lView);\n                    if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n                        // At this point, we have an injector which *may* contain the token, so we step through\n                        // the providers and directives associated with the injector's corresponding node to get\n                        // the instance.\n                        var instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n                        if (instance !== NOT_FOUND) {\n                            return instance;\n                        }\n                    }\n                    parentLocation = lView[injectorIndex + 8 /* PARENT */];\n                    if (parentLocation !== NO_PARENT_INJECTOR &&\n                        shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* TNODE */] === hostTElementNode) &&\n                        bloomHasToken(bloomHash, injectorIndex, lView)) {\n                        // The def wasn't found anywhere on this node, so it was a false positive.\n                        // Traverse up the tree and continue searching.\n                        previousTView = tView;\n                        injectorIndex = getParentInjectorIndex(parentLocation);\n                        lView = getParentInjectorView(parentLocation, lView);\n                    }\n                    else {\n                        // If we should not search parent OR If the ancestor bloom filter value does not have the\n                        // bit corresponding to the directive we can give up on traversing up to find the specific\n                        // injector.\n                        injectorIndex = -1;\n                    }\n                }\n            }\n        }\n        return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n    }\n    var NOT_FOUND = {};\n    function createNodeInjector() {\n        return new NodeInjector(getCurrentTNode(), getLView());\n    }\n    function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n        var currentTView = lView[TVIEW];\n        var tNode = currentTView.data[injectorIndex + 8 /* TNODE */];\n        // First, we need to determine if view providers can be accessed by the starting element.\n        // There are two possibilities\n        var canAccessViewProviders = previousTView == null ?\n            // 1) This is the first invocation `previousTView == null` which means that we are at the\n            // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n            // to look into the ViewProviders is if:\n            // - we are on a component\n            // - AND the injector set `includeViewProviders` to true (implying that the token can see\n            // ViewProviders because it is the Component or a Service which itself was declared in\n            // ViewProviders)\n            (isComponentHost(tNode) && includeViewProviders) :\n            // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n            // In such a case we are only allowed to look into the ViewProviders if:\n            // - We just crossed from child View to Parent View `previousTView != currentTView`\n            // - AND the parent TNode is an Element.\n            // This means that we just came from the Component's View and therefore are allowed to see\n            // into the ViewProviders.\n            (previousTView != currentTView && ((tNode.type & 3 /* AnyRNode */) !== 0));\n        // This special case happens when there is a @host on the inject and when we are searching\n        // on the host element node.\n        var isHostSpecialCase = (flags & exports.InjectFlags.Host) && hostTElementNode === tNode;\n        var injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n        if (injectableIdx !== null) {\n            return getNodeInjectable(lView, currentTView, injectableIdx, tNode);\n        }\n        else {\n            return NOT_FOUND;\n        }\n    }\n    /**\n     * Searches for the given token among the node's directives and providers.\n     *\n     * @param tNode TNode on which directives are present.\n     * @param tView The tView we are currently processing\n     * @param token Provider token or type of a directive to look for.\n     * @param canAccessViewProviders Whether view providers should be considered.\n     * @param isHostSpecialCase Whether the host special case applies.\n     * @returns Index of a found directive or provider, or null when none found.\n     */\n    function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n        var nodeProviderIndexes = tNode.providerIndexes;\n        var tInjectables = tView.data;\n        var injectablesStart = nodeProviderIndexes & 1048575 /* ProvidersStartIndexMask */;\n        var directivesStart = tNode.directiveStart;\n        var directiveEnd = tNode.directiveEnd;\n        var cptViewProvidersCount = nodeProviderIndexes >> 20 /* CptViewProvidersCountShift */;\n        var startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n        // When the host special case applies, only the viewProviders and the component are visible\n        var endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n        for (var i = startingIndex; i < endIndex; i++) {\n            var providerTokenOrDef = tInjectables[i];\n            if (i < directivesStart && token === providerTokenOrDef ||\n                i >= directivesStart && providerTokenOrDef.type === token) {\n                return i;\n            }\n        }\n        if (isHostSpecialCase) {\n            var dirDef = tInjectables[directivesStart];\n            if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n                return directivesStart;\n            }\n        }\n        return null;\n    }\n    /**\n     * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n     *\n     * This function checks to see if the value has already been instantiated and if so returns the\n     * cached `injectable`. Otherwise if it detects that the value is still a factory it\n     * instantiates the `injectable` and caches the value.\n     */\n    function getNodeInjectable(lView, tView, index, tNode) {\n        var value = lView[index];\n        var tData = tView.data;\n        if (isFactory(value)) {\n            var factory = value;\n            if (factory.resolving) {\n                throwCyclicDependencyError(stringifyForError(tData[index]));\n            }\n            var previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n            factory.resolving = true;\n            var previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;\n            var success = enterDI(lView, tNode, exports.InjectFlags.Default);\n            ngDevMode &&\n                assertEqual(success, true, 'Because flags do not contain \\`SkipSelf\\' we expect this to always succeed.');\n            try {\n                value = lView[index] = factory.factory(undefined, tData, lView, tNode);\n                // This code path is hit for both directives and providers.\n                // For perf reasons, we want to avoid searching for hooks on providers.\n                // It does no harm to try (the hooks just won't exist), but the extra\n                // checks are unnecessary and this is a hot path. So we check to see\n                // if the index of the dependency is in the directive range for this\n                // tNode. If it's not, we know it's a provider and skip hook registration.\n                if (tView.firstCreatePass && index >= tNode.directiveStart) {\n                    ngDevMode && assertDirectiveDef(tData[index]);\n                    registerPreOrderHooks(index, tData[index], tView);\n                }\n            }\n            finally {\n                previousInjectImplementation !== null &&\n                    setInjectImplementation(previousInjectImplementation);\n                setIncludeViewProviders(previousIncludeViewProviders);\n                factory.resolving = false;\n                leaveDI();\n            }\n        }\n        return value;\n    }\n    /**\n     * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n     * the directive might be provided by the injector.\n     *\n     * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n     * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n     * is returned as the node injector can not possibly provide that token.\n     *\n     * @param token the injection token\n     * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n     *   When the returned value is negative then it represents special values such as `Injector`.\n     */\n    function bloomHashBitOrFactory(token) {\n        ngDevMode && assertDefined(token, 'token must be defined');\n        if (typeof token === 'string') {\n            return token.charCodeAt(0) || 0;\n        }\n        var tokenId = \n        // First check with `hasOwnProperty` so we don't get an inherited ID.\n        token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n        // Negative token IDs are used for special objects such as `Injector`\n        if (typeof tokenId === 'number') {\n            if (tokenId >= 0) {\n                return tokenId & BLOOM_MASK;\n            }\n            else {\n                ngDevMode &&\n                    assertEqual(tokenId, -1 /* Injector */, 'Expecting to get Special Injector Id');\n                return createNodeInjector;\n            }\n        }\n        else {\n            return tokenId;\n        }\n    }\n    function bloomHasToken(bloomHash, injectorIndex, injectorView) {\n        // Create a mask that targets the specific bit associated with the directive we're looking for.\n        // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n        // to bit positions 0 - 31 in a 32 bit integer.\n        var mask = 1 << bloomHash;\n        // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n        // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n        // that should be used.\n        var value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n        // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n        // this injector is a potential match.\n        return !!(value & mask);\n    }\n    /** Returns true if flags prevent parent injector from being searched for tokens */\n    function shouldSearchParent(flags, isFirstHostTNode) {\n        return !(flags & exports.InjectFlags.Self) && !(flags & exports.InjectFlags.Host && isFirstHostTNode);\n    }\n    var NodeInjector = /** @class */ (function () {\n        function NodeInjector(_tNode, _lView) {\n            this._tNode = _tNode;\n            this._lView = _lView;\n        }\n        NodeInjector.prototype.get = function (token, notFoundValue) {\n            return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue);\n        };\n        return NodeInjector;\n    }());\n    /**\n     * @codeGenApi\n     */\n    function ɵɵgetInheritedFactory(type) {\n        return noSideEffects(function () {\n            var ownConstructor = type.prototype.constructor;\n            var ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n            var objectPrototype = Object.prototype;\n            var parent = Object.getPrototypeOf(type.prototype).constructor;\n            // Go up the prototype until we hit `Object`.\n            while (parent && parent !== objectPrototype) {\n                var factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n                // If we hit something that has a factory and the factory isn't the same as the type,\n                // we've found the inherited factory. Note the check that the factory isn't the type's\n                // own factory is redundant in most cases, but if the user has custom decorators on the\n                // class, this lookup will start one level down in the prototype chain, causing us to\n                // find the own factory first and potentially triggering an infinite loop downstream.\n                if (factory && factory !== ownFactory) {\n                    return factory;\n                }\n                parent = Object.getPrototypeOf(parent);\n            }\n            // There is no factory defined. Either this was improper usage of inheritance\n            // (no Angular decorator on the superclass) or there is no constructor at all\n            // in the inheritance chain. Since the two cases cannot be distinguished, the\n            // latter has to be assumed.\n            return function (t) { return new t(); };\n        });\n    }\n    function getFactoryOf(type) {\n        if (isForwardRef(type)) {\n            return function () {\n                var factory = getFactoryOf(resolveForwardRef(type));\n                return factory && factory();\n            };\n        }\n        return getFactoryDef(type);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Facade for the attribute injection from DI.\n     *\n     * @codeGenApi\n     */\n    function ɵɵinjectAttribute(attrNameToInject) {\n        return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n    }\n\n    var ANNOTATIONS = '__annotations__';\n    var PARAMETERS = '__parameters__';\n    var PROP_METADATA = '__prop__metadata__';\n    /**\n     * @suppress {globalThis}\n     */\n    function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n        return noSideEffects(function () {\n            var metaCtor = makeMetadataCtor(props);\n            function DecoratorFactory() {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                if (this instanceof DecoratorFactory) {\n                    metaCtor.call.apply(metaCtor, __spreadArray([this], __read(args)));\n                    return this;\n                }\n                var annotationInstance = new (DecoratorFactory.bind.apply(DecoratorFactory, __spreadArray([void 0], __read(args))))();\n                return function TypeDecorator(cls) {\n                    if (typeFn)\n                        typeFn.apply(void 0, __spreadArray([cls], __read(args)));\n                    // Use of Object.defineProperty is important since it creates non-enumerable property which\n                    // prevents the property is copied during subclassing.\n                    var annotations = cls.hasOwnProperty(ANNOTATIONS) ?\n                        cls[ANNOTATIONS] :\n                        Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];\n                    annotations.push(annotationInstance);\n                    if (additionalProcessing)\n                        additionalProcessing(cls);\n                    return cls;\n                };\n            }\n            if (parentClass) {\n                DecoratorFactory.prototype = Object.create(parentClass.prototype);\n            }\n            DecoratorFactory.prototype.ngMetadataName = name;\n            DecoratorFactory.annotationCls = DecoratorFactory;\n            return DecoratorFactory;\n        });\n    }\n    function makeMetadataCtor(props) {\n        return function ctor() {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            if (props) {\n                var values = props.apply(void 0, __spreadArray([], __read(args)));\n                for (var propName in values) {\n                    this[propName] = values[propName];\n                }\n            }\n        };\n    }\n    function makeParamDecorator(name, props, parentClass) {\n        return noSideEffects(function () {\n            var metaCtor = makeMetadataCtor(props);\n            function ParamDecoratorFactory() {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                if (this instanceof ParamDecoratorFactory) {\n                    metaCtor.apply(this, args);\n                    return this;\n                }\n                var annotationInstance = new (ParamDecoratorFactory.bind.apply(ParamDecoratorFactory, __spreadArray([void 0], __read(args))))();\n                ParamDecorator.annotation = annotationInstance;\n                return ParamDecorator;\n                function ParamDecorator(cls, unusedKey, index) {\n                    // Use of Object.defineProperty is important since it creates non-enumerable property which\n                    // prevents the property is copied during subclassing.\n                    var parameters = cls.hasOwnProperty(PARAMETERS) ?\n                        cls[PARAMETERS] :\n                        Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];\n                    // there might be gaps if some in between parameters do not have annotations.\n                    // we pad with nulls.\n                    while (parameters.length <= index) {\n                        parameters.push(null);\n                    }\n                    (parameters[index] = parameters[index] || []).push(annotationInstance);\n                    return cls;\n                }\n            }\n            if (parentClass) {\n                ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n            }\n            ParamDecoratorFactory.prototype.ngMetadataName = name;\n            ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n            return ParamDecoratorFactory;\n        });\n    }\n    function makePropDecorator(name, props, parentClass, additionalProcessing) {\n        return noSideEffects(function () {\n            var metaCtor = makeMetadataCtor(props);\n            function PropDecoratorFactory() {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                if (this instanceof PropDecoratorFactory) {\n                    metaCtor.apply(this, args);\n                    return this;\n                }\n                var decoratorInstance = new (PropDecoratorFactory.bind.apply(PropDecoratorFactory, __spreadArray([void 0], __read(args))))();\n                function PropDecorator(target, name) {\n                    var constructor = target.constructor;\n                    // Use of Object.defineProperty is important because it creates a non-enumerable property\n                    // which prevents the property from being copied during subclassing.\n                    var meta = constructor.hasOwnProperty(PROP_METADATA) ?\n                        constructor[PROP_METADATA] :\n                        Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];\n                    meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n                    meta[name].unshift(decoratorInstance);\n                    if (additionalProcessing)\n                        additionalProcessing.apply(void 0, __spreadArray([target, name], __read(args)));\n                }\n                return PropDecorator;\n            }\n            if (parentClass) {\n                PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n            }\n            PropDecoratorFactory.prototype.ngMetadataName = name;\n            PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n            return PropDecoratorFactory;\n        });\n    }\n\n    /**\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://angular.io/license\n     */\n    function CREATE_ATTRIBUTE_DECORATOR__PRE_R3__() {\n        return makeParamDecorator('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });\n    }\n    function CREATE_ATTRIBUTE_DECORATOR__POST_R3__() {\n        return makeParamDecorator('Attribute', function (attributeName) { return ({ attributeName: attributeName, __NG_ELEMENT_ID__: function () { return ɵɵinjectAttribute(attributeName); } }); });\n    }\n    var CREATE_ATTRIBUTE_DECORATOR_IMPL = CREATE_ATTRIBUTE_DECORATOR__PRE_R3__;\n    /**\n     * Attribute decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Attribute = CREATE_ATTRIBUTE_DECORATOR_IMPL();\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Creates a token that can be used in a DI Provider.\n     *\n     * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n     * runtime representation) such as when injecting an interface, callable type, array or\n     * parameterized type.\n     *\n     * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n     * the `Injector`. This provides additional level of type safety.\n     *\n     * ```\n     * interface MyInterface {...}\n     * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));\n     * // myInterface is inferred to be MyInterface.\n     * ```\n     *\n     * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n     * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n     * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n     * application's root injector. If the factory function, which takes zero arguments, needs to inject\n     * dependencies, it can do so using the `inject` function. See below for an example.\n     *\n     * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n     * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As\n     * mentioned above, `'root'` is the default value for `providedIn`.\n     *\n     * @usageNotes\n     * ### Basic Example\n     *\n     * ### Plain InjectionToken\n     *\n     * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n     *\n     * ### Tree-shakable InjectionToken\n     *\n     * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n     *\n     *\n     * @publicApi\n     */\n    var InjectionToken = /** @class */ (function () {\n        function InjectionToken(_desc, options) {\n            this._desc = _desc;\n            /** @internal */\n            this.ngMetadataName = 'InjectionToken';\n            this.ɵprov = undefined;\n            if (typeof options == 'number') {\n                (typeof ngDevMode === 'undefined' || ngDevMode) &&\n                    assertLessThan(options, 0, 'Only negative numbers are supported here');\n                // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.\n                // See `InjectorMarkers`\n                this.__NG_ELEMENT_ID__ = options;\n            }\n            else if (options !== undefined) {\n                this.ɵprov = ɵɵdefineInjectable({\n                    token: this,\n                    providedIn: options.providedIn || 'root',\n                    factory: options.factory,\n                });\n            }\n        }\n        InjectionToken.prototype.toString = function () {\n            return \"InjectionToken \" + this._desc;\n        };\n        return InjectionToken;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A DI token that you can use to create a virtual [provider](guide/glossary#provider)\n     * that will populate the `entryComponents` field of components and NgModules\n     * based on its `useValue` property value.\n     * All components that are referenced in the `useValue` value (either directly\n     * or in a nested array or map) are added to the `entryComponents` property.\n     *\n     * @usageNotes\n     *\n     * The following example shows how the router can populate the `entryComponents`\n     * field of an NgModule based on a router configuration that refers\n     * to components.\n     *\n     * ```typescript\n     * // helper function inside the router\n     * function provideRoutes(routes) {\n     *   return [\n     *     {provide: ROUTES, useValue: routes},\n     *     {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}\n     *   ];\n     * }\n     *\n     * // user code\n     * let routes = [\n     *   {path: '/root', component: RootComp},\n     *   {path: '/teams', component: TeamsComp}\n     * ];\n     *\n     * @NgModule({\n     *   providers: [provideRoutes(routes)]\n     * })\n     * class ModuleWithRoutes {}\n     * ```\n     *\n     * @publicApi\n     * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.\n     */\n    var ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');\n    // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n    // explicitly set.\n    var emitDistinctChangesOnlyDefaultValue = true;\n    /**\n     * Base class for query metadata.\n     *\n     * @see `ContentChildren`.\n     * @see `ContentChild`.\n     * @see `ViewChildren`.\n     * @see `ViewChild`.\n     *\n     * @publicApi\n     */\n    var Query = /** @class */ (function () {\n        function Query() {\n        }\n        return Query;\n    }());\n    var ɵ0$1 = function (selector, data) {\n        if (data === void 0) { data = {}; }\n        return (Object.assign({ selector: selector, first: false, isViewQuery: false, descendants: false, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));\n    };\n    /**\n     * ContentChildren decorator and metadata.\n     *\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var ContentChildren = makePropDecorator('ContentChildren', ɵ0$1, Query);\n    var ɵ1 = function (selector, data) {\n        if (data === void 0) { data = {}; }\n        return (Object.assign({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));\n    };\n    /**\n     * ContentChild decorator and metadata.\n     *\n     *\n     * @Annotation\n     *\n     * @publicApi\n     */\n    var ContentChild = makePropDecorator('ContentChild', ɵ1, Query);\n    var ɵ2 = function (selector, data) {\n        if (data === void 0) { data = {}; }\n        return (Object.assign({ selector: selector, first: false, isViewQuery: true, descendants: true, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));\n    };\n    /**\n     * ViewChildren decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var ViewChildren = makePropDecorator('ViewChildren', ɵ2, Query);\n    var ɵ3 = function (selector, data) { return (Object.assign({ selector: selector, first: true, isViewQuery: true, descendants: true }, data)); };\n    /**\n     * ViewChild decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var ViewChild = makePropDecorator('ViewChild', ɵ3, Query);\n\n    /**\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://angular.io/license\n     */\n    (function (FactoryTarget) {\n        FactoryTarget[FactoryTarget[\"Directive\"] = 0] = \"Directive\";\n        FactoryTarget[FactoryTarget[\"Component\"] = 1] = \"Component\";\n        FactoryTarget[FactoryTarget[\"Injectable\"] = 2] = \"Injectable\";\n        FactoryTarget[FactoryTarget[\"Pipe\"] = 3] = \"Pipe\";\n        FactoryTarget[FactoryTarget[\"NgModule\"] = 4] = \"NgModule\";\n    })(exports.ɵɵFactoryTarget || (exports.ɵɵFactoryTarget = {}));\n    var ViewEncapsulation;\n    (function (ViewEncapsulation) {\n        ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n        // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n        ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n        ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n    })(ViewEncapsulation || (ViewEncapsulation = {}));\n\n    /**\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://angular.io/license\n     */\n    function getCompilerFacade(request) {\n        var globalNg = _global['ng'];\n        if (globalNg && globalNg.ɵcompilerFacade) {\n            return globalNg.ɵcompilerFacade;\n        }\n        if (typeof ngDevMode === 'undefined' || ngDevMode) {\n            // Log the type as an error so that a developer can easily navigate to the type from the\n            // console.\n            console.error(\"JIT compilation failed for \" + request.kind, request.type);\n            var message = \"The \" + request.kind + \" '\" + request\n                .type.name + \"' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n\";\n            if (request.usage === 1 /* PartialDeclaration */) {\n                message += \"The \" + request.kind + \" is part of a library that has been partially compiled.\\n\";\n                message +=\n                    \"However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n\";\n                message += '\\n';\n                message +=\n                    \"Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n\";\n            }\n            else {\n                message +=\n                    \"JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n\";\n            }\n            message +=\n                \"Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n\";\n            message +=\n                \"or manually provide the compiler with 'import \\\"@angular/compiler\\\";' before bootstrapping.\";\n            throw new Error(message);\n        }\n        else {\n            throw new Error('JIT compiler unavailable');\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @description\n     *\n     * Represents a type that a Component or other object is instances of.\n     *\n     * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n     * the `MyCustomComponent` constructor function.\n     *\n     * @publicApi\n     */\n    var Type = Function;\n    function isType(v) {\n        return typeof v === 'function';\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Equivalent to ES6 spread, add each item to an array.\n     *\n     * @param items The items to add\n     * @param arr The array to which you want to add the items\n     */\n    function addAllToArray(items, arr) {\n        for (var i = 0; i < items.length; i++) {\n            arr.push(items[i]);\n        }\n    }\n    /**\n     * Determines if the contents of two arrays is identical\n     *\n     * @param a first array\n     * @param b second array\n     * @param identityAccessor Optional function for extracting stable object identity from a value in\n     *     the array.\n     */\n    function arrayEquals(a, b, identityAccessor) {\n        if (a.length !== b.length)\n            return false;\n        for (var i = 0; i < a.length; i++) {\n            var valueA = a[i];\n            var valueB = b[i];\n            if (identityAccessor) {\n                valueA = identityAccessor(valueA);\n                valueB = identityAccessor(valueB);\n            }\n            if (valueB !== valueA) {\n                return false;\n            }\n        }\n        return true;\n    }\n    /**\n     * Flattens an array.\n     */\n    function flatten(list, dst) {\n        if (dst === undefined)\n            dst = list;\n        for (var i = 0; i < list.length; i++) {\n            var item = list[i];\n            if (Array.isArray(item)) {\n                // we need to inline it.\n                if (dst === list) {\n                    // Our assumption that the list was already flat was wrong and\n                    // we need to clone flat since we need to write to it.\n                    dst = list.slice(0, i);\n                }\n                flatten(item, dst);\n            }\n            else if (dst !== list) {\n                dst.push(item);\n            }\n        }\n        return dst;\n    }\n    function deepForEach(input, fn) {\n        input.forEach(function (value) { return Array.isArray(value) ? deepForEach(value, fn) : fn(value); });\n    }\n    function addToArray(arr, index, value) {\n        // perf: array.push is faster than array.splice!\n        if (index >= arr.length) {\n            arr.push(value);\n        }\n        else {\n            arr.splice(index, 0, value);\n        }\n    }\n    function removeFromArray(arr, index) {\n        // perf: array.pop is faster than array.splice!\n        if (index >= arr.length - 1) {\n            return arr.pop();\n        }\n        else {\n            return arr.splice(index, 1)[0];\n        }\n    }\n    function newArray(size, value) {\n        var list = [];\n        for (var i = 0; i < size; i++) {\n            list.push(value);\n        }\n        return list;\n    }\n    /**\n     * Remove item from array (Same as `Array.splice()` but faster.)\n     *\n     * `Array.splice()` is not as fast because it has to allocate an array for the elements which were\n     * removed. This causes memory pressure and slows down code when most of the time we don't\n     * care about the deleted items array.\n     *\n     * https://jsperf.com/fast-array-splice (About 20x faster)\n     *\n     * @param array Array to splice\n     * @param index Index of element in array to remove.\n     * @param count Number of items to remove.\n     */\n    function arraySplice(array, index, count) {\n        var length = array.length - count;\n        while (index < length) {\n            array[index] = array[index + count];\n            index++;\n        }\n        while (count--) {\n            array.pop(); // shrink the array\n        }\n    }\n    /**\n     * Same as `Array.splice(index, 0, value)` but faster.\n     *\n     * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n     * removed. This causes memory pressure and slows down code when most of the time we don't\n     * care about the deleted items array.\n     *\n     * @param array Array to splice.\n     * @param index Index in array where the `value` should be added.\n     * @param value Value to add to array.\n     */\n    function arrayInsert(array, index, value) {\n        ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\\'t insert past array end.');\n        var end = array.length;\n        while (end > index) {\n            var previousEnd = end - 1;\n            array[end] = array[previousEnd];\n            end = previousEnd;\n        }\n        array[index] = value;\n    }\n    /**\n     * Same as `Array.splice2(index, 0, value1, value2)` but faster.\n     *\n     * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n     * removed. This causes memory pressure and slows down code when most of the time we don't\n     * care about the deleted items array.\n     *\n     * @param array Array to splice.\n     * @param index Index in array where the `value` should be added.\n     * @param value1 Value to add to array.\n     * @param value2 Value to add to array.\n     */\n    function arrayInsert2(array, index, value1, value2) {\n        ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\\'t insert past array end.');\n        var end = array.length;\n        if (end == index) {\n            // inserting at the end.\n            array.push(value1, value2);\n        }\n        else if (end === 1) {\n            // corner case when we have less items in array than we have items to insert.\n            array.push(value2, array[0]);\n            array[0] = value1;\n        }\n        else {\n            end--;\n            array.push(array[end - 1], array[end]);\n            while (end > index) {\n                var previousEnd = end - 2;\n                array[end] = array[previousEnd];\n                end--;\n            }\n            array[index] = value1;\n            array[index + 1] = value2;\n        }\n    }\n    /**\n     * Insert a `value` into an `array` so that the array remains sorted.\n     *\n     * NOTE:\n     * - Duplicates are not allowed, and are ignored.\n     * - This uses binary search algorithm for fast inserts.\n     *\n     * @param array A sorted array to insert into.\n     * @param value The value to insert.\n     * @returns index of the inserted value.\n     */\n    function arrayInsertSorted(array, value) {\n        var index = arrayIndexOfSorted(array, value);\n        if (index < 0) {\n            // if we did not find it insert it.\n            index = ~index;\n            arrayInsert(array, index, value);\n        }\n        return index;\n    }\n    /**\n     * Remove `value` from a sorted `array`.\n     *\n     * NOTE:\n     * - This uses binary search algorithm for fast removals.\n     *\n     * @param array A sorted array to remove from.\n     * @param value The value to remove.\n     * @returns index of the removed value.\n     *   - positive index if value found and removed.\n     *   - negative index if value not found. (`~index` to get the value where it should have been\n     *     inserted)\n     */\n    function arrayRemoveSorted(array, value) {\n        var index = arrayIndexOfSorted(array, value);\n        if (index >= 0) {\n            arraySplice(array, index, 1);\n        }\n        return index;\n    }\n    /**\n     * Get an index of an `value` in a sorted `array`.\n     *\n     * NOTE:\n     * - This uses binary search algorithm for fast removals.\n     *\n     * @param array A sorted array to binary search.\n     * @param value The value to look for.\n     * @returns index of the value.\n     *   - positive index if value found.\n     *   - negative index if value not found. (`~index` to get the value where it should have been\n     *     located)\n     */\n    function arrayIndexOfSorted(array, value) {\n        return _arrayIndexOfSorted(array, value, 0);\n    }\n    /**\n     * Set a `value` for a `key`.\n     *\n     * @param keyValueArray to modify.\n     * @param key The key to locate or create.\n     * @param value The value to set for a `key`.\n     * @returns index (always even) of where the value vas set.\n     */\n    function keyValueArraySet(keyValueArray, key, value) {\n        var index = keyValueArrayIndexOf(keyValueArray, key);\n        if (index >= 0) {\n            // if we found it set it.\n            keyValueArray[index | 1] = value;\n        }\n        else {\n            index = ~index;\n            arrayInsert2(keyValueArray, index, key, value);\n        }\n        return index;\n    }\n    /**\n     * Retrieve a `value` for a `key` (on `undefined` if not found.)\n     *\n     * @param keyValueArray to search.\n     * @param key The key to locate.\n     * @return The `value` stored at the `key` location or `undefined if not found.\n     */\n    function keyValueArrayGet(keyValueArray, key) {\n        var index = keyValueArrayIndexOf(keyValueArray, key);\n        if (index >= 0) {\n            // if we found it retrieve it.\n            return keyValueArray[index | 1];\n        }\n        return undefined;\n    }\n    /**\n     * Retrieve a `key` index value in the array or `-1` if not found.\n     *\n     * @param keyValueArray to search.\n     * @param key The key to locate.\n     * @returns index of where the key is (or should have been.)\n     *   - positive (even) index if key found.\n     *   - negative index if key not found. (`~index` (even) to get the index where it should have\n     *     been inserted.)\n     */\n    function keyValueArrayIndexOf(keyValueArray, key) {\n        return _arrayIndexOfSorted(keyValueArray, key, 1);\n    }\n    /**\n     * Delete a `key` (and `value`) from the `KeyValueArray`.\n     *\n     * @param keyValueArray to modify.\n     * @param key The key to locate or delete (if exist).\n     * @returns index of where the key was (or should have been.)\n     *   - positive (even) index if key found and deleted.\n     *   - negative index if key not found. (`~index` (even) to get the index where it should have\n     *     been.)\n     */\n    function keyValueArrayDelete(keyValueArray, key) {\n        var index = keyValueArrayIndexOf(keyValueArray, key);\n        if (index >= 0) {\n            // if we found it remove it.\n            arraySplice(keyValueArray, index, 2);\n        }\n        return index;\n    }\n    /**\n     * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`.\n     *\n     * NOTE:\n     * - This uses binary search algorithm for fast removals.\n     *\n     * @param array A sorted array to binary search.\n     * @param value The value to look for.\n     * @param shift grouping shift.\n     *   - `0` means look at every location\n     *   - `1` means only look at every other (even) location (the odd locations are to be ignored as\n     *         they are values.)\n     * @returns index of the value.\n     *   - positive index if value found.\n     *   - negative index if value not found. (`~index` to get the value where it should have been\n     * inserted)\n     */\n    function _arrayIndexOfSorted(array, value, shift) {\n        ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n        var start = 0;\n        var end = array.length >> shift;\n        while (end !== start) {\n            var middle = start + ((end - start) >> 1); // find the middle.\n            var current = array[middle << shift];\n            if (value === current) {\n                return (middle << shift);\n            }\n            else if (current > value) {\n                end = middle;\n            }\n            else {\n                start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n            }\n        }\n        return ~(end << shift);\n    }\n\n    /*\n     * #########################\n     * Attention: These Regular expressions have to hold even if the code is minified!\n     * ##########################\n     */\n    /**\n     * Regular expression that detects pass-through constructors for ES5 output. This Regex\n     * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n     * it intends to capture the pattern where existing constructors have been downleveled from\n     * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n     *\n     * ```\n     *   function MyClass() {\n     *     var _this = _super.apply(this, arguments) || this;\n     * ```\n     *\n     * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n     * ```\n     *   function MyClass() {\n     *     var _this = _super.apply(this, __spread(arguments)) || this;\n     * ```\n     *\n     * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n     * ```\n     *   function MyClass() {\n     *     var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n     * ```\n     *\n     * More details can be found in: https://github.com/angular/angular/issues/38453.\n     */\n    var ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\))\\)/;\n    /** Regular expression that detects ES2015 classes which extend from other classes. */\n    var ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n    /**\n     * Regular expression that detects ES2015 classes which extend from other classes and\n     * have an explicit constructor defined.\n     */\n    var ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n    /**\n     * Regular expression that detects ES2015 classes which extend from other classes\n     * and inherit a constructor.\n     */\n    var ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{\\s*super\\(\\.\\.\\.arguments\\)/;\n    /**\n     * Determine whether a stringified type is a class which delegates its constructor\n     * to its parent.\n     *\n     * This is not trivial since compiled code can actually contain a constructor function\n     * even if the original source code did not. For instance, when the child class contains\n     * an initialized instance property.\n     */\n    function isDelegateCtor(typeStr) {\n        return ES5_DELEGATE_CTOR.test(typeStr) ||\n            ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n            (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n    }\n    var ReflectionCapabilities = /** @class */ (function () {\n        function ReflectionCapabilities(reflect) {\n            this._reflect = reflect || _global['Reflect'];\n        }\n        ReflectionCapabilities.prototype.isReflectionEnabled = function () {\n            return true;\n        };\n        ReflectionCapabilities.prototype.factory = function (t) {\n            return function () {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                return new (t.bind.apply(t, __spreadArray([void 0], __read(args))))();\n            };\n        };\n        /** @internal */\n        ReflectionCapabilities.prototype._zipTypesAndAnnotations = function (paramTypes, paramAnnotations) {\n            var result;\n            if (typeof paramTypes === 'undefined') {\n                result = newArray(paramAnnotations.length);\n            }\n            else {\n                result = newArray(paramTypes.length);\n            }\n            for (var i = 0; i < result.length; i++) {\n                // TS outputs Object for parameters without types, while Traceur omits\n                // the annotations. For now we preserve the Traceur behavior to aid\n                // migration, but this can be revisited.\n                if (typeof paramTypes === 'undefined') {\n                    result[i] = [];\n                }\n                else if (paramTypes[i] && paramTypes[i] != Object) {\n                    result[i] = [paramTypes[i]];\n                }\n                else {\n                    result[i] = [];\n                }\n                if (paramAnnotations && paramAnnotations[i] != null) {\n                    result[i] = result[i].concat(paramAnnotations[i]);\n                }\n            }\n            return result;\n        };\n        ReflectionCapabilities.prototype._ownParameters = function (type, parentCtor) {\n            var typeStr = type.toString();\n            // If we have no decorators, we only have function.length as metadata.\n            // In that case, to detect whether a child class declared an own constructor or not,\n            // we need to look inside of that constructor to check whether it is\n            // just calling the parent.\n            // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n            // that sets 'design:paramtypes' to []\n            // if a class inherits from another class but has no ctor declared itself.\n            if (isDelegateCtor(typeStr)) {\n                return null;\n            }\n            // Prefer the direct API.\n            if (type.parameters && type.parameters !== parentCtor.parameters) {\n                return type.parameters;\n            }\n            // API of tsickle for lowering decorators to properties on the class.\n            var tsickleCtorParams = type.ctorParameters;\n            if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n                // Newer tsickle uses a function closure\n                // Retain the non-function case for compatibility with older tsickle\n                var ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n                var paramTypes_1 = ctorParameters.map(function (ctorParam) { return ctorParam && ctorParam.type; });\n                var paramAnnotations_1 = ctorParameters.map(function (ctorParam) { return ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators); });\n                return this._zipTypesAndAnnotations(paramTypes_1, paramAnnotations_1);\n            }\n            // API for metadata created by invoking the decorators.\n            var paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];\n            var paramTypes = this._reflect && this._reflect.getOwnMetadata &&\n                this._reflect.getOwnMetadata('design:paramtypes', type);\n            if (paramTypes || paramAnnotations) {\n                return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n            }\n            // If a class has no decorators, at least create metadata\n            // based on function.length.\n            // Note: We know that this is a real constructor as we checked\n            // the content of the constructor above.\n            return newArray(type.length);\n        };\n        ReflectionCapabilities.prototype.parameters = function (type) {\n            // Note: only report metadata if we have at least one class decorator\n            // to stay in sync with the static reflector.\n            if (!isType(type)) {\n                return [];\n            }\n            var parentCtor = getParentCtor(type);\n            var parameters = this._ownParameters(type, parentCtor);\n            if (!parameters && parentCtor !== Object) {\n                parameters = this.parameters(parentCtor);\n            }\n            return parameters || [];\n        };\n        ReflectionCapabilities.prototype._ownAnnotations = function (typeOrFunc, parentCtor) {\n            // Prefer the direct API.\n            if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n                var annotations = typeOrFunc.annotations;\n                if (typeof annotations === 'function' && annotations.annotations) {\n                    annotations = annotations.annotations;\n                }\n                return annotations;\n            }\n            // API of tsickle for lowering decorators to properties on the class.\n            if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n                return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n            }\n            // API for metadata created by invoking the decorators.\n            if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n                return typeOrFunc[ANNOTATIONS];\n            }\n            return null;\n        };\n        ReflectionCapabilities.prototype.annotations = function (typeOrFunc) {\n            if (!isType(typeOrFunc)) {\n                return [];\n            }\n            var parentCtor = getParentCtor(typeOrFunc);\n            var ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n            var parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n            return parentAnnotations.concat(ownAnnotations);\n        };\n        ReflectionCapabilities.prototype._ownPropMetadata = function (typeOrFunc, parentCtor) {\n            // Prefer the direct API.\n            if (typeOrFunc.propMetadata &&\n                typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n                var propMetadata = typeOrFunc.propMetadata;\n                if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n                    propMetadata = propMetadata.propMetadata;\n                }\n                return propMetadata;\n            }\n            // API of tsickle for lowering decorators to properties on the class.\n            if (typeOrFunc.propDecorators &&\n                typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n                var propDecorators_1 = typeOrFunc.propDecorators;\n                var propMetadata_1 = {};\n                Object.keys(propDecorators_1).forEach(function (prop) {\n                    propMetadata_1[prop] = convertTsickleDecoratorIntoMetadata(propDecorators_1[prop]);\n                });\n                return propMetadata_1;\n            }\n            // API for metadata created by invoking the decorators.\n            if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n                return typeOrFunc[PROP_METADATA];\n            }\n            return null;\n        };\n        ReflectionCapabilities.prototype.propMetadata = function (typeOrFunc) {\n            if (!isType(typeOrFunc)) {\n                return {};\n            }\n            var parentCtor = getParentCtor(typeOrFunc);\n            var propMetadata = {};\n            if (parentCtor !== Object) {\n                var parentPropMetadata_1 = this.propMetadata(parentCtor);\n                Object.keys(parentPropMetadata_1).forEach(function (propName) {\n                    propMetadata[propName] = parentPropMetadata_1[propName];\n                });\n            }\n            var ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n            if (ownPropMetadata) {\n                Object.keys(ownPropMetadata).forEach(function (propName) {\n                    var decorators = [];\n                    if (propMetadata.hasOwnProperty(propName)) {\n                        decorators.push.apply(decorators, __spreadArray([], __read(propMetadata[propName])));\n                    }\n                    decorators.push.apply(decorators, __spreadArray([], __read(ownPropMetadata[propName])));\n                    propMetadata[propName] = decorators;\n                });\n            }\n            return propMetadata;\n        };\n        ReflectionCapabilities.prototype.ownPropMetadata = function (typeOrFunc) {\n            if (!isType(typeOrFunc)) {\n                return {};\n            }\n            return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n        };\n        ReflectionCapabilities.prototype.hasLifecycleHook = function (type, lcProperty) {\n            return type instanceof Type && lcProperty in type.prototype;\n        };\n        ReflectionCapabilities.prototype.guards = function (type) {\n            return {};\n        };\n        ReflectionCapabilities.prototype.getter = function (name) {\n            return new Function('o', 'return o.' + name + ';');\n        };\n        ReflectionCapabilities.prototype.setter = function (name) {\n            return new Function('o', 'v', 'return o.' + name + ' = v;');\n        };\n        ReflectionCapabilities.prototype.method = function (name) {\n            var functionBody = \"if (!o.\" + name + \") throw new Error('\\\"\" + name + \"\\\" is undefined');\\n        return o.\" + name + \".apply(o, args);\";\n            return new Function('o', 'args', functionBody);\n        };\n        // There is not a concept of import uri in Js, but this is useful in developing Dart applications.\n        ReflectionCapabilities.prototype.importUri = function (type) {\n            // StaticSymbol\n            if (typeof type === 'object' && type['filePath']) {\n                return type['filePath'];\n            }\n            // Runtime type\n            return \"./\" + stringify(type);\n        };\n        ReflectionCapabilities.prototype.resourceUri = function (type) {\n            return \"./\" + stringify(type);\n        };\n        ReflectionCapabilities.prototype.resolveIdentifier = function (name, moduleUrl, members, runtime) {\n            return runtime;\n        };\n        ReflectionCapabilities.prototype.resolveEnum = function (enumIdentifier, name) {\n            return enumIdentifier[name];\n        };\n        return ReflectionCapabilities;\n    }());\n    function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n        if (!decoratorInvocations) {\n            return [];\n        }\n        return decoratorInvocations.map(function (decoratorInvocation) {\n            var decoratorType = decoratorInvocation.type;\n            var annotationCls = decoratorType.annotationCls;\n            var annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n            return new (annotationCls.bind.apply(annotationCls, __spreadArray([void 0], __read(annotationArgs))))();\n        });\n    }\n    function getParentCtor(ctor) {\n        var parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n        var parentCtor = parentProto ? parentProto.constructor : null;\n        // Note: We always use `Object` as the null value\n        // to simplify checking later on.\n        return parentCtor || Object;\n    }\n\n    /**\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://angular.io/license\n     */\n    var _THROW_IF_NOT_FOUND = {};\n    var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n    /*\n     * Name of a property (that we patch onto DI decorator), which is used as an annotation of which\n     * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators\n     * in the code, thus making them tree-shakable.\n     */\n    var DI_DECORATOR_FLAG = '__NG_DI_FLAG__';\n    var NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\n    var NG_TOKEN_PATH = 'ngTokenPath';\n    var NEW_LINE = /\\n/gm;\n    var NO_NEW_LINE = 'ɵ';\n    var SOURCE = '__source';\n    var ɵ0$2 = getClosureSafeProperty;\n    var USE_VALUE = getClosureSafeProperty({ provide: String, useValue: ɵ0$2 });\n    /**\n     * Current injector value used by `inject`.\n     * - `undefined`: it is an error to call `inject`\n     * - `null`: `inject` can be called but there is no injector (limp-mode).\n     * - Injector instance: Use the injector for resolution.\n     */\n    var _currentInjector = undefined;\n    function setCurrentInjector(injector) {\n        var former = _currentInjector;\n        _currentInjector = injector;\n        return former;\n    }\n    function injectInjectorOnly(token, flags) {\n        if (flags === void 0) { flags = exports.InjectFlags.Default; }\n        if (_currentInjector === undefined) {\n            throw new Error(\"inject() must be called from an injection context\");\n        }\n        else if (_currentInjector === null) {\n            return injectRootLimpMode(token, undefined, flags);\n        }\n        else {\n            return _currentInjector.get(token, flags & exports.InjectFlags.Optional ? null : undefined, flags);\n        }\n    }\n    function ɵɵinject(token, flags) {\n        if (flags === void 0) { flags = exports.InjectFlags.Default; }\n        return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);\n    }\n    /**\n     * Throws an error indicating that a factory function could not be generated by the compiler for a\n     * particular class.\n     *\n     * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n     * off, saving bytes of generated code while still providing a good experience in dev mode.\n     *\n     * The name of the class is not mentioned here, but will be in the generated factory function name\n     * and thus in the stack trace.\n     *\n     * @codeGenApi\n     */\n    function ɵɵinvalidFactoryDep(index) {\n        var msg = ngDevMode ?\n            \"This constructor is not compatible with Angular Dependency Injection because its dependency at index \" + index + \" of the parameter list is invalid.\\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\\n\\nPlease check that 1) the type for the parameter at index \" + index + \" is correct and 2) the correct Angular decorators are defined for this class and its ancestors.\" :\n            'invalid';\n        throw new Error(msg);\n    }\n    /**\n     * Injects a token from the currently active injector.\n     *\n     * Must be used in the context of a factory function such as one defined for an\n     * `InjectionToken`. Throws an error if not called from such a context.\n     *\n     * Within such a factory function, using this function to request injection of a dependency\n     * is faster and more type-safe than providing an additional array of dependencies\n     * (as has been common with `useFactory` providers).\n     *\n     * @param token The injection token for the dependency to be injected.\n     * @param flags Optional flags that control how injection is executed.\n     * The flags correspond to injection strategies that can be specified with\n     * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.\n     * @returns the injected value if injection is successful, `null` otherwise.\n     *\n     * @usageNotes\n     *\n     * ### Example\n     *\n     * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n     *\n     * @publicApi\n     */\n    var inject = ɵɵinject;\n    function injectArgs(types) {\n        var args = [];\n        for (var i = 0; i < types.length; i++) {\n            var arg = resolveForwardRef(types[i]);\n            if (Array.isArray(arg)) {\n                if (arg.length === 0) {\n                    throw new Error('Arguments array must have arguments.');\n                }\n                var type = undefined;\n                var flags = exports.InjectFlags.Default;\n                for (var j = 0; j < arg.length; j++) {\n                    var meta = arg[j];\n                    var flag = getInjectFlag(meta);\n                    if (typeof flag === 'number') {\n                        // Special case when we handle @Inject decorator.\n                        if (flag === -1 /* Inject */) {\n                            type = meta.token;\n                        }\n                        else {\n                            flags |= flag;\n                        }\n                    }\n                    else {\n                        type = meta;\n                    }\n                }\n                args.push(ɵɵinject(type, flags));\n            }\n            else {\n                args.push(ɵɵinject(arg));\n            }\n        }\n        return args;\n    }\n    /**\n     * Attaches a given InjectFlag to a given decorator using monkey-patching.\n     * Since DI decorators can be used in providers `deps` array (when provider is configured using\n     * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we\n     * attach the flag to make it available both as a static property and as a field on decorator\n     * instance.\n     *\n     * @param decorator Provided DI decorator.\n     * @param flag InjectFlag that should be applied.\n     */\n    function attachInjectFlag(decorator, flag) {\n        decorator[DI_DECORATOR_FLAG] = flag;\n        decorator.prototype[DI_DECORATOR_FLAG] = flag;\n        return decorator;\n    }\n    /**\n     * Reads monkey-patched property that contains InjectFlag attached to a decorator.\n     *\n     * @param token Token that may contain monkey-patched DI flags property.\n     */\n    function getInjectFlag(token) {\n        return token[DI_DECORATOR_FLAG];\n    }\n    function catchInjectorError(e, token, injectorErrorName, source) {\n        var tokenPath = e[NG_TEMP_TOKEN_PATH];\n        if (token[SOURCE]) {\n            tokenPath.unshift(token[SOURCE]);\n        }\n        e.message = formatError('\\n' + e.message, tokenPath, injectorErrorName, source);\n        e[NG_TOKEN_PATH] = tokenPath;\n        e[NG_TEMP_TOKEN_PATH] = null;\n        throw e;\n    }\n    function formatError(text, obj, injectorErrorName, source) {\n        if (source === void 0) { source = null; }\n        text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;\n        var context = stringify(obj);\n        if (Array.isArray(obj)) {\n            context = obj.map(stringify).join(' -> ');\n        }\n        else if (typeof obj === 'object') {\n            var parts = [];\n            for (var key in obj) {\n                if (obj.hasOwnProperty(key)) {\n                    var value = obj[key];\n                    parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n                }\n            }\n            context = \"{\" + parts.join(', ') + \"}\";\n        }\n        return \"\" + injectorErrorName + (source ? '(' + source + ')' : '') + \"[\" + context + \"]: \" + text.replace(NEW_LINE, '\\n  ');\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$3 = function (token) { return ({ token: token }); };\n    /**\n     * Inject decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Inject = attachInjectFlag(\n    // Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\n    // tslint:disable-next-line: no-toplevel-property-access\n    makeParamDecorator('Inject', ɵ0$3), -1 /* Inject */);\n    /**\n     * Optional decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Optional = \n    // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n    // tslint:disable-next-line: no-toplevel-property-access\n    attachInjectFlag(makeParamDecorator('Optional'), 8 /* Optional */);\n    /**\n     * Self decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Self = \n    // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n    // tslint:disable-next-line: no-toplevel-property-access\n    attachInjectFlag(makeParamDecorator('Self'), 2 /* Self */);\n    /**\n     * `SkipSelf` decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var SkipSelf = \n    // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n    // tslint:disable-next-line: no-toplevel-property-access\n    attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* SkipSelf */);\n    /**\n     * Host decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Host = \n    // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n    // tslint:disable-next-line: no-toplevel-property-access\n    attachInjectFlag(makeParamDecorator('Host'), 1 /* Host */);\n\n    /**\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://angular.io/license\n     */\n    var _reflect = null;\n    function getReflect() {\n        return (_reflect = _reflect || new ReflectionCapabilities());\n    }\n    function reflectDependencies(type) {\n        return convertDependencies(getReflect().parameters(type));\n    }\n    function convertDependencies(deps) {\n        return deps.map(function (dep) { return reflectDependency(dep); });\n    }\n    function reflectDependency(dep) {\n        var meta = {\n            token: null,\n            attribute: null,\n            host: false,\n            optional: false,\n            self: false,\n            skipSelf: false,\n        };\n        if (Array.isArray(dep) && dep.length > 0) {\n            for (var j = 0; j < dep.length; j++) {\n                var param = dep[j];\n                if (param === undefined) {\n                    // param may be undefined if type of dep is not set by ngtsc\n                    continue;\n                }\n                var proto = Object.getPrototypeOf(param);\n                if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n                    meta.optional = true;\n                }\n                else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n                    meta.skipSelf = true;\n                }\n                else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n                    meta.self = true;\n                }\n                else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n                    meta.host = true;\n                }\n                else if (param instanceof Inject) {\n                    meta.token = param.token;\n                }\n                else if (param instanceof Attribute) {\n                    if (param.attributeName === undefined) {\n                        throw new Error(\"Attribute name must be defined.\");\n                    }\n                    meta.attribute = param.attributeName;\n                }\n                else {\n                    meta.token = param;\n                }\n            }\n        }\n        else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) {\n            meta.token = null;\n        }\n        else {\n            meta.token = dep;\n        }\n        return meta;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n     *\n     * Example:\n     * ```\n     * @Component({\n     *   selector: 'my-comp',\n     *   templateUrl: 'my-comp.html', // This requires asynchronous resolution\n     * })\n     * class MyComponent{\n     * }\n     *\n     * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n     * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n     *\n     * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n     * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n     *\n     * // Use browser's `fetch()` function as the default resource resolution strategy.\n     * resolveComponentResources(fetch).then(() => {\n     *   // After resolution all URLs have been converted into `template` strings.\n     *   renderComponent(MyComponent);\n     * });\n     *\n     * ```\n     *\n     * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n     * to call this method outside JIT mode.\n     *\n     * @param resourceResolver a function which is responsible for returning a `Promise` to the\n     * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n     */\n    function resolveComponentResources(resourceResolver) {\n        // Store all promises which are fetching the resources.\n        var componentResolved = [];\n        // Cache so that we don't fetch the same resource more than once.\n        var urlMap = new Map();\n        function cachedResourceResolve(url) {\n            var promise = urlMap.get(url);\n            if (!promise) {\n                var resp = resourceResolver(url);\n                urlMap.set(url, promise = resp.then(unwrapResponse));\n            }\n            return promise;\n        }\n        componentResourceResolutionQueue.forEach(function (component, type) {\n            var promises = [];\n            if (component.templateUrl) {\n                promises.push(cachedResourceResolve(component.templateUrl).then(function (template) {\n                    component.template = template;\n                }));\n            }\n            var styleUrls = component.styleUrls;\n            var styles = component.styles || (component.styles = []);\n            var styleOffset = component.styles.length;\n            styleUrls && styleUrls.forEach(function (styleUrl, index) {\n                styles.push(''); // pre-allocate array.\n                promises.push(cachedResourceResolve(styleUrl).then(function (style) {\n                    styles[styleOffset + index] = style;\n                    styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n                    if (styleUrls.length == 0) {\n                        component.styleUrls = undefined;\n                    }\n                }));\n            });\n            var fullyResolved = Promise.all(promises).then(function () { return componentDefResolved(type); });\n            componentResolved.push(fullyResolved);\n        });\n        clearResolutionOfComponentResourcesQueue();\n        return Promise.all(componentResolved).then(function () { return undefined; });\n    }\n    var componentResourceResolutionQueue = new Map();\n    // Track when existing ɵcmp for a Type is waiting on resources.\n    var componentDefPendingResolution = new Set();\n    function maybeQueueResolutionOfComponentResources(type, metadata) {\n        if (componentNeedsResolution(metadata)) {\n            componentResourceResolutionQueue.set(type, metadata);\n            componentDefPendingResolution.add(type);\n        }\n    }\n    function isComponentDefPendingResolution(type) {\n        return componentDefPendingResolution.has(type);\n    }\n    function componentNeedsResolution(component) {\n        return !!((component.templateUrl && !component.hasOwnProperty('template')) ||\n            component.styleUrls && component.styleUrls.length);\n    }\n    function clearResolutionOfComponentResourcesQueue() {\n        var old = componentResourceResolutionQueue;\n        componentResourceResolutionQueue = new Map();\n        return old;\n    }\n    function restoreComponentResolutionQueue(queue) {\n        componentDefPendingResolution.clear();\n        queue.forEach(function (_, type) { return componentDefPendingResolution.add(type); });\n        componentResourceResolutionQueue = queue;\n    }\n    function isComponentResourceResolutionQueueEmpty() {\n        return componentResourceResolutionQueue.size === 0;\n    }\n    function unwrapResponse(response) {\n        return typeof response == 'string' ? response : response.text();\n    }\n    function componentDefResolved(type) {\n        componentDefPendingResolution.delete(type);\n    }\n\n    /**\n     * The Trusted Types policy, or null if Trusted Types are not\n     * enabled/supported, or undefined if the policy has not been created yet.\n     */\n    var policy;\n    /**\n     * Returns the Trusted Types policy, or null if Trusted Types are not\n     * enabled/supported. The first call to this function will create the policy.\n     */\n    function getPolicy() {\n        if (policy === undefined) {\n            policy = null;\n            if (_global.trustedTypes) {\n                try {\n                    policy = _global.trustedTypes.createPolicy('angular', {\n                        createHTML: function (s) { return s; },\n                        createScript: function (s) { return s; },\n                        createScriptURL: function (s) { return s; },\n                    });\n                }\n                catch (_a) {\n                    // trustedTypes.createPolicy throws if called with a name that is\n                    // already registered, even in report-only mode. Until the API changes,\n                    // catch the error not to break the applications functionally. In such\n                    // cases, the code will fall back to using strings.\n                }\n            }\n        }\n        return policy;\n    }\n    /**\n     * Unsafely promote a string to a TrustedHTML, falling back to strings when\n     * Trusted Types are not available.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that the\n     * provided string will never cause an XSS vulnerability if used in a context\n     * that will be interpreted as HTML by a browser, e.g. when assigning to\n     * element.innerHTML.\n     */\n    function trustedHTMLFromString(html) {\n        var _a;\n        return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createHTML(html)) || html;\n    }\n    /**\n     * Unsafely promote a string to a TrustedScript, falling back to strings when\n     * Trusted Types are not available.\n     * @security In particular, it must be assured that the provided string will\n     * never cause an XSS vulnerability if used in a context that will be\n     * interpreted and executed as a script by a browser, e.g. when calling eval.\n     */\n    function trustedScriptFromString(script) {\n        var _a;\n        return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n    }\n    /**\n     * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n     * when Trusted Types are not available.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that the\n     * provided string will never cause an XSS vulnerability if used in a context\n     * that will cause a browser to load and execute a resource, e.g. when\n     * assigning to script.src.\n     */\n    function trustedScriptURLFromString(url) {\n        var _a;\n        return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScriptURL(url)) || url;\n    }\n    /**\n     * Unsafely call the Function constructor with the given string arguments. It\n     * is only available in development mode, and should be stripped out of\n     * production code.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that it\n     * is only called from development code, as use in production code can lead to\n     * XSS vulnerabilities.\n     */\n    function newTrustedFunctionForDev() {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        if (typeof ngDevMode === 'undefined') {\n            throw new Error('newTrustedFunctionForDev should never be called in production');\n        }\n        if (!_global.trustedTypes) {\n            // In environments that don't support Trusted Types, fall back to the most\n            // straightforward implementation:\n            return new (Function.bind.apply(Function, __spreadArray([void 0], __read(args))))();\n        }\n        // Chrome currently does not support passing TrustedScript to the Function\n        // constructor. The following implements the workaround proposed on the page\n        // below, where the Chromium bug is also referenced:\n        // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n        var fnArgs = args.slice(0, -1).join(',');\n        var fnBody = args[args.length - 1];\n        var body = \"(function anonymous(\" + fnArgs + \"\\n) { \" + fnBody + \"\\n})\";\n        // Using eval directly confuses the compiler and prevents this module from\n        // being stripped out of JS binaries even if not used. The global['eval']\n        // indirection fixes that.\n        var fn = _global['eval'](trustedScriptFromString(body));\n        if (fn.bind === undefined) {\n            // Workaround for a browser bug that only exists in Chrome 83, where passing\n            // a TrustedScript to eval just returns the TrustedScript back without\n            // evaluating it. In that case, fall back to the most straightforward\n            // implementation:\n            return new (Function.bind.apply(Function, __spreadArray([void 0], __read(args))))();\n        }\n        // To completely mimic the behavior of calling \"new Function\", two more\n        // things need to happen:\n        // 1. Stringifying the resulting function should return its source code\n        fn.toString = function () { return body; };\n        // 2. When calling the resulting function, `this` should refer to `global`\n        return fn.bind(_global);\n        // When Trusted Types support in Function constructors is widely available,\n        // the implementation of this function can be simplified to:\n        // return new Function(...args.map(a => trustedScriptFromString(a)));\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * The Trusted Types policy, or null if Trusted Types are not\n     * enabled/supported, or undefined if the policy has not been created yet.\n     */\n    var policy$1;\n    /**\n     * Returns the Trusted Types policy, or null if Trusted Types are not\n     * enabled/supported. The first call to this function will create the policy.\n     */\n    function getPolicy$1() {\n        if (policy$1 === undefined) {\n            policy$1 = null;\n            if (_global.trustedTypes) {\n                try {\n                    policy$1 = _global.trustedTypes\n                        .createPolicy('angular#unsafe-bypass', {\n                        createHTML: function (s) { return s; },\n                        createScript: function (s) { return s; },\n                        createScriptURL: function (s) { return s; },\n                    });\n                }\n                catch (_a) {\n                    // trustedTypes.createPolicy throws if called with a name that is\n                    // already registered, even in report-only mode. Until the API changes,\n                    // catch the error not to break the applications functionally. In such\n                    // cases, the code will fall back to using strings.\n                }\n            }\n        }\n        return policy$1;\n    }\n    /**\n     * Unsafely promote a string to a TrustedHTML, falling back to strings when\n     * Trusted Types are not available.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that it\n     * is only passed strings that come directly from custom sanitizers or the\n     * bypassSecurityTrust* functions.\n     */\n    function trustedHTMLFromStringBypass(html) {\n        var _a;\n        return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createHTML(html)) || html;\n    }\n    /**\n     * Unsafely promote a string to a TrustedScript, falling back to strings when\n     * Trusted Types are not available.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that it\n     * is only passed strings that come directly from custom sanitizers or the\n     * bypassSecurityTrust* functions.\n     */\n    function trustedScriptFromStringBypass(script) {\n        var _a;\n        return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n    }\n    /**\n     * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n     * when Trusted Types are not available.\n     * @security This is a security-sensitive function; any use of this function\n     * must go through security review. In particular, it must be assured that it\n     * is only passed strings that come directly from custom sanitizers or the\n     * bypassSecurityTrust* functions.\n     */\n    function trustedScriptURLFromStringBypass(url) {\n        var _a;\n        return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScriptURL(url)) || url;\n    }\n\n    /**\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://angular.io/license\n     */\n    var SafeValueImpl = /** @class */ (function () {\n        function SafeValueImpl(changingThisBreaksApplicationSecurity) {\n            this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n        }\n        SafeValueImpl.prototype.toString = function () {\n            return \"SafeValue must use [property]=binding: \" + this.changingThisBreaksApplicationSecurity +\n                \" (see https://g.co/ng/security#xss)\";\n        };\n        return SafeValueImpl;\n    }());\n    var SafeHtmlImpl = /** @class */ (function (_super) {\n        __extends(SafeHtmlImpl, _super);\n        function SafeHtmlImpl() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        SafeHtmlImpl.prototype.getTypeName = function () {\n            return \"HTML\" /* Html */;\n        };\n        return SafeHtmlImpl;\n    }(SafeValueImpl));\n    var SafeStyleImpl = /** @class */ (function (_super) {\n        __extends(SafeStyleImpl, _super);\n        function SafeStyleImpl() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        SafeStyleImpl.prototype.getTypeName = function () {\n            return \"Style\" /* Style */;\n        };\n        return SafeStyleImpl;\n    }(SafeValueImpl));\n    var SafeScriptImpl = /** @class */ (function (_super) {\n        __extends(SafeScriptImpl, _super);\n        function SafeScriptImpl() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        SafeScriptImpl.prototype.getTypeName = function () {\n            return \"Script\" /* Script */;\n        };\n        return SafeScriptImpl;\n    }(SafeValueImpl));\n    var SafeUrlImpl = /** @class */ (function (_super) {\n        __extends(SafeUrlImpl, _super);\n        function SafeUrlImpl() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        SafeUrlImpl.prototype.getTypeName = function () {\n            return \"URL\" /* Url */;\n        };\n        return SafeUrlImpl;\n    }(SafeValueImpl));\n    var SafeResourceUrlImpl = /** @class */ (function (_super) {\n        __extends(SafeResourceUrlImpl, _super);\n        function SafeResourceUrlImpl() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        SafeResourceUrlImpl.prototype.getTypeName = function () {\n            return \"ResourceURL\" /* ResourceUrl */;\n        };\n        return SafeResourceUrlImpl;\n    }(SafeValueImpl));\n    function unwrapSafeValue(value) {\n        return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity :\n            value;\n    }\n    function allowSanitizationBypassAndThrow(value, type) {\n        var actualType = getSanitizationBypassType(value);\n        if (actualType != null && actualType !== type) {\n            // Allow ResourceURLs in URL contexts, they are strictly more trusted.\n            if (actualType === \"ResourceURL\" /* ResourceUrl */ && type === \"URL\" /* Url */)\n                return true;\n            throw new Error(\"Required a safe \" + type + \", got a \" + actualType + \" (see https://g.co/ng/security#xss)\");\n        }\n        return actualType === type;\n    }\n    function getSanitizationBypassType(value) {\n        return value instanceof SafeValueImpl && value.getTypeName() || null;\n    }\n    /**\n     * Mark `html` string as trusted.\n     *\n     * This function wraps the trusted string in `String` and brands it in a way which makes it\n     * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n     *\n     * @param trustedHtml `html` string which needs to be implicitly trusted.\n     * @returns a `html` which has been branded to be implicitly trusted.\n     */\n    function bypassSanitizationTrustHtml(trustedHtml) {\n        return new SafeHtmlImpl(trustedHtml);\n    }\n    /**\n     * Mark `style` string as trusted.\n     *\n     * This function wraps the trusted string in `String` and brands it in a way which makes it\n     * recognizable to {@link styleSanitizer} to be trusted implicitly.\n     *\n     * @param trustedStyle `style` string which needs to be implicitly trusted.\n     * @returns a `style` hich has been branded to be implicitly trusted.\n     */\n    function bypassSanitizationTrustStyle(trustedStyle) {\n        return new SafeStyleImpl(trustedStyle);\n    }\n    /**\n     * Mark `script` string as trusted.\n     *\n     * This function wraps the trusted string in `String` and brands it in a way which makes it\n     * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n     *\n     * @param trustedScript `script` string which needs to be implicitly trusted.\n     * @returns a `script` which has been branded to be implicitly trusted.\n     */\n    function bypassSanitizationTrustScript(trustedScript) {\n        return new SafeScriptImpl(trustedScript);\n    }\n    /**\n     * Mark `url` string as trusted.\n     *\n     * This function wraps the trusted string in `String` and brands it in a way which makes it\n     * recognizable to {@link urlSanitizer} to be trusted implicitly.\n     *\n     * @param trustedUrl `url` string which needs to be implicitly trusted.\n     * @returns a `url`  which has been branded to be implicitly trusted.\n     */\n    function bypassSanitizationTrustUrl(trustedUrl) {\n        return new SafeUrlImpl(trustedUrl);\n    }\n    /**\n     * Mark `url` string as trusted.\n     *\n     * This function wraps the trusted string in `String` and brands it in a way which makes it\n     * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n     *\n     * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n     * @returns a `url` which has been branded to be implicitly trusted.\n     */\n    function bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n        return new SafeResourceUrlImpl(trustedResourceUrl);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML\n     * that needs sanitizing.\n     * Depending upon browser support we use one of two strategies for doing this.\n     * Default: DOMParser strategy\n     * Fallback: InertDocument strategy\n     */\n    function getInertBodyHelper(defaultDoc) {\n        var inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n        return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n    }\n    /**\n     * Uses DOMParser to create and fill an inert body element.\n     * This is the default strategy used in browsers that support it.\n     */\n    var DOMParserHelper = /** @class */ (function () {\n        function DOMParserHelper(inertDocumentHelper) {\n            this.inertDocumentHelper = inertDocumentHelper;\n        }\n        DOMParserHelper.prototype.getInertBodyElement = function (html) {\n            // We add these extra elements to ensure that the rest of the content is parsed as expected\n            // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n            // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags\n            // in `html` from consuming the otherwise explicit `</body>` tag.\n            html = '<body><remove></remove>' + html;\n            try {\n                var body = new window.DOMParser()\n                    .parseFromString(trustedHTMLFromString(html), 'text/html')\n                    .body;\n                if (body === null) {\n                    // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only\n                    // becomes available in the following tick of the JS engine. In that case we fall back to\n                    // the `inertDocumentHelper` instead.\n                    return this.inertDocumentHelper.getInertBodyElement(html);\n                }\n                body.removeChild(body.firstChild);\n                return body;\n            }\n            catch (_a) {\n                return null;\n            }\n        };\n        return DOMParserHelper;\n    }());\n    /**\n     * Use an HTML5 `template` element, if supported, or an inert body element created via\n     * `createHtmlDocument` to create and fill an inert DOM element.\n     * This is the fallback strategy if the browser does not support DOMParser.\n     */\n    var InertDocumentHelper = /** @class */ (function () {\n        function InertDocumentHelper(defaultDoc) {\n            this.defaultDoc = defaultDoc;\n            this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n            if (this.inertDocument.body == null) {\n                // usually there should be only one body element in the document, but IE doesn't have any, so\n                // we need to create one.\n                var inertHtml = this.inertDocument.createElement('html');\n                this.inertDocument.appendChild(inertHtml);\n                var inertBodyElement = this.inertDocument.createElement('body');\n                inertHtml.appendChild(inertBodyElement);\n            }\n        }\n        InertDocumentHelper.prototype.getInertBodyElement = function (html) {\n            // Prefer using <template> element if supported.\n            var templateEl = this.inertDocument.createElement('template');\n            if ('content' in templateEl) {\n                templateEl.innerHTML = trustedHTMLFromString(html);\n                return templateEl;\n            }\n            // Note that previously we used to do something like `this.inertDocument.body.innerHTML = html`\n            // and we returned the inert `body` node. This was changed, because IE seems to treat setting\n            // `innerHTML` on an inserted element differently, compared to one that hasn't been inserted\n            // yet. In particular, IE appears to split some of the text into multiple text nodes rather\n            // than keeping them in a single one which ends up messing with Ivy's i18n parsing further\n            // down the line. This has been worked around by creating a new inert `body` and using it as\n            // the root node in which we insert the HTML.\n            var inertBody = this.inertDocument.createElement('body');\n            inertBody.innerHTML = trustedHTMLFromString(html);\n            // Support: IE 11 only\n            // strip custom-namespaced attributes on IE<=11\n            if (this.defaultDoc.documentMode) {\n                this.stripCustomNsAttrs(inertBody);\n            }\n            return inertBody;\n        };\n        /**\n         * When IE11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n         * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.\n         * 'ns1:xlink:foo').\n         *\n         * This is undesirable since we don't want to allow any of these custom attributes. This method\n         * strips them all.\n         */\n        InertDocumentHelper.prototype.stripCustomNsAttrs = function (el) {\n            var elAttrs = el.attributes;\n            // loop backwards so that we can support removals.\n            for (var i = elAttrs.length - 1; 0 < i; i--) {\n                var attrib = elAttrs.item(i);\n                var attrName = attrib.name;\n                if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n                    el.removeAttribute(attrName);\n                }\n            }\n            var childNode = el.firstChild;\n            while (childNode) {\n                if (childNode.nodeType === Node.ELEMENT_NODE)\n                    this.stripCustomNsAttrs(childNode);\n                childNode = childNode.nextSibling;\n            }\n        };\n        return InertDocumentHelper;\n    }());\n    /**\n     * We need to determine whether the DOMParser exists in the global context and\n     * supports parsing HTML; HTML parsing support is not as wide as other formats, see\n     * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.\n     *\n     * @suppress {uselessCode}\n     */\n    function isDOMParserAvailable() {\n        try {\n            return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');\n        }\n        catch (_a) {\n            return false;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A pattern that recognizes a commonly useful subset of URLs that are safe.\n     *\n     * This regular expression matches a subset of URLs that will not cause script\n     * execution if used in URL context within a HTML document. Specifically, this\n     * regular expression matches if (comment from here on and regex copied from\n     * Soy's EscapingConventions):\n     * (1) Either an allowed protocol (http, https, mailto or ftp).\n     * (2) or no protocol.  A protocol must be followed by a colon. The below\n     *     allows that by allowing colons only after one of the characters [/?#].\n     *     A colon after a hash (#) must be in the fragment.\n     *     Otherwise, a colon after a (?) must be in a query.\n     *     Otherwise, a colon after a single solidus (/) must be in a path.\n     *     Otherwise, a colon after a double solidus (//) must be in the authority\n     *     (before port).\n     *\n     * The pattern disallows &, used in HTML entity declarations before\n     * one of the characters in [/?#]. This disallows HTML entities used in the\n     * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n     * It also disallows HTML entities in the first path part of a relative path,\n     * e.g. \"foo&lt;bar/baz\".  Our existing escaping functions should not produce\n     * that. More importantly, it disallows masking of a colon,\n     * e.g. \"javascript&#58;...\".\n     *\n     * This regular expression was taken from the Closure sanitization library.\n     */\n    var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;\n    /* A pattern that matches safe srcset values */\n    var SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n    /** A pattern that matches safe data URLs. Only matches image, video and audio types. */\n    var DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n    function _sanitizeUrl(url) {\n        url = String(url);\n        if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))\n            return url;\n        if (typeof ngDevMode === 'undefined' || ngDevMode) {\n            console.warn(\"WARNING: sanitizing unsafe URL value \" + url + \" (see https://g.co/ng/security#xss)\");\n        }\n        return 'unsafe:' + url;\n    }\n    function sanitizeSrcset(srcset) {\n        srcset = String(srcset);\n        return srcset.split(',').map(function (srcset) { return _sanitizeUrl(srcset.trim()); }).join(', ');\n    }\n\n    function tagSet(tags) {\n        var e_1, _a;\n        var res = {};\n        try {\n            for (var _b = __values(tags.split(',')), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var t = _c.value;\n                res[t] = true;\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return res;\n    }\n    function merge() {\n        var e_2, _a;\n        var sets = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            sets[_i] = arguments[_i];\n        }\n        var res = {};\n        try {\n            for (var sets_1 = __values(sets), sets_1_1 = sets_1.next(); !sets_1_1.done; sets_1_1 = sets_1.next()) {\n                var s = sets_1_1.value;\n                for (var v in s) {\n                    if (s.hasOwnProperty(v))\n                        res[v] = true;\n                }\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (sets_1_1 && !sets_1_1.done && (_a = sets_1.return)) _a.call(sets_1);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        return res;\n    }\n    // Good source of info about elements and attributes\n    // https://html.spec.whatwg.org/#semantics\n    // https://simon.html5.org/html-elements\n    // Safe Void Elements - HTML5\n    // https://html.spec.whatwg.org/#void-elements\n    var VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n    // Elements that you can, intentionally, leave open (and which close themselves)\n    // https://html.spec.whatwg.org/#optional-tags\n    var OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\n    var OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\n    var OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n    // Safe Block Elements - HTML5\n    var BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +\n        'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n        'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n    // Inline Elements - HTML5\n    var INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +\n        'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n        'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\n    var VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n    // Attributes that have href and hence need to be sanitized\n    var URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n    // Attributes that have special href set hence need to be sanitized\n    var SRCSET_ATTRS = tagSet('srcset');\n    var HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n        'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n        'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n        'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n        'valign,value,vspace,width');\n    // Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)\n    var ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +\n        'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +\n        'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +\n        'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +\n        'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +\n        'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +\n        'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');\n    // NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n    // issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n    // innerHTML is required, SVG attributes should be added here.\n    // NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n    // can be sanitized, but they increase security surface area without a legitimate use case, so they\n    // are left out here.\n    var VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS, ARIA_ATTRS);\n    // Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n    //\n    // Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n    // `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n    // don't want to preserve the content, if the elements themselves are going to be removed.\n    var SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n    /**\n     * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n     * attributes.\n     */\n    var SanitizingHtmlSerializer = /** @class */ (function () {\n        function SanitizingHtmlSerializer() {\n            // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n            // because characters were re-encoded.\n            this.sanitizedSomething = false;\n            this.buf = [];\n        }\n        SanitizingHtmlSerializer.prototype.sanitizeChildren = function (el) {\n            // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n            // However this code never accesses properties off of `document` before deleting its contents\n            // again, so it shouldn't be vulnerable to DOM clobbering.\n            var current = el.firstChild;\n            var traverseContent = true;\n            while (current) {\n                if (current.nodeType === Node.ELEMENT_NODE) {\n                    traverseContent = this.startElement(current);\n                }\n                else if (current.nodeType === Node.TEXT_NODE) {\n                    this.chars(current.nodeValue);\n                }\n                else {\n                    // Strip non-element, non-text nodes.\n                    this.sanitizedSomething = true;\n                }\n                if (traverseContent && current.firstChild) {\n                    current = current.firstChild;\n                    continue;\n                }\n                while (current) {\n                    // Leaving the element. Walk up and to the right, closing tags as we go.\n                    if (current.nodeType === Node.ELEMENT_NODE) {\n                        this.endElement(current);\n                    }\n                    var next = this.checkClobberedElement(current, current.nextSibling);\n                    if (next) {\n                        current = next;\n                        break;\n                    }\n                    current = this.checkClobberedElement(current, current.parentNode);\n                }\n            }\n            return this.buf.join('');\n        };\n        /**\n         * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n         * be traversed. Element content must always be traversed (even if the element itself is not\n         * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n         *\n         * @param element The element to sanitize.\n         * @return True if the element's contents should be traversed.\n         */\n        SanitizingHtmlSerializer.prototype.startElement = function (element) {\n            var tagName = element.nodeName.toLowerCase();\n            if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n                this.sanitizedSomething = true;\n                return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n            }\n            this.buf.push('<');\n            this.buf.push(tagName);\n            var elAttrs = element.attributes;\n            for (var i = 0; i < elAttrs.length; i++) {\n                var elAttr = elAttrs.item(i);\n                var attrName = elAttr.name;\n                var lower = attrName.toLowerCase();\n                if (!VALID_ATTRS.hasOwnProperty(lower)) {\n                    this.sanitizedSomething = true;\n                    continue;\n                }\n                var value = elAttr.value;\n                // TODO(martinprobst): Special case image URIs for data:image/...\n                if (URI_ATTRS[lower])\n                    value = _sanitizeUrl(value);\n                if (SRCSET_ATTRS[lower])\n                    value = sanitizeSrcset(value);\n                this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n            }\n            this.buf.push('>');\n            return true;\n        };\n        SanitizingHtmlSerializer.prototype.endElement = function (current) {\n            var tagName = current.nodeName.toLowerCase();\n            if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n                this.buf.push('</');\n                this.buf.push(tagName);\n                this.buf.push('>');\n            }\n        };\n        SanitizingHtmlSerializer.prototype.chars = function (chars) {\n            this.buf.push(encodeEntities(chars));\n        };\n        SanitizingHtmlSerializer.prototype.checkClobberedElement = function (node, nextNode) {\n            if (nextNode &&\n                (node.compareDocumentPosition(nextNode) &\n                    Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {\n                throw new Error(\"Failed to sanitize html because the element is clobbered: \" + node.outerHTML);\n            }\n            return nextNode;\n        };\n        return SanitizingHtmlSerializer;\n    }());\n    // Regular Expressions for parsing tags and attributes\n    var SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n    // ! to ~ is the ASCII range.\n    var NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n    /**\n     * Escapes all potentially dangerous characters, so that the\n     * resulting string can be safely inserted into attribute or\n     * element text.\n     * @param value\n     */\n    function encodeEntities(value) {\n        return value.replace(/&/g, '&amp;')\n            .replace(SURROGATE_PAIR_REGEXP, function (match) {\n            var hi = match.charCodeAt(0);\n            var low = match.charCodeAt(1);\n            return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n        })\n            .replace(NON_ALPHANUMERIC_REGEXP, function (match) {\n            return '&#' + match.charCodeAt(0) + ';';\n        })\n            .replace(/</g, '&lt;')\n            .replace(/>/g, '&gt;');\n    }\n    var inertBodyHelper;\n    /**\n     * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n     * the DOM in a browser environment.\n     */\n    function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n        var inertBodyElement = null;\n        try {\n            inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n            // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n            var unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n            inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n            // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n            // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n            var mXSSAttempts = 5;\n            var parsedHtml = unsafeHtml;\n            do {\n                if (mXSSAttempts === 0) {\n                    throw new Error('Failed to sanitize html because the input is unstable');\n                }\n                mXSSAttempts--;\n                unsafeHtml = parsedHtml;\n                parsedHtml = inertBodyElement.innerHTML;\n                inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n            } while (unsafeHtml !== parsedHtml);\n            var sanitizer = new SanitizingHtmlSerializer();\n            var safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);\n            if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n                console.warn('WARNING: sanitizing HTML stripped some content, see https://g.co/ng/security#xss');\n            }\n            return trustedHTMLFromString(safeHtml);\n        }\n        finally {\n            // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n            if (inertBodyElement) {\n                var parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n                while (parent.firstChild) {\n                    parent.removeChild(parent.firstChild);\n                }\n            }\n        }\n    }\n    function getTemplateContent(el) {\n        return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el) ?\n            el.content :\n            null;\n    }\n    function isTemplateElement(el) {\n        return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n    }\n\n    /**\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://angular.io/license\n     */\n    (function (SecurityContext) {\n        SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n        SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n        SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n        SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n        SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n        SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n    })(exports.SecurityContext || (exports.SecurityContext = {}));\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n     * dangerous content.\n     *\n     * This method parses the `html` and locates potentially dangerous content (such as urls and\n     * javascript) and removes it.\n     *\n     * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n     *\n     * @param unsafeHtml untrusted `html`, typically from the user.\n     * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n     * and urls have been removed.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsanitizeHtml(unsafeHtml) {\n        var sanitizer = getSanitizer();\n        if (sanitizer) {\n            return trustedHTMLFromStringBypass(sanitizer.sanitize(exports.SecurityContext.HTML, unsafeHtml) || '');\n        }\n        if (allowSanitizationBypassAndThrow(unsafeHtml, \"HTML\" /* Html */)) {\n            return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n        }\n        return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n    }\n    /**\n     * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n     * dangerous content.\n     *\n     * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n     *\n     * @param unsafeStyle untrusted `style`, typically from the user.\n     * @returns `style` string which is safe to bind to the `style` properties.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsanitizeStyle(unsafeStyle) {\n        var sanitizer = getSanitizer();\n        if (sanitizer) {\n            return sanitizer.sanitize(exports.SecurityContext.STYLE, unsafeStyle) || '';\n        }\n        if (allowSanitizationBypassAndThrow(unsafeStyle, \"Style\" /* Style */)) {\n            return unwrapSafeValue(unsafeStyle);\n        }\n        return renderStringify(unsafeStyle);\n    }\n    /**\n     * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n     * dangerous\n     * content.\n     *\n     * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n     * removes it.\n     *\n     * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n     *\n     * @param unsafeUrl untrusted `url`, typically from the user.\n     * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n     * all of the dangerous javascript has been removed.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsanitizeUrl(unsafeUrl) {\n        var sanitizer = getSanitizer();\n        if (sanitizer) {\n            return sanitizer.sanitize(exports.SecurityContext.URL, unsafeUrl) || '';\n        }\n        if (allowSanitizationBypassAndThrow(unsafeUrl, \"URL\" /* Url */)) {\n            return unwrapSafeValue(unsafeUrl);\n        }\n        return _sanitizeUrl(renderStringify(unsafeUrl));\n    }\n    /**\n     * A `url` sanitizer which only lets trusted `url`s through.\n     *\n     * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n     *\n     * @param unsafeResourceUrl untrusted `url`, typically from the user.\n     * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n     * only trusted `url`s have been allowed to pass.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {\n        var sanitizer = getSanitizer();\n        if (sanitizer) {\n            return trustedScriptURLFromStringBypass(sanitizer.sanitize(exports.SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n        }\n        if (allowSanitizationBypassAndThrow(unsafeResourceUrl, \"ResourceURL\" /* ResourceUrl */)) {\n            return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n        }\n        throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');\n    }\n    /**\n     * A `script` sanitizer which only lets trusted javascript through.\n     *\n     * This passes only `script`s marked trusted by calling {@link\n     * bypassSanitizationTrustScript}.\n     *\n     * @param unsafeScript untrusted `script`, typically from the user.\n     * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n     * because only trusted `scripts` have been allowed to pass.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsanitizeScript(unsafeScript) {\n        var sanitizer = getSanitizer();\n        if (sanitizer) {\n            return trustedScriptFromStringBypass(sanitizer.sanitize(exports.SecurityContext.SCRIPT, unsafeScript) || '');\n        }\n        if (allowSanitizationBypassAndThrow(unsafeScript, \"Script\" /* Script */)) {\n            return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n        }\n        throw new Error('unsafe value used in a script context');\n    }\n    /**\n     * A template tag function for promoting the associated constant literal to a\n     * TrustedHTML. Interpolation is explicitly not allowed.\n     *\n     * @param html constant template literal containing trusted HTML.\n     * @returns TrustedHTML wrapping `html`.\n     *\n     * @security This is a security-sensitive function and should only be used to\n     * convert constant values of attributes and properties found in\n     * application-provided Angular templates to TrustedHTML.\n     *\n     * @codeGenApi\n     */\n    function ɵɵtrustConstantHtml(html) {\n        // The following runtime check ensures that the function was called as a\n        // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation\n        // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray\n        // is an array with a `raw` property that is also an array. The associated\n        // template literal has no interpolation if and only if the length of the\n        // TemplateStringsArray is 1.\n        if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n            throw new Error(\"Unexpected interpolation in trusted HTML constant: \" + html.join('?'));\n        }\n        return trustedHTMLFromString(html[0]);\n    }\n    /**\n     * A template tag function for promoting the associated constant literal to a\n     * TrustedScriptURL. Interpolation is explicitly not allowed.\n     *\n     * @param url constant template literal containing a trusted script URL.\n     * @returns TrustedScriptURL wrapping `url`.\n     *\n     * @security This is a security-sensitive function and should only be used to\n     * convert constant values of attributes and properties found in\n     * application-provided Angular templates to TrustedScriptURL.\n     *\n     * @codeGenApi\n     */\n    function ɵɵtrustConstantResourceUrl(url) {\n        // The following runtime check ensures that the function was called as a\n        // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any\n        // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A\n        // TemplateStringsArray is an array with a `raw` property that is also an\n        // array. The associated template literal has no interpolation if and only if\n        // the length of the TemplateStringsArray is 1.\n        if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n            throw new Error(\"Unexpected interpolation in trusted URL constant: \" + url.join('?'));\n        }\n        return trustedScriptURLFromString(url[0]);\n    }\n    /**\n     * Detects which sanitizer to use for URL property, based on tag name and prop name.\n     *\n     * The rules are based on the RESOURCE_URL context config from\n     * `packages/compiler/src/schema/dom_security_schema.ts`.\n     * If tag and prop names don't match Resource URL schema, use URL sanitizer.\n     */\n    function getUrlSanitizer(tag, prop) {\n        if ((prop === 'src' &&\n            (tag === 'embed' || tag === 'frame' || tag === 'iframe' || tag === 'media' ||\n                tag === 'script')) ||\n            (prop === 'href' && (tag === 'base' || tag === 'link'))) {\n            return ɵɵsanitizeResourceUrl;\n        }\n        return ɵɵsanitizeUrl;\n    }\n    /**\n     * Sanitizes URL, selecting sanitizer function based on tag and property names.\n     *\n     * This function is used in case we can't define security context at compile time, when only prop\n     * name is available. This happens when we generate host bindings for Directives/Components. The\n     * host element is unknown at compile time, so we defer calculation of specific sanitizer to\n     * runtime.\n     *\n     * @param unsafeUrl untrusted `url`, typically from the user.\n     * @param tag target element tag name.\n     * @param prop name of the property that contains the value.\n     * @returns `url` string which is safe to bind.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {\n        return getUrlSanitizer(tag, prop)(unsafeUrl);\n    }\n    function validateAgainstEventProperties(name) {\n        if (name.toLowerCase().startsWith('on')) {\n            var msg = \"Binding to event property '\" + name + \"' is disallowed for security reasons, \" +\n                (\"please use (\" + name.slice(2) + \")=...\") +\n                (\"\\nIf '\" + name + \"' is a directive input, make sure the directive is imported by the\") +\n                \" current module.\";\n            throw new Error(msg);\n        }\n    }\n    function validateAgainstEventAttributes(name) {\n        if (name.toLowerCase().startsWith('on')) {\n            var msg = \"Binding to event attribute '\" + name + \"' is disallowed for security reasons, \" +\n                (\"please use (\" + name.slice(2) + \")=...\");\n            throw new Error(msg);\n        }\n    }\n    function getSanitizer() {\n        var lView = getLView();\n        return lView && lView[SANITIZER];\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n     *\n     * This function will examine the provided DOM element, component, or directive instance\\'s\n     * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n     * value will be that of the newly created `LContext`.\n     *\n     * If the monkey-patched value is the `LView` instance then the context value for that\n     * target will be created and the monkey-patch reference will be updated. Therefore when this\n     * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n     * directive\\'s monkey-patch values.\n     *\n     * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n     * is found which contains a monkey-patch reference. When that occurs then the provided element\n     * will be updated with a new context (which is then returned). If the monkey-patch value is not\n     * detected for a component/directive instance then it will throw an error (all components and\n     * directives should be automatically monkey-patched by ivy).\n     *\n     * @param target Component, Directive or DOM Node.\n     */\n    function getLContext(target) {\n        var mpValue = readPatchedData(target);\n        if (mpValue) {\n            // only when it's an array is it considered an LView instance\n            // ... otherwise it's an already constructed LContext instance\n            if (Array.isArray(mpValue)) {\n                var lView = mpValue;\n                var nodeIndex = void 0;\n                var component = undefined;\n                var directives = undefined;\n                if (isComponentInstance(target)) {\n                    nodeIndex = findViaComponent(lView, target);\n                    if (nodeIndex == -1) {\n                        throw new Error('The provided component was not found in the application');\n                    }\n                    component = target;\n                }\n                else if (isDirectiveInstance(target)) {\n                    nodeIndex = findViaDirective(lView, target);\n                    if (nodeIndex == -1) {\n                        throw new Error('The provided directive was not found in the application');\n                    }\n                    directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);\n                }\n                else {\n                    nodeIndex = findViaNativeElement(lView, target);\n                    if (nodeIndex == -1) {\n                        return null;\n                    }\n                }\n                // the goal is not to fill the entire context full of data because the lookups\n                // are expensive. Instead, only the target data (the element, component, container, ICU\n                // expression or directive details) are filled into the context. If called multiple times\n                // with different target values then the missing target data will be filled in.\n                var native = unwrapRNode(lView[nodeIndex]);\n                var existingCtx = readPatchedData(native);\n                var context = (existingCtx && !Array.isArray(existingCtx)) ?\n                    existingCtx :\n                    createLContext(lView, nodeIndex, native);\n                // only when the component has been discovered then update the monkey-patch\n                if (component && context.component === undefined) {\n                    context.component = component;\n                    attachPatchData(context.component, context);\n                }\n                // only when the directives have been discovered then update the monkey-patch\n                if (directives && context.directives === undefined) {\n                    context.directives = directives;\n                    for (var i = 0; i < directives.length; i++) {\n                        attachPatchData(directives[i], context);\n                    }\n                }\n                attachPatchData(context.native, context);\n                mpValue = context;\n            }\n        }\n        else {\n            var rElement = target;\n            ngDevMode && assertDomNode(rElement);\n            // if the context is not found then we need to traverse upwards up the DOM\n            // to find the nearest element that has already been monkey patched with data\n            var parent = rElement;\n            while (parent = parent.parentNode) {\n                var parentContext = readPatchedData(parent);\n                if (parentContext) {\n                    var lView = void 0;\n                    if (Array.isArray(parentContext)) {\n                        lView = parentContext;\n                    }\n                    else {\n                        lView = parentContext.lView;\n                    }\n                    // the edge of the app was also reached here through another means\n                    // (maybe because the DOM was changed manually).\n                    if (!lView) {\n                        return null;\n                    }\n                    var index = findViaNativeElement(lView, rElement);\n                    if (index >= 0) {\n                        var native = unwrapRNode(lView[index]);\n                        var context = createLContext(lView, index, native);\n                        attachPatchData(native, context);\n                        mpValue = context;\n                        break;\n                    }\n                }\n            }\n        }\n        return mpValue || null;\n    }\n    /**\n     * Creates an empty instance of a `LContext` context\n     */\n    function createLContext(lView, nodeIndex, native) {\n        return {\n            lView: lView,\n            nodeIndex: nodeIndex,\n            native: native,\n            component: undefined,\n            directives: undefined,\n            localRefs: undefined,\n        };\n    }\n    /**\n     * Takes a component instance and returns the view for that component.\n     *\n     * @param componentInstance\n     * @returns The component's view\n     */\n    function getComponentViewByInstance(componentInstance) {\n        var lView = readPatchedData(componentInstance);\n        var view;\n        if (Array.isArray(lView)) {\n            var nodeIndex = findViaComponent(lView, componentInstance);\n            view = getComponentLViewByIndex(nodeIndex, lView);\n            var context = createLContext(lView, nodeIndex, view[HOST]);\n            context.component = componentInstance;\n            attachPatchData(componentInstance, context);\n            attachPatchData(context.native, context);\n        }\n        else {\n            var context = lView;\n            view = getComponentLViewByIndex(context.nodeIndex, context.lView);\n        }\n        return view;\n    }\n    /**\n     * This property will be monkey-patched on elements, components and directives.\n     */\n    var MONKEY_PATCH_KEY_NAME = '__ngContext__';\n    /**\n     * Assigns the given data to the given target (which could be a component,\n     * directive or DOM node instance) using monkey-patching.\n     */\n    function attachPatchData(target, data) {\n        ngDevMode && assertDefined(target, 'Target expected');\n        target[MONKEY_PATCH_KEY_NAME] = data;\n    }\n    /**\n     * Returns the monkey-patch value data present on the target (which could be\n     * a component, directive or a DOM node).\n     */\n    function readPatchedData(target) {\n        ngDevMode && assertDefined(target, 'Target expected');\n        return target[MONKEY_PATCH_KEY_NAME] || null;\n    }\n    function readPatchedLView(target) {\n        var value = readPatchedData(target);\n        if (value) {\n            return Array.isArray(value) ? value : value.lView;\n        }\n        return null;\n    }\n    function isComponentInstance(instance) {\n        return instance && instance.constructor && instance.constructor.ɵcmp;\n    }\n    function isDirectiveInstance(instance) {\n        return instance && instance.constructor && instance.constructor.ɵdir;\n    }\n    /**\n     * Locates the element within the given LView and returns the matching index\n     */\n    function findViaNativeElement(lView, target) {\n        var tView = lView[TVIEW];\n        for (var i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n            if (unwrapRNode(lView[i]) === target) {\n                return i;\n            }\n        }\n        return -1;\n    }\n    /**\n     * Locates the next tNode (child, sibling or parent).\n     */\n    function traverseNextElement(tNode) {\n        if (tNode.child) {\n            return tNode.child;\n        }\n        else if (tNode.next) {\n            return tNode.next;\n        }\n        else {\n            // Let's take the following template: <div><span>text</span></div><component/>\n            // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n            // in this case the parent `div`, so that we can find the component.\n            while (tNode.parent && !tNode.parent.next) {\n                tNode = tNode.parent;\n            }\n            return tNode.parent && tNode.parent.next;\n        }\n    }\n    /**\n     * Locates the component within the given LView and returns the matching index\n     */\n    function findViaComponent(lView, componentInstance) {\n        var componentIndices = lView[TVIEW].components;\n        if (componentIndices) {\n            for (var i = 0; i < componentIndices.length; i++) {\n                var elementComponentIndex = componentIndices[i];\n                var componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n                if (componentView[CONTEXT] === componentInstance) {\n                    return elementComponentIndex;\n                }\n            }\n        }\n        else {\n            var rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n            var rootComponent = rootComponentView[CONTEXT];\n            if (rootComponent === componentInstance) {\n                // we are dealing with the root element here therefore we know that the\n                // element is the very first element after the HEADER data in the lView\n                return HEADER_OFFSET;\n            }\n        }\n        return -1;\n    }\n    /**\n     * Locates the directive within the given LView and returns the matching index\n     */\n    function findViaDirective(lView, directiveInstance) {\n        // if a directive is monkey patched then it will (by default)\n        // have a reference to the LView of the current view. The\n        // element bound to the directive being search lives somewhere\n        // in the view data. We loop through the nodes and check their\n        // list of directives for the instance.\n        var tNode = lView[TVIEW].firstChild;\n        while (tNode) {\n            var directiveIndexStart = tNode.directiveStart;\n            var directiveIndexEnd = tNode.directiveEnd;\n            for (var i = directiveIndexStart; i < directiveIndexEnd; i++) {\n                if (lView[i] === directiveInstance) {\n                    return tNode.index;\n                }\n            }\n            tNode = traverseNextElement(tNode);\n        }\n        return -1;\n    }\n    /**\n     * Returns a list of directives extracted from the given view based on the\n     * provided list of directive index values.\n     *\n     * @param nodeIndex The node index\n     * @param lView The target view data\n     * @param includeComponents Whether or not to include components in returned directives\n     */\n    function getDirectivesAtNodeIndex(nodeIndex, lView, includeComponents) {\n        var tNode = lView[TVIEW].data[nodeIndex];\n        var directiveStartIndex = tNode.directiveStart;\n        if (directiveStartIndex == 0)\n            return EMPTY_ARRAY;\n        var directiveEndIndex = tNode.directiveEnd;\n        if (!includeComponents && tNode.flags & 2 /* isComponentHost */)\n            directiveStartIndex++;\n        return lView.slice(directiveStartIndex, directiveEndIndex);\n    }\n    function getComponentAtNodeIndex(nodeIndex, lView) {\n        var tNode = lView[TVIEW].data[nodeIndex];\n        var directiveStartIndex = tNode.directiveStart;\n        return tNode.flags & 2 /* isComponentHost */ ? lView[directiveStartIndex] : null;\n    }\n    /**\n     * Returns a map of local references (local reference name => element or directive instance) that\n     * exist on a given element.\n     */\n    function discoverLocalRefs(lView, nodeIndex) {\n        var tNode = lView[TVIEW].data[nodeIndex];\n        if (tNode && tNode.localNames) {\n            var result = {};\n            var localIndex = tNode.index + 1;\n            for (var i = 0; i < tNode.localNames.length; i += 2) {\n                result[tNode.localNames[i]] = lView[localIndex];\n                localIndex++;\n            }\n            return result;\n        }\n        return null;\n    }\n\n    /**\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://angular.io/license\n     */\n    var ERROR_TYPE = 'ngType';\n    var ERROR_DEBUG_CONTEXT = 'ngDebugContext';\n    var ERROR_ORIGINAL_ERROR = 'ngOriginalError';\n    var ERROR_LOGGER = 'ngErrorLogger';\n    function wrappedError(message, originalError) {\n        var msg = message + \" caused by: \" + (originalError instanceof Error ? originalError.message : originalError);\n        var error = Error(msg);\n        error[ERROR_ORIGINAL_ERROR] = originalError;\n        return error;\n    }\n\n    function getType(error) {\n        return error[ERROR_TYPE];\n    }\n    function getDebugContext(error) {\n        return error[ERROR_DEBUG_CONTEXT];\n    }\n    function getOriginalError(error) {\n        return error[ERROR_ORIGINAL_ERROR];\n    }\n    function getErrorLogger(error) {\n        return error && error[ERROR_LOGGER] || defaultErrorLogger;\n    }\n    function defaultErrorLogger(console) {\n        var values = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            values[_i - 1] = arguments[_i];\n        }\n        console.error.apply(console, __spreadArray([], __read(values)));\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Provides a hook for centralized exception handling.\n     *\n     * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n     * intercept error handling, write a custom exception handler that replaces this default as\n     * appropriate for your app.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```\n     * class MyErrorHandler implements ErrorHandler {\n     *   handleError(error) {\n     *     // do something with the exception\n     *   }\n     * }\n     *\n     * @NgModule({\n     *   providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n     * })\n     * class MyModule {}\n     * ```\n     *\n     * @publicApi\n     */\n    var ErrorHandler = /** @class */ (function () {\n        function ErrorHandler() {\n            /**\n             * @internal\n             */\n            this._console = console;\n        }\n        ErrorHandler.prototype.handleError = function (error) {\n            var originalError = this._findOriginalError(error);\n            var context = this._findContext(error);\n            // Note: Browser consoles show the place from where console.error was called.\n            // We can use this to give users additional information about the error.\n            var errorLogger = getErrorLogger(error);\n            errorLogger(this._console, \"ERROR\", error);\n            if (originalError) {\n                errorLogger(this._console, \"ORIGINAL ERROR\", originalError);\n            }\n            if (context) {\n                errorLogger(this._console, 'ERROR CONTEXT', context);\n            }\n        };\n        /** @internal */\n        ErrorHandler.prototype._findContext = function (error) {\n            return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;\n        };\n        /** @internal */\n        ErrorHandler.prototype._findOriginalError = function (error) {\n            var e = error && getOriginalError(error);\n            while (e && getOriginalError(e)) {\n                e = getOriginalError(e);\n            }\n            return e || null;\n        };\n        return ErrorHandler;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Defines a schema that allows an NgModule to contain the following:\n     * - Non-Angular elements named with dash case (`-`).\n     * - Element properties named with dash case (`-`).\n     * Dash case is the naming convention for custom elements.\n     *\n     * @publicApi\n     */\n    var CUSTOM_ELEMENTS_SCHEMA = {\n        name: 'custom-elements'\n    };\n    /**\n     * Defines a schema that allows any property on any element.\n     *\n     * This schema allows you to ignore the errors related to any unknown elements or properties in a\n     * template. The usage of this schema is generally discouraged because it prevents useful validation\n     * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.\n     *\n     * @publicApi\n     */\n    var NO_ERRORS_SCHEMA = {\n        name: 'no-errors-schema'\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Disallowed strings in the comment.\n     *\n     * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n     */\n    var COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;\n    /**\n     * Delimiter in the disallowed strings which needs to be wrapped with zero with character.\n     */\n    var COMMENT_DELIMITER = /(<|>)/;\n    var COMMENT_DELIMITER_ESCAPED = '\\u200B$1\\u200B';\n    /**\n     * Escape the content of comment strings so that it can be safely inserted into a comment node.\n     *\n     * The issue is that HTML does not specify any way to escape comment end text inside the comment.\n     * Consider: `<!-- The way you close a comment is with \">\", and \"->\" at the beginning or by \"-->\" or\n     * \"--!>\" at the end. -->`. Above the `\"-->\"` is meant to be text not an end to the comment. This\n     * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)\n     *\n     * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n     *\n     * ```\n     * div.innerHTML = div.innerHTML\n     * ```\n     *\n     * One would expect that the above code would be safe to do, but it turns out that because comment\n     * text is not escaped, the comment may contain text which will prematurely close the comment\n     * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which\n     * may contain such text and expect them to be safe.)\n     *\n     * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and\n     * surrounding them with `_>_` where the `_` is a zero width space `\\u200B`. The result is that if a\n     * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the\n     * text it will render normally but it will not cause the HTML parser to close/open the comment.\n     *\n     * @param value text to make safe for comment node by escaping the comment open/close character\n     *     sequence.\n     */\n    function escapeCommentText(value) {\n        return value.replace(COMMENT_DISALLOWED, function (text) { return text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED); });\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!\n     */\n    /**\n     * Creates an `Array` construction with a given name. This is useful when\n     * looking for memory consumption to see what time of array it is.\n     *\n     *\n     * @param name Name to give to the constructor\n     * @returns A subclass of `Array` if possible. This can only be done in\n     *          environments which support `class` construct.\n     */\n    function createNamedArrayType(name) {\n        // This should never be called in prod mode, so let's verify that is the case.\n        if (ngDevMode) {\n            try {\n                // If this function were compromised the following could lead to arbitrary\n                // script execution. We bless it with Trusted Types anyway since this\n                // function is stripped out of production binaries.\n                return (newTrustedFunctionForDev('Array', \"return class \" + name + \" extends Array{}\"))(Array);\n            }\n            catch (e) {\n                // If it does not work just give up and fall back to regular Array.\n                return Array;\n            }\n        }\n        else {\n            throw new Error('Looks like we are in \\'prod mode\\', but we are creating a named Array type, which is wrong! Check your code');\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function normalizeDebugBindingName(name) {\n        // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n        name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n        return \"ng-reflect-\" + name;\n    }\n    var CAMEL_CASE_REGEXP = /([A-Z])/g;\n    function camelCaseToDashCase(input) {\n        return input.replace(CAMEL_CASE_REGEXP, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            return '-' + m[1].toLowerCase();\n        });\n    }\n    function normalizeDebugBindingValue(value) {\n        try {\n            // Limit the size of the value as otherwise the DOM just gets polluted.\n            return value != null ? value.toString().slice(0, 30) : value;\n        }\n        catch (e) {\n            return '[ERROR] Exception while trying to serialize the value';\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$4 = function () { return (typeof requestAnimationFrame !== 'undefined' &&\n        requestAnimationFrame || // browser only\n        setTimeout // everything else\n    )\n        .bind(_global); };\n    var defaultScheduler = (ɵ0$4)();\n    /**\n     *\n     * @codeGenApi\n     */\n    function ɵɵresolveWindow(element) {\n        return element.ownerDocument.defaultView;\n    }\n    /**\n     *\n     * @codeGenApi\n     */\n    function ɵɵresolveDocument(element) {\n        return element.ownerDocument;\n    }\n    /**\n     *\n     * @codeGenApi\n     */\n    function ɵɵresolveBody(element) {\n        return element.ownerDocument.body;\n    }\n    /**\n     * The special delimiter we use to separate property names, prefixes, and suffixes\n     * in property binding metadata. See storeBindingMetadata().\n     *\n     * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n     * because it is a very uncommon character that is unlikely to be part of a user's\n     * property names or interpolation strings. If it is in fact used in a property\n     * binding, DebugElement.properties will not return the correct value for that\n     * binding. However, there should be no runtime effect for real applications.\n     *\n     * This character is typically rendered as a question mark inside of a diamond.\n     * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n     *\n     */\n    var INTERPOLATION_DELIMITER = \"\\uFFFD\";\n    /**\n     * Unwrap a value which might be behind a closure (for forward declaration reasons).\n     */\n    function maybeUnwrapFn(value) {\n        if (value instanceof Function) {\n            return value();\n        }\n        else {\n            return value;\n        }\n    }\n\n    /** Called when there are multiple component selectors that match a given node */\n    function throwMultipleComponentError(tNode) {\n        throw new RuntimeError(\"300\" /* MULTIPLE_COMPONENTS_MATCH */, \"Multiple components match node with tagname \" + tNode.value);\n    }\n    /** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\n    function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {\n        var field = propName ? \" for '\" + propName + \"'\" : '';\n        var msg = \"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value\" + field + \": '\" + oldValue + \"'. Current value: '\" + currValue + \"'.\";\n        if (creationMode) {\n            msg +=\n                \" It seems like the view has been created after its parent and its children have been dirty checked.\" +\n                    \" Has it been created in a change detection hook?\";\n        }\n        // TODO: include debug context, see `viewDebugError` function in\n        // `packages/core/src/view/errors.ts` for reference.\n        throw new RuntimeError(\"100\" /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);\n    }\n    function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {\n        var _a = __read(meta.split(INTERPOLATION_DELIMITER)), propName = _a[0], prefix = _a[1], chunks = _a.slice(2);\n        var oldValue = prefix, newValue = prefix;\n        for (var i = 0; i < chunks.length; i++) {\n            var slotIdx = rootIndex + i;\n            oldValue += \"\" + lView[slotIdx] + chunks[i];\n            newValue += \"\" + (slotIdx === expressionIndex ? changedValue : lView[slotIdx]) + chunks[i];\n        }\n        return { propName: propName, oldValue: oldValue, newValue: newValue };\n    }\n    /**\n     * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:\n     * - property name (for property bindings or interpolations)\n     * - old and new values, enriched using information from metadata\n     *\n     * More information on the metadata storage format can be found in `storePropertyBindingMetadata`\n     * function description.\n     */\n    function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {\n        var tData = lView[TVIEW].data;\n        var metadata = tData[bindingIndex];\n        if (typeof metadata === 'string') {\n            // metadata for property interpolation\n            if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {\n                return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);\n            }\n            // metadata for property binding\n            return { propName: metadata, oldValue: oldValue, newValue: newValue };\n        }\n        // metadata is not available for this expression, check if this expression is a part of the\n        // property interpolation by going from the current binding index left and look for a string that\n        // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:\n        // [..., 'id�Prefix � and � suffix', null, null, null, ...]\n        if (metadata === null) {\n            var idx = bindingIndex - 1;\n            while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {\n                idx--;\n            }\n            var meta = tData[idx];\n            if (typeof meta === 'string') {\n                var matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));\n                // first interpolation delimiter separates property name from interpolation parts (in case of\n                // property interpolations), so we subtract one from total number of found delimiters\n                if (matches && (matches.length - 1) > bindingIndex - idx) {\n                    return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);\n                }\n            }\n        }\n        return { propName: undefined, oldValue: oldValue, newValue: newValue };\n    }\n\n    /**\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://angular.io/license\n     */\n    (function (RendererStyleFlags2) {\n        // TODO(misko): This needs to be refactored into a separate file so that it can be imported from\n        // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails\n        // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.\n        /**\n         * Marks a style as important.\n         */\n        RendererStyleFlags2[RendererStyleFlags2[\"Important\"] = 1] = \"Important\";\n        /**\n         * Marks a style as using dash case naming (this-is-dash-case).\n         */\n        RendererStyleFlags2[RendererStyleFlags2[\"DashCase\"] = 2] = \"DashCase\";\n    })(exports.RendererStyleFlags2 || (exports.RendererStyleFlags2 = {}));\n\n    /**\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://angular.io/license\n     */\n    var _icuContainerIterate;\n    /**\n     * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.\n     */\n    function icuContainerIterate(tIcuContainerNode, lView) {\n        return _icuContainerIterate(tIcuContainerNode, lView);\n    }\n    /**\n     * Ensures that `IcuContainerVisitor`'s implementation is present.\n     *\n     * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the\n     * bundler to tree shake ICU logic and only load it if ICU instruction is executed.\n     */\n    function ensureIcuContainerVisitorLoaded(loader) {\n        if (_icuContainerIterate === undefined) {\n            // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it\n            // can be inlined into call-site.\n            _icuContainerIterate = loader();\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$5 = 1;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of\n     * that LContainer, which is an LView\n     * @param lView the lView whose parent to get\n     */\n    function getLViewParent(lView) {\n        ngDevMode && assertLView(lView);\n        var parent = lView[PARENT];\n        return isLContainer(parent) ? parent[PARENT] : parent;\n    }\n    /**\n     * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n     * reaching the root `LView`.\n     *\n     * @param componentOrLView any component or `LView`\n     */\n    function getRootView(componentOrLView) {\n        ngDevMode && assertDefined(componentOrLView, 'component');\n        var lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n        while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) {\n            lView = getLViewParent(lView);\n        }\n        ngDevMode && assertLView(lView);\n        return lView;\n    }\n    /**\n     * Returns the `RootContext` instance that is associated with\n     * the application where the target is situated. It does this by walking the parent views until it\n     * gets to the root view, then getting the context off of that.\n     *\n     * @param viewOrComponent the `LView` or component to get the root context for.\n     */\n    function getRootContext(viewOrComponent) {\n        var rootView = getRootView(viewOrComponent);\n        ngDevMode &&\n            assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?');\n        return rootView[CONTEXT];\n    }\n    /**\n     * Gets the first `LContainer` in the LView or `null` if none exists.\n     */\n    function getFirstLContainer(lView) {\n        return getNearestLContainer(lView[CHILD_HEAD]);\n    }\n    /**\n     * Gets the next `LContainer` that is a sibling of the given container.\n     */\n    function getNextLContainer(container) {\n        return getNearestLContainer(container[NEXT]);\n    }\n    function getNearestLContainer(viewOrContainer) {\n        while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n            viewOrContainer = viewOrContainer[NEXT];\n        }\n        return viewOrContainer;\n    }\n\n    /**\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://angular.io/license\n     */\n    var unusedValueToPlacateAjd = unusedValueExportToPlacateAjd + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd$1;\n    /**\n     * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n     * being passed as an argument.\n     */\n    function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n        // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n        // won't be created until i18nApply() in the update block, so this node should be skipped.\n        // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n        // in `i18n_spec.ts`.\n        if (lNodeToHandle != null) {\n            var lContainer = void 0;\n            var isComponent = false;\n            // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n            // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n            // it has LContainer so that we can process all of those cases appropriately.\n            if (isLContainer(lNodeToHandle)) {\n                lContainer = lNodeToHandle;\n            }\n            else if (isLView(lNodeToHandle)) {\n                isComponent = true;\n                ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n                lNodeToHandle = lNodeToHandle[HOST];\n            }\n            var rNode = unwrapRNode(lNodeToHandle);\n            ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n            if (action === 0 /* Create */ && parent !== null) {\n                if (beforeNode == null) {\n                    nativeAppendChild(renderer, parent, rNode);\n                }\n                else {\n                    nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n                }\n            }\n            else if (action === 1 /* Insert */ && parent !== null) {\n                nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n            }\n            else if (action === 2 /* Detach */) {\n                nativeRemoveNode(renderer, rNode, isComponent);\n            }\n            else if (action === 3 /* Destroy */) {\n                ngDevMode && ngDevMode.rendererDestroyNode++;\n                renderer.destroyNode(rNode);\n            }\n            if (lContainer != null) {\n                applyContainer(renderer, action, lContainer, parent, beforeNode);\n            }\n        }\n    }\n    function createTextNode(renderer, value) {\n        ngDevMode && ngDevMode.rendererCreateTextNode++;\n        ngDevMode && ngDevMode.rendererSetText++;\n        return isProceduralRenderer(renderer) ? renderer.createText(value) :\n            renderer.createTextNode(value);\n    }\n    function updateTextNode(renderer, rNode, value) {\n        ngDevMode && ngDevMode.rendererSetText++;\n        isProceduralRenderer(renderer) ? renderer.setValue(rNode, value) : rNode.textContent = value;\n    }\n    function createCommentNode(renderer, value) {\n        ngDevMode && ngDevMode.rendererCreateComment++;\n        // isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same\n        // method name.\n        return renderer.createComment(escapeCommentText(value));\n    }\n    /**\n     * Creates a native element from a tag name, using a renderer.\n     * @param renderer A renderer to use\n     * @param name the tag name\n     * @param namespace Optional namespace for element.\n     * @returns the element created\n     */\n    function createElementNode(renderer, name, namespace) {\n        ngDevMode && ngDevMode.rendererCreateElement++;\n        if (isProceduralRenderer(renderer)) {\n            return renderer.createElement(name, namespace);\n        }\n        else {\n            return namespace === null ? renderer.createElement(name) :\n                renderer.createElementNS(namespace, name);\n        }\n    }\n    /**\n     * Removes all DOM elements associated with a view.\n     *\n     * Because some root nodes of the view may be containers, we sometimes need\n     * to propagate deeply into the nested containers to remove all elements in the\n     * views beneath it.\n     *\n     * @param tView The `TView' of the `LView` from which elements should be added or removed\n     * @param lView The view from which elements should be added or removed\n     */\n    function removeViewFromContainer(tView, lView) {\n        var renderer = lView[RENDERER];\n        applyView(tView, lView, renderer, 2 /* Detach */, null, null);\n        lView[HOST] = null;\n        lView[T_HOST] = null;\n    }\n    /**\n     * Adds all DOM elements associated with a view.\n     *\n     * Because some root nodes of the view may be containers, we sometimes need\n     * to propagate deeply into the nested containers to add all elements in the\n     * views beneath it.\n     *\n     * @param tView The `TView' of the `LView` from which elements should be added or removed\n     * @param parentTNode The `TNode` where the `LView` should be attached to.\n     * @param renderer Current renderer to use for DOM manipulations.\n     * @param lView The view from which elements should be added or removed\n     * @param parentNativeNode The parent `RElement` where it should be inserted into.\n     * @param beforeNode The node before which elements should be added, if insert mode\n     */\n    function addViewToContainer(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {\n        lView[HOST] = parentNativeNode;\n        lView[T_HOST] = parentTNode;\n        applyView(tView, lView, renderer, 1 /* Insert */, parentNativeNode, beforeNode);\n    }\n    /**\n     * Detach a `LView` from the DOM by detaching its nodes.\n     *\n     * @param tView The `TView' of the `LView` to be detached\n     * @param lView the `LView` to be detached.\n     */\n    function renderDetachView(tView, lView) {\n        applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n    }\n    /**\n     * Traverses down and up the tree of views and containers to remove listeners and\n     * call onDestroy callbacks.\n     *\n     * Notes:\n     *  - Because it's used for onDestroy calls, it needs to be bottom-up.\n     *  - Must process containers instead of their views to avoid splicing\n     *  when views are destroyed and re-added.\n     *  - Using a while loop because it's faster than recursion\n     *  - Destroy only called on movement to sibling or movement to parent (laterally or up)\n     *\n     *  @param rootView The view to destroy\n     */\n    function destroyViewTree(rootView) {\n        // If the view has no children, we can clean it up and return early.\n        var lViewOrLContainer = rootView[CHILD_HEAD];\n        if (!lViewOrLContainer) {\n            return cleanUpView(rootView[TVIEW], rootView);\n        }\n        while (lViewOrLContainer) {\n            var next = null;\n            if (isLView(lViewOrLContainer)) {\n                // If LView, traverse down to child.\n                next = lViewOrLContainer[CHILD_HEAD];\n            }\n            else {\n                ngDevMode && assertLContainer(lViewOrLContainer);\n                // If container, traverse down to its first LView.\n                var firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n                if (firstView)\n                    next = firstView;\n            }\n            if (!next) {\n                // Only clean up view when moving to the side or up, as destroy hooks\n                // should be called in order from the bottom up.\n                while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {\n                    if (isLView(lViewOrLContainer)) {\n                        cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n                    }\n                    lViewOrLContainer = lViewOrLContainer[PARENT];\n                }\n                if (lViewOrLContainer === null)\n                    lViewOrLContainer = rootView;\n                if (isLView(lViewOrLContainer)) {\n                    cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n                }\n                next = lViewOrLContainer && lViewOrLContainer[NEXT];\n            }\n            lViewOrLContainer = next;\n        }\n    }\n    /**\n     * Inserts a view into a container.\n     *\n     * This adds the view to the container's array of active views in the correct\n     * position. It also adds the view's elements to the DOM if the container isn't a\n     * root node of another view (in that case, the view's elements will be added when\n     * the container's parent view is added later).\n     *\n     * @param tView The `TView' of the `LView` to insert\n     * @param lView The view to insert\n     * @param lContainer The container into which the view should be inserted\n     * @param index Which index in the container to insert the child view into\n     */\n    function insertView(tView, lView, lContainer, index) {\n        ngDevMode && assertLView(lView);\n        ngDevMode && assertLContainer(lContainer);\n        var indexInContainer = CONTAINER_HEADER_OFFSET + index;\n        var containerLength = lContainer.length;\n        if (index > 0) {\n            // This is a new view, we need to add it to the children.\n            lContainer[indexInContainer - 1][NEXT] = lView;\n        }\n        if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n            lView[NEXT] = lContainer[indexInContainer];\n            addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n        }\n        else {\n            lContainer.push(lView);\n            lView[NEXT] = null;\n        }\n        lView[PARENT] = lContainer;\n        // track views where declaration and insertion points are different\n        var declarationLContainer = lView[DECLARATION_LCONTAINER];\n        if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n            trackMovedView(declarationLContainer, lView);\n        }\n        // notify query that a new view has been added\n        var lQueries = lView[QUERIES];\n        if (lQueries !== null) {\n            lQueries.insertView(tView);\n        }\n        // Sets the attached flag\n        lView[FLAGS] |= 128 /* Attached */;\n    }\n    /**\n     * Track views created from the declaration container (TemplateRef) and inserted into a\n     * different LContainer.\n     */\n    function trackMovedView(declarationContainer, lView) {\n        ngDevMode && assertDefined(lView, 'LView required');\n        ngDevMode && assertLContainer(declarationContainer);\n        var movedViews = declarationContainer[MOVED_VIEWS];\n        var insertedLContainer = lView[PARENT];\n        ngDevMode && assertLContainer(insertedLContainer);\n        var insertedComponentLView = insertedLContainer[PARENT][DECLARATION_COMPONENT_VIEW];\n        ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n        var declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n        ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n        if (declaredComponentLView !== insertedComponentLView) {\n            // At this point the declaration-component is not same as insertion-component; this means that\n            // this is a transplanted view. Mark the declared lView as having transplanted views so that\n            // those views can participate in CD.\n            declarationContainer[HAS_TRANSPLANTED_VIEWS] = true;\n        }\n        if (movedViews === null) {\n            declarationContainer[MOVED_VIEWS] = [lView];\n        }\n        else {\n            movedViews.push(lView);\n        }\n    }\n    function detachMovedView(declarationContainer, lView) {\n        ngDevMode && assertLContainer(declarationContainer);\n        ngDevMode &&\n            assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');\n        var movedViews = declarationContainer[MOVED_VIEWS];\n        var declarationViewIndex = movedViews.indexOf(lView);\n        var insertionLContainer = lView[PARENT];\n        ngDevMode && assertLContainer(insertionLContainer);\n        // If the view was marked for refresh but then detached before it was checked (where the flag\n        // would be cleared and the counter decremented), we need to decrement the view counter here\n        // instead.\n        if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {\n            lView[FLAGS] &= ~1024 /* RefreshTransplantedView */;\n            updateTransplantedViewCount(insertionLContainer, -1);\n        }\n        movedViews.splice(declarationViewIndex, 1);\n    }\n    /**\n     * Detaches a view from a container.\n     *\n     * This method removes the view from the container's array of active views. It also\n     * removes the view's elements from the DOM.\n     *\n     * @param lContainer The container from which to detach a view\n     * @param removeIndex The index of the view to detach\n     * @returns Detached LView instance.\n     */\n    function detachView(lContainer, removeIndex) {\n        if (lContainer.length <= CONTAINER_HEADER_OFFSET)\n            return;\n        var indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n        var viewToDetach = lContainer[indexInContainer];\n        if (viewToDetach) {\n            var declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n            if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n                detachMovedView(declarationLContainer, viewToDetach);\n            }\n            if (removeIndex > 0) {\n                lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n            }\n            var removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n            removeViewFromContainer(viewToDetach[TVIEW], viewToDetach);\n            // notify query that a view has been removed\n            var lQueries = removedLView[QUERIES];\n            if (lQueries !== null) {\n                lQueries.detachView(removedLView[TVIEW]);\n            }\n            viewToDetach[PARENT] = null;\n            viewToDetach[NEXT] = null;\n            // Unsets the attached flag\n            viewToDetach[FLAGS] &= ~128 /* Attached */;\n        }\n        return viewToDetach;\n    }\n    /**\n     * A standalone function which destroys an LView,\n     * conducting clean up (e.g. removing listeners, calling onDestroys).\n     *\n     * @param tView The `TView' of the `LView` to be destroyed\n     * @param lView The view to be destroyed.\n     */\n    function destroyLView(tView, lView) {\n        if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n            var renderer = lView[RENDERER];\n            if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n                applyView(tView, lView, renderer, 3 /* Destroy */, null, null);\n            }\n            destroyViewTree(lView);\n        }\n    }\n    /**\n     * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n     * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n     * can be propagated to @Output listeners.\n     *\n     * @param tView `TView` for the `LView` to clean up.\n     * @param lView The LView to clean up\n     */\n    function cleanUpView(tView, lView) {\n        if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n            // Usually the Attached flag is removed when the view is detached from its parent, however\n            // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n            lView[FLAGS] &= ~128 /* Attached */;\n            // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n            // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n            // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n            // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n            // really more of an \"afterDestroy\" hook if you think about it.\n            lView[FLAGS] |= 256 /* Destroyed */;\n            executeOnDestroys(tView, lView);\n            processCleanups(tView, lView);\n            // For component views only, the local renderer is destroyed at clean up time.\n            if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n                ngDevMode && ngDevMode.rendererDestroy++;\n                lView[RENDERER].destroy();\n            }\n            var declarationContainer = lView[DECLARATION_LCONTAINER];\n            // we are dealing with an embedded view that is still inserted into a container\n            if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n                // and this is a projected view\n                if (declarationContainer !== lView[PARENT]) {\n                    detachMovedView(declarationContainer, lView);\n                }\n                // For embedded views still attached to a container: remove query result from this view.\n                var lQueries = lView[QUERIES];\n                if (lQueries !== null) {\n                    lQueries.detachView(tView);\n                }\n            }\n        }\n    }\n    /** Removes listeners and unsubscribes from output subscriptions */\n    function processCleanups(tView, lView) {\n        var tCleanup = tView.cleanup;\n        var lCleanup = lView[CLEANUP];\n        // `LCleanup` contains both share information with `TCleanup` as well as instance specific\n        // information appended at the end. We need to know where the end of the `TCleanup` information\n        // is, and we track this with `lastLCleanupIndex`.\n        var lastLCleanupIndex = -1;\n        if (tCleanup !== null) {\n            for (var i = 0; i < tCleanup.length - 1; i += 2) {\n                if (typeof tCleanup[i] === 'string') {\n                    // This is a native DOM listener\n                    var idxOrTargetGetter = tCleanup[i + 1];\n                    var target = typeof idxOrTargetGetter === 'function' ?\n                        idxOrTargetGetter(lView) :\n                        unwrapRNode(lView[idxOrTargetGetter]);\n                    var listener = lCleanup[lastLCleanupIndex = tCleanup[i + 2]];\n                    var useCaptureOrSubIdx = tCleanup[i + 3];\n                    if (typeof useCaptureOrSubIdx === 'boolean') {\n                        // native DOM listener registered with Renderer3\n                        target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);\n                    }\n                    else {\n                        if (useCaptureOrSubIdx >= 0) {\n                            // unregister\n                            lCleanup[lastLCleanupIndex = useCaptureOrSubIdx]();\n                        }\n                        else {\n                            // Subscription\n                            lCleanup[lastLCleanupIndex = -useCaptureOrSubIdx].unsubscribe();\n                        }\n                    }\n                    i += 2;\n                }\n                else {\n                    // This is a cleanup function that is grouped with the index of its context\n                    var context = lCleanup[lastLCleanupIndex = tCleanup[i + 1]];\n                    tCleanup[i].call(context);\n                }\n            }\n        }\n        if (lCleanup !== null) {\n            for (var i = lastLCleanupIndex + 1; i < lCleanup.length; i++) {\n                var instanceCleanupFn = lCleanup[i];\n                ngDevMode && assertFunction(instanceCleanupFn, 'Expecting instance cleanup function.');\n                instanceCleanupFn();\n            }\n            lView[CLEANUP] = null;\n        }\n    }\n    /** Calls onDestroy hooks for this view */\n    function executeOnDestroys(tView, lView) {\n        var destroyHooks;\n        if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n            for (var i = 0; i < destroyHooks.length; i += 2) {\n                var context = lView[destroyHooks[i]];\n                // Only call the destroy hook if the context has been requested.\n                if (!(context instanceof NodeInjectorFactory)) {\n                    var toCall = destroyHooks[i + 1];\n                    if (Array.isArray(toCall)) {\n                        for (var j = 0; j < toCall.length; j += 2) {\n                            var callContext = context[toCall[j]];\n                            var hook = toCall[j + 1];\n                            profiler(4 /* LifecycleHookStart */, callContext, hook);\n                            try {\n                                hook.call(callContext);\n                            }\n                            finally {\n                                profiler(5 /* LifecycleHookEnd */, callContext, hook);\n                            }\n                        }\n                    }\n                    else {\n                        profiler(4 /* LifecycleHookStart */, context, toCall);\n                        try {\n                            toCall.call(context);\n                        }\n                        finally {\n                            profiler(5 /* LifecycleHookEnd */, context, toCall);\n                        }\n                    }\n                }\n            }\n        }\n    }\n    /**\n     * Returns a native element if a node can be inserted into the given parent.\n     *\n     * There are two reasons why we may not be able to insert a element immediately.\n     * - Projection: When creating a child content element of a component, we have to skip the\n     *   insertion because the content of a component will be projected.\n     *   `<component><content>delayed due to projection</content></component>`\n     * - Parent container is disconnected: This can happen when we are inserting a view into\n     *   parent container, which itself is disconnected. For example the parent container is part\n     *   of a View which has not be inserted or is made for projection but has not been inserted\n     *   into destination.\n     *\n     * @param tView: Current `TView`.\n     * @param tNode: `TNode` for which we wish to retrieve render parent.\n     * @param lView: Current `LView`.\n     */\n    function getParentRElement(tView, tNode, lView) {\n        return getClosestRElement(tView, tNode.parent, lView);\n    }\n    /**\n     * Get closest `RElement` or `null` if it can't be found.\n     *\n     * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.\n     * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).\n     * If `TNode` is `null` then return host `RElement`:\n     *   - return `null` if projection\n     *   - return `null` if parent container is disconnected (we have no parent.)\n     *\n     * @param tView: Current `TView`.\n     * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is\n     *     needed).\n     * @param lView: Current `LView`.\n     * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)\n     */\n    function getClosestRElement(tView, tNode, lView) {\n        var parentTNode = tNode;\n        // Skip over element and ICU containers as those are represented by a comment node and\n        // can't be used as a render parent.\n        while (parentTNode !== null &&\n            (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n            tNode = parentTNode;\n            parentTNode = tNode.parent;\n        }\n        // If the parent tNode is null, then we are inserting across views: either into an embedded view\n        // or a component view.\n        if (parentTNode === null) {\n            // We are inserting a root element of the component view into the component host element and\n            // it should always be eager.\n            return lView[HOST];\n        }\n        else {\n            ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n            if (parentTNode.flags & 2 /* isComponentHost */) {\n                ngDevMode && assertTNodeForLView(parentTNode, lView);\n                var encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n                // We've got a parent which is an element in the current view. We just need to verify if the\n                // parent element is not a component. Component's content nodes are not inserted immediately\n                // because they will be projected, and so doing insert at this point would be wasteful.\n                // Since the projection would then move it to its final destination. Note that we can't\n                // make this assumption when using the Shadow DOM, because the native projection placeholders\n                // (<content> or <slot>) have to be in place as elements are being inserted.\n                if (encapsulation === exports.ViewEncapsulation.None ||\n                    encapsulation === exports.ViewEncapsulation.Emulated) {\n                    return null;\n                }\n            }\n            return getNativeByTNode(parentTNode, lView);\n        }\n    }\n    /**\n     * Inserts a native node before another native node for a given parent using {@link Renderer3}.\n     * This is a utility function that can be used when native nodes were determined - it abstracts an\n     * actual renderer being used.\n     */\n    function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {\n        ngDevMode && ngDevMode.rendererInsertBefore++;\n        if (isProceduralRenderer(renderer)) {\n            renderer.insertBefore(parent, child, beforeNode, isMove);\n        }\n        else {\n            parent.insertBefore(child, beforeNode, isMove);\n        }\n    }\n    function nativeAppendChild(renderer, parent, child) {\n        ngDevMode && ngDevMode.rendererAppendChild++;\n        ngDevMode && assertDefined(parent, 'parent node must be defined');\n        if (isProceduralRenderer(renderer)) {\n            renderer.appendChild(parent, child);\n        }\n        else {\n            parent.appendChild(child);\n        }\n    }\n    function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {\n        if (beforeNode !== null) {\n            nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n        }\n        else {\n            nativeAppendChild(renderer, parent, child);\n        }\n    }\n    /** Removes a node from the DOM given its native parent. */\n    function nativeRemoveChild(renderer, parent, child, isHostElement) {\n        if (isProceduralRenderer(renderer)) {\n            renderer.removeChild(parent, child, isHostElement);\n        }\n        else {\n            parent.removeChild(child);\n        }\n    }\n    /**\n     * Returns a native parent of a given native node.\n     */\n    function nativeParentNode(renderer, node) {\n        return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode);\n    }\n    /**\n     * Returns a native sibling of a given native node.\n     */\n    function nativeNextSibling(renderer, node) {\n        return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;\n    }\n    /**\n     * Find a node in front of which `currentTNode` should be inserted.\n     *\n     * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n     * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.\n     *\n     * @param parentTNode parent `TNode`\n     * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n     * @param lView current `LView`\n     */\n    function getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {\n        return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n    }\n    /**\n     * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into\n     * account)\n     *\n     * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n     * does not take `TNode.insertBeforeIndex` into account.\n     *\n     * @param parentTNode parent `TNode`\n     * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n     * @param lView current `LView`\n     */\n    function getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {\n        if (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */)) {\n            return getNativeByTNode(parentTNode, lView);\n        }\n        return null;\n    }\n    /**\n     * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.\n     *\n     * This function will only be set if i18n code runs.\n     */\n    var _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;\n    /**\n     * Tree shakable boundary for `processI18nInsertBefore` function.\n     *\n     * This function will only be set if i18n code runs.\n     */\n    var _processI18nInsertBefore;\n    function setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {\n        _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n        _processI18nInsertBefore = processI18nInsertBefore;\n    }\n    /**\n     * Appends the `child` native node (or a collection of nodes) to the `parent`.\n     *\n     * @param tView The `TView' to be appended\n     * @param lView The current LView\n     * @param childRNode The native child (or children) that should be appended\n     * @param childTNode The TNode of the child element\n     */\n    function appendChild(tView, lView, childRNode, childTNode) {\n        var parentRNode = getParentRElement(tView, childTNode, lView);\n        var renderer = lView[RENDERER];\n        var parentTNode = childTNode.parent || lView[T_HOST];\n        var anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n        if (parentRNode != null) {\n            if (Array.isArray(childRNode)) {\n                for (var i = 0; i < childRNode.length; i++) {\n                    nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n                }\n            }\n            else {\n                nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n            }\n        }\n        _processI18nInsertBefore !== undefined &&\n            _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n    }\n    /**\n     * Returns the first native node for a given LView, starting from the provided TNode.\n     *\n     * Native nodes are returned in the order in which those appear in the native tree (DOM).\n     */\n    function getFirstNativeNode(lView, tNode) {\n        if (tNode !== null) {\n            ngDevMode &&\n                assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 32 /* Icu */ | 16 /* Projection */);\n            var tNodeType = tNode.type;\n            if (tNodeType & 3 /* AnyRNode */) {\n                return getNativeByTNode(tNode, lView);\n            }\n            else if (tNodeType & 4 /* Container */) {\n                return getBeforeNodeForView(-1, lView[tNode.index]);\n            }\n            else if (tNodeType & 8 /* ElementContainer */) {\n                var elIcuContainerChild = tNode.child;\n                if (elIcuContainerChild !== null) {\n                    return getFirstNativeNode(lView, elIcuContainerChild);\n                }\n                else {\n                    var rNodeOrLContainer = lView[tNode.index];\n                    if (isLContainer(rNodeOrLContainer)) {\n                        return getBeforeNodeForView(-1, rNodeOrLContainer);\n                    }\n                    else {\n                        return unwrapRNode(rNodeOrLContainer);\n                    }\n                }\n            }\n            else if (tNodeType & 32 /* Icu */) {\n                var nextRNode = icuContainerIterate(tNode, lView);\n                var rNode = nextRNode();\n                // If the ICU container has no nodes, than we use the ICU anchor as the node.\n                return rNode || unwrapRNode(lView[tNode.index]);\n            }\n            else {\n                var projectionNodes = getProjectionNodes(lView, tNode);\n                if (projectionNodes !== null) {\n                    if (Array.isArray(projectionNodes)) {\n                        return projectionNodes[0];\n                    }\n                    var parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n                    ngDevMode && assertParentView(parentView);\n                    return getFirstNativeNode(parentView, projectionNodes);\n                }\n                else {\n                    return getFirstNativeNode(lView, tNode.next);\n                }\n            }\n        }\n        return null;\n    }\n    function getProjectionNodes(lView, tNode) {\n        if (tNode !== null) {\n            var componentView = lView[DECLARATION_COMPONENT_VIEW];\n            var componentHost = componentView[T_HOST];\n            var slotIdx = tNode.projection;\n            ngDevMode && assertProjectionSlots(lView);\n            return componentHost.projection[slotIdx];\n        }\n        return null;\n    }\n    function getBeforeNodeForView(viewIndexInContainer, lContainer) {\n        var nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n        if (nextViewIndex < lContainer.length) {\n            var lView = lContainer[nextViewIndex];\n            var firstTNodeOfView = lView[TVIEW].firstChild;\n            if (firstTNodeOfView !== null) {\n                return getFirstNativeNode(lView, firstTNodeOfView);\n            }\n        }\n        return lContainer[NATIVE];\n    }\n    /**\n     * Removes a native node itself using a given renderer. To remove the node we are looking up its\n     * parent from the native tree as not all platforms / browsers support the equivalent of\n     * node.remove().\n     *\n     * @param renderer A renderer to be used\n     * @param rNode The native node that should be removed\n     * @param isHostElement A flag indicating if a node to be removed is a host of a component.\n     */\n    function nativeRemoveNode(renderer, rNode, isHostElement) {\n        ngDevMode && ngDevMode.rendererRemoveNode++;\n        var nativeParent = nativeParentNode(renderer, rNode);\n        if (nativeParent) {\n            nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n        }\n    }\n    /**\n     * Performs the operation of `action` on the node. Typically this involves inserting or removing\n     * nodes on the LView or projection boundary.\n     */\n    function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {\n        while (tNode != null) {\n            ngDevMode && assertTNodeForLView(tNode, lView);\n            ngDevMode &&\n                assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 16 /* Projection */ | 32 /* Icu */);\n            var rawSlotValue = lView[tNode.index];\n            var tNodeType = tNode.type;\n            if (isProjection) {\n                if (action === 0 /* Create */) {\n                    rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n                    tNode.flags |= 4 /* isProjected */;\n                }\n            }\n            if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {\n                if (tNodeType & 8 /* ElementContainer */) {\n                    applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n                    applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n                }\n                else if (tNodeType & 32 /* Icu */) {\n                    var nextRNode = icuContainerIterate(tNode, lView);\n                    var rNode = void 0;\n                    while (rNode = nextRNode()) {\n                        applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n                    }\n                    applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n                }\n                else if (tNodeType & 16 /* Projection */) {\n                    applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);\n                }\n                else {\n                    ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 4 /* Container */);\n                    applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n                }\n            }\n            tNode = isProjection ? tNode.projectionNext : tNode.next;\n        }\n    }\n    function applyView(tView, lView, renderer, action, parentRElement, beforeNode) {\n        applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n    }\n    /**\n     * `applyProjection` performs operation on the projection.\n     *\n     * Inserting a projection requires us to locate the projected nodes from the parent component. The\n     * complication is that those nodes themselves could be re-projected from their parent component.\n     *\n     * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed\n     * @param lView The `LView` which needs to be inserted, detached, destroyed.\n     * @param tProjectionNode node to project\n     */\n    function applyProjection(tView, lView, tProjectionNode) {\n        var renderer = lView[RENDERER];\n        var parentRNode = getParentRElement(tView, tProjectionNode, lView);\n        var parentTNode = tProjectionNode.parent || lView[T_HOST];\n        var beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n        applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n    }\n    /**\n     * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,\n     * detach, destroy)\n     *\n     * Inserting a projection requires us to locate the projected nodes from the parent component. The\n     * complication is that those nodes themselves could be re-projected from their parent component.\n     *\n     * @param renderer Render to use\n     * @param action action to perform (insert, detach, destroy)\n     * @param lView The LView which needs to be inserted, detached, destroyed.\n     * @param tProjectionNode node to project\n     * @param parentRElement parent DOM element for insertion/removal.\n     * @param beforeNode Before which node the insertions should happen.\n     */\n    function applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {\n        var componentLView = lView[DECLARATION_COMPONENT_VIEW];\n        var componentNode = componentLView[T_HOST];\n        ngDevMode &&\n            assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n        var nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];\n        if (Array.isArray(nodeToProjectOrRNodes)) {\n            // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we\n            // need to support passing projectable nodes, so we cheat and put them in the TNode\n            // of the Host TView. (Yes we put instance info at the T Level). We can get away with it\n            // because we know that that TView is not shared and therefore it will not be a problem.\n            // This should be refactored and cleaned up.\n            for (var i = 0; i < nodeToProjectOrRNodes.length; i++) {\n                var rNode = nodeToProjectOrRNodes[i];\n                applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n            }\n        }\n        else {\n            var nodeToProject = nodeToProjectOrRNodes;\n            var projectedComponentLView = componentLView[PARENT];\n            applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n        }\n    }\n    /**\n     * `applyContainer` performs an operation on the container and its views as specified by\n     * `action` (insert, detach, destroy)\n     *\n     * Inserting a Container is complicated by the fact that the container may have Views which\n     * themselves have containers or projections.\n     *\n     * @param renderer Renderer to use\n     * @param action action to perform (insert, detach, destroy)\n     * @param lContainer The LContainer which needs to be inserted, detached, destroyed.\n     * @param parentRElement parent DOM element for insertion/removal.\n     * @param beforeNode Before which node the insertions should happen.\n     */\n    function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n        ngDevMode && assertLContainer(lContainer);\n        var anchor = lContainer[NATIVE]; // LContainer has its own before node.\n        var native = unwrapRNode(lContainer);\n        // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n        // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n        // node (comment in the DOM) that will be different from the LContainer's host node. In this\n        // particular case we need to execute action on 2 nodes:\n        // - container's host node (this is done in the executeActionOnElementOrContainer)\n        // - container's host node (this is done here)\n        if (anchor !== native) {\n            // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n            // don't see a reason why they should be different, but they are.\n            //\n            // If they are we need to process the second anchor as well.\n            applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n        }\n        for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n            var lView = lContainer[i];\n            applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n        }\n    }\n    /**\n     * Writes class/style to element.\n     *\n     * @param renderer Renderer to use.\n     * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)\n     * @param rNode The Node to write to.\n     * @param prop Property to write to. This would be the class/style name.\n     * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add\n     *        otherwise).\n     */\n    function applyStyling(renderer, isClassBased, rNode, prop, value) {\n        var isProcedural = isProceduralRenderer(renderer);\n        if (isClassBased) {\n            // We actually want JS true/false here because any truthy value should add the class\n            if (!value) {\n                ngDevMode && ngDevMode.rendererRemoveClass++;\n                if (isProcedural) {\n                    renderer.removeClass(rNode, prop);\n                }\n                else {\n                    rNode.classList.remove(prop);\n                }\n            }\n            else {\n                ngDevMode && ngDevMode.rendererAddClass++;\n                if (isProcedural) {\n                    renderer.addClass(rNode, prop);\n                }\n                else {\n                    ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');\n                    rNode.classList.add(prop);\n                }\n            }\n        }\n        else {\n            var flags = prop.indexOf('-') === -1 ? undefined : exports.RendererStyleFlags2.DashCase;\n            if (value == null /** || value === undefined */) {\n                ngDevMode && ngDevMode.rendererRemoveStyle++;\n                if (isProcedural) {\n                    renderer.removeStyle(rNode, prop, flags);\n                }\n                else {\n                    rNode.style.removeProperty(prop);\n                }\n            }\n            else {\n                // A value is important if it ends with `!important`. The style\n                // parser strips any semicolons at the end of the value.\n                var isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n                if (isImportant) {\n                    // !important has to be stripped from the value for it to be valid.\n                    value = value.slice(0, -10);\n                    flags |= exports.RendererStyleFlags2.Important;\n                }\n                ngDevMode && ngDevMode.rendererSetStyle++;\n                if (isProcedural) {\n                    renderer.setStyle(rNode, prop, value, flags);\n                }\n                else {\n                    ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');\n                    rNode.style.setProperty(prop, value, isImportant ? 'important' : '');\n                }\n            }\n        }\n    }\n    /**\n     * Write `cssText` to `RElement`.\n     *\n     * This function does direct write without any reconciliation. Used for writing initial values, so\n     * that static styling values do not pull in the style parser.\n     *\n     * @param renderer Renderer to use\n     * @param element The element which needs to be updated.\n     * @param newValue The new class list to write.\n     */\n    function writeDirectStyle(renderer, element, newValue) {\n        ngDevMode && assertString(newValue, '\\'newValue\\' should be a string');\n        if (isProceduralRenderer(renderer)) {\n            renderer.setAttribute(element, 'style', newValue);\n        }\n        else {\n            element.style.cssText = newValue;\n        }\n        ngDevMode && ngDevMode.rendererSetStyle++;\n    }\n    /**\n     * Write `className` to `RElement`.\n     *\n     * This function does direct write without any reconciliation. Used for writing initial values, so\n     * that static styling values do not pull in the style parser.\n     *\n     * @param renderer Renderer to use\n     * @param element The element which needs to be updated.\n     * @param newValue The new class list to write.\n     */\n    function writeDirectClass(renderer, element, newValue) {\n        ngDevMode && assertString(newValue, '\\'newValue\\' should be a string');\n        if (isProceduralRenderer(renderer)) {\n            if (newValue === '') {\n                // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.\n                renderer.removeAttribute(element, 'class');\n            }\n            else {\n                renderer.setAttribute(element, 'class', newValue);\n            }\n        }\n        else {\n            element.className = newValue;\n        }\n        ngDevMode && ngDevMode.rendererSetClassName++;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n     *\n     * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n     *\n     * @param className A string containing classes (whitespace separated)\n     * @param classToSearch A class name to locate\n     * @param startingIndex Starting location of search\n     * @returns an index of the located class (or -1 if not found)\n     */\n    function classIndexOf(className, classToSearch, startingIndex) {\n        ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n        var end = className.length;\n        while (true) {\n            var foundIndex = className.indexOf(classToSearch, startingIndex);\n            if (foundIndex === -1)\n                return foundIndex;\n            if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* SPACE */) {\n                // Ensure that it has leading whitespace\n                var length = classToSearch.length;\n                if (foundIndex + length === end ||\n                    className.charCodeAt(foundIndex + length) <= 32 /* SPACE */) {\n                    // Ensure that it has trailing whitespace\n                    return foundIndex;\n                }\n            }\n            // False positive, keep searching from where we left off.\n            startingIndex = foundIndex + 1;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5;\n    var NG_TEMPLATE_SELECTOR = 'ng-template';\n    /**\n     * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n     *\n     * @param attrs `TAttributes` to search through.\n     * @param cssClassToMatch class to match (lowercase)\n     * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n     *    addition to the `AttributeMarker.Classes`.\n     */\n    function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {\n        // TODO(misko): The fact that this function needs to know about `isProjectionMode` seems suspect.\n        // It is strange to me that sometimes the class information comes in form of `class` attribute\n        // and sometimes in form of `AttributeMarker.Classes`. Some investigation is needed to determine\n        // if that is the right behavior.\n        ngDevMode &&\n            assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n        var i = 0;\n        while (i < attrs.length) {\n            var item = attrs[i++];\n            if (isProjectionMode && item === 'class') {\n                item = attrs[i];\n                if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) {\n                    return true;\n                }\n            }\n            else if (item === 1 /* Classes */) {\n                // We found the classes section. Start searching for the class.\n                while (i < attrs.length && typeof (item = attrs[i++]) == 'string') {\n                    // while we have strings\n                    if (item.toLowerCase() === cssClassToMatch)\n                        return true;\n                }\n                return false;\n            }\n        }\n        return false;\n    }\n    /**\n     * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n     *\n     * @param tNode current TNode\n     */\n    function isInlineTemplate(tNode) {\n        return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n    }\n    /**\n     * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n     *\n     * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n     * directive matching mode:\n     * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n     * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n     * tag name was extracted from * syntax so we would match the same directive twice);\n     * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n     * (applicable to TNodeType.Container only).\n     */\n    function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n        var tagNameToCompare = tNode.type === 4 /* Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n        return currentSelector === tagNameToCompare;\n    }\n    /**\n     * A utility function to match an Ivy node static data against a simple CSS selector\n     *\n     * @param node static data of the node to match\n     * @param selector The selector to try matching against the node.\n     * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n     * directive matching.\n     * @returns true if node matches the selector.\n     */\n    function isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n        ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n        var mode = 4 /* ELEMENT */;\n        var nodeAttrs = tNode.attrs || [];\n        // Find the index of first attribute that has no value, only a name.\n        var nameOnlyMarkerIdx = getNameOnlyMarkerIndex(nodeAttrs);\n        // When processing \":not\" selectors, we skip to the next \":not\" if the\n        // current one doesn't match\n        var skipToNextSelector = false;\n        for (var i = 0; i < selector.length; i++) {\n            var current = selector[i];\n            if (typeof current === 'number') {\n                // If we finish processing a :not selector and it hasn't failed, return false\n                if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n                    return false;\n                }\n                // If we are skipping to the next :not() and this mode flag is positive,\n                // it's a part of the current :not() selector, and we should keep skipping\n                if (skipToNextSelector && isPositive(current))\n                    continue;\n                skipToNextSelector = false;\n                mode = current | (mode & 1 /* NOT */);\n                continue;\n            }\n            if (skipToNextSelector)\n                continue;\n            if (mode & 4 /* ELEMENT */) {\n                mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */;\n                if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) ||\n                    current === '' && selector.length === 1) {\n                    if (isPositive(mode))\n                        return false;\n                    skipToNextSelector = true;\n                }\n            }\n            else {\n                var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i];\n                // special case for matching against classes when a tNode has been instantiated with\n                // class and style values as separate attribute values (e.g. ['title', CLASS, 'foo'])\n                if ((mode & 8 /* CLASS */) && tNode.attrs !== null) {\n                    if (!isCssClassMatching(tNode.attrs, selectorAttrValue, isProjectionMode)) {\n                        if (isPositive(mode))\n                            return false;\n                        skipToNextSelector = true;\n                    }\n                    continue;\n                }\n                var attrName = (mode & 8 /* CLASS */) ? 'class' : current;\n                var attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n                if (attrIndexInNode === -1) {\n                    if (isPositive(mode))\n                        return false;\n                    skipToNextSelector = true;\n                    continue;\n                }\n                if (selectorAttrValue !== '') {\n                    var nodeAttrValue = void 0;\n                    if (attrIndexInNode > nameOnlyMarkerIdx) {\n                        nodeAttrValue = '';\n                    }\n                    else {\n                        ngDevMode &&\n                            assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes');\n                        // we lowercase the attribute value to be able to match\n                        // selectors without case-sensitivity\n                        // (selectors are already in lowercase when generated)\n                        nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n                    }\n                    var compareAgainstClassName = mode & 8 /* CLASS */ ? nodeAttrValue : null;\n                    if (compareAgainstClassName &&\n                        classIndexOf(compareAgainstClassName, selectorAttrValue, 0) !== -1 ||\n                        mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {\n                        if (isPositive(mode))\n                            return false;\n                        skipToNextSelector = true;\n                    }\n                }\n            }\n        }\n        return isPositive(mode) || skipToNextSelector;\n    }\n    function isPositive(mode) {\n        return (mode & 1 /* NOT */) === 0;\n    }\n    /**\n     * Examines the attribute's definition array for a node to find the index of the\n     * attribute that matches the given `name`.\n     *\n     * NOTE: This will not match namespaced attributes.\n     *\n     * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n     * The following table summarizes which types of attributes we attempt to match:\n     *\n     * ===========================================================================================================\n     * Modes                   | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n     * Attributes\n     * ===========================================================================================================\n     * Inline + Projection     | YES               | YES                 | NO                  | YES\n     * -----------------------------------------------------------------------------------------------------------\n     * Inline + Directive      | NO                | NO                  | YES                 | NO\n     * -----------------------------------------------------------------------------------------------------------\n     * Non-inline + Projection | YES               | YES                 | NO                  | YES\n     * -----------------------------------------------------------------------------------------------------------\n     * Non-inline + Directive  | YES               | YES                 | NO                  | YES\n     * ===========================================================================================================\n     *\n     * @param name the name of the attribute to find\n     * @param attrs the attribute array to examine\n     * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n     * rather than a manually expanded template node (e.g `<ng-template>`).\n     * @param isProjectionMode true if we are matching against content projection otherwise we are\n     * matching against directives.\n     */\n    function findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n        if (attrs === null)\n            return -1;\n        var i = 0;\n        if (isProjectionMode || !isInlineTemplate) {\n            var bindingsMode = false;\n            while (i < attrs.length) {\n                var maybeAttrName = attrs[i];\n                if (maybeAttrName === name) {\n                    return i;\n                }\n                else if (maybeAttrName === 3 /* Bindings */ || maybeAttrName === 6 /* I18n */) {\n                    bindingsMode = true;\n                }\n                else if (maybeAttrName === 1 /* Classes */ || maybeAttrName === 2 /* Styles */) {\n                    var value = attrs[++i];\n                    // We should skip classes here because we have a separate mechanism for\n                    // matching classes in projection mode.\n                    while (typeof value === 'string') {\n                        value = attrs[++i];\n                    }\n                    continue;\n                }\n                else if (maybeAttrName === 4 /* Template */) {\n                    // We do not care about Template attributes in this scenario.\n                    break;\n                }\n                else if (maybeAttrName === 0 /* NamespaceURI */) {\n                    // Skip the whole namespaced attribute and value. This is by design.\n                    i += 4;\n                    continue;\n                }\n                // In binding mode there are only names, rather than name-value pairs.\n                i += bindingsMode ? 1 : 2;\n            }\n            // We did not match the attribute\n            return -1;\n        }\n        else {\n            return matchTemplateAttribute(attrs, name);\n        }\n    }\n    function isNodeMatchingSelectorList(tNode, selector, isProjectionMode) {\n        if (isProjectionMode === void 0) { isProjectionMode = false; }\n        for (var i = 0; i < selector.length; i++) {\n            if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    function getProjectAsAttrValue(tNode) {\n        var nodeAttrs = tNode.attrs;\n        if (nodeAttrs != null) {\n            var ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* ProjectAs */);\n            // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n            // (attribute names are stored at even indexes)\n            if ((ngProjectAsAttrIdx & 1) === 0) {\n                return nodeAttrs[ngProjectAsAttrIdx + 1];\n            }\n        }\n        return null;\n    }\n    function getNameOnlyMarkerIndex(nodeAttrs) {\n        for (var i = 0; i < nodeAttrs.length; i++) {\n            var nodeAttr = nodeAttrs[i];\n            if (isNameOnlyAttributeMarker(nodeAttr)) {\n                return i;\n            }\n        }\n        return nodeAttrs.length;\n    }\n    function matchTemplateAttribute(attrs, name) {\n        var i = attrs.indexOf(4 /* Template */);\n        if (i > -1) {\n            i++;\n            while (i < attrs.length) {\n                var attr = attrs[i];\n                // Return in case we checked all template attrs and are switching to the next section in the\n                // attrs array (that starts with a number that represents an attribute marker).\n                if (typeof attr === 'number')\n                    return -1;\n                if (attr === name)\n                    return i;\n                i++;\n            }\n        }\n        return -1;\n    }\n    /**\n     * Checks whether a selector is inside a CssSelectorList\n     * @param selector Selector to be checked.\n     * @param list List in which to look for the selector.\n     */\n    function isSelectorInSelectorList(selector, list) {\n        selectorListLoop: for (var i = 0; i < list.length; i++) {\n            var currentSelectorInList = list[i];\n            if (selector.length !== currentSelectorInList.length) {\n                continue;\n            }\n            for (var j = 0; j < selector.length; j++) {\n                if (selector[j] !== currentSelectorInList[j]) {\n                    continue selectorListLoop;\n                }\n            }\n            return true;\n        }\n        return false;\n    }\n    function maybeWrapInNotSelector(isNegativeMode, chunk) {\n        return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n    }\n    function stringifyCSSSelector(selector) {\n        var result = selector[0];\n        var i = 1;\n        var mode = 2 /* ATTRIBUTE */;\n        var currentChunk = '';\n        var isNegativeMode = false;\n        while (i < selector.length) {\n            var valueOrMarker = selector[i];\n            if (typeof valueOrMarker === 'string') {\n                if (mode & 2 /* ATTRIBUTE */) {\n                    var attrValue = selector[++i];\n                    currentChunk +=\n                        '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n                }\n                else if (mode & 8 /* CLASS */) {\n                    currentChunk += '.' + valueOrMarker;\n                }\n                else if (mode & 4 /* ELEMENT */) {\n                    currentChunk += ' ' + valueOrMarker;\n                }\n            }\n            else {\n                //\n                // Append current chunk to the final result in case we come across SelectorFlag, which\n                // indicates that the previous section of a selector is over. We need to accumulate content\n                // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n                // ```\n                //  ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n                // ```\n                // should be transformed to `.classA :not(.classB .classC)`.\n                //\n                // Note: for negative selector part, we accumulate content between flags until we find the\n                // next negative flag. This is needed to support a case where `:not()` rule contains more than\n                // one chunk, e.g. the following selector:\n                // ```\n                //  ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n                // ```\n                // should be stringified to `:not(p.foo) :not(.bar)`\n                //\n                if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n                    result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n                    currentChunk = '';\n                }\n                mode = valueOrMarker;\n                // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n                // mode is maintained for remaining chunks of a selector.\n                isNegativeMode = isNegativeMode || !isPositive(mode);\n            }\n            i++;\n        }\n        if (currentChunk !== '') {\n            result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n        }\n        return result;\n    }\n    /**\n     * Generates string representation of CSS selector in parsed form.\n     *\n     * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n     * additional parsing at runtime (for example, for directive matching). However in some cases (for\n     * example, while bootstrapping a component), a string version of the selector is required to query\n     * for the host element on the page. This function takes the parsed form of a selector and returns\n     * its string representation.\n     *\n     * @param selectorList selector in parsed form\n     * @returns string representation of a given selector\n     */\n    function stringifyCSSSelectorList(selectorList) {\n        return selectorList.map(stringifyCSSSelector).join(',');\n    }\n    /**\n     * Extracts attributes and classes information from a given CSS selector.\n     *\n     * This function is used while creating a component dynamically. In this case, the host element\n     * (that is created dynamically) should contain attributes and classes specified in component's CSS\n     * selector.\n     *\n     * @param selector CSS selector in parsed form (in a form of array)\n     * @returns object with `attrs` and `classes` fields that contain extracted information\n     */\n    function extractAttrsAndClassesFromSelector(selector) {\n        var attrs = [];\n        var classes = [];\n        var i = 1;\n        var mode = 2 /* ATTRIBUTE */;\n        while (i < selector.length) {\n            var valueOrMarker = selector[i];\n            if (typeof valueOrMarker === 'string') {\n                if (mode === 2 /* ATTRIBUTE */) {\n                    if (valueOrMarker !== '') {\n                        attrs.push(valueOrMarker, selector[++i]);\n                    }\n                }\n                else if (mode === 8 /* CLASS */) {\n                    classes.push(valueOrMarker);\n                }\n            }\n            else {\n                // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n                // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n                // extracted only for \"positive\" part of the selector, we can stop here.\n                if (!isPositive(mode))\n                    break;\n                mode = valueOrMarker;\n            }\n            i++;\n        }\n        return { attrs: attrs, classes: classes };\n    }\n\n    /**\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://angular.io/license\n     */\n    /** A special value which designates that a value has not changed. */\n    var NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__: 'NO_CHANGE' } : {};\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Advances to an element for later binding instructions.\n     *\n     * Used in conjunction with instructions like {@link property} to act on elements with specified\n     * indices, for example those created with {@link element} or {@link elementStart}.\n     *\n     * ```ts\n     * (rf: RenderFlags, ctx: any) => {\n     *   if (rf & 1) {\n     *     text(0, 'Hello');\n     *     text(1, 'Goodbye')\n     *     element(2, 'div');\n     *   }\n     *   if (rf & 2) {\n     *     advance(2); // Advance twice to the <div>.\n     *     property('title', 'test');\n     *   }\n     *  }\n     * ```\n     * @param delta Number of elements to advance forwards by.\n     *\n     * @codeGenApi\n     */\n    function ɵɵadvance(delta) {\n        ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n        selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, isInCheckNoChangesMode());\n    }\n    function selectIndexInternal(tView, lView, index, checkNoChangesMode) {\n        ngDevMode && assertIndexInDeclRange(lView, index);\n        // Flush the initial hooks for elements in the view that have been added up to this point.\n        // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n        if (!checkNoChangesMode) {\n            var hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;\n            if (hooksInitPhaseCompleted) {\n                var preOrderCheckHooks = tView.preOrderCheckHooks;\n                if (preOrderCheckHooks !== null) {\n                    executeCheckHooks(lView, preOrderCheckHooks, index);\n                }\n            }\n            else {\n                var preOrderHooks = tView.preOrderHooks;\n                if (preOrderHooks !== null) {\n                    executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, index);\n                }\n            }\n        }\n        // We must set the selected index *after* running the hooks, because hooks may have side-effects\n        // that cause other template functions to run, thus updating the selected index, which is global\n        // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index\n        // will be altered by the time we leave the `ɵɵadvance` instruction.\n        setSelectedIndex(index);\n    }\n\n    /**\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://angular.io/license\n     */\n    function toTStylingRange(prev, next) {\n        ngDevMode && assertNumberInRange(prev, 0, 32767 /* UNSIGNED_MASK */);\n        ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */);\n        return (prev << 17 /* PREV_SHIFT */ | next << 2 /* NEXT_SHIFT */);\n    }\n    function getTStylingRangePrev(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        return (tStylingRange >> 17 /* PREV_SHIFT */) & 32767 /* UNSIGNED_MASK */;\n    }\n    function getTStylingRangePrevDuplicate(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        return (tStylingRange & 2 /* PREV_DUPLICATE */) ==\n            2 /* PREV_DUPLICATE */;\n    }\n    function setTStylingRangePrev(tStylingRange, previous) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        ngDevMode && assertNumberInRange(previous, 0, 32767 /* UNSIGNED_MASK */);\n        return ((tStylingRange & ~4294836224 /* PREV_MASK */) |\n            (previous << 17 /* PREV_SHIFT */));\n    }\n    function setTStylingRangePrevDuplicate(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        return (tStylingRange | 2 /* PREV_DUPLICATE */);\n    }\n    function getTStylingRangeNext(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        return (tStylingRange & 131068 /* NEXT_MASK */) >> 2 /* NEXT_SHIFT */;\n    }\n    function setTStylingRangeNext(tStylingRange, next) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */);\n        return ((tStylingRange & ~131068 /* NEXT_MASK */) | //\n            next << 2 /* NEXT_SHIFT */);\n    }\n    function getTStylingRangeNextDuplicate(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        return (tStylingRange & 1 /* NEXT_DUPLICATE */) ===\n            1 /* NEXT_DUPLICATE */;\n    }\n    function setTStylingRangeNextDuplicate(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        return (tStylingRange | 1 /* NEXT_DUPLICATE */);\n    }\n    function getTStylingRangeTail(tStylingRange) {\n        ngDevMode && assertNumber(tStylingRange, 'expected number');\n        var next = getTStylingRangeNext(tStylingRange);\n        return next === 0 ? getTStylingRangePrev(tStylingRange) : next;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Patch a `debug` property on top of the existing object.\n     *\n     * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`\n     *\n     * @param obj Object to patch\n     * @param debug Value to patch\n     */\n    function attachDebugObject(obj, debug) {\n        if (ngDevMode) {\n            Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });\n        }\n        else {\n            throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n        }\n    }\n    /**\n     * Patch a `debug` property getter on top of the existing object.\n     *\n     * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`\n     *\n     * @param obj Object to patch\n     * @param debugGetter Getter returning a value to patch\n     */\n    function attachDebugGetter(obj, debugGetter) {\n        if (ngDevMode) {\n            Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n        }\n        else {\n            throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var NG_DEV_MODE = ((typeof ngDevMode === 'undefined' || !!ngDevMode) && initNgDevMode());\n    /*\n     * This file contains conditionally attached classes which provide human readable (debug) level\n     * information for `LView`, `LContainer` and other internal data structures. These data structures\n     * are stored internally as array which makes it very difficult during debugging to reason about the\n     * current state of the system.\n     *\n     * Patching the array with extra property does change the array's hidden class' but it does not\n     * change the cost of access, therefore this patching should not have significant if any impact in\n     * `ngDevMode` mode. (see: https://jsperf.com/array-vs-monkey-patch-array)\n     *\n     * So instead of seeing:\n     * ```\n     * Array(30) [Object, 659, null, …]\n     * ```\n     *\n     * You get to see:\n     * ```\n     * LViewDebug {\n     *   views: [...],\n     *   flags: {attached: true, ...}\n     *   nodes: [\n     *     {html: '<div id=\"123\">', ..., nodes: [\n     *       {html: '<span>', ..., nodes: null}\n     *     ]}\n     *   ]\n     * }\n     * ```\n     */\n    var LVIEW_COMPONENT_CACHE;\n    var LVIEW_EMBEDDED_CACHE;\n    var LVIEW_ROOT;\n    /**\n     * This function clones a blueprint and creates LView.\n     *\n     * Simple slice will keep the same type, and we need it to be LView\n     */\n    function cloneToLViewFromTViewBlueprint(tView) {\n        var debugTView = tView;\n        var lView = getLViewToClone(debugTView.type, tView.template && tView.template.name);\n        return lView.concat(tView.blueprint);\n    }\n    function getLViewToClone(type, name) {\n        switch (type) {\n            case 0 /* Root */:\n                if (LVIEW_ROOT === undefined)\n                    LVIEW_ROOT = new (createNamedArrayType('LRootView'))();\n                return LVIEW_ROOT;\n            case 1 /* Component */:\n                if (LVIEW_COMPONENT_CACHE === undefined)\n                    LVIEW_COMPONENT_CACHE = new Map();\n                var componentArray = LVIEW_COMPONENT_CACHE.get(name);\n                if (componentArray === undefined) {\n                    componentArray = new (createNamedArrayType('LComponentView' + nameSuffix(name)))();\n                    LVIEW_COMPONENT_CACHE.set(name, componentArray);\n                }\n                return componentArray;\n            case 2 /* Embedded */:\n                if (LVIEW_EMBEDDED_CACHE === undefined)\n                    LVIEW_EMBEDDED_CACHE = new Map();\n                var embeddedArray = LVIEW_EMBEDDED_CACHE.get(name);\n                if (embeddedArray === undefined) {\n                    embeddedArray = new (createNamedArrayType('LEmbeddedView' + nameSuffix(name)))();\n                    LVIEW_EMBEDDED_CACHE.set(name, embeddedArray);\n                }\n                return embeddedArray;\n        }\n    }\n    function nameSuffix(text) {\n        if (text == null)\n            return '';\n        var index = text.lastIndexOf('_Template');\n        return '_' + (index === -1 ? text : text.substr(0, index));\n    }\n    /**\n     * This class is a debug version of Object literal so that we can have constructor name show up\n     * in\n     * debug tools in ngDevMode.\n     */\n    var TViewConstructor = /** @class */ (function () {\n        function TView(type, blueprint, template, queries, viewQuery, declTNode, data, bindingStartIndex, expandoStartIndex, hostBindingOpCodes, firstCreatePass, firstUpdatePass, staticViewQueries, staticContentQueries, preOrderHooks, preOrderCheckHooks, contentHooks, contentCheckHooks, viewHooks, viewCheckHooks, destroyHooks, cleanup, contentQueries, components, directiveRegistry, pipeRegistry, firstChild, schemas, consts, incompleteFirstPass, _decls, _vars) {\n            this.type = type;\n            this.blueprint = blueprint;\n            this.template = template;\n            this.queries = queries;\n            this.viewQuery = viewQuery;\n            this.declTNode = declTNode;\n            this.data = data;\n            this.bindingStartIndex = bindingStartIndex;\n            this.expandoStartIndex = expandoStartIndex;\n            this.hostBindingOpCodes = hostBindingOpCodes;\n            this.firstCreatePass = firstCreatePass;\n            this.firstUpdatePass = firstUpdatePass;\n            this.staticViewQueries = staticViewQueries;\n            this.staticContentQueries = staticContentQueries;\n            this.preOrderHooks = preOrderHooks;\n            this.preOrderCheckHooks = preOrderCheckHooks;\n            this.contentHooks = contentHooks;\n            this.contentCheckHooks = contentCheckHooks;\n            this.viewHooks = viewHooks;\n            this.viewCheckHooks = viewCheckHooks;\n            this.destroyHooks = destroyHooks;\n            this.cleanup = cleanup;\n            this.contentQueries = contentQueries;\n            this.components = components;\n            this.directiveRegistry = directiveRegistry;\n            this.pipeRegistry = pipeRegistry;\n            this.firstChild = firstChild;\n            this.schemas = schemas;\n            this.consts = consts;\n            this.incompleteFirstPass = incompleteFirstPass;\n            this._decls = _decls;\n            this._vars = _vars;\n        }\n        Object.defineProperty(TView.prototype, \"template_\", {\n            get: function () {\n                var buf = [];\n                processTNodeChildren(this.firstChild, buf);\n                return buf.join('');\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TView.prototype, \"type_\", {\n            get: function () {\n                return TViewTypeAsString[this.type] || \"TViewType.?\" + this.type + \"?\";\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return TView;\n    }());\n    var TNode = /** @class */ (function () {\n        function TNode(tView_, //\n        type, //\n        index, //\n        insertBeforeIndex, //\n        injectorIndex, //\n        directiveStart, //\n        directiveEnd, //\n        directiveStylingLast, //\n        propertyBindings, //\n        flags, //\n        providerIndexes, //\n        value, //\n        attrs, //\n        mergedAttrs, //\n        localNames, //\n        initialInputs, //\n        inputs, //\n        outputs, //\n        tViews, //\n        next, //\n        projectionNext, //\n        child, //\n        parent, //\n        projection, //\n        styles, //\n        stylesWithoutHost, //\n        residualStyles, //\n        classes, //\n        classesWithoutHost, //\n        residualClasses, //\n        classBindings, //\n        styleBindings) {\n            this.tView_ = tView_;\n            this.type = type;\n            this.index = index;\n            this.insertBeforeIndex = insertBeforeIndex;\n            this.injectorIndex = injectorIndex;\n            this.directiveStart = directiveStart;\n            this.directiveEnd = directiveEnd;\n            this.directiveStylingLast = directiveStylingLast;\n            this.propertyBindings = propertyBindings;\n            this.flags = flags;\n            this.providerIndexes = providerIndexes;\n            this.value = value;\n            this.attrs = attrs;\n            this.mergedAttrs = mergedAttrs;\n            this.localNames = localNames;\n            this.initialInputs = initialInputs;\n            this.inputs = inputs;\n            this.outputs = outputs;\n            this.tViews = tViews;\n            this.next = next;\n            this.projectionNext = projectionNext;\n            this.child = child;\n            this.parent = parent;\n            this.projection = projection;\n            this.styles = styles;\n            this.stylesWithoutHost = stylesWithoutHost;\n            this.residualStyles = residualStyles;\n            this.classes = classes;\n            this.classesWithoutHost = classesWithoutHost;\n            this.residualClasses = residualClasses;\n            this.classBindings = classBindings;\n            this.styleBindings = styleBindings;\n        }\n        /**\n         * Return a human debug version of the set of `NodeInjector`s which will be consulted when\n         * resolving tokens from this `TNode`.\n         *\n         * When debugging applications, it is often difficult to determine which `NodeInjector`s will be\n         * consulted. This method shows a list of `DebugNode`s representing the `TNode`s which will be\n         * consulted in order when resolving a token starting at this `TNode`.\n         *\n         * The original data is stored in `LView` and `TView` with a lot of offset indexes, and so it is\n         * difficult to reason about.\n         *\n         * @param lView The `LView` instance for this `TNode`.\n         */\n        TNode.prototype.debugNodeInjectorPath = function (lView) {\n            var path = [];\n            var injectorIndex = getInjectorIndex(this, lView);\n            if (injectorIndex === -1) {\n                // Looks like the current `TNode` does not have `NodeInjector` associated with it => look for\n                // parent NodeInjector.\n                var parentLocation = getParentInjectorLocation(this, lView);\n                if (parentLocation !== NO_PARENT_INJECTOR) {\n                    // We found a parent, so start searching from the parent location.\n                    injectorIndex = getParentInjectorIndex(parentLocation);\n                    lView = getParentInjectorView(parentLocation, lView);\n                }\n                else {\n                    // No parents have been found, so there are no `NodeInjector`s to consult.\n                }\n            }\n            while (injectorIndex !== -1) {\n                ngDevMode && assertNodeInjector(lView, injectorIndex);\n                var tNode = lView[TVIEW].data[injectorIndex + 8 /* TNODE */];\n                path.push(buildDebugNode(tNode, lView));\n                var parentLocation = lView[injectorIndex + 8 /* PARENT */];\n                if (parentLocation === NO_PARENT_INJECTOR) {\n                    injectorIndex = -1;\n                }\n                else {\n                    injectorIndex = getParentInjectorIndex(parentLocation);\n                    lView = getParentInjectorView(parentLocation, lView);\n                }\n            }\n            return path;\n        };\n        Object.defineProperty(TNode.prototype, \"type_\", {\n            get: function () {\n                return toTNodeTypeAsString(this.type) || \"TNodeType.?\" + this.type + \"?\";\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TNode.prototype, \"flags_\", {\n            get: function () {\n                var flags = [];\n                if (this.flags & 16 /* hasClassInput */)\n                    flags.push('TNodeFlags.hasClassInput');\n                if (this.flags & 8 /* hasContentQuery */)\n                    flags.push('TNodeFlags.hasContentQuery');\n                if (this.flags & 32 /* hasStyleInput */)\n                    flags.push('TNodeFlags.hasStyleInput');\n                if (this.flags & 128 /* hasHostBindings */)\n                    flags.push('TNodeFlags.hasHostBindings');\n                if (this.flags & 2 /* isComponentHost */)\n                    flags.push('TNodeFlags.isComponentHost');\n                if (this.flags & 1 /* isDirectiveHost */)\n                    flags.push('TNodeFlags.isDirectiveHost');\n                if (this.flags & 64 /* isDetached */)\n                    flags.push('TNodeFlags.isDetached');\n                if (this.flags & 4 /* isProjected */)\n                    flags.push('TNodeFlags.isProjected');\n                return flags.join('|');\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TNode.prototype, \"template_\", {\n            get: function () {\n                if (this.type & 1 /* Text */)\n                    return this.value;\n                var buf = [];\n                var tagName = typeof this.value === 'string' && this.value || this.type_;\n                buf.push('<', tagName);\n                if (this.flags) {\n                    buf.push(' ', this.flags_);\n                }\n                if (this.attrs) {\n                    for (var i = 0; i < this.attrs.length;) {\n                        var attrName = this.attrs[i++];\n                        if (typeof attrName == 'number') {\n                            break;\n                        }\n                        var attrValue = this.attrs[i++];\n                        buf.push(' ', attrName, '=\"', attrValue, '\"');\n                    }\n                }\n                buf.push('>');\n                processTNodeChildren(this.child, buf);\n                buf.push('</', tagName, '>');\n                return buf.join('');\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TNode.prototype, \"styleBindings_\", {\n            get: function () {\n                return toDebugStyleBinding(this, false);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TNode.prototype, \"classBindings_\", {\n            get: function () {\n                return toDebugStyleBinding(this, true);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TNode.prototype, \"providerIndexStart_\", {\n            get: function () {\n                return this.providerIndexes & 1048575 /* ProvidersStartIndexMask */;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(TNode.prototype, \"providerIndexEnd_\", {\n            get: function () {\n                return this.providerIndexStart_ +\n                    (this.providerIndexes >>> 20 /* CptViewProvidersCountShift */);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return TNode;\n    }());\n    var TNodeDebug = TNode;\n    function toDebugStyleBinding(tNode, isClassBased) {\n        var tData = tNode.tView_.data;\n        var bindings = [];\n        var range = isClassBased ? tNode.classBindings : tNode.styleBindings;\n        var prev = getTStylingRangePrev(range);\n        var next = getTStylingRangeNext(range);\n        var isTemplate = next !== 0;\n        var cursor = isTemplate ? next : prev;\n        while (cursor !== 0) {\n            var itemKey = tData[cursor];\n            var itemRange = tData[cursor + 1];\n            bindings.unshift({\n                key: itemKey,\n                index: cursor,\n                isTemplate: isTemplate,\n                prevDuplicate: getTStylingRangePrevDuplicate(itemRange),\n                nextDuplicate: getTStylingRangeNextDuplicate(itemRange),\n                nextIndex: getTStylingRangeNext(itemRange),\n                prevIndex: getTStylingRangePrev(itemRange),\n            });\n            if (cursor === prev)\n                isTemplate = false;\n            cursor = getTStylingRangePrev(itemRange);\n        }\n        bindings.push((isClassBased ? tNode.residualClasses : tNode.residualStyles) || null);\n        return bindings;\n    }\n    function processTNodeChildren(tNode, buf) {\n        while (tNode) {\n            buf.push(tNode.template_);\n            tNode = tNode.next;\n        }\n    }\n    var TViewData = NG_DEV_MODE && createNamedArrayType('TViewData') || null;\n    var TVIEWDATA_EMPTY; // can't initialize here or it will not be tree shaken, because\n    // `LView` constructor could have side-effects.\n    /**\n     * This function clones a blueprint and creates TData.\n     *\n     * Simple slice will keep the same type, and we need it to be TData\n     */\n    function cloneToTViewData(list) {\n        if (TVIEWDATA_EMPTY === undefined)\n            TVIEWDATA_EMPTY = new TViewData();\n        return TVIEWDATA_EMPTY.concat(list);\n    }\n    var LViewBlueprint = NG_DEV_MODE && createNamedArrayType('LViewBlueprint') || null;\n    var MatchesArray = NG_DEV_MODE && createNamedArrayType('MatchesArray') || null;\n    var TViewComponents = NG_DEV_MODE && createNamedArrayType('TViewComponents') || null;\n    var TNodeLocalNames = NG_DEV_MODE && createNamedArrayType('TNodeLocalNames') || null;\n    var TNodeInitialInputs = NG_DEV_MODE && createNamedArrayType('TNodeInitialInputs') || null;\n    var TNodeInitialData = NG_DEV_MODE && createNamedArrayType('TNodeInitialData') || null;\n    var LCleanup = NG_DEV_MODE && createNamedArrayType('LCleanup') || null;\n    var TCleanup = NG_DEV_MODE && createNamedArrayType('TCleanup') || null;\n    function attachLViewDebug(lView) {\n        attachDebugObject(lView, new LViewDebug(lView));\n    }\n    function attachLContainerDebug(lContainer) {\n        attachDebugObject(lContainer, new LContainerDebug(lContainer));\n    }\n    function toDebug(obj) {\n        if (obj) {\n            var debug = obj.debug;\n            assertDefined(debug, 'Object does not have a debug representation.');\n            return debug;\n        }\n        else {\n            return obj;\n        }\n    }\n    /**\n     * Use this method to unwrap a native element in `LView` and convert it into HTML for easier\n     * reading.\n     *\n     * @param value possibly wrapped native DOM node.\n     * @param includeChildren If `true` then the serialized HTML form will include child elements\n     * (same\n     * as `outerHTML`). If `false` then the serialized HTML form will only contain the element\n     * itself\n     * (will not serialize child elements).\n     */\n    function toHtml(value, includeChildren) {\n        if (includeChildren === void 0) { includeChildren = false; }\n        var node = unwrapRNode(value);\n        if (node) {\n            switch (node.nodeType) {\n                case Node.TEXT_NODE:\n                    return node.textContent;\n                case Node.COMMENT_NODE:\n                    return \"<!--\" + node.textContent + \"-->\";\n                case Node.ELEMENT_NODE:\n                    var outerHTML = node.outerHTML;\n                    if (includeChildren) {\n                        return outerHTML;\n                    }\n                    else {\n                        var innerHTML = '>' + node.innerHTML + '<';\n                        return (outerHTML.split(innerHTML)[0]) + '>';\n                    }\n            }\n        }\n        return null;\n    }\n    var LViewDebug = /** @class */ (function () {\n        function LViewDebug(_raw_lView) {\n            this._raw_lView = _raw_lView;\n        }\n        Object.defineProperty(LViewDebug.prototype, \"flags\", {\n            /**\n             * Flags associated with the `LView` unpacked into a more readable state.\n             */\n            get: function () {\n                var flags = this._raw_lView[FLAGS];\n                return {\n                    __raw__flags__: flags,\n                    initPhaseState: flags & 3 /* InitPhaseStateMask */,\n                    creationMode: !!(flags & 4 /* CreationMode */),\n                    firstViewPass: !!(flags & 8 /* FirstLViewPass */),\n                    checkAlways: !!(flags & 16 /* CheckAlways */),\n                    dirty: !!(flags & 64 /* Dirty */),\n                    attached: !!(flags & 128 /* Attached */),\n                    destroyed: !!(flags & 256 /* Destroyed */),\n                    isRoot: !!(flags & 512 /* IsRoot */),\n                    indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */,\n                };\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"parent\", {\n            get: function () {\n                return toDebug(this._raw_lView[PARENT]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"hostHTML\", {\n            get: function () {\n                return toHtml(this._raw_lView[HOST], true);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"html\", {\n            get: function () {\n                return (this.nodes || []).map(mapToHTML).join('');\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"context\", {\n            get: function () {\n                return this._raw_lView[CONTEXT];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"nodes\", {\n            /**\n             * The tree of nodes associated with the current `LView`. The nodes have been normalized into\n             * a tree structure with relevant details pulled out for readability.\n             */\n            get: function () {\n                var lView = this._raw_lView;\n                var tNode = lView[TVIEW].firstChild;\n                return toDebugNodes(tNode, lView);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"template\", {\n            get: function () {\n                return this.tView.template_;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"tView\", {\n            get: function () {\n                return this._raw_lView[TVIEW];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"cleanup\", {\n            get: function () {\n                return this._raw_lView[CLEANUP];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"injector\", {\n            get: function () {\n                return this._raw_lView[INJECTOR];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"rendererFactory\", {\n            get: function () {\n                return this._raw_lView[RENDERER_FACTORY];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"renderer\", {\n            get: function () {\n                return this._raw_lView[RENDERER];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"sanitizer\", {\n            get: function () {\n                return this._raw_lView[SANITIZER];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"childHead\", {\n            get: function () {\n                return toDebug(this._raw_lView[CHILD_HEAD]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"next\", {\n            get: function () {\n                return toDebug(this._raw_lView[NEXT]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"childTail\", {\n            get: function () {\n                return toDebug(this._raw_lView[CHILD_TAIL]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"declarationView\", {\n            get: function () {\n                return toDebug(this._raw_lView[DECLARATION_VIEW]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"queries\", {\n            get: function () {\n                return this._raw_lView[QUERIES];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"tHost\", {\n            get: function () {\n                return this._raw_lView[T_HOST];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"decls\", {\n            get: function () {\n                return toLViewRange(this.tView, this._raw_lView, HEADER_OFFSET, this.tView.bindingStartIndex);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"vars\", {\n            get: function () {\n                return toLViewRange(this.tView, this._raw_lView, this.tView.bindingStartIndex, this.tView.expandoStartIndex);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"expando\", {\n            get: function () {\n                return toLViewRange(this.tView, this._raw_lView, this.tView.expandoStartIndex, this._raw_lView.length);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LViewDebug.prototype, \"childViews\", {\n            /**\n             * Normalized view of child views (and containers) attached at this location.\n             */\n            get: function () {\n                var childViews = [];\n                var child = this.childHead;\n                while (child) {\n                    childViews.push(child);\n                    child = child.next;\n                }\n                return childViews;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return LViewDebug;\n    }());\n    function mapToHTML(node) {\n        if (node.type === 'ElementContainer') {\n            return (node.children || []).map(mapToHTML).join('');\n        }\n        else if (node.type === 'IcuContainer') {\n            throw new Error('Not implemented');\n        }\n        else {\n            return toHtml(node.native, true) || '';\n        }\n    }\n    function toLViewRange(tView, lView, start, end) {\n        var content = [];\n        for (var index = start; index < end; index++) {\n            content.push({ index: index, t: tView.data[index], l: lView[index] });\n        }\n        return { start: start, end: end, length: end - start, content: content };\n    }\n    /**\n     * Turns a flat list of nodes into a tree by walking the associated `TNode` tree.\n     *\n     * @param tNode\n     * @param lView\n     */\n    function toDebugNodes(tNode, lView) {\n        if (tNode) {\n            var debugNodes = [];\n            var tNodeCursor = tNode;\n            while (tNodeCursor) {\n                debugNodes.push(buildDebugNode(tNodeCursor, lView));\n                tNodeCursor = tNodeCursor.next;\n            }\n            return debugNodes;\n        }\n        else {\n            return [];\n        }\n    }\n    function buildDebugNode(tNode, lView) {\n        var rawValue = lView[tNode.index];\n        var native = unwrapRNode(rawValue);\n        var factories = [];\n        var instances = [];\n        var tView = lView[TVIEW];\n        for (var i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n            var def = tView.data[i];\n            factories.push(def.type);\n            instances.push(lView[i]);\n        }\n        return {\n            html: toHtml(native),\n            type: toTNodeTypeAsString(tNode.type),\n            tNode: tNode,\n            native: native,\n            children: toDebugNodes(tNode.child, lView),\n            factories: factories,\n            instances: instances,\n            injector: buildNodeInjectorDebug(tNode, tView, lView),\n            get injectorResolutionPath() {\n                return tNode.debugNodeInjectorPath(lView);\n            },\n        };\n    }\n    function buildNodeInjectorDebug(tNode, tView, lView) {\n        var viewProviders = [];\n        for (var i = tNode.providerIndexStart_; i < tNode.providerIndexEnd_; i++) {\n            viewProviders.push(tView.data[i]);\n        }\n        var providers = [];\n        for (var i = tNode.providerIndexEnd_; i < tNode.directiveEnd; i++) {\n            providers.push(tView.data[i]);\n        }\n        var nodeInjectorDebug = {\n            bloom: toBloom(lView, tNode.injectorIndex),\n            cumulativeBloom: toBloom(tView.data, tNode.injectorIndex),\n            providers: providers,\n            viewProviders: viewProviders,\n            parentInjectorIndex: lView[tNode.providerIndexStart_ - 1],\n        };\n        return nodeInjectorDebug;\n    }\n    /**\n     * Convert a number at `idx` location in `array` into binary representation.\n     *\n     * @param array\n     * @param idx\n     */\n    function binary(array, idx) {\n        var value = array[idx];\n        // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n        // wrong type.\n        if (typeof value !== 'number')\n            return '????????';\n        // We prefix 0s so that we have constant length number\n        var text = '00000000' + value.toString(2);\n        return text.substring(text.length - 8);\n    }\n    /**\n     * Convert a bloom filter at location `idx` in `array` into binary representation.\n     *\n     * @param array\n     * @param idx\n     */\n    function toBloom(array, idx) {\n        if (idx < 0) {\n            return 'NO_NODE_INJECTOR';\n        }\n        return binary(array, idx + 7) + \"_\" + binary(array, idx + 6) + \"_\" + binary(array, idx + 5) + \"_\" + binary(array, idx + 4) + \"_\" + binary(array, idx + 3) + \"_\" + binary(array, idx + 2) + \"_\" + binary(array, idx + 1) + \"_\" + binary(array, idx + 0);\n    }\n    var LContainerDebug = /** @class */ (function () {\n        function LContainerDebug(_raw_lContainer) {\n            this._raw_lContainer = _raw_lContainer;\n        }\n        Object.defineProperty(LContainerDebug.prototype, \"hasTransplantedViews\", {\n            get: function () {\n                return this._raw_lContainer[HAS_TRANSPLANTED_VIEWS];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LContainerDebug.prototype, \"views\", {\n            get: function () {\n                return this._raw_lContainer.slice(CONTAINER_HEADER_OFFSET)\n                    .map(toDebug);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LContainerDebug.prototype, \"parent\", {\n            get: function () {\n                return toDebug(this._raw_lContainer[PARENT]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LContainerDebug.prototype, \"movedViews\", {\n            get: function () {\n                return this._raw_lContainer[MOVED_VIEWS];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LContainerDebug.prototype, \"host\", {\n            get: function () {\n                return this._raw_lContainer[HOST];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LContainerDebug.prototype, \"native\", {\n            get: function () {\n                return this._raw_lContainer[NATIVE];\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(LContainerDebug.prototype, \"next\", {\n            get: function () {\n                return toDebug(this._raw_lContainer[NEXT]);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return LContainerDebug;\n    }());\n\n    var ɵ0$5 = function () { return Promise.resolve(null); };\n    /**\n     * A permanent marker promise which signifies that the current CD tree is\n     * clean.\n     */\n    var _CLEAN_PROMISE = (ɵ0$5)();\n    /**\n     * Invoke `HostBindingsFunction`s for view.\n     *\n     * This methods executes `TView.hostBindingOpCodes`. It is used to execute the\n     * `HostBindingsFunction`s associated with the current `LView`.\n     *\n     * @param tView Current `TView`.\n     * @param lView Current `LView`.\n     */\n    function processHostBindingOpCodes(tView, lView) {\n        var hostBindingOpCodes = tView.hostBindingOpCodes;\n        if (hostBindingOpCodes === null)\n            return;\n        try {\n            for (var i = 0; i < hostBindingOpCodes.length; i++) {\n                var opCode = hostBindingOpCodes[i];\n                if (opCode < 0) {\n                    // Negative numbers are element indexes.\n                    setSelectedIndex(~opCode);\n                }\n                else {\n                    // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n                    var directiveIdx = opCode;\n                    var bindingRootIndx = hostBindingOpCodes[++i];\n                    var hostBindingFn = hostBindingOpCodes[++i];\n                    setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n                    var context = lView[directiveIdx];\n                    hostBindingFn(2 /* Update */, context);\n                }\n            }\n        }\n        finally {\n            setSelectedIndex(-1);\n        }\n    }\n    /** Refreshes all content queries declared by directives in a given view */\n    function refreshContentQueries(tView, lView) {\n        var contentQueries = tView.contentQueries;\n        if (contentQueries !== null) {\n            for (var i = 0; i < contentQueries.length; i += 2) {\n                var queryStartIdx = contentQueries[i];\n                var directiveDefIdx = contentQueries[i + 1];\n                if (directiveDefIdx !== -1) {\n                    var directiveDef = tView.data[directiveDefIdx];\n                    ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n                    ngDevMode &&\n                        assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n                    setCurrentQueryIndex(queryStartIdx);\n                    directiveDef.contentQueries(2 /* Update */, lView[directiveDefIdx], directiveDefIdx);\n                }\n            }\n        }\n    }\n    /** Refreshes child components in the current view (update mode). */\n    function refreshChildComponents(hostLView, components) {\n        for (var i = 0; i < components.length; i++) {\n            refreshComponent(hostLView, components[i]);\n        }\n    }\n    /** Renders child components in the current view (creation mode). */\n    function renderChildComponents(hostLView, components) {\n        for (var i = 0; i < components.length; i++) {\n            renderComponent(hostLView, components[i]);\n        }\n    }\n    function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector) {\n        var lView = ngDevMode ? cloneToLViewFromTViewBlueprint(tView) : tView.blueprint.slice();\n        lView[HOST] = host;\n        lView[FLAGS] = flags | 4 /* CreationMode */ | 128 /* Attached */ | 8 /* FirstLViewPass */;\n        resetPreOrderHookFlags(lView);\n        ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n        lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n        lView[CONTEXT] = context;\n        lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY]);\n        ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required');\n        lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER]);\n        ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n        lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null;\n        lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;\n        lView[T_HOST] = tHostNode;\n        ngDevMode &&\n            assertEqual(tView.type == 2 /* Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');\n        lView[DECLARATION_COMPONENT_VIEW] =\n            tView.type == 2 /* Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;\n        ngDevMode && attachLViewDebug(lView);\n        return lView;\n    }\n    function getOrCreateTNode(tView, index, type, name, attrs) {\n        ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n            // `view_engine_compatibility` for additional context.\n            assertGreaterThanOrEqual(index, HEADER_OFFSET, 'TNodes can\\'t be in the LView header.');\n        // Keep this function short, so that the VM will inline it.\n        ngDevMode && assertPureTNodeType(type);\n        var tNode = tView.data[index];\n        if (tNode === null) {\n            tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n            if (isInI18nBlock()) {\n                // If we are in i18n block then all elements should be pre declared through `Placeholder`\n                // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n                // If the `TNode` was not pre-declared than it means it was not mentioned which means it was\n                // removed, so we mark it as detached.\n                tNode.flags |= 64 /* isDetached */;\n            }\n        }\n        else if (tNode.type & 64 /* Placeholder */) {\n            tNode.type = type;\n            tNode.value = name;\n            tNode.attrs = attrs;\n            var parent = getCurrentParentTNode();\n            tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n            ngDevMode && assertTNodeForTView(tNode, tView);\n            ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n        }\n        setCurrentTNode(tNode, true);\n        return tNode;\n    }\n    function createTNodeAtIndex(tView, index, type, name, attrs) {\n        var currentTNode = getCurrentTNodePlaceholderOk();\n        var isParent = isCurrentTNodeParent();\n        var parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n        // Parents cannot cross component boundaries because components will be used in multiple places.\n        var tNode = tView.data[index] =\n            createTNode(tView, parent, type, index, name, attrs);\n        // Assign a pointer to the first child node of a given view. The first node is not always the one\n        // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has\n        // the index 1 or more, so we can't just check node index.\n        if (tView.firstChild === null) {\n            tView.firstChild = tNode;\n        }\n        if (currentTNode !== null) {\n            if (isParent) {\n                // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?\n                if (currentTNode.child == null && tNode.parent !== null) {\n                    // We are in the same view, which means we are adding content node to the parent view.\n                    currentTNode.child = tNode;\n                }\n            }\n            else {\n                if (currentTNode.next === null) {\n                    // In the case of i18n the `currentTNode` may already be linked, in which case we don't want\n                    // to break the links which i18n created.\n                    currentTNode.next = tNode;\n                }\n            }\n        }\n        return tNode;\n    }\n    /**\n     * When elements are created dynamically after a view blueprint is created (e.g. through\n     * i18nApply()), we need to adjust the blueprint for future\n     * template passes.\n     *\n     * @param tView `TView` associated with `LView`\n     * @param lView The `LView` containing the blueprint to adjust\n     * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0\n     * @param initialValue Initial value to store in blueprint\n     */\n    function allocExpando(tView, lView, numSlotsToAlloc, initialValue) {\n        if (numSlotsToAlloc === 0)\n            return -1;\n        if (ngDevMode) {\n            assertFirstCreatePass(tView);\n            assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');\n            assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n            assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n            assertFirstUpdatePass(tView);\n        }\n        var allocIdx = lView.length;\n        for (var i = 0; i < numSlotsToAlloc; i++) {\n            lView.push(initialValue);\n            tView.blueprint.push(initialValue);\n            tView.data.push(null);\n        }\n        return allocIdx;\n    }\n    //////////////////////////\n    //// Render\n    //////////////////////////\n    /**\n     * Processes a view in the creation mode. This includes a number of steps in a specific order:\n     * - creating view query functions (if any);\n     * - executing a template function in the creation mode;\n     * - updating static queries (if any);\n     * - creating child components defined in a given view.\n     */\n    function renderView(tView, lView, context) {\n        ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n        enterView(lView);\n        try {\n            var viewQuery = tView.viewQuery;\n            if (viewQuery !== null) {\n                executeViewQueryFn(1 /* Create */, viewQuery, context);\n            }\n            // Execute a template associated with this view, if it exists. A template function might not be\n            // defined for the root component views.\n            var templateFn = tView.template;\n            if (templateFn !== null) {\n                executeTemplate(tView, lView, templateFn, 1 /* Create */, context);\n            }\n            // This needs to be set before children are processed to support recursive components.\n            // This must be set to false immediately after the first creation run because in an\n            // ngFor loop, all the views will be created together before update mode runs and turns\n            // off firstCreatePass. If we don't set it here, instances will perform directive\n            // matching, etc again and again.\n            if (tView.firstCreatePass) {\n                tView.firstCreatePass = false;\n            }\n            // We resolve content queries specifically marked as `static` in creation mode. Dynamic\n            // content queries are resolved during change detection (i.e. update mode), after embedded\n            // views are refreshed (see block above).\n            if (tView.staticContentQueries) {\n                refreshContentQueries(tView, lView);\n            }\n            // We must materialize query results before child components are processed\n            // in case a child component has projected a container. The LContainer needs\n            // to exist so the embedded views are properly attached by the container.\n            if (tView.staticViewQueries) {\n                executeViewQueryFn(2 /* Update */, tView.viewQuery, context);\n            }\n            // Render child component views.\n            var components = tView.components;\n            if (components !== null) {\n                renderChildComponents(lView, components);\n            }\n        }\n        catch (error) {\n            // If we didn't manage to get past the first template pass due to\n            // an error, mark the view as corrupted so we can try to recover.\n            if (tView.firstCreatePass) {\n                tView.incompleteFirstPass = true;\n                tView.firstCreatePass = false;\n            }\n            throw error;\n        }\n        finally {\n            lView[FLAGS] &= ~4 /* CreationMode */;\n            leaveView();\n        }\n    }\n    /**\n     * Processes a view in update mode. This includes a number of steps in a specific order:\n     * - executing a template function in update mode;\n     * - executing hooks;\n     * - refreshing queries;\n     * - setting host bindings;\n     * - refreshing child (embedded and component) views.\n     */\n    function refreshView(tView, lView, templateFn, context) {\n        ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n        var flags = lView[FLAGS];\n        if ((flags & 256 /* Destroyed */) === 256 /* Destroyed */)\n            return;\n        enterView(lView);\n        // Check no changes mode is a dev only mode used to verify that bindings have not changed\n        // since they were assigned. We do not want to execute lifecycle hooks in that mode.\n        var isInCheckNoChangesPass = isInCheckNoChangesMode();\n        try {\n            resetPreOrderHookFlags(lView);\n            setBindingIndex(tView.bindingStartIndex);\n            if (templateFn !== null) {\n                executeTemplate(tView, lView, templateFn, 2 /* Update */, context);\n            }\n            var hooksInitPhaseCompleted = (flags & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;\n            // execute pre-order hooks (OnInit, OnChanges, DoCheck)\n            // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n            if (!isInCheckNoChangesPass) {\n                if (hooksInitPhaseCompleted) {\n                    var preOrderCheckHooks = tView.preOrderCheckHooks;\n                    if (preOrderCheckHooks !== null) {\n                        executeCheckHooks(lView, preOrderCheckHooks, null);\n                    }\n                }\n                else {\n                    var preOrderHooks = tView.preOrderHooks;\n                    if (preOrderHooks !== null) {\n                        executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, null);\n                    }\n                    incrementInitPhaseFlags(lView, 0 /* OnInitHooksToBeRun */);\n                }\n            }\n            // First mark transplanted views that are declared in this lView as needing a refresh at their\n            // insertion points. This is needed to avoid the situation where the template is defined in this\n            // `LView` but its declaration appears after the insertion component.\n            markTransplantedViewsForRefresh(lView);\n            refreshEmbeddedViews(lView);\n            // Content query results must be refreshed before content hooks are called.\n            if (tView.contentQueries !== null) {\n                refreshContentQueries(tView, lView);\n            }\n            // execute content hooks (AfterContentInit, AfterContentChecked)\n            // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n            if (!isInCheckNoChangesPass) {\n                if (hooksInitPhaseCompleted) {\n                    var contentCheckHooks = tView.contentCheckHooks;\n                    if (contentCheckHooks !== null) {\n                        executeCheckHooks(lView, contentCheckHooks);\n                    }\n                }\n                else {\n                    var contentHooks = tView.contentHooks;\n                    if (contentHooks !== null) {\n                        executeInitAndCheckHooks(lView, contentHooks, 1 /* AfterContentInitHooksToBeRun */);\n                    }\n                    incrementInitPhaseFlags(lView, 1 /* AfterContentInitHooksToBeRun */);\n                }\n            }\n            processHostBindingOpCodes(tView, lView);\n            // Refresh child component views.\n            var components = tView.components;\n            if (components !== null) {\n                refreshChildComponents(lView, components);\n            }\n            // View queries must execute after refreshing child components because a template in this view\n            // could be inserted in a child component. If the view query executes before child component\n            // refresh, the template might not yet be inserted.\n            var viewQuery = tView.viewQuery;\n            if (viewQuery !== null) {\n                executeViewQueryFn(2 /* Update */, viewQuery, context);\n            }\n            // execute view hooks (AfterViewInit, AfterViewChecked)\n            // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n            if (!isInCheckNoChangesPass) {\n                if (hooksInitPhaseCompleted) {\n                    var viewCheckHooks = tView.viewCheckHooks;\n                    if (viewCheckHooks !== null) {\n                        executeCheckHooks(lView, viewCheckHooks);\n                    }\n                }\n                else {\n                    var viewHooks = tView.viewHooks;\n                    if (viewHooks !== null) {\n                        executeInitAndCheckHooks(lView, viewHooks, 2 /* AfterViewInitHooksToBeRun */);\n                    }\n                    incrementInitPhaseFlags(lView, 2 /* AfterViewInitHooksToBeRun */);\n                }\n            }\n            if (tView.firstUpdatePass === true) {\n                // We need to make sure that we only flip the flag on successful `refreshView` only\n                // Don't do this in `finally` block.\n                // If we did this in `finally` block then an exception could block the execution of styling\n                // instructions which in turn would be unable to insert themselves into the styling linked\n                // list. The result of this would be that if the exception would not be throw on subsequent CD\n                // the styling would be unable to process it data and reflect to the DOM.\n                tView.firstUpdatePass = false;\n            }\n            // Do not reset the dirty state when running in check no changes mode. We don't want components\n            // to behave differently depending on whether check no changes is enabled or not. For example:\n            // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to\n            // refresh a `NgClass` binding should work. If we would reset the dirty state in the check\n            // no changes cycle, the component would be not be dirty for the next update pass. This would\n            // be different in production mode where the component dirty state is not reset.\n            if (!isInCheckNoChangesPass) {\n                lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */);\n            }\n            if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {\n                lView[FLAGS] &= ~1024 /* RefreshTransplantedView */;\n                updateTransplantedViewCount(lView[PARENT], -1);\n            }\n        }\n        finally {\n            leaveView();\n        }\n    }\n    function renderComponentOrTemplate(tView, lView, templateFn, context) {\n        var rendererFactory = lView[RENDERER_FACTORY];\n        var normalExecutionPath = !isInCheckNoChangesMode();\n        var creationModeIsActive = isCreationMode(lView);\n        try {\n            if (normalExecutionPath && !creationModeIsActive && rendererFactory.begin) {\n                rendererFactory.begin();\n            }\n            if (creationModeIsActive) {\n                renderView(tView, lView, context);\n            }\n            refreshView(tView, lView, templateFn, context);\n        }\n        finally {\n            if (normalExecutionPath && !creationModeIsActive && rendererFactory.end) {\n                rendererFactory.end();\n            }\n        }\n    }\n    function executeTemplate(tView, lView, templateFn, rf, context) {\n        var prevSelectedIndex = getSelectedIndex();\n        var isUpdatePhase = rf & 2 /* Update */;\n        try {\n            setSelectedIndex(-1);\n            if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n                // When we're updating, inherently select 0 so we don't\n                // have to generate that instruction for most update blocks.\n                selectIndexInternal(tView, lView, HEADER_OFFSET, isInCheckNoChangesMode());\n            }\n            var preHookType = isUpdatePhase ? 2 /* TemplateUpdateStart */ : 0 /* TemplateCreateStart */;\n            profiler(preHookType, context);\n            templateFn(rf, context);\n        }\n        finally {\n            setSelectedIndex(prevSelectedIndex);\n            var postHookType = isUpdatePhase ? 3 /* TemplateUpdateEnd */ : 1 /* TemplateCreateEnd */;\n            profiler(postHookType, context);\n        }\n    }\n    //////////////////////////\n    //// Element\n    //////////////////////////\n    function executeContentQueries(tView, tNode, lView) {\n        if (isContentQueryHost(tNode)) {\n            var start = tNode.directiveStart;\n            var end = tNode.directiveEnd;\n            for (var directiveIndex = start; directiveIndex < end; directiveIndex++) {\n                var def = tView.data[directiveIndex];\n                if (def.contentQueries) {\n                    def.contentQueries(1 /* Create */, lView[directiveIndex], directiveIndex);\n                }\n            }\n        }\n    }\n    /**\n     * Creates directive instances.\n     */\n    function createDirectivesInstances(tView, lView, tNode) {\n        if (!getBindingsEnabled())\n            return;\n        instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));\n        if ((tNode.flags & 128 /* hasHostBindings */) === 128 /* hasHostBindings */) {\n            invokeDirectivesHostBindings(tView, lView, tNode);\n        }\n    }\n    /**\n     * Takes a list of local names and indices and pushes the resolved local variable values\n     * to LView in the same order as they are loaded in the template with load().\n     */\n    function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n        if (localRefExtractor === void 0) { localRefExtractor = getNativeByTNode; }\n        var localNames = tNode.localNames;\n        if (localNames !== null) {\n            var localIndex = tNode.index + 1;\n            for (var i = 0; i < localNames.length; i += 2) {\n                var index = localNames[i + 1];\n                var value = index === -1 ?\n                    localRefExtractor(tNode, viewData) :\n                    viewData[index];\n                viewData[localIndex++] = value;\n            }\n        }\n    }\n    /**\n     * Gets TView from a template function or creates a new TView\n     * if it doesn't already exist.\n     *\n     * @param def ComponentDef\n     * @returns TView\n     */\n    function getOrCreateTComponentView(def) {\n        var tView = def.tView;\n        // Create a TView if there isn't one, or recreate it if the first create pass didn't\n        // complete successfully since we can't know for sure whether it's in a usable shape.\n        if (tView === null || tView.incompleteFirstPass) {\n            // Declaration node here is null since this function is called when we dynamically create a\n            // component and hence there is no declaration.\n            var declTNode = null;\n            return def.tView = createTView(1 /* Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts);\n        }\n        return tView;\n    }\n    /**\n     * Creates a TView instance\n     *\n     * @param type Type of `TView`.\n     * @param declTNode Declaration location of this `TView`.\n     * @param templateFn Template function\n     * @param decls The number of nodes, local refs, and pipes in this template\n     * @param directives Registry of directives for this view\n     * @param pipes Registry of pipes for this view\n     * @param viewQuery View queries for this view\n     * @param schemas Schemas for this view\n     * @param consts Constants for this view\n     */\n    function createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory) {\n        ngDevMode && ngDevMode.tView++;\n        var bindingStartIndex = HEADER_OFFSET + decls;\n        // This length does not yet contain host bindings from child directives because at this point,\n        // we don't know which directives are active on this template. As soon as a directive is matched\n        // that has a host binding, we will update the blueprint with that def's hostVars count.\n        var initialViewLength = bindingStartIndex + vars;\n        var blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n        var consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n        var tView = blueprint[TVIEW] = ngDevMode ?\n            new TViewConstructor(type, // type: TViewType,\n            blueprint, // blueprint: LView,\n            templateFn, // template: ComponentTemplate<{}>|null,\n            null, // queries: TQueries|null\n            viewQuery, // viewQuery: ViewQueriesFunction<{}>|null,\n            declTNode, // declTNode: TNode|null,\n            cloneToTViewData(blueprint).fill(null, bindingStartIndex), // data: TData,\n            bindingStartIndex, // bindingStartIndex: number,\n            initialViewLength, // expandoStartIndex: number,\n            null, // hostBindingOpCodes: HostBindingOpCodes,\n            true, // firstCreatePass: boolean,\n            true, // firstUpdatePass: boolean,\n            false, // staticViewQueries: boolean,\n            false, // staticContentQueries: boolean,\n            null, // preOrderHooks: HookData|null,\n            null, // preOrderCheckHooks: HookData|null,\n            null, // contentHooks: HookData|null,\n            null, // contentCheckHooks: HookData|null,\n            null, // viewHooks: HookData|null,\n            null, // viewCheckHooks: HookData|null,\n            null, // destroyHooks: DestroyHookData|null,\n            null, // cleanup: any[]|null,\n            null, // contentQueries: number[]|null,\n            null, // components: number[]|null,\n            typeof directives === 'function' ? //\n                directives() : //\n                directives, // directiveRegistry: DirectiveDefList|null,\n            typeof pipes === 'function' ? pipes() : pipes, // pipeRegistry: PipeDefList|null,\n            null, // firstChild: TNode|null,\n            schemas, // schemas: SchemaMetadata[]|null,\n            consts, // consts: TConstants|null\n            false, // incompleteFirstPass: boolean\n            decls, // ngDevMode only: decls\n            vars) :\n            {\n                type: type,\n                blueprint: blueprint,\n                template: templateFn,\n                queries: null,\n                viewQuery: viewQuery,\n                declTNode: declTNode,\n                data: blueprint.slice().fill(null, bindingStartIndex),\n                bindingStartIndex: bindingStartIndex,\n                expandoStartIndex: initialViewLength,\n                hostBindingOpCodes: null,\n                firstCreatePass: true,\n                firstUpdatePass: true,\n                staticViewQueries: false,\n                staticContentQueries: false,\n                preOrderHooks: null,\n                preOrderCheckHooks: null,\n                contentHooks: null,\n                contentCheckHooks: null,\n                viewHooks: null,\n                viewCheckHooks: null,\n                destroyHooks: null,\n                cleanup: null,\n                contentQueries: null,\n                components: null,\n                directiveRegistry: typeof directives === 'function' ? directives() : directives,\n                pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n                firstChild: null,\n                schemas: schemas,\n                consts: consts,\n                incompleteFirstPass: false\n            };\n        if (ngDevMode) {\n            // For performance reasons it is important that the tView retains the same shape during runtime.\n            // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n            // prevent class transitions.\n            Object.seal(tView);\n        }\n        return tView;\n    }\n    function createViewBlueprint(bindingStartIndex, initialViewLength) {\n        var blueprint = ngDevMode ? new LViewBlueprint() : [];\n        for (var i = 0; i < initialViewLength; i++) {\n            blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n        }\n        return blueprint;\n    }\n    function createError(text, token) {\n        return new Error(\"Renderer: \" + text + \" [\" + stringifyForError(token) + \"]\");\n    }\n    function assertHostNodeExists(rElement, elementOrSelector) {\n        if (!rElement) {\n            if (typeof elementOrSelector === 'string') {\n                throw createError('Host node with selector not found:', elementOrSelector);\n            }\n            else {\n                throw createError('Host node is required:', elementOrSelector);\n            }\n        }\n    }\n    /**\n     * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n     *\n     * @param rendererFactory Factory function to create renderer instance.\n     * @param elementOrSelector Render element or CSS selector to locate the element.\n     * @param encapsulation View Encapsulation defined for component that requests host element.\n     */\n    function locateHostElement(renderer, elementOrSelector, encapsulation) {\n        if (isProceduralRenderer(renderer)) {\n            // When using native Shadow DOM, do not clear host element to allow native slot projection\n            var preserveContent = encapsulation === exports.ViewEncapsulation.ShadowDom;\n            return renderer.selectRootElement(elementOrSelector, preserveContent);\n        }\n        var rElement = typeof elementOrSelector === 'string' ?\n            renderer.querySelector(elementOrSelector) :\n            elementOrSelector;\n        ngDevMode && assertHostNodeExists(rElement, elementOrSelector);\n        // Always clear host element's content when Renderer3 is in use. For procedural renderer case we\n        // make it depend on whether ShadowDom encapsulation is used (in which case the content should be\n        // preserved to allow native slot projection). ShadowDom encapsulation requires procedural\n        // renderer, and procedural renderer case is handled above.\n        rElement.textContent = '';\n        return rElement;\n    }\n    /**\n     * Saves context for this cleanup function in LView.cleanupInstances.\n     *\n     * On the first template pass, saves in TView:\n     * - Cleanup function\n     * - Index of context we just saved in LView.cleanupInstances\n     *\n     * This function can also be used to store instance specific cleanup fns. In that case the `context`\n     * is `null` and the function is store in `LView` (rather than it `TView`).\n     */\n    function storeCleanupWithContext(tView, lView, context, cleanupFn) {\n        var lCleanup = getOrCreateLViewCleanup(lView);\n        if (context === null) {\n            // If context is null that this is instance specific callback. These callbacks can only be\n            // inserted after template shared instances. For this reason in ngDevMode we freeze the TView.\n            if (ngDevMode) {\n                Object.freeze(getOrCreateTViewCleanup(tView));\n            }\n            lCleanup.push(cleanupFn);\n        }\n        else {\n            lCleanup.push(context);\n            if (tView.firstCreatePass) {\n                getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);\n            }\n        }\n    }\n    function createTNode(tView, tParent, type, index, value, attrs) {\n        ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n            // `view_engine_compatibility` for additional context.\n            assertGreaterThanOrEqual(index, HEADER_OFFSET, 'TNodes can\\'t be in the LView header.');\n        ngDevMode && assertNotSame(attrs, undefined, '\\'undefined\\' is not valid value for \\'attrs\\'');\n        ngDevMode && ngDevMode.tNode++;\n        ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n        var injectorIndex = tParent ? tParent.injectorIndex : -1;\n        var tNode = ngDevMode ?\n            new TNodeDebug(tView, // tView_: TView\n            type, // type: TNodeType\n            index, // index: number\n            null, // insertBeforeIndex: null|-1|number|number[]\n            injectorIndex, // injectorIndex: number\n            -1, // directiveStart: number\n            -1, // directiveEnd: number\n            -1, // directiveStylingLast: number\n            null, // propertyBindings: number[]|null\n            0, // flags: TNodeFlags\n            0, // providerIndexes: TNodeProviderIndexes\n            value, // value: string|null\n            attrs, // attrs: (string|AttributeMarker|(string|SelectorFlags)[])[]|null\n            null, // mergedAttrs\n            null, // localNames: (string|number)[]|null\n            undefined, // initialInputs: (string[]|null)[]|null|undefined\n            null, // inputs: PropertyAliases|null\n            null, // outputs: PropertyAliases|null\n            null, // tViews: ITView|ITView[]|null\n            null, // next: ITNode|null\n            null, // projectionNext: ITNode|null\n            null, // child: ITNode|null\n            tParent, // parent: TElementNode|TContainerNode|null\n            null, // projection: number|(ITNode|RNode[])[]|null\n            null, // styles: string|null\n            null, // stylesWithoutHost: string|null\n            undefined, // residualStyles: string|null\n            null, // classes: string|null\n            null, // classesWithoutHost: string|null\n            undefined, // residualClasses: string|null\n            0, // classBindings: TStylingRange;\n            0) :\n            {\n                type: type,\n                index: index,\n                insertBeforeIndex: null,\n                injectorIndex: injectorIndex,\n                directiveStart: -1,\n                directiveEnd: -1,\n                directiveStylingLast: -1,\n                propertyBindings: null,\n                flags: 0,\n                providerIndexes: 0,\n                value: value,\n                attrs: attrs,\n                mergedAttrs: null,\n                localNames: null,\n                initialInputs: undefined,\n                inputs: null,\n                outputs: null,\n                tViews: null,\n                next: null,\n                projectionNext: null,\n                child: null,\n                parent: tParent,\n                projection: null,\n                styles: null,\n                stylesWithoutHost: null,\n                residualStyles: undefined,\n                classes: null,\n                classesWithoutHost: null,\n                residualClasses: undefined,\n                classBindings: 0,\n                styleBindings: 0,\n            };\n        if (ngDevMode) {\n            // For performance reasons it is important that the tNode retains the same shape during runtime.\n            // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n            // prevent class transitions.\n            Object.seal(tNode);\n        }\n        return tNode;\n    }\n    function generatePropertyAliases(inputAliasMap, directiveDefIdx, propStore) {\n        for (var publicName in inputAliasMap) {\n            if (inputAliasMap.hasOwnProperty(publicName)) {\n                propStore = propStore === null ? {} : propStore;\n                var internalName = inputAliasMap[publicName];\n                if (propStore.hasOwnProperty(publicName)) {\n                    propStore[publicName].push(directiveDefIdx, internalName);\n                }\n                else {\n                    (propStore[publicName] = [directiveDefIdx, internalName]);\n                }\n            }\n        }\n        return propStore;\n    }\n    /**\n     * Initializes data structures required to work with directive inputs and outputs.\n     * Initialization is done for all directives matched on a given TNode.\n     */\n    function initializeInputAndOutputAliases(tView, tNode) {\n        ngDevMode && assertFirstCreatePass(tView);\n        var start = tNode.directiveStart;\n        var end = tNode.directiveEnd;\n        var tViewData = tView.data;\n        var tNodeAttrs = tNode.attrs;\n        var inputsFromAttrs = ngDevMode ? new TNodeInitialInputs() : [];\n        var inputsStore = null;\n        var outputsStore = null;\n        for (var i = start; i < end; i++) {\n            var directiveDef = tViewData[i];\n            var directiveInputs = directiveDef.inputs;\n            // Do not use unbound attributes as inputs to structural directives, since structural\n            // directive inputs can only be set using microsyntax (e.g. `<div *dir=\"exp\">`).\n            // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which\n            // should be set for inline templates.\n            var initialInputs = (tNodeAttrs !== null && !isInlineTemplate(tNode)) ?\n                generateInitialInputs(directiveInputs, tNodeAttrs) :\n                null;\n            inputsFromAttrs.push(initialInputs);\n            inputsStore = generatePropertyAliases(directiveInputs, i, inputsStore);\n            outputsStore = generatePropertyAliases(directiveDef.outputs, i, outputsStore);\n        }\n        if (inputsStore !== null) {\n            if (inputsStore.hasOwnProperty('class')) {\n                tNode.flags |= 16 /* hasClassInput */;\n            }\n            if (inputsStore.hasOwnProperty('style')) {\n                tNode.flags |= 32 /* hasStyleInput */;\n            }\n        }\n        tNode.initialInputs = inputsFromAttrs;\n        tNode.inputs = inputsStore;\n        tNode.outputs = outputsStore;\n    }\n    /**\n     * Mapping between attributes names that don't correspond to their element property names.\n     *\n     * Performance note: this function is written as a series of if checks (instead of, say, a property\n     * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of\n     * mapping property names. Do NOT change without benchmarking.\n     *\n     * Note: this mapping has to be kept in sync with the equally named mapping in the template\n     * type-checking machinery of ngtsc.\n     */\n    function mapPropName(name) {\n        if (name === 'class')\n            return 'className';\n        if (name === 'for')\n            return 'htmlFor';\n        if (name === 'formaction')\n            return 'formAction';\n        if (name === 'innerHtml')\n            return 'innerHTML';\n        if (name === 'readonly')\n            return 'readOnly';\n        if (name === 'tabindex')\n            return 'tabIndex';\n        return name;\n    }\n    function elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {\n        ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n        var element = getNativeByTNode(tNode, lView);\n        var inputData = tNode.inputs;\n        var dataValue;\n        if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {\n            setInputsForProperty(tView, lView, dataValue, propName, value);\n            if (isComponentHost(tNode))\n                markDirtyIfOnPush(lView, tNode.index);\n            if (ngDevMode) {\n                setNgReflectProperties(lView, element, tNode.type, dataValue, value);\n            }\n        }\n        else if (tNode.type & 3 /* AnyRNode */) {\n            propName = mapPropName(propName);\n            if (ngDevMode) {\n                validateAgainstEventProperties(propName);\n                if (!validateProperty(tView, element, propName, tNode)) {\n                    // Return here since we only log warnings for unknown properties.\n                    logUnknownPropertyError(propName, tNode);\n                    return;\n                }\n                ngDevMode.rendererSetProperty++;\n            }\n            // It is assumed that the sanitizer is only added when the compiler determines that the\n            // property is risky, so sanitization can be done without further checks.\n            value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;\n            if (isProceduralRenderer(renderer)) {\n                renderer.setProperty(element, propName, value);\n            }\n            else if (!isAnimationProp(propName)) {\n                element.setProperty ? element.setProperty(propName, value) :\n                    element[propName] = value;\n            }\n        }\n        else if (tNode.type & 12 /* AnyContainer */) {\n            // If the node is a container and the property didn't\n            // match any of the inputs or schemas we should throw.\n            if (ngDevMode && !matchingSchemas(tView, tNode.value)) {\n                logUnknownPropertyError(propName, tNode);\n            }\n        }\n    }\n    /** If node is an OnPush component, marks its LView dirty. */\n    function markDirtyIfOnPush(lView, viewIndex) {\n        ngDevMode && assertLView(lView);\n        var childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n        if (!(childComponentLView[FLAGS] & 16 /* CheckAlways */)) {\n            childComponentLView[FLAGS] |= 64 /* Dirty */;\n        }\n    }\n    function setNgReflectProperty(lView, element, type, attrName, value) {\n        var _a;\n        var renderer = lView[RENDERER];\n        attrName = normalizeDebugBindingName(attrName);\n        var debugValue = normalizeDebugBindingValue(value);\n        if (type & 3 /* AnyRNode */) {\n            if (value == null) {\n                isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) :\n                    element.removeAttribute(attrName);\n            }\n            else {\n                isProceduralRenderer(renderer) ?\n                    renderer.setAttribute(element, attrName, debugValue) :\n                    element.setAttribute(attrName, debugValue);\n            }\n        }\n        else {\n            var textContent = escapeCommentText(\"bindings=\" + JSON.stringify((_a = {}, _a[attrName] = debugValue, _a), null, 2));\n            if (isProceduralRenderer(renderer)) {\n                renderer.setValue(element, textContent);\n            }\n            else {\n                element.textContent = textContent;\n            }\n        }\n    }\n    function setNgReflectProperties(lView, element, type, dataValue, value) {\n        if (type & (3 /* AnyRNode */ | 4 /* Container */)) {\n            /**\n             * dataValue is an array containing runtime input or output names for the directives:\n             * i+0: directive instance index\n             * i+1: privateName\n             *\n             * e.g. [0, 'change', 'change-minified']\n             * we want to set the reflected property with the privateName: dataValue[i+1]\n             */\n            for (var i = 0; i < dataValue.length; i += 2) {\n                setNgReflectProperty(lView, element, type, dataValue[i + 1], value);\n            }\n        }\n    }\n    function validateProperty(tView, element, propName, tNode) {\n        // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n        // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n        // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n        // execute the check below.\n        if (tView.schemas === null)\n            return true;\n        // The property is considered valid if the element matches the schema, it exists on the element\n        // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).\n        if (matchingSchemas(tView, tNode.value) || propName in element || isAnimationProp(propName)) {\n            return true;\n        }\n        // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we\n        // need to account for both here, while being careful for `typeof null` also returning 'object'.\n        return typeof Node === 'undefined' || Node === null || !(element instanceof Node);\n    }\n    function matchingSchemas(tView, tagName) {\n        var schemas = tView.schemas;\n        if (schemas !== null) {\n            for (var i = 0; i < schemas.length; i++) {\n                var schema = schemas[i];\n                if (schema === NO_ERRORS_SCHEMA ||\n                    schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n    /**\n     * Logs an error that a property is not supported on an element.\n     * @param propName Name of the invalid property.\n     * @param tNode Node on which we encountered the property.\n     */\n    function logUnknownPropertyError(propName, tNode) {\n        var message = \"Can't bind to '\" + propName + \"' since it isn't a known property of '\" + tNode.value + \"'.\";\n        console.error(formatRuntimeError(\"303\" /* UNKNOWN_BINDING */, message));\n    }\n    /**\n     * Instantiate a root component.\n     */\n    function instantiateRootComponent(tView, lView, def) {\n        var rootTNode = getCurrentTNode();\n        if (tView.firstCreatePass) {\n            if (def.providersResolver)\n                def.providersResolver(def);\n            var directiveIndex = allocExpando(tView, lView, 1, null);\n            ngDevMode &&\n                assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');\n            configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);\n        }\n        var directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);\n        attachPatchData(directive, lView);\n        var native = getNativeByTNode(rootTNode, lView);\n        if (native) {\n            attachPatchData(native, lView);\n        }\n        return directive;\n    }\n    /**\n     * Resolve the matched directives on a node.\n     */\n    function resolveDirectives(tView, lView, tNode, localRefs) {\n        // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in\n        // tsickle.\n        ngDevMode && assertFirstCreatePass(tView);\n        var hasDirectives = false;\n        if (getBindingsEnabled()) {\n            var directiveDefs = findDirectiveDefMatches(tView, lView, tNode);\n            var exportsMap = localRefs === null ? null : { '': -1 };\n            if (directiveDefs !== null) {\n                hasDirectives = true;\n                initTNodeFlags(tNode, tView.data.length, directiveDefs.length);\n                // When the same token is provided by several directives on the same node, some rules apply in\n                // the viewEngine:\n                // - viewProviders have priority over providers\n                // - the last directive in NgModule.declarations has priority over the previous one\n                // So to match these rules, the order in which providers are added in the arrays is very\n                // important.\n                for (var i = 0; i < directiveDefs.length; i++) {\n                    var def = directiveDefs[i];\n                    if (def.providersResolver)\n                        def.providersResolver(def);\n                }\n                var preOrderHooksFound = false;\n                var preOrderCheckHooksFound = false;\n                var directiveIdx = allocExpando(tView, lView, directiveDefs.length, null);\n                ngDevMode &&\n                    assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');\n                for (var i = 0; i < directiveDefs.length; i++) {\n                    var def = directiveDefs[i];\n                    // Merge the attrs in the order of matches. This assumes that the first directive is the\n                    // component itself, so that the component has the least priority.\n                    tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n                    configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n                    saveNameToExportMap(directiveIdx, def, exportsMap);\n                    if (def.contentQueries !== null)\n                        tNode.flags |= 8 /* hasContentQuery */;\n                    if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)\n                        tNode.flags |= 128 /* hasHostBindings */;\n                    var lifeCycleHooks = def.type.prototype;\n                    // Only push a node index into the preOrderHooks array if this is the first\n                    // pre-order hook found on this node.\n                    if (!preOrderHooksFound &&\n                        (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n                        // We will push the actual hook function into this array later during dir instantiation.\n                        // We cannot do it now because we must ensure hooks are registered in the same\n                        // order that directives are created (i.e. injection order).\n                        (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);\n                        preOrderHooksFound = true;\n                    }\n                    if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n                        (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);\n                        preOrderCheckHooksFound = true;\n                    }\n                    directiveIdx++;\n                }\n                initializeInputAndOutputAliases(tView, tNode);\n            }\n            if (exportsMap)\n                cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n        }\n        // Merge the template attrs last so that they have the highest priority.\n        tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n        return hasDirectives;\n    }\n    /**\n     * Add `hostBindings` to the `TView.hostBindingOpCodes`.\n     *\n     * @param tView `TView` to which the `hostBindings` should be added.\n     * @param tNode `TNode` the element which contains the directive\n     * @param lView `LView` current `LView`\n     * @param directiveIdx Directive index in view.\n     * @param directiveVarsIdx Where will the directive's vars be stored\n     * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.\n     */\n    function registerHostBindingOpCodes(tView, tNode, lView, directiveIdx, directiveVarsIdx, def) {\n        ngDevMode && assertFirstCreatePass(tView);\n        var hostBindings = def.hostBindings;\n        if (hostBindings) {\n            var hostBindingOpCodes = tView.hostBindingOpCodes;\n            if (hostBindingOpCodes === null) {\n                hostBindingOpCodes = tView.hostBindingOpCodes = [];\n            }\n            var elementIndx = ~tNode.index;\n            if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n                // Conditionally add select element so that we are more efficient in execution.\n                // NOTE: this is strictly not necessary and it trades code size for runtime perf.\n                // (We could just always add it.)\n                hostBindingOpCodes.push(elementIndx);\n            }\n            hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n        }\n    }\n    /**\n     * Returns the last selected element index in the `HostBindingOpCodes`\n     *\n     * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only\n     * if it changes. This method returns the last index (or '0' if not found.)\n     *\n     * Selected element index are only the ones which are negative.\n     */\n    function lastSelectedElementIdx(hostBindingOpCodes) {\n        var i = hostBindingOpCodes.length;\n        while (i > 0) {\n            var value = hostBindingOpCodes[--i];\n            if (typeof value === 'number' && value < 0) {\n                return value;\n            }\n        }\n        return 0;\n    }\n    /**\n     * Instantiate all the directives that were previously resolved on the current node.\n     */\n    function instantiateAllDirectives(tView, lView, tNode, native) {\n        var start = tNode.directiveStart;\n        var end = tNode.directiveEnd;\n        if (!tView.firstCreatePass) {\n            getOrCreateNodeInjectorForNode(tNode, lView);\n        }\n        attachPatchData(native, lView);\n        var initialInputs = tNode.initialInputs;\n        for (var i = start; i < end; i++) {\n            var def = tView.data[i];\n            var isComponent = isComponentDef(def);\n            if (isComponent) {\n                ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);\n                addComponentLogic(lView, tNode, def);\n            }\n            var directive = getNodeInjectable(lView, tView, i, tNode);\n            attachPatchData(directive, lView);\n            if (initialInputs !== null) {\n                setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n            }\n            if (isComponent) {\n                var componentView = getComponentLViewByIndex(tNode.index, lView);\n                componentView[CONTEXT] = directive;\n            }\n        }\n    }\n    function invokeDirectivesHostBindings(tView, lView, tNode) {\n        var start = tNode.directiveStart;\n        var end = tNode.directiveEnd;\n        var firstCreatePass = tView.firstCreatePass;\n        var elementIndex = tNode.index;\n        var currentDirectiveIndex = getCurrentDirectiveIndex();\n        try {\n            setSelectedIndex(elementIndex);\n            for (var dirIndex = start; dirIndex < end; dirIndex++) {\n                var def = tView.data[dirIndex];\n                var directive = lView[dirIndex];\n                setCurrentDirectiveIndex(dirIndex);\n                if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n                    invokeHostBindingsInCreationMode(def, directive);\n                }\n            }\n        }\n        finally {\n            setSelectedIndex(-1);\n            setCurrentDirectiveIndex(currentDirectiveIndex);\n        }\n    }\n    /**\n     * Invoke the host bindings in creation mode.\n     *\n     * @param def `DirectiveDef` which may contain the `hostBindings` function.\n     * @param directive Instance of directive.\n     */\n    function invokeHostBindingsInCreationMode(def, directive) {\n        if (def.hostBindings !== null) {\n            def.hostBindings(1 /* Create */, directive);\n        }\n    }\n    /**\n     * Matches the current node against all available selectors.\n     * If a component is matched (at most one), it is returned in first position in the array.\n     */\n    function findDirectiveDefMatches(tView, viewData, tNode) {\n        ngDevMode && assertFirstCreatePass(tView);\n        ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n        var registry = tView.directiveRegistry;\n        var matches = null;\n        if (registry) {\n            for (var i = 0; i < registry.length; i++) {\n                var def = registry[i];\n                if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n                    matches || (matches = ngDevMode ? new MatchesArray() : []);\n                    diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n                    if (isComponentDef(def)) {\n                        if (ngDevMode) {\n                            assertTNodeType(tNode, 2 /* Element */, \"\\\"\" + tNode.value + \"\\\" tags cannot be used as component hosts. \" +\n                                (\"Please use a different tag to activate the \" + stringify(def.type) + \" component.\"));\n                            if (tNode.flags & 2 /* isComponentHost */)\n                                throwMultipleComponentError(tNode);\n                        }\n                        markAsComponentHost(tView, tNode);\n                        // The component is always stored first with directives after.\n                        matches.unshift(def);\n                    }\n                    else {\n                        matches.push(def);\n                    }\n                }\n            }\n        }\n        return matches;\n    }\n    /**\n     * Marks a given TNode as a component's host. This consists of:\n     * - setting appropriate TNode flags;\n     * - storing index of component's host element so it will be queued for view refresh during CD.\n     */\n    function markAsComponentHost(tView, hostTNode) {\n        ngDevMode && assertFirstCreatePass(tView);\n        hostTNode.flags |= 2 /* isComponentHost */;\n        (tView.components || (tView.components = ngDevMode ? new TViewComponents() : []))\n            .push(hostTNode.index);\n    }\n    /** Caches local names and their matching directive indices for query and template lookups. */\n    function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n        if (localRefs) {\n            var localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : [];\n            // Local names must be stored in tNode in the same order that localRefs are defined\n            // in the template to ensure the data is loaded in the same slots as their refs\n            // in the template (for template queries).\n            for (var i = 0; i < localRefs.length; i += 2) {\n                var index = exportsMap[localRefs[i + 1]];\n                if (index == null)\n                    throw new RuntimeError(\"301\" /* EXPORT_NOT_FOUND */, \"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n                localNames.push(localRefs[i], index);\n            }\n        }\n    }\n    /**\n     * Builds up an export map as directives are created, so local refs can be quickly mapped\n     * to their directive instances.\n     */\n    function saveNameToExportMap(directiveIdx, def, exportsMap) {\n        if (exportsMap) {\n            if (def.exportAs) {\n                for (var i = 0; i < def.exportAs.length; i++) {\n                    exportsMap[def.exportAs[i]] = directiveIdx;\n                }\n            }\n            if (isComponentDef(def))\n                exportsMap[''] = directiveIdx;\n        }\n    }\n    /**\n     * Initializes the flags on the current node, setting all indices to the initial index,\n     * the directive count to 0, and adding the isComponent flag.\n     * @param index the initial index\n     */\n    function initTNodeFlags(tNode, index, numberOfDirectives) {\n        ngDevMode &&\n            assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');\n        tNode.flags |= 1 /* isDirectiveHost */;\n        // When the first directive is created on a node, save the index\n        tNode.directiveStart = index;\n        tNode.directiveEnd = index + numberOfDirectives;\n        tNode.providerIndexes = index;\n    }\n    /**\n     * Setup directive for instantiation.\n     *\n     * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well\n     * as `LView`. `TView` gets the `DirectiveDef`.\n     *\n     * @param tView `TView`\n     * @param tNode `TNode`\n     * @param lView `LView`\n     * @param directiveIndex Index where the directive will be stored in the Expando.\n     * @param def `DirectiveDef`\n     */\n    function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {\n        ngDevMode &&\n            assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n        tView.data[directiveIndex] = def;\n        var directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));\n        var nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), null);\n        tView.blueprint[directiveIndex] = nodeInjectorFactory;\n        lView[directiveIndex] = nodeInjectorFactory;\n        registerHostBindingOpCodes(tView, tNode, lView, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n    }\n    function addComponentLogic(lView, hostTNode, def) {\n        var native = getNativeByTNode(hostTNode, lView);\n        var tView = getOrCreateTComponentView(def);\n        // Only component views should be added to the view tree directly. Embedded views are\n        // accessed through their containers because they may be removed / re-added later.\n        var rendererFactory = lView[RENDERER_FACTORY];\n        var componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null));\n        // Component view will always be created before any injected LContainers,\n        // so this is a regular element, wrap it with the component view\n        lView[hostTNode.index] = componentView;\n    }\n    function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {\n        if (ngDevMode) {\n            assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n            validateAgainstEventAttributes(name);\n            assertTNodeType(tNode, 2 /* Element */, \"Attempted to set attribute `\" + name + \"` on a container node. \" +\n                \"Host bindings are not valid on ng-container or ng-template.\");\n        }\n        var element = getNativeByTNode(tNode, lView);\n        setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n    }\n    function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {\n        if (value == null) {\n            ngDevMode && ngDevMode.rendererRemoveAttribute++;\n            isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name, namespace) :\n                element.removeAttribute(name);\n        }\n        else {\n            ngDevMode && ngDevMode.rendererSetAttribute++;\n            var strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n            if (isProceduralRenderer(renderer)) {\n                renderer.setAttribute(element, name, strValue, namespace);\n            }\n            else {\n                namespace ? element.setAttributeNS(namespace, name, strValue) :\n                    element.setAttribute(name, strValue);\n            }\n        }\n    }\n    /**\n     * Sets initial input properties on directive instances from attribute data\n     *\n     * @param lView Current LView that is being processed.\n     * @param directiveIndex Index of the directive in directives array\n     * @param instance Instance of the directive on which to set the initial inputs\n     * @param def The directive def that contains the list of inputs\n     * @param tNode The static data for this node\n     */\n    function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {\n        var initialInputs = initialInputData[directiveIndex];\n        if (initialInputs !== null) {\n            var setInput = def.setInput;\n            for (var i = 0; i < initialInputs.length;) {\n                var publicName = initialInputs[i++];\n                var privateName = initialInputs[i++];\n                var value = initialInputs[i++];\n                if (setInput !== null) {\n                    def.setInput(instance, value, publicName, privateName);\n                }\n                else {\n                    instance[privateName] = value;\n                }\n                if (ngDevMode) {\n                    var nativeElement = getNativeByTNode(tNode, lView);\n                    setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);\n                }\n            }\n        }\n    }\n    /**\n     * Generates initialInputData for a node and stores it in the template's static storage\n     * so subsequent template invocations don't have to recalculate it.\n     *\n     * initialInputData is an array containing values that need to be set as input properties\n     * for directives on this node, but only once on creation. We need this array to support\n     * the case where you set an @Input property of a directive using attribute-like syntax.\n     * e.g. if you have a `name` @Input, you can set it once like this:\n     *\n     * <my-component name=\"Bess\"></my-component>\n     *\n     * @param inputs The list of inputs from the directive def\n     * @param attrs The static attrs on this node\n     */\n    function generateInitialInputs(inputs, attrs) {\n        var inputsToStore = null;\n        var i = 0;\n        while (i < attrs.length) {\n            var attrName = attrs[i];\n            if (attrName === 0 /* NamespaceURI */) {\n                // We do not allow inputs on namespaced attributes.\n                i += 4;\n                continue;\n            }\n            else if (attrName === 5 /* ProjectAs */) {\n                // Skip over the `ngProjectAs` value.\n                i += 2;\n                continue;\n            }\n            // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.\n            if (typeof attrName === 'number')\n                break;\n            if (inputs.hasOwnProperty(attrName)) {\n                if (inputsToStore === null)\n                    inputsToStore = [];\n                inputsToStore.push(attrName, inputs[attrName], attrs[i + 1]);\n            }\n            i += 2;\n        }\n        return inputsToStore;\n    }\n    //////////////////////////\n    //// ViewContainer & View\n    //////////////////////////\n    // Not sure why I need to do `any` here but TS complains later.\n    var LContainerArray = ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) &&\n        createNamedArrayType('LContainer');\n    /**\n     * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n     *\n     * @param hostNative The host element for the LContainer\n     * @param hostTNode The host TNode for the LContainer\n     * @param currentView The parent view of the LContainer\n     * @param native The native comment element\n     * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n     * @returns LContainer\n     */\n    function createLContainer(hostNative, currentView, native, tNode) {\n        ngDevMode && assertLView(currentView);\n        ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);\n        // https://jsperf.com/array-literal-vs-new-array-really\n        var lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native\n        true, // Boolean `true` in this position signifies that this is an `LContainer`\n        false, // has transplanted views\n        currentView, // parent\n        null, // next\n        0, // transplanted views to refresh count\n        tNode, // t_host\n        native, // native,\n        null, // view refs\n        null);\n        ngDevMode &&\n            assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');\n        ngDevMode && attachLContainerDebug(lContainer);\n        return lContainer;\n    }\n    /**\n     * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes\n     * them by executing an associated template function.\n     */\n    function refreshEmbeddedViews(lView) {\n        for (var lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n            for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n                var embeddedLView = lContainer[i];\n                var embeddedTView = embeddedLView[TVIEW];\n                ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');\n                if (viewAttachedToChangeDetector(embeddedLView)) {\n                    refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);\n                }\n            }\n        }\n    }\n    /**\n     * Mark transplanted views as needing to be refreshed at their insertion points.\n     *\n     * @param lView The `LView` that may have transplanted views.\n     */\n    function markTransplantedViewsForRefresh(lView) {\n        for (var lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n            if (!lContainer[HAS_TRANSPLANTED_VIEWS])\n                continue;\n            var movedViews = lContainer[MOVED_VIEWS];\n            ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n            for (var i = 0; i < movedViews.length; i++) {\n                var movedLView = movedViews[i];\n                var insertionLContainer = movedLView[PARENT];\n                ngDevMode && assertLContainer(insertionLContainer);\n                // We don't want to increment the counter if the moved LView was already marked for\n                // refresh.\n                if ((movedLView[FLAGS] & 1024 /* RefreshTransplantedView */) === 0) {\n                    updateTransplantedViewCount(insertionLContainer, 1);\n                }\n                // Note, it is possible that the `movedViews` is tracking views that are transplanted *and*\n                // those that aren't (declaration component === insertion component). In the latter case,\n                // it's fine to add the flag, as we will clear it immediately in\n                // `refreshEmbeddedViews` for the view currently being refreshed.\n                movedLView[FLAGS] |= 1024 /* RefreshTransplantedView */;\n            }\n        }\n    }\n    /////////////\n    /**\n     * Refreshes components by entering the component view and processing its bindings, queries, etc.\n     *\n     * @param componentHostIdx  Element index in LView[] (adjusted for HEADER_OFFSET)\n     */\n    function refreshComponent(hostLView, componentHostIdx) {\n        ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n        var componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n        // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n        if (viewAttachedToChangeDetector(componentView)) {\n            var tView = componentView[TVIEW];\n            if (componentView[FLAGS] & (16 /* CheckAlways */ | 64 /* Dirty */)) {\n                refreshView(tView, componentView, tView.template, componentView[CONTEXT]);\n            }\n            else if (componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n                // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n                refreshContainsDirtyView(componentView);\n            }\n        }\n    }\n    /**\n     * Refreshes all transplanted views marked with `LViewFlags.RefreshTransplantedView` that are\n     * children or descendants of the given lView.\n     *\n     * @param lView The lView which contains descendant transplanted views that need to be refreshed.\n     */\n    function refreshContainsDirtyView(lView) {\n        for (var lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n            for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n                var embeddedLView = lContainer[i];\n                if (embeddedLView[FLAGS] & 1024 /* RefreshTransplantedView */) {\n                    var embeddedTView = embeddedLView[TVIEW];\n                    ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');\n                    refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);\n                }\n                else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n                    refreshContainsDirtyView(embeddedLView);\n                }\n            }\n        }\n        var tView = lView[TVIEW];\n        // Refresh child component views.\n        var components = tView.components;\n        if (components !== null) {\n            for (var i = 0; i < components.length; i++) {\n                var componentView = getComponentLViewByIndex(components[i], lView);\n                // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n                if (viewAttachedToChangeDetector(componentView) &&\n                    componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n                    refreshContainsDirtyView(componentView);\n                }\n            }\n        }\n    }\n    function renderComponent(hostLView, componentHostIdx) {\n        ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n        var componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n        var componentTView = componentView[TVIEW];\n        syncViewWithBlueprint(componentTView, componentView);\n        renderView(componentTView, componentView, componentView[CONTEXT]);\n    }\n    /**\n     * Syncs an LView instance with its blueprint if they have gotten out of sync.\n     *\n     * Typically, blueprints and their view instances should always be in sync, so the loop here\n     * will be skipped. However, consider this case of two components side-by-side:\n     *\n     * App template:\n     * ```\n     * <comp></comp>\n     * <comp></comp>\n     * ```\n     *\n     * The following will happen:\n     * 1. App template begins processing.\n     * 2. First <comp> is matched as a component and its LView is created.\n     * 3. Second <comp> is matched as a component and its LView is created.\n     * 4. App template completes processing, so it's time to check child templates.\n     * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n     * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n     * <comp> template, but its LView was created before this update, so it is out of sync.\n     *\n     * Note that embedded views inside ngFor loops will never be out of sync because these views\n     * are processed as soon as they are created.\n     *\n     * @param tView The `TView` that contains the blueprint for syncing\n     * @param lView The view to sync\n     */\n    function syncViewWithBlueprint(tView, lView) {\n        for (var i = lView.length; i < tView.blueprint.length; i++) {\n            lView.push(tView.blueprint[i]);\n        }\n    }\n    /**\n     * Adds LView or LContainer to the end of the current view tree.\n     *\n     * This structure will be used to traverse through nested views to remove listeners\n     * and call onDestroy callbacks.\n     *\n     * @param lView The view where LView or LContainer should be added\n     * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n     * @param lViewOrLContainer The LView or LContainer to add to the view tree\n     * @returns The state passed in\n     */\n    function addToViewTree(lView, lViewOrLContainer) {\n        // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer\n        // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out\n        // of order, the change detection will run out of order, as the act of retrieving the the\n        // LContainer from the RNode is what adds it to the queue.\n        if (lView[CHILD_HEAD]) {\n            lView[CHILD_TAIL][NEXT] = lViewOrLContainer;\n        }\n        else {\n            lView[CHILD_HEAD] = lViewOrLContainer;\n        }\n        lView[CHILD_TAIL] = lViewOrLContainer;\n        return lViewOrLContainer;\n    }\n    ///////////////////////////////\n    //// Change detection\n    ///////////////////////////////\n    /**\n     * Marks current view and all ancestors dirty.\n     *\n     * Returns the root view because it is found as a byproduct of marking the view tree\n     * dirty, and can be used by methods that consume markViewDirty() to easily schedule\n     * change detection. Otherwise, such methods would need to traverse up the view tree\n     * an additional time to get the root view and schedule a tick on it.\n     *\n     * @param lView The starting LView to mark dirty\n     * @returns the root LView\n     */\n    function markViewDirty(lView) {\n        while (lView) {\n            lView[FLAGS] |= 64 /* Dirty */;\n            var parent = getLViewParent(lView);\n            // Stop traversing up as soon as you find a root view that wasn't attached to any container\n            if (isRootView(lView) && !parent) {\n                return lView;\n            }\n            // continue otherwise\n            lView = parent;\n        }\n        return null;\n    }\n    /**\n     * Used to schedule change detection on the whole application.\n     *\n     * Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.\n     * It is usually called indirectly by calling `markDirty` when the view needs to be\n     * re-rendered.\n     *\n     * Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple\n     * `scheduleTick` requests. The scheduling function can be overridden in\n     * `renderComponent`'s `scheduler` option.\n     */\n    function scheduleTick(rootContext, flags) {\n        var nothingScheduled = rootContext.flags === 0 /* Empty */;\n        if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n            // https://github.com/angular/angular/issues/39296\n            // should only attach the flags when really scheduling a tick\n            rootContext.flags |= flags;\n            var res_1;\n            rootContext.clean = new Promise(function (r) { return res_1 = r; });\n            rootContext.scheduler(function () {\n                if (rootContext.flags & 1 /* DetectChanges */) {\n                    rootContext.flags &= ~1 /* DetectChanges */;\n                    tickRootContext(rootContext);\n                }\n                if (rootContext.flags & 2 /* FlushPlayers */) {\n                    rootContext.flags &= ~2 /* FlushPlayers */;\n                    var playerHandler = rootContext.playerHandler;\n                    if (playerHandler) {\n                        playerHandler.flushPlayers();\n                    }\n                }\n                rootContext.clean = _CLEAN_PROMISE;\n                res_1(null);\n            });\n        }\n    }\n    function tickRootContext(rootContext) {\n        for (var i = 0; i < rootContext.components.length; i++) {\n            var rootComponent = rootContext.components[i];\n            var lView = readPatchedLView(rootComponent);\n            var tView = lView[TVIEW];\n            renderComponentOrTemplate(tView, lView, tView.template, rootComponent);\n        }\n    }\n    function detectChangesInternal(tView, lView, context) {\n        var rendererFactory = lView[RENDERER_FACTORY];\n        if (rendererFactory.begin)\n            rendererFactory.begin();\n        try {\n            refreshView(tView, lView, tView.template, context);\n        }\n        catch (error) {\n            handleError(lView, error);\n            throw error;\n        }\n        finally {\n            if (rendererFactory.end)\n                rendererFactory.end();\n        }\n    }\n    /**\n     * Synchronously perform change detection on a root view and its components.\n     *\n     * @param lView The view which the change detection should be performed on.\n     */\n    function detectChangesInRootView(lView) {\n        tickRootContext(lView[CONTEXT]);\n    }\n    function checkNoChangesInternal(tView, view, context) {\n        setIsInCheckNoChangesMode(true);\n        try {\n            detectChangesInternal(tView, view, context);\n        }\n        finally {\n            setIsInCheckNoChangesMode(false);\n        }\n    }\n    /**\n     * Checks the change detector on a root view and its components, and throws if any changes are\n     * detected.\n     *\n     * This is used in development mode to verify that running change detection doesn't\n     * introduce other changes.\n     *\n     * @param lView The view which the change detection should be checked on.\n     */\n    function checkNoChangesInRootView(lView) {\n        setIsInCheckNoChangesMode(true);\n        try {\n            detectChangesInRootView(lView);\n        }\n        finally {\n            setIsInCheckNoChangesMode(false);\n        }\n    }\n    function executeViewQueryFn(flags, viewQueryFn, component) {\n        ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n        setCurrentQueryIndex(0);\n        viewQueryFn(flags, component);\n    }\n    ///////////////////////////////\n    //// Bindings & interpolations\n    ///////////////////////////////\n    /**\n     * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.\n     *\n     * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:\n     * - a bound property name;\n     * - a static parts of interpolated strings;\n     *\n     * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a\n     * property binding metadata will be stored in `TView.data` at the same index as a bound value in\n     * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the\n     * following format:\n     * - `propertyName` for bound properties;\n     * - `propertyName�prefix�interpolation_static_part1�..interpolation_static_partN�suffix` for\n     * interpolated properties.\n     *\n     * @param tData `TData` where meta-data will be saved;\n     * @param tNode `TNode` that is a target of the binding;\n     * @param propertyName bound property name;\n     * @param bindingIndex binding index in `LView`\n     * @param interpolationParts static interpolation parts (for property interpolations)\n     */\n    function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex) {\n        var interpolationParts = [];\n        for (var _i = 4; _i < arguments.length; _i++) {\n            interpolationParts[_i - 4] = arguments[_i];\n        }\n        // Binding meta-data are stored only the first time a given property instruction is processed.\n        // Since we don't have a concept of the \"first update pass\" we need to check for presence of the\n        // binding meta-data to decide if one should be stored (or if was stored already).\n        if (tData[bindingIndex] === null) {\n            if (tNode.inputs == null || !tNode.inputs[propertyName]) {\n                var propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n                propBindingIdxs.push(bindingIndex);\n                var bindingMetadata = propertyName;\n                if (interpolationParts.length > 0) {\n                    bindingMetadata +=\n                        INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n                }\n                tData[bindingIndex] = bindingMetadata;\n            }\n        }\n    }\n    var CLEAN_PROMISE = _CLEAN_PROMISE;\n    function getOrCreateLViewCleanup(view) {\n        // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n        return view[CLEANUP] || (view[CLEANUP] = ngDevMode ? new LCleanup() : []);\n    }\n    function getOrCreateTViewCleanup(tView) {\n        return tView.cleanup || (tView.cleanup = ngDevMode ? new TCleanup() : []);\n    }\n    /**\n     * There are cases where the sub component's renderer needs to be included\n     * instead of the current renderer (see the componentSyntheticHost* instructions).\n     */\n    function loadComponentRenderer(currentDef, tNode, lView) {\n        // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n        // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n        // of creating inner components, when current directive index is available in the state. In order\n        // to avoid relying on current def being `null` (thus special-casing root component creation), the\n        // process of creating root component should be unified with the process of creating inner\n        // components.\n        if (currentDef === null || isComponentDef(currentDef)) {\n            lView = unwrapLView(lView[tNode.index]);\n        }\n        return lView[RENDERER];\n    }\n    /** Handles an error thrown in an LView. */\n    function handleError(lView, error) {\n        var injector = lView[INJECTOR];\n        var errorHandler = injector ? injector.get(ErrorHandler, null) : null;\n        errorHandler && errorHandler.handleError(error);\n    }\n    /**\n     * Set the inputs of directives at the current node to corresponding value.\n     *\n     * @param tView The current TView\n     * @param lView the `LView` which contains the directives.\n     * @param inputs mapping between the public \"input\" name and privately-known,\n     *        possibly minified, property names to write to.\n     * @param value Value to set.\n     */\n    function setInputsForProperty(tView, lView, inputs, publicName, value) {\n        for (var i = 0; i < inputs.length;) {\n            var index = inputs[i++];\n            var privateName = inputs[i++];\n            var instance = lView[index];\n            ngDevMode && assertIndexInRange(lView, index);\n            var def = tView.data[index];\n            if (def.setInput !== null) {\n                def.setInput(instance, value, publicName, privateName);\n            }\n            else {\n                instance[privateName] = value;\n            }\n        }\n    }\n    /**\n     * Updates a text binding at a given index in a given LView.\n     */\n    function textBindingInternal(lView, index, value) {\n        ngDevMode && assertString(value, 'Value should be a string');\n        ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE');\n        ngDevMode && assertIndexInRange(lView, index);\n        var element = getNativeByIndex(index, lView);\n        ngDevMode && assertDefined(element, 'native element should exist');\n        updateTextNode(lView[RENDERER], element, value);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Compute the static styling (class/style) from `TAttributes`.\n     *\n     * This function should be called during `firstCreatePass` only.\n     *\n     * @param tNode The `TNode` into which the styling information should be loaded.\n     * @param attrs `TAttributes` containing the styling information.\n     * @param writeToHost Where should the resulting static styles be written?\n     *   - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`\n     *   - `true` Write to `TNode.styles` / `TNode.classes`\n     */\n    function computeStaticStyling(tNode, attrs, writeToHost) {\n        ngDevMode &&\n            assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n        var styles = writeToHost ? tNode.styles : null;\n        var classes = writeToHost ? tNode.classes : null;\n        var mode = 0;\n        if (attrs !== null) {\n            for (var i = 0; i < attrs.length; i++) {\n                var value = attrs[i];\n                if (typeof value === 'number') {\n                    mode = value;\n                }\n                else if (mode == 1 /* Classes */) {\n                    classes = concatStringsWithSpace(classes, value);\n                }\n                else if (mode == 2 /* Styles */) {\n                    var style = value;\n                    var styleValue = attrs[++i];\n                    styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n                }\n            }\n        }\n        writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;\n        writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Synchronously perform change detection on a component (and possibly its sub-components).\n     *\n     * This function triggers change detection in a synchronous way on a component.\n     *\n     * @param component The component which the change detection should be performed on.\n     */\n    function detectChanges(component) {\n        var view = getComponentViewByInstance(component);\n        detectChangesInternal(view[TVIEW], view, component);\n    }\n    /**\n     * Marks the component as dirty (needing change detection). Marking a component dirty will\n     * schedule a change detection on it at some point in the future.\n     *\n     * Marking an already dirty component as dirty won't do anything. Only one outstanding change\n     * detection can be scheduled per component tree.\n     *\n     * @param component Component to mark as dirty.\n     */\n    function markDirty(component) {\n        ngDevMode && assertDefined(component, 'component');\n        var rootView = markViewDirty(getComponentViewByInstance(component));\n        ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n        scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n    }\n    /**\n     * Used to perform change detection on the whole application.\n     *\n     * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`\n     * executes lifecycle hooks and conditionally checks components based on their\n     * `ChangeDetectionStrategy` and dirtiness.\n     *\n     * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally\n     * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a\n     * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can\n     * be changed when calling `renderComponent` and providing the `scheduler` option.\n     */\n    function tick(component) {\n        var rootView = getRootView(component);\n        var rootContext = rootView[CONTEXT];\n        tickRootContext(rootContext);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n     *\n     * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n     * project.\n     *\n     * @publicApi\n     */\n    var INJECTOR$1 = new InjectionToken('INJECTOR', \n    // Dissable tslint because this is const enum which gets inlined not top level prop access.\n    // tslint:disable-next-line: no-toplevel-property-access\n    -1 /* Injector */);\n\n    /**\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://angular.io/license\n     */\n    var NullInjector = /** @class */ (function () {\n        function NullInjector() {\n        }\n        NullInjector.prototype.get = function (token, notFoundValue) {\n            if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }\n            if (notFoundValue === THROW_IF_NOT_FOUND) {\n                var error = new Error(\"NullInjectorError: No provider for \" + stringify(token) + \"!\");\n                error.name = 'NullInjectorError';\n                throw error;\n            }\n            return notFoundValue;\n        };\n        return NullInjector;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An internal token whose presence in an injector indicates that the injector should treat itself\n     * as a root scoped injector when processing requests for unknown tokens which may indicate\n     * they are provided in the root scope.\n     */\n    var INJECTOR_SCOPE = new InjectionToken('Set Injector scope.');\n\n    /**\n     * Marker which indicates that a value has not yet been created from the factory function.\n     */\n    var NOT_YET = {};\n    /**\n     * Marker which indicates that the factory function for a token is in the process of being called.\n     *\n     * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n     * injection of a dependency has recursively attempted to inject the original token, and there is\n     * a circular dependency among the providers.\n     */\n    var CIRCULAR = {};\n    /**\n     * A lazily initialized NullInjector.\n     */\n    var NULL_INJECTOR = undefined;\n    function getNullInjector() {\n        if (NULL_INJECTOR === undefined) {\n            NULL_INJECTOR = new NullInjector();\n        }\n        return NULL_INJECTOR;\n    }\n    /**\n     * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n     *\n     * @publicApi\n     */\n    function createInjector(defType, parent, additionalProviders, name) {\n        if (parent === void 0) { parent = null; }\n        if (additionalProviders === void 0) { additionalProviders = null; }\n        var injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);\n        injector._resolveInjectorDefTypes();\n        return injector;\n    }\n    /**\n     * Creates a new injector without eagerly resolving its injector types. Can be used in places\n     * where resolving the injector types immediately can lead to an infinite loop. The injector types\n     * should be resolved at a later point by calling `_resolveInjectorDefTypes`.\n     */\n    function createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name) {\n        if (parent === void 0) { parent = null; }\n        if (additionalProviders === void 0) { additionalProviders = null; }\n        return new R3Injector(defType, additionalProviders, parent || getNullInjector(), name);\n    }\n    var R3Injector = /** @class */ (function () {\n        function R3Injector(def, additionalProviders, parent, source) {\n            var _this = this;\n            if (source === void 0) { source = null; }\n            this.parent = parent;\n            /**\n             * Map of tokens to records which contain the instances of those tokens.\n             * - `null` value implies that we don't have the record. Used by tree-shakable injectors\n             * to prevent further searches.\n             */\n            this.records = new Map();\n            /**\n             * The transitive set of `InjectorType`s which define this injector.\n             */\n            this.injectorDefTypes = new Set();\n            /**\n             * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n             */\n            this.onDestroy = new Set();\n            this._destroyed = false;\n            var dedupStack = [];\n            // Start off by creating Records for every provider declared in every InjectorType\n            // included transitively in additional providers then do the same for `def`. This order is\n            // important because `def` may include providers that override ones in additionalProviders.\n            additionalProviders &&\n                deepForEach(additionalProviders, function (provider) { return _this.processProvider(provider, def, additionalProviders); });\n            deepForEach([def], function (injectorDef) { return _this.processInjectorType(injectorDef, [], dedupStack); });\n            // Make sure the INJECTOR token provides this injector.\n            this.records.set(INJECTOR$1, makeRecord(undefined, this));\n            // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n            // any injectable scoped to APP_ROOT_SCOPE.\n            var record = this.records.get(INJECTOR_SCOPE);\n            this.scope = record != null ? record.value : null;\n            // Source name, used for debugging\n            this.source = source || (typeof def === 'object' ? null : stringify(def));\n        }\n        Object.defineProperty(R3Injector.prototype, \"destroyed\", {\n            /**\n             * Flag indicating that this injector was previously destroyed.\n             */\n            get: function () {\n                return this._destroyed;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Destroy the injector and release references to every instance or provider associated with it.\n         *\n         * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n         * hook was found.\n         */\n        R3Injector.prototype.destroy = function () {\n            this.assertNotDestroyed();\n            // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n            this._destroyed = true;\n            try {\n                // Call all the lifecycle hooks.\n                this.onDestroy.forEach(function (service) { return service.ngOnDestroy(); });\n            }\n            finally {\n                // Release all references.\n                this.records.clear();\n                this.onDestroy.clear();\n                this.injectorDefTypes.clear();\n            }\n        };\n        R3Injector.prototype.get = function (token, notFoundValue, flags) {\n            if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }\n            if (flags === void 0) { flags = exports.InjectFlags.Default; }\n            this.assertNotDestroyed();\n            // Set the injection context.\n            var previousInjector = setCurrentInjector(this);\n            var previousInjectImplementation = setInjectImplementation(undefined);\n            try {\n                // Check for the SkipSelf flag.\n                if (!(flags & exports.InjectFlags.SkipSelf)) {\n                    // SkipSelf isn't set, check if the record belongs to this injector.\n                    var record = this.records.get(token);\n                    if (record === undefined) {\n                        // No record, but maybe the token is scoped to this injector. Look for an injectable\n                        // def with a scope matching this injector.\n                        var def = couldBeInjectableType(token) && getInjectableDef(token);\n                        if (def && this.injectableDefInScope(def)) {\n                            // Found an injectable def and it's scoped to this injector. Pretend as if it was here\n                            // all along.\n                            record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n                        }\n                        else {\n                            record = null;\n                        }\n                        this.records.set(token, record);\n                    }\n                    // If a record was found, get the instance for it and return it.\n                    if (record != null /* NOT null || undefined */) {\n                        return this.hydrate(token, record);\n                    }\n                }\n                // Select the next injector based on the Self flag - if self is set, the next injector is\n                // the NullInjector, otherwise it's the parent.\n                var nextInjector = !(flags & exports.InjectFlags.Self) ? this.parent : getNullInjector();\n                // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue\n                // is undefined, the value is null, otherwise it's the notFoundValue.\n                notFoundValue = (flags & exports.InjectFlags.Optional) && notFoundValue === THROW_IF_NOT_FOUND ?\n                    null :\n                    notFoundValue;\n                return nextInjector.get(token, notFoundValue);\n            }\n            catch (e) {\n                if (e.name === 'NullInjectorError') {\n                    var path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n                    path.unshift(stringify(token));\n                    if (previousInjector) {\n                        // We still have a parent injector, keep throwing\n                        throw e;\n                    }\n                    else {\n                        // Format & throw the final error message when we don't have any previous injector\n                        return catchInjectorError(e, token, 'R3InjectorError', this.source);\n                    }\n                }\n                else {\n                    throw e;\n                }\n            }\n            finally {\n                // Lastly, restore the previous injection context.\n                setInjectImplementation(previousInjectImplementation);\n                setCurrentInjector(previousInjector);\n            }\n        };\n        /** @internal */\n        R3Injector.prototype._resolveInjectorDefTypes = function () {\n            var _this = this;\n            this.injectorDefTypes.forEach(function (defType) { return _this.get(defType); });\n        };\n        R3Injector.prototype.toString = function () {\n            var tokens = [], records = this.records;\n            records.forEach(function (v, token) { return tokens.push(stringify(token)); });\n            return \"R3Injector[\" + tokens.join(', ') + \"]\";\n        };\n        R3Injector.prototype.assertNotDestroyed = function () {\n            if (this._destroyed) {\n                throw new Error('Injector has already been destroyed.');\n            }\n        };\n        /**\n         * Add an `InjectorType` or `InjectorTypeWithProviders` and all of its transitive providers\n         * to this injector.\n         *\n         * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,\n         * the function will return \"true\" to indicate that the providers of the type definition need\n         * to be processed. This allows us to process providers of injector types after all imports of\n         * an injector definition are processed. (following View Engine semantics: see FW-1349)\n         */\n        R3Injector.prototype.processInjectorType = function (defOrWrappedDef, parents, dedupStack) {\n            var _this = this;\n            defOrWrappedDef = resolveForwardRef(defOrWrappedDef);\n            if (!defOrWrappedDef)\n                return false;\n            // Either the defOrWrappedDef is an InjectorType (with injector def) or an\n            // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic\n            // read, so care is taken to only do the read once.\n            // First attempt to read the injector def (`ɵinj`).\n            var def = getInjectorDef(defOrWrappedDef);\n            // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.\n            var ngModule = (def == null) && defOrWrappedDef.ngModule || undefined;\n            // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,\n            // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type\n            // is the `ngModule`.\n            var defType = (ngModule === undefined) ? defOrWrappedDef : ngModule;\n            // Check for circular dependencies.\n            if (ngDevMode && parents.indexOf(defType) !== -1) {\n                var defName = stringify(defType);\n                var path = parents.map(stringify);\n                throwCyclicDependencyError(defName, path);\n            }\n            // Check for multiple imports of the same module\n            var isDuplicate = dedupStack.indexOf(defType) !== -1;\n            // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual\n            // `InjectorDef` is on its `ngModule`.\n            if (ngModule !== undefined) {\n                def = getInjectorDef(ngModule);\n            }\n            // If no definition was found, it might be from exports. Remove it.\n            if (def == null) {\n                return false;\n            }\n            // Add providers in the same way that @NgModule resolution did:\n            // First, include providers from any imports.\n            if (def.imports != null && !isDuplicate) {\n                // Before processing defType's imports, add it to the set of parents. This way, if it ends\n                // up deeply importing itself, this can be detected.\n                ngDevMode && parents.push(defType);\n                // Add it to the set of dedups. This way we can detect multiple imports of the same module\n                dedupStack.push(defType);\n                var importTypesWithProviders_1;\n                try {\n                    deepForEach(def.imports, function (imported) {\n                        if (_this.processInjectorType(imported, parents, dedupStack)) {\n                            if (importTypesWithProviders_1 === undefined)\n                                importTypesWithProviders_1 = [];\n                            // If the processed import is an injector type with providers, we store it in the\n                            // list of import types with providers, so that we can process those afterwards.\n                            importTypesWithProviders_1.push(imported);\n                        }\n                    });\n                }\n                finally {\n                    // Remove it from the parents set when finished.\n                    ngDevMode && parents.pop();\n                }\n                // Imports which are declared with providers (TypeWithProviders) need to be processed\n                // after all imported modules are processed. This is similar to how View Engine\n                // processes/merges module imports in the metadata resolver. See: FW-1349.\n                if (importTypesWithProviders_1 !== undefined) {\n                    var _loop_1 = function (i) {\n                        var _a = importTypesWithProviders_1[i], ngModule_1 = _a.ngModule, providers = _a.providers;\n                        deepForEach(providers, function (provider) { return _this.processProvider(provider, ngModule_1, providers || EMPTY_ARRAY); });\n                    };\n                    for (var i = 0; i < importTypesWithProviders_1.length; i++) {\n                        _loop_1(i);\n                    }\n                }\n            }\n            // Track the InjectorType and add a provider for it. It's important that this is done after the\n            // def's imports.\n            this.injectorDefTypes.add(defType);\n            var factory = getFactoryDef(defType) || (function () { return new defType(); });\n            this.records.set(defType, makeRecord(factory, NOT_YET));\n            // Next, include providers listed on the definition itself.\n            var defProviders = def.providers;\n            if (defProviders != null && !isDuplicate) {\n                var injectorType_1 = defOrWrappedDef;\n                deepForEach(defProviders, function (provider) { return _this.processProvider(provider, injectorType_1, defProviders); });\n            }\n            return (ngModule !== undefined &&\n                defOrWrappedDef.providers !== undefined);\n        };\n        /**\n         * Process a `SingleProvider` and add it.\n         */\n        R3Injector.prototype.processProvider = function (provider, ngModuleType, providers) {\n            // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n            // property.\n            provider = resolveForwardRef(provider);\n            var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n            // Construct a `Record` for the provider.\n            var record = providerToRecord(provider, ngModuleType, providers);\n            if (!isTypeProvider(provider) && provider.multi === true) {\n                // If the provider indicates that it's a multi-provider, process it specially.\n                // First check whether it's been defined already.\n                var multiRecord_1 = this.records.get(token);\n                if (multiRecord_1) {\n                    // It has. Throw a nice error if\n                    if (ngDevMode && multiRecord_1.multi === undefined) {\n                        throwMixedMultiProviderError();\n                    }\n                }\n                else {\n                    multiRecord_1 = makeRecord(undefined, NOT_YET, true);\n                    multiRecord_1.factory = function () { return injectArgs(multiRecord_1.multi); };\n                    this.records.set(token, multiRecord_1);\n                }\n                token = provider;\n                multiRecord_1.multi.push(provider);\n            }\n            else {\n                var existing = this.records.get(token);\n                if (ngDevMode && existing && existing.multi !== undefined) {\n                    throwMixedMultiProviderError();\n                }\n            }\n            this.records.set(token, record);\n        };\n        R3Injector.prototype.hydrate = function (token, record) {\n            if (ngDevMode && record.value === CIRCULAR) {\n                throwCyclicDependencyError(stringify(token));\n            }\n            else if (record.value === NOT_YET) {\n                record.value = CIRCULAR;\n                record.value = record.factory();\n            }\n            if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n                this.onDestroy.add(record.value);\n            }\n            return record.value;\n        };\n        R3Injector.prototype.injectableDefInScope = function (def) {\n            if (!def.providedIn) {\n                return false;\n            }\n            var providedIn = resolveForwardRef(def.providedIn);\n            if (typeof providedIn === 'string') {\n                return providedIn === 'any' || (providedIn === this.scope);\n            }\n            else {\n                return this.injectorDefTypes.has(providedIn);\n            }\n        };\n        return R3Injector;\n    }());\n    function injectableDefOrInjectorDefFactory(token) {\n        // Most tokens will have an injectable def directly on them, which specifies a factory directly.\n        var injectableDef = getInjectableDef(token);\n        var factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);\n        if (factory !== null) {\n            return factory;\n        }\n        // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.\n        // If it's missing that, it's an error.\n        if (token instanceof InjectionToken) {\n            throw new Error(\"Token \" + stringify(token) + \" is missing a \\u0275prov definition.\");\n        }\n        // Undecorated types can sometimes be created if they have no constructor arguments.\n        if (token instanceof Function) {\n            return getUndecoratedInjectableFactory(token);\n        }\n        // There was no way to resolve a factory for this token.\n        throw new Error('unreachable');\n    }\n    function getUndecoratedInjectableFactory(token) {\n        // If the token has parameters then it has dependencies that we cannot resolve implicitly.\n        var paramLength = token.length;\n        if (paramLength > 0) {\n            var args = newArray(paramLength, '?');\n            throw new Error(\"Can't resolve all parameters for \" + stringify(token) + \": (\" + args.join(', ') + \").\");\n        }\n        // The constructor function appears to have no parameters.\n        // This might be because it inherits from a super-class. In which case, use an injectable\n        // def from an ancestor if there is one.\n        // Otherwise this really is a simple class with no dependencies, so return a factory that\n        // just instantiates the zero-arg constructor.\n        var inheritedInjectableDef = getInheritedInjectableDef(token);\n        if (inheritedInjectableDef !== null) {\n            return function () { return inheritedInjectableDef.factory(token); };\n        }\n        else {\n            return function () { return new token(); };\n        }\n    }\n    function providerToRecord(provider, ngModuleType, providers) {\n        if (isValueProvider(provider)) {\n            return makeRecord(undefined, provider.useValue);\n        }\n        else {\n            var factory = providerToFactory(provider, ngModuleType, providers);\n            return makeRecord(factory, NOT_YET);\n        }\n    }\n    /**\n     * Converts a `SingleProvider` into a factory function.\n     *\n     * @param provider provider to convert to factory\n     */\n    function providerToFactory(provider, ngModuleType, providers) {\n        var factory = undefined;\n        if (isTypeProvider(provider)) {\n            var unwrappedProvider = resolveForwardRef(provider);\n            return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n        }\n        else {\n            if (isValueProvider(provider)) {\n                factory = function () { return resolveForwardRef(provider.useValue); };\n            }\n            else if (isFactoryProvider(provider)) {\n                factory = function () { return provider.useFactory.apply(provider, __spreadArray([], __read(injectArgs(provider.deps || [])))); };\n            }\n            else if (isExistingProvider(provider)) {\n                factory = function () { return ɵɵinject(resolveForwardRef(provider.useExisting)); };\n            }\n            else {\n                var classRef_1 = resolveForwardRef(provider &&\n                    (provider.useClass || provider.provide));\n                if (ngDevMode && !classRef_1) {\n                    throwInvalidProviderError(ngModuleType, providers, provider);\n                }\n                if (hasDeps(provider)) {\n                    factory = function () { return new ((classRef_1).bind.apply((classRef_1), __spreadArray([void 0], __read(injectArgs(provider.deps)))))(); };\n                }\n                else {\n                    return getFactoryDef(classRef_1) || injectableDefOrInjectorDefFactory(classRef_1);\n                }\n            }\n        }\n        return factory;\n    }\n    function makeRecord(factory, value, multi) {\n        if (multi === void 0) { multi = false; }\n        return {\n            factory: factory,\n            value: value,\n            multi: multi ? [] : undefined,\n        };\n    }\n    function isValueProvider(value) {\n        return value !== null && typeof value == 'object' && USE_VALUE in value;\n    }\n    function isExistingProvider(value) {\n        return !!(value && value.useExisting);\n    }\n    function isFactoryProvider(value) {\n        return !!(value && value.useFactory);\n    }\n    function isTypeProvider(value) {\n        return typeof value === 'function';\n    }\n    function isClassProvider(value) {\n        return !!value.useClass;\n    }\n    function hasDeps(value) {\n        return !!value.deps;\n    }\n    function hasOnDestroy(value) {\n        return value !== null && typeof value === 'object' &&\n            typeof value.ngOnDestroy === 'function';\n    }\n    function couldBeInjectableType(value) {\n        return (typeof value === 'function') ||\n            (typeof value === 'object' && value instanceof InjectionToken);\n    }\n\n    function INJECTOR_IMPL__PRE_R3__(providers, parent, name) {\n        return new StaticInjector(providers, parent, name);\n    }\n    function INJECTOR_IMPL__POST_R3__(providers, parent, name) {\n        return createInjector({ name: name }, parent, providers, name);\n    }\n    var INJECTOR_IMPL = INJECTOR_IMPL__PRE_R3__;\n    /**\n     * Concrete injectors implement this interface. Injectors are configured\n     * with [providers](guide/glossary#provider) that associate\n     * dependencies of various types with [injection tokens](guide/glossary#di-token).\n     *\n     * @see [\"DI Providers\"](guide/dependency-injection-providers).\n     * @see `StaticProvider`\n     *\n     * @usageNotes\n     *\n     *  The following example creates a service injector instance.\n     *\n     * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n     *\n     * ### Usage example\n     *\n     * {@example core/di/ts/injector_spec.ts region='Injector'}\n     *\n     * `Injector` returns itself when given `Injector` as a token:\n     *\n     * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n     *\n     * @publicApi\n     */\n    var Injector = /** @class */ (function () {\n        function Injector() {\n        }\n        Injector.create = function (options, parent) {\n            if (Array.isArray(options)) {\n                return INJECTOR_IMPL(options, parent, '');\n            }\n            else {\n                return INJECTOR_IMPL(options.providers, options.parent, options.name || '');\n            }\n        };\n        return Injector;\n    }());\n    Injector.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;\n    Injector.NULL = new NullInjector();\n    /** @nocollapse */\n    Injector.ɵprov = ɵɵdefineInjectable({\n        token: Injector,\n        providedIn: 'any',\n        factory: function () { return ɵɵinject(INJECTOR$1); },\n    });\n    /**\n     * @internal\n     * @nocollapse\n     */\n    Injector.__NG_ELEMENT_ID__ = -1 /* Injector */;\n    var IDENT = function (value) {\n        return value;\n    };\n    var ɵ0$6 = IDENT;\n    var EMPTY = [];\n    var CIRCULAR$1 = IDENT;\n    var MULTI_PROVIDER_FN = function () {\n        return Array.prototype.slice.call(arguments);\n    };\n    var ɵ1$1 = MULTI_PROVIDER_FN;\n    var NO_NEW_LINE$1 = 'ɵ';\n    var StaticInjector = /** @class */ (function () {\n        function StaticInjector(providers, parent, source) {\n            if (parent === void 0) { parent = Injector.NULL; }\n            if (source === void 0) { source = null; }\n            this.parent = parent;\n            this.source = source;\n            var records = this._records = new Map();\n            records.set(Injector, { token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false });\n            records.set(INJECTOR$1, { token: INJECTOR$1, fn: IDENT, deps: EMPTY, value: this, useNew: false });\n            this.scope = recursivelyProcessProviders(records, providers);\n        }\n        StaticInjector.prototype.get = function (token, notFoundValue, flags) {\n            if (flags === void 0) { flags = exports.InjectFlags.Default; }\n            var records = this._records;\n            var record = records.get(token);\n            if (record === undefined) {\n                // This means we have never seen this record, see if it is tree shakable provider.\n                var injectableDef = getInjectableDef(token);\n                if (injectableDef) {\n                    var providedIn = injectableDef && resolveForwardRef(injectableDef.providedIn);\n                    if (providedIn === 'any' || providedIn != null && providedIn === this.scope) {\n                        records.set(token, record = resolveProvider({ provide: token, useFactory: injectableDef.factory, deps: EMPTY }));\n                    }\n                }\n                if (record === undefined) {\n                    // Set record to null to make sure that we don't go through expensive lookup above again.\n                    records.set(token, null);\n                }\n            }\n            var lastInjector = setCurrentInjector(this);\n            try {\n                return tryResolveToken(token, record, records, this.parent, notFoundValue, flags);\n            }\n            catch (e) {\n                return catchInjectorError(e, token, 'StaticInjectorError', this.source);\n            }\n            finally {\n                setCurrentInjector(lastInjector);\n            }\n        };\n        StaticInjector.prototype.toString = function () {\n            var tokens = [], records = this._records;\n            records.forEach(function (v, token) { return tokens.push(stringify(token)); });\n            return \"StaticInjector[\" + tokens.join(', ') + \"]\";\n        };\n        return StaticInjector;\n    }());\n    function resolveProvider(provider) {\n        var deps = computeDeps(provider);\n        var fn = IDENT;\n        var value = EMPTY;\n        var useNew = false;\n        var provide = resolveForwardRef(provider.provide);\n        if (USE_VALUE in provider) {\n            // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.\n            value = provider.useValue;\n        }\n        else if (provider.useFactory) {\n            fn = provider.useFactory;\n        }\n        else if (provider.useExisting) {\n            // Just use IDENT\n        }\n        else if (provider.useClass) {\n            useNew = true;\n            fn = resolveForwardRef(provider.useClass);\n        }\n        else if (typeof provide == 'function') {\n            useNew = true;\n            fn = provide;\n        }\n        else {\n            throw staticError('StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable', provider);\n        }\n        return { deps: deps, fn: fn, useNew: useNew, value: value };\n    }\n    function multiProviderMixError(token) {\n        return staticError('Cannot mix multi providers and regular providers', token);\n    }\n    function recursivelyProcessProviders(records, provider) {\n        var scope = null;\n        if (provider) {\n            provider = resolveForwardRef(provider);\n            if (Array.isArray(provider)) {\n                // if we have an array recurse into the array\n                for (var i = 0; i < provider.length; i++) {\n                    scope = recursivelyProcessProviders(records, provider[i]) || scope;\n                }\n            }\n            else if (typeof provider === 'function') {\n                // Functions were supported in ReflectiveInjector, but are not here. For safety give useful\n                // error messages\n                throw staticError('Function/Class not supported', provider);\n            }\n            else if (provider && typeof provider === 'object' && provider.provide) {\n                // At this point we have what looks like a provider: {provide: ?, ....}\n                var token = resolveForwardRef(provider.provide);\n                var resolvedProvider = resolveProvider(provider);\n                if (provider.multi === true) {\n                    // This is a multi provider.\n                    var multiProvider = records.get(token);\n                    if (multiProvider) {\n                        if (multiProvider.fn !== MULTI_PROVIDER_FN) {\n                            throw multiProviderMixError(token);\n                        }\n                    }\n                    else {\n                        // Create a placeholder factory which will look up the constituents of the multi provider.\n                        records.set(token, multiProvider = {\n                            token: provider.provide,\n                            deps: [],\n                            useNew: false,\n                            fn: MULTI_PROVIDER_FN,\n                            value: EMPTY\n                        });\n                    }\n                    // Treat the provider as the token.\n                    token = provider;\n                    multiProvider.deps.push({ token: token, options: 6 /* Default */ });\n                }\n                var record = records.get(token);\n                if (record && record.fn == MULTI_PROVIDER_FN) {\n                    throw multiProviderMixError(token);\n                }\n                if (token === INJECTOR_SCOPE) {\n                    scope = resolvedProvider.value;\n                }\n                records.set(token, resolvedProvider);\n            }\n            else {\n                throw staticError('Unexpected provider', provider);\n            }\n        }\n        return scope;\n    }\n    function tryResolveToken(token, record, records, parent, notFoundValue, flags) {\n        try {\n            return resolveToken(token, record, records, parent, notFoundValue, flags);\n        }\n        catch (e) {\n            // ensure that 'e' is of type Error.\n            if (!(e instanceof Error)) {\n                e = new Error(e);\n            }\n            var path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n            path.unshift(token);\n            if (record && record.value == CIRCULAR$1) {\n                // Reset the Circular flag.\n                record.value = EMPTY;\n            }\n            throw e;\n        }\n    }\n    function resolveToken(token, record, records, parent, notFoundValue, flags) {\n        var value;\n        if (record && !(flags & exports.InjectFlags.SkipSelf)) {\n            // If we don't have a record, this implies that we don't own the provider hence don't know how\n            // to resolve it.\n            value = record.value;\n            if (value == CIRCULAR$1) {\n                throw Error(NO_NEW_LINE$1 + 'Circular dependency');\n            }\n            else if (value === EMPTY) {\n                record.value = CIRCULAR$1;\n                var obj = undefined;\n                var useNew = record.useNew;\n                var fn = record.fn;\n                var depRecords = record.deps;\n                var deps = EMPTY;\n                if (depRecords.length) {\n                    deps = [];\n                    for (var i = 0; i < depRecords.length; i++) {\n                        var depRecord = depRecords[i];\n                        var options = depRecord.options;\n                        var childRecord = options & 2 /* CheckSelf */ ? records.get(depRecord.token) : undefined;\n                        deps.push(tryResolveToken(\n                        // Current Token to resolve\n                        depRecord.token, \n                        // A record which describes how to resolve the token.\n                        // If undefined, this means we don't have such a record\n                        childRecord, \n                        // Other records we know about.\n                        records, \n                        // If we don't know how to resolve dependency and we should not check parent for it,\n                        // than pass in Null injector.\n                        !childRecord && !(options & 4 /* CheckParent */) ? Injector.NULL : parent, options & 1 /* Optional */ ? null : Injector.THROW_IF_NOT_FOUND, exports.InjectFlags.Default));\n                    }\n                }\n                record.value = value = useNew ? new (fn.bind.apply(fn, __spreadArray([void 0], __read(deps))))() : fn.apply(obj, deps);\n            }\n        }\n        else if (!(flags & exports.InjectFlags.Self)) {\n            value = parent.get(token, notFoundValue, exports.InjectFlags.Default);\n        }\n        else if (!(flags & exports.InjectFlags.Optional)) {\n            value = Injector.NULL.get(token, notFoundValue);\n        }\n        else {\n            value = Injector.NULL.get(token, typeof notFoundValue !== 'undefined' ? notFoundValue : null);\n        }\n        return value;\n    }\n    function computeDeps(provider) {\n        var deps = EMPTY;\n        var providerDeps = provider.deps;\n        if (providerDeps && providerDeps.length) {\n            deps = [];\n            for (var i = 0; i < providerDeps.length; i++) {\n                var options = 6 /* Default */;\n                var token = resolveForwardRef(providerDeps[i]);\n                if (Array.isArray(token)) {\n                    for (var j = 0, annotations = token; j < annotations.length; j++) {\n                        var annotation = annotations[j];\n                        if (annotation instanceof Optional || annotation == Optional) {\n                            options = options | 1 /* Optional */;\n                        }\n                        else if (annotation instanceof SkipSelf || annotation == SkipSelf) {\n                            options = options & ~2 /* CheckSelf */;\n                        }\n                        else if (annotation instanceof Self || annotation == Self) {\n                            options = options & ~4 /* CheckParent */;\n                        }\n                        else if (annotation instanceof Inject) {\n                            token = annotation.token;\n                        }\n                        else {\n                            token = resolveForwardRef(annotation);\n                        }\n                    }\n                }\n                deps.push({ token: token, options: options });\n            }\n        }\n        else if (provider.useExisting) {\n            var token = resolveForwardRef(provider.useExisting);\n            deps = [{ token: token, options: 6 /* Default */ }];\n        }\n        else if (!providerDeps && !(USE_VALUE in provider)) {\n            // useValue & useExisting are the only ones which are exempt from deps all others need it.\n            throw staticError('\\'deps\\' required', provider);\n        }\n        return deps;\n    }\n    function staticError(text, obj) {\n        return new Error(formatError(text, obj, 'StaticInjectorError'));\n    }\n\n    /**\n     * Retrieves the component instance associated with a given DOM element.\n     *\n     * @usageNotes\n     * Given the following DOM structure:\n     *\n     * ```html\n     * <app-root>\n     *   <div>\n     *     <child-comp></child-comp>\n     *   </div>\n     * </app-root>\n     * ```\n     *\n     * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`\n     * associated with this DOM element.\n     *\n     * Calling the function on `<app-root>` will return the `MyApp` instance.\n     *\n     *\n     * @param element DOM element from which the component should be retrieved.\n     * @returns Component instance associated with the element or `null` if there\n     *    is no component associated with it.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getComponent(element) {\n        assertDomElement(element);\n        var context = getLContext(element);\n        if (context === null)\n            return null;\n        if (context.component === undefined) {\n            context.component = getComponentAtNodeIndex(context.nodeIndex, context.lView);\n        }\n        return context.component;\n    }\n    /**\n     * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded\n     * view that the element is part of. Otherwise retrieves the instance of the component whose view\n     * owns the element (in this case, the result is the same as calling `getOwningComponent`).\n     *\n     * @param element Element for which to get the surrounding component instance.\n     * @returns Instance of the component that is around the element or null if the element isn't\n     *    inside any component.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getContext(element) {\n        assertDomElement(element);\n        var context = getLContext(element);\n        return context === null ? null : context.lView[CONTEXT];\n    }\n    /**\n     * Retrieves the component instance whose view contains the DOM element.\n     *\n     * For example, if `<child-comp>` is used in the template of `<app-comp>`\n     * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`\n     * would return `<app-comp>`.\n     *\n     * @param elementOrDir DOM element, component or directive instance\n     *    for which to retrieve the root components.\n     * @returns Component instance whose view owns the DOM element or null if the element is not\n     *    part of a component view.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getOwningComponent(elementOrDir) {\n        var context = getLContext(elementOrDir);\n        if (context === null)\n            return null;\n        var lView = context.lView;\n        var parent;\n        ngDevMode && assertLView(lView);\n        while (lView[TVIEW].type === 2 /* Embedded */ && (parent = getLViewParent(lView))) {\n            lView = parent;\n        }\n        return lView[FLAGS] & 512 /* IsRoot */ ? null : lView[CONTEXT];\n    }\n    /**\n     * Retrieves all root components associated with a DOM element, directive or component instance.\n     * Root components are those which have been bootstrapped by Angular.\n     *\n     * @param elementOrDir DOM element, component or directive instance\n     *    for which to retrieve the root components.\n     * @returns Root components associated with the target object.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getRootComponents(elementOrDir) {\n        return __spreadArray([], __read(getRootContext(elementOrDir).components));\n    }\n    /**\n     * Retrieves an `Injector` associated with an element, component or directive instance.\n     *\n     * @param elementOrDir DOM element, component or directive instance for which to\n     *    retrieve the injector.\n     * @returns Injector associated with the element, component or directive instance.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getInjector(elementOrDir) {\n        var context = getLContext(elementOrDir);\n        if (context === null)\n            return Injector.NULL;\n        var tNode = context.lView[TVIEW].data[context.nodeIndex];\n        return new NodeInjector(tNode, context.lView);\n    }\n    /**\n     * Retrieve a set of injection tokens at a given DOM node.\n     *\n     * @param element Element for which the injection tokens should be retrieved.\n     */\n    function getInjectionTokens(element) {\n        var context = getLContext(element);\n        if (context === null)\n            return [];\n        var lView = context.lView;\n        var tView = lView[TVIEW];\n        var tNode = tView.data[context.nodeIndex];\n        var providerTokens = [];\n        var startIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;\n        var endIndex = tNode.directiveEnd;\n        for (var i = startIndex; i < endIndex; i++) {\n            var value = tView.data[i];\n            if (isDirectiveDefHack(value)) {\n                // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n                // design flaw.  We should always store same type so that we can be monomorphic. The issue\n                // is that for Components/Directives we store the def instead the type. The correct behavior\n                // is that we should always be storing injectable type in this location.\n                value = value.type;\n            }\n            providerTokens.push(value);\n        }\n        return providerTokens;\n    }\n    /**\n     * Retrieves directive instances associated with a given DOM node. Does not include\n     * component instances.\n     *\n     * @usageNotes\n     * Given the following DOM structure:\n     *\n     * ```html\n     * <app-root>\n     *   <button my-button></button>\n     *   <my-comp></my-comp>\n     * </app-root>\n     * ```\n     *\n     * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`\n     * directive that is associated with the DOM node.\n     *\n     * Calling `getDirectives` on `<my-comp>` will return an empty array.\n     *\n     * @param node DOM node for which to get the directives.\n     * @returns Array of directives associated with the node.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getDirectives(node) {\n        // Skip text nodes because we can't have directives associated with them.\n        if (node instanceof Text) {\n            return [];\n        }\n        var context = getLContext(node);\n        if (context === null) {\n            return [];\n        }\n        var lView = context.lView;\n        var tView = lView[TVIEW];\n        var nodeIndex = context.nodeIndex;\n        if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {\n            return [];\n        }\n        if (context.directives === undefined) {\n            context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);\n        }\n        // The `directives` in this case are a named array called `LComponentView`. Clone the\n        // result so we don't expose an internal data structure in the user's console.\n        return context.directives === null ? [] : __spreadArray([], __read(context.directives));\n    }\n    /**\n     * Returns the debug (partial) metadata for a particular directive or component instance.\n     * The function accepts an instance of a directive or component and returns the corresponding\n     * metadata.\n     *\n     * @param directiveOrComponentInstance Instance of a directive or component\n     * @returns metadata of the passed directive or component\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getDirectiveMetadata(directiveOrComponentInstance) {\n        var constructor = directiveOrComponentInstance.constructor;\n        if (!constructor) {\n            throw new Error('Unable to find the instance constructor');\n        }\n        // In case a component inherits from a directive, we may have component and directive metadata\n        // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.\n        var componentDef = getComponentDef(constructor);\n        if (componentDef) {\n            return {\n                inputs: componentDef.inputs,\n                outputs: componentDef.outputs,\n                encapsulation: componentDef.encapsulation,\n                changeDetection: componentDef.onPush ? exports.ChangeDetectionStrategy.OnPush :\n                    exports.ChangeDetectionStrategy.Default\n            };\n        }\n        var directiveDef = getDirectiveDef(constructor);\n        if (directiveDef) {\n            return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };\n        }\n        return null;\n    }\n    /**\n     * Retrieve map of local references.\n     *\n     * The references are retrieved as a map of local reference name to element or directive instance.\n     *\n     * @param target DOM element, component or directive instance for which to retrieve\n     *    the local references.\n     */\n    function getLocalRefs(target) {\n        var context = getLContext(target);\n        if (context === null)\n            return {};\n        if (context.localRefs === undefined) {\n            context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n        }\n        return context.localRefs || {};\n    }\n    /**\n     * Retrieves the host element of a component or directive instance.\n     * The host element is the DOM element that matched the selector of the directive.\n     *\n     * @param componentOrDirective Component or directive instance for which the host\n     *     element should be retrieved.\n     * @returns Host element of the target.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getHostElement(componentOrDirective) {\n        return getLContext(componentOrDirective).native;\n    }\n    /**\n     * Retrieves the rendered text for a given component.\n     *\n     * This function retrieves the host element of a component and\n     * and then returns the `textContent` for that element. This implies\n     * that the text returned will include re-projected content of\n     * the component as well.\n     *\n     * @param component The component to return the content text for.\n     */\n    function getRenderedText(component) {\n        var hostElement = getHostElement(component);\n        return hostElement.textContent || '';\n    }\n    /**\n     * Retrieves a list of event listeners associated with a DOM element. The list does include host\n     * listeners, but it does not include event listeners defined outside of the Angular context\n     * (e.g. through `addEventListener`).\n     *\n     * @usageNotes\n     * Given the following DOM structure:\n     *\n     * ```html\n     * <app-root>\n     *   <div (click)=\"doSomething()\"></div>\n     * </app-root>\n     * ```\n     *\n     * Calling `getListeners` on `<div>` will return an object that looks as follows:\n     *\n     * ```ts\n     * {\n     *   name: 'click',\n     *   element: <div>,\n     *   callback: () => doSomething(),\n     *   useCapture: false\n     * }\n     * ```\n     *\n     * @param element Element for which the DOM listeners should be retrieved.\n     * @returns Array of event listeners on the DOM element.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function getListeners(element) {\n        assertDomElement(element);\n        var lContext = getLContext(element);\n        if (lContext === null)\n            return [];\n        var lView = lContext.lView;\n        var tView = lView[TVIEW];\n        var lCleanup = lView[CLEANUP];\n        var tCleanup = tView.cleanup;\n        var listeners = [];\n        if (tCleanup && lCleanup) {\n            for (var i = 0; i < tCleanup.length;) {\n                var firstParam = tCleanup[i++];\n                var secondParam = tCleanup[i++];\n                if (typeof firstParam === 'string') {\n                    var name = firstParam;\n                    var listenerElement = unwrapRNode(lView[secondParam]);\n                    var callback = lCleanup[tCleanup[i++]];\n                    var useCaptureOrIndx = tCleanup[i++];\n                    // if useCaptureOrIndx is boolean then report it as is.\n                    // if useCaptureOrIndx is positive number then it in unsubscribe method\n                    // if useCaptureOrIndx is negative number then it is a Subscription\n                    var type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';\n                    var useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;\n                    if (element == listenerElement) {\n                        listeners.push({ element: element, name: name, callback: callback, useCapture: useCapture, type: type });\n                    }\n                }\n            }\n        }\n        listeners.sort(sortListeners);\n        return listeners;\n    }\n    function sortListeners(a, b) {\n        if (a.name == b.name)\n            return 0;\n        return a.name < b.name ? -1 : 1;\n    }\n    /**\n     * This function should not exist because it is megamorphic and only mostly correct.\n     *\n     * See call site for more info.\n     */\n    function isDirectiveDefHack(obj) {\n        return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;\n    }\n    /**\n     * Returns the attached `DebugNode` instance for an element in the DOM.\n     *\n     * @param element DOM element which is owned by an existing component's view.\n     */\n    function getDebugNode(element) {\n        if (ngDevMode && !(element instanceof Node)) {\n            throw new Error('Expecting instance of DOM Element');\n        }\n        var lContext = getLContext(element);\n        if (lContext === null) {\n            return null;\n        }\n        var lView = lContext.lView;\n        var nodeIndex = lContext.nodeIndex;\n        if (nodeIndex !== -1) {\n            var valueInLView = lView[nodeIndex];\n            // this means that value in the lView is a component with its own\n            // data. In this situation the TNode is not accessed at the same spot.\n            var tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);\n            ngDevMode &&\n                assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');\n            return buildDebugNode(tNode, lView);\n        }\n        return null;\n    }\n    /**\n     * Retrieve the component `LView` from component/element.\n     *\n     * NOTE: `LView` is a private and should not be leaked outside.\n     *       Don't export this method to `ng.*` on window.\n     *\n     * @param target DOM element or component instance for which to retrieve the LView.\n     */\n    function getComponentLView(target) {\n        var lContext = getLContext(target);\n        var nodeIndx = lContext.nodeIndex;\n        var lView = lContext.lView;\n        var componentLView = lView[nodeIndx];\n        ngDevMode && assertLView(componentLView);\n        return componentLView;\n    }\n    /** Asserts that a value is a DOM Element. */\n    function assertDomElement(value) {\n        if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n            throw new Error('Expecting instance of DOM Element');\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Marks a component for check (in case of OnPush components) and synchronously\n     * performs change detection on the application this component belongs to.\n     *\n     * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.\n     *\n     * @publicApi\n     * @globalApi ng\n     */\n    function applyChanges(component) {\n        markDirty(component);\n        getRootComponents(component).forEach(function (rootComponent) { return detectChanges(rootComponent); });\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This file introduces series of globally accessible debug tools\n     * to allow for the Angular debugging story to function.\n     *\n     * To see this in action run the following command:\n     *\n     *   bazel run --config=ivy\n     *   //packages/core/test/bundling/todo:devserver\n     *\n     *  Then load `localhost:5432` and start using the console tools.\n     */\n    /**\n     * This value reflects the property on the window where the dev\n     * tools are patched (window.ng).\n     * */\n    var GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\n    var _published = false;\n    /**\n     * Publishes a collection of default debug tools onto`window.ng`.\n     *\n     * These functions are available globally when Angular is in development\n     * mode and are automatically stripped away from prod mode is on.\n     */\n    function publishDefaultGlobalUtils() {\n        if (!_published) {\n            _published = true;\n            /**\n             * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n             * The contract of the function might be changed in any release and/or the function can be\n             * removed completely.\n             */\n            publishGlobalUtil('ɵsetProfiler', setProfiler);\n            publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata);\n            publishGlobalUtil('getComponent', getComponent);\n            publishGlobalUtil('getContext', getContext);\n            publishGlobalUtil('getListeners', getListeners);\n            publishGlobalUtil('getOwningComponent', getOwningComponent);\n            publishGlobalUtil('getHostElement', getHostElement);\n            publishGlobalUtil('getInjector', getInjector);\n            publishGlobalUtil('getRootComponents', getRootComponents);\n            publishGlobalUtil('getDirectives', getDirectives);\n            publishGlobalUtil('applyChanges', applyChanges);\n        }\n    }\n    /**\n     * Publishes the given function to `window.ng` so that it can be\n     * used from the browser console when an application is not in production.\n     */\n    function publishGlobalUtil(name, fn) {\n        if (typeof COMPILED === 'undefined' || !COMPILED) {\n            // Note: we can't export `ng` when using closure enhanced optimization as:\n            // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n            // - we can't declare a closure extern as the namespace `ng` is already used within Google\n            //   for typings for AngularJS (via `goog.provide('ng....')`).\n            var w = _global;\n            ngDevMode && assertDefined(fn, 'function not defined');\n            if (w) {\n                var container = w[GLOBAL_PUBLISH_EXPANDO_KEY];\n                if (!container) {\n                    container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};\n                }\n                container[name] = fn;\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$7 = function (token, notFoundValue) {\n        throwProviderNotFoundError(token, 'NullInjector');\n    };\n    // TODO: A hack to not pull in the NullInjector from @angular/core.\n    var NULL_INJECTOR$1 = {\n        get: ɵ0$7\n    };\n    /**\n     * Bootstraps a Component into an existing host element and returns an instance\n     * of the component.\n     *\n     * Use this function to bootstrap a component into the DOM tree. Each invocation\n     * of this function will create a separate tree of components, injectors and\n     * change detection cycles and lifetimes. To dynamically insert a new component\n     * into an existing tree such that it shares the same injection, change detection\n     * and object lifetime, use {@link ViewContainer#createComponent}.\n     *\n     * @param componentType Component to bootstrap\n     * @param options Optional parameters which control bootstrapping\n     */\n    function renderComponent$1(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts) {\n        if (opts === void 0) { opts = {}; }\n        ngDevMode && publishDefaultGlobalUtils();\n        ngDevMode && assertComponentType(componentType);\n        var rendererFactory = opts.rendererFactory || domRendererFactory3;\n        var sanitizer = opts.sanitizer || null;\n        var componentDef = getComponentDef(componentType);\n        if (componentDef.type != componentType)\n            componentDef.type = componentType;\n        // The first index of the first selector is the tag name.\n        var componentTag = componentDef.selectors[0][0];\n        var hostRenderer = rendererFactory.createRenderer(null, null);\n        var hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);\n        var rootFlags = componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :\n            16 /* CheckAlways */ | 512 /* IsRoot */;\n        var rootContext = createRootContext(opts.scheduler, opts.playerHandler);\n        var renderer = rendererFactory.createRenderer(hostRNode, componentDef);\n        var rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);\n        var rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null);\n        enterView(rootView);\n        var component;\n        try {\n            if (rendererFactory.begin)\n                rendererFactory.begin();\n            var componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);\n            component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);\n            // create mode pass\n            renderView(rootTView, rootView, null);\n            // update mode pass\n            refreshView(rootTView, rootView, null, null);\n        }\n        finally {\n            leaveView();\n            if (rendererFactory.end)\n                rendererFactory.end();\n        }\n        return component;\n    }\n    /**\n     * Creates the root component view and the root component node.\n     *\n     * @param rNode Render host element.\n     * @param def ComponentDef\n     * @param rootView The parent view where the host node is stored\n     * @param rendererFactory Factory to be used for creating child renderers.\n     * @param hostRenderer The current renderer\n     * @param sanitizer The sanitizer, if provided\n     *\n     * @returns Component view created\n     */\n    function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {\n        var tView = rootView[TVIEW];\n        var index = HEADER_OFFSET;\n        ngDevMode && assertIndexInRange(rootView, index);\n        rootView[index] = rNode;\n        // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at\n        // the same time we want to communicate the debug `TNode` that this is a special `TNode`\n        // representing a host element.\n        var tNode = getOrCreateTNode(tView, index, 2 /* Element */, '#host', null);\n        var mergedAttrs = tNode.mergedAttrs = def.hostAttrs;\n        if (mergedAttrs !== null) {\n            computeStaticStyling(tNode, mergedAttrs, true);\n            if (rNode !== null) {\n                setUpAttributes(hostRenderer, rNode, mergedAttrs);\n                if (tNode.classes !== null) {\n                    writeDirectClass(hostRenderer, rNode, tNode.classes);\n                }\n                if (tNode.styles !== null) {\n                    writeDirectStyle(hostRenderer, rNode, tNode.styles);\n                }\n            }\n        }\n        var viewRenderer = rendererFactory.createRenderer(rNode, def);\n        var componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null);\n        if (tView.firstCreatePass) {\n            diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);\n            markAsComponentHost(tView, tNode);\n            initTNodeFlags(tNode, rootView.length, 1);\n        }\n        addToViewTree(rootView, componentView);\n        // Store component view at node index, with node as the HOST\n        return rootView[index] = componentView;\n    }\n    /**\n     * Creates a root component and sets it up with features and host bindings. Shared by\n     * renderComponent() and ViewContainerRef.createComponent().\n     */\n    function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {\n        var tView = rootLView[TVIEW];\n        // Create directive instance with factory() and store at next index in viewData\n        var component = instantiateRootComponent(tView, rootLView, componentDef);\n        rootContext.components.push(component);\n        componentView[CONTEXT] = component;\n        hostFeatures && hostFeatures.forEach(function (feature) { return feature(component, componentDef); });\n        // We want to generate an empty QueryList for root content queries for backwards\n        // compatibility with ViewEngine.\n        if (componentDef.contentQueries) {\n            var tNode = getCurrentTNode();\n            ngDevMode && assertDefined(tNode, 'TNode expected');\n            componentDef.contentQueries(1 /* Create */, component, tNode.directiveStart);\n        }\n        var rootTNode = getCurrentTNode();\n        ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');\n        if (tView.firstCreatePass &&\n            (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {\n            setSelectedIndex(rootTNode.index);\n            var rootTView = rootLView[TVIEW];\n            registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);\n            invokeHostBindingsInCreationMode(componentDef, component);\n        }\n        return component;\n    }\n    function createRootContext(scheduler, playerHandler) {\n        return {\n            components: [],\n            scheduler: scheduler || defaultScheduler,\n            clean: CLEAN_PROMISE,\n            playerHandler: playerHandler || null,\n            flags: 0 /* Empty */\n        };\n    }\n    /**\n     * Used to enable lifecycle hooks on the root component.\n     *\n     * Include this feature when calling `renderComponent` if the root component\n     * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n     * be called properly.\n     *\n     * Example:\n     *\n     * ```\n     * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});\n     * ```\n     */\n    function LifecycleHooksFeature(component, def) {\n        var lView = readPatchedLView(component);\n        ngDevMode && assertDefined(lView, 'LView is required');\n        var tView = lView[TVIEW];\n        var tNode = getCurrentTNode();\n        ngDevMode && assertDefined(tNode, 'TNode is required');\n        registerPostOrderHooks(tView, tNode);\n    }\n    /**\n     * Wait on component until it is rendered.\n     *\n     * This function returns a `Promise` which is resolved when the component's\n     * change detection is executed. This is determined by finding the scheduler\n     * associated with the `component`'s render tree and waiting until the scheduler\n     * flushes. If nothing is scheduled, the function returns a resolved promise.\n     *\n     * Example:\n     * ```\n     * await whenRendered(myComponent);\n     * ```\n     *\n     * @param component Component to wait upon\n     * @returns Promise which resolves when the component is rendered.\n     */\n    function whenRendered(component) {\n        return getRootContext(component).clean;\n    }\n\n    /**\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://angular.io/license\n     */\n    function getSuperType(type) {\n        return Object.getPrototypeOf(type.prototype).constructor;\n    }\n    /**\n     * Merges the definition from a super class to a sub class.\n     * @param definition The definition that is a SubClass of another directive of component\n     *\n     * @codeGenApi\n     */\n    function ɵɵInheritDefinitionFeature(definition) {\n        var superType = getSuperType(definition.type);\n        var shouldInheritFields = true;\n        var inheritanceChain = [definition];\n        while (superType) {\n            var superDef = undefined;\n            if (isComponentDef(definition)) {\n                // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n                superDef = superType.ɵcmp || superType.ɵdir;\n            }\n            else {\n                if (superType.ɵcmp) {\n                    throw new Error('Directives cannot inherit Components');\n                }\n                // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n                superDef = superType.ɵdir;\n            }\n            if (superDef) {\n                if (shouldInheritFields) {\n                    inheritanceChain.push(superDef);\n                    // Some fields in the definition may be empty, if there were no values to put in them that\n                    // would've justified object creation. Unwrap them if necessary.\n                    var writeableDef = definition;\n                    writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n                    writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n                    writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n                    // Merge hostBindings\n                    var superHostBindings = superDef.hostBindings;\n                    superHostBindings && inheritHostBindings(definition, superHostBindings);\n                    // Merge queries\n                    var superViewQuery = superDef.viewQuery;\n                    var superContentQueries = superDef.contentQueries;\n                    superViewQuery && inheritViewQuery(definition, superViewQuery);\n                    superContentQueries && inheritContentQueries(definition, superContentQueries);\n                    // Merge inputs and outputs\n                    fillProperties(definition.inputs, superDef.inputs);\n                    fillProperties(definition.declaredInputs, superDef.declaredInputs);\n                    fillProperties(definition.outputs, superDef.outputs);\n                    // Merge animations metadata.\n                    // If `superDef` is a Component, the `data` field is present (defaults to an empty object).\n                    if (isComponentDef(superDef) && superDef.data.animation) {\n                        // If super def is a Component, the `definition` is also a Component, since Directives can\n                        // not inherit Components (we throw an error above and cannot reach this code).\n                        var defData = definition.data;\n                        defData.animation = (defData.animation || []).concat(superDef.data.animation);\n                    }\n                }\n                // Run parent features\n                var features = superDef.features;\n                if (features) {\n                    for (var i = 0; i < features.length; i++) {\n                        var feature = features[i];\n                        if (feature && feature.ngInherit) {\n                            feature(definition);\n                        }\n                        // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this\n                        // def already has all the necessary information inherited from its super class(es), so we\n                        // can stop merging fields from super classes. However we need to iterate through the\n                        // prototype chain to look for classes that might contain other \"features\" (like\n                        // NgOnChanges), which we should invoke for the original `definition`. We set the\n                        // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance\n                        // logic and only invoking functions from the \"features\" list.\n                        if (feature === ɵɵInheritDefinitionFeature) {\n                            shouldInheritFields = false;\n                        }\n                    }\n                }\n            }\n            superType = Object.getPrototypeOf(superType);\n        }\n        mergeHostAttrsAcrossInheritance(inheritanceChain);\n    }\n    /**\n     * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.\n     *\n     * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing\n     * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child\n     * type.\n     */\n    function mergeHostAttrsAcrossInheritance(inheritanceChain) {\n        var hostVars = 0;\n        var hostAttrs = null;\n        // We process the inheritance order from the base to the leaves here.\n        for (var i = inheritanceChain.length - 1; i >= 0; i--) {\n            var def = inheritanceChain[i];\n            // For each `hostVars`, we need to add the superclass amount.\n            def.hostVars = (hostVars += def.hostVars);\n            // for each `hostAttrs` we need to merge it with superclass.\n            def.hostAttrs =\n                mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));\n        }\n    }\n    function maybeUnwrapEmpty(value) {\n        if (value === EMPTY_OBJ) {\n            return {};\n        }\n        else if (value === EMPTY_ARRAY) {\n            return [];\n        }\n        else {\n            return value;\n        }\n    }\n    function inheritViewQuery(definition, superViewQuery) {\n        var prevViewQuery = definition.viewQuery;\n        if (prevViewQuery) {\n            definition.viewQuery = function (rf, ctx) {\n                superViewQuery(rf, ctx);\n                prevViewQuery(rf, ctx);\n            };\n        }\n        else {\n            definition.viewQuery = superViewQuery;\n        }\n    }\n    function inheritContentQueries(definition, superContentQueries) {\n        var prevContentQueries = definition.contentQueries;\n        if (prevContentQueries) {\n            definition.contentQueries = function (rf, ctx, directiveIndex) {\n                superContentQueries(rf, ctx, directiveIndex);\n                prevContentQueries(rf, ctx, directiveIndex);\n            };\n        }\n        else {\n            definition.contentQueries = superContentQueries;\n        }\n    }\n    function inheritHostBindings(definition, superHostBindings) {\n        var prevHostBindings = definition.hostBindings;\n        if (prevHostBindings) {\n            definition.hostBindings = function (rf, ctx) {\n                superHostBindings(rf, ctx);\n                prevHostBindings(rf, ctx);\n            };\n        }\n        else {\n            definition.hostBindings = superHostBindings;\n        }\n    }\n\n    /**\n     * Fields which exist on either directive or component definitions, and need to be copied from\n     * parent to child classes by the `ɵɵCopyDefinitionFeature`.\n     */\n    var COPY_DIRECTIVE_FIELDS = [\n        // The child class should use the providers of its parent.\n        'providersResolver',\n        // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such\n        // as inputs, outputs, and host binding functions.\n    ];\n    /**\n     * Fields which exist only on component definitions, and need to be copied from parent to child\n     * classes by the `ɵɵCopyDefinitionFeature`.\n     *\n     * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,\n     * since those should go in `COPY_DIRECTIVE_FIELDS` above.\n     */\n    var COPY_COMPONENT_FIELDS = [\n        // The child class should use the template function of its parent, including all template\n        // semantics.\n        'template',\n        'decls',\n        'consts',\n        'vars',\n        'onPush',\n        'ngContentSelectors',\n        // The child class should use the CSS styles of its parent, including all styling semantics.\n        'styles',\n        'encapsulation',\n        // The child class should be checked by the runtime in the same way as its parent.\n        'schemas',\n    ];\n    /**\n     * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a\n     * definition.\n     *\n     * This exists primarily to support ngcc migration of an existing View Engine pattern, where an\n     * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it\n     * generates a skeleton definition on the child class, and applies this feature.\n     *\n     * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,\n     * including things like the component template function.\n     *\n     * @param definition The definition of a child class which inherits from a parent class with its\n     * own definition.\n     *\n     * @codeGenApi\n     */\n    function ɵɵCopyDefinitionFeature(definition) {\n        var e_1, _a, e_2, _b;\n        var superType = getSuperType(definition.type);\n        var superDef = undefined;\n        if (isComponentDef(definition)) {\n            // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n            superDef = superType.ɵcmp;\n        }\n        else {\n            // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n            superDef = superType.ɵdir;\n        }\n        // Needed because `definition` fields are readonly.\n        var defAny = definition;\n        try {\n            // Copy over any fields that apply to either directives or components.\n            for (var COPY_DIRECTIVE_FIELDS_1 = __values(COPY_DIRECTIVE_FIELDS), COPY_DIRECTIVE_FIELDS_1_1 = COPY_DIRECTIVE_FIELDS_1.next(); !COPY_DIRECTIVE_FIELDS_1_1.done; COPY_DIRECTIVE_FIELDS_1_1 = COPY_DIRECTIVE_FIELDS_1.next()) {\n                var field = COPY_DIRECTIVE_FIELDS_1_1.value;\n                defAny[field] = superDef[field];\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (COPY_DIRECTIVE_FIELDS_1_1 && !COPY_DIRECTIVE_FIELDS_1_1.done && (_a = COPY_DIRECTIVE_FIELDS_1.return)) _a.call(COPY_DIRECTIVE_FIELDS_1);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        if (isComponentDef(superDef)) {\n            try {\n                // Copy over any component-specific fields.\n                for (var COPY_COMPONENT_FIELDS_1 = __values(COPY_COMPONENT_FIELDS), COPY_COMPONENT_FIELDS_1_1 = COPY_COMPONENT_FIELDS_1.next(); !COPY_COMPONENT_FIELDS_1_1.done; COPY_COMPONENT_FIELDS_1_1 = COPY_COMPONENT_FIELDS_1.next()) {\n                    var field = COPY_COMPONENT_FIELDS_1_1.value;\n                    defAny[field] = superDef[field];\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (COPY_COMPONENT_FIELDS_1_1 && !COPY_COMPONENT_FIELDS_1_1.done && (_b = COPY_COMPONENT_FIELDS_1.return)) _b.call(COPY_COMPONENT_FIELDS_1);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var _symbolIterator = null;\n    function getSymbolIterator() {\n        if (!_symbolIterator) {\n            var Symbol = _global['Symbol'];\n            if (Symbol && Symbol.iterator) {\n                _symbolIterator = Symbol.iterator;\n            }\n            else {\n                // es6-shim specific logic\n                var keys = Object.getOwnPropertyNames(Map.prototype);\n                for (var i = 0; i < keys.length; ++i) {\n                    var key = keys[i];\n                    if (key !== 'entries' && key !== 'size' &&\n                        Map.prototype[key] === Map.prototype['entries']) {\n                        _symbolIterator = key;\n                    }\n                }\n            }\n        }\n        return _symbolIterator;\n    }\n\n    /**\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://angular.io/license\n     */\n    function devModeEqual(a, b) {\n        var isListLikeIterableA = isListLikeIterable(a);\n        var isListLikeIterableB = isListLikeIterable(b);\n        if (isListLikeIterableA && isListLikeIterableB) {\n            return areIterablesEqual(a, b, devModeEqual);\n        }\n        else {\n            var isAObject = a && (typeof a === 'object' || typeof a === 'function');\n            var isBObject = b && (typeof b === 'object' || typeof b === 'function');\n            if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n                return true;\n            }\n            else {\n                return Object.is(a, b);\n            }\n        }\n    }\n    /**\n     * Indicates that the result of a {@link Pipe} transformation has changed even though the\n     * reference has not changed.\n     *\n     * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value\n     * is stored.\n     *\n     * Example:\n     *\n     * ```\n     * if (this._latestValue === this._latestReturnedValue) {\n     *    return this._latestReturnedValue;\n     *  } else {\n     *    this._latestReturnedValue = this._latestValue;\n     *    return WrappedValue.wrap(this._latestValue); // this will force update\n     *  }\n     * ```\n     *\n     * @publicApi\n     * @deprecated from v10 stop using. (No replacement, deemed unnecessary.)\n     */\n    var WrappedValue = /** @class */ (function () {\n        function WrappedValue(value) {\n            this.wrapped = value;\n        }\n        /** Creates a wrapped value. */\n        WrappedValue.wrap = function (value) {\n            return new WrappedValue(value);\n        };\n        /**\n         * Returns the underlying value of a wrapped value.\n         * Returns the given `value` when it is not wrapped.\n         **/\n        WrappedValue.unwrap = function (value) {\n            return WrappedValue.isWrapped(value) ? value.wrapped : value;\n        };\n        /** Returns true if `value` is a wrapped value. */\n        WrappedValue.isWrapped = function (value) {\n            return value instanceof WrappedValue;\n        };\n        return WrappedValue;\n    }());\n    function isListLikeIterable(obj) {\n        if (!isJsObject(obj))\n            return false;\n        return Array.isArray(obj) ||\n            (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n                getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop\n    }\n    function areIterablesEqual(a, b, comparator) {\n        var iterator1 = a[getSymbolIterator()]();\n        var iterator2 = b[getSymbolIterator()]();\n        while (true) {\n            var item1 = iterator1.next();\n            var item2 = iterator2.next();\n            if (item1.done && item2.done)\n                return true;\n            if (item1.done || item2.done)\n                return false;\n            if (!comparator(item1.value, item2.value))\n                return false;\n        }\n    }\n    function iterateListLike(obj, fn) {\n        if (Array.isArray(obj)) {\n            for (var i = 0; i < obj.length; i++) {\n                fn(obj[i]);\n            }\n        }\n        else {\n            var iterator = obj[getSymbolIterator()]();\n            var item = void 0;\n            while (!((item = iterator.next()).done)) {\n                fn(item.value);\n            }\n        }\n    }\n    function isJsObject(o) {\n        return o !== null && (typeof o === 'function' || typeof o === 'object');\n    }\n\n    /**\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://angular.io/license\n     */\n    // TODO(misko): consider inlining\n    /** Updates binding and returns the value. */\n    function updateBinding(lView, bindingIndex, value) {\n        return lView[bindingIndex] = value;\n    }\n    /** Gets the current binding value. */\n    function getBinding(lView, bindingIndex) {\n        ngDevMode && assertIndexInRange(lView, bindingIndex);\n        ngDevMode &&\n            assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n        return lView[bindingIndex];\n    }\n    /**\n     * Updates binding if changed, then returns whether it was updated.\n     *\n     * This function also checks the `CheckNoChangesMode` and throws if changes are made.\n     * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE\n     * behavior.\n     *\n     * @param lView current `LView`\n     * @param bindingIndex The binding in the `LView` to check\n     * @param value New value to check against `lView[bindingIndex]`\n     * @returns `true` if the bindings has changed. (Throws if binding has changed during\n     *          `CheckNoChangesMode`)\n     */\n    function bindingUpdated(lView, bindingIndex, value) {\n        ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n        ngDevMode &&\n            assertLessThan(bindingIndex, lView.length, \"Slot should have been initialized to NO_CHANGE\");\n        var oldValue = lView[bindingIndex];\n        if (Object.is(oldValue, value)) {\n            return false;\n        }\n        else {\n            if (ngDevMode && isInCheckNoChangesMode()) {\n                // View engine didn't report undefined values as changed on the first checkNoChanges pass\n                // (before the change detection was run).\n                var oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n                if (!devModeEqual(oldValueToCompare, value)) {\n                    var details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n                    throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n                }\n                // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n                // For this reason we exit as if no change. The early exit is needed to prevent the changed\n                // value to be written into `LView` (If we would write the new value that we would not see it\n                // as change on next CD.)\n                return false;\n            }\n            lView[bindingIndex] = value;\n            return true;\n        }\n    }\n    /** Updates 2 bindings if changed, then returns whether either was updated. */\n    function bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n        var different = bindingUpdated(lView, bindingIndex, exp1);\n        return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n    }\n    /** Updates 3 bindings if changed, then returns whether any was updated. */\n    function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n        var different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n        return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n    }\n    /** Updates 4 bindings if changed, then returns whether any was updated. */\n    function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {\n        var different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n        return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Updates the value of or removes a bound attribute on an Element.\n     *\n     * Used in the case of `[attr.title]=\"value\"`\n     *\n     * @param name name The name of the attribute.\n     * @param value value The attribute is removed when value is `null` or `undefined`.\n     *                  Otherwise the attribute value is set to the stringified value.\n     * @param sanitizer An optional function used to sanitize the value.\n     * @param namespace Optional namespace to use when setting the attribute.\n     *\n     * @codeGenApi\n     */\n    function ɵɵattribute(name, value, sanitizer, namespace) {\n        var lView = getLView();\n        var bindingIndex = nextBindingIndex();\n        if (bindingUpdated(lView, bindingIndex, value)) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);\n            ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);\n        }\n        return ɵɵattribute;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Create interpolation bindings with a variable number of expressions.\n     *\n     * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n     * Those are faster because there is no need to create an array of expressions and iterate over it.\n     *\n     * `values`:\n     * - has static text at even indexes,\n     * - has evaluated expressions at odd indexes.\n     *\n     * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n     */\n    function interpolationV(lView, values) {\n        ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n        ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n        var isBindingUpdated = false;\n        var bindingIndex = getBindingIndex();\n        for (var i = 1; i < values.length; i += 2) {\n            // Check if bindings (odd indexes) have changed\n            isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;\n        }\n        setBindingIndex(bindingIndex);\n        if (!isBindingUpdated) {\n            return NO_CHANGE;\n        }\n        // Build the updated content\n        var content = values[0];\n        for (var i = 1; i < values.length; i += 2) {\n            content += renderStringify(values[i]) + values[i + 1];\n        }\n        return content;\n    }\n    /**\n     * Creates an interpolation binding with 1 expression.\n     *\n     * @param prefix static value used for concatenation only.\n     * @param v0 value checked for change.\n     * @param suffix static value used for concatenation only.\n     */\n    function interpolation1(lView, prefix, v0, suffix) {\n        var different = bindingUpdated(lView, nextBindingIndex(), v0);\n        return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;\n    }\n    /**\n     * Creates an interpolation binding with 2 expressions.\n     */\n    function interpolation2(lView, prefix, v0, i0, v1, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated2(lView, bindingIndex, v0, v1);\n        incrementBindingIndex(2);\n        return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;\n    }\n    /**\n     * Creates an interpolation binding with 3 expressions.\n     */\n    function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n        incrementBindingIndex(3);\n        return different ?\n            prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :\n            NO_CHANGE;\n    }\n    /**\n     * Create an interpolation binding with 4 expressions.\n     */\n    function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n        incrementBindingIndex(4);\n        return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n            renderStringify(v2) + i2 + renderStringify(v3) + suffix :\n            NO_CHANGE;\n    }\n    /**\n     * Creates an interpolation binding with 5 expressions.\n     */\n    function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n        different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n        incrementBindingIndex(5);\n        return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n            renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :\n            NO_CHANGE;\n    }\n    /**\n     * Creates an interpolation binding with 6 expressions.\n     */\n    function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n        different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n        incrementBindingIndex(6);\n        return different ?\n            prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +\n                renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :\n            NO_CHANGE;\n    }\n    /**\n     * Creates an interpolation binding with 7 expressions.\n     */\n    function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n        different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n        incrementBindingIndex(7);\n        return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n            renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +\n            renderStringify(v5) + i5 + renderStringify(v6) + suffix :\n            NO_CHANGE;\n    }\n    /**\n     * Creates an interpolation binding with 8 expressions.\n     */\n    function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n        var bindingIndex = getBindingIndex();\n        var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n        different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n        incrementBindingIndex(8);\n        return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n            renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +\n            renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :\n            NO_CHANGE;\n    }\n\n    /**\n     *\n     * Update an interpolated attribute on an element with single bound value surrounded by text.\n     *\n     * Used when the value passed to a property has 1 interpolated value in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);\n        }\n        return ɵɵattributeInterpolate1;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 2 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 2 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);\n        }\n        return ɵɵattributeInterpolate2;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 3 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 3 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate3(\n     * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n        }\n        return ɵɵattributeInterpolate3;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 4 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 4 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate4(\n     * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n        }\n        return ɵɵattributeInterpolate4;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 5 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 5 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate5(\n     * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n        }\n        return ɵɵattributeInterpolate5;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 6 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 6 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate6(\n     *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate6(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n        }\n        return ɵɵattributeInterpolate6;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 7 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 7 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate7(\n     *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate7(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);\n        }\n        return ɵɵattributeInterpolate7;\n    }\n    /**\n     *\n     * Update an interpolated attribute on an element with 8 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 8 interpolated values in it:\n     *\n     * ```html\n     * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolate8(\n     *  'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n     * ```\n     *\n     * @param attrName The name of the attribute to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param i6 Static value used for concatenation only.\n     * @param v7 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolate8(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n            ngDevMode &&\n                storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);\n        }\n        return ɵɵattributeInterpolate8;\n    }\n    /**\n     * Update an interpolated attribute on an element with 9 or more bound values surrounded by text.\n     *\n     * Used when the number of interpolated values exceeds 8.\n     *\n     * ```html\n     * <div\n     *  title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵattributeInterpolateV(\n     *  'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n     *  'suffix']);\n     * ```\n     *\n     * @param attrName The name of the attribute to update.\n     * @param values The collection of values and the strings in-between those values, beginning with\n     * a string prefix and ending with a string suffix.\n     * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {\n        var lView = getLView();\n        var interpolated = interpolationV(lView, values);\n        if (interpolated !== NO_CHANGE) {\n            var tNode = getSelectedTNode();\n            elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);\n            if (ngDevMode) {\n                var interpolationInBetween = [values[0]]; // prefix\n                for (var i = 2; i < values.length; i += 2) {\n                    interpolationInBetween.push(values[i]);\n                }\n                storePropertyBindingMetadata.apply(void 0, __spreadArray([getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - interpolationInBetween.length + 1], __read(interpolationInBetween)));\n            }\n        }\n        return ɵɵattributeInterpolateV;\n    }\n\n    /**\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://angular.io/license\n     */\n    function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) {\n        ngDevMode && assertFirstCreatePass(tView);\n        ngDevMode && ngDevMode.firstCreatePass++;\n        var tViewConsts = tView.consts;\n        // TODO(pk): refactor getOrCreateTNode to have the \"create\" only version\n        var tNode = getOrCreateTNode(tView, index, 4 /* Container */, tagName || null, getConstant(tViewConsts, attrsIndex));\n        resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));\n        registerPostOrderHooks(tView, tNode);\n        var embeddedTView = tNode.tViews = createTView(2 /* Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);\n        if (tView.queries !== null) {\n            tView.queries.template(tView, tNode);\n            embeddedTView.queries = tView.queries.embeddedTView(tNode);\n        }\n        return tNode;\n    }\n    /**\n     * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n     *\n     * <ng-template #foo>\n     *    <div></div>\n     * </ng-template>\n     *\n     * @param index The index of the container in the data array\n     * @param templateFn Inline template\n     * @param decls The number of nodes, local refs, and pipes for this template\n     * @param vars The number of bindings for this template\n     * @param tagName The name of the container element, if applicable\n     * @param attrsIndex Index of template attributes in the `consts` array.\n     * @param localRefs Index of the local references in the `consts` array.\n     * @param localRefExtractor A function which extracts local-refs values from the template.\n     *        Defaults to the current element associated with the local-ref.\n     *\n     * @codeGenApi\n     */\n    function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n        var lView = getLView();\n        var tView = getTView();\n        var adjustedIndex = index + HEADER_OFFSET;\n        var tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n            tView.data[adjustedIndex];\n        setCurrentTNode(tNode, false);\n        var comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n        appendChild(tView, lView, comment, tNode);\n        attachPatchData(comment, lView);\n        addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n        if (isDirectiveHost(tNode)) {\n            createDirectivesInstances(tView, lView, tNode);\n        }\n        if (localRefsIndex != null) {\n            saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /** Store a value in the `data` at a given `index`. */\n    function store(tView, lView, index, value) {\n        // We don't store any static data for local variables, so the first time\n        // we see the template, we should store as null to avoid a sparse array\n        if (index >= tView.data.length) {\n            tView.data[index] = null;\n            tView.blueprint[index] = null;\n        }\n        lView[index] = value;\n    }\n    /**\n     * Retrieves a local reference from the current contextViewData.\n     *\n     * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n     * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n     *\n     * @param index The index of the local ref in contextViewData.\n     *\n     * @codeGenApi\n     */\n    function ɵɵreference(index) {\n        var contextLView = getContextLView();\n        return load(contextLView, HEADER_OFFSET + index);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n     *\n     * This should be kept up to date with the public exports of @angular/core.\n     */\n    var angularCoreDiEnv = {\n        'ɵɵdefineInjectable': ɵɵdefineInjectable,\n        'ɵɵdefineInjector': ɵɵdefineInjector,\n        'ɵɵinject': ɵɵinject,\n        'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n        'resolveForwardRef': resolveForwardRef,\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n     * injectable def (`ɵprov`) onto the injectable type.\n     */\n    function compileInjectable(type, meta) {\n        var ngInjectableDef = null;\n        var ngFactoryDef = null;\n        // if NG_PROV_DEF is already defined on this class then don't overwrite it\n        if (!type.hasOwnProperty(NG_PROV_DEF)) {\n            Object.defineProperty(type, NG_PROV_DEF, {\n                get: function () {\n                    if (ngInjectableDef === null) {\n                        var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type: type });\n                        ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, \"ng:///\" + type.name + \"/\\u0275prov.js\", getInjectableMetadata(type, meta));\n                    }\n                    return ngInjectableDef;\n                },\n            });\n        }\n        // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n        if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n            Object.defineProperty(type, NG_FACTORY_DEF, {\n                get: function () {\n                    if (ngFactoryDef === null) {\n                        var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type: type });\n                        ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, \"ng:///\" + type.name + \"/\\u0275fac.js\", {\n                            name: type.name,\n                            type: type,\n                            typeArgumentCount: 0,\n                            deps: reflectDependencies(type),\n                            target: compiler.FactoryTarget.Injectable\n                        });\n                    }\n                    return ngFactoryDef;\n                },\n                // Leave this configurable so that the factories from directives or pipes can take precedence.\n                configurable: true\n            });\n        }\n    }\n    var ɵ0$8 = getClosureSafeProperty;\n    var USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: ɵ0$8 });\n    function isUseClassProvider(meta) {\n        return meta.useClass !== undefined;\n    }\n    function isUseValueProvider(meta) {\n        return USE_VALUE$1 in meta;\n    }\n    function isUseFactoryProvider(meta) {\n        return meta.useFactory !== undefined;\n    }\n    function isUseExistingProvider(meta) {\n        return meta.useExisting !== undefined;\n    }\n    function getInjectableMetadata(type, srcMeta) {\n        // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n        var meta = srcMeta || { providedIn: null };\n        var compilerMeta = {\n            name: type.name,\n            type: type,\n            typeArgumentCount: 0,\n            providedIn: meta.providedIn,\n        };\n        if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n            compilerMeta.deps = convertDependencies(meta.deps);\n        }\n        // Check to see if the user explicitly provided a `useXxxx` property.\n        if (isUseClassProvider(meta)) {\n            compilerMeta.useClass = meta.useClass;\n        }\n        else if (isUseValueProvider(meta)) {\n            compilerMeta.useValue = meta.useValue;\n        }\n        else if (isUseFactoryProvider(meta)) {\n            compilerMeta.useFactory = meta.useFactory;\n        }\n        else if (isUseExistingProvider(meta)) {\n            compilerMeta.useExisting = meta.useExisting;\n        }\n        return compilerMeta;\n    }\n\n    var ɵ0$9 = getClosureSafeProperty;\n    var USE_VALUE$2 = getClosureSafeProperty({ provide: String, useValue: ɵ0$9 });\n    function convertInjectableProviderToFactory(type, provider) {\n        if (!provider) {\n            var reflectionCapabilities = new ReflectionCapabilities();\n            var deps_1 = reflectionCapabilities.parameters(type);\n            // TODO - convert to flags.\n            return function () { return new (type.bind.apply(type, __spreadArray([void 0], __read(injectArgs(deps_1)))))(); };\n        }\n        if (USE_VALUE$2 in provider) {\n            var valueProvider_1 = provider;\n            return function () { return valueProvider_1.useValue; };\n        }\n        else if (provider.useExisting) {\n            var existingProvider_1 = provider;\n            return function () { return ɵɵinject(resolveForwardRef(existingProvider_1.useExisting)); };\n        }\n        else if (provider.useFactory) {\n            var factoryProvider_1 = provider;\n            return function () { return factoryProvider_1.useFactory.apply(factoryProvider_1, __spreadArray([], __read(injectArgs(factoryProvider_1.deps || EMPTY_ARRAY)))); };\n        }\n        else if (provider.useClass) {\n            var classProvider_1 = provider;\n            var deps_2 = provider.deps;\n            if (!deps_2) {\n                var reflectionCapabilities = new ReflectionCapabilities();\n                deps_2 = reflectionCapabilities.parameters(type);\n            }\n            return function () {\n                var _a;\n                return new ((_a = (resolveForwardRef(classProvider_1.useClass))).bind.apply(_a, __spreadArray([void 0], __read(injectArgs(deps_2)))))();\n            };\n        }\n        else {\n            var deps_3 = provider.deps;\n            if (!deps_3) {\n                var reflectionCapabilities = new ReflectionCapabilities();\n                deps_3 = reflectionCapabilities.parameters(type);\n            }\n            return function () { return new (type.bind.apply(type, __spreadArray([void 0], __read(injectArgs(deps_3)))))(); };\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$a = function (type, meta) { return SWITCH_COMPILE_INJECTABLE(type, meta); };\n    /**\n     * Injectable decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Injectable = makeDecorator('Injectable', undefined, undefined, undefined, ɵ0$a);\n    /**\n     * Supports @Injectable() in JIT mode for Render2.\n     */\n    function render2CompileInjectable(injectableType, options) {\n        if (options && options.providedIn !== undefined && !getInjectableDef(injectableType)) {\n            injectableType.ɵprov = ɵɵdefineInjectable({\n                token: injectableType,\n                providedIn: options.providedIn,\n                factory: convertInjectableProviderToFactory(injectableType, options),\n            });\n        }\n    }\n    var SWITCH_COMPILE_INJECTABLE__POST_R3__ = compileInjectable;\n    var SWITCH_COMPILE_INJECTABLE__PRE_R3__ = render2CompileInjectable;\n    var SWITCH_COMPILE_INJECTABLE = SWITCH_COMPILE_INJECTABLE__PRE_R3__;\n\n    /**\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://angular.io/license\n     */\n    function findFirstClosedCycle(keys) {\n        var res = [];\n        for (var i = 0; i < keys.length; ++i) {\n            if (res.indexOf(keys[i]) > -1) {\n                res.push(keys[i]);\n                return res;\n            }\n            res.push(keys[i]);\n        }\n        return res;\n    }\n    function constructResolvingPath(keys) {\n        if (keys.length > 1) {\n            var reversed = findFirstClosedCycle(keys.slice().reverse());\n            var tokenStrs = reversed.map(function (k) { return stringify(k.token); });\n            return ' (' + tokenStrs.join(' -> ') + ')';\n        }\n        return '';\n    }\n    function injectionError(injector, key, constructResolvingMessage, originalError) {\n        var keys = [key];\n        var errMsg = constructResolvingMessage(keys);\n        var error = (originalError ? wrappedError(errMsg, originalError) : Error(errMsg));\n        error.addKey = addKey;\n        error.keys = keys;\n        error.injectors = [injector];\n        error.constructResolvingMessage = constructResolvingMessage;\n        error[ERROR_ORIGINAL_ERROR] = originalError;\n        return error;\n    }\n    function addKey(injector, key) {\n        this.injectors.push(injector);\n        this.keys.push(key);\n        // Note: This updated message won't be reflected in the `.stack` property\n        this.message = this.constructResolvingMessage(this.keys);\n    }\n    /**\n     * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the\n     * {@link Injector} does not have a {@link Provider} for the given key.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * class A {\n     *   constructor(b:B) {}\n     * }\n     *\n     * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n     * ```\n     */\n    function noProviderError(injector, key) {\n        return injectionError(injector, key, function (keys) {\n            var first = stringify(keys[0].token);\n            return \"No provider for \" + first + \"!\" + constructResolvingPath(keys);\n        });\n    }\n    /**\n     * Thrown when dependencies form a cycle.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * var injector = Injector.resolveAndCreate([\n     *   {provide: \"one\", useFactory: (two) => \"two\", deps: [[new Inject(\"two\")]]},\n     *   {provide: \"two\", useFactory: (one) => \"one\", deps: [[new Inject(\"one\")]]}\n     * ]);\n     *\n     * expect(() => injector.get(\"one\")).toThrowError();\n     * ```\n     *\n     * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.\n     */\n    function cyclicDependencyError(injector, key) {\n        return injectionError(injector, key, function (keys) {\n            return \"Cannot instantiate cyclic dependency!\" + constructResolvingPath(keys);\n        });\n    }\n    /**\n     * Thrown when a constructing type returns with an Error.\n     *\n     * The `InstantiationError` class contains the original error plus the dependency graph which caused\n     * this object to be instantiated.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * class A {\n     *   constructor() {\n     *     throw new Error('message');\n     *   }\n     * }\n     *\n     * var injector = Injector.resolveAndCreate([A]);\n\n     * try {\n     *   injector.get(A);\n     * } catch (e) {\n     *   expect(e instanceof InstantiationError).toBe(true);\n     *   expect(e.originalException.message).toEqual(\"message\");\n     *   expect(e.originalStack).toBeDefined();\n     * }\n     * ```\n     */\n    function instantiationError(injector, originalException, originalStack, key) {\n        return injectionError(injector, key, function (keys) {\n            var first = stringify(keys[0].token);\n            return originalException.message + \": Error during instantiation of \" + first + \"!\" + constructResolvingPath(keys) + \".\";\n        }, originalException);\n    }\n    /**\n     * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}\n     * creation.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * expect(() => Injector.resolveAndCreate([\"not a type\"])).toThrowError();\n     * ```\n     */\n    function invalidProviderError(provider) {\n        return Error(\"Invalid provider - only instances of Provider and Type are allowed, got: \" + provider);\n    }\n    /**\n     * Thrown when the class has no annotation information.\n     *\n     * Lack of annotation information prevents the {@link Injector} from determining which dependencies\n     * need to be injected into the constructor.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * class A {\n     *   constructor(b) {}\n     * }\n     *\n     * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n     * ```\n     *\n     * This error is also thrown when the class not marked with {@link Injectable} has parameter types.\n     *\n     * ```typescript\n     * class B {}\n     *\n     * class A {\n     *   constructor(b:B) {} // no information about the parameter types of A is available at runtime.\n     * }\n     *\n     * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();\n     * ```\n     *\n     */\n    function noAnnotationError(typeOrFunc, params) {\n        var signature = [];\n        for (var i = 0, ii = params.length; i < ii; i++) {\n            var parameter = params[i];\n            if (!parameter || parameter.length == 0) {\n                signature.push('?');\n            }\n            else {\n                signature.push(parameter.map(stringify).join(' '));\n            }\n        }\n        return Error('Cannot resolve all parameters for \\'' + stringify(typeOrFunc) + '\\'(' +\n            signature.join(', ') + '). ' +\n            'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \\'' +\n            stringify(typeOrFunc) + '\\' is decorated with Injectable.');\n    }\n    /**\n     * Thrown when getting an object by index.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * class A {}\n     *\n     * var injector = Injector.resolveAndCreate([A]);\n     *\n     * expect(() => injector.getAt(100)).toThrowError();\n     * ```\n     *\n     */\n    function outOfBoundsError(index) {\n        return Error(\"Index \" + index + \" is out-of-bounds.\");\n    }\n    // TODO: add a working example after alpha38 is released\n    /**\n     * Thrown when a multi provider and a regular provider are bound to the same token.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * expect(() => Injector.resolveAndCreate([\n     *   { provide: \"Strings\", useValue: \"string1\", multi: true},\n     *   { provide: \"Strings\", useValue: \"string2\", multi: false}\n     * ])).toThrowError();\n     * ```\n     */\n    function mixingMultiProvidersWithRegularProvidersError(provider1, provider2) {\n        return Error(\"Cannot mix multi providers and regular providers, got: \" + provider1 + \" \" + provider2);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A unique object used for retrieving items from the {@link ReflectiveInjector}.\n     *\n     * Keys have:\n     * - a system-wide unique `id`.\n     * - a `token`.\n     *\n     * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows\n     * the\n     * injector to store created objects in a more efficient way.\n     *\n     * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when\n     * resolving\n     * providers.\n     *\n     * @deprecated No replacement\n     * @publicApi\n     */\n    var ReflectiveKey = /** @class */ (function () {\n        /**\n         * Private\n         */\n        function ReflectiveKey(token, id) {\n            this.token = token;\n            this.id = id;\n            if (!token) {\n                throw new Error('Token must be defined!');\n            }\n            this.displayName = stringify(this.token);\n        }\n        /**\n         * Retrieves a `Key` for a token.\n         */\n        ReflectiveKey.get = function (token) {\n            return _globalKeyRegistry.get(resolveForwardRef(token));\n        };\n        Object.defineProperty(ReflectiveKey, \"numberOfKeys\", {\n            /**\n             * @returns the number of keys registered in the system.\n             */\n            get: function () {\n                return _globalKeyRegistry.numberOfKeys;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return ReflectiveKey;\n    }());\n    var KeyRegistry = /** @class */ (function () {\n        function KeyRegistry() {\n            this._allKeys = new Map();\n        }\n        KeyRegistry.prototype.get = function (token) {\n            if (token instanceof ReflectiveKey)\n                return token;\n            if (this._allKeys.has(token)) {\n                return this._allKeys.get(token);\n            }\n            var newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);\n            this._allKeys.set(token, newKey);\n            return newKey;\n        };\n        Object.defineProperty(KeyRegistry.prototype, \"numberOfKeys\", {\n            get: function () {\n                return this._allKeys.size;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return KeyRegistry;\n    }());\n    var _globalKeyRegistry = new KeyRegistry();\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Provides access to reflection data about symbols. Used internally by Angular\n     * to power dependency injection and compilation.\n     */\n    var Reflector = /** @class */ (function () {\n        function Reflector(reflectionCapabilities) {\n            this.reflectionCapabilities = reflectionCapabilities;\n        }\n        Reflector.prototype.updateCapabilities = function (caps) {\n            this.reflectionCapabilities = caps;\n        };\n        Reflector.prototype.factory = function (type) {\n            return this.reflectionCapabilities.factory(type);\n        };\n        Reflector.prototype.parameters = function (typeOrFunc) {\n            return this.reflectionCapabilities.parameters(typeOrFunc);\n        };\n        Reflector.prototype.annotations = function (typeOrFunc) {\n            return this.reflectionCapabilities.annotations(typeOrFunc);\n        };\n        Reflector.prototype.propMetadata = function (typeOrFunc) {\n            return this.reflectionCapabilities.propMetadata(typeOrFunc);\n        };\n        Reflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n            return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n        };\n        Reflector.prototype.getter = function (name) {\n            return this.reflectionCapabilities.getter(name);\n        };\n        Reflector.prototype.setter = function (name) {\n            return this.reflectionCapabilities.setter(name);\n        };\n        Reflector.prototype.method = function (name) {\n            return this.reflectionCapabilities.method(name);\n        };\n        Reflector.prototype.importUri = function (type) {\n            return this.reflectionCapabilities.importUri(type);\n        };\n        Reflector.prototype.resourceUri = function (type) {\n            return this.reflectionCapabilities.resourceUri(type);\n        };\n        Reflector.prototype.resolveIdentifier = function (name, moduleUrl, members, runtime) {\n            return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);\n        };\n        Reflector.prototype.resolveEnum = function (identifier, name) {\n            return this.reflectionCapabilities.resolveEnum(identifier, name);\n        };\n        return Reflector;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * The {@link Reflector} used internally in Angular to access metadata\n     * about symbols.\n     */\n    var reflector = new Reflector(new ReflectionCapabilities());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * `Dependency` is used by the framework to extend DI.\n     * This is internal to Angular and should not be used directly.\n     */\n    var ReflectiveDependency = /** @class */ (function () {\n        function ReflectiveDependency(key, optional, visibility) {\n            this.key = key;\n            this.optional = optional;\n            this.visibility = visibility;\n        }\n        ReflectiveDependency.fromKey = function (key) {\n            return new ReflectiveDependency(key, false, null);\n        };\n        return ReflectiveDependency;\n    }());\n    var _EMPTY_LIST = [];\n    var ResolvedReflectiveProvider_ = /** @class */ (function () {\n        function ResolvedReflectiveProvider_(key, resolvedFactories, multiProvider) {\n            this.key = key;\n            this.resolvedFactories = resolvedFactories;\n            this.multiProvider = multiProvider;\n            this.resolvedFactory = this.resolvedFactories[0];\n        }\n        return ResolvedReflectiveProvider_;\n    }());\n    /**\n     * An internal resolved representation of a factory function created by resolving `Provider`.\n     * @publicApi\n     */\n    var ResolvedReflectiveFactory = /** @class */ (function () {\n        function ResolvedReflectiveFactory(\n        /**\n         * Factory function which can return an instance of an object represented by a key.\n         */\n        factory, \n        /**\n         * Arguments (dependencies) to the `factory` function.\n         */\n        dependencies) {\n            this.factory = factory;\n            this.dependencies = dependencies;\n        }\n        return ResolvedReflectiveFactory;\n    }());\n    /**\n     * Resolve a single provider.\n     */\n    function resolveReflectiveFactory(provider) {\n        var factoryFn;\n        var resolvedDeps;\n        if (provider.useClass) {\n            var useClass = resolveForwardRef(provider.useClass);\n            factoryFn = reflector.factory(useClass);\n            resolvedDeps = _dependenciesFor(useClass);\n        }\n        else if (provider.useExisting) {\n            factoryFn = function (aliasInstance) { return aliasInstance; };\n            resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n        }\n        else if (provider.useFactory) {\n            factoryFn = provider.useFactory;\n            resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n        }\n        else {\n            factoryFn = function () { return provider.useValue; };\n            resolvedDeps = _EMPTY_LIST;\n        }\n        return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n    }\n    /**\n     * Converts the `Provider` into `ResolvedProvider`.\n     *\n     * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider\n     * syntax.\n     */\n    function resolveReflectiveProvider(provider) {\n        return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n    }\n    /**\n     * Resolve a list of Providers.\n     */\n    function resolveReflectiveProviders(providers) {\n        var normalized = _normalizeProviders(providers, []);\n        var resolved = normalized.map(resolveReflectiveProvider);\n        var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n        return Array.from(resolvedProviderMap.values());\n    }\n    /**\n     * Merges a list of ResolvedProviders into a list where each key is contained exactly once and\n     * multi providers have been merged.\n     */\n    function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n        for (var i = 0; i < providers.length; i++) {\n            var provider = providers[i];\n            var existing = normalizedProvidersMap.get(provider.key.id);\n            if (existing) {\n                if (provider.multiProvider !== existing.multiProvider) {\n                    throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n                }\n                if (provider.multiProvider) {\n                    for (var j = 0; j < provider.resolvedFactories.length; j++) {\n                        existing.resolvedFactories.push(provider.resolvedFactories[j]);\n                    }\n                }\n                else {\n                    normalizedProvidersMap.set(provider.key.id, provider);\n                }\n            }\n            else {\n                var resolvedProvider = void 0;\n                if (provider.multiProvider) {\n                    resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n                }\n                else {\n                    resolvedProvider = provider;\n                }\n                normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n            }\n        }\n        return normalizedProvidersMap;\n    }\n    function _normalizeProviders(providers, res) {\n        providers.forEach(function (b) {\n            if (b instanceof Type) {\n                res.push({ provide: b, useClass: b });\n            }\n            else if (b && typeof b == 'object' && b.provide !== undefined) {\n                res.push(b);\n            }\n            else if (Array.isArray(b)) {\n                _normalizeProviders(b, res);\n            }\n            else {\n                throw invalidProviderError(b);\n            }\n        });\n        return res;\n    }\n    function constructDependencies(typeOrFunc, dependencies) {\n        if (!dependencies) {\n            return _dependenciesFor(typeOrFunc);\n        }\n        else {\n            var params_1 = dependencies.map(function (t) { return [t]; });\n            return dependencies.map(function (t) { return _extractToken(typeOrFunc, t, params_1); });\n        }\n    }\n    function _dependenciesFor(typeOrFunc) {\n        var params = reflector.parameters(typeOrFunc);\n        if (!params)\n            return [];\n        if (params.some(function (p) { return p == null; })) {\n            throw noAnnotationError(typeOrFunc, params);\n        }\n        return params.map(function (p) { return _extractToken(typeOrFunc, p, params); });\n    }\n    function _extractToken(typeOrFunc, metadata, params) {\n        var token = null;\n        var optional = false;\n        if (!Array.isArray(metadata)) {\n            if (metadata instanceof Inject) {\n                return _createDependency(metadata.token, optional, null);\n            }\n            else {\n                return _createDependency(metadata, optional, null);\n            }\n        }\n        var visibility = null;\n        for (var i = 0; i < metadata.length; ++i) {\n            var paramMetadata = metadata[i];\n            if (paramMetadata instanceof Type) {\n                token = paramMetadata;\n            }\n            else if (paramMetadata instanceof Inject) {\n                token = paramMetadata.token;\n            }\n            else if (paramMetadata instanceof Optional) {\n                optional = true;\n            }\n            else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {\n                visibility = paramMetadata;\n            }\n            else if (paramMetadata instanceof InjectionToken) {\n                token = paramMetadata;\n            }\n        }\n        token = resolveForwardRef(token);\n        if (token != null) {\n            return _createDependency(token, optional, visibility);\n        }\n        else {\n            throw noAnnotationError(typeOrFunc, params);\n        }\n    }\n    function _createDependency(token, optional, visibility) {\n        return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);\n    }\n\n    // Threshold for the dynamic version\n    var UNDEFINED = {};\n    /**\n     * A ReflectiveDependency injection container used for instantiating objects and resolving\n     * dependencies.\n     *\n     * An `Injector` is a replacement for a `new` operator, which can automatically resolve the\n     * constructor dependencies.\n     *\n     * In typical use, application code asks for the dependencies in the constructor and they are\n     * resolved by the `Injector`.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * The following example creates an `Injector` configured to create `Engine` and `Car`.\n     *\n     * ```typescript\n     * @Injectable()\n     * class Engine {\n     * }\n     *\n     * @Injectable()\n     * class Car {\n     *   constructor(public engine:Engine) {}\n     * }\n     *\n     * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n     * var car = injector.get(Car);\n     * expect(car instanceof Car).toBe(true);\n     * expect(car.engine instanceof Engine).toBe(true);\n     * ```\n     *\n     * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`\n     * resolve all of the object's dependencies automatically.\n     *\n     * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.\n     * @publicApi\n     */\n    var ReflectiveInjector = /** @class */ (function () {\n        function ReflectiveInjector() {\n        }\n        /**\n         * Turns an array of provider definitions into an array of resolved providers.\n         *\n         * A resolution is a process of flattening multiple nested arrays and converting individual\n         * providers into an array of `ResolvedReflectiveProvider`s.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * ```typescript\n         * @Injectable()\n         * class Engine {\n         * }\n         *\n         * @Injectable()\n         * class Car {\n         *   constructor(public engine:Engine) {}\n         * }\n         *\n         * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);\n         *\n         * expect(providers.length).toEqual(2);\n         *\n         * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);\n         * expect(providers[0].key.displayName).toBe(\"Car\");\n         * expect(providers[0].dependencies.length).toEqual(1);\n         * expect(providers[0].factory).toBeDefined();\n         *\n         * expect(providers[1].key.displayName).toBe(\"Engine\");\n         * });\n         * ```\n         *\n         */\n        ReflectiveInjector.resolve = function (providers) {\n            return resolveReflectiveProviders(providers);\n        };\n        /**\n         * Resolves an array of providers and creates an injector from those providers.\n         *\n         * The passed-in providers can be an array of `Type`, `Provider`,\n         * or a recursive array of more providers.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * ```typescript\n         * @Injectable()\n         * class Engine {\n         * }\n         *\n         * @Injectable()\n         * class Car {\n         *   constructor(public engine:Engine) {}\n         * }\n         *\n         * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n         * expect(injector.get(Car) instanceof Car).toBe(true);\n         * ```\n         */\n        ReflectiveInjector.resolveAndCreate = function (providers, parent) {\n            var ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n            return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);\n        };\n        /**\n         * Creates an injector from previously resolved providers.\n         *\n         * This API is the recommended way to construct injectors in performance-sensitive parts.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * ```typescript\n         * @Injectable()\n         * class Engine {\n         * }\n         *\n         * @Injectable()\n         * class Car {\n         *   constructor(public engine:Engine) {}\n         * }\n         *\n         * var providers = ReflectiveInjector.resolve([Car, Engine]);\n         * var injector = ReflectiveInjector.fromResolvedProviders(providers);\n         * expect(injector.get(Car) instanceof Car).toBe(true);\n         * ```\n         */\n        ReflectiveInjector.fromResolvedProviders = function (providers, parent) {\n            return new ReflectiveInjector_(providers, parent);\n        };\n        return ReflectiveInjector;\n    }());\n    var ReflectiveInjector_ = /** @class */ (function () {\n        /**\n         * Private\n         */\n        function ReflectiveInjector_(_providers, _parent) {\n            /** @internal */\n            this._constructionCounter = 0;\n            this._providers = _providers;\n            this.parent = _parent || null;\n            var len = _providers.length;\n            this.keyIds = [];\n            this.objs = [];\n            for (var i = 0; i < len; i++) {\n                this.keyIds[i] = _providers[i].key.id;\n                this.objs[i] = UNDEFINED;\n            }\n        }\n        ReflectiveInjector_.prototype.get = function (token, notFoundValue) {\n            if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }\n            return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);\n        };\n        ReflectiveInjector_.prototype.resolveAndCreateChild = function (providers) {\n            var ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n            return this.createChildFromResolved(ResolvedReflectiveProviders);\n        };\n        ReflectiveInjector_.prototype.createChildFromResolved = function (providers) {\n            var inj = new ReflectiveInjector_(providers);\n            inj.parent = this;\n            return inj;\n        };\n        ReflectiveInjector_.prototype.resolveAndInstantiate = function (provider) {\n            return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);\n        };\n        ReflectiveInjector_.prototype.instantiateResolved = function (provider) {\n            return this._instantiateProvider(provider);\n        };\n        ReflectiveInjector_.prototype.getProviderAtIndex = function (index) {\n            if (index < 0 || index >= this._providers.length) {\n                throw outOfBoundsError(index);\n            }\n            return this._providers[index];\n        };\n        /** @internal */\n        ReflectiveInjector_.prototype._new = function (provider) {\n            if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {\n                throw cyclicDependencyError(this, provider.key);\n            }\n            return this._instantiateProvider(provider);\n        };\n        ReflectiveInjector_.prototype._getMaxNumberOfObjects = function () {\n            return this.objs.length;\n        };\n        ReflectiveInjector_.prototype._instantiateProvider = function (provider) {\n            if (provider.multiProvider) {\n                var res = [];\n                for (var i = 0; i < provider.resolvedFactories.length; ++i) {\n                    res[i] = this._instantiate(provider, provider.resolvedFactories[i]);\n                }\n                return res;\n            }\n            else {\n                return this._instantiate(provider, provider.resolvedFactories[0]);\n            }\n        };\n        ReflectiveInjector_.prototype._instantiate = function (provider, ResolvedReflectiveFactory) {\n            var _this = this;\n            var factory = ResolvedReflectiveFactory.factory;\n            var deps;\n            try {\n                deps =\n                    ResolvedReflectiveFactory.dependencies.map(function (dep) { return _this._getByReflectiveDependency(dep); });\n            }\n            catch (e) {\n                if (e.addKey) {\n                    e.addKey(this, provider.key);\n                }\n                throw e;\n            }\n            var obj;\n            try {\n                obj = factory.apply(void 0, __spreadArray([], __read(deps)));\n            }\n            catch (e) {\n                throw instantiationError(this, e, e.stack, provider.key);\n            }\n            return obj;\n        };\n        ReflectiveInjector_.prototype._getByReflectiveDependency = function (dep) {\n            return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);\n        };\n        ReflectiveInjector_.prototype._getByKey = function (key, visibility, notFoundValue) {\n            if (key === ReflectiveInjector_.INJECTOR_KEY) {\n                return this;\n            }\n            if (visibility instanceof Self) {\n                return this._getByKeySelf(key, notFoundValue);\n            }\n            else {\n                return this._getByKeyDefault(key, notFoundValue, visibility);\n            }\n        };\n        ReflectiveInjector_.prototype._getObjByKeyId = function (keyId) {\n            for (var i = 0; i < this.keyIds.length; i++) {\n                if (this.keyIds[i] === keyId) {\n                    if (this.objs[i] === UNDEFINED) {\n                        this.objs[i] = this._new(this._providers[i]);\n                    }\n                    return this.objs[i];\n                }\n            }\n            return UNDEFINED;\n        };\n        /** @internal */\n        ReflectiveInjector_.prototype._throwOrNull = function (key, notFoundValue) {\n            if (notFoundValue !== THROW_IF_NOT_FOUND) {\n                return notFoundValue;\n            }\n            else {\n                throw noProviderError(this, key);\n            }\n        };\n        /** @internal */\n        ReflectiveInjector_.prototype._getByKeySelf = function (key, notFoundValue) {\n            var obj = this._getObjByKeyId(key.id);\n            return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);\n        };\n        /** @internal */\n        ReflectiveInjector_.prototype._getByKeyDefault = function (key, notFoundValue, visibility) {\n            var inj;\n            if (visibility instanceof SkipSelf) {\n                inj = this.parent;\n            }\n            else {\n                inj = this;\n            }\n            while (inj instanceof ReflectiveInjector_) {\n                var inj_ = inj;\n                var obj = inj_._getObjByKeyId(key.id);\n                if (obj !== UNDEFINED)\n                    return obj;\n                inj = inj_.parent;\n            }\n            if (inj !== null) {\n                return inj.get(key.token, notFoundValue);\n            }\n            else {\n                return this._throwOrNull(key, notFoundValue);\n            }\n        };\n        Object.defineProperty(ReflectiveInjector_.prototype, \"displayName\", {\n            get: function () {\n                var providers = _mapProviders(this, function (b) { return ' \"' + b.key.displayName + '\" '; })\n                    .join(', ');\n                return \"ReflectiveInjector(providers: [\" + providers + \"])\";\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ReflectiveInjector_.prototype.toString = function () {\n            return this.displayName;\n        };\n        return ReflectiveInjector_;\n    }());\n    ReflectiveInjector_.INJECTOR_KEY = ReflectiveKey.get(Injector);\n    function _mapProviders(injector, fn) {\n        var res = [];\n        for (var i = 0; i < injector._providers.length; ++i) {\n            res[i] = fn(injector.getProviderAtIndex(i));\n        }\n        return res;\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    function ɵɵdirectiveInject(token, flags) {\n        if (flags === void 0) { flags = exports.InjectFlags.Default; }\n        var lView = getLView();\n        // Fall back to inject() if view hasn't been created. This situation can happen in tests\n        // if inject utilities are used before bootstrapping.\n        if (lView === null) {\n            // Verify that we will not get into infinite loop.\n            ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);\n            return ɵɵinject(token, flags);\n        }\n        var tNode = getCurrentTNode();\n        return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);\n    }\n    /**\n     * Throws an error indicating that a factory function could not be generated by the compiler for a\n     * particular class.\n     *\n     * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n     * off, saving bytes of generated code while still providing a good experience in dev mode.\n     *\n     * The name of the class is not mentioned here, but will be in the generated factory function name\n     * and thus in the stack trace.\n     *\n     * @codeGenApi\n     */\n    function ɵɵinvalidFactory() {\n        var msg = ngDevMode ? \"This constructor was not compatible with Dependency Injection.\" : 'invalid';\n        throw new Error(msg);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Update a property on a selected element.\n     *\n     * Operates on the element selected by index via the {@link select} instruction.\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled\n     *\n     * @param propName Name of property. Because it is going to DOM, this is not subject to\n     *        renaming as part of minification.\n     * @param value New value to write.\n     * @param sanitizer An optional function used to sanitize the value.\n     * @returns This function returns itself so that it may be chained\n     * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n     *\n     * @codeGenApi\n     */\n    function ɵɵproperty(propName, value, sanitizer) {\n        var lView = getLView();\n        var bindingIndex = nextBindingIndex();\n        if (bindingUpdated(lView, bindingIndex, value)) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);\n            ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n        }\n        return ɵɵproperty;\n    }\n    /**\n     * Given `<div style=\"...\" my-dir>` and `MyDir` with `@Input('style')` we need to write to\n     * directive input.\n     */\n    function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {\n        var inputs = tNode.inputs;\n        var property = isClassBased ? 'class' : 'style';\n        // We support both 'class' and `className` hence the fallback.\n        setInputsForProperty(tView, lView, inputs[property], property, value);\n    }\n\n    /**\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://angular.io/license\n     */\n    function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {\n        ngDevMode && assertFirstCreatePass(tView);\n        ngDevMode && ngDevMode.firstCreatePass++;\n        var tViewConsts = tView.consts;\n        var attrs = getConstant(tViewConsts, attrsIndex);\n        var tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);\n        var hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));\n        ngDevMode && logUnknownElementError(tView, native, tNode, hasDirectives);\n        if (tNode.attrs !== null) {\n            computeStaticStyling(tNode, tNode.attrs, false);\n        }\n        if (tNode.mergedAttrs !== null) {\n            computeStaticStyling(tNode, tNode.mergedAttrs, true);\n        }\n        if (tView.queries !== null) {\n            tView.queries.elementStart(tView, tNode);\n        }\n        return tNode;\n    }\n    /**\n     * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n     *\n     * @param index Index of the element in the LView array\n     * @param name Name of the DOM Node\n     * @param attrsIndex Index of the element's attributes in the `consts` array.\n     * @param localRefsIndex Index of the element's local references in the `consts` array.\n     *\n     * Attributes and localRefs are passed as an array of strings where elements with an even index\n     * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n     * ['id', 'warning5', 'class', 'alert']\n     *\n     * @codeGenApi\n     */\n    function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n        var lView = getLView();\n        var tView = getTView();\n        var adjustedIndex = HEADER_OFFSET + index;\n        ngDevMode &&\n            assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n        ngDevMode && assertIndexInRange(lView, adjustedIndex);\n        var renderer = lView[RENDERER];\n        var native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace());\n        var tNode = tView.firstCreatePass ?\n            elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :\n            tView.data[adjustedIndex];\n        setCurrentTNode(tNode, true);\n        var mergedAttrs = tNode.mergedAttrs;\n        if (mergedAttrs !== null) {\n            setUpAttributes(renderer, native, mergedAttrs);\n        }\n        var classes = tNode.classes;\n        if (classes !== null) {\n            writeDirectClass(renderer, native, classes);\n        }\n        var styles = tNode.styles;\n        if (styles !== null) {\n            writeDirectStyle(renderer, native, styles);\n        }\n        if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {\n            // In the i18n case, the translation may have removed this element, so only add it if it is not\n            // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n            appendChild(tView, lView, native, tNode);\n        }\n        // any immediate children of a component or template container must be pre-emptively\n        // monkey-patched with the component view data so that the element can be inspected\n        // later on using any element discovery utility methods (see `element_discovery.ts`)\n        if (getElementDepthCount() === 0) {\n            attachPatchData(native, lView);\n        }\n        increaseElementDepthCount();\n        if (isDirectiveHost(tNode)) {\n            createDirectivesInstances(tView, lView, tNode);\n            executeContentQueries(tView, tNode, lView);\n        }\n        if (localRefsIndex !== null) {\n            saveResolvedLocalsInData(lView, tNode);\n        }\n    }\n    /**\n     * Mark the end of the element.\n     *\n     * @codeGenApi\n     */\n    function ɵɵelementEnd() {\n        var currentTNode = getCurrentTNode();\n        ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n        if (isCurrentTNodeParent()) {\n            setCurrentTNodeAsNotParent();\n        }\n        else {\n            ngDevMode && assertHasParent(getCurrentTNode());\n            currentTNode = currentTNode.parent;\n            setCurrentTNode(currentTNode, false);\n        }\n        var tNode = currentTNode;\n        ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);\n        decreaseElementDepthCount();\n        var tView = getTView();\n        if (tView.firstCreatePass) {\n            registerPostOrderHooks(tView, currentTNode);\n            if (isContentQueryHost(currentTNode)) {\n                tView.queries.elementEnd(currentTNode);\n            }\n        }\n        if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n            setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n        }\n        if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n            setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n        }\n    }\n    /**\n     * Creates an empty element using {@link elementStart} and {@link elementEnd}\n     *\n     * @param index Index of the element in the data array\n     * @param name Name of the DOM Node\n     * @param attrsIndex Index of the element's attributes in the `consts` array.\n     * @param localRefsIndex Index of the element's local references in the `consts` array.\n     *\n     * @codeGenApi\n     */\n    function ɵɵelement(index, name, attrsIndex, localRefsIndex) {\n        ɵɵelementStart(index, name, attrsIndex, localRefsIndex);\n        ɵɵelementEnd();\n    }\n    function logUnknownElementError(tView, element, tNode, hasDirectives) {\n        var schemas = tView.schemas;\n        // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n        // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n        // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n        // execute the check below.\n        if (schemas === null)\n            return;\n        var tagName = tNode.value;\n        // If the element matches any directive, it's considered as valid.\n        if (!hasDirectives && tagName !== null) {\n            // The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered\n            // as a custom element. Note that unknown elements with a dash in their name won't be instances\n            // of HTMLUnknownElement in browsers that support web components.\n            var isUnknown = \n            // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,\n            // because while most browsers return 'function', IE returns 'object'.\n            (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&\n                element instanceof HTMLUnknownElement) ||\n                (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&\n                    !customElements.get(tagName));\n            if (isUnknown && !matchingSchemas(tView, tagName)) {\n                var message = \"'\" + tagName + \"' is not a known element:\\n\";\n                message += \"1. If '\" + tagName + \"' is an Angular component, then verify that it is part of this module.\\n\";\n                if (tagName && tagName.indexOf('-') > -1) {\n                    message += \"2. If '\" + tagName + \"' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\";\n                }\n                else {\n                    message +=\n                        \"2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n                }\n                console.error(formatRuntimeError(\"304\" /* UNKNOWN_ELEMENT */, message));\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {\n        ngDevMode && ngDevMode.firstCreatePass++;\n        var tViewConsts = tView.consts;\n        var attrs = getConstant(tViewConsts, attrsIndex);\n        var tNode = getOrCreateTNode(tView, index, 8 /* ElementContainer */, 'ng-container', attrs);\n        // While ng-container doesn't necessarily support styling, we use the style context to identify\n        // and execute directives on the ng-container.\n        if (attrs !== null) {\n            computeStaticStyling(tNode, attrs, true);\n        }\n        var localRefs = getConstant(tViewConsts, localRefsIndex);\n        resolveDirectives(tView, lView, tNode, localRefs);\n        if (tView.queries !== null) {\n            tView.queries.elementStart(tView, tNode);\n        }\n        return tNode;\n    }\n    /**\n     * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n     * The instruction must later be followed by `elementContainerEnd()` call.\n     *\n     * @param index Index of the element in the LView array\n     * @param attrsIndex Index of the container attributes in the `consts` array.\n     * @param localRefsIndex Index of the container's local references in the `consts` array.\n     *\n     * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n     * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n     * matching purposes and setting initial inputs of directives.\n     *\n     * @codeGenApi\n     */\n    function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {\n        var lView = getLView();\n        var tView = getTView();\n        var adjustedIndex = index + HEADER_OFFSET;\n        ngDevMode && assertIndexInRange(lView, adjustedIndex);\n        ngDevMode &&\n            assertEqual(getBindingIndex(), tView.bindingStartIndex, 'element containers should be created before any bindings');\n        var tNode = tView.firstCreatePass ?\n            elementContainerStartFirstCreatePass(adjustedIndex, tView, lView, attrsIndex, localRefsIndex) :\n            tView.data[adjustedIndex];\n        setCurrentTNode(tNode, true);\n        ngDevMode && ngDevMode.rendererCreateComment++;\n        var native = lView[adjustedIndex] =\n            lView[RENDERER].createComment(ngDevMode ? 'ng-container' : '');\n        appendChild(tView, lView, native, tNode);\n        attachPatchData(native, lView);\n        if (isDirectiveHost(tNode)) {\n            createDirectivesInstances(tView, lView, tNode);\n            executeContentQueries(tView, tNode, lView);\n        }\n        if (localRefsIndex != null) {\n            saveResolvedLocalsInData(lView, tNode);\n        }\n    }\n    /**\n     * Mark the end of the <ng-container>.\n     *\n     * @codeGenApi\n     */\n    function ɵɵelementContainerEnd() {\n        var currentTNode = getCurrentTNode();\n        var tView = getTView();\n        if (isCurrentTNodeParent()) {\n            setCurrentTNodeAsNotParent();\n        }\n        else {\n            ngDevMode && assertHasParent(currentTNode);\n            currentTNode = currentTNode.parent;\n            setCurrentTNode(currentTNode, false);\n        }\n        ngDevMode && assertTNodeType(currentTNode, 8 /* ElementContainer */);\n        if (tView.firstCreatePass) {\n            registerPostOrderHooks(tView, currentTNode);\n            if (isContentQueryHost(currentTNode)) {\n                tView.queries.elementEnd(currentTNode);\n            }\n        }\n    }\n    /**\n     * Creates an empty logical container using {@link elementContainerStart}\n     * and {@link elementContainerEnd}\n     *\n     * @param index Index of the element in the LView array\n     * @param attrsIndex Index of the container attributes in the `consts` array.\n     * @param localRefsIndex Index of the container's local references in the `consts` array.\n     *\n     * @codeGenApi\n     */\n    function ɵɵelementContainer(index, attrsIndex, localRefsIndex) {\n        ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);\n        ɵɵelementContainerEnd();\n    }\n\n    /**\n     * Returns the current OpaqueViewState instance.\n     *\n     * Used in conjunction with the restoreView() instruction to save a snapshot\n     * of the current view and restore it when listeners are invoked. This allows\n     * walking the declaration view tree in listeners to get vars from parent views.\n     *\n     * @codeGenApi\n     */\n    function ɵɵgetCurrentView() {\n        return getLView();\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Determine if the argument is shaped like a Promise\n     */\n    function isPromise(obj) {\n        // allow any Promise/A+ compliant thenable.\n        // It's up to the caller to ensure that obj.then conforms to the spec\n        return !!obj && typeof obj.then === 'function';\n    }\n    /**\n     * Determine if the argument is a Subscribable\n     */\n    function isSubscribable(obj) {\n        return !!obj && typeof obj.subscribe === 'function';\n    }\n    /**\n     * Determine if the argument is an Observable\n     *\n     * Strictly this tests that the `obj` is `Subscribable`, since `Observable`\n     * types need additional methods, such as `lift()`. But it is adequate for our\n     * needs since within the Angular framework code we only ever need to use the\n     * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects\n     * into `Observable` as needed.\n     */\n    var isObservable = isSubscribable;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Adds an event listener to the current node.\n     *\n     * If an output exists on one of the node's directives, it also subscribes to the output\n     * and saves the subscription for later cleanup.\n     *\n     * @param eventName Name of the event\n     * @param listenerFn The function to be called when event emits\n     * @param useCapture Whether or not to use capture in event listener\n     * @param eventTargetResolver Function that returns global target information in case this listener\n     * should be attached to a global object like window, document or body\n     *\n     * @codeGenApi\n     */\n    function ɵɵlistener(eventName, listenerFn, useCapture, eventTargetResolver) {\n        var lView = getLView();\n        var tView = getTView();\n        var tNode = getCurrentTNode();\n        listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, !!useCapture, eventTargetResolver);\n        return ɵɵlistener;\n    }\n    /**\n     * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.\n     *\n     * This instruction is for compatibility purposes and is designed to ensure that a\n     * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered\n     * in the component's renderer. Normally all host listeners are evaluated with the\n     * parent component's renderer, but, in the case of animation @triggers, they need\n     * to be evaluated with the sub component's renderer (because that's where the\n     * animation triggers are defined).\n     *\n     * Do not use this instruction as a replacement for `listener`. This instruction\n     * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n     *\n     * @param eventName Name of the event\n     * @param listenerFn The function to be called when event emits\n     * @param useCapture Whether or not to use capture in event listener\n     * @param eventTargetResolver Function that returns global target information in case this listener\n     * should be attached to a global object like window, document or body\n     *\n     * @codeGenApi\n     */\n    function ɵɵsyntheticHostListener(eventName, listenerFn) {\n        var tNode = getCurrentTNode();\n        var lView = getLView();\n        var tView = getTView();\n        var currentDef = getCurrentDirectiveDef(tView.data);\n        var renderer = loadComponentRenderer(currentDef, tNode, lView);\n        listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, false);\n        return ɵɵsyntheticHostListener;\n    }\n    /**\n     * A utility function that checks if a given element has already an event handler registered for an\n     * event with a specified name. The TView.cleanup data structure is used to find out which events\n     * are registered for a given element.\n     */\n    function findExistingListener(tView, lView, eventName, tNodeIdx) {\n        var tCleanup = tView.cleanup;\n        if (tCleanup != null) {\n            for (var i = 0; i < tCleanup.length - 1; i += 2) {\n                var cleanupEventName = tCleanup[i];\n                if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) {\n                    // We have found a matching event name on the same node but it might not have been\n                    // registered yet, so we must explicitly verify entries in the LView cleanup data\n                    // structures.\n                    var lCleanup = lView[CLEANUP];\n                    var listenerIdxInLCleanup = tCleanup[i + 2];\n                    return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;\n                }\n                // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or\n                // 2-element entries (for directive and queries destroy hooks). As such we can encounter\n                // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements\n                // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check\n                // documentation of TView.cleanup for more details of this data structure layout.\n                if (typeof cleanupEventName === 'string') {\n                    i += 2;\n                }\n            }\n        }\n        return null;\n    }\n    function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, useCapture, eventTargetResolver) {\n        var isTNodeDirectiveHost = isDirectiveHost(tNode);\n        var firstCreatePass = tView.firstCreatePass;\n        var tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);\n        var context = lView[CONTEXT];\n        // When the ɵɵlistener instruction was generated and is executed we know that there is either a\n        // native listener or a directive output on this element. As such we we know that we will have to\n        // register a listener and store its cleanup function on LView.\n        var lCleanup = getOrCreateLViewCleanup(lView);\n        ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n        var processOutputs = true;\n        // Adding a native event listener is applicable when:\n        // - The corresponding TNode represents a DOM element.\n        // - The event target has a resolver (usually resulting in a global object,\n        //   such as `window` or `document`).\n        if ((tNode.type & 3 /* AnyRNode */) || eventTargetResolver) {\n            var native = getNativeByTNode(tNode, lView);\n            var target = eventTargetResolver ? eventTargetResolver(native) : native;\n            var lCleanupIndex = lCleanup.length;\n            var idxOrTargetGetter = eventTargetResolver ?\n                function (_lView) { return eventTargetResolver(unwrapRNode(_lView[tNode.index])); } :\n                tNode.index;\n            // In order to match current behavior, native DOM event listeners must be added for all\n            // events (including outputs).\n            if (isProceduralRenderer(renderer)) {\n                // There might be cases where multiple directives on the same element try to register an event\n                // handler function for the same event. In this situation we want to avoid registration of\n                // several native listeners as each registration would be intercepted by NgZone and\n                // trigger change detection. This would mean that a single user action would result in several\n                // change detections being invoked. To avoid this situation we want to have only one call to\n                // native handler registration (for the same element and same type of event).\n                //\n                // In order to have just one native event handler in presence of multiple handler functions,\n                // we just register a first handler function as a native event listener and then chain\n                // (coalesce) other handler functions on top of the first native handler function.\n                var existingListener = null;\n                // Please note that the coalescing described here doesn't happen for events specifying an\n                // alternative target (ex. (document:click)) - this is to keep backward compatibility with the\n                // view engine.\n                // Also, we don't have to search for existing listeners is there are no directives\n                // matching on a given node as we can't register multiple event handlers for the same event in\n                // a template (this would mean having duplicate attributes).\n                if (!eventTargetResolver && isTNodeDirectiveHost) {\n                    existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n                }\n                if (existingListener !== null) {\n                    // Attach a new listener to coalesced listeners list, maintaining the order in which\n                    // listeners are registered. For performance reasons, we keep a reference to the last\n                    // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through\n                    // the entire set each time we need to add a new listener.\n                    var lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;\n                    lastListenerFn.__ngNextListenerFn__ = listenerFn;\n                    existingListener.__ngLastListenerFn__ = listenerFn;\n                    processOutputs = false;\n                }\n                else {\n                    listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);\n                    var cleanupFn = renderer.listen(target, eventName, listenerFn);\n                    ngDevMode && ngDevMode.rendererAddEventListener++;\n                    lCleanup.push(listenerFn, cleanupFn);\n                    tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);\n                }\n            }\n            else {\n                listenerFn = wrapListener(tNode, lView, context, listenerFn, true /** preventDefault */);\n                target.addEventListener(eventName, listenerFn, useCapture);\n                ngDevMode && ngDevMode.rendererAddEventListener++;\n                lCleanup.push(listenerFn);\n                tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, useCapture);\n            }\n        }\n        else {\n            // Even if there is no native listener to add, we still need to wrap the listener so that OnPush\n            // ancestors are marked dirty when an event occurs.\n            listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);\n        }\n        // subscribe to directive outputs\n        var outputs = tNode.outputs;\n        var props;\n        if (processOutputs && outputs !== null && (props = outputs[eventName])) {\n            var propsLength = props.length;\n            if (propsLength) {\n                for (var i = 0; i < propsLength; i += 2) {\n                    var index = props[i];\n                    ngDevMode && assertIndexInRange(lView, index);\n                    var minifiedName = props[i + 1];\n                    var directiveInstance = lView[index];\n                    var output = directiveInstance[minifiedName];\n                    if (ngDevMode && !isObservable(output)) {\n                        throw new Error(\"@Output \" + minifiedName + \" not initialized in '\" + directiveInstance.constructor.name + \"'.\");\n                    }\n                    var subscription = output.subscribe(listenerFn);\n                    var idx = lCleanup.length;\n                    lCleanup.push(listenerFn, subscription);\n                    tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n                }\n            }\n        }\n    }\n    function executeListenerWithErrorHandling(lView, context, listenerFn, e) {\n        try {\n            profiler(6 /* OutputStart */, context, listenerFn);\n            // Only explicitly returning false from a listener should preventDefault\n            return listenerFn(e) !== false;\n        }\n        catch (error) {\n            handleError(lView, error);\n            return false;\n        }\n        finally {\n            profiler(7 /* OutputEnd */, context, listenerFn);\n        }\n    }\n    /**\n     * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,\n     * if applicable.\n     *\n     * @param tNode The TNode associated with this listener\n     * @param lView The LView that contains this listener\n     * @param listenerFn The listener function to call\n     * @param wrapWithPreventDefault Whether or not to prevent default behavior\n     * (the procedural renderer does this already, so in those cases, we should skip)\n     */\n    function wrapListener(tNode, lView, context, listenerFn, wrapWithPreventDefault) {\n        // Note: we are performing most of the work in the listener function itself\n        // to optimize listener registration.\n        return function wrapListenerIn_markDirtyAndPreventDefault(e) {\n            // Ivy uses `Function` as a special token that allows us to unwrap the function\n            // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`.\n            if (e === Function) {\n                return listenerFn;\n            }\n            // In order to be backwards compatible with View Engine, events on component host nodes\n            // must also mark the component view itself dirty (i.e. the view that it owns).\n            var startView = tNode.flags & 2 /* isComponentHost */ ?\n                getComponentLViewByIndex(tNode.index, lView) :\n                lView;\n            // See interfaces/view.ts for more on LViewFlags.ManualOnPush\n            if ((lView[FLAGS] & 32 /* ManualOnPush */) === 0) {\n                markViewDirty(startView);\n            }\n            var result = executeListenerWithErrorHandling(lView, context, listenerFn, e);\n            // A just-invoked listener function might have coalesced listeners so we need to check for\n            // their presence and invoke as needed.\n            var nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;\n            while (nextListenerFn) {\n                // We should prevent default if any of the listeners explicitly return false\n                result = executeListenerWithErrorHandling(lView, context, nextListenerFn, e) && result;\n                nextListenerFn = nextListenerFn.__ngNextListenerFn__;\n            }\n            if (wrapWithPreventDefault && result === false) {\n                e.preventDefault();\n                // Necessary for legacy browsers that don't support preventDefault (e.g. IE)\n                e.returnValue = false;\n            }\n            return result;\n        };\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Retrieves a context at the level specified and saves it as the global, contextViewData.\n     * Will get the next level up if level is not specified.\n     *\n     * This is used to save contexts of parent views so they can be bound in embedded views, or\n     * in conjunction with reference() to bind a ref from a parent view.\n     *\n     * @param level The relative level of the view from which to grab context compared to contextVewData\n     * @returns context\n     *\n     * @codeGenApi\n     */\n    function ɵɵnextContext(level) {\n        if (level === void 0) { level = 1; }\n        return nextContextImpl(level);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Checks a given node against matching projection slots and returns the\n     * determined slot index. Returns \"null\" if no slot matched the given node.\n     *\n     * This function takes into account the parsed ngProjectAs selector from the\n     * node's attributes. If present, it will check whether the ngProjectAs selector\n     * matches any of the projection slot selectors.\n     */\n    function matchingProjectionSlotIndex(tNode, projectionSlots) {\n        var wildcardNgContentIndex = null;\n        var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n        for (var i = 0; i < projectionSlots.length; i++) {\n            var slotValue = projectionSlots[i];\n            // The last wildcard projection slot should match all nodes which aren't matching\n            // any selector. This is necessary to be backwards compatible with view engine.\n            if (slotValue === '*') {\n                wildcardNgContentIndex = i;\n                continue;\n            }\n            // If we ran into an `ngProjectAs` attribute, we should match its parsed selector\n            // to the list of selectors, otherwise we fall back to matching against the node.\n            if (ngProjectAsAttrVal === null ?\n                isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */ true) :\n                isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {\n                return i; // first matching selector \"captures\" a given node\n            }\n        }\n        return wildcardNgContentIndex;\n    }\n    /**\n     * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n     * It takes all the selectors from the entire component's template and decides where\n     * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n     * backed by a selector).\n     *\n     * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n     * un-parsed form.\n     *\n     * The parsed form is needed for efficient matching of a node against a given CSS selector.\n     * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n     *\n     * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n     * drawbacks:\n     * - having only a textual form would require runtime parsing of CSS selectors;\n     * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n     * template author).\n     *\n     * @param projectionSlots? A collection of projection slots. A projection slot can be based\n     *        on a parsed CSS selectors or set to the wildcard selector (\"*\") in order to match\n     *        all nodes which do not match any selector. If not specified, a single wildcard\n     *        selector projection slot will be defined.\n     *\n     * @codeGenApi\n     */\n    function ɵɵprojectionDef(projectionSlots) {\n        var componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];\n        if (!componentNode.projection) {\n            // If no explicit projection slots are defined, fall back to a single\n            // projection slot with the wildcard selector.\n            var numProjectionSlots = projectionSlots ? projectionSlots.length : 1;\n            var projectionHeads = componentNode.projection =\n                newArray(numProjectionSlots, null);\n            var tails = projectionHeads.slice();\n            var componentChild = componentNode.child;\n            while (componentChild !== null) {\n                var slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;\n                if (slotIndex !== null) {\n                    if (tails[slotIndex]) {\n                        tails[slotIndex].projectionNext = componentChild;\n                    }\n                    else {\n                        projectionHeads[slotIndex] = componentChild;\n                    }\n                    tails[slotIndex] = componentChild;\n                }\n                componentChild = componentChild.next;\n            }\n        }\n    }\n    /**\n     * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n     * to the projectionDef instruction.\n     *\n     * @param nodeIndex\n     * @param selectorIndex:\n     *        - 0 when the selector is `*` (or unspecified as this is the default value),\n     *        - 1 based index of the selector from the {@link projectionDef}\n     *\n     * @codeGenApi\n     */\n    function ɵɵprojection(nodeIndex, selectorIndex, attrs) {\n        if (selectorIndex === void 0) { selectorIndex = 0; }\n        var lView = getLView();\n        var tView = getTView();\n        var tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* Projection */, null, attrs || null);\n        // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n        if (tProjectionNode.projection === null)\n            tProjectionNode.projection = selectorIndex;\n        // `<ng-content>` has no content\n        setCurrentTNodeAsNotParent();\n        if ((tProjectionNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {\n            // re-distribution of projectable nodes is stored on a component's view level\n            applyProjection(tView, lView, tProjectionNode);\n        }\n    }\n\n    /**\n     *\n     * Update an interpolated property on an element with a lone bound value\n     *\n     * Used when the value passed to a property has 1 interpolated value in it, an no additional text\n     * surrounds that interpolated value:\n     *\n     * ```html\n     * <div title=\"{{v0}}\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate('title', v0);\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate(propName, v0, sanitizer) {\n        ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer);\n        return ɵɵpropertyInterpolate;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with single bound value surrounded by text.\n     *\n     * Used when the value passed to a property has 1 interpolated value in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate1(propName, prefix, v0, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);\n        }\n        return ɵɵpropertyInterpolate1;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 2 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 2 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate2(propName, prefix, v0, i0, v1, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);\n        }\n        return ɵɵpropertyInterpolate2;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 3 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 3 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate3(\n     * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate3(propName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n        }\n        return ɵɵpropertyInterpolate3;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 4 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 4 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate4(\n     * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate4(propName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n        }\n        return ɵɵpropertyInterpolate4;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 5 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 5 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate5(\n     * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate5(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n        }\n        return ɵɵpropertyInterpolate5;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 6 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 6 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate6(\n     *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate6(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n        }\n        return ɵɵpropertyInterpolate6;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 7 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 7 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate7(\n     *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate7(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);\n        }\n        return ɵɵpropertyInterpolate7;\n    }\n    /**\n     *\n     * Update an interpolated property on an element with 8 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 8 interpolated values in it:\n     *\n     * ```html\n     * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolate8(\n     *  'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param i6 Static value used for concatenation only.\n     * @param v7 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            ngDevMode &&\n                storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);\n        }\n        return ɵɵpropertyInterpolate8;\n    }\n    /**\n     * Update an interpolated property on an element with 9 or more bound values surrounded by text.\n     *\n     * Used when the number of interpolated values exceeds 8.\n     *\n     * ```html\n     * <div\n     *  title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is::\n     *\n     * ```ts\n     * ɵɵpropertyInterpolateV(\n     *  'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n     *  'suffix']);\n     * ```\n     *\n     * If the property name also exists as an input property on one of the element's directives,\n     * the component property will be set instead of the element property. This check must\n     * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n     *\n     * @param propName The name of the property to update.\n     * @param values The collection of values and the strings inbetween those values, beginning with a\n     * string prefix and ending with a string suffix.\n     * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n     * @param sanitizer An optional sanitizer function\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵpropertyInterpolateV(propName, values, sanitizer) {\n        var lView = getLView();\n        var interpolatedValue = interpolationV(lView, values);\n        if (interpolatedValue !== NO_CHANGE) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n            if (ngDevMode) {\n                var interpolationInBetween = [values[0]]; // prefix\n                for (var i = 2; i < values.length; i += 2) {\n                    interpolationInBetween.push(values[i]);\n                }\n                storePropertyBindingMetadata.apply(void 0, __spreadArray([tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1], __read(interpolationInBetween)));\n            }\n        }\n        return ɵɵpropertyInterpolateV;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * NOTE: The word `styling` is used interchangeably as style or class styling.\n     *\n     * This file contains code to link styling instructions together so that they can be replayed in\n     * priority order. The file exists because Ivy styling instruction execution order does not match\n     * that of the priority order. The purpose of this code is to create a linked list so that the\n     * instructions can be traversed in priority order when computing the styles.\n     *\n     * Assume we are dealing with the following code:\n     * ```\n     * @Component({\n     *   template: `\n     *     <my-cmp [style]=\" {color: '#001'} \"\n     *             [style.color]=\" #002 \"\n     *             dir-style-color-1\n     *             dir-style-color-2> `\n     * })\n     * class ExampleComponent {\n     *   static ngComp = ... {\n     *     ...\n     *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n     *     ɵɵstyleMap({color: '#001'});\n     *     ɵɵstyleProp('color', '#002');\n     *     ...\n     *   }\n     * }\n     *\n     * @Directive({\n     *   selector: `[dir-style-color-1]',\n     * })\n     * class Style1Directive {\n     *   @HostBinding('style') style = {color: '#005'};\n     *   @HostBinding('style.color') color = '#006';\n     *\n     *   static ngDir = ... {\n     *     ...\n     *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n     *     ɵɵstyleMap({color: '#005'});\n     *     ɵɵstyleProp('color', '#006');\n     *     ...\n     *   }\n     * }\n     *\n     * @Directive({\n     *   selector: `[dir-style-color-2]',\n     * })\n     * class Style2Directive {\n     *   @HostBinding('style') style = {color: '#007'};\n     *   @HostBinding('style.color') color = '#008';\n     *\n     *   static ngDir = ... {\n     *     ...\n     *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n     *     ɵɵstyleMap({color: '#007'});\n     *     ɵɵstyleProp('color', '#008');\n     *     ...\n     *   }\n     * }\n     *\n     * @Directive({\n     *   selector: `my-cmp',\n     * })\n     * class MyComponent {\n     *   @HostBinding('style') style = {color: '#003'};\n     *   @HostBinding('style.color') color = '#004';\n     *\n     *   static ngComp = ... {\n     *     ...\n     *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n     *     ɵɵstyleMap({color: '#003'});\n     *     ɵɵstyleProp('color', '#004');\n     *     ...\n     *   }\n     * }\n     * ```\n     *\n     * The Order of instruction execution is:\n     *\n     * NOTE: the comment binding location is for illustrative purposes only.\n     *\n     * ```\n     * // Template: (ExampleComponent)\n     *     ɵɵstyleMap({color: '#001'});   // Binding index: 10\n     *     ɵɵstyleProp('color', '#002');  // Binding index: 12\n     * // MyComponent\n     *     ɵɵstyleMap({color: '#003'});   // Binding index: 20\n     *     ɵɵstyleProp('color', '#004');  // Binding index: 22\n     * // Style1Directive\n     *     ɵɵstyleMap({color: '#005'});   // Binding index: 24\n     *     ɵɵstyleProp('color', '#006');  // Binding index: 26\n     * // Style2Directive\n     *     ɵɵstyleMap({color: '#007'});   // Binding index: 28\n     *     ɵɵstyleProp('color', '#008');  // Binding index: 30\n     * ```\n     *\n     * The correct priority order of concatenation is:\n     *\n     * ```\n     * // MyComponent\n     *     ɵɵstyleMap({color: '#003'});   // Binding index: 20\n     *     ɵɵstyleProp('color', '#004');  // Binding index: 22\n     * // Style1Directive\n     *     ɵɵstyleMap({color: '#005'});   // Binding index: 24\n     *     ɵɵstyleProp('color', '#006');  // Binding index: 26\n     * // Style2Directive\n     *     ɵɵstyleMap({color: '#007'});   // Binding index: 28\n     *     ɵɵstyleProp('color', '#008');  // Binding index: 30\n     * // Template: (ExampleComponent)\n     *     ɵɵstyleMap({color: '#001'});   // Binding index: 10\n     *     ɵɵstyleProp('color', '#002');  // Binding index: 12\n     * ```\n     *\n     * What color should be rendered?\n     *\n     * Once the items are correctly sorted in the list, the answer is simply the last item in the\n     * concatenation list which is `#002`.\n     *\n     * To do so we keep a linked list of all of the bindings which pertain to this element.\n     * Notice that the bindings are inserted in the order of execution, but the `TView.data` allows\n     * us to traverse them in the order of priority.\n     *\n     * |Idx|`TView.data`|`LView`          | Notes\n     * |---|------------|-----------------|--------------\n     * |...|            |                 |\n     * |10 |`null`      |`{color: '#001'}`| `ɵɵstyleMap('color', {color: '#001'})`\n     * |11 |`30 | 12`   | ...             |\n     * |12 |`color`     |`'#002'`         | `ɵɵstyleProp('color', '#002')`\n     * |13 |`10 | 0`    | ...             |\n     * |...|            |                 |\n     * |20 |`null`      |`{color: '#003'}`| `ɵɵstyleMap('color', {color: '#003'})`\n     * |21 |`0 | 22`    | ...             |\n     * |22 |`color`     |`'#004'`         | `ɵɵstyleProp('color', '#004')`\n     * |23 |`20 | 24`   | ...             |\n     * |24 |`null`      |`{color: '#005'}`| `ɵɵstyleMap('color', {color: '#005'})`\n     * |25 |`22 | 26`   | ...             |\n     * |26 |`color`     |`'#006'`         | `ɵɵstyleProp('color', '#006')`\n     * |27 |`24 | 28`   | ...             |\n     * |28 |`null`      |`{color: '#007'}`| `ɵɵstyleMap('color', {color: '#007'})`\n     * |29 |`26 | 30`   | ...             |\n     * |30 |`color`     |`'#008'`         | `ɵɵstyleProp('color', '#008')`\n     * |31 |`28 | 10`   | ...             |\n     *\n     * The above data structure allows us to re-concatenate the styling no matter which data binding\n     * changes.\n     *\n     * NOTE: in addition to keeping track of next/previous index the `TView.data` also stores prev/next\n     * duplicate bit. The duplicate bit if true says there either is a binding with the same name or\n     * there is a map (which may contain the name). This information is useful in knowing if other\n     * styles with higher priority need to be searched for overwrites.\n     *\n     * NOTE: See `should support example in 'tnode_linked_list.ts' documentation` in\n     * `tnode_linked_list_spec.ts` for working example.\n     */\n    var __unused_const_as_closure_does_not_like_standalone_comment_blocks__;\n    /**\n     * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked\n     * list of styles and compute the duplicate flag.\n     *\n     * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.\n     *\n     * The function works by keeping track of `tStylingRange` which contains two pointers pointing to\n     * the head/tail of the template portion of the styles.\n     *  - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`\n     *  - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`\n     *\n     * @param tData The `TData` to insert into.\n     * @param tNode `TNode` associated with the styling element.\n     * @param tStylingKey See `TStylingKey`.\n     * @param index location of where `tStyleValue` should be stored (and linked into list.)\n     * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of\n     *               template.)\n     * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n     *                       `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n     */\n    function insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {\n        ngDevMode && assertFirstUpdatePass(getTView());\n        var tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;\n        var tmplHead = getTStylingRangePrev(tBindings);\n        var tmplTail = getTStylingRangeNext(tBindings);\n        tData[index] = tStylingKeyWithStatic;\n        var isKeyDuplicateOfStatic = false;\n        var tStylingKey;\n        if (Array.isArray(tStylingKeyWithStatic)) {\n            // We are case when the `TStylingKey` contains static fields as well.\n            var staticKeyValueArray = tStylingKeyWithStatic;\n            tStylingKey = staticKeyValueArray[1]; // unwrap.\n            // We need to check if our key is present in the static so that we can mark it as duplicate.\n            if (tStylingKey === null ||\n                keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {\n                // tStylingKey is present in the statics, need to mark it as duplicate.\n                isKeyDuplicateOfStatic = true;\n            }\n        }\n        else {\n            tStylingKey = tStylingKeyWithStatic;\n        }\n        if (isHostBinding) {\n            // We are inserting host bindings\n            // If we don't have template bindings then `tail` is 0.\n            var hasTemplateBindings = tmplTail !== 0;\n            // This is important to know because that means that the `head` can't point to the first\n            // template bindings (there are none.) Instead the head points to the tail of the template.\n            if (hasTemplateBindings) {\n                // template head's \"prev\" will point to last host binding or to 0 if no host bindings yet\n                var previousNode = getTStylingRangePrev(tData[tmplHead + 1]);\n                tData[index + 1] = toTStylingRange(previousNode, tmplHead);\n                // if a host binding has already been registered, we need to update the next of that host\n                // binding to point to this one\n                if (previousNode !== 0) {\n                    // We need to update the template-tail value to point to us.\n                    tData[previousNode + 1] =\n                        setTStylingRangeNext(tData[previousNode + 1], index);\n                }\n                // The \"previous\" of the template binding head should point to this host binding\n                tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);\n            }\n            else {\n                tData[index + 1] = toTStylingRange(tmplHead, 0);\n                // if a host binding has already been registered, we need to update the next of that host\n                // binding to point to this one\n                if (tmplHead !== 0) {\n                    // We need to update the template-tail value to point to us.\n                    tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);\n                }\n                // if we don't have template, the head points to template-tail, and needs to be advanced.\n                tmplHead = index;\n            }\n        }\n        else {\n            // We are inserting in template section.\n            // We need to set this binding's \"previous\" to the current template tail\n            tData[index + 1] = toTStylingRange(tmplTail, 0);\n            ngDevMode &&\n                assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.');\n            if (tmplHead === 0) {\n                tmplHead = index;\n            }\n            else {\n                // We need to update the previous value \"next\" to point to this binding\n                tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);\n            }\n            tmplTail = index;\n        }\n        // Now we need to update / compute the duplicates.\n        // Starting with our location search towards head (least priority)\n        if (isKeyDuplicateOfStatic) {\n            tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);\n        }\n        markDuplicates(tData, tStylingKey, index, true, isClassBinding);\n        markDuplicates(tData, tStylingKey, index, false, isClassBinding);\n        markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);\n        tBindings = toTStylingRange(tmplHead, tmplTail);\n        if (isClassBinding) {\n            tNode.classBindings = tBindings;\n        }\n        else {\n            tNode.styleBindings = tBindings;\n        }\n    }\n    /**\n     * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.\n     *\n     * @param tNode `TNode` where the residual is stored.\n     * @param tStylingKey `TStylingKey` to store.\n     * @param tData `TData` associated with the current `LView`.\n     * @param index location of where `tStyleValue` should be stored (and linked into list.)\n     * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n     *                       `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n     */\n    function markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {\n        var residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;\n        if (residual != null /* or undefined */ && typeof tStylingKey == 'string' &&\n            keyValueArrayIndexOf(residual, tStylingKey) >= 0) {\n            // We have duplicate in the residual so mark ourselves as duplicate.\n            tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);\n        }\n    }\n    /**\n     * Marks `TStyleValue`s as duplicates if another style binding in the list has the same\n     * `TStyleValue`.\n     *\n     * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once\n     * with it set to `false` to search both the previous as well as next items in the list.\n     *\n     * No duplicate case\n     * ```\n     *   [style.color]\n     *   [style.width.px] <<- index\n     *   [style.height.px]\n     * ```\n     *\n     * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no\n     * duplicates because `width` is not found in any other part of the linked list.\n     *\n     * Duplicate case\n     * ```\n     *   [style.color]\n     *   [style.width.em]\n     *   [style.width.px] <<- index\n     * ```\n     * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`\n     * because `width` is found in the chain.\n     *\n     * Map case 1\n     * ```\n     *   [style.width.px]\n     *   [style.color]\n     *   [style]  <<- index\n     * ```\n     * In the above case adding `[style]` will produce a duplicate with any other bindings because\n     * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.\n     *\n     * Map case 2\n     * ```\n     *   [style]\n     *   [style.width.px]\n     *   [style.color]  <<- index\n     * ```\n     * In the above case adding `[style.color]` will produce a duplicate because there is already a\n     * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or\n     * `width`.\n     *\n     * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.\n     * NOTE: We use `style` as example, but same logic is applied to `class`es as well.\n     *\n     * @param tData `TData` where the linked list is stored.\n     * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in\n     *        the linked list.\n     * @param index Starting location in the linked list to search from\n     * @param isPrevDir Direction.\n     *        - `true` for previous (lower priority);\n     *        - `false` for next (higher priority).\n     */\n    function markDuplicates(tData, tStylingKey, index, isPrevDir, isClassBinding) {\n        var tStylingAtIndex = tData[index + 1];\n        var isMap = tStylingKey === null;\n        var cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);\n        var foundDuplicate = false;\n        // We keep iterating as long as we have a cursor\n        // AND either:\n        // - we found what we are looking for, OR\n        // - we are a map in which case we have to continue searching even after we find what we were\n        //   looking for since we are a wild card and everything needs to be flipped to duplicate.\n        while (cursor !== 0 && (foundDuplicate === false || isMap)) {\n            ngDevMode && assertIndexInRange(tData, cursor);\n            var tStylingValueAtCursor = tData[cursor];\n            var tStyleRangeAtCursor = tData[cursor + 1];\n            if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {\n                foundDuplicate = true;\n                tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) :\n                    setTStylingRangePrevDuplicate(tStyleRangeAtCursor);\n            }\n            cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) :\n                getTStylingRangeNext(tStyleRangeAtCursor);\n        }\n        if (foundDuplicate) {\n            // if we found a duplicate, than mark ourselves.\n            tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) :\n                setTStylingRangeNextDuplicate(tStylingAtIndex);\n        }\n    }\n    /**\n     * Determines if two `TStylingKey`s are a match.\n     *\n     * When computing whether a binding contains a duplicate, we need to compare if the instruction\n     * `TStylingKey` has a match.\n     *\n     * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:\n     * - `color`\n     *    - `color`    // Match another color\n     *    - `null`     // That means that `tStylingKey` is a `classMap`/`styleMap` instruction\n     *    - `['', 'color', 'other', true]` // wrapped `color` so match\n     *    - `['', null, 'other', true]`       // wrapped `null` so match\n     *    - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`\n     * - `null`       // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction\n     *\n     * @param tStylingKeyCursor\n     * @param tStylingKey\n     */\n    function isStylingMatch(tStylingKeyCursor, tStylingKey) {\n        ngDevMode &&\n            assertNotEqual(Array.isArray(tStylingKey), true, 'Expected that \\'tStylingKey\\' has been unwrapped');\n        if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that\n            // location so we must assume that we have a match.\n            tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it\n            // contains a match.\n            (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) ===\n                tStylingKey // If the keys match explicitly than we are a match.\n        ) {\n            return true;\n        }\n        else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {\n            // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has\n            // statics and we need to check those as well.\n            return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >=\n                0; // see if we are matching the key\n        }\n        return false;\n    }\n\n    /**\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://angular.io/license\n     */\n    // Global state of the parser. (This makes parser non-reentrant, but that is not an issue)\n    var parserState = {\n        textEnd: 0,\n        key: 0,\n        keyEnd: 0,\n        value: 0,\n        valueEnd: 0,\n    };\n    /**\n     * Retrieves the last parsed `key` of style.\n     * @param text the text to substring the key from.\n     */\n    function getLastParsedKey(text) {\n        return text.substring(parserState.key, parserState.keyEnd);\n    }\n    /**\n     * Retrieves the last parsed `value` of style.\n     * @param text the text to substring the key from.\n     */\n    function getLastParsedValue(text) {\n        return text.substring(parserState.value, parserState.valueEnd);\n    }\n    /**\n     * Initializes `className` string for parsing and parses the first token.\n     *\n     * This function is intended to be used in this format:\n     * ```\n     * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n     *   const key = getLastParsedKey();\n     *   ...\n     * }\n     * ```\n     * @param text `className` to parse\n     * @returns index where the next invocation of `parseClassNameNext` should resume.\n     */\n    function parseClassName(text) {\n        resetParserState(text);\n        return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n    }\n    /**\n     * Parses next `className` token.\n     *\n     * This function is intended to be used in this format:\n     * ```\n     * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n     *   const key = getLastParsedKey();\n     *   ...\n     * }\n     * ```\n     *\n     * @param text `className` to parse\n     * @param index where the parsing should resume.\n     * @returns index where the next invocation of `parseClassNameNext` should resume.\n     */\n    function parseClassNameNext(text, index) {\n        var end = parserState.textEnd;\n        if (end === index) {\n            return -1;\n        }\n        index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);\n        return consumeWhitespace(text, index, end);\n    }\n    /**\n     * Initializes `cssText` string for parsing and parses the first key/values.\n     *\n     * This function is intended to be used in this format:\n     * ```\n     * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n     *   const key = getLastParsedKey();\n     *   const value = getLastParsedValue();\n     *   ...\n     * }\n     * ```\n     * @param text `cssText` to parse\n     * @returns index where the next invocation of `parseStyleNext` should resume.\n     */\n    function parseStyle(text) {\n        resetParserState(text);\n        return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n    }\n    /**\n     * Parses the next `cssText` key/values.\n     *\n     * This function is intended to be used in this format:\n     * ```\n     * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n     *   const key = getLastParsedKey();\n     *   const value = getLastParsedValue();\n     *   ...\n     * }\n     *\n     * @param text `cssText` to parse\n     * @param index where the parsing should resume.\n     * @returns index where the next invocation of `parseStyleNext` should resume.\n     */\n    function parseStyleNext(text, startIndex) {\n        var end = parserState.textEnd;\n        var index = parserState.key = consumeWhitespace(text, startIndex, end);\n        if (end === index) {\n            // we reached an end so just quit\n            return -1;\n        }\n        index = parserState.keyEnd = consumeStyleKey(text, index, end);\n        index = consumeSeparator(text, index, end, 58 /* COLON */);\n        index = parserState.value = consumeWhitespace(text, index, end);\n        index = parserState.valueEnd = consumeStyleValue(text, index, end);\n        return consumeSeparator(text, index, end, 59 /* SEMI_COLON */);\n    }\n    /**\n     * Reset the global state of the styling parser.\n     * @param text The styling text to parse.\n     */\n    function resetParserState(text) {\n        parserState.key = 0;\n        parserState.keyEnd = 0;\n        parserState.value = 0;\n        parserState.valueEnd = 0;\n        parserState.textEnd = text.length;\n    }\n    /**\n     * Returns index of next non-whitespace character.\n     *\n     * @param text Text to scan\n     * @param startIndex Starting index of character where the scan should start.\n     * @param endIndex Ending index of character where the scan should end.\n     * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at\n     *          that location.)\n     */\n    function consumeWhitespace(text, startIndex, endIndex) {\n        while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* SPACE */) {\n            startIndex++;\n        }\n        return startIndex;\n    }\n    /**\n     * Returns index of last char in class token.\n     *\n     * @param text Text to scan\n     * @param startIndex Starting index of character where the scan should start.\n     * @param endIndex Ending index of character where the scan should end.\n     * @returns Index after last char in class token.\n     */\n    function consumeClassToken(text, startIndex, endIndex) {\n        while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* SPACE */) {\n            startIndex++;\n        }\n        return startIndex;\n    }\n    /**\n     * Consumes all of the characters belonging to style key and token.\n     *\n     * @param text Text to scan\n     * @param startIndex Starting index of character where the scan should start.\n     * @param endIndex Ending index of character where the scan should end.\n     * @returns Index after last style key character.\n     */\n    function consumeStyleKey(text, startIndex, endIndex) {\n        var ch;\n        while (startIndex < endIndex &&\n            ((ch = text.charCodeAt(startIndex)) === 45 /* DASH */ || ch === 95 /* UNDERSCORE */ ||\n                ((ch & -33 /* UPPER_CASE */) >= 65 /* A */ && (ch & -33 /* UPPER_CASE */) <= 90 /* Z */) ||\n                (ch >= 48 /* ZERO */ && ch <= 57 /* NINE */))) {\n            startIndex++;\n        }\n        return startIndex;\n    }\n    /**\n     * Consumes all whitespace and the separator `:` after the style key.\n     *\n     * @param text Text to scan\n     * @param startIndex Starting index of character where the scan should start.\n     * @param endIndex Ending index of character where the scan should end.\n     * @returns Index after separator and surrounding whitespace.\n     */\n    function consumeSeparator(text, startIndex, endIndex, separator) {\n        startIndex = consumeWhitespace(text, startIndex, endIndex);\n        if (startIndex < endIndex) {\n            if (ngDevMode && text.charCodeAt(startIndex) !== separator) {\n                malformedStyleError(text, String.fromCharCode(separator), startIndex);\n            }\n            startIndex++;\n        }\n        return startIndex;\n    }\n    /**\n     * Consumes style value honoring `url()` and `\"\"` text.\n     *\n     * @param text Text to scan\n     * @param startIndex Starting index of character where the scan should start.\n     * @param endIndex Ending index of character where the scan should end.\n     * @returns Index after last style value character.\n     */\n    function consumeStyleValue(text, startIndex, endIndex) {\n        var ch1 = -1; // 1st previous character\n        var ch2 = -1; // 2nd previous character\n        var ch3 = -1; // 3rd previous character\n        var i = startIndex;\n        var lastChIndex = i;\n        while (i < endIndex) {\n            var ch = text.charCodeAt(i++);\n            if (ch === 59 /* SEMI_COLON */) {\n                return lastChIndex;\n            }\n            else if (ch === 34 /* DOUBLE_QUOTE */ || ch === 39 /* SINGLE_QUOTE */) {\n                lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);\n            }\n            else if (startIndex ===\n                i - 4 && // We have seen only 4 characters so far \"URL(\" (Ignore \"foo_URL()\")\n                ch3 === 85 /* U */ &&\n                ch2 === 82 /* R */ && ch1 === 76 /* L */ && ch === 40 /* OPEN_PAREN */) {\n                lastChIndex = i = consumeQuotedText(text, 41 /* CLOSE_PAREN */, i, endIndex);\n            }\n            else if (ch > 32 /* SPACE */) {\n                // if we have a non-whitespace character then capture its location\n                lastChIndex = i;\n            }\n            ch3 = ch2;\n            ch2 = ch1;\n            ch1 = ch & -33 /* UPPER_CASE */;\n        }\n        return lastChIndex;\n    }\n    /**\n     * Consumes all of the quoted characters.\n     *\n     * @param text Text to scan\n     * @param quoteCharCode CharCode of either `\"` or `'` quote or `)` for `url(...)`.\n     * @param startIndex Starting index of character where the scan should start.\n     * @param endIndex Ending index of character where the scan should end.\n     * @returns Index after quoted characters.\n     */\n    function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {\n        var ch1 = -1; // 1st previous character\n        var index = startIndex;\n        while (index < endIndex) {\n            var ch = text.charCodeAt(index++);\n            if (ch == quoteCharCode && ch1 !== 92 /* BACK_SLASH */) {\n                return index;\n            }\n            if (ch == 92 /* BACK_SLASH */ && ch1 === 92 /* BACK_SLASH */) {\n                // two back slashes cancel each other out. For example `\"\\\\\"` should properly end the\n                // quotation. (It should not assume that the last `\"` is escaped.)\n                ch1 = 0;\n            }\n            else {\n                ch1 = ch;\n            }\n        }\n        throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) :\n            new Error();\n    }\n    function malformedStyleError(text, expecting, index) {\n        ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');\n        throw throwError(\"Malformed style at location \" + index + \" in string '\" + text.substring(0, index) + '[>>' +\n            text.substring(index, index + 1) + '<<]' + text.substr(index + 1) +\n            (\"'. Expecting '\" + expecting + \"'.\"));\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Update a style binding on an element with the provided value.\n     *\n     * If the style value is falsy then it will be removed from the element\n     * (or assigned a different value depending if there are any styles placed\n     * on the element with `styleMap` or any static styles that are\n     * present from when the element was created with `styling`).\n     *\n     * Note that the styling element is updated as part of `stylingApply`.\n     *\n     * @param prop A valid CSS property.\n     * @param value New value to write (`null` or an empty string to remove).\n     * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n     *\n     * Note that this will apply the provided style value to the host element if this function is called\n     * within a host binding function.\n     *\n     * @codeGenApi\n     */\n    function ɵɵstyleProp(prop, value, suffix) {\n        checkStylingProperty(prop, value, suffix, false);\n        return ɵɵstyleProp;\n    }\n    /**\n     * Update a class binding on an element with the provided value.\n     *\n     * This instruction is meant to handle the `[class.foo]=\"exp\"` case and,\n     * therefore, the class binding itself must already be allocated using\n     * `styling` within the creation block.\n     *\n     * @param prop A valid CSS class (only one).\n     * @param value A true/false value which will turn the class on or off.\n     *\n     * Note that this will apply the provided class value to the host element if this function\n     * is called within a host binding function.\n     *\n     * @codeGenApi\n     */\n    function ɵɵclassProp(className, value) {\n        checkStylingProperty(className, value, null, true);\n        return ɵɵclassProp;\n    }\n    /**\n     * Update style bindings using an object literal on an element.\n     *\n     * This instruction is meant to apply styling via the `[style]=\"exp\"` template bindings.\n     * When styles are applied to the element they will then be updated with respect to\n     * any styles/classes set via `styleProp`. If any styles are set to falsy\n     * then they will be removed from the element.\n     *\n     * Note that the styling instruction will not be applied until `stylingApply` is called.\n     *\n     * @param styles A key/value style map of the styles that will be applied to the given element.\n     *        Any missing styles (that have already been applied to the element beforehand) will be\n     *        removed (unset) from the element's styling.\n     *\n     * Note that this will apply the provided styleMap value to the host element if this function\n     * is called within a host binding.\n     *\n     * @codeGenApi\n     */\n    function ɵɵstyleMap(styles) {\n        checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);\n    }\n    /**\n     * Parse text as style and add values to KeyValueArray.\n     *\n     * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n     * needed. It is only referenced from `ɵɵstyleMap`.\n     *\n     * @param keyValueArray KeyValueArray to add parsed values to.\n     * @param text text to parse.\n     */\n    function styleStringParser(keyValueArray, text) {\n        for (var i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {\n            styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));\n        }\n    }\n    /**\n     * Update class bindings using an object literal or class-string on an element.\n     *\n     * This instruction is meant to apply styling via the `[class]=\"exp\"` template bindings.\n     * When classes are applied to the element they will then be updated with\n     * respect to any styles/classes set via `classProp`. If any\n     * classes are set to falsy then they will be removed from the element.\n     *\n     * Note that the styling instruction will not be applied until `stylingApply` is called.\n     * Note that this will the provided classMap value to the host element if this function is called\n     * within a host binding.\n     *\n     * @param classes A key/value map or string of CSS classes that will be added to the\n     *        given element. Any missing classes (that have already been applied to the element\n     *        beforehand) will be removed (unset) from the element's list of CSS classes.\n     *\n     * @codeGenApi\n     */\n    function ɵɵclassMap(classes) {\n        checkStylingMap(keyValueArraySet, classStringParser, classes, true);\n    }\n    /**\n     * Parse text as class and add values to KeyValueArray.\n     *\n     * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n     * needed. It is only referenced from `ɵɵclassMap`.\n     *\n     * @param keyValueArray KeyValueArray to add parsed values to.\n     * @param text text to parse.\n     */\n    function classStringParser(keyValueArray, text) {\n        for (var i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n            keyValueArraySet(keyValueArray, getLastParsedKey(text), true);\n        }\n    }\n    /**\n     * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.\n     *\n     * @param prop property name.\n     * @param value binding value.\n     * @param suffix suffix for the property (e.g. `em` or `px`)\n     * @param isClassBased `true` if `class` change (`false` if `style`)\n     */\n    function checkStylingProperty(prop, value, suffix, isClassBased) {\n        var lView = getLView();\n        var tView = getTView();\n        // Styling instructions use 2 slots per binding.\n        // 1. one for the value / TStylingKey\n        // 2. one for the intermittent-value / TStylingRange\n        var bindingIndex = incrementBindingIndex(2);\n        if (tView.firstUpdatePass) {\n            stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);\n        }\n        if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n            var tNode = tView.data[getSelectedIndex()];\n            updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);\n        }\n    }\n    /**\n     * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.\n     *\n     * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n     *        function so that `style` can be processed. This is done for tree shaking purposes.\n     * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`\n     *        have different parsers.)\n     * @param value bound value from application\n     * @param isClassBased `true` if `class` change (`false` if `style`)\n     */\n    function checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) {\n        var tView = getTView();\n        var bindingIndex = incrementBindingIndex(2);\n        if (tView.firstUpdatePass) {\n            stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);\n        }\n        var lView = getLView();\n        if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n            // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n            // if so as not to read unnecessarily.\n            var tNode = tView.data[getSelectedIndex()];\n            if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {\n                if (ngDevMode) {\n                    // verify that if we are shadowing then `TData` is appropriately marked so that we skip\n                    // processing this binding in styling resolution.\n                    var tStylingKey = tView.data[bindingIndex];\n                    assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, 'Styling linked list shadow input should be marked as \\'false\\'');\n                }\n                // VE does not concatenate the static portion like we are doing here.\n                // Instead VE just ignores the static completely if dynamic binding is present.\n                // Because of locality we have already set the static portion because we don't know if there\n                // is a dynamic portion until later. If we would ignore the static portion it would look like\n                // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong\n                // thing as it would think that the static portion was removed. For this reason we\n                // concatenate it so that `[ngStyle]`/`[ngClass]`  can continue to work on changed.\n                var staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;\n                ngDevMode && isClassBased === false && staticPrefix !== null &&\n                    assertEqual(staticPrefix.endsWith(';'), true, 'Expecting static portion to end with \\';\\'');\n                if (staticPrefix !== null) {\n                    // We want to make sure that falsy values of `value` become empty strings.\n                    value = concatStringsWithSpace(staticPrefix, value ? value : '');\n                }\n                // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.\n                // This takes over the `[style]` binding. (Same for `[class]`)\n                setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);\n            }\n            else {\n                updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value), isClassBased, bindingIndex);\n            }\n        }\n    }\n    /**\n     * Determines when the binding is in `hostBindings` section\n     *\n     * @param tView Current `TView`\n     * @param bindingIndex index of binding which we would like if it is in `hostBindings`\n     */\n    function isInHostBindings(tView, bindingIndex) {\n        // All host bindings are placed after the expando section.\n        return bindingIndex >= tView.expandoStartIndex;\n    }\n    /**\n     * Collects the necessary information to insert the binding into a linked list of style bindings\n     * using `insertTStylingBinding`.\n     *\n     * @param tView `TView` where the binding linked list will be stored.\n     * @param tStylingKey Property/key of the binding.\n     * @param bindingIndex Index of binding associated with the `prop`\n     * @param isClassBased `true` if `class` change (`false` if `style`)\n     */\n    function stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {\n        ngDevMode && assertFirstUpdatePass(tView);\n        var tData = tView.data;\n        if (tData[bindingIndex + 1] === null) {\n            // The above check is necessary because we don't clear first update pass until first successful\n            // (no exception) template execution. This prevents the styling instruction from double adding\n            // itself to the list.\n            // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n            // if so as not to read unnecessarily.\n            var tNode = tData[getSelectedIndex()];\n            ngDevMode && assertDefined(tNode, 'TNode expected');\n            var isHostBindings = isInHostBindings(tView, bindingIndex);\n            if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {\n                // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.\n                // If there is a directive which uses `@Input('style')` or `@Input('class')` than\n                // we need to neutralize this binding since that directive is shadowing it.\n                // We turn this into a noop by setting the key to `false`\n                tStylingKey = false;\n            }\n            tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);\n            insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);\n        }\n    }\n    /**\n     * Adds static styling information to the binding if applicable.\n     *\n     * The linked list of styles not only stores the list and keys, but also stores static styling\n     * information on some of the keys. This function determines if the key should contain the styling\n     * information and computes it.\n     *\n     * See `TStylingStatic` for more details.\n     *\n     * @param tData `TData` where the linked list is stored.\n     * @param tNode `TNode` for which the styling is being computed.\n     * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     */\n    function wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {\n        var hostDirectiveDef = getCurrentDirectiveDef(tData);\n        var residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n        if (hostDirectiveDef === null) {\n            // We are in template node.\n            // If template node already had styling instruction then it has already collected the static\n            // styling and there is no need to collect them again. We know that we are the first styling\n            // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).\n            var isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;\n            if (isFirstStylingInstructionInTemplate) {\n                // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point\n                // they are already merged and it would not be possible to figure which property belongs where\n                // in the priority.\n                stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);\n                stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);\n                // We know that if we have styling binding in template we can't have residual.\n                residual = null;\n            }\n        }\n        else {\n            // We are in host binding node and there was no binding instruction in template node.\n            // This means that we need to compute the residual.\n            var directiveStylingLast = tNode.directiveStylingLast;\n            var isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;\n            if (isFirstStylingInstructionInHostBinding) {\n                stylingKey =\n                    collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);\n                if (residual === null) {\n                    // - If `null` than either:\n                    //    - Template styling instruction already ran and it has consumed the static\n                    //      styling into its `TStylingKey` and so there is no need to update residual. Instead\n                    //      we need to update the `TStylingKey` associated with the first template node\n                    //      instruction. OR\n                    //    - Some other styling instruction ran and determined that there are no residuals\n                    var templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);\n                    if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {\n                        // Only recompute if `templateStylingKey` had static values. (If no static value found\n                        // then there is nothing to do since this operation can only produce less static keys, not\n                        // more.)\n                        templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased);\n                        templateStylingKey =\n                            collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);\n                        setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);\n                    }\n                }\n                else {\n                    // We only need to recompute residual if it is not `null`.\n                    // - If existing residual (implies there was no template styling). This means that some of\n                    //   the statics may have moved from the residual to the `stylingKey` and so we have to\n                    //   recompute.\n                    // - If `undefined` this is the first time we are running.\n                    residual = collectResidual(tData, tNode, isClassBased);\n                }\n            }\n        }\n        if (residual !== undefined) {\n            isClassBased ? (tNode.residualClasses = residual) : (tNode.residualStyles = residual);\n        }\n        return stylingKey;\n    }\n    /**\n     * Retrieve the `TStylingKey` for the template styling instruction.\n     *\n     * This is needed since `hostBinding` styling instructions are inserted after the template\n     * instruction. While the template instruction needs to update the residual in `TNode` the\n     * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because\n     * the template instruction is downstream from the `hostBindings` instructions.\n     *\n     * @param tData `TData` where the linked list is stored.\n     * @param tNode `TNode` for which the styling is being computed.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     * @return `TStylingKey` if found or `undefined` if not found.\n     */\n    function getTemplateHeadTStylingKey(tData, tNode, isClassBased) {\n        var bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n        if (getTStylingRangeNext(bindings) === 0) {\n            // There does not seem to be a styling instruction in the `template`.\n            return undefined;\n        }\n        return tData[getTStylingRangePrev(bindings)];\n    }\n    /**\n     * Update the `TStylingKey` of the first template instruction in `TNode`.\n     *\n     * Logically `hostBindings` styling instructions are of lower priority than that of the template.\n     * However, they execute after the template styling instructions. This means that they get inserted\n     * in front of the template styling instructions.\n     *\n     * If we have a template styling instruction and a new `hostBindings` styling instruction is\n     * executed it means that it may need to steal static fields from the template instruction. This\n     * method allows us to update the first template instruction `TStylingKey` with a new value.\n     *\n     * Assume:\n     * ```\n     * <div my-dir style=\"color: red\" [style.color]=\"tmplExp\"></div>\n     *\n     * @Directive({\n     *   host: {\n     *     'style': 'width: 100px',\n     *     '[style.color]': 'dirExp',\n     *   }\n     * })\n     * class MyDir {}\n     * ```\n     *\n     * when `[style.color]=\"tmplExp\"` executes it creates this data structure.\n     * ```\n     *  ['', 'color', 'color', 'red', 'width', '100px'],\n     * ```\n     *\n     * The reason for this is that the template instruction does not know if there are styling\n     * instructions and must assume that there are none and must collect all of the static styling.\n     * (both\n     * `color' and 'width`)\n     *\n     * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.\n     * ```\n     *  ['', 'color', 'width', '100px'],  // newly inserted\n     *  ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong\n     * ```\n     *\n     * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to\n     * update it like so:\n     * ```\n     *  ['', 'color', 'width', '100px'],\n     *  ['', 'color', 'color', 'red'],    // UPDATE\n     * ```\n     *\n     * @param tData `TData` where the linked list is stored.\n     * @param tNode `TNode` for which the styling is being computed.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     * @param tStylingKey New `TStylingKey` which is replacing the old one.\n     */\n    function setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {\n        var bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n        ngDevMode &&\n            assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.');\n        tData[getTStylingRangePrev(bindings)] = tStylingKey;\n    }\n    /**\n     * Collect all static values after the current `TNode.directiveStylingLast` index.\n     *\n     * Collect the remaining styling information which has not yet been collected by an existing\n     * styling instruction.\n     *\n     * @param tData `TData` where the `DirectiveDefs` are stored.\n     * @param tNode `TNode` which contains the directive range.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     */\n    function collectResidual(tData, tNode, isClassBased) {\n        var residual = undefined;\n        var directiveEnd = tNode.directiveEnd;\n        ngDevMode &&\n            assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');\n        // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are\n        // collecting things after the last `hostBindings` directive which had a styling instruction.)\n        for (var i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {\n            var attrs = tData[i].hostAttrs;\n            residual = collectStylingFromTAttrs(residual, attrs, isClassBased);\n        }\n        return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);\n    }\n    /**\n     * Collect the static styling information with lower priority than `hostDirectiveDef`.\n     *\n     * (This is opposite of residual styling.)\n     *\n     * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static\n     *        styling. (Or `null` if template styling)\n     * @param tData `TData` where the linked list is stored.\n     * @param tNode `TNode` for which the styling is being computed.\n     * @param stylingKey Existing `TStylingKey` to update or wrap.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     */\n    function collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {\n        // We need to loop because there can be directives which have `hostAttrs` but don't have\n        // `hostBindings` so this loop catches up to the current directive..\n        var currentDirective = null;\n        var directiveEnd = tNode.directiveEnd;\n        var directiveStylingLast = tNode.directiveStylingLast;\n        if (directiveStylingLast === -1) {\n            directiveStylingLast = tNode.directiveStart;\n        }\n        else {\n            directiveStylingLast++;\n        }\n        while (directiveStylingLast < directiveEnd) {\n            currentDirective = tData[directiveStylingLast];\n            ngDevMode && assertDefined(currentDirective, 'expected to be defined');\n            stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);\n            if (currentDirective === hostDirectiveDef)\n                break;\n            directiveStylingLast++;\n        }\n        if (hostDirectiveDef !== null) {\n            // we only advance the styling cursor if we are collecting data from host bindings.\n            // Template executes before host bindings and so if we would update the index,\n            // host bindings would not get their statics.\n            tNode.directiveStylingLast = directiveStylingLast;\n        }\n        return stylingKey;\n    }\n    /**\n     * Convert `TAttrs` into `TStylingStatic`.\n     *\n     * @param stylingKey existing `TStylingKey` to update or wrap.\n     * @param attrs `TAttributes` to process.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     */\n    function collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {\n        var desiredMarker = isClassBased ? 1 /* Classes */ : 2 /* Styles */;\n        var currentMarker = -1 /* ImplicitAttributes */;\n        if (attrs !== null) {\n            for (var i = 0; i < attrs.length; i++) {\n                var item = attrs[i];\n                if (typeof item === 'number') {\n                    currentMarker = item;\n                }\n                else {\n                    if (currentMarker === desiredMarker) {\n                        if (!Array.isArray(stylingKey)) {\n                            stylingKey = stylingKey === undefined ? [] : ['', stylingKey];\n                        }\n                        keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);\n                    }\n                }\n            }\n        }\n        return stylingKey === undefined ? null : stylingKey;\n    }\n    /**\n     * Convert user input to `KeyValueArray`.\n     *\n     * This function takes user input which could be `string`, Object literal, or iterable and converts\n     * it into a consistent representation. The output of this is `KeyValueArray` (which is an array\n     * where\n     * even indexes contain keys and odd indexes contain values for those keys).\n     *\n     * The advantage of converting to `KeyValueArray` is that we can perform diff in an input\n     * independent\n     * way.\n     * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be\n     * applied)\n     *\n     * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the\n     * difference in linear fashion without the need to allocate any additional data.\n     *\n     * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine\n     * which values need to be deleted, over the new `Map` to determine additions, and we would have to\n     * keep additional `Map` to keep track of duplicates or items which have not yet been visited.\n     *\n     * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n     *        function so that `style` can be processed. This is done\n     *        for tree shaking purposes.\n     * @param stringParser The parser is passed in so that it will be tree shakable. See\n     *        `styleStringParser` and `classStringParser`\n     * @param value The value to parse/convert to `KeyValueArray`\n     */\n    function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {\n        if (value == null /*|| value === undefined */ || value === '')\n            return EMPTY_ARRAY;\n        var styleKeyValueArray = [];\n        var unwrappedValue = unwrapSafeValue(value);\n        if (Array.isArray(unwrappedValue)) {\n            for (var i = 0; i < unwrappedValue.length; i++) {\n                keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);\n            }\n        }\n        else if (typeof unwrappedValue === 'object') {\n            for (var key in unwrappedValue) {\n                if (unwrappedValue.hasOwnProperty(key)) {\n                    keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);\n                }\n            }\n        }\n        else if (typeof unwrappedValue === 'string') {\n            stringParser(styleKeyValueArray, unwrappedValue);\n        }\n        else {\n            ngDevMode &&\n                throwError('Unsupported styling type ' + typeof unwrappedValue + ': ' + unwrappedValue);\n        }\n        return styleKeyValueArray;\n    }\n    /**\n     * Set a `value` for a `key`.\n     *\n     * See: `keyValueArraySet` for details\n     *\n     * @param keyValueArray KeyValueArray to add to.\n     * @param key Style key to add.\n     * @param value The value to set.\n     */\n    function styleKeyValueArraySet(keyValueArray, key, value) {\n        keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));\n    }\n    /**\n     * Update map based styling.\n     *\n     * Map based styling could be anything which contains more than one binding. For example `string`,\n     * or object literal. Dealing with all of these types would complicate the logic so\n     * instead this function expects that the complex input is first converted into normalized\n     * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it\n     * very cheap to compute deltas between the previous and current value.\n     *\n     * @param tView Associated `TView.data` contains the linked list of binding priorities.\n     * @param tNode `TNode` where the binding is located.\n     * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n     * @param renderer Renderer to use if any updates.\n     * @param oldKeyValueArray Previous value represented as `KeyValueArray`\n     * @param newKeyValueArray Current value represented as `KeyValueArray`\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     * @param bindingIndex Binding index of the binding.\n     */\n    function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {\n        if (oldKeyValueArray === NO_CHANGE) {\n            // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n            oldKeyValueArray = EMPTY_ARRAY;\n        }\n        var oldIndex = 0;\n        var newIndex = 0;\n        var oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;\n        var newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;\n        while (oldKey !== null || newKey !== null) {\n            ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');\n            ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');\n            var oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;\n            var newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;\n            var setKey = null;\n            var setValue = undefined;\n            if (oldKey === newKey) {\n                // UPDATE: Keys are equal => new value is overwriting old value.\n                oldIndex += 2;\n                newIndex += 2;\n                if (oldValue !== newValue) {\n                    setKey = newKey;\n                    setValue = newValue;\n                }\n            }\n            else if (newKey === null || oldKey !== null && oldKey < newKey) {\n                // DELETE: oldKey key is missing or we did not find the oldKey in the newValue\n                // (because the keyValueArray is sorted and `newKey` is found later alphabetically).\n                // `\"background\" < \"color\"` so we need to delete `\"background\"` because it is not found in the\n                // new array.\n                oldIndex += 2;\n                setKey = oldKey;\n            }\n            else {\n                // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.\n                // `\"color\" > \"background\"` so we need to add `color` because it is in new array but not in\n                // old array.\n                ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');\n                newIndex += 2;\n                setKey = newKey;\n                setValue = newValue;\n            }\n            if (setKey !== null) {\n                updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);\n            }\n            oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;\n            newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;\n        }\n    }\n    /**\n     * Update a simple (property name) styling.\n     *\n     * This function takes `prop` and updates the DOM to that value. The function takes the binding\n     * value as well as binding priority into consideration to determine which value should be written\n     * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks\n     * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)\n     *\n     * @param tView Associated `TView.data` contains the linked list of binding priorities.\n     * @param tNode `TNode` where the binding is located.\n     * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n     * @param renderer Renderer to use if any updates.\n     * @param prop Either style property name or a class name.\n     * @param value Either style value for `prop` or `true`/`false` if `prop` is class.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     * @param bindingIndex Binding index of the binding.\n     */\n    function updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {\n        if (!(tNode.type & 3 /* AnyRNode */)) {\n            // It is possible to have styling on non-elements (such as ng-container).\n            // This is rare, but it does happen. In such a case, just ignore the binding.\n            return;\n        }\n        var tData = tView.data;\n        var tRange = tData[bindingIndex + 1];\n        var higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ?\n            findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) :\n            undefined;\n        if (!isStylingValuePresent(higherPriorityValue)) {\n            // We don't have a next duplicate, or we did not find a duplicate value.\n            if (!isStylingValuePresent(value)) {\n                // We should delete current value or restore to lower priority value.\n                if (getTStylingRangePrevDuplicate(tRange)) {\n                    // We have a possible prev duplicate, let's retrieve it.\n                    value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);\n                }\n            }\n            var rNode = getNativeByIndex(getSelectedIndex(), lView);\n            applyStyling(renderer, isClassBased, rNode, prop, value);\n        }\n    }\n    /**\n     * Search for styling value with higher priority which is overwriting current value, or a\n     * value of lower priority to which we should fall back if the value is `undefined`.\n     *\n     * When value is being applied at a location, related values need to be consulted.\n     * - If there is a higher priority binding, we should be using that one instead.\n     *   For example `<div  [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp1`\n     *   requires that we check `exp2` to see if it is set to value other than `undefined`.\n     * - If there is a lower priority binding and we are changing to `undefined`\n     *   For example `<div  [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp2` to\n     *   `undefined` requires that we check `exp1` (and static values) and use that as new value.\n     *\n     * NOTE: The styling stores two values.\n     * 1. The raw value which came from the application is stored at `index + 0` location. (This value\n     *    is used for dirty checking).\n     * 2. The normalized value is stored at `index + 1`.\n     *\n     * @param tData `TData` used for traversing the priority.\n     * @param tNode `TNode` to use for resolving static styling. Also controls search direction.\n     *   - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n     *      If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n     *   - `null` search prev and go all the way to end. Return last value where\n     *     `isStylingValuePresent(value)` is true.\n     * @param lView `LView` used for retrieving the actual values.\n     * @param prop Property which we are interested in.\n     * @param index Starting index in the linked list of styling bindings where the search should start.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     */\n    function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {\n        // `TNode` to use for resolving static styling. Also controls search direction.\n        //   - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n        //      If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n        //   - `null` search prev and go all the way to end. Return last value where\n        //     `isStylingValuePresent(value)` is true.\n        var isPrevDirection = tNode === null;\n        var value = undefined;\n        while (index > 0) {\n            var rawKey = tData[index];\n            var containsStatics = Array.isArray(rawKey);\n            // Unwrap the key if we contain static values.\n            var key = containsStatics ? rawKey[1] : rawKey;\n            var isStylingMap = key === null;\n            var valueAtLViewIndex = lView[index + 1];\n            if (valueAtLViewIndex === NO_CHANGE) {\n                // In firstUpdatePass the styling instructions create a linked list of styling.\n                // On subsequent passes it is possible for a styling instruction to try to read a binding\n                // which\n                // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that\n                // we have `undefined` (or empty array in case of styling-map instruction) instead. This\n                // allows the resolution to apply the value (which may later be overwritten when the\n                // binding actually executes.)\n                valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;\n            }\n            var currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :\n                key === prop ? valueAtLViewIndex : undefined;\n            if (containsStatics && !isStylingValuePresent(currentValue)) {\n                currentValue = keyValueArrayGet(rawKey, prop);\n            }\n            if (isStylingValuePresent(currentValue)) {\n                value = currentValue;\n                if (isPrevDirection) {\n                    return value;\n                }\n            }\n            var tRange = tData[index + 1];\n            index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);\n        }\n        if (tNode !== null) {\n            // in case where we are going in next direction AND we did not find anything, we need to\n            // consult residual styling\n            var residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n            if (residual != null /** OR residual !=== undefined */) {\n                value = keyValueArrayGet(residual, prop);\n            }\n        }\n        return value;\n    }\n    /**\n     * Determines if the binding value should be used (or if the value is 'undefined' and hence priority\n     * resolution should be used.)\n     *\n     * @param value Binding style value.\n     */\n    function isStylingValuePresent(value) {\n        // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n        // have an opinion as to what this binding should be and you should consult other bindings by\n        // priority to determine the valid value.\n        // This is extracted into a single function so that we have a single place to control this.\n        return value !== undefined;\n    }\n    /**\n     * Normalizes and/or adds a suffix to the value.\n     *\n     * If value is `null`/`undefined` no suffix is added\n     * @param value\n     * @param suffix\n     */\n    function normalizeSuffix(value, suffix) {\n        if (value == null /** || value === undefined */) {\n            // do nothing\n        }\n        else if (typeof suffix === 'string') {\n            value = value + suffix;\n        }\n        else if (typeof value === 'object') {\n            value = stringify(unwrapSafeValue(value));\n        }\n        return value;\n    }\n    /**\n     * Tests if the `TNode` has input shadow.\n     *\n     * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or\n     * `@Input('class')` as input.\n     *\n     * @param tNode `TNode` which we would like to see if it has shadow.\n     * @param isClassBased `true` if `class` (`false` if `style`)\n     */\n    function hasStylingInputShadow(tNode, isClassBased) {\n        return (tNode.flags & (isClassBased ? 16 /* hasClassInput */ : 32 /* hasStyleInput */)) !== 0;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Create static text node\n     *\n     * @param index Index of the node in the data array\n     * @param value Static string value to write.\n     *\n     * @codeGenApi\n     */\n    function ɵɵtext(index, value) {\n        if (value === void 0) { value = ''; }\n        var lView = getLView();\n        var tView = getTView();\n        var adjustedIndex = index + HEADER_OFFSET;\n        ngDevMode &&\n            assertEqual(getBindingIndex(), tView.bindingStartIndex, 'text nodes should be created before any bindings');\n        ngDevMode && assertIndexInRange(lView, adjustedIndex);\n        var tNode = tView.firstCreatePass ?\n            getOrCreateTNode(tView, adjustedIndex, 1 /* Text */, value, null) :\n            tView.data[adjustedIndex];\n        var textNative = lView[adjustedIndex] = createTextNode(lView[RENDERER], value);\n        appendChild(tView, lView, textNative, tNode);\n        // Text nodes are self closing.\n        setCurrentTNode(tNode, false);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     *\n     * Update text content with a lone bound value\n     *\n     * Used when a text node has 1 interpolated value in it, an no additional text\n     * surrounds that interpolated value:\n     *\n     * ```html\n     * <div>{{v0}}</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate(v0);\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate(v0) {\n        ɵɵtextInterpolate1('', v0, '');\n        return ɵɵtextInterpolate;\n    }\n    /**\n     *\n     * Update text content with single bound value surrounded by other text.\n     *\n     * Used when a text node has 1 interpolated value in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate1('prefix', v0, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate1(prefix, v0, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation1(lView, prefix, v0, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate1;\n    }\n    /**\n     *\n     * Update text content with 2 bound values surrounded by other text.\n     *\n     * Used when a text node has 2 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate2;\n    }\n    /**\n     *\n     * Update text content with 3 bound values surrounded by other text.\n     *\n     * Used when a text node has 3 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate3(\n     * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate3;\n    }\n    /**\n     *\n     * Update text content with 4 bound values surrounded by other text.\n     *\n     * Used when a text node has 4 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate4(\n     * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see ɵɵtextInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate4;\n    }\n    /**\n     *\n     * Update text content with 5 bound values surrounded by other text.\n     *\n     * Used when a text node has 5 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate5(\n     * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate5;\n    }\n    /**\n     *\n     * Update text content with 6 bound values surrounded by other text.\n     *\n     * Used when a text node has 6 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate6(\n     *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n     * ```\n     *\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change. @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate6;\n    }\n    /**\n     *\n     * Update text content with 7 bound values surrounded by other text.\n     *\n     * Used when a text node has 7 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate7(\n     *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate7;\n    }\n    /**\n     *\n     * Update text content with 8 bound values surrounded by other text.\n     *\n     * Used when a text node has 8 interpolated values in it:\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolate8(\n     *  'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n     * ```\n     * @returns itself, so that it may be chained.\n     * @see textInterpolateV\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n        var lView = getLView();\n        var interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolate8;\n    }\n    /**\n     * Update text content with 9 or more bound values other surrounded by text.\n     *\n     * Used when the number of interpolated values exceeds 8.\n     *\n     * ```html\n     * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵtextInterpolateV(\n     *  ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n     *  'suffix']);\n     * ```\n     *.\n     * @param values The collection of values and the strings in between those values, beginning with\n     * a string prefix and ending with a string suffix.\n     * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n     *\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵtextInterpolateV(values) {\n        var lView = getLView();\n        var interpolated = interpolationV(lView, values);\n        if (interpolated !== NO_CHANGE) {\n            textBindingInternal(lView, getSelectedIndex(), interpolated);\n        }\n        return ɵɵtextInterpolateV;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     *\n     * Update an interpolated class on an element with single bound value surrounded by text.\n     *\n     * Used when the value passed to a property has 1 interpolated value in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate1('prefix', v0, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate1(prefix, v0, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 2 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 2 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate2(prefix, v0, i0, v1, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 3 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 3 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate3(\n     * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 4 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 4 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate4(\n     * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 5 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 5 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate5(\n     * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 6 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 6 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate6(\n     *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 7 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 7 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate7(\n     *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     *\n     * Update an interpolated class on an element with 8 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 8 interpolated values in it:\n     *\n     * ```html\n     * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolate8(\n     *  'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param i6 Static value used for concatenation only.\n     * @param v7 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n    /**\n     * Update an interpolated class on an element with 9 or more bound values surrounded by text.\n     *\n     * Used when the number of interpolated values exceeds 8.\n     *\n     * ```html\n     * <div\n     *  class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵclassMapInterpolateV(\n     *  ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n     *  'suffix']);\n     * ```\n     *.\n     * @param values The collection of values and the strings in-between those values, beginning with\n     * a string prefix and ending with a string suffix.\n     * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n     * @codeGenApi\n     */\n    function ɵɵclassMapInterpolateV(values) {\n        var lView = getLView();\n        var interpolatedValue = interpolationV(lView, values);\n        checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     *\n     * Update an interpolated style on an element with single bound value surrounded by text.\n     *\n     * Used when the value passed to a property has 1 interpolated value in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate1(prefix, v0, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 2 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 2 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key1: {{v1}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate2(prefix, v0, i0, v1, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 3 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 3 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate3(\n     *     'key: ', v0, '; key1: ', v1, '; key2: ', v2, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 4 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 4 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate4(\n     *     'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 5 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 5 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate5(\n     *     'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 6 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 6 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}};\n     *             key5: {{v5}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate6(\n     *    'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n     *    'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 7 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 7 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n     *             key6: {{v6}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate7(\n     *    'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n     *    '; key6: ', v6, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     *\n     * Update an interpolated style on an element with 8 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 8 interpolated values in it:\n     *\n     * ```html\n     * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n     *             key6: {{v6}}; key7: {{v7}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolate8(\n     *    'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n     *    '; key6: ', v6, '; key7: ', v7, 'suffix');\n     * ```\n     *\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param i6 Static value used for concatenation only.\n     * @param v7 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n        ɵɵstyleMap(interpolatedValue);\n    }\n    /**\n     * Update an interpolated style on an element with 9 or more bound values surrounded by text.\n     *\n     * Used when the number of interpolated values exceeds 8.\n     *\n     * ```html\n     * <div\n     *  class=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n     *         key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstyleMapInterpolateV(\n     *    ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n     *     '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']);\n     * ```\n     *.\n     * @param values The collection of values and the strings in-between those values, beginning with\n     * a string prefix and ending with a string suffix.\n     * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`)\n     * @codeGenApi\n     */\n    function ɵɵstyleMapInterpolateV(values) {\n        var lView = getLView();\n        var interpolatedValue = interpolationV(lView, values);\n        ɵɵstyleMap(interpolatedValue);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     *\n     * Update an interpolated style property on an element with single bound value surrounded by text.\n     *\n     * Used when the value passed to a property has 1 interpolated value in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate1(prop, prefix, v0, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate1;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 2 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 2 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate2(prop, prefix, v0, i0, v1, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate2;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 3 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 3 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate3(prop, prefix, v0, i0, v1, i1, v2, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate3;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 4 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 4 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate4(prop, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate4;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 5 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 5 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate5(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate5;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 6 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 6 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate6(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate6;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 7 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 7 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate7(\n     *    0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate7(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate7;\n    }\n    /**\n     *\n     * Update an interpolated style property on an element with 8 bound values surrounded by text.\n     *\n     * Used when the value passed to a property has 8 interpolated values in it:\n     *\n     * ```html\n     * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6,\n     * '-', v7, 'suffix');\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`.\n     * @param prefix Static value used for concatenation only.\n     * @param v0 Value checked for change.\n     * @param i0 Static value used for concatenation only.\n     * @param v1 Value checked for change.\n     * @param i1 Static value used for concatenation only.\n     * @param v2 Value checked for change.\n     * @param i2 Static value used for concatenation only.\n     * @param v3 Value checked for change.\n     * @param i3 Static value used for concatenation only.\n     * @param v4 Value checked for change.\n     * @param i4 Static value used for concatenation only.\n     * @param v5 Value checked for change.\n     * @param i5 Static value used for concatenation only.\n     * @param v6 Value checked for change.\n     * @param i6 Static value used for concatenation only.\n     * @param v7 Value checked for change.\n     * @param suffix Static value used for concatenation only.\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolate8(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolate8;\n    }\n    /**\n     * Update an interpolated style property on an element with 9 or more bound values surrounded by\n     * text.\n     *\n     * Used when the number of interpolated values exceeds 8.\n     *\n     * ```html\n     * <div\n     *  style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\">\n     * </div>\n     * ```\n     *\n     * Its compiled representation is:\n     *\n     * ```ts\n     * ɵɵstylePropInterpolateV(\n     *  0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n     *  'suffix']);\n     * ```\n     *\n     * @param styleIndex Index of style to update. This index value refers to the\n     *        index of the style in the style bindings array that was passed into\n     *        `styling`..\n     * @param values The collection of values and the strings in-between those values, beginning with\n     * a string prefix and ending with a string suffix.\n     * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n     * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n     * @returns itself, so that it may be chained.\n     * @codeGenApi\n     */\n    function ɵɵstylePropInterpolateV(prop, values, valueSuffix) {\n        var lView = getLView();\n        var interpolatedValue = interpolationV(lView, values);\n        checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n        return ɵɵstylePropInterpolateV;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Update a property on a host element. Only applies to native node properties, not inputs.\n     *\n     * Operates on the element selected by index via the {@link select} instruction.\n     *\n     * @param propName Name of property. Because it is going to DOM, this is not subject to\n     *        renaming as part of minification.\n     * @param value New value to write.\n     * @param sanitizer An optional function used to sanitize the value.\n     * @returns This function returns itself so that it may be chained\n     * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n     *\n     * @codeGenApi\n     */\n    function ɵɵhostProperty(propName, value, sanitizer) {\n        var lView = getLView();\n        var bindingIndex = nextBindingIndex();\n        if (bindingUpdated(lView, bindingIndex, value)) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);\n            ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n        }\n        return ɵɵhostProperty;\n    }\n    /**\n     * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.\n     *\n     * This instruction is for compatibility purposes and is designed to ensure that a\n     * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n     * the component's renderer. Normally all host bindings are evaluated with the parent\n     * component's renderer, but, in the case of animation @triggers, they need to be\n     * evaluated with the sub component's renderer (because that's where the animation\n     * triggers are defined).\n     *\n     * Do not use this instruction as a replacement for `elementProperty`. This instruction\n     * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n     *\n     * @param index The index of the element to update in the data array\n     * @param propName Name of property. Because it is going to DOM, this is not subject to\n     *        renaming as part of minification.\n     * @param value New value to write.\n     * @param sanitizer An optional function used to sanitize the value.\n     *\n     * @codeGenApi\n     */\n    function ɵɵsyntheticHostProperty(propName, value, sanitizer) {\n        var lView = getLView();\n        var bindingIndex = nextBindingIndex();\n        if (bindingUpdated(lView, bindingIndex, value)) {\n            var tView = getTView();\n            var tNode = getSelectedTNode();\n            var currentDef = getCurrentDirectiveDef(tView.data);\n            var renderer = loadComponentRenderer(currentDef, tNode, lView);\n            elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);\n            ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n        }\n        return ɵɵsyntheticHostProperty;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.\n     */\n    if (typeof ngI18nClosureMode === 'undefined') {\n        // These property accesses can be ignored because ngI18nClosureMode will be set to false\n        // when optimizing code and the whole if statement will be dropped.\n        // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.\n        // NOTE: we need to have it in IIFE so that the tree-shaker is happy.\n        (function () {\n            // tslint:disable-next-line:no-toplevel-property-access\n            _global['ngI18nClosureMode'] =\n                // TODO(FW-1250): validate that this actually, you know, works.\n                // tslint:disable-next-line:no-toplevel-property-access\n                typeof goog !== 'undefined' && typeof goog.getMsg === 'function';\n        })();\n    }\n\n    /**\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://angular.io/license\n     */\n    // THIS CODE IS GENERATED - DO NOT MODIFY.\n    var u = undefined;\n    function plural(n) {\n        var i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\\.?/, '').length;\n        if (i === 1 && v === 0)\n            return 1;\n        return 5;\n    }\n    var localeEn = [\"en\", [[\"a\", \"p\"], [\"AM\", \"PM\"], u], [[\"AM\", \"PM\"], u, u], [[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"], [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"]], u, [[\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"], [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]], u, [[\"B\", \"A\"], [\"BC\", \"AD\"], [\"Before Christ\", \"Anno Domini\"]], 0, [6, 0], [\"M/d/yy\", \"MMM d, y\", \"MMMM d, y\", \"EEEE, MMMM d, y\"], [\"h:mm a\", \"h:mm:ss a\", \"h:mm:ss a z\", \"h:mm:ss a zzzz\"], [\"{1}, {0}\", u, \"{1} 'at' {0}\", u], [\".\", \",\", \";\", \"%\", \"+\", \"-\", \"E\", \"×\", \"‰\", \"∞\", \"NaN\", \":\"], [\"#,##0.###\", \"#,##0%\", \"¤#,##0.00\", \"#E0\"], \"USD\", \"$\", \"US Dollar\", {}, \"ltr\", plural];\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This const is used to store the locale data registered with `registerLocaleData`\n     */\n    var LOCALE_DATA = {};\n    /**\n     * Register locale data to be used internally by Angular. See the\n     * [\"I18n guide\"](guide/i18n#i18n-pipes) to know how to import additional locale data.\n     *\n     * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1\n     */\n    function registerLocaleData(data, localeId, extraData) {\n        if (typeof localeId !== 'string') {\n            extraData = localeId;\n            localeId = data[exports.ɵLocaleDataIndex.LocaleId];\n        }\n        localeId = localeId.toLowerCase().replace(/_/g, '-');\n        LOCALE_DATA[localeId] = data;\n        if (extraData) {\n            LOCALE_DATA[localeId][exports.ɵLocaleDataIndex.ExtraData] = extraData;\n        }\n    }\n    /**\n     * Finds the locale data for a given locale.\n     *\n     * @param locale The locale code.\n     * @returns The locale data.\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     */\n    function findLocaleData(locale) {\n        var normalizedLocale = normalizeLocale(locale);\n        var match = getLocaleData(normalizedLocale);\n        if (match) {\n            return match;\n        }\n        // let's try to find a parent locale\n        var parentLocale = normalizedLocale.split('-')[0];\n        match = getLocaleData(parentLocale);\n        if (match) {\n            return match;\n        }\n        if (parentLocale === 'en') {\n            return localeEn;\n        }\n        throw new Error(\"Missing locale data for the locale \\\"\" + locale + \"\\\".\");\n    }\n    /**\n     * Retrieves the default currency code for the given locale.\n     *\n     * The default is defined as the first currency which is still in use.\n     *\n     * @param locale The code of the locale whose currency code we want.\n     * @returns The code of the default currency for the given locale.\n     *\n     */\n    function getLocaleCurrencyCode(locale) {\n        var data = findLocaleData(locale);\n        return data[exports.ɵLocaleDataIndex.CurrencyCode] || null;\n    }\n    /**\n     * Retrieves the plural function used by ICU expressions to determine the plural case to use\n     * for a given locale.\n     * @param locale A locale code for the locale format rules to use.\n     * @returns The plural function for the locale.\n     * @see `NgPlural`\n     * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n     */\n    function getLocalePluralCase(locale) {\n        var data = findLocaleData(locale);\n        return data[exports.ɵLocaleDataIndex.PluralCase];\n    }\n    /**\n     * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`\n     * or from the global `ng.common.locale`.\n     */\n    function getLocaleData(normalizedLocale) {\n        if (!(normalizedLocale in LOCALE_DATA)) {\n            LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales &&\n                _global.ng.common.locales[normalizedLocale];\n        }\n        return LOCALE_DATA[normalizedLocale];\n    }\n    /**\n     * Helper function to remove all the locale data from `LOCALE_DATA`.\n     */\n    function unregisterAllLocaleData() {\n        LOCALE_DATA = {};\n    }\n    (function (LocaleDataIndex) {\n        LocaleDataIndex[LocaleDataIndex[\"LocaleId\"] = 0] = \"LocaleId\";\n        LocaleDataIndex[LocaleDataIndex[\"DayPeriodsFormat\"] = 1] = \"DayPeriodsFormat\";\n        LocaleDataIndex[LocaleDataIndex[\"DayPeriodsStandalone\"] = 2] = \"DayPeriodsStandalone\";\n        LocaleDataIndex[LocaleDataIndex[\"DaysFormat\"] = 3] = \"DaysFormat\";\n        LocaleDataIndex[LocaleDataIndex[\"DaysStandalone\"] = 4] = \"DaysStandalone\";\n        LocaleDataIndex[LocaleDataIndex[\"MonthsFormat\"] = 5] = \"MonthsFormat\";\n        LocaleDataIndex[LocaleDataIndex[\"MonthsStandalone\"] = 6] = \"MonthsStandalone\";\n        LocaleDataIndex[LocaleDataIndex[\"Eras\"] = 7] = \"Eras\";\n        LocaleDataIndex[LocaleDataIndex[\"FirstDayOfWeek\"] = 8] = \"FirstDayOfWeek\";\n        LocaleDataIndex[LocaleDataIndex[\"WeekendRange\"] = 9] = \"WeekendRange\";\n        LocaleDataIndex[LocaleDataIndex[\"DateFormat\"] = 10] = \"DateFormat\";\n        LocaleDataIndex[LocaleDataIndex[\"TimeFormat\"] = 11] = \"TimeFormat\";\n        LocaleDataIndex[LocaleDataIndex[\"DateTimeFormat\"] = 12] = \"DateTimeFormat\";\n        LocaleDataIndex[LocaleDataIndex[\"NumberSymbols\"] = 13] = \"NumberSymbols\";\n        LocaleDataIndex[LocaleDataIndex[\"NumberFormats\"] = 14] = \"NumberFormats\";\n        LocaleDataIndex[LocaleDataIndex[\"CurrencyCode\"] = 15] = \"CurrencyCode\";\n        LocaleDataIndex[LocaleDataIndex[\"CurrencySymbol\"] = 16] = \"CurrencySymbol\";\n        LocaleDataIndex[LocaleDataIndex[\"CurrencyName\"] = 17] = \"CurrencyName\";\n        LocaleDataIndex[LocaleDataIndex[\"Currencies\"] = 18] = \"Currencies\";\n        LocaleDataIndex[LocaleDataIndex[\"Directionality\"] = 19] = \"Directionality\";\n        LocaleDataIndex[LocaleDataIndex[\"PluralCase\"] = 20] = \"PluralCase\";\n        LocaleDataIndex[LocaleDataIndex[\"ExtraData\"] = 21] = \"ExtraData\";\n    })(exports.ɵLocaleDataIndex || (exports.ɵLocaleDataIndex = {}));\n    /**\n     * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.\n     */\n    function normalizeLocale(locale) {\n        return locale.toLowerCase().replace(/_/g, '-');\n    }\n\n    /**\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://angular.io/license\n     */\n    var pluralMapping = ['zero', 'one', 'two', 'few', 'many'];\n    /**\n     * Returns the plural case based on the locale\n     */\n    function getPluralCase(value, locale) {\n        var plural = getLocalePluralCase(locale)(parseInt(value, 10));\n        var result = pluralMapping[plural];\n        return (result !== undefined) ? result : 'other';\n    }\n    /**\n     * The locale id that the application is using by default (for translations and ICU expressions).\n     */\n    var DEFAULT_LOCALE_ID = 'en-US';\n    /**\n     * USD currency code that the application uses by default for CurrencyPipe when no\n     * DEFAULT_CURRENCY_CODE is provided.\n     */\n    var USD_CURRENCY_CODE = 'USD';\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Marks that the next string is an element name.\n     *\n     * See `I18nMutateOpCodes` documentation.\n     */\n    var ELEMENT_MARKER = {\n        marker: 'element'\n    };\n    /**\n     * Marks that the next string is comment text need for ICU.\n     *\n     * See `I18nMutateOpCodes` documentation.\n     */\n    var ICU_MARKER = {\n        marker: 'ICU'\n    };\n    /**\n     * See `I18nCreateOpCodes`\n     */\n    var I18nCreateOpCode;\n    (function (I18nCreateOpCode) {\n        /**\n         * Number of bits to shift index so that it can be combined with the `APPEND_EAGERLY` and\n         * `COMMENT`.\n         */\n        I18nCreateOpCode[I18nCreateOpCode[\"SHIFT\"] = 2] = \"SHIFT\";\n        /**\n         * Should the node be appended to parent imedditatly after creation.\n         */\n        I18nCreateOpCode[I18nCreateOpCode[\"APPEND_EAGERLY\"] = 1] = \"APPEND_EAGERLY\";\n        /**\n         * If set the node should be comment (rather than a text) node.\n         */\n        I18nCreateOpCode[I18nCreateOpCode[\"COMMENT\"] = 2] = \"COMMENT\";\n    })(I18nCreateOpCode || (I18nCreateOpCode = {}));\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$6 = 1;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * The locale id that the application is currently using (for translations and ICU expressions).\n     * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n     * but is now defined as a global value.\n     */\n    var LOCALE_ID = DEFAULT_LOCALE_ID;\n    /**\n     * Sets the locale id that will be used for translations and ICU expressions.\n     * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n     * but is now defined as a global value.\n     *\n     * @param localeId\n     */\n    function setLocaleId(localeId) {\n        assertDefined(localeId, \"Expected localeId to be defined\");\n        if (typeof localeId === 'string') {\n            LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n        }\n    }\n    /**\n     * Gets the locale id that will be used for translations and ICU expressions.\n     * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n     * but is now defined as a global value.\n     */\n    function getLocaleId() {\n        return LOCALE_ID;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Find a node in front of which `currentTNode` should be inserted (takes i18n into account).\n     *\n     * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n     * takes `TNode.insertBeforeIndex` into account.\n     *\n     * @param parentTNode parent `TNode`\n     * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n     * @param lView current `LView`\n     */\n    function getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {\n        var tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;\n        var insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex;\n        if (insertBeforeIndex === null) {\n            return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);\n        }\n        else {\n            ngDevMode && assertIndexInRange(lView, insertBeforeIndex);\n            return unwrapRNode(lView[insertBeforeIndex]);\n        }\n    }\n    /**\n     * Process `TNode.insertBeforeIndex` by adding i18n text nodes.\n     *\n     * See `TNode.insertBeforeIndex`\n     */\n    function processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {\n        var tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;\n        if (Array.isArray(tNodeInsertBeforeIndex)) {\n            // An array indicates that there are i18n nodes that need to be added as children of this\n            // `childRNode`. These i18n nodes were created before this `childRNode` was available and so\n            // only now can be added. The first element of the array is the normal index where we should\n            // insert the `childRNode`. Additional elements are the extra nodes to be added as children of\n            // `childRNode`.\n            ngDevMode && assertDomNode(childRNode);\n            var i18nParent = childRNode;\n            var anchorRNode = null;\n            if (!(childTNode.type & 3 /* AnyRNode */)) {\n                anchorRNode = i18nParent;\n                i18nParent = parentRElement;\n            }\n            if (i18nParent !== null && (childTNode.flags & 2 /* isComponentHost */) === 0) {\n                for (var i = 1; i < tNodeInsertBeforeIndex.length; i++) {\n                    // No need to `unwrapRNode` because all of the indexes point to i18n text nodes.\n                    // see `assertDomNode` below.\n                    var i18nChild = lView[tNodeInsertBeforeIndex[i]];\n                    nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);\n                }\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Add `tNode` to `previousTNodes` list and update relevant `TNode`s in `previousTNodes` list\n     * `tNode.insertBeforeIndex`.\n     *\n     * Things to keep in mind:\n     * 1. All i18n text nodes are encoded as `TNodeType.Element` and are created eagerly by the\n     *    `ɵɵi18nStart` instruction.\n     * 2. All `TNodeType.Placeholder` `TNodes` are elements which will be created later by\n     *    `ɵɵelementStart` instruction.\n     * 3. `ɵɵelementStart` instruction will create `TNode`s in the ascending `TNode.index` order. (So a\n     *    smaller index `TNode` is guaranteed to be created before a larger one)\n     *\n     * We use the above three invariants to determine `TNode.insertBeforeIndex`.\n     *\n     * In an ideal world `TNode.insertBeforeIndex` would always be `TNode.next.index`. However,\n     * this will not work because `TNode.next.index` may be larger than `TNode.index` which means that\n     * the next node is not yet created and therefore we can't insert in front of it.\n     *\n     * Rule1: `TNode.insertBeforeIndex = null` if `TNode.next === null` (Initial condition, as we don't\n     *        know if there will be further `TNode`s inserted after.)\n     * Rule2: If `previousTNode` is created after the `tNode` being inserted, then\n     *        `previousTNode.insertBeforeNode = tNode.index` (So when a new `tNode` is added we check\n     *        previous to see if we can update its `insertBeforeTNode`)\n     *\n     * See `TNode.insertBeforeIndex` for more context.\n     *\n     * @param previousTNodes A list of previous TNodes so that we can easily traverse `TNode`s in\n     *     reverse order. (If `TNode` would have `previous` this would not be necessary.)\n     * @param newTNode A TNode to add to the `previousTNodes` list.\n     */\n    function addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {\n        // Start with Rule1\n        ngDevMode &&\n            assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');\n        previousTNodes.push(newTNode);\n        if (previousTNodes.length > 1) {\n            for (var i = previousTNodes.length - 2; i >= 0; i--) {\n                var existingTNode = previousTNodes[i];\n                // Text nodes are created eagerly and so they don't need their `indexBeforeIndex` updated.\n                // It is safe to ignore them.\n                if (!isI18nText(existingTNode)) {\n                    if (isNewTNodeCreatedBefore(existingTNode, newTNode) &&\n                        getInsertBeforeIndex(existingTNode) === null) {\n                        // If it was created before us in time, (and it does not yet have `insertBeforeIndex`)\n                        // then add the `insertBeforeIndex`.\n                        setInsertBeforeIndex(existingTNode, newTNode.index);\n                    }\n                }\n            }\n        }\n    }\n    function isI18nText(tNode) {\n        return !(tNode.type & 64 /* Placeholder */);\n    }\n    function isNewTNodeCreatedBefore(existingTNode, newTNode) {\n        return isI18nText(newTNode) || existingTNode.index > newTNode.index;\n    }\n    function getInsertBeforeIndex(tNode) {\n        var index = tNode.insertBeforeIndex;\n        return Array.isArray(index) ? index[0] : index;\n    }\n    function setInsertBeforeIndex(tNode, value) {\n        var index = tNode.insertBeforeIndex;\n        if (Array.isArray(index)) {\n            // Array is stored if we have to insert child nodes. See `TNode.insertBeforeIndex`\n            index[0] = value;\n        }\n        else {\n            setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n            tNode.insertBeforeIndex = value;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Retrieve `TIcu` at a given `index`.\n     *\n     * The `TIcu` can be stored either directly (if it is nested ICU) OR\n     * it is stored inside tho `TIcuContainer` if it is top level ICU.\n     *\n     * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n     * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n     * expressed (parent ICU may have selected a case which does not contain it.)\n     *\n     * @param tView Current `TView`.\n     * @param index Index where the value should be read from.\n     */\n    function getTIcu(tView, index) {\n        var value = tView.data[index];\n        if (value === null || typeof value === 'string')\n            return null;\n        if (ngDevMode &&\n            !(value.hasOwnProperty('tViews') || value.hasOwnProperty('currentCaseLViewIndex'))) {\n            throwError('We expect to get \\'null\\'|\\'TIcu\\'|\\'TIcuContainer\\', but got: ' + value);\n        }\n        // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be\n        // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it\n        // will be just two cases which fits into the browser inline cache (inline cache can take up to\n        // 4)\n        var tIcu = value.hasOwnProperty('currentCaseLViewIndex') ? value :\n            value.value;\n        ngDevMode && assertTIcu(tIcu);\n        return tIcu;\n    }\n    /**\n     * Store `TIcu` at a give `index`.\n     *\n     * The `TIcu` can be stored either directly (if it is nested ICU) OR\n     * it is stored inside tho `TIcuContainer` if it is top level ICU.\n     *\n     * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n     * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n     * expressed (parent ICU may have selected a case which does not contain it.)\n     *\n     * @param tView Current `TView`.\n     * @param index Index where the value should be stored at in `Tview.data`\n     * @param tIcu The TIcu to store.\n     */\n    function setTIcu(tView, index, tIcu) {\n        var tNode = tView.data[index];\n        ngDevMode &&\n            assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n        if (tNode === null) {\n            tView.data[index] = tIcu;\n        }\n        else {\n            ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n            tNode.value = tIcu;\n        }\n    }\n    /**\n     * Set `TNode.insertBeforeIndex` taking the `Array` into account.\n     *\n     * See `TNode.insertBeforeIndex`\n     */\n    function setTNodeInsertBeforeIndex(tNode, index) {\n        ngDevMode && assertTNode(tNode);\n        var insertBeforeIndex = tNode.insertBeforeIndex;\n        if (insertBeforeIndex === null) {\n            setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n            insertBeforeIndex = tNode.insertBeforeIndex =\n                [null /* may be updated to number later */, index];\n        }\n        else {\n            assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n            insertBeforeIndex.push(index);\n        }\n    }\n    /**\n     * Create `TNode.type=TNodeType.Placeholder` node.\n     *\n     * See `TNodeType.Placeholder` for more information.\n     */\n    function createTNodePlaceholder(tView, previousTNodes, index) {\n        var tNode = createTNodeAtIndex(tView, index, 64 /* Placeholder */, null, null);\n        addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n        return tNode;\n    }\n    /**\n     * Returns current ICU case.\n     *\n     * ICU cases are stored as index into the `TIcu.cases`.\n     * At times it is necessary to communicate that the ICU case just switched and that next ICU update\n     * should update all bindings regardless of the mask. In such a case the we store negative numbers\n     * for cases which have just been switched. This function removes the negative flag.\n     */\n    function getCurrentICUCaseIndex(tIcu, lView) {\n        var currentCase = lView[tIcu.currentCaseLViewIndex];\n        return currentCase === null ? currentCase : (currentCase < 0 ? ~currentCase : currentCase);\n    }\n    function getParentFromIcuCreateOpCode(mergedCode) {\n        return mergedCode >>> 17 /* SHIFT_PARENT */;\n    }\n    function getRefFromIcuCreateOpCode(mergedCode) {\n        return (mergedCode & 131070 /* MASK_REF */) >>> 1 /* SHIFT_REF */;\n    }\n    function getInstructionFromIcuCreateOpCode(mergedCode) {\n        return mergedCode & 1 /* MASK_INSTRUCTION */;\n    }\n    function icuCreateOpCode(opCode, parentIdx, refIdx) {\n        ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');\n        ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');\n        return opCode | parentIdx << 17 /* SHIFT_PARENT */ | refIdx << 1 /* SHIFT_REF */;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n     *\n     * This is used to efficiently update expressions in i18n only when the corresponding input has\n     * changed.\n     *\n     * 1) Each bit represents which of the `ɵɵi18nExp` has changed.\n     * 2) There are 32 bits allowed in JS.\n     * 3) Bit 32 is special as it is shared for all changes past 32. (In other words if you have more\n     * than 32 `ɵɵi18nExp` then all changes past 32nd `ɵɵi18nExp` will be mapped to same bit. This means\n     * that we may end up changing more than we need to. But i18n expressions with 32 bindings is rare\n     * so in practice it should not be an issue.)\n     */\n    var changeMask = 0;\n    /**\n     * Keeps track of which bit needs to be updated in `changeMask`\n     *\n     * This value gets incremented on every call to `ɵɵi18nExp`\n     */\n    var changeMaskCounter = 0;\n    /**\n     * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n     *\n     * `setMaskBit` gets invoked by each call to `ɵɵi18nExp`.\n     *\n     * @param hasChange did `ɵɵi18nExp` detect a change.\n     */\n    function setMaskBit(hasChange) {\n        if (hasChange) {\n            changeMask = changeMask | (1 << Math.min(changeMaskCounter, 31));\n        }\n        changeMaskCounter++;\n    }\n    function applyI18n(tView, lView, index) {\n        if (changeMaskCounter > 0) {\n            ngDevMode && assertDefined(tView, \"tView should be defined\");\n            var tI18n = tView.data[index];\n            // When `index` points to an `ɵɵi18nAttributes` then we have an array otherwise `TI18n`\n            var updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;\n            var bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;\n            applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);\n        }\n        // Reset changeMask & maskBit to default for the next update cycle\n        changeMask = 0;\n        changeMaskCounter = 0;\n    }\n    /**\n     * Apply `I18nCreateOpCodes` op-codes as stored in `TI18n.create`.\n     *\n     * Creates text (and comment) nodes which are internationalized.\n     *\n     * @param lView Current lView\n     * @param createOpCodes Set of op-codes to apply\n     * @param parentRNode Parent node (so that direct children can be added eagerly) or `null` if it is\n     *     a root node.\n     * @param insertInFrontOf DOM node that should be used as an anchor.\n     */\n    function applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {\n        var renderer = lView[RENDERER];\n        for (var i = 0; i < createOpCodes.length; i++) {\n            var opCode = createOpCodes[i++];\n            var text = createOpCodes[i];\n            var isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n            var appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n            var index = opCode >>> I18nCreateOpCode.SHIFT;\n            var rNode = lView[index];\n            if (rNode === null) {\n                // We only create new DOM nodes if they don't already exist: If ICU switches case back to a\n                // case which was already instantiated, no need to create new DOM nodes.\n                rNode = lView[index] =\n                    isComment ? renderer.createComment(text) : createTextNode(renderer, text);\n            }\n            if (appendNow && parentRNode !== null) {\n                nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);\n            }\n        }\n    }\n    /**\n     * Apply `I18nMutateOpCodes` OpCodes.\n     *\n     * @param tView Current `TView`\n     * @param mutableOpCodes Mutable OpCodes to process\n     * @param lView Current `LView`\n     * @param anchorRNode place where the i18n node should be inserted.\n     */\n    function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {\n        ngDevMode && assertDomNode(anchorRNode);\n        var renderer = lView[RENDERER];\n        // `rootIdx` represents the node into which all inserts happen.\n        var rootIdx = null;\n        // `rootRNode` represents the real node into which we insert. This can be different from\n        // `lView[rootIdx]` if we have projection.\n        //  - null we don't have a parent (as can be the case in when we are inserting into a root of\n        //    LView which has no parent.)\n        //  - `RElement` The element representing the root after taking projection into account.\n        var rootRNode;\n        for (var i = 0; i < mutableOpCodes.length; i++) {\n            var opCode = mutableOpCodes[i];\n            if (typeof opCode == 'string') {\n                var textNodeIndex = mutableOpCodes[++i];\n                if (lView[textNodeIndex] === null) {\n                    ngDevMode && ngDevMode.rendererCreateTextNode++;\n                    ngDevMode && assertIndexInRange(lView, textNodeIndex);\n                    lView[textNodeIndex] = createTextNode(renderer, opCode);\n                }\n            }\n            else if (typeof opCode == 'number') {\n                switch (opCode & 1 /* MASK_INSTRUCTION */) {\n                    case 0 /* AppendChild */:\n                        var parentIdx = getParentFromIcuCreateOpCode(opCode);\n                        if (rootIdx === null) {\n                            // The first operation should save the `rootIdx` because the first operation\n                            // must insert into the root. (Only subsequent operations can insert into a dynamic\n                            // parent)\n                            rootIdx = parentIdx;\n                            rootRNode = nativeParentNode(renderer, anchorRNode);\n                        }\n                        var insertInFrontOf = void 0;\n                        var parentRNode = void 0;\n                        if (parentIdx === rootIdx) {\n                            insertInFrontOf = anchorRNode;\n                            parentRNode = rootRNode;\n                        }\n                        else {\n                            insertInFrontOf = null;\n                            parentRNode = unwrapRNode(lView[parentIdx]);\n                        }\n                        // FIXME(misko): Refactor with `processI18nText`\n                        if (parentRNode !== null) {\n                            // This can happen if the `LView` we are adding to is not attached to a parent `LView`.\n                            // In such a case there is no \"root\" we can attach to. This is fine, as we still need to\n                            // create the elements. When the `LView` gets later added to a parent these \"root\" nodes\n                            // get picked up and added.\n                            ngDevMode && assertDomNode(parentRNode);\n                            var refIdx = getRefFromIcuCreateOpCode(opCode);\n                            ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, 'Missing ref');\n                            // `unwrapRNode` is not needed here as all of these point to RNodes as part of the i18n\n                            // which can't have components.\n                            var child = lView[refIdx];\n                            ngDevMode && assertDomNode(child);\n                            nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);\n                            var tIcu = getTIcu(tView, refIdx);\n                            if (tIcu !== null && typeof tIcu === 'object') {\n                                // If we just added a comment node which has ICU then that ICU may have already been\n                                // rendered and therefore we need to re-add it here.\n                                ngDevMode && assertTIcu(tIcu);\n                                var caseIndex = getCurrentICUCaseIndex(tIcu, lView);\n                                if (caseIndex !== null) {\n                                    applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);\n                                }\n                            }\n                        }\n                        break;\n                    case 1 /* Attr */:\n                        var elementNodeIndex = opCode >>> 1 /* SHIFT_REF */;\n                        var attrName = mutableOpCodes[++i];\n                        var attrValue = mutableOpCodes[++i];\n                        // This code is used for ICU expressions only, since we don't support\n                        // directives/components in ICUs, we don't need to worry about inputs here\n                        setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);\n                        break;\n                    default:\n                        throw new Error(\"Unable to determine the type of mutate operation for \\\"\" + opCode + \"\\\"\");\n                }\n            }\n            else {\n                switch (opCode) {\n                    case ICU_MARKER:\n                        var commentValue = mutableOpCodes[++i];\n                        var commentNodeIndex = mutableOpCodes[++i];\n                        if (lView[commentNodeIndex] === null) {\n                            ngDevMode &&\n                                assertEqual(typeof commentValue, 'string', \"Expected \\\"\" + commentValue + \"\\\" to be a comment node value\");\n                            ngDevMode && ngDevMode.rendererCreateComment++;\n                            ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);\n                            var commentRNode = lView[commentNodeIndex] =\n                                createCommentNode(renderer, commentValue);\n                            // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n                            attachPatchData(commentRNode, lView);\n                        }\n                        break;\n                    case ELEMENT_MARKER:\n                        var tagName = mutableOpCodes[++i];\n                        var elementNodeIndex = mutableOpCodes[++i];\n                        if (lView[elementNodeIndex] === null) {\n                            ngDevMode &&\n                                assertEqual(typeof tagName, 'string', \"Expected \\\"\" + tagName + \"\\\" to be an element node tag name\");\n                            ngDevMode && ngDevMode.rendererCreateElement++;\n                            ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);\n                            var elementRNode = lView[elementNodeIndex] =\n                                createElementNode(renderer, tagName, null);\n                            // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n                            attachPatchData(elementRNode, lView);\n                        }\n                        break;\n                    default:\n                        ngDevMode &&\n                            throwError(\"Unable to determine the type of mutate operation for \\\"\" + opCode + \"\\\"\");\n                }\n            }\n        }\n    }\n    /**\n     * Apply `I18nUpdateOpCodes` OpCodes\n     *\n     * @param tView Current `TView`\n     * @param lView Current `LView`\n     * @param updateOpCodes OpCodes to process\n     * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n     * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from\n     *     `bindingsStartIndex`)\n     */\n    function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask) {\n        for (var i = 0; i < updateOpCodes.length; i++) {\n            // bit code to check if we should apply the next update\n            var checkBit = updateOpCodes[i];\n            // Number of opCodes to skip until next set of update codes\n            var skipCodes = updateOpCodes[++i];\n            if (checkBit & changeMask) {\n                // The value has been updated since last checked\n                var value = '';\n                for (var j = i + 1; j <= (i + skipCodes); j++) {\n                    var opCode = updateOpCodes[j];\n                    if (typeof opCode == 'string') {\n                        value += opCode;\n                    }\n                    else if (typeof opCode == 'number') {\n                        if (opCode < 0) {\n                            // Negative opCode represent `i18nExp` values offset.\n                            value += renderStringify(lView[bindingsStartIndex - opCode]);\n                        }\n                        else {\n                            var nodeIndex = (opCode >>> 2 /* SHIFT_REF */);\n                            switch (opCode & 3 /* MASK_OPCODE */) {\n                                case 1 /* Attr */:\n                                    var propName = updateOpCodes[++j];\n                                    var sanitizeFn = updateOpCodes[++j];\n                                    var tNodeOrTagName = tView.data[nodeIndex];\n                                    ngDevMode && assertDefined(tNodeOrTagName, 'Experting TNode or string');\n                                    if (typeof tNodeOrTagName === 'string') {\n                                        // IF we don't have a `TNode`, then we are an element in ICU (as ICU content does\n                                        // not have TNode), in which case we know that there are no directives, and hence\n                                        // we use attribute setting.\n                                        setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);\n                                    }\n                                    else {\n                                        elementPropertyInternal(tView, tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn, false);\n                                    }\n                                    break;\n                                case 0 /* Text */:\n                                    var rText = lView[nodeIndex];\n                                    rText !== null && updateTextNode(lView[RENDERER], rText, value);\n                                    break;\n                                case 2 /* IcuSwitch */:\n                                    applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);\n                                    break;\n                                case 3 /* IcuUpdate */:\n                                    applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);\n                                    break;\n                            }\n                        }\n                    }\n                }\n            }\n            else {\n                var opCode = updateOpCodes[i + 1];\n                if (opCode > 0 && (opCode & 3 /* MASK_OPCODE */) === 3 /* IcuUpdate */) {\n                    // Special case for the `icuUpdateCase`. It could be that the mask did not match, but\n                    // we still need to execute `icuUpdateCase` because the case has changed recently due to\n                    // previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in\n                    // pairs.)\n                    var nodeIndex = (opCode >>> 2 /* SHIFT_REF */);\n                    var tIcu = getTIcu(tView, nodeIndex);\n                    var currentIndex = lView[tIcu.currentCaseLViewIndex];\n                    if (currentIndex < 0) {\n                        applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);\n                    }\n                }\n            }\n            i += skipCodes;\n        }\n    }\n    /**\n     * Apply OpCodes associated with updating an existing ICU.\n     *\n     * @param tView Current `TView`\n     * @param tIcu Current `TIcu`\n     * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n     * @param lView Current `LView`\n     */\n    function applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {\n        ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);\n        var activeCaseIndex = lView[tIcu.currentCaseLViewIndex];\n        if (activeCaseIndex !== null) {\n            var mask = changeMask;\n            if (activeCaseIndex < 0) {\n                // Clear the flag.\n                // Negative number means that the ICU was freshly created and we need to force the update.\n                activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;\n                // -1 is same as all bits on, which simulates creation since it marks all bits dirty\n                mask = -1;\n            }\n            applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);\n        }\n    }\n    /**\n     * Apply OpCodes associated with switching a case on ICU.\n     *\n     * This involves tearing down existing case and than building up a new case.\n     *\n     * @param tView Current `TView`\n     * @param tIcu Current `TIcu`\n     * @param lView Current `LView`\n     * @param value Value of the case to update to.\n     */\n    function applyIcuSwitchCase(tView, tIcu, lView, value) {\n        // Rebuild a new case for this ICU\n        var caseIndex = getCaseIndex(tIcu, value);\n        var activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n        if (activeCaseIndex !== caseIndex) {\n            applyIcuSwitchCaseRemove(tView, tIcu, lView);\n            lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n            if (caseIndex !== null) {\n                // Add the nodes for the new case\n                var anchorRNode = lView[tIcu.anchorIdx];\n                if (anchorRNode) {\n                    ngDevMode && assertDomNode(anchorRNode);\n                    applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n                }\n            }\n        }\n    }\n    /**\n     * Apply OpCodes associated with tearing ICU case.\n     *\n     * This involves tearing down existing case and than building up a new case.\n     *\n     * @param tView Current `TView`\n     * @param tIcu Current `TIcu`\n     * @param lView Current `LView`\n     */\n    function applyIcuSwitchCaseRemove(tView, tIcu, lView) {\n        var activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n        if (activeCaseIndex !== null) {\n            var removeCodes = tIcu.remove[activeCaseIndex];\n            for (var i = 0; i < removeCodes.length; i++) {\n                var nodeOrIcuIndex = removeCodes[i];\n                if (nodeOrIcuIndex > 0) {\n                    // Positive numbers are `RNode`s.\n                    var rNode = getNativeByIndex(nodeOrIcuIndex, lView);\n                    rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);\n                }\n                else {\n                    // Negative numbers are ICUs\n                    applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);\n                }\n            }\n        }\n    }\n    /**\n     * Returns the index of the current case of an ICU expression depending on the main binding value\n     *\n     * @param icuExpression\n     * @param bindingValue The value of the main binding used by this ICU expression\n     */\n    function getCaseIndex(icuExpression, bindingValue) {\n        var index = icuExpression.cases.indexOf(bindingValue);\n        if (index === -1) {\n            switch (icuExpression.type) {\n                case 1 /* plural */: {\n                    var resolvedCase = getPluralCase(bindingValue, getLocaleId());\n                    index = icuExpression.cases.indexOf(resolvedCase);\n                    if (index === -1 && resolvedCase !== 'other') {\n                        index = icuExpression.cases.indexOf('other');\n                    }\n                    break;\n                }\n                case 0 /* select */: {\n                    index = icuExpression.cases.indexOf('other');\n                    break;\n                }\n            }\n        }\n        return index === -1 ? null : index;\n    }\n\n    /**\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://angular.io/license\n     */\n    function loadIcuContainerVisitor() {\n        var _stack = [];\n        var _index = -1;\n        var _lView;\n        var _removes;\n        /**\n         * Retrieves a set of root nodes from `TIcu.remove`. Used by `TNodeType.ICUContainer`\n         * to determine which root belong to the ICU.\n         *\n         * Example of usage.\n         * ```\n         * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);\n         * let rNode: RNode|null;\n         * while(rNode = nextRNode()) {\n         *   console.log(rNode);\n         * }\n         * ```\n         *\n         * @param tIcuContainerNode Current `TIcuContainerNode`\n         * @param lView `LView` where the `RNode`s should be looked up.\n         */\n        function icuContainerIteratorStart(tIcuContainerNode, lView) {\n            _lView = lView;\n            while (_stack.length)\n                _stack.pop();\n            ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);\n            enterIcu(tIcuContainerNode.value, lView);\n            return icuContainerIteratorNext;\n        }\n        function enterIcu(tIcu, lView) {\n            _index = 0;\n            var currentCase = getCurrentICUCaseIndex(tIcu, lView);\n            if (currentCase !== null) {\n                ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);\n                _removes = tIcu.remove[currentCase];\n            }\n            else {\n                _removes = EMPTY_ARRAY;\n            }\n        }\n        function icuContainerIteratorNext() {\n            if (_index < _removes.length) {\n                var removeOpCode = _removes[_index++];\n                ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');\n                if (removeOpCode > 0) {\n                    var rNode = _lView[removeOpCode];\n                    ngDevMode && assertDomNode(rNode);\n                    return rNode;\n                }\n                else {\n                    _stack.push(_index, _removes);\n                    // ICUs are represented by negative indices\n                    var tIcuIndex = ~removeOpCode;\n                    var tIcu = _lView[TVIEW].data[tIcuIndex];\n                    ngDevMode && assertTIcu(tIcu);\n                    enterIcu(tIcu, _lView);\n                    return icuContainerIteratorNext();\n                }\n            }\n            else {\n                if (_stack.length === 0) {\n                    return null;\n                }\n                else {\n                    _removes = _stack.pop();\n                    _index = _stack.pop();\n                    return icuContainerIteratorNext();\n                }\n            }\n        }\n        return icuContainerIteratorStart;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Converts `I18nCreateOpCodes` array into a human readable format.\n     *\n     * This function is attached to the `I18nCreateOpCodes.debug` property if `ngDevMode` is enabled.\n     * This function provides a human readable view of the opcodes. This is useful when debugging the\n     * application as well as writing more readable tests.\n     *\n     * @param this `I18nCreateOpCodes` if attached as a method.\n     * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n     */\n    function i18nCreateOpCodesToString(opcodes) {\n        var createOpCodes = opcodes || (Array.isArray(this) ? this : []);\n        var lines = [];\n        for (var i = 0; i < createOpCodes.length; i++) {\n            var opCode = createOpCodes[i++];\n            var text = createOpCodes[i];\n            var isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n            var appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n            var index = opCode >>> I18nCreateOpCode.SHIFT;\n            lines.push(\"lView[\" + index + \"] = document.\" + (isComment ? 'createComment' : 'createText') + \"(\" + JSON.stringify(text) + \");\");\n            if (appendNow) {\n                lines.push(\"parent.appendChild(lView[\" + index + \"]);\");\n            }\n        }\n        return lines;\n    }\n    /**\n     * Converts `I18nUpdateOpCodes` array into a human readable format.\n     *\n     * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled.\n     * This function provides a human readable view of the opcodes. This is useful when debugging the\n     * application as well as writing more readable tests.\n     *\n     * @param this `I18nUpdateOpCodes` if attached as a method.\n     * @param opcodes `I18nUpdateOpCodes` if invoked as a function.\n     */\n    function i18nUpdateOpCodesToString(opcodes) {\n        var parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n        var lines = [];\n        function consumeOpCode(value) {\n            var ref = value >>> 2 /* SHIFT_REF */;\n            var opCode = value & 3 /* MASK_OPCODE */;\n            switch (opCode) {\n                case 0 /* Text */:\n                    return \"(lView[\" + ref + \"] as Text).textContent = $$$\";\n                case 1 /* Attr */:\n                    var attrName = parser.consumeString();\n                    var sanitizationFn = parser.consumeFunction();\n                    var value_1 = sanitizationFn ? \"(\" + sanitizationFn + \")($$$)\" : '$$$';\n                    return \"(lView[\" + ref + \"] as Element).setAttribute('\" + attrName + \"', \" + value_1 + \")\";\n                case 2 /* IcuSwitch */:\n                    return \"icuSwitchCase(\" + ref + \", $$$)\";\n                case 3 /* IcuUpdate */:\n                    return \"icuUpdateCase(\" + ref + \")\";\n            }\n            throw new Error('unexpected OpCode');\n        }\n        while (parser.hasMore()) {\n            var mask = parser.consumeNumber();\n            var size = parser.consumeNumber();\n            var end = parser.i + size;\n            var statements = [];\n            var statement = '';\n            while (parser.i < end) {\n                var value = parser.consumeNumberOrString();\n                if (typeof value === 'string') {\n                    statement += value;\n                }\n                else if (value < 0) {\n                    // Negative numbers are ref indexes\n                    // Here `i` refers to current binding index. It is to signify that the value is relative,\n                    // rather than absolute.\n                    statement += '${lView[i' + value + ']}';\n                }\n                else {\n                    // Positive numbers are operations.\n                    var opCodeText = consumeOpCode(value);\n                    statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';');\n                    statement = '';\n                }\n            }\n            lines.push(\"if (mask & 0b\" + mask.toString(2) + \") { \" + statements.join(' ') + \" }\");\n        }\n        return lines;\n    }\n    /**\n     * Converts `I18nCreateOpCodes` array into a human readable format.\n     *\n     * This function is attached to the `I18nCreateOpCodes.debug` if `ngDevMode` is enabled. This\n     * function provides a human readable view of the opcodes. This is useful when debugging the\n     * application as well as writing more readable tests.\n     *\n     * @param this `I18nCreateOpCodes` if attached as a method.\n     * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n     */\n    function icuCreateOpCodesToString(opcodes) {\n        var parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n        var lines = [];\n        function consumeOpCode(opCode) {\n            var parent = getParentFromIcuCreateOpCode(opCode);\n            var ref = getRefFromIcuCreateOpCode(opCode);\n            switch (getInstructionFromIcuCreateOpCode(opCode)) {\n                case 0 /* AppendChild */:\n                    return \"(lView[\" + parent + \"] as Element).appendChild(lView[\" + lastRef + \"])\";\n                case 1 /* Attr */:\n                    return \"(lView[\" + ref + \"] as Element).setAttribute(\\\"\" + parser.consumeString() + \"\\\", \\\"\" + parser.consumeString() + \"\\\")\";\n            }\n            throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));\n        }\n        var lastRef = -1;\n        while (parser.hasMore()) {\n            var value = parser.consumeNumberStringOrMarker();\n            if (value === ICU_MARKER) {\n                var text = parser.consumeString();\n                lastRef = parser.consumeNumber();\n                lines.push(\"lView[\" + lastRef + \"] = document.createComment(\\\"\" + text + \"\\\")\");\n            }\n            else if (value === ELEMENT_MARKER) {\n                var text = parser.consumeString();\n                lastRef = parser.consumeNumber();\n                lines.push(\"lView[\" + lastRef + \"] = document.createElement(\\\"\" + text + \"\\\")\");\n            }\n            else if (typeof value === 'string') {\n                lastRef = parser.consumeNumber();\n                lines.push(\"lView[\" + lastRef + \"] = document.createTextNode(\\\"\" + value + \"\\\")\");\n            }\n            else if (typeof value === 'number') {\n                var line = consumeOpCode(value);\n                line && lines.push(line);\n            }\n            else {\n                throw new Error('Unexpected value');\n            }\n        }\n        return lines;\n    }\n    /**\n     * Converts `I18nRemoveOpCodes` array into a human readable format.\n     *\n     * This function is attached to the `I18nRemoveOpCodes.debug` if `ngDevMode` is enabled. This\n     * function provides a human readable view of the opcodes. This is useful when debugging the\n     * application as well as writing more readable tests.\n     *\n     * @param this `I18nRemoveOpCodes` if attached as a method.\n     * @param opcodes `I18nRemoveOpCodes` if invoked as a function.\n     */\n    function i18nRemoveOpCodesToString(opcodes) {\n        var removeCodes = opcodes || (Array.isArray(this) ? this : []);\n        var lines = [];\n        for (var i = 0; i < removeCodes.length; i++) {\n            var nodeOrIcuIndex = removeCodes[i];\n            if (nodeOrIcuIndex > 0) {\n                // Positive numbers are `RNode`s.\n                lines.push(\"remove(lView[\" + nodeOrIcuIndex + \"])\");\n            }\n            else {\n                // Negative numbers are ICUs\n                lines.push(\"removeNestedICU(\" + ~nodeOrIcuIndex + \")\");\n            }\n        }\n        return lines;\n    }\n    var OpCodeParser = /** @class */ (function () {\n        function OpCodeParser(codes) {\n            this.i = 0;\n            this.codes = codes;\n        }\n        OpCodeParser.prototype.hasMore = function () {\n            return this.i < this.codes.length;\n        };\n        OpCodeParser.prototype.consumeNumber = function () {\n            var value = this.codes[this.i++];\n            assertNumber(value, 'expecting number in OpCode');\n            return value;\n        };\n        OpCodeParser.prototype.consumeString = function () {\n            var value = this.codes[this.i++];\n            assertString(value, 'expecting string in OpCode');\n            return value;\n        };\n        OpCodeParser.prototype.consumeFunction = function () {\n            var value = this.codes[this.i++];\n            if (value === null || typeof value === 'function') {\n                return value;\n            }\n            throw new Error('expecting function in OpCode');\n        };\n        OpCodeParser.prototype.consumeNumberOrString = function () {\n            var value = this.codes[this.i++];\n            if (typeof value === 'string') {\n                return value;\n            }\n            assertNumber(value, 'expecting number or string in OpCode');\n            return value;\n        };\n        OpCodeParser.prototype.consumeNumberStringOrMarker = function () {\n            var value = this.codes[this.i++];\n            if (typeof value === 'string' || typeof value === 'number' || value == ICU_MARKER ||\n                value == ELEMENT_MARKER) {\n                return value;\n            }\n            assertNumber(value, 'expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode');\n            return value;\n        };\n        return OpCodeParser;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var BINDING_REGEXP = /�(\\d+):?\\d*�/gi;\n    var ICU_REGEXP = /({\\s*�\\d+:?\\d*�\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\n    var NESTED_ICU = /�(\\d+)�/;\n    var ICU_BLOCK_REGEXP = /^\\s*(�\\d+:?\\d*�)\\s*,\\s*(select|plural)\\s*,/;\n    var MARKER = \"\\uFFFD\";\n    var SUBTEMPLATE_REGEXP = /�\\/?\\*(\\d+:\\d+)�/gi;\n    var PH_REGEXP = /�(\\/?[#*]\\d+):?\\d*�/gi;\n    /**\n     * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:\n     * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32\n     * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character\n     * and later on replaced by a space. We are re-implementing the same idea here, since translations\n     * might contain this special character.\n     */\n    var NGSP_UNICODE_REGEXP = /\\uE500/g;\n    function replaceNgsp(value) {\n        return value.replace(NGSP_UNICODE_REGEXP, ' ');\n    }\n    /**\n     * Create dynamic nodes from i18n translation block.\n     *\n     * - Text nodes are created synchronously\n     * - TNodes are linked into tree lazily\n     *\n     * @param tView Current `TView`\n     * @parentTNodeIndex index to the parent TNode of this i18n block\n     * @param lView Current `LView`\n     * @param index Index of `ɵɵi18nStart` instruction.\n     * @param message Message to translate.\n     * @param subTemplateIndex Index into the sub template of message translation. (ie in case of\n     *     `ngIf`) (-1 otherwise)\n     */\n    function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {\n        var rootTNode = getCurrentParentTNode();\n        var createOpCodes = [];\n        var updateOpCodes = [];\n        var existingTNodeStack = [[]];\n        if (ngDevMode) {\n            attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);\n            attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n        }\n        message = getTranslationForTemplate(message, subTemplateIndex);\n        var msgParts = replaceNgsp(message).split(PH_REGEXP);\n        for (var i = 0; i < msgParts.length; i++) {\n            var value = msgParts[i];\n            if ((i & 1) === 0) {\n                // Even indexes are text (including bindings & ICU expressions)\n                var parts = i18nParseTextIntoPartsAndICU(value);\n                for (var j = 0; j < parts.length; j++) {\n                    var part = parts[j];\n                    if ((j & 1) === 0) {\n                        // `j` is odd therefore `part` is string\n                        var text = part;\n                        ngDevMode && assertString(text, 'Parsed ICU part should be string');\n                        if (text !== '') {\n                            i18nStartFirstCreatePassProcessTextNode(tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);\n                        }\n                    }\n                    else {\n                        // `j` is Even therefor `part` is an `ICUExpression`\n                        var icuExpression = part;\n                        // Verify that ICU expression has the right shape. Translations might contain invalid\n                        // constructions (while original messages were correct), so ICU parsing at runtime may\n                        // not succeed (thus `icuExpression` remains a string).\n                        // Note: we intentionally retain the error here by not using `ngDevMode`, because\n                        // the value can change based on the locale and users aren't guaranteed to hit\n                        // an invalid string while they're developing.\n                        if (typeof icuExpression !== 'object') {\n                            throw new Error(\"Unable to parse ICU expression in \\\"\" + message + \"\\\" message.\");\n                        }\n                        var icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? \"ICU \" + index + \":\" + icuExpression.mainBinding : '', true);\n                        var icuNodeIndex = icuContainerTNode.index;\n                        ngDevMode &&\n                            assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, 'Index must be in absolute LView offset');\n                        icuStart(tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);\n                    }\n                }\n            }\n            else {\n                // Odd indexes are placeholders (elements and sub-templates)\n                // At this point value is something like: '/#1:2' (originally coming from '�/#1:2�')\n                var isClosing = value.charCodeAt(0) === 47 /* SLASH */;\n                var type = value.charCodeAt(isClosing ? 1 : 0);\n                ngDevMode && assertOneOf(type, 42 /* STAR */, 35 /* HASH */);\n                var index_1 = HEADER_OFFSET + Number.parseInt(value.substring((isClosing ? 2 : 1)));\n                if (isClosing) {\n                    existingTNodeStack.shift();\n                    setCurrentTNode(getCurrentParentTNode(), false);\n                }\n                else {\n                    var tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index_1);\n                    existingTNodeStack.unshift([]);\n                    setCurrentTNode(tNode, true);\n                }\n            }\n        }\n        tView.data[index] = {\n            create: createOpCodes,\n            update: updateOpCodes,\n        };\n    }\n    /**\n     * Allocate space in i18n Range add create OpCode instruction to crete a text or comment node.\n     *\n     * @param tView Current `TView` needed to allocate space in i18n range.\n     * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be\n     *     added as part of the `i18nStart` instruction or as part of the `TNode.insertBeforeIndex`.\n     * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n     * @param lView Current `LView` needed to allocate space in i18n range.\n     * @param createOpCodes Array storing `I18nCreateOpCodes` where new opCodes will be added.\n     * @param text Text to be added when the `Text` or `Comment` node will be created.\n     * @param isICU true if a `Comment` node for ICU (instead of `Text`) node should be created.\n     */\n    function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n        var i18nNodeIdx = allocExpando(tView, lView, 1, null);\n        var opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n        var parentTNode = getCurrentParentTNode();\n        if (rootTNode === parentTNode) {\n            // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n            // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n            // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n            parentTNode = null;\n        }\n        if (parentTNode === null) {\n            // If we don't have a parent that means that we can eagerly add nodes.\n            // If we have a parent than these nodes can't be added now (as the parent has not been created\n            // yet) and instead the `parentTNode` is responsible for adding it. See\n            // `TNode.insertBeforeIndex`\n            opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n        }\n        if (isICU) {\n            opCode |= I18nCreateOpCode.COMMENT;\n            ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n        }\n        createOpCodes.push(opCode, text === null ? '' : text);\n        // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n        // bindings are.\n        var tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n        addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n        var tNodeIdx = tNode.index;\n        setCurrentTNode(tNode, false /* Text nodes are self closing */);\n        if (parentTNode !== null && rootTNode !== parentTNode) {\n            // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n            // We have to make sure to add ourselves to the parent.\n            setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n        }\n        return tNode;\n    }\n    /**\n     * Processes text node in i18n block.\n     *\n     * Text nodes can have:\n     * - Create instruction in `createOpCodes` for creating the text node.\n     * - Allocate spec for text node in i18n range of `LView`\n     * - If contains binding:\n     *    - bindings => allocate space in i18n range of `LView` to store the binding value.\n     *    - populate `updateOpCodes` with update instructions.\n     *\n     * @param tView Current `TView`\n     * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will\n     *     be added as part of the `i18nStart` instruction or as part of the\n     *     `TNode.insertBeforeIndex`.\n     * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n     * @param createOpCodes Location where the creation OpCodes will be stored.\n     * @param lView Current `LView`\n     * @param text The translated text (which may contain binding)\n     */\n    function i18nStartFirstCreatePassProcessTextNode(tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {\n        var hasBinding = text.match(BINDING_REGEXP);\n        var tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);\n        if (hasBinding) {\n            generateBindingUpdateOpCodes(updateOpCodes, text, tNode.index, null, 0, null);\n        }\n    }\n    /**\n     * See `i18nAttributes` above.\n     */\n    function i18nAttributesFirstPass(tView, index, values) {\n        var previousElement = getCurrentTNode();\n        var previousElementIndex = previousElement.index;\n        var updateOpCodes = [];\n        if (ngDevMode) {\n            attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n        }\n        if (tView.firstCreatePass && tView.data[index] === null) {\n            for (var i = 0; i < values.length; i += 2) {\n                var attrName = values[i];\n                var message = values[i + 1];\n                if (message !== '') {\n                    // Check if attribute value contains an ICU and throw an error if that's the case.\n                    // ICUs in element attributes are not supported.\n                    // Note: we intentionally retain the error here by not using `ngDevMode`, because\n                    // the `value` can change based on the locale and users aren't guaranteed to hit\n                    // an invalid string while they're developing.\n                    if (ICU_REGEXP.test(message)) {\n                        throw new Error(\"ICU expressions are not supported in attributes. Message: \\\"\" + message + \"\\\".\");\n                    }\n                    // i18n attributes that hit this code path are guaranteed to have bindings, because\n                    // the compiler treats static i18n attributes as regular attribute bindings.\n                    // Since this may not be the first i18n attribute on this element we need to pass in how\n                    // many previous bindings there have already been.\n                    generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);\n                }\n            }\n            tView.data[index] = updateOpCodes;\n        }\n    }\n    /**\n     * Generate the OpCodes to update the bindings of a string.\n     *\n     * @param updateOpCodes Place where the update opcodes will be stored.\n     * @param str The string containing the bindings.\n     * @param destinationNode Index of the destination node which will receive the binding.\n     * @param attrName Name of the attribute, if the string belongs to an attribute.\n     * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n     * @param bindingStart The lView index of the next expression that can be bound via an opCode.\n     * @returns The mask value for these bindings\n     */\n    function generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, bindingStart, sanitizeFn) {\n        ngDevMode &&\n            assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, 'Index must be in absolute LView offset');\n        var maskIndex = updateOpCodes.length; // Location of mask\n        var sizeIndex = maskIndex + 1; // location of size for skipping\n        updateOpCodes.push(null, null); // Alloc space for mask and size\n        var startIndex = maskIndex + 2; // location of first allocation.\n        if (ngDevMode) {\n            attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n        }\n        var textParts = str.split(BINDING_REGEXP);\n        var mask = 0;\n        for (var j = 0; j < textParts.length; j++) {\n            var textValue = textParts[j];\n            if (j & 1) {\n                // Odd indexes are bindings\n                var bindingIndex = bindingStart + parseInt(textValue, 10);\n                updateOpCodes.push(-1 - bindingIndex);\n                mask = mask | toMaskBit(bindingIndex);\n            }\n            else if (textValue !== '') {\n                // Even indexes are text\n                updateOpCodes.push(textValue);\n            }\n        }\n        updateOpCodes.push(destinationNode << 2 /* SHIFT_REF */ |\n            (attrName ? 1 /* Attr */ : 0 /* Text */));\n        if (attrName) {\n            updateOpCodes.push(attrName, sanitizeFn);\n        }\n        updateOpCodes[maskIndex] = mask;\n        updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;\n        return mask;\n    }\n    /**\n     * Count the number of bindings in the given `opCodes`.\n     *\n     * It could be possible to speed this up, by passing the number of bindings found back from\n     * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more\n     * complexity in the code and/or transient objects to be created.\n     *\n     * Since this function is only called once when the template is instantiated, is trivial in the\n     * first instance (since `opCodes` will be an empty array), and it is not common for elements to\n     * contain multiple i18n bound attributes, it seems like this is a reasonable compromise.\n     */\n    function countBindings(opCodes) {\n        var count = 0;\n        for (var i = 0; i < opCodes.length; i++) {\n            var opCode = opCodes[i];\n            // Bindings are negative numbers.\n            if (typeof opCode === 'number' && opCode < 0) {\n                count++;\n            }\n        }\n        return count;\n    }\n    /**\n     * Convert binding index to mask bit.\n     *\n     * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n     * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to\n     * have more than 32 bindings this will be hit very rarely. The downside of hitting this corner\n     * case is that we will execute binding code more often than necessary. (penalty of performance)\n     */\n    function toMaskBit(bindingIndex) {\n        return 1 << Math.min(bindingIndex, 31);\n    }\n    function isRootTemplateMessage(subTemplateIndex) {\n        return subTemplateIndex === -1;\n    }\n    /**\n     * Removes everything inside the sub-templates of a message.\n     */\n    function removeInnerTemplateTranslation(message) {\n        var match;\n        var res = '';\n        var index = 0;\n        var inTemplate = false;\n        var tagMatched;\n        while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n            if (!inTemplate) {\n                res += message.substring(index, match.index + match[0].length);\n                tagMatched = match[1];\n                inTemplate = true;\n            }\n            else {\n                if (match[0] === MARKER + \"/*\" + tagMatched + MARKER) {\n                    index = match.index;\n                    inTemplate = false;\n                }\n            }\n        }\n        ngDevMode &&\n            assertEqual(inTemplate, false, \"Tag mismatch: unable to find the end of the sub-template in the translation \\\"\" + message + \"\\\"\");\n        res += message.substr(index);\n        return res;\n    }\n    /**\n     * Extracts a part of a message and removes the rest.\n     *\n     * This method is used for extracting a part of the message associated with a template. A\n     * translated message can span multiple templates.\n     *\n     * Example:\n     * ```\n     * <div i18n>Translate <span *ngIf>me</span>!</div>\n     * ```\n     *\n     * @param message The message to crop\n     * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n     * external template and removes all sub-templates.\n     */\n    function getTranslationForTemplate(message, subTemplateIndex) {\n        if (isRootTemplateMessage(subTemplateIndex)) {\n            // We want the root template message, ignore all sub-templates\n            return removeInnerTemplateTranslation(message);\n        }\n        else {\n            // We want a specific sub-template\n            var start = message.indexOf(\":\" + subTemplateIndex + MARKER) + 2 + subTemplateIndex.toString().length;\n            var end = message.search(new RegExp(MARKER + \"\\\\/\\\\*\\\\d+:\" + subTemplateIndex + MARKER));\n            return removeInnerTemplateTranslation(message.substring(start, end));\n        }\n    }\n    /**\n     * Generate the OpCodes for ICU expressions.\n     *\n     * @param icuExpression\n     * @param index Index where the anchor is stored and an optional `TIcuContainerNode`\n     *   - `lView[anchorIdx]` points to a `Comment` node representing the anchor for the ICU.\n     *   - `tView.data[anchorIdx]` points to the `TIcuContainerNode` if ICU is root (`null` otherwise)\n     */\n    function icuStart(tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {\n        ngDevMode && assertDefined(icuExpression, 'ICU expression must be defined');\n        var bindingMask = 0;\n        var tIcu = {\n            type: icuExpression.type,\n            currentCaseLViewIndex: allocExpando(tView, lView, 1, null),\n            anchorIdx: anchorIdx,\n            cases: [],\n            create: [],\n            remove: [],\n            update: []\n        };\n        addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);\n        setTIcu(tView, anchorIdx, tIcu);\n        var values = icuExpression.values;\n        for (var i = 0; i < values.length; i++) {\n            // Each value is an array of strings & other ICU expressions\n            var valueArr = values[i];\n            var nestedIcus = [];\n            for (var j = 0; j < valueArr.length; j++) {\n                var value = valueArr[j];\n                if (typeof value !== 'string') {\n                    // It is an nested ICU expression\n                    var icuIndex = nestedIcus.push(value) - 1;\n                    // Replace nested ICU expression by a comment node\n                    valueArr[j] = \"<!--\\uFFFD\" + icuIndex + \"\\uFFFD-->\";\n                }\n            }\n            bindingMask = parseIcuCase(tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(''), nestedIcus) |\n                bindingMask;\n        }\n        if (bindingMask) {\n            addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);\n        }\n    }\n    /**\n     * Parses text containing an ICU expression and produces a JSON object for it.\n     * Original code from closure library, modified for Angular.\n     *\n     * @param pattern Text containing an ICU expression that needs to be parsed.\n     *\n     */\n    function parseICUBlock(pattern) {\n        var cases = [];\n        var values = [];\n        var icuType = 1 /* plural */;\n        var mainBinding = 0;\n        pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {\n            if (type === 'select') {\n                icuType = 0 /* select */;\n            }\n            else {\n                icuType = 1 /* plural */;\n            }\n            mainBinding = parseInt(binding.substr(1), 10);\n            return '';\n        });\n        var parts = i18nParseTextIntoPartsAndICU(pattern);\n        // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n        for (var pos = 0; pos < parts.length;) {\n            var key = parts[pos++].trim();\n            if (icuType === 1 /* plural */) {\n                // Key can be \"=x\", we just want \"x\"\n                key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n            }\n            if (key.length) {\n                cases.push(key);\n            }\n            var blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);\n            if (cases.length > values.length) {\n                values.push(blocks);\n            }\n        }\n        // TODO(ocombe): support ICU expressions in attributes, see #21615\n        return { type: icuType, mainBinding: mainBinding, cases: cases, values: values };\n    }\n    /**\n     * Breaks pattern into strings and top level {...} blocks.\n     * Can be used to break a message into text and ICU expressions, or to break an ICU expression\n     * into keys and cases. Original code from closure library, modified for Angular.\n     *\n     * @param pattern (sub)Pattern to be broken.\n     * @returns An `Array<string|IcuExpression>` where:\n     *   - odd positions: `string` => text between ICU expressions\n     *   - even positions: `ICUExpression` => ICU expression parsed into `ICUExpression` record.\n     */\n    function i18nParseTextIntoPartsAndICU(pattern) {\n        if (!pattern) {\n            return [];\n        }\n        var prevPos = 0;\n        var braceStack = [];\n        var results = [];\n        var braces = /[{}]/g;\n        // lastIndex doesn't get set to 0 so we have to.\n        braces.lastIndex = 0;\n        var match;\n        while (match = braces.exec(pattern)) {\n            var pos = match.index;\n            if (match[0] == '}') {\n                braceStack.pop();\n                if (braceStack.length == 0) {\n                    // End of the block.\n                    var block = pattern.substring(prevPos, pos);\n                    if (ICU_BLOCK_REGEXP.test(block)) {\n                        results.push(parseICUBlock(block));\n                    }\n                    else {\n                        results.push(block);\n                    }\n                    prevPos = pos + 1;\n                }\n            }\n            else {\n                if (braceStack.length == 0) {\n                    var substring_1 = pattern.substring(prevPos, pos);\n                    results.push(substring_1);\n                    prevPos = pos + 1;\n                }\n                braceStack.push('{');\n            }\n        }\n        var substring = pattern.substring(prevPos);\n        results.push(substring);\n        return results;\n    }\n    /**\n     * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n     *\n     */\n    function parseIcuCase(tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {\n        var create = [];\n        var remove = [];\n        var update = [];\n        if (ngDevMode) {\n            attachDebugGetter(create, icuCreateOpCodesToString);\n            attachDebugGetter(remove, i18nRemoveOpCodesToString);\n            attachDebugGetter(update, i18nUpdateOpCodesToString);\n        }\n        tIcu.cases.push(caseName);\n        tIcu.create.push(create);\n        tIcu.remove.push(remove);\n        tIcu.update.push(update);\n        var inertBodyHelper = getInertBodyHelper(getDocument());\n        var inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeCaseHtml);\n        ngDevMode && assertDefined(inertBodyElement, 'Unable to generate inert body element');\n        var inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;\n        if (inertRootNode) {\n            return walkIcuTree(tView, tIcu, lView, updateOpCodes, create, remove, update, inertRootNode, parentIdx, nestedIcus, 0);\n        }\n        else {\n            return 0;\n        }\n    }\n    function walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, parentNode, parentIdx, nestedIcus, depth) {\n        var bindingMask = 0;\n        var currentNode = parentNode.firstChild;\n        while (currentNode) {\n            var newIndex = allocExpando(tView, lView, 1, null);\n            switch (currentNode.nodeType) {\n                case Node.ELEMENT_NODE:\n                    var element = currentNode;\n                    var tagName = element.tagName.toLowerCase();\n                    if (VALID_ELEMENTS.hasOwnProperty(tagName)) {\n                        addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);\n                        tView.data[newIndex] = tagName;\n                        var elAttrs = element.attributes;\n                        for (var i = 0; i < elAttrs.length; i++) {\n                            var attr = elAttrs.item(i);\n                            var lowerAttrName = attr.name.toLowerCase();\n                            var hasBinding_1 = !!attr.value.match(BINDING_REGEXP);\n                            // we assume the input string is safe, unless it's using a binding\n                            if (hasBinding_1) {\n                                if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n                                    if (URI_ATTRS[lowerAttrName]) {\n                                        generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);\n                                    }\n                                    else if (SRCSET_ATTRS[lowerAttrName]) {\n                                        generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, sanitizeSrcset);\n                                    }\n                                    else {\n                                        generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);\n                                    }\n                                }\n                                else {\n                                    ngDevMode &&\n                                        console.warn(\"WARNING: ignoring unsafe attribute value \" +\n                                            (lowerAttrName + \" on element \" + tagName + \" \") +\n                                            \"(see https://g.co/ng/security#xss)\");\n                                }\n                            }\n                            else {\n                                addCreateAttribute(create, newIndex, attr);\n                            }\n                        }\n                        // Parse the children of this node (if any)\n                        bindingMask = walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, currentNode, newIndex, nestedIcus, depth + 1) |\n                            bindingMask;\n                        addRemoveNode(remove, newIndex, depth);\n                    }\n                    break;\n                case Node.TEXT_NODE:\n                    var value = currentNode.textContent || '';\n                    var hasBinding = value.match(BINDING_REGEXP);\n                    addCreateNodeAndAppend(create, null, hasBinding ? '' : value, parentIdx, newIndex);\n                    addRemoveNode(remove, newIndex, depth);\n                    if (hasBinding) {\n                        bindingMask =\n                            generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;\n                    }\n                    break;\n                case Node.COMMENT_NODE:\n                    // Check if the comment node is a placeholder for a nested ICU\n                    var isNestedIcu = NESTED_ICU.exec(currentNode.textContent || '');\n                    if (isNestedIcu) {\n                        var nestedIcuIndex = parseInt(isNestedIcu[1], 10);\n                        var icuExpression = nestedIcus[nestedIcuIndex];\n                        // Create the comment node that will anchor the ICU expression\n                        addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? \"nested ICU \" + nestedIcuIndex : '', parentIdx, newIndex);\n                        icuStart(tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);\n                        addRemoveNestedIcu(remove, newIndex, depth);\n                    }\n                    break;\n            }\n            currentNode = currentNode.nextSibling;\n        }\n        return bindingMask;\n    }\n    function addRemoveNode(remove, index, depth) {\n        if (depth === 0) {\n            remove.push(index);\n        }\n    }\n    function addRemoveNestedIcu(remove, index, depth) {\n        if (depth === 0) {\n            remove.push(~index); // remove ICU at `index`\n            remove.push(index); // remove ICU comment at `index`\n        }\n    }\n    function addUpdateIcuSwitch(update, icuExpression, index) {\n        update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, index << 2 /* SHIFT_REF */ | 2 /* IcuSwitch */);\n    }\n    function addUpdateIcuUpdate(update, bindingMask, index) {\n        update.push(bindingMask, 1, index << 2 /* SHIFT_REF */ | 3 /* IcuUpdate */);\n    }\n    function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {\n        if (marker !== null) {\n            create.push(marker);\n        }\n        create.push(text, createAtIdx, icuCreateOpCode(0 /* AppendChild */, appendToParentIdx, createAtIdx));\n    }\n    function addCreateAttribute(create, newIndex, attr) {\n        create.push(newIndex << 1 /* SHIFT_REF */ | 1 /* Attr */, attr.name, attr.value);\n    }\n\n    /**\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://angular.io/license\n     */\n    // i18nPostprocess consts\n    var ROOT_TEMPLATE_ID = 0;\n    var PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\\[(�.+?�?)\\]/;\n    var PP_PLACEHOLDERS_REGEXP = /\\[(�.+?�?)\\]|(�\\/?\\*\\d+:\\d+�)/g;\n    var PP_ICU_VARS_REGEXP = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\n    var PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;\n    var PP_ICUS_REGEXP = /�I18N_EXP_(ICU(_\\d+)?)�/g;\n    var PP_CLOSE_TEMPLATE_REGEXP = /\\/\\*/;\n    var PP_TEMPLATE_ID_REGEXP = /\\d+\\:(\\d+)/;\n    /**\n     * Handles message string post-processing for internationalization.\n     *\n     * Handles message string post-processing by transforming it from intermediate\n     * format (that might contain some markers that we need to replace) to the final\n     * form, consumable by i18nStart instruction. Post processing steps include:\n     *\n     * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])\n     * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n     * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n     * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)\n     *    in case multiple ICUs have the same placeholder name\n     *\n     * @param message Raw translation string for post processing\n     * @param replacements Set of replacements that should be applied\n     *\n     * @returns Transformed string that can be consumed by i18nStart instruction\n     *\n     * @codeGenApi\n     */\n    function i18nPostprocess(message, replacements) {\n        if (replacements === void 0) { replacements = {}; }\n        /**\n         * Step 1: resolve all multi-value placeholders like [�#5�|�*1:1��#2:1�|�#4:1�]\n         *\n         * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically\n         * grouped by templates, for example: [�#5�|�#6�|�#1:1�|�#3:2�] where �#5� and �#6� belong to root\n         * template, �#1:1� belong to nested template with index 1 and �#1:2� - nested template with index\n         * 3. However in real templates the order might be different: i.e. �#1:1� and/or �#3:2� may go in\n         * front of �#6�. The post processing step restores the right order by keeping track of the\n         * template id stack and looks for placeholders that belong to the currently active template.\n         */\n        var result = message;\n        if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {\n            var matches_1 = {};\n            var templateIdsStack_1 = [ROOT_TEMPLATE_ID];\n            result = result.replace(PP_PLACEHOLDERS_REGEXP, function (m, phs, tmpl) {\n                var content = phs || tmpl;\n                var placeholders = matches_1[content] || [];\n                if (!placeholders.length) {\n                    content.split('|').forEach(function (placeholder) {\n                        var match = placeholder.match(PP_TEMPLATE_ID_REGEXP);\n                        var templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;\n                        var isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder);\n                        placeholders.push([templateId, isCloseTemplateTag, placeholder]);\n                    });\n                    matches_1[content] = placeholders;\n                }\n                if (!placeholders.length) {\n                    throw new Error(\"i18n postprocess: unmatched placeholder - \" + content);\n                }\n                var currentTemplateId = templateIdsStack_1[templateIdsStack_1.length - 1];\n                var idx = 0;\n                // find placeholder index that matches current template id\n                for (var i = 0; i < placeholders.length; i++) {\n                    if (placeholders[i][0] === currentTemplateId) {\n                        idx = i;\n                        break;\n                    }\n                }\n                // update template id stack based on the current tag extracted\n                var _a = __read(placeholders[idx], 3), templateId = _a[0], isCloseTemplateTag = _a[1], placeholder = _a[2];\n                if (isCloseTemplateTag) {\n                    templateIdsStack_1.pop();\n                }\n                else if (currentTemplateId !== templateId) {\n                    templateIdsStack_1.push(templateId);\n                }\n                // remove processed tag from the list\n                placeholders.splice(idx, 1);\n                return placeholder;\n            });\n        }\n        // return current result if no replacements specified\n        if (!Object.keys(replacements).length) {\n            return result;\n        }\n        /**\n         * Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n         */\n        result = result.replace(PP_ICU_VARS_REGEXP, function (match, start, key, _type, _idx, end) {\n            return replacements.hasOwnProperty(key) ? \"\" + start + replacements[key] + end : match;\n        });\n        /**\n         * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n         */\n        result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, function (match, key) {\n            return replacements.hasOwnProperty(key) ? replacements[key] : match;\n        });\n        /**\n         * Step 4: replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�) in case\n         * multiple ICUs have the same placeholder name\n         */\n        result = result.replace(PP_ICUS_REGEXP, function (match, key) {\n            if (replacements.hasOwnProperty(key)) {\n                var list = replacements[key];\n                if (!list.length) {\n                    throw new Error(\"i18n postprocess: unmatched ICU - \" + match + \" with key: \" + key);\n                }\n                return list.shift();\n            }\n            return match;\n        });\n        return result;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Marks a block of text as translatable.\n     *\n     * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n     * The translation `message` is the value which is locale specific. The translation string may\n     * contain placeholders which associate inner elements and sub-templates within the translation.\n     *\n     * The translation `message` placeholders are:\n     * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be\n     *   interpolated into. The placeholder `index` points to the expression binding index. An optional\n     *   `block` that matches the sub-template in which it was declared.\n     * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*:  Marks the beginning\n     *   and end of DOM element that were embedded in the original translation block. The placeholder\n     *   `index` points to the element index in the template instructions set. An optional `block` that\n     *   matches the sub-template in which it was declared.\n     * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be\n     *   split up and translated separately in each angular template function. The `index` points to the\n     *   `template` instruction index. A `block` that matches the sub-template in which it was declared.\n     *\n     * @param index A unique index of the translation in the static block.\n     * @param messageIndex An index of the translation message from the `def.consts` array.\n     * @param subTemplateIndex Optional sub-template index in the `message`.\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18nStart(index, messageIndex, subTemplateIndex) {\n        if (subTemplateIndex === void 0) { subTemplateIndex = -1; }\n        var tView = getTView();\n        var lView = getLView();\n        var adjustedIndex = HEADER_OFFSET + index;\n        ngDevMode && assertDefined(tView, \"tView should be defined\");\n        var message = getConstant(tView.consts, messageIndex);\n        var parentTNode = getCurrentParentTNode();\n        if (tView.firstCreatePass) {\n            i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);\n        }\n        var tI18n = tView.data[adjustedIndex];\n        var sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;\n        var parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);\n        // If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.\n        // When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.\n        var insertInFrontOf = parentTNode && (parentTNode.type & 8 /* ElementContainer */) ?\n            lView[parentTNode.index] :\n            null;\n        applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);\n        setInI18nBlock(true);\n    }\n    /**\n     * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n     * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18nEnd() {\n        setInI18nBlock(false);\n    }\n    /**\n     *\n     * Use this instruction to create a translation block that doesn't contain any placeholder.\n     * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n     *\n     * The translation `message` is the value which is locale specific. The translation string may\n     * contain placeholders which associate inner elements and sub-templates within the translation.\n     *\n     * The translation `message` placeholders are:\n     * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be\n     *   interpolated into. The placeholder `index` points to the expression binding index. An optional\n     *   `block` that matches the sub-template in which it was declared.\n     * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*:  Marks the beginning\n     *   and end of DOM element that were embedded in the original translation block. The placeholder\n     *   `index` points to the element index in the template instructions set. An optional `block` that\n     *   matches the sub-template in which it was declared.\n     * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be\n     *   split up and translated separately in each angular template function. The `index` points to the\n     *   `template` instruction index. A `block` that matches the sub-template in which it was declared.\n     *\n     * @param index A unique index of the translation in the static block.\n     * @param messageIndex An index of the translation message from the `def.consts` array.\n     * @param subTemplateIndex Optional sub-template index in the `message`.\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18n(index, messageIndex, subTemplateIndex) {\n        ɵɵi18nStart(index, messageIndex, subTemplateIndex);\n        ɵɵi18nEnd();\n    }\n    /**\n     * Marks a list of attributes as translatable.\n     *\n     * @param index A unique index in the static block\n     * @param values\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18nAttributes(index, attrsIndex) {\n        var tView = getTView();\n        ngDevMode && assertDefined(tView, \"tView should be defined\");\n        var attrs = getConstant(tView.consts, attrsIndex);\n        i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);\n    }\n    /**\n     * Stores the values of the bindings during each update cycle in order to determine if we need to\n     * update the translated nodes.\n     *\n     * @param value The binding's value\n     * @returns This function returns itself so that it may be chained\n     * (e.g. `i18nExp(ctx.name)(ctx.title)`)\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18nExp(value) {\n        var lView = getLView();\n        setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));\n        return ɵɵi18nExp;\n    }\n    /**\n     * Updates a translation block or an i18n attribute when the bindings have changed.\n     *\n     * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n     * (i18n attribute) on which it should update the content.\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18nApply(index) {\n        applyI18n(getTView(), getLView(), index + HEADER_OFFSET);\n    }\n    /**\n     * Handles message string post-processing for internationalization.\n     *\n     * Handles message string post-processing by transforming it from intermediate\n     * format (that might contain some markers that we need to replace) to the final\n     * form, consumable by i18nStart instruction. Post processing steps include:\n     *\n     * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])\n     * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n     * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n     * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)\n     *    in case multiple ICUs have the same placeholder name\n     *\n     * @param message Raw translation string for post processing\n     * @param replacements Set of replacements that should be applied\n     *\n     * @returns Transformed string that can be consumed by i18nStart instruction\n     *\n     * @codeGenApi\n     */\n    function ɵɵi18nPostprocess(message, replacements) {\n        if (replacements === void 0) { replacements = {}; }\n        return i18nPostprocess(message, replacements);\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Resolves the providers which are defined in the DirectiveDef.\n     *\n     * When inserting the tokens and the factories in their respective arrays, we can assume that\n     * this method is called first for the component (if any), and then for other directives on the same\n     * node.\n     * As a consequence,the providers are always processed in that order:\n     * 1) The view providers of the component\n     * 2) The providers of the component\n     * 3) The providers of the other directives\n     * This matches the structure of the injectables arrays of a view (for each node).\n     * So the tokens and the factories can be pushed at the end of the arrays, except\n     * in one case for multi providers.\n     *\n     * @param def the directive definition\n     * @param providers: Array of `providers`.\n     * @param viewProviders: Array of `viewProviders`.\n     */\n    function providersResolver(def, providers, viewProviders) {\n        var tView = getTView();\n        if (tView.firstCreatePass) {\n            var isComponent = isComponentDef(def);\n            // The list of view providers is processed first, and the flags are updated\n            resolveProvider$1(viewProviders, tView.data, tView.blueprint, isComponent, true);\n            // Then, the list of providers is processed, and the flags are updated\n            resolveProvider$1(providers, tView.data, tView.blueprint, isComponent, false);\n        }\n    }\n    /**\n     * Resolves a provider and publishes it to the DI system.\n     */\n    function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n        provider = resolveForwardRef(provider);\n        if (Array.isArray(provider)) {\n            // Recursively call `resolveProvider`\n            // Recursion is OK in this case because this code will not be in hot-path once we implement\n            // cloning of the initial state.\n            for (var i = 0; i < provider.length; i++) {\n                resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n            }\n        }\n        else {\n            var tView = getTView();\n            var lView = getLView();\n            var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n            var providerFactory = providerToFactory(provider);\n            var tNode = getCurrentTNode();\n            var beginIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;\n            var endIndex = tNode.directiveStart;\n            var cptViewProvidersCount = tNode.providerIndexes >> 20 /* CptViewProvidersCountShift */;\n            if (isTypeProvider(provider) || !provider.multi) {\n                // Single provider case: the factory is created and pushed immediately\n                var factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n                var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n                if (existingFactoryIndex === -1) {\n                    diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n                    registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n                    tInjectables.push(token);\n                    tNode.directiveStart++;\n                    tNode.directiveEnd++;\n                    if (isViewProvider) {\n                        tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;\n                    }\n                    lInjectablesBlueprint.push(factory);\n                    lView.push(factory);\n                }\n                else {\n                    lInjectablesBlueprint[existingFactoryIndex] = factory;\n                    lView[existingFactoryIndex] = factory;\n                }\n            }\n            else {\n                // Multi provider case:\n                // We create a multi factory which is going to aggregate all the values.\n                // Since the output of such a factory depends on content or view injection,\n                // we create two of them, which are linked together.\n                //\n                // The first one (for view providers) is always in the first block of the injectables array,\n                // and the second one (for providers) is always in the second block.\n                // This is important because view providers have higher priority. When a multi token\n                // is being looked up, the view providers should be found first.\n                // Note that it is not possible to have a multi factory in the third block (directive block).\n                //\n                // The algorithm to process multi providers is as follows:\n                // 1) If the multi provider comes from the `viewProviders` of the component:\n                //   a) If the special view providers factory doesn't exist, it is created and pushed.\n                //   b) Else, the multi provider is added to the existing multi factory.\n                // 2) If the multi provider comes from the `providers` of the component or of another\n                // directive:\n                //   a) If the multi factory doesn't exist, it is created and provider pushed into it.\n                //      It is also linked to the multi factory for view providers, if it exists.\n                //   b) Else, the multi provider is added to the existing multi factory.\n                var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n                var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n                var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n                    lInjectablesBlueprint[existingProvidersFactoryIndex];\n                var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n                    lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n                if (isViewProvider && !doesViewProvidersFactoryExist ||\n                    !isViewProvider && !doesProvidersFactoryExist) {\n                    // Cases 1.a and 2.a\n                    diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n                    var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n                    if (!isViewProvider && doesViewProvidersFactoryExist) {\n                        lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n                    }\n                    registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n                    tInjectables.push(token);\n                    tNode.directiveStart++;\n                    tNode.directiveEnd++;\n                    if (isViewProvider) {\n                        tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;\n                    }\n                    lInjectablesBlueprint.push(factory);\n                    lView.push(factory);\n                }\n                else {\n                    // Cases 1.b and 2.b\n                    var indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex :\n                        existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n                    registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex :\n                        existingViewProvidersFactoryIndex, indexInFactory);\n                }\n                if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n                    lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n                }\n            }\n        }\n    }\n    /**\n     * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.\n     * @param tView `TView` in which to register the hook.\n     * @param provider Provider whose hook should be registered.\n     * @param contextIndex Index under which to find the context for the hook when it's being invoked.\n     * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi\n     * provider factory.\n     */\n    function registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {\n        var providerIsTypeProvider = isTypeProvider(provider);\n        if (providerIsTypeProvider || isClassProvider(provider)) {\n            var prototype = (provider.useClass || provider).prototype;\n            var ngOnDestroy = prototype.ngOnDestroy;\n            if (ngOnDestroy) {\n                var hooks = tView.destroyHooks || (tView.destroyHooks = []);\n                if (!providerIsTypeProvider && provider.multi) {\n                    ngDevMode &&\n                        assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook');\n                    var existingCallbacksIndex = hooks.indexOf(contextIndex);\n                    if (existingCallbacksIndex === -1) {\n                        hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);\n                    }\n                    else {\n                        hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);\n                    }\n                }\n                else {\n                    hooks.push(contextIndex, ngOnDestroy);\n                }\n            }\n        }\n    }\n    /**\n     * Add a factory in a multi factory.\n     * @returns Index at which the factory was inserted.\n     */\n    function multiFactoryAdd(multiFactory, factory, isComponentProvider) {\n        if (isComponentProvider) {\n            multiFactory.componentProviders++;\n        }\n        return multiFactory.multi.push(factory) - 1;\n    }\n    /**\n     * Returns the index of item in the array, but only in the begin to end range.\n     */\n    function indexOf(item, arr, begin, end) {\n        for (var i = begin; i < end; i++) {\n            if (arr[i] === item)\n                return i;\n        }\n        return -1;\n    }\n    /**\n     * Use this with `multi` `providers`.\n     */\n    function multiProvidersFactoryResolver(_, tData, lData, tNode) {\n        return multiResolve(this.multi, []);\n    }\n    /**\n     * Use this with `multi` `viewProviders`.\n     *\n     * This factory knows how to concatenate itself with the existing `multi` `providers`.\n     */\n    function multiViewProvidersFactoryResolver(_, tData, lView, tNode) {\n        var factories = this.multi;\n        var result;\n        if (this.providerFactory) {\n            var componentCount = this.providerFactory.componentProviders;\n            var multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);\n            // Copy the section of the array which contains `multi` `providers` from the component\n            result = multiProviders.slice(0, componentCount);\n            // Insert the `viewProvider` instances.\n            multiResolve(factories, result);\n            // Copy the section of the array which contains `multi` `providers` from other directives\n            for (var i = componentCount; i < multiProviders.length; i++) {\n                result.push(multiProviders[i]);\n            }\n        }\n        else {\n            result = [];\n            // Insert the `viewProvider` instances.\n            multiResolve(factories, result);\n        }\n        return result;\n    }\n    /**\n     * Maps an array of factories into an array of values.\n     */\n    function multiResolve(factories, result) {\n        for (var i = 0; i < factories.length; i++) {\n            var factory = factories[i];\n            result.push(factory());\n        }\n        return result;\n    }\n    /**\n     * Creates a multi factory.\n     */\n    function multiFactory(factoryFn, index, isViewProvider, isComponent, f) {\n        var factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject);\n        factory.multi = [];\n        factory.index = index;\n        factory.componentProviders = 0;\n        multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n        return factory;\n    }\n\n    /**\n     * This feature resolves the providers of a directive (or component),\n     * and publish them into the DI system, making it visible to others for injection.\n     *\n     * For example:\n     * ```ts\n     * class ComponentWithProviders {\n     *   constructor(private greeter: GreeterDE) {}\n     *\n     *   static ɵcmp = defineComponent({\n     *     type: ComponentWithProviders,\n     *     selectors: [['component-with-providers']],\n     *    factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n     *    decls: 1,\n     *    vars: 1,\n     *    template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n     *      if (fs & RenderFlags.Create) {\n     *        ɵɵtext(0);\n     *      }\n     *      if (fs & RenderFlags.Update) {\n     *        ɵɵtextInterpolate(ctx.greeter.greet());\n     *      }\n     *    },\n     *    features: [ɵɵProvidersFeature([GreeterDE])]\n     *  });\n     * }\n     * ```\n     *\n     * @param definition\n     *\n     * @codeGenApi\n     */\n    function ɵɵProvidersFeature(providers, viewProviders) {\n        if (viewProviders === void 0) { viewProviders = []; }\n        return function (definition) {\n            definition.providersResolver =\n                function (def, processProvidersFn) {\n                    return providersResolver(def, //\n                    processProvidersFn ? processProvidersFn(providers) : providers, //\n                    viewProviders);\n                };\n        };\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Represents a component created by a `ComponentFactory`.\n     * Provides access to the component instance and related objects,\n     * and provides the means of destroying the instance.\n     *\n     * @publicApi\n     */\n    var ComponentRef = /** @class */ (function () {\n        function ComponentRef() {\n        }\n        return ComponentRef;\n    }());\n    /**\n     * Base class for a factory that can create a component dynamically.\n     * Instantiate a factory for a given type of component with `resolveComponentFactory()`.\n     * Use the resulting `ComponentFactory.create()` method to create a component of that type.\n     *\n     * @see [Dynamic Components](guide/dynamic-component-loader)\n     *\n     * @publicApi\n     */\n    var ComponentFactory = /** @class */ (function () {\n        function ComponentFactory() {\n        }\n        return ComponentFactory;\n    }());\n\n    function noComponentFactoryError(component) {\n        var error = Error(\"No component factory found for \" + stringify(component) + \". Did you add it to @NgModule.entryComponents?\");\n        error[ERROR_COMPONENT] = component;\n        return error;\n    }\n    var ERROR_COMPONENT = 'ngComponent';\n    function getComponent$1(error) {\n        return error[ERROR_COMPONENT];\n    }\n    var _NullComponentFactoryResolver = /** @class */ (function () {\n        function _NullComponentFactoryResolver() {\n        }\n        _NullComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {\n            throw noComponentFactoryError(component);\n        };\n        return _NullComponentFactoryResolver;\n    }());\n    /**\n     * A simple registry that maps `Components` to generated `ComponentFactory` classes\n     * that can be used to create instances of components.\n     * Use to obtain the factory for a given component type,\n     * then use the factory's `create()` method to create a component of that type.\n     *\n     * @see [Dynamic Components](guide/dynamic-component-loader)\n     * @see [Usage Example](guide/dynamic-component-loader#resolving-components)\n     * @see <live-example name=\"dynamic-component-loader\" noDownload></live-example>\n    of the code in this cookbook\n     * @publicApi\n     */\n    var ComponentFactoryResolver = /** @class */ (function () {\n        function ComponentFactoryResolver() {\n        }\n        return ComponentFactoryResolver;\n    }());\n    ComponentFactoryResolver.NULL = new _NullComponentFactoryResolver();\n    var CodegenComponentFactoryResolver = /** @class */ (function () {\n        function CodegenComponentFactoryResolver(factories, _parent, _ngModule) {\n            this._parent = _parent;\n            this._ngModule = _ngModule;\n            this._factories = new Map();\n            for (var i = 0; i < factories.length; i++) {\n                var factory = factories[i];\n                this._factories.set(factory.componentType, factory);\n            }\n        }\n        CodegenComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {\n            var factory = this._factories.get(component);\n            if (!factory && this._parent) {\n                factory = this._parent.resolveComponentFactory(component);\n            }\n            if (!factory) {\n                throw noComponentFactoryError(component);\n            }\n            return new ComponentFactoryBoundToModule(factory, this._ngModule);\n        };\n        return CodegenComponentFactoryResolver;\n    }());\n    var ComponentFactoryBoundToModule = /** @class */ (function (_super) {\n        __extends(ComponentFactoryBoundToModule, _super);\n        function ComponentFactoryBoundToModule(factory, ngModule) {\n            var _this = _super.call(this) || this;\n            _this.factory = factory;\n            _this.ngModule = ngModule;\n            _this.selector = factory.selector;\n            _this.componentType = factory.componentType;\n            _this.ngContentSelectors = factory.ngContentSelectors;\n            _this.inputs = factory.inputs;\n            _this.outputs = factory.outputs;\n            return _this;\n        }\n        ComponentFactoryBoundToModule.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {\n            return this.factory.create(injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);\n        };\n        return ComponentFactoryBoundToModule;\n    }(ComponentFactory));\n\n    /**\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://angular.io/license\n     */\n    function noop() {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        // Do nothing.\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Creates an ElementRef from the most recent node.\n     *\n     * @returns The ElementRef instance to use\n     */\n    function injectElementRef() {\n        return createElementRef(getCurrentTNode(), getLView());\n    }\n    /**\n     * Creates an ElementRef given a node.\n     *\n     * @param tNode The node for which you'd like an ElementRef\n     * @param lView The view to which the node belongs\n     * @returns The ElementRef instance to use\n     */\n    function createElementRef(tNode, lView) {\n        return new ElementRef(getNativeByTNode(tNode, lView));\n    }\n    var SWITCH_ELEMENT_REF_FACTORY__POST_R3__ = injectElementRef;\n    var SWITCH_ELEMENT_REF_FACTORY__PRE_R3__ = noop;\n    var SWITCH_ELEMENT_REF_FACTORY = SWITCH_ELEMENT_REF_FACTORY__PRE_R3__;\n    /**\n     * A wrapper around a native element inside of a View.\n     *\n     * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n     * element.\n     *\n     * @security Permitting direct access to the DOM can make your application more vulnerable to\n     * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n     * [Security Guide](https://g.co/ng/security).\n     *\n     * @publicApi\n     */\n    // Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n    // i.e. users have to ask for what they need. With that, we can build better analysis tools\n    // and could do better codegen in the future.\n    var ElementRef = /** @class */ (function () {\n        function ElementRef(nativeElement) {\n            this.nativeElement = nativeElement;\n        }\n        return ElementRef;\n    }());\n    /**\n     * @internal\n     * @nocollapse\n     */\n    ElementRef.__NG_ELEMENT_ID__ = SWITCH_ELEMENT_REF_FACTORY;\n    /**\n     * Unwraps `ElementRef` and return the `nativeElement`.\n     *\n     * @param value value to unwrap\n     * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n     */\n    function unwrapElementRef(value) {\n        return value instanceof ElementRef ? value.nativeElement : value;\n    }\n\n    /**\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://angular.io/license\n     */\n    var Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');\n    /**\n     * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n     *\n     * @publicApi\n     */\n    var RendererFactory2 = /** @class */ (function () {\n        function RendererFactory2() {\n        }\n        return RendererFactory2;\n    }());\n    /**\n     * Extend this base class to implement custom rendering. By default, Angular\n     * renders a template into DOM. You can use custom rendering to intercept\n     * rendering calls, or to render to something other than DOM.\n     *\n     * Create your custom renderer using `RendererFactory2`.\n     *\n     * Use a custom renderer to bypass Angular's templating and\n     * make custom UI changes that can't be expressed declaratively.\n     * For example if you need to set a property or an attribute whose name is\n     * not statically known, use the `setProperty()` or\n     * `setAttribute()` method.\n     *\n     * @publicApi\n     */\n    var Renderer2 = /** @class */ (function () {\n        function Renderer2() {\n        }\n        return Renderer2;\n    }());\n    /**\n     * @internal\n     * @nocollapse\n     */\n    Renderer2.__NG_ELEMENT_ID__ = function () { return SWITCH_RENDERER2_FACTORY(); };\n    var SWITCH_RENDERER2_FACTORY__POST_R3__ = injectRenderer2;\n    var SWITCH_RENDERER2_FACTORY__PRE_R3__ = noop;\n    var SWITCH_RENDERER2_FACTORY = SWITCH_RENDERER2_FACTORY__PRE_R3__;\n    /** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */\n    function getOrCreateRenderer2(lView) {\n        var renderer = lView[RENDERER];\n        if (ngDevMode && !isProceduralRenderer(renderer)) {\n            throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');\n        }\n        return renderer;\n    }\n    /** Injects a Renderer2 for the current component. */\n    function injectRenderer2() {\n        // We need the Renderer to be based on the component that it's being injected into, however since\n        // DI happens before we've entered its view, `getLView` will return the parent view instead.\n        var lView = getLView();\n        var tNode = getCurrentTNode();\n        var nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n        return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Sanitizer is used by the views to sanitize potentially dangerous values.\n     *\n     * @publicApi\n     */\n    var Sanitizer = /** @class */ (function () {\n        function Sanitizer() {\n        }\n        return Sanitizer;\n    }());\n    /** @nocollapse */\n    Sanitizer.ɵprov = ɵɵdefineInjectable({\n        token: Sanitizer,\n        providedIn: 'root',\n        factory: function () { return null; },\n    });\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @description Represents the version of Angular\n     *\n     * @publicApi\n     */\n    var Version = /** @class */ (function () {\n        function Version(full) {\n            this.full = full;\n            this.major = full.split('.')[0];\n            this.minor = full.split('.')[1];\n            this.patch = full.split('.').slice(2).join('.');\n        }\n        return Version;\n    }());\n    /**\n     * @publicApi\n     */\n    var VERSION = new Version('12.2.1');\n\n    /**\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://angular.io/license\n     */\n    var DefaultIterableDifferFactory = /** @class */ (function () {\n        function DefaultIterableDifferFactory() {\n        }\n        DefaultIterableDifferFactory.prototype.supports = function (obj) {\n            return isListLikeIterable(obj);\n        };\n        DefaultIterableDifferFactory.prototype.create = function (trackByFn) {\n            return new DefaultIterableDiffer(trackByFn);\n        };\n        return DefaultIterableDifferFactory;\n    }());\n    var trackByIdentity = function (index, item) { return item; };\n    var ɵ0$b = trackByIdentity;\n    /**\n     * @deprecated v4.0.0 - Should not be part of public API.\n     * @publicApi\n     */\n    var DefaultIterableDiffer = /** @class */ (function () {\n        function DefaultIterableDiffer(trackByFn) {\n            this.length = 0;\n            // Keeps track of the used records at any point in time (during & across `_check()` calls)\n            this._linkedRecords = null;\n            // Keeps track of the removed records at any point in time during `_check()` calls.\n            this._unlinkedRecords = null;\n            this._previousItHead = null;\n            this._itHead = null;\n            this._itTail = null;\n            this._additionsHead = null;\n            this._additionsTail = null;\n            this._movesHead = null;\n            this._movesTail = null;\n            this._removalsHead = null;\n            this._removalsTail = null;\n            // Keeps track of records where custom track by is the same, but item identity has changed\n            this._identityChangesHead = null;\n            this._identityChangesTail = null;\n            this._trackByFn = trackByFn || trackByIdentity;\n        }\n        DefaultIterableDiffer.prototype.forEachItem = function (fn) {\n            var record;\n            for (record = this._itHead; record !== null; record = record._next) {\n                fn(record);\n            }\n        };\n        DefaultIterableDiffer.prototype.forEachOperation = function (fn) {\n            var nextIt = this._itHead;\n            var nextRemove = this._removalsHead;\n            var addRemoveOffset = 0;\n            var moveOffsets = null;\n            while (nextIt || nextRemove) {\n                // Figure out which is the next record to process\n                // Order: remove, add, move\n                var record = !nextRemove ||\n                    nextIt &&\n                        nextIt.currentIndex <\n                            getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?\n                    nextIt :\n                    nextRemove;\n                var adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n                var currentIndex = record.currentIndex;\n                // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n                if (record === nextRemove) {\n                    addRemoveOffset--;\n                    nextRemove = nextRemove._nextRemoved;\n                }\n                else {\n                    nextIt = nextIt._next;\n                    if (record.previousIndex == null) {\n                        addRemoveOffset++;\n                    }\n                    else {\n                        // INVARIANT:  currentIndex < previousIndex\n                        if (!moveOffsets)\n                            moveOffsets = [];\n                        var localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n                        var localCurrentIndex = currentIndex - addRemoveOffset;\n                        if (localMovePreviousIndex != localCurrentIndex) {\n                            for (var i = 0; i < localMovePreviousIndex; i++) {\n                                var offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n                                var index = offset + i;\n                                if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n                                    moveOffsets[i] = offset + 1;\n                                }\n                            }\n                            var previousIndex = record.previousIndex;\n                            moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n                        }\n                    }\n                }\n                if (adjPreviousIndex !== currentIndex) {\n                    fn(record, adjPreviousIndex, currentIndex);\n                }\n            }\n        };\n        DefaultIterableDiffer.prototype.forEachPreviousItem = function (fn) {\n            var record;\n            for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n                fn(record);\n            }\n        };\n        DefaultIterableDiffer.prototype.forEachAddedItem = function (fn) {\n            var record;\n            for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n                fn(record);\n            }\n        };\n        DefaultIterableDiffer.prototype.forEachMovedItem = function (fn) {\n            var record;\n            for (record = this._movesHead; record !== null; record = record._nextMoved) {\n                fn(record);\n            }\n        };\n        DefaultIterableDiffer.prototype.forEachRemovedItem = function (fn) {\n            var record;\n            for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n                fn(record);\n            }\n        };\n        DefaultIterableDiffer.prototype.forEachIdentityChange = function (fn) {\n            var record;\n            for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n                fn(record);\n            }\n        };\n        DefaultIterableDiffer.prototype.diff = function (collection) {\n            if (collection == null)\n                collection = [];\n            if (!isListLikeIterable(collection)) {\n                throw new Error(\"Error trying to diff '\" + stringify(collection) + \"'. Only arrays and iterables are allowed\");\n            }\n            if (this.check(collection)) {\n                return this;\n            }\n            else {\n                return null;\n            }\n        };\n        DefaultIterableDiffer.prototype.onDestroy = function () { };\n        DefaultIterableDiffer.prototype.check = function (collection) {\n            var _this = this;\n            this._reset();\n            var record = this._itHead;\n            var mayBeDirty = false;\n            var index;\n            var item;\n            var itemTrackBy;\n            if (Array.isArray(collection)) {\n                this.length = collection.length;\n                for (var index_1 = 0; index_1 < this.length; index_1++) {\n                    item = collection[index_1];\n                    itemTrackBy = this._trackByFn(index_1, item);\n                    if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n                        record = this._mismatch(record, item, itemTrackBy, index_1);\n                        mayBeDirty = true;\n                    }\n                    else {\n                        if (mayBeDirty) {\n                            // TODO(misko): can we limit this to duplicates only?\n                            record = this._verifyReinsertion(record, item, itemTrackBy, index_1);\n                        }\n                        if (!Object.is(record.item, item))\n                            this._addIdentityChange(record, item);\n                    }\n                    record = record._next;\n                }\n            }\n            else {\n                index = 0;\n                iterateListLike(collection, function (item) {\n                    itemTrackBy = _this._trackByFn(index, item);\n                    if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n                        record = _this._mismatch(record, item, itemTrackBy, index);\n                        mayBeDirty = true;\n                    }\n                    else {\n                        if (mayBeDirty) {\n                            // TODO(misko): can we limit this to duplicates only?\n                            record = _this._verifyReinsertion(record, item, itemTrackBy, index);\n                        }\n                        if (!Object.is(record.item, item))\n                            _this._addIdentityChange(record, item);\n                    }\n                    record = record._next;\n                    index++;\n                });\n                this.length = index;\n            }\n            this._truncate(record);\n            this.collection = collection;\n            return this.isDirty;\n        };\n        Object.defineProperty(DefaultIterableDiffer.prototype, \"isDirty\", {\n            /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n             * changes.\n             */\n            get: function () {\n                return this._additionsHead !== null || this._movesHead !== null ||\n                    this._removalsHead !== null || this._identityChangesHead !== null;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Reset the state of the change objects to show no changes. This means set previousKey to\n         * currentKey, and clear all of the queues (additions, moves, removals).\n         * Set the previousIndexes of moved and added items to their currentIndexes\n         * Reset the list of additions, moves and removals\n         *\n         * @internal\n         */\n        DefaultIterableDiffer.prototype._reset = function () {\n            if (this.isDirty) {\n                var record = void 0;\n                for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n                    record._nextPrevious = record._next;\n                }\n                for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n                    record.previousIndex = record.currentIndex;\n                }\n                this._additionsHead = this._additionsTail = null;\n                for (record = this._movesHead; record !== null; record = record._nextMoved) {\n                    record.previousIndex = record.currentIndex;\n                }\n                this._movesHead = this._movesTail = null;\n                this._removalsHead = this._removalsTail = null;\n                this._identityChangesHead = this._identityChangesTail = null;\n                // TODO(vicb): when assert gets supported\n                // assert(!this.isDirty);\n            }\n        };\n        /**\n         * This is the core function which handles differences between collections.\n         *\n         * - `record` is the record which we saw at this position last time. If null then it is a new\n         *   item.\n         * - `item` is the current item in the collection\n         * - `index` is the position of the item in the collection\n         *\n         * @internal\n         */\n        DefaultIterableDiffer.prototype._mismatch = function (record, item, itemTrackBy, index) {\n            // The previous record after which we will append the current one.\n            var previousRecord;\n            if (record === null) {\n                previousRecord = this._itTail;\n            }\n            else {\n                previousRecord = record._prev;\n                // Remove the record from the collection since we know it does not match the item.\n                this._remove(record);\n            }\n            // See if we have evicted the item, which used to be at some anterior position of _itHead list.\n            record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n            if (record !== null) {\n                // It is an item which we have evicted earlier: reinsert it back into the list.\n                // But first we need to check if identity changed, so we can update in view if necessary.\n                if (!Object.is(record.item, item))\n                    this._addIdentityChange(record, item);\n                this._reinsertAfter(record, previousRecord, index);\n            }\n            else {\n                // Attempt to see if the item is at some posterior position of _itHead list.\n                record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n                if (record !== null) {\n                    // We have the item in _itHead at/after `index` position. We need to move it forward in the\n                    // collection.\n                    // But first we need to check if identity changed, so we can update in view if necessary.\n                    if (!Object.is(record.item, item))\n                        this._addIdentityChange(record, item);\n                    this._moveAfter(record, previousRecord, index);\n                }\n                else {\n                    // It is a new item: add it.\n                    record =\n                        this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);\n                }\n            }\n            return record;\n        };\n        /**\n         * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n         *\n         * Use case: `[a, a]` => `[b, a, a]`\n         *\n         * If we did not have this check then the insertion of `b` would:\n         *   1) evict first `a`\n         *   2) insert `b` at `0` index.\n         *   3) leave `a` at index `1` as is. <-- this is wrong!\n         *   3) reinsert `a` at index 2. <-- this is wrong!\n         *\n         * The correct behavior is:\n         *   1) evict first `a`\n         *   2) insert `b` at `0` index.\n         *   3) reinsert `a` at index 1.\n         *   3) move `a` at from `1` to `2`.\n         *\n         *\n         * Double check that we have not evicted a duplicate item. We need to check if the item type may\n         * have already been removed:\n         * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n         * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n         * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n         * at the end.\n         *\n         * @internal\n         */\n        DefaultIterableDiffer.prototype._verifyReinsertion = function (record, item, itemTrackBy, index) {\n            var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n            if (reinsertRecord !== null) {\n                record = this._reinsertAfter(reinsertRecord, record._prev, index);\n            }\n            else if (record.currentIndex != index) {\n                record.currentIndex = index;\n                this._addToMoves(record, index);\n            }\n            return record;\n        };\n        /**\n         * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n         *\n         * - `record` The first excess {@link IterableChangeRecord_}.\n         *\n         * @internal\n         */\n        DefaultIterableDiffer.prototype._truncate = function (record) {\n            // Anything after that needs to be removed;\n            while (record !== null) {\n                var nextRecord = record._next;\n                this._addToRemovals(this._unlink(record));\n                record = nextRecord;\n            }\n            if (this._unlinkedRecords !== null) {\n                this._unlinkedRecords.clear();\n            }\n            if (this._additionsTail !== null) {\n                this._additionsTail._nextAdded = null;\n            }\n            if (this._movesTail !== null) {\n                this._movesTail._nextMoved = null;\n            }\n            if (this._itTail !== null) {\n                this._itTail._next = null;\n            }\n            if (this._removalsTail !== null) {\n                this._removalsTail._nextRemoved = null;\n            }\n            if (this._identityChangesTail !== null) {\n                this._identityChangesTail._nextIdentityChange = null;\n            }\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._reinsertAfter = function (record, prevRecord, index) {\n            if (this._unlinkedRecords !== null) {\n                this._unlinkedRecords.remove(record);\n            }\n            var prev = record._prevRemoved;\n            var next = record._nextRemoved;\n            if (prev === null) {\n                this._removalsHead = next;\n            }\n            else {\n                prev._nextRemoved = next;\n            }\n            if (next === null) {\n                this._removalsTail = prev;\n            }\n            else {\n                next._prevRemoved = prev;\n            }\n            this._insertAfter(record, prevRecord, index);\n            this._addToMoves(record, index);\n            return record;\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._moveAfter = function (record, prevRecord, index) {\n            this._unlink(record);\n            this._insertAfter(record, prevRecord, index);\n            this._addToMoves(record, index);\n            return record;\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._addAfter = function (record, prevRecord, index) {\n            this._insertAfter(record, prevRecord, index);\n            if (this._additionsTail === null) {\n                // TODO(vicb):\n                // assert(this._additionsHead === null);\n                this._additionsTail = this._additionsHead = record;\n            }\n            else {\n                // TODO(vicb):\n                // assert(_additionsTail._nextAdded === null);\n                // assert(record._nextAdded === null);\n                this._additionsTail = this._additionsTail._nextAdded = record;\n            }\n            return record;\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._insertAfter = function (record, prevRecord, index) {\n            // TODO(vicb):\n            // assert(record != prevRecord);\n            // assert(record._next === null);\n            // assert(record._prev === null);\n            var next = prevRecord === null ? this._itHead : prevRecord._next;\n            // TODO(vicb):\n            // assert(next != record);\n            // assert(prevRecord != record);\n            record._next = next;\n            record._prev = prevRecord;\n            if (next === null) {\n                this._itTail = record;\n            }\n            else {\n                next._prev = record;\n            }\n            if (prevRecord === null) {\n                this._itHead = record;\n            }\n            else {\n                prevRecord._next = record;\n            }\n            if (this._linkedRecords === null) {\n                this._linkedRecords = new _DuplicateMap();\n            }\n            this._linkedRecords.put(record);\n            record.currentIndex = index;\n            return record;\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._remove = function (record) {\n            return this._addToRemovals(this._unlink(record));\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._unlink = function (record) {\n            if (this._linkedRecords !== null) {\n                this._linkedRecords.remove(record);\n            }\n            var prev = record._prev;\n            var next = record._next;\n            // TODO(vicb):\n            // assert((record._prev = null) === null);\n            // assert((record._next = null) === null);\n            if (prev === null) {\n                this._itHead = next;\n            }\n            else {\n                prev._next = next;\n            }\n            if (next === null) {\n                this._itTail = prev;\n            }\n            else {\n                next._prev = prev;\n            }\n            return record;\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._addToMoves = function (record, toIndex) {\n            // TODO(vicb):\n            // assert(record._nextMoved === null);\n            if (record.previousIndex === toIndex) {\n                return record;\n            }\n            if (this._movesTail === null) {\n                // TODO(vicb):\n                // assert(_movesHead === null);\n                this._movesTail = this._movesHead = record;\n            }\n            else {\n                // TODO(vicb):\n                // assert(_movesTail._nextMoved === null);\n                this._movesTail = this._movesTail._nextMoved = record;\n            }\n            return record;\n        };\n        DefaultIterableDiffer.prototype._addToRemovals = function (record) {\n            if (this._unlinkedRecords === null) {\n                this._unlinkedRecords = new _DuplicateMap();\n            }\n            this._unlinkedRecords.put(record);\n            record.currentIndex = null;\n            record._nextRemoved = null;\n            if (this._removalsTail === null) {\n                // TODO(vicb):\n                // assert(_removalsHead === null);\n                this._removalsTail = this._removalsHead = record;\n                record._prevRemoved = null;\n            }\n            else {\n                // TODO(vicb):\n                // assert(_removalsTail._nextRemoved === null);\n                // assert(record._nextRemoved === null);\n                record._prevRemoved = this._removalsTail;\n                this._removalsTail = this._removalsTail._nextRemoved = record;\n            }\n            return record;\n        };\n        /** @internal */\n        DefaultIterableDiffer.prototype._addIdentityChange = function (record, item) {\n            record.item = item;\n            if (this._identityChangesTail === null) {\n                this._identityChangesTail = this._identityChangesHead = record;\n            }\n            else {\n                this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n            }\n            return record;\n        };\n        return DefaultIterableDiffer;\n    }());\n    var IterableChangeRecord_ = /** @class */ (function () {\n        function IterableChangeRecord_(item, trackById) {\n            this.item = item;\n            this.trackById = trackById;\n            this.currentIndex = null;\n            this.previousIndex = null;\n            /** @internal */\n            this._nextPrevious = null;\n            /** @internal */\n            this._prev = null;\n            /** @internal */\n            this._next = null;\n            /** @internal */\n            this._prevDup = null;\n            /** @internal */\n            this._nextDup = null;\n            /** @internal */\n            this._prevRemoved = null;\n            /** @internal */\n            this._nextRemoved = null;\n            /** @internal */\n            this._nextAdded = null;\n            /** @internal */\n            this._nextMoved = null;\n            /** @internal */\n            this._nextIdentityChange = null;\n        }\n        return IterableChangeRecord_;\n    }());\n    // A linked list of IterableChangeRecords with the same IterableChangeRecord_.item\n    var _DuplicateItemRecordList = /** @class */ (function () {\n        function _DuplicateItemRecordList() {\n            /** @internal */\n            this._head = null;\n            /** @internal */\n            this._tail = null;\n        }\n        /**\n         * Append the record to the list of duplicates.\n         *\n         * Note: by design all records in the list of duplicates hold the same value in record.item.\n         */\n        _DuplicateItemRecordList.prototype.add = function (record) {\n            if (this._head === null) {\n                this._head = this._tail = record;\n                record._nextDup = null;\n                record._prevDup = null;\n            }\n            else {\n                // TODO(vicb):\n                // assert(record.item ==  _head.item ||\n                //       record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n                this._tail._nextDup = record;\n                record._prevDup = this._tail;\n                record._nextDup = null;\n                this._tail = record;\n            }\n        };\n        // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n        // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n        _DuplicateItemRecordList.prototype.get = function (trackById, atOrAfterIndex) {\n            var record;\n            for (record = this._head; record !== null; record = record._nextDup) {\n                if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) &&\n                    Object.is(record.trackById, trackById)) {\n                    return record;\n                }\n            }\n            return null;\n        };\n        /**\n         * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n         *\n         * Returns whether the list of duplicates is empty.\n         */\n        _DuplicateItemRecordList.prototype.remove = function (record) {\n            // TODO(vicb):\n            // assert(() {\n            //  // verify that the record being removed is in the list.\n            //  for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n            //    if (identical(cursor, record)) return true;\n            //  }\n            //  return false;\n            //});\n            var prev = record._prevDup;\n            var next = record._nextDup;\n            if (prev === null) {\n                this._head = next;\n            }\n            else {\n                prev._nextDup = next;\n            }\n            if (next === null) {\n                this._tail = prev;\n            }\n            else {\n                next._prevDup = prev;\n            }\n            return this._head === null;\n        };\n        return _DuplicateItemRecordList;\n    }());\n    var _DuplicateMap = /** @class */ (function () {\n        function _DuplicateMap() {\n            this.map = new Map();\n        }\n        _DuplicateMap.prototype.put = function (record) {\n            var key = record.trackById;\n            var duplicates = this.map.get(key);\n            if (!duplicates) {\n                duplicates = new _DuplicateItemRecordList();\n                this.map.set(key, duplicates);\n            }\n            duplicates.add(record);\n        };\n        /**\n         * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n         * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n         *\n         * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n         * have any more `a`s needs to return the second `a`.\n         */\n        _DuplicateMap.prototype.get = function (trackById, atOrAfterIndex) {\n            var key = trackById;\n            var recordList = this.map.get(key);\n            return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n        };\n        /**\n         * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n         *\n         * The list of duplicates also is removed from the map if it gets empty.\n         */\n        _DuplicateMap.prototype.remove = function (record) {\n            var key = record.trackById;\n            var recordList = this.map.get(key);\n            // Remove the list of duplicates when it gets empty\n            if (recordList.remove(record)) {\n                this.map.delete(key);\n            }\n            return record;\n        };\n        Object.defineProperty(_DuplicateMap.prototype, \"isEmpty\", {\n            get: function () {\n                return this.map.size === 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        _DuplicateMap.prototype.clear = function () {\n            this.map.clear();\n        };\n        return _DuplicateMap;\n    }());\n    function getPreviousIndex(item, addRemoveOffset, moveOffsets) {\n        var previousIndex = item.previousIndex;\n        if (previousIndex === null)\n            return previousIndex;\n        var moveOffset = 0;\n        if (moveOffsets && previousIndex < moveOffsets.length) {\n            moveOffset = moveOffsets[previousIndex];\n        }\n        return previousIndex + addRemoveOffset + moveOffset;\n    }\n\n    /**\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://angular.io/license\n     */\n    var DefaultKeyValueDifferFactory = /** @class */ (function () {\n        function DefaultKeyValueDifferFactory() {\n        }\n        DefaultKeyValueDifferFactory.prototype.supports = function (obj) {\n            return obj instanceof Map || isJsObject(obj);\n        };\n        DefaultKeyValueDifferFactory.prototype.create = function () {\n            return new DefaultKeyValueDiffer();\n        };\n        return DefaultKeyValueDifferFactory;\n    }());\n    var DefaultKeyValueDiffer = /** @class */ (function () {\n        function DefaultKeyValueDiffer() {\n            this._records = new Map();\n            this._mapHead = null;\n            // _appendAfter is used in the check loop\n            this._appendAfter = null;\n            this._previousMapHead = null;\n            this._changesHead = null;\n            this._changesTail = null;\n            this._additionsHead = null;\n            this._additionsTail = null;\n            this._removalsHead = null;\n            this._removalsTail = null;\n        }\n        Object.defineProperty(DefaultKeyValueDiffer.prototype, \"isDirty\", {\n            get: function () {\n                return this._additionsHead !== null || this._changesHead !== null ||\n                    this._removalsHead !== null;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        DefaultKeyValueDiffer.prototype.forEachItem = function (fn) {\n            var record;\n            for (record = this._mapHead; record !== null; record = record._next) {\n                fn(record);\n            }\n        };\n        DefaultKeyValueDiffer.prototype.forEachPreviousItem = function (fn) {\n            var record;\n            for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n                fn(record);\n            }\n        };\n        DefaultKeyValueDiffer.prototype.forEachChangedItem = function (fn) {\n            var record;\n            for (record = this._changesHead; record !== null; record = record._nextChanged) {\n                fn(record);\n            }\n        };\n        DefaultKeyValueDiffer.prototype.forEachAddedItem = function (fn) {\n            var record;\n            for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n                fn(record);\n            }\n        };\n        DefaultKeyValueDiffer.prototype.forEachRemovedItem = function (fn) {\n            var record;\n            for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n                fn(record);\n            }\n        };\n        DefaultKeyValueDiffer.prototype.diff = function (map) {\n            if (!map) {\n                map = new Map();\n            }\n            else if (!(map instanceof Map || isJsObject(map))) {\n                throw new Error(\"Error trying to diff '\" + stringify(map) + \"'. Only maps and objects are allowed\");\n            }\n            return this.check(map) ? this : null;\n        };\n        DefaultKeyValueDiffer.prototype.onDestroy = function () { };\n        /**\n         * Check the current state of the map vs the previous.\n         * The algorithm is optimised for when the keys do no change.\n         */\n        DefaultKeyValueDiffer.prototype.check = function (map) {\n            var _this = this;\n            this._reset();\n            var insertBefore = this._mapHead;\n            this._appendAfter = null;\n            this._forEach(map, function (value, key) {\n                if (insertBefore && insertBefore.key === key) {\n                    _this._maybeAddToChanges(insertBefore, value);\n                    _this._appendAfter = insertBefore;\n                    insertBefore = insertBefore._next;\n                }\n                else {\n                    var record = _this._getOrCreateRecordForKey(key, value);\n                    insertBefore = _this._insertBeforeOrAppend(insertBefore, record);\n                }\n            });\n            // Items remaining at the end of the list have been deleted\n            if (insertBefore) {\n                if (insertBefore._prev) {\n                    insertBefore._prev._next = null;\n                }\n                this._removalsHead = insertBefore;\n                for (var record = insertBefore; record !== null; record = record._nextRemoved) {\n                    if (record === this._mapHead) {\n                        this._mapHead = null;\n                    }\n                    this._records.delete(record.key);\n                    record._nextRemoved = record._next;\n                    record.previousValue = record.currentValue;\n                    record.currentValue = null;\n                    record._prev = null;\n                    record._next = null;\n                }\n            }\n            // Make sure tails have no next records from previous runs\n            if (this._changesTail)\n                this._changesTail._nextChanged = null;\n            if (this._additionsTail)\n                this._additionsTail._nextAdded = null;\n            return this.isDirty;\n        };\n        /**\n         * Inserts a record before `before` or append at the end of the list when `before` is null.\n         *\n         * Notes:\n         * - This method appends at `this._appendAfter`,\n         * - This method updates `this._appendAfter`,\n         * - The return value is the new value for the insertion pointer.\n         */\n        DefaultKeyValueDiffer.prototype._insertBeforeOrAppend = function (before, record) {\n            if (before) {\n                var prev = before._prev;\n                record._next = before;\n                record._prev = prev;\n                before._prev = record;\n                if (prev) {\n                    prev._next = record;\n                }\n                if (before === this._mapHead) {\n                    this._mapHead = record;\n                }\n                this._appendAfter = before;\n                return before;\n            }\n            if (this._appendAfter) {\n                this._appendAfter._next = record;\n                record._prev = this._appendAfter;\n            }\n            else {\n                this._mapHead = record;\n            }\n            this._appendAfter = record;\n            return null;\n        };\n        DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey = function (key, value) {\n            if (this._records.has(key)) {\n                var record_1 = this._records.get(key);\n                this._maybeAddToChanges(record_1, value);\n                var prev = record_1._prev;\n                var next = record_1._next;\n                if (prev) {\n                    prev._next = next;\n                }\n                if (next) {\n                    next._prev = prev;\n                }\n                record_1._next = null;\n                record_1._prev = null;\n                return record_1;\n            }\n            var record = new KeyValueChangeRecord_(key);\n            this._records.set(key, record);\n            record.currentValue = value;\n            this._addToAdditions(record);\n            return record;\n        };\n        /** @internal */\n        DefaultKeyValueDiffer.prototype._reset = function () {\n            if (this.isDirty) {\n                var record = void 0;\n                // let `_previousMapHead` contain the state of the map before the changes\n                this._previousMapHead = this._mapHead;\n                for (record = this._previousMapHead; record !== null; record = record._next) {\n                    record._nextPrevious = record._next;\n                }\n                // Update `record.previousValue` with the value of the item before the changes\n                // We need to update all changed items (that's those which have been added and changed)\n                for (record = this._changesHead; record !== null; record = record._nextChanged) {\n                    record.previousValue = record.currentValue;\n                }\n                for (record = this._additionsHead; record != null; record = record._nextAdded) {\n                    record.previousValue = record.currentValue;\n                }\n                this._changesHead = this._changesTail = null;\n                this._additionsHead = this._additionsTail = null;\n                this._removalsHead = null;\n            }\n        };\n        // Add the record or a given key to the list of changes only when the value has actually changed\n        DefaultKeyValueDiffer.prototype._maybeAddToChanges = function (record, newValue) {\n            if (!Object.is(newValue, record.currentValue)) {\n                record.previousValue = record.currentValue;\n                record.currentValue = newValue;\n                this._addToChanges(record);\n            }\n        };\n        DefaultKeyValueDiffer.prototype._addToAdditions = function (record) {\n            if (this._additionsHead === null) {\n                this._additionsHead = this._additionsTail = record;\n            }\n            else {\n                this._additionsTail._nextAdded = record;\n                this._additionsTail = record;\n            }\n        };\n        DefaultKeyValueDiffer.prototype._addToChanges = function (record) {\n            if (this._changesHead === null) {\n                this._changesHead = this._changesTail = record;\n            }\n            else {\n                this._changesTail._nextChanged = record;\n                this._changesTail = record;\n            }\n        };\n        /** @internal */\n        DefaultKeyValueDiffer.prototype._forEach = function (obj, fn) {\n            if (obj instanceof Map) {\n                obj.forEach(fn);\n            }\n            else {\n                Object.keys(obj).forEach(function (k) { return fn(obj[k], k); });\n            }\n        };\n        return DefaultKeyValueDiffer;\n    }());\n    var KeyValueChangeRecord_ = /** @class */ (function () {\n        function KeyValueChangeRecord_(key) {\n            this.key = key;\n            this.previousValue = null;\n            this.currentValue = null;\n            /** @internal */\n            this._nextPrevious = null;\n            /** @internal */\n            this._next = null;\n            /** @internal */\n            this._prev = null;\n            /** @internal */\n            this._nextAdded = null;\n            /** @internal */\n            this._nextRemoved = null;\n            /** @internal */\n            this._nextChanged = null;\n        }\n        return KeyValueChangeRecord_;\n    }());\n\n    /**\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://angular.io/license\n     */\n    function defaultIterableDiffersFactory() {\n        return new IterableDiffers([new DefaultIterableDifferFactory()]);\n    }\n    /**\n     * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n     *\n     * @publicApi\n     */\n    var IterableDiffers = /** @class */ (function () {\n        function IterableDiffers(factories) {\n            this.factories = factories;\n        }\n        IterableDiffers.create = function (factories, parent) {\n            if (parent != null) {\n                var copied = parent.factories.slice();\n                factories = factories.concat(copied);\n            }\n            return new IterableDiffers(factories);\n        };\n        /**\n         * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n         * inherited {@link IterableDiffers} instance with the provided factories and return a new\n         * {@link IterableDiffers} instance.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * The following example shows how to extend an existing list of factories,\n         * which will only be applied to the injector for this component and its children.\n         * This step is all that's required to make a new {@link IterableDiffer} available.\n         *\n         * ```\n         * @Component({\n         *   viewProviders: [\n         *     IterableDiffers.extend([new ImmutableListDiffer()])\n         *   ]\n         * })\n         * ```\n         */\n        IterableDiffers.extend = function (factories) {\n            return {\n                provide: IterableDiffers,\n                useFactory: function (parent) {\n                    // if parent is null, it means that we are in the root injector and we have just overridden\n                    // the default injection mechanism for IterableDiffers, in such a case just assume\n                    // `defaultIterableDiffersFactory`.\n                    return IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());\n                },\n                // Dependency technically isn't optional, but we can provide a better error message this way.\n                deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n            };\n        };\n        IterableDiffers.prototype.find = function (iterable) {\n            var factory = this.factories.find(function (f) { return f.supports(iterable); });\n            if (factory != null) {\n                return factory;\n            }\n            else {\n                throw new Error(\"Cannot find a differ supporting object '\" + iterable + \"' of type '\" + getTypeNameForDebugging(iterable) + \"'\");\n            }\n        };\n        return IterableDiffers;\n    }());\n    /** @nocollapse */\n    IterableDiffers.ɵprov = ɵɵdefineInjectable({ token: IterableDiffers, providedIn: 'root', factory: defaultIterableDiffersFactory });\n    function getTypeNameForDebugging(type) {\n        return type['name'] || typeof type;\n    }\n\n    /**\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://angular.io/license\n     */\n    function defaultKeyValueDiffersFactory() {\n        return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);\n    }\n    /**\n     * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n     *\n     * @publicApi\n     */\n    var KeyValueDiffers = /** @class */ (function () {\n        function KeyValueDiffers(factories) {\n            this.factories = factories;\n        }\n        KeyValueDiffers.create = function (factories, parent) {\n            if (parent) {\n                var copied = parent.factories.slice();\n                factories = factories.concat(copied);\n            }\n            return new KeyValueDiffers(factories);\n        };\n        /**\n         * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n         * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n         * {@link KeyValueDiffers} instance.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * The following example shows how to extend an existing list of factories,\n         * which will only be applied to the injector for this component and its children.\n         * This step is all that's required to make a new {@link KeyValueDiffer} available.\n         *\n         * ```\n         * @Component({\n         *   viewProviders: [\n         *     KeyValueDiffers.extend([new ImmutableMapDiffer()])\n         *   ]\n         * })\n         * ```\n         */\n        KeyValueDiffers.extend = function (factories) {\n            return {\n                provide: KeyValueDiffers,\n                useFactory: function (parent) {\n                    // if parent is null, it means that we are in the root injector and we have just overridden\n                    // the default injection mechanism for KeyValueDiffers, in such a case just assume\n                    // `defaultKeyValueDiffersFactory`.\n                    return KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());\n                },\n                // Dependency technically isn't optional, but we can provide a better error message this way.\n                deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n            };\n        };\n        KeyValueDiffers.prototype.find = function (kv) {\n            var factory = this.factories.find(function (f) { return f.supports(kv); });\n            if (factory) {\n                return factory;\n            }\n            throw new Error(\"Cannot find a differ supporting object '\" + kv + \"'\");\n        };\n        return KeyValueDiffers;\n    }());\n    /** @nocollapse */\n    KeyValueDiffers.ɵprov = ɵɵdefineInjectable({ token: KeyValueDiffers, providedIn: 'root', factory: defaultKeyValueDiffersFactory });\n\n    function collectNativeNodes(tView, lView, tNode, result, isProjection) {\n        if (isProjection === void 0) { isProjection = false; }\n        while (tNode !== null) {\n            ngDevMode &&\n                assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 16 /* Projection */ | 32 /* Icu */);\n            var lNode = lView[tNode.index];\n            if (lNode !== null) {\n                result.push(unwrapRNode(lNode));\n            }\n            // A given lNode can represent either a native node or a LContainer (when it is a host of a\n            // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes\n            // from the views in this container.\n            if (isLContainer(lNode)) {\n                for (var i = CONTAINER_HEADER_OFFSET; i < lNode.length; i++) {\n                    var lViewInAContainer = lNode[i];\n                    var lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;\n                    if (lViewFirstChildTNode !== null) {\n                        collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);\n                    }\n                }\n            }\n            var tNodeType = tNode.type;\n            if (tNodeType & 8 /* ElementContainer */) {\n                collectNativeNodes(tView, lView, tNode.child, result);\n            }\n            else if (tNodeType & 32 /* Icu */) {\n                var nextRNode = icuContainerIterate(tNode, lView);\n                var rNode = void 0;\n                while (rNode = nextRNode()) {\n                    result.push(rNode);\n                }\n            }\n            else if (tNodeType & 16 /* Projection */) {\n                var nodesInSlot = getProjectionNodes(lView, tNode);\n                if (Array.isArray(nodesInSlot)) {\n                    result.push.apply(result, __spreadArray([], __read(nodesInSlot)));\n                }\n                else {\n                    var parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n                    ngDevMode && assertParentView(parentView);\n                    collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);\n                }\n            }\n            tNode = isProjection ? tNode.projectionNext : tNode.next;\n        }\n        return result;\n    }\n\n    var ViewRef = /** @class */ (function () {\n        function ViewRef(\n        /**\n         * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.\n         *\n         * When ViewRef is created for a dynamic component, this also represents the `LView` for the\n         * component.\n         *\n         * For a \"regular\" ViewRef created for an embedded view, this is the `LView` for the embedded\n         * view.\n         *\n         * @internal\n         */\n        _lView, \n        /**\n         * This represents the `LView` associated with the point where `ChangeDetectorRef` was\n         * requested.\n         *\n         * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.\n         */\n        _cdRefInjectingView) {\n            this._lView = _lView;\n            this._cdRefInjectingView = _cdRefInjectingView;\n            this._appRef = null;\n            this._attachedToViewContainer = false;\n        }\n        Object.defineProperty(ViewRef.prototype, \"rootNodes\", {\n            get: function () {\n                var lView = this._lView;\n                var tView = lView[TVIEW];\n                return collectNativeNodes(tView, lView, tView.firstChild, []);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewRef.prototype, \"context\", {\n            get: function () {\n                return this._lView[CONTEXT];\n            },\n            set: function (value) {\n                this._lView[CONTEXT] = value;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewRef.prototype, \"destroyed\", {\n            get: function () {\n                return (this._lView[FLAGS] & 256 /* Destroyed */) === 256 /* Destroyed */;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ViewRef.prototype.destroy = function () {\n            if (this._appRef) {\n                this._appRef.detachView(this);\n            }\n            else if (this._attachedToViewContainer) {\n                var parent = this._lView[PARENT];\n                if (isLContainer(parent)) {\n                    var viewRefs = parent[VIEW_REFS];\n                    var index = viewRefs ? viewRefs.indexOf(this) : -1;\n                    if (index > -1) {\n                        ngDevMode &&\n                            assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n                        detachView(parent, index);\n                        removeFromArray(viewRefs, index);\n                    }\n                }\n                this._attachedToViewContainer = false;\n            }\n            destroyLView(this._lView[TVIEW], this._lView);\n        };\n        ViewRef.prototype.onDestroy = function (callback) {\n            storeCleanupWithContext(this._lView[TVIEW], this._lView, null, callback);\n        };\n        /**\n         * Marks a view and all of its ancestors dirty.\n         *\n         * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is\n         * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n         * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n         *\n         * <!-- TODO: Add a link to a chapter on OnPush components -->\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * ```typescript\n         * @Component({\n         *   selector: 'app-root',\n         *   template: `Number of ticks: {{numberOfTicks}}`\n         *   changeDetection: ChangeDetectionStrategy.OnPush,\n         * })\n         * class AppComponent {\n         *   numberOfTicks = 0;\n         *\n         *   constructor(private ref: ChangeDetectorRef) {\n         *     setInterval(() => {\n         *       this.numberOfTicks++;\n         *       // the following is required, otherwise the view will not be updated\n         *       this.ref.markForCheck();\n         *     }, 1000);\n         *   }\n         * }\n         * ```\n         */\n        ViewRef.prototype.markForCheck = function () {\n            markViewDirty(this._cdRefInjectingView || this._lView);\n        };\n        /**\n         * Detaches the view from the change detection tree.\n         *\n         * Detached views will not be checked during change detection runs until they are\n         * re-attached, even if they are dirty. `detach` can be used in combination with\n         * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change\n         * detection checks.\n         *\n         * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n         * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * The following example defines a component with a large list of readonly data.\n         * Imagine the data changes constantly, many times per second. For performance reasons,\n         * we want to check and update the list every five seconds. We can do that by detaching\n         * the component's change detector and doing a local check every five seconds.\n         *\n         * ```typescript\n         * class DataProvider {\n         *   // in a real application the returned data will be different every time\n         *   get data() {\n         *     return [1,2,3,4,5];\n         *   }\n         * }\n         *\n         * @Component({\n         *   selector: 'giant-list',\n         *   template: `\n         *     <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n         *   `,\n         * })\n         * class GiantList {\n         *   constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n         *     ref.detach();\n         *     setInterval(() => {\n         *       this.ref.detectChanges();\n         *     }, 5000);\n         *   }\n         * }\n         *\n         * @Component({\n         *   selector: 'app',\n         *   providers: [DataProvider],\n         *   template: `\n         *     <giant-list><giant-list>\n         *   `,\n         * })\n         * class App {\n         * }\n         * ```\n         */\n        ViewRef.prototype.detach = function () {\n            this._lView[FLAGS] &= ~128 /* Attached */;\n        };\n        /**\n         * Re-attaches a view to the change detection tree.\n         *\n         * This can be used to re-attach views that were previously detached from the tree\n         * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.\n         *\n         * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * The following example creates a component displaying `live` data. The component will detach\n         * its change detector from the main change detector tree when the component's live property\n         * is set to false.\n         *\n         * ```typescript\n         * class DataProvider {\n         *   data = 1;\n         *\n         *   constructor() {\n         *     setInterval(() => {\n         *       this.data = this.data * 2;\n         *     }, 500);\n         *   }\n         * }\n         *\n         * @Component({\n         *   selector: 'live-data',\n         *   inputs: ['live'],\n         *   template: 'Data: {{dataProvider.data}}'\n         * })\n         * class LiveData {\n         *   constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n         *\n         *   set live(value) {\n         *     if (value) {\n         *       this.ref.reattach();\n         *     } else {\n         *       this.ref.detach();\n         *     }\n         *   }\n         * }\n         *\n         * @Component({\n         *   selector: 'app-root',\n         *   providers: [DataProvider],\n         *   template: `\n         *     Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n         *     <live-data [live]=\"live\"><live-data>\n         *   `,\n         * })\n         * class AppComponent {\n         *   live = true;\n         * }\n         * ```\n         */\n        ViewRef.prototype.reattach = function () {\n            this._lView[FLAGS] |= 128 /* Attached */;\n        };\n        /**\n         * Checks the view and its children.\n         *\n         * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement\n         * local change detection checks.\n         *\n         * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n         * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * The following example defines a component with a large list of readonly data.\n         * Imagine, the data changes constantly, many times per second. For performance reasons,\n         * we want to check and update the list every five seconds.\n         *\n         * We can do that by detaching the component's change detector and doing a local change detection\n         * check every five seconds.\n         *\n         * See {@link ChangeDetectorRef#detach detach} for more information.\n         */\n        ViewRef.prototype.detectChanges = function () {\n            detectChangesInternal(this._lView[TVIEW], this._lView, this.context);\n        };\n        /**\n         * Checks the change detector and its children, and throws if any changes are detected.\n         *\n         * This is used in development mode to verify that running change detection doesn't\n         * introduce other changes.\n         */\n        ViewRef.prototype.checkNoChanges = function () {\n            checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n        };\n        ViewRef.prototype.attachToViewContainerRef = function () {\n            if (this._appRef) {\n                throw new Error('This view is already attached directly to the ApplicationRef!');\n            }\n            this._attachedToViewContainer = true;\n        };\n        ViewRef.prototype.detachFromAppRef = function () {\n            this._appRef = null;\n            renderDetachView(this._lView[TVIEW], this._lView);\n        };\n        ViewRef.prototype.attachToAppRef = function (appRef) {\n            if (this._attachedToViewContainer) {\n                throw new Error('This view is already attached to a ViewContainer!');\n            }\n            this._appRef = appRef;\n        };\n        return ViewRef;\n    }());\n    /** @internal */\n    var RootViewRef = /** @class */ (function (_super) {\n        __extends(RootViewRef, _super);\n        function RootViewRef(_view) {\n            var _this = _super.call(this, _view) || this;\n            _this._view = _view;\n            return _this;\n        }\n        RootViewRef.prototype.detectChanges = function () {\n            detectChangesInRootView(this._view);\n        };\n        RootViewRef.prototype.checkNoChanges = function () {\n            checkNoChangesInRootView(this._view);\n        };\n        Object.defineProperty(RootViewRef.prototype, \"context\", {\n            get: function () {\n                return null;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return RootViewRef;\n    }(ViewRef));\n\n    /**\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://angular.io/license\n     */\n    var SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ = injectChangeDetectorRef;\n    var SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__ = noop;\n    var SWITCH_CHANGE_DETECTOR_REF_FACTORY = SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__;\n    /**\n     * Base class that provides change detection functionality.\n     * A change-detection tree collects all views that are to be checked for changes.\n     * Use the methods to add and remove views from the tree, initiate change-detection,\n     * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.\n     *\n     * @see [Using change detection hooks](guide/lifecycle-hooks#using-change-detection-hooks)\n     * @see [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection)\n     *\n     * @usageNotes\n     *\n     * The following examples demonstrate how to modify default change-detection behavior\n     * to perform explicit detection when needed.\n     *\n     * ### Use `markForCheck()` with `CheckOnce` strategy\n     *\n     * The following example sets the `OnPush` change-detection strategy for a component\n     * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n     * after an interval. See [live demo](https://plnkr.co/edit/GC512b?p=preview).\n     *\n     * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n     * region=\"mark-for-check\"></code-example>\n     *\n     * ### Detach change detector to limit how often check occurs\n     *\n     * The following example defines a component with a large list of read-only data\n     * that is expected to change constantly, many times per second.\n     * To improve performance, we want to check and update the list\n     * less often than the changes actually occur. To do that, we detach\n     * the component's change detector and perform an explicit local check every five seconds.\n     *\n     * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n     *\n     *\n     * ### Reattaching a detached component\n     *\n     * The following example creates a component displaying live data.\n     * The component detaches its change detector from the main change detector tree\n     * when the `live` property is set to false, and reattaches it when the property\n     * becomes true.\n     *\n     * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n     *\n     * @publicApi\n     */\n    var ChangeDetectorRef = /** @class */ (function () {\n        function ChangeDetectorRef() {\n        }\n        return ChangeDetectorRef;\n    }());\n    /**\n     * @internal\n     * @nocollapse\n     */\n    ChangeDetectorRef.__NG_ELEMENT_ID__ = SWITCH_CHANGE_DETECTOR_REF_FACTORY;\n    /** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\n    function injectChangeDetectorRef(flags) {\n        return createViewRef(getCurrentTNode(), getLView(), (flags & 16 /* ForPipe */) === 16 /* ForPipe */);\n    }\n    /**\n     * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n     *\n     * @param tNode The node that is requesting a ChangeDetectorRef\n     * @param lView The view to which the node belongs\n     * @param isPipe Whether the view is being injected into a pipe.\n     * @returns The ChangeDetectorRef to use\n     */\n    function createViewRef(tNode, lView, isPipe) {\n        if (isComponentHost(tNode) && !isPipe) {\n            // The LView represents the location where the component is declared.\n            // Instead we want the LView for the component View and so we need to look it up.\n            var componentView = getComponentLViewByIndex(tNode.index, lView); // look down\n            return new ViewRef(componentView, componentView);\n        }\n        else if (tNode.type & (3 /* AnyRNode */ | 12 /* AnyContainer */ | 32 /* Icu */)) {\n            // The LView represents the location where the injection is requested from.\n            // We need to locate the containing LView (in case where the `lView` is an embedded view)\n            var hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up\n            return new ViewRef(hostComponentView, lView);\n        }\n        return null;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Structural diffing for `Object`s and `Map`s.\n     */\n    var keyValDiff = [new DefaultKeyValueDifferFactory()];\n    /**\n     * Structural diffing for `Iterable` types such as `Array`s.\n     */\n    var iterableDiff = [new DefaultIterableDifferFactory()];\n    var defaultIterableDiffers = new IterableDiffers(iterableDiff);\n    var defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n\n    var SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ = injectTemplateRef;\n    var SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__ = noop;\n    var SWITCH_TEMPLATE_REF_FACTORY = SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__;\n    /**\n     * Represents an embedded template that can be used to instantiate embedded views.\n     * To instantiate embedded views based on a template, use the `ViewContainerRef`\n     * method `createEmbeddedView()`.\n     *\n     * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n     * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n     * is injected into the constructor of the directive,\n     * using the `TemplateRef` token.\n     *\n     * You can also use a `Query` to find a `TemplateRef` associated with\n     * a component or a directive.\n     *\n     * @see `ViewContainerRef`\n     * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)\n     *\n     * @publicApi\n     */\n    var TemplateRef = /** @class */ (function () {\n        function TemplateRef() {\n        }\n        return TemplateRef;\n    }());\n    /**\n     * @internal\n     * @nocollapse\n     */\n    TemplateRef.__NG_ELEMENT_ID__ = SWITCH_TEMPLATE_REF_FACTORY;\n    var ViewEngineTemplateRef = TemplateRef;\n    var R3TemplateRef = /** @class */ (function (_super) {\n        __extends(TemplateRef, _super);\n        function TemplateRef(_declarationLView, _declarationTContainer, elementRef) {\n            var _this = _super.call(this) || this;\n            _this._declarationLView = _declarationLView;\n            _this._declarationTContainer = _declarationTContainer;\n            _this.elementRef = elementRef;\n            return _this;\n        }\n        TemplateRef.prototype.createEmbeddedView = function (context) {\n            var embeddedTView = this._declarationTContainer.tViews;\n            var embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, null);\n            var declarationLContainer = this._declarationLView[this._declarationTContainer.index];\n            ngDevMode && assertLContainer(declarationLContainer);\n            embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n            var declarationViewLQueries = this._declarationLView[QUERIES];\n            if (declarationViewLQueries !== null) {\n                embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n            }\n            renderView(embeddedTView, embeddedLView, context);\n            return new ViewRef(embeddedLView);\n        };\n        return TemplateRef;\n    }(ViewEngineTemplateRef));\n    /**\n     * Creates a TemplateRef given a node.\n     *\n     * @returns The TemplateRef instance to use\n     */\n    function injectTemplateRef() {\n        return createTemplateRef(getCurrentTNode(), getLView());\n    }\n    /**\n     * Creates a TemplateRef and stores it on the injector.\n     *\n     * @param hostTNode The node on which a TemplateRef is requested\n     * @param hostLView The `LView` to which the node belongs\n     * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type\n     */\n    function createTemplateRef(hostTNode, hostLView) {\n        if (hostTNode.type & 4 /* Container */) {\n            ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');\n            return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));\n        }\n        return null;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Represents an instance of an `NgModule` created by an `NgModuleFactory`.\n     * Provides access to the `NgModule` instance and related objects.\n     *\n     * @publicApi\n     */\n    var NgModuleRef = /** @class */ (function () {\n        function NgModuleRef() {\n        }\n        return NgModuleRef;\n    }());\n    /**\n     * @publicApi\n     */\n    var NgModuleFactory = /** @class */ (function () {\n        function NgModuleFactory() {\n        }\n        return NgModuleFactory;\n    }());\n\n    var SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ = injectViewContainerRef;\n    var SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__ = noop;\n    var SWITCH_VIEW_CONTAINER_REF_FACTORY = SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__;\n    /**\n     * Represents a container where one or more views can be attached to a component.\n     *\n     * Can contain *host views* (created by instantiating a\n     * component with the `createComponent()` method), and *embedded views*\n     * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n     *\n     * A view container instance can contain other view containers,\n     * creating a [view hierarchy](guide/glossary#view-tree).\n     *\n     * @see `ComponentRef`\n     * @see `EmbeddedViewRef`\n     *\n     * @publicApi\n     */\n    var ViewContainerRef = /** @class */ (function () {\n        function ViewContainerRef() {\n        }\n        return ViewContainerRef;\n    }());\n    /**\n     * @internal\n     * @nocollapse\n     */\n    ViewContainerRef.__NG_ELEMENT_ID__ = SWITCH_VIEW_CONTAINER_REF_FACTORY;\n    /**\n     * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n     * already exists, retrieves the existing ViewContainerRef.\n     *\n     * @returns The ViewContainerRef instance to use\n     */\n    function injectViewContainerRef() {\n        var previousTNode = getCurrentTNode();\n        return createContainerRef(previousTNode, getLView());\n    }\n    var VE_ViewContainerRef = ViewContainerRef;\n    var R3ViewContainerRef = /** @class */ (function (_super) {\n        __extends(ViewContainerRef, _super);\n        function ViewContainerRef(_lContainer, _hostTNode, _hostLView) {\n            var _this = _super.call(this) || this;\n            _this._lContainer = _lContainer;\n            _this._hostTNode = _hostTNode;\n            _this._hostLView = _hostLView;\n            return _this;\n        }\n        Object.defineProperty(ViewContainerRef.prototype, \"element\", {\n            get: function () {\n                return createElementRef(this._hostTNode, this._hostLView);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewContainerRef.prototype, \"injector\", {\n            get: function () {\n                return new NodeInjector(this._hostTNode, this._hostLView);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewContainerRef.prototype, \"parentInjector\", {\n            /** @deprecated No replacement */\n            get: function () {\n                var parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);\n                if (hasParentInjector(parentLocation)) {\n                    var parentView = getParentInjectorView(parentLocation, this._hostLView);\n                    var injectorIndex = getParentInjectorIndex(parentLocation);\n                    ngDevMode && assertNodeInjector(parentView, injectorIndex);\n                    var parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* TNODE */];\n                    return new NodeInjector(parentTNode, parentView);\n                }\n                else {\n                    return new NodeInjector(null, this._hostLView);\n                }\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ViewContainerRef.prototype.clear = function () {\n            while (this.length > 0) {\n                this.remove(this.length - 1);\n            }\n        };\n        ViewContainerRef.prototype.get = function (index) {\n            var viewRefs = getViewRefs(this._lContainer);\n            return viewRefs !== null && viewRefs[index] || null;\n        };\n        Object.defineProperty(ViewContainerRef.prototype, \"length\", {\n            get: function () {\n                return this._lContainer.length - CONTAINER_HEADER_OFFSET;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ViewContainerRef.prototype.createEmbeddedView = function (templateRef, context, index) {\n            var viewRef = templateRef.createEmbeddedView(context || {});\n            this.insert(viewRef, index);\n            return viewRef;\n        };\n        ViewContainerRef.prototype.createComponent = function (componentFactory, index, injector, projectableNodes, ngModuleRef) {\n            var contextInjector = injector || this.parentInjector;\n            if (!ngModuleRef && componentFactory.ngModule == null && contextInjector) {\n                // DO NOT REFACTOR. The code here used to have a `value || undefined` expression\n                // which seems to cause internal google apps to fail. This is documented in the\n                // following internal bug issue: go/b/142967802\n                var result = contextInjector.get(NgModuleRef, null);\n                if (result) {\n                    ngModuleRef = result;\n                }\n            }\n            var componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n            this.insert(componentRef.hostView, index);\n            return componentRef;\n        };\n        ViewContainerRef.prototype.insert = function (viewRef, index) {\n            var lView = viewRef._lView;\n            var tView = lView[TVIEW];\n            if (ngDevMode && viewRef.destroyed) {\n                throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n            }\n            if (viewAttachedToContainer(lView)) {\n                // If view is already attached, detach it first so we clean up references appropriately.\n                var prevIdx = this.indexOf(viewRef);\n                // A view might be attached either to this or a different container. The `prevIdx` for\n                // those cases will be:\n                // equal to -1 for views attached to this ViewContainerRef\n                // >= 0 for views attached to a different ViewContainerRef\n                if (prevIdx !== -1) {\n                    this.detach(prevIdx);\n                }\n                else {\n                    var prevLContainer = lView[PARENT];\n                    ngDevMode &&\n                        assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.');\n                    // We need to re-create a R3ViewContainerRef instance since those are not stored on\n                    // LView (nor anywhere else).\n                    var prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);\n                    prevVCRef.detach(prevVCRef.indexOf(viewRef));\n                }\n            }\n            // Logical operation of adding `LView` to `LContainer`\n            var adjustedIdx = this._adjustIndex(index);\n            var lContainer = this._lContainer;\n            insertView(tView, lView, lContainer, adjustedIdx);\n            // Physical operation of adding the DOM nodes.\n            var beforeNode = getBeforeNodeForView(adjustedIdx, lContainer);\n            var renderer = lView[RENDERER];\n            var parentRNode = nativeParentNode(renderer, lContainer[NATIVE]);\n            if (parentRNode !== null) {\n                addViewToContainer(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n            }\n            viewRef.attachToViewContainerRef();\n            addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);\n            return viewRef;\n        };\n        ViewContainerRef.prototype.move = function (viewRef, newIndex) {\n            if (ngDevMode && viewRef.destroyed) {\n                throw new Error('Cannot move a destroyed View in a ViewContainer!');\n            }\n            return this.insert(viewRef, newIndex);\n        };\n        ViewContainerRef.prototype.indexOf = function (viewRef) {\n            var viewRefsArr = getViewRefs(this._lContainer);\n            return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;\n        };\n        ViewContainerRef.prototype.remove = function (index) {\n            var adjustedIdx = this._adjustIndex(index, -1);\n            var detachedView = detachView(this._lContainer, adjustedIdx);\n            if (detachedView) {\n                // Before destroying the view, remove it from the container's array of `ViewRef`s.\n                // This ensures the view container length is updated before calling\n                // `destroyLView`, which could recursively call view container methods that\n                // rely on an accurate container length.\n                // (e.g. a method on this view container being called by a child directive's OnDestroy\n                // lifecycle hook)\n                removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);\n                destroyLView(detachedView[TVIEW], detachedView);\n            }\n        };\n        ViewContainerRef.prototype.detach = function (index) {\n            var adjustedIdx = this._adjustIndex(index, -1);\n            var view = detachView(this._lContainer, adjustedIdx);\n            var wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;\n            return wasDetached ? new ViewRef(view) : null;\n        };\n        ViewContainerRef.prototype._adjustIndex = function (index, shift) {\n            if (shift === void 0) { shift = 0; }\n            if (index == null) {\n                return this.length + shift;\n            }\n            if (ngDevMode) {\n                assertGreaterThan(index, -1, \"ViewRef index must be positive, got \" + index);\n                // +1 because it's legal to insert at the end.\n                assertLessThan(index, this.length + 1 + shift, 'index');\n            }\n            return index;\n        };\n        return ViewContainerRef;\n    }(VE_ViewContainerRef));\n    function getViewRefs(lContainer) {\n        return lContainer[VIEW_REFS];\n    }\n    function getOrCreateViewRefs(lContainer) {\n        return (lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []));\n    }\n    /**\n     * Creates a ViewContainerRef and stores it on the injector.\n     *\n     * @param ViewContainerRefToken The ViewContainerRef type\n     * @param ElementRefToken The ElementRef type\n     * @param hostTNode The node that is requesting a ViewContainerRef\n     * @param hostLView The view to which the node belongs\n     * @returns The ViewContainerRef instance to use\n     */\n    function createContainerRef(hostTNode, hostLView) {\n        ngDevMode && assertTNodeType(hostTNode, 12 /* AnyContainer */ | 3 /* AnyRNode */);\n        var lContainer;\n        var slotValue = hostLView[hostTNode.index];\n        if (isLContainer(slotValue)) {\n            // If the host is a container, we don't need to create a new LContainer\n            lContainer = slotValue;\n        }\n        else {\n            var commentNode = void 0;\n            // If the host is an element container, the native host element is guaranteed to be a\n            // comment and we can reuse that comment as anchor element for the new LContainer.\n            // The comment node in question is already part of the DOM structure so we don't need to append\n            // it again.\n            if (hostTNode.type & 8 /* ElementContainer */) {\n                commentNode = unwrapRNode(slotValue);\n            }\n            else {\n                // If the host is a regular element, we have to insert a comment node manually which will\n                // be used as an anchor when inserting elements. In this specific case we use low-level DOM\n                // manipulation to insert it.\n                var renderer = hostLView[RENDERER];\n                ngDevMode && ngDevMode.rendererCreateComment++;\n                commentNode = renderer.createComment(ngDevMode ? 'container' : '');\n                var hostNative = getNativeByTNode(hostTNode, hostLView);\n                var parentOfHostNative = nativeParentNode(renderer, hostNative);\n                nativeInsertBefore(renderer, parentOfHostNative, commentNode, nativeNextSibling(renderer, hostNative), false);\n            }\n            hostLView[hostTNode.index] = lContainer =\n                createLContainer(slotValue, hostLView, commentNode, hostTNode);\n            addToViewTree(hostLView, lContainer);\n        }\n        return new R3ViewContainerRef(lContainer, hostTNode, hostLView);\n    }\n\n    /**\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://angular.io/license\n     */\n    function expressionChangedAfterItHasBeenCheckedError(context, oldValue, currValue, isFirstCheck) {\n        var msg = \"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '\" + oldValue + \"'. Current value: '\" + currValue + \"'.\";\n        if (isFirstCheck) {\n            msg +=\n                \" It seems like the view has been created after its parent and its children have been dirty checked.\" +\n                    \" Has it been created in a change detection hook ?\";\n        }\n        return viewDebugError(msg, context);\n    }\n    function viewWrappedDebugError(err, context) {\n        if (!(err instanceof Error)) {\n            // errors that are not Error instances don't have a stack,\n            // so it is ok to wrap them into a new Error object...\n            err = new Error(err.toString());\n        }\n        _addDebugContext(err, context);\n        return err;\n    }\n    function viewDebugError(msg, context) {\n        var err = new Error(msg);\n        _addDebugContext(err, context);\n        return err;\n    }\n    function _addDebugContext(err, context) {\n        err[ERROR_DEBUG_CONTEXT] = context;\n        err[ERROR_LOGGER] = context.logError.bind(context);\n    }\n    function isViewDebugError(err) {\n        return !!getDebugContext(err);\n    }\n    function viewDestroyedError(action) {\n        return new Error(\"ViewDestroyedError: Attempt to use a destroyed view: \" + action);\n    }\n\n    /**\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://angular.io/license\n     */\n    // Called before each cycle of a view's check to detect whether this is in the\n    // initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit\n    // lifecycle methods. Returns true if this check cycle should call lifecycle\n    // methods.\n    function shiftInitState(view, priorInitState, newInitState) {\n        // Only update the InitState if we are currently in the prior state.\n        // For example, only move into CallingInit if we are in BeforeInit. Only\n        // move into CallingContentInit if we are in CallingInit. Normally this will\n        // always be true because of how checkCycle is called in checkAndUpdateView.\n        // However, if checkAndUpdateView is called recursively or if an exception is\n        // thrown while checkAndUpdateView is running, checkAndUpdateView starts over\n        // from the beginning. This ensures the state is monotonically increasing,\n        // terminating in the AfterInit state, which ensures the Init methods are called\n        // at least once and only once.\n        var state = view.state;\n        var initState = state & 1792 /* InitState_Mask */;\n        if (initState === priorInitState) {\n            view.state = (state & ~1792 /* InitState_Mask */) | newInitState;\n            view.initIndex = -1;\n            return true;\n        }\n        return initState === newInitState;\n    }\n    // Returns true if the lifecycle init method should be called for the node with\n    // the given init index.\n    function shouldCallLifecycleInitHook(view, initState, index) {\n        if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {\n            view.initIndex = index + 1;\n            return true;\n        }\n        return false;\n    }\n    /**\n     * Node instance data.\n     *\n     * We have a separate type per NodeType to save memory\n     * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>)\n     *\n     * To keep our code monomorphic,\n     * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...).\n     * This way, no usage site can get a `NodeData` from view.nodes and then use it for different\n     * purposes.\n     */\n    var NodeData = /** @class */ (function () {\n        function NodeData() {\n        }\n        return NodeData;\n    }());\n    /**\n     * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n     */\n    function asTextData(view, index) {\n        return view.nodes[index];\n    }\n    /**\n     * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n     */\n    function asElementData(view, index) {\n        return view.nodes[index];\n    }\n    /**\n     * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n     */\n    function asProviderData(view, index) {\n        return view.nodes[index];\n    }\n    /**\n     * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n     */\n    function asPureExpressionData(view, index) {\n        return view.nodes[index];\n    }\n    /**\n     * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n     */\n    function asQueryList(view, index) {\n        return view.nodes[index];\n    }\n    var DebugContext = /** @class */ (function () {\n        function DebugContext() {\n        }\n        return DebugContext;\n    }());\n    /**\n     * This object is used to prevent cycles in the source files and to have a place where\n     * debug mode can hook it. It is lazily filled when `isDevMode` is known.\n     */\n    var Services = {\n        setCurrentNode: undefined,\n        createRootView: undefined,\n        createEmbeddedView: undefined,\n        createComponentView: undefined,\n        createNgModuleRef: undefined,\n        overrideProvider: undefined,\n        overrideComponentView: undefined,\n        clearOverrides: undefined,\n        checkAndUpdateView: undefined,\n        checkNoChangesView: undefined,\n        destroyView: undefined,\n        resolveDep: undefined,\n        createDebugContext: undefined,\n        handleEvent: undefined,\n        updateDirectives: undefined,\n        updateRenderer: undefined,\n        dirtyParentQueries: undefined,\n    };\n\n    var NOOP = function () { };\n    var _tokenKeyCache = new Map();\n    function tokenKey(token) {\n        var key = _tokenKeyCache.get(token);\n        if (!key) {\n            key = stringify(token) + '_' + _tokenKeyCache.size;\n            _tokenKeyCache.set(token, key);\n        }\n        return key;\n    }\n    function unwrapValue(view, nodeIdx, bindingIdx, value) {\n        if (WrappedValue.isWrapped(value)) {\n            value = WrappedValue.unwrap(value);\n            var globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;\n            var oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);\n            view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);\n        }\n        return value;\n    }\n    var UNDEFINED_RENDERER_TYPE_ID = '$$undefined';\n    var EMPTY_RENDERER_TYPE_ID = '$$empty';\n    // Attention: this function is called as top level function.\n    // Putting any logic in here will destroy closure tree shaking!\n    function createRendererType2(values) {\n        return {\n            id: UNDEFINED_RENDERER_TYPE_ID,\n            styles: values.styles,\n            encapsulation: values.encapsulation,\n            data: values.data\n        };\n    }\n    var _renderCompCount$1 = 0;\n    function resolveRendererType2(type) {\n        if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {\n            // first time we see this RendererType2. Initialize it...\n            var isFilled = ((type.encapsulation != null && type.encapsulation !== exports.ViewEncapsulation.None) ||\n                type.styles.length || Object.keys(type.data).length);\n            if (isFilled) {\n                type.id = \"c\" + _renderCompCount$1++;\n            }\n            else {\n                type.id = EMPTY_RENDERER_TYPE_ID;\n            }\n        }\n        if (type && type.id === EMPTY_RENDERER_TYPE_ID) {\n            type = null;\n        }\n        return type || null;\n    }\n    function checkBinding(view, def, bindingIdx, value) {\n        var oldValues = view.oldValues;\n        if ((view.state & 2 /* FirstCheck */) ||\n            !Object.is(oldValues[def.bindingIndex + bindingIdx], value)) {\n            return true;\n        }\n        return false;\n    }\n    function checkAndUpdateBinding(view, def, bindingIdx, value) {\n        if (checkBinding(view, def, bindingIdx, value)) {\n            view.oldValues[def.bindingIndex + bindingIdx] = value;\n            return true;\n        }\n        return false;\n    }\n    function checkBindingNoChanges(view, def, bindingIdx, value) {\n        var oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n        if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) {\n            var bindingName = def.bindings[bindingIdx].name;\n            throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), bindingName + \": \" + oldValue, bindingName + \": \" + value, (view.state & 1 /* BeforeFirstCheck */) !== 0);\n        }\n    }\n    function markParentViewsForCheck(view) {\n        var currView = view;\n        while (currView) {\n            if (currView.def.flags & 2 /* OnPush */) {\n                currView.state |= 8 /* ChecksEnabled */;\n            }\n            currView = currView.viewContainerParent || currView.parent;\n        }\n    }\n    function markParentViewsForCheckProjectedViews(view, endView) {\n        var currView = view;\n        while (currView && currView !== endView) {\n            currView.state |= 64 /* CheckProjectedViews */;\n            currView = currView.viewContainerParent || currView.parent;\n        }\n    }\n    function dispatchEvent(view, nodeIndex, eventName, event) {\n        try {\n            var nodeDef = view.def.nodes[nodeIndex];\n            var startView = nodeDef.flags & 33554432 /* ComponentView */ ?\n                asElementData(view, nodeIndex).componentView :\n                view;\n            markParentViewsForCheck(startView);\n            return Services.handleEvent(view, nodeIndex, eventName, event);\n        }\n        catch (e) {\n            // Attention: Don't rethrow, as it would cancel Observable subscriptions!\n            view.root.errorHandler.handleError(e);\n        }\n    }\n    function declaredViewContainer(view) {\n        if (view.parent) {\n            var parentView = view.parent;\n            return asElementData(parentView, view.parentNodeDef.nodeIndex);\n        }\n        return null;\n    }\n    /**\n     * for component views, this is the host element.\n     * for embedded views, this is the index of the parent node\n     * that contains the view container.\n     */\n    function viewParentEl(view) {\n        var parentView = view.parent;\n        if (parentView) {\n            return view.parentNodeDef.parent;\n        }\n        else {\n            return null;\n        }\n    }\n    function renderNode(view, def) {\n        switch (def.flags & 201347067 /* Types */) {\n            case 1 /* TypeElement */:\n                return asElementData(view, def.nodeIndex).renderElement;\n            case 2 /* TypeText */:\n                return asTextData(view, def.nodeIndex).renderText;\n        }\n    }\n    function elementEventFullName(target, name) {\n        return target ? target + \":\" + name : name;\n    }\n    function isComponentView(view) {\n        return !!view.parent && !!(view.parentNodeDef.flags & 32768 /* Component */);\n    }\n    function isEmbeddedView(view) {\n        return !!view.parent && !(view.parentNodeDef.flags & 32768 /* Component */);\n    }\n    function filterQueryId(queryId) {\n        return 1 << (queryId % 32);\n    }\n    function splitMatchedQueriesDsl(matchedQueriesDsl) {\n        var matchedQueries = {};\n        var matchedQueryIds = 0;\n        var references = {};\n        if (matchedQueriesDsl) {\n            matchedQueriesDsl.forEach(function (_a) {\n                var _b = __read(_a, 2), queryId = _b[0], valueType = _b[1];\n                if (typeof queryId === 'number') {\n                    matchedQueries[queryId] = valueType;\n                    matchedQueryIds |= filterQueryId(queryId);\n                }\n                else {\n                    references[queryId] = valueType;\n                }\n            });\n        }\n        return { matchedQueries: matchedQueries, references: references, matchedQueryIds: matchedQueryIds };\n    }\n    function splitDepsDsl(deps, sourceName) {\n        return deps.map(function (value) {\n            var _a;\n            var token;\n            var flags;\n            if (Array.isArray(value)) {\n                _a = __read(value, 2), flags = _a[0], token = _a[1];\n            }\n            else {\n                flags = 0 /* None */;\n                token = value;\n            }\n            if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {\n                Object.defineProperty(token, SOURCE, { value: sourceName, configurable: true });\n            }\n            return { flags: flags, token: token, tokenKey: tokenKey(token) };\n        });\n    }\n    function getParentRenderElement(view, renderHost, def) {\n        var renderParent = def.renderParent;\n        if (renderParent) {\n            if ((renderParent.flags & 1 /* TypeElement */) === 0 ||\n                (renderParent.flags & 33554432 /* ComponentView */) === 0 ||\n                (renderParent.element.componentRendererType &&\n                    (renderParent.element.componentRendererType.encapsulation ===\n                        exports.ViewEncapsulation.ShadowDom ||\n                        // TODO(FW-2290): remove the `encapsulation === 1` fallback logic in v12.\n                        // @ts-ignore TODO: Remove as part of FW-2290. TS complains about us dealing with an enum\n                        // value that is not known (but previously was the value for ViewEncapsulation.Native)\n                        renderParent.element.componentRendererType.encapsulation === 1))) {\n                // only children of non components, or children of components with native encapsulation should\n                // be attached.\n                return asElementData(view, def.renderParent.nodeIndex).renderElement;\n            }\n        }\n        else {\n            return renderHost;\n        }\n    }\n    var DEFINITION_CACHE = new WeakMap();\n    function resolveDefinition(factory) {\n        var value = DEFINITION_CACHE.get(factory);\n        if (!value) {\n            value = factory(function () { return NOOP; });\n            value.factory = factory;\n            DEFINITION_CACHE.set(factory, value);\n        }\n        return value;\n    }\n    function rootRenderNodes(view) {\n        var renderNodes = [];\n        visitRootRenderNodes(view, 0 /* Collect */, undefined, undefined, renderNodes);\n        return renderNodes;\n    }\n    function visitRootRenderNodes(view, action, parentNode, nextSibling, target) {\n        // We need to re-compute the parent node in case the nodes have been moved around manually\n        if (action === 3 /* RemoveChild */) {\n            parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode));\n        }\n        visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);\n    }\n    function visitSiblingRenderNodes(view, action, startIndex, endIndex, parentNode, nextSibling, target) {\n        for (var i = startIndex; i <= endIndex; i++) {\n            var nodeDef = view.def.nodes[i];\n            if (nodeDef.flags & (1 /* TypeElement */ | 2 /* TypeText */ | 8 /* TypeNgContent */)) {\n                visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);\n            }\n            // jump to next sibling\n            i += nodeDef.childCount;\n        }\n    }\n    function visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nextSibling, target) {\n        var compView = view;\n        while (compView && !isComponentView(compView)) {\n            compView = compView.parent;\n        }\n        var hostView = compView.parent;\n        var hostElDef = viewParentEl(compView);\n        var startIndex = hostElDef.nodeIndex + 1;\n        var endIndex = hostElDef.nodeIndex + hostElDef.childCount;\n        for (var i = startIndex; i <= endIndex; i++) {\n            var nodeDef = hostView.def.nodes[i];\n            if (nodeDef.ngContentIndex === ngContentIndex) {\n                visitRenderNode(hostView, nodeDef, action, parentNode, nextSibling, target);\n            }\n            // jump to next sibling\n            i += nodeDef.childCount;\n        }\n        if (!hostView.parent) {\n            // a root view\n            var projectedNodes = view.root.projectableNodes[ngContentIndex];\n            if (projectedNodes) {\n                for (var i = 0; i < projectedNodes.length; i++) {\n                    execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);\n                }\n            }\n        }\n    }\n    function visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target) {\n        if (nodeDef.flags & 8 /* TypeNgContent */) {\n            visitProjectedRenderNodes(view, nodeDef.ngContent.index, action, parentNode, nextSibling, target);\n        }\n        else {\n            var rn = renderNode(view, nodeDef);\n            if (action === 3 /* RemoveChild */ && (nodeDef.flags & 33554432 /* ComponentView */) &&\n                (nodeDef.bindingFlags & 48 /* CatSyntheticProperty */)) {\n                // Note: we might need to do both actions.\n                if (nodeDef.bindingFlags & (16 /* SyntheticProperty */)) {\n                    execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n                }\n                if (nodeDef.bindingFlags & (32 /* SyntheticHostProperty */)) {\n                    var compView = asElementData(view, nodeDef.nodeIndex).componentView;\n                    execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);\n                }\n            }\n            else {\n                execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n            }\n            if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n                var embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer._embeddedViews;\n                for (var k = 0; k < embeddedViews.length; k++) {\n                    visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);\n                }\n            }\n            if (nodeDef.flags & 1 /* TypeElement */ && !nodeDef.element.name) {\n                visitSiblingRenderNodes(view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode, nextSibling, target);\n            }\n        }\n    }\n    function execRenderNodeAction(view, renderNode, action, parentNode, nextSibling, target) {\n        var renderer = view.renderer;\n        switch (action) {\n            case 1 /* AppendChild */:\n                renderer.appendChild(parentNode, renderNode);\n                break;\n            case 2 /* InsertBefore */:\n                renderer.insertBefore(parentNode, renderNode, nextSibling);\n                break;\n            case 3 /* RemoveChild */:\n                renderer.removeChild(parentNode, renderNode);\n                break;\n            case 0 /* Collect */:\n                target.push(renderNode);\n                break;\n        }\n    }\n    var NS_PREFIX_RE = /^:([^:]+):(.+)$/;\n    function splitNamespace(name) {\n        if (name[0] === ':') {\n            var match = name.match(NS_PREFIX_RE);\n            return [match[1], match[2]];\n        }\n        return ['', name];\n    }\n    function calcBindingFlags(bindings) {\n        var flags = 0;\n        for (var i = 0; i < bindings.length; i++) {\n            flags |= bindings[i].flags;\n        }\n        return flags;\n    }\n    function interpolate(valueCount, constAndInterp) {\n        var result = '';\n        for (var i = 0; i < valueCount * 2; i = i + 2) {\n            result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);\n        }\n        return result + constAndInterp[valueCount * 2];\n    }\n    function inlineInterpolate(valueCount, c0, a1, c1, a2, c2, a3, c3, a4, c4, a5, c5, a6, c6, a7, c7, a8, c8, a9, c9) {\n        switch (valueCount) {\n            case 1:\n                return c0 + _toStringWithNull(a1) + c1;\n            case 2:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;\n            case 3:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3;\n            case 4:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3 + _toStringWithNull(a4) + c4;\n            case 5:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;\n            case 6:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;\n            case 7:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n                    c6 + _toStringWithNull(a7) + c7;\n            case 8:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n                    c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;\n            case 9:\n                return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                    c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n                    c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;\n            default:\n                throw new Error(\"Does not support more than 9 expressions\");\n        }\n    }\n    function _toStringWithNull(v) {\n        return v != null ? v.toString() : '';\n    }\n    var EMPTY_MAP = {};\n\n    var UNDEFINED_VALUE = {};\n    var InjectorRefTokenKey = tokenKey(Injector);\n    var INJECTORRefTokenKey = tokenKey(INJECTOR$1);\n    var NgModuleRefTokenKey = tokenKey(NgModuleRef);\n    function moduleProvideDef(flags, token, value, deps) {\n        // Need to resolve forwardRefs as e.g. for `useValue` we\n        // lowered the expression and then stopped evaluating it,\n        // i.e. also didn't unwrap it.\n        value = resolveForwardRef(value);\n        var depDefs = splitDepsDsl(deps, stringify(token));\n        return {\n            // will bet set by the module definition\n            index: -1,\n            deps: depDefs,\n            flags: flags,\n            token: token,\n            value: value\n        };\n    }\n    function moduleDef(providers) {\n        var providersByKey = {};\n        var modules = [];\n        var scope = null;\n        for (var i = 0; i < providers.length; i++) {\n            var provider = providers[i];\n            if (provider.token === INJECTOR_SCOPE) {\n                scope = provider.value;\n            }\n            if (provider.flags & 1073741824 /* TypeNgModule */) {\n                modules.push(provider.token);\n            }\n            provider.index = i;\n            providersByKey[tokenKey(provider.token)] = provider;\n        }\n        return {\n            // Will be filled later...\n            factory: null,\n            providersByKey: providersByKey,\n            providers: providers,\n            modules: modules,\n            scope: scope,\n        };\n    }\n    function initNgModule(data) {\n        var def = data._def;\n        var providers = data._providers = newArray(def.providers.length);\n        for (var i = 0; i < def.providers.length; i++) {\n            var provDef = def.providers[i];\n            if (!(provDef.flags & 4096 /* LazyProvider */)) {\n                // Make sure the provider has not been already initialized outside this loop.\n                if (providers[i] === undefined) {\n                    providers[i] = _createProviderInstance(data, provDef);\n                }\n            }\n        }\n    }\n    function resolveNgModuleDep(data, depDef, notFoundValue) {\n        if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n        var former = setCurrentInjector(data);\n        try {\n            if (depDef.flags & 8 /* Value */) {\n                return depDef.token;\n            }\n            if (depDef.flags & 2 /* Optional */) {\n                notFoundValue = null;\n            }\n            if (depDef.flags & 1 /* SkipSelf */) {\n                return data._parent.get(depDef.token, notFoundValue);\n            }\n            var tokenKey_1 = depDef.tokenKey;\n            switch (tokenKey_1) {\n                case InjectorRefTokenKey:\n                case INJECTORRefTokenKey:\n                case NgModuleRefTokenKey:\n                    return data;\n            }\n            var providerDef = data._def.providersByKey[tokenKey_1];\n            var injectableDef = void 0;\n            if (providerDef) {\n                var providerInstance = data._providers[providerDef.index];\n                if (providerInstance === undefined) {\n                    providerInstance = data._providers[providerDef.index] =\n                        _createProviderInstance(data, providerDef);\n                }\n                return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;\n            }\n            else if ((injectableDef = getInjectableDef(depDef.token)) && targetsModule(data, injectableDef)) {\n                var index = data._providers.length;\n                data._def.providers[index] = data._def.providersByKey[depDef.tokenKey] = {\n                    flags: 1024 /* TypeFactoryProvider */ | 4096 /* LazyProvider */,\n                    value: injectableDef.factory,\n                    deps: [],\n                    index: index,\n                    token: depDef.token,\n                };\n                data._providers[index] = UNDEFINED_VALUE;\n                return (data._providers[index] =\n                    _createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));\n            }\n            else if (depDef.flags & 4 /* Self */) {\n                return notFoundValue;\n            }\n            return data._parent.get(depDef.token, notFoundValue);\n        }\n        finally {\n            setCurrentInjector(former);\n        }\n    }\n    function moduleTransitivelyPresent(ngModule, scope) {\n        return ngModule._def.modules.indexOf(scope) > -1;\n    }\n    function targetsModule(ngModule, def) {\n        var providedIn = resolveForwardRef(def.providedIn);\n        return providedIn != null &&\n            (providedIn === 'any' || providedIn === ngModule._def.scope ||\n                moduleTransitivelyPresent(ngModule, providedIn));\n    }\n    function _createProviderInstance(ngModule, providerDef) {\n        var injectable;\n        switch (providerDef.flags & 201347067 /* Types */) {\n            case 512 /* TypeClassProvider */:\n                injectable = _createClass(ngModule, providerDef.value, providerDef.deps);\n                break;\n            case 1024 /* TypeFactoryProvider */:\n                injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);\n                break;\n            case 2048 /* TypeUseExistingProvider */:\n                injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);\n                break;\n            case 256 /* TypeValueProvider */:\n                injectable = providerDef.value;\n                break;\n        }\n        // The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be\n        // avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be\n        // checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already\n        // set (ngOnDestroy was detected statically).\n        if (injectable !== UNDEFINED_VALUE && injectable !== null && typeof injectable === 'object' &&\n            !(providerDef.flags & 131072 /* OnDestroy */) && typeof injectable.ngOnDestroy === 'function') {\n            providerDef.flags |= 131072 /* OnDestroy */;\n        }\n        return injectable === undefined ? UNDEFINED_VALUE : injectable;\n    }\n    function _createClass(ngModule, ctor, deps) {\n        var len = deps.length;\n        switch (len) {\n            case 0:\n                return new ctor();\n            case 1:\n                return new ctor(resolveNgModuleDep(ngModule, deps[0]));\n            case 2:\n                return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n            case 3:\n                return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));\n            default:\n                var depValues = [];\n                for (var i = 0; i < len; i++) {\n                    depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n                }\n                return new (ctor.bind.apply(ctor, __spreadArray([void 0], __read(depValues))))();\n        }\n    }\n    function _callFactory(ngModule, factory, deps) {\n        var len = deps.length;\n        switch (len) {\n            case 0:\n                return factory();\n            case 1:\n                return factory(resolveNgModuleDep(ngModule, deps[0]));\n            case 2:\n                return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n            case 3:\n                return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));\n            default:\n                var depValues = [];\n                for (var i = 0; i < len; i++) {\n                    depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n                }\n                return factory.apply(void 0, __spreadArray([], __read(depValues)));\n        }\n    }\n    function callNgModuleLifecycle(ngModule, lifecycles) {\n        var def = ngModule._def;\n        var destroyed = new Set();\n        for (var i = 0; i < def.providers.length; i++) {\n            var provDef = def.providers[i];\n            if (provDef.flags & 131072 /* OnDestroy */) {\n                var instance = ngModule._providers[i];\n                if (instance && instance !== UNDEFINED_VALUE) {\n                    var onDestroy = instance.ngOnDestroy;\n                    if (typeof onDestroy === 'function' && !destroyed.has(instance)) {\n                        onDestroy.apply(instance);\n                        destroyed.add(instance);\n                    }\n                }\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function attachEmbeddedView(parentView, elementData, viewIndex, view) {\n        var embeddedViews = elementData.viewContainer._embeddedViews;\n        if (viewIndex === null || viewIndex === undefined) {\n            viewIndex = embeddedViews.length;\n        }\n        view.viewContainerParent = parentView;\n        addToArray(embeddedViews, viewIndex, view);\n        attachProjectedView(elementData, view);\n        Services.dirtyParentQueries(view);\n        var prevView = viewIndex > 0 ? embeddedViews[viewIndex - 1] : null;\n        renderAttachEmbeddedView(elementData, prevView, view);\n    }\n    function attachProjectedView(vcElementData, view) {\n        var dvcElementData = declaredViewContainer(view);\n        if (!dvcElementData || dvcElementData === vcElementData ||\n            view.state & 16 /* IsProjectedView */) {\n            return;\n        }\n        // Note: For performance reasons, we\n        // - add a view to template._projectedViews only 1x throughout its lifetime,\n        //   and remove it not until the view is destroyed.\n        //   (hard, as when a parent view is attached/detached we would need to attach/detach all\n        //    nested projected views as well, even across component boundaries).\n        // - don't track the insertion order of views in the projected views array\n        //   (hard, as when the views of the same template are inserted different view containers)\n        view.state |= 16 /* IsProjectedView */;\n        var projectedViews = dvcElementData.template._projectedViews;\n        if (!projectedViews) {\n            projectedViews = dvcElementData.template._projectedViews = [];\n        }\n        projectedViews.push(view);\n        // Note: we are changing the NodeDef here as we cannot calculate\n        // the fact whether a template is used for projection during compilation.\n        markNodeAsProjectedTemplate(view.parent.def, view.parentNodeDef);\n    }\n    function markNodeAsProjectedTemplate(viewDef, nodeDef) {\n        if (nodeDef.flags & 4 /* ProjectedTemplate */) {\n            return;\n        }\n        viewDef.nodeFlags |= 4 /* ProjectedTemplate */;\n        nodeDef.flags |= 4 /* ProjectedTemplate */;\n        var parentNodeDef = nodeDef.parent;\n        while (parentNodeDef) {\n            parentNodeDef.childFlags |= 4 /* ProjectedTemplate */;\n            parentNodeDef = parentNodeDef.parent;\n        }\n    }\n    function detachEmbeddedView(elementData, viewIndex) {\n        var embeddedViews = elementData.viewContainer._embeddedViews;\n        if (viewIndex == null || viewIndex >= embeddedViews.length) {\n            viewIndex = embeddedViews.length - 1;\n        }\n        if (viewIndex < 0) {\n            return null;\n        }\n        var view = embeddedViews[viewIndex];\n        view.viewContainerParent = null;\n        removeFromArray(embeddedViews, viewIndex);\n        // See attachProjectedView for why we don't update projectedViews here.\n        Services.dirtyParentQueries(view);\n        renderDetachView$1(view);\n        return view;\n    }\n    function detachProjectedView(view) {\n        if (!(view.state & 16 /* IsProjectedView */)) {\n            return;\n        }\n        var dvcElementData = declaredViewContainer(view);\n        if (dvcElementData) {\n            var projectedViews = dvcElementData.template._projectedViews;\n            if (projectedViews) {\n                removeFromArray(projectedViews, projectedViews.indexOf(view));\n                Services.dirtyParentQueries(view);\n            }\n        }\n    }\n    function moveEmbeddedView(elementData, oldViewIndex, newViewIndex) {\n        var embeddedViews = elementData.viewContainer._embeddedViews;\n        var view = embeddedViews[oldViewIndex];\n        removeFromArray(embeddedViews, oldViewIndex);\n        if (newViewIndex == null) {\n            newViewIndex = embeddedViews.length;\n        }\n        addToArray(embeddedViews, newViewIndex, view);\n        // Note: Don't need to change projectedViews as the order in there\n        // as always invalid...\n        Services.dirtyParentQueries(view);\n        renderDetachView$1(view);\n        var prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;\n        renderAttachEmbeddedView(elementData, prevView, view);\n        return view;\n    }\n    function renderAttachEmbeddedView(elementData, prevView, view) {\n        var prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode) : elementData.renderElement;\n        var parentNode = view.renderer.parentNode(prevRenderNode);\n        var nextSibling = view.renderer.nextSibling(prevRenderNode);\n        // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!\n        // However, browsers automatically do `appendChild` when there is no `nextSibling`.\n        visitRootRenderNodes(view, 2 /* InsertBefore */, parentNode, nextSibling, undefined);\n    }\n    function renderDetachView$1(view) {\n        visitRootRenderNodes(view, 3 /* RemoveChild */, null, null, undefined);\n    }\n\n    var EMPTY_CONTEXT = {};\n    // Attention: this function is called as top level function.\n    // Putting any logic in here will destroy closure tree shaking!\n    function createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) {\n        return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);\n    }\n    function getComponentViewDefinitionFactory(componentFactory) {\n        return componentFactory.viewDefFactory;\n    }\n    var ComponentFactory_ = /** @class */ (function (_super) {\n        __extends(ComponentFactory_, _super);\n        function ComponentFactory_(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) {\n            var _this = \n            // Attention: this ctor is called as top level function.\n            // Putting any logic in here will destroy closure tree shaking!\n            _super.call(this) || this;\n            _this.selector = selector;\n            _this.componentType = componentType;\n            _this._inputs = _inputs;\n            _this._outputs = _outputs;\n            _this.ngContentSelectors = ngContentSelectors;\n            _this.viewDefFactory = viewDefFactory;\n            return _this;\n        }\n        Object.defineProperty(ComponentFactory_.prototype, \"inputs\", {\n            get: function () {\n                var inputsArr = [];\n                var inputs = this._inputs;\n                for (var propName in inputs) {\n                    var templateName = inputs[propName];\n                    inputsArr.push({ propName: propName, templateName: templateName });\n                }\n                return inputsArr;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ComponentFactory_.prototype, \"outputs\", {\n            get: function () {\n                var outputsArr = [];\n                for (var propName in this._outputs) {\n                    var templateName = this._outputs[propName];\n                    outputsArr.push({ propName: propName, templateName: templateName });\n                }\n                return outputsArr;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Creates a new component.\n         */\n        ComponentFactory_.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {\n            if (!ngModule) {\n                throw new Error('ngModule should be provided');\n            }\n            var viewDef = resolveDefinition(this.viewDefFactory);\n            var componentNodeIndex = viewDef.nodes[0].element.componentProvider.nodeIndex;\n            var view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);\n            var component = asProviderData(view, componentNodeIndex).instance;\n            if (rootSelectorOrNode) {\n                view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);\n            }\n            return new ComponentRef_(view, new ViewRef_(view), component);\n        };\n        return ComponentFactory_;\n    }(ComponentFactory));\n    var ComponentRef_ = /** @class */ (function (_super) {\n        __extends(ComponentRef_, _super);\n        function ComponentRef_(_view, _viewRef, _component) {\n            var _this = _super.call(this) || this;\n            _this._view = _view;\n            _this._viewRef = _viewRef;\n            _this._component = _component;\n            _this._elDef = _this._view.def.nodes[0];\n            _this.hostView = _viewRef;\n            _this.changeDetectorRef = _viewRef;\n            _this.instance = _component;\n            return _this;\n        }\n        Object.defineProperty(ComponentRef_.prototype, \"location\", {\n            get: function () {\n                return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ComponentRef_.prototype, \"injector\", {\n            get: function () {\n                return new Injector_(this._view, this._elDef);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ComponentRef_.prototype, \"componentType\", {\n            get: function () {\n                return this._component.constructor;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ComponentRef_.prototype.destroy = function () {\n            this._viewRef.destroy();\n        };\n        ComponentRef_.prototype.onDestroy = function (callback) {\n            this._viewRef.onDestroy(callback);\n        };\n        return ComponentRef_;\n    }(ComponentRef));\n    function createViewContainerData(view, elDef, elData) {\n        return new ViewContainerRef_(view, elDef, elData);\n    }\n    var ViewContainerRef_ = /** @class */ (function () {\n        function ViewContainerRef_(_view, _elDef, _data) {\n            this._view = _view;\n            this._elDef = _elDef;\n            this._data = _data;\n            /**\n             * @internal\n             */\n            this._embeddedViews = [];\n        }\n        Object.defineProperty(ViewContainerRef_.prototype, \"element\", {\n            get: function () {\n                return new ElementRef(this._data.renderElement);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewContainerRef_.prototype, \"injector\", {\n            get: function () {\n                return new Injector_(this._view, this._elDef);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewContainerRef_.prototype, \"parentInjector\", {\n            /** @deprecated No replacement */\n            get: function () {\n                var view = this._view;\n                var elDef = this._elDef.parent;\n                while (!elDef && view) {\n                    elDef = viewParentEl(view);\n                    view = view.parent;\n                }\n                return view ? new Injector_(view, elDef) : new Injector_(this._view, null);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ViewContainerRef_.prototype.clear = function () {\n            var len = this._embeddedViews.length;\n            for (var i = len - 1; i >= 0; i--) {\n                var view = detachEmbeddedView(this._data, i);\n                Services.destroyView(view);\n            }\n        };\n        ViewContainerRef_.prototype.get = function (index) {\n            var view = this._embeddedViews[index];\n            if (view) {\n                var ref = new ViewRef_(view);\n                ref.attachToViewContainerRef(this);\n                return ref;\n            }\n            return null;\n        };\n        Object.defineProperty(ViewContainerRef_.prototype, \"length\", {\n            get: function () {\n                return this._embeddedViews.length;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ViewContainerRef_.prototype.createEmbeddedView = function (templateRef, context, index) {\n            var viewRef = templateRef.createEmbeddedView(context || {});\n            this.insert(viewRef, index);\n            return viewRef;\n        };\n        ViewContainerRef_.prototype.createComponent = function (componentFactory, index, injector, projectableNodes, ngModuleRef) {\n            var contextInjector = injector || this.parentInjector;\n            if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {\n                ngModuleRef = contextInjector.get(NgModuleRef);\n            }\n            var componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n            this.insert(componentRef.hostView, index);\n            return componentRef;\n        };\n        ViewContainerRef_.prototype.insert = function (viewRef, index) {\n            if (viewRef.destroyed) {\n                throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n            }\n            var viewRef_ = viewRef;\n            var viewData = viewRef_._view;\n            attachEmbeddedView(this._view, this._data, index, viewData);\n            viewRef_.attachToViewContainerRef(this);\n            return viewRef;\n        };\n        ViewContainerRef_.prototype.move = function (viewRef, currentIndex) {\n            if (viewRef.destroyed) {\n                throw new Error('Cannot move a destroyed View in a ViewContainer!');\n            }\n            var previousIndex = this._embeddedViews.indexOf(viewRef._view);\n            moveEmbeddedView(this._data, previousIndex, currentIndex);\n            return viewRef;\n        };\n        ViewContainerRef_.prototype.indexOf = function (viewRef) {\n            return this._embeddedViews.indexOf(viewRef._view);\n        };\n        ViewContainerRef_.prototype.remove = function (index) {\n            var viewData = detachEmbeddedView(this._data, index);\n            if (viewData) {\n                Services.destroyView(viewData);\n            }\n        };\n        ViewContainerRef_.prototype.detach = function (index) {\n            var view = detachEmbeddedView(this._data, index);\n            return view ? new ViewRef_(view) : null;\n        };\n        return ViewContainerRef_;\n    }());\n    function createChangeDetectorRef(view) {\n        return new ViewRef_(view);\n    }\n    var ViewRef_ = /** @class */ (function () {\n        function ViewRef_(_view) {\n            this._view = _view;\n            this._viewContainerRef = null;\n            this._appRef = null;\n        }\n        Object.defineProperty(ViewRef_.prototype, \"rootNodes\", {\n            get: function () {\n                return rootRenderNodes(this._view);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewRef_.prototype, \"context\", {\n            get: function () {\n                return this._view.context;\n            },\n            set: function (value) {\n                this._view.context = value;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewRef_.prototype, \"destroyed\", {\n            get: function () {\n                return (this._view.state & 128 /* Destroyed */) !== 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ViewRef_.prototype.markForCheck = function () {\n            markParentViewsForCheck(this._view);\n        };\n        ViewRef_.prototype.detach = function () {\n            this._view.state &= ~4 /* Attached */;\n        };\n        ViewRef_.prototype.detectChanges = function () {\n            var fs = this._view.root.rendererFactory;\n            if (fs.begin) {\n                fs.begin();\n            }\n            try {\n                Services.checkAndUpdateView(this._view);\n            }\n            finally {\n                if (fs.end) {\n                    fs.end();\n                }\n            }\n        };\n        ViewRef_.prototype.checkNoChanges = function () {\n            Services.checkNoChangesView(this._view);\n        };\n        ViewRef_.prototype.reattach = function () {\n            this._view.state |= 4 /* Attached */;\n        };\n        ViewRef_.prototype.onDestroy = function (callback) {\n            if (!this._view.disposables) {\n                this._view.disposables = [];\n            }\n            this._view.disposables.push(callback);\n        };\n        ViewRef_.prototype.destroy = function () {\n            if (this._appRef) {\n                this._appRef.detachView(this);\n            }\n            else if (this._viewContainerRef) {\n                this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));\n            }\n            Services.destroyView(this._view);\n        };\n        ViewRef_.prototype.detachFromAppRef = function () {\n            this._appRef = null;\n            renderDetachView$1(this._view);\n            Services.dirtyParentQueries(this._view);\n        };\n        ViewRef_.prototype.attachToAppRef = function (appRef) {\n            if (this._viewContainerRef) {\n                throw new Error('This view is already attached to a ViewContainer!');\n            }\n            this._appRef = appRef;\n        };\n        ViewRef_.prototype.attachToViewContainerRef = function (vcRef) {\n            if (this._appRef) {\n                throw new Error('This view is already attached directly to the ApplicationRef!');\n            }\n            this._viewContainerRef = vcRef;\n        };\n        return ViewRef_;\n    }());\n    function createTemplateData(view, def) {\n        return new TemplateRef_(view, def);\n    }\n    var TemplateRef_ = /** @class */ (function (_super) {\n        __extends(TemplateRef_, _super);\n        function TemplateRef_(_parentView, _def) {\n            var _this = _super.call(this) || this;\n            _this._parentView = _parentView;\n            _this._def = _def;\n            return _this;\n        }\n        TemplateRef_.prototype.createEmbeddedView = function (context) {\n            return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, this._def.element.template, context));\n        };\n        Object.defineProperty(TemplateRef_.prototype, \"elementRef\", {\n            get: function () {\n                return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return TemplateRef_;\n    }(TemplateRef));\n    function createInjector$1(view, elDef) {\n        return new Injector_(view, elDef);\n    }\n    var Injector_ = /** @class */ (function () {\n        function Injector_(view, elDef) {\n            this.view = view;\n            this.elDef = elDef;\n        }\n        Injector_.prototype.get = function (token, notFoundValue) {\n            if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n            var allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false;\n            return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token: token, tokenKey: tokenKey(token) }, notFoundValue);\n        };\n        return Injector_;\n    }());\n    function nodeValue(view, index) {\n        var def = view.def.nodes[index];\n        if (def.flags & 1 /* TypeElement */) {\n            var elData = asElementData(view, def.nodeIndex);\n            return def.element.template ? elData.template : elData.renderElement;\n        }\n        else if (def.flags & 2 /* TypeText */) {\n            return asTextData(view, def.nodeIndex).renderText;\n        }\n        else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) {\n            return asProviderData(view, def.nodeIndex).instance;\n        }\n        throw new Error(\"Illegal state: read nodeValue for node index \" + index);\n    }\n    function createNgModuleRef(moduleType, parent, bootstrapComponents, def) {\n        return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);\n    }\n    var NgModuleRef_ = /** @class */ (function () {\n        function NgModuleRef_(_moduleType, _parent, _bootstrapComponents, _def) {\n            this._moduleType = _moduleType;\n            this._parent = _parent;\n            this._bootstrapComponents = _bootstrapComponents;\n            this._def = _def;\n            this._destroyListeners = [];\n            this._destroyed = false;\n            this.injector = this;\n            initNgModule(this);\n        }\n        NgModuleRef_.prototype.get = function (token, notFoundValue, injectFlags) {\n            if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n            if (injectFlags === void 0) { injectFlags = exports.InjectFlags.Default; }\n            var flags = 0 /* None */;\n            if (injectFlags & exports.InjectFlags.SkipSelf) {\n                flags |= 1 /* SkipSelf */;\n            }\n            else if (injectFlags & exports.InjectFlags.Self) {\n                flags |= 4 /* Self */;\n            }\n            return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: flags }, notFoundValue);\n        };\n        Object.defineProperty(NgModuleRef_.prototype, \"instance\", {\n            get: function () {\n                return this.get(this._moduleType);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(NgModuleRef_.prototype, \"componentFactoryResolver\", {\n            get: function () {\n                return this.get(ComponentFactoryResolver);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        NgModuleRef_.prototype.destroy = function () {\n            if (this._destroyed) {\n                throw new Error(\"The ng module \" + stringify(this.instance.constructor) + \" has already been destroyed.\");\n            }\n            this._destroyed = true;\n            callNgModuleLifecycle(this, 131072 /* OnDestroy */);\n            this._destroyListeners.forEach(function (listener) { return listener(); });\n        };\n        NgModuleRef_.prototype.onDestroy = function (callback) {\n            this._destroyListeners.push(callback);\n        };\n        return NgModuleRef_;\n    }());\n\n    var Renderer2TokenKey = tokenKey(Renderer2);\n    var ElementRefTokenKey = tokenKey(ElementRef);\n    var ViewContainerRefTokenKey = tokenKey(ViewContainerRef);\n    var TemplateRefTokenKey = tokenKey(TemplateRef);\n    var ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);\n    var InjectorRefTokenKey$1 = tokenKey(Injector);\n    var INJECTORRefTokenKey$1 = tokenKey(INJECTOR$1);\n    function directiveDef(checkIndex, flags, matchedQueries, childCount, ctor, deps, props, outputs) {\n        var bindings = [];\n        if (props) {\n            for (var prop in props) {\n                var _a = __read(props[prop], 2), bindingIndex = _a[0], nonMinifiedName = _a[1];\n                bindings[bindingIndex] = {\n                    flags: 8 /* TypeProperty */,\n                    name: prop,\n                    nonMinifiedName: nonMinifiedName,\n                    ns: null,\n                    securityContext: null,\n                    suffix: null\n                };\n            }\n        }\n        var outputDefs = [];\n        if (outputs) {\n            for (var propName in outputs) {\n                outputDefs.push({ type: 1 /* DirectiveOutput */, propName: propName, target: null, eventName: outputs[propName] });\n            }\n        }\n        flags |= 16384 /* TypeDirective */;\n        return _def(checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);\n    }\n    function pipeDef(flags, ctor, deps) {\n        flags |= 16 /* TypePipe */;\n        return _def(-1, flags, null, 0, ctor, ctor, deps);\n    }\n    function providerDef(flags, matchedQueries, token, value, deps) {\n        return _def(-1, flags, matchedQueries, 0, token, value, deps);\n    }\n    function _def(checkIndex, flags, matchedQueriesDsl, childCount, token, value, deps, bindings, outputs) {\n        var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;\n        if (!outputs) {\n            outputs = [];\n        }\n        if (!bindings) {\n            bindings = [];\n        }\n        // Need to resolve forwardRefs as e.g. for `useValue` we\n        // lowered the expression and then stopped evaluating it,\n        // i.e. also didn't unwrap it.\n        value = resolveForwardRef(value);\n        var depDefs = splitDepsDsl(deps, stringify(token));\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            checkIndex: checkIndex,\n            flags: flags,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            matchedQueries: matchedQueries,\n            matchedQueryIds: matchedQueryIds,\n            references: references,\n            ngContentIndex: -1,\n            childCount: childCount,\n            bindings: bindings,\n            bindingFlags: calcBindingFlags(bindings),\n            outputs: outputs,\n            element: null,\n            provider: { token: token, value: value, deps: depDefs },\n            text: null,\n            query: null,\n            ngContent: null\n        };\n    }\n    function createProviderInstance(view, def) {\n        return _createProviderInstance$1(view, def);\n    }\n    function createPipeInstance(view, def) {\n        // deps are looked up from component.\n        var compView = view;\n        while (compView.parent && !isComponentView(compView)) {\n            compView = compView.parent;\n        }\n        // pipes can see the private services of the component\n        var allowPrivateServices = true;\n        // pipes are always eager and classes!\n        return createClass(compView.parent, viewParentEl(compView), allowPrivateServices, def.provider.value, def.provider.deps);\n    }\n    function createDirectiveInstance(view, def) {\n        // components can see other private services, other directives can't.\n        var allowPrivateServices = (def.flags & 32768 /* Component */) > 0;\n        // directives are always eager and classes!\n        var instance = createClass(view, def.parent, allowPrivateServices, def.provider.value, def.provider.deps);\n        if (def.outputs.length) {\n            for (var i = 0; i < def.outputs.length; i++) {\n                var output = def.outputs[i];\n                var outputObservable = instance[output.propName];\n                if (isObservable(outputObservable)) {\n                    var subscription = outputObservable.subscribe(eventHandlerClosure(view, def.parent.nodeIndex, output.eventName));\n                    view.disposables[def.outputIndex + i] = subscription.unsubscribe.bind(subscription);\n                }\n                else {\n                    throw new Error(\"@Output \" + output.propName + \" not initialized in '\" + instance.constructor.name + \"'.\");\n                }\n            }\n        }\n        return instance;\n    }\n    function eventHandlerClosure(view, index, eventName) {\n        return function (event) { return dispatchEvent(view, index, eventName, event); };\n    }\n    function checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var providerData = asProviderData(view, def.nodeIndex);\n        var directive = providerData.instance;\n        var changed = false;\n        var changes = undefined;\n        var bindLen = def.bindings.length;\n        if (bindLen > 0 && checkBinding(view, def, 0, v0)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 0, v0, changes);\n        }\n        if (bindLen > 1 && checkBinding(view, def, 1, v1)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 1, v1, changes);\n        }\n        if (bindLen > 2 && checkBinding(view, def, 2, v2)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 2, v2, changes);\n        }\n        if (bindLen > 3 && checkBinding(view, def, 3, v3)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 3, v3, changes);\n        }\n        if (bindLen > 4 && checkBinding(view, def, 4, v4)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 4, v4, changes);\n        }\n        if (bindLen > 5 && checkBinding(view, def, 5, v5)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 5, v5, changes);\n        }\n        if (bindLen > 6 && checkBinding(view, def, 6, v6)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 6, v6, changes);\n        }\n        if (bindLen > 7 && checkBinding(view, def, 7, v7)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 7, v7, changes);\n        }\n        if (bindLen > 8 && checkBinding(view, def, 8, v8)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 8, v8, changes);\n        }\n        if (bindLen > 9 && checkBinding(view, def, 9, v9)) {\n            changed = true;\n            changes = updateProp(view, providerData, def, 9, v9, changes);\n        }\n        if (changes) {\n            directive.ngOnChanges(changes);\n        }\n        if ((def.flags & 65536 /* OnInit */) &&\n            shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {\n            directive.ngOnInit();\n        }\n        if (def.flags & 262144 /* DoCheck */) {\n            directive.ngDoCheck();\n        }\n        return changed;\n    }\n    function checkAndUpdateDirectiveDynamic(view, def, values) {\n        var providerData = asProviderData(view, def.nodeIndex);\n        var directive = providerData.instance;\n        var changed = false;\n        var changes = undefined;\n        for (var i = 0; i < values.length; i++) {\n            if (checkBinding(view, def, i, values[i])) {\n                changed = true;\n                changes = updateProp(view, providerData, def, i, values[i], changes);\n            }\n        }\n        if (changes) {\n            directive.ngOnChanges(changes);\n        }\n        if ((def.flags & 65536 /* OnInit */) &&\n            shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {\n            directive.ngOnInit();\n        }\n        if (def.flags & 262144 /* DoCheck */) {\n            directive.ngDoCheck();\n        }\n        return changed;\n    }\n    function _createProviderInstance$1(view, def) {\n        // private services can see other private services\n        var allowPrivateServices = (def.flags & 8192 /* PrivateProvider */) > 0;\n        var providerDef = def.provider;\n        switch (def.flags & 201347067 /* Types */) {\n            case 512 /* TypeClassProvider */:\n                return createClass(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);\n            case 1024 /* TypeFactoryProvider */:\n                return callFactory(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);\n            case 2048 /* TypeUseExistingProvider */:\n                return resolveDep(view, def.parent, allowPrivateServices, providerDef.deps[0]);\n            case 256 /* TypeValueProvider */:\n                return providerDef.value;\n        }\n    }\n    function createClass(view, elDef, allowPrivateServices, ctor, deps) {\n        var len = deps.length;\n        switch (len) {\n            case 0:\n                return new ctor();\n            case 1:\n                return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n            case 2:\n                return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));\n            case 3:\n                return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));\n            default:\n                var depValues = [];\n                for (var i = 0; i < len; i++) {\n                    depValues.push(resolveDep(view, elDef, allowPrivateServices, deps[i]));\n                }\n                return new (ctor.bind.apply(ctor, __spreadArray([void 0], __read(depValues))))();\n        }\n    }\n    function callFactory(view, elDef, allowPrivateServices, factory, deps) {\n        var len = deps.length;\n        switch (len) {\n            case 0:\n                return factory();\n            case 1:\n                return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n            case 2:\n                return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));\n            case 3:\n                return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));\n            default:\n                var depValues = [];\n                for (var i = 0; i < len; i++) {\n                    depValues.push(resolveDep(view, elDef, allowPrivateServices, deps[i]));\n                }\n                return factory.apply(void 0, __spreadArray([], __read(depValues)));\n        }\n    }\n    // This default value is when checking the hierarchy for a token.\n    //\n    // It means both:\n    // - the token is not provided by the current injector,\n    // - only the element injectors should be checked (ie do not check module injectors\n    //\n    //          mod1\n    //         /\n    //       el1   mod2\n    //         \\  /\n    //         el2\n    //\n    // When requesting el2.injector.get(token), we should check in the following order and return the\n    // first found value:\n    // - el2.injector.get(token, default)\n    // - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n    // - mod2.injector.get(token, default)\n    var NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n    function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue) {\n        if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n        if (depDef.flags & 8 /* Value */) {\n            return depDef.token;\n        }\n        var startView = view;\n        if (depDef.flags & 2 /* Optional */) {\n            notFoundValue = null;\n        }\n        var tokenKey = depDef.tokenKey;\n        if (tokenKey === ChangeDetectorRefTokenKey) {\n            // directives on the same element as a component should be able to control the change detector\n            // of that component as well.\n            allowPrivateServices = !!(elDef && elDef.element.componentView);\n        }\n        if (elDef && (depDef.flags & 1 /* SkipSelf */)) {\n            allowPrivateServices = false;\n            elDef = elDef.parent;\n        }\n        var searchView = view;\n        while (searchView) {\n            if (elDef) {\n                switch (tokenKey) {\n                    case Renderer2TokenKey: {\n                        var compView = findCompView(searchView, elDef, allowPrivateServices);\n                        return compView.renderer;\n                    }\n                    case ElementRefTokenKey:\n                        return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement);\n                    case ViewContainerRefTokenKey:\n                        return asElementData(searchView, elDef.nodeIndex).viewContainer;\n                    case TemplateRefTokenKey: {\n                        if (elDef.element.template) {\n                            return asElementData(searchView, elDef.nodeIndex).template;\n                        }\n                        break;\n                    }\n                    case ChangeDetectorRefTokenKey: {\n                        var cdView = findCompView(searchView, elDef, allowPrivateServices);\n                        return createChangeDetectorRef(cdView);\n                    }\n                    case InjectorRefTokenKey$1:\n                    case INJECTORRefTokenKey$1:\n                        return createInjector$1(searchView, elDef);\n                    default:\n                        var providerDef_1 = (allowPrivateServices ? elDef.element.allProviders :\n                            elDef.element.publicProviders)[tokenKey];\n                        if (providerDef_1) {\n                            var providerData = asProviderData(searchView, providerDef_1.nodeIndex);\n                            if (!providerData) {\n                                providerData = { instance: _createProviderInstance$1(searchView, providerDef_1) };\n                                searchView.nodes[providerDef_1.nodeIndex] = providerData;\n                            }\n                            return providerData.instance;\n                        }\n                }\n            }\n            allowPrivateServices = isComponentView(searchView);\n            elDef = viewParentEl(searchView);\n            searchView = searchView.parent;\n            if (depDef.flags & 4 /* Self */) {\n                searchView = null;\n            }\n        }\n        var value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n        if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n            notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n            // Return the value from the root element injector when\n            // - it provides it\n            //   (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n            // - the module injector should not be checked\n            //   (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n            return value;\n        }\n        return startView.root.ngModule.injector.get(depDef.token, notFoundValue);\n    }\n    function findCompView(view, elDef, allowPrivateServices) {\n        var compView;\n        if (allowPrivateServices) {\n            compView = asElementData(view, elDef.nodeIndex).componentView;\n        }\n        else {\n            compView = view;\n            while (compView.parent && !isComponentView(compView)) {\n                compView = compView.parent;\n            }\n        }\n        return compView;\n    }\n    function updateProp(view, providerData, def, bindingIdx, value, changes) {\n        if (def.flags & 32768 /* Component */) {\n            var compView = asElementData(view, def.parent.nodeIndex).componentView;\n            if (compView.def.flags & 2 /* OnPush */) {\n                compView.state |= 8 /* ChecksEnabled */;\n            }\n        }\n        var binding = def.bindings[bindingIdx];\n        var propName = binding.name;\n        // Note: This is still safe with Closure Compiler as\n        // the user passed in the property name as an object has to `providerDef`,\n        // so Closure Compiler will have renamed the property correctly already.\n        providerData.instance[propName] = value;\n        if (def.flags & 524288 /* OnChanges */) {\n            changes = changes || {};\n            var oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);\n            var binding_1 = def.bindings[bindingIdx];\n            changes[binding_1.nonMinifiedName] =\n                new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0);\n        }\n        view.oldValues[def.bindingIndex + bindingIdx] = value;\n        return changes;\n    }\n    // This function calls the ngAfterContentCheck, ngAfterContentInit,\n    // ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node\n    // flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are\n    // called during a pre-order traversal of the view tree (that is calling the\n    // parent hooks before the child hooks) these events are sent in using a\n    // post-order traversal of the tree (children before parents). This changes the\n    // meaning of initIndex in the view state. For ngOnInit, initIndex tracks the\n    // expected nodeIndex which a ngOnInit should be called. When sending\n    // ngAfterContentInit and ngAfterViewInit it is the expected count of\n    // ngAfterContentInit or ngAfterViewInit methods that have been called. This\n    // ensure that despite being called recursively or after picking up after an\n    // exception, the ngAfterContentInit or ngAfterViewInit will be called on the\n    // correct nodes. Consider for example, the following (where E is an element\n    // and D is a directive)\n    //  Tree:       pre-order index  post-order index\n    //    E1        0                6\n    //      E2      1                1\n    //       D3     2                0\n    //      E4      3                5\n    //       E5     4                4\n    //        E6    5                2\n    //        E7    6                3\n    // As can be seen, the post-order index has an unclear relationship to the\n    // pre-order index (postOrderIndex === preOrderIndex - parentCount +\n    // childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit\n    // are stable (will be the same for the same view regardless of exceptions or\n    // recursion) we just need to count them which will roughly correspond to the\n    // post-order index (it skips elements and directives that do not have\n    // lifecycle hooks).\n    //\n    // For example, if an exception is raised in the E6.onAfterViewInit() the\n    // initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to\n    // initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will\n    // not have their ngAfterViewInit() called but, starting with E7, the rest of\n    // the view will begin getting ngAfterViewInit() called until a check and\n    // pass is complete.\n    //\n    // This algorthim also handles recursion. Consider if E4's ngAfterViewInit()\n    // indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected\n    // initIndex is set to 6, the recusive checkAndUpdateView() starts walk again.\n    // D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1.\n    // When the recursion returns the initIndex will be 7 so E1 is skipped as it\n    // has already been called in the recursively called checkAnUpdateView().\n    function callLifecycleHooksChildrenFirst(view, lifecycles) {\n        if (!(view.def.nodeFlags & lifecycles)) {\n            return;\n        }\n        var nodes = view.def.nodes;\n        var initIndex = 0;\n        for (var i = 0; i < nodes.length; i++) {\n            var nodeDef = nodes[i];\n            var parent = nodeDef.parent;\n            if (!parent && nodeDef.flags & lifecycles) {\n                // matching root node (e.g. a pipe)\n                callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n            }\n            if ((nodeDef.childFlags & lifecycles) === 0) {\n                // no child matches one of the lifecycles\n                i += nodeDef.childCount;\n            }\n            while (parent && (parent.flags & 1 /* TypeElement */) &&\n                i === parent.nodeIndex + parent.childCount) {\n                // last child of an element\n                if (parent.directChildFlags & lifecycles) {\n                    initIndex = callElementProvidersLifecycles(view, parent, lifecycles, initIndex);\n                }\n                parent = parent.parent;\n            }\n        }\n    }\n    function callElementProvidersLifecycles(view, elDef, lifecycles, initIndex) {\n        for (var i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {\n            var nodeDef = view.def.nodes[i];\n            if (nodeDef.flags & lifecycles) {\n                callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n            }\n            // only visit direct children\n            i += nodeDef.childCount;\n        }\n        return initIndex;\n    }\n    function callProviderLifecycles(view, index, lifecycles, initIndex) {\n        var providerData = asProviderData(view, index);\n        if (!providerData) {\n            return;\n        }\n        var provider = providerData.instance;\n        if (!provider) {\n            return;\n        }\n        Services.setCurrentNode(view, index);\n        if (lifecycles & 1048576 /* AfterContentInit */ &&\n            shouldCallLifecycleInitHook(view, 512 /* InitState_CallingAfterContentInit */, initIndex)) {\n            provider.ngAfterContentInit();\n        }\n        if (lifecycles & 2097152 /* AfterContentChecked */) {\n            provider.ngAfterContentChecked();\n        }\n        if (lifecycles & 4194304 /* AfterViewInit */ &&\n            shouldCallLifecycleInitHook(view, 768 /* InitState_CallingAfterViewInit */, initIndex)) {\n            provider.ngAfterViewInit();\n        }\n        if (lifecycles & 8388608 /* AfterViewChecked */) {\n            provider.ngAfterViewChecked();\n        }\n        if (lifecycles & 131072 /* OnDestroy */) {\n            provider.ngOnDestroy();\n        }\n    }\n\n    var ComponentFactoryResolver$1 = /** @class */ (function (_super) {\n        __extends(ComponentFactoryResolver, _super);\n        /**\n         * @param ngModule The NgModuleRef to which all resolved factories are bound.\n         */\n        function ComponentFactoryResolver(ngModule) {\n            var _this = _super.call(this) || this;\n            _this.ngModule = ngModule;\n            return _this;\n        }\n        ComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {\n            ngDevMode && assertComponentType(component);\n            var componentDef = getComponentDef(component);\n            return new ComponentFactory$1(componentDef, this.ngModule);\n        };\n        return ComponentFactoryResolver;\n    }(ComponentFactoryResolver));\n    function toRefArray(map) {\n        var array = [];\n        for (var nonMinified in map) {\n            if (map.hasOwnProperty(nonMinified)) {\n                var minified = map[nonMinified];\n                array.push({ propName: minified, templateName: nonMinified });\n            }\n        }\n        return array;\n    }\n    function getNamespace$1(elementName) {\n        var name = elementName.toLowerCase();\n        return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);\n    }\n    /**\n     * A change detection scheduler token for {@link RootContext}. This token is the default value used\n     * for the default `RootContext` found in the {@link ROOT_CONTEXT} token.\n     */\n    var SCHEDULER = new InjectionToken('SCHEDULER_TOKEN', {\n        providedIn: 'root',\n        factory: function () { return defaultScheduler; },\n    });\n    function createChainedInjector(rootViewInjector, moduleInjector) {\n        return {\n            get: function (token, notFoundValue, flags) {\n                var value = rootViewInjector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);\n                if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n                    notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n                    // Return the value from the root element injector when\n                    // - it provides it\n                    //   (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n                    // - the module injector should not be checked\n                    //   (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n                    return value;\n                }\n                return moduleInjector.get(token, notFoundValue, flags);\n            }\n        };\n    }\n    /**\n     * Render3 implementation of {@link viewEngine_ComponentFactory}.\n     */\n    var ComponentFactory$1 = /** @class */ (function (_super) {\n        __extends(ComponentFactory, _super);\n        /**\n         * @param componentDef The component definition.\n         * @param ngModule The NgModuleRef to which the factory is bound.\n         */\n        function ComponentFactory(componentDef, ngModule) {\n            var _this = _super.call(this) || this;\n            _this.componentDef = componentDef;\n            _this.ngModule = ngModule;\n            _this.componentType = componentDef.type;\n            _this.selector = stringifyCSSSelectorList(componentDef.selectors);\n            _this.ngContentSelectors =\n                componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];\n            _this.isBoundToModule = !!ngModule;\n            return _this;\n        }\n        Object.defineProperty(ComponentFactory.prototype, \"inputs\", {\n            get: function () {\n                return toRefArray(this.componentDef.inputs);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ComponentFactory.prototype, \"outputs\", {\n            get: function () {\n                return toRefArray(this.componentDef.outputs);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ComponentFactory.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {\n            ngModule = ngModule || this.ngModule;\n            var rootViewInjector = ngModule ? createChainedInjector(injector, ngModule.injector) : injector;\n            var rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);\n            var sanitizer = rootViewInjector.get(Sanitizer, null);\n            var hostRenderer = rendererFactory.createRenderer(null, this.componentDef);\n            // Determine a tag name used for creating host elements when this component is created\n            // dynamically. Default to 'div' if this component did not specify any tag name in its selector.\n            var elementName = this.componentDef.selectors[0][0] || 'div';\n            var hostRNode = rootSelectorOrNode ?\n                locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :\n                createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace$1(elementName));\n            var rootFlags = this.componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :\n                16 /* CheckAlways */ | 512 /* IsRoot */;\n            var rootContext = createRootContext();\n            // Create the root view. Uses empty TView and ContentTemplate.\n            var rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);\n            var rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector);\n            // rootView is the parent when bootstrapping\n            // TODO(misko): it looks like we are entering view here but we don't really need to as\n            // `renderView` does that. However as the code is written it is needed because\n            // `createRootComponentView` and `createRootComponent` both read global state. Fixing those\n            // issues would allow us to drop this.\n            enterView(rootLView);\n            var component;\n            var tElementNode;\n            try {\n                var componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);\n                if (hostRNode) {\n                    if (rootSelectorOrNode) {\n                        setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);\n                    }\n                    else {\n                        // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`\n                        // is not defined), also apply attributes and classes extracted from component selector.\n                        // Extract attributes and classes from the first selector only to match VE behavior.\n                        var _a = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]), attrs = _a.attrs, classes = _a.classes;\n                        if (attrs) {\n                            setUpAttributes(hostRenderer, hostRNode, attrs);\n                        }\n                        if (classes && classes.length > 0) {\n                            writeDirectClass(hostRenderer, hostRNode, classes.join(' '));\n                        }\n                    }\n                }\n                tElementNode = getTNode(rootTView, HEADER_OFFSET);\n                if (projectableNodes !== undefined) {\n                    var projection = tElementNode.projection = [];\n                    for (var i = 0; i < this.ngContentSelectors.length; i++) {\n                        var nodesforSlot = projectableNodes[i];\n                        // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade\n                        // case). Here we do normalize passed data structure to be an array of arrays to avoid\n                        // complex checks down the line.\n                        // We also normalize the length of the passed in projectable nodes (to match the number of\n                        // <ng-container> slots defined by a component).\n                        projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);\n                    }\n                }\n                // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and\n                // executed here?\n                // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n                component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);\n                renderView(rootTView, rootLView, null);\n            }\n            finally {\n                leaveView();\n            }\n            return new ComponentRef$1(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);\n        };\n        return ComponentFactory;\n    }(ComponentFactory));\n    var componentFactoryResolver = new ComponentFactoryResolver$1();\n    /**\n     * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the\n     * ComponentFactoryResolver\n     * already exists, retrieves the existing ComponentFactoryResolver.\n     *\n     * @returns The ComponentFactoryResolver instance to use\n     */\n    function injectComponentFactoryResolver() {\n        return componentFactoryResolver;\n    }\n    /**\n     * Represents an instance of a Component created via a {@link ComponentFactory}.\n     *\n     * `ComponentRef` provides access to the Component Instance as well other objects related to this\n     * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n     * method.\n     *\n     */\n    var ComponentRef$1 = /** @class */ (function (_super) {\n        __extends(ComponentRef, _super);\n        function ComponentRef(componentType, instance, location, _rootLView, _tNode) {\n            var _this = _super.call(this) || this;\n            _this.location = location;\n            _this._rootLView = _rootLView;\n            _this._tNode = _tNode;\n            _this.instance = instance;\n            _this.hostView = _this.changeDetectorRef = new RootViewRef(_rootLView);\n            _this.componentType = componentType;\n            return _this;\n        }\n        Object.defineProperty(ComponentRef.prototype, \"injector\", {\n            get: function () {\n                return new NodeInjector(this._tNode, this._rootLView);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        ComponentRef.prototype.destroy = function () {\n            this.hostView.destroy();\n        };\n        ComponentRef.prototype.onDestroy = function (callback) {\n            this.hostView.onDestroy(callback);\n        };\n        return ComponentRef;\n    }(ComponentRef));\n\n    /**\n     * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n     * on the type.\n     *\n     * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n     *\n     * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments\n     * being tree-shaken away during production builds.\n     */\n    function setClassMetadata(type, decorators, ctorParameters, propDecorators) {\n        return noSideEffects(function () {\n            var _a;\n            var clazz = type;\n            if (decorators !== null) {\n                if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {\n                    (_a = clazz.decorators).push.apply(_a, __spreadArray([], __read(decorators)));\n                }\n                else {\n                    clazz.decorators = decorators;\n                }\n            }\n            if (ctorParameters !== null) {\n                // Rather than merging, clobber the existing parameters. If other projects exist which\n                // use tsickle-style annotations and reflect over them in the same way, this could\n                // cause issues, but that is vanishingly unlikely.\n                clazz.ctorParameters = ctorParameters;\n            }\n            if (propDecorators !== null) {\n                // The property decorator objects are merged as it is possible different fields have\n                // different decorator types. Decorators on individual fields are not merged, as it's\n                // also incredibly unlikely that a field will be decorated both with an Angular\n                // decorator and a non-Angular decorator that's also been downleveled.\n                if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {\n                    clazz.propDecorators = Object.assign(Object.assign({}, clazz.propDecorators), propDecorators);\n                }\n                else {\n                    clazz.propDecorators = propDecorators;\n                }\n            }\n        });\n    }\n\n    /**\n     * Map of module-id to the corresponding NgModule.\n     * - In pre Ivy we track NgModuleFactory,\n     * - In post Ivy we track the NgModuleType\n     */\n    var modules = new Map();\n    /**\n     * Registers a loaded module. Should only be called from generated NgModuleFactory code.\n     * @publicApi\n     */\n    function registerModuleFactory(id, factory) {\n        var existing = modules.get(id);\n        assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType);\n        modules.set(id, factory);\n    }\n    function assertSameOrNotExisting(id, type, incoming) {\n        if (type && type !== incoming) {\n            throw new Error(\"Duplicate module registered for \" + id + \" - \" + stringify(type) + \" vs \" + stringify(type.name));\n        }\n    }\n    function registerNgModuleType(ngModuleType) {\n        var visited = new Set();\n        recurse(ngModuleType);\n        function recurse(ngModuleType) {\n            var e_1, _a;\n            // The imports array of an NgModule must refer to other NgModules,\n            // so an error is thrown if no module definition is available.\n            var def = getNgModuleDef(ngModuleType, /* throwNotFound */ true);\n            var id = def.id;\n            if (id !== null) {\n                var existing = modules.get(id);\n                assertSameOrNotExisting(id, existing, ngModuleType);\n                modules.set(id, ngModuleType);\n            }\n            var imports = maybeUnwrapFn(def.imports);\n            try {\n                for (var imports_1 = __values(imports), imports_1_1 = imports_1.next(); !imports_1_1.done; imports_1_1 = imports_1.next()) {\n                    var i = imports_1_1.value;\n                    if (!visited.has(i)) {\n                        visited.add(i);\n                        recurse(i);\n                    }\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (imports_1_1 && !imports_1_1.done && (_a = imports_1.return)) _a.call(imports_1);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n        }\n    }\n    function clearModulesForTest() {\n        modules.clear();\n    }\n    function getRegisteredNgModuleType(id) {\n        return modules.get(id) || autoRegisterModuleById[id];\n    }\n\n    var NgModuleRef$1 = /** @class */ (function (_super) {\n        __extends(NgModuleRef$1, _super);\n        function NgModuleRef$1(ngModuleType, _parent) {\n            var _this = _super.call(this) || this;\n            _this._parent = _parent;\n            // tslint:disable-next-line:require-internal-with-underscore\n            _this._bootstrapComponents = [];\n            _this.injector = _this;\n            _this.destroyCbs = [];\n            // When bootstrapping a module we have a dependency graph that looks like this:\n            // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the\n            // module being resolved tries to inject the ComponentFactoryResolver, it'll create a\n            // circular dependency which will result in a runtime error, because the injector doesn't\n            // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves\n            // and providing it, rather than letting the injector resolve it.\n            _this.componentFactoryResolver = new ComponentFactoryResolver$1(_this);\n            var ngModuleDef = getNgModuleDef(ngModuleType);\n            ngDevMode &&\n                assertDefined(ngModuleDef, \"NgModule '\" + stringify(ngModuleType) + \"' is not a subtype of 'NgModuleType'.\");\n            var ngLocaleIdDef = getNgLocaleIdDef(ngModuleType);\n            ngLocaleIdDef && setLocaleId(ngLocaleIdDef);\n            _this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);\n            _this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [\n                { provide: NgModuleRef, useValue: _this }, {\n                    provide: ComponentFactoryResolver,\n                    useValue: _this.componentFactoryResolver\n                }\n            ], stringify(ngModuleType));\n            // We need to resolve the injector types separately from the injector creation, because\n            // the module might be trying to use this ref in its contructor for DI which will cause a\n            // circular error that will eventually error out, because the injector isn't created yet.\n            _this._r3Injector._resolveInjectorDefTypes();\n            _this.instance = _this.get(ngModuleType);\n            return _this;\n        }\n        NgModuleRef$1.prototype.get = function (token, notFoundValue, injectFlags) {\n            if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n            if (injectFlags === void 0) { injectFlags = exports.InjectFlags.Default; }\n            if (token === Injector || token === NgModuleRef || token === INJECTOR$1) {\n                return this;\n            }\n            return this._r3Injector.get(token, notFoundValue, injectFlags);\n        };\n        NgModuleRef$1.prototype.destroy = function () {\n            ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n            var injector = this._r3Injector;\n            !injector.destroyed && injector.destroy();\n            this.destroyCbs.forEach(function (fn) { return fn(); });\n            this.destroyCbs = null;\n        };\n        NgModuleRef$1.prototype.onDestroy = function (callback) {\n            ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n            this.destroyCbs.push(callback);\n        };\n        return NgModuleRef$1;\n    }(NgModuleRef));\n    var NgModuleFactory$1 = /** @class */ (function (_super) {\n        __extends(NgModuleFactory, _super);\n        function NgModuleFactory(moduleType) {\n            var _this = _super.call(this) || this;\n            _this.moduleType = moduleType;\n            var ngModuleDef = getNgModuleDef(moduleType);\n            if (ngModuleDef !== null) {\n                // Register the NgModule with Angular's module registry. The location (and hence timing) of\n                // this call is critical to ensure this works correctly (modules get registered when expected)\n                // without bloating bundles (modules are registered when otherwise not referenced).\n                //\n                // In View Engine, registration occurs in the .ngfactory.js file as a side effect. This has\n                // several practical consequences:\n                //\n                // - If an .ngfactory file is not imported from, the module won't be registered (and can be\n                //   tree shaken).\n                // - If an .ngfactory file is imported from, the module will be registered even if an instance\n                //   is not actually created (via `create` below).\n                // - Since an .ngfactory file in View Engine references the .ngfactory files of the NgModule's\n                //   imports,\n                //\n                // In Ivy, things are a bit different. .ngfactory files still exist for compatibility, but are\n                // not a required API to use - there are other ways to obtain an NgModuleFactory for a given\n                // NgModule. Thus, relying on a side effect in the .ngfactory file is not sufficient. Instead,\n                // the side effect of registration is added here, in the constructor of NgModuleFactory,\n                // ensuring no matter how a factory is created, the module is registered correctly.\n                //\n                // An alternative would be to include the registration side effect inline following the actual\n                // NgModule definition. This also has the correct timing, but breaks tree-shaking - modules\n                // will be registered and retained even if they're otherwise never referenced.\n                registerNgModuleType(moduleType);\n            }\n            return _this;\n        }\n        NgModuleFactory.prototype.create = function (parentInjector) {\n            return new NgModuleRef$1(this.moduleType, parentInjector);\n        };\n        return NgModuleFactory;\n    }(NgModuleFactory));\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Bindings for pure functions are stored after regular bindings.\n     *\n     * |-------decls------|---------vars---------|                 |----- hostVars (dir1) ------|\n     * ------------------------------------------------------------------------------------------\n     * | nodes/refs/pipes | bindings | fn slots  | injector | dir1 | host bindings | host slots |\n     * ------------------------------------------------------------------------------------------\n     *                    ^                      ^\n     *      TView.bindingStartIndex      TView.expandoStartIndex\n     *\n     * Pure function instructions are given an offset from the binding root. Adding the offset to the\n     * binding root gives the first index where the bindings are stored. In component views, the binding\n     * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n     * any directive instances + any hostVars in directives evaluated before it.\n     *\n     * See VIEW_DATA.md for more information about host binding resolution.\n     */\n    /**\n     * If the value hasn't been saved, calls the pure function to store and return the\n     * value. If it has been saved, returns the saved value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn Function that returns a value\n     * @param thisArg Optional calling context of pureFn\n     * @returns value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction0(slotOffset, pureFn, thisArg) {\n        var bindingIndex = getBindingRoot() + slotOffset;\n        var lView = getLView();\n        return lView[bindingIndex] === NO_CHANGE ?\n            updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) :\n            getBinding(lView, bindingIndex);\n    }\n    /**\n     * If the value of the provided exp has changed, calls the pure function to return\n     * an updated value. Or if the value has not changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn Function that returns an updated value\n     * @param exp Updated expression value\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) {\n        return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {\n        return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n        return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param exp4\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n        return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param exp4\n     * @param exp5\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {\n        var bindingIndex = getBindingRoot() + slotOffset;\n        var lView = getLView();\n        var different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n        return bindingUpdated(lView, bindingIndex + 4, exp5) || different ?\n            updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :\n                pureFn(exp1, exp2, exp3, exp4, exp5)) :\n            getBinding(lView, bindingIndex + 5);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param exp4\n     * @param exp5\n     * @param exp6\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n        var bindingIndex = getBindingRoot() + slotOffset;\n        var lView = getLView();\n        var different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n        return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n            updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n                pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n            getBinding(lView, bindingIndex + 6);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param exp4\n     * @param exp5\n     * @param exp6\n     * @param exp7\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {\n        var bindingIndex = getBindingRoot() + slotOffset;\n        var lView = getLView();\n        var different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n        return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ?\n            updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :\n                pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :\n            getBinding(lView, bindingIndex + 7);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param exp4\n     * @param exp5\n     * @param exp6\n     * @param exp7\n     * @param exp8\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {\n        var bindingIndex = getBindingRoot() + slotOffset;\n        var lView = getLView();\n        var different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n        return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ?\n            updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :\n                pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :\n            getBinding(lView, bindingIndex + 8);\n    }\n    /**\n     * pureFunction instruction that can support any number of bindings.\n     *\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn A pure function that takes binding values and builds an object or array\n     * containing those values.\n     * @param exps An array of binding values\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     * @codeGenApi\n     */\n    function ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {\n        return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);\n    }\n    /**\n     * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized\n     * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first\n     * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE\n     * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert\n     * it to `undefined`.\n     */\n    function getPureFunctionReturnValue(lView, returnValueIndex) {\n        ngDevMode && assertIndexInRange(lView, returnValueIndex);\n        var lastReturnValue = lView[returnValueIndex];\n        return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;\n    }\n    /**\n     * If the value of the provided exp has changed, calls the pure function to return\n     * an updated value. Or if the value has not changed, returns cached value.\n     *\n     * @param lView LView in which the function is being executed.\n     * @param bindingRoot Binding root index.\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn Function that returns an updated value\n     * @param exp Updated expression value\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     */\n    function pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {\n        var bindingIndex = bindingRoot + slotOffset;\n        return bindingUpdated(lView, bindingIndex, exp) ?\n            updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :\n            getPureFunctionReturnValue(lView, bindingIndex + 1);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param lView LView in which the function is being executed.\n     * @param bindingRoot Binding root index.\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     */\n    function pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {\n        var bindingIndex = bindingRoot + slotOffset;\n        return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?\n            updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :\n            getPureFunctionReturnValue(lView, bindingIndex + 2);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param lView LView in which the function is being executed.\n     * @param bindingRoot Binding root index.\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     */\n    function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n        var bindingIndex = bindingRoot + slotOffset;\n        return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n            updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n            getPureFunctionReturnValue(lView, bindingIndex + 3);\n    }\n    /**\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param lView LView in which the function is being executed.\n     * @param bindingRoot Binding root index.\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn\n     * @param exp1\n     * @param exp2\n     * @param exp3\n     * @param exp4\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     *\n     */\n    function pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n        var bindingIndex = bindingRoot + slotOffset;\n        return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?\n            updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :\n            getPureFunctionReturnValue(lView, bindingIndex + 4);\n    }\n    /**\n     * pureFunction instruction that can support any number of bindings.\n     *\n     * If the value of any provided exp has changed, calls the pure function to return\n     * an updated value. Or if no values have changed, returns cached value.\n     *\n     * @param lView LView in which the function is being executed.\n     * @param bindingRoot Binding root index.\n     * @param slotOffset the offset from binding root to the reserved slot\n     * @param pureFn A pure function that takes binding values and builds an object or array\n     * containing those values.\n     * @param exps An array of binding values\n     * @param thisArg Optional calling context of pureFn\n     * @returns Updated or cached value\n     */\n    function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {\n        var bindingIndex = bindingRoot + slotOffset;\n        var different = false;\n        for (var i = 0; i < exps.length; i++) {\n            bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n        }\n        return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :\n            getPureFunctionReturnValue(lView, bindingIndex);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Create a pipe.\n     *\n     * @param index Pipe index where the pipe will be stored.\n     * @param pipeName The name of the pipe\n     * @returns T the instance of the pipe.\n     *\n     * @codeGenApi\n     */\n    function ɵɵpipe(index, pipeName) {\n        var tView = getTView();\n        var pipeDef;\n        var adjustedIndex = index + HEADER_OFFSET;\n        if (tView.firstCreatePass) {\n            pipeDef = getPipeDef$1(pipeName, tView.pipeRegistry);\n            tView.data[adjustedIndex] = pipeDef;\n            if (pipeDef.onDestroy) {\n                (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);\n            }\n        }\n        else {\n            pipeDef = tView.data[adjustedIndex];\n        }\n        var pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));\n        var previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);\n        try {\n            // DI for pipes is supposed to behave like directives when placed on a component\n            // host node, which means that we have to disable access to `viewProviders`.\n            var previousIncludeViewProviders = setIncludeViewProviders(false);\n            var pipeInstance = pipeFactory();\n            setIncludeViewProviders(previousIncludeViewProviders);\n            store(tView, getLView(), adjustedIndex, pipeInstance);\n            return pipeInstance;\n        }\n        finally {\n            // we have to restore the injector implementation in finally, just in case the creation of the\n            // pipe throws an error.\n            setInjectImplementation(previousInjectImplementation);\n        }\n    }\n    /**\n     * Searches the pipe registry for a pipe with the given name. If one is found,\n     * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n     *\n     * @param name Name of pipe to resolve\n     * @param registry Full list of available pipes\n     * @returns Matching PipeDef\n     */\n    function getPipeDef$1(name, registry) {\n        if (registry) {\n            for (var i = registry.length - 1; i >= 0; i--) {\n                var pipeDef = registry[i];\n                if (name === pipeDef.name) {\n                    return pipeDef;\n                }\n            }\n        }\n        throw new RuntimeError(\"302\" /* PIPE_NOT_FOUND */, \"The pipe '\" + name + \"' could not be found!\");\n    }\n    /**\n     * Invokes a pipe with 1 arguments.\n     *\n     * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n     * the pipe only when an input to the pipe changes.\n     *\n     * @param index Pipe index where the pipe was stored on creation.\n     * @param slotOffset the offset in the reserved slot space\n     * @param v1 1st argument to {@link PipeTransform#transform}.\n     *\n     * @codeGenApi\n     */\n    function ɵɵpipeBind1(index, slotOffset, v1) {\n        var adjustedIndex = index + HEADER_OFFSET;\n        var lView = getLView();\n        var pipeInstance = load(lView, adjustedIndex);\n        return unwrapValue$1(lView, isPure(lView, adjustedIndex) ?\n            pureFunction1Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, pipeInstance) :\n            pipeInstance.transform(v1));\n    }\n    /**\n     * Invokes a pipe with 2 arguments.\n     *\n     * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n     * the pipe only when an input to the pipe changes.\n     *\n     * @param index Pipe index where the pipe was stored on creation.\n     * @param slotOffset the offset in the reserved slot space\n     * @param v1 1st argument to {@link PipeTransform#transform}.\n     * @param v2 2nd argument to {@link PipeTransform#transform}.\n     *\n     * @codeGenApi\n     */\n    function ɵɵpipeBind2(index, slotOffset, v1, v2) {\n        var adjustedIndex = index + HEADER_OFFSET;\n        var lView = getLView();\n        var pipeInstance = load(lView, adjustedIndex);\n        return unwrapValue$1(lView, isPure(lView, adjustedIndex) ?\n            pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :\n            pipeInstance.transform(v1, v2));\n    }\n    /**\n     * Invokes a pipe with 3 arguments.\n     *\n     * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n     * the pipe only when an input to the pipe changes.\n     *\n     * @param index Pipe index where the pipe was stored on creation.\n     * @param slotOffset the offset in the reserved slot space\n     * @param v1 1st argument to {@link PipeTransform#transform}.\n     * @param v2 2nd argument to {@link PipeTransform#transform}.\n     * @param v3 4rd argument to {@link PipeTransform#transform}.\n     *\n     * @codeGenApi\n     */\n    function ɵɵpipeBind3(index, slotOffset, v1, v2, v3) {\n        var adjustedIndex = index + HEADER_OFFSET;\n        var lView = getLView();\n        var pipeInstance = load(lView, adjustedIndex);\n        return unwrapValue$1(lView, isPure(lView, adjustedIndex) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :\n            pipeInstance.transform(v1, v2, v3));\n    }\n    /**\n     * Invokes a pipe with 4 arguments.\n     *\n     * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n     * the pipe only when an input to the pipe changes.\n     *\n     * @param index Pipe index where the pipe was stored on creation.\n     * @param slotOffset the offset in the reserved slot space\n     * @param v1 1st argument to {@link PipeTransform#transform}.\n     * @param v2 2nd argument to {@link PipeTransform#transform}.\n     * @param v3 3rd argument to {@link PipeTransform#transform}.\n     * @param v4 4th argument to {@link PipeTransform#transform}.\n     *\n     * @codeGenApi\n     */\n    function ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) {\n        var adjustedIndex = index + HEADER_OFFSET;\n        var lView = getLView();\n        var pipeInstance = load(lView, adjustedIndex);\n        return unwrapValue$1(lView, isPure(lView, adjustedIndex) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :\n            pipeInstance.transform(v1, v2, v3, v4));\n    }\n    /**\n     * Invokes a pipe with variable number of arguments.\n     *\n     * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n     * the pipe only when an input to the pipe changes.\n     *\n     * @param index Pipe index where the pipe was stored on creation.\n     * @param slotOffset the offset in the reserved slot space\n     * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n     *\n     * @codeGenApi\n     */\n    function ɵɵpipeBindV(index, slotOffset, values) {\n        var adjustedIndex = index + HEADER_OFFSET;\n        var lView = getLView();\n        var pipeInstance = load(lView, adjustedIndex);\n        return unwrapValue$1(lView, isPure(lView, adjustedIndex) ?\n            pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) :\n            pipeInstance.transform.apply(pipeInstance, values));\n    }\n    function isPure(lView, index) {\n        return lView[TVIEW].data[index].pure;\n    }\n    /**\n     * Unwrap the output of a pipe transformation.\n     * In order to trick change detection into considering that the new value is always different from\n     * the old one, the old value is overwritten by NO_CHANGE.\n     *\n     * @param newValue the pipe transformation output.\n     */\n    function unwrapValue$1(lView, newValue) {\n        if (WrappedValue.isWrapped(newValue)) {\n            newValue = WrappedValue.unwrap(newValue);\n            // The NO_CHANGE value needs to be written at the index where the impacted binding value is\n            // stored\n            var bindingToInvalidateIdx = getBindingIndex();\n            lView[bindingToInvalidateIdx] = NO_CHANGE;\n        }\n        return newValue;\n    }\n\n    var EventEmitter_ = /** @class */ (function (_super) {\n        __extends(EventEmitter_, _super);\n        function EventEmitter_(isAsync) {\n            if (isAsync === void 0) { isAsync = false; }\n            var _this = _super.call(this) || this;\n            _this.__isAsync = isAsync;\n            return _this;\n        }\n        EventEmitter_.prototype.emit = function (value) {\n            _super.prototype.next.call(this, value);\n        };\n        EventEmitter_.prototype.subscribe = function (observerOrNext, error, complete) {\n            var _a, _b, _c;\n            var nextFn = observerOrNext;\n            var errorFn = error || (function () { return null; });\n            var completeFn = complete;\n            if (observerOrNext && typeof observerOrNext === 'object') {\n                var observer = observerOrNext;\n                nextFn = (_a = observer.next) === null || _a === void 0 ? void 0 : _a.bind(observer);\n                errorFn = (_b = observer.error) === null || _b === void 0 ? void 0 : _b.bind(observer);\n                completeFn = (_c = observer.complete) === null || _c === void 0 ? void 0 : _c.bind(observer);\n            }\n            if (this.__isAsync) {\n                errorFn = _wrapInTimeout(errorFn);\n                if (nextFn) {\n                    nextFn = _wrapInTimeout(nextFn);\n                }\n                if (completeFn) {\n                    completeFn = _wrapInTimeout(completeFn);\n                }\n            }\n            var sink = _super.prototype.subscribe.call(this, { next: nextFn, error: errorFn, complete: completeFn });\n            if (observerOrNext instanceof rxjs.Subscription) {\n                observerOrNext.add(sink);\n            }\n            return sink;\n        };\n        return EventEmitter_;\n    }(rxjs.Subject));\n    function _wrapInTimeout(fn) {\n        return function (value) {\n            setTimeout(fn, undefined, value);\n        };\n    }\n    /**\n     * @publicApi\n     */\n    var EventEmitter = EventEmitter_;\n\n    /**\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://angular.io/license\n     */\n    function symbolIterator() {\n        return this._results[getSymbolIterator()]();\n    }\n    /**\n     * An unmodifiable list of items that Angular keeps up to date when the state\n     * of the application changes.\n     *\n     * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n     * provide.\n     *\n     * Implements an iterable interface, therefore it can be used in both ES6\n     * javascript `for (var i of items)` loops as well as in Angular templates with\n     * `*ngFor=\"let i of myList\"`.\n     *\n     * Changes can be observed by subscribing to the changes `Observable`.\n     *\n     * NOTE: In the future this class will implement an `Observable` interface.\n     *\n     * @usageNotes\n     * ### Example\n     * ```typescript\n     * @Component({...})\n     * class Container {\n     *   @ViewChildren(Item) items:QueryList<Item>;\n     * }\n     * ```\n     *\n     * @publicApi\n     */\n    var QueryList = /** @class */ (function () {\n        /**\n         * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n         *     has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n         *     the same result)\n         */\n        function QueryList(_emitDistinctChangesOnly) {\n            if (_emitDistinctChangesOnly === void 0) { _emitDistinctChangesOnly = false; }\n            this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n            this.dirty = true;\n            this._results = [];\n            this._changesDetected = false;\n            this._changes = null;\n            this.length = 0;\n            this.first = undefined;\n            this.last = undefined;\n            // This function should be declared on the prototype, but doing so there will cause the class\n            // declaration to have side-effects and become not tree-shakable. For this reason we do it in\n            // the constructor.\n            // [getSymbolIterator()](): Iterator<T> { ... }\n            var symbol = getSymbolIterator();\n            var proto = QueryList.prototype;\n            if (!proto[symbol])\n                proto[symbol] = symbolIterator;\n        }\n        Object.defineProperty(QueryList.prototype, \"changes\", {\n            /**\n             * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n             */\n            get: function () {\n                return this._changes || (this._changes = new EventEmitter());\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Returns the QueryList entry at `index`.\n         */\n        QueryList.prototype.get = function (index) {\n            return this._results[index];\n        };\n        /**\n         * See\n         * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n         */\n        QueryList.prototype.map = function (fn) {\n            return this._results.map(fn);\n        };\n        /**\n         * See\n         * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n         */\n        QueryList.prototype.filter = function (fn) {\n            return this._results.filter(fn);\n        };\n        /**\n         * See\n         * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n         */\n        QueryList.prototype.find = function (fn) {\n            return this._results.find(fn);\n        };\n        /**\n         * See\n         * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n         */\n        QueryList.prototype.reduce = function (fn, init) {\n            return this._results.reduce(fn, init);\n        };\n        /**\n         * See\n         * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n         */\n        QueryList.prototype.forEach = function (fn) {\n            this._results.forEach(fn);\n        };\n        /**\n         * See\n         * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n         */\n        QueryList.prototype.some = function (fn) {\n            return this._results.some(fn);\n        };\n        /**\n         * Returns a copy of the internal results list as an Array.\n         */\n        QueryList.prototype.toArray = function () {\n            return this._results.slice();\n        };\n        QueryList.prototype.toString = function () {\n            return this._results.toString();\n        };\n        /**\n         * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n         * on change detection, it will not notify of changes to the queries, unless a new change\n         * occurs.\n         *\n         * @param resultsTree The query results to store\n         * @param identityAccessor Optional function for extracting stable object identity from a value\n         *    in the array. This function is executed for each element of the query result list while\n         *    comparing current query list with the new one (provided as a first argument of the `reset`\n         *    function) to detect if the lists are different. If the function is not provided, elements\n         *    are compared as is (without any pre-processing).\n         */\n        QueryList.prototype.reset = function (resultsTree, identityAccessor) {\n            // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n            // QueryList (but not for QueryList itself.)\n            var self = this;\n            self.dirty = false;\n            var newResultFlat = flatten(resultsTree);\n            if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n                self._results = newResultFlat;\n                self.length = newResultFlat.length;\n                self.last = newResultFlat[this.length - 1];\n                self.first = newResultFlat[0];\n            }\n        };\n        /**\n         * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n         */\n        QueryList.prototype.notifyOnChanges = function () {\n            if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))\n                this._changes.emit(this);\n        };\n        /** internal */\n        QueryList.prototype.setDirty = function () {\n            this.dirty = true;\n        };\n        /** internal */\n        QueryList.prototype.destroy = function () {\n            this.changes.complete();\n            this.changes.unsubscribe();\n        };\n        return QueryList;\n    }());\n    Symbol.iterator;\n\n    /**\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://angular.io/license\n     */\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$7 = 1;\n\n    /**\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://angular.io/license\n     */\n    // Note: This hack is necessary so we don't erroneously get a circular dependency\n    // failure based on types.\n    var unusedValueExportToPlacateAjd$8 = 1;\n\n    /**\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://angular.io/license\n     */\n    var unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8;\n    var LQuery_ = /** @class */ (function () {\n        function LQuery_(queryList) {\n            this.queryList = queryList;\n            this.matches = null;\n        }\n        LQuery_.prototype.clone = function () {\n            return new LQuery_(this.queryList);\n        };\n        LQuery_.prototype.setDirty = function () {\n            this.queryList.setDirty();\n        };\n        return LQuery_;\n    }());\n    var LQueries_ = /** @class */ (function () {\n        function LQueries_(queries) {\n            if (queries === void 0) { queries = []; }\n            this.queries = queries;\n        }\n        LQueries_.prototype.createEmbeddedView = function (tView) {\n            var tQueries = tView.queries;\n            if (tQueries !== null) {\n                var noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;\n                var viewLQueries = [];\n                // An embedded view has queries propagated from a declaration view at the beginning of the\n                // TQueries collection and up until a first content query declared in the embedded view. Only\n                // propagated LQueries are created at this point (LQuery corresponding to declared content\n                // queries will be instantiated from the content query instructions for each directive).\n                for (var i = 0; i < noOfInheritedQueries; i++) {\n                    var tQuery = tQueries.getByIndex(i);\n                    var parentLQuery = this.queries[tQuery.indexInDeclarationView];\n                    viewLQueries.push(parentLQuery.clone());\n                }\n                return new LQueries_(viewLQueries);\n            }\n            return null;\n        };\n        LQueries_.prototype.insertView = function (tView) {\n            this.dirtyQueriesWithMatches(tView);\n        };\n        LQueries_.prototype.detachView = function (tView) {\n            this.dirtyQueriesWithMatches(tView);\n        };\n        LQueries_.prototype.dirtyQueriesWithMatches = function (tView) {\n            for (var i = 0; i < this.queries.length; i++) {\n                if (getTQuery(tView, i).matches !== null) {\n                    this.queries[i].setDirty();\n                }\n            }\n        };\n        return LQueries_;\n    }());\n    var TQueryMetadata_ = /** @class */ (function () {\n        function TQueryMetadata_(predicate, flags, read) {\n            if (read === void 0) { read = null; }\n            this.predicate = predicate;\n            this.flags = flags;\n            this.read = read;\n        }\n        return TQueryMetadata_;\n    }());\n    var TQueries_ = /** @class */ (function () {\n        function TQueries_(queries) {\n            if (queries === void 0) { queries = []; }\n            this.queries = queries;\n        }\n        TQueries_.prototype.elementStart = function (tView, tNode) {\n            ngDevMode &&\n                assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n            for (var i = 0; i < this.queries.length; i++) {\n                this.queries[i].elementStart(tView, tNode);\n            }\n        };\n        TQueries_.prototype.elementEnd = function (tNode) {\n            for (var i = 0; i < this.queries.length; i++) {\n                this.queries[i].elementEnd(tNode);\n            }\n        };\n        TQueries_.prototype.embeddedTView = function (tNode) {\n            var queriesForTemplateRef = null;\n            for (var i = 0; i < this.length; i++) {\n                var childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;\n                var tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);\n                if (tqueryClone) {\n                    tqueryClone.indexInDeclarationView = i;\n                    if (queriesForTemplateRef !== null) {\n                        queriesForTemplateRef.push(tqueryClone);\n                    }\n                    else {\n                        queriesForTemplateRef = [tqueryClone];\n                    }\n                }\n            }\n            return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null;\n        };\n        TQueries_.prototype.template = function (tView, tNode) {\n            ngDevMode &&\n                assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n            for (var i = 0; i < this.queries.length; i++) {\n                this.queries[i].template(tView, tNode);\n            }\n        };\n        TQueries_.prototype.getByIndex = function (index) {\n            ngDevMode && assertIndexInRange(this.queries, index);\n            return this.queries[index];\n        };\n        Object.defineProperty(TQueries_.prototype, \"length\", {\n            get: function () {\n                return this.queries.length;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        TQueries_.prototype.track = function (tquery) {\n            this.queries.push(tquery);\n        };\n        return TQueries_;\n    }());\n    var TQuery_ = /** @class */ (function () {\n        function TQuery_(metadata, nodeIndex) {\n            if (nodeIndex === void 0) { nodeIndex = -1; }\n            this.metadata = metadata;\n            this.matches = null;\n            this.indexInDeclarationView = -1;\n            this.crossesNgTemplate = false;\n            /**\n             * A flag indicating if a given query still applies to nodes it is crossing. We use this flag\n             * (alongside with _declarationNodeIndex) to know when to stop applying content queries to\n             * elements in a template.\n             */\n            this._appliesToNextNode = true;\n            this._declarationNodeIndex = nodeIndex;\n        }\n        TQuery_.prototype.elementStart = function (tView, tNode) {\n            if (this.isApplyingToNode(tNode)) {\n                this.matchTNode(tView, tNode);\n            }\n        };\n        TQuery_.prototype.elementEnd = function (tNode) {\n            if (this._declarationNodeIndex === tNode.index) {\n                this._appliesToNextNode = false;\n            }\n        };\n        TQuery_.prototype.template = function (tView, tNode) {\n            this.elementStart(tView, tNode);\n        };\n        TQuery_.prototype.embeddedTView = function (tNode, childQueryIndex) {\n            if (this.isApplyingToNode(tNode)) {\n                this.crossesNgTemplate = true;\n                // A marker indicating a `<ng-template>` element (a placeholder for query results from\n                // embedded views created based on this `<ng-template>`).\n                this.addMatch(-tNode.index, childQueryIndex);\n                return new TQuery_(this.metadata);\n            }\n            return null;\n        };\n        TQuery_.prototype.isApplyingToNode = function (tNode) {\n            if (this._appliesToNextNode &&\n                (this.metadata.flags & 1 /* descendants */) !== 1 /* descendants */) {\n                var declarationNodeIdx = this._declarationNodeIndex;\n                var parent = tNode.parent;\n                // Determine if a given TNode is a \"direct\" child of a node on which a content query was\n                // declared (only direct children of query's host node can match with the descendants: false\n                // option). There are 3 main use-case / conditions to consider here:\n                // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query\n                // host node;\n                // - <needs-target><ng-template [ngIf]=\"true\"><i #target></i></ng-template></needs-target>:\n                // here <i #target> parent node is null;\n                // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need\n                // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse\n                // up past the query's host node!).\n                while (parent !== null && (parent.type & 8 /* ElementContainer */) &&\n                    parent.index !== declarationNodeIdx) {\n                    parent = parent.parent;\n                }\n                return declarationNodeIdx === (parent !== null ? parent.index : -1);\n            }\n            return this._appliesToNextNode;\n        };\n        TQuery_.prototype.matchTNode = function (tView, tNode) {\n            var predicate = this.metadata.predicate;\n            if (Array.isArray(predicate)) {\n                for (var i = 0; i < predicate.length; i++) {\n                    var name = predicate[i];\n                    this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));\n                    // Also try matching the name to a provider since strings can be used as DI tokens too.\n                    this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));\n                }\n            }\n            else {\n                if (predicate === TemplateRef) {\n                    if (tNode.type & 4 /* Container */) {\n                        this.matchTNodeWithReadOption(tView, tNode, -1);\n                    }\n                }\n                else {\n                    this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));\n                }\n            }\n        };\n        TQuery_.prototype.matchTNodeWithReadOption = function (tView, tNode, nodeMatchIdx) {\n            if (nodeMatchIdx !== null) {\n                var read = this.metadata.read;\n                if (read !== null) {\n                    if (read === ElementRef || read === ViewContainerRef ||\n                        read === TemplateRef && (tNode.type & 4 /* Container */)) {\n                        this.addMatch(tNode.index, -2);\n                    }\n                    else {\n                        var directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);\n                        if (directiveOrProviderIdx !== null) {\n                            this.addMatch(tNode.index, directiveOrProviderIdx);\n                        }\n                    }\n                }\n                else {\n                    this.addMatch(tNode.index, nodeMatchIdx);\n                }\n            }\n        };\n        TQuery_.prototype.addMatch = function (tNodeIdx, matchIdx) {\n            if (this.matches === null) {\n                this.matches = [tNodeIdx, matchIdx];\n            }\n            else {\n                this.matches.push(tNodeIdx, matchIdx);\n            }\n        };\n        return TQuery_;\n    }());\n    /**\n     * Iterates over local names for a given node and returns directive index\n     * (or -1 if a local name points to an element).\n     *\n     * @param tNode static data of a node to check\n     * @param selector selector to match\n     * @returns directive index, -1 or null if a selector didn't match any of the local names\n     */\n    function getIdxOfMatchingSelector(tNode, selector) {\n        var localNames = tNode.localNames;\n        if (localNames !== null) {\n            for (var i = 0; i < localNames.length; i += 2) {\n                if (localNames[i] === selector) {\n                    return localNames[i + 1];\n                }\n            }\n        }\n        return null;\n    }\n    function createResultByTNodeType(tNode, currentView) {\n        if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {\n            return createElementRef(tNode, currentView);\n        }\n        else if (tNode.type & 4 /* Container */) {\n            return createTemplateRef(tNode, currentView);\n        }\n        return null;\n    }\n    function createResultForNode(lView, tNode, matchingIdx, read) {\n        if (matchingIdx === -1) {\n            // if read token and / or strategy is not specified, detect it using appropriate tNode type\n            return createResultByTNodeType(tNode, lView);\n        }\n        else if (matchingIdx === -2) {\n            // read a special token from a node injector\n            return createSpecialToken(lView, tNode, read);\n        }\n        else {\n            // read a token\n            return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);\n        }\n    }\n    function createSpecialToken(lView, tNode, read) {\n        if (read === ElementRef) {\n            return createElementRef(tNode, lView);\n        }\n        else if (read === TemplateRef) {\n            return createTemplateRef(tNode, lView);\n        }\n        else if (read === ViewContainerRef) {\n            ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n            return createContainerRef(tNode, lView);\n        }\n        else {\n            ngDevMode &&\n                throwError(\"Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got \" + stringify(read) + \".\");\n        }\n    }\n    /**\n     * A helper function that creates query results for a given view. This function is meant to do the\n     * processing once and only once for a given view instance (a set of results for a given view\n     * doesn't change).\n     */\n    function materializeViewResults(tView, lView, tQuery, queryIndex) {\n        var lQuery = lView[QUERIES].queries[queryIndex];\n        if (lQuery.matches === null) {\n            var tViewData = tView.data;\n            var tQueryMatches = tQuery.matches;\n            var result = [];\n            for (var i = 0; i < tQueryMatches.length; i += 2) {\n                var matchedNodeIdx = tQueryMatches[i];\n                if (matchedNodeIdx < 0) {\n                    // we at the <ng-template> marker which might have results in views created based on this\n                    // <ng-template> - those results will be in separate views though, so here we just leave\n                    // null as a placeholder\n                    result.push(null);\n                }\n                else {\n                    ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);\n                    var tNode = tViewData[matchedNodeIdx];\n                    result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));\n                }\n            }\n            lQuery.matches = result;\n        }\n        return lQuery.matches;\n    }\n    /**\n     * A helper function that collects (already materialized) query results from a tree of views,\n     * starting with a provided LView.\n     */\n    function collectQueryResults(tView, lView, queryIndex, result) {\n        var tQuery = tView.queries.getByIndex(queryIndex);\n        var tQueryMatches = tQuery.matches;\n        if (tQueryMatches !== null) {\n            var lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);\n            for (var i = 0; i < tQueryMatches.length; i += 2) {\n                var tNodeIdx = tQueryMatches[i];\n                if (tNodeIdx > 0) {\n                    result.push(lViewResults[i / 2]);\n                }\n                else {\n                    var childQueryIndex = tQueryMatches[i + 1];\n                    var declarationLContainer = lView[-tNodeIdx];\n                    ngDevMode && assertLContainer(declarationLContainer);\n                    // collect matches for views inserted in this container\n                    for (var i_1 = CONTAINER_HEADER_OFFSET; i_1 < declarationLContainer.length; i_1++) {\n                        var embeddedLView = declarationLContainer[i_1];\n                        if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {\n                            collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n                        }\n                    }\n                    // collect matches for views created from this declaration container and inserted into\n                    // different containers\n                    if (declarationLContainer[MOVED_VIEWS] !== null) {\n                        var embeddedLViews = declarationLContainer[MOVED_VIEWS];\n                        for (var i_2 = 0; i_2 < embeddedLViews.length; i_2++) {\n                            var embeddedLView = embeddedLViews[i_2];\n                            collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n                        }\n                    }\n                }\n            }\n        }\n        return result;\n    }\n    /**\n     * Refreshes a query by combining matches from all active views and removing matches from deleted\n     * views.\n     *\n     * @returns `true` if a query got dirty during change detection or if this is a static query\n     * resolving in creation mode, `false` otherwise.\n     *\n     * @codeGenApi\n     */\n    function ɵɵqueryRefresh(queryList) {\n        var lView = getLView();\n        var tView = getTView();\n        var queryIndex = getCurrentQueryIndex();\n        setCurrentQueryIndex(queryIndex + 1);\n        var tQuery = getTQuery(tView, queryIndex);\n        if (queryList.dirty &&\n            (isCreationMode(lView) ===\n                ((tQuery.metadata.flags & 2 /* isStatic */) === 2 /* isStatic */))) {\n            if (tQuery.matches === null) {\n                queryList.reset([]);\n            }\n            else {\n                var result = tQuery.crossesNgTemplate ?\n                    collectQueryResults(tView, lView, queryIndex, []) :\n                    materializeViewResults(tView, lView, tQuery, queryIndex);\n                queryList.reset(result, unwrapElementRef);\n                queryList.notifyOnChanges();\n            }\n            return true;\n        }\n        return false;\n    }\n    /**\n     * Creates new QueryList, stores the reference in LView and returns QueryList.\n     *\n     * @param predicate The type for which the query will search\n     * @param flags Flags associated with the query\n     * @param read What to save in the query\n     *\n     * @codeGenApi\n     */\n    function ɵɵviewQuery(predicate, flags, read) {\n        ngDevMode && assertNumber(flags, 'Expecting flags');\n        var tView = getTView();\n        if (tView.firstCreatePass) {\n            createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);\n            if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {\n                tView.staticViewQueries = true;\n            }\n        }\n        createLQuery(tView, getLView(), flags);\n    }\n    /**\n     * Registers a QueryList, associated with a content query, for later refresh (part of a view\n     * refresh).\n     *\n     * @param directiveIndex Current directive index\n     * @param predicate The type for which the query will search\n     * @param flags Flags associated with the query\n     * @param read What to save in the query\n     * @returns QueryList<T>\n     *\n     * @codeGenApi\n     */\n    function ɵɵcontentQuery(directiveIndex, predicate, flags, read) {\n        ngDevMode && assertNumber(flags, 'Expecting flags');\n        var tView = getTView();\n        if (tView.firstCreatePass) {\n            var tNode = getCurrentTNode();\n            createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);\n            saveContentQueryAndDirectiveIndex(tView, directiveIndex);\n            if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {\n                tView.staticContentQueries = true;\n            }\n        }\n        createLQuery(tView, getLView(), flags);\n    }\n    /**\n     * Loads a QueryList corresponding to the current view or content query.\n     *\n     * @codeGenApi\n     */\n    function ɵɵloadQuery() {\n        return loadQueryInternal(getLView(), getCurrentQueryIndex());\n    }\n    function loadQueryInternal(lView, queryIndex) {\n        ngDevMode &&\n            assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');\n        ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);\n        return lView[QUERIES].queries[queryIndex].queryList;\n    }\n    function createLQuery(tView, lView, flags) {\n        var queryList = new QueryList((flags & 4 /* emitDistinctChangesOnly */) === 4 /* emitDistinctChangesOnly */);\n        storeCleanupWithContext(tView, lView, queryList, queryList.destroy);\n        if (lView[QUERIES] === null)\n            lView[QUERIES] = new LQueries_();\n        lView[QUERIES].queries.push(new LQuery_(queryList));\n    }\n    function createTQuery(tView, metadata, nodeIndex) {\n        if (tView.queries === null)\n            tView.queries = new TQueries_();\n        tView.queries.track(new TQuery_(metadata, nodeIndex));\n    }\n    function saveContentQueryAndDirectiveIndex(tView, directiveIndex) {\n        var tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n        var lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1;\n        if (directiveIndex !== lastSavedDirectiveIndex) {\n            tViewContentQueries.push(tView.queries.length - 1, directiveIndex);\n        }\n    }\n    function getTQuery(tView, index) {\n        ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');\n        return tView.queries.getByIndex(index);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n     * `<ng-template>` element.\n     *\n     * @codeGenApi\n     */\n    function ɵɵtemplateRefExtractor(tNode, lView) {\n        return createTemplateRef(tNode, lView);\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$c = function () { return ({\n        'ɵɵattribute': ɵɵattribute,\n        'ɵɵattributeInterpolate1': ɵɵattributeInterpolate1,\n        'ɵɵattributeInterpolate2': ɵɵattributeInterpolate2,\n        'ɵɵattributeInterpolate3': ɵɵattributeInterpolate3,\n        'ɵɵattributeInterpolate4': ɵɵattributeInterpolate4,\n        'ɵɵattributeInterpolate5': ɵɵattributeInterpolate5,\n        'ɵɵattributeInterpolate6': ɵɵattributeInterpolate6,\n        'ɵɵattributeInterpolate7': ɵɵattributeInterpolate7,\n        'ɵɵattributeInterpolate8': ɵɵattributeInterpolate8,\n        'ɵɵattributeInterpolateV': ɵɵattributeInterpolateV,\n        'ɵɵdefineComponent': ɵɵdefineComponent,\n        'ɵɵdefineDirective': ɵɵdefineDirective,\n        'ɵɵdefineInjectable': ɵɵdefineInjectable,\n        'ɵɵdefineInjector': ɵɵdefineInjector,\n        'ɵɵdefineNgModule': ɵɵdefineNgModule,\n        'ɵɵdefinePipe': ɵɵdefinePipe,\n        'ɵɵdirectiveInject': ɵɵdirectiveInject,\n        'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory,\n        'ɵɵinject': ɵɵinject,\n        'ɵɵinjectAttribute': ɵɵinjectAttribute,\n        'ɵɵinvalidFactory': ɵɵinvalidFactory,\n        'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n        'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,\n        'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,\n        'ɵɵProvidersFeature': ɵɵProvidersFeature,\n        'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,\n        'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,\n        'ɵɵnextContext': ɵɵnextContext,\n        'ɵɵnamespaceHTML': ɵɵnamespaceHTML,\n        'ɵɵnamespaceMathML': ɵɵnamespaceMathML,\n        'ɵɵnamespaceSVG': ɵɵnamespaceSVG,\n        'ɵɵenableBindings': ɵɵenableBindings,\n        'ɵɵdisableBindings': ɵɵdisableBindings,\n        'ɵɵelementStart': ɵɵelementStart,\n        'ɵɵelementEnd': ɵɵelementEnd,\n        'ɵɵelement': ɵɵelement,\n        'ɵɵelementContainerStart': ɵɵelementContainerStart,\n        'ɵɵelementContainerEnd': ɵɵelementContainerEnd,\n        'ɵɵelementContainer': ɵɵelementContainer,\n        'ɵɵpureFunction0': ɵɵpureFunction0,\n        'ɵɵpureFunction1': ɵɵpureFunction1,\n        'ɵɵpureFunction2': ɵɵpureFunction2,\n        'ɵɵpureFunction3': ɵɵpureFunction3,\n        'ɵɵpureFunction4': ɵɵpureFunction4,\n        'ɵɵpureFunction5': ɵɵpureFunction5,\n        'ɵɵpureFunction6': ɵɵpureFunction6,\n        'ɵɵpureFunction7': ɵɵpureFunction7,\n        'ɵɵpureFunction8': ɵɵpureFunction8,\n        'ɵɵpureFunctionV': ɵɵpureFunctionV,\n        'ɵɵgetCurrentView': ɵɵgetCurrentView,\n        'ɵɵrestoreView': ɵɵrestoreView,\n        'ɵɵlistener': ɵɵlistener,\n        'ɵɵprojection': ɵɵprojection,\n        'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty,\n        'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener,\n        'ɵɵpipeBind1': ɵɵpipeBind1,\n        'ɵɵpipeBind2': ɵɵpipeBind2,\n        'ɵɵpipeBind3': ɵɵpipeBind3,\n        'ɵɵpipeBind4': ɵɵpipeBind4,\n        'ɵɵpipeBindV': ɵɵpipeBindV,\n        'ɵɵprojectionDef': ɵɵprojectionDef,\n        'ɵɵhostProperty': ɵɵhostProperty,\n        'ɵɵproperty': ɵɵproperty,\n        'ɵɵpropertyInterpolate': ɵɵpropertyInterpolate,\n        'ɵɵpropertyInterpolate1': ɵɵpropertyInterpolate1,\n        'ɵɵpropertyInterpolate2': ɵɵpropertyInterpolate2,\n        'ɵɵpropertyInterpolate3': ɵɵpropertyInterpolate3,\n        'ɵɵpropertyInterpolate4': ɵɵpropertyInterpolate4,\n        'ɵɵpropertyInterpolate5': ɵɵpropertyInterpolate5,\n        'ɵɵpropertyInterpolate6': ɵɵpropertyInterpolate6,\n        'ɵɵpropertyInterpolate7': ɵɵpropertyInterpolate7,\n        'ɵɵpropertyInterpolate8': ɵɵpropertyInterpolate8,\n        'ɵɵpropertyInterpolateV': ɵɵpropertyInterpolateV,\n        'ɵɵpipe': ɵɵpipe,\n        'ɵɵqueryRefresh': ɵɵqueryRefresh,\n        'ɵɵviewQuery': ɵɵviewQuery,\n        'ɵɵloadQuery': ɵɵloadQuery,\n        'ɵɵcontentQuery': ɵɵcontentQuery,\n        'ɵɵreference': ɵɵreference,\n        'ɵɵclassMap': ɵɵclassMap,\n        'ɵɵclassMapInterpolate1': ɵɵclassMapInterpolate1,\n        'ɵɵclassMapInterpolate2': ɵɵclassMapInterpolate2,\n        'ɵɵclassMapInterpolate3': ɵɵclassMapInterpolate3,\n        'ɵɵclassMapInterpolate4': ɵɵclassMapInterpolate4,\n        'ɵɵclassMapInterpolate5': ɵɵclassMapInterpolate5,\n        'ɵɵclassMapInterpolate6': ɵɵclassMapInterpolate6,\n        'ɵɵclassMapInterpolate7': ɵɵclassMapInterpolate7,\n        'ɵɵclassMapInterpolate8': ɵɵclassMapInterpolate8,\n        'ɵɵclassMapInterpolateV': ɵɵclassMapInterpolateV,\n        'ɵɵstyleMap': ɵɵstyleMap,\n        'ɵɵstyleMapInterpolate1': ɵɵstyleMapInterpolate1,\n        'ɵɵstyleMapInterpolate2': ɵɵstyleMapInterpolate2,\n        'ɵɵstyleMapInterpolate3': ɵɵstyleMapInterpolate3,\n        'ɵɵstyleMapInterpolate4': ɵɵstyleMapInterpolate4,\n        'ɵɵstyleMapInterpolate5': ɵɵstyleMapInterpolate5,\n        'ɵɵstyleMapInterpolate6': ɵɵstyleMapInterpolate6,\n        'ɵɵstyleMapInterpolate7': ɵɵstyleMapInterpolate7,\n        'ɵɵstyleMapInterpolate8': ɵɵstyleMapInterpolate8,\n        'ɵɵstyleMapInterpolateV': ɵɵstyleMapInterpolateV,\n        'ɵɵstyleProp': ɵɵstyleProp,\n        'ɵɵstylePropInterpolate1': ɵɵstylePropInterpolate1,\n        'ɵɵstylePropInterpolate2': ɵɵstylePropInterpolate2,\n        'ɵɵstylePropInterpolate3': ɵɵstylePropInterpolate3,\n        'ɵɵstylePropInterpolate4': ɵɵstylePropInterpolate4,\n        'ɵɵstylePropInterpolate5': ɵɵstylePropInterpolate5,\n        'ɵɵstylePropInterpolate6': ɵɵstylePropInterpolate6,\n        'ɵɵstylePropInterpolate7': ɵɵstylePropInterpolate7,\n        'ɵɵstylePropInterpolate8': ɵɵstylePropInterpolate8,\n        'ɵɵstylePropInterpolateV': ɵɵstylePropInterpolateV,\n        'ɵɵclassProp': ɵɵclassProp,\n        'ɵɵadvance': ɵɵadvance,\n        'ɵɵtemplate': ɵɵtemplate,\n        'ɵɵtext': ɵɵtext,\n        'ɵɵtextInterpolate': ɵɵtextInterpolate,\n        'ɵɵtextInterpolate1': ɵɵtextInterpolate1,\n        'ɵɵtextInterpolate2': ɵɵtextInterpolate2,\n        'ɵɵtextInterpolate3': ɵɵtextInterpolate3,\n        'ɵɵtextInterpolate4': ɵɵtextInterpolate4,\n        'ɵɵtextInterpolate5': ɵɵtextInterpolate5,\n        'ɵɵtextInterpolate6': ɵɵtextInterpolate6,\n        'ɵɵtextInterpolate7': ɵɵtextInterpolate7,\n        'ɵɵtextInterpolate8': ɵɵtextInterpolate8,\n        'ɵɵtextInterpolateV': ɵɵtextInterpolateV,\n        'ɵɵi18n': ɵɵi18n,\n        'ɵɵi18nAttributes': ɵɵi18nAttributes,\n        'ɵɵi18nExp': ɵɵi18nExp,\n        'ɵɵi18nStart': ɵɵi18nStart,\n        'ɵɵi18nEnd': ɵɵi18nEnd,\n        'ɵɵi18nApply': ɵɵi18nApply,\n        'ɵɵi18nPostprocess': ɵɵi18nPostprocess,\n        'ɵɵresolveWindow': ɵɵresolveWindow,\n        'ɵɵresolveDocument': ɵɵresolveDocument,\n        'ɵɵresolveBody': ɵɵresolveBody,\n        'ɵɵsetComponentScope': ɵɵsetComponentScope,\n        'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,\n        'ɵɵsanitizeHtml': ɵɵsanitizeHtml,\n        'ɵɵsanitizeStyle': ɵɵsanitizeStyle,\n        'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,\n        'ɵɵsanitizeScript': ɵɵsanitizeScript,\n        'ɵɵsanitizeUrl': ɵɵsanitizeUrl,\n        'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,\n        'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,\n        'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,\n        'forwardRef': forwardRef,\n        'resolveForwardRef': resolveForwardRef,\n    }); };\n    /**\n     * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n     *\n     * This should be kept up to date with the public exports of @angular/core.\n     */\n    var angularCoreEnv = (ɵ0$c)();\n\n    var jitOptions = null;\n    function setJitOptions(options) {\n        if (jitOptions !== null) {\n            if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {\n                ngDevMode &&\n                    console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.');\n                return;\n            }\n            if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {\n                ngDevMode &&\n                    console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.');\n                return;\n            }\n        }\n        jitOptions = options;\n    }\n    function getJitOptions() {\n        return jitOptions;\n    }\n    function resetJitOptions() {\n        jitOptions = null;\n    }\n\n    var moduleQueue = [];\n    /**\n     * Enqueues moduleDef to be checked later to see if scope can be set on its\n     * component declarations.\n     */\n    function enqueueModuleForDelayedScoping(moduleType, ngModule) {\n        moduleQueue.push({ moduleType: moduleType, ngModule: ngModule });\n    }\n    var flushingModuleQueue = false;\n    /**\n     * Loops over queued module definitions, if a given module definition has all of its\n     * declarations resolved, it dequeues that module definition and sets the scope on\n     * its declarations.\n     */\n    function flushModuleScopingQueueAsMuchAsPossible() {\n        if (!flushingModuleQueue) {\n            flushingModuleQueue = true;\n            try {\n                for (var i = moduleQueue.length - 1; i >= 0; i--) {\n                    var _a = moduleQueue[i], moduleType = _a.moduleType, ngModule = _a.ngModule;\n                    if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n                        // dequeue\n                        moduleQueue.splice(i, 1);\n                        setScopeOnDeclaredComponents(moduleType, ngModule);\n                    }\n                }\n            }\n            finally {\n                flushingModuleQueue = false;\n            }\n        }\n    }\n    /**\n     * Returns truthy if a declaration has resolved. If the declaration happens to be\n     * an array of declarations, it will recurse to check each declaration in that array\n     * (which may also be arrays).\n     */\n    function isResolvedDeclaration(declaration) {\n        if (Array.isArray(declaration)) {\n            return declaration.every(isResolvedDeclaration);\n        }\n        return !!resolveForwardRef(declaration);\n    }\n    /**\n     * Compiles a module in JIT mode.\n     *\n     * This function automatically gets called when a class has a `@NgModule` decorator.\n     */\n    function compileNgModule(moduleType, ngModule) {\n        if (ngModule === void 0) { ngModule = {}; }\n        compileNgModuleDefs(moduleType, ngModule);\n        // Because we don't know if all declarations have resolved yet at the moment the\n        // NgModule decorator is executing, we're enqueueing the setting of module scope\n        // on its declarations to be run at a later time when all declarations for the module,\n        // including forward refs, have resolved.\n        enqueueModuleForDelayedScoping(moduleType, ngModule);\n    }\n    /**\n     * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.\n     *\n     * It's possible to compile a module via this API which will allow duplicate declarations in its\n     * root.\n     */\n    function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot) {\n        if (allowDuplicateDeclarationsInRoot === void 0) { allowDuplicateDeclarationsInRoot = false; }\n        ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n        ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n        var declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n        var ngModuleDef = null;\n        Object.defineProperty(moduleType, NG_MOD_DEF, {\n            configurable: true,\n            get: function () {\n                if (ngModuleDef === null) {\n                    if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {\n                        // We need to assert this immediately, because allowing it to continue will cause it to\n                        // go into an infinite loop before we've reached the point where we throw all the errors.\n                        throw new Error(\"'\" + stringifyForError(moduleType) + \"' module can't import itself\");\n                    }\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });\n                    ngModuleDef = compiler.compileNgModule(angularCoreEnv, \"ng:///\" + moduleType.name + \"/\\u0275mod.js\", {\n                        type: moduleType,\n                        bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),\n                        declarations: declarations.map(resolveForwardRef),\n                        imports: flatten(ngModule.imports || EMPTY_ARRAY)\n                            .map(resolveForwardRef)\n                            .map(expandModuleWithProviders),\n                        exports: flatten(ngModule.exports || EMPTY_ARRAY)\n                            .map(resolveForwardRef)\n                            .map(expandModuleWithProviders),\n                        schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,\n                        id: ngModule.id || null,\n                    });\n                    // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime\n                    // should verify that there are no unknown elements in a template. In AOT mode, that check\n                    // happens at compile time and `schemas` information is not present on Component and Module\n                    // defs after compilation (so the check doesn't happen the second time at runtime).\n                    if (!ngModuleDef.schemas) {\n                        ngModuleDef.schemas = [];\n                    }\n                }\n                return ngModuleDef;\n            }\n        });\n        var ngFactoryDef = null;\n        Object.defineProperty(moduleType, NG_FACTORY_DEF, {\n            get: function () {\n                if (ngFactoryDef === null) {\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });\n                    ngFactoryDef = compiler.compileFactory(angularCoreEnv, \"ng:///\" + moduleType.name + \"/\\u0275fac.js\", {\n                        name: moduleType.name,\n                        type: moduleType,\n                        deps: reflectDependencies(moduleType),\n                        target: compiler.FactoryTarget.NgModule,\n                        typeArgumentCount: 0,\n                    });\n                }\n                return ngFactoryDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n        var ngInjectorDef = null;\n        Object.defineProperty(moduleType, NG_INJ_DEF, {\n            get: function () {\n                if (ngInjectorDef === null) {\n                    ngDevMode &&\n                        verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);\n                    var meta = {\n                        name: moduleType.name,\n                        type: moduleType,\n                        providers: ngModule.providers || EMPTY_ARRAY,\n                        imports: [\n                            (ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),\n                            (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),\n                        ],\n                    };\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });\n                    ngInjectorDef =\n                        compiler.compileInjector(angularCoreEnv, \"ng:///\" + moduleType.name + \"/\\u0275inj.js\", meta);\n                }\n                return ngInjectorDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n    }\n    function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {\n        if (verifiedNgModule.get(moduleType))\n            return;\n        verifiedNgModule.set(moduleType, true);\n        moduleType = resolveForwardRef(moduleType);\n        var ngModuleDef;\n        if (importingModule) {\n            ngModuleDef = getNgModuleDef(moduleType);\n            if (!ngModuleDef) {\n                throw new Error(\"Unexpected value '\" + moduleType.name + \"' imported by the module '\" + importingModule.name + \"'. Please add an @NgModule annotation.\");\n            }\n        }\n        else {\n            ngModuleDef = getNgModuleDef(moduleType, true);\n        }\n        var errors = [];\n        var declarations = maybeUnwrapFn(ngModuleDef.declarations);\n        var imports = maybeUnwrapFn(ngModuleDef.imports);\n        flatten(imports).map(unwrapModuleWithProvidersImports).forEach(function (mod) {\n            verifySemanticsOfNgModuleImport(mod, moduleType);\n            verifySemanticsOfNgModuleDef(mod, false, moduleType);\n        });\n        var exports = maybeUnwrapFn(ngModuleDef.exports);\n        declarations.forEach(verifyDeclarationsHaveDefinitions);\n        declarations.forEach(verifyDirectivesHaveSelector);\n        var combinedDeclarations = __spreadArray(__spreadArray([], __read(declarations.map(resolveForwardRef))), __read(flatten(imports.map(computeCombinedExports)).map(resolveForwardRef)));\n        exports.forEach(verifyExportsAreDeclaredOrReExported);\n        declarations.forEach(function (decl) { return verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot); });\n        declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule);\n        var ngModule = getAnnotation(moduleType, 'NgModule');\n        if (ngModule) {\n            ngModule.imports &&\n                flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach(function (mod) {\n                    verifySemanticsOfNgModuleImport(mod, moduleType);\n                    verifySemanticsOfNgModuleDef(mod, false, moduleType);\n                });\n            ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);\n            ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);\n            ngModule.entryComponents &&\n                deepForEach(ngModule.entryComponents, verifyComponentIsPartOfNgModule);\n        }\n        // Throw Error if any errors were detected.\n        if (errors.length) {\n            throw new Error(errors.join('\\n'));\n        }\n        ////////////////////////////////////////////////////////////////////////////////////////////////\n        function verifyDeclarationsHaveDefinitions(type) {\n            type = resolveForwardRef(type);\n            var def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);\n            if (!def) {\n                errors.push(\"Unexpected value '\" + stringifyForError(type) + \"' declared by the module '\" + stringifyForError(moduleType) + \"'. Please add a @Pipe/@Directive/@Component annotation.\");\n            }\n        }\n        function verifyDirectivesHaveSelector(type) {\n            type = resolveForwardRef(type);\n            var def = getDirectiveDef(type);\n            if (!getComponentDef(type) && def && def.selectors.length == 0) {\n                errors.push(\"Directive \" + stringifyForError(type) + \" has no selector, please add it!\");\n            }\n        }\n        function verifyExportsAreDeclaredOrReExported(type) {\n            type = resolveForwardRef(type);\n            var kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' ||\n                getPipeDef(type) && 'pipe';\n            if (kind) {\n                // only checked if we are declared as Component, Directive, or Pipe\n                // Modules don't need to be declared or imported.\n                if (combinedDeclarations.lastIndexOf(type) === -1) {\n                    // We are exporting something which we don't explicitly declare or import.\n                    errors.push(\"Can't export \" + kind + \" \" + stringifyForError(type) + \" from \" + stringifyForError(moduleType) + \" as it was neither declared nor imported!\");\n                }\n            }\n        }\n        function verifyDeclarationIsUnique(type, suppressErrors) {\n            type = resolveForwardRef(type);\n            var existingModule = ownerNgModule.get(type);\n            if (existingModule && existingModule !== moduleType) {\n                if (!suppressErrors) {\n                    var modules = [existingModule, moduleType].map(stringifyForError).sort();\n                    errors.push(\"Type \" + stringifyForError(type) + \" is part of the declarations of 2 modules: \" + modules[0] + \" and \" + modules[1] + \"! \" +\n                        (\"Please consider moving \" + stringifyForError(type) + \" to a higher module that imports \" + modules[0] + \" and \" + modules[1] + \". \") +\n                        (\"You can also create a new NgModule that exports and includes \" + stringifyForError(type) + \" then import that NgModule in \" + modules[0] + \" and \" + modules[1] + \".\"));\n                }\n            }\n            else {\n                // Mark type as having owner.\n                ownerNgModule.set(type, moduleType);\n            }\n        }\n        function verifyComponentIsPartOfNgModule(type) {\n            type = resolveForwardRef(type);\n            var existingModule = ownerNgModule.get(type);\n            if (!existingModule) {\n                errors.push(\"Component \" + stringifyForError(type) + \" is not part of any NgModule or the module has not been imported into your module.\");\n            }\n        }\n        function verifyCorrectBootstrapType(type) {\n            type = resolveForwardRef(type);\n            if (!getComponentDef(type)) {\n                errors.push(stringifyForError(type) + \" cannot be used as an entry component.\");\n            }\n        }\n        function verifyComponentEntryComponentsIsPartOfNgModule(type) {\n            type = resolveForwardRef(type);\n            if (getComponentDef(type)) {\n                // We know we are component\n                var component = getAnnotation(type, 'Component');\n                if (component && component.entryComponents) {\n                    deepForEach(component.entryComponents, verifyComponentIsPartOfNgModule);\n                }\n            }\n        }\n        function verifySemanticsOfNgModuleImport(type, importingModule) {\n            type = resolveForwardRef(type);\n            if (getComponentDef(type) || getDirectiveDef(type)) {\n                throw new Error(\"Unexpected directive '\" + type.name + \"' imported by the module '\" + importingModule.name + \"'. Please add an @NgModule annotation.\");\n            }\n            if (getPipeDef(type)) {\n                throw new Error(\"Unexpected pipe '\" + type.name + \"' imported by the module '\" + importingModule.name + \"'. Please add an @NgModule annotation.\");\n            }\n        }\n    }\n    function unwrapModuleWithProvidersImports(typeOrWithProviders) {\n        typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n        return typeOrWithProviders.ngModule || typeOrWithProviders;\n    }\n    function getAnnotation(type, name) {\n        var annotation = null;\n        collect(type.__annotations__);\n        collect(type.decorators);\n        return annotation;\n        function collect(annotations) {\n            if (annotations) {\n                annotations.forEach(readAnnotation);\n            }\n        }\n        function readAnnotation(decorator) {\n            if (!annotation) {\n                var proto = Object.getPrototypeOf(decorator);\n                if (proto.ngMetadataName == name) {\n                    annotation = decorator;\n                }\n                else if (decorator.type) {\n                    var proto_1 = Object.getPrototypeOf(decorator.type);\n                    if (proto_1.ngMetadataName == name) {\n                        annotation = decorator.args[0];\n                    }\n                }\n            }\n        }\n    }\n    /**\n     * Keep track of compiled components. This is needed because in tests we often want to compile the\n     * same component with more than one NgModule. This would cause an error unless we reset which\n     * NgModule the component belongs to. We keep the list of compiled components here so that the\n     * TestBed can reset it later.\n     */\n    var ownerNgModule = new WeakMap();\n    var verifiedNgModule = new WeakMap();\n    function resetCompiledComponents() {\n        ownerNgModule = new WeakMap();\n        verifiedNgModule = new WeakMap();\n        moduleQueue.length = 0;\n    }\n    /**\n     * Computes the combined declarations of explicit declarations, as well as declarations inherited by\n     * traversing the exports of imported modules.\n     * @param type\n     */\n    function computeCombinedExports(type) {\n        type = resolveForwardRef(type);\n        var ngModuleDef = getNgModuleDef(type, true);\n        return __spreadArray([], __read(flatten(maybeUnwrapFn(ngModuleDef.exports).map(function (type) {\n            var ngModuleDef = getNgModuleDef(type);\n            if (ngModuleDef) {\n                verifySemanticsOfNgModuleDef(type, false);\n                return computeCombinedExports(type);\n            }\n            else {\n                return type;\n            }\n        }))));\n    }\n    /**\n     * Some declared components may be compiled asynchronously, and thus may not have their\n     * ɵcmp set yet. If this is the case, then a reference to the module is written into\n     * the `ngSelectorScope` property of the declared type.\n     */\n    function setScopeOnDeclaredComponents(moduleType, ngModule) {\n        var declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n        var transitiveScopes = transitiveScopesFor(moduleType);\n        declarations.forEach(function (declaration) {\n            if (declaration.hasOwnProperty(NG_COMP_DEF)) {\n                // A `ɵcmp` field exists - go ahead and patch the component directly.\n                var component = declaration;\n                var componentDef = getComponentDef(component);\n                patchComponentDefWithScope(componentDef, transitiveScopes);\n            }\n            else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n                // Set `ngSelectorScope` for future reference when the component compilation finishes.\n                declaration.ngSelectorScope = moduleType;\n            }\n        });\n    }\n    /**\n     * Patch the definition of a component with directives and pipes from the compilation scope of\n     * a given module.\n     */\n    function patchComponentDefWithScope(componentDef, transitiveScopes) {\n        componentDef.directiveDefs = function () { return Array.from(transitiveScopes.compilation.directives)\n            .map(function (dir) { return dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir); })\n            .filter(function (def) { return !!def; }); };\n        componentDef.pipeDefs = function () { return Array.from(transitiveScopes.compilation.pipes).map(function (pipe) { return getPipeDef(pipe); }); };\n        componentDef.schemas = transitiveScopes.schemas;\n        // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we\n        // may face a problem where previously compiled defs available to a given Component/Directive\n        // are cached in TView and may become stale (in case any of these defs gets recompiled). In\n        // order to avoid this problem, we force fresh TView to be created.\n        componentDef.tView = null;\n    }\n    /**\n     * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.\n     *\n     * This operation is memoized and the result is cached on the module's definition. This function can\n     * be called on modules with components that have not fully compiled yet, but the result should not\n     * be used until they have.\n     *\n     * @param moduleType module that transitive scope should be calculated for.\n     */\n    function transitiveScopesFor(moduleType) {\n        if (!isNgModule(moduleType)) {\n            throw new Error(moduleType.name + \" does not have a module def (\\u0275mod property)\");\n        }\n        var def = getNgModuleDef(moduleType);\n        if (def.transitiveCompileScopes !== null) {\n            return def.transitiveCompileScopes;\n        }\n        var scopes = {\n            schemas: def.schemas || null,\n            compilation: {\n                directives: new Set(),\n                pipes: new Set(),\n            },\n            exported: {\n                directives: new Set(),\n                pipes: new Set(),\n            },\n        };\n        maybeUnwrapFn(def.imports).forEach(function (imported) {\n            var importedType = imported;\n            if (!isNgModule(importedType)) {\n                throw new Error(\"Importing \" + importedType.name + \" which does not have a \\u0275mod property\");\n            }\n            // When this module imports another, the imported module's exported directives and pipes are\n            // added to the compilation scope of this module.\n            var importedScope = transitiveScopesFor(importedType);\n            importedScope.exported.directives.forEach(function (entry) { return scopes.compilation.directives.add(entry); });\n            importedScope.exported.pipes.forEach(function (entry) { return scopes.compilation.pipes.add(entry); });\n        });\n        maybeUnwrapFn(def.declarations).forEach(function (declared) {\n            var declaredWithDefs = declared;\n            if (getPipeDef(declaredWithDefs)) {\n                scopes.compilation.pipes.add(declared);\n            }\n            else {\n                // Either declared has a ɵcmp or ɵdir, or it's a component which hasn't\n                // had its template compiled yet. In either case, it gets added to the compilation's\n                // directives.\n                scopes.compilation.directives.add(declared);\n            }\n        });\n        maybeUnwrapFn(def.exports).forEach(function (exported) {\n            var exportedType = exported;\n            // Either the type is a module, a pipe, or a component/directive (which may not have a\n            // ɵcmp as it might be compiled asynchronously).\n            if (isNgModule(exportedType)) {\n                // When this module exports another, the exported module's exported directives and pipes are\n                // added to both the compilation and exported scopes of this module.\n                var exportedScope = transitiveScopesFor(exportedType);\n                exportedScope.exported.directives.forEach(function (entry) {\n                    scopes.compilation.directives.add(entry);\n                    scopes.exported.directives.add(entry);\n                });\n                exportedScope.exported.pipes.forEach(function (entry) {\n                    scopes.compilation.pipes.add(entry);\n                    scopes.exported.pipes.add(entry);\n                });\n            }\n            else if (getPipeDef(exportedType)) {\n                scopes.exported.pipes.add(exportedType);\n            }\n            else {\n                scopes.exported.directives.add(exportedType);\n            }\n        });\n        def.transitiveCompileScopes = scopes;\n        return scopes;\n    }\n    function expandModuleWithProviders(value) {\n        if (isModuleWithProviders(value)) {\n            return value.ngModule;\n        }\n        return value;\n    }\n    function isModuleWithProviders(value) {\n        return value.ngModule !== undefined;\n    }\n    function isNgModule(value) {\n        return !!getNgModuleDef(value);\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This\n     * matters in the following scenario:\n     *\n     * Consider a component 'A' that extends component 'B', both declared in module 'M'. During\n     * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain,\n     * potentially triggering compilation of 'B'. If this nested compilation were to trigger\n     * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the\n     * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of\n     * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid\n     * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure\n     * all compilations have finished.\n     */\n    var compilationDepth = 0;\n    /**\n     * Compile an Angular component according to its decorator metadata, and patch the resulting\n     * component def (ɵcmp) onto the component type.\n     *\n     * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n     * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n     * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`\n     * until the global queue has been resolved with a call to `resolveComponentResources`.\n     */\n    function compileComponent(type, metadata) {\n        // Initialize ngDevMode. This must be the first statement in compileComponent.\n        // See the `initNgDevMode` docstring for more information.\n        (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n        var ngComponentDef = null;\n        // Metadata may have resources which need to be resolved.\n        maybeQueueResolutionOfComponentResources(type, metadata);\n        // Note that we're using the same function as `Directive`, because that's only subset of metadata\n        // that we need to create the ngFactoryDef. We're avoiding using the component metadata\n        // because we'd have to resolve the asynchronous templates.\n        addDirectiveFactoryDef(type, metadata);\n        Object.defineProperty(type, NG_COMP_DEF, {\n            get: function () {\n                if (ngComponentDef === null) {\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'component', type: type });\n                    if (componentNeedsResolution(metadata)) {\n                        var error = [\"Component '\" + type.name + \"' is not resolved:\"];\n                        if (metadata.templateUrl) {\n                            error.push(\" - templateUrl: \" + metadata.templateUrl);\n                        }\n                        if (metadata.styleUrls && metadata.styleUrls.length) {\n                            error.push(\" - styleUrls: \" + JSON.stringify(metadata.styleUrls));\n                        }\n                        error.push(\"Did you run and wait for 'resolveComponentResources()'?\");\n                        throw new Error(error.join('\\n'));\n                    }\n                    // This const was called `jitOptions` previously but had to be renamed to `options` because\n                    // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`.\n                    // This bug was investigated in https://github.com/angular/angular-cli/issues/17264.\n                    // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed.\n                    var options = getJitOptions();\n                    var preserveWhitespaces = metadata.preserveWhitespaces;\n                    if (preserveWhitespaces === undefined) {\n                        if (options !== null && options.preserveWhitespaces !== undefined) {\n                            preserveWhitespaces = options.preserveWhitespaces;\n                        }\n                        else {\n                            preserveWhitespaces = false;\n                        }\n                    }\n                    var encapsulation = metadata.encapsulation;\n                    if (encapsulation === undefined) {\n                        if (options !== null && options.defaultEncapsulation !== undefined) {\n                            encapsulation = options.defaultEncapsulation;\n                        }\n                        else {\n                            encapsulation = exports.ViewEncapsulation.Emulated;\n                        }\n                    }\n                    var templateUrl = metadata.templateUrl || \"ng:///\" + type.name + \"/template.html\";\n                    var meta = Object.assign(Object.assign({}, directiveMetadata(type, metadata)), { typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl), template: metadata.template || '', preserveWhitespaces: preserveWhitespaces, styles: metadata.styles || EMPTY_ARRAY, animations: metadata.animations, directives: [], changeDetection: metadata.changeDetection, pipes: new Map(), encapsulation: encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null });\n                    compilationDepth++;\n                    try {\n                        if (meta.usesInheritance) {\n                            addDirectiveDefToUndecoratedParents(type);\n                        }\n                        ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);\n                    }\n                    finally {\n                        // Ensure that the compilation depth is decremented even when the compilation failed.\n                        compilationDepth--;\n                    }\n                    if (compilationDepth === 0) {\n                        // When NgModule decorator executed, we enqueued the module definition such that\n                        // it would only dequeue and add itself as module scope to all of its declarations,\n                        // but only if  if all of its declarations had resolved. This call runs the check\n                        // to see if any modules that are in the queue can be dequeued and add scope to\n                        // their declarations.\n                        flushModuleScopingQueueAsMuchAsPossible();\n                    }\n                    // If component compilation is async, then the @NgModule annotation which declares the\n                    // component may execute and set an ngSelectorScope property on the component type. This\n                    // allows the component to patch itself with directiveDefs from the module after it\n                    // finishes compiling.\n                    if (hasSelectorScope(type)) {\n                        var scopes = transitiveScopesFor(type.ngSelectorScope);\n                        patchComponentDefWithScope(ngComponentDef, scopes);\n                    }\n                }\n                return ngComponentDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n    }\n    function hasSelectorScope(component) {\n        return component.ngSelectorScope !== undefined;\n    }\n    /**\n     * Compile an Angular directive according to its decorator metadata, and patch the resulting\n     * directive def onto the component type.\n     *\n     * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n     * will resolve when compilation completes and the directive becomes usable.\n     */\n    function compileDirective(type, directive) {\n        var ngDirectiveDef = null;\n        addDirectiveFactoryDef(type, directive || {});\n        Object.defineProperty(type, NG_DIR_DEF, {\n            get: function () {\n                if (ngDirectiveDef === null) {\n                    // `directive` can be null in the case of abstract directives as a base class\n                    // that use `@Directive()` with no selector. In that case, pass empty object to the\n                    // `directiveMetadata` function instead of null.\n                    var meta = getDirectiveMetadata$1(type, directive || {});\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });\n                    ngDirectiveDef =\n                        compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);\n                }\n                return ngDirectiveDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n    }\n    function getDirectiveMetadata$1(type, metadata) {\n        var name = type && type.name;\n        var sourceMapUrl = \"ng:///\" + name + \"/\\u0275dir.js\";\n        var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });\n        var facade = directiveMetadata(type, metadata);\n        facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);\n        if (facade.usesInheritance) {\n            addDirectiveDefToUndecoratedParents(type);\n        }\n        return { metadata: facade, sourceMapUrl: sourceMapUrl };\n    }\n    function addDirectiveFactoryDef(type, metadata) {\n        var ngFactoryDef = null;\n        Object.defineProperty(type, NG_FACTORY_DEF, {\n            get: function () {\n                if (ngFactoryDef === null) {\n                    var meta = getDirectiveMetadata$1(type, metadata);\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });\n                    ngFactoryDef = compiler.compileFactory(angularCoreEnv, \"ng:///\" + type.name + \"/\\u0275fac.js\", {\n                        name: meta.metadata.name,\n                        type: meta.metadata.type,\n                        typeArgumentCount: 0,\n                        deps: reflectDependencies(type),\n                        target: compiler.FactoryTarget.Directive\n                    });\n                }\n                return ngFactoryDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n    }\n    function extendsDirectlyFromObject(type) {\n        return Object.getPrototypeOf(type.prototype) === Object.prototype;\n    }\n    /**\n     * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n     * `Component`).\n     */\n    function directiveMetadata(type, metadata) {\n        // Reflect inputs and outputs.\n        var reflect = getReflect();\n        var propMetadata = reflect.ownPropMetadata(type);\n        return {\n            name: type.name,\n            type: type,\n            selector: metadata.selector !== undefined ? metadata.selector : null,\n            host: metadata.host || EMPTY_OBJ,\n            propMetadata: propMetadata,\n            inputs: metadata.inputs || EMPTY_ARRAY,\n            outputs: metadata.outputs || EMPTY_ARRAY,\n            queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n            lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges') },\n            typeSourceSpan: null,\n            usesInheritance: !extendsDirectlyFromObject(type),\n            exportAs: extractExportAs(metadata.exportAs),\n            providers: metadata.providers || null,\n            viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery)\n        };\n    }\n    /**\n     * Adds a directive definition to all parent classes of a type that don't have an Angular decorator.\n     */\n    function addDirectiveDefToUndecoratedParents(type) {\n        var objPrototype = Object.prototype;\n        var parent = Object.getPrototypeOf(type.prototype).constructor;\n        // Go up the prototype until we hit `Object`.\n        while (parent && parent !== objPrototype) {\n            // Since inheritance works if the class was annotated already, we only need to add\n            // the def if there are no annotations and the def hasn't been created already.\n            if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n                shouldAddAbstractDirective(parent)) {\n                compileDirective(parent, null);\n            }\n            parent = Object.getPrototypeOf(parent);\n        }\n    }\n    function convertToR3QueryPredicate(selector) {\n        return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n    }\n    function convertToR3QueryMetadata(propertyName, ann) {\n        return {\n            propertyName: propertyName,\n            predicate: convertToR3QueryPredicate(ann.selector),\n            descendants: ann.descendants,\n            first: ann.first,\n            read: ann.read ? ann.read : null,\n            static: !!ann.static,\n            emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,\n        };\n    }\n    function extractQueriesMetadata(type, propMetadata, isQueryAnn) {\n        var queriesMeta = [];\n        var _loop_1 = function (field) {\n            if (propMetadata.hasOwnProperty(field)) {\n                var annotations_1 = propMetadata[field];\n                annotations_1.forEach(function (ann) {\n                    if (isQueryAnn(ann)) {\n                        if (!ann.selector) {\n                            throw new Error(\"Can't construct a query for the property \\\"\" + field + \"\\\" of \" +\n                                (\"\\\"\" + stringifyForError(type) + \"\\\" since the query selector wasn't defined.\"));\n                        }\n                        if (annotations_1.some(isInputAnnotation)) {\n                            throw new Error(\"Cannot combine @Input decorators with query decorators\");\n                        }\n                        queriesMeta.push(convertToR3QueryMetadata(field, ann));\n                    }\n                });\n            }\n        };\n        for (var field in propMetadata) {\n            _loop_1(field);\n        }\n        return queriesMeta;\n    }\n    function extractExportAs(exportAs) {\n        return exportAs === undefined ? null : splitByComma(exportAs);\n    }\n    function isContentQuery(value) {\n        var name = value.ngMetadataName;\n        return name === 'ContentChild' || name === 'ContentChildren';\n    }\n    function isViewQuery(value) {\n        var name = value.ngMetadataName;\n        return name === 'ViewChild' || name === 'ViewChildren';\n    }\n    function isInputAnnotation(value) {\n        return value.ngMetadataName === 'Input';\n    }\n    function splitByComma(value) {\n        return value.split(',').map(function (piece) { return piece.trim(); });\n    }\n    var LIFECYCLE_HOOKS = [\n        'ngOnChanges', 'ngOnInit', 'ngOnDestroy', 'ngDoCheck', 'ngAfterViewInit', 'ngAfterViewChecked',\n        'ngAfterContentInit', 'ngAfterContentChecked'\n    ];\n    function shouldAddAbstractDirective(type) {\n        var reflect = getReflect();\n        if (LIFECYCLE_HOOKS.some(function (hookName) { return reflect.hasLifecycleHook(type, hookName); })) {\n            return true;\n        }\n        var propMetadata = reflect.propMetadata(type);\n        for (var field in propMetadata) {\n            var annotations = propMetadata[field];\n            for (var i = 0; i < annotations.length; i++) {\n                var current = annotations[i];\n                var metadataName = current.ngMetadataName;\n                if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) ||\n                    metadataName === 'Output' || metadataName === 'HostBinding' ||\n                    metadataName === 'HostListener') {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\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://angular.io/license\n     */\n    function compilePipe(type, meta) {\n        var ngPipeDef = null;\n        var ngFactoryDef = null;\n        Object.defineProperty(type, NG_FACTORY_DEF, {\n            get: function () {\n                if (ngFactoryDef === null) {\n                    var metadata = getPipeMetadata(type, meta);\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });\n                    ngFactoryDef = compiler.compileFactory(angularCoreEnv, \"ng:///\" + metadata.name + \"/\\u0275fac.js\", {\n                        name: metadata.name,\n                        type: metadata.type,\n                        typeArgumentCount: 0,\n                        deps: reflectDependencies(type),\n                        target: compiler.FactoryTarget.Pipe\n                    });\n                }\n                return ngFactoryDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n        Object.defineProperty(type, NG_PIPE_DEF, {\n            get: function () {\n                if (ngPipeDef === null) {\n                    var metadata = getPipeMetadata(type, meta);\n                    var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });\n                    ngPipeDef =\n                        compiler.compilePipe(angularCoreEnv, \"ng:///\" + metadata.name + \"/\\u0275pipe.js\", metadata);\n                }\n                return ngPipeDef;\n            },\n            // Make the property configurable in dev mode to allow overriding in tests\n            configurable: !!ngDevMode,\n        });\n    }\n    function getPipeMetadata(type, meta) {\n        return {\n            type: type,\n            name: type.name,\n            pipeName: meta.name,\n            pure: meta.pure !== undefined ? meta.pure : true\n        };\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$d = function (dir) {\n        if (dir === void 0) { dir = {}; }\n        return dir;\n    }, ɵ1$2 = function (type, meta) { return SWITCH_COMPILE_DIRECTIVE(type, meta); };\n    /**\n     * Type of the Directive metadata.\n     *\n     * @publicApi\n     */\n    var Directive = makeDecorator('Directive', ɵ0$d, undefined, undefined, ɵ1$2);\n    var ɵ2$1 = function (c) {\n        if (c === void 0) { c = {}; }\n        return (Object.assign({ changeDetection: exports.ChangeDetectionStrategy.Default }, c));\n    }, ɵ3$1 = function (type, meta) { return SWITCH_COMPILE_COMPONENT(type, meta); };\n    /**\n     * Component decorator and metadata.\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var Component = makeDecorator('Component', ɵ2$1, Directive, undefined, ɵ3$1);\n    var ɵ4 = function (p) { return (Object.assign({ pure: true }, p)); }, ɵ5 = function (type, meta) { return SWITCH_COMPILE_PIPE(type, meta); };\n    /**\n     * @Annotation\n     * @publicApi\n     */\n    var Pipe = makeDecorator('Pipe', ɵ4, undefined, undefined, ɵ5);\n    var ɵ6 = function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); };\n    /**\n     * @Annotation\n     * @publicApi\n     */\n    var Input = makePropDecorator('Input', ɵ6);\n    var ɵ7 = function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); };\n    /**\n     * @Annotation\n     * @publicApi\n     */\n    var Output = makePropDecorator('Output', ɵ7);\n    var ɵ8 = function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); };\n    /**\n     * @Annotation\n     * @publicApi\n     */\n    var HostBinding = makePropDecorator('HostBinding', ɵ8);\n    var ɵ9 = function (eventName, args) { return ({ eventName: eventName, args: args }); };\n    /**\n     * Decorator that binds a DOM event to a host listener and supplies configuration metadata.\n     * Angular invokes the supplied handler method when the host element emits the specified event,\n     * and updates the bound element with the result.\n     *\n     * If the handler method returns false, applies `preventDefault` on the bound element.\n     *\n     * @usageNotes\n     *\n     * The following example declares a directive\n     * that attaches a click listener to a button and counts clicks.\n     *\n     * ```ts\n     * @Directive({selector: 'button[counting]'})\n     * class CountClicks {\n     *   numberOfClicks = 0;\n     *\n     *   @HostListener('click', ['$event.target'])\n     *   onClick(btn) {\n     *     console.log('button', btn, 'number of clicks:', this.numberOfClicks++);\n     *  }\n     * }\n     *\n     * @Component({\n     *   selector: 'app',\n     *   template: '<button counting>Increment</button>',\n     * })\n     * class App {}\n     *\n     * ```\n     *\n     * The following example registers another DOM event handler that listens for key-press events.\n     * ``` ts\n     * import { HostListener, Component } from \"@angular/core\";\n     *\n     * @Component({\n     *   selector: 'app',\n     *   template: `<h1>Hello, you have pressed keys {{counter}} number of times!</h1> Press any key to\n     * increment the counter.\n     *   <button (click)=\"resetCounter()\">Reset Counter</button>`\n     * })\n     * class AppComponent {\n     *   counter = 0;\n     *   @HostListener('window:keydown', ['$event'])\n     *   handleKeyDown(event: KeyboardEvent) {\n     *     this.counter++;\n     *   }\n     *   resetCounter() {\n     *     this.counter = 0;\n     *   }\n     * }\n     * ```\n     *\n     * @Annotation\n     * @publicApi\n     */\n    var HostListener = makePropDecorator('HostListener', ɵ9);\n    var SWITCH_COMPILE_COMPONENT__POST_R3__ = compileComponent;\n    var SWITCH_COMPILE_DIRECTIVE__POST_R3__ = compileDirective;\n    var SWITCH_COMPILE_PIPE__POST_R3__ = compilePipe;\n    var SWITCH_COMPILE_COMPONENT__PRE_R3__ = noop;\n    var SWITCH_COMPILE_DIRECTIVE__PRE_R3__ = noop;\n    var SWITCH_COMPILE_PIPE__PRE_R3__ = noop;\n    var SWITCH_COMPILE_COMPONENT = SWITCH_COMPILE_COMPONENT__PRE_R3__;\n    var SWITCH_COMPILE_DIRECTIVE = SWITCH_COMPILE_DIRECTIVE__PRE_R3__;\n    var SWITCH_COMPILE_PIPE = SWITCH_COMPILE_PIPE__PRE_R3__;\n\n    var ɵ0$e = function (ngModule) { return ngModule; }, ɵ1$3 = \n    /**\n     * Decorator that marks the following class as an NgModule, and supplies\n     * configuration metadata for it.\n     *\n     * * The `declarations` and `entryComponents` options configure the compiler\n     * with information about what belongs to the NgModule.\n     * * The `providers` options configures the NgModule's injector to provide\n     * dependencies the NgModule members.\n     * * The `imports` and `exports` options bring in members from other modules, and make\n     * this module's members available to others.\n     */\n    function (type, meta) { return SWITCH_COMPILE_NGMODULE(type, meta); };\n    /**\n     * @Annotation\n     * @publicApi\n     */\n    var NgModule = makeDecorator('NgModule', ɵ0$e, undefined, undefined, ɵ1$3);\n    function preR3NgModuleCompile(moduleType, metadata) {\n        var imports = (metadata && metadata.imports) || [];\n        if (metadata && metadata.exports) {\n            imports = __spreadArray(__spreadArray([], __read(imports)), [metadata.exports]);\n        }\n        var moduleInjectorType = moduleType;\n        moduleInjectorType.ɵfac = convertInjectableProviderToFactory(moduleType, { useClass: moduleType });\n        moduleInjectorType.ɵinj =\n            ɵɵdefineInjector({ providers: metadata && metadata.providers, imports: imports });\n    }\n    var SWITCH_COMPILE_NGMODULE__POST_R3__ = compileNgModule;\n    var SWITCH_COMPILE_NGMODULE__PRE_R3__ = preR3NgModuleCompile;\n    var SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__PRE_R3__;\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A [DI token](guide/glossary#di-token \"DI token definition\") that you can use to provide\n     * one or more initialization functions.\n     *\n     * The provided functions are injected at application startup and executed during\n     * app initialization. If any of these functions returns a Promise or an Observable, initialization\n     * does not complete until the Promise is resolved or the Observable is completed.\n     *\n     * You can, for example, create a factory function that loads language data\n     * or an external configuration, and provide that function to the `APP_INITIALIZER` token.\n     * The function is executed during the application bootstrap process,\n     * and the needed data is available on startup.\n     *\n     * @see `ApplicationInitStatus`\n     *\n     * @usageNotes\n     *\n     * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token\n     * and a function returning a promise.\n     *\n     * ```\n     *  function initializeApp(): Promise<any> {\n     *    return new Promise((resolve, reject) => {\n     *      // Do some asynchronous stuff\n     *      resolve();\n     *    });\n     *  }\n     *\n     *  @NgModule({\n     *   imports: [BrowserModule],\n     *   declarations: [AppComponent],\n     *   bootstrap: [AppComponent],\n     *   providers: [{\n     *     provide: APP_INITIALIZER,\n     *     useFactory: () => initializeApp,\n     *     multi: true\n     *    }]\n     *   })\n     *  export class AppModule {}\n     * ```\n     *\n     * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function\n     * returning an observable, see an example below. Note: the `HttpClient` in this example is used for\n     * demo purposes to illustrate how the factory function can work with other providers available\n     * through DI.\n     *\n     * ```\n     *  function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {\n     *   return () => httpClient.get(\"https://someUrl.com/api/user\")\n     *     .pipe(\n     *        tap(user => { ... })\n     *     );\n     *  }\n     *\n     *  @NgModule({\n     *    imports: [BrowserModule, HttpClientModule],\n     *    declarations: [AppComponent],\n     *    bootstrap: [AppComponent],\n     *    providers: [{\n     *      provide: APP_INITIALIZER,\n     *      useFactory: initializeAppFactory,\n     *      deps: [HttpClient],\n     *      multi: true\n     *    }]\n     *  })\n     *  export class AppModule {}\n     * ```\n     *\n     * @publicApi\n     */\n    var APP_INITIALIZER = new InjectionToken('Application Initializer');\n    /**\n     * A class that reflects the state of running {@link APP_INITIALIZER} functions.\n     *\n     * @publicApi\n     */\n    var ApplicationInitStatus = /** @class */ (function () {\n        function ApplicationInitStatus(appInits) {\n            var _this = this;\n            this.appInits = appInits;\n            this.resolve = noop;\n            this.reject = noop;\n            this.initialized = false;\n            this.done = false;\n            this.donePromise = new Promise(function (res, rej) {\n                _this.resolve = res;\n                _this.reject = rej;\n            });\n        }\n        /** @internal */\n        ApplicationInitStatus.prototype.runInitializers = function () {\n            var _this = this;\n            if (this.initialized) {\n                return;\n            }\n            var asyncInitPromises = [];\n            var complete = function () {\n                _this.done = true;\n                _this.resolve();\n            };\n            if (this.appInits) {\n                var _loop_1 = function (i) {\n                    var initResult = this_1.appInits[i]();\n                    if (isPromise(initResult)) {\n                        asyncInitPromises.push(initResult);\n                    }\n                    else if (isObservable(initResult)) {\n                        var observableAsPromise = new Promise(function (resolve, reject) {\n                            initResult.subscribe({ complete: resolve, error: reject });\n                        });\n                        asyncInitPromises.push(observableAsPromise);\n                    }\n                };\n                var this_1 = this;\n                for (var i = 0; i < this.appInits.length; i++) {\n                    _loop_1(i);\n                }\n            }\n            Promise.all(asyncInitPromises)\n                .then(function () {\n                complete();\n            })\n                .catch(function (e) {\n                _this.reject(e);\n            });\n            if (asyncInitPromises.length === 0) {\n                complete();\n            }\n            this.initialized = true;\n        };\n        return ApplicationInitStatus;\n    }());\n    ApplicationInitStatus.decorators = [\n        { type: Injectable }\n    ];\n    ApplicationInitStatus.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A [DI token](guide/glossary#di-token \"DI token definition\") representing a unique string ID, used\n     * primarily for prefixing application attributes and CSS styles when\n     * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.\n     *\n     * BY default, the value is randomly generated and assigned to the application by Angular.\n     * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure\n     * the root {@link Injector} that uses this token.\n     *\n     * @publicApi\n     */\n    var APP_ID = new InjectionToken('AppId');\n    function _appIdRandomProviderFactory() {\n        return \"\" + _randomChar() + _randomChar() + _randomChar();\n    }\n    /**\n     * Providers that generate a random `APP_ID_TOKEN`.\n     * @publicApi\n     */\n    var APP_ID_RANDOM_PROVIDER = {\n        provide: APP_ID,\n        useFactory: _appIdRandomProviderFactory,\n        deps: [],\n    };\n    function _randomChar() {\n        return String.fromCharCode(97 + Math.floor(Math.random() * 25));\n    }\n    /**\n     * A function that is executed when a platform is initialized.\n     * @publicApi\n     */\n    var PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');\n    /**\n     * A token that indicates an opaque platform ID.\n     * @publicApi\n     */\n    var PLATFORM_ID = new InjectionToken('Platform ID');\n    /**\n     * A [DI token](guide/glossary#di-token \"DI token definition\") that provides a set of callbacks to\n     * be called for every component that is bootstrapped.\n     *\n     * Each callback must take a `ComponentRef` instance and return nothing.\n     *\n     * `(componentRef: ComponentRef) => void`\n     *\n     * @publicApi\n     */\n    var APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');\n    /**\n     * A [DI token](guide/glossary#di-token \"DI token definition\") that indicates the root directory of\n     * the application\n     * @publicApi\n     */\n    var PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');\n\n    /**\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://angular.io/license\n     */\n    var Console = /** @class */ (function () {\n        function Console() {\n        }\n        Console.prototype.log = function (message) {\n            // tslint:disable-next-line:no-console\n            console.log(message);\n        };\n        // Note: for reporting errors use `DOM.logError()` as it is platform specific\n        Console.prototype.warn = function (message) {\n            // tslint:disable-next-line:no-console\n            console.warn(message);\n        };\n        return Console;\n    }());\n    Console.decorators = [\n        { type: Injectable }\n    ];\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Provide this token to set the locale of your application.\n     * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n     * DecimalPipe and PercentPipe) and by ICU expressions.\n     *\n     * See the [i18n guide](guide/i18n#setting-up-locale) for more information.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * import { LOCALE_ID } from '@angular/core';\n     * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n     * import { AppModule } from './app/app.module';\n     *\n     * platformBrowserDynamic().bootstrapModule(AppModule, {\n     *   providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n     * });\n     * ```\n     *\n     * @publicApi\n     */\n    var LOCALE_ID$1 = new InjectionToken('LocaleId');\n    /**\n     * Provide this token to set the default currency code your application uses for\n     * CurrencyPipe when there is no currency code passed into it. This is only used by\n     * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.\n     *\n     * See the [i18n guide](guide/i18n#setting-up-locale) for more information.\n     *\n     * <div class=\"alert is-helpful\">\n     *\n     * **Deprecation notice:**\n     *\n     * The default currency code is currently always `USD` but this is deprecated from v9.\n     *\n     * **In v10 the default currency code will be taken from the current locale.**\n     *\n     * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n     * your application `NgModule`:\n     *\n     * ```ts\n     * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n     * ```\n     *\n     * </div>\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n     * import { AppModule } from './app/app.module';\n     *\n     * platformBrowserDynamic().bootstrapModule(AppModule, {\n     *   providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n     * });\n     * ```\n     *\n     * @publicApi\n     */\n    var DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode');\n    /**\n     * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n     * `xlf` or `xlf2`) when you want to translate your application in another language.\n     *\n     * See the [i18n guide](guide/i18n#merge) for more information.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * import { TRANSLATIONS } from '@angular/core';\n     * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n     * import { AppModule } from './app/app.module';\n     *\n     * // content of your translation file\n     * const translations = '....';\n     *\n     * platformBrowserDynamic().bootstrapModule(AppModule, {\n     *   providers: [{provide: TRANSLATIONS, useValue: translations }]\n     * });\n     * ```\n     *\n     * @publicApi\n     */\n    var TRANSLATIONS = new InjectionToken('Translations');\n    /**\n     * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n     * `xlf` or `xlf2`.\n     *\n     * See the [i18n guide](guide/i18n#merge) for more information.\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```typescript\n     * import { TRANSLATIONS_FORMAT } from '@angular/core';\n     * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n     * import { AppModule } from './app/app.module';\n     *\n     * platformBrowserDynamic().bootstrapModule(AppModule, {\n     *   providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n     * });\n     * ```\n     *\n     * @publicApi\n     */\n    var TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');\n    (function (MissingTranslationStrategy) {\n        MissingTranslationStrategy[MissingTranslationStrategy[\"Error\"] = 0] = \"Error\";\n        MissingTranslationStrategy[MissingTranslationStrategy[\"Warning\"] = 1] = \"Warning\";\n        MissingTranslationStrategy[MissingTranslationStrategy[\"Ignore\"] = 2] = \"Ignore\";\n    })(exports.MissingTranslationStrategy || (exports.MissingTranslationStrategy = {}));\n\n    /**\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://angular.io/license\n     */\n    var SWITCH_IVY_ENABLED__POST_R3__ = true;\n    var SWITCH_IVY_ENABLED__PRE_R3__ = false;\n    var ivyEnabled = SWITCH_IVY_ENABLED__PRE_R3__;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Combination of NgModuleFactory and ComponentFactories.\n     *\n     * @publicApi\n     */\n    var ModuleWithComponentFactories = /** @class */ (function () {\n        function ModuleWithComponentFactories(ngModuleFactory, componentFactories) {\n            this.ngModuleFactory = ngModuleFactory;\n            this.componentFactories = componentFactories;\n        }\n        return ModuleWithComponentFactories;\n    }());\n    function _throwError() {\n        throw new Error(\"Runtime compiler is not loaded\");\n    }\n    var Compiler_compileModuleSync__PRE_R3__ = _throwError;\n    var Compiler_compileModuleSync__POST_R3__ = function (moduleType) {\n        return new NgModuleFactory$1(moduleType);\n    };\n    var Compiler_compileModuleSync = Compiler_compileModuleSync__PRE_R3__;\n    var Compiler_compileModuleAsync__PRE_R3__ = _throwError;\n    var Compiler_compileModuleAsync__POST_R3__ = function (moduleType) {\n        return Promise.resolve(Compiler_compileModuleSync__POST_R3__(moduleType));\n    };\n    var Compiler_compileModuleAsync = Compiler_compileModuleAsync__PRE_R3__;\n    var Compiler_compileModuleAndAllComponentsSync__PRE_R3__ = _throwError;\n    var Compiler_compileModuleAndAllComponentsSync__POST_R3__ = function (moduleType) {\n        var ngModuleFactory = Compiler_compileModuleSync__POST_R3__(moduleType);\n        var moduleDef = getNgModuleDef(moduleType);\n        var componentFactories = maybeUnwrapFn(moduleDef.declarations)\n            .reduce(function (factories, declaration) {\n            var componentDef = getComponentDef(declaration);\n            componentDef && factories.push(new ComponentFactory$1(componentDef));\n            return factories;\n        }, []);\n        return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n    };\n    var Compiler_compileModuleAndAllComponentsSync = Compiler_compileModuleAndAllComponentsSync__PRE_R3__;\n    var Compiler_compileModuleAndAllComponentsAsync__PRE_R3__ = _throwError;\n    var Compiler_compileModuleAndAllComponentsAsync__POST_R3__ = function (moduleType) {\n        return Promise.resolve(Compiler_compileModuleAndAllComponentsSync__POST_R3__(moduleType));\n    };\n    var Compiler_compileModuleAndAllComponentsAsync = Compiler_compileModuleAndAllComponentsAsync__PRE_R3__;\n    /**\n     * Low-level service for running the angular compiler during runtime\n     * to create {@link ComponentFactory}s, which\n     * can later be used to create and render a Component instance.\n     *\n     * Each `@NgModule` provides an own `Compiler` to its injector,\n     * that will use the directives/pipes of the ng module for compilation\n     * of components.\n     *\n     * @publicApi\n     */\n    var Compiler = /** @class */ (function () {\n        function Compiler() {\n            /**\n             * Compiles the given NgModule and all of its components. All templates of the components listed\n             * in `entryComponents` have to be inlined.\n             */\n            this.compileModuleSync = Compiler_compileModuleSync;\n            /**\n             * Compiles the given NgModule and all of its components\n             */\n            this.compileModuleAsync = Compiler_compileModuleAsync;\n            /**\n             * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.\n             */\n            this.compileModuleAndAllComponentsSync = Compiler_compileModuleAndAllComponentsSync;\n            /**\n             * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.\n             */\n            this.compileModuleAndAllComponentsAsync = Compiler_compileModuleAndAllComponentsAsync;\n        }\n        /**\n         * Clears all caches.\n         */\n        Compiler.prototype.clearCache = function () { };\n        /**\n         * Clears the cache for the given component/ngModule.\n         */\n        Compiler.prototype.clearCacheFor = function (type) { };\n        /**\n         * Returns the id for a given NgModule, if one is defined and known to the compiler.\n         */\n        Compiler.prototype.getModuleId = function (moduleType) {\n            return undefined;\n        };\n        return Compiler;\n    }());\n    Compiler.decorators = [\n        { type: Injectable }\n    ];\n    /**\n     * Token to provide CompilerOptions in the platform injector.\n     *\n     * @publicApi\n     */\n    var COMPILER_OPTIONS = new InjectionToken('compilerOptions');\n    /**\n     * A factory for creating a Compiler\n     *\n     * @publicApi\n     */\n    var CompilerFactory = /** @class */ (function () {\n        function CompilerFactory() {\n        }\n        return CompilerFactory;\n    }());\n\n    /**\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://angular.io/license\n     */\n    var promise = (function () { return Promise.resolve(0); })();\n    function scheduleMicroTask(fn) {\n        if (typeof Zone === 'undefined') {\n            // use promise to schedule microTask instead of use Zone\n            promise.then(function () {\n                fn && fn.apply(null, null);\n            });\n        }\n        else {\n            Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function getNativeRequestAnimationFrame() {\n        var nativeRequestAnimationFrame = _global['requestAnimationFrame'];\n        var nativeCancelAnimationFrame = _global['cancelAnimationFrame'];\n        if (typeof Zone !== 'undefined' && nativeRequestAnimationFrame && nativeCancelAnimationFrame) {\n            // use unpatched version of requestAnimationFrame(native delegate) if possible\n            // to avoid another Change detection\n            var unpatchedRequestAnimationFrame = nativeRequestAnimationFrame[Zone.__symbol__('OriginalDelegate')];\n            if (unpatchedRequestAnimationFrame) {\n                nativeRequestAnimationFrame = unpatchedRequestAnimationFrame;\n            }\n            var unpatchedCancelAnimationFrame = nativeCancelAnimationFrame[Zone.__symbol__('OriginalDelegate')];\n            if (unpatchedCancelAnimationFrame) {\n                nativeCancelAnimationFrame = unpatchedCancelAnimationFrame;\n            }\n        }\n        return { nativeRequestAnimationFrame: nativeRequestAnimationFrame, nativeCancelAnimationFrame: nativeCancelAnimationFrame };\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An injectable service for executing work inside or outside of the Angular zone.\n     *\n     * The most common use of this service is to optimize performance when starting a work consisting of\n     * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n     * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n     * can reenter the Angular zone via {@link #run}.\n     *\n     * <!-- TODO: add/fix links to:\n     *   - docs explaining zones and the use of zones in Angular and change-detection\n     *   - link to runOutsideAngular/run (throughout this file!)\n     *   -->\n     *\n     * @usageNotes\n     * ### Example\n     *\n     * ```\n     * import {Component, NgZone} from '@angular/core';\n     * import {NgIf} from '@angular/common';\n     *\n     * @Component({\n     *   selector: 'ng-zone-demo',\n     *   template: `\n     *     <h2>Demo: NgZone</h2>\n     *\n     *     <p>Progress: {{progress}}%</p>\n     *     <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n     *\n     *     <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n     *     <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n     *   `,\n     * })\n     * export class NgZoneDemo {\n     *   progress: number = 0;\n     *   label: string;\n     *\n     *   constructor(private _ngZone: NgZone) {}\n     *\n     *   // Loop inside the Angular zone\n     *   // so the UI DOES refresh after each setTimeout cycle\n     *   processWithinAngularZone() {\n     *     this.label = 'inside';\n     *     this.progress = 0;\n     *     this._increaseProgress(() => console.log('Inside Done!'));\n     *   }\n     *\n     *   // Loop outside of the Angular zone\n     *   // so the UI DOES NOT refresh after each setTimeout cycle\n     *   processOutsideOfAngularZone() {\n     *     this.label = 'outside';\n     *     this.progress = 0;\n     *     this._ngZone.runOutsideAngular(() => {\n     *       this._increaseProgress(() => {\n     *         // reenter the Angular zone and display done\n     *         this._ngZone.run(() => { console.log('Outside Done!'); });\n     *       });\n     *     });\n     *   }\n     *\n     *   _increaseProgress(doneCallback: () => void) {\n     *     this.progress += 1;\n     *     console.log(`Current progress: ${this.progress}%`);\n     *\n     *     if (this.progress < 100) {\n     *       window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n     *     } else {\n     *       doneCallback();\n     *     }\n     *   }\n     * }\n     * ```\n     *\n     * @publicApi\n     */\n    var NgZone = /** @class */ (function () {\n        function NgZone(_a) {\n            var _b = _a.enableLongStackTrace, enableLongStackTrace = _b === void 0 ? false : _b, _c = _a.shouldCoalesceEventChangeDetection, shouldCoalesceEventChangeDetection = _c === void 0 ? false : _c, _d = _a.shouldCoalesceRunChangeDetection, shouldCoalesceRunChangeDetection = _d === void 0 ? false : _d;\n            this.hasPendingMacrotasks = false;\n            this.hasPendingMicrotasks = false;\n            /**\n             * Whether there are no outstanding microtasks or macrotasks.\n             */\n            this.isStable = true;\n            /**\n             * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n             */\n            this.onUnstable = new EventEmitter(false);\n            /**\n             * Notifies when there is no more microtasks enqueued in the current VM Turn.\n             * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n             * For this reason this event can fire multiple times per VM Turn.\n             */\n            this.onMicrotaskEmpty = new EventEmitter(false);\n            /**\n             * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n             * implies we are about to relinquish VM turn.\n             * This event gets called just once.\n             */\n            this.onStable = new EventEmitter(false);\n            /**\n             * Notifies that an error has been delivered.\n             */\n            this.onError = new EventEmitter(false);\n            if (typeof Zone == 'undefined') {\n                throw new Error(\"In this configuration Angular requires Zone.js\");\n            }\n            Zone.assertZonePatched();\n            var self = this;\n            self._nesting = 0;\n            self._outer = self._inner = Zone.current;\n            if (Zone['TaskTrackingZoneSpec']) {\n                self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']);\n            }\n            if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n                self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n            }\n            // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n            // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n            self.shouldCoalesceEventChangeDetection =\n                !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n            self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n            self.lastRequestAnimationFrameId = -1;\n            self.nativeRequestAnimationFrame = getNativeRequestAnimationFrame().nativeRequestAnimationFrame;\n            forkInnerZoneWithAngularBehavior(self);\n        }\n        NgZone.isInAngularZone = function () {\n            return Zone.current.get('isAngularZone') === true;\n        };\n        NgZone.assertInAngularZone = function () {\n            if (!NgZone.isInAngularZone()) {\n                throw new Error('Expected to be in Angular Zone, but it is not!');\n            }\n        };\n        NgZone.assertNotInAngularZone = function () {\n            if (NgZone.isInAngularZone()) {\n                throw new Error('Expected to not be in Angular Zone, but it is!');\n            }\n        };\n        /**\n         * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n         * the function.\n         *\n         * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n         * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n         *\n         * Any future tasks or microtasks scheduled from within this function will continue executing from\n         * within the Angular zone.\n         *\n         * If a synchronous error happens it will be rethrown and not reported via `onError`.\n         */\n        NgZone.prototype.run = function (fn, applyThis, applyArgs) {\n            return this._inner.run(fn, applyThis, applyArgs);\n        };\n        /**\n         * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n         * returned by the function.\n         *\n         * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n         * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n         *\n         * Any future tasks or microtasks scheduled from within this function will continue executing from\n         * within the Angular zone.\n         *\n         * If a synchronous error happens it will be rethrown and not reported via `onError`.\n         */\n        NgZone.prototype.runTask = function (fn, applyThis, applyArgs, name) {\n            var zone = this._inner;\n            var task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n            try {\n                return zone.runTask(task, applyThis, applyArgs);\n            }\n            finally {\n                zone.cancelTask(task);\n            }\n        };\n        /**\n         * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n         * rethrown.\n         */\n        NgZone.prototype.runGuarded = function (fn, applyThis, applyArgs) {\n            return this._inner.runGuarded(fn, applyThis, applyArgs);\n        };\n        /**\n         * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n         * the function.\n         *\n         * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n         * work that\n         * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n         *\n         * Any future tasks or microtasks scheduled from within this function will continue executing from\n         * outside of the Angular zone.\n         *\n         * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n         */\n        NgZone.prototype.runOutsideAngular = function (fn) {\n            return this._outer.run(fn);\n        };\n        return NgZone;\n    }());\n    var EMPTY_PAYLOAD = {};\n    function checkStable(zone) {\n        // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n        // re-entry. The case is:\n        //\n        // @Component({...})\n        // export class AppComponent {\n        // constructor(private ngZone: NgZone) {\n        //   this.ngZone.onStable.subscribe(() => {\n        //     this.ngZone.run(() => console.log('stable'););\n        //   });\n        // }\n        //\n        // The onStable subscriber run another function inside ngZone\n        // which causes `checkStable()` re-entry.\n        // But this fix causes some issues in g3, so this fix will be\n        // launched in another PR.\n        if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n            try {\n                zone._nesting++;\n                zone.onMicrotaskEmpty.emit(null);\n            }\n            finally {\n                zone._nesting--;\n                if (!zone.hasPendingMicrotasks) {\n                    try {\n                        zone.runOutsideAngular(function () { return zone.onStable.emit(null); });\n                    }\n                    finally {\n                        zone.isStable = true;\n                    }\n                }\n            }\n        }\n    }\n    function delayChangeDetectionForEvents(zone) {\n        /**\n         * We also need to check _nesting here\n         * Consider the following case with shouldCoalesceRunChangeDetection = true\n         *\n         * ngZone.run(() => {});\n         * ngZone.run(() => {});\n         *\n         * We want the two `ngZone.run()` only trigger one change detection\n         * when shouldCoalesceRunChangeDetection is true.\n         * And because in this case, change detection run in async way(requestAnimationFrame),\n         * so we also need to check the _nesting here to prevent multiple\n         * change detections.\n         */\n        if (zone.isCheckStableRunning || zone.lastRequestAnimationFrameId !== -1) {\n            return;\n        }\n        zone.lastRequestAnimationFrameId = zone.nativeRequestAnimationFrame.call(_global, function () {\n            // This is a work around for https://github.com/angular/angular/issues/36839.\n            // The core issue is that when event coalescing is enabled it is possible for microtasks\n            // to get flushed too early (As is the case with `Promise.then`) between the\n            // coalescing eventTasks.\n            //\n            // To workaround this we schedule a \"fake\" eventTask before we process the\n            // coalescing eventTasks. The benefit of this is that the \"fake\" container eventTask\n            //  will prevent the microtasks queue from getting drained in between the coalescing\n            // eventTask execution.\n            if (!zone.fakeTopEventTask) {\n                zone.fakeTopEventTask = Zone.root.scheduleEventTask('fakeTopEventTask', function () {\n                    zone.lastRequestAnimationFrameId = -1;\n                    updateMicroTaskStatus(zone);\n                    zone.isCheckStableRunning = true;\n                    checkStable(zone);\n                    zone.isCheckStableRunning = false;\n                }, undefined, function () { }, function () { });\n            }\n            zone.fakeTopEventTask.invoke();\n        });\n        updateMicroTaskStatus(zone);\n    }\n    function forkInnerZoneWithAngularBehavior(zone) {\n        var delayChangeDetectionForEventsDelegate = function () {\n            delayChangeDetectionForEvents(zone);\n        };\n        zone._inner = zone._inner.fork({\n            name: 'angular',\n            properties: { 'isAngularZone': true },\n            onInvokeTask: function (delegate, current, target, task, applyThis, applyArgs) {\n                try {\n                    onEnter(zone);\n                    return delegate.invokeTask(target, task, applyThis, applyArgs);\n                }\n                finally {\n                    if ((zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask') ||\n                        zone.shouldCoalesceRunChangeDetection) {\n                        delayChangeDetectionForEventsDelegate();\n                    }\n                    onLeave(zone);\n                }\n            },\n            onInvoke: function (delegate, current, target, callback, applyThis, applyArgs, source) {\n                try {\n                    onEnter(zone);\n                    return delegate.invoke(target, callback, applyThis, applyArgs, source);\n                }\n                finally {\n                    if (zone.shouldCoalesceRunChangeDetection) {\n                        delayChangeDetectionForEventsDelegate();\n                    }\n                    onLeave(zone);\n                }\n            },\n            onHasTask: function (delegate, current, target, hasTaskState) {\n                delegate.hasTask(target, hasTaskState);\n                if (current === target) {\n                    // We are only interested in hasTask events which originate from our zone\n                    // (A child hasTask event is not interesting to us)\n                    if (hasTaskState.change == 'microTask') {\n                        zone._hasPendingMicrotasks = hasTaskState.microTask;\n                        updateMicroTaskStatus(zone);\n                        checkStable(zone);\n                    }\n                    else if (hasTaskState.change == 'macroTask') {\n                        zone.hasPendingMacrotasks = hasTaskState.macroTask;\n                    }\n                }\n            },\n            onHandleError: function (delegate, current, target, error) {\n                delegate.handleError(target, error);\n                zone.runOutsideAngular(function () { return zone.onError.emit(error); });\n                return false;\n            }\n        });\n    }\n    function updateMicroTaskStatus(zone) {\n        if (zone._hasPendingMicrotasks ||\n            ((zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) &&\n                zone.lastRequestAnimationFrameId !== -1)) {\n            zone.hasPendingMicrotasks = true;\n        }\n        else {\n            zone.hasPendingMicrotasks = false;\n        }\n    }\n    function onEnter(zone) {\n        zone._nesting++;\n        if (zone.isStable) {\n            zone.isStable = false;\n            zone.onUnstable.emit(null);\n        }\n    }\n    function onLeave(zone) {\n        zone._nesting--;\n        checkStable(zone);\n    }\n    /**\n     * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n     * to framework to perform rendering.\n     */\n    var NoopNgZone = /** @class */ (function () {\n        function NoopNgZone() {\n            this.hasPendingMicrotasks = false;\n            this.hasPendingMacrotasks = false;\n            this.isStable = true;\n            this.onUnstable = new EventEmitter();\n            this.onMicrotaskEmpty = new EventEmitter();\n            this.onStable = new EventEmitter();\n            this.onError = new EventEmitter();\n        }\n        NoopNgZone.prototype.run = function (fn, applyThis, applyArgs) {\n            return fn.apply(applyThis, applyArgs);\n        };\n        NoopNgZone.prototype.runGuarded = function (fn, applyThis, applyArgs) {\n            return fn.apply(applyThis, applyArgs);\n        };\n        NoopNgZone.prototype.runOutsideAngular = function (fn) {\n            return fn();\n        };\n        NoopNgZone.prototype.runTask = function (fn, applyThis, applyArgs, name) {\n            return fn.apply(applyThis, applyArgs);\n        };\n        return NoopNgZone;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * The Testability service provides testing hooks that can be accessed from\n     * the browser. Each bootstrapped Angular application on the page will have\n     * an instance of Testability.\n     * @publicApi\n     */\n    var Testability = /** @class */ (function () {\n        function Testability(_ngZone) {\n            var _this = this;\n            this._ngZone = _ngZone;\n            this._pendingCount = 0;\n            this._isZoneStable = true;\n            /**\n             * Whether any work was done since the last 'whenStable' callback. This is\n             * useful to detect if this could have potentially destabilized another\n             * component while it is stabilizing.\n             * @internal\n             */\n            this._didWork = false;\n            this._callbacks = [];\n            this.taskTrackingZone = null;\n            this._watchAngularEvents();\n            _ngZone.run(function () {\n                _this.taskTrackingZone =\n                    typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n            });\n        }\n        Testability.prototype._watchAngularEvents = function () {\n            var _this = this;\n            this._ngZone.onUnstable.subscribe({\n                next: function () {\n                    _this._didWork = true;\n                    _this._isZoneStable = false;\n                }\n            });\n            this._ngZone.runOutsideAngular(function () {\n                _this._ngZone.onStable.subscribe({\n                    next: function () {\n                        NgZone.assertNotInAngularZone();\n                        scheduleMicroTask(function () {\n                            _this._isZoneStable = true;\n                            _this._runCallbacksIfReady();\n                        });\n                    }\n                });\n            });\n        };\n        /**\n         * Increases the number of pending request\n         * @deprecated pending requests are now tracked with zones.\n         */\n        Testability.prototype.increasePendingRequestCount = function () {\n            this._pendingCount += 1;\n            this._didWork = true;\n            return this._pendingCount;\n        };\n        /**\n         * Decreases the number of pending request\n         * @deprecated pending requests are now tracked with zones\n         */\n        Testability.prototype.decreasePendingRequestCount = function () {\n            this._pendingCount -= 1;\n            if (this._pendingCount < 0) {\n                throw new Error('pending async requests below zero');\n            }\n            this._runCallbacksIfReady();\n            return this._pendingCount;\n        };\n        /**\n         * Whether an associated application is stable\n         */\n        Testability.prototype.isStable = function () {\n            return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;\n        };\n        Testability.prototype._runCallbacksIfReady = function () {\n            var _this = this;\n            if (this.isStable()) {\n                // Schedules the call backs in a new frame so that it is always async.\n                scheduleMicroTask(function () {\n                    while (_this._callbacks.length !== 0) {\n                        var cb = _this._callbacks.pop();\n                        clearTimeout(cb.timeoutId);\n                        cb.doneCb(_this._didWork);\n                    }\n                    _this._didWork = false;\n                });\n            }\n            else {\n                // Still not stable, send updates.\n                var pending_1 = this.getPendingTasks();\n                this._callbacks = this._callbacks.filter(function (cb) {\n                    if (cb.updateCb && cb.updateCb(pending_1)) {\n                        clearTimeout(cb.timeoutId);\n                        return false;\n                    }\n                    return true;\n                });\n                this._didWork = true;\n            }\n        };\n        Testability.prototype.getPendingTasks = function () {\n            if (!this.taskTrackingZone) {\n                return [];\n            }\n            // Copy the tasks data so that we don't leak tasks.\n            return this.taskTrackingZone.macroTasks.map(function (t) {\n                return {\n                    source: t.source,\n                    // From TaskTrackingZone:\n                    // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n                    creationLocation: t.creationLocation,\n                    data: t.data\n                };\n            });\n        };\n        Testability.prototype.addCallback = function (cb, timeout, updateCb) {\n            var _this = this;\n            var timeoutId = -1;\n            if (timeout && timeout > 0) {\n                timeoutId = setTimeout(function () {\n                    _this._callbacks = _this._callbacks.filter(function (cb) { return cb.timeoutId !== timeoutId; });\n                    cb(_this._didWork, _this.getPendingTasks());\n                }, timeout);\n            }\n            this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb });\n        };\n        /**\n         * Wait for the application to be stable with a timeout. If the timeout is reached before that\n         * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n         *\n         * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n         *    whichever comes first.\n         * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n         *    specified, whenStable() will wait forever.\n         * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n         *    pending macrotasks changes. If this callback returns true doneCb will not be invoked\n         *    and no further updates will be issued.\n         */\n        Testability.prototype.whenStable = function (doneCb, timeout, updateCb) {\n            if (updateCb && !this.taskTrackingZone) {\n                throw new Error('Task tracking zone is required when passing an update callback to ' +\n                    'whenStable(). Is \"zone.js/plugins/task-tracking\" loaded?');\n            }\n            // These arguments are 'Function' above to keep the public API simple.\n            this.addCallback(doneCb, timeout, updateCb);\n            this._runCallbacksIfReady();\n        };\n        /**\n         * Get the number of pending requests\n         * @deprecated pending requests are now tracked with zones\n         */\n        Testability.prototype.getPendingRequestCount = function () {\n            return this._pendingCount;\n        };\n        /**\n         * Find providers by name\n         * @param using The root element to search from\n         * @param provider The name of binding variable\n         * @param exactMatch Whether using exactMatch\n         */\n        Testability.prototype.findProviders = function (using, provider, exactMatch) {\n            // TODO(juliemr): implement.\n            return [];\n        };\n        return Testability;\n    }());\n    Testability.decorators = [\n        { type: Injectable }\n    ];\n    Testability.ctorParameters = function () { return [\n        { type: NgZone }\n    ]; };\n    /**\n     * A global registry of {@link Testability} instances for specific elements.\n     * @publicApi\n     */\n    var TestabilityRegistry = /** @class */ (function () {\n        function TestabilityRegistry() {\n            /** @internal */\n            this._applications = new Map();\n            _testabilityGetter.addToWindow(this);\n        }\n        /**\n         * Registers an application with a testability hook so that it can be tracked\n         * @param token token of application, root element\n         * @param testability Testability hook\n         */\n        TestabilityRegistry.prototype.registerApplication = function (token, testability) {\n            this._applications.set(token, testability);\n        };\n        /**\n         * Unregisters an application.\n         * @param token token of application, root element\n         */\n        TestabilityRegistry.prototype.unregisterApplication = function (token) {\n            this._applications.delete(token);\n        };\n        /**\n         * Unregisters all applications\n         */\n        TestabilityRegistry.prototype.unregisterAllApplications = function () {\n            this._applications.clear();\n        };\n        /**\n         * Get a testability hook associated with the application\n         * @param elem root element\n         */\n        TestabilityRegistry.prototype.getTestability = function (elem) {\n            return this._applications.get(elem) || null;\n        };\n        /**\n         * Get all registered testabilities\n         */\n        TestabilityRegistry.prototype.getAllTestabilities = function () {\n            return Array.from(this._applications.values());\n        };\n        /**\n         * Get all registered applications(root elements)\n         */\n        TestabilityRegistry.prototype.getAllRootElements = function () {\n            return Array.from(this._applications.keys());\n        };\n        /**\n         * Find testability of a node in the Tree\n         * @param elem node\n         * @param findInAncestors whether finding testability in ancestors if testability was not found in\n         * current node\n         */\n        TestabilityRegistry.prototype.findTestabilityInTree = function (elem, findInAncestors) {\n            if (findInAncestors === void 0) { findInAncestors = true; }\n            return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);\n        };\n        return TestabilityRegistry;\n    }());\n    TestabilityRegistry.decorators = [\n        { type: Injectable }\n    ];\n    TestabilityRegistry.ctorParameters = function () { return []; };\n    var _NoopGetTestability = /** @class */ (function () {\n        function _NoopGetTestability() {\n        }\n        _NoopGetTestability.prototype.addToWindow = function (registry) { };\n        _NoopGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {\n            return null;\n        };\n        return _NoopGetTestability;\n    }());\n    /**\n     * Set the {@link GetTestability} implementation used by the Angular testing framework.\n     * @publicApi\n     */\n    function setTestabilityGetter(getter) {\n        _testabilityGetter = getter;\n    }\n    var _testabilityGetter = new _NoopGetTestability();\n\n    /**\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://angular.io/license\n     */\n    /**\n     * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.\n     *\n     * For more information on how to run and debug tests with either Ivy or View Engine (legacy),\n     * please see [BAZEL.md](./docs/BAZEL.md).\n     */\n    var _devMode = true;\n    var _runModeLocked = false;\n    /**\n     * Returns whether Angular is in development mode. After called once,\n     * the value is locked and won't change any more.\n     *\n     * By default, this is true, unless a user calls `enableProdMode` before calling this.\n     *\n     * @publicApi\n     */\n    function isDevMode() {\n        _runModeLocked = true;\n        return _devMode;\n    }\n    /**\n     * Disable Angular's development mode, which turns off assertions and other\n     * checks within the framework.\n     *\n     * One important assertion this disables verifies that a change detection pass\n     * does not result in additional changes to any bindings (also known as\n     * unidirectional data flow).\n     *\n     * @publicApi\n     */\n    function enableProdMode() {\n        if (_runModeLocked) {\n            throw new Error('Cannot enable prod mode after platform setup.');\n        }\n        // The below check is there so when ngDevMode is set via terser\n        // `global['ngDevMode'] = false;` is also dropped.\n        if (typeof ngDevMode === undefined || !!ngDevMode) {\n            _global['ngDevMode'] = false;\n        }\n        _devMode = false;\n    }\n\n    var _platform;\n    var compileNgModuleFactory = compileNgModuleFactory__PRE_R3__;\n    function compileNgModuleFactory__PRE_R3__(injector, options, moduleType) {\n        var compilerFactory = injector.get(CompilerFactory);\n        var compiler = compilerFactory.createCompiler([options]);\n        return compiler.compileModuleAsync(moduleType);\n    }\n    function compileNgModuleFactory__POST_R3__(injector, options, moduleType) {\n        ngDevMode && assertNgModuleType(moduleType);\n        var moduleFactory = new NgModuleFactory$1(moduleType);\n        // All of the logic below is irrelevant for AOT-compiled code.\n        if (typeof ngJitMode !== 'undefined' && !ngJitMode) {\n            return Promise.resolve(moduleFactory);\n        }\n        var compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);\n        // Configure the compiler to use the provided options. This call may fail when multiple modules\n        // are bootstrapped with incompatible options, as a component can only be compiled according to\n        // a single set of options.\n        setJitOptions({\n            defaultEncapsulation: _lastDefined(compilerOptions.map(function (opts) { return opts.defaultEncapsulation; })),\n            preserveWhitespaces: _lastDefined(compilerOptions.map(function (opts) { return opts.preserveWhitespaces; })),\n        });\n        if (isComponentResourceResolutionQueueEmpty()) {\n            return Promise.resolve(moduleFactory);\n        }\n        var compilerProviders = _mergeArrays(compilerOptions.map(function (o) { return o.providers; }));\n        // In case there are no compiler providers, we just return the module factory as\n        // there won't be any resource loader. This can happen with Ivy, because AOT compiled\n        // modules can be still passed through \"bootstrapModule\". In that case we shouldn't\n        // unnecessarily require the JIT compiler.\n        if (compilerProviders.length === 0) {\n            return Promise.resolve(moduleFactory);\n        }\n        var compiler = getCompilerFacade({\n            usage: 0 /* Decorator */,\n            kind: 'NgModule',\n            type: moduleType,\n        });\n        var compilerInjector = Injector.create({ providers: compilerProviders });\n        var resourceLoader = compilerInjector.get(compiler.ResourceLoader);\n        // The resource loader can also return a string while the \"resolveComponentResources\"\n        // always expects a promise. Therefore we need to wrap the returned value in a promise.\n        return resolveComponentResources(function (url) { return Promise.resolve(resourceLoader.get(url)); })\n            .then(function () { return moduleFactory; });\n    }\n    // the `window.ng` global utilities are only available in non-VE versions of\n    // Angular. The function switch below will make sure that the code is not\n    // included into Angular when PRE mode is active.\n    function publishDefaultGlobalUtils__PRE_R3__() { }\n    function publishDefaultGlobalUtils__POST_R3__() {\n        ngDevMode && publishDefaultGlobalUtils();\n    }\n    var publishDefaultGlobalUtils$1 = publishDefaultGlobalUtils__PRE_R3__;\n    var isBoundToModule = isBoundToModule__PRE_R3__;\n    function isBoundToModule__PRE_R3__(cf) {\n        return cf instanceof ComponentFactoryBoundToModule;\n    }\n    function isBoundToModule__POST_R3__(cf) {\n        return cf.isBoundToModule;\n    }\n    var ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');\n    /**\n     * A token for third-party components that can register themselves with NgProbe.\n     *\n     * @publicApi\n     */\n    var NgProbeToken = /** @class */ (function () {\n        function NgProbeToken(name, token) {\n            this.name = name;\n            this.token = token;\n        }\n        return NgProbeToken;\n    }());\n    /**\n     * Creates a platform.\n     * Platforms must be created on launch using this function.\n     *\n     * @publicApi\n     */\n    function createPlatform(injector) {\n        if (_platform && !_platform.destroyed &&\n            !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n            throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n        }\n        publishDefaultGlobalUtils$1();\n        _platform = injector.get(PlatformRef);\n        var inits = injector.get(PLATFORM_INITIALIZER, null);\n        if (inits)\n            inits.forEach(function (init) { return init(); });\n        return _platform;\n    }\n    /**\n     * Creates a factory for a platform. Can be used to provide or override `Providers` specific to\n     * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.\n     * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories\n     * to build up configurations that might be required by different libraries or parts of the\n     * application.\n     * @param name Identifies the new platform factory.\n     * @param providers A set of dependency providers for platforms created with the new factory.\n     *\n     * @publicApi\n     */\n    function createPlatformFactory(parentPlatformFactory, name, providers) {\n        if (providers === void 0) { providers = []; }\n        var desc = \"Platform: \" + name;\n        var marker = new InjectionToken(desc);\n        return function (extraProviders) {\n            if (extraProviders === void 0) { extraProviders = []; }\n            var platform = getPlatform();\n            if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n                if (parentPlatformFactory) {\n                    parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n                }\n                else {\n                    var injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {\n                        provide: INJECTOR_SCOPE,\n                        useValue: 'platform'\n                    });\n                    createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n                }\n            }\n            return assertPlatform(marker);\n        };\n    }\n    /**\n     * Checks that there is currently a platform that contains the given token as a provider.\n     *\n     * @publicApi\n     */\n    function assertPlatform(requiredToken) {\n        var platform = getPlatform();\n        if (!platform) {\n            throw new Error('No platform exists!');\n        }\n        if (!platform.injector.get(requiredToken, null)) {\n            throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n        }\n        return platform;\n    }\n    /**\n     * Destroys the current Angular platform and all Angular applications on the page.\n     * Destroys all modules and listeners registered with the platform.\n     *\n     * @publicApi\n     */\n    function destroyPlatform() {\n        if (_platform && !_platform.destroyed) {\n            _platform.destroy();\n        }\n    }\n    /**\n     * Returns the current platform.\n     *\n     * @publicApi\n     */\n    function getPlatform() {\n        return _platform && !_platform.destroyed ? _platform : null;\n    }\n    /**\n     * The Angular platform is the entry point for Angular on a web page.\n     * Each page has exactly one platform. Services (such as reflection) which are common\n     * to every Angular application running on the page are bound in its scope.\n     * A page's platform is initialized implicitly when a platform is created using a platform\n     * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.\n     *\n     * @publicApi\n     */\n    var PlatformRef = /** @class */ (function () {\n        /** @internal */\n        function PlatformRef(_injector) {\n            this._injector = _injector;\n            this._modules = [];\n            this._destroyListeners = [];\n            this._destroyed = false;\n        }\n        /**\n         * Creates an instance of an `@NgModule` for the given platform for offline compilation.\n         *\n         * @usageNotes\n         *\n         * The following example creates the NgModule for a browser platform.\n         *\n         * ```typescript\n         * my_module.ts:\n         *\n         * @NgModule({\n         *   imports: [BrowserModule]\n         * })\n         * class MyModule {}\n         *\n         * main.ts:\n         * import {MyModuleNgFactory} from './my_module.ngfactory';\n         * import {platformBrowser} from '@angular/platform-browser';\n         *\n         * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);\n         * ```\n         */\n        PlatformRef.prototype.bootstrapModuleFactory = function (moduleFactory, options) {\n            var _this = this;\n            // Note: We need to create the NgZone _before_ we instantiate the module,\n            // as instantiating the module creates some providers eagerly.\n            // So we create a mini parent injector that just contains the new NgZone and\n            // pass that as parent to the NgModuleFactory.\n            var ngZoneOption = options ? options.ngZone : undefined;\n            var ngZoneEventCoalescing = (options && options.ngZoneEventCoalescing) || false;\n            var ngZoneRunCoalescing = (options && options.ngZoneRunCoalescing) || false;\n            var ngZone = getNgZone(ngZoneOption, { ngZoneEventCoalescing: ngZoneEventCoalescing, ngZoneRunCoalescing: ngZoneRunCoalescing });\n            var providers = [{ provide: NgZone, useValue: ngZone }];\n            // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are\n            // created within the Angular zone\n            // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be\n            // created outside of the Angular zone.\n            return ngZone.run(function () {\n                var ngZoneInjector = Injector.create({ providers: providers, parent: _this.injector, name: moduleFactory.moduleType.name });\n                var moduleRef = moduleFactory.create(ngZoneInjector);\n                var exceptionHandler = moduleRef.injector.get(ErrorHandler, null);\n                if (!exceptionHandler) {\n                    throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');\n                }\n                ngZone.runOutsideAngular(function () {\n                    var subscription = ngZone.onError.subscribe({\n                        next: function (error) {\n                            exceptionHandler.handleError(error);\n                        }\n                    });\n                    moduleRef.onDestroy(function () {\n                        remove(_this._modules, moduleRef);\n                        subscription.unsubscribe();\n                    });\n                });\n                return _callAndReportToErrorHandler(exceptionHandler, ngZone, function () {\n                    var initStatus = moduleRef.injector.get(ApplicationInitStatus);\n                    initStatus.runInitializers();\n                    return initStatus.donePromise.then(function () {\n                        if (ivyEnabled) {\n                            // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy\n                            var localeId = moduleRef.injector.get(LOCALE_ID$1, DEFAULT_LOCALE_ID);\n                            setLocaleId(localeId || DEFAULT_LOCALE_ID);\n                        }\n                        _this._moduleDoBootstrap(moduleRef);\n                        return moduleRef;\n                    });\n                });\n            });\n        };\n        /**\n         * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.\n         *\n         * @usageNotes\n         * ### Simple Example\n         *\n         * ```typescript\n         * @NgModule({\n         *   imports: [BrowserModule]\n         * })\n         * class MyModule {}\n         *\n         * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n         * ```\n         *\n         */\n        PlatformRef.prototype.bootstrapModule = function (moduleType, compilerOptions) {\n            var _this = this;\n            if (compilerOptions === void 0) { compilerOptions = []; }\n            var options = optionsReducer({}, compilerOptions);\n            return compileNgModuleFactory(this.injector, options, moduleType)\n                .then(function (moduleFactory) { return _this.bootstrapModuleFactory(moduleFactory, options); });\n        };\n        PlatformRef.prototype._moduleDoBootstrap = function (moduleRef) {\n            var appRef = moduleRef.injector.get(ApplicationRef);\n            if (moduleRef._bootstrapComponents.length > 0) {\n                moduleRef._bootstrapComponents.forEach(function (f) { return appRef.bootstrap(f); });\n            }\n            else if (moduleRef.instance.ngDoBootstrap) {\n                moduleRef.instance.ngDoBootstrap(appRef);\n            }\n            else {\n                throw new Error(\"The module \" + stringify(moduleRef.instance\n                    .constructor) + \" was bootstrapped, but it does not declare \\\"@NgModule.bootstrap\\\" components nor a \\\"ngDoBootstrap\\\" method. \" +\n                    \"Please define one of these.\");\n            }\n            this._modules.push(moduleRef);\n        };\n        /**\n         * Registers a listener to be called when the platform is destroyed.\n         */\n        PlatformRef.prototype.onDestroy = function (callback) {\n            this._destroyListeners.push(callback);\n        };\n        Object.defineProperty(PlatformRef.prototype, \"injector\", {\n            /**\n             * Retrieves the platform {@link Injector}, which is the parent injector for\n             * every Angular application on the page and provides singleton providers.\n             */\n            get: function () {\n                return this._injector;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        /**\n         * Destroys the current Angular platform and all Angular applications on the page.\n         * Destroys all modules and listeners registered with the platform.\n         */\n        PlatformRef.prototype.destroy = function () {\n            if (this._destroyed) {\n                throw new Error('The platform has already been destroyed!');\n            }\n            this._modules.slice().forEach(function (module) { return module.destroy(); });\n            this._destroyListeners.forEach(function (listener) { return listener(); });\n            this._destroyed = true;\n        };\n        Object.defineProperty(PlatformRef.prototype, \"destroyed\", {\n            get: function () {\n                return this._destroyed;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return PlatformRef;\n    }());\n    PlatformRef.decorators = [\n        { type: Injectable }\n    ];\n    PlatformRef.ctorParameters = function () { return [\n        { type: Injector }\n    ]; };\n    function getNgZone(ngZoneOption, extra) {\n        var ngZone;\n        if (ngZoneOption === 'noop') {\n            ngZone = new NoopNgZone();\n        }\n        else {\n            ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) || new NgZone({\n                enableLongStackTrace: isDevMode(),\n                shouldCoalesceEventChangeDetection: !!(extra === null || extra === void 0 ? void 0 : extra.ngZoneEventCoalescing),\n                shouldCoalesceRunChangeDetection: !!(extra === null || extra === void 0 ? void 0 : extra.ngZoneRunCoalescing)\n            });\n        }\n        return ngZone;\n    }\n    function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {\n        try {\n            var result = callback();\n            if (isPromise(result)) {\n                return result.catch(function (e) {\n                    ngZone.runOutsideAngular(function () { return errorHandler.handleError(e); });\n                    // rethrow as the exception handler might not do it\n                    throw e;\n                });\n            }\n            return result;\n        }\n        catch (e) {\n            ngZone.runOutsideAngular(function () { return errorHandler.handleError(e); });\n            // rethrow as the exception handler might not do it\n            throw e;\n        }\n    }\n    function optionsReducer(dst, objs) {\n        if (Array.isArray(objs)) {\n            dst = objs.reduce(optionsReducer, dst);\n        }\n        else {\n            dst = Object.assign(Object.assign({}, dst), objs);\n        }\n        return dst;\n    }\n    /**\n     * A reference to an Angular application running on a page.\n     *\n     * @usageNotes\n     *\n     * {@a is-stable-examples}\n     * ### isStable examples and caveats\n     *\n     * Note two important points about `isStable`, demonstrated in the examples below:\n     * - the application will never be stable if you start any kind\n     * of recurrent asynchronous task when the application starts\n     * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n     * or using RxJS operators like `interval`);\n     * - the `isStable` Observable runs outside of the Angular zone.\n     *\n     * Let's imagine that you start a recurrent task\n     * (here incrementing a counter, using RxJS `interval`),\n     * and at the same time subscribe to `isStable`.\n     *\n     * ```\n     * constructor(appRef: ApplicationRef) {\n     *   appRef.isStable.pipe(\n     *      filter(stable => stable)\n     *   ).subscribe(() => console.log('App is stable now');\n     *   interval(1000).subscribe(counter => console.log(counter));\n     * }\n     * ```\n     * In this example, `isStable` will never emit `true`,\n     * and the trace \"App is stable now\" will never get logged.\n     *\n     * If you want to execute something when the app is stable,\n     * you have to wait for the application to be stable\n     * before starting your polling process.\n     *\n     * ```\n     * constructor(appRef: ApplicationRef) {\n     *   appRef.isStable.pipe(\n     *     first(stable => stable),\n     *     tap(stable => console.log('App is stable now')),\n     *     switchMap(() => interval(1000))\n     *   ).subscribe(counter => console.log(counter));\n     * }\n     * ```\n     * In this example, the trace \"App is stable now\" will be logged\n     * and then the counter starts incrementing every second.\n     *\n     * Note also that this Observable runs outside of the Angular zone,\n     * which means that the code in the subscription\n     * to this Observable will not trigger the change detection.\n     *\n     * Let's imagine that instead of logging the counter value,\n     * you update a field of your component\n     * and display it in its template.\n     *\n     * ```\n     * constructor(appRef: ApplicationRef) {\n     *   appRef.isStable.pipe(\n     *     first(stable => stable),\n     *     switchMap(() => interval(1000))\n     *   ).subscribe(counter => this.value = counter);\n     * }\n     * ```\n     * As the `isStable` Observable runs outside the zone,\n     * the `value` field will be updated properly,\n     * but the template will not be refreshed!\n     *\n     * You'll have to manually trigger the change detection to update the template.\n     *\n     * ```\n     * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n     *   appRef.isStable.pipe(\n     *     first(stable => stable),\n     *     switchMap(() => interval(1000))\n     *   ).subscribe(counter => {\n     *     this.value = counter;\n     *     cd.detectChanges();\n     *   });\n     * }\n     * ```\n     *\n     * Or make the subscription callback run inside the zone.\n     *\n     * ```\n     * constructor(appRef: ApplicationRef, zone: NgZone) {\n     *   appRef.isStable.pipe(\n     *     first(stable => stable),\n     *     switchMap(() => interval(1000))\n     *   ).subscribe(counter => zone.run(() => this.value = counter));\n     * }\n     * ```\n     *\n     * @publicApi\n     */\n    var ApplicationRef = /** @class */ (function () {\n        /** @internal */\n        function ApplicationRef(_zone, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {\n            var _this = this;\n            this._zone = _zone;\n            this._injector = _injector;\n            this._exceptionHandler = _exceptionHandler;\n            this._componentFactoryResolver = _componentFactoryResolver;\n            this._initStatus = _initStatus;\n            /** @internal */\n            this._bootstrapListeners = [];\n            this._views = [];\n            this._runningTick = false;\n            this._stable = true;\n            /**\n             * Get a list of component types registered to this application.\n             * This list is populated even before the component is created.\n             */\n            this.componentTypes = [];\n            /**\n             * Get a list of components registered to this application.\n             */\n            this.components = [];\n            this._onMicrotaskEmptySubscription = this._zone.onMicrotaskEmpty.subscribe({\n                next: function () {\n                    _this._zone.run(function () {\n                        _this.tick();\n                    });\n                }\n            });\n            var isCurrentlyStable = new rxjs.Observable(function (observer) {\n                _this._stable = _this._zone.isStable && !_this._zone.hasPendingMacrotasks &&\n                    !_this._zone.hasPendingMicrotasks;\n                _this._zone.runOutsideAngular(function () {\n                    observer.next(_this._stable);\n                    observer.complete();\n                });\n            });\n            var isStable = new rxjs.Observable(function (observer) {\n                // Create the subscription to onStable outside the Angular Zone so that\n                // the callback is run outside the Angular Zone.\n                var stableSub;\n                _this._zone.runOutsideAngular(function () {\n                    stableSub = _this._zone.onStable.subscribe(function () {\n                        NgZone.assertNotInAngularZone();\n                        // Check whether there are no pending macro/micro tasks in the next tick\n                        // to allow for NgZone to update the state.\n                        scheduleMicroTask(function () {\n                            if (!_this._stable && !_this._zone.hasPendingMacrotasks &&\n                                !_this._zone.hasPendingMicrotasks) {\n                                _this._stable = true;\n                                observer.next(true);\n                            }\n                        });\n                    });\n                });\n                var unstableSub = _this._zone.onUnstable.subscribe(function () {\n                    NgZone.assertInAngularZone();\n                    if (_this._stable) {\n                        _this._stable = false;\n                        _this._zone.runOutsideAngular(function () {\n                            observer.next(false);\n                        });\n                    }\n                });\n                return function () {\n                    stableSub.unsubscribe();\n                    unstableSub.unsubscribe();\n                };\n            });\n            this.isStable =\n                rxjs.merge(isCurrentlyStable, isStable.pipe(operators.share()));\n        }\n        /**\n         * Bootstrap a component onto the element identified by its selector or, optionally, to a\n         * specified element.\n         *\n         * @usageNotes\n         * ### Bootstrap process\n         *\n         * When bootstrapping a component, Angular mounts it onto a target DOM element\n         * and kicks off automatic change detection. The target DOM element can be\n         * provided using the `rootSelectorOrNode` argument.\n         *\n         * If the target DOM element is not provided, Angular tries to find one on a page\n         * using the `selector` of the component that is being bootstrapped\n         * (first matched element is used).\n         *\n         * ### Example\n         *\n         * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n         * but it requires us to know the component while writing the application code.\n         *\n         * Imagine a situation where we have to wait for an API call to decide about the component to\n         * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n         * dynamically bootstrap a component.\n         *\n         * {@example core/ts/platform/platform.ts region='componentSelector'}\n         *\n         * Optionally, a component can be mounted onto a DOM element that does not match the\n         * selector of the bootstrapped component.\n         *\n         * In the following example, we are providing a CSS selector to match the target element.\n         *\n         * {@example core/ts/platform/platform.ts region='cssSelector'}\n         *\n         * While in this example, we are providing reference to a DOM node.\n         *\n         * {@example core/ts/platform/platform.ts region='domNode'}\n         */\n        ApplicationRef.prototype.bootstrap = function (componentOrFactory, rootSelectorOrNode) {\n            var _this = this;\n            if (!this._initStatus.done) {\n                throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');\n            }\n            var componentFactory;\n            if (componentOrFactory instanceof ComponentFactory) {\n                componentFactory = componentOrFactory;\n            }\n            else {\n                componentFactory =\n                    this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);\n            }\n            this.componentTypes.push(componentFactory.componentType);\n            // Create a factory associated with the current module if it's not bound to some other\n            var ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef);\n            var selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n            var compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n            var nativeElement = compRef.location.nativeElement;\n            var testability = compRef.injector.get(Testability, null);\n            var testabilityRegistry = testability && compRef.injector.get(TestabilityRegistry);\n            if (testability && testabilityRegistry) {\n                testabilityRegistry.registerApplication(nativeElement, testability);\n            }\n            compRef.onDestroy(function () {\n                _this.detachView(compRef.hostView);\n                remove(_this.components, compRef);\n                if (testabilityRegistry) {\n                    testabilityRegistry.unregisterApplication(nativeElement);\n                }\n            });\n            this._loadComponent(compRef);\n            // Note that we have still left the `isDevMode()` condition in order to avoid\n            // creating a breaking change for projects that still use the View Engine.\n            if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {\n                var _console = this._injector.get(Console);\n                _console.log(\"Angular is running in development mode. Call enableProdMode() to enable production mode.\");\n            }\n            return compRef;\n        };\n        /**\n         * Invoke this method to explicitly process change detection and its side-effects.\n         *\n         * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n         * further changes are detected. If additional changes are picked up during this second cycle,\n         * bindings in the app have side-effects that cannot be resolved in a single change detection\n         * pass.\n         * In this case, Angular throws an error, since an Angular application can only have one change\n         * detection pass during which all change detection must complete.\n         */\n        ApplicationRef.prototype.tick = function () {\n            var e_1, _a, e_2, _b;\n            var _this = this;\n            if (this._runningTick) {\n                throw new Error('ApplicationRef.tick is called recursively');\n            }\n            try {\n                this._runningTick = true;\n                try {\n                    for (var _c = __values(this._views), _d = _c.next(); !_d.done; _d = _c.next()) {\n                        var view = _d.value;\n                        view.detectChanges();\n                    }\n                }\n                catch (e_1_1) { e_1 = { error: e_1_1 }; }\n                finally {\n                    try {\n                        if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n                    }\n                    finally { if (e_1) throw e_1.error; }\n                }\n                // Note that we have still left the `isDevMode()` condition in order to avoid\n                // creating a breaking change for projects that still use the View Engine.\n                if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {\n                    try {\n                        for (var _e = __values(this._views), _f = _e.next(); !_f.done; _f = _e.next()) {\n                            var view = _f.value;\n                            view.checkNoChanges();\n                        }\n                    }\n                    catch (e_2_1) { e_2 = { error: e_2_1 }; }\n                    finally {\n                        try {\n                            if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n                        }\n                        finally { if (e_2) throw e_2.error; }\n                    }\n                }\n            }\n            catch (e) {\n                // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n                this._zone.runOutsideAngular(function () { return _this._exceptionHandler.handleError(e); });\n            }\n            finally {\n                this._runningTick = false;\n            }\n        };\n        /**\n         * Attaches a view so that it will be dirty checked.\n         * The view will be automatically detached when it is destroyed.\n         * This will throw if the view is already attached to a ViewContainer.\n         */\n        ApplicationRef.prototype.attachView = function (viewRef) {\n            var view = viewRef;\n            this._views.push(view);\n            view.attachToAppRef(this);\n        };\n        /**\n         * Detaches a view from dirty checking again.\n         */\n        ApplicationRef.prototype.detachView = function (viewRef) {\n            var view = viewRef;\n            remove(this._views, view);\n            view.detachFromAppRef();\n        };\n        ApplicationRef.prototype._loadComponent = function (componentRef) {\n            this.attachView(componentRef.hostView);\n            this.tick();\n            this.components.push(componentRef);\n            // Get the listeners lazily to prevent DI cycles.\n            var listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);\n            listeners.forEach(function (listener) { return listener(componentRef); });\n        };\n        /** @internal */\n        ApplicationRef.prototype.ngOnDestroy = function () {\n            this._views.slice().forEach(function (view) { return view.destroy(); });\n            this._onMicrotaskEmptySubscription.unsubscribe();\n        };\n        Object.defineProperty(ApplicationRef.prototype, \"viewCount\", {\n            /**\n             * Returns the number of attached views.\n             */\n            get: function () {\n                return this._views.length;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return ApplicationRef;\n    }());\n    ApplicationRef.decorators = [\n        { type: Injectable }\n    ];\n    ApplicationRef.ctorParameters = function () { return [\n        { type: NgZone },\n        { type: Injector },\n        { type: ErrorHandler },\n        { type: ComponentFactoryResolver },\n        { type: ApplicationInitStatus }\n    ]; };\n    function remove(list, el) {\n        var index = list.indexOf(el);\n        if (index > -1) {\n            list.splice(index, 1);\n        }\n    }\n    function _lastDefined(args) {\n        for (var i = args.length - 1; i >= 0; i--) {\n            if (args[i] !== undefined) {\n                return args[i];\n            }\n        }\n        return undefined;\n    }\n    function _mergeArrays(parts) {\n        var result = [];\n        parts.forEach(function (part) { return part && result.push.apply(result, __spreadArray([], __read(part))); });\n        return result;\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Used to load ng module factories.\n     *\n     * @publicApi\n     * @deprecated the `string` form of `loadChildren` is deprecated, and `NgModuleFactoryLoader` is\n     * part of its implementation. See `LoadChildren` for more details.\n     */\n    var NgModuleFactoryLoader = /** @class */ (function () {\n        function NgModuleFactoryLoader() {\n        }\n        return NgModuleFactoryLoader;\n    }());\n    function getModuleFactory__PRE_R3__(id) {\n        var factory = getRegisteredNgModuleType(id);\n        if (!factory)\n            throw noModuleError(id);\n        return factory;\n    }\n    function getModuleFactory__POST_R3__(id) {\n        var type = getRegisteredNgModuleType(id);\n        if (!type)\n            throw noModuleError(id);\n        return new NgModuleFactory$1(type);\n    }\n    /**\n     * Returns the NgModuleFactory with the given id, if it exists and has been loaded.\n     * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module\n     * cannot be found.\n     * @publicApi\n     */\n    var getModuleFactory = getModuleFactory__PRE_R3__;\n    function noModuleError(id) {\n        return new Error(\"No module with ID \" + id + \" loaded\");\n    }\n\n    var _SEPARATOR = '#';\n    var FACTORY_CLASS_SUFFIX = 'NgFactory';\n    /**\n     * Configuration for SystemJsNgModuleLoader.\n     * token.\n     *\n     * @publicApi\n     * @deprecated the `string` form of `loadChildren` is deprecated, and `SystemJsNgModuleLoaderConfig`\n     * is part of its implementation. See `LoadChildren` for more details.\n     */\n    var SystemJsNgModuleLoaderConfig = /** @class */ (function () {\n        function SystemJsNgModuleLoaderConfig() {\n        }\n        return SystemJsNgModuleLoaderConfig;\n    }());\n    var DEFAULT_CONFIG = {\n        factoryPathPrefix: '',\n        factoryPathSuffix: '.ngfactory',\n    };\n    /**\n     * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n     * @publicApi\n     * @deprecated the `string` form of `loadChildren` is deprecated, and `SystemJsNgModuleLoader` is\n     * part of its implementation. See `LoadChildren` for more details.\n     */\n    var SystemJsNgModuleLoader = /** @class */ (function () {\n        function SystemJsNgModuleLoader(_compiler, config) {\n            this._compiler = _compiler;\n            this._config = config || DEFAULT_CONFIG;\n        }\n        SystemJsNgModuleLoader.prototype.load = function (path) {\n            var legacyOfflineMode = !ivyEnabled && this._compiler instanceof Compiler;\n            return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n        };\n        SystemJsNgModuleLoader.prototype.loadAndCompile = function (path) {\n            var _this = this;\n            var _a = __read(path.split(_SEPARATOR), 2), module = _a[0], exportName = _a[1];\n            if (exportName === undefined) {\n                exportName = 'default';\n            }\n            return System.import(module)\n                .then(function (module) { return module[exportName]; })\n                .then(function (type) { return checkNotEmpty(type, module, exportName); })\n                .then(function (type) { return _this._compiler.compileModuleAsync(type); });\n        };\n        SystemJsNgModuleLoader.prototype.loadFactory = function (path) {\n            var _a = __read(path.split(_SEPARATOR), 2), module = _a[0], exportName = _a[1];\n            var factoryClassSuffix = FACTORY_CLASS_SUFFIX;\n            if (exportName === undefined) {\n                exportName = 'default';\n                factoryClassSuffix = '';\n            }\n            return System.import(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)\n                .then(function (module) { return module[exportName + factoryClassSuffix]; })\n                .then(function (factory) { return checkNotEmpty(factory, module, exportName); });\n        };\n        return SystemJsNgModuleLoader;\n    }());\n    SystemJsNgModuleLoader.decorators = [\n        { type: Injectable }\n    ];\n    SystemJsNgModuleLoader.ctorParameters = function () { return [\n        { type: Compiler },\n        { type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }] }\n    ]; };\n    function checkNotEmpty(value, modulePath, exportName) {\n        if (!value) {\n            throw new Error(\"Cannot find '\" + exportName + \"' in '\" + modulePath + \"'\");\n        }\n        return value;\n    }\n\n    /**\n     * Represents an Angular [view](guide/glossary#view \"Definition\").\n     *\n     * @see {@link ChangeDetectorRef#usage-notes Change detection usage}\n     *\n     * @publicApi\n     */\n    var ViewRef$1 = /** @class */ (function (_super) {\n        __extends(ViewRef, _super);\n        function ViewRef() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        return ViewRef;\n    }(ChangeDetectorRef));\n    /**\n     * Represents an Angular [view](guide/glossary#view) in a view container.\n     * An [embedded view](guide/glossary#view-tree) can be referenced from a component\n     * other than the hosting component whose template defines it, or it can be defined\n     * independently by a `TemplateRef`.\n     *\n     * Properties of elements in a view can change, but the structure (number and order) of elements in\n     * a view cannot. Change the structure of elements by inserting, moving, or\n     * removing nested views in a view container.\n     *\n     * @see `ViewContainerRef`\n     *\n     * @usageNotes\n     *\n     * The following template breaks down into two separate `TemplateRef` instances,\n     * an outer one and an inner one.\n     *\n     * ```\n     * Count: {{items.length}}\n     * <ul>\n     *   <li *ngFor=\"let  item of items\">{{item}}</li>\n     * </ul>\n     * ```\n     *\n     * This is the outer `TemplateRef`:\n     *\n     * ```\n     * Count: {{items.length}}\n     * <ul>\n     *   <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n     * </ul>\n     * ```\n     *\n     * This is the inner `TemplateRef`:\n     *\n     * ```\n     *   <li>{{item}}</li>\n     * ```\n     *\n     * The outer and inner `TemplateRef` instances are assembled into views as follows:\n     *\n     * ```\n     * <!-- ViewRef: outer-0 -->\n     * Count: 2\n     * <ul>\n     *   <ng-template view-container-ref></ng-template>\n     *   <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n     *   <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n     * </ul>\n     * <!-- /ViewRef: outer-0 -->\n     * ```\n     * @publicApi\n     */\n    var EmbeddedViewRef = /** @class */ (function (_super) {\n        __extends(EmbeddedViewRef, _super);\n        function EmbeddedViewRef() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        return EmbeddedViewRef;\n    }(ViewRef$1));\n\n    /**\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://angular.io/license\n     */\n\n    /**\n     * @publicApi\n     */\n    var DebugEventListener = /** @class */ (function () {\n        function DebugEventListener(name, callback) {\n            this.name = name;\n            this.callback = callback;\n        }\n        return DebugEventListener;\n    }());\n    var DebugNode__PRE_R3__ = /** @class */ (function () {\n        function DebugNode__PRE_R3__(nativeNode, parent, _debugContext) {\n            this.listeners = [];\n            this.parent = null;\n            this._debugContext = _debugContext;\n            this.nativeNode = nativeNode;\n            if (parent && parent instanceof DebugElement__PRE_R3__) {\n                parent.addChild(this);\n            }\n        }\n        Object.defineProperty(DebugNode__PRE_R3__.prototype, \"injector\", {\n            get: function () {\n                return this._debugContext.injector;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__PRE_R3__.prototype, \"componentInstance\", {\n            get: function () {\n                return this._debugContext.component;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__PRE_R3__.prototype, \"context\", {\n            get: function () {\n                return this._debugContext.context;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__PRE_R3__.prototype, \"references\", {\n            get: function () {\n                return this._debugContext.references;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__PRE_R3__.prototype, \"providerTokens\", {\n            get: function () {\n                return this._debugContext.providerTokens;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return DebugNode__PRE_R3__;\n    }());\n    var DebugElement__PRE_R3__ = /** @class */ (function (_super) {\n        __extends(DebugElement__PRE_R3__, _super);\n        function DebugElement__PRE_R3__(nativeNode, parent, _debugContext) {\n            var _this = _super.call(this, nativeNode, parent, _debugContext) || this;\n            _this.properties = {};\n            _this.attributes = {};\n            _this.classes = {};\n            _this.styles = {};\n            _this.childNodes = [];\n            _this.nativeElement = nativeNode;\n            return _this;\n        }\n        DebugElement__PRE_R3__.prototype.addChild = function (child) {\n            if (child) {\n                this.childNodes.push(child);\n                child.parent = this;\n            }\n        };\n        DebugElement__PRE_R3__.prototype.removeChild = function (child) {\n            var childIndex = this.childNodes.indexOf(child);\n            if (childIndex !== -1) {\n                child.parent = null;\n                this.childNodes.splice(childIndex, 1);\n            }\n        };\n        DebugElement__PRE_R3__.prototype.insertChildrenAfter = function (child, newChildren) {\n            var _a;\n            var _this = this;\n            var siblingIndex = this.childNodes.indexOf(child);\n            if (siblingIndex !== -1) {\n                (_a = this.childNodes).splice.apply(_a, __spreadArray([siblingIndex + 1, 0], __read(newChildren)));\n                newChildren.forEach(function (c) {\n                    if (c.parent) {\n                        c.parent.removeChild(c);\n                    }\n                    child.parent = _this;\n                });\n            }\n        };\n        DebugElement__PRE_R3__.prototype.insertBefore = function (refChild, newChild) {\n            var refIndex = this.childNodes.indexOf(refChild);\n            if (refIndex === -1) {\n                this.addChild(newChild);\n            }\n            else {\n                if (newChild.parent) {\n                    newChild.parent.removeChild(newChild);\n                }\n                newChild.parent = this;\n                this.childNodes.splice(refIndex, 0, newChild);\n            }\n        };\n        DebugElement__PRE_R3__.prototype.query = function (predicate) {\n            var results = this.queryAll(predicate);\n            return results[0] || null;\n        };\n        DebugElement__PRE_R3__.prototype.queryAll = function (predicate) {\n            var matches = [];\n            _queryElementChildren(this, predicate, matches);\n            return matches;\n        };\n        DebugElement__PRE_R3__.prototype.queryAllNodes = function (predicate) {\n            var matches = [];\n            _queryNodeChildren(this, predicate, matches);\n            return matches;\n        };\n        Object.defineProperty(DebugElement__PRE_R3__.prototype, \"children\", {\n            get: function () {\n                return this.childNodes //\n                    .filter(function (node) { return node instanceof DebugElement__PRE_R3__; });\n            },\n            enumerable: false,\n            configurable: true\n        });\n        DebugElement__PRE_R3__.prototype.triggerEventHandler = function (eventName, eventObj) {\n            this.listeners.forEach(function (listener) {\n                if (listener.name == eventName) {\n                    listener.callback(eventObj);\n                }\n            });\n        };\n        return DebugElement__PRE_R3__;\n    }(DebugNode__PRE_R3__));\n    /**\n     * @publicApi\n     */\n    function asNativeElements(debugEls) {\n        return debugEls.map(function (el) { return el.nativeElement; });\n    }\n    function _queryElementChildren(element, predicate, matches) {\n        element.childNodes.forEach(function (node) {\n            if (node instanceof DebugElement__PRE_R3__) {\n                if (predicate(node)) {\n                    matches.push(node);\n                }\n                _queryElementChildren(node, predicate, matches);\n            }\n        });\n    }\n    function _queryNodeChildren(parentNode, predicate, matches) {\n        if (parentNode instanceof DebugElement__PRE_R3__) {\n            parentNode.childNodes.forEach(function (node) {\n                if (predicate(node)) {\n                    matches.push(node);\n                }\n                if (node instanceof DebugElement__PRE_R3__) {\n                    _queryNodeChildren(node, predicate, matches);\n                }\n            });\n        }\n    }\n    var DebugNode__POST_R3__ = /** @class */ (function () {\n        function DebugNode__POST_R3__(nativeNode) {\n            this.nativeNode = nativeNode;\n        }\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"parent\", {\n            get: function () {\n                var parent = this.nativeNode.parentNode;\n                return parent ? new DebugElement__POST_R3__(parent) : null;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"injector\", {\n            get: function () {\n                return getInjector(this.nativeNode);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"componentInstance\", {\n            get: function () {\n                var nativeElement = this.nativeNode;\n                return nativeElement &&\n                    (getComponent(nativeElement) || getOwningComponent(nativeElement));\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"context\", {\n            get: function () {\n                return getComponent(this.nativeNode) || getContext(this.nativeNode);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"listeners\", {\n            get: function () {\n                return getListeners(this.nativeNode).filter(function (listener) { return listener.type === 'dom'; });\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"references\", {\n            get: function () {\n                return getLocalRefs(this.nativeNode);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugNode__POST_R3__.prototype, \"providerTokens\", {\n            get: function () {\n                return getInjectionTokens(this.nativeNode);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return DebugNode__POST_R3__;\n    }());\n    var DebugElement__POST_R3__ = /** @class */ (function (_super) {\n        __extends(DebugElement__POST_R3__, _super);\n        function DebugElement__POST_R3__(nativeNode) {\n            var _this = this;\n            ngDevMode && assertDomNode(nativeNode);\n            _this = _super.call(this, nativeNode) || this;\n            return _this;\n        }\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"nativeElement\", {\n            get: function () {\n                return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"name\", {\n            get: function () {\n                var context = getLContext(this.nativeNode);\n                if (context !== null) {\n                    var lView = context.lView;\n                    var tData = lView[TVIEW].data;\n                    var tNode = tData[context.nodeIndex];\n                    return tNode.value;\n                }\n                else {\n                    return this.nativeNode.nodeName;\n                }\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"properties\", {\n            /**\n             *  Gets a map of property names to property values for an element.\n             *\n             *  This map includes:\n             *  - Regular property bindings (e.g. `[id]=\"id\"`)\n             *  - Host property bindings (e.g. `host: { '[id]': \"id\" }`)\n             *  - Interpolated property bindings (e.g. `id=\"{{ value }}\")\n             *\n             *  It does not include:\n             *  - input property bindings (e.g. `[myCustomInput]=\"value\"`)\n             *  - attribute bindings (e.g. `[attr.role]=\"menu\"`)\n             */\n            get: function () {\n                var context = getLContext(this.nativeNode);\n                if (context === null) {\n                    return {};\n                }\n                var lView = context.lView;\n                var tData = lView[TVIEW].data;\n                var tNode = tData[context.nodeIndex];\n                var properties = {};\n                // Collect properties from the DOM.\n                copyDomProperties(this.nativeElement, properties);\n                // Collect properties from the bindings. This is needed for animation renderer which has\n                // synthetic properties which don't get reflected into the DOM.\n                collectPropertyBindings(properties, tNode, lView, tData);\n                return properties;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"attributes\", {\n            get: function () {\n                var attributes = {};\n                var element = this.nativeElement;\n                if (!element) {\n                    return attributes;\n                }\n                var context = getLContext(element);\n                if (context === null) {\n                    return {};\n                }\n                var lView = context.lView;\n                var tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;\n                var lowercaseTNodeAttrs = [];\n                // For debug nodes we take the element's attribute directly from the DOM since it allows us\n                // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones\n                // that are set through `Renderer2`). The problem is that the browser will lowercase all names,\n                // however since we have the attributes already on the TNode, we can preserve the case by going\n                // through them once, adding them to the `attributes` map and putting their lower-cased name\n                // into an array. Afterwards when we're going through the native DOM attributes, we can check\n                // whether we haven't run into an attribute already through the TNode.\n                if (tNodeAttrs) {\n                    var i = 0;\n                    while (i < tNodeAttrs.length) {\n                        var attrName = tNodeAttrs[i];\n                        // Stop as soon as we hit a marker. We only care about the regular attributes. Everything\n                        // else will be handled below when we read the final attributes off the DOM.\n                        if (typeof attrName !== 'string')\n                            break;\n                        var attrValue = tNodeAttrs[i + 1];\n                        attributes[attrName] = attrValue;\n                        lowercaseTNodeAttrs.push(attrName.toLowerCase());\n                        i += 2;\n                    }\n                }\n                var eAttrs = element.attributes;\n                for (var i = 0; i < eAttrs.length; i++) {\n                    var attr = eAttrs[i];\n                    var lowercaseName = attr.name.toLowerCase();\n                    // Make sure that we don't assign the same attribute both in its\n                    // case-sensitive form and the lower-cased one from the browser.\n                    if (lowercaseTNodeAttrs.indexOf(lowercaseName) === -1) {\n                        // Save the lowercase name to align the behavior between browsers.\n                        // IE preserves the case, while all other browser convert it to lower case.\n                        attributes[lowercaseName] = attr.value;\n                    }\n                }\n                return attributes;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"styles\", {\n            get: function () {\n                if (this.nativeElement && this.nativeElement.style) {\n                    return this.nativeElement.style;\n                }\n                return {};\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"classes\", {\n            get: function () {\n                var result = {};\n                var element = this.nativeElement;\n                // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n                var className = element.className;\n                var classes = className && typeof className !== 'string' ? className.baseVal.split(' ') :\n                    className.split(' ');\n                classes.forEach(function (value) { return result[value] = true; });\n                return result;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"childNodes\", {\n            get: function () {\n                var childNodes = this.nativeNode.childNodes;\n                var children = [];\n                for (var i = 0; i < childNodes.length; i++) {\n                    var element = childNodes[i];\n                    children.push(getDebugNode__POST_R3__(element));\n                }\n                return children;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugElement__POST_R3__.prototype, \"children\", {\n            get: function () {\n                var nativeElement = this.nativeElement;\n                if (!nativeElement)\n                    return [];\n                var childNodes = nativeElement.children;\n                var children = [];\n                for (var i = 0; i < childNodes.length; i++) {\n                    var element = childNodes[i];\n                    children.push(getDebugNode__POST_R3__(element));\n                }\n                return children;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        DebugElement__POST_R3__.prototype.query = function (predicate) {\n            var results = this.queryAll(predicate);\n            return results[0] || null;\n        };\n        DebugElement__POST_R3__.prototype.queryAll = function (predicate) {\n            var matches = [];\n            _queryAllR3(this, predicate, matches, true);\n            return matches;\n        };\n        DebugElement__POST_R3__.prototype.queryAllNodes = function (predicate) {\n            var matches = [];\n            _queryAllR3(this, predicate, matches, false);\n            return matches;\n        };\n        DebugElement__POST_R3__.prototype.triggerEventHandler = function (eventName, eventObj) {\n            var node = this.nativeNode;\n            var invokedListeners = [];\n            this.listeners.forEach(function (listener) {\n                if (listener.name === eventName) {\n                    var callback = listener.callback;\n                    callback.call(node, eventObj);\n                    invokedListeners.push(callback);\n                }\n            });\n            // We need to check whether `eventListeners` exists, because it's something\n            // that Zone.js only adds to `EventTarget` in browser environments.\n            if (typeof node.eventListeners === 'function') {\n                // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some\n                // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event\n                // listener.\n                node.eventListeners(eventName).forEach(function (listener) {\n                    // In order to ensure that we can detect the special __ngUnwrap__ token described above, we\n                    // use `toString` on the listener and see if it contains the token. We use this approach to\n                    // ensure that it still worked with compiled code since it cannot remove or rename string\n                    // literals. We also considered using a special function name (i.e. if(listener.name ===\n                    // special)) but that was more cumbersome and we were also concerned the compiled code could\n                    // strip the name, turning the condition in to (\"\" === \"\") and always returning true.\n                    if (listener.toString().indexOf('__ngUnwrap__') !== -1) {\n                        var unwrappedListener = listener('__ngUnwrap__');\n                        return invokedListeners.indexOf(unwrappedListener) === -1 &&\n                            unwrappedListener.call(node, eventObj);\n                    }\n                });\n            }\n        };\n        return DebugElement__POST_R3__;\n    }(DebugNode__POST_R3__));\n    function copyDomProperties(element, properties) {\n        if (element) {\n            // Skip own properties (as those are patched)\n            var obj = Object.getPrototypeOf(element);\n            var NodePrototype = Node.prototype;\n            while (obj !== null && obj !== NodePrototype) {\n                var descriptors = Object.getOwnPropertyDescriptors(obj);\n                for (var key in descriptors) {\n                    if (!key.startsWith('__') && !key.startsWith('on')) {\n                        // don't include properties starting with `__` and `on`.\n                        // `__` are patched values which should not be included.\n                        // `on` are listeners which also should not be included.\n                        var value = element[key];\n                        if (isPrimitiveValue(value)) {\n                            properties[key] = value;\n                        }\n                    }\n                }\n                obj = Object.getPrototypeOf(obj);\n            }\n        }\n    }\n    function isPrimitiveValue(value) {\n        return typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' ||\n            value === null;\n    }\n    function _queryAllR3(parentElement, predicate, matches, elementsOnly) {\n        var context = getLContext(parentElement.nativeNode);\n        if (context !== null) {\n            var parentTNode = context.lView[TVIEW].data[context.nodeIndex];\n            _queryNodeChildrenR3(parentTNode, context.lView, predicate, matches, elementsOnly, parentElement.nativeNode);\n        }\n        else {\n            // If the context is null, then `parentElement` was either created with Renderer2 or native DOM\n            // APIs.\n            _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly);\n        }\n    }\n    /**\n     * Recursively match the current TNode against the predicate, and goes on with the next ones.\n     *\n     * @param tNode the current TNode\n     * @param lView the LView of this TNode\n     * @param predicate the predicate to match\n     * @param matches the list of positive matches\n     * @param elementsOnly whether only elements should be searched\n     * @param rootNativeNode the root native node on which predicate should not be matched\n     */\n    function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n        var e_1, _a;\n        ngDevMode && assertTNodeForLView(tNode, lView);\n        var nativeNode = getNativeByTNodeOrNull(tNode, lView);\n        // For each type of TNode, specific logic is executed.\n        if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {\n            // Case 1: the TNode is an element\n            // The native node has to be checked.\n            _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n            if (isComponentHost(tNode)) {\n                // If the element is the host of a component, then all nodes in its view have to be processed.\n                // Note: the component's content (tNode.child) will be processed from the insertion points.\n                var componentView = getComponentLViewByIndex(tNode.index, lView);\n                if (componentView && componentView[TVIEW].firstChild) {\n                    _queryNodeChildrenR3(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n                }\n            }\n            else {\n                if (tNode.child) {\n                    // Otherwise, its children have to be processed.\n                    _queryNodeChildrenR3(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n                }\n                // We also have to query the DOM directly in order to catch elements inserted through\n                // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n                // times. ViewEngine could do it more efficiently, because all the insertions go through\n                // Renderer2, however that's not the case in Ivy. This approach is being used because:\n                // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency\n                //    from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n                // 2. We would have to make `Renderer3` \"know\" about debug nodes.\n                // 3. It allows us to capture nodes that were inserted directly via the DOM.\n                nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n            }\n            // In all cases, if a dynamic container exists for this node, each view inside it has to be\n            // processed.\n            var nodeOrContainer = lView[tNode.index];\n            if (isLContainer(nodeOrContainer)) {\n                _queryNodeChildrenInContainerR3(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n            }\n        }\n        else if (tNode.type & 4 /* Container */) {\n            // Case 2: the TNode is a container\n            // The native node has to be checked.\n            var lContainer = lView[tNode.index];\n            _addQueryMatchR3(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n            // Each view inside the container has to be processed.\n            _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n        }\n        else if (tNode.type & 16 /* Projection */) {\n            // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n            // The nodes projected at this location all need to be processed.\n            var componentView = lView[DECLARATION_COMPONENT_VIEW];\n            var componentHost = componentView[T_HOST];\n            var head = componentHost.projection[tNode.projection];\n            if (Array.isArray(head)) {\n                try {\n                    for (var head_1 = __values(head), head_1_1 = head_1.next(); !head_1_1.done; head_1_1 = head_1.next()) {\n                        var nativeNode_1 = head_1_1.value;\n                        _addQueryMatchR3(nativeNode_1, predicate, matches, elementsOnly, rootNativeNode);\n                    }\n                }\n                catch (e_1_1) { e_1 = { error: e_1_1 }; }\n                finally {\n                    try {\n                        if (head_1_1 && !head_1_1.done && (_a = head_1.return)) _a.call(head_1);\n                    }\n                    finally { if (e_1) throw e_1.error; }\n                }\n            }\n            else if (head) {\n                var nextLView = componentView[PARENT];\n                var nextTNode = nextLView[TVIEW].data[head.index];\n                _queryNodeChildrenR3(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n            }\n        }\n        else if (tNode.child) {\n            // Case 4: the TNode is a view.\n            _queryNodeChildrenR3(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n        }\n        // We don't want to go to the next sibling of the root node.\n        if (rootNativeNode !== nativeNode) {\n            // To determine the next node to be processed, we need to use the next or the projectionNext\n            // link, depending on whether the current node has been projected.\n            var nextTNode = (tNode.flags & 4 /* isProjected */) ? tNode.projectionNext : tNode.next;\n            if (nextTNode) {\n                _queryNodeChildrenR3(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n            }\n        }\n    }\n    /**\n     * Process all TNodes in a given container.\n     *\n     * @param lContainer the container to be processed\n     * @param predicate the predicate to match\n     * @param matches the list of positive matches\n     * @param elementsOnly whether only elements should be searched\n     * @param rootNativeNode the root native node on which predicate should not be matched\n     */\n    function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n        for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n            var childView = lContainer[i];\n            var firstChild = childView[TVIEW].firstChild;\n            if (firstChild) {\n                _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n            }\n        }\n    }\n    /**\n     * Match the current native node against the predicate.\n     *\n     * @param nativeNode the current native node\n     * @param predicate the predicate to match\n     * @param matches the list of positive matches\n     * @param elementsOnly whether only elements should be searched\n     * @param rootNativeNode the root native node on which predicate should not be matched\n     */\n    function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n        if (rootNativeNode !== nativeNode) {\n            var debugNode = getDebugNode$1(nativeNode);\n            if (!debugNode) {\n                return;\n            }\n            // Type of the \"predicate and \"matches\" array are set based on the value of\n            // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n            // types with generics, so we manually cast the parameters accordingly.\n            if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n                matches.indexOf(debugNode) === -1) {\n                matches.push(debugNode);\n            }\n            else if (!elementsOnly && predicate(debugNode) &&\n                matches.indexOf(debugNode) === -1) {\n                matches.push(debugNode);\n            }\n        }\n    }\n    /**\n     * Match all the descendants of a DOM node against a predicate.\n     *\n     * @param nativeNode the current native node\n     * @param predicate the predicate to match\n     * @param matches the list where matches are stored\n     * @param elementsOnly whether only elements should be searched\n     */\n    function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n        var nodes = parentNode.childNodes;\n        var length = nodes.length;\n        for (var i = 0; i < length; i++) {\n            var node = nodes[i];\n            var debugNode = getDebugNode$1(node);\n            if (debugNode) {\n                if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n                    matches.indexOf(debugNode) === -1) {\n                    matches.push(debugNode);\n                }\n                else if (!elementsOnly && predicate(debugNode) &&\n                    matches.indexOf(debugNode) === -1) {\n                    matches.push(debugNode);\n                }\n                _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n            }\n        }\n    }\n    /**\n     * Iterates through the property bindings for a given node and generates\n     * a map of property names to values. This map only contains property bindings\n     * defined in templates, not in host bindings.\n     */\n    function collectPropertyBindings(properties, tNode, lView, tData) {\n        var bindingIndexes = tNode.propertyBindings;\n        if (bindingIndexes !== null) {\n            for (var i = 0; i < bindingIndexes.length; i++) {\n                var bindingIndex = bindingIndexes[i];\n                var propMetadata = tData[bindingIndex];\n                var metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);\n                var propertyName = metadataParts[0];\n                if (metadataParts.length > 1) {\n                    var value = metadataParts[1];\n                    for (var j = 1; j < metadataParts.length - 1; j++) {\n                        value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];\n                    }\n                    properties[propertyName] = value;\n                }\n                else {\n                    properties[propertyName] = lView[bindingIndex];\n                }\n            }\n        }\n    }\n    // Need to keep the nodes in a global Map so that multiple angular apps are supported.\n    var _nativeNodeToDebugNode = new Map();\n    function getDebugNode__PRE_R3__(nativeNode) {\n        return _nativeNodeToDebugNode.get(nativeNode) || null;\n    }\n    var NG_DEBUG_PROPERTY = '__ng_debug__';\n    function getDebugNode__POST_R3__(nativeNode) {\n        if (nativeNode instanceof Node) {\n            if (!(nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY))) {\n                nativeNode[NG_DEBUG_PROPERTY] = nativeNode.nodeType == Node.ELEMENT_NODE ?\n                    new DebugElement__POST_R3__(nativeNode) :\n                    new DebugNode__POST_R3__(nativeNode);\n            }\n            return nativeNode[NG_DEBUG_PROPERTY];\n        }\n        return null;\n    }\n    /**\n     * @publicApi\n     */\n    var getDebugNode$1 = getDebugNode__PRE_R3__;\n    function getDebugNodeR2__PRE_R3__(nativeNode) {\n        return getDebugNode__PRE_R3__(nativeNode);\n    }\n    function getDebugNodeR2__POST_R3__(_nativeNode) {\n        return null;\n    }\n    var getDebugNodeR2 = getDebugNodeR2__PRE_R3__;\n    function getAllDebugNodes() {\n        return Array.from(_nativeNodeToDebugNode.values());\n    }\n    function indexDebugNode(node) {\n        _nativeNodeToDebugNode.set(node.nativeNode, node);\n    }\n    function removeDebugNodeFromIndex(node) {\n        _nativeNodeToDebugNode.delete(node.nativeNode);\n    }\n    /**\n     * @publicApi\n     */\n    var DebugNode = DebugNode__PRE_R3__;\n    /**\n     * @publicApi\n     */\n    var DebugElement = DebugElement__PRE_R3__;\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    var _CORE_PLATFORM_PROVIDERS = [\n        // Set a default platform name for platforms that don't set it explicitly.\n        { provide: PLATFORM_ID, useValue: 'unknown' },\n        { provide: PlatformRef, deps: [Injector] },\n        { provide: TestabilityRegistry, deps: [] },\n        { provide: Console, deps: [] },\n    ];\n    /**\n     * This platform has to be included in any other platform\n     *\n     * @publicApi\n     */\n    var platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);\n\n    /**\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://angular.io/license\n     */\n    function _iterableDiffersFactory() {\n        return defaultIterableDiffers;\n    }\n    function _keyValueDiffersFactory() {\n        return defaultKeyValueDiffers;\n    }\n    function _localeFactory(locale) {\n        locale = locale || getGlobalLocale();\n        if (ivyEnabled) {\n            setLocaleId(locale);\n        }\n        return locale;\n    }\n    /**\n     * Work out the locale from the potential global properties.\n     *\n     * * Closure Compiler: use `goog.getLocale()`.\n     * * Ivy enabled: use `$localize.locale`\n     */\n    function getGlobalLocale() {\n        if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&\n            typeof goog !== 'undefined' && goog.getLocale() !== 'en') {\n            // * The default `goog.getLocale()` value is `en`, while Angular used `en-US`.\n            // * In order to preserve backwards compatibility, we use Angular default value over\n            //   Closure Compiler's one.\n            return goog.getLocale();\n        }\n        else {\n            // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE\n            // COMPILE-TIME INLINER.\n            //\n            // * During compile time inlining of translations the expression will be replaced\n            //   with a string literal that is the current locale. Other forms of this expression are not\n            //   guaranteed to be replaced.\n            //\n            // * During runtime translation evaluation, the developer is required to set `$localize.locale`\n            //   if required, or just to provide their own `LOCALE_ID` provider.\n            return (ivyEnabled && typeof $localize !== 'undefined' && $localize.locale) ||\n                DEFAULT_LOCALE_ID;\n        }\n    }\n    var ɵ0$f = USD_CURRENCY_CODE;\n    /**\n     * A built-in [dependency injection token](guide/glossary#di-token)\n     * that is used to configure the root injector for bootstrapping.\n     */\n    var APPLICATION_MODULE_PROVIDERS = [\n        {\n            provide: ApplicationRef,\n            useClass: ApplicationRef,\n            deps: [NgZone, Injector, ErrorHandler, ComponentFactoryResolver, ApplicationInitStatus]\n        },\n        { provide: SCHEDULER, deps: [NgZone], useFactory: zoneSchedulerFactory },\n        {\n            provide: ApplicationInitStatus,\n            useClass: ApplicationInitStatus,\n            deps: [[new Optional(), APP_INITIALIZER]]\n        },\n        { provide: Compiler, useClass: Compiler, deps: [] },\n        APP_ID_RANDOM_PROVIDER,\n        { provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: [] },\n        { provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: [] },\n        {\n            provide: LOCALE_ID$1,\n            useFactory: _localeFactory,\n            deps: [[new Inject(LOCALE_ID$1), new Optional(), new SkipSelf()]]\n        },\n        { provide: DEFAULT_CURRENCY_CODE, useValue: ɵ0$f },\n    ];\n    /**\n     * Schedule work at next available slot.\n     *\n     * In Ivy this is just `requestAnimationFrame`. For compatibility reasons when bootstrapped\n     * using `platformRef.bootstrap` we need to use `NgZone.onStable` as the scheduling mechanism.\n     * This overrides the scheduling mechanism in Ivy to `NgZone.onStable`.\n     *\n     * @param ngZone NgZone to use for scheduling.\n     */\n    function zoneSchedulerFactory(ngZone) {\n        var queue = [];\n        ngZone.onStable.subscribe(function () {\n            while (queue.length) {\n                queue.pop()();\n            }\n        });\n        return function (fn) {\n            queue.push(fn);\n        };\n    }\n    /**\n     * Configures the root injector for an app with\n     * providers of `@angular/core` dependencies that `ApplicationRef` needs\n     * to bootstrap components.\n     *\n     * Re-exported by `BrowserModule`, which is included automatically in the root\n     * `AppModule` when you create a new app with the CLI `new` command.\n     *\n     * @publicApi\n     */\n    var ApplicationModule = /** @class */ (function () {\n        // Inject ApplicationRef to make it eager...\n        function ApplicationModule(appRef) {\n        }\n        return ApplicationModule;\n    }());\n    ApplicationModule.decorators = [\n        { type: NgModule, args: [{ providers: APPLICATION_MODULE_PROVIDERS },] }\n    ];\n    ApplicationModule.ctorParameters = function () { return [\n        { type: ApplicationRef }\n    ]; };\n\n    function anchorDef(flags, matchedQueriesDsl, ngContentIndex, childCount, handleEvent, templateFactory) {\n        flags |= 1 /* TypeElement */;\n        var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;\n        var template = templateFactory ? resolveDefinition(templateFactory) : null;\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            flags: flags,\n            checkIndex: -1,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            matchedQueries: matchedQueries,\n            matchedQueryIds: matchedQueryIds,\n            references: references,\n            ngContentIndex: ngContentIndex,\n            childCount: childCount,\n            bindings: [],\n            bindingFlags: 0,\n            outputs: [],\n            element: {\n                ns: null,\n                name: null,\n                attrs: null,\n                template: template,\n                componentProvider: null,\n                componentView: null,\n                componentRendererType: null,\n                publicProviders: null,\n                allProviders: null,\n                handleEvent: handleEvent || NOOP\n            },\n            provider: null,\n            text: null,\n            query: null,\n            ngContent: null\n        };\n    }\n    function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childCount, namespaceAndName, fixedAttrs, bindings, outputs, handleEvent, componentView, componentRendererType) {\n        var _a;\n        if (fixedAttrs === void 0) { fixedAttrs = []; }\n        if (!handleEvent) {\n            handleEvent = NOOP;\n        }\n        var _b = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _b.matchedQueries, references = _b.references, matchedQueryIds = _b.matchedQueryIds;\n        var ns = null;\n        var name = null;\n        if (namespaceAndName) {\n            _a = __read(splitNamespace(namespaceAndName), 2), ns = _a[0], name = _a[1];\n        }\n        bindings = bindings || [];\n        var bindingDefs = [];\n        for (var i = 0; i < bindings.length; i++) {\n            var _c = __read(bindings[i], 3), bindingFlags = _c[0], namespaceAndName_1 = _c[1], suffixOrSecurityContext = _c[2];\n            var _d = __read(splitNamespace(namespaceAndName_1), 2), ns_1 = _d[0], name_1 = _d[1];\n            var securityContext = undefined;\n            var suffix = undefined;\n            switch (bindingFlags & 15 /* Types */) {\n                case 4 /* TypeElementStyle */:\n                    suffix = suffixOrSecurityContext;\n                    break;\n                case 1 /* TypeElementAttribute */:\n                case 8 /* TypeProperty */:\n                    securityContext = suffixOrSecurityContext;\n                    break;\n            }\n            bindingDefs[i] =\n                { flags: bindingFlags, ns: ns_1, name: name_1, nonMinifiedName: name_1, securityContext: securityContext, suffix: suffix };\n        }\n        outputs = outputs || [];\n        var outputDefs = [];\n        for (var i = 0; i < outputs.length; i++) {\n            var _e = __read(outputs[i], 2), target = _e[0], eventName = _e[1];\n            outputDefs[i] =\n                { type: 0 /* ElementOutput */, target: target, eventName: eventName, propName: null };\n        }\n        fixedAttrs = fixedAttrs || [];\n        var attrs = fixedAttrs.map(function (_a) {\n            var _b = __read(_a, 2), namespaceAndName = _b[0], value = _b[1];\n            var _c = __read(splitNamespace(namespaceAndName), 2), ns = _c[0], name = _c[1];\n            return [ns, name, value];\n        });\n        componentRendererType = resolveRendererType2(componentRendererType);\n        if (componentView) {\n            flags |= 33554432 /* ComponentView */;\n        }\n        flags |= 1 /* TypeElement */;\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            checkIndex: checkIndex,\n            flags: flags,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            matchedQueries: matchedQueries,\n            matchedQueryIds: matchedQueryIds,\n            references: references,\n            ngContentIndex: ngContentIndex,\n            childCount: childCount,\n            bindings: bindingDefs,\n            bindingFlags: calcBindingFlags(bindingDefs),\n            outputs: outputDefs,\n            element: {\n                ns: ns,\n                name: name,\n                attrs: attrs,\n                template: null,\n                // will bet set by the view definition\n                componentProvider: null,\n                componentView: componentView || null,\n                componentRendererType: componentRendererType,\n                publicProviders: null,\n                allProviders: null,\n                handleEvent: handleEvent || NOOP,\n            },\n            provider: null,\n            text: null,\n            query: null,\n            ngContent: null\n        };\n    }\n    function createElement(view, renderHost, def) {\n        var elDef = def.element;\n        var rootSelectorOrNode = view.root.selectorOrNode;\n        var renderer = view.renderer;\n        var el;\n        if (view.parent || !rootSelectorOrNode) {\n            if (elDef.name) {\n                el = renderer.createElement(elDef.name, elDef.ns);\n            }\n            else {\n                el = renderer.createComment('');\n            }\n            var parentEl = getParentRenderElement(view, renderHost, def);\n            if (parentEl) {\n                renderer.appendChild(parentEl, el);\n            }\n        }\n        else {\n            // when using native Shadow DOM, do not clear the root element contents to allow slot projection\n            var preserveContent = (!!elDef.componentRendererType &&\n                elDef.componentRendererType.encapsulation === exports.ViewEncapsulation.ShadowDom);\n            el = renderer.selectRootElement(rootSelectorOrNode, preserveContent);\n        }\n        if (elDef.attrs) {\n            for (var i = 0; i < elDef.attrs.length; i++) {\n                var _a = __read(elDef.attrs[i], 3), ns = _a[0], name = _a[1], value = _a[2];\n                renderer.setAttribute(el, name, value, ns);\n            }\n        }\n        return el;\n    }\n    function listenToElementOutputs(view, compView, def, el) {\n        for (var i = 0; i < def.outputs.length; i++) {\n            var output = def.outputs[i];\n            var handleEventClosure = renderEventHandlerClosure(view, def.nodeIndex, elementEventFullName(output.target, output.eventName));\n            var listenTarget = output.target;\n            var listenerView = view;\n            if (output.target === 'component') {\n                listenTarget = null;\n                listenerView = compView;\n            }\n            var disposable = listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure);\n            view.disposables[def.outputIndex + i] = disposable;\n        }\n    }\n    function renderEventHandlerClosure(view, index, eventName) {\n        return function (event) { return dispatchEvent(view, index, eventName, event); };\n    }\n    function checkAndUpdateElementInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var bindLen = def.bindings.length;\n        var changed = false;\n        if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0))\n            changed = true;\n        if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1))\n            changed = true;\n        if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2))\n            changed = true;\n        if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3))\n            changed = true;\n        if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4))\n            changed = true;\n        if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5))\n            changed = true;\n        if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6))\n            changed = true;\n        if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7))\n            changed = true;\n        if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8))\n            changed = true;\n        if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9))\n            changed = true;\n        return changed;\n    }\n    function checkAndUpdateElementDynamic(view, def, values) {\n        var changed = false;\n        for (var i = 0; i < values.length; i++) {\n            if (checkAndUpdateElementValue(view, def, i, values[i]))\n                changed = true;\n        }\n        return changed;\n    }\n    function checkAndUpdateElementValue(view, def, bindingIdx, value) {\n        if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {\n            return false;\n        }\n        var binding = def.bindings[bindingIdx];\n        var elData = asElementData(view, def.nodeIndex);\n        var renderNode = elData.renderElement;\n        var name = binding.name;\n        switch (binding.flags & 15 /* Types */) {\n            case 1 /* TypeElementAttribute */:\n                setElementAttribute$1(view, binding, renderNode, binding.ns, name, value);\n                break;\n            case 2 /* TypeElementClass */:\n                setElementClass(view, renderNode, name, value);\n                break;\n            case 4 /* TypeElementStyle */:\n                setElementStyle(view, binding, renderNode, name, value);\n                break;\n            case 8 /* TypeProperty */:\n                var bindView = (def.flags & 33554432 /* ComponentView */ &&\n                    binding.flags & 32 /* SyntheticHostProperty */) ?\n                    elData.componentView :\n                    view;\n                setElementProperty(bindView, binding, renderNode, name, value);\n                break;\n        }\n        return true;\n    }\n    function setElementAttribute$1(view, binding, renderNode, ns, name, value) {\n        var securityContext = binding.securityContext;\n        var renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n        renderValue = renderValue != null ? renderValue.toString() : null;\n        var renderer = view.renderer;\n        if (value != null) {\n            renderer.setAttribute(renderNode, name, renderValue, ns);\n        }\n        else {\n            renderer.removeAttribute(renderNode, name, ns);\n        }\n    }\n    function setElementClass(view, renderNode, name, value) {\n        var renderer = view.renderer;\n        if (value) {\n            renderer.addClass(renderNode, name);\n        }\n        else {\n            renderer.removeClass(renderNode, name);\n        }\n    }\n    function setElementStyle(view, binding, renderNode, name, value) {\n        var renderValue = view.root.sanitizer.sanitize(exports.SecurityContext.STYLE, value);\n        if (renderValue != null) {\n            renderValue = renderValue.toString();\n            var unit = binding.suffix;\n            if (unit != null) {\n                renderValue = renderValue + unit;\n            }\n        }\n        else {\n            renderValue = null;\n        }\n        var renderer = view.renderer;\n        if (renderValue != null) {\n            renderer.setStyle(renderNode, name, renderValue);\n        }\n        else {\n            renderer.removeStyle(renderNode, name);\n        }\n    }\n    function setElementProperty(view, binding, renderNode, name, value) {\n        var securityContext = binding.securityContext;\n        var renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n        view.renderer.setProperty(renderNode, name, renderValue);\n    }\n\n    /**\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://angular.io/license\n     */\n    function queryDef(flags, id, bindings) {\n        var bindingDefs = [];\n        for (var propName in bindings) {\n            var bindingType = bindings[propName];\n            bindingDefs.push({ propName: propName, bindingType: bindingType });\n        }\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            // TODO(vicb): check\n            checkIndex: -1,\n            flags: flags,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            ngContentIndex: -1,\n            matchedQueries: {},\n            matchedQueryIds: 0,\n            references: {},\n            childCount: 0,\n            bindings: [],\n            bindingFlags: 0,\n            outputs: [],\n            element: null,\n            provider: null,\n            text: null,\n            query: { id: id, filterId: filterQueryId(id), bindings: bindingDefs },\n            ngContent: null\n        };\n    }\n    function createQuery(emitDistinctChangesOnly) {\n        return new QueryList(emitDistinctChangesOnly);\n    }\n    function dirtyParentQueries(view) {\n        var queryIds = view.def.nodeMatchedQueries;\n        while (view.parent && isEmbeddedView(view)) {\n            var tplDef = view.parentNodeDef;\n            view = view.parent;\n            // content queries\n            var end = tplDef.nodeIndex + tplDef.childCount;\n            for (var i = 0; i <= end; i++) {\n                var nodeDef = view.def.nodes[i];\n                if ((nodeDef.flags & 67108864 /* TypeContentQuery */) &&\n                    (nodeDef.flags & 536870912 /* DynamicQuery */) &&\n                    (nodeDef.query.filterId & queryIds) === nodeDef.query.filterId) {\n                    asQueryList(view, i).setDirty();\n                }\n                if ((nodeDef.flags & 1 /* TypeElement */ && i + nodeDef.childCount < tplDef.nodeIndex) ||\n                    !(nodeDef.childFlags & 67108864 /* TypeContentQuery */) ||\n                    !(nodeDef.childFlags & 536870912 /* DynamicQuery */)) {\n                    // skip elements that don't contain the template element or no query.\n                    i += nodeDef.childCount;\n                }\n            }\n        }\n        // view queries\n        if (view.def.nodeFlags & 134217728 /* TypeViewQuery */) {\n            for (var i = 0; i < view.def.nodes.length; i++) {\n                var nodeDef = view.def.nodes[i];\n                if ((nodeDef.flags & 134217728 /* TypeViewQuery */) && (nodeDef.flags & 536870912 /* DynamicQuery */)) {\n                    asQueryList(view, i).setDirty();\n                }\n                // only visit the root nodes\n                i += nodeDef.childCount;\n            }\n        }\n    }\n    function checkAndUpdateQuery(view, nodeDef) {\n        var queryList = asQueryList(view, nodeDef.nodeIndex);\n        if (!queryList.dirty) {\n            return;\n        }\n        var directiveInstance;\n        var newValues = undefined;\n        if (nodeDef.flags & 67108864 /* TypeContentQuery */) {\n            var elementDef = nodeDef.parent.parent;\n            newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query, []);\n            directiveInstance = asProviderData(view, nodeDef.parent.nodeIndex).instance;\n        }\n        else if (nodeDef.flags & 134217728 /* TypeViewQuery */) {\n            newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query, []);\n            directiveInstance = view.component;\n        }\n        queryList.reset(newValues, unwrapElementRef);\n        var bindings = nodeDef.query.bindings;\n        var notify = false;\n        for (var i = 0; i < bindings.length; i++) {\n            var binding = bindings[i];\n            var boundValue = void 0;\n            switch (binding.bindingType) {\n                case 0 /* First */:\n                    boundValue = queryList.first;\n                    break;\n                case 1 /* All */:\n                    boundValue = queryList;\n                    notify = true;\n                    break;\n            }\n            directiveInstance[binding.propName] = boundValue;\n        }\n        if (notify) {\n            queryList.notifyOnChanges();\n        }\n    }\n    function calcQueryValues(view, startIndex, endIndex, queryDef, values) {\n        for (var i = startIndex; i <= endIndex; i++) {\n            var nodeDef = view.def.nodes[i];\n            var valueType = nodeDef.matchedQueries[queryDef.id];\n            if (valueType != null) {\n                values.push(getQueryValue(view, nodeDef, valueType));\n            }\n            if (nodeDef.flags & 1 /* TypeElement */ && nodeDef.element.template &&\n                (nodeDef.element.template.nodeMatchedQueries & queryDef.filterId) ===\n                    queryDef.filterId) {\n                var elementData = asElementData(view, i);\n                // check embedded views that were attached at the place of their template,\n                // but process child nodes first if some match the query (see issue #16568)\n                if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {\n                    calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);\n                    i += nodeDef.childCount;\n                }\n                if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n                    var embeddedViews = elementData.viewContainer._embeddedViews;\n                    for (var k = 0; k < embeddedViews.length; k++) {\n                        var embeddedView = embeddedViews[k];\n                        var dvc = declaredViewContainer(embeddedView);\n                        if (dvc && dvc === elementData) {\n                            calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);\n                        }\n                    }\n                }\n                var projectedViews = elementData.template._projectedViews;\n                if (projectedViews) {\n                    for (var k = 0; k < projectedViews.length; k++) {\n                        var projectedView = projectedViews[k];\n                        calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);\n                    }\n                }\n            }\n            if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {\n                // if no child matches the query, skip the children.\n                i += nodeDef.childCount;\n            }\n        }\n        return values;\n    }\n    function getQueryValue(view, nodeDef, queryValueType) {\n        if (queryValueType != null) {\n            // a match\n            switch (queryValueType) {\n                case 1 /* RenderElement */:\n                    return asElementData(view, nodeDef.nodeIndex).renderElement;\n                case 0 /* ElementRef */:\n                    return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);\n                case 2 /* TemplateRef */:\n                    return asElementData(view, nodeDef.nodeIndex).template;\n                case 3 /* ViewContainerRef */:\n                    return asElementData(view, nodeDef.nodeIndex).viewContainer;\n                case 4 /* Provider */:\n                    return asProviderData(view, nodeDef.nodeIndex).instance;\n            }\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    function ngContentDef(ngContentIndex, index) {\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            checkIndex: -1,\n            flags: 8 /* TypeNgContent */,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            matchedQueries: {},\n            matchedQueryIds: 0,\n            references: {},\n            ngContentIndex: ngContentIndex,\n            childCount: 0,\n            bindings: [],\n            bindingFlags: 0,\n            outputs: [],\n            element: null,\n            provider: null,\n            text: null,\n            query: null,\n            ngContent: { index: index }\n        };\n    }\n    function appendNgContent(view, renderHost, def) {\n        var parentEl = getParentRenderElement(view, renderHost, def);\n        if (!parentEl) {\n            // Nothing to do if there is no parent element.\n            return;\n        }\n        var ngContentIndex = def.ngContent.index;\n        visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined);\n    }\n\n    function purePipeDef(checkIndex, argCount) {\n        // argCount + 1 to include the pipe as first arg\n        return _pureExpressionDef(128 /* TypePurePipe */, checkIndex, newArray(argCount + 1));\n    }\n    function pureArrayDef(checkIndex, argCount) {\n        return _pureExpressionDef(32 /* TypePureArray */, checkIndex, newArray(argCount));\n    }\n    function pureObjectDef(checkIndex, propToIndex) {\n        var keys = Object.keys(propToIndex);\n        var nbKeys = keys.length;\n        var propertyNames = [];\n        for (var i = 0; i < nbKeys; i++) {\n            var key = keys[i];\n            var index = propToIndex[key];\n            propertyNames.push(key);\n        }\n        return _pureExpressionDef(64 /* TypePureObject */, checkIndex, propertyNames);\n    }\n    function _pureExpressionDef(flags, checkIndex, propertyNames) {\n        var bindings = [];\n        for (var i = 0; i < propertyNames.length; i++) {\n            var prop = propertyNames[i];\n            bindings.push({\n                flags: 8 /* TypeProperty */,\n                name: prop,\n                ns: null,\n                nonMinifiedName: prop,\n                securityContext: null,\n                suffix: null\n            });\n        }\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            checkIndex: checkIndex,\n            flags: flags,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            matchedQueries: {},\n            matchedQueryIds: 0,\n            references: {},\n            ngContentIndex: -1,\n            childCount: 0,\n            bindings: bindings,\n            bindingFlags: calcBindingFlags(bindings),\n            outputs: [],\n            element: null,\n            provider: null,\n            text: null,\n            query: null,\n            ngContent: null\n        };\n    }\n    function createPureExpression(view, def) {\n        return { value: undefined };\n    }\n    function checkAndUpdatePureExpressionInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var bindings = def.bindings;\n        var changed = false;\n        var bindLen = bindings.length;\n        if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))\n            changed = true;\n        if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))\n            changed = true;\n        if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))\n            changed = true;\n        if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))\n            changed = true;\n        if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))\n            changed = true;\n        if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))\n            changed = true;\n        if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))\n            changed = true;\n        if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))\n            changed = true;\n        if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))\n            changed = true;\n        if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))\n            changed = true;\n        if (changed) {\n            var data = asPureExpressionData(view, def.nodeIndex);\n            var value = void 0;\n            switch (def.flags & 201347067 /* Types */) {\n                case 32 /* TypePureArray */:\n                    value = [];\n                    if (bindLen > 0)\n                        value.push(v0);\n                    if (bindLen > 1)\n                        value.push(v1);\n                    if (bindLen > 2)\n                        value.push(v2);\n                    if (bindLen > 3)\n                        value.push(v3);\n                    if (bindLen > 4)\n                        value.push(v4);\n                    if (bindLen > 5)\n                        value.push(v5);\n                    if (bindLen > 6)\n                        value.push(v6);\n                    if (bindLen > 7)\n                        value.push(v7);\n                    if (bindLen > 8)\n                        value.push(v8);\n                    if (bindLen > 9)\n                        value.push(v9);\n                    break;\n                case 64 /* TypePureObject */:\n                    value = {};\n                    if (bindLen > 0)\n                        value[bindings[0].name] = v0;\n                    if (bindLen > 1)\n                        value[bindings[1].name] = v1;\n                    if (bindLen > 2)\n                        value[bindings[2].name] = v2;\n                    if (bindLen > 3)\n                        value[bindings[3].name] = v3;\n                    if (bindLen > 4)\n                        value[bindings[4].name] = v4;\n                    if (bindLen > 5)\n                        value[bindings[5].name] = v5;\n                    if (bindLen > 6)\n                        value[bindings[6].name] = v6;\n                    if (bindLen > 7)\n                        value[bindings[7].name] = v7;\n                    if (bindLen > 8)\n                        value[bindings[8].name] = v8;\n                    if (bindLen > 9)\n                        value[bindings[9].name] = v9;\n                    break;\n                case 128 /* TypePurePipe */:\n                    var pipe = v0;\n                    switch (bindLen) {\n                        case 1:\n                            value = pipe.transform(v0);\n                            break;\n                        case 2:\n                            value = pipe.transform(v1);\n                            break;\n                        case 3:\n                            value = pipe.transform(v1, v2);\n                            break;\n                        case 4:\n                            value = pipe.transform(v1, v2, v3);\n                            break;\n                        case 5:\n                            value = pipe.transform(v1, v2, v3, v4);\n                            break;\n                        case 6:\n                            value = pipe.transform(v1, v2, v3, v4, v5);\n                            break;\n                        case 7:\n                            value = pipe.transform(v1, v2, v3, v4, v5, v6);\n                            break;\n                        case 8:\n                            value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);\n                            break;\n                        case 9:\n                            value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);\n                            break;\n                        case 10:\n                            value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);\n                            break;\n                    }\n                    break;\n            }\n            data.value = value;\n        }\n        return changed;\n    }\n    function checkAndUpdatePureExpressionDynamic(view, def, values) {\n        var bindings = def.bindings;\n        var changed = false;\n        for (var i = 0; i < values.length; i++) {\n            // Note: We need to loop over all values, so that\n            // the old values are updates as well!\n            if (checkAndUpdateBinding(view, def, i, values[i])) {\n                changed = true;\n            }\n        }\n        if (changed) {\n            var data = asPureExpressionData(view, def.nodeIndex);\n            var value = void 0;\n            switch (def.flags & 201347067 /* Types */) {\n                case 32 /* TypePureArray */:\n                    value = values;\n                    break;\n                case 64 /* TypePureObject */:\n                    value = {};\n                    for (var i = 0; i < values.length; i++) {\n                        value[bindings[i].name] = values[i];\n                    }\n                    break;\n                case 128 /* TypePurePipe */:\n                    var pipe = values[0];\n                    var params = values.slice(1);\n                    value = pipe.transform.apply(pipe, __spreadArray([], __read(params)));\n                    break;\n            }\n            data.value = value;\n        }\n        return changed;\n    }\n\n    /**\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://angular.io/license\n     */\n    function textDef(checkIndex, ngContentIndex, staticText) {\n        var bindings = [];\n        for (var i = 1; i < staticText.length; i++) {\n            bindings[i - 1] = {\n                flags: 8 /* TypeProperty */,\n                name: null,\n                ns: null,\n                nonMinifiedName: null,\n                securityContext: null,\n                suffix: staticText[i],\n            };\n        }\n        return {\n            // will bet set by the view definition\n            nodeIndex: -1,\n            parent: null,\n            renderParent: null,\n            bindingIndex: -1,\n            outputIndex: -1,\n            // regular values\n            checkIndex: checkIndex,\n            flags: 2 /* TypeText */,\n            childFlags: 0,\n            directChildFlags: 0,\n            childMatchedQueries: 0,\n            matchedQueries: {},\n            matchedQueryIds: 0,\n            references: {},\n            ngContentIndex: ngContentIndex,\n            childCount: 0,\n            bindings: bindings,\n            bindingFlags: 8 /* TypeProperty */,\n            outputs: [],\n            element: null,\n            provider: null,\n            text: { prefix: staticText[0] },\n            query: null,\n            ngContent: null,\n        };\n    }\n    function createText(view, renderHost, def) {\n        var renderNode;\n        var renderer = view.renderer;\n        renderNode = renderer.createText(def.text.prefix);\n        var parentEl = getParentRenderElement(view, renderHost, def);\n        if (parentEl) {\n            renderer.appendChild(parentEl, renderNode);\n        }\n        return { renderText: renderNode };\n    }\n    function checkAndUpdateTextInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var changed = false;\n        var bindings = def.bindings;\n        var bindLen = bindings.length;\n        if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))\n            changed = true;\n        if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))\n            changed = true;\n        if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))\n            changed = true;\n        if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))\n            changed = true;\n        if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))\n            changed = true;\n        if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))\n            changed = true;\n        if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))\n            changed = true;\n        if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))\n            changed = true;\n        if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))\n            changed = true;\n        if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))\n            changed = true;\n        if (changed) {\n            var value = def.text.prefix;\n            if (bindLen > 0)\n                value += _addInterpolationPart(v0, bindings[0]);\n            if (bindLen > 1)\n                value += _addInterpolationPart(v1, bindings[1]);\n            if (bindLen > 2)\n                value += _addInterpolationPart(v2, bindings[2]);\n            if (bindLen > 3)\n                value += _addInterpolationPart(v3, bindings[3]);\n            if (bindLen > 4)\n                value += _addInterpolationPart(v4, bindings[4]);\n            if (bindLen > 5)\n                value += _addInterpolationPart(v5, bindings[5]);\n            if (bindLen > 6)\n                value += _addInterpolationPart(v6, bindings[6]);\n            if (bindLen > 7)\n                value += _addInterpolationPart(v7, bindings[7]);\n            if (bindLen > 8)\n                value += _addInterpolationPart(v8, bindings[8]);\n            if (bindLen > 9)\n                value += _addInterpolationPart(v9, bindings[9]);\n            var renderNode = asTextData(view, def.nodeIndex).renderText;\n            view.renderer.setValue(renderNode, value);\n        }\n        return changed;\n    }\n    function checkAndUpdateTextDynamic(view, def, values) {\n        var bindings = def.bindings;\n        var changed = false;\n        for (var i = 0; i < values.length; i++) {\n            // Note: We need to loop over all values, so that\n            // the old values are updates as well!\n            if (checkAndUpdateBinding(view, def, i, values[i])) {\n                changed = true;\n            }\n        }\n        if (changed) {\n            var value = '';\n            for (var i = 0; i < values.length; i++) {\n                value = value + _addInterpolationPart(values[i], bindings[i]);\n            }\n            value = def.text.prefix + value;\n            var renderNode = asTextData(view, def.nodeIndex).renderText;\n            view.renderer.setValue(renderNode, value);\n        }\n        return changed;\n    }\n    function _addInterpolationPart(value, binding) {\n        var valueStr = value != null ? value.toString() : '';\n        return valueStr + binding.suffix;\n    }\n\n    /**\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://angular.io/license\n     */\n    function viewDef(flags, nodes, updateDirectives, updateRenderer) {\n        // clone nodes and set auto calculated values\n        var viewBindingCount = 0;\n        var viewDisposableCount = 0;\n        var viewNodeFlags = 0;\n        var viewRootNodeFlags = 0;\n        var viewMatchedQueries = 0;\n        var currentParent = null;\n        var currentRenderParent = null;\n        var currentElementHasPublicProviders = false;\n        var currentElementHasPrivateProviders = false;\n        var lastRenderRootNode = null;\n        for (var i = 0; i < nodes.length; i++) {\n            var node = nodes[i];\n            node.nodeIndex = i;\n            node.parent = currentParent;\n            node.bindingIndex = viewBindingCount;\n            node.outputIndex = viewDisposableCount;\n            node.renderParent = currentRenderParent;\n            viewNodeFlags |= node.flags;\n            viewMatchedQueries |= node.matchedQueryIds;\n            if (node.element) {\n                var elDef = node.element;\n                elDef.publicProviders =\n                    currentParent ? currentParent.element.publicProviders : Object.create(null);\n                elDef.allProviders = elDef.publicProviders;\n                // Note: We assume that all providers of an element are before any child element!\n                currentElementHasPublicProviders = false;\n                currentElementHasPrivateProviders = false;\n                if (node.element.template) {\n                    viewMatchedQueries |= node.element.template.nodeMatchedQueries;\n                }\n            }\n            validateNode(currentParent, node, nodes.length);\n            viewBindingCount += node.bindings.length;\n            viewDisposableCount += node.outputs.length;\n            if (!currentRenderParent && (node.flags & 3 /* CatRenderNode */)) {\n                lastRenderRootNode = node;\n            }\n            if (node.flags & 20224 /* CatProvider */) {\n                if (!currentElementHasPublicProviders) {\n                    currentElementHasPublicProviders = true;\n                    // Use prototypical inheritance to not get O(n^2) complexity...\n                    currentParent.element.publicProviders =\n                        Object.create(currentParent.element.publicProviders);\n                    currentParent.element.allProviders = currentParent.element.publicProviders;\n                }\n                var isPrivateService = (node.flags & 8192 /* PrivateProvider */) !== 0;\n                var isComponent = (node.flags & 32768 /* Component */) !== 0;\n                if (!isPrivateService || isComponent) {\n                    currentParent.element.publicProviders[tokenKey(node.provider.token)] = node;\n                }\n                else {\n                    if (!currentElementHasPrivateProviders) {\n                        currentElementHasPrivateProviders = true;\n                        // Use prototypical inheritance to not get O(n^2) complexity...\n                        currentParent.element.allProviders =\n                            Object.create(currentParent.element.publicProviders);\n                    }\n                    currentParent.element.allProviders[tokenKey(node.provider.token)] = node;\n                }\n                if (isComponent) {\n                    currentParent.element.componentProvider = node;\n                }\n            }\n            if (currentParent) {\n                currentParent.childFlags |= node.flags;\n                currentParent.directChildFlags |= node.flags;\n                currentParent.childMatchedQueries |= node.matchedQueryIds;\n                if (node.element && node.element.template) {\n                    currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;\n                }\n            }\n            else {\n                viewRootNodeFlags |= node.flags;\n            }\n            if (node.childCount > 0) {\n                currentParent = node;\n                if (!isNgContainer(node)) {\n                    currentRenderParent = node;\n                }\n            }\n            else {\n                // When the current node has no children, check if it is the last children of its parent.\n                // When it is, propagate the flags up.\n                // The loop is required because an element could be the last transitive children of several\n                // elements. We loop to either the root or the highest opened element (= with remaining\n                // children)\n                while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {\n                    var newParent = currentParent.parent;\n                    if (newParent) {\n                        newParent.childFlags |= currentParent.childFlags;\n                        newParent.childMatchedQueries |= currentParent.childMatchedQueries;\n                    }\n                    currentParent = newParent;\n                    // We also need to update the render parent & account for ng-container\n                    if (currentParent && isNgContainer(currentParent)) {\n                        currentRenderParent = currentParent.renderParent;\n                    }\n                    else {\n                        currentRenderParent = currentParent;\n                    }\n                }\n            }\n        }\n        var handleEvent = function (view, nodeIndex, eventName, event) { return nodes[nodeIndex].element.handleEvent(view, eventName, event); };\n        return {\n            // Will be filled later...\n            factory: null,\n            nodeFlags: viewNodeFlags,\n            rootNodeFlags: viewRootNodeFlags,\n            nodeMatchedQueries: viewMatchedQueries,\n            flags: flags,\n            nodes: nodes,\n            updateDirectives: updateDirectives || NOOP,\n            updateRenderer: updateRenderer || NOOP,\n            handleEvent: handleEvent,\n            bindingCount: viewBindingCount,\n            outputCount: viewDisposableCount,\n            lastRenderRootNode: lastRenderRootNode\n        };\n    }\n    function isNgContainer(node) {\n        return (node.flags & 1 /* TypeElement */) !== 0 && node.element.name === null;\n    }\n    function validateNode(parent, node, nodeCount) {\n        var template = node.element && node.element.template;\n        if (template) {\n            if (!template.lastRenderRootNode) {\n                throw new Error(\"Illegal State: Embedded templates without nodes are not allowed!\");\n            }\n            if (template.lastRenderRootNode &&\n                template.lastRenderRootNode.flags & 16777216 /* EmbeddedViews */) {\n                throw new Error(\"Illegal State: Last root node of a template can't have embedded views, at index \" + node.nodeIndex + \"!\");\n            }\n        }\n        if (node.flags & 20224 /* CatProvider */) {\n            var parentFlags = parent ? parent.flags : 0;\n            if ((parentFlags & 1 /* TypeElement */) === 0) {\n                throw new Error(\"Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index \" + node.nodeIndex + \"!\");\n            }\n        }\n        if (node.query) {\n            if (node.flags & 67108864 /* TypeContentQuery */ &&\n                (!parent || (parent.flags & 16384 /* TypeDirective */) === 0)) {\n                throw new Error(\"Illegal State: Content Query nodes need to be children of directives, at index \" + node.nodeIndex + \"!\");\n            }\n            if (node.flags & 134217728 /* TypeViewQuery */ && parent) {\n                throw new Error(\"Illegal State: View Query nodes have to be top level nodes, at index \" + node.nodeIndex + \"!\");\n            }\n        }\n        if (node.childCount) {\n            var parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;\n            if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {\n                throw new Error(\"Illegal State: childCount of node leads outside of parent, at index \" + node.nodeIndex + \"!\");\n            }\n        }\n    }\n    function createEmbeddedView(parent, anchorDef, viewDef, context) {\n        // embedded views are seen as siblings to the anchor, so we need\n        // to get the parent of the anchor and use it as parentIndex.\n        var view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef);\n        initView(view, parent.component, context);\n        createViewNodes(view);\n        return view;\n    }\n    function createRootView(root, def, context) {\n        var view = createView(root, root.renderer, null, null, def);\n        initView(view, context, context);\n        createViewNodes(view);\n        return view;\n    }\n    function createComponentView(parentView, nodeDef, viewDef, hostElement) {\n        var rendererType = nodeDef.element.componentRendererType;\n        var compRenderer;\n        if (!rendererType) {\n            compRenderer = parentView.root.renderer;\n        }\n        else {\n            compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);\n        }\n        return createView(parentView.root, compRenderer, parentView, nodeDef.element.componentProvider, viewDef);\n    }\n    function createView(root, renderer, parent, parentNodeDef, def) {\n        var nodes = new Array(def.nodes.length);\n        var disposables = def.outputCount ? new Array(def.outputCount) : null;\n        var view = {\n            def: def,\n            parent: parent,\n            viewContainerParent: null,\n            parentNodeDef: parentNodeDef,\n            context: null,\n            component: null,\n            nodes: nodes,\n            state: 13 /* CatInit */,\n            root: root,\n            renderer: renderer,\n            oldValues: new Array(def.bindingCount),\n            disposables: disposables,\n            initIndex: -1\n        };\n        return view;\n    }\n    function initView(view, component, context) {\n        view.component = component;\n        view.context = context;\n    }\n    function createViewNodes(view) {\n        var renderHost;\n        if (isComponentView(view)) {\n            var hostDef = view.parentNodeDef;\n            renderHost = asElementData(view.parent, hostDef.parent.nodeIndex).renderElement;\n        }\n        var def = view.def;\n        var nodes = view.nodes;\n        for (var i = 0; i < def.nodes.length; i++) {\n            var nodeDef = def.nodes[i];\n            Services.setCurrentNode(view, i);\n            var nodeData = void 0;\n            switch (nodeDef.flags & 201347067 /* Types */) {\n                case 1 /* TypeElement */:\n                    var el = createElement(view, renderHost, nodeDef);\n                    var componentView = undefined;\n                    if (nodeDef.flags & 33554432 /* ComponentView */) {\n                        var compViewDef = resolveDefinition(nodeDef.element.componentView);\n                        componentView = Services.createComponentView(view, nodeDef, compViewDef, el);\n                    }\n                    listenToElementOutputs(view, componentView, nodeDef, el);\n                    nodeData = {\n                        renderElement: el,\n                        componentView: componentView,\n                        viewContainer: null,\n                        template: nodeDef.element.template ? createTemplateData(view, nodeDef) : undefined\n                    };\n                    if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n                        nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);\n                    }\n                    break;\n                case 2 /* TypeText */:\n                    nodeData = createText(view, renderHost, nodeDef);\n                    break;\n                case 512 /* TypeClassProvider */:\n                case 1024 /* TypeFactoryProvider */:\n                case 2048 /* TypeUseExistingProvider */:\n                case 256 /* TypeValueProvider */: {\n                    nodeData = nodes[i];\n                    if (!nodeData && !(nodeDef.flags & 4096 /* LazyProvider */)) {\n                        var instance = createProviderInstance(view, nodeDef);\n                        nodeData = { instance: instance };\n                    }\n                    break;\n                }\n                case 16 /* TypePipe */: {\n                    var instance = createPipeInstance(view, nodeDef);\n                    nodeData = { instance: instance };\n                    break;\n                }\n                case 16384 /* TypeDirective */: {\n                    nodeData = nodes[i];\n                    if (!nodeData) {\n                        var instance = createDirectiveInstance(view, nodeDef);\n                        nodeData = { instance: instance };\n                    }\n                    if (nodeDef.flags & 32768 /* Component */) {\n                        var compView = asElementData(view, nodeDef.parent.nodeIndex).componentView;\n                        initView(compView, nodeData.instance, nodeData.instance);\n                    }\n                    break;\n                }\n                case 32 /* TypePureArray */:\n                case 64 /* TypePureObject */:\n                case 128 /* TypePurePipe */:\n                    nodeData = createPureExpression(view, nodeDef);\n                    break;\n                case 67108864 /* TypeContentQuery */:\n                case 134217728 /* TypeViewQuery */:\n                    nodeData = createQuery((nodeDef.flags & -2147483648 /* EmitDistinctChangesOnly */) ===\n                        -2147483648 /* EmitDistinctChangesOnly */);\n                    break;\n                case 8 /* TypeNgContent */:\n                    appendNgContent(view, renderHost, nodeDef);\n                    // no runtime data needed for NgContent...\n                    nodeData = undefined;\n                    break;\n            }\n            nodes[i] = nodeData;\n        }\n        // Create the ViewData.nodes of component views after we created everything else,\n        // so that e.g. ng-content works\n        execComponentViewsAction(view, ViewAction.CreateViewNodes);\n        // fill static content and view queries\n        execQueriesAction(view, 67108864 /* TypeContentQuery */ | 134217728 /* TypeViewQuery */, 268435456 /* StaticQuery */, 0 /* CheckAndUpdate */);\n    }\n    function checkNoChangesView(view) {\n        markProjectedViewsForCheck(view);\n        Services.updateDirectives(view, 1 /* CheckNoChanges */);\n        execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);\n        Services.updateRenderer(view, 1 /* CheckNoChanges */);\n        execComponentViewsAction(view, ViewAction.CheckNoChanges);\n        // Note: We don't check queries for changes as we didn't do this in v2.x.\n        // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.\n        view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);\n    }\n    function checkAndUpdateView(view) {\n        if (view.state & 1 /* BeforeFirstCheck */) {\n            view.state &= ~1 /* BeforeFirstCheck */;\n            view.state |= 2 /* FirstCheck */;\n        }\n        else {\n            view.state &= ~2 /* FirstCheck */;\n        }\n        shiftInitState(view, 0 /* InitState_BeforeInit */, 256 /* InitState_CallingOnInit */);\n        markProjectedViewsForCheck(view);\n        Services.updateDirectives(view, 0 /* CheckAndUpdate */);\n        execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);\n        execQueriesAction(view, 67108864 /* TypeContentQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);\n        var callInit = shiftInitState(view, 256 /* InitState_CallingOnInit */, 512 /* InitState_CallingAfterContentInit */);\n        callLifecycleHooksChildrenFirst(view, 2097152 /* AfterContentChecked */ | (callInit ? 1048576 /* AfterContentInit */ : 0));\n        Services.updateRenderer(view, 0 /* CheckAndUpdate */);\n        execComponentViewsAction(view, ViewAction.CheckAndUpdate);\n        execQueriesAction(view, 134217728 /* TypeViewQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);\n        callInit = shiftInitState(view, 512 /* InitState_CallingAfterContentInit */, 768 /* InitState_CallingAfterViewInit */);\n        callLifecycleHooksChildrenFirst(view, 8388608 /* AfterViewChecked */ | (callInit ? 4194304 /* AfterViewInit */ : 0));\n        if (view.def.flags & 2 /* OnPush */) {\n            view.state &= ~8 /* ChecksEnabled */;\n        }\n        view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);\n        shiftInitState(view, 768 /* InitState_CallingAfterViewInit */, 1024 /* InitState_AfterInit */);\n    }\n    function checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        if (argStyle === 0 /* Inline */) {\n            return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n        }\n        else {\n            return checkAndUpdateNodeDynamic(view, nodeDef, v0);\n        }\n    }\n    function markProjectedViewsForCheck(view) {\n        var def = view.def;\n        if (!(def.nodeFlags & 4 /* ProjectedTemplate */)) {\n            return;\n        }\n        for (var i = 0; i < def.nodes.length; i++) {\n            var nodeDef = def.nodes[i];\n            if (nodeDef.flags & 4 /* ProjectedTemplate */) {\n                var projectedViews = asElementData(view, i).template._projectedViews;\n                if (projectedViews) {\n                    for (var i_1 = 0; i_1 < projectedViews.length; i_1++) {\n                        var projectedView = projectedViews[i_1];\n                        projectedView.state |= 32 /* CheckProjectedView */;\n                        markParentViewsForCheckProjectedViews(projectedView, view);\n                    }\n                }\n            }\n            else if ((nodeDef.childFlags & 4 /* ProjectedTemplate */) === 0) {\n                // a parent with leafs\n                // no child is a component,\n                // then skip the children\n                i += nodeDef.childCount;\n            }\n        }\n    }\n    function checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        switch (nodeDef.flags & 201347067 /* Types */) {\n            case 1 /* TypeElement */:\n                return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            case 2 /* TypeText */:\n                return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            case 16384 /* TypeDirective */:\n                return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            case 32 /* TypePureArray */:\n            case 64 /* TypePureObject */:\n            case 128 /* TypePurePipe */:\n                return checkAndUpdatePureExpressionInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            default:\n                throw 'unreachable';\n        }\n    }\n    function checkAndUpdateNodeDynamic(view, nodeDef, values) {\n        switch (nodeDef.flags & 201347067 /* Types */) {\n            case 1 /* TypeElement */:\n                return checkAndUpdateElementDynamic(view, nodeDef, values);\n            case 2 /* TypeText */:\n                return checkAndUpdateTextDynamic(view, nodeDef, values);\n            case 16384 /* TypeDirective */:\n                return checkAndUpdateDirectiveDynamic(view, nodeDef, values);\n            case 32 /* TypePureArray */:\n            case 64 /* TypePureObject */:\n            case 128 /* TypePurePipe */:\n                return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);\n            default:\n                throw 'unreachable';\n        }\n    }\n    function checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        if (argStyle === 0 /* Inline */) {\n            checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n        }\n        else {\n            checkNoChangesNodeDynamic(view, nodeDef, v0);\n        }\n        // Returning false is ok here as we would have thrown in case of a change.\n        return false;\n    }\n    function checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var bindLen = nodeDef.bindings.length;\n        if (bindLen > 0)\n            checkBindingNoChanges(view, nodeDef, 0, v0);\n        if (bindLen > 1)\n            checkBindingNoChanges(view, nodeDef, 1, v1);\n        if (bindLen > 2)\n            checkBindingNoChanges(view, nodeDef, 2, v2);\n        if (bindLen > 3)\n            checkBindingNoChanges(view, nodeDef, 3, v3);\n        if (bindLen > 4)\n            checkBindingNoChanges(view, nodeDef, 4, v4);\n        if (bindLen > 5)\n            checkBindingNoChanges(view, nodeDef, 5, v5);\n        if (bindLen > 6)\n            checkBindingNoChanges(view, nodeDef, 6, v6);\n        if (bindLen > 7)\n            checkBindingNoChanges(view, nodeDef, 7, v7);\n        if (bindLen > 8)\n            checkBindingNoChanges(view, nodeDef, 8, v8);\n        if (bindLen > 9)\n            checkBindingNoChanges(view, nodeDef, 9, v9);\n    }\n    function checkNoChangesNodeDynamic(view, nodeDef, values) {\n        for (var i = 0; i < values.length; i++) {\n            checkBindingNoChanges(view, nodeDef, i, values[i]);\n        }\n    }\n    /**\n     * Workaround https://github.com/angular/tsickle/issues/497\n     * @suppress {misplacedTypeAnnotation}\n     */\n    function checkNoChangesQuery(view, nodeDef) {\n        var queryList = asQueryList(view, nodeDef.nodeIndex);\n        if (queryList.dirty) {\n            throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, nodeDef.nodeIndex), \"Query \" + nodeDef.query.id + \" not dirty\", \"Query \" + nodeDef.query.id + \" dirty\", (view.state & 1 /* BeforeFirstCheck */) !== 0);\n        }\n    }\n    function destroyView(view) {\n        if (view.state & 128 /* Destroyed */) {\n            return;\n        }\n        execEmbeddedViewsAction(view, ViewAction.Destroy);\n        execComponentViewsAction(view, ViewAction.Destroy);\n        callLifecycleHooksChildrenFirst(view, 131072 /* OnDestroy */);\n        if (view.disposables) {\n            for (var i = 0; i < view.disposables.length; i++) {\n                view.disposables[i]();\n            }\n        }\n        detachProjectedView(view);\n        if (view.renderer.destroyNode) {\n            destroyViewNodes(view);\n        }\n        if (isComponentView(view)) {\n            view.renderer.destroy();\n        }\n        view.state |= 128 /* Destroyed */;\n    }\n    function destroyViewNodes(view) {\n        var len = view.def.nodes.length;\n        for (var i = 0; i < len; i++) {\n            var def = view.def.nodes[i];\n            if (def.flags & 1 /* TypeElement */) {\n                view.renderer.destroyNode(asElementData(view, i).renderElement);\n            }\n            else if (def.flags & 2 /* TypeText */) {\n                view.renderer.destroyNode(asTextData(view, i).renderText);\n            }\n            else if (def.flags & 67108864 /* TypeContentQuery */ || def.flags & 134217728 /* TypeViewQuery */) {\n                asQueryList(view, i).destroy();\n            }\n        }\n    }\n    var ViewAction;\n    (function (ViewAction) {\n        ViewAction[ViewAction[\"CreateViewNodes\"] = 0] = \"CreateViewNodes\";\n        ViewAction[ViewAction[\"CheckNoChanges\"] = 1] = \"CheckNoChanges\";\n        ViewAction[ViewAction[\"CheckNoChangesProjectedViews\"] = 2] = \"CheckNoChangesProjectedViews\";\n        ViewAction[ViewAction[\"CheckAndUpdate\"] = 3] = \"CheckAndUpdate\";\n        ViewAction[ViewAction[\"CheckAndUpdateProjectedViews\"] = 4] = \"CheckAndUpdateProjectedViews\";\n        ViewAction[ViewAction[\"Destroy\"] = 5] = \"Destroy\";\n    })(ViewAction || (ViewAction = {}));\n    function execComponentViewsAction(view, action) {\n        var def = view.def;\n        if (!(def.nodeFlags & 33554432 /* ComponentView */)) {\n            return;\n        }\n        for (var i = 0; i < def.nodes.length; i++) {\n            var nodeDef = def.nodes[i];\n            if (nodeDef.flags & 33554432 /* ComponentView */) {\n                // a leaf\n                callViewAction(asElementData(view, i).componentView, action);\n            }\n            else if ((nodeDef.childFlags & 33554432 /* ComponentView */) === 0) {\n                // a parent with leafs\n                // no child is a component,\n                // then skip the children\n                i += nodeDef.childCount;\n            }\n        }\n    }\n    function execEmbeddedViewsAction(view, action) {\n        var def = view.def;\n        if (!(def.nodeFlags & 16777216 /* EmbeddedViews */)) {\n            return;\n        }\n        for (var i = 0; i < def.nodes.length; i++) {\n            var nodeDef = def.nodes[i];\n            if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n                // a leaf\n                var embeddedViews = asElementData(view, i).viewContainer._embeddedViews;\n                for (var k = 0; k < embeddedViews.length; k++) {\n                    callViewAction(embeddedViews[k], action);\n                }\n            }\n            else if ((nodeDef.childFlags & 16777216 /* EmbeddedViews */) === 0) {\n                // a parent with leafs\n                // no child is a component,\n                // then skip the children\n                i += nodeDef.childCount;\n            }\n        }\n    }\n    function callViewAction(view, action) {\n        var viewState = view.state;\n        switch (action) {\n            case ViewAction.CheckNoChanges:\n                if ((viewState & 128 /* Destroyed */) === 0) {\n                    if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {\n                        checkNoChangesView(view);\n                    }\n                    else if (viewState & 64 /* CheckProjectedViews */) {\n                        execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);\n                    }\n                }\n                break;\n            case ViewAction.CheckNoChangesProjectedViews:\n                if ((viewState & 128 /* Destroyed */) === 0) {\n                    if (viewState & 32 /* CheckProjectedView */) {\n                        checkNoChangesView(view);\n                    }\n                    else if (viewState & 64 /* CheckProjectedViews */) {\n                        execProjectedViewsAction(view, action);\n                    }\n                }\n                break;\n            case ViewAction.CheckAndUpdate:\n                if ((viewState & 128 /* Destroyed */) === 0) {\n                    if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {\n                        checkAndUpdateView(view);\n                    }\n                    else if (viewState & 64 /* CheckProjectedViews */) {\n                        execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);\n                    }\n                }\n                break;\n            case ViewAction.CheckAndUpdateProjectedViews:\n                if ((viewState & 128 /* Destroyed */) === 0) {\n                    if (viewState & 32 /* CheckProjectedView */) {\n                        checkAndUpdateView(view);\n                    }\n                    else if (viewState & 64 /* CheckProjectedViews */) {\n                        execProjectedViewsAction(view, action);\n                    }\n                }\n                break;\n            case ViewAction.Destroy:\n                // Note: destroyView recurses over all views,\n                // so we don't need to special case projected views here.\n                destroyView(view);\n                break;\n            case ViewAction.CreateViewNodes:\n                createViewNodes(view);\n                break;\n        }\n    }\n    function execProjectedViewsAction(view, action) {\n        execEmbeddedViewsAction(view, action);\n        execComponentViewsAction(view, action);\n    }\n    function execQueriesAction(view, queryFlags, staticDynamicQueryFlag, checkType) {\n        if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {\n            return;\n        }\n        var nodeCount = view.def.nodes.length;\n        for (var i = 0; i < nodeCount; i++) {\n            var nodeDef = view.def.nodes[i];\n            if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {\n                Services.setCurrentNode(view, nodeDef.nodeIndex);\n                switch (checkType) {\n                    case 0 /* CheckAndUpdate */:\n                        checkAndUpdateQuery(view, nodeDef);\n                        break;\n                    case 1 /* CheckNoChanges */:\n                        checkNoChangesQuery(view, nodeDef);\n                        break;\n                }\n            }\n            if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {\n                // no child has a matching query\n                // then skip the children\n                i += nodeDef.childCount;\n            }\n        }\n    }\n\n    var initialized = false;\n    function initServicesIfNeeded() {\n        if (initialized) {\n            return;\n        }\n        initialized = true;\n        var services = isDevMode() ? createDebugServices() : createProdServices();\n        Services.setCurrentNode = services.setCurrentNode;\n        Services.createRootView = services.createRootView;\n        Services.createEmbeddedView = services.createEmbeddedView;\n        Services.createComponentView = services.createComponentView;\n        Services.createNgModuleRef = services.createNgModuleRef;\n        Services.overrideProvider = services.overrideProvider;\n        Services.overrideComponentView = services.overrideComponentView;\n        Services.clearOverrides = services.clearOverrides;\n        Services.checkAndUpdateView = services.checkAndUpdateView;\n        Services.checkNoChangesView = services.checkNoChangesView;\n        Services.destroyView = services.destroyView;\n        Services.resolveDep = resolveDep;\n        Services.createDebugContext = services.createDebugContext;\n        Services.handleEvent = services.handleEvent;\n        Services.updateDirectives = services.updateDirectives;\n        Services.updateRenderer = services.updateRenderer;\n        Services.dirtyParentQueries = dirtyParentQueries;\n    }\n    function createProdServices() {\n        return {\n            setCurrentNode: function () { },\n            createRootView: createProdRootView,\n            createEmbeddedView: createEmbeddedView,\n            createComponentView: createComponentView,\n            createNgModuleRef: createNgModuleRef,\n            overrideProvider: NOOP,\n            overrideComponentView: NOOP,\n            clearOverrides: NOOP,\n            checkAndUpdateView: checkAndUpdateView,\n            checkNoChangesView: checkNoChangesView,\n            destroyView: destroyView,\n            createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },\n            handleEvent: function (view, nodeIndex, eventName, event) { return view.def.handleEvent(view, nodeIndex, eventName, event); },\n            updateDirectives: function (view, checkType) { return view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view); },\n            updateRenderer: function (view, checkType) { return view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view); },\n        };\n    }\n    function createDebugServices() {\n        return {\n            setCurrentNode: debugSetCurrentNode,\n            createRootView: debugCreateRootView,\n            createEmbeddedView: debugCreateEmbeddedView,\n            createComponentView: debugCreateComponentView,\n            createNgModuleRef: debugCreateNgModuleRef,\n            overrideProvider: debugOverrideProvider,\n            overrideComponentView: debugOverrideComponentView,\n            clearOverrides: debugClearOverrides,\n            checkAndUpdateView: debugCheckAndUpdateView,\n            checkNoChangesView: debugCheckNoChangesView,\n            destroyView: debugDestroyView,\n            createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },\n            handleEvent: debugHandleEvent,\n            updateDirectives: debugUpdateDirectives,\n            updateRenderer: debugUpdateRenderer,\n        };\n    }\n    function createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {\n        var rendererFactory = ngModule.injector.get(RendererFactory2);\n        return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context);\n    }\n    function debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {\n        var rendererFactory = ngModule.injector.get(RendererFactory2);\n        var root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode);\n        var defWithOverride = applyProviderOverridesToView(def);\n        return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]);\n    }\n    function createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) {\n        var sanitizer = ngModule.injector.get(Sanitizer);\n        var errorHandler = ngModule.injector.get(ErrorHandler);\n        var renderer = rendererFactory.createRenderer(null, null);\n        return {\n            ngModule: ngModule,\n            injector: elInjector,\n            projectableNodes: projectableNodes,\n            selectorOrNode: rootSelectorOrNode,\n            sanitizer: sanitizer,\n            rendererFactory: rendererFactory,\n            renderer: renderer,\n            errorHandler: errorHandler\n        };\n    }\n    function debugCreateEmbeddedView(parentView, anchorDef, viewDef, context) {\n        var defWithOverride = applyProviderOverridesToView(viewDef);\n        return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]);\n    }\n    function debugCreateComponentView(parentView, nodeDef, viewDef, hostElement) {\n        var overrideComponentView = viewDefOverrides.get(nodeDef.element.componentProvider.provider.token);\n        if (overrideComponentView) {\n            viewDef = overrideComponentView;\n        }\n        else {\n            viewDef = applyProviderOverridesToView(viewDef);\n        }\n        return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]);\n    }\n    function debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) {\n        var defWithOverride = applyProviderOverridesToNgModule(def);\n        return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);\n    }\n    var providerOverrides = new Map();\n    var providerOverridesWithScope = new Map();\n    var viewDefOverrides = new Map();\n    function debugOverrideProvider(override) {\n        providerOverrides.set(override.token, override);\n        var injectableDef;\n        if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) &&\n            typeof injectableDef.providedIn === 'function') {\n            providerOverridesWithScope.set(override.token, override);\n        }\n    }\n    function debugOverrideComponentView(comp, compFactory) {\n        var hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));\n        var compViewDef = resolveDefinition(hostViewDef.nodes[0].element.componentView);\n        viewDefOverrides.set(comp, compViewDef);\n    }\n    function debugClearOverrides() {\n        providerOverrides.clear();\n        providerOverridesWithScope.clear();\n        viewDefOverrides.clear();\n    }\n    // Notes about the algorithm:\n    // 1) Locate the providers of an element and check if one of them was overwritten\n    // 2) Change the providers of that element\n    //\n    // We only create new data structures if we need to, to keep perf impact\n    // reasonable.\n    function applyProviderOverridesToView(def) {\n        if (providerOverrides.size === 0) {\n            return def;\n        }\n        var elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);\n        if (elementIndicesWithOverwrittenProviders.length === 0) {\n            return def;\n        }\n        // clone the whole view definition,\n        // as it maintains references between the nodes that are hard to update.\n        def = def.factory(function () { return NOOP; });\n        for (var i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {\n            applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);\n        }\n        return def;\n        function findElementIndicesWithOverwrittenProviders(def) {\n            var elIndicesWithOverwrittenProviders = [];\n            var lastElementDef = null;\n            for (var i = 0; i < def.nodes.length; i++) {\n                var nodeDef = def.nodes[i];\n                if (nodeDef.flags & 1 /* TypeElement */) {\n                    lastElementDef = nodeDef;\n                }\n                if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ &&\n                    providerOverrides.has(nodeDef.provider.token)) {\n                    elIndicesWithOverwrittenProviders.push(lastElementDef.nodeIndex);\n                    lastElementDef = null;\n                }\n            }\n            return elIndicesWithOverwrittenProviders;\n        }\n        function applyProviderOverridesToElement(viewDef, elIndex) {\n            for (var i = elIndex + 1; i < viewDef.nodes.length; i++) {\n                var nodeDef = viewDef.nodes[i];\n                if (nodeDef.flags & 1 /* TypeElement */) {\n                    // stop at the next element\n                    return;\n                }\n                if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {\n                    var provider = nodeDef.provider;\n                    var override = providerOverrides.get(provider.token);\n                    if (override) {\n                        nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;\n                        provider.deps = splitDepsDsl(override.deps);\n                        provider.value = override.value;\n                    }\n                }\n            }\n        }\n    }\n    // Notes about the algorithm:\n    // We only create new data structures if we need to, to keep perf impact\n    // reasonable.\n    function applyProviderOverridesToNgModule(def) {\n        var _a = calcHasOverrides(def), hasOverrides = _a.hasOverrides, hasDeprecatedOverrides = _a.hasDeprecatedOverrides;\n        if (!hasOverrides) {\n            return def;\n        }\n        // clone the whole view definition,\n        // as it maintains references between the nodes that are hard to update.\n        def = def.factory(function () { return NOOP; });\n        applyProviderOverrides(def);\n        return def;\n        function calcHasOverrides(def) {\n            var hasOverrides = false;\n            var hasDeprecatedOverrides = false;\n            if (providerOverrides.size === 0) {\n                return { hasOverrides: hasOverrides, hasDeprecatedOverrides: hasDeprecatedOverrides };\n            }\n            def.providers.forEach(function (node) {\n                var override = providerOverrides.get(node.token);\n                if ((node.flags & 3840 /* CatProviderNoDirective */) && override) {\n                    hasOverrides = true;\n                    hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n                }\n            });\n            def.modules.forEach(function (module) {\n                providerOverridesWithScope.forEach(function (override, token) {\n                    if (resolveForwardRef(getInjectableDef(token).providedIn) === module) {\n                        hasOverrides = true;\n                        hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n                    }\n                });\n            });\n            return { hasOverrides: hasOverrides, hasDeprecatedOverrides: hasDeprecatedOverrides };\n        }\n        function applyProviderOverrides(def) {\n            for (var i = 0; i < def.providers.length; i++) {\n                var provider = def.providers[i];\n                if (hasDeprecatedOverrides) {\n                    // We had a bug where me made\n                    // all providers lazy. Keep this logic behind a flag\n                    // for migrating existing users.\n                    provider.flags |= 4096 /* LazyProvider */;\n                }\n                var override = providerOverrides.get(provider.token);\n                if (override) {\n                    provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags;\n                    provider.deps = splitDepsDsl(override.deps);\n                    provider.value = override.value;\n                }\n            }\n            if (providerOverridesWithScope.size > 0) {\n                var moduleSet_1 = new Set(def.modules);\n                providerOverridesWithScope.forEach(function (override, token) {\n                    if (moduleSet_1.has(resolveForwardRef(getInjectableDef(token).providedIn))) {\n                        var provider = {\n                            token: token,\n                            flags: override.flags | (hasDeprecatedOverrides ? 4096 /* LazyProvider */ : 0 /* None */),\n                            deps: splitDepsDsl(override.deps),\n                            value: override.value,\n                            index: def.providers.length,\n                        };\n                        def.providers.push(provider);\n                        def.providersByKey[tokenKey(token)] = provider;\n                    }\n                });\n            }\n        }\n    }\n    function prodCheckAndUpdateNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var nodeDef = view.def.nodes[checkIndex];\n        checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n        return (nodeDef.flags & 224 /* CatPureExpression */) ?\n            asPureExpressionData(view, checkIndex).value :\n            undefined;\n    }\n    function prodCheckNoChangesNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n        var nodeDef = view.def.nodes[checkIndex];\n        checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n        return (nodeDef.flags & 224 /* CatPureExpression */) ?\n            asPureExpressionData(view, checkIndex).value :\n            undefined;\n    }\n    function debugCheckAndUpdateView(view) {\n        return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);\n    }\n    function debugCheckNoChangesView(view) {\n        return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);\n    }\n    function debugDestroyView(view) {\n        return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);\n    }\n    var DebugAction;\n    (function (DebugAction) {\n        DebugAction[DebugAction[\"create\"] = 0] = \"create\";\n        DebugAction[DebugAction[\"detectChanges\"] = 1] = \"detectChanges\";\n        DebugAction[DebugAction[\"checkNoChanges\"] = 2] = \"checkNoChanges\";\n        DebugAction[DebugAction[\"destroy\"] = 3] = \"destroy\";\n        DebugAction[DebugAction[\"handleEvent\"] = 4] = \"handleEvent\";\n    })(DebugAction || (DebugAction = {}));\n    var _currentAction;\n    var _currentView;\n    var _currentNodeIndex;\n    function debugSetCurrentNode(view, nodeIndex) {\n        _currentView = view;\n        _currentNodeIndex = nodeIndex;\n    }\n    function debugHandleEvent(view, nodeIndex, eventName, event) {\n        debugSetCurrentNode(view, nodeIndex);\n        return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);\n    }\n    function debugUpdateDirectives(view, checkType) {\n        if (view.state & 128 /* Destroyed */) {\n            throw viewDestroyedError(DebugAction[_currentAction]);\n        }\n        debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));\n        return view.def.updateDirectives(debugCheckDirectivesFn, view);\n        function debugCheckDirectivesFn(view, nodeIndex, argStyle) {\n            var values = [];\n            for (var _i = 3; _i < arguments.length; _i++) {\n                values[_i - 3] = arguments[_i];\n            }\n            var nodeDef = view.def.nodes[nodeIndex];\n            if (checkType === 0 /* CheckAndUpdate */) {\n                debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n            }\n            else {\n                debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n            }\n            if (nodeDef.flags & 16384 /* TypeDirective */) {\n                debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));\n            }\n            return (nodeDef.flags & 224 /* CatPureExpression */) ?\n                asPureExpressionData(view, nodeDef.nodeIndex).value :\n                undefined;\n        }\n    }\n    function debugUpdateRenderer(view, checkType) {\n        if (view.state & 128 /* Destroyed */) {\n            throw viewDestroyedError(DebugAction[_currentAction]);\n        }\n        debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));\n        return view.def.updateRenderer(debugCheckRenderNodeFn, view);\n        function debugCheckRenderNodeFn(view, nodeIndex, argStyle) {\n            var values = [];\n            for (var _i = 3; _i < arguments.length; _i++) {\n                values[_i - 3] = arguments[_i];\n            }\n            var nodeDef = view.def.nodes[nodeIndex];\n            if (checkType === 0 /* CheckAndUpdate */) {\n                debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n            }\n            else {\n                debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n            }\n            if (nodeDef.flags & 3 /* CatRenderNode */) {\n                debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));\n            }\n            return (nodeDef.flags & 224 /* CatPureExpression */) ?\n                asPureExpressionData(view, nodeDef.nodeIndex).value :\n                undefined;\n        }\n    }\n    function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {\n        var changed = checkAndUpdateNode.apply(void 0, __spreadArray([view, nodeDef, argStyle], __read(givenValues)));\n        if (changed) {\n            var values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues;\n            if (nodeDef.flags & 16384 /* TypeDirective */) {\n                var bindingValues = {};\n                for (var i = 0; i < nodeDef.bindings.length; i++) {\n                    var binding = nodeDef.bindings[i];\n                    var value = values[i];\n                    if (binding.flags & 8 /* TypeProperty */) {\n                        bindingValues[normalizeDebugBindingName(binding.nonMinifiedName)] =\n                            normalizeDebugBindingValue(value);\n                    }\n                }\n                var elDef = nodeDef.parent;\n                var el = asElementData(view, elDef.nodeIndex).renderElement;\n                if (!elDef.element.name) {\n                    // a comment.\n                    view.renderer.setValue(el, escapeCommentText(\"bindings=\" + JSON.stringify(bindingValues, null, 2)));\n                }\n                else {\n                    // a regular element.\n                    for (var attr in bindingValues) {\n                        var value = bindingValues[attr];\n                        if (value != null) {\n                            view.renderer.setAttribute(el, attr, value);\n                        }\n                        else {\n                            view.renderer.removeAttribute(el, attr);\n                        }\n                    }\n                }\n            }\n        }\n    }\n    function debugCheckNoChangesNode(view, nodeDef, argStyle, values) {\n        checkNoChangesNode.apply(void 0, __spreadArray([view, nodeDef, argStyle], __read(values)));\n    }\n    function nextDirectiveWithBinding(view, nodeIndex) {\n        for (var i = nodeIndex; i < view.def.nodes.length; i++) {\n            var nodeDef = view.def.nodes[i];\n            if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) {\n                return i;\n            }\n        }\n        return null;\n    }\n    function nextRenderNodeWithBinding(view, nodeIndex) {\n        for (var i = nodeIndex; i < view.def.nodes.length; i++) {\n            var nodeDef = view.def.nodes[i];\n            if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) {\n                return i;\n            }\n        }\n        return null;\n    }\n    var DebugContext_ = /** @class */ (function () {\n        function DebugContext_(view, nodeIndex) {\n            this.view = view;\n            this.nodeIndex = nodeIndex;\n            if (nodeIndex == null) {\n                this.nodeIndex = nodeIndex = 0;\n            }\n            this.nodeDef = view.def.nodes[nodeIndex];\n            var elDef = this.nodeDef;\n            var elView = view;\n            while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {\n                elDef = elDef.parent;\n            }\n            if (!elDef) {\n                while (!elDef && elView) {\n                    elDef = viewParentEl(elView);\n                    elView = elView.parent;\n                }\n            }\n            this.elDef = elDef;\n            this.elView = elView;\n        }\n        Object.defineProperty(DebugContext_.prototype, \"elOrCompView\", {\n            get: function () {\n                // Has to be done lazily as we use the DebugContext also during creation of elements...\n                return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"injector\", {\n            get: function () {\n                return createInjector$1(this.elView, this.elDef);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"component\", {\n            get: function () {\n                return this.elOrCompView.component;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"context\", {\n            get: function () {\n                return this.elOrCompView.context;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"providerTokens\", {\n            get: function () {\n                var tokens = [];\n                if (this.elDef) {\n                    for (var i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {\n                        var childDef = this.elView.def.nodes[i];\n                        if (childDef.flags & 20224 /* CatProvider */) {\n                            tokens.push(childDef.provider.token);\n                        }\n                        i += childDef.childCount;\n                    }\n                }\n                return tokens;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"references\", {\n            get: function () {\n                var references = {};\n                if (this.elDef) {\n                    collectReferences(this.elView, this.elDef, references);\n                    for (var i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {\n                        var childDef = this.elView.def.nodes[i];\n                        if (childDef.flags & 20224 /* CatProvider */) {\n                            collectReferences(this.elView, childDef, references);\n                        }\n                        i += childDef.childCount;\n                    }\n                }\n                return references;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"componentRenderElement\", {\n            get: function () {\n                var elData = findHostElement(this.elOrCompView);\n                return elData ? elData.renderElement : undefined;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(DebugContext_.prototype, \"renderNode\", {\n            get: function () {\n                return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) :\n                    renderNode(this.elView, this.elDef);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        DebugContext_.prototype.logError = function (console) {\n            var values = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                values[_i - 1] = arguments[_i];\n            }\n            var logViewDef;\n            var logNodeIndex;\n            if (this.nodeDef.flags & 2 /* TypeText */) {\n                logViewDef = this.view.def;\n                logNodeIndex = this.nodeDef.nodeIndex;\n            }\n            else {\n                logViewDef = this.elView.def;\n                logNodeIndex = this.elDef.nodeIndex;\n            }\n            // Note: we only generate a log function for text and element nodes\n            // to make the generated code as small as possible.\n            var renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);\n            var currRenderNodeIndex = -1;\n            var nodeLogger = function () {\n                var _a;\n                currRenderNodeIndex++;\n                if (currRenderNodeIndex === renderNodeIndex) {\n                    return (_a = console.error).bind.apply(_a, __spreadArray([console], __read(values)));\n                }\n                else {\n                    return NOOP;\n                }\n            };\n            logViewDef.factory(nodeLogger);\n            if (currRenderNodeIndex < renderNodeIndex) {\n                console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');\n                console.error.apply(console, __spreadArray([], __read(values)));\n            }\n        };\n        return DebugContext_;\n    }());\n    function getRenderNodeIndex(viewDef, nodeIndex) {\n        var renderNodeIndex = -1;\n        for (var i = 0; i <= nodeIndex; i++) {\n            var nodeDef = viewDef.nodes[i];\n            if (nodeDef.flags & 3 /* CatRenderNode */) {\n                renderNodeIndex++;\n            }\n        }\n        return renderNodeIndex;\n    }\n    function findHostElement(view) {\n        while (view && !isComponentView(view)) {\n            view = view.parent;\n        }\n        if (view.parent) {\n            return asElementData(view.parent, viewParentEl(view).nodeIndex);\n        }\n        return null;\n    }\n    function collectReferences(view, nodeDef, references) {\n        for (var refName in nodeDef.references) {\n            references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);\n        }\n    }\n    function callWithDebugContext(action, fn, self, args) {\n        var oldAction = _currentAction;\n        var oldView = _currentView;\n        var oldNodeIndex = _currentNodeIndex;\n        try {\n            _currentAction = action;\n            var result = fn.apply(self, args);\n            _currentView = oldView;\n            _currentNodeIndex = oldNodeIndex;\n            _currentAction = oldAction;\n            return result;\n        }\n        catch (e) {\n            if (isViewDebugError(e) || !_currentView) {\n                throw e;\n            }\n            throw viewWrappedDebugError(e, getCurrentDebugContext());\n        }\n    }\n    function getCurrentDebugContext() {\n        return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;\n    }\n    var DebugRendererFactory2 = /** @class */ (function () {\n        function DebugRendererFactory2(delegate) {\n            this.delegate = delegate;\n        }\n        DebugRendererFactory2.prototype.createRenderer = function (element, renderData) {\n            return new DebugRenderer2(this.delegate.createRenderer(element, renderData));\n        };\n        DebugRendererFactory2.prototype.begin = function () {\n            if (this.delegate.begin) {\n                this.delegate.begin();\n            }\n        };\n        DebugRendererFactory2.prototype.end = function () {\n            if (this.delegate.end) {\n                this.delegate.end();\n            }\n        };\n        DebugRendererFactory2.prototype.whenRenderingDone = function () {\n            if (this.delegate.whenRenderingDone) {\n                return this.delegate.whenRenderingDone();\n            }\n            return Promise.resolve(null);\n        };\n        return DebugRendererFactory2;\n    }());\n    var DebugRenderer2 = /** @class */ (function () {\n        function DebugRenderer2(delegate) {\n            this.delegate = delegate;\n            /**\n             * Factory function used to create a `DebugContext` when a node is created.\n             *\n             * The `DebugContext` allows to retrieve information about the nodes that are useful in tests.\n             *\n             * The factory is configurable so that the `DebugRenderer2` could instantiate either a View Engine\n             * or a Render context.\n             */\n            this.debugContextFactory = getCurrentDebugContext;\n            this.data = this.delegate.data;\n        }\n        DebugRenderer2.prototype.createDebugContext = function (nativeElement) {\n            return this.debugContextFactory(nativeElement);\n        };\n        DebugRenderer2.prototype.destroyNode = function (node) {\n            var debugNode = getDebugNode$1(node);\n            if (debugNode) {\n                removeDebugNodeFromIndex(debugNode);\n                if (debugNode instanceof DebugNode__PRE_R3__) {\n                    debugNode.listeners.length = 0;\n                }\n            }\n            if (this.delegate.destroyNode) {\n                this.delegate.destroyNode(node);\n            }\n        };\n        DebugRenderer2.prototype.destroy = function () {\n            this.delegate.destroy();\n        };\n        DebugRenderer2.prototype.createElement = function (name, namespace) {\n            var el = this.delegate.createElement(name, namespace);\n            var debugCtx = this.createDebugContext(el);\n            if (debugCtx) {\n                var debugEl = new DebugElement__PRE_R3__(el, null, debugCtx);\n                debugEl.name = name;\n                indexDebugNode(debugEl);\n            }\n            return el;\n        };\n        DebugRenderer2.prototype.createComment = function (value) {\n            var comment = this.delegate.createComment(escapeCommentText(value));\n            var debugCtx = this.createDebugContext(comment);\n            if (debugCtx) {\n                indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));\n            }\n            return comment;\n        };\n        DebugRenderer2.prototype.createText = function (value) {\n            var text = this.delegate.createText(value);\n            var debugCtx = this.createDebugContext(text);\n            if (debugCtx) {\n                indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx));\n            }\n            return text;\n        };\n        DebugRenderer2.prototype.appendChild = function (parent, newChild) {\n            var debugEl = getDebugNode$1(parent);\n            var debugChildEl = getDebugNode$1(newChild);\n            if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.addChild(debugChildEl);\n            }\n            this.delegate.appendChild(parent, newChild);\n        };\n        DebugRenderer2.prototype.insertBefore = function (parent, newChild, refChild, isMove) {\n            var debugEl = getDebugNode$1(parent);\n            var debugChildEl = getDebugNode$1(newChild);\n            var debugRefEl = getDebugNode$1(refChild);\n            if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.insertBefore(debugRefEl, debugChildEl);\n            }\n            this.delegate.insertBefore(parent, newChild, refChild, isMove);\n        };\n        DebugRenderer2.prototype.removeChild = function (parent, oldChild) {\n            var debugEl = getDebugNode$1(parent);\n            var debugChildEl = getDebugNode$1(oldChild);\n            if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.removeChild(debugChildEl);\n            }\n            this.delegate.removeChild(parent, oldChild);\n        };\n        DebugRenderer2.prototype.selectRootElement = function (selectorOrNode, preserveContent) {\n            var el = this.delegate.selectRootElement(selectorOrNode, preserveContent);\n            var debugCtx = getCurrentDebugContext();\n            if (debugCtx) {\n                indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx));\n            }\n            return el;\n        };\n        DebugRenderer2.prototype.setAttribute = function (el, name, value, namespace) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                var fullName = namespace ? namespace + ':' + name : name;\n                debugEl.attributes[fullName] = value;\n            }\n            this.delegate.setAttribute(el, name, value, namespace);\n        };\n        DebugRenderer2.prototype.removeAttribute = function (el, name, namespace) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                var fullName = namespace ? namespace + ':' + name : name;\n                debugEl.attributes[fullName] = null;\n            }\n            this.delegate.removeAttribute(el, name, namespace);\n        };\n        DebugRenderer2.prototype.addClass = function (el, name) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.classes[name] = true;\n            }\n            this.delegate.addClass(el, name);\n        };\n        DebugRenderer2.prototype.removeClass = function (el, name) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.classes[name] = false;\n            }\n            this.delegate.removeClass(el, name);\n        };\n        DebugRenderer2.prototype.setStyle = function (el, style, value, flags) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.styles[style] = value;\n            }\n            this.delegate.setStyle(el, style, value, flags);\n        };\n        DebugRenderer2.prototype.removeStyle = function (el, style, flags) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.styles[style] = null;\n            }\n            this.delegate.removeStyle(el, style, flags);\n        };\n        DebugRenderer2.prototype.setProperty = function (el, name, value) {\n            var debugEl = getDebugNode$1(el);\n            if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n                debugEl.properties[name] = value;\n            }\n            this.delegate.setProperty(el, name, value);\n        };\n        DebugRenderer2.prototype.listen = function (target, eventName, callback) {\n            if (typeof target !== 'string') {\n                var debugEl = getDebugNode$1(target);\n                if (debugEl) {\n                    debugEl.listeners.push(new DebugEventListener(eventName, callback));\n                }\n            }\n            return this.delegate.listen(target, eventName, callback);\n        };\n        DebugRenderer2.prototype.parentNode = function (node) {\n            return this.delegate.parentNode(node);\n        };\n        DebugRenderer2.prototype.nextSibling = function (node) {\n            return this.delegate.nextSibling(node);\n        };\n        DebugRenderer2.prototype.setValue = function (node, value) {\n            return this.delegate.setValue(node, value);\n        };\n        return DebugRenderer2;\n    }());\n\n    function overrideProvider(override) {\n        initServicesIfNeeded();\n        return Services.overrideProvider(override);\n    }\n    function overrideComponentView(comp, componentFactory) {\n        initServicesIfNeeded();\n        return Services.overrideComponentView(comp, componentFactory);\n    }\n    function clearOverrides() {\n        initServicesIfNeeded();\n        return Services.clearOverrides();\n    }\n    // Attention: this function is called as top level function.\n    // Putting any logic in here will destroy closure tree shaking!\n    function createNgModuleFactory(ngModuleType, bootstrapComponents, defFactory) {\n        return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);\n    }\n    function cloneNgModuleDefinition(def) {\n        var providers = Array.from(def.providers);\n        var modules = Array.from(def.modules);\n        var providersByKey = {};\n        for (var key in def.providersByKey) {\n            providersByKey[key] = def.providersByKey[key];\n        }\n        return {\n            factory: def.factory,\n            scope: def.scope,\n            providers: providers,\n            modules: modules,\n            providersByKey: providersByKey,\n        };\n    }\n    var NgModuleFactory_ = /** @class */ (function (_super) {\n        __extends(NgModuleFactory_, _super);\n        function NgModuleFactory_(moduleType, _bootstrapComponents, _ngModuleDefFactory) {\n            var _this = \n            // Attention: this ctor is called as top level function.\n            // Putting any logic in here will destroy closure tree shaking!\n            _super.call(this) || this;\n            _this.moduleType = moduleType;\n            _this._bootstrapComponents = _bootstrapComponents;\n            _this._ngModuleDefFactory = _ngModuleDefFactory;\n            return _this;\n        }\n        NgModuleFactory_.prototype.create = function (parentInjector) {\n            initServicesIfNeeded();\n            // Clone the NgModuleDefinition so that any tree shakeable provider definition\n            // added to this instance of the NgModuleRef doesn't affect the cached copy.\n            // See https://github.com/angular/angular/issues/25018.\n            var def = cloneNgModuleDefinition(resolveDefinition(this._ngModuleDefFactory));\n            return Services.createNgModuleRef(this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);\n        };\n        return NgModuleFactory_;\n    }(NgModuleFactory));\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Compiles a partial directive declaration object into a full directive definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareDirective(decl) {\n        var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'directive', type: decl.type });\n        return compiler.compileDirectiveDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275fac.js\", decl);\n    }\n    /**\n     * Evaluates the class metadata declaration.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareClassMetadata(decl) {\n        var _a, _b;\n        setClassMetadata(decl.type, decl.decorators, (_a = decl.ctorParameters) !== null && _a !== void 0 ? _a : null, (_b = decl.propDecorators) !== null && _b !== void 0 ? _b : null);\n    }\n    /**\n     * Compiles a partial component declaration object into a full component definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareComponent(decl) {\n        var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'component', type: decl.type });\n        return compiler.compileComponentDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275cmp.js\", decl);\n    }\n    /**\n     * Compiles a partial pipe declaration object into a full pipe definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareFactory(decl) {\n        var compiler = getCompilerFacade({\n            usage: 1 /* PartialDeclaration */,\n            kind: getFactoryKind(decl.target),\n            type: decl.type\n        });\n        return compiler.compileFactoryDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275fac.js\", decl);\n    }\n    function getFactoryKind(target) {\n        switch (target) {\n            case exports.ɵɵFactoryTarget.Directive:\n                return 'directive';\n            case exports.ɵɵFactoryTarget.Component:\n                return 'component';\n            case exports.ɵɵFactoryTarget.Injectable:\n                return 'injectable';\n            case exports.ɵɵFactoryTarget.Pipe:\n                return 'pipe';\n            case exports.ɵɵFactoryTarget.NgModule:\n                return 'NgModule';\n        }\n    }\n    /**\n     * Compiles a partial injectable declaration object into a full injectable definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareInjectable(decl) {\n        var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'injectable', type: decl.type });\n        return compiler.compileInjectableDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275prov.js\", decl);\n    }\n    /**\n     * Compiles a partial injector declaration object into a full injector definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareInjector(decl) {\n        var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });\n        return compiler.compileInjectorDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275inj.js\", decl);\n    }\n    /**\n     * Compiles a partial NgModule declaration object into a full NgModule definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclareNgModule(decl) {\n        var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });\n        return compiler.compileNgModuleDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275mod.js\", decl);\n    }\n    /**\n     * Compiles a partial pipe declaration object into a full pipe definition object.\n     *\n     * @codeGenApi\n     */\n    function ɵɵngDeclarePipe(decl) {\n        var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'pipe', type: decl.type });\n        return compiler.compilePipeDeclaration(angularCoreEnv, \"ng:///\" + decl.type.name + \"/\\u0275pipe.js\", decl);\n    }\n\n    /**\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://angular.io/license\n     */\n    // clang-format on\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n        // This helper is to give a reasonable error message to people upgrading to v9 that have not yet\n        // installed `@angular/localize` in their app.\n        // tslint:disable-next-line: no-toplevel-property-access\n        _global.$localize = _global.$localize || function () {\n            throw new Error('It looks like your application or one of its dependencies is using i18n.\\n' +\n                'Angular 9 introduced a global `$localize()` function that needs to be loaded.\\n' +\n                'Please run `ng add @angular/localize` from the Angular CLI.\\n' +\n                '(For non-CLI projects, add `import \\'@angular/localize/init\\';` to your `polyfills.ts` file.\\n' +\n                'For server-side rendering applications add the import to your `main.server.ts` file.)');\n        };\n    }\n\n    /**\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://angular.io/license\n     */\n    // This file only reexports content of the `src` folder. Keep it that way.\n\n    /**\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://angular.io/license\n     */\n\n    /**\n     * Generated bundle index. Do not edit.\n     */\n\n    exports.ANALYZE_FOR_ENTRY_COMPONENTS = ANALYZE_FOR_ENTRY_COMPONENTS;\n    exports.APP_BOOTSTRAP_LISTENER = APP_BOOTSTRAP_LISTENER;\n    exports.APP_ID = APP_ID;\n    exports.APP_INITIALIZER = APP_INITIALIZER;\n    exports.ApplicationInitStatus = ApplicationInitStatus;\n    exports.ApplicationModule = ApplicationModule;\n    exports.ApplicationRef = ApplicationRef;\n    exports.Attribute = Attribute;\n    exports.COMPILER_OPTIONS = COMPILER_OPTIONS;\n    exports.CUSTOM_ELEMENTS_SCHEMA = CUSTOM_ELEMENTS_SCHEMA;\n    exports.ChangeDetectorRef = ChangeDetectorRef;\n    exports.Compiler = Compiler;\n    exports.CompilerFactory = CompilerFactory;\n    exports.Component = Component;\n    exports.ComponentFactory = ComponentFactory;\n    exports.ComponentFactoryResolver = ComponentFactoryResolver;\n    exports.ComponentRef = ComponentRef;\n    exports.ContentChild = ContentChild;\n    exports.ContentChildren = ContentChildren;\n    exports.DEFAULT_CURRENCY_CODE = DEFAULT_CURRENCY_CODE;\n    exports.DebugElement = DebugElement;\n    exports.DebugEventListener = DebugEventListener;\n    exports.DebugNode = DebugNode;\n    exports.DefaultIterableDiffer = DefaultIterableDiffer;\n    exports.Directive = Directive;\n    exports.ElementRef = ElementRef;\n    exports.EmbeddedViewRef = EmbeddedViewRef;\n    exports.ErrorHandler = ErrorHandler;\n    exports.EventEmitter = EventEmitter;\n    exports.Host = Host;\n    exports.HostBinding = HostBinding;\n    exports.HostListener = HostListener;\n    exports.INJECTOR = INJECTOR$1;\n    exports.Inject = Inject;\n    exports.Injectable = Injectable;\n    exports.InjectionToken = InjectionToken;\n    exports.Injector = Injector;\n    exports.Input = Input;\n    exports.IterableDiffers = IterableDiffers;\n    exports.KeyValueDiffers = KeyValueDiffers;\n    exports.LOCALE_ID = LOCALE_ID$1;\n    exports.ModuleWithComponentFactories = ModuleWithComponentFactories;\n    exports.NO_ERRORS_SCHEMA = NO_ERRORS_SCHEMA;\n    exports.NgModule = NgModule;\n    exports.NgModuleFactory = NgModuleFactory;\n    exports.NgModuleFactoryLoader = NgModuleFactoryLoader;\n    exports.NgModuleRef = NgModuleRef;\n    exports.NgProbeToken = NgProbeToken;\n    exports.NgZone = NgZone;\n    exports.Optional = Optional;\n    exports.Output = Output;\n    exports.PACKAGE_ROOT_URL = PACKAGE_ROOT_URL;\n    exports.PLATFORM_ID = PLATFORM_ID;\n    exports.PLATFORM_INITIALIZER = PLATFORM_INITIALIZER;\n    exports.Pipe = Pipe;\n    exports.PlatformRef = PlatformRef;\n    exports.Query = Query;\n    exports.QueryList = QueryList;\n    exports.ReflectiveInjector = ReflectiveInjector;\n    exports.ReflectiveKey = ReflectiveKey;\n    exports.Renderer2 = Renderer2;\n    exports.RendererFactory2 = RendererFactory2;\n    exports.ResolvedReflectiveFactory = ResolvedReflectiveFactory;\n    exports.Sanitizer = Sanitizer;\n    exports.Self = Self;\n    exports.SimpleChange = SimpleChange;\n    exports.SkipSelf = SkipSelf;\n    exports.SystemJsNgModuleLoader = SystemJsNgModuleLoader;\n    exports.SystemJsNgModuleLoaderConfig = SystemJsNgModuleLoaderConfig;\n    exports.TRANSLATIONS = TRANSLATIONS;\n    exports.TRANSLATIONS_FORMAT = TRANSLATIONS_FORMAT;\n    exports.TemplateRef = TemplateRef;\n    exports.Testability = Testability;\n    exports.TestabilityRegistry = TestabilityRegistry;\n    exports.Type = Type;\n    exports.VERSION = VERSION;\n    exports.Version = Version;\n    exports.ViewChild = ViewChild;\n    exports.ViewChildren = ViewChildren;\n    exports.ViewContainerRef = ViewContainerRef;\n    exports.ViewRef = ViewRef$1;\n    exports.WrappedValue = WrappedValue;\n    exports.asNativeElements = asNativeElements;\n    exports.assertPlatform = assertPlatform;\n    exports.createPlatform = createPlatform;\n    exports.createPlatformFactory = createPlatformFactory;\n    exports.defineInjectable = defineInjectable;\n    exports.destroyPlatform = destroyPlatform;\n    exports.enableProdMode = enableProdMode;\n    exports.forwardRef = forwardRef;\n    exports.getDebugNode = getDebugNode$1;\n    exports.getModuleFactory = getModuleFactory;\n    exports.getPlatform = getPlatform;\n    exports.inject = inject;\n    exports.isDevMode = isDevMode;\n    exports.platformCore = platformCore;\n    exports.resolveForwardRef = resolveForwardRef;\n    exports.setTestabilityGetter = setTestabilityGetter;\n    exports.ɵ0 = ɵ0$3;\n    exports.ɵALLOW_MULTIPLE_PLATFORMS = ALLOW_MULTIPLE_PLATFORMS;\n    exports.ɵAPP_ID_RANDOM_PROVIDER = APP_ID_RANDOM_PROVIDER;\n    exports.ɵCREATE_ATTRIBUTE_DECORATOR__POST_R3__ = CREATE_ATTRIBUTE_DECORATOR__POST_R3__;\n    exports.ɵCodegenComponentFactoryResolver = CodegenComponentFactoryResolver;\n    exports.ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__ = Compiler_compileModuleAndAllComponentsAsync__POST_R3__;\n    exports.ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__ = Compiler_compileModuleAndAllComponentsSync__POST_R3__;\n    exports.ɵCompiler_compileModuleAsync__POST_R3__ = Compiler_compileModuleAsync__POST_R3__;\n    exports.ɵCompiler_compileModuleSync__POST_R3__ = Compiler_compileModuleSync__POST_R3__;\n    exports.ɵComponentFactory = ComponentFactory;\n    exports.ɵConsole = Console;\n    exports.ɵDEFAULT_LOCALE_ID = DEFAULT_LOCALE_ID;\n    exports.ɵEMPTY_ARRAY = EMPTY_ARRAY;\n    exports.ɵEMPTY_MAP = EMPTY_MAP;\n    exports.ɵINJECTOR_IMPL__POST_R3__ = INJECTOR_IMPL__POST_R3__;\n    exports.ɵINJECTOR_SCOPE = INJECTOR_SCOPE;\n    exports.ɵLifecycleHooksFeature = LifecycleHooksFeature;\n    exports.ɵNG_COMP_DEF = NG_COMP_DEF;\n    exports.ɵNG_DIR_DEF = NG_DIR_DEF;\n    exports.ɵNG_ELEMENT_ID = NG_ELEMENT_ID;\n    exports.ɵNG_INJ_DEF = NG_INJ_DEF;\n    exports.ɵNG_MOD_DEF = NG_MOD_DEF;\n    exports.ɵNG_PIPE_DEF = NG_PIPE_DEF;\n    exports.ɵNG_PROV_DEF = NG_PROV_DEF;\n    exports.ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR;\n    exports.ɵNO_CHANGE = NO_CHANGE;\n    exports.ɵNgModuleFactory = NgModuleFactory$1;\n    exports.ɵNoopNgZone = NoopNgZone;\n    exports.ɵReflectionCapabilities = ReflectionCapabilities;\n    exports.ɵRender3ComponentFactory = ComponentFactory$1;\n    exports.ɵRender3ComponentRef = ComponentRef$1;\n    exports.ɵRender3NgModuleRef = NgModuleRef$1;\n    exports.ɵRuntimeError = RuntimeError;\n    exports.ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ = SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__;\n    exports.ɵSWITCH_COMPILE_COMPONENT__POST_R3__ = SWITCH_COMPILE_COMPONENT__POST_R3__;\n    exports.ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__ = SWITCH_COMPILE_DIRECTIVE__POST_R3__;\n    exports.ɵSWITCH_COMPILE_INJECTABLE__POST_R3__ = SWITCH_COMPILE_INJECTABLE__POST_R3__;\n    exports.ɵSWITCH_COMPILE_NGMODULE__POST_R3__ = SWITCH_COMPILE_NGMODULE__POST_R3__;\n    exports.ɵSWITCH_COMPILE_PIPE__POST_R3__ = SWITCH_COMPILE_PIPE__POST_R3__;\n    exports.ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__ = SWITCH_ELEMENT_REF_FACTORY__POST_R3__;\n    exports.ɵSWITCH_IVY_ENABLED__POST_R3__ = SWITCH_IVY_ENABLED__POST_R3__;\n    exports.ɵSWITCH_RENDERER2_FACTORY__POST_R3__ = SWITCH_RENDERER2_FACTORY__POST_R3__;\n    exports.ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__ = SWITCH_TEMPLATE_REF_FACTORY__POST_R3__;\n    exports.ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ = SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__;\n    exports.ɵ_sanitizeHtml = _sanitizeHtml;\n    exports.ɵ_sanitizeUrl = _sanitizeUrl;\n    exports.ɵallowSanitizationBypassAndThrow = allowSanitizationBypassAndThrow;\n    exports.ɵand = anchorDef;\n    exports.ɵangular_packages_core_core_a = isForwardRef;\n    exports.ɵangular_packages_core_core_b = injectInjectorOnly;\n    exports.ɵangular_packages_core_core_ba = zoneSchedulerFactory;\n    exports.ɵangular_packages_core_core_bb = USD_CURRENCY_CODE;\n    exports.ɵangular_packages_core_core_bc = _def;\n    exports.ɵangular_packages_core_core_bd = DebugContext;\n    exports.ɵangular_packages_core_core_be = NgOnChangesFeatureImpl;\n    exports.ɵangular_packages_core_core_bf = SCHEDULER;\n    exports.ɵangular_packages_core_core_bg = injectAttributeImpl;\n    exports.ɵangular_packages_core_core_bh = getLView;\n    exports.ɵangular_packages_core_core_bi = getBindingRoot;\n    exports.ɵangular_packages_core_core_bj = nextContextImpl;\n    exports.ɵangular_packages_core_core_bl = pureFunction1Internal;\n    exports.ɵangular_packages_core_core_bm = pureFunction2Internal;\n    exports.ɵangular_packages_core_core_bn = pureFunction3Internal;\n    exports.ɵangular_packages_core_core_bo = pureFunction4Internal;\n    exports.ɵangular_packages_core_core_bp = pureFunctionVInternal;\n    exports.ɵangular_packages_core_core_bq = getUrlSanitizer;\n    exports.ɵangular_packages_core_core_br = makePropDecorator;\n    exports.ɵangular_packages_core_core_bs = makeParamDecorator;\n    exports.ɵangular_packages_core_core_bv = getClosureSafeProperty;\n    exports.ɵangular_packages_core_core_bw = NullInjector;\n    exports.ɵangular_packages_core_core_bx = getInjectImplementation;\n    exports.ɵangular_packages_core_core_bz = getNativeByTNode;\n    exports.ɵangular_packages_core_core_c = attachInjectFlag;\n    exports.ɵangular_packages_core_core_cb = getRootContext;\n    exports.ɵangular_packages_core_core_cc = i18nPostprocess;\n    exports.ɵangular_packages_core_core_d = ReflectiveInjector_;\n    exports.ɵangular_packages_core_core_e = ReflectiveDependency;\n    exports.ɵangular_packages_core_core_f = resolveReflectiveProviders;\n    exports.ɵangular_packages_core_core_g = _appIdRandomProviderFactory;\n    exports.ɵangular_packages_core_core_h = injectRenderer2;\n    exports.ɵangular_packages_core_core_i = injectElementRef;\n    exports.ɵangular_packages_core_core_j = createElementRef;\n    exports.ɵangular_packages_core_core_k = getModuleFactory__PRE_R3__;\n    exports.ɵangular_packages_core_core_l = injectTemplateRef;\n    exports.ɵangular_packages_core_core_m = createTemplateRef;\n    exports.ɵangular_packages_core_core_n = injectViewContainerRef;\n    exports.ɵangular_packages_core_core_o = DebugNode__PRE_R3__;\n    exports.ɵangular_packages_core_core_p = DebugElement__PRE_R3__;\n    exports.ɵangular_packages_core_core_q = getDebugNodeR2__PRE_R3__;\n    exports.ɵangular_packages_core_core_r = injectChangeDetectorRef;\n    exports.ɵangular_packages_core_core_s = DefaultIterableDifferFactory;\n    exports.ɵangular_packages_core_core_t = DefaultKeyValueDifferFactory;\n    exports.ɵangular_packages_core_core_u = defaultIterableDiffersFactory;\n    exports.ɵangular_packages_core_core_v = defaultKeyValueDiffersFactory;\n    exports.ɵangular_packages_core_core_w = _iterableDiffersFactory;\n    exports.ɵangular_packages_core_core_x = _keyValueDiffersFactory;\n    exports.ɵangular_packages_core_core_y = _localeFactory;\n    exports.ɵangular_packages_core_core_z = APPLICATION_MODULE_PROVIDERS;\n    exports.ɵbypassSanitizationTrustHtml = bypassSanitizationTrustHtml;\n    exports.ɵbypassSanitizationTrustResourceUrl = bypassSanitizationTrustResourceUrl;\n    exports.ɵbypassSanitizationTrustScript = bypassSanitizationTrustScript;\n    exports.ɵbypassSanitizationTrustStyle = bypassSanitizationTrustStyle;\n    exports.ɵbypassSanitizationTrustUrl = bypassSanitizationTrustUrl;\n    exports.ɵccf = createComponentFactory;\n    exports.ɵclearOverrides = clearOverrides;\n    exports.ɵclearResolutionOfComponentResourcesQueue = clearResolutionOfComponentResourcesQueue;\n    exports.ɵcmf = createNgModuleFactory;\n    exports.ɵcompileComponent = compileComponent;\n    exports.ɵcompileDirective = compileDirective;\n    exports.ɵcompileNgModule = compileNgModule;\n    exports.ɵcompileNgModuleDefs = compileNgModuleDefs;\n    exports.ɵcompileNgModuleFactory__POST_R3__ = compileNgModuleFactory__POST_R3__;\n    exports.ɵcompilePipe = compilePipe;\n    exports.ɵcreateInjector = createInjector;\n    exports.ɵcrt = createRendererType2;\n    exports.ɵdefaultIterableDiffers = defaultIterableDiffers;\n    exports.ɵdefaultKeyValueDiffers = defaultKeyValueDiffers;\n    exports.ɵdetectChanges = detectChanges;\n    exports.ɵdevModeEqual = devModeEqual;\n    exports.ɵdid = directiveDef;\n    exports.ɵeld = elementDef;\n    exports.ɵfindLocaleData = findLocaleData;\n    exports.ɵflushModuleScopingQueueAsMuchAsPossible = flushModuleScopingQueueAsMuchAsPossible;\n    exports.ɵgetComponentViewDefinitionFactory = getComponentViewDefinitionFactory;\n    exports.ɵgetDebugNodeR2 = getDebugNodeR2;\n    exports.ɵgetDebugNode__POST_R3__ = getDebugNode__POST_R3__;\n    exports.ɵgetDirectives = getDirectives;\n    exports.ɵgetHostElement = getHostElement;\n    exports.ɵgetInjectableDef = getInjectableDef;\n    exports.ɵgetLContext = getLContext;\n    exports.ɵgetLocaleCurrencyCode = getLocaleCurrencyCode;\n    exports.ɵgetLocalePluralCase = getLocalePluralCase;\n    exports.ɵgetModuleFactory__POST_R3__ = getModuleFactory__POST_R3__;\n    exports.ɵgetSanitizationBypassType = getSanitizationBypassType;\n    exports.ɵglobal = _global;\n    exports.ɵinitServicesIfNeeded = initServicesIfNeeded;\n    exports.ɵinlineInterpolate = inlineInterpolate;\n    exports.ɵinterpolate = interpolate;\n    exports.ɵisBoundToModule__POST_R3__ = isBoundToModule__POST_R3__;\n    exports.ɵisDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy;\n    exports.ɵisListLikeIterable = isListLikeIterable;\n    exports.ɵisObservable = isObservable;\n    exports.ɵisPromise = isPromise;\n    exports.ɵisSubscribable = isSubscribable;\n    exports.ɵivyEnabled = ivyEnabled;\n    exports.ɵmakeDecorator = makeDecorator;\n    exports.ɵmarkDirty = markDirty;\n    exports.ɵmod = moduleDef;\n    exports.ɵmpd = moduleProvideDef;\n    exports.ɵncd = ngContentDef;\n    exports.ɵnoSideEffects = noSideEffects;\n    exports.ɵnov = nodeValue;\n    exports.ɵoverrideComponentView = overrideComponentView;\n    exports.ɵoverrideProvider = overrideProvider;\n    exports.ɵpad = pureArrayDef;\n    exports.ɵpatchComponentDefWithScope = patchComponentDefWithScope;\n    exports.ɵpid = pipeDef;\n    exports.ɵpod = pureObjectDef;\n    exports.ɵppd = purePipeDef;\n    exports.ɵprd = providerDef;\n    exports.ɵpublishDefaultGlobalUtils = publishDefaultGlobalUtils;\n    exports.ɵpublishGlobalUtil = publishGlobalUtil;\n    exports.ɵqud = queryDef;\n    exports.ɵregisterLocaleData = registerLocaleData;\n    exports.ɵregisterModuleFactory = registerModuleFactory;\n    exports.ɵregisterNgModuleType = registerNgModuleType;\n    exports.ɵrenderComponent = renderComponent$1;\n    exports.ɵresetCompiledComponents = resetCompiledComponents;\n    exports.ɵresetJitOptions = resetJitOptions;\n    exports.ɵresolveComponentResources = resolveComponentResources;\n    exports.ɵsetClassMetadata = setClassMetadata;\n    exports.ɵsetCurrentInjector = setCurrentInjector;\n    exports.ɵsetDocument = setDocument;\n    exports.ɵsetLocaleId = setLocaleId;\n    exports.ɵstore = store;\n    exports.ɵstringify = stringify;\n    exports.ɵted = textDef;\n    exports.ɵtransitiveScopesFor = transitiveScopesFor;\n    exports.ɵunregisterLocaleData = unregisterAllLocaleData;\n    exports.ɵunv = unwrapValue;\n    exports.ɵunwrapSafeValue = unwrapSafeValue;\n    exports.ɵvid = viewDef;\n    exports.ɵwhenRendered = whenRendered;\n    exports.ɵɵCopyDefinitionFeature = ɵɵCopyDefinitionFeature;\n    exports.ɵɵInheritDefinitionFeature = ɵɵInheritDefinitionFeature;\n    exports.ɵɵNgOnChangesFeature = ɵɵNgOnChangesFeature;\n    exports.ɵɵProvidersFeature = ɵɵProvidersFeature;\n    exports.ɵɵadvance = ɵɵadvance;\n    exports.ɵɵattribute = ɵɵattribute;\n    exports.ɵɵattributeInterpolate1 = ɵɵattributeInterpolate1;\n    exports.ɵɵattributeInterpolate2 = ɵɵattributeInterpolate2;\n    exports.ɵɵattributeInterpolate3 = ɵɵattributeInterpolate3;\n    exports.ɵɵattributeInterpolate4 = ɵɵattributeInterpolate4;\n    exports.ɵɵattributeInterpolate5 = ɵɵattributeInterpolate5;\n    exports.ɵɵattributeInterpolate6 = ɵɵattributeInterpolate6;\n    exports.ɵɵattributeInterpolate7 = ɵɵattributeInterpolate7;\n    exports.ɵɵattributeInterpolate8 = ɵɵattributeInterpolate8;\n    exports.ɵɵattributeInterpolateV = ɵɵattributeInterpolateV;\n    exports.ɵɵclassMap = ɵɵclassMap;\n    exports.ɵɵclassMapInterpolate1 = ɵɵclassMapInterpolate1;\n    exports.ɵɵclassMapInterpolate2 = ɵɵclassMapInterpolate2;\n    exports.ɵɵclassMapInterpolate3 = ɵɵclassMapInterpolate3;\n    exports.ɵɵclassMapInterpolate4 = ɵɵclassMapInterpolate4;\n    exports.ɵɵclassMapInterpolate5 = ɵɵclassMapInterpolate5;\n    exports.ɵɵclassMapInterpolate6 = ɵɵclassMapInterpolate6;\n    exports.ɵɵclassMapInterpolate7 = ɵɵclassMapInterpolate7;\n    exports.ɵɵclassMapInterpolate8 = ɵɵclassMapInterpolate8;\n    exports.ɵɵclassMapInterpolateV = ɵɵclassMapInterpolateV;\n    exports.ɵɵclassProp = ɵɵclassProp;\n    exports.ɵɵcontentQuery = ɵɵcontentQuery;\n    exports.ɵɵdefineComponent = ɵɵdefineComponent;\n    exports.ɵɵdefineDirective = ɵɵdefineDirective;\n    exports.ɵɵdefineInjectable = ɵɵdefineInjectable;\n    exports.ɵɵdefineInjector = ɵɵdefineInjector;\n    exports.ɵɵdefineNgModule = ɵɵdefineNgModule;\n    exports.ɵɵdefinePipe = ɵɵdefinePipe;\n    exports.ɵɵdirectiveInject = ɵɵdirectiveInject;\n    exports.ɵɵdisableBindings = ɵɵdisableBindings;\n    exports.ɵɵelement = ɵɵelement;\n    exports.ɵɵelementContainer = ɵɵelementContainer;\n    exports.ɵɵelementContainerEnd = ɵɵelementContainerEnd;\n    exports.ɵɵelementContainerStart = ɵɵelementContainerStart;\n    exports.ɵɵelementEnd = ɵɵelementEnd;\n    exports.ɵɵelementStart = ɵɵelementStart;\n    exports.ɵɵenableBindings = ɵɵenableBindings;\n    exports.ɵɵgetCurrentView = ɵɵgetCurrentView;\n    exports.ɵɵgetInheritedFactory = ɵɵgetInheritedFactory;\n    exports.ɵɵhostProperty = ɵɵhostProperty;\n    exports.ɵɵi18n = ɵɵi18n;\n    exports.ɵɵi18nApply = ɵɵi18nApply;\n    exports.ɵɵi18nAttributes = ɵɵi18nAttributes;\n    exports.ɵɵi18nEnd = ɵɵi18nEnd;\n    exports.ɵɵi18nExp = ɵɵi18nExp;\n    exports.ɵɵi18nPostprocess = ɵɵi18nPostprocess;\n    exports.ɵɵi18nStart = ɵɵi18nStart;\n    exports.ɵɵinject = ɵɵinject;\n    exports.ɵɵinjectAttribute = ɵɵinjectAttribute;\n    exports.ɵɵinvalidFactory = ɵɵinvalidFactory;\n    exports.ɵɵinvalidFactoryDep = ɵɵinvalidFactoryDep;\n    exports.ɵɵlistener = ɵɵlistener;\n    exports.ɵɵloadQuery = ɵɵloadQuery;\n    exports.ɵɵnamespaceHTML = ɵɵnamespaceHTML;\n    exports.ɵɵnamespaceMathML = ɵɵnamespaceMathML;\n    exports.ɵɵnamespaceSVG = ɵɵnamespaceSVG;\n    exports.ɵɵnextContext = ɵɵnextContext;\n    exports.ɵɵngDeclareClassMetadata = ɵɵngDeclareClassMetadata;\n    exports.ɵɵngDeclareComponent = ɵɵngDeclareComponent;\n    exports.ɵɵngDeclareDirective = ɵɵngDeclareDirective;\n    exports.ɵɵngDeclareFactory = ɵɵngDeclareFactory;\n    exports.ɵɵngDeclareInjectable = ɵɵngDeclareInjectable;\n    exports.ɵɵngDeclareInjector = ɵɵngDeclareInjector;\n    exports.ɵɵngDeclareNgModule = ɵɵngDeclareNgModule;\n    exports.ɵɵngDeclarePipe = ɵɵngDeclarePipe;\n    exports.ɵɵpipe = ɵɵpipe;\n    exports.ɵɵpipeBind1 = ɵɵpipeBind1;\n    exports.ɵɵpipeBind2 = ɵɵpipeBind2;\n    exports.ɵɵpipeBind3 = ɵɵpipeBind3;\n    exports.ɵɵpipeBind4 = ɵɵpipeBind4;\n    exports.ɵɵpipeBindV = ɵɵpipeBindV;\n    exports.ɵɵprojection = ɵɵprojection;\n    exports.ɵɵprojectionDef = ɵɵprojectionDef;\n    exports.ɵɵproperty = ɵɵproperty;\n    exports.ɵɵpropertyInterpolate = ɵɵpropertyInterpolate;\n    exports.ɵɵpropertyInterpolate1 = ɵɵpropertyInterpolate1;\n    exports.ɵɵpropertyInterpolate2 = ɵɵpropertyInterpolate2;\n    exports.ɵɵpropertyInterpolate3 = ɵɵpropertyInterpolate3;\n    exports.ɵɵpropertyInterpolate4 = ɵɵpropertyInterpolate4;\n    exports.ɵɵpropertyInterpolate5 = ɵɵpropertyInterpolate5;\n    exports.ɵɵpropertyInterpolate6 = ɵɵpropertyInterpolate6;\n    exports.ɵɵpropertyInterpolate7 = ɵɵpropertyInterpolate7;\n    exports.ɵɵpropertyInterpolate8 = ɵɵpropertyInterpolate8;\n    exports.ɵɵpropertyInterpolateV = ɵɵpropertyInterpolateV;\n    exports.ɵɵpureFunction0 = ɵɵpureFunction0;\n    exports.ɵɵpureFunction1 = ɵɵpureFunction1;\n    exports.ɵɵpureFunction2 = ɵɵpureFunction2;\n    exports.ɵɵpureFunction3 = ɵɵpureFunction3;\n    exports.ɵɵpureFunction4 = ɵɵpureFunction4;\n    exports.ɵɵpureFunction5 = ɵɵpureFunction5;\n    exports.ɵɵpureFunction6 = ɵɵpureFunction6;\n    exports.ɵɵpureFunction7 = ɵɵpureFunction7;\n    exports.ɵɵpureFunction8 = ɵɵpureFunction8;\n    exports.ɵɵpureFunctionV = ɵɵpureFunctionV;\n    exports.ɵɵqueryRefresh = ɵɵqueryRefresh;\n    exports.ɵɵreference = ɵɵreference;\n    exports.ɵɵresolveBody = ɵɵresolveBody;\n    exports.ɵɵresolveDocument = ɵɵresolveDocument;\n    exports.ɵɵresolveWindow = ɵɵresolveWindow;\n    exports.ɵɵrestoreView = ɵɵrestoreView;\n    exports.ɵɵsanitizeHtml = ɵɵsanitizeHtml;\n    exports.ɵɵsanitizeResourceUrl = ɵɵsanitizeResourceUrl;\n    exports.ɵɵsanitizeScript = ɵɵsanitizeScript;\n    exports.ɵɵsanitizeStyle = ɵɵsanitizeStyle;\n    exports.ɵɵsanitizeUrl = ɵɵsanitizeUrl;\n    exports.ɵɵsanitizeUrlOrResourceUrl = ɵɵsanitizeUrlOrResourceUrl;\n    exports.ɵɵsetComponentScope = ɵɵsetComponentScope;\n    exports.ɵɵsetNgModuleScope = ɵɵsetNgModuleScope;\n    exports.ɵɵstyleMap = ɵɵstyleMap;\n    exports.ɵɵstyleMapInterpolate1 = ɵɵstyleMapInterpolate1;\n    exports.ɵɵstyleMapInterpolate2 = ɵɵstyleMapInterpolate2;\n    exports.ɵɵstyleMapInterpolate3 = ɵɵstyleMapInterpolate3;\n    exports.ɵɵstyleMapInterpolate4 = ɵɵstyleMapInterpolate4;\n    exports.ɵɵstyleMapInterpolate5 = ɵɵstyleMapInterpolate5;\n    exports.ɵɵstyleMapInterpolate6 = ɵɵstyleMapInterpolate6;\n    exports.ɵɵstyleMapInterpolate7 = ɵɵstyleMapInterpolate7;\n    exports.ɵɵstyleMapInterpolate8 = ɵɵstyleMapInterpolate8;\n    exports.ɵɵstyleMapInterpolateV = ɵɵstyleMapInterpolateV;\n    exports.ɵɵstyleProp = ɵɵstyleProp;\n    exports.ɵɵstylePropInterpolate1 = ɵɵstylePropInterpolate1;\n    exports.ɵɵstylePropInterpolate2 = ɵɵstylePropInterpolate2;\n    exports.ɵɵstylePropInterpolate3 = ɵɵstylePropInterpolate3;\n    exports.ɵɵstylePropInterpolate4 = ɵɵstylePropInterpolate4;\n    exports.ɵɵstylePropInterpolate5 = ɵɵstylePropInterpolate5;\n    exports.ɵɵstylePropInterpolate6 = ɵɵstylePropInterpolate6;\n    exports.ɵɵstylePropInterpolate7 = ɵɵstylePropInterpolate7;\n    exports.ɵɵstylePropInterpolate8 = ɵɵstylePropInterpolate8;\n    exports.ɵɵstylePropInterpolateV = ɵɵstylePropInterpolateV;\n    exports.ɵɵsyntheticHostListener = ɵɵsyntheticHostListener;\n    exports.ɵɵsyntheticHostProperty = ɵɵsyntheticHostProperty;\n    exports.ɵɵtemplate = ɵɵtemplate;\n    exports.ɵɵtemplateRefExtractor = ɵɵtemplateRefExtractor;\n    exports.ɵɵtext = ɵɵtext;\n    exports.ɵɵtextInterpolate = ɵɵtextInterpolate;\n    exports.ɵɵtextInterpolate1 = ɵɵtextInterpolate1;\n    exports.ɵɵtextInterpolate2 = ɵɵtextInterpolate2;\n    exports.ɵɵtextInterpolate3 = ɵɵtextInterpolate3;\n    exports.ɵɵtextInterpolate4 = ɵɵtextInterpolate4;\n    exports.ɵɵtextInterpolate5 = ɵɵtextInterpolate5;\n    exports.ɵɵtextInterpolate6 = ɵɵtextInterpolate6;\n    exports.ɵɵtextInterpolate7 = ɵɵtextInterpolate7;\n    exports.ɵɵtextInterpolate8 = ɵɵtextInterpolate8;\n    exports.ɵɵtextInterpolateV = ɵɵtextInterpolateV;\n    exports.ɵɵtrustConstantHtml = ɵɵtrustConstantHtml;\n    exports.ɵɵtrustConstantResourceUrl = ɵɵtrustConstantResourceUrl;\n    exports.ɵɵviewQuery = ɵɵviewQuery;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=core.umd.js.map"
  },
  {
    "path": "test/lib/angular-12/angular-12-platform-browser-dynamic.js",
    "content": "/**\n * @license Angular v12.2.1\n * (c) 2010-2021 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/compiler'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser')) :\n    typeof define === 'function' && define.amd ? define('@angular/platform-browser-dynamic', ['exports', '@angular/compiler', '@angular/core', '@angular/common', '@angular/platform-browser'], factory) :\n    (global = global || self, factory((global.ng = global.ng || {}, global.ng.platformBrowserDynamic = {}), global.ng.compiler, global.ng.core, global.ng.common, global.ng.platformBrowser));\n}(this, (function (exports, compiler, core, common, platformBrowser) { 'use strict';\n\n    /*! *****************************************************************************\n    Copyright (c) Microsoft Corporation.\n\n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n    PERFORMANCE OF THIS SOFTWARE.\n    ***************************************************************************** */\n    /* global Reflect, Promise */\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b)\n                if (Object.prototype.hasOwnProperty.call(b, p))\n                    d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    function __extends(d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    }\n    var __assign = function () {\n        __assign = Object.assign || function __assign(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s)\n                    if (Object.prototype.hasOwnProperty.call(s, p))\n                        t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign.apply(this, arguments);\n    };\n    function __rest(s, e) {\n        var t = {};\n        for (var p in s)\n            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n                t[p] = s[p];\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                    t[p[i]] = s[p[i]];\n            }\n        return t;\n    }\n    function __decorate(decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n            r = Reflect.decorate(decorators, target, key, desc);\n        else\n            for (var i = decorators.length - 1; i >= 0; i--)\n                if (d = decorators[i])\n                    r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    }\n    function __param(paramIndex, decorator) {\n        return function (target, key) { decorator(target, key, paramIndex); };\n    }\n    function __metadata(metadataKey, metadataValue) {\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n            return Reflect.metadata(metadataKey, metadataValue);\n    }\n    function __awaiter(thisArg, _arguments, P, generator) {\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n        return new (P || (P = Promise))(function (resolve, reject) {\n            function fulfilled(value) { try {\n                step(generator.next(value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function rejected(value) { try {\n                step(generator[\"throw\"](value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\n        });\n    }\n    function __generator(thisArg, body) {\n        var _ = { label: 0, sent: function () { if (t[0] & 1)\n                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n        function verb(n) { return function (v) { return step([n, v]); }; }\n        function step(op) {\n            if (f)\n                throw new TypeError(\"Generator is already executing.\");\n            while (_)\n                try {\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)\n                        return t;\n                    if (y = 0, t)\n                        op = [op[0] & 2, t.value];\n                    switch (op[0]) {\n                        case 0:\n                        case 1:\n                            t = op;\n                            break;\n                        case 4:\n                            _.label++;\n                            return { value: op[1], done: false };\n                        case 5:\n                            _.label++;\n                            y = op[1];\n                            op = [0];\n                            continue;\n                        case 7:\n                            op = _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                        default:\n                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n                                _ = 0;\n                                continue;\n                            }\n                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n                                _.label = op[1];\n                                break;\n                            }\n                            if (op[0] === 6 && _.label < t[1]) {\n                                _.label = t[1];\n                                t = op;\n                                break;\n                            }\n                            if (t && _.label < t[2]) {\n                                _.label = t[2];\n                                _.ops.push(op);\n                                break;\n                            }\n                            if (t[2])\n                                _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                    }\n                    op = body.call(thisArg, _);\n                }\n                catch (e) {\n                    op = [6, e];\n                    y = 0;\n                }\n                finally {\n                    f = t = 0;\n                }\n            if (op[0] & 5)\n                throw op[1];\n            return { value: op[0] ? op[1] : void 0, done: true };\n        }\n    }\n    var __createBinding = Object.create ? (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n    }) : (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        o[k2] = m[k];\n    });\n    function __exportStar(m, o) {\n        for (var p in m)\n            if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n                __createBinding(o, m, p);\n    }\n    function __values(o) {\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n        if (m)\n            return m.call(o);\n        if (o && typeof o.length === \"number\")\n            return {\n                next: function () {\n                    if (o && i >= o.length)\n                        o = void 0;\n                    return { value: o && o[i++], done: !o };\n                }\n            };\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n    }\n    function __read(o, n) {\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n        if (!m)\n            return o;\n        var i = m.call(o), r, ar = [], e;\n        try {\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n                ar.push(r.value);\n        }\n        catch (error) {\n            e = { error: error };\n        }\n        finally {\n            try {\n                if (r && !r.done && (m = i[\"return\"]))\n                    m.call(i);\n            }\n            finally {\n                if (e)\n                    throw e.error;\n            }\n        }\n        return ar;\n    }\n    /** @deprecated */\n    function __spread() {\n        for (var ar = [], i = 0; i < arguments.length; i++)\n            ar = ar.concat(__read(arguments[i]));\n        return ar;\n    }\n    /** @deprecated */\n    function __spreadArrays() {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n            s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    }\n    function __spreadArray(to, from, pack) {\n        if (pack || arguments.length === 2)\n            for (var i = 0, l = from.length, ar; i < l; i++) {\n                if (ar || !(i in from)) {\n                    if (!ar)\n                        ar = Array.prototype.slice.call(from, 0, i);\n                    ar[i] = from[i];\n                }\n            }\n        return to.concat(ar || from);\n    }\n    function __await(v) {\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\n    }\n    function __asyncGenerator(thisArg, _arguments, generator) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n        function verb(n) { if (g[n])\n            i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n        function resume(n, v) { try {\n            step(g[n](v));\n        }\n        catch (e) {\n            settle(q[0][3], e);\n        } }\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n        function fulfill(value) { resume(\"next\", value); }\n        function reject(value) { resume(\"throw\", value); }\n        function settle(f, v) { if (f(v), q.shift(), q.length)\n            resume(q[0][0], q[0][1]); }\n    }\n    function __asyncDelegator(o) {\n        var i, p;\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\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; }\n    }\n    function __asyncValues(o) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n    }\n    function __makeTemplateObject(cooked, raw) {\n        if (Object.defineProperty) {\n            Object.defineProperty(cooked, \"raw\", { value: raw });\n        }\n        else {\n            cooked.raw = raw;\n        }\n        return cooked;\n    }\n    ;\n    var __setModuleDefault = Object.create ? (function (o, v) {\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n    }) : function (o, v) {\n        o[\"default\"] = v;\n    };\n    function __importStar(mod) {\n        if (mod && mod.__esModule)\n            return mod;\n        var result = {};\n        if (mod != null)\n            for (var k in mod)\n                if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n                    __createBinding(result, mod, k);\n        __setModuleDefault(result, mod);\n        return result;\n    }\n    function __importDefault(mod) {\n        return (mod && mod.__esModule) ? mod : { default: mod };\n    }\n    function __classPrivateFieldGet(receiver, state, kind, f) {\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a getter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n    }\n    function __classPrivateFieldSet(receiver, state, value, kind, f) {\n        if (kind === \"m\")\n            throw new TypeError(\"Private method is not writable\");\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a setter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n    }\n\n    /**\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://angular.io/license\n     */\n    var MODULE_SUFFIX = '';\n    var builtinExternalReferences = createBuiltinExternalReferencesMap();\n    var JitReflector = /** @class */ (function () {\n        function JitReflector() {\n            this.reflectionCapabilities = new core.ɵReflectionCapabilities();\n        }\n        JitReflector.prototype.componentModuleUrl = function (type, cmpMetadata) {\n            var moduleId = cmpMetadata.moduleId;\n            if (typeof moduleId === 'string') {\n                var scheme = compiler.getUrlScheme(moduleId);\n                return scheme ? moduleId : \"package:\" + moduleId + MODULE_SUFFIX;\n            }\n            else if (moduleId !== null && moduleId !== void 0) {\n                throw compiler.syntaxError(\"moduleId should be a string in \\\"\" + core.ɵstringify(type) + \"\\\". See https://goo.gl/wIDDiL for more information.\\n\" +\n                    \"If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.\");\n            }\n            return \"./\" + core.ɵstringify(type);\n        };\n        JitReflector.prototype.parameters = function (typeOrFunc) {\n            return this.reflectionCapabilities.parameters(typeOrFunc);\n        };\n        JitReflector.prototype.tryAnnotations = function (typeOrFunc) {\n            return this.annotations(typeOrFunc);\n        };\n        JitReflector.prototype.annotations = function (typeOrFunc) {\n            return this.reflectionCapabilities.annotations(typeOrFunc);\n        };\n        JitReflector.prototype.shallowAnnotations = function (typeOrFunc) {\n            throw new Error('Not supported in JIT mode');\n        };\n        JitReflector.prototype.propMetadata = function (typeOrFunc) {\n            return this.reflectionCapabilities.propMetadata(typeOrFunc);\n        };\n        JitReflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n            return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n        };\n        JitReflector.prototype.guards = function (type) {\n            return this.reflectionCapabilities.guards(type);\n        };\n        JitReflector.prototype.resolveExternalReference = function (ref) {\n            return builtinExternalReferences.get(ref) || ref.runtime;\n        };\n        return JitReflector;\n    }());\n    function createBuiltinExternalReferencesMap() {\n        var map = new Map();\n        map.set(compiler.Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS, core.ANALYZE_FOR_ENTRY_COMPONENTS);\n        map.set(compiler.Identifiers.ElementRef, core.ElementRef);\n        map.set(compiler.Identifiers.NgModuleRef, core.NgModuleRef);\n        map.set(compiler.Identifiers.ViewContainerRef, core.ViewContainerRef);\n        map.set(compiler.Identifiers.ChangeDetectorRef, core.ChangeDetectorRef);\n        map.set(compiler.Identifiers.Renderer2, core.Renderer2);\n        map.set(compiler.Identifiers.QueryList, core.QueryList);\n        map.set(compiler.Identifiers.TemplateRef, core.TemplateRef);\n        map.set(compiler.Identifiers.CodegenComponentFactoryResolver, core.ɵCodegenComponentFactoryResolver);\n        map.set(compiler.Identifiers.ComponentFactoryResolver, core.ComponentFactoryResolver);\n        map.set(compiler.Identifiers.ComponentFactory, core.ComponentFactory);\n        map.set(compiler.Identifiers.ComponentRef, core.ComponentRef);\n        map.set(compiler.Identifiers.NgModuleFactory, core.NgModuleFactory);\n        map.set(compiler.Identifiers.createModuleFactory, core.ɵcmf);\n        map.set(compiler.Identifiers.moduleDef, core.ɵmod);\n        map.set(compiler.Identifiers.moduleProviderDef, core.ɵmpd);\n        map.set(compiler.Identifiers.RegisterModuleFactoryFn, core.ɵregisterModuleFactory);\n        map.set(compiler.Identifiers.Injector, core.Injector);\n        map.set(compiler.Identifiers.ViewEncapsulation, core.ViewEncapsulation);\n        map.set(compiler.Identifiers.ChangeDetectionStrategy, core.ChangeDetectionStrategy);\n        map.set(compiler.Identifiers.SecurityContext, core.SecurityContext);\n        map.set(compiler.Identifiers.LOCALE_ID, core.LOCALE_ID);\n        map.set(compiler.Identifiers.TRANSLATIONS_FORMAT, core.TRANSLATIONS_FORMAT);\n        map.set(compiler.Identifiers.inlineInterpolate, core.ɵinlineInterpolate);\n        map.set(compiler.Identifiers.interpolate, core.ɵinterpolate);\n        map.set(compiler.Identifiers.EMPTY_ARRAY, core.ɵEMPTY_ARRAY);\n        map.set(compiler.Identifiers.EMPTY_MAP, core.ɵEMPTY_MAP);\n        map.set(compiler.Identifiers.viewDef, core.ɵvid);\n        map.set(compiler.Identifiers.elementDef, core.ɵeld);\n        map.set(compiler.Identifiers.anchorDef, core.ɵand);\n        map.set(compiler.Identifiers.textDef, core.ɵted);\n        map.set(compiler.Identifiers.directiveDef, core.ɵdid);\n        map.set(compiler.Identifiers.providerDef, core.ɵprd);\n        map.set(compiler.Identifiers.queryDef, core.ɵqud);\n        map.set(compiler.Identifiers.pureArrayDef, core.ɵpad);\n        map.set(compiler.Identifiers.pureObjectDef, core.ɵpod);\n        map.set(compiler.Identifiers.purePipeDef, core.ɵppd);\n        map.set(compiler.Identifiers.pipeDef, core.ɵpid);\n        map.set(compiler.Identifiers.nodeValue, core.ɵnov);\n        map.set(compiler.Identifiers.ngContentDef, core.ɵncd);\n        map.set(compiler.Identifiers.unwrapValue, core.ɵunv);\n        map.set(compiler.Identifiers.createRendererType2, core.ɵcrt);\n        map.set(compiler.Identifiers.createComponentFactory, core.ɵccf);\n        return map;\n    }\n\n    var ERROR_COLLECTOR_TOKEN = new core.InjectionToken('ErrorCollector');\n    /**\n     * A default provider for {@link PACKAGE_ROOT_URL} that maps to '/'.\n     */\n    var DEFAULT_PACKAGE_URL_PROVIDER = {\n        provide: core.PACKAGE_ROOT_URL,\n        useValue: '/'\n    };\n    var _NO_RESOURCE_LOADER = {\n        get: function (url) {\n            throw new Error(\"No ResourceLoader implementation has been provided. Can't read the url \\\"\" + url + \"\\\"\");\n        }\n    };\n    var baseHtmlParser = new core.InjectionToken('HtmlParser');\n    var CompilerImpl = /** @class */ (function () {\n        function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, jitEvaluator, compilerConfig, console) {\n            this._metadataResolver = _metadataResolver;\n            this._delegate = new compiler.JitCompiler(_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, jitEvaluator, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));\n            this.injector = injector;\n        }\n        CompilerImpl.prototype.getExtraNgModuleProviders = function () {\n            return [this._metadataResolver.getProviderMetadata(new compiler.ProviderMeta(core.Compiler, { useValue: this }))];\n        };\n        CompilerImpl.prototype.compileModuleSync = function (moduleType) {\n            return this._delegate.compileModuleSync(moduleType);\n        };\n        CompilerImpl.prototype.compileModuleAsync = function (moduleType) {\n            return this._delegate.compileModuleAsync(moduleType);\n        };\n        CompilerImpl.prototype.compileModuleAndAllComponentsSync = function (moduleType) {\n            var result = this._delegate.compileModuleAndAllComponentsSync(moduleType);\n            return {\n                ngModuleFactory: result.ngModuleFactory,\n                componentFactories: result.componentFactories,\n            };\n        };\n        CompilerImpl.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {\n            return this._delegate.compileModuleAndAllComponentsAsync(moduleType)\n                .then(function (result) { return ({\n                ngModuleFactory: result.ngModuleFactory,\n                componentFactories: result.componentFactories,\n            }); });\n        };\n        CompilerImpl.prototype.loadAotSummaries = function (summaries) {\n            this._delegate.loadAotSummaries(summaries);\n        };\n        CompilerImpl.prototype.hasAotSummary = function (ref) {\n            return this._delegate.hasAotSummary(ref);\n        };\n        CompilerImpl.prototype.getComponentFactory = function (component) {\n            return this._delegate.getComponentFactory(component);\n        };\n        CompilerImpl.prototype.clearCache = function () {\n            this._delegate.clearCache();\n        };\n        CompilerImpl.prototype.clearCacheFor = function (type) {\n            this._delegate.clearCacheFor(type);\n        };\n        CompilerImpl.prototype.getModuleId = function (moduleType) {\n            var meta = this._metadataResolver.getNgModuleMetadata(moduleType);\n            return meta && meta.id || undefined;\n        };\n        return CompilerImpl;\n    }());\n    var ɵ0 = new JitReflector(), ɵ1 = _NO_RESOURCE_LOADER, ɵ2 = function (parser, translations, format, config, console) {\n        translations = translations || '';\n        var missingTranslation = translations ? config.missingTranslation : core.MissingTranslationStrategy.Ignore;\n        return new compiler.I18NHtmlParser(parser, translations, format, missingTranslation, console);\n    }, ɵ3 = new compiler.CompilerConfig();\n    /**\n     * A set of providers that provide `JitCompiler` and its dependencies to use for\n     * template compilation.\n     */\n    var COMPILER_PROVIDERS__PRE_R3__ = [\n        { provide: compiler.CompileReflector, useValue: ɵ0 },\n        { provide: compiler.ResourceLoader, useValue: ɵ1 },\n        { provide: compiler.JitSummaryResolver, deps: [] },\n        { provide: compiler.SummaryResolver, useExisting: compiler.JitSummaryResolver },\n        { provide: core.ɵConsole, deps: [] },\n        { provide: compiler.Lexer, deps: [] },\n        { provide: compiler.Parser, deps: [compiler.Lexer] },\n        {\n            provide: baseHtmlParser,\n            useClass: compiler.HtmlParser,\n            deps: [],\n        },\n        {\n            provide: compiler.I18NHtmlParser,\n            useFactory: ɵ2,\n            deps: [\n                baseHtmlParser,\n                [new core.Optional(), new core.Inject(core.TRANSLATIONS)],\n                [new core.Optional(), new core.Inject(core.TRANSLATIONS_FORMAT)],\n                [compiler.CompilerConfig],\n                [core.ɵConsole],\n            ]\n        },\n        {\n            provide: compiler.HtmlParser,\n            useExisting: compiler.I18NHtmlParser,\n        },\n        {\n            provide: compiler.TemplateParser,\n            deps: [compiler.CompilerConfig, compiler.CompileReflector, compiler.Parser, compiler.ElementSchemaRegistry, compiler.I18NHtmlParser, core.ɵConsole]\n        },\n        { provide: compiler.JitEvaluator, useClass: compiler.JitEvaluator, deps: [] },\n        { provide: compiler.DirectiveNormalizer, deps: [compiler.ResourceLoader, compiler.UrlResolver, compiler.HtmlParser, compiler.CompilerConfig] },\n        {\n            provide: compiler.CompileMetadataResolver,\n            deps: [\n                compiler.CompilerConfig, compiler.HtmlParser, compiler.NgModuleResolver, compiler.DirectiveResolver, compiler.PipeResolver,\n                compiler.SummaryResolver, compiler.ElementSchemaRegistry, compiler.DirectiveNormalizer, core.ɵConsole,\n                [core.Optional, compiler.StaticSymbolCache], compiler.CompileReflector, [core.Optional, ERROR_COLLECTOR_TOKEN]\n            ]\n        },\n        DEFAULT_PACKAGE_URL_PROVIDER,\n        { provide: compiler.StyleCompiler, deps: [compiler.UrlResolver] },\n        { provide: compiler.ViewCompiler, deps: [compiler.CompileReflector] },\n        { provide: compiler.NgModuleCompiler, deps: [compiler.CompileReflector] },\n        { provide: compiler.CompilerConfig, useValue: ɵ3 },\n        {\n            provide: core.Compiler,\n            useClass: CompilerImpl,\n            deps: [\n                core.Injector, compiler.CompileMetadataResolver, compiler.TemplateParser, compiler.StyleCompiler, compiler.ViewCompiler,\n                compiler.NgModuleCompiler, compiler.SummaryResolver, compiler.CompileReflector, compiler.JitEvaluator, compiler.CompilerConfig, core.ɵConsole\n            ]\n        },\n        { provide: compiler.DomElementSchemaRegistry, deps: [] },\n        { provide: compiler.ElementSchemaRegistry, useExisting: compiler.DomElementSchemaRegistry },\n        { provide: compiler.UrlResolver, deps: [core.PACKAGE_ROOT_URL] },\n        { provide: compiler.DirectiveResolver, deps: [compiler.CompileReflector] },\n        { provide: compiler.PipeResolver, deps: [compiler.CompileReflector] },\n        { provide: compiler.NgModuleResolver, deps: [compiler.CompileReflector] },\n    ];\n    var COMPILER_PROVIDERS__POST_R3__ = [{ provide: core.Compiler, useFactory: function () { return new core.Compiler(); } }];\n    var COMPILER_PROVIDERS = COMPILER_PROVIDERS__PRE_R3__;\n    /**\n     * @publicApi\n     */\n    var JitCompilerFactory = /** @class */ (function () {\n        /* @internal */\n        function JitCompilerFactory(defaultOptions) {\n            var compilerOptions = {\n                useJit: true,\n                defaultEncapsulation: core.ViewEncapsulation.Emulated,\n                missingTranslation: core.MissingTranslationStrategy.Warning,\n            };\n            this._defaultOptions = __spreadArray([compilerOptions], __read(defaultOptions));\n        }\n        JitCompilerFactory.prototype.createCompiler = function (options) {\n            if (options === void 0) { options = []; }\n            var opts = _mergeOptions(this._defaultOptions.concat(options));\n            var injector = core.Injector.create([\n                COMPILER_PROVIDERS, {\n                    provide: compiler.CompilerConfig,\n                    useFactory: function () {\n                        return new compiler.CompilerConfig({\n                            // let explicit values from the compiler options overwrite options\n                            // from the app providers\n                            useJit: opts.useJit,\n                            jitDevMode: core.isDevMode(),\n                            // let explicit values from the compiler options overwrite options\n                            // from the app providers\n                            defaultEncapsulation: opts.defaultEncapsulation,\n                            missingTranslation: opts.missingTranslation,\n                            preserveWhitespaces: opts.preserveWhitespaces,\n                        });\n                    },\n                    deps: []\n                },\n                opts.providers\n            ]);\n            return injector.get(core.Compiler);\n        };\n        return JitCompilerFactory;\n    }());\n    function _mergeOptions(optionsArr) {\n        return {\n            useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),\n            defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),\n            providers: _mergeArrays(optionsArr.map(function (options) { return options.providers; })),\n            missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),\n            preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),\n        };\n    }\n    function _lastDefined(args) {\n        for (var i = args.length - 1; i >= 0; i--) {\n            if (args[i] !== undefined) {\n                return args[i];\n            }\n        }\n        return undefined;\n    }\n    function _mergeArrays(parts) {\n        var result = [];\n        parts.forEach(function (part) { return part && result.push.apply(result, __spreadArray([], __read(part))); });\n        return result;\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$1 = {};\n    /**\n     * A platform that included corePlatform and the compiler.\n     *\n     * @publicApi\n     */\n    var platformCoreDynamic = core.createPlatformFactory(core.platformCore, 'coreDynamic', [\n        { provide: core.COMPILER_OPTIONS, useValue: ɵ0$1, multi: true },\n        { provide: core.CompilerFactory, useClass: JitCompilerFactory, deps: [core.COMPILER_OPTIONS] },\n    ]);\n\n    var ResourceLoaderImpl = /** @class */ (function (_super) {\n        __extends(ResourceLoaderImpl, _super);\n        function ResourceLoaderImpl() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        ResourceLoaderImpl.prototype.get = function (url) {\n            var resolve;\n            var reject;\n            var promise = new Promise(function (res, rej) {\n                resolve = res;\n                reject = rej;\n            });\n            var xhr = new XMLHttpRequest();\n            xhr.open('GET', url, true);\n            xhr.responseType = 'text';\n            xhr.onload = function () {\n                // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n                // response/responseType properties were introduced in ResourceLoader Level2 spec (supported\n                // by IE10)\n                var response = xhr.response || xhr.responseText;\n                // normalize IE9 bug (https://bugs.jquery.com/ticket/1450)\n                var status = xhr.status === 1223 ? 204 : xhr.status;\n                // fix status code when it is 0 (0 status is undocumented).\n                // Occurs when accessing file resources or on Android 4.1 stock browser\n                // while retrieving files from application cache.\n                if (status === 0) {\n                    status = response ? 200 : 0;\n                }\n                if (200 <= status && status <= 300) {\n                    resolve(response);\n                }\n                else {\n                    reject(\"Failed to load \" + url);\n                }\n            };\n            xhr.onerror = function () {\n                reject(\"Failed to load \" + url);\n            };\n            xhr.send();\n            return promise;\n        };\n        return ResourceLoaderImpl;\n    }(compiler.ResourceLoader));\n    ResourceLoaderImpl.decorators = [\n        { type: core.Injectable }\n    ];\n\n    /**\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://angular.io/license\n     */\n    var ɵ0$2 = { providers: [{ provide: compiler.ResourceLoader, useClass: ResourceLoaderImpl, deps: [] }] }, ɵ1$1 = common.ɵPLATFORM_BROWSER_ID;\n    /**\n     * @publicApi\n     */\n    var INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [\n        platformBrowser.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS,\n        {\n            provide: core.COMPILER_OPTIONS,\n            useValue: ɵ0$2,\n            multi: true\n        },\n        { provide: core.PLATFORM_ID, useValue: ɵ1$1 },\n    ];\n\n    /**\n     * An implementation of ResourceLoader that uses a template cache to avoid doing an actual\n     * ResourceLoader.\n     *\n     * The template cache needs to be built and loaded into window.$templateCache\n     * via a separate mechanism.\n     *\n     * @publicApi\n     */\n    var CachedResourceLoader = /** @class */ (function (_super) {\n        __extends(CachedResourceLoader, _super);\n        function CachedResourceLoader() {\n            var _this = _super.call(this) || this;\n            _this._cache = core.ɵglobal.$templateCache;\n            if (_this._cache == null) {\n                throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');\n            }\n            return _this;\n        }\n        CachedResourceLoader.prototype.get = function (url) {\n            if (this._cache.hasOwnProperty(url)) {\n                return Promise.resolve(this._cache[url]);\n            }\n            else {\n                return Promise.reject('CachedResourceLoader: Did not find cached template for ' + url);\n            }\n        };\n        return CachedResourceLoader;\n    }(compiler.ResourceLoader));\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @publicApi\n     */\n    var VERSION = new core.Version('12.2.1');\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @publicApi\n     */\n    var RESOURCE_CACHE_PROVIDER = [{ provide: compiler.ResourceLoader, useClass: CachedResourceLoader, deps: [] }];\n    /**\n     * @publicApi\n     */\n    var platformBrowserDynamic = core.createPlatformFactory(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);\n\n    /**\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://angular.io/license\n     */\n    // This file only reexports content of the `src` folder. Keep it that way.\n\n    /**\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://angular.io/license\n     */\n\n    /**\n     * Generated bundle index. Do not edit.\n     */\n\n    exports.JitCompilerFactory = JitCompilerFactory;\n    exports.RESOURCE_CACHE_PROVIDER = RESOURCE_CACHE_PROVIDER;\n    exports.VERSION = VERSION;\n    exports.platformBrowserDynamic = platformBrowserDynamic;\n    exports.ɵCOMPILER_PROVIDERS__POST_R3__ = COMPILER_PROVIDERS__POST_R3__;\n    exports.ɵCompilerImpl = CompilerImpl;\n    exports.ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS;\n    exports.ɵResourceLoaderImpl = ResourceLoaderImpl;\n    exports.ɵangular_packages_platform_browser_dynamic_platform_browser_dynamic_a = CachedResourceLoader;\n    exports.ɵplatformCoreDynamic = platformCoreDynamic;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=platform-browser-dynamic.umd.js.map"
  },
  {
    "path": "test/lib/angular-12/angular-12-platform-browser.js",
    "content": "/**\n * @license Angular v12.2.1\n * (c) 2010-2021 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core')) :\n    typeof define === 'function' && define.amd ? define('@angular/platform-browser', ['exports', '@angular/common', '@angular/core'], factory) :\n    (global = global || self, factory((global.ng = global.ng || {}, global.ng.platformBrowser = {}), global.ng.common, global.ng.core));\n}(this, (function (exports, common, i0) { 'use strict';\n\n    /*! *****************************************************************************\n    Copyright (c) Microsoft Corporation.\n\n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n    PERFORMANCE OF THIS SOFTWARE.\n    ***************************************************************************** */\n    /* global Reflect, Promise */\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b)\n                if (Object.prototype.hasOwnProperty.call(b, p))\n                    d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    function __extends(d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    }\n    var __assign = function () {\n        __assign = Object.assign || function __assign(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s)\n                    if (Object.prototype.hasOwnProperty.call(s, p))\n                        t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign.apply(this, arguments);\n    };\n    function __rest(s, e) {\n        var t = {};\n        for (var p in s)\n            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n                t[p] = s[p];\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                    t[p[i]] = s[p[i]];\n            }\n        return t;\n    }\n    function __decorate(decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n            r = Reflect.decorate(decorators, target, key, desc);\n        else\n            for (var i = decorators.length - 1; i >= 0; i--)\n                if (d = decorators[i])\n                    r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    }\n    function __param(paramIndex, decorator) {\n        return function (target, key) { decorator(target, key, paramIndex); };\n    }\n    function __metadata(metadataKey, metadataValue) {\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n            return Reflect.metadata(metadataKey, metadataValue);\n    }\n    function __awaiter(thisArg, _arguments, P, generator) {\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n        return new (P || (P = Promise))(function (resolve, reject) {\n            function fulfilled(value) { try {\n                step(generator.next(value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function rejected(value) { try {\n                step(generator[\"throw\"](value));\n            }\n            catch (e) {\n                reject(e);\n            } }\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\n        });\n    }\n    function __generator(thisArg, body) {\n        var _ = { label: 0, sent: function () { if (t[0] & 1)\n                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n        function verb(n) { return function (v) { return step([n, v]); }; }\n        function step(op) {\n            if (f)\n                throw new TypeError(\"Generator is already executing.\");\n            while (_)\n                try {\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)\n                        return t;\n                    if (y = 0, t)\n                        op = [op[0] & 2, t.value];\n                    switch (op[0]) {\n                        case 0:\n                        case 1:\n                            t = op;\n                            break;\n                        case 4:\n                            _.label++;\n                            return { value: op[1], done: false };\n                        case 5:\n                            _.label++;\n                            y = op[1];\n                            op = [0];\n                            continue;\n                        case 7:\n                            op = _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                        default:\n                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n                                _ = 0;\n                                continue;\n                            }\n                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n                                _.label = op[1];\n                                break;\n                            }\n                            if (op[0] === 6 && _.label < t[1]) {\n                                _.label = t[1];\n                                t = op;\n                                break;\n                            }\n                            if (t && _.label < t[2]) {\n                                _.label = t[2];\n                                _.ops.push(op);\n                                break;\n                            }\n                            if (t[2])\n                                _.ops.pop();\n                            _.trys.pop();\n                            continue;\n                    }\n                    op = body.call(thisArg, _);\n                }\n                catch (e) {\n                    op = [6, e];\n                    y = 0;\n                }\n                finally {\n                    f = t = 0;\n                }\n            if (op[0] & 5)\n                throw op[1];\n            return { value: op[0] ? op[1] : void 0, done: true };\n        }\n    }\n    var __createBinding = Object.create ? (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n    }) : (function (o, m, k, k2) {\n        if (k2 === undefined)\n            k2 = k;\n        o[k2] = m[k];\n    });\n    function __exportStar(m, o) {\n        for (var p in m)\n            if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n                __createBinding(o, m, p);\n    }\n    function __values(o) {\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n        if (m)\n            return m.call(o);\n        if (o && typeof o.length === \"number\")\n            return {\n                next: function () {\n                    if (o && i >= o.length)\n                        o = void 0;\n                    return { value: o && o[i++], done: !o };\n                }\n            };\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n    }\n    function __read(o, n) {\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n        if (!m)\n            return o;\n        var i = m.call(o), r, ar = [], e;\n        try {\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n                ar.push(r.value);\n        }\n        catch (error) {\n            e = { error: error };\n        }\n        finally {\n            try {\n                if (r && !r.done && (m = i[\"return\"]))\n                    m.call(i);\n            }\n            finally {\n                if (e)\n                    throw e.error;\n            }\n        }\n        return ar;\n    }\n    /** @deprecated */\n    function __spread() {\n        for (var ar = [], i = 0; i < arguments.length; i++)\n            ar = ar.concat(__read(arguments[i]));\n        return ar;\n    }\n    /** @deprecated */\n    function __spreadArrays() {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n            s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    }\n    function __spreadArray(to, from, pack) {\n        if (pack || arguments.length === 2)\n            for (var i = 0, l = from.length, ar; i < l; i++) {\n                if (ar || !(i in from)) {\n                    if (!ar)\n                        ar = Array.prototype.slice.call(from, 0, i);\n                    ar[i] = from[i];\n                }\n            }\n        return to.concat(ar || from);\n    }\n    function __await(v) {\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\n    }\n    function __asyncGenerator(thisArg, _arguments, generator) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n        function verb(n) { if (g[n])\n            i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n        function resume(n, v) { try {\n            step(g[n](v));\n        }\n        catch (e) {\n            settle(q[0][3], e);\n        } }\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n        function fulfill(value) { resume(\"next\", value); }\n        function reject(value) { resume(\"throw\", value); }\n        function settle(f, v) { if (f(v), q.shift(), q.length)\n            resume(q[0][0], q[0][1]); }\n    }\n    function __asyncDelegator(o) {\n        var i, p;\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\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; }\n    }\n    function __asyncValues(o) {\n        if (!Symbol.asyncIterator)\n            throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n        var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n    }\n    function __makeTemplateObject(cooked, raw) {\n        if (Object.defineProperty) {\n            Object.defineProperty(cooked, \"raw\", { value: raw });\n        }\n        else {\n            cooked.raw = raw;\n        }\n        return cooked;\n    }\n    ;\n    var __setModuleDefault = Object.create ? (function (o, v) {\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n    }) : function (o, v) {\n        o[\"default\"] = v;\n    };\n    function __importStar(mod) {\n        if (mod && mod.__esModule)\n            return mod;\n        var result = {};\n        if (mod != null)\n            for (var k in mod)\n                if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n                    __createBinding(result, mod, k);\n        __setModuleDefault(result, mod);\n        return result;\n    }\n    function __importDefault(mod) {\n        return (mod && mod.__esModule) ? mod : { default: mod };\n    }\n    function __classPrivateFieldGet(receiver, state, kind, f) {\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a getter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n    }\n    function __classPrivateFieldSet(receiver, state, value, kind, f) {\n        if (kind === \"m\")\n            throw new TypeError(\"Private method is not writable\");\n        if (kind === \"a\" && !f)\n            throw new TypeError(\"Private accessor was defined without a setter\");\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n            throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n    }\n\n    /**\n     * Provides DOM operations in any browser environment.\n     *\n     * @security Tread carefully! Interacting with the DOM directly is dangerous and\n     * can introduce XSS risks.\n     */\n    var GenericBrowserDomAdapter = /** @class */ (function (_super) {\n        __extends(GenericBrowserDomAdapter, _super);\n        function GenericBrowserDomAdapter() {\n            var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;\n            _this.supportsDOMEvents = true;\n            return _this;\n        }\n        return GenericBrowserDomAdapter;\n    }(common.ɵDomAdapter));\n\n    /**\n     * A `DomAdapter` powered by full browser DOM APIs.\n     *\n     * @security Tread carefully! Interacting with the DOM directly is dangerous and\n     * can introduce XSS risks.\n     */\n    /* tslint:disable:requireParameterType no-console */\n    var BrowserDomAdapter = /** @class */ (function (_super) {\n        __extends(BrowserDomAdapter, _super);\n        function BrowserDomAdapter() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        BrowserDomAdapter.makeCurrent = function () {\n            common.ɵsetRootDomAdapter(new BrowserDomAdapter());\n        };\n        BrowserDomAdapter.prototype.onAndCancel = function (el, evt, listener) {\n            el.addEventListener(evt, listener, false);\n            // Needed to follow Dart's subscription semantic, until fix of\n            // https://code.google.com/p/dart/issues/detail?id=17406\n            return function () {\n                el.removeEventListener(evt, listener, false);\n            };\n        };\n        BrowserDomAdapter.prototype.dispatchEvent = function (el, evt) {\n            el.dispatchEvent(evt);\n        };\n        BrowserDomAdapter.prototype.remove = function (node) {\n            if (node.parentNode) {\n                node.parentNode.removeChild(node);\n            }\n        };\n        BrowserDomAdapter.prototype.createElement = function (tagName, doc) {\n            doc = doc || this.getDefaultDocument();\n            return doc.createElement(tagName);\n        };\n        BrowserDomAdapter.prototype.createHtmlDocument = function () {\n            return document.implementation.createHTMLDocument('fakeTitle');\n        };\n        BrowserDomAdapter.prototype.getDefaultDocument = function () {\n            return document;\n        };\n        BrowserDomAdapter.prototype.isElementNode = function (node) {\n            return node.nodeType === Node.ELEMENT_NODE;\n        };\n        BrowserDomAdapter.prototype.isShadowRoot = function (node) {\n            return node instanceof DocumentFragment;\n        };\n        /** @deprecated No longer being used in Ivy code. To be removed in version 14. */\n        BrowserDomAdapter.prototype.getGlobalEventTarget = function (doc, target) {\n            if (target === 'window') {\n                return window;\n            }\n            if (target === 'document') {\n                return doc;\n            }\n            if (target === 'body') {\n                return doc.body;\n            }\n            return null;\n        };\n        BrowserDomAdapter.prototype.getBaseHref = function (doc) {\n            var href = getBaseElementHref();\n            return href == null ? null : relativePath(href);\n        };\n        BrowserDomAdapter.prototype.resetBaseElement = function () {\n            baseElement = null;\n        };\n        BrowserDomAdapter.prototype.getUserAgent = function () {\n            return window.navigator.userAgent;\n        };\n        BrowserDomAdapter.prototype.getCookie = function (name) {\n            return common.ɵparseCookieValue(document.cookie, name);\n        };\n        return BrowserDomAdapter;\n    }(GenericBrowserDomAdapter));\n    var baseElement = null;\n    function getBaseElementHref() {\n        baseElement = baseElement || document.querySelector('base');\n        return baseElement ? baseElement.getAttribute('href') : null;\n    }\n    // based on urlUtils.js in AngularJS 1\n    var urlParsingNode;\n    function relativePath(url) {\n        urlParsingNode = urlParsingNode || document.createElement('a');\n        urlParsingNode.setAttribute('href', url);\n        var pathName = urlParsingNode.pathname;\n        return pathName.charAt(0) === '/' ? pathName : \"/\" + pathName;\n    }\n\n    /**\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://angular.io/license\n     */\n    /**\n     * An id that identifies a particular application being bootstrapped, that should\n     * match across the client/server boundary.\n     */\n    var TRANSITION_ID = new i0.InjectionToken('TRANSITION_ID');\n    function appInitializerFactory(transitionId, document, injector) {\n        return function () {\n            // Wait for all application initializers to be completed before removing the styles set by\n            // the server.\n            injector.get(i0.ApplicationInitStatus).donePromise.then(function () {\n                var dom = common.ɵgetDOM();\n                var styles = Array.prototype.slice.apply(document.querySelectorAll(\"style[ng-transition]\"));\n                styles.filter(function (el) { return el.getAttribute('ng-transition') === transitionId; })\n                    .forEach(function (el) { return dom.remove(el); });\n            });\n        };\n    }\n    var SERVER_TRANSITION_PROVIDERS = [\n        {\n            provide: i0.APP_INITIALIZER,\n            useFactory: appInitializerFactory,\n            deps: [TRANSITION_ID, common.DOCUMENT, i0.Injector],\n            multi: true\n        },\n    ];\n\n    /**\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://angular.io/license\n     */\n    var BrowserGetTestability = /** @class */ (function () {\n        function BrowserGetTestability() {\n        }\n        BrowserGetTestability.init = function () {\n            i0.setTestabilityGetter(new BrowserGetTestability());\n        };\n        BrowserGetTestability.prototype.addToWindow = function (registry) {\n            i0.ɵglobal['getAngularTestability'] = function (elem, findInAncestors) {\n                if (findInAncestors === void 0) { findInAncestors = true; }\n                var testability = registry.findTestabilityInTree(elem, findInAncestors);\n                if (testability == null) {\n                    throw new Error('Could not find testability for element.');\n                }\n                return testability;\n            };\n            i0.ɵglobal['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };\n            i0.ɵglobal['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };\n            var whenAllStable = function (callback /** TODO #9100 */) {\n                var testabilities = i0.ɵglobal['getAllAngularTestabilities']();\n                var count = testabilities.length;\n                var didWork = false;\n                var decrement = function (didWork_ /** TODO #9100 */) {\n                    didWork = didWork || didWork_;\n                    count--;\n                    if (count == 0) {\n                        callback(didWork);\n                    }\n                };\n                testabilities.forEach(function (testability /** TODO #9100 */) {\n                    testability.whenStable(decrement);\n                });\n            };\n            if (!i0.ɵglobal['frameworkStabilizers']) {\n                i0.ɵglobal['frameworkStabilizers'] = [];\n            }\n            i0.ɵglobal['frameworkStabilizers'].push(whenAllStable);\n        };\n        BrowserGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {\n            if (elem == null) {\n                return null;\n            }\n            var t = registry.getTestability(elem);\n            if (t != null) {\n                return t;\n            }\n            else if (!findInAncestors) {\n                return null;\n            }\n            if (common.ɵgetDOM().isShadowRoot(elem)) {\n                return this.findTestabilityInTree(registry, elem.host, true);\n            }\n            return this.findTestabilityInTree(registry, elem.parentElement, true);\n        };\n        return BrowserGetTestability;\n    }());\n\n    /**\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://angular.io/license\n     */\n    /**\n     * A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API.\n     */\n    var BrowserXhr = /** @class */ (function () {\n        function BrowserXhr() {\n        }\n        BrowserXhr.prototype.build = function () {\n            return new XMLHttpRequest();\n        };\n        return BrowserXhr;\n    }());\n    BrowserXhr.decorators = [\n        { type: i0.Injectable }\n    ];\n\n    /**\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://angular.io/license\n     */\n    var CAMEL_CASE_REGEXP = /([A-Z])/g;\n    var DASH_CASE_REGEXP = /-([a-z])/g;\n    function camelCaseToDashCase(input) {\n        return input.replace(CAMEL_CASE_REGEXP, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            return '-' + m[1].toLowerCase();\n        });\n    }\n    function dashCaseToCamelCase(input) {\n        return input.replace(DASH_CASE_REGEXP, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            return m[1].toUpperCase();\n        });\n    }\n    /**\n     * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if\n     * `name` is `'probe'`.\n     * @param name Name under which it will be exported. Keep in mind this will be a property of the\n     * global `ng` object.\n     * @param value The value to export.\n     */\n    function exportNgVar(name, value) {\n        if (typeof COMPILED === 'undefined' || !COMPILED) {\n            // Note: we can't export `ng` when using closure enhanced optimization as:\n            // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n            // - we can't declare a closure extern as the namespace `ng` is already used within Google\n            //   for typings for angularJS (via `goog.provide('ng....')`).\n            var ng = i0.ɵglobal['ng'] = i0.ɵglobal['ng'] || {};\n            ng[name] = value;\n        }\n    }\n\n    /**\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://angular.io/license\n     */\n    var ɵ0 = function () { return ({\n        'ApplicationRef': i0.ApplicationRef,\n        'NgZone': i0.NgZone,\n    }); };\n    var CORE_TOKENS = (ɵ0)();\n    var INSPECT_GLOBAL_NAME = 'probe';\n    var CORE_TOKENS_GLOBAL_NAME = 'coreTokens';\n    /**\n     * Returns a {@link DebugElement} for the given native DOM element, or\n     * null if the given native element does not have an Angular view associated\n     * with it.\n     */\n    function inspectNativeElementR2(element) {\n        return i0.ɵgetDebugNodeR2(element);\n    }\n    function _createNgProbeR2(coreTokens) {\n        exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElementR2);\n        exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object.assign(Object.assign({}, CORE_TOKENS), _ngProbeTokensToMap(coreTokens || [])));\n        return function () { return inspectNativeElementR2; };\n    }\n    function _ngProbeTokensToMap(tokens) {\n        return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});\n    }\n    /**\n     * In Ivy, we don't support NgProbe because we have our own set of testing utilities\n     * with more robust functionality.\n     *\n     * We shouldn't bring in NgProbe because it prevents DebugNode and friends from\n     * tree-shaking properly.\n     */\n    var ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];\n    /**\n     * Providers which support debugging Angular applications (e.g. via `ng.probe`).\n     */\n    var ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [\n        {\n            provide: i0.APP_INITIALIZER,\n            useFactory: _createNgProbeR2,\n            deps: [\n                [i0.NgProbeToken, new i0.Optional()],\n            ],\n            multi: true,\n        },\n    ];\n    var ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__PRE_R3__;\n\n    /**\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://angular.io/license\n     */\n    /**\n     * The injection token for the event-manager plug-in service.\n     *\n     * @publicApi\n     */\n    var EVENT_MANAGER_PLUGINS = new i0.InjectionToken('EventManagerPlugins');\n    /**\n     * An injectable service that provides event management for Angular\n     * through a browser plug-in.\n     *\n     * @publicApi\n     */\n    var EventManager = /** @class */ (function () {\n        /**\n         * Initializes an instance of the event-manager service.\n         */\n        function EventManager(plugins, _zone) {\n            var _this = this;\n            this._zone = _zone;\n            this._eventNameToPlugin = new Map();\n            plugins.forEach(function (p) { return p.manager = _this; });\n            this._plugins = plugins.slice().reverse();\n        }\n        /**\n         * Registers a handler for a specific element and event.\n         *\n         * @param element The HTML element to receive event notifications.\n         * @param eventName The name of the event to listen for.\n         * @param handler A function to call when the notification occurs. Receives the\n         * event object as an argument.\n         * @returns  A callback function that can be used to remove the handler.\n         */\n        EventManager.prototype.addEventListener = function (element, eventName, handler) {\n            var plugin = this._findPluginFor(eventName);\n            return plugin.addEventListener(element, eventName, handler);\n        };\n        /**\n         * Registers a global handler for an event in a target view.\n         *\n         * @param target A target for global event notifications. One of \"window\", \"document\", or \"body\".\n         * @param eventName The name of the event to listen for.\n         * @param handler A function to call when the notification occurs. Receives the\n         * event object as an argument.\n         * @returns A callback function that can be used to remove the handler.\n         * @deprecated No longer being used in Ivy code. To be removed in version 14.\n         */\n        EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {\n            var plugin = this._findPluginFor(eventName);\n            return plugin.addGlobalEventListener(target, eventName, handler);\n        };\n        /**\n         * Retrieves the compilation zone in which event listeners are registered.\n         */\n        EventManager.prototype.getZone = function () {\n            return this._zone;\n        };\n        /** @internal */\n        EventManager.prototype._findPluginFor = function (eventName) {\n            var plugin = this._eventNameToPlugin.get(eventName);\n            if (plugin) {\n                return plugin;\n            }\n            var plugins = this._plugins;\n            for (var i = 0; i < plugins.length; i++) {\n                var plugin_1 = plugins[i];\n                if (plugin_1.supports(eventName)) {\n                    this._eventNameToPlugin.set(eventName, plugin_1);\n                    return plugin_1;\n                }\n            }\n            throw new Error(\"No event manager plugin found for event \" + eventName);\n        };\n        return EventManager;\n    }());\n    EventManager.decorators = [\n        { type: i0.Injectable }\n    ];\n    EventManager.ctorParameters = function () { return [\n        { type: Array, decorators: [{ type: i0.Inject, args: [EVENT_MANAGER_PLUGINS,] }] },\n        { type: i0.NgZone }\n    ]; };\n    var EventManagerPlugin = /** @class */ (function () {\n        function EventManagerPlugin(_doc) {\n            this._doc = _doc;\n        }\n        EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) {\n            var target = common.ɵgetDOM().getGlobalEventTarget(this._doc, element);\n            if (!target) {\n                throw new Error(\"Unsupported event target \" + target + \" for event \" + eventName);\n            }\n            return this.addEventListener(target, eventName, handler);\n        };\n        return EventManagerPlugin;\n    }());\n\n    var SharedStylesHost = /** @class */ (function () {\n        function SharedStylesHost() {\n            /** @internal */\n            this._stylesSet = new Set();\n        }\n        SharedStylesHost.prototype.addStyles = function (styles) {\n            var _this = this;\n            var additions = new Set();\n            styles.forEach(function (style) {\n                if (!_this._stylesSet.has(style)) {\n                    _this._stylesSet.add(style);\n                    additions.add(style);\n                }\n            });\n            this.onStylesAdded(additions);\n        };\n        SharedStylesHost.prototype.onStylesAdded = function (additions) { };\n        SharedStylesHost.prototype.getAllStyles = function () {\n            return Array.from(this._stylesSet);\n        };\n        return SharedStylesHost;\n    }());\n    SharedStylesHost.decorators = [\n        { type: i0.Injectable }\n    ];\n    var DomSharedStylesHost = /** @class */ (function (_super) {\n        __extends(DomSharedStylesHost, _super);\n        function DomSharedStylesHost(_doc) {\n            var _this = _super.call(this) || this;\n            _this._doc = _doc;\n            // Maps all registered host nodes to a list of style nodes that have been added to the host node.\n            _this._hostNodes = new Map();\n            _this._hostNodes.set(_doc.head, []);\n            return _this;\n        }\n        DomSharedStylesHost.prototype._addStylesToHost = function (styles, host, styleNodes) {\n            var _this = this;\n            styles.forEach(function (style) {\n                var styleEl = _this._doc.createElement('style');\n                styleEl.textContent = style;\n                styleNodes.push(host.appendChild(styleEl));\n            });\n        };\n        DomSharedStylesHost.prototype.addHost = function (hostNode) {\n            var styleNodes = [];\n            this._addStylesToHost(this._stylesSet, hostNode, styleNodes);\n            this._hostNodes.set(hostNode, styleNodes);\n        };\n        DomSharedStylesHost.prototype.removeHost = function (hostNode) {\n            var styleNodes = this._hostNodes.get(hostNode);\n            if (styleNodes) {\n                styleNodes.forEach(removeStyle);\n            }\n            this._hostNodes.delete(hostNode);\n        };\n        DomSharedStylesHost.prototype.onStylesAdded = function (additions) {\n            var _this = this;\n            this._hostNodes.forEach(function (styleNodes, hostNode) {\n                _this._addStylesToHost(additions, hostNode, styleNodes);\n            });\n        };\n        DomSharedStylesHost.prototype.ngOnDestroy = function () {\n            this._hostNodes.forEach(function (styleNodes) { return styleNodes.forEach(removeStyle); });\n        };\n        return DomSharedStylesHost;\n    }(SharedStylesHost));\n    DomSharedStylesHost.decorators = [\n        { type: i0.Injectable }\n    ];\n    DomSharedStylesHost.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }\n    ]; };\n    function removeStyle(styleNode) {\n        common.ɵgetDOM().remove(styleNode);\n    }\n\n    var NAMESPACE_URIS = {\n        'svg': 'http://www.w3.org/2000/svg',\n        'xhtml': 'http://www.w3.org/1999/xhtml',\n        'xlink': 'http://www.w3.org/1999/xlink',\n        'xml': 'http://www.w3.org/XML/1998/namespace',\n        'xmlns': 'http://www.w3.org/2000/xmlns/',\n    };\n    var COMPONENT_REGEX = /%COMP%/g;\n    var NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;\n    var COMPONENT_VARIABLE = '%COMP%';\n    var HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\n    var CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\n    function shimContentAttribute(componentShortId) {\n        return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);\n    }\n    function shimHostAttribute(componentShortId) {\n        return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);\n    }\n    function flattenStyles(compId, styles, target) {\n        for (var i = 0; i < styles.length; i++) {\n            var style = styles[i];\n            if (Array.isArray(style)) {\n                flattenStyles(compId, style, target);\n            }\n            else {\n                style = style.replace(COMPONENT_REGEX, compId);\n                target.push(style);\n            }\n        }\n        return target;\n    }\n    function decoratePreventDefault(eventHandler) {\n        // `DebugNode.triggerEventHandler` needs to know if the listener was created with\n        // decoratePreventDefault or is a listener added outside the Angular context so it can handle the\n        // two differently. In the first case, the special '__ngUnwrap__' token is passed to the unwrap\n        // the listener (see below).\n        return function (event) {\n            // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function\n            // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The debug_node\n            // can inspect the listener toString contents for the existence of this special token. Because\n            // the token is a string literal, it is ensured to not be modified by compiled code.\n            if (event === '__ngUnwrap__') {\n                return eventHandler;\n            }\n            var allowDefaultBehavior = eventHandler(event);\n            if (allowDefaultBehavior === false) {\n                // TODO(tbosch): move preventDefault into event plugins...\n                event.preventDefault();\n                event.returnValue = false;\n            }\n            return undefined;\n        };\n    }\n    var hasLoggedNativeEncapsulationWarning = false;\n    var DomRendererFactory2 = /** @class */ (function () {\n        function DomRendererFactory2(eventManager, sharedStylesHost, appId) {\n            this.eventManager = eventManager;\n            this.sharedStylesHost = sharedStylesHost;\n            this.appId = appId;\n            this.rendererByCompId = new Map();\n            this.defaultRenderer = new DefaultDomRenderer2(eventManager);\n        }\n        DomRendererFactory2.prototype.createRenderer = function (element, type) {\n            if (!element || !type) {\n                return this.defaultRenderer;\n            }\n            switch (type.encapsulation) {\n                case i0.ViewEncapsulation.Emulated: {\n                    var renderer = this.rendererByCompId.get(type.id);\n                    if (!renderer) {\n                        renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId);\n                        this.rendererByCompId.set(type.id, renderer);\n                    }\n                    renderer.applyToHost(element);\n                    return renderer;\n                }\n                // @ts-ignore TODO: Remove as part of FW-2290. TS complains about us dealing with an enum\n                // value that is not known (but previously was the value for ViewEncapsulation.Native)\n                case 1:\n                case i0.ViewEncapsulation.ShadowDom:\n                    // TODO(FW-2290): remove the `case 1:` fallback logic and the warning in v12.\n                    if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n                        // @ts-ignore TODO: Remove as part of FW-2290. TS complains about us dealing with an\n                        // enum value that is not known (but previously was the value for\n                        // ViewEncapsulation.Native)\n                        !hasLoggedNativeEncapsulationWarning && type.encapsulation === 1) {\n                        hasLoggedNativeEncapsulationWarning = true;\n                        console.warn('ViewEncapsulation.Native is no longer supported. Falling back to ViewEncapsulation.ShadowDom. The fallback will be removed in v12.');\n                    }\n                    return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);\n                default: {\n                    if (!this.rendererByCompId.has(type.id)) {\n                        var styles = flattenStyles(type.id, type.styles, []);\n                        this.sharedStylesHost.addStyles(styles);\n                        this.rendererByCompId.set(type.id, this.defaultRenderer);\n                    }\n                    return this.defaultRenderer;\n                }\n            }\n        };\n        DomRendererFactory2.prototype.begin = function () { };\n        DomRendererFactory2.prototype.end = function () { };\n        return DomRendererFactory2;\n    }());\n    DomRendererFactory2.decorators = [\n        { type: i0.Injectable }\n    ];\n    DomRendererFactory2.ctorParameters = function () { return [\n        { type: EventManager },\n        { type: DomSharedStylesHost },\n        { type: String, decorators: [{ type: i0.Inject, args: [i0.APP_ID,] }] }\n    ]; };\n    var DefaultDomRenderer2 = /** @class */ (function () {\n        function DefaultDomRenderer2(eventManager) {\n            this.eventManager = eventManager;\n            this.data = Object.create(null);\n        }\n        DefaultDomRenderer2.prototype.destroy = function () { };\n        DefaultDomRenderer2.prototype.createElement = function (name, namespace) {\n            if (namespace) {\n                // In cases where Ivy (not ViewEngine) is giving us the actual namespace, the look up by key\n                // will result in undefined, so we just return the namespace here.\n                return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);\n            }\n            return document.createElement(name);\n        };\n        DefaultDomRenderer2.prototype.createComment = function (value) {\n            return document.createComment(value);\n        };\n        DefaultDomRenderer2.prototype.createText = function (value) {\n            return document.createTextNode(value);\n        };\n        DefaultDomRenderer2.prototype.appendChild = function (parent, newChild) {\n            parent.appendChild(newChild);\n        };\n        DefaultDomRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {\n            if (parent) {\n                parent.insertBefore(newChild, refChild);\n            }\n        };\n        DefaultDomRenderer2.prototype.removeChild = function (parent, oldChild) {\n            if (parent) {\n                parent.removeChild(oldChild);\n            }\n        };\n        DefaultDomRenderer2.prototype.selectRootElement = function (selectorOrNode, preserveContent) {\n            var el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :\n                selectorOrNode;\n            if (!el) {\n                throw new Error(\"The selector \\\"\" + selectorOrNode + \"\\\" did not match any elements\");\n            }\n            if (!preserveContent) {\n                el.textContent = '';\n            }\n            return el;\n        };\n        DefaultDomRenderer2.prototype.parentNode = function (node) {\n            return node.parentNode;\n        };\n        DefaultDomRenderer2.prototype.nextSibling = function (node) {\n            return node.nextSibling;\n        };\n        DefaultDomRenderer2.prototype.setAttribute = function (el, name, value, namespace) {\n            if (namespace) {\n                name = namespace + ':' + name;\n                // TODO(FW-811): Ivy may cause issues here because it's passing around\n                // full URIs for namespaces, therefore this lookup will fail.\n                var namespaceUri = NAMESPACE_URIS[namespace];\n                if (namespaceUri) {\n                    el.setAttributeNS(namespaceUri, name, value);\n                }\n                else {\n                    el.setAttribute(name, value);\n                }\n            }\n            else {\n                el.setAttribute(name, value);\n            }\n        };\n        DefaultDomRenderer2.prototype.removeAttribute = function (el, name, namespace) {\n            if (namespace) {\n                // TODO(FW-811): Ivy may cause issues here because it's passing around\n                // full URIs for namespaces, therefore this lookup will fail.\n                var namespaceUri = NAMESPACE_URIS[namespace];\n                if (namespaceUri) {\n                    el.removeAttributeNS(namespaceUri, name);\n                }\n                else {\n                    // TODO(FW-811): Since ivy is passing around full URIs for namespaces\n                    // this could result in properties like `http://www.w3.org/2000/svg:cx=\"123\"`,\n                    // which is wrong.\n                    el.removeAttribute(namespace + \":\" + name);\n                }\n            }\n            else {\n                el.removeAttribute(name);\n            }\n        };\n        DefaultDomRenderer2.prototype.addClass = function (el, name) {\n            el.classList.add(name);\n        };\n        DefaultDomRenderer2.prototype.removeClass = function (el, name) {\n            el.classList.remove(name);\n        };\n        DefaultDomRenderer2.prototype.setStyle = function (el, style, value, flags) {\n            if (flags & (i0.RendererStyleFlags2.DashCase | i0.RendererStyleFlags2.Important)) {\n                el.style.setProperty(style, value, flags & i0.RendererStyleFlags2.Important ? 'important' : '');\n            }\n            else {\n                el.style[style] = value;\n            }\n        };\n        DefaultDomRenderer2.prototype.removeStyle = function (el, style, flags) {\n            if (flags & i0.RendererStyleFlags2.DashCase) {\n                el.style.removeProperty(style);\n            }\n            else {\n                // IE requires '' instead of null\n                // see https://github.com/angular/angular/issues/7916\n                el.style[style] = '';\n            }\n        };\n        DefaultDomRenderer2.prototype.setProperty = function (el, name, value) {\n            NG_DEV_MODE && checkNoSyntheticProp(name, 'property');\n            el[name] = value;\n        };\n        DefaultDomRenderer2.prototype.setValue = function (node, value) {\n            node.nodeValue = value;\n        };\n        DefaultDomRenderer2.prototype.listen = function (target, event, callback) {\n            NG_DEV_MODE && checkNoSyntheticProp(event, 'listener');\n            if (typeof target === 'string') {\n                return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback));\n            }\n            return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback));\n        };\n        return DefaultDomRenderer2;\n    }());\n    var ɵ0$1 = function () { return '@'.charCodeAt(0); };\n    var AT_CHARCODE = (ɵ0$1)();\n    function checkNoSyntheticProp(name, nameKind) {\n        if (name.charCodeAt(0) === AT_CHARCODE) {\n            throw new Error(\"Found the synthetic \" + nameKind + \" \" + name + \". Please include either \\\"BrowserAnimationsModule\\\" or \\\"NoopAnimationsModule\\\" in your application.\");\n        }\n    }\n    var EmulatedEncapsulationDomRenderer2 = /** @class */ (function (_super) {\n        __extends(EmulatedEncapsulationDomRenderer2, _super);\n        function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component, appId) {\n            var _this = _super.call(this, eventManager) || this;\n            _this.component = component;\n            var styles = flattenStyles(appId + '-' + component.id, component.styles, []);\n            sharedStylesHost.addStyles(styles);\n            _this.contentAttr = shimContentAttribute(appId + '-' + component.id);\n            _this.hostAttr = shimHostAttribute(appId + '-' + component.id);\n            return _this;\n        }\n        EmulatedEncapsulationDomRenderer2.prototype.applyToHost = function (element) {\n            _super.prototype.setAttribute.call(this, element, this.hostAttr, '');\n        };\n        EmulatedEncapsulationDomRenderer2.prototype.createElement = function (parent, name) {\n            var el = _super.prototype.createElement.call(this, parent, name);\n            _super.prototype.setAttribute.call(this, el, this.contentAttr, '');\n            return el;\n        };\n        return EmulatedEncapsulationDomRenderer2;\n    }(DefaultDomRenderer2));\n    var ShadowDomRenderer = /** @class */ (function (_super) {\n        __extends(ShadowDomRenderer, _super);\n        function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {\n            var _this = _super.call(this, eventManager) || this;\n            _this.sharedStylesHost = sharedStylesHost;\n            _this.hostEl = hostEl;\n            _this.shadowRoot = hostEl.attachShadow({ mode: 'open' });\n            _this.sharedStylesHost.addHost(_this.shadowRoot);\n            var styles = flattenStyles(component.id, component.styles, []);\n            for (var i = 0; i < styles.length; i++) {\n                var styleEl = document.createElement('style');\n                styleEl.textContent = styles[i];\n                _this.shadowRoot.appendChild(styleEl);\n            }\n            return _this;\n        }\n        ShadowDomRenderer.prototype.nodeOrShadowRoot = function (node) {\n            return node === this.hostEl ? this.shadowRoot : node;\n        };\n        ShadowDomRenderer.prototype.destroy = function () {\n            this.sharedStylesHost.removeHost(this.shadowRoot);\n        };\n        ShadowDomRenderer.prototype.appendChild = function (parent, newChild) {\n            return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);\n        };\n        ShadowDomRenderer.prototype.insertBefore = function (parent, newChild, refChild) {\n            return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);\n        };\n        ShadowDomRenderer.prototype.removeChild = function (parent, oldChild) {\n            return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);\n        };\n        ShadowDomRenderer.prototype.parentNode = function (node) {\n            return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));\n        };\n        return ShadowDomRenderer;\n    }(DefaultDomRenderer2));\n\n    var DomEventsPlugin = /** @class */ (function (_super) {\n        __extends(DomEventsPlugin, _super);\n        function DomEventsPlugin(doc) {\n            return _super.call(this, doc) || this;\n        }\n        // This plugin should come last in the list of plugins, because it accepts all\n        // events.\n        DomEventsPlugin.prototype.supports = function (eventName) {\n            return true;\n        };\n        DomEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {\n            var _this = this;\n            element.addEventListener(eventName, handler, false);\n            return function () { return _this.removeEventListener(element, eventName, handler); };\n        };\n        DomEventsPlugin.prototype.removeEventListener = function (target, eventName, callback) {\n            return target.removeEventListener(eventName, callback);\n        };\n        return DomEventsPlugin;\n    }(EventManagerPlugin));\n    DomEventsPlugin.decorators = [\n        { type: i0.Injectable }\n    ];\n    DomEventsPlugin.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }\n    ]; };\n\n    /**\n     * Supported HammerJS recognizer event names.\n     */\n    var EVENT_NAMES = {\n        // pan\n        'pan': true,\n        'panstart': true,\n        'panmove': true,\n        'panend': true,\n        'pancancel': true,\n        'panleft': true,\n        'panright': true,\n        'panup': true,\n        'pandown': true,\n        // pinch\n        'pinch': true,\n        'pinchstart': true,\n        'pinchmove': true,\n        'pinchend': true,\n        'pinchcancel': true,\n        'pinchin': true,\n        'pinchout': true,\n        // press\n        'press': true,\n        'pressup': true,\n        // rotate\n        'rotate': true,\n        'rotatestart': true,\n        'rotatemove': true,\n        'rotateend': true,\n        'rotatecancel': true,\n        // swipe\n        'swipe': true,\n        'swipeleft': true,\n        'swiperight': true,\n        'swipeup': true,\n        'swipedown': true,\n        // tap\n        'tap': true,\n        'doubletap': true\n    };\n    /**\n     * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.\n     * @see `HammerGestureConfig`\n     *\n     * @ngModule HammerModule\n     * @publicApi\n     */\n    var HAMMER_GESTURE_CONFIG = new i0.InjectionToken('HammerGestureConfig');\n    /**\n     * Injection token used to provide a {@link HammerLoader} to Angular.\n     *\n     * @publicApi\n     */\n    var HAMMER_LOADER = new i0.InjectionToken('HammerLoader');\n    /**\n     * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)\n     * for gesture recognition. Configures specific event recognition.\n     * @publicApi\n     */\n    var HammerGestureConfig = /** @class */ (function () {\n        function HammerGestureConfig() {\n            /**\n             * A set of supported event names for gestures to be used in Angular.\n             * Angular supports all built-in recognizers, as listed in\n             * [HammerJS documentation](https://hammerjs.github.io/).\n             */\n            this.events = [];\n            /**\n             * Maps gesture event names to a set of configuration options\n             * that specify overrides to the default values for specific properties.\n             *\n             * The key is a supported event name to be configured,\n             * and the options object contains a set of properties, with override values\n             * to be applied to the named recognizer event.\n             * For example, to disable recognition of the rotate event, specify\n             *  `{\"rotate\": {\"enable\": false}}`.\n             *\n             * Properties that are not present take the HammerJS default values.\n             * For information about which properties are supported for which events,\n             * and their allowed and default values, see\n             * [HammerJS documentation](https://hammerjs.github.io/).\n             *\n             */\n            this.overrides = {};\n        }\n        /**\n         * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)\n         * and attaches it to a given HTML element.\n         * @param element The element that will recognize gestures.\n         * @returns A HammerJS event-manager object.\n         */\n        HammerGestureConfig.prototype.buildHammer = function (element) {\n            var mc = new Hammer(element, this.options);\n            mc.get('pinch').set({ enable: true });\n            mc.get('rotate').set({ enable: true });\n            for (var eventName in this.overrides) {\n                mc.get(eventName).set(this.overrides[eventName]);\n            }\n            return mc;\n        };\n        return HammerGestureConfig;\n    }());\n    HammerGestureConfig.decorators = [\n        { type: i0.Injectable }\n    ];\n    /**\n     * Event plugin that adds Hammer support to an application.\n     *\n     * @ngModule HammerModule\n     */\n    var HammerGesturesPlugin = /** @class */ (function (_super) {\n        __extends(HammerGesturesPlugin, _super);\n        function HammerGesturesPlugin(doc, _config, console, loader) {\n            var _this = _super.call(this, doc) || this;\n            _this._config = _config;\n            _this.console = console;\n            _this.loader = loader;\n            _this._loaderPromise = null;\n            return _this;\n        }\n        HammerGesturesPlugin.prototype.supports = function (eventName) {\n            if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {\n                return false;\n            }\n            if (!window.Hammer && !this.loader) {\n                if (typeof ngDevMode === 'undefined' || ngDevMode) {\n                    this.console.warn(\"The \\\"\" + eventName + \"\\\" event cannot be bound because Hammer.JS is not \" +\n                        \"loaded and no custom loader has been specified.\");\n                }\n                return false;\n            }\n            return true;\n        };\n        HammerGesturesPlugin.prototype.addEventListener = function (element, eventName, handler) {\n            var _this = this;\n            var zone = this.manager.getZone();\n            eventName = eventName.toLowerCase();\n            // If Hammer is not present but a loader is specified, we defer adding the event listener\n            // until Hammer is loaded.\n            if (!window.Hammer && this.loader) {\n                this._loaderPromise = this._loaderPromise || this.loader();\n                // This `addEventListener` method returns a function to remove the added listener.\n                // Until Hammer is loaded, the returned function needs to *cancel* the registration rather\n                // than remove anything.\n                var cancelRegistration_1 = false;\n                var deregister_1 = function () {\n                    cancelRegistration_1 = true;\n                };\n                this._loaderPromise\n                    .then(function () {\n                    // If Hammer isn't actually loaded when the custom loader resolves, give up.\n                    if (!window.Hammer) {\n                        if (typeof ngDevMode === 'undefined' || ngDevMode) {\n                            _this.console.warn(\"The custom HAMMER_LOADER completed, but Hammer.JS is not present.\");\n                        }\n                        deregister_1 = function () { };\n                        return;\n                    }\n                    if (!cancelRegistration_1) {\n                        // Now that Hammer is loaded and the listener is being loaded for real,\n                        // the deregistration function changes from canceling registration to removal.\n                        deregister_1 = _this.addEventListener(element, eventName, handler);\n                    }\n                })\n                    .catch(function () {\n                    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n                        _this.console.warn(\"The \\\"\" + eventName + \"\\\" event cannot be bound because the custom \" +\n                            \"Hammer.JS loader failed.\");\n                    }\n                    deregister_1 = function () { };\n                });\n                // Return a function that *executes* `deregister` (and not `deregister` itself) so that we\n                // can change the behavior of `deregister` once the listener is added. Using a closure in\n                // this way allows us to avoid any additional data structures to track listener removal.\n                return function () {\n                    deregister_1();\n                };\n            }\n            return zone.runOutsideAngular(function () {\n                // Creating the manager bind events, must be done outside of angular\n                var mc = _this._config.buildHammer(element);\n                var callback = function (eventObj) {\n                    zone.runGuarded(function () {\n                        handler(eventObj);\n                    });\n                };\n                mc.on(eventName, callback);\n                return function () {\n                    mc.off(eventName, callback);\n                    // destroy mc to prevent memory leak\n                    if (typeof mc.destroy === 'function') {\n                        mc.destroy();\n                    }\n                };\n            });\n        };\n        HammerGesturesPlugin.prototype.isCustomEvent = function (eventName) {\n            return this._config.events.indexOf(eventName) > -1;\n        };\n        return HammerGesturesPlugin;\n    }(EventManagerPlugin));\n    HammerGesturesPlugin.decorators = [\n        { type: i0.Injectable }\n    ];\n    HammerGesturesPlugin.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] },\n        { type: HammerGestureConfig, decorators: [{ type: i0.Inject, args: [HAMMER_GESTURE_CONFIG,] }] },\n        { type: i0.ɵConsole },\n        { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [HAMMER_LOADER,] }] }\n    ]; };\n    /**\n     * In Ivy, support for Hammer gestures is optional, so applications must\n     * import the `HammerModule` at root to turn on support. This means that\n     * Hammer-specific code can be tree-shaken away if not needed.\n     */\n    var HAMMER_PROVIDERS__POST_R3__ = [];\n    /**\n     * In View Engine, support for Hammer gestures is built-in by default.\n     */\n    var HAMMER_PROVIDERS__PRE_R3__ = [\n        {\n            provide: EVENT_MANAGER_PLUGINS,\n            useClass: HammerGesturesPlugin,\n            multi: true,\n            deps: [common.DOCUMENT, HAMMER_GESTURE_CONFIG, i0.ɵConsole, [new i0.Optional(), HAMMER_LOADER]]\n        },\n        { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },\n    ];\n    var HAMMER_PROVIDERS = HAMMER_PROVIDERS__PRE_R3__;\n    /**\n     * Adds support for HammerJS.\n     *\n     * Import this module at the root of your application so that Angular can work with\n     * HammerJS to detect gesture events.\n     *\n     * Note that applications still need to include the HammerJS script itself. This module\n     * simply sets up the coordination layer between HammerJS and Angular's EventManager.\n     *\n     * @publicApi\n     */\n    var HammerModule = /** @class */ (function () {\n        function HammerModule() {\n        }\n        return HammerModule;\n    }());\n    HammerModule.decorators = [\n        { type: i0.NgModule, args: [{ providers: HAMMER_PROVIDERS__PRE_R3__ },] }\n    ];\n\n    /**\n     * Defines supported modifiers for key events.\n     */\n    var MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];\n    var DOM_KEY_LOCATION_NUMPAD = 3;\n    // Map to convert some key or keyIdentifier values to what will be returned by getEventKey\n    var _keyMap = {\n        // The following values are here for cross-browser compatibility and to match the W3C standard\n        // cf https://www.w3.org/TR/DOM-Level-3-Events-key/\n        '\\b': 'Backspace',\n        '\\t': 'Tab',\n        '\\x7F': 'Delete',\n        '\\x1B': 'Escape',\n        'Del': 'Delete',\n        'Esc': 'Escape',\n        'Left': 'ArrowLeft',\n        'Right': 'ArrowRight',\n        'Up': 'ArrowUp',\n        'Down': 'ArrowDown',\n        'Menu': 'ContextMenu',\n        'Scroll': 'ScrollLock',\n        'Win': 'OS'\n    };\n    // There is a bug in Chrome for numeric keypad keys:\n    // https://code.google.com/p/chromium/issues/detail?id=155654\n    // 1, 2, 3 ... are reported as A, B, C ...\n    var _chromeNumKeyPadMap = {\n        'A': '1',\n        'B': '2',\n        'C': '3',\n        'D': '4',\n        'E': '5',\n        'F': '6',\n        'G': '7',\n        'H': '8',\n        'I': '9',\n        'J': '*',\n        'K': '+',\n        'M': '-',\n        'N': '.',\n        'O': '/',\n        '\\x60': '0',\n        '\\x90': 'NumLock'\n    };\n    var ɵ0$2 = function (event) { return event.altKey; }, ɵ1 = function (event) { return event.ctrlKey; }, ɵ2 = function (event) { return event.metaKey; }, ɵ3 = function (event) { return event.shiftKey; };\n    /**\n     * Retrieves modifiers from key-event objects.\n     */\n    var MODIFIER_KEY_GETTERS = {\n        'alt': ɵ0$2,\n        'control': ɵ1,\n        'meta': ɵ2,\n        'shift': ɵ3\n    };\n    /**\n     * @publicApi\n     * A browser plug-in that provides support for handling of key events in Angular.\n     */\n    var KeyEventsPlugin = /** @class */ (function (_super) {\n        __extends(KeyEventsPlugin, _super);\n        /**\n         * Initializes an instance of the browser plug-in.\n         * @param doc The document in which key events will be detected.\n         */\n        function KeyEventsPlugin(doc) {\n            return _super.call(this, doc) || this;\n        }\n        /**\n         * Reports whether a named key event is supported.\n         * @param eventName The event name to query.\n         * @return True if the named key event is supported.\n         */\n        KeyEventsPlugin.prototype.supports = function (eventName) {\n            return KeyEventsPlugin.parseEventName(eventName) != null;\n        };\n        /**\n         * Registers a handler for a specific element and key event.\n         * @param element The HTML element to receive event notifications.\n         * @param eventName The name of the key event to listen for.\n         * @param handler A function to call when the notification occurs. Receives the\n         * event object as an argument.\n         * @returns The key event that was registered.\n         */\n        KeyEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {\n            var parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n            var outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n            return this.manager.getZone().runOutsideAngular(function () {\n                return common.ɵgetDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n            });\n        };\n        KeyEventsPlugin.parseEventName = function (eventName) {\n            var parts = eventName.toLowerCase().split('.');\n            var domEventName = parts.shift();\n            if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n                return null;\n            }\n            var key = KeyEventsPlugin._normalizeKey(parts.pop());\n            var fullKey = '';\n            MODIFIER_KEYS.forEach(function (modifierName) {\n                var index = parts.indexOf(modifierName);\n                if (index > -1) {\n                    parts.splice(index, 1);\n                    fullKey += modifierName + '.';\n                }\n            });\n            fullKey += key;\n            if (parts.length != 0 || key.length === 0) {\n                // returning null instead of throwing to let another plugin process the event\n                return null;\n            }\n            // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming.\n            //       The code must remain in the `result['domEventName']` form.\n            // return {domEventName, fullKey};\n            var result = {};\n            result['domEventName'] = domEventName;\n            result['fullKey'] = fullKey;\n            return result;\n        };\n        KeyEventsPlugin.getEventFullKey = function (event) {\n            var fullKey = '';\n            var key = getEventKey(event);\n            key = key.toLowerCase();\n            if (key === ' ') {\n                key = 'space'; // for readability\n            }\n            else if (key === '.') {\n                key = 'dot'; // because '.' is used as a separator in event names\n            }\n            MODIFIER_KEYS.forEach(function (modifierName) {\n                if (modifierName != key) {\n                    var modifierGetter = MODIFIER_KEY_GETTERS[modifierName];\n                    if (modifierGetter(event)) {\n                        fullKey += modifierName + '.';\n                    }\n                }\n            });\n            fullKey += key;\n            return fullKey;\n        };\n        /**\n         * Configures a handler callback for a key event.\n         * @param fullKey The event name that combines all simultaneous keystrokes.\n         * @param handler The function that responds to the key event.\n         * @param zone The zone in which the event occurred.\n         * @returns A callback function.\n         */\n        KeyEventsPlugin.eventCallback = function (fullKey, handler, zone) {\n            return function (event /** TODO #9100 */) {\n                if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n                    zone.runGuarded(function () { return handler(event); });\n                }\n            };\n        };\n        /** @internal */\n        KeyEventsPlugin._normalizeKey = function (keyName) {\n            // TODO: switch to a Map if the mapping grows too much\n            switch (keyName) {\n                case 'esc':\n                    return 'escape';\n                default:\n                    return keyName;\n            }\n        };\n        return KeyEventsPlugin;\n    }(EventManagerPlugin));\n    KeyEventsPlugin.decorators = [\n        { type: i0.Injectable }\n    ];\n    KeyEventsPlugin.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }\n    ]; };\n    function getEventKey(event) {\n        var key = event.key;\n        if (key == null) {\n            key = event.keyIdentifier;\n            // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and\n            // Safari cf\n            // https://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces\n            if (key == null) {\n                return 'Unidentified';\n            }\n            if (key.startsWith('U+')) {\n                key = String.fromCharCode(parseInt(key.substring(2), 16));\n                if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {\n                    // There is a bug in Chrome for numeric keypad keys:\n                    // https://code.google.com/p/chromium/issues/detail?id=155654\n                    // 1, 2, 3 ... are reported as A, B, C ...\n                    key = _chromeNumKeyPadMap[key];\n                }\n            }\n        }\n        return _keyMap[key] || key;\n    }\n\n    /**\n     * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing\n     * values to be safe to use in the different DOM contexts.\n     *\n     * For example, when binding a URL in an `<a [href]=\"someValue\">` hyperlink, `someValue` will be\n     * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on\n     * the website.\n     *\n     * In specific situations, it might be necessary to disable sanitization, for example if the\n     * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.\n     * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`\n     * methods, and then binding to that value from the template.\n     *\n     * These situations should be very rare, and extraordinary care must be taken to avoid creating a\n     * Cross Site Scripting (XSS) security bug!\n     *\n     * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as\n     * close as possible to the source of the value, to make it easy to verify no security bug is\n     * created by its use.\n     *\n     * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that\n     * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous\n     * code. The sanitizer leaves safe values intact.\n     *\n     * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in\n     * sanitization for the value passed in. Carefully check and audit all values and code paths going\n     * into this call. Make sure any user data is appropriately escaped for this security context.\n     * For more detail, see the [Security Guide](https://g.co/ng/security).\n     *\n     * @publicApi\n     */\n    var DomSanitizer = /** @class */ (function () {\n        function DomSanitizer() {\n        }\n        return DomSanitizer;\n    }());\n    DomSanitizer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DomSanitizer_Factory() { return i0.ɵɵinject(DomSanitizerImpl); }, token: DomSanitizer, providedIn: \"root\" });\n    DomSanitizer.decorators = [\n        { type: i0.Injectable, args: [{ providedIn: 'root', useExisting: i0.forwardRef(function () { return DomSanitizerImpl; }) },] }\n    ];\n    function domSanitizerImplFactory(injector) {\n        return new DomSanitizerImpl(injector.get(common.DOCUMENT));\n    }\n    var DomSanitizerImpl = /** @class */ (function (_super) {\n        __extends(DomSanitizerImpl, _super);\n        function DomSanitizerImpl(_doc) {\n            var _this = _super.call(this) || this;\n            _this._doc = _doc;\n            return _this;\n        }\n        DomSanitizerImpl.prototype.sanitize = function (ctx, value) {\n            if (value == null)\n                return null;\n            switch (ctx) {\n                case i0.SecurityContext.NONE:\n                    return value;\n                case i0.SecurityContext.HTML:\n                    if (i0.ɵallowSanitizationBypassAndThrow(value, \"HTML\" /* Html */)) {\n                        return i0.ɵunwrapSafeValue(value);\n                    }\n                    return i0.ɵ_sanitizeHtml(this._doc, String(value)).toString();\n                case i0.SecurityContext.STYLE:\n                    if (i0.ɵallowSanitizationBypassAndThrow(value, \"Style\" /* Style */)) {\n                        return i0.ɵunwrapSafeValue(value);\n                    }\n                    return value;\n                case i0.SecurityContext.SCRIPT:\n                    if (i0.ɵallowSanitizationBypassAndThrow(value, \"Script\" /* Script */)) {\n                        return i0.ɵunwrapSafeValue(value);\n                    }\n                    throw new Error('unsafe value used in a script context');\n                case i0.SecurityContext.URL:\n                    var type = i0.ɵgetSanitizationBypassType(value);\n                    if (i0.ɵallowSanitizationBypassAndThrow(value, \"URL\" /* Url */)) {\n                        return i0.ɵunwrapSafeValue(value);\n                    }\n                    return i0.ɵ_sanitizeUrl(String(value));\n                case i0.SecurityContext.RESOURCE_URL:\n                    if (i0.ɵallowSanitizationBypassAndThrow(value, \"ResourceURL\" /* ResourceUrl */)) {\n                        return i0.ɵunwrapSafeValue(value);\n                    }\n                    throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');\n                default:\n                    throw new Error(\"Unexpected SecurityContext \" + ctx + \" (see https://g.co/ng/security#xss)\");\n            }\n        };\n        DomSanitizerImpl.prototype.bypassSecurityTrustHtml = function (value) {\n            return i0.ɵbypassSanitizationTrustHtml(value);\n        };\n        DomSanitizerImpl.prototype.bypassSecurityTrustStyle = function (value) {\n            return i0.ɵbypassSanitizationTrustStyle(value);\n        };\n        DomSanitizerImpl.prototype.bypassSecurityTrustScript = function (value) {\n            return i0.ɵbypassSanitizationTrustScript(value);\n        };\n        DomSanitizerImpl.prototype.bypassSecurityTrustUrl = function (value) {\n            return i0.ɵbypassSanitizationTrustUrl(value);\n        };\n        DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = function (value) {\n            return i0.ɵbypassSanitizationTrustResourceUrl(value);\n        };\n        return DomSanitizerImpl;\n    }(DomSanitizer));\n    DomSanitizerImpl.ɵprov = i0.ɵɵdefineInjectable({ factory: function DomSanitizerImpl_Factory() { return domSanitizerImplFactory(i0.ɵɵinject(i0.INJECTOR)); }, token: DomSanitizerImpl, providedIn: \"root\" });\n    DomSanitizerImpl.decorators = [\n        { type: i0.Injectable, args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [i0.Injector] },] }\n    ];\n    DomSanitizerImpl.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    function initDomAdapter() {\n        BrowserDomAdapter.makeCurrent();\n        BrowserGetTestability.init();\n    }\n    function errorHandler() {\n        return new i0.ErrorHandler();\n    }\n    function _document() {\n        // Tell ivy about the global document\n        i0.ɵsetDocument(document);\n        return document;\n    }\n    var ɵ0$3 = common.ɵPLATFORM_BROWSER_ID;\n    var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [\n        { provide: i0.PLATFORM_ID, useValue: ɵ0$3 },\n        { provide: i0.PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },\n        { provide: common.DOCUMENT, useFactory: _document, deps: [] },\n    ];\n    var BROWSER_SANITIZATION_PROVIDERS__PRE_R3__ = [\n        { provide: i0.Sanitizer, useExisting: DomSanitizer },\n        { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [common.DOCUMENT] },\n    ];\n    var BROWSER_SANITIZATION_PROVIDERS__POST_R3__ = [];\n    /**\n     * @security Replacing built-in sanitization providers exposes the application to XSS risks.\n     * Attacker-controlled data introduced by an unsanitized provider could expose your\n     * application to XSS risks. For more detail, see the [Security Guide](https://g.co/ng/security).\n     * @publicApi\n     */\n    var BROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS__PRE_R3__;\n    /**\n     * A factory function that returns a `PlatformRef` instance associated with browser service\n     * providers.\n     *\n     * @publicApi\n     */\n    var platformBrowser = i0.createPlatformFactory(i0.platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n    var BROWSER_MODULE_PROVIDERS = [\n        BROWSER_SANITIZATION_PROVIDERS,\n        { provide: i0.ɵINJECTOR_SCOPE, useValue: 'root' },\n        { provide: i0.ErrorHandler, useFactory: errorHandler, deps: [] },\n        {\n            provide: EVENT_MANAGER_PLUGINS,\n            useClass: DomEventsPlugin,\n            multi: true,\n            deps: [common.DOCUMENT, i0.NgZone, i0.PLATFORM_ID]\n        },\n        { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [common.DOCUMENT] },\n        HAMMER_PROVIDERS,\n        {\n            provide: DomRendererFactory2,\n            useClass: DomRendererFactory2,\n            deps: [EventManager, DomSharedStylesHost, i0.APP_ID]\n        },\n        { provide: i0.RendererFactory2, useExisting: DomRendererFactory2 },\n        { provide: SharedStylesHost, useExisting: DomSharedStylesHost },\n        { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [common.DOCUMENT] },\n        { provide: i0.Testability, useClass: i0.Testability, deps: [i0.NgZone] },\n        { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, i0.NgZone] },\n        { provide: common.XhrFactory, useClass: BrowserXhr, deps: [] },\n        ELEMENT_PROBE_PROVIDERS,\n    ];\n    /**\n     * Exports required infrastructure for all Angular apps.\n     * Included by default in all Angular apps created with the CLI\n     * `new` command.\n     * Re-exports `CommonModule` and `ApplicationModule`, making their\n     * exports and providers available to all apps.\n     *\n     * @publicApi\n     */\n    var BrowserModule = /** @class */ (function () {\n        function BrowserModule(parentModule) {\n            if (parentModule) {\n                throw new Error(\"BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.\");\n            }\n        }\n        /**\n         * Configures a browser-based app to transition from a server-rendered app, if\n         * one is present on the page.\n         *\n         * @param params An object containing an identifier for the app to transition.\n         * The ID must match between the client and server versions of the app.\n         * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.\n         */\n        BrowserModule.withServerTransition = function (params) {\n            return {\n                ngModule: BrowserModule,\n                providers: [\n                    { provide: i0.APP_ID, useValue: params.appId },\n                    { provide: TRANSITION_ID, useExisting: i0.APP_ID },\n                    SERVER_TRANSITION_PROVIDERS,\n                ],\n            };\n        };\n        return BrowserModule;\n    }());\n    BrowserModule.decorators = [\n        { type: i0.NgModule, args: [{ providers: BROWSER_MODULE_PROVIDERS, exports: [common.CommonModule, i0.ApplicationModule] },] }\n    ];\n    BrowserModule.ctorParameters = function () { return [\n        { type: BrowserModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }, { type: i0.Inject, args: [BrowserModule,] }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Factory to create a `Meta` service instance for the current DOM document.\n     */\n    function createMeta() {\n        return new Meta(i0.ɵɵinject(common.DOCUMENT));\n    }\n    /**\n     * A service for managing HTML `<meta>` tags.\n     *\n     * Properties of the `MetaDefinition` object match the attributes of the\n     * HTML `<meta>` tag. These tags define document metadata that is important for\n     * things like configuring a Content Security Policy, defining browser compatibility\n     * and security settings, setting HTTP Headers, defining rich content for social sharing,\n     * and Search Engine Optimization (SEO).\n     *\n     * To identify specific `<meta>` tags in a document, use an attribute selection\n     * string in the format `\"tag_attribute='value string'\"`.\n     * For example, an `attrSelector` value of `\"name='description'\"` matches a tag\n     * whose `name` attribute has the value `\"description\"`.\n     * Selectors are used with the `querySelector()` Document method,\n     * in the format `meta[{attrSelector}]`.\n     *\n     * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)\n     * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector)\n     *\n     *\n     * @publicApi\n     */\n    var Meta = /** @class */ (function () {\n        function Meta(_doc) {\n            this._doc = _doc;\n            this._dom = common.ɵgetDOM();\n        }\n        /**\n         * Retrieves or creates a specific `<meta>` tag element in the current HTML document.\n         * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute\n         * values in the provided tag definition, and verifies that all other attribute values are equal.\n         * If an existing element is found, it is returned and is not modified in any way.\n         * @param tag The definition of a `<meta>` element to match or create.\n         * @param forceCreation True to create a new element without checking whether one already exists.\n         * @returns The existing element with the same attributes and values if found,\n         * the new element if no match is found, or `null` if the tag parameter is not defined.\n         */\n        Meta.prototype.addTag = function (tag, forceCreation) {\n            if (forceCreation === void 0) { forceCreation = false; }\n            if (!tag)\n                return null;\n            return this._getOrCreateElement(tag, forceCreation);\n        };\n        /**\n         * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.\n         * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute\n         * values in the provided tag definition, and verifies that all other attribute values are equal.\n         * @param tags An array of tag definitions to match or create.\n         * @param forceCreation True to create new elements without checking whether they already exist.\n         * @returns The matching elements if found, or the new elements.\n         */\n        Meta.prototype.addTags = function (tags, forceCreation) {\n            var _this = this;\n            if (forceCreation === void 0) { forceCreation = false; }\n            if (!tags)\n                return [];\n            return tags.reduce(function (result, tag) {\n                if (tag) {\n                    result.push(_this._getOrCreateElement(tag, forceCreation));\n                }\n                return result;\n            }, []);\n        };\n        /**\n         * Retrieves a `<meta>` tag element in the current HTML document.\n         * @param attrSelector The tag attribute and value to match against, in the format\n         * `\"tag_attribute='value string'\"`.\n         * @returns The matching element, if any.\n         */\n        Meta.prototype.getTag = function (attrSelector) {\n            if (!attrSelector)\n                return null;\n            return this._doc.querySelector(\"meta[\" + attrSelector + \"]\") || null;\n        };\n        /**\n         * Retrieves a set of `<meta>` tag elements in the current HTML document.\n         * @param attrSelector The tag attribute and value to match against, in the format\n         * `\"tag_attribute='value string'\"`.\n         * @returns The matching elements, if any.\n         */\n        Meta.prototype.getTags = function (attrSelector) {\n            if (!attrSelector)\n                return [];\n            var list /*NodeList*/ = this._doc.querySelectorAll(\"meta[\" + attrSelector + \"]\");\n            return list ? [].slice.call(list) : [];\n        };\n        /**\n         * Modifies an existing `<meta>` tag element in the current HTML document.\n         * @param tag The tag description with which to replace the existing tag content.\n         * @param selector A tag attribute and value to match against, to identify\n         * an existing tag. A string in the format `\"tag_attribute=`value string`\"`.\n         * If not supplied, matches a tag with the same `name` or `property` attribute value as the\n         * replacement tag.\n         * @return The modified element.\n         */\n        Meta.prototype.updateTag = function (tag, selector) {\n            if (!tag)\n                return null;\n            selector = selector || this._parseSelector(tag);\n            var meta = this.getTag(selector);\n            if (meta) {\n                return this._setMetaElementAttributes(tag, meta);\n            }\n            return this._getOrCreateElement(tag, true);\n        };\n        /**\n         * Removes an existing `<meta>` tag element from the current HTML document.\n         * @param attrSelector A tag attribute and value to match against, to identify\n         * an existing tag. A string in the format `\"tag_attribute=`value string`\"`.\n         */\n        Meta.prototype.removeTag = function (attrSelector) {\n            this.removeTagElement(this.getTag(attrSelector));\n        };\n        /**\n         * Removes an existing `<meta>` tag element from the current HTML document.\n         * @param meta The tag definition to match against to identify an existing tag.\n         */\n        Meta.prototype.removeTagElement = function (meta) {\n            if (meta) {\n                this._dom.remove(meta);\n            }\n        };\n        Meta.prototype._getOrCreateElement = function (meta, forceCreation) {\n            var _this = this;\n            if (forceCreation === void 0) { forceCreation = false; }\n            if (!forceCreation) {\n                var selector = this._parseSelector(meta);\n                // It's allowed to have multiple elements with the same name so it's not enough to\n                // just check that element with the same name already present on the page. We also need to\n                // check if element has tag attributes\n                var elem = this.getTags(selector).filter(function (elem) { return _this._containsAttributes(meta, elem); })[0];\n                if (elem !== undefined)\n                    return elem;\n            }\n            var element = this._dom.createElement('meta');\n            this._setMetaElementAttributes(meta, element);\n            var head = this._doc.getElementsByTagName('head')[0];\n            head.appendChild(element);\n            return element;\n        };\n        Meta.prototype._setMetaElementAttributes = function (tag, el) {\n            var _this = this;\n            Object.keys(tag).forEach(function (prop) { return el.setAttribute(_this._getMetaKeyMap(prop), tag[prop]); });\n            return el;\n        };\n        Meta.prototype._parseSelector = function (tag) {\n            var attr = tag.name ? 'name' : 'property';\n            return attr + \"=\\\"\" + tag[attr] + \"\\\"\";\n        };\n        Meta.prototype._containsAttributes = function (tag, elem) {\n            var _this = this;\n            return Object.keys(tag).every(function (key) { return elem.getAttribute(_this._getMetaKeyMap(key)) === tag[key]; });\n        };\n        Meta.prototype._getMetaKeyMap = function (prop) {\n            return META_KEYS_MAP[prop] || prop;\n        };\n        return Meta;\n    }());\n    Meta.ɵprov = i0.ɵɵdefineInjectable({ factory: createMeta, token: Meta, providedIn: \"root\" });\n    Meta.decorators = [\n        { type: i0.Injectable, args: [{ providedIn: 'root', useFactory: createMeta, deps: [] },] }\n    ];\n    Meta.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }\n    ]; };\n    /**\n     * Mapping for MetaDefinition properties with their correct meta attribute names\n     */\n    var META_KEYS_MAP = {\n        httpEquiv: 'http-equiv'\n    };\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Factory to create Title service.\n     */\n    function createTitle() {\n        return new Title(i0.ɵɵinject(common.DOCUMENT));\n    }\n    /**\n     * A service that can be used to get and set the title of a current HTML document.\n     *\n     * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)\n     * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements\n     * (representing the `<title>` tag). Instead, this service can be used to set and get the current\n     * title value.\n     *\n     * @publicApi\n     */\n    var Title = /** @class */ (function () {\n        function Title(_doc) {\n            this._doc = _doc;\n        }\n        /**\n         * Get the title of the current HTML document.\n         */\n        Title.prototype.getTitle = function () {\n            return this._doc.title;\n        };\n        /**\n         * Set the title of the current HTML document.\n         * @param newTitle\n         */\n        Title.prototype.setTitle = function (newTitle) {\n            this._doc.title = newTitle || '';\n        };\n        return Title;\n    }());\n    Title.ɵprov = i0.ɵɵdefineInjectable({ factory: createTitle, token: Title, providedIn: \"root\" });\n    Title.decorators = [\n        { type: i0.Injectable, args: [{ providedIn: 'root', useFactory: createTitle, deps: [] },] }\n    ];\n    Title.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }\n    ]; };\n\n    /**\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://angular.io/license\n     */\n    var win = typeof window !== 'undefined' && window || {};\n\n    /**\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://angular.io/license\n     */\n    var ChangeDetectionPerfRecord = /** @class */ (function () {\n        function ChangeDetectionPerfRecord(msPerTick, numTicks) {\n            this.msPerTick = msPerTick;\n            this.numTicks = numTicks;\n        }\n        return ChangeDetectionPerfRecord;\n    }());\n    /**\n     * Entry point for all Angular profiling-related debug tools. This object\n     * corresponds to the `ng.profiler` in the dev console.\n     */\n    var AngularProfiler = /** @class */ (function () {\n        function AngularProfiler(ref) {\n            this.appRef = ref.injector.get(i0.ApplicationRef);\n        }\n        // tslint:disable:no-console\n        /**\n         * Exercises change detection in a loop and then prints the average amount of\n         * time in milliseconds how long a single round of change detection takes for\n         * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n         * of 500 milliseconds.\n         *\n         * Optionally, a user may pass a `config` parameter containing a map of\n         * options. Supported options are:\n         *\n         * `record` (boolean) - causes the profiler to record a CPU profile while\n         * it exercises the change detector. Example:\n         *\n         * ```\n         * ng.profiler.timeChangeDetection({record: true})\n         * ```\n         */\n        AngularProfiler.prototype.timeChangeDetection = function (config) {\n            var record = config && config['record'];\n            var profileName = 'Change Detection';\n            // Profiler is not available in Android browsers without dev tools opened\n            var isProfilerAvailable = win.console.profile != null;\n            if (record && isProfilerAvailable) {\n                win.console.profile(profileName);\n            }\n            var start = performanceNow();\n            var numTicks = 0;\n            while (numTicks < 5 || (performanceNow() - start) < 500) {\n                this.appRef.tick();\n                numTicks++;\n            }\n            var end = performanceNow();\n            if (record && isProfilerAvailable) {\n                win.console.profileEnd(profileName);\n            }\n            var msPerTick = (end - start) / numTicks;\n            win.console.log(\"ran \" + numTicks + \" change detection cycles\");\n            win.console.log(msPerTick.toFixed(2) + \" ms per check\");\n            return new ChangeDetectionPerfRecord(msPerTick, numTicks);\n        };\n        return AngularProfiler;\n    }());\n    function performanceNow() {\n        return win.performance && win.performance.now ? win.performance.now() :\n            new Date().getTime();\n    }\n\n    /**\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://angular.io/license\n     */\n    var PROFILER_GLOBAL_NAME = 'profiler';\n    /**\n     * Enabled Angular debug tools that are accessible via your browser's\n     * developer console.\n     *\n     * Usage:\n     *\n     * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)\n     * 1. Type `ng.` (usually the console will show auto-complete suggestion)\n     * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`\n     *    then hit Enter.\n     *\n     * @publicApi\n     */\n    function enableDebugTools(ref) {\n        exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));\n        return ref;\n    }\n    /**\n     * Disables Angular tools.\n     *\n     * @publicApi\n     */\n    function disableDebugTools() {\n        exportNgVar(PROFILER_GLOBAL_NAME, null);\n    }\n\n    /**\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://angular.io/license\n     */\n    function escapeHtml(text) {\n        var escapedText = {\n            '&': '&a;',\n            '\"': '&q;',\n            '\\'': '&s;',\n            '<': '&l;',\n            '>': '&g;',\n        };\n        return text.replace(/[&\"'<>]/g, function (s) { return escapedText[s]; });\n    }\n    function unescapeHtml(text) {\n        var unescapedText = {\n            '&a;': '&',\n            '&q;': '\"',\n            '&s;': '\\'',\n            '&l;': '<',\n            '&g;': '>',\n        };\n        return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });\n    }\n    /**\n     * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n     *\n     * Example:\n     *\n     * ```\n     * const COUNTER_KEY = makeStateKey<number>('counter');\n     * let value = 10;\n     *\n     * transferState.set(COUNTER_KEY, value);\n     * ```\n     *\n     * @publicApi\n     */\n    function makeStateKey(key) {\n        return key;\n    }\n    /**\n     * A key value store that is transferred from the application on the server side to the application\n     * on the client side.\n     *\n     * `TransferState` will be available as an injectable token. To use it import\n     * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.\n     *\n     * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n     * boolean, number, string, null and non-class objects will be serialized and deserialized in a\n     * non-lossy manner.\n     *\n     * @publicApi\n     */\n    var TransferState = /** @class */ (function () {\n        function TransferState() {\n            this.store = {};\n            this.onSerializeCallbacks = {};\n        }\n        /** @internal */\n        TransferState.init = function (initState) {\n            var transferState = new TransferState();\n            transferState.store = initState;\n            return transferState;\n        };\n        /**\n         * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n         */\n        TransferState.prototype.get = function (key, defaultValue) {\n            return this.store[key] !== undefined ? this.store[key] : defaultValue;\n        };\n        /**\n         * Set the value corresponding to a key.\n         */\n        TransferState.prototype.set = function (key, value) {\n            this.store[key] = value;\n        };\n        /**\n         * Remove a key from the store.\n         */\n        TransferState.prototype.remove = function (key) {\n            delete this.store[key];\n        };\n        /**\n         * Test whether a key exists in the store.\n         */\n        TransferState.prototype.hasKey = function (key) {\n            return this.store.hasOwnProperty(key);\n        };\n        /**\n         * Register a callback to provide the value for a key when `toJson` is called.\n         */\n        TransferState.prototype.onSerialize = function (key, callback) {\n            this.onSerializeCallbacks[key] = callback;\n        };\n        /**\n         * Serialize the current state of the store to JSON.\n         */\n        TransferState.prototype.toJson = function () {\n            // Call the onSerialize callbacks and put those values into the store.\n            for (var key in this.onSerializeCallbacks) {\n                if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n                    try {\n                        this.store[key] = this.onSerializeCallbacks[key]();\n                    }\n                    catch (e) {\n                        console.warn('Exception in onSerialize callback: ', e);\n                    }\n                }\n            }\n            return JSON.stringify(this.store);\n        };\n        return TransferState;\n    }());\n    TransferState.decorators = [\n        { type: i0.Injectable }\n    ];\n    function initTransferState(doc, appId) {\n        // Locate the script tag with the JSON data transferred from the server.\n        // The id of the script tag is set to the Angular appId + 'state'.\n        var script = doc.getElementById(appId + '-state');\n        var initialState = {};\n        if (script && script.textContent) {\n            try {\n                // Avoid using any here as it triggers lint errors in google3 (any is not allowed).\n                initialState = JSON.parse(unescapeHtml(script.textContent));\n            }\n            catch (e) {\n                console.warn('Exception while restoring TransferState for app ' + appId, e);\n            }\n        }\n        return TransferState.init(initialState);\n    }\n    /**\n     * NgModule to install on the client side while using the `TransferState` to transfer state from\n     * server to client.\n     *\n     * @publicApi\n     */\n    var BrowserTransferStateModule = /** @class */ (function () {\n        function BrowserTransferStateModule() {\n        }\n        return BrowserTransferStateModule;\n    }());\n    BrowserTransferStateModule.decorators = [\n        { type: i0.NgModule, args: [{\n                    providers: [{ provide: TransferState, useFactory: initTransferState, deps: [common.DOCUMENT, i0.APP_ID] }],\n                },] }\n    ];\n\n    /**\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://angular.io/license\n     */\n    /**\n     * Predicates for use with {@link DebugElement}'s query functions.\n     *\n     * @publicApi\n     */\n    var By = /** @class */ (function () {\n        function By() {\n        }\n        /**\n         * Match all nodes.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n         */\n        By.all = function () {\n            return function () { return true; };\n        };\n        /**\n         * Match elements by the given CSS selector.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n         */\n        By.css = function (selector) {\n            return function (debugElement) {\n                return debugElement.nativeElement != null ?\n                    elementMatches(debugElement.nativeElement, selector) :\n                    false;\n            };\n        };\n        /**\n         * Match nodes that have the given directive present.\n         *\n         * @usageNotes\n         * ### Example\n         *\n         * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n         */\n        By.directive = function (type) {\n            return function (debugNode) { return debugNode.providerTokens.indexOf(type) !== -1; };\n        };\n        return By;\n    }());\n    function elementMatches(n, selector) {\n        if (common.ɵgetDOM().isElementNode(n)) {\n            return n.matches && n.matches(selector) ||\n                n.msMatchesSelector && n.msMatchesSelector(selector) ||\n                n.webkitMatchesSelector && n.webkitMatchesSelector(selector);\n        }\n        return false;\n    }\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    /**\n     * @publicApi\n     */\n    var VERSION = new i0.Version('12.2.1');\n\n    /**\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://angular.io/license\n     */\n\n    /**\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://angular.io/license\n     */\n    // This file only reexports content of the `src` folder. Keep it that way.\n\n    /**\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://angular.io/license\n     */\n\n    /**\n     * Generated bundle index. Do not edit.\n     */\n\n    Object.defineProperty(exports, 'ɵgetDOM', {\n        enumerable: true,\n        get: function () {\n            return common.ɵgetDOM;\n        }\n    });\n    exports.BrowserModule = BrowserModule;\n    exports.BrowserTransferStateModule = BrowserTransferStateModule;\n    exports.By = By;\n    exports.DomSanitizer = DomSanitizer;\n    exports.EVENT_MANAGER_PLUGINS = EVENT_MANAGER_PLUGINS;\n    exports.EventManager = EventManager;\n    exports.HAMMER_GESTURE_CONFIG = HAMMER_GESTURE_CONFIG;\n    exports.HAMMER_LOADER = HAMMER_LOADER;\n    exports.HammerGestureConfig = HammerGestureConfig;\n    exports.HammerModule = HammerModule;\n    exports.Meta = Meta;\n    exports.Title = Title;\n    exports.TransferState = TransferState;\n    exports.VERSION = VERSION;\n    exports.disableDebugTools = disableDebugTools;\n    exports.enableDebugTools = enableDebugTools;\n    exports.makeStateKey = makeStateKey;\n    exports.platformBrowser = platformBrowser;\n    exports.ɵBROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS;\n    exports.ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__ = BROWSER_SANITIZATION_PROVIDERS__POST_R3__;\n    exports.ɵBrowserDomAdapter = BrowserDomAdapter;\n    exports.ɵBrowserGetTestability = BrowserGetTestability;\n    exports.ɵDomEventsPlugin = DomEventsPlugin;\n    exports.ɵDomRendererFactory2 = DomRendererFactory2;\n    exports.ɵDomSanitizerImpl = DomSanitizerImpl;\n    exports.ɵDomSharedStylesHost = DomSharedStylesHost;\n    exports.ɵELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS;\n    exports.ɵELEMENT_PROBE_PROVIDERS__POST_R3__ = ELEMENT_PROBE_PROVIDERS__POST_R3__;\n    exports.ɵHAMMER_PROVIDERS__POST_R3__ = HAMMER_PROVIDERS__POST_R3__;\n    exports.ɵHammerGesturesPlugin = HammerGesturesPlugin;\n    exports.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS = INTERNAL_BROWSER_PLATFORM_PROVIDERS;\n    exports.ɵKeyEventsPlugin = KeyEventsPlugin;\n    exports.ɵNAMESPACE_URIS = NAMESPACE_URIS;\n    exports.ɵSharedStylesHost = SharedStylesHost;\n    exports.ɵTRANSITION_ID = TRANSITION_ID;\n    exports.ɵangular_packages_platform_browser_platform_browser_a = errorHandler;\n    exports.ɵangular_packages_platform_browser_platform_browser_b = _document;\n    exports.ɵangular_packages_platform_browser_platform_browser_c = BROWSER_MODULE_PROVIDERS;\n    exports.ɵangular_packages_platform_browser_platform_browser_d = createMeta;\n    exports.ɵangular_packages_platform_browser_platform_browser_e = createTitle;\n    exports.ɵangular_packages_platform_browser_platform_browser_f = initTransferState;\n    exports.ɵangular_packages_platform_browser_platform_browser_g = EventManagerPlugin;\n    exports.ɵangular_packages_platform_browser_platform_browser_h = HAMMER_PROVIDERS__PRE_R3__;\n    exports.ɵangular_packages_platform_browser_platform_browser_i = HAMMER_PROVIDERS;\n    exports.ɵangular_packages_platform_browser_platform_browser_j = domSanitizerImplFactory;\n    exports.ɵangular_packages_platform_browser_platform_browser_k = appInitializerFactory;\n    exports.ɵangular_packages_platform_browser_platform_browser_l = SERVER_TRANSITION_PROVIDERS;\n    exports.ɵangular_packages_platform_browser_platform_browser_m = _createNgProbeR2;\n    exports.ɵangular_packages_platform_browser_platform_browser_n = ELEMENT_PROBE_PROVIDERS__PRE_R3__;\n    exports.ɵangular_packages_platform_browser_platform_browser_o = BrowserXhr;\n    exports.ɵangular_packages_platform_browser_platform_browser_p = GenericBrowserDomAdapter;\n    exports.ɵescapeHtml = escapeHtml;\n    exports.ɵflattenStyles = flattenStyles;\n    exports.ɵinitDomAdapter = initDomAdapter;\n    exports.ɵshimContentAttribute = shimContentAttribute;\n    exports.ɵshimHostAttribute = shimHostAttribute;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=platform-browser.umd.js.map"
  },
  {
    "path": "test/lib/angular-12/rxjs_v6.2.0.js",
    "content": "/**\n  @license\n  Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt\n **/\n/**\n  @license\n  Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt\n **/\n/*\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n*****************************************************************************/\nvar $jscomp={scope:{}};$jscomp.defineProperty=\"function\"==typeof Object.defineProperties?Object.defineProperty:function(e,d,l){if(l.get||l.set)throw new TypeError(\"ES3 does not support getters and setters.\");e!=Array.prototype&&e!=Object.prototype&&(e[d]=l.value)};$jscomp.getGlobal=function(e){return\"undefined\"!=typeof window&&window===e?e:\"undefined\"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);\n$jscomp.polyfill=function(e,d,l,h){if(d){l=$jscomp.global;e=e.split(\".\");for(h=0;h<e.length-1;h++){var y=e[h];y in l||(l[y]={});l=l[y]}e=e[e.length-1];h=l[e];d=d(h);d!=h&&null!=d&&$jscomp.defineProperty(l,e,{configurable:!0,writable:!0,value:d})}};$jscomp.polyfill(\"Object.setPrototypeOf\",function(e){return e?e:\"object\"!=typeof\"\".__proto__?null:function(d,e){d.__proto__=e;if(d.__proto__!==e)throw new TypeError(d+\" is not extensible\");return d}},\"es6\",\"es5\");\n$jscomp.owns=function(e,d){return Object.prototype.hasOwnProperty.call(e,d)};$jscomp.polyfill(\"Object.assign\",function(e){return e?e:function(d,e){for(var h=1;h<arguments.length;h++){var l=arguments[h];if(l)for(var n in l)$jscomp.owns(l,n)&&(d[n]=l[n])}return d}},\"es6-impl\",\"es3\");$jscomp.SYMBOL_PREFIX=\"jscomp_symbol_\";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;\n$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||\"\")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol(\"iterator\"));\"function\"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};\n$jscomp.arrayIterator=function(e){var d=0;return $jscomp.iteratorPrototype(function(){return d<e.length?{done:!1,value:e[d++]}:{done:!0}})};$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.makeIterator=function(e){$jscomp.initSymbolIterator();var d=e[Symbol.iterator];return d?d.call(e):$jscomp.arrayIterator(e)};$jscomp.EXPOSE_ASYNC_EXECUTOR=!0;$jscomp.FORCE_POLYFILL_PROMISE=!1;\n$jscomp.polyfill(\"Promise\",function(e){function d(){this.batch_=null}if(e&&!$jscomp.FORCE_POLYFILL_PROMISE)return e;d.prototype.asyncExecute=function(d){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(d);return this};d.prototype.asyncExecuteBatch_=function(){var d=this;this.asyncExecuteFunction(function(){d.executeBatch_()})};var l=$jscomp.global.setTimeout;d.prototype.asyncExecuteFunction=function(d){l(d,0)};d.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var d=\nthis.batch_;this.batch_=[];for(var e=0;e<d.length;++e){var m=d[e];delete d[e];try{m()}catch(G){this.asyncThrow_(G)}}}this.batch_=null};d.prototype.asyncThrow_=function(d){this.asyncExecuteFunction(function(){throw d;})};var h=function(d){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var e=this.createResolveAndReject_();try{d(e.resolve,e.reject)}catch(m){e.reject(m)}};h.prototype.createResolveAndReject_=function(){function d(d){return function(n){m||(m=!0,d.call(e,n))}}var e=this,m=\n!1;return{resolve:d(this.resolveTo_),reject:d(this.reject_)}};h.prototype.resolveTo_=function(d){if(d===this)this.reject_(new TypeError(\"A Promise cannot resolve to itself\"));else if(d instanceof h)this.settleSameAsPromise_(d);else{var e;a:switch(typeof d){case \"object\":e=null!=d;break a;case \"function\":e=!0;break a;default:e=!1}e?this.resolveToNonPromiseObj_(d):this.fulfill_(d)}};h.prototype.resolveToNonPromiseObj_=function(d){var e=void 0;try{e=d.then}catch(m){this.reject_(m);return}\"function\"==\ntypeof e?this.settleSameAsThenable_(e,d):this.fulfill_(d)};h.prototype.reject_=function(d){this.settle_(2,d)};h.prototype.fulfill_=function(d){this.settle_(1,d)};h.prototype.settle_=function(d,e){if(0!=this.state_)throw Error(\"Cannot settle(\"+d+\", \"+e|\"): Promise already settled in state\"+this.state_);this.state_=d;this.result_=e;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var d=this.onSettledCallbacks_,e=0;e<d.length;++e)d[e].call(),\nd[e]=null;this.onSettledCallbacks_=null}};var y=new d;h.prototype.settleSameAsPromise_=function(d){var e=this.createResolveAndReject_();d.callWhenSettled_(e.resolve,e.reject)};h.prototype.settleSameAsThenable_=function(d,e){var m=this.createResolveAndReject_();try{d.call(e,m.resolve,m.reject)}catch(G){m.reject(G)}};h.prototype.then=function(d,e){function m(d,e){return\"function\"==typeof d?function(e){try{l(d(e))}catch(B){n(B)}}:e}var l,n,O=new h(function(d,e){l=d;n=e});this.callWhenSettled_(m(d,l),\nm(e,n));return O};h.prototype.catch=function(d){return this.then(void 0,d)};h.prototype.callWhenSettled_=function(d,e){function m(){switch(h.state_){case 1:d(h.result_);break;case 2:e(h.result_);break;default:throw Error(\"Unexpected state: \"+h.state_);}}var h=this;null==this.onSettledCallbacks_?y.asyncExecute(m):this.onSettledCallbacks_.push(function(){y.asyncExecute(m)})};h.resolve=function(d){return d instanceof h?d:new h(function(e,m){e(d)})};h.reject=function(d){return new h(function(e,m){m(d)})};\nh.race=function(d){return new h(function(e,m){for(var l=$jscomp.makeIterator(d),n=l.next();!n.done;n=l.next())h.resolve(n.value).callWhenSettled_(e,m)})};h.all=function(d){var e=$jscomp.makeIterator(d),m=e.next();return m.done?h.resolve([]):new h(function(d,l){function n(e){return function(m){G[e]=m;P--;0==P&&d(G)}}var G=[],P=0;do G.push(void 0),P++,h.resolve(m.value).callWhenSettled_(n(G.length-1),l),m=e.next();while(!m.done)})};$jscomp.EXPOSE_ASYNC_EXECUTOR&&(h.$jscomp$new$AsyncExecutor=function(){return new d});\nreturn h},\"es6-impl\",\"es3\");\n$jscomp.polyfill(\"WeakMap\",function(e){function d(d){$jscomp.owns(d,h)||$jscomp.defineProperty(d,h,{value:{}})}function l(e){var m=Object[e];m&&(Object[e]=function(e){d(e);return m(e)})}if(function(){if(!e||!Object.seal)return!1;try{var d=Object.seal({}),m=Object.seal({}),h=new e([[d,2],[m,3]]);if(2!=h.get(d)||3!=h.get(m))return!1;h.delete(d);h.set(m,4);return!h.has(d)&&4==h.get(m)}catch(P){return!1}}())return e;var h=\"$jscomp_hidden_\"+Math.random().toString().substring(2);l(\"freeze\");l(\"preventExtensions\");\nl(\"seal\");var y=0,n=function(d){this.id_=(y+=Math.random()+1).toString();if(d){$jscomp.initSymbol();$jscomp.initSymbolIterator();d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)e=e.value,this.set(e[0],e[1])}};n.prototype.set=function(e,m){d(e);if(!$jscomp.owns(e,h))throw Error(\"WeakMap key fail: \"+e);e[h][this.id_]=m;return this};n.prototype.get=function(d){return $jscomp.owns(d,h)?d[h][this.id_]:void 0};n.prototype.has=function(d){return $jscomp.owns(d,h)&&$jscomp.owns(d[h],this.id_)};n.prototype.delete=\nfunction(d){return $jscomp.owns(d,h)&&$jscomp.owns(d[h],this.id_)?delete d[h][this.id_]:!1};return n},\"es6-impl\",\"es3\");$jscomp.ASSUME_NO_NATIVE_MAP=!1;\n$jscomp.polyfill(\"Map\",function(e){if(!$jscomp.ASSUME_NO_NATIVE_MAP&&function(){if(!e||!e.prototype.entries||\"function\"!=typeof Object.seal)return!1;try{var d=Object.seal({x:4}),h=new e($jscomp.makeIterator([[d,\"s\"]]));if(\"s\"!=h.get(d)||1!=h.size||h.get({x:4})||h.set({x:4},\"t\")!=h||2!=h.size)return!1;var l=h.entries(),n=l.next();if(n.done||n.value[0]!=d||\"s\"!=n.value[1])return!1;n=l.next();return n.done||4!=n.value[0].x||\"t\"!=n.value[1]||!l.next().done?!1:!0}catch(la){return!1}}())return e;$jscomp.initSymbol();\n$jscomp.initSymbolIterator();var d=new WeakMap,l=function(d){this.data_={};this.head_=n();this.size=0;if(d){d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)e=e.value,this.set(e[0],e[1])}};l.prototype.set=function(d,e){var m=h(this,d);m.list||(m.list=this.data_[m.id]=[]);m.entry?m.entry.value=e:(m.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:d,value:e},m.list.push(m.entry),this.head_.previous.next=m.entry,this.head_.previous=m.entry,this.size++);return this};l.prototype.delete=\nfunction(d){d=h(this,d);return d.entry&&d.list?(d.list.splice(d.index,1),d.list.length||delete this.data_[d.id],d.entry.previous.next=d.entry.next,d.entry.next.previous=d.entry.previous,d.entry.head=null,this.size--,!0):!1};l.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=n();this.size=0};l.prototype.has=function(d){return!!h(this,d).entry};l.prototype.get=function(d){return(d=h(this,d).entry)&&d.value};l.prototype.entries=function(){return y(this,function(d){return[d.key,\nd.value]})};l.prototype.keys=function(){return y(this,function(d){return d.key})};l.prototype.values=function(){return y(this,function(d){return d.value})};l.prototype.forEach=function(d,e){for(var h=this.entries(),l;!(l=h.next()).done;)l=l.value,d.call(e,l[1],l[0],this)};l.prototype[Symbol.iterator]=l.prototype.entries;var h=function(e,h){var l;l=h&&typeof h;\"object\"==l||\"function\"==l?d.has(h)?l=d.get(h):(l=\"\"+ ++O,d.set(h,l)):l=\"p_\"+h;var m=e.data_[l];if(m&&$jscomp.owns(e.data_,l))for(e=0;e<m.length;e++){var n=\nm[e];if(h!==h&&n.key!==n.key||h===n.key)return{id:l,list:m,index:e,entry:n}}return{id:l,list:m,index:-1,entry:void 0}},y=function(d,e){var h=d.head_;return $jscomp.iteratorPrototype(function(){if(h){for(;h.head!=d.head_;)h=h.previous;for(;h.next!=h.head;)return h=h.next,{done:!1,value:e(h)};h=null}return{done:!0,value:void 0}})},n=function(){var d={};return d.previous=d.next=d.head=d},O=0;return l},\"es6-impl\",\"es3\");$jscomp.array=$jscomp.array||{};\n$jscomp.iteratorFromArray=function(e,d){$jscomp.initSymbolIterator();e instanceof String&&(e+=\"\");var l=0,h={next:function(){if(l<e.length){var y=l++;return{value:d(y,e[y]),done:!1}}h.next=function(){return{done:!0,value:void 0}};return h.next()}};h[Symbol.iterator]=function(){return h};return h};$jscomp.polyfill(\"Array.prototype.values\",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(d,e){return e})}},\"es6\",\"es3\");\n$jscomp.polyfill(\"Array.prototype.keys\",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},\"es6-impl\",\"es3\");$jscomp.ASSUME_NO_NATIVE_SET=!1;\n$jscomp.polyfill(\"Set\",function(e){if(!$jscomp.ASSUME_NO_NATIVE_SET&&function(){if(!e||!e.prototype.entries||\"function\"!=typeof Object.seal)return!1;try{var d=Object.seal({x:4}),h=new e($jscomp.makeIterator([d]));if(!h.has(d)||1!=h.size||h.add(d)!=h||1!=h.size||h.add({x:4})!=h||2!=h.size)return!1;var y=h.entries(),n=y.next();if(n.done||n.value[0]!=d||n.value[1]!=d)return!1;n=y.next();return n.done||n.value[0]==d||4!=n.value[0].x||n.value[1]!=n.value[0]?!1:y.next().done}catch(O){return!1}}())return e;\n$jscomp.initSymbol();$jscomp.initSymbolIterator();var d=function(d){this.map_=new Map;if(d){d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)this.add(e.value)}this.size=this.map_.size};d.prototype.add=function(d){this.map_.set(d,d);this.size=this.map_.size;return this};d.prototype.delete=function(d){d=this.map_.delete(d);this.size=this.map_.size;return d};d.prototype.clear=function(){this.map_.clear();this.size=0};d.prototype.has=function(d){return this.map_.has(d)};d.prototype.entries=function(){return this.map_.entries()};\nd.prototype.values=function(){return this.map_.values()};d.prototype.keys=d.prototype.values;d.prototype[Symbol.iterator]=d.prototype.values;d.prototype.forEach=function(d,e){var h=this;this.map_.forEach(function(l){return d.call(e,l,l,h)})};return d},\"es6-impl\",\"es3\");\n(function(e,d){\"object\"===typeof exports&&\"undefined\"!==typeof module?d(exports):\"function\"===typeof define&&define.amd?define([\"exports\"],d):d(e.rxjs=e.rxjs||{})})(this,function(e){function d(c,a){function b(){this.constructor=c}Mb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function l(c){return\"function\"===typeof c}function h(c){setTimeout(function(){throw c;})}function y(){try{return La.apply(this,arguments)}catch(c){return q.e=c,q}}function n(c){La=c;return y}function O(c){return c.reduce(function(a,\nb){return a.concat(b instanceof ea?b.errors:b)},[])}function m(){}function G(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return P(c)}function P(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}:m}function Ka(c){c||(c=H.Promise||Promise);if(!c)throw Error(\"no Promise impl found\");return c}function la(){return function(c){return c.lift(new Nb(c))}}function I(c){return c?Lb(c):Q}function Lb(c){return new r(function(a){return c.schedule(function(){return a.complete()})})}\nfunction B(c){return c&&\"function\"===typeof c.schedule}function J(c,a){return a?new r(function(b){var f=new w,g=0;f.add(a.schedule(function(){g===c.length?b.complete():(b.next(c[g++]),b.closed||f.add(this.schedule()))}));return f}):new r(Ma(c))}function ta(c){var a=new r(function(b){b.next(c);b.complete()});a._isScalar=!0;a.value=c;return a}function ua(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];B(a)?c.pop():a=void 0;switch(c.length){case 0:return I(a);case 1:return a?\nJ(c,a):ta(c[0]);default:return J(c,a)}}function va(c,a){return a?new r(function(b){return a.schedule(Ob,0,{error:c,subscriber:b})}):new r(function(b){return b.error(c)})}function Ob(c){c.subscriber.error(c.error)}function R(c){return c}function F(c,a){return function(b){if(\"function\"!==typeof c)throw new TypeError(\"argument is not a function. Are you looking for `mapTo()`?\");return b.lift(new Pb(c,a))}}function Na(c,a,b){if(a)if(B(a))b=a;else return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=\narguments[g];return Na(c,b).apply(void 0,f).pipe(F(function(b){return D(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];var k=this,d,e={context:k,subject:d,callbackFunc:c,scheduler:b};return new r(function(f){if(b)return b.schedule(Qb,0,{args:a,subscriber:f,params:e});if(!d){d=new Y;try{c.apply(k,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];d.next(1>=b.length?b[0]:b);d.complete()}]))}catch(xa){d.error(xa)}}return d.subscribe(f)})}}\nfunction Qb(c){var a=this,b=c.args,f=c.subscriber;c=c.params;var g=c.callbackFunc,k=c.context,d=c.scheduler,e=c.subject;if(!e){e=c.subject=new Y;try{g.apply(k,b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(d.schedule(Rb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(S){e.error(S)}}this.add(e.subscribe(f))}function Rb(c){var a=c.subject;a.next(c.value);a.complete()}function Oa(c,a,b){if(a)if(B(a))b=a;else return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=\narguments[g];return Oa(c,b).apply(void 0,f).pipe(F(function(b){return D(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];var k={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new r(function(f){var g=k.context,d=k.subject;if(b)return b.schedule(Sb,0,{params:k,subscriber:f,context:g});if(!d){d=k.subject=new Y;try{c.apply(g,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];(a=b.shift())?d.error(a):\n(d.next(1>=b.length?b[0]:b),d.complete())}]))}catch(xa){d.error(xa)}}return d.subscribe(f)})}}function Sb(c){var a=this,b=c.params,f=c.subscriber;c=c.context;var g=b.callbackFunc,k=b.args,d=b.scheduler,e=b.subject;if(!e){e=b.subject=new Y;try{g.apply(c,k.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(d.schedule(Pa,0,{err:c,subject:e})):a.add(d.schedule(Tb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(S){this.add(d.schedule(Pa,0,{err:S,subject:e}))}}this.add(e.subscribe(f))}\nfunction Tb(c){var a=c.subject;a.next(c.value);a.complete()}function Pa(c){c.subject.error(c.err)}function Qa(c){return c&&\"function\"!==typeof c.subscribe&&\"function\"===typeof c.then}function u(c,a,b,f){c=new Ub(c,b,f);return Ra(a)(c)}function Vb(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){return c.then(function(c){f.add(a.schedule(function(){b.next(c);f.add(a.schedule(function(){return b.complete()}))}))},function(c){f.add(a.schedule(function(){return b.error(c)}))})}));\nreturn f}):new r(Sa(c))}function Wb(c,a){if(!c)throw Error(\"Iterable cannot be null\");return a?new r(function(b){var f=new w,g;f.add(function(){g&&\"function\"===typeof g.return&&g.return()});f.add(a.schedule(function(){g=c[K]();f.add(a.schedule(function(){if(!b.closed){var a,c;try{var f=g.next();a=f.value;c=f.done}catch(S){b.error(S);return}c?b.complete():(b.next(a),this.schedule())}}))}));return f}):new r(Ta(c))}function Xb(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){var g=\nc[Z]();f.add(g.subscribe({next:function(c){f.add(a.schedule(function(){return b.next(c)}))},error:function(c){f.add(a.schedule(function(){return b.error(c)}))},complete:function(){f.add(a.schedule(function(){return b.complete()}))}}))}));return f}):new r(Ua(c))}function L(c,a){if(!a)return c instanceof r?c:new r(Ra(c));if(null!=c){if(c&&\"function\"===typeof c[Z])return Xb(c,a);if(Qa(c))return Vb(c,a);if(Va(c))return J(c,a);if(c&&\"function\"===typeof c[K]||\"string\"===typeof c)return Wb(c,a)}throw new TypeError((null!==\nc&&typeof c||c)+\" is not observable\");}function T(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if(\"function\"===typeof a)return function(f){return f.pipe(T(function(b,f){return L(c(b,f)).pipe(F(function(c,g){return a(b,c,f,g)}))},b))};\"number\"===typeof a&&(b=a);return function(a){return a.lift(new Yb(c,b))}}function ya(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return T(R,c)}function Wa(){return ya(1)}function M(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return 1===c.length||2===\nc.length&&B(c[1])?L(c[0]):Wa()(ua.apply(void 0,c))}function za(c){return new r(function(a){var b;try{b=c()}catch(f){a.error(f);return}return(b?L(b):I()).subscribe(a)})}function Xa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b;\"function\"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return 0===c.length?Q:b?Xa(c).pipe(F(function(a){return b.apply(void 0,a)})):new r(function(b){return new Zb(b,c)})}function Ya(c,a,b,f){l(b)&&(f=b,b=void 0);return f?Ya(c,a,b).pipe(F(function(b){return D(b)?\nf.apply(void 0,b):f(b)})):new r(function(f){Za(c,a,function(b){1<arguments.length?f.next(Array.prototype.slice.call(arguments)):f.next(b)},f,b)})}function Za(c,a,b,f,g){var k;if(c&&\"function\"===typeof c.addEventListener&&\"function\"===typeof c.removeEventListener)c.addEventListener(a,b,g),k=function(){return c.removeEventListener(a,b,g)};else if(c&&\"function\"===typeof c.on&&\"function\"===typeof c.off)c.on(a,b),k=function(){return c.off(a,b)};else if(c&&\"function\"===typeof c.addListener&&\"function\"===\ntypeof c.removeListener)c.addListener(a,b),k=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var d=0,e=c.length;d<e;d++)Za(c[d],a,b,f,g);else throw new TypeError(\"Invalid event target\");f.add(k)}function $a(c,a,b){return b?$a(c,a).pipe(F(function(a){return D(a)?b.apply(void 0,a):b(a)})):new r(function(b){var f=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return b.next(1===a.length?a[0]:a)},k;try{k=c(f)}catch(x){b.error(x);return}if(l(a))return function(){return a(f,\nk)}})}function $b(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(k){a.error(k);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(k){a.error(k);return}if(!f){a.complete();return}if(a.closed)return}var g;try{g=c.resultSelector(c.state)}catch(k){a.error(k);return}if(!a.closed&&(a.next(g),!a.closed))return this.schedule(c)}}function aa(c){return!D(c)&&0<=c-parseFloat(c)+1}function ac(c){var a=c.subscriber,b=c.counter;c=c.period;\na.next(b);this.schedule({subscriber:a,counter:b+1,period:c},c)}function ab(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var a=Number.POSITIVE_INFINITY,b=null,f=c[c.length-1];B(f)?(b=c.pop(),1<c.length&&\"number\"===typeof c[c.length-1]&&(a=c.pop())):\"number\"===typeof f&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof r?c[0]:ya(a)(J(c,b))}function Aa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(0===c.length)return Q;var b=c[0],f=c.slice(1);return 1===c.length&&\nD(b)?Aa.apply(void 0,b):new r(function(a){var c=function(){return a.add(Aa.apply(void 0,f).subscribe(a))};return L(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function bc(c){var a=c.keys,b=c.index,f=c.subscriber,g=c.subscription;c=c.obj;if(!f.closed)if(b<a.length){var k=a[b];f.next([k,c[k]]);g.add(this.schedule({keys:a,index:b+1,subscriber:f,subscription:g,obj:c}))}else f.complete()}function bb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(D(c[0]))c=\nc[0];else return c[0];return J(c,void 0).lift(new cc)}function dc(c){var a=c.start,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a),f.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function cb(c,a,b){void 0===c&&(c=0);var f=-1;aa(a)?f=1>Number(a)&&1||Number(a):B(a)&&(b=a);B(b)||(b=C);return new r(function(a){var g=aa(c)?c:+c-b.now();return b.schedule(ec,g,{index:0,period:f,subscriber:a})})}function ec(c){var a=c.index,b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete();\nc.index=a+1;this.schedule(c,b)}}function db(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];\"function\"===typeof a&&c.pop();return J(c,void 0).lift(new eb(a))}function fb(c){return function(a){return a.lift(new fc(c))}}function gb(c){var a=c.subscriber,b=c.context;b&&a.closeContext(b);a.closed||(c.context=a.openContext(),c.context.closeAction=this.schedule(c,c.bufferTimeSpan))}function gc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,f=c.subscriber,g=c.scheduler,\nk=f.openContext();f.closed||(f.add(k.closeAction=g.schedule(hb,b,{subscriber:f,context:k})),this.schedule(c,a))}function hb(c){c.subscriber.closeContext(c.context)}function ib(c,a){return T(c,a,1)}function hc(c){c.debouncedNext()}function fa(c){void 0===c&&(c=null);return function(a){return a.lift(new ic(c))}}function jb(c,a){return function(b){return b.lift(new jc(c,a))}}function ba(c,a){return function(b){return b.lift(new kc(c,a))}}function kb(c,a,b){return function(f){return f.lift(new lc(c,a,\nb))}}function mc(){return new ga}function Ba(c){return function(a){return 0===c?I():a.lift(new nc(c))}}function lb(c,a){return a?function(b){return b.pipe(lb(function(b,g){return L(c(b,g)).pipe(F(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new oc(c))}}function ma(c){return function(a){return 0===c?I():a.lift(new pc(c))}}function na(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(f){return f.lift(new qc(c,a,b))}}function oa(c,a){return 2<=arguments.length?function(b){return G(na(c,\na),ma(1),fa(a))(b)}:function(b){return G(na(function(b,a,k){return c(b,a,k+1)}),ma(1))(b)}}function U(c,a){return function(b){var f;f=\"function\"===typeof c?c:function(){return c};if(\"function\"===typeof a)return b.lift(new rc(f,a));var g=Object.create(b,sc);g.source=b;g.subjectFactory=f;return g}}function tc(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function uc(c,a){return function(b){var f=b;for(b=0;b<a;b++)if(f=f[c[b]],\"undefined\"===typeof f)return;\nreturn f}}function vc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function wc(){return new z}function xc(c,a,b){var f,g=0,k,d=!1,e=!1;return function(x){g++;if(!f||d)d=!1,f=new V(c,a,b),k=x.subscribe({next:function(b){f.next(b)},error:function(b){d=!0;f.error(b)},complete:function(){e=!0;f.complete()}});var h=f.subscribe(this);return function(){g--;h.unsubscribe();k&&0===g&&e&&k.unsubscribe()}}}function ha(c,a){return\"function\"===typeof a?function(b){return b.pipe(ha(function(b,\ng){return L(c(b,g)).pipe(F(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new yc(c))}}function zc(c){c.subscriber.clearThrottle()}function mb(c,a,b){void 0===b&&(b=C);return function(f){var g=c instanceof Date&&!isNaN(+c),k=g?+c-b.now():Math.abs(c);return f.lift(new Ac(k,g,a,b))}}function Bc(c,a,b){if(0===b)return[a];c.push(a);return c}function Cc(c){var a=c.subscriber,b=c.windowTimeSpan,f=c.window;f&&a.closeWindow(f);c.window=a.openWindow();this.schedule(c,b)}function Dc(c){var a=\nc.windowTimeSpan,b=c.subscriber,f=c.scheduler,g=c.windowCreationInterval,k=b.openWindow(),d={action:this,subscription:null};d.subscription=f.schedule(nb,a,{subscriber:b,window:k,context:d});this.add(d.subscription);this.schedule(c,g)}function nb(c){var a=c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function ob(c,a){for(var b=0,f=a.length;b<f;b++)for(var g=a[b],k=Object.getOwnPropertyNames(g.prototype),d=0,e=k.length;d<e;d++){var h=\nk[d];c.prototype[h]=g.prototype[h]}}function Ec(c,a){void 0===a&&(a=null);return new W({method:\"GET\",url:c,headers:a})}function Fc(c,a,b){return new W({method:\"POST\",url:c,body:a,headers:b})}function Gc(c,a){return new W({method:\"DELETE\",url:c,headers:a})}function Hc(c,a,b){return new W({method:\"PUT\",url:c,body:a,headers:b})}function Ic(c,a,b){return new W({method:\"PATCH\",url:c,body:a,headers:b})}function Jc(c,a){return Kc(new W({method:\"GET\",url:c,responseType:\"json\",headers:a}))}function pb(c,a){switch(c){case \"json\":return\"response\"in\na?a.responseType?a.response:JSON.parse(a.response||a.responseText||\"null\"):JSON.parse(a.responseText||\"null\");case \"xml\":return a.responseXML;default:return\"response\"in a?a.response:a.responseText}}var Mb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},Lc=Object.assign||function(c){for(var a,b=1,f=arguments.length;b<f;b++){a=arguments[b];for(var g in a)Object.prototype.hasOwnProperty.call(a,g)&&(c[g]=\na[g])}return c},Ca=!1,H={Promise:void 0,set useDeprecatedSynchronousErrorHandling(c){c?console.warn(\"DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n\"+Error().stack):Ca&&console.log(\"RxJS: Back to a better error behavior. Thank you. \\x3c3\");Ca=c},get useDeprecatedSynchronousErrorHandling(){return Ca}},pa={closed:!0,next:function(c){},error:function(c){if(H.useDeprecatedSynchronousErrorHandling)throw c;h(c)},complete:function(){}},D=Array.isArray||function(c){return c&&\n\"number\"===typeof c.length},q={e:{}},La,ea=function(c){function a(b){var f=c.call(this,b?b.length+\" errors occurred during unsubscription:\\n  \"+b.map(function(b,a){return a+1+\") \"+b.toString()}).join(\"\\n  \"):\"\")||this;f.errors=b;f.name=\"UnsubscriptionError\";Object.setPrototypeOf(f,a.prototype);return f}d(a,c);return a}(Error),w=function(){function c(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a=!1,b;if(!this.closed){var c=\nthis._parent,g=this._parents,k=this._unsubscribe,d=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var e=-1,h=g?g.length:0;c;)c.remove(this),c=++e<h&&g[e]||null;l(k)&&(c=n(k).call(this),c===q&&(a=!0,b=b||(q.e instanceof ea?O(q.e.errors):[q.e])));if(D(d))for(e=-1,h=d.length;++e<h;)c=d[e],null!=c&&\"object\"===typeof c&&(c=n(c.unsubscribe).call(c),c===q&&(a=!0,b=b||[],c=q.e,c instanceof ea?b=b.concat(O(c.errors)):b.push(c)));if(a)throw new ea(b);}};c.prototype.add=\nfunction(a){if(!a||a===c.EMPTY)return c.EMPTY;if(a===this)return this;var b=a;switch(typeof a){case \"function\":b=new c(a);case \"object\":if(b.closed||\"function\"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;\"function\"!==typeof b._addParent&&(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error(\"unrecognized teardown \"+a+\" added to Subscription.\");}(this._subscriptions||(this._subscriptions=[])).push(b);b._addParent(this);return b};c.prototype.remove=function(a){var b=\nthis._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.prototype._addParent=function(a){var b=this._parent,c=this._parents;b&&b!==a?c?-1===c.indexOf(a)&&c.push(a):this._parents=[a]:this._parent=a};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),ca=\"function\"===typeof Symbol&&\"function\"===typeof Symbol.for?Symbol.for(\"rxSubscriber\"):\"@@rxSubscriber\",p=function(c){function a(b,a,g){var f=c.call(this)||this;f.syncErrorValue=null;f.syncErrorThrown=!1;f.syncErrorThrowable=!1;f.isStopped=\n!1;switch(arguments.length){case 0:f.destination=pa;break;case 1:if(!b){f.destination=pa;break}if(\"object\"===typeof b){if(b instanceof p||\"syncErrorThrowable\"in b&&b[ca]){var d=b[ca]();f.syncErrorThrowable=d.syncErrorThrowable;f.destination=d;d.add(f)}else f.syncErrorThrowable=!0,f.destination=new qb(f,b);break}default:f.syncErrorThrowable=!0,f.destination=new qb(f,b,a,g)}return f}d(a,c);a.prototype[ca]=function(){return this};a.create=function(b,c,g){b=new a(b,c,g);b.syncErrorThrowable=!1;return b};\na.prototype.next=function(b){this.isStopped||this._next(b)};a.prototype.error=function(b){this.isStopped||(this.isStopped=!0,this._error(b))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,c.prototype.unsubscribe.call(this))};a.prototype._next=function(b){this.destination.next(b)};a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();\nthis.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=b;this._parents=a;return this};return a}(w),qb=function(c){function a(b,a,g,k){var f=c.call(this)||this;f._parentSubscriber=b;var d;b=f;l(a)?d=a:a&&(d=a.next,g=a.error,k=a.complete,a!==pa&&(b=Object.create(a),l(b.unsubscribe)&&f.add(b.unsubscribe.bind(b)),b.unsubscribe=f.unsubscribe.bind(f)));f._context=b;\nf._next=d;f._error=g;f._complete=k;return f}d(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber;H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,this._next,b)&&this.unsubscribe():this.__tryOrUnsub(this._next,b)}};a.prototype.error=function(b){if(!this.isStopped){var a=this._parentSubscriber,c=H.useDeprecatedSynchronousErrorHandling;if(this._error)c&&a.syncErrorThrowable?this.__tryOrSetError(a,this._error,b):this.__tryOrUnsub(this._error,\nb),this.unsubscribe();else if(a.syncErrorThrowable)c?(a.syncErrorValue=b,a.syncErrorThrown=!0):h(b),this.unsubscribe();else{this.unsubscribe();if(c)throw b;h(b)}}};a.prototype.complete=function(){var b=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var c=function(){return b._complete.call(b._context)};H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,c):this.__tryOrUnsub(c)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(b,a){try{b.call(this._context,\na)}catch(g){this.unsubscribe();if(H.useDeprecatedSynchronousErrorHandling)throw g;h(g)}};a.prototype.__tryOrSetError=function(b,a,c){if(!H.useDeprecatedSynchronousErrorHandling)throw Error(\"bad call\");try{a.call(this._context,c)}catch(k){return H.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=k,b.syncErrorThrown=!0):h(k),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber;this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(p),Z=\"function\"===typeof Symbol&&\nSymbol.observable||\"@@observable\",r=function(){function c(a){this._isScalar=!1;a&&(this._subscribe=a)}c.prototype.lift=function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe=function(a,b,c){var f=this.operator;a:{if(a){if(a instanceof p)break a;if(a[ca]){a=a[ca]();break a}}a=a||b||c?new p(a,b,c):new p(pa)}f?f.call(a,this.source):a.add(this.source||!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&\n(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};c.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(b){H.useDeprecatedSynchronousErrorHandling&&(a.syncErrorThrown=!0,a.syncErrorValue=b),a.error(b)}};c.prototype.forEach=function(a,b){var c=this;b=Ka(b);return new b(function(b,f){var g;g=c.subscribe(function(b){try{a(b)}catch(S){f(S),g&&g.unsubscribe()}},f,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[Z]=\nfunction(){return this};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:P(a)(this)};c.prototype.toPromise=function(a){var b=this;a=Ka(a);return new a(function(a,c){var f;b.subscribe(function(b){return f=b},function(b){return c(b)},function(){return a(f)})})};c.create=function(a){return new c(a)};return c}(),N=function(c){function a(){var b=c.call(this,\"object unsubscribed\")||this;b.name=\"ObjectUnsubscribedError\";Object.setPrototypeOf(b,\na.prototype);return b}d(a,c);return a}(Error),rb=function(c){function a(b,a){var f=c.call(this)||this;f.subject=b;f.subscriber=a;f.closed=!1;return f}d(a,c);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b,1))}};return a}(w),sb=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}d(a,c);return a}(p),z=function(c){function a(){var b=\nc.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}d(a,c);a.prototype[ca]=function(){return new sb(this)};a.prototype.lift=function(b){var a=new Da(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new N;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),k=0;k<c;k++)a[k].next(b)};a.prototype.error=function(b){if(this.closed)throw new N;this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=\nthis.observers,c=a.length,a=a.slice(),k=0;k<c;k++)a[k].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new N;this.isStopped=!0;for(var b=this.observers,a=b.length,b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(b){if(this.closed)throw new N;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new N;\nif(this.hasError)return b.error(this.thrownError),w.EMPTY;if(this.isStopped)return b.complete(),w.EMPTY;this.observers.push(b);return new rb(this,b)};a.prototype.asObservable=function(){var b=new r;b.source=this;return b};a.create=function(b,a){return new Da(b,a)};return a}(r),Da=function(c){function a(b,a){var f=c.call(this)||this;f.destination=b;f.source=a;return f}d(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&a.next(b)};a.prototype.error=function(b){var a=this.destination;\na&&a.error&&this.destination.error(b)};a.prototype.complete=function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe=function(b){return this.source?this.source.subscribe(b):w.EMPTY};return a}(z),Nb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Mc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),Mc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=\na;return b}d(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a}(p),tb=function(c){function a(b,a){var f=c.call(this)||this;f.source=b;f.subjectFactory=a;f._refCount=0;f._isComplete=!1;return f}d(a,c);a.prototype._subscribe=function(b){return this.getSubject().subscribe(b)};\na.prototype.getSubject=function(){var b=this._subject;if(!b||b.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var b=this._connection;b||(this._isComplete=!1,b=this._connection=new w,b.add(this.source.subscribe(new Nc(this.getSubject(),this))),b.closed?(this._connection=null,b=w.EMPTY):this._connection=b);return b};a.prototype.refCount=function(){return la()(this)};return a}(r),ia=tb.prototype,sc={operator:{value:null},_refCount:{value:0,writable:!0},\n_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ia._subscribe},_isComplete:{value:ia._isComplete,writable:!0},getSubject:{value:ia.getSubject},connect:{value:ia.connect},refCount:{value:ia.refCount}},Nc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._error=function(b){this._unsubscribe();c.prototype._error.call(this,b)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();c.prototype._complete.call(this)};\na.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._connection;b._refCount=0;b._subject=null;b._connection=null;a&&a.unsubscribe()}};return a}(sb);(function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,\n!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a})(p);var Pc=function(){function c(a,b,c,g){this.keySelector=a;this.elementSelector=b;this.durationSelector=c;this.subjectSelector=g}c.prototype.call=function(a,b){return b.subscribe(new Oc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Oc=function(c){function a(b,a,g,k,d){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=g;b.durationSelector=k;b.subjectSelector=d;b.groups=\nnull;b.attemptedToUnsubscribe=!1;b.count=0;return b}d(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(g){this.error(g);return}this._group(b,a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var f=c.get(a),d;if(this.elementSelector)try{d=this.elementSelector(b)}catch(wa){this.error(wa)}else d=b;if(!f&&(f=this.subjectSelector?this.subjectSelector():new z,c.set(a,f),b=new Ea(a,f,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=\nthis.durationSelector(new Ea(a,f))}catch(wa){this.error(wa);return}this.add(b.subscribe(new Qc(a,f,this)))}f.closed||f.next(d)};a.prototype._error=function(b){var a=this.groups;a&&(a.forEach(function(a,c){a.error(b)}),a.clear());this.destination.error(b)};a.prototype._complete=function(){var b=this.groups;b&&(b.forEach(function(b,a){b.complete()}),b.clear());this.destination.complete()};a.prototype.removeGroup=function(b){this.groups.delete(b)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=\n!0,0===this.count&&c.prototype.unsubscribe.call(this))};return a}(p),Qc=function(c){function a(b,a,g){var f=c.call(this,a)||this;f.key=b;f.group=a;f.parent=g;return f}d(a,c);a.prototype._next=function(b){this.complete()};a.prototype._unsubscribe=function(){var b=this.parent,a=this.key;this.key=this.parent=null;b&&b.removeGroup(a)};return a}(p),Ea=function(c){function a(b,a,g){var f=c.call(this)||this;f.key=b;f.groupSubject=a;f.refCountSubscription=g;return f}d(a,c);a.prototype._subscribe=function(b){var a=\nnew w,c=this.refCountSubscription,k=this.groupSubject;c&&!c.closed&&a.add(new Rc(c));a.add(k.subscribe(b));return a};return a}(r),Rc=function(c){function a(b){var a=c.call(this)||this;a.parent=b;b.count++;return a}d(a,c);a.prototype.unsubscribe=function(){var b=this.parent;b.closed||this.closed||(c.prototype.unsubscribe.call(this),--b.count,0===b.count&&b.attemptedToUnsubscribe&&b.unsubscribe())};return a}(w),ub=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}d(a,c);Object.defineProperty(a.prototype,\n\"value\",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(b){var a=c.prototype._subscribe.call(this,b);a&&!a.closed&&b.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new N;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,this._value=b)};return a}(z),ja=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;f.pending=!1;\nreturn f}d(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(this.closed)return this;this.state=b;b=this.id;var c=this.scheduler;null!=b&&(this.id=this.recycleAsyncId(c,b,a));this.pending=!0;this.delay=a;this.id=this.id||this.requestAsyncId(c,this.id,a);return this};a.prototype.requestAsyncId=function(b,a,c){void 0===c&&(c=0);return setInterval(b.flush.bind(b,this),c)};a.prototype.recycleAsyncId=function(b,a,c){void 0===c&&(c=0);return null!==c&&this.delay===c&&!1===this.pending?a:(clearInterval(a),\nvoid 0)};a.prototype.execute=function(b,a){if(this.closed)return Error(\"executing a cancelled action\");this.pending=!1;if(b=this._execute(b,a))return b;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(b,a){a=!1;var c=void 0;try{this.work(b)}catch(k){a=!0,c=!!k&&k||Error(k)}if(a)return this.unsubscribe(),c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,k=c.indexOf(this);this.state=this.work=\nnull;this.pending=!1;this.scheduler=null;-1!==k&&c.splice(k,1);null!=b&&(this.id=this.recycleAsyncId(a,b,null));this.delay=null};return a}(function(c){function a(b,a){return c.call(this)||this}d(a,c);a.prototype.schedule=function(b,a){return this};return a}(w)),Sc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;return f}d(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(0<a)return c.prototype.schedule.call(this,b,a);this.delay=a;this.state=b;this.scheduler.flush(this);\nreturn this};a.prototype.execute=function(b,a){return 0<a||this.closed?c.prototype.execute.call(this,b,a):this._execute(b,a)};a.prototype.requestAsyncId=function(b,a,g){void 0===g&&(g=0);return null!==g&&0<g||null===g&&0<this.delay?c.prototype.requestAsyncId.call(this,b,a,g):b.flush(this)};return a}(ja),Fa=function(){function c(a,b){void 0===b&&(b=c.now);this.SchedulerAction=a;this.now=b}c.prototype.schedule=function(a,b,c){void 0===b&&(b=0);return(new this.SchedulerAction(this,a)).schedule(c,b)};\nc.now=Date.now?Date.now:function(){return+new Date};return c}(),X=function(c){function a(b,f){void 0===f&&(f=Fa.now);var g=c.call(this,b,function(){return a.delegate&&a.delegate!==g?a.delegate.now():f()})||this;g.actions=[];g.active=!1;g.scheduled=void 0;return g}d(a,c);a.prototype.schedule=function(b,f,g){void 0===f&&(f=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(b,f,g):c.prototype.schedule.call(this,b,f,g)};a.prototype.flush=function(b){var a=this.actions;if(this.active)a.push(b);\nelse{var c;this.active=!0;do if(c=b.execute(b.state,b.delay))break;while(b=a.shift());this.active=!1;if(c){for(;b=a.shift();)b.unsubscribe();throw c;}}};return a}(Fa),vb=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}d(a,c);return a}(X))(Sc),Q=new r(function(c){return c.complete()}),Ma=function(c){return function(a){for(var b=0,f=c.length;b<f&&!a.closed;b++)a.next(c[b]);a.closed||a.complete()}},A=function(){function c(a,b,c){this.kind=a;this.value=b;this.error=c;this.hasValue=\n\"N\"===a}c.prototype.observe=function(a){switch(this.kind){case \"N\":return a.next&&a.next(this.value);case \"E\":return a.error&&a.error(this.error);case \"C\":return a.complete&&a.complete()}};c.prototype.do=function(a,b,c){switch(this.kind){case \"N\":return a&&a(this.value);case \"E\":return b&&b(this.error);case \"C\":return c&&c()}};c.prototype.accept=function(a,b,c){return a&&\"function\"===typeof a.next?this.observe(a):this.do(a,b,c)};c.prototype.toObservable=function(){switch(this.kind){case \"N\":return ua(this.value);\ncase \"E\":return va(this.error);case \"C\":return I()}throw Error(\"unexpected notification kind value\");};c.createNext=function(a){return\"undefined\"!==typeof a?new c(\"N\",a):c.undefinedValueNotification};c.createError=function(a){return new c(\"E\",void 0,a)};c.createComplete=function(){return c.completeNotification};c.completeNotification=new c(\"C\");c.undefinedValueNotification=new c(\"N\",void 0);return c}(),Tc=function(){function c(a,b){void 0===b&&(b=0);this.scheduler=a;this.delay=b}c.prototype.call=\nfunction(a,b){return b.subscribe(new wb(a,this.scheduler,this.delay))};return c}(),wb=function(c){function a(b,a,g){void 0===g&&(g=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=g;return b}d(a,c);a.dispatch=function(b){b.notification.observe(b.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(b){this.add(this.scheduler.schedule(a.dispatch,this.delay,new Uc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(A.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(A.createError(b))};\na.prototype._complete=function(){this.scheduleMessage(A.createComplete())};return a}(p),Uc=function(){return function(c,a){this.notification=c;this.destination=a}}(),V=function(c){function a(b,a,g){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var f=c.call(this)||this;f.scheduler=g;f._events=[];f._infiniteTimeWindow=!1;f._bufferSize=1>b?1:b;f._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(f._infiniteTimeWindow=!0,f.next=f.nextInfiniteTimeWindow):f.next=f.nextTimeWindow;\nreturn f}d(a,c);a.prototype.nextInfiniteTimeWindow=function(b){var a=this._events;a.push(b);a.length>this._bufferSize&&a.shift();c.prototype.next.call(this,b)};a.prototype.nextTimeWindow=function(b){this._events.push(new Vc(this._getNow(),b));this._trimBufferThenGetEvents();c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),k=this.scheduler,d=c.length,e;if(this.closed)throw new N;this.isStopped||this.hasError?\ne=w.EMPTY:(this.observers.push(b),e=new rb(this,b));k&&b.add(b=new wb(b,k));if(a)for(a=0;a<d&&!b.closed;a++)b.next(c[a]);else for(a=0;a<d&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return e};a.prototype._getNow=function(){return(this.scheduler||vb).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,k=this._events,d=k.length,e=0;e<d&&!(b-k[e].time<c);)e++;d>a&&(e=Math.max(e,\nd-a));0<e&&k.splice(0,e);return k};return a}(z),Vc=function(){return function(c,a){this.time=c;this.value=a}}(),Y=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}d(a,c);a.prototype._subscribe=function(b){return this.hasError?(b.error(this.thrownError),w.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),w.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value=\nb,this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(z),Wc=1,Ga={},xb={setImmediate:function(c){var a=Wc++;Ga[a]=c;Promise.resolve().then(function(){var b=Ga[a];b&&b()});return a},clearImmediate:function(c){delete Ga[c]}},Xc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;\nreturn f}d(a,c);a.prototype.requestAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==g&&0<g)return c.prototype.requestAsyncId.call(this,b,a,g);b.actions.push(this);return b.scheduled||(b.scheduled=xb.setImmediate(b.flush.bind(b,null)))};a.prototype.recycleAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==g&&0<g||null===g&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,g);0===b.actions.length&&(xb.clearImmediate(a),b.scheduled=void 0)};return a}(ja),qa=new (function(c){function a(){return null!==\nc&&c.apply(this,arguments)||this}d(a,c);a.prototype.flush=function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,k=-1,d=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++k<d&&(b=a.shift()));this.active=!1;if(c){for(;++k<d&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(X))(Xc),C=new X(ja),Yc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;return f}d(a,c);a.prototype.requestAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==\ng&&0<g)return c.prototype.requestAsyncId.call(this,b,a,g);b.actions.push(this);return b.scheduled||(b.scheduled=requestAnimationFrame(function(){return b.flush(null)}))};a.prototype.recycleAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==g&&0<g||null===g&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,g);0===b.actions.length&&(cancelAnimationFrame(a),b.scheduled=void 0)};return a}(ja),Zc=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}d(a,c);a.prototype.flush=\nfunction(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,k=-1,d=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++k<d&&(b=a.shift()));this.active=!1;if(c){for(;++k<d&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(X))(Yc),yb=function(c){function a(b,a){void 0===b&&(b=Ha);void 0===a&&(a=Number.POSITIVE_INFINITY);var f=c.call(this,b,function(){return f.frame})||this;f.maxFrames=a;f.frame=0;f.index=-1;return f}d(a,c);a.prototype.flush=function(){for(var b=this.actions,\na=this.maxFrames,c,k;(k=b.shift())&&(this.frame=k.delay)<=a&&!(c=k.execute(k.state,k.delay)););if(c){for(;k=b.shift();)k.unsubscribe();throw c;}};a.frameTimeFactor=10;return a}(X),Ha=function(c){function a(b,a,g){void 0===g&&(g=b.index+=1);var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;f.index=g;f.active=!0;f.index=b.index=g;return f}d(a,c);a.prototype.schedule=function(b,f){void 0===f&&(f=0);if(!this.id)return c.prototype.schedule.call(this,b,f);this.active=!1;var g=new a(this.scheduler,this.work);\nthis.add(g);return g.schedule(b,f)};a.prototype.requestAsyncId=function(b,c,g){void 0===g&&(g=0);this.delay=b.frame+g;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(b,a,c){};a.prototype._execute=function(b,a){if(!0===this.active)return c.prototype._execute.call(this,b,a)};a.sortActions=function(b,a){return b.delay===a.delay?b.index===a.index?0:b.index>a.index?1:-1:b.delay>a.delay?1:-1};return a}(ja),da=function(c){function a(){var b=c.call(this,\"argument out of range\")||\nthis;b.name=\"ArgumentOutOfRangeError\";Object.setPrototypeOf(b,a.prototype);return b}d(a,c);return a}(Error),ga=function(c){function a(){var b=c.call(this,\"no elements in sequence\")||this;b.name=\"EmptyError\";Object.setPrototypeOf(b,a.prototype);return b}d(a,c);return a}(Error),zb=function(c){function a(){var b=c.call(this,\"Timeout has occurred\")||this;b.name=\"TimeoutError\";Object.setPrototypeOf(b,a.prototype);return b}d(a,c);return a}(Error),Pb=function(){function c(a,b){this.project=a;this.thisArg=\nb}c.prototype.call=function(a,b){return b.subscribe(new $c(a,this.project,this.thisArg))};return c}(),$c=function(c){function a(b,a,g){b=c.call(this,b)||this;b.project=a;b.count=0;b.thisArg=g||b;return b}d(a,c);a.prototype._next=function(b){var a;try{a=this.project.call(this.thisArg,b,this.count++)}catch(g){this.destination.error(g);return}this.destination.next(a)};return a}(p),v=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}d(a,c);a.prototype.notifyNext=function(b,a,c,k,\nd){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(p),Ub=function(c){function a(b,a,g){var f=c.call(this)||this;f.parent=b;f.outerValue=a;f.outerIndex=g;f.index=0;return f}d(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,b,this.outerIndex,this.index++,this)};a.prototype._error=function(b){this.parent.notifyError(b,this);this.unsubscribe()};a.prototype._complete=\nfunction(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(p),Sa=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,h);return a}},K;K=\"function\"===typeof Symbol&&Symbol.iterator?Symbol.iterator:\"@@iterator\";var Ta=function(c){return function(a){var b=c[K]();do{var f=b.next();if(f.done){a.complete();break}a.next(f.value);if(a.closed)break}while(1);\"function\"===typeof b.return&&a.add(function(){b.return&&b.return()});\nreturn a}},Ua=function(c){return function(a){var b=c[Z]();if(\"function\"!==typeof b.subscribe)throw new TypeError(\"Provided object does not correctly implement Symbol.observable\");return b.subscribe(a)}},Va=function(c){return c&&\"number\"===typeof c.length&&\"function\"!==typeof c},Ra=function(c){if(c instanceof r)return function(a){if(c._isScalar)a.next(c.value),a.complete();else return c.subscribe(a)};if(Va(c))return Ma(c);if(Qa(c))return Sa(c);if(c&&\"function\"===typeof c[K])return Ta(c);if(c&&\"function\"===\ntypeof c[Z])return Ua(c);throw new TypeError(\"You provided \"+(null!=c&&\"object\"===typeof c?\"an invalid object\":\"'\"+c+\"'\")+\" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.\");},Ab={},Ia=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new ad(a,this.resultSelector))};return c}(),ad=function(c){function a(b,a){b=c.call(this,b)||this;b.resultSelector=a;b.active=0;b.values=[];b.observables=[];return b}d(a,c);a.prototype._next=\nfunction(b){this.values.push(Ab);this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;c<a;c++){var k=b[c];this.add(u(this,k,k,c))}}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,k,d){b=this.values;k=b[c];k=this.toRespond?k===Ab?--this.toRespond:this.toRespond:0;b[c]=a;0===k&&(this.resultSelector?this._tryResultSelector(b):\nthis.destination.next(b.slice()))};a.prototype._tryResultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(g){this.destination.error(g);return}this.destination.next(a)};return a}(v),Yb=function(){function c(a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.concurrent=b}c.prototype.call=function(a,b){return b.subscribe(new bd(a,this.project,this.concurrent))};return c}(),bd=function(c){function a(b,a,g){void 0===g&&(g=Number.POSITIVE_INFINITY);b=c.call(this,b)||\nthis;b.project=a;b.concurrent=g;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}d(a,c);a.prototype._next=function(b){this.active<this.concurrent?this._tryNext(b):this.buffer.push(b)};a.prototype._tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(k){this.destination.error(k);return}this.active++;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){this.add(u(this,b,a,c))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&\nthis.destination.complete()};a.prototype.notifyNext=function(b,a,c,d,e){this.destination.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(v),Zb=function(c){function a(b,a){b=c.call(this,b)||this;b.sources=a;b.completed=0;b.haveValues=0;var f=a.length;b.values=Array(f);for(var d=0;d<f;d++){var e=u(b,a[d],null,d);e&&b.add(e)}return b}d(a,c);a.prototype.notifyNext=\nfunction(b,a,c,d,e){this.values[c]=a;e._hasValue||(e._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(b){var a=this.destination,c=this.haveValues,d=this.values,e=d.length;b._hasValue?(this.completed++,this.completed===e&&(c===e&&a.next(d),a.complete())):a.complete()};return a}(v),Bb=new r(m),cc=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new cd(a))};return c}(),cd=function(c){function a(b){b=c.call(this,b)||this;b.hasFirst=!1;b.observables=[];b.subscriptions=\n[];return b}d(a,c);a.prototype._next=function(b){this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{for(var c=0;c<a&&!this.hasFirst;c++){var d=b[c],d=u(this,d,d,c);this.subscriptions&&this.subscriptions.push(d);this.add(d)}this.observables=null}};a.prototype.notifyNext=function(b,a,c,d,e){if(!this.hasFirst){this.hasFirst=!0;for(b=0;b<this.subscriptions.length;b++)b!==c&&(d=this.subscriptions[b],d.unsubscribe(),this.remove(d));\nthis.subscriptions=null}this.destination.next(a)};return a}(v),eb=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new dd(a,this.resultSelector))};return c}(),dd=function(c){function a(b,a,g){void 0===g&&(g=Object.create(null));b=c.call(this,b)||this;b.iterators=[];b.active=0;b.resultSelector=\"function\"===typeof a?a:null;b.values=g;return b}d(a,c);a.prototype._next=function(b){var a=this.iterators;D(b)?a.push(new ed(b)):\"function\"===typeof b[K]?a.push(new fd(b[K]())):\na.push(new gd(this.destination,this,b))};a.prototype._complete=function(){var b=this.iterators,a=b.length;if(0===a)this.destination.complete();else{this.active=a;for(var c=0;c<a;c++){var d=b[c];d.stillUnsubscribed?this.add(d.subscribe(d,c)):this.active--}}};a.prototype.notifyInactive=function(){this.active--;0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var b=this.iterators,a=b.length,c=this.destination,d=0;d<a;d++){var e=b[d];if(\"function\"===typeof e.hasValue&&\n!e.hasValue())return}for(var h=!1,l=[],d=0;d<a;d++){var e=b[d],n=e.next();e.hasCompleted()&&(h=!0);if(n.done){c.complete();return}l.push(n.value)}this.resultSelector?this._tryresultSelector(l):c.next(l);h&&c.complete()};a.prototype._tryresultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(g){this.destination.error(g);return}this.destination.next(a)};return a}(p),fd=function(){function c(a){this.iterator=a;this.nextResult=a.next()}c.prototype.hasValue=function(){return!0};\nc.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};c.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return c}(),ed=function(){function c(a){this.array=a;this.length=this.index=0;this.length=a.length}c.prototype[K]=function(){return this};c.prototype.next=function(a){a=this.index++;var b=this.array;return a<this.length?{value:b[a],done:!1}:{value:null,done:!0}};c.prototype.hasValue=function(){return this.array.length>this.index};\nc.prototype.hasCompleted=function(){return this.array.length===this.index};return c}(),gd=function(c){function a(b,a,g){b=c.call(this,b)||this;b.parent=a;b.observable=g;b.stillUnsubscribed=!0;b.buffer=[];b.isComplete=!1;return b}d(a,c);a.prototype[K]=function(){return this};a.prototype.next=function(){var b=this.buffer;return 0===b.length&&this.isComplete?{value:null,done:!0}:{value:b.shift(),done:!1}};a.prototype.hasValue=function(){return 0<this.buffer.length};a.prototype.hasCompleted=function(){return 0===\nthis.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(b,a,c,d,e){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(b,a){return u(this,this.observable,this,a)};return a}(v),fc=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a,b){return b.subscribe(new hd(a,this.durationSelector))};return c}(),\nhd=function(c){function a(b,a){b=c.call(this,b)||this;b.durationSelector=a;b.hasValue=!1;return b}d(a,c);a.prototype._next=function(b){this.value=b;this.hasValue=!0;this.throttled||(b=n(this.durationSelector)(b),b===q?this.destination.error(q.e):(b=u(this,b),!b||b.closed?this.clearThrottle():this.add(this.throttled=b)))};a.prototype.clearThrottle=function(){var b=this.value,a=this.hasValue,c=this.throttled;c&&(this.remove(c),this.throttled=null,c.unsubscribe());a&&(this.value=null,this.hasValue=!1,\nthis.destination.next(b))};a.prototype.notifyNext=function(b,a,c,d){this.clearThrottle()};a.prototype.notifyComplete=function(){this.clearThrottle()};return a}(v),jd=function(){function c(a){this.closingNotifier=a}c.prototype.call=function(a,b){return b.subscribe(new id(a,this.closingNotifier))};return c}(),id=function(c){function a(b,a){b=c.call(this,b)||this;b.buffer=[];b.add(u(b,a));return b}d(a,c);a.prototype._next=function(b){this.buffer.push(b)};a.prototype.notifyNext=function(b,a,c,d,e){b=\nthis.buffer;this.buffer=[];this.destination.next(b)};return a}(v),md=function(){function c(a,b){this.bufferSize=a;this.subscriberClass=(this.startBufferEvery=b)&&a!==b?kd:ld}c.prototype.call=function(a,b){return b.subscribe(new this.subscriberClass(a,this.bufferSize,this.startBufferEvery))};return c}(),ld=function(c){function a(b,a){b=c.call(this,b)||this;b.bufferSize=a;b.buffer=[];return b}d(a,c);a.prototype._next=function(b){var a=this.buffer;a.push(b);a.length==this.bufferSize&&(this.destination.next(a),\nthis.buffer=[])};a.prototype._complete=function(){var b=this.buffer;0<b.length&&this.destination.next(b);c.prototype._complete.call(this)};return a}(p),kd=function(c){function a(b,a,g){b=c.call(this,b)||this;b.bufferSize=a;b.startBufferEvery=g;b.buffers=[];b.count=0;return b}d(a,c);a.prototype._next=function(b){var a=this.bufferSize,c=this.startBufferEvery,d=this.buffers,e=this.count;this.count++;0===e%c&&d.push([]);for(c=d.length;c--;)e=d[c],e.push(b),e.length===a&&(d.splice(c,1),this.destination.next(e))};\na.prototype._complete=function(){for(var b=this.buffers,a=this.destination;0<b.length;){var g=b.shift();0<g.length&&a.next(g)}c.prototype._complete.call(this)};return a}(p),od=function(){function c(a,b,c,g){this.bufferTimeSpan=a;this.bufferCreationInterval=b;this.maxBufferSize=c;this.scheduler=g}c.prototype.call=function(a,b){return b.subscribe(new nd(a,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))};return c}(),pd=function(){return function(){this.buffer=[]}}(),\nnd=function(c){function a(b,a,g,d,e){b=c.call(this,b)||this;b.bufferTimeSpan=a;b.bufferCreationInterval=g;b.maxBufferSize=d;b.scheduler=e;b.contexts=[];d=b.openContext();b.timespanOnly=null==g||0>g;if(b.timespanOnly)b.add(d.closeAction=e.schedule(gb,a,{subscriber:b,context:d,bufferTimeSpan:a}));else{var f={bufferTimeSpan:a,bufferCreationInterval:g,subscriber:b,scheduler:e};b.add(d.closeAction=e.schedule(hb,a,{subscriber:b,context:d}));b.add(e.schedule(gc,g,f))}return b}d(a,c);a.prototype._next=function(b){for(var a=\nthis.contexts,c=a.length,d,e=0;e<c;e++){var h=a[e],l=h.buffer;l.push(b);l.length==this.maxBufferSize&&(d=h)}if(d)this.onBufferFull(d)};a.prototype._error=function(b){this.contexts.length=0;c.prototype._error.call(this,b)};a.prototype._complete=function(){for(var b=this.contexts,a=this.destination;0<b.length;){var g=b.shift();a.next(g.buffer)}c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.contexts=null};a.prototype.onBufferFull=function(b){this.closeContext(b);b=b.closeAction;\nb.unsubscribe();this.remove(b);if(!this.closed&&this.timespanOnly){b=this.openContext();var a=this.bufferTimeSpan;this.add(b.closeAction=this.scheduler.schedule(gb,a,{subscriber:this,context:b,bufferTimeSpan:a}))}};a.prototype.openContext=function(){var b=new pd;this.contexts.push(b);return b};a.prototype.closeContext=function(b){this.destination.next(b.buffer);var a=this.contexts;0<=(a?a.indexOf(b):-1)&&a.splice(a.indexOf(b),1)};return a}(p),rd=function(){function c(a,b){this.openings=a;this.closingSelector=\nb}c.prototype.call=function(a,b){return b.subscribe(new qd(a,this.openings,this.closingSelector))};return c}(),qd=function(c){function a(b,a,g){b=c.call(this,b)||this;b.openings=a;b.closingSelector=g;b.contexts=[];b.add(u(b,a));return b}d(a,c);a.prototype._next=function(b){for(var a=this.contexts,c=a.length,d=0;d<c;d++)a[d].buffer.push(b)};a.prototype._error=function(b){for(var a=this.contexts;0<a.length;){var g=a.shift();g.subscription.unsubscribe();g.buffer=null;g.subscription=null}this.contexts=\nnull;c.prototype._error.call(this,b)};a.prototype._complete=function(){for(var b=this.contexts;0<b.length;){var a=b.shift();this.destination.next(a.buffer);a.subscription.unsubscribe();a.buffer=null;a.subscription=null}this.contexts=null;c.prototype._complete.call(this)};a.prototype.notifyNext=function(b,a,c,d,e){b?this.closeBuffer(b):this.openBuffer(a)};a.prototype.notifyComplete=function(b){this.closeBuffer(b.context)};a.prototype.openBuffer=function(b){try{var a=this.closingSelector.call(this,\nb);a&&this.trySubscribe(a)}catch(g){this._error(g)}};a.prototype.closeBuffer=function(b){var a=this.contexts;if(a&&b){var c=b.subscription;this.destination.next(b.buffer);a.splice(a.indexOf(b),1);this.remove(c);c.unsubscribe()}};a.prototype.trySubscribe=function(b){var a=this.contexts,c=new w,d={buffer:[],subscription:c};a.push(d);b=u(this,b,d);!b||b.closed?this.closeBuffer(d):(b.context=d,this.add(b),c.add(b))};return a}(v),td=function(){function c(a){this.closingSelector=a}c.prototype.call=function(a,\nb){return b.subscribe(new sd(a,this.closingSelector))};return c}(),sd=function(c){function a(b,a){b=c.call(this,b)||this;b.closingSelector=a;b.subscribing=!1;b.openBuffer();return b}d(a,c);a.prototype._next=function(b){this.buffer.push(b)};a.prototype._complete=function(){var b=this.buffer;b&&this.destination.next(b);c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.buffer=null;this.subscribing=!1};a.prototype.notifyNext=function(b,a,c,d,e){this.openBuffer()};a.prototype.notifyComplete=\nfunction(){this.subscribing?this.complete():this.openBuffer()};a.prototype.openBuffer=function(){var b=this.closingSubscription;b&&(this.remove(b),b.unsubscribe());(b=this.buffer)&&this.destination.next(b);this.buffer=[];var a=n(this.closingSelector)();a===q?this.error(q.e):(this.closingSubscription=b=new w,this.add(b),this.subscribing=!0,b.add(u(this,a)),this.subscribing=!1)};return a}(v),vd=function(){function c(a){this.selector=a}c.prototype.call=function(a,b){return b.subscribe(new ud(a,this.selector,\nthis.caught))};return c}(),ud=function(c){function a(b,a,g){b=c.call(this,b)||this;b.selector=a;b.caught=g;return b}d(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=void 0;try{a=this.selector(b,this.caught)}catch(g){c.prototype.error.call(this,g);return}this._unsubscribeAndRecycle();this.add(u(this,a))}};return a}(v),xd=function(){function c(a,b){this.predicate=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new wd(a,this.predicate,this.source))};return c}(),wd=function(c){function a(b,\na,g){b=c.call(this,b)||this;b.predicate=a;b.source=g;b.count=0;b.index=0;return b}d(a,c);a.prototype._next=function(b){this.predicate?this._tryPredicate(b):this.count++};a.prototype._tryPredicate=function(b){var a;try{a=this.predicate(b,this.index++,this.source)}catch(g){this.destination.error(g);return}a&&this.count++};a.prototype._complete=function(){this.destination.next(this.count);this.destination.complete()};return a}(p),zd=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a,\nb){return b.subscribe(new yd(a,this.durationSelector))};return c}(),yd=function(c){function a(b,a){b=c.call(this,b)||this;b.durationSelector=a;b.hasValue=!1;b.durationSubscription=null;return b}d(a,c);a.prototype._next=function(b){try{var a=this.durationSelector.call(this,b);a&&this._tryNext(b,a)}catch(g){this.destination.error(g)}};a.prototype._complete=function(){this.emitValue();this.destination.complete()};a.prototype._tryNext=function(b,a){var c=this.durationSubscription;this.value=b;this.hasValue=\n!0;c&&(c.unsubscribe(),this.remove(c));(c=u(this,a))&&!c.closed&&this.add(this.durationSubscription=c)};a.prototype.notifyNext=function(b,a,c,d,e){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){if(this.hasValue){var b=this.value,a=this.durationSubscription;a&&(this.durationSubscription=null,a.unsubscribe(),this.remove(a));this.value=null;this.hasValue=!1;c.prototype._next.call(this,b)}};return a}(v),Bd=function(){function c(a,b){this.dueTime=\na;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Ad(a,this.dueTime,this.scheduler))};return c}(),Ad=function(c){function a(b,a,g){b=c.call(this,b)||this;b.dueTime=a;b.scheduler=g;b.debouncedSubscription=null;b.lastValue=null;b.hasValue=!1;return b}d(a,c);a.prototype._next=function(b){this.clearDebounce();this.lastValue=b;this.hasValue=!0;this.add(this.debouncedSubscription=this.scheduler.schedule(hc,this.dueTime,this))};a.prototype._complete=function(){this.debouncedNext();\nthis.destination.complete()};a.prototype.debouncedNext=function(){this.clearDebounce();if(this.hasValue){var b=this.lastValue;this.lastValue=null;this.hasValue=!1;this.destination.next(b)}};a.prototype.clearDebounce=function(){var b=this.debouncedSubscription;null!==b&&(this.remove(b),b.unsubscribe(),this.debouncedSubscription=null)};return a}(p),ic=function(){function c(a){this.defaultValue=a}c.prototype.call=function(a,b){return b.subscribe(new Cd(a,this.defaultValue))};return c}(),Cd=function(c){function a(b,\na){b=c.call(this,b)||this;b.defaultValue=a;b.isEmpty=!0;return b}d(a,c);a.prototype._next=function(b){this.isEmpty=!1;this.destination.next(b)};a.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue);this.destination.complete()};return a}(p),Ed=function(){function c(a,b){this.delay=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Dd(a,this.delay,this.scheduler))};return c}(),Dd=function(c){function a(b,a,g){b=c.call(this,b)||this;b.delay=a;b.scheduler=\ng;b.queue=[];b.active=!1;b.errored=!1;return b}d(a,c);a.dispatch=function(b){for(var a=b.source,c=a.queue,d=b.scheduler,e=b.destination;0<c.length&&0>=c[0].time-d.now();)c.shift().notification.observe(e);0<c.length?(a=Math.max(0,c[0].time-d.now()),this.schedule(b,a)):(this.unsubscribe(),a.active=!1)};a.prototype._schedule=function(b){this.active=!0;this.add(b.schedule(a.dispatch,this.delay,{source:this,destination:this.destination,scheduler:b}))};a.prototype.scheduleNotification=function(b){if(!0!==\nthis.errored){var a=this.scheduler;b=new Fd(a.now()+this.delay,b);this.queue.push(b);!1===this.active&&this._schedule(a)}};a.prototype._next=function(b){this.scheduleNotification(A.createNext(b))};a.prototype._error=function(b){this.errored=!0;this.queue=[];this.destination.error(b)};a.prototype._complete=function(){this.scheduleNotification(A.createComplete())};return a}(p),Fd=function(){return function(c,a){this.time=c;this.notification=a}}(),Cb=function(){function c(a){this.delayDurationSelector=\na}c.prototype.call=function(a,b){return b.subscribe(new Gd(a,this.delayDurationSelector))};return c}(),Gd=function(c){function a(b,a){b=c.call(this,b)||this;b.delayDurationSelector=a;b.completed=!1;b.delayNotifierSubscriptions=[];b.values=[];return b}d(a,c);a.prototype.notifyNext=function(b,a,c,d,e){this.destination.next(b);this.removeSubscription(e);this.tryComplete()};a.prototype.notifyError=function(b,a){this._error(b)};a.prototype.notifyComplete=function(b){(b=this.removeSubscription(b))&&this.destination.next(b);\nthis.tryComplete()};a.prototype._next=function(b){try{var a=this.delayDurationSelector(b);a&&this.tryDelay(a,b)}catch(g){this.destination.error(g)}};a.prototype._complete=function(){this.completed=!0;this.tryComplete()};a.prototype.removeSubscription=function(b){b.unsubscribe();b=this.delayNotifierSubscriptions.indexOf(b);var a=null;-1!==b&&(a=this.values[b],this.delayNotifierSubscriptions.splice(b,1),this.values.splice(b,1));return a};a.prototype.tryDelay=function(b,a){(b=u(this,b,a))&&!b.closed&&\n(this.add(b),this.delayNotifierSubscriptions.push(b));this.values.push(a)};a.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()};return a}(v),Id=function(c){function a(b,a){var f=c.call(this)||this;f.source=b;f.subscriptionDelay=a;return f}d(a,c);a.prototype._subscribe=function(b){this.subscriptionDelay.subscribe(new Hd(b,this.source))};return a}(r),Hd=function(c){function a(b,a){var f=c.call(this)||this;f.parent=b;f.source=a;f.sourceSubscribed=\n!1;return f}d(a,c);a.prototype._next=function(b){this.subscribeToSource()};a.prototype._error=function(b){this.unsubscribe();this.parent.error(b)};a.prototype._complete=function(){this.subscribeToSource()};a.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))};return a}(p),Kd=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Jd(a))};return c}(),Jd=function(c){function a(b){return c.call(this,\nb)||this}d(a,c);a.prototype._next=function(b){b.observe(this.destination)};return a}(p),Md=function(){function c(a,b){this.keySelector=a;this.flushes=b}c.prototype.call=function(a,b){return b.subscribe(new Ld(a,this.keySelector,this.flushes))};return c}(),Ld=function(c){function a(b,a,g){b=c.call(this,b)||this;b.keySelector=a;b.values=new Set;g&&b.add(u(b,g));return b}d(a,c);a.prototype.notifyNext=function(b,a,c,d,e){this.values.clear()};a.prototype.notifyError=function(b,a){this._error(b)};a.prototype._next=\nfunction(b){this.keySelector?this._useKeySelector(b):this._finalizeNext(b,b)};a.prototype._useKeySelector=function(b){var a,c=this.destination;try{a=this.keySelector(b)}catch(k){c.error(k);return}this._finalizeNext(a,b)};a.prototype._finalizeNext=function(b,a){var c=this.values;c.has(b)||(c.add(b),this.destination.next(a))};return a}(v),jc=function(){function c(a,b){this.compare=a;this.keySelector=b}c.prototype.call=function(a,b){return b.subscribe(new Nd(a,this.compare,this.keySelector))};return c}(),\nNd=function(c){function a(b,a,g){b=c.call(this,b)||this;b.keySelector=g;b.hasKey=!1;\"function\"===typeof a&&(b.compare=a);return b}d(a,c);a.prototype.compare=function(b,a){return b===a};a.prototype._next=function(b){var a=b;if(this.keySelector&&(a=n(this.keySelector)(b),a===q))return this.destination.error(q.e);var c=!1;if(this.hasKey){if(c=n(this.compare)(this.key,a),c===q)return this.destination.error(q.e)}else this.hasKey=!0;!1===!!c&&(this.key=a,this.destination.next(b))};return a}(p),kc=function(){function c(a,\nb){this.predicate=a;this.thisArg=b}c.prototype.call=function(a,b){return b.subscribe(new Od(a,this.predicate,this.thisArg))};return c}(),Od=function(c){function a(b,a,g){b=c.call(this,b)||this;b.predicate=a;b.thisArg=g;b.count=0;return b}d(a,c);a.prototype._next=function(b){var a;try{a=this.predicate.call(this.thisArg,b,this.count++)}catch(g){this.destination.error(g);return}a&&this.destination.next(b)};return a}(p),lc=function(){function c(a,b,c){this.nextOrObserver=a;this.error=b;this.complete=\nc}c.prototype.call=function(a,b){return b.subscribe(new Pd(a,this.nextOrObserver,this.error,this.complete))};return c}(),Pd=function(c){function a(b,a,g,d){b=c.call(this,b)||this;b._tapNext=m;b._tapError=m;b._tapComplete=m;b._tapError=g||m;b._tapComplete=d||m;l(a)?(b._context=b,b._tapNext=a):a&&(b._context=a,b._tapNext=a.next||m,b._tapError=a.error||m,b._tapComplete=a.complete||m);return b}d(a,c);a.prototype._next=function(b){try{this._tapNext.call(this._context,b)}catch(f){this.destination.error(f);\nreturn}this.destination.next(b)};a.prototype._error=function(b){try{this._tapError.call(this._context,b)}catch(f){this.destination.error(f);return}this.destination.error(b)};a.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(b){this.destination.error(b);return}return this.destination.complete()};return a}(p),ra=function(c){void 0===c&&(c=mc);return kb({hasValue:!1,next:function(){this.hasValue=!0},complete:function(){if(!this.hasValue)throw c();}})},nc=function(){function c(a){this.total=\na;if(0>this.total)throw new da;}c.prototype.call=function(a,b){return b.subscribe(new Qd(a,this.total))};return c}(),Qd=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}d(a,c);a.prototype._next=function(b){var a=this.total,c=++this.count;c<=a&&(this.destination.next(b),c===a&&(this.destination.complete(),this.unsubscribe()))};return a}(p),Sd=function(){function c(a,b,c){this.predicate=a;this.thisArg=b;this.source=c}c.prototype.call=function(a,b){return b.subscribe(new Rd(a,\nthis.predicate,this.thisArg,this.source))};return c}(),Rd=function(c){function a(b,a,g,d){b=c.call(this,b)||this;b.predicate=a;b.thisArg=g;b.source=d;b.index=0;b.thisArg=g||b;return b}d(a,c);a.prototype.notifyComplete=function(b){this.destination.next(b);this.destination.complete()};a.prototype._next=function(b){var a=!1;try{a=this.predicate.call(this.thisArg,b,this.index++,this.source)}catch(g){this.destination.error(g);return}a||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};\nreturn a}(p),Ud=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Td(a))};return c}(),Td=function(c){function a(b){b=c.call(this,b)||this;b.hasCompleted=!1;b.hasSubscription=!1;return b}d(a,c);a.prototype._next=function(b){this.hasSubscription||(this.hasSubscription=!0,this.add(u(this,b)))};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(b){this.remove(b);this.hasSubscription=\n!1;this.hasCompleted&&this.destination.complete()};return a}(v),oc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Vd(a,this.project))};return c}(),Vd=function(c){function a(b,a){b=c.call(this,b)||this;b.project=a;b.hasSubscription=!1;b.hasCompleted=!1;b.index=0;return b}d(a,c);a.prototype._next=function(b){this.hasSubscription||this.tryNext(b)};a.prototype.tryNext=function(b){var a=this.index++,c=this.destination;try{var d=this.project(b,a);this.hasSubscription=\n!0;this.add(u(this,d,b,a))}catch(x){c.error(x)}};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyNext=function(b,a,c,d,e){this.destination.next(a)};a.prototype.notifyError=function(b){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.remove(b);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(v),Xd=function(){function c(a,b,c){this.project=a;this.concurrent=b;this.scheduler=\nc}c.prototype.call=function(a,b){return b.subscribe(new Wd(a,this.project,this.concurrent,this.scheduler))};return c}(),Wd=function(c){function a(b,a,g,d){b=c.call(this,b)||this;b.project=a;b.concurrent=g;b.scheduler=d;b.index=0;b.active=0;b.hasCompleted=!1;g<Number.POSITIVE_INFINITY&&(b.buffer=[]);return b}d(a,c);a.dispatch=function(b){b.subscriber.subscribeToProjection(b.result,b.value,b.index)};a.prototype._next=function(b){var c=this.destination;if(c.closed)this._complete();else{var g=this.index++;\nif(this.active<this.concurrent){c.next(b);var d=n(this.project)(b,g);d===q?c.error(q.e):this.scheduler?this.add(this.scheduler.schedule(a.dispatch,0,{subscriber:this,result:d,value:b,index:g})):this.subscribeToProjection(d,b,g)}else this.buffer.push(b)}};a.prototype.subscribeToProjection=function(b,a,c){this.active++;this.add(u(this,b,a,c))};a.prototype._complete=function(){(this.hasCompleted=!0,0===this.active)&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,d,e){this._next(a)};\na.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;a&&0<a.length&&this._next(a.shift());this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(v),Zd=function(){function c(a){this.callback=a}c.prototype.call=function(a,b){return b.subscribe(new Yd(a,this.callback))};return c}(),Yd=function(c){function a(b,a){b=c.call(this,b)||this;b.add(new w(a));return b}d(a,c);return a}(p),Db=function(){function c(a,b,c,g){this.predicate=a;this.source=b;this.yieldIndex=\nc;this.thisArg=g}c.prototype.call=function(a,b){return b.subscribe(new $d(a,this.predicate,this.source,this.yieldIndex,this.thisArg))};return c}(),$d=function(c){function a(b,a,g,d,e){b=c.call(this,b)||this;b.predicate=a;b.source=g;b.yieldIndex=d;b.thisArg=e;b.index=0;return b}d(a,c);a.prototype.notifyComplete=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype._next=function(b){var a=this.predicate,c=this.thisArg,d=this.index++;try{a.call(c||this,b,d,this.source)&&this.notifyComplete(this.yieldIndex?\nd:b)}catch(x){this.destination.error(x)}};a.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)};return a}(p),be=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ae(a))};return c}(),ae=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}d(a,c);a.prototype._next=function(b){};return a}(p),de=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ce(a))};return c}(),ce=function(c){function a(b){return c.call(this,\nb)||this}d(a,c);a.prototype.notifyComplete=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype._next=function(b){this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(p),pc=function(){function c(a){this.total=a;if(0>this.total)throw new da;}c.prototype.call=function(a,b){return b.subscribe(new ee(a,this.total))};return c}(),ee=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.ring=[];b.count=0;return b}d(a,c);a.prototype._next=\nfunction(b){var a=this.ring,c=this.total,d=this.count++;a.length<c?a.push(b):a[d%c]=b};a.prototype._complete=function(){var b=this.destination,a=this.count;if(0<a)for(var c=this.count>=this.total?this.total:this.count,d=this.ring,e=0;e<c;e++){var h=a++%c;b.next(d[h])}b.complete()};return a}(p),ge=function(){function c(a){this.value=a}c.prototype.call=function(a,b){return b.subscribe(new fe(a,this.value))};return c}(),fe=function(c){function a(b,a){b=c.call(this,b)||this;b.value=a;return b}d(a,c);\na.prototype._next=function(b){this.destination.next(this.value)};return a}(p),ie=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new he(a))};return c}(),he=function(c){function a(b){return c.call(this,b)||this}d(a,c);a.prototype._next=function(b){this.destination.next(A.createNext(b))};a.prototype._error=function(b){var a=this.destination;a.next(A.createError(b));a.complete()};a.prototype._complete=function(){var b=this.destination;b.next(A.createComplete());b.complete()};\nreturn a}(p),qc=function(){function c(a,b,c){void 0===c&&(c=!1);this.accumulator=a;this.seed=b;this.hasSeed=c}c.prototype.call=function(a,b){return b.subscribe(new je(a,this.accumulator,this.seed,this.hasSeed))};return c}(),je=function(c){function a(b,a,g,d){b=c.call(this,b)||this;b.accumulator=a;b._seed=g;b.hasSeed=d;b.index=0;return b}d(a,c);Object.defineProperty(a.prototype,\"seed\",{get:function(){return this._seed},set:function(b){this.hasSeed=!0;this._seed=b},enumerable:!0,configurable:!0});a.prototype._next=\nfunction(b){if(this.hasSeed)return this._tryNext(b);this.seed=b;this.destination.next(b)};a.prototype._tryNext=function(b){var a=this.index++,c;try{c=this.accumulator(this.seed,b,a)}catch(k){this.destination.error(k)}this.seed=c;this.destination.next(c)};return a}(p),le=function(){function c(a,b,c){this.accumulator=a;this.seed=b;this.concurrent=c}c.prototype.call=function(a,b){return b.subscribe(new ke(a,this.accumulator,this.seed,this.concurrent))};return c}(),ke=function(c){function a(b,a,g,d){b=\nc.call(this,b)||this;b.accumulator=a;b.acc=g;b.concurrent=d;b.hasValue=!1;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}d(a,c);a.prototype._next=function(b){if(this.active<this.concurrent){var a=this.index++,c=n(this.accumulator)(this.acc,b),d=this.destination;c===q?d.error(q.e):(this.active++,this._innerSub(c,b,a))}else this.buffer.push(b)};a.prototype._innerSub=function(b,a,c){this.add(u(this,b,a,c))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&\n(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())};a.prototype.notifyNext=function(b,a,c,d,e){b=this.destination;this.acc=a;this.hasValue=!0;b.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())};return a}(v),rc=function(){function c(a,b){this.subjectFactory=a;this.selector=\nb}c.prototype.call=function(a,b){var c=this.selector,g=this.subjectFactory();a=c(g).subscribe(a);a.add(b.subscribe(g));return a};return c}(),ne=function(){function c(a){this.nextSources=a}c.prototype.call=function(a,b){return b.subscribe(new me(a,this.nextSources))};return c}(),me=function(c){function a(b,a){var f=c.call(this,b)||this;f.destination=b;f.nextSources=a;return f}d(a,c);a.prototype.notifyError=function(b,a){this.subscribeToNextSource()};a.prototype.notifyComplete=function(b){this.subscribeToNextSource()};\na.prototype._error=function(b){this.subscribeToNextSource()};a.prototype._complete=function(){this.subscribeToNextSource()};a.prototype.subscribeToNextSource=function(){var b=this.nextSources.shift();b?this.add(u(this,b)):this.destination.complete()};return a}(v),pe=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new oe(a))};return c}(),oe=function(c){function a(b){b=c.call(this,b)||this;b.hasPrev=!1;return b}d(a,c);a.prototype._next=function(b){this.hasPrev?this.destination.next([this.prev,\nb]):this.hasPrev=!0;this.prev=b};return a}(p),Eb=function(){function c(a,b){this.count=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new qe(a,this.count,this.source))};return c}(),qe=function(c){function a(b,a,g){b=c.call(this,b)||this;b.count=a;b.source=g;return b}d(a,c);a.prototype.complete=function(){if(!this.isStopped){var b=this.source,a=this.count;if(0===a)return c.prototype.complete.call(this);-1<a&&(this.count=a-1);b.subscribe(this._unsubscribeAndRecycle())}};return a}(p),\nse=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){return b.subscribe(new re(a,this.notifier,b))};return c}(),re=function(c){function a(b,a,g){b=c.call(this,b)||this;b.notifier=a;b.source=g;b.sourceIsBeingSubscribedTo=!0;return b}d(a,c);a.prototype.notifyNext=function(b,a,c,d,e){this.sourceIsBeingSubscribedTo=!0;this.source.subscribe(this)};a.prototype.notifyComplete=function(b){if(!1===this.sourceIsBeingSubscribedTo)return c.prototype.complete.call(this)};a.prototype.complete=\nfunction(){this.sourceIsBeingSubscribedTo=!1;if(!this.isStopped){this.retries||this.subscribeToRetries();if(!this.retriesSubscription||this.retriesSubscription.closed)return c.prototype.complete.call(this);this._unsubscribeAndRecycle();this.notifications.next()}};a.prototype._unsubscribe=function(){var b=this.notifications,a=this.retriesSubscription;b&&(b.unsubscribe(),this.notifications=null);a&&(a.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype._unsubscribeAndRecycle=\nfunction(){var b=this._unsubscribe;this._unsubscribe=null;c.prototype._unsubscribeAndRecycle.call(this);this._unsubscribe=b;return this};a.prototype.subscribeToRetries=function(){this.notifications=new z;var b=n(this.notifier)(this.notifications);if(b===q)return c.prototype.complete.call(this);this.retries=b;this.retriesSubscription=u(this,b)};return a}(v),ue=function(){function c(a,b){this.count=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new te(a,this.count,this.source))};\nreturn c}(),te=function(c){function a(b,a,g){b=c.call(this,b)||this;b.count=a;b.source=g;return b}d(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=this.source,g=this.count;if(0===g)return c.prototype.error.call(this,b);-1<g&&(this.count=g-1);a.subscribe(this._unsubscribeAndRecycle())}};return a}(p),we=function(){function c(a,b){this.notifier=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new ve(a,this.notifier,this.source))};return c}(),ve=function(c){function a(b,\na,g){b=c.call(this,b)||this;b.notifier=a;b.source=g;return b}d(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=this.errors,g=this.retries,d=this.retriesSubscription;if(g)this.retriesSubscription=this.errors=null;else{a=new z;g=n(this.notifier)(a);if(g===q)return c.prototype.error.call(this,q.e);d=u(this,g)}this._unsubscribeAndRecycle();this.errors=a;this.retries=g;this.retriesSubscription=d;a.next(b)}};a.prototype._unsubscribe=function(){var b=this.errors,a=this.retriesSubscription;b&&\n(b.unsubscribe(),this.errors=null);a&&(a.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype.notifyNext=function(b,a,c,d,e){b=this._unsubscribe;this._unsubscribe=null;this._unsubscribeAndRecycle();this._unsubscribe=b;this.source.subscribe(this)};return a}(v),ye=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){a=new xe(a);b=b.subscribe(a);b.add(u(a,this.notifier));return b};return c}(),xe=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||\nthis;b.hasValue=!1;return b}d(a,c);a.prototype._next=function(b){this.value=b;this.hasValue=!0};a.prototype.notifyNext=function(b,a,c,d,e){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))};return a}(v),Ae=function(){function c(a,b){this.period=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new ze(a,this.period,this.scheduler))};return c}(),ze=function(c){function a(b,\na,g){b=c.call(this,b)||this;b.period=a;b.scheduler=g;b.hasValue=!1;b.add(g.schedule(vc,a,{subscriber:b,period:a}));return b}d(a,c);a.prototype._next=function(b){this.lastValue=b;this.hasValue=!0};a.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return a}(p),Ce=function(){function c(a,b){this.compareTo=a;this.comparor=b}c.prototype.call=function(a,b){return b.subscribe(new Be(a,this.compareTo,this.comparor))};return c}(),Be=function(c){function a(b,\na,g){var f=c.call(this,b)||this;f.compareTo=a;f.comparor=g;f._a=[];f._b=[];f._oneComplete=!1;f.add(a.subscribe(new De(b,f)));return f}d(a,c);a.prototype._next=function(b){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(b),this.checkValues())};a.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0};a.prototype.checkValues=function(){for(var b=this._a,a=this._b,c=this.comparor;0<b.length&&0<a.length;){var d=b.shift(),\ne=a.shift();c?(d=n(c)(d,e),d===q&&this.destination.error(q.e)):d=d===e;d||this.emit(!1)}};a.prototype.emit=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype.nextB=function(b){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(b),this.checkValues())};return a}(p),De=function(c){function a(b,a){b=c.call(this,b)||this;b.parent=a;return b}d(a,c);a.prototype._next=function(b){this.parent.nextB(b)};a.prototype._error=function(b){this.parent.error(b)};a.prototype._complete=\nfunction(){this.parent._complete()};return a}(p),Fe=function(){function c(a,b){this.predicate=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new Ee(a,this.predicate,this.source))};return c}(),Ee=function(c){function a(b,a,g){b=c.call(this,b)||this;b.predicate=a;b.source=g;b.seenValue=!1;b.index=0;return b}d(a,c);a.prototype.applySingleValue=function(b){this.seenValue?this.destination.error(\"Sequence contains more than one element\"):(this.seenValue=!0,this.singleValue=b)};a.prototype._next=\nfunction(b){var a=this.index++;this.predicate?this.tryNext(b,a):this.applySingleValue(b)};a.prototype.tryNext=function(b,a){try{this.predicate(b,a,this.source)&&this.applySingleValue(b)}catch(g){this.destination.error(g)}};a.prototype._complete=function(){var b=this.destination;0<this.index?(b.next(this.seenValue?this.singleValue:void 0),b.complete()):b.error(new ga)};return a}(p),He=function(){function c(a){this.total=a}c.prototype.call=function(a,b){return b.subscribe(new Ge(a,this.total))};return c}(),\nGe=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}d(a,c);a.prototype._next=function(b){++this.count>this.total&&this.destination.next(b)};return a}(p),Je=function(){function c(a){this._skipCount=a;if(0>this._skipCount)throw new da;}c.prototype.call=function(a,b){return 0===this._skipCount?b.subscribe(new p(a)):b.subscribe(new Ie(a,this._skipCount))};return c}(),Ie=function(c){function a(b,a){b=c.call(this,b)||this;b._skipCount=a;b._count=0;b._ring=Array(a);return b}\nd(a,c);a.prototype._next=function(b){var a=this._skipCount,c=this._count++;if(c<a)this._ring[c]=b;else{var a=c%a,c=this._ring,d=c[a];c[a]=b;this.destination.next(d)}};return a}(p),Le=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){return b.subscribe(new Ke(a,this.notifier))};return c}(),Ke=function(c){function a(b,a){b=c.call(this,b)||this;b.hasValue=!1;b.add(b.innerSubscription=u(b,a));return b}d(a,c);a.prototype._next=function(b){this.hasValue&&c.prototype._next.call(this,\nb)};a.prototype.notifyNext=function(b,a,c,d,e){this.hasValue=!0;this.innerSubscription&&this.innerSubscription.unsubscribe()};a.prototype.notifyComplete=function(){};return a}(v),Ne=function(){function c(a){this.predicate=a}c.prototype.call=function(a,b){return b.subscribe(new Me(a,this.predicate))};return c}(),Me=function(c){function a(b,a){b=c.call(this,b)||this;b.predicate=a;b.skipping=!0;b.index=0;return b}d(a,c);a.prototype._next=function(b){var a=this.destination;this.skipping&&this.tryCallPredicate(b);\nthis.skipping||a.next(b)};a.prototype.tryCallPredicate=function(a){try{this.skipping=!!this.predicate(a,this.index++)}catch(f){this.destination.error(f)}};return a}(p),Oe=function(c){function a(a,f,d){void 0===f&&(f=0);void 0===d&&(d=qa);var b=c.call(this)||this;b.source=a;b.delayTime=f;b.scheduler=d;if(!aa(f)||0>f)b.delayTime=0;d&&\"function\"===typeof d.schedule||(b.scheduler=qa);return b}d(a,c);a.create=function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=qa);return new a(b,c,d)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};\na.prototype._subscribe=function(b){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:b})};return a}(r),Pe=function(){function c(a,b){this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return(new Oe(b,this.delay,this.scheduler)).subscribe(a)};return c}(),yc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Qe(a,this.project))};return c}(),Qe=function(c){function a(a,f){a=c.call(this,a)||this;a.project=f;a.index=\n0;return a}d(a,c);a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(k){this.destination.error(k);return}this._innerSub(b,a,c)};a.prototype._innerSub=function(a,c,d){var b=this.innerSubscription;b&&b.unsubscribe();this.add(this.innerSubscription=u(this,a,c,d))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);\nthis.innerSubscription=null;this.isStopped&&c.prototype._complete.call(this)};a.prototype.notifyNext=function(a,c,d,e,h){this.destination.next(c)};return a}(v),Se=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){a=new Re(a);var c=u(a,this.notifier);return c&&!c.closed?(a.add(c),b.subscribe(a)):a};return c}(),Re=function(c){function a(a){return c.call(this,a)||this}d(a,c);a.prototype.notifyNext=function(a,c,d,e,h){this.complete()};a.prototype.notifyComplete=function(){};return a}(v),\nUe=function(){function c(a){this.predicate=a}c.prototype.call=function(a,b){return b.subscribe(new Te(a,this.predicate))};return c}(),Te=function(c){function a(a,f){a=c.call(this,a)||this;a.predicate=f;a.index=0;return a}d(a,c);a.prototype._next=function(a){var b=this.destination,c;try{c=this.predicate(a,this.index++)}catch(k){b.error(k);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a,c){var b=this.destination;c?b.next(a):b.complete()};return a}(p),Fb={leading:!0,trailing:!1},\nWe=function(){function c(a,b,c){this.durationSelector=a;this.leading=b;this.trailing=c}c.prototype.call=function(a,b){return b.subscribe(new Ve(a,this.durationSelector,this.leading,this.trailing))};return c}(),Ve=function(c){function a(a,f,d,e){var b=c.call(this,a)||this;b.destination=a;b.durationSelector=f;b._leading=d;b._trailing=e;b._hasValue=!1;return b}d(a,c);a.prototype._next=function(a){this._hasValue=!0;this._sendValue=a;this._throttled||(this._leading?this.send():this.throttle(a))};a.prototype.send=\nfunction(){var a=this._sendValue;this._hasValue&&(this.destination.next(a),this.throttle(a));this._hasValue=!1;this._sendValue=null};a.prototype.throttle=function(a){(a=this.tryDurationSelector(a))&&this.add(this._throttled=u(this,a))};a.prototype.tryDurationSelector=function(a){try{return this.durationSelector(a)}catch(f){return this.destination.error(f),null}};a.prototype.throttlingDone=function(){var a=this._throttled,c=this._trailing;a&&a.unsubscribe();this._throttled=null;c&&this.send()};a.prototype.notifyNext=\nfunction(a,c,d,e,h){this.throttlingDone()};a.prototype.notifyComplete=function(){this.throttlingDone()};return a}(v),Ye=function(){function c(a,b,c,d){this.duration=a;this.scheduler=b;this.leading=c;this.trailing=d}c.prototype.call=function(a,b){return b.subscribe(new Xe(a,this.duration,this.scheduler,this.leading,this.trailing))};return c}(),Xe=function(c){function a(a,f,d,e,h){a=c.call(this,a)||this;a.duration=f;a.scheduler=d;a.leading=e;a.trailing=h;a._hasTrailingValue=!1;a._trailingValue=null;\nreturn a}d(a,c);a.prototype._next=function(a){this.throttled?this.trailing&&(this._trailingValue=a,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(zc,this.duration,{subscriber:this})),this.leading&&this.destination.next(a))};a.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue);this.destination.complete()};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),\nthis._trailingValue=null,this._hasTrailingValue=!1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(p),Ze=function(){return function(c,a){this.value=c;this.interval=a}}(),Ac=function(){function c(a,b,c,d){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=c;this.scheduler=d}c.prototype.call=function(a,b){return b.subscribe(new $e(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return c}(),$e=function(c){function a(a,f,d,e,h){a=c.call(this,a)||this;a.absoluteTimeout=\nf;a.waitFor=d;a.withObservable=e;a.scheduler=h;a.action=null;a.scheduleTimeout();return a}d(a,c);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(u(a,b))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();c.prototype._next.call(this,a)};a.prototype._unsubscribe=\nfunction(){this.withObservable=this.scheduler=this.action=null};return a}(v),af=function(){return function(c,a){this.value=c;this.timestamp=a}}(),cf=function(){function c(a){this.windowBoundaries=a}c.prototype.call=function(a,b){a=new bf(a);b=b.subscribe(a);b.closed||a.add(u(a,this.windowBoundaries));return b};return c}(),bf=function(c){function a(a){var b=c.call(this,a)||this;b.window=new z;a.next(b.window);return b}d(a,c);a.prototype.notifyNext=function(a,c,d,e,h){this.openWindow()};a.prototype.notifyError=\nfunction(a,c){this._error(a)};a.prototype.notifyComplete=function(a){this._complete()};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a)};a.prototype._complete=function(){this.window.complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.window=null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,c=this.window=new z;a.next(c)};return a}(v),ef=function(){function c(a,\nb){this.windowSize=a;this.startWindowEvery=b}c.prototype.call=function(a,b){return b.subscribe(new df(a,this.windowSize,this.startWindowEvery))};return c}(),df=function(c){function a(a,f,d){var b=c.call(this,a)||this;b.destination=a;b.windowSize=f;b.startWindowEvery=d;b.windows=[new z];b.count=0;a.next(b.windows[0]);return b}d(a,c);a.prototype._next=function(a){for(var b=0<this.startWindowEvery?this.startWindowEvery:this.windowSize,c=this.destination,d=this.windowSize,e=this.windows,h=e.length,l=\n0;l<h&&!this.closed;l++)e[l].next(a);a=this.count-d+1;0<=a&&0===a%b&&!this.closed&&e.shift().complete();0!==++this.count%b||this.closed||(b=new z,e.push(b),c.next(b))};a.prototype._error=function(a){var b=this.windows;if(b)for(;0<b.length&&!this.closed;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){var a=this.windows;if(a)for(;0<a.length&&!this.closed;)a.shift().complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.count=0;this.windows=null};\nreturn a}(p),gf=function(){function c(a,b,c,d){this.windowTimeSpan=a;this.windowCreationInterval=b;this.maxWindowSize=c;this.scheduler=d}c.prototype.call=function(a,b){return b.subscribe(new ff(a,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))};return c}(),hf=function(c){function a(){var a=null!==c&&c.apply(this,arguments)||this;a._numberOfNextedValues=0;return a}d(a,c);a.prototype.next=function(a){this._numberOfNextedValues++;c.prototype.next.call(this,a)};Object.defineProperty(a.prototype,\n\"numberOfNextedValues\",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0});return a}(z),ff=function(c){function a(a,f,d,e,h){var b=c.call(this,a)||this;b.destination=a;b.windowTimeSpan=f;b.windowCreationInterval=d;b.maxWindowSize=e;b.scheduler=h;b.windows=[];a=b.openWindow();null!==d&&0<=d?(e={windowTimeSpan:f,windowCreationInterval:d,subscriber:b,scheduler:h},b.add(h.schedule(nb,f,{subscriber:b,window:a,context:null})),b.add(h.schedule(Dc,d,e))):b.add(h.schedule(Cc,\nf,{subscriber:b,window:a,windowTimeSpan:f}));return b}d(a,c);a.prototype._next=function(a){for(var b=this.windows,c=b.length,d=0;d<c;d++){var e=b[d];e.closed||(e.next(a),e.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(e))}};a.prototype._error=function(a){for(var b=this.windows;0<b.length;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){for(var a=this.windows;0<a.length;){var c=a.shift();c.closed||c.complete()}this.destination.complete()};a.prototype.openWindow=\nfunction(){var a=new hf;this.windows.push(a);this.destination.next(a);return a};a.prototype.closeWindow=function(a){a.complete();var b=this.windows;b.splice(b.indexOf(a),1)};return a}(p),kf=function(){function c(a,b){this.openings=a;this.closingSelector=b}c.prototype.call=function(a,b){return b.subscribe(new jf(a,this.openings,this.closingSelector))};return c}(),jf=function(c){function a(a,f,d){a=c.call(this,a)||this;a.openings=f;a.closingSelector=d;a.contexts=[];a.add(a.openSubscription=u(a,f,f));\nreturn a}d(a,c);a.prototype._next=function(a){var b=this.contexts;if(b)for(var c=b.length,d=0;d<c;d++)b[d].window.next(a)};a.prototype._error=function(a){var b=this.contexts;this.contexts=null;if(b)for(var d=b.length,e=-1;++e<d;){var h=b[e];h.window.error(a);h.subscription.unsubscribe()}c.prototype._error.call(this,a)};a.prototype._complete=function(){var a=this.contexts;this.contexts=null;if(a)for(var d=a.length,g=-1;++g<d;){var e=a[g];e.window.complete();e.subscription.unsubscribe()}c.prototype._complete.call(this)};\na.prototype._unsubscribe=function(){var a=this.contexts;this.contexts=null;if(a)for(var c=a.length,d=-1;++d<c;){var e=a[d];e.window.unsubscribe();e.subscription.unsubscribe()}};a.prototype.notifyNext=function(a,c,d,e,h){if(a===this.openings){e=n(this.closingSelector)(c);if(e===q)return this.error(q.e);a=new z;c=new w;d={window:a,subscription:c};this.contexts.push(d);e=u(this,e,d);e.closed?this.closeWindow(this.contexts.length-1):(e.context=d,c.add(e));this.destination.next(a)}else this.closeWindow(this.contexts.indexOf(a))};\na.prototype.notifyError=function(a){this.error(a)};a.prototype.notifyComplete=function(a){a!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(a.context))};a.prototype.closeWindow=function(a){if(-1!==a){var b=this.contexts,c=b[a],d=c.window,c=c.subscription;b.splice(a,1);d.complete();c.unsubscribe()}};return a}(v),mf=function(){function c(a){this.closingSelector=a}c.prototype.call=function(a,b){return b.subscribe(new lf(a,this.closingSelector))};return c}(),lf=function(c){function a(a,\nd){var b=c.call(this,a)||this;b.destination=a;b.closingSelector=d;b.openWindow();return b}d(a,c);a.prototype.notifyNext=function(a,c,d,e,h){this.openWindow(h)};a.prototype.notifyError=function(a,c){this._error(a)};a.prototype.notifyComplete=function(a){this.openWindow(a)};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a);this.unsubscribeClosingNotification()};a.prototype._complete=function(){this.window.complete();this.destination.complete();\nthis.unsubscribeClosingNotification()};a.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()};a.prototype.openWindow=function(a){void 0===a&&(a=null);a&&(this.remove(a),a.unsubscribe());(a=this.window)&&a.complete();a=this.window=new z;this.destination.next(a);a=n(this.closingSelector)();a===q?(a=q.e,this.destination.error(a),this.window.error(a)):this.add(this.closingNotification=u(this,a))};return a}(v),of=function(){function c(a,\nb){this.observables=a;this.project=b}c.prototype.call=function(a,b){return b.subscribe(new nf(a,this.observables,this.project))};return c}(),nf=function(c){function a(a,d,g){a=c.call(this,a)||this;a.observables=d;a.project=g;a.toRespond=[];g=d.length;a.values=Array(g);for(var b=0;b<g;b++)a.toRespond.push(b);for(b=0;b<g;b++){var f=d[b];a.add(u(a,f,f,b))}return a}d(a,c);a.prototype.notifyNext=function(a,c,d,e,h){this.values[d]=c;a=this.toRespond;0<a.length&&(d=a.indexOf(d),-1!==d&&a.splice(d,1))};a.prototype.notifyComplete=\nfunction(){};a.prototype._next=function(a){0===this.toRespond.length&&(a=[a].concat(this.values),this.project?this._tryProject(a):this.destination.next(a))};a.prototype._tryProject=function(a){var b;try{b=this.project.apply(this,a)}catch(g){this.destination.error(g);return}this.destination.next(b)};return a}(v),pf=Object.freeze({audit:fb,auditTime:function(c,a){void 0===a&&(a=C);return fb(function(){return cb(c,a)})},buffer:function(c){return function(a){return a.lift(new jd(c))}},bufferCount:function(c,\na){void 0===a&&(a=null);return function(b){return b.lift(new md(c,a))}},bufferTime:function(c){var a=arguments.length,b=C;B(arguments[arguments.length-1])&&(b=arguments[arguments.length-1],a--);var d=null;2<=a&&(d=arguments[1]);var g=Number.POSITIVE_INFINITY;3<=a&&(g=arguments[2]);return function(a){return a.lift(new od(c,d,g,b))}},bufferToggle:function(c,a){return function(b){return b.lift(new rd(c,a))}},bufferWhen:function(c){return function(a){return a.lift(new td(c))}},catchError:function(c){return function(a){var b=\nnew vd(c);a=a.lift(b);return b.caught=a}},combineAll:function(c){return function(a){return a.lift(new Ia(c))}},combineLatest:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=null;\"function\"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0].slice());return function(a){return a.lift.call(L([a].concat(c)),new Ia(b))}},concat:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(M.apply(void 0,[a].concat(c)))}},\nconcatAll:Wa,concatMap:ib,concatMapTo:function(c,a){return ib(function(){return c},a)},count:function(c){return function(a){return a.lift(new xd(c,a))}},debounce:function(c){return function(a){return a.lift(new zd(c))}},debounceTime:function(c,a){void 0===a&&(a=C);return function(b){return b.lift(new Bd(c,a))}},defaultIfEmpty:fa,delay:function(c,a){void 0===a&&(a=C);var b=c instanceof Date&&!isNaN(+c)?+c-a.now():Math.abs(c);return function(c){return c.lift(new Ed(b,a))}},delayWhen:function(c,a){return a?\nfunction(b){return(new Id(b,a)).lift(new Cb(c))}:function(a){return a.lift(new Cb(c))}},dematerialize:function(){return function(c){return c.lift(new Kd)}},distinct:function(c,a){return function(b){return b.lift(new Md(c,a))}},distinctUntilChanged:jb,distinctUntilKeyChanged:function(c,a){return jb(function(b,d){return a?a(b[c],d[c]):b[c]===d[c]})},elementAt:function(c,a){if(0>c)throw new da;var b=2<=arguments.length;return function(d){return d.pipe(ba(function(a,b){return b===c}),Ba(1),b?fa(a):ra(function(){return new da}))}},\nendWith:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){var b=c[c.length-1];B(b)?c.pop():b=null;var d=c.length;return 1!==d||b?0<d?M(a,J(c,b)):M(a,I(b)):M(a,ta(c[0]))}},every:function(c,a){return function(b){return b.lift(new Sd(c,a,b))}},exhaust:function(){return function(c){return c.lift(new Ud)}},exhaustMap:lb,expand:function(c,a,b){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===b&&(b=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new Xd(c,\na,b))}},filter:ba,finalize:function(c){return function(a){return a.lift(new Zd(c))}},find:function(c,a){if(\"function\"!==typeof c)throw new TypeError(\"predicate is not a function\");return function(b){return b.lift(new Db(c,b,!1,a))}},findIndex:function(c,a){return function(b){return b.lift(new Db(c,b,!0,a))}},first:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?ba(function(a,b){return c(a,b,d)}):R,Ba(1),b?fa(a):ra(function(){return new ga}))}},groupBy:function(c,a,b,d){return function(f){return f.lift(new Pc(c,\na,b,d))}},ignoreElements:function(){return function(c){return c.lift(new be)}},isEmpty:function(){return function(c){return c.lift(new de)}},last:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?ba(function(a,b){return c(a,b,d)}):R,ma(1),b?fa(a):ra(function(){return new ga}))}},map:F,mapTo:function(c){return function(a){return a.lift(new ge(c))}},materialize:function(){return function(c){return c.lift(new ie)}},max:function(c){return oa(\"function\"===typeof c?function(a,b){return 0<\nc(a,b)?a:b}:function(a,b){return a>b?a:b})},merge:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(ab.apply(void 0,[a].concat(c)))}},mergeAll:ya,mergeMap:T,flatMap:T,mergeMapTo:function(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if(\"function\"===typeof a)return T(function(){return c},a,b);\"number\"===typeof a&&(b=a);return T(function(){return c},b)},mergeScan:function(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);return function(d){return d.lift(new le(c,\na,b))}},min:function(c){return oa(\"function\"===typeof c?function(a,b){return 0>c(a,b)?a:b}:function(a,b){return a<b?a:b})},multicast:U,observeOn:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Tc(c,a))}},onErrorResumeNext:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];1===c.length&&D(c[0])&&(c=c[0]);return function(a){return a.lift(new ne(c))}},pairwise:function(){return function(c){return c.lift(new pe)}},partition:function(c,a){return function(b){return[ba(c,\na)(b),ba(tc(c,a))(b)]}},pluck:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=c.length;if(0===b)throw Error(\"list of properties cannot be empty.\");return function(a){return F(uc(c,b))(a)}},publish:function(c){return c?U(function(){return new z},c):U(new z)},publishBehavior:function(c){return function(a){return U(new ub(c))(a)}},publishLast:function(){return function(c){return U(new Y)(c)}},publishReplay:function(c,a,b,d){b&&\"function\"!==typeof b&&(d=b);var f=\"function\"===\ntypeof b?b:void 0,e=new V(c,a,d);return function(a){return U(function(){return e},f)(a)}},race:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){1===c.length&&D(c[0])&&(c=c[0]);return a.lift.call(bb.apply(void 0,[a].concat(c)))}},reduce:oa,repeat:function(c){void 0===c&&(c=-1);return function(a){return 0===c?I():0>c?a.lift(new Eb(-1,a)):a.lift(new Eb(c-1,a))}},repeatWhen:function(c){return function(a){return a.lift(new se(c))}},retry:function(c){void 0===c&&(c=\n-1);return function(a){return a.lift(new ue(c,a))}},retryWhen:function(c){return function(a){return a.lift(new we(c,a))}},refCount:la,sample:function(c){return function(a){return a.lift(new ye(c))}},sampleTime:function(c,a){void 0===a&&(a=C);return function(b){return b.lift(new Ae(c,a))}},scan:na,sequenceEqual:function(c,a){return function(b){return b.lift(new Ce(c,a))}},share:function(){return function(c){return la()(U(wc)(c))}},shareReplay:function(c,a,b){return function(d){return d.lift(xc(c,a,\nb))}},single:function(c){return function(a){return a.lift(new Fe(c,a))}},skip:function(c){return function(a){return a.lift(new He(c))}},skipLast:function(c){return function(a){return a.lift(new Je(c))}},skipUntil:function(c){return function(a){return a.lift(new Le(c))}},skipWhile:function(c){return function(a){return a.lift(new Ne(c))}},startWith:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){var b=c[c.length-1];B(b)?c.pop():b=null;var d=c.length;return 1!==\nd||b?0<d?M(J(c,b),a):M(I(b),a):M(ta(c[0]),a)}},subscribeOn:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Pe(c,a))}},switchAll:function(){return ha(R)},switchMap:ha,switchMapTo:function(c,a){return a?ha(function(){return c},a):ha(function(){return c})},take:Ba,takeLast:ma,takeUntil:function(c){return function(a){return a.lift(new Se(c))}},takeWhile:function(c){return function(a){return a.lift(new Ue(c))}},tap:kb,throttle:function(c,a){void 0===a&&(a=Fb);return function(b){return b.lift(new We(c,\na.leading,a.trailing))}},throttleTime:function(c,a,b){void 0===a&&(a=C);void 0===b&&(b=Fb);return function(d){return d.lift(new Ye(c,a,b.leading,b.trailing))}},throwIfEmpty:ra,timeInterval:function(c){void 0===c&&(c=C);return function(a){return za(function(){return a.pipe(na(function(a,d){a=a.current;return{value:d,current:c.now(),last:a}},{current:c.now(),value:void 0,last:void 0}),F(function(a){return new Ze(a.value,a.current-a.last)}))})}},timeout:function(c,a){void 0===a&&(a=C);return mb(c,va(new zb),\na)},timeoutWith:mb,timestamp:function(c){void 0===c&&(c=C);return F(function(a){return new af(a,c.now())})},toArray:function(){return oa(Bc,[])},window:function(c){return function(a){return a.lift(new cf(c))}},windowCount:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new ef(c,a))}},windowTime:function(c,a,b,d){var f=C,e=null,h=Number.POSITIVE_INFINITY;B(d)&&(f=d);B(b)?f=b:aa(b)&&(h=b);B(a)?f=a:aa(a)&&(e=a);return function(a){return a.lift(new gf(c,e,h,f))}},windowToggle:function(c,\na){return function(b){return b.lift(new kf(c,a))}},windowWhen:function(c){return function(a){return a.lift(new mf(c))}},withLatestFrom:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){var b;\"function\"===typeof c[c.length-1]&&(b=c.pop());return a.lift(new of(c,b))}},zip:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(db.apply(void 0,[a].concat(c)))}},zipAll:function(c){return function(a){return a.lift(new eb(c))}}}),\nka=function(){return function(c,a){void 0===a&&(a=Number.POSITIVE_INFINITY);this.subscribedFrame=c;this.unsubscribedFrame=a}}(),Gb=function(){function c(){this.subscriptions=[]}c.prototype.logSubscribedFrame=function(){this.subscriptions.push(new ka(this.scheduler.now()));return this.subscriptions.length-1};c.prototype.logUnsubscribedFrame=function(a){var b=this.subscriptions;b[a]=new ka(b[a].subscribedFrame,this.scheduler.now())};return c}(),Ja=function(c){function a(a,d){var b=c.call(this,function(a){var b=\nthis,c=b.logSubscribedFrame();a.add(new w(function(){b.logUnsubscribedFrame(c)}));b.scheduleMessages(a);return a})||this;b.messages=a;b.subscriptions=[];b.scheduler=d;return b}d(a,c);a.prototype.scheduleMessages=function(a){for(var b=this.messages.length,c=0;c<b;c++){var d=this.messages[c];a.add(this.scheduler.schedule(function(a){a.message.notification.observe(a.subscriber)},d.frame,{message:d,subscriber:a}))}};return a}(r);ob(Ja,[Gb]);var Hb=function(c){function a(a,d){var b=c.call(this)||this;\nb.messages=a;b.subscriptions=[];b.scheduler=d;return b}d(a,c);a.prototype._subscribe=function(a){var b=this,d=b.logSubscribedFrame();a.add(new w(function(){b.logUnsubscribedFrame(d)}));return c.prototype._subscribe.call(this,a)};a.prototype.setup=function(){for(var a=this,c=a.messages.length,d=0;d<c;d++)(function(){var b=a.messages[d];a.scheduler.schedule(function(){b.notification.observe(a)},b.frame)})()};return a}(z);ob(Hb,[Gb]);var qf=function(c){function a(a){var b=c.call(this,Ha,750)||this;b.assertDeepEqual=\na;b.hotObservables=[];b.coldObservables=[];b.flushTests=[];b.runMode=!1;return b}d(a,c);a.prototype.createTime=function(b){b=b.indexOf(\"|\");if(-1===b)throw Error('marble diagram for time should have a completion marker \"|\"');return b*a.frameTimeFactor};a.prototype.createColdObservable=function(b,c,d){if(-1!==b.indexOf(\"^\"))throw Error('cold observable cannot have subscription offset \"^\"');if(-1!==b.indexOf(\"!\"))throw Error('cold observable cannot have unsubscription marker \"!\"');b=a.parseMarbles(b,\nc,d,void 0,this.runMode);b=new Ja(b,this);this.coldObservables.push(b);return b};a.prototype.createHotObservable=function(b,c,d){if(-1!==b.indexOf(\"!\"))throw Error('hot observable cannot have unsubscription marker \"!\"');b=a.parseMarbles(b,c,d,void 0,this.runMode);b=new Hb(b,this);this.hotObservables.push(b);return b};a.prototype.materializeInnerObservable=function(a,c){var b=this,d=[];a.subscribe(function(a){d.push({frame:b.frame-c,notification:A.createNext(a)})},function(a){d.push({frame:b.frame-\nc,notification:A.createError(a)})},function(){d.push({frame:b.frame-c,notification:A.createComplete()})});return d};a.prototype.expectObservable=function(b,c){var d=this;void 0===c&&(c=null);var f=[],e={actual:f,ready:!1};c=a.parseMarblesAsSubscriptions(c,this.runMode).unsubscribedFrame;var h;this.schedule(function(){h=b.subscribe(function(a){var b=a;a instanceof r&&(b=d.materializeInnerObservable(b,d.frame));f.push({frame:d.frame,notification:A.createNext(b)})},function(a){f.push({frame:d.frame,\nnotification:A.createError(a)})},function(){f.push({frame:d.frame,notification:A.createComplete()})})},0);c!==Number.POSITIVE_INFINITY&&this.schedule(function(){return h.unsubscribe()},c);this.flushTests.push(e);var l=this.runMode;return{toBe:function(b,c,d){e.ready=!0;e.expected=a.parseMarbles(b,c,d,!0,l)}}};a.prototype.expectSubscriptions=function(b){var c={actual:b,ready:!1};this.flushTests.push(c);var d=this.runMode;return{toBe:function(b){b=\"string\"===typeof b?[b]:b;c.ready=!0;c.expected=b.map(function(b){return a.parseMarblesAsSubscriptions(b,\nd)})}}};a.prototype.flush=function(){for(var a=this.hotObservables;0<a.length;)a.shift().setup();c.prototype.flush.call(this);for(var a=this.flushTests,d=a.slice(),e=0,k=a.length;e<k;e++){var h=d[e];h.ready&&(a.splice(e,1),this.assertDeepEqual(h.actual,h.expected))}};a.parseMarblesAsSubscriptions=function(a,c){var b=this;void 0===c&&(c=!1);if(\"string\"!==typeof a)return new ka(Number.POSITIVE_INFINITY);for(var d=a.length,f=-1,e=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,l=0,n=function(d){var g=\nl,k=function(a){g+=a*b.frameTimeFactor},n=a[d];switch(n){case \" \":c||k(1);break;case \"-\":k(1);break;case \"(\":f=l;k(1);break;case \")\":f=-1;k(1);break;case \"^\":if(e!==Number.POSITIVE_INFINITY)throw Error(\"found a second subscription point '^' in a subscription marble diagram. There can only be one.\");e=-1<f?f:l;k(1);break;case \"!\":if(h!==Number.POSITIVE_INFINITY)throw Error(\"found a second subscription point '^' in a subscription marble diagram. There can only be one.\");h=-1<f?f:l;break;default:if(c&&\nn.match(/^[0-9]$/)&&(0===d||\" \"===a[d-1])){var t=a.slice(d).match(/^([0-9]+(?:\\.[0-9]+)?)(ms|s|m) /);if(t){d+=t[0].length-1;var n=parseFloat(t[1]),x=void 0;switch(t[2]){case \"ms\":x=n;break;case \"s\":x=1E3*n;break;case \"m\":x=6E4*n}k(x/m.frameTimeFactor);break}}throw Error(\"there can only be '^' and '!' markers in a subscription marble diagram. Found instead '\"+n+\"'.\");}l=g;p=d},m=this,p,q=0;q<d;q++)n(q),q=p;return 0>h?new ka(e):new ka(e,h)};a.parseMarbles=function(a,c,d,e,h){var b=this;void 0===e&&\n(e=!1);void 0===h&&(h=!1);if(-1!==a.indexOf(\"!\"))throw Error('conventional marble diagrams cannot have the unsubscription marker \"!\"');for(var f=a.length,g=[],k=h?a.replace(/^[ ]+/,\"\").indexOf(\"^\"):a.indexOf(\"^\"),l=-1===k?0:k*-this.frameTimeFactor,n=\"object\"!==typeof c?function(a){return a}:function(a){return e&&c[a]instanceof Ja?c[a].messages:c[a]},m=-1,k=function(c){var f=l,e=function(a){f+=a*b.frameTimeFactor},k=void 0,t=a[c];switch(t){case \" \":h||e(1);break;case \"-\":e(1);break;case \"(\":m=l;e(1);\nbreak;case \")\":m=-1;e(1);break;case \"|\":k=A.createComplete();e(1);break;case \"^\":e(1);break;case \"#\":k=A.createError(d||\"error\");e(1);break;default:if(h&&t.match(/^[0-9]$/)&&(0===c||\" \"===a[c-1])){var x=a.slice(c).match(/^([0-9]+(?:\\.[0-9]+)?)(ms|s|m) /);if(x){c+=x[0].length-1;var t=parseFloat(x[1]),r=void 0;switch(x[2]){case \"ms\":r=t;break;case \"s\":r=1E3*t;break;case \"m\":r=6E4*t}e(r/p.frameTimeFactor);break}}k=A.createNext(n(t));e(1)}k&&g.push({frame:-1<m?m:l,notification:k});l=f;q=c},p=this,q,x=\n0;x<f;x++)k(x),x=q;return g};a.prototype.run=function(b){var c=a.frameTimeFactor,d=this.maxFrames;a.frameTimeFactor=1;this.maxFrames=Number.POSITIVE_INFINITY;this.runMode=!0;X.delegate=this;var e={cold:this.createColdObservable.bind(this),hot:this.createHotObservable.bind(this),flush:this.flush.bind(this),expectObservable:this.expectObservable.bind(this),expectSubscriptions:this.expectSubscriptions.bind(this)};try{var h=b(e);this.flush();return h}finally{a.frameTimeFactor=c,this.maxFrames=d,this.runMode=\n!1,X.delegate=void 0}};return a}(yb),rf=Object.freeze({TestScheduler:qf}),sf=\"undefined\"!==typeof self&&\"undefined\"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,tf=\"undefined\"!==typeof global&&global,E=\"undefined\"!==typeof window&&window||tf||sf;if(!E)throw Error(\"RxJS could not find any global context (window, self, global)\");var Kc=F(function(c,a){return c.response}),W=function(c){function a(a){var b=c.call(this)||this,d={async:!0,createXHR:function(){var a;if(this.crossDomain)if(E.XMLHttpRequest)a=\nnew E.XMLHttpRequest;else if(E.XDomainRequest)a=new E.XDomainRequest;else throw Error(\"CORS is not supported by your browser\");else if(E.XMLHttpRequest)a=new E.XMLHttpRequest;else{var b=void 0;try{for(var c=[\"Msxml2.XMLHTTP\",\"Microsoft.XMLHTTP\",\"Msxml2.XMLHTTP.4.0\"],d=0;3>d;d++)try{b=c[d];new E.ActiveXObject(b);break}catch(t){}a=new E.ActiveXObject(b)}catch(t){throw Error(\"XMLHttpRequest is not supported by your browser\");}}return a},crossDomain:!0,withCredentials:!1,headers:{},method:\"GET\",responseType:\"json\",\ntimeout:0};if(\"string\"===typeof a)d.url=a;else for(var e in a)a.hasOwnProperty(e)&&(d[e]=a[e]);b.request=d;return b}d(a,c);a.prototype._subscribe=function(a){return new uf(a,this.request)};a.create=function(){var b=function(b){return new a(b)};b.get=Ec;b.post=Fc;b.delete=Gc;b.put=Hc;b.patch=Ic;b.getJSON=Jc;return b}();return a}(r),uf=function(c){function a(a,d){a=c.call(this,a)||this;a.request=d;a.done=!1;var b=d.headers=d.headers||{};d.crossDomain||b[\"X-Requested-With\"]||(b[\"X-Requested-With\"]=\"XMLHttpRequest\");\n\"Content-Type\"in b||E.FormData&&d.body instanceof E.FormData||\"undefined\"===typeof d.body||(b[\"Content-Type\"]=\"application/x-www-form-urlencoded; charset\\x3dUTF-8\");d.body=a.serializeBody(d.body,d.headers[\"Content-Type\"]);a.send();return a}d(a,c);a.prototype.next=function(a){this.done=!0;var b=this.destination;a=new Ib(a,this.xhr,this.request);b.next(a)};a.prototype.send=function(){var a=this.request,c=this.request,d=c.user,e=c.method,h=c.url,l=c.async,m=c.password,p=c.headers,c=c.body,t=n(a.createXHR).call(a);\nif(t===q)this.error(q.e);else{this.xhr=t;this.setupEvents(t,a);d=d?n(t.open).call(t,e,h,l,d,m):n(t.open).call(t,e,h,l);if(d===q)return this.error(q.e),null;l&&(t.timeout=a.timeout,t.responseType=a.responseType);\"withCredentials\"in t&&(t.withCredentials=!!a.withCredentials);this.setHeaders(t,p);d=c?n(t.send).call(t,c):n(t.send).call(t);if(d===q)return this.error(q.e),null}return t};a.prototype.serializeBody=function(a,c){if(!a||\"string\"===typeof a||E.FormData&&a instanceof E.FormData)return a;if(c){var b=\nc.indexOf(\";\");-1!==b&&(c=c.substring(0,b))}switch(c){case \"application/x-www-form-urlencoded\":return Object.keys(a).map(function(b){return encodeURIComponent(b)+\"\\x3d\"+encodeURIComponent(a[b])}).join(\"\\x26\");case \"application/json\":return JSON.stringify(a);default:return a}};a.prototype.setHeaders=function(a,c){for(var b in c)c.hasOwnProperty(b)&&a.setRequestHeader(b,c[b])};a.prototype.setupEvents=function(a,c){function b(a){var c=b.subscriber,d=b.progressSubscriber,e=b.request;d&&d.error(a);c.error(new Jb(this,\ne))}function d(a){}function e(a){var b=e.subscriber,c=e.progressSubscriber,d=e.request;if(4===this.readyState){var f=1223===this.status?204:this.status,g=\"text\"===this.responseType?this.response||this.responseText:this.response;0===f&&(f=g?200:0);400>f?(c&&c.complete(),b.next(a),b.complete()):(c&&c.error(a),b.error(new sa(\"ajax error \"+f,this,d)))}}var f=c.progressSubscriber;a.ontimeout=b;b.request=c;b.subscriber=this;b.progressSubscriber=f;if(a.upload&&\"withCredentials\"in a){if(f){var h;h=function(a){h.progressSubscriber.next(a)};\nE.XDomainRequest?a.onprogress=h:a.upload.onprogress=h;h.progressSubscriber=f}var l;l=function(a){var b=l.progressSubscriber,c=l.subscriber,d=l.request;b&&b.error(a);c.error(new sa(\"ajax error\",this,d))};a.onerror=l;l.request=c;l.subscriber=this;l.progressSubscriber=f}a.onreadystatechange=d;d.subscriber=this;d.progressSubscriber=f;d.request=c;a.onload=e;e.subscriber=this;e.progressSubscriber=f;e.request=c};a.prototype.unsubscribe=function(){var a=this.xhr;!this.done&&a&&4!==a.readyState&&\"function\"===\ntypeof a.abort&&a.abort();c.prototype.unsubscribe.call(this)};return a}(p),Ib=function(){return function(c,a,b){this.originalEvent=c;this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=pb(this.responseType,a)}}(),sa=function(c){function a(b,d,e){var f=c.call(this,b)||this;f.name=\"AjaxError\";f.message=b;f.xhr=d;f.request=e;f.status=d.status;f.responseType=d.responseType||e.responseType;f.response=pb(f.responseType,d);Object.setPrototypeOf(f,\na.prototype);return f}d(a,c);return a}(Error),Jb=function(c){function a(b,d){b=c.call(this,\"ajax timeout\",b,d)||this;b.name=\"AjaxTimeoutError\";Object.setPrototypeOf(b,a.prototype);return b}d(a,c);return a}(sa),vf=Object.freeze({ajax:W.create,AjaxResponse:Ib,AjaxError:sa,AjaxTimeoutError:Jb}),wf={url:\"\",deserializer:function(c){return JSON.parse(c.data)},serializer:function(c){return JSON.stringify(c)}},Kb=function(c){function a(a,d){var b=c.call(this)||this;if(a instanceof r)b.destination=d,b.source=\na;else{d=b._config=Lc({},wf);b._output=new z;if(\"string\"===typeof a)d.url=a;else for(var e in a)a.hasOwnProperty(e)&&(d[e]=a[e]);if(!d.WebSocketCtor&&WebSocket)d.WebSocketCtor=WebSocket;else if(!d.WebSocketCtor)throw Error(\"no WebSocket constructor can be found\");b.destination=new V}return b}d(a,c);a.prototype.lift=function(b){var c=new a(this._config,this.destination);c.operator=b;c.source=this;return c};a.prototype._resetState=function(){this._socket=null;this.source||(this.destination=new V);this._output=\nnew z};a.prototype.multiplex=function(a,c,d){var b=this;return new r(function(e){var f=n(a)();f===q?e.error(q.e):b.next(f);var g=b.subscribe(function(a){var b=n(d)(a);b===q?e.error(q.e):b&&e.next(a)},function(a){return e.error(a)},function(){return e.complete()});return function(){var a=n(c)();a===q?e.error(q.e):b.next(a);g.unsubscribe()}})};a.prototype._connectSocket=function(){var a=this,c=this._config,d=c.WebSocketCtor,e=c.protocol,h=c.url,c=c.binaryType,l=this._output,m=null;try{this._socket=\nm=e?new d(h,e):new d(h),c&&(this._socket.binaryType=c)}catch(t){l.error(t);return}var r=new w(function(){a._socket=null;m&&1===m.readyState&&m.close()});m.onopen=function(b){var c=a._config.openObserver;c&&c.next(b);b=a.destination;a.destination=p.create(function(b){1===m.readyState&&(b=n(a._config.serializer)(b),b===q?a.destination.error(q.e):m.send(b))},function(b){var c=a._config.closingObserver;c&&c.next(void 0);b&&b.code?m.close(b.code,b.reason):l.error(new TypeError(\"WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }\"));\na._resetState()},function(){var b=a._config.closingObserver;b&&b.next(void 0);m.close();a._resetState()});b&&b instanceof V&&r.add(b.subscribe(a.destination))};m.onerror=function(b){a._resetState();l.error(b)};m.onclose=function(b){a._resetState();var c=a._config.closeObserver;c&&c.next(b);b.wasClean?l.complete():l.error(b)};m.onmessage=function(b){b=n(a._config.deserializer)(b);b===q?l.error(q.e):l.next(b)}};a.prototype._subscribe=function(a){var b=this,c=this.source;if(c)return c.subscribe(a);this._socket||\nthis._connectSocket();c=new w;c.add(this._output.subscribe(a));c.add(function(){var a=b._socket;0===b._output.observers.length&&(a&&1===a.readyState&&a.close(),b._resetState())});return c};a.prototype.unsubscribe=function(){var a=this.source,d=this._socket;d&&1===d.readyState&&(d.close(),this._resetState());c.prototype.unsubscribe.call(this);a||(this.destination=new V)};return a}(Da),xf=Object.freeze({webSocket:function(c){return new Kb(c)},WebSocketSubject:Kb});e.operators=pf;e.testing=rf;e.ajax=\nvf;e.webSocket=xf;e.Observable=r;e.ConnectableObservable=tb;e.GroupedObservable=Ea;e.observable=Z;e.Subject=z;e.BehaviorSubject=ub;e.ReplaySubject=V;e.AsyncSubject=Y;e.asapScheduler=qa;e.asyncScheduler=C;e.queueScheduler=vb;e.animationFrameScheduler=Zc;e.VirtualTimeScheduler=yb;e.VirtualAction=Ha;e.Scheduler=Fa;e.Subscription=w;e.Subscriber=p;e.Notification=A;e.pipe=G;e.noop=m;e.identity=R;e.isObservable=function(c){return!!c&&(c instanceof r||\"function\"===typeof c.lift&&\"function\"===typeof c.subscribe)};\ne.ArgumentOutOfRangeError=da;e.EmptyError=ga;e.ObjectUnsubscribedError=N;e.UnsubscriptionError=ea;e.TimeoutError=zb;e.bindCallback=Na;e.bindNodeCallback=Oa;e.combineLatest=function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=a=null;B(c[c.length-1])&&(b=c.pop());\"function\"===typeof c[c.length-1]&&(a=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return J(c,b).lift(new Ia(a))};e.concat=M;e.defer=za;e.empty=I;e.forkJoin=Xa;e.from=L;e.fromEvent=Ya;e.fromEventPattern=$a;e.generate=function(c,\na,b,d,e){var f,g;1==arguments.length?(g=c.initialState,a=c.condition,b=c.iterate,f=c.resultSelector||R,e=c.scheduler):void 0===d||B(d)?(g=c,f=R,e=d):(g=c,f=d);return new r(function(c){var d=g;if(e)return e.schedule($b,0,{subscriber:c,iterate:b,condition:a,resultSelector:f,state:d});do{if(a){var h=void 0;try{h=a(d)}catch(t){c.error(t);break}if(!h){c.complete();break}}h=void 0;try{h=f(d)}catch(t){c.error(t);break}c.next(h);if(c.closed)break;try{d=b(d)}catch(t){c.error(t);break}}while(1)})};e.iif=function(c,\na,b){void 0===a&&(a=Q);void 0===b&&(b=Q);return za(function(){return c()?a:b})};e.interval=function(c,a){void 0===c&&(c=0);void 0===a&&(a=C);if(!aa(c)||0>c)c=0;a&&\"function\"===typeof a.schedule||(a=C);return new r(function(b){b.add(a.schedule(ac,c,{subscriber:b,counter:0,period:c}));return b})};e.merge=ab;e.never=function(){return Bb};e.of=ua;e.onErrorResumeNext=Aa;e.pairs=function(c,a){return a?new r(function(b){var d=Object.keys(c),e=new w;e.add(a.schedule(bc,0,{keys:d,index:0,subscriber:b,subscription:e,\nobj:c}));return e}):new r(function(a){for(var b=Object.keys(c),d=0;d<b.length&&!a.closed;d++){var e=b[d];c.hasOwnProperty(e)&&a.next([e,c[e]])}a.complete()})};e.race=bb;e.range=function(c,a,b){void 0===c&&(c=0);void 0===a&&(a=0);return new r(function(d){var e=0,f=c;if(b)return b.schedule(dc,0,{index:e,count:a,start:c,subscriber:d});do{if(e++>=a){d.complete();break}d.next(f++);if(d.closed)break}while(1)})};e.throwError=va;e.timer=cb;e.using=function(c,a){return new r(function(b){var d;try{d=c()}catch(x){b.error(x);\nreturn}var e;try{e=a(d)}catch(x){b.error(x);return}var h=(e?L(e):Q).subscribe(b);return function(){h.unsubscribe();d&&d.unsubscribe()}})};e.zip=db;e.EMPTY=Q;e.NEVER=Bb;e.config=H;Object.defineProperty(e,\"__esModule\",{value:!0})});\n"
  },
  {
    "path": "test/lib/angular-12/zone_v0.8.12.js",
    "content": "/**\n* @license\n* Copyright Google Inc. 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://angular.io/license\n*/\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(factory());\n}(this, (function () { 'use strict';\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar Zone$1 = (function (global) {\n    var performance = global['performance'];\n    function mark(name) {\n        performance && performance['mark'] && performance['mark'](name);\n    }\n    function performanceMeasure(name, label) {\n        performance && performance['measure'] && performance['measure'](name, label);\n    }\n    mark('Zone');\n    if (global['Zone']) {\n        throw new Error('Zone already loaded.');\n    }\n    var Zone = (function () {\n        function Zone(parent, zoneSpec) {\n            this._properties = null;\n            this._parent = parent;\n            this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>';\n            this._properties = zoneSpec && zoneSpec.properties || {};\n            this._zoneDelegate =\n                new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n        }\n        Zone.assertZonePatched = function () {\n            if (global['Promise'] !== patches['ZoneAwarePromise']) {\n                throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' +\n                    'has been overwritten.\\n' +\n                    'Most likely cause is that a Promise polyfill has been loaded ' +\n                    'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' +\n                    'If you must load one, do so before loading zone.js.)');\n            }\n        };\n        Object.defineProperty(Zone, \"root\", {\n            get: function () {\n                var zone = Zone.current;\n                while (zone.parent) {\n                    zone = zone.parent;\n                }\n                return zone;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Zone, \"current\", {\n            get: function () {\n                return _currentZoneFrame.zone;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Object.defineProperty(Zone, \"currentTask\", {\n            get: function () {\n                return _currentTask;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Zone.__load_patch = function (name, fn) {\n            if (patches.hasOwnProperty(name)) {\n                throw Error('Already loaded patch: ' + name);\n            }\n            else if (!global['__Zone_disable_' + name]) {\n                var perfName = 'Zone:' + name;\n                mark(perfName);\n                patches[name] = fn(global, Zone, _api);\n                performanceMeasure(perfName, perfName);\n            }\n        };\n        Object.defineProperty(Zone.prototype, \"parent\", {\n            get: function () {\n                return this._parent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Object.defineProperty(Zone.prototype, \"name\", {\n            get: function () {\n                return this._name;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Zone.prototype.get = function (key) {\n            var zone = this.getZoneWith(key);\n            if (zone)\n                return zone._properties[key];\n        };\n        Zone.prototype.getZoneWith = function (key) {\n            var current = this;\n            while (current) {\n                if (current._properties.hasOwnProperty(key)) {\n                    return current;\n                }\n                current = current._parent;\n            }\n            return null;\n        };\n        Zone.prototype.fork = function (zoneSpec) {\n            if (!zoneSpec)\n                throw new Error('ZoneSpec required!');\n            return this._zoneDelegate.fork(this, zoneSpec);\n        };\n        Zone.prototype.wrap = function (callback, source) {\n            if (typeof callback !== 'function') {\n                throw new Error('Expecting function got: ' + callback);\n            }\n            var _callback = this._zoneDelegate.intercept(this, callback, source);\n            var zone = this;\n            return function () {\n                return zone.runGuarded(_callback, this, arguments, source);\n            };\n        };\n        Zone.prototype.run = function (callback, applyThis, applyArgs, source) {\n            if (applyThis === void 0) { applyThis = undefined; }\n            if (applyArgs === void 0) { applyArgs = null; }\n            if (source === void 0) { source = null; }\n            _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n            try {\n                return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n            }\n            finally {\n                _currentZoneFrame = _currentZoneFrame.parent;\n            }\n        };\n        Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) {\n            if (applyThis === void 0) { applyThis = null; }\n            if (applyArgs === void 0) { applyArgs = null; }\n            if (source === void 0) { source = null; }\n            _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n            try {\n                try {\n                    return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n                }\n                catch (error) {\n                    if (this._zoneDelegate.handleError(this, error)) {\n                        throw error;\n                    }\n                }\n            }\n            finally {\n                _currentZoneFrame = _currentZoneFrame.parent;\n            }\n        };\n        Zone.prototype.runTask = function (task, applyThis, applyArgs) {\n            if (task.zone != this) {\n                throw new Error('A task can only be run in the zone of creation! (Creation: ' +\n                    (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n            }\n            // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n            // will run in notScheduled(canceled) state, we should not try to\n            // run such kind of task but just return\n            // we have to define an variable here, if not\n            // typescript compiler will complain below\n            var isNotScheduled = task.state === notScheduled;\n            if (isNotScheduled && task.type === eventTask) {\n                return;\n            }\n            var reEntryGuard = task.state != running;\n            reEntryGuard && task._transitionTo(running, scheduled);\n            task.runCount++;\n            var previousTask = _currentTask;\n            _currentTask = task;\n            _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n            try {\n                if (task.type == macroTask && task.data && !task.data.isPeriodic) {\n                    task.cancelFn = null;\n                }\n                try {\n                    return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);\n                }\n                catch (error) {\n                    if (this._zoneDelegate.handleError(this, error)) {\n                        throw error;\n                    }\n                }\n            }\n            finally {\n                // if the task's state is notScheduled or unknown, then it has already been cancelled\n                // we should not reset the state to scheduled\n                if (task.state !== notScheduled && task.state !== unknown) {\n                    if (task.type == eventTask || (task.data && task.data.isPeriodic)) {\n                        reEntryGuard && task._transitionTo(scheduled, running);\n                    }\n                    else {\n                        task.runCount = 0;\n                        this._updateTaskCount(task, -1);\n                        reEntryGuard &&\n                            task._transitionTo(notScheduled, running, notScheduled);\n                    }\n                }\n                _currentZoneFrame = _currentZoneFrame.parent;\n                _currentTask = previousTask;\n            }\n        };\n        Zone.prototype.scheduleTask = function (task) {\n            if (task.zone && task.zone !== this) {\n                // check if the task was rescheduled, the newZone\n                // should not be the children of the original zone\n                var newZone = this;\n                while (newZone) {\n                    if (newZone === task.zone) {\n                        throw Error(\"can not reschedule task to \" + this\n                            .name + \" which is descendants of the original zone \" + task.zone.name);\n                    }\n                    newZone = newZone.parent;\n                }\n            }\n            task._transitionTo(scheduling, notScheduled);\n            var zoneDelegates = [];\n            task._zoneDelegates = zoneDelegates;\n            task._zone = this;\n            try {\n                task = this._zoneDelegate.scheduleTask(this, task);\n            }\n            catch (err) {\n                // should set task's state to unknown when scheduleTask throw error\n                // because the err may from reschedule, so the fromState maybe notScheduled\n                task._transitionTo(unknown, scheduling, notScheduled);\n                // TODO: @JiaLiPassion, should we check the result from handleError?\n                this._zoneDelegate.handleError(this, err);\n                throw err;\n            }\n            if (task._zoneDelegates === zoneDelegates) {\n                // we have to check because internally the delegate can reschedule the task.\n                this._updateTaskCount(task, 1);\n            }\n            if (task.state == scheduling) {\n                task._transitionTo(scheduled, scheduling);\n            }\n            return task;\n        };\n        Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) {\n            return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, null));\n        };\n        Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) {\n            return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n        };\n        Zone.prototype.scheduleEventTask = function (source, callback, data, customSchedule, customCancel) {\n            return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n        };\n        Zone.prototype.cancelTask = function (task) {\n            if (task.zone != this)\n                throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' +\n                    (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n            task._transitionTo(canceling, scheduled, running);\n            try {\n                this._zoneDelegate.cancelTask(this, task);\n            }\n            catch (err) {\n                // if error occurs when cancelTask, transit the state to unknown\n                task._transitionTo(unknown, canceling);\n                this._zoneDelegate.handleError(this, err);\n                throw err;\n            }\n            this._updateTaskCount(task, -1);\n            task._transitionTo(notScheduled, canceling);\n            task.runCount = 0;\n            return task;\n        };\n        Zone.prototype._updateTaskCount = function (task, count) {\n            var zoneDelegates = task._zoneDelegates;\n            if (count == -1) {\n                task._zoneDelegates = null;\n            }\n            for (var i = 0; i < zoneDelegates.length; i++) {\n                zoneDelegates[i]._updateTaskCount(task.type, count);\n            }\n        };\n        return Zone;\n    }());\n    Zone.__symbol__ = __symbol__;\n    var DELEGATE_ZS = {\n        name: '',\n        onHasTask: function (delegate, _, target, hasTaskState) {\n            return delegate.hasTask(target, hasTaskState);\n        },\n        onScheduleTask: function (delegate, _, target, task) {\n            return delegate.scheduleTask(target, task);\n        },\n        onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) { return delegate.invokeTask(target, task, applyThis, applyArgs); },\n        onCancelTask: function (delegate, _, target, task) {\n            return delegate.cancelTask(target, task);\n        }\n    };\n    var ZoneDelegate = (function () {\n        function ZoneDelegate(zone, parentDelegate, zoneSpec) {\n            this._taskCounts = { 'microTask': 0, 'macroTask': 0, 'eventTask': 0 };\n            this.zone = zone;\n            this._parentDelegate = parentDelegate;\n            this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n            this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n            this._forkCurrZone = zoneSpec && (zoneSpec.onFork ? this.zone : parentDelegate.zone);\n            this._interceptZS =\n                zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n            this._interceptDlgt =\n                zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n            this._interceptCurrZone =\n                zoneSpec && (zoneSpec.onIntercept ? this.zone : parentDelegate.zone);\n            this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n            this._invokeDlgt =\n                zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n            this._invokeCurrZone = zoneSpec && (zoneSpec.onInvoke ? this.zone : parentDelegate.zone);\n            this._handleErrorZS =\n                zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n            this._handleErrorDlgt =\n                zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n            this._handleErrorCurrZone =\n                zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate.zone);\n            this._scheduleTaskZS =\n                zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n            this._scheduleTaskDlgt =\n                zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n            this._scheduleTaskCurrZone =\n                zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate.zone);\n            this._invokeTaskZS =\n                zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n            this._invokeTaskDlgt =\n                zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n            this._invokeTaskCurrZone =\n                zoneSpec && (zoneSpec.onInvokeTask ? this.zone : parentDelegate.zone);\n            this._cancelTaskZS =\n                zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n            this._cancelTaskDlgt =\n                zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n            this._cancelTaskCurrZone =\n                zoneSpec && (zoneSpec.onCancelTask ? this.zone : parentDelegate.zone);\n            this._hasTaskZS = null;\n            this._hasTaskDlgt = null;\n            this._hasTaskDlgtOwner = null;\n            this._hasTaskCurrZone = null;\n            var zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n            var parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n            if (zoneSpecHasTask || parentHasTask) {\n                // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n                // a case all task related interceptors must go through this ZD. We can't short circuit it.\n                this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n                this._hasTaskDlgt = parentDelegate;\n                this._hasTaskDlgtOwner = this;\n                this._hasTaskCurrZone = zone;\n                if (!zoneSpec.onScheduleTask) {\n                    this._scheduleTaskZS = DELEGATE_ZS;\n                    this._scheduleTaskDlgt = parentDelegate;\n                    this._scheduleTaskCurrZone = this.zone;\n                }\n                if (!zoneSpec.onInvokeTask) {\n                    this._invokeTaskZS = DELEGATE_ZS;\n                    this._invokeTaskDlgt = parentDelegate;\n                    this._invokeTaskCurrZone = this.zone;\n                }\n                if (!zoneSpec.onCancelTask) {\n                    this._cancelTaskZS = DELEGATE_ZS;\n                    this._cancelTaskDlgt = parentDelegate;\n                    this._cancelTaskCurrZone = this.zone;\n                }\n            }\n        }\n        ZoneDelegate.prototype.fork = function (targetZone, zoneSpec) {\n            return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) :\n                new Zone(targetZone, zoneSpec);\n        };\n        ZoneDelegate.prototype.intercept = function (targetZone, callback, source) {\n            return this._interceptZS ?\n                this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) :\n                callback;\n        };\n        ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) {\n            return this._invokeZS ?\n                this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :\n                callback.apply(applyThis, applyArgs);\n        };\n        ZoneDelegate.prototype.handleError = function (targetZone, error) {\n            return this._handleErrorZS ?\n                this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) :\n                true;\n        };\n        ZoneDelegate.prototype.scheduleTask = function (targetZone, task) {\n            var returnTask = task;\n            if (this._scheduleTaskZS) {\n                if (this._hasTaskZS) {\n                    returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n                }\n                returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n                if (!returnTask)\n                    returnTask = task;\n            }\n            else {\n                if (task.scheduleFn) {\n                    task.scheduleFn(task);\n                }\n                else if (task.type == microTask) {\n                    scheduleMicroTask(task);\n                }\n                else {\n                    throw new Error('Task is missing scheduleFn.');\n                }\n            }\n            return returnTask;\n        };\n        ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {\n            return this._invokeTaskZS ?\n                this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :\n                task.callback.apply(applyThis, applyArgs);\n        };\n        ZoneDelegate.prototype.cancelTask = function (targetZone, task) {\n            var value;\n            if (this._cancelTaskZS) {\n                value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n            }\n            else {\n                if (!task.cancelFn) {\n                    throw Error('Task is not cancelable');\n                }\n                value = task.cancelFn(task);\n            }\n            return value;\n        };\n        ZoneDelegate.prototype.hasTask = function (targetZone, isEmpty) {\n            // hasTask should not throw error so other ZoneDelegate\n            // can still trigger hasTask callback\n            try {\n                return this._hasTaskZS &&\n                    this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n            }\n            catch (err) {\n                this.handleError(targetZone, err);\n            }\n        };\n        ZoneDelegate.prototype._updateTaskCount = function (type, count) {\n            var counts = this._taskCounts;\n            var prev = counts[type];\n            var next = counts[type] = prev + count;\n            if (next < 0) {\n                throw new Error('More tasks executed then were scheduled.');\n            }\n            if (prev == 0 || next == 0) {\n                var isEmpty = {\n                    microTask: counts.microTask > 0,\n                    macroTask: counts.macroTask > 0,\n                    eventTask: counts.eventTask > 0,\n                    change: type\n                };\n                this.hasTask(this.zone, isEmpty);\n            }\n        };\n        return ZoneDelegate;\n    }());\n    var ZoneTask = (function () {\n        function ZoneTask(type, source, callback, options, scheduleFn, cancelFn) {\n            this._zone = null;\n            this.runCount = 0;\n            this._zoneDelegates = null;\n            this._state = 'notScheduled';\n            this.type = type;\n            this.source = source;\n            this.data = options;\n            this.scheduleFn = scheduleFn;\n            this.cancelFn = cancelFn;\n            this.callback = callback;\n            var self = this;\n            this.invoke = function () {\n                _numberOfNestedTaskFrames++;\n                try {\n                    self.runCount++;\n                    return self.zone.runTask(self, this, arguments);\n                }\n                finally {\n                    if (_numberOfNestedTaskFrames == 1) {\n                        drainMicroTaskQueue();\n                    }\n                    _numberOfNestedTaskFrames--;\n                }\n            };\n        }\n        Object.defineProperty(ZoneTask.prototype, \"zone\", {\n            get: function () {\n                return this._zone;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ZoneTask.prototype, \"state\", {\n            get: function () {\n                return this._state;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ZoneTask.prototype.cancelScheduleRequest = function () {\n            this._transitionTo(notScheduled, scheduling);\n        };\n        ZoneTask.prototype._transitionTo = function (toState, fromState1, fromState2) {\n            if (this._state === fromState1 || this._state === fromState2) {\n                this._state = toState;\n                if (toState == notScheduled) {\n                    this._zoneDelegates = null;\n                }\n            }\n            else {\n                throw new Error(this.type + \" '\" + this.source + \"': can not transition to '\" + toState + \"', expecting state '\" + fromState1 + \"'\" + (fromState2 ?\n                    ' or \\'' + fromState2 + '\\'' :\n                    '') + \", was '\" + this._state + \"'.\");\n            }\n        };\n        ZoneTask.prototype.toString = function () {\n            if (this.data && typeof this.data.handleId !== 'undefined') {\n                return this.data.handleId;\n            }\n            else {\n                return Object.prototype.toString.call(this);\n            }\n        };\n        // add toJSON method to prevent cyclic error when\n        // call JSON.stringify(zoneTask)\n        ZoneTask.prototype.toJSON = function () {\n            return {\n                type: this.type,\n                state: this.state,\n                source: this.source,\n                zone: this.zone.name,\n                invoke: this.invoke,\n                scheduleFn: this.scheduleFn,\n                cancelFn: this.cancelFn,\n                runCount: this.runCount,\n                callback: this.callback\n            };\n        };\n        return ZoneTask;\n    }());\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    ///  MICROTASK QUEUE\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    var symbolSetTimeout = __symbol__('setTimeout');\n    var symbolPromise = __symbol__('Promise');\n    var symbolThen = __symbol__('then');\n    var _microTaskQueue = [];\n    var _isDrainingMicrotaskQueue = false;\n    function scheduleMicroTask(task) {\n        // if we are not running in any task, and there has not been anything scheduled\n        // we must bootstrap the initial task creation by manually scheduling the drain\n        if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n            // We are not running in Task, so we need to kickstart the microtask queue.\n            if (global[symbolPromise]) {\n                global[symbolPromise].resolve(0)[symbolThen](drainMicroTaskQueue);\n            }\n            else {\n                global[symbolSetTimeout](drainMicroTaskQueue, 0);\n            }\n        }\n        task && _microTaskQueue.push(task);\n    }\n    function drainMicroTaskQueue() {\n        if (!_isDrainingMicrotaskQueue) {\n            _isDrainingMicrotaskQueue = true;\n            while (_microTaskQueue.length) {\n                var queue = _microTaskQueue;\n                _microTaskQueue = [];\n                for (var i = 0; i < queue.length; i++) {\n                    var task = queue[i];\n                    try {\n                        task.zone.runTask(task, null, null);\n                    }\n                    catch (error) {\n                        _api.onUnhandledError(error);\n                    }\n                }\n            }\n            var showError = !Zone[__symbol__('ignoreConsoleErrorUncaughtError')];\n            _api.microtaskDrainDone();\n            _isDrainingMicrotaskQueue = false;\n        }\n    }\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    ///  BOOTSTRAP\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    var NO_ZONE = { name: 'NO ZONE' };\n    var notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown';\n    var microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask';\n    var patches = {};\n    var _api = {\n        symbol: __symbol__,\n        currentZoneFrame: function () { return _currentZoneFrame; },\n        onUnhandledError: noop,\n        microtaskDrainDone: noop,\n        scheduleMicroTask: scheduleMicroTask,\n        showUncaughtError: function () { return !Zone[__symbol__('ignoreConsoleErrorUncaughtError')]; },\n        patchEventTargetMethods: function () { return false; },\n        patchOnProperties: noop,\n        patchMethod: function () { return noop; }\n    };\n    var _currentZoneFrame = { parent: null, zone: new Zone(null, null) };\n    var _currentTask = null;\n    var _numberOfNestedTaskFrames = 0;\n    function noop() { }\n    function __symbol__(name) {\n        return '__zone_symbol__' + name;\n    }\n    performanceMeasure('Zone', 'Zone');\n    return global['Zone'] = Zone;\n})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nZone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {\n    var __symbol__ = api.symbol;\n    var _uncaughtPromiseErrors = [];\n    var symbolPromise = __symbol__('Promise');\n    var symbolThen = __symbol__('then');\n    api.onUnhandledError = function (e) {\n        if (api.showUncaughtError()) {\n            var rejection = e && e.rejection;\n            if (rejection) {\n                console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n            }\n            console.error(e);\n        }\n    };\n    api.microtaskDrainDone = function () {\n        while (_uncaughtPromiseErrors.length) {\n            var _loop_1 = function () {\n                var uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n                try {\n                    uncaughtPromiseError.zone.runGuarded(function () {\n                        throw uncaughtPromiseError;\n                    });\n                }\n                catch (error) {\n                    handleUnhandledRejection(error);\n                }\n            };\n            while (_uncaughtPromiseErrors.length) {\n                _loop_1();\n            }\n        }\n    };\n    function handleUnhandledRejection(e) {\n        api.onUnhandledError(e);\n        try {\n            var handler = Zone[__symbol__('unhandledPromiseRejectionHandler')];\n            if (handler && typeof handler === 'function') {\n                handler.apply(this, [e]);\n            }\n        }\n        catch (err) {\n        }\n    }\n    function isThenable(value) {\n        return value && value.then;\n    }\n    function forwardResolution(value) {\n        return value;\n    }\n    function forwardRejection(rejection) {\n        return ZoneAwarePromise.reject(rejection);\n    }\n    var symbolState = __symbol__('state');\n    var symbolValue = __symbol__('value');\n    var source = 'Promise.then';\n    var UNRESOLVED = null;\n    var RESOLVED = true;\n    var REJECTED = false;\n    var REJECTED_NO_CATCH = 0;\n    function makeResolver(promise, state) {\n        return function (v) {\n            try {\n                resolvePromise(promise, state, v);\n            }\n            catch (err) {\n                resolvePromise(promise, false, err);\n            }\n            // Do not return value or you will break the Promise spec.\n        };\n    }\n    var once = function () {\n        var wasCalled = false;\n        return function wrapper(wrappedFunction) {\n            return function () {\n                if (wasCalled) {\n                    return;\n                }\n                wasCalled = true;\n                wrappedFunction.apply(null, arguments);\n            };\n        };\n    };\n    // Promise Resolution\n    function resolvePromise(promise, state, value) {\n        var onceWrapper = once();\n        if (promise === value) {\n            throw new TypeError('Promise resolved with itself');\n        }\n        if (promise[symbolState] === UNRESOLVED) {\n            // should only get value.then once based on promise spec.\n            var then = null;\n            try {\n                if (typeof value === 'object' || typeof value === 'function') {\n                    then = value && value.then;\n                }\n            }\n            catch (err) {\n                onceWrapper(function () {\n                    resolvePromise(promise, false, err);\n                })();\n                return promise;\n            }\n            // if (value instanceof ZoneAwarePromise) {\n            if (state !== REJECTED && value instanceof ZoneAwarePromise &&\n                value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) &&\n                value[symbolState] !== UNRESOLVED) {\n                clearRejectedNoCatch(value);\n                resolvePromise(promise, value[symbolState], value[symbolValue]);\n            }\n            else if (state !== REJECTED && typeof then === 'function') {\n                try {\n                    then.apply(value, [\n                        onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false))\n                    ]);\n                }\n                catch (err) {\n                    onceWrapper(function () {\n                        resolvePromise(promise, false, err);\n                    })();\n                }\n            }\n            else {\n                promise[symbolState] = state;\n                var queue = promise[symbolValue];\n                promise[symbolValue] = value;\n                // record task information in value when error occurs, so we can\n                // do some additional work such as render longStackTrace\n                if (state === REJECTED && value instanceof Error) {\n                    value[__symbol__('currentTask')] = Zone.currentTask;\n                }\n                for (var i = 0; i < queue.length;) {\n                    scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n                }\n                if (queue.length == 0 && state == REJECTED) {\n                    promise[symbolState] = REJECTED_NO_CATCH;\n                    try {\n                        throw new Error('Uncaught (in promise): ' + value +\n                            (value && value.stack ? '\\n' + value.stack : ''));\n                    }\n                    catch (err) {\n                        var error_1 = err;\n                        error_1.rejection = value;\n                        error_1.promise = promise;\n                        error_1.zone = Zone.current;\n                        error_1.task = Zone.currentTask;\n                        _uncaughtPromiseErrors.push(error_1);\n                        api.scheduleMicroTask(); // to make sure that it is running\n                    }\n                }\n            }\n        }\n        // Resolving an already resolved promise is a noop.\n        return promise;\n    }\n    function clearRejectedNoCatch(promise) {\n        if (promise[symbolState] === REJECTED_NO_CATCH) {\n            // if the promise is rejected no catch status\n            // and queue.length > 0, means there is a error handler\n            // here to handle the rejected promise, we should trigger\n            // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n            // eventHandler\n            try {\n                var handler = Zone[__symbol__('rejectionHandledHandler')];\n                if (handler && typeof handler === 'function') {\n                    handler.apply(this, [{ rejection: promise[symbolValue], promise: promise }]);\n                }\n            }\n            catch (err) {\n            }\n            promise[symbolState] = REJECTED;\n            for (var i = 0; i < _uncaughtPromiseErrors.length; i++) {\n                if (promise === _uncaughtPromiseErrors[i].promise) {\n                    _uncaughtPromiseErrors.splice(i, 1);\n                }\n            }\n        }\n    }\n    function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n        clearRejectedNoCatch(promise);\n        var delegate = promise[symbolState] ?\n            (typeof onFulfilled === 'function') ? onFulfilled : forwardResolution :\n            (typeof onRejected === 'function') ? onRejected : forwardRejection;\n        zone.scheduleMicroTask(source, function () {\n            try {\n                resolvePromise(chainPromise, true, zone.run(delegate, undefined, [promise[symbolValue]]));\n            }\n            catch (error) {\n                resolvePromise(chainPromise, false, error);\n            }\n        });\n    }\n    var ZoneAwarePromise = (function () {\n        function ZoneAwarePromise(executor) {\n            var promise = this;\n            if (!(promise instanceof ZoneAwarePromise)) {\n                throw new Error('Must be an instanceof Promise.');\n            }\n            promise[symbolState] = UNRESOLVED;\n            promise[symbolValue] = []; // queue;\n            try {\n                executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED));\n            }\n            catch (error) {\n                resolvePromise(promise, false, error);\n            }\n        }\n        ZoneAwarePromise.toString = function () {\n            return 'function ZoneAwarePromise() { [native code] }';\n        };\n        ZoneAwarePromise.resolve = function (value) {\n            return resolvePromise(new this(null), RESOLVED, value);\n        };\n        ZoneAwarePromise.reject = function (error) {\n            return resolvePromise(new this(null), REJECTED, error);\n        };\n        ZoneAwarePromise.race = function (values) {\n            var resolve;\n            var reject;\n            var promise = new this(function (res, rej) {\n                _a = [res, rej], resolve = _a[0], reject = _a[1];\n                var _a;\n            });\n            function onResolve(value) {\n                promise && (promise = null || resolve(value));\n            }\n            function onReject(error) {\n                promise && (promise = null || reject(error));\n            }\n            for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n                var value = values_1[_i];\n                if (!isThenable(value)) {\n                    value = this.resolve(value);\n                }\n                value.then(onResolve, onReject);\n            }\n            return promise;\n        };\n        ZoneAwarePromise.all = function (values) {\n            var resolve;\n            var reject;\n            var promise = new this(function (res, rej) {\n                resolve = res;\n                reject = rej;\n            });\n            var count = 0;\n            var resolvedValues = [];\n            for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {\n                var value = values_2[_i];\n                if (!isThenable(value)) {\n                    value = this.resolve(value);\n                }\n                value.then((function (index) { return function (value) {\n                    resolvedValues[index] = value;\n                    count--;\n                    if (!count) {\n                        resolve(resolvedValues);\n                    }\n                }; })(count), reject);\n                count++;\n            }\n            if (!count)\n                resolve(resolvedValues);\n            return promise;\n        };\n        ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {\n            var chainPromise = new this.constructor(null);\n            var zone = Zone.current;\n            if (this[symbolState] == UNRESOLVED) {\n                this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n            }\n            else {\n                scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n            }\n            return chainPromise;\n        };\n        ZoneAwarePromise.prototype.catch = function (onRejected) {\n            return this.then(null, onRejected);\n        };\n        return ZoneAwarePromise;\n    }());\n    // Protect against aggressive optimizers dropping seemingly unused properties.\n    // E.g. Closure Compiler in advanced mode.\n    ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n    ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n    ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n    ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n    var NativePromise = global[symbolPromise] = global['Promise'];\n    global['Promise'] = ZoneAwarePromise;\n    var symbolThenPatched = __symbol__('thenPatched');\n    function patchThen(Ctor) {\n        var proto = Ctor.prototype;\n        var originalThen = proto.then;\n        // Keep a reference to the original method.\n        proto[symbolThen] = originalThen;\n        Ctor.prototype.then = function (onResolve, onReject) {\n            var _this = this;\n            var wrapped = new ZoneAwarePromise(function (resolve, reject) {\n                originalThen.call(_this, resolve, reject);\n            });\n            return wrapped.then(onResolve, onReject);\n        };\n        Ctor[symbolThenPatched] = true;\n    }\n    function zoneify(fn) {\n        return function () {\n            var resultPromise = fn.apply(this, arguments);\n            if (resultPromise instanceof ZoneAwarePromise) {\n                return resultPromise;\n            }\n            var ctor = resultPromise.constructor;\n            if (!ctor[symbolThenPatched]) {\n                patchThen(ctor);\n            }\n            return resultPromise;\n        };\n    }\n    if (NativePromise) {\n        patchThen(NativePromise);\n        var fetch_1 = global['fetch'];\n        if (typeof fetch_1 == 'function') {\n            global['fetch'] = zoneify(fetch_1);\n        }\n    }\n    // This is not part of public API, but it is useful for tests, so we expose it.\n    Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n    return ZoneAwarePromise;\n});\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Suppress closure compiler errors about unknown 'Zone' variable\n * @fileoverview\n * @suppress {undefinedVars,globalThis}\n */\nvar zoneSymbol = function (n) { return \"__zone_symbol__\" + n; };\nvar _global = typeof window === 'object' && window || typeof self === 'object' && self || global;\nfunction bindArguments(args, source) {\n    for (var i = args.length - 1; i >= 0; i--) {\n        if (typeof args[i] === 'function') {\n            args[i] = Zone.current.wrap(args[i], source + '_' + i);\n        }\n    }\n    return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n    var source = prototype.constructor['name'];\n    var _loop_1 = function (i) {\n        var name_1 = fnNames[i];\n        var delegate = prototype[name_1];\n        if (delegate) {\n            prototype[name_1] = (function (delegate) {\n                var patched = function () {\n                    return delegate.apply(this, bindArguments(arguments, source + '.' + name_1));\n                };\n                attachOriginToPatched(patched, delegate);\n                return patched;\n            })(delegate);\n        }\n    };\n    for (var i = 0; i < fnNames.length; i++) {\n        _loop_1(i);\n    }\n}\nvar isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);\n// Make sure to access `process` through `_global` so that WebPack does not accidently browserify\n// this code.\nvar isNode = (!('nw' in _global) && typeof _global.process !== 'undefined' &&\n    {}.toString.call(_global.process) === '[object process]');\nvar isBrowser = !isNode && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']);\n// we are in electron of nw, so we are both browser and nodejs\n// Make sure to access `process` through `_global` so that WebPack does not accidently browserify\n// this code.\nvar isMix = typeof _global.process !== 'undefined' &&\n    {}.toString.call(_global.process) === '[object process]' && !isWebWorker &&\n    !!(typeof window !== 'undefined' && window['HTMLElement']);\nfunction patchProperty(obj, prop, prototype) {\n    var desc = Object.getOwnPropertyDescriptor(obj, prop);\n    if (!desc && prototype) {\n        // when patch window object, use prototype to check prop exist or not\n        var prototypeDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n        if (prototypeDesc) {\n            desc = { enumerable: true, configurable: true };\n        }\n    }\n    // if the descriptor not exists or is not configurable\n    // just return\n    if (!desc || !desc.configurable) {\n        return;\n    }\n    // A property descriptor cannot have getter/setter and be writable\n    // deleting the writable and value properties avoids this error:\n    //\n    // TypeError: property descriptors must not specify a value or be writable when a\n    // getter or setter has been specified\n    delete desc.writable;\n    delete desc.value;\n    var originalDescGet = desc.get;\n    // substr(2) cuz 'onclick' -> 'click', etc\n    var eventName = prop.substr(2);\n    var _prop = zoneSymbol('_' + prop);\n    desc.set = function (newValue) {\n        // in some of windows's onproperty callback, this is undefined\n        // so we need to check it\n        var target = this;\n        if (!target && obj === _global) {\n            target = _global;\n        }\n        if (!target) {\n            return;\n        }\n        var previousValue = target[_prop];\n        if (previousValue) {\n            target.removeEventListener(eventName, previousValue);\n        }\n        if (typeof newValue === 'function') {\n            var wrapFn = function (event) {\n                var result = newValue.apply(this, arguments);\n                if (result != undefined && !result) {\n                    event.preventDefault();\n                }\n                return result;\n            };\n            target[_prop] = wrapFn;\n            target.addEventListener(eventName, wrapFn, false);\n        }\n        else {\n            target[_prop] = null;\n        }\n    };\n    // The getter would return undefined for unassigned properties but the default value of an\n    // unassigned property is null\n    desc.get = function () {\n        // in some of windows's onproperty callback, this is undefined\n        // so we need to check it\n        var target = this;\n        if (!target && obj === _global) {\n            target = _global;\n        }\n        if (!target) {\n            return null;\n        }\n        if (target.hasOwnProperty(_prop)) {\n            return target[_prop];\n        }\n        else if (originalDescGet) {\n            // result will be null when use inline event attribute,\n            // such as <button onclick=\"func();\">OK</button>\n            // because the onclick function is internal raw uncompiled handler\n            // the onclick will be evaluated when first time event was triggered or\n            // the property is accessed, https://github.com/angular/zone.js/issues/525\n            // so we should use original native get to retrieve the handler\n            var value = originalDescGet && originalDescGet.apply(this);\n            if (value) {\n                desc.set.apply(this, [value]);\n                if (typeof target['removeAttribute'] === 'function') {\n                    target.removeAttribute(prop);\n                }\n                return value;\n            }\n        }\n        return null;\n    };\n    Object.defineProperty(obj, prop, desc);\n}\nfunction patchOnProperties(obj, properties, prototype) {\n    if (properties) {\n        for (var i = 0; i < properties.length; i++) {\n            patchProperty(obj, 'on' + properties[i], prototype);\n        }\n    }\n    else {\n        var onProperties = [];\n        for (var prop in obj) {\n            if (prop.substr(0, 2) == 'on') {\n                onProperties.push(prop);\n            }\n        }\n        for (var j = 0; j < onProperties.length; j++) {\n            patchProperty(obj, onProperties[j], prototype);\n        }\n    }\n}\nvar EVENT_TASKS = zoneSymbol('eventTasks');\n// For EventTarget\nvar ADD_EVENT_LISTENER = 'addEventListener';\nvar REMOVE_EVENT_LISTENER = 'removeEventListener';\n// compare the EventListenerOptionsOrCapture\n// 1. if the options is usCapture: boolean, compare the useCpature values directly\n// 2. if the options is EventListerOptions, only compare the capture\nfunction compareEventListenerOptions(left, right) {\n    var leftCapture = (typeof left === 'boolean') ?\n        left :\n        ((typeof left === 'object') ? (left && left.capture) : false);\n    var rightCapture = (typeof right === 'boolean') ?\n        right :\n        ((typeof right === 'object') ? (right && right.capture) : false);\n    return !!leftCapture === !!rightCapture;\n}\nfunction findExistingRegisteredTask(target, handler, name, options, remove) {\n    var eventTasks = target[EVENT_TASKS];\n    if (eventTasks) {\n        for (var i = 0; i < eventTasks.length; i++) {\n            var eventTask = eventTasks[i];\n            var data = eventTask.data;\n            var listener = data.handler;\n            if ((data.handler === handler || listener.listener === handler) &&\n                compareEventListenerOptions(data.options, options) && data.eventName === name) {\n                if (remove) {\n                    eventTasks.splice(i, 1);\n                }\n                return eventTask;\n            }\n        }\n    }\n    return null;\n}\nfunction attachRegisteredEvent(target, eventTask, isPrepend) {\n    var eventTasks = target[EVENT_TASKS];\n    if (!eventTasks) {\n        eventTasks = target[EVENT_TASKS] = [];\n    }\n    if (isPrepend) {\n        eventTasks.unshift(eventTask);\n    }\n    else {\n        eventTasks.push(eventTask);\n    }\n}\nvar defaultListenerMetaCreator = function (self, args) {\n    return {\n        options: args[2],\n        eventName: args[0],\n        handler: args[1],\n        target: self || _global,\n        name: args[0],\n        crossContext: false,\n        invokeAddFunc: function (addFnSymbol, delegate) {\n            // check if the data is cross site context, if it is, fallback to\n            // remove the delegate directly and try catch error\n            if (!this.crossContext) {\n                if (delegate && delegate.invoke) {\n                    return this.target[addFnSymbol](this.eventName, delegate.invoke, this.options);\n                }\n                else {\n                    return this.target[addFnSymbol](this.eventName, delegate, this.options);\n                }\n            }\n            else {\n                // add a if/else branch here for performance concern, for most times\n                // cross site context is false, so we don't need to try/catch\n                try {\n                    return this.target[addFnSymbol](this.eventName, delegate, this.options);\n                }\n                catch (err) {\n                    // do nothing here is fine, because objects in a cross-site context are unusable\n                }\n            }\n        },\n        invokeRemoveFunc: function (removeFnSymbol, delegate) {\n            // check if the data is cross site context, if it is, fallback to\n            // remove the delegate directly and try catch error\n            if (!this.crossContext) {\n                if (delegate && delegate.invoke) {\n                    return this.target[removeFnSymbol](this.eventName, delegate.invoke, this.options);\n                }\n                else {\n                    return this.target[removeFnSymbol](this.eventName, delegate, this.options);\n                }\n            }\n            else {\n                // add a if/else branch here for performance concern, for most times\n                // cross site context is false, so we don't need to try/catch\n                try {\n                    return this.target[removeFnSymbol](this.eventName, delegate, this.options);\n                }\n                catch (err) {\n                    // do nothing here is fine, because objects in a cross-site context are unusable\n                }\n            }\n        }\n    };\n};\nfunction makeZoneAwareAddListener(addFnName, removeFnName, useCapturingParam, allowDuplicates, isPrepend, metaCreator) {\n    if (useCapturingParam === void 0) { useCapturingParam = true; }\n    if (allowDuplicates === void 0) { allowDuplicates = false; }\n    if (isPrepend === void 0) { isPrepend = false; }\n    if (metaCreator === void 0) { metaCreator = defaultListenerMetaCreator; }\n    var addFnSymbol = zoneSymbol(addFnName);\n    var removeFnSymbol = zoneSymbol(removeFnName);\n    var defaultUseCapturing = useCapturingParam ? false : undefined;\n    function scheduleEventListener(eventTask) {\n        var meta = eventTask.data;\n        attachRegisteredEvent(meta.target, eventTask, isPrepend);\n        return meta.invokeAddFunc(addFnSymbol, eventTask);\n    }\n    function cancelEventListener(eventTask) {\n        var meta = eventTask.data;\n        findExistingRegisteredTask(meta.target, eventTask.invoke, meta.eventName, meta.options, true);\n        return meta.invokeRemoveFunc(removeFnSymbol, eventTask);\n    }\n    return function zoneAwareAddListener(self, args) {\n        var data = metaCreator(self, args);\n        data.options = data.options || defaultUseCapturing;\n        // - Inside a Web Worker, `this` is undefined, the context is `global`\n        // - When `addEventListener` is called on the global context in strict mode, `this` is undefined\n        // see https://github.com/angular/zone.js/issues/190\n        var delegate = null;\n        if (typeof data.handler == 'function') {\n            delegate = data.handler;\n        }\n        else if (data.handler && data.handler.handleEvent) {\n            delegate = function (event) { return data.handler.handleEvent(event); };\n        }\n        var validZoneHandler = false;\n        try {\n            // In cross site contexts (such as WebDriver frameworks like Selenium),\n            // accessing the handler object here will cause an exception to be thrown which\n            // will fail tests prematurely.\n            validZoneHandler = data.handler && data.handler.toString() === '[object FunctionWrapper]';\n        }\n        catch (error) {\n            // we can still try to add the data.handler even we are in cross site context\n            data.crossContext = true;\n            return data.invokeAddFunc(addFnSymbol, data.handler);\n        }\n        // Ignore special listeners of IE11 & Edge dev tools, see\n        // https://github.com/angular/zone.js/issues/150\n        if (!delegate || validZoneHandler) {\n            return data.invokeAddFunc(addFnSymbol, data.handler);\n        }\n        if (!allowDuplicates) {\n            var eventTask = findExistingRegisteredTask(data.target, data.handler, data.eventName, data.options, false);\n            if (eventTask) {\n                // we already registered, so this will have noop.\n                return data.invokeAddFunc(addFnSymbol, eventTask);\n            }\n        }\n        var zone = Zone.current;\n        var source = data.target.constructor['name'] + '.' + addFnName + ':' + data.eventName;\n        zone.scheduleEventTask(source, delegate, data, scheduleEventListener, cancelEventListener);\n    };\n}\nfunction makeZoneAwareRemoveListener(fnName, useCapturingParam, metaCreator) {\n    if (useCapturingParam === void 0) { useCapturingParam = true; }\n    if (metaCreator === void 0) { metaCreator = defaultListenerMetaCreator; }\n    var symbol = zoneSymbol(fnName);\n    var defaultUseCapturing = useCapturingParam ? false : undefined;\n    return function zoneAwareRemoveListener(self, args) {\n        var data = metaCreator(self, args);\n        data.options = data.options || defaultUseCapturing;\n        // - Inside a Web Worker, `this` is undefined, the context is `global`\n        // - When `addEventListener` is called on the global context in strict mode, `this` is undefined\n        // see https://github.com/angular/zone.js/issues/190\n        var delegate = null;\n        if (typeof data.handler == 'function') {\n            delegate = data.handler;\n        }\n        else if (data.handler && data.handler.handleEvent) {\n            delegate = function (event) { return data.handler.handleEvent(event); };\n        }\n        var validZoneHandler = false;\n        try {\n            // In cross site contexts (such as WebDriver frameworks like Selenium),\n            // accessing the handler object here will cause an exception to be thrown which\n            // will fail tests prematurely.\n            validZoneHandler = data.handler && data.handler.toString() === '[object FunctionWrapper]';\n        }\n        catch (error) {\n            data.crossContext = true;\n            return data.invokeRemoveFunc(symbol, data.handler);\n        }\n        // Ignore special listeners of IE11 & Edge dev tools, see\n        // https://github.com/angular/zone.js/issues/150\n        if (!delegate || validZoneHandler) {\n            return data.invokeRemoveFunc(symbol, data.handler);\n        }\n        var eventTask = findExistingRegisteredTask(data.target, data.handler, data.eventName, data.options, true);\n        if (eventTask) {\n            eventTask.zone.cancelTask(eventTask);\n        }\n        else {\n            data.invokeRemoveFunc(symbol, data.handler);\n        }\n    };\n}\n\n\nfunction patchEventTargetMethods(obj, addFnName, removeFnName, metaCreator) {\n    if (addFnName === void 0) { addFnName = ADD_EVENT_LISTENER; }\n    if (removeFnName === void 0) { removeFnName = REMOVE_EVENT_LISTENER; }\n    if (metaCreator === void 0) { metaCreator = defaultListenerMetaCreator; }\n    if (obj && obj[addFnName]) {\n        patchMethod(obj, addFnName, function () { return makeZoneAwareAddListener(addFnName, removeFnName, true, false, false, metaCreator); });\n        patchMethod(obj, removeFnName, function () { return makeZoneAwareRemoveListener(removeFnName, true, metaCreator); });\n        return true;\n    }\n    else {\n        return false;\n    }\n}\nvar originalInstanceKey = zoneSymbol('originalInstance');\n// wrap some native API on `window`\nfunction patchClass(className) {\n    var OriginalClass = _global[className];\n    if (!OriginalClass)\n        return;\n    // keep original class in global\n    _global[zoneSymbol(className)] = OriginalClass;\n    _global[className] = function () {\n        var a = bindArguments(arguments, className);\n        switch (a.length) {\n            case 0:\n                this[originalInstanceKey] = new OriginalClass();\n                break;\n            case 1:\n                this[originalInstanceKey] = new OriginalClass(a[0]);\n                break;\n            case 2:\n                this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n                break;\n            case 3:\n                this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n                break;\n            case 4:\n                this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n                break;\n            default:\n                throw new Error('Arg list too long.');\n        }\n    };\n    // attach original delegate to patched function\n    attachOriginToPatched(_global[className], OriginalClass);\n    var instance = new OriginalClass(function () { });\n    var prop;\n    for (prop in instance) {\n        // https://bugs.webkit.org/show_bug.cgi?id=44721\n        if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n            continue;\n        (function (prop) {\n            if (typeof instance[prop] === 'function') {\n                _global[className].prototype[prop] = function () {\n                    return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n                };\n            }\n            else {\n                Object.defineProperty(_global[className].prototype, prop, {\n                    set: function (fn) {\n                        if (typeof fn === 'function') {\n                            this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n                            // keep callback in wrapped function so we can\n                            // use it in Function.prototype.toString to return\n                            // the native one.\n                            attachOriginToPatched(this[originalInstanceKey][prop], fn);\n                        }\n                        else {\n                            this[originalInstanceKey][prop] = fn;\n                        }\n                    },\n                    get: function () {\n                        return this[originalInstanceKey][prop];\n                    }\n                });\n            }\n        }(prop));\n    }\n    for (prop in OriginalClass) {\n        if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n            _global[className][prop] = OriginalClass[prop];\n        }\n    }\n}\nfunction patchMethod(target, name, patchFn) {\n    var proto = target;\n    while (proto && !proto.hasOwnProperty(name)) {\n        proto = Object.getPrototypeOf(proto);\n    }\n    if (!proto && target[name]) {\n        // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n        proto = target;\n    }\n    var delegateName = zoneSymbol(name);\n    var delegate;\n    if (proto && !(delegate = proto[delegateName])) {\n        delegate = proto[delegateName] = proto[name];\n        var patchDelegate_1 = patchFn(delegate, delegateName, name);\n        proto[name] = function () {\n            return patchDelegate_1(this, arguments);\n        };\n        attachOriginToPatched(proto[name], delegate);\n    }\n    return delegate;\n}\n// TODO: @JiaLiPassion, support cancel task later if necessary\nfunction patchMacroTask(obj, funcName, metaCreator) {\n    var setNative = null;\n    function scheduleTask(task) {\n        var data = task.data;\n        data.args[data.callbackIndex] = function () {\n            task.invoke.apply(this, arguments);\n        };\n        setNative.apply(data.target, data.args);\n        return task;\n    }\n    setNative = patchMethod(obj, funcName, function (delegate) { return function (self, args) {\n        var meta = metaCreator(self, args);\n        if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') {\n            var task = Zone.current.scheduleMacroTask(meta.name, args[meta.callbackIndex], meta, scheduleTask, null);\n            return task;\n        }\n        else {\n            // cause an error by calling it directly.\n            return delegate.apply(self, args);\n        }\n    }; });\n}\n\nfunction findEventTask(target, evtName) {\n    var eventTasks = target[zoneSymbol('eventTasks')];\n    var result = [];\n    if (eventTasks) {\n        for (var i = 0; i < eventTasks.length; i++) {\n            var eventTask = eventTasks[i];\n            var data = eventTask.data;\n            var eventName = data && data.eventName;\n            if (eventName === evtName) {\n                result.push(eventTask);\n            }\n        }\n    }\n    return result;\n}\nfunction attachOriginToPatched(patched, original) {\n    patched[zoneSymbol('OriginalDelegate')] = original;\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// override Function.prototype.toString to make zone.js patched function\n// look like native function\nZone.__load_patch('toString', function (global, Zone, api) {\n    // patch Func.prototype.toString to let them look like native\n    var originalFunctionToString = Function.prototype.toString;\n    Function.prototype.toString = function () {\n        if (typeof this === 'function') {\n            var originalDelegate = this[zoneSymbol('OriginalDelegate')];\n            if (originalDelegate) {\n                if (typeof originalDelegate === 'function') {\n                    return originalFunctionToString.apply(this[zoneSymbol('OriginalDelegate')], arguments);\n                }\n                else {\n                    return Object.prototype.toString.call(originalDelegate);\n                }\n            }\n            if (this === Promise) {\n                var nativePromise = global[zoneSymbol('Promise')];\n                if (nativePromise) {\n                    return originalFunctionToString.apply(nativePromise, arguments);\n                }\n            }\n            if (this === Error) {\n                var nativeError = global[zoneSymbol('Error')];\n                if (nativeError) {\n                    return originalFunctionToString.apply(nativeError, arguments);\n                }\n            }\n        }\n        return originalFunctionToString.apply(this, arguments);\n    };\n    // patch Object.prototype.toString to let them look like native\n    var originalObjectToString = Object.prototype.toString;\n    Object.prototype.toString = function () {\n        if (this instanceof Promise) {\n            return '[object Promise]';\n        }\n        return originalObjectToString.apply(this, arguments);\n    };\n});\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nfunction patchTimer(window, setName, cancelName, nameSuffix) {\n    var setNative = null;\n    var clearNative = null;\n    setName += nameSuffix;\n    cancelName += nameSuffix;\n    var tasksByHandleId = {};\n    function scheduleTask(task) {\n        var data = task.data;\n        function timer() {\n            try {\n                task.invoke.apply(this, arguments);\n            }\n            finally {\n                if (typeof data.handleId === 'number') {\n                    // Node returns complex objects as handleIds\n                    delete tasksByHandleId[data.handleId];\n                }\n            }\n        }\n        data.args[0] = timer;\n        data.handleId = setNative.apply(window, data.args);\n        if (typeof data.handleId === 'number') {\n            // Node returns complex objects as handleIds -> no need to keep them around. Additionally,\n            // this throws an\n            // exception in older node versions and has no effect there, because of the stringified key.\n            tasksByHandleId[data.handleId] = task;\n        }\n        return task;\n    }\n    function clearTask(task) {\n        if (typeof task.data.handleId === 'number') {\n            // Node returns complex objects as handleIds\n            delete tasksByHandleId[task.data.handleId];\n        }\n        return clearNative(task.data.handleId);\n    }\n    setNative =\n        patchMethod(window, setName, function (delegate) { return function (self, args) {\n            if (typeof args[0] === 'function') {\n                var zone = Zone.current;\n                var options = {\n                    handleId: null,\n                    isPeriodic: nameSuffix === 'Interval',\n                    delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,\n                    args: args\n                };\n                var task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask);\n                if (!task) {\n                    return task;\n                }\n                // Node.js must additionally support the ref and unref functions.\n                var handle = task.data.handleId;\n                // check whether handle is null, because some polyfill or browser\n                // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame\n                if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&\n                    typeof handle.unref === 'function') {\n                    task.ref = handle.ref.bind(handle);\n                    task.unref = handle.unref.bind(handle);\n                }\n                return task;\n            }\n            else {\n                // cause an error by calling it directly.\n                return delegate.apply(window, args);\n            }\n        }; });\n    clearNative =\n        patchMethod(window, cancelName, function (delegate) { return function (self, args) {\n            var task = typeof args[0] === 'number' ? tasksByHandleId[args[0]] : args[0];\n            if (task && typeof task.type === 'string') {\n                if (task.state !== 'notScheduled' &&\n                    (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {\n                    // Do not cancel already canceled functions\n                    task.zone.cancelTask(task);\n                }\n            }\n            else {\n                // cause an error by calling it directly.\n                delegate.apply(window, args);\n            }\n        }; });\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/*\n * This is necessary for Chrome and Chrome mobile, to enable\n * things like redefining `createdCallback` on an element.\n */\nvar _defineProperty = Object[zoneSymbol('defineProperty')] = Object.defineProperty;\nvar _getOwnPropertyDescriptor = Object[zoneSymbol('getOwnPropertyDescriptor')] =\n    Object.getOwnPropertyDescriptor;\nvar _create = Object.create;\nvar unconfigurablesKey = zoneSymbol('unconfigurables');\nfunction propertyPatch() {\n    Object.defineProperty = function (obj, prop, desc) {\n        if (isUnconfigurable(obj, prop)) {\n            throw new TypeError('Cannot assign to read only property \\'' + prop + '\\' of ' + obj);\n        }\n        var originalConfigurableFlag = desc.configurable;\n        if (prop !== 'prototype') {\n            desc = rewriteDescriptor(obj, prop, desc);\n        }\n        return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);\n    };\n    Object.defineProperties = function (obj, props) {\n        Object.keys(props).forEach(function (prop) {\n            Object.defineProperty(obj, prop, props[prop]);\n        });\n        return obj;\n    };\n    Object.create = function (obj, proto) {\n        if (typeof proto === 'object' && !Object.isFrozen(proto)) {\n            Object.keys(proto).forEach(function (prop) {\n                proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);\n            });\n        }\n        return _create(obj, proto);\n    };\n    Object.getOwnPropertyDescriptor = function (obj, prop) {\n        var desc = _getOwnPropertyDescriptor(obj, prop);\n        if (isUnconfigurable(obj, prop)) {\n            desc.configurable = false;\n        }\n        return desc;\n    };\n}\nfunction _redefineProperty(obj, prop, desc) {\n    var originalConfigurableFlag = desc.configurable;\n    desc = rewriteDescriptor(obj, prop, desc);\n    return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);\n}\nfunction isUnconfigurable(obj, prop) {\n    return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop];\n}\nfunction rewriteDescriptor(obj, prop, desc) {\n    desc.configurable = true;\n    if (!desc.configurable) {\n        if (!obj[unconfigurablesKey]) {\n            _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} });\n        }\n        obj[unconfigurablesKey][prop] = true;\n    }\n    return desc;\n}\nfunction _tryDefineProperty(obj, prop, desc, originalConfigurableFlag) {\n    try {\n        return _defineProperty(obj, prop, desc);\n    }\n    catch (error) {\n        if (desc.configurable) {\n            // In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's\n            // retry with the original flag value\n            if (typeof originalConfigurableFlag == 'undefined') {\n                delete desc.configurable;\n            }\n            else {\n                desc.configurable = originalConfigurableFlag;\n            }\n            try {\n                return _defineProperty(obj, prop, desc);\n            }\n            catch (error) {\n                var descJson = null;\n                try {\n                    descJson = JSON.stringify(desc);\n                }\n                catch (error) {\n                    descJson = descJson.toString();\n                }\n                console.log(\"Attempting to configure '\" + prop + \"' with descriptor '\" + descJson + \"' on object '\" + obj + \"' and got error, giving up: \" + error);\n            }\n        }\n        else {\n            throw error;\n        }\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar WTF_ISSUE_555 = 'Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video';\nvar NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket'\n    .split(',');\nvar EVENT_TARGET = 'EventTarget';\nfunction eventTargetPatch(_global) {\n    var apis = [];\n    var isWtf = _global['wtf'];\n    if (isWtf) {\n        // Workaround for: https://github.com/google/tracing-framework/issues/555\n        apis = WTF_ISSUE_555.split(',').map(function (v) { return 'HTML' + v + 'Element'; }).concat(NO_EVENT_TARGET);\n    }\n    else if (_global[EVENT_TARGET]) {\n        apis.push(EVENT_TARGET);\n    }\n    else {\n        // Note: EventTarget is not available in all browsers,\n        // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget\n        apis = NO_EVENT_TARGET;\n    }\n    for (var i = 0; i < apis.length; i++) {\n        var type = _global[apis[i]];\n        patchEventTargetMethods(type && type.prototype);\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// we have to patch the instance since the proto is non-configurable\nfunction apply(_global) {\n    var WS = _global.WebSocket;\n    // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener\n    // On older Chrome, no need since EventTarget was already patched\n    if (!_global.EventTarget) {\n        patchEventTargetMethods(WS.prototype);\n    }\n    _global.WebSocket = function (a, b) {\n        var socket = arguments.length > 1 ? new WS(a, b) : new WS(a);\n        var proxySocket;\n        // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance\n        var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage');\n        if (onmessageDesc && onmessageDesc.configurable === false) {\n            proxySocket = Object.create(socket);\n            ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function (propName) {\n                proxySocket[propName] = function () {\n                    return socket[propName].apply(socket, arguments);\n                };\n            });\n        }\n        else {\n            // we can patch the real socket\n            proxySocket = socket;\n        }\n        patchOnProperties(proxySocket, ['close', 'error', 'message', 'open']);\n        return proxySocket;\n    };\n    for (var prop in WS) {\n        _global['WebSocket'][prop] = WS[prop];\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar globalEventHandlersEventNames = [\n    'abort',\n    'animationcancel',\n    'animationend',\n    'animationiteration',\n    'auxclick',\n    'beforeinput',\n    'blur',\n    'cancel',\n    'canplay',\n    'canplaythrough',\n    'change',\n    'compositionstart',\n    'compositionupdate',\n    'compositionend',\n    'cuechange',\n    'click',\n    'close',\n    'contextmenu',\n    'curechange',\n    'dblclick',\n    'drag',\n    'dragend',\n    'dragenter',\n    'dragexit',\n    'dragleave',\n    'dragover',\n    'drop',\n    'durationchange',\n    'emptied',\n    'ended',\n    'error',\n    'focus',\n    'focusin',\n    'focusout',\n    'gotpointercapture',\n    'input',\n    'invalid',\n    'keydown',\n    'keypress',\n    'keyup',\n    'load',\n    'loadstart',\n    'loadeddata',\n    'loadedmetadata',\n    'lostpointercapture',\n    'mousedown',\n    'mouseenter',\n    'mouseleave',\n    'mousemove',\n    'mouseout',\n    'mouseover',\n    'mouseup',\n    'mousewheel',\n    'pause',\n    'play',\n    'playing',\n    'pointercancel',\n    'pointerdown',\n    'pointerenter',\n    'pointerleave',\n    'pointerlockchange',\n    'mozpointerlockchange',\n    'webkitpointerlockerchange',\n    'pointerlockerror',\n    'mozpointerlockerror',\n    'webkitpointerlockerror',\n    'pointermove',\n    'pointout',\n    'pointerover',\n    'pointerup',\n    'progress',\n    'ratechange',\n    'reset',\n    'resize',\n    'scroll',\n    'seeked',\n    'seeking',\n    'select',\n    'selectionchange',\n    'selectstart',\n    'show',\n    'sort',\n    'stalled',\n    'submit',\n    'suspend',\n    'timeupdate',\n    'volumechange',\n    'touchcancel',\n    'touchmove',\n    'touchstart',\n    'transitioncancel',\n    'transitionend',\n    'waiting',\n    'wheel'\n];\nvar documentEventNames = [\n    'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'fullscreenchange',\n    'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror',\n    'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange'\n];\nvar windowEventNames = [\n    'absolutedeviceorientation',\n    'afterinput',\n    'afterprint',\n    'appinstalled',\n    'beforeinstallprompt',\n    'beforeprint',\n    'beforeunload',\n    'devicelight',\n    'devicemotion',\n    'deviceorientation',\n    'deviceorientationabsolute',\n    'deviceproximity',\n    'hashchange',\n    'languagechange',\n    'message',\n    'mozbeforepaint',\n    'offline',\n    'online',\n    'paint',\n    'pageshow',\n    'pagehide',\n    'popstate',\n    'rejectionhandled',\n    'storage',\n    'unhandledrejection',\n    'unload',\n    'userproximity',\n    'vrdisplyconnected',\n    'vrdisplaydisconnected',\n    'vrdisplaypresentchange'\n];\nvar htmlElementEventNames = [\n    'beforecopy', 'beforecut', 'beforepaste', 'copy', 'cut', 'paste', 'dragstart', 'loadend',\n    'animationstart', 'search', 'transitionrun', 'transitionstart', 'webkitanimationend',\n    'webkitanimationiteration', 'webkitanimationstart', 'webkittransitionend'\n];\nvar mediaElementEventNames = ['encrypted', 'waitingforkey', 'msneedkey', 'mozinterruptbegin', 'mozinterruptend'];\nvar ieElementEventNames = [\n    'activate',\n    'afterupdate',\n    'ariarequest',\n    'beforeactivate',\n    'beforedeactivate',\n    'beforeeditfocus',\n    'beforeupdate',\n    'cellchange',\n    'controlselect',\n    'dataavailable',\n    'datasetchanged',\n    'datasetcomplete',\n    'errorupdate',\n    'filterchange',\n    'layoutcomplete',\n    'losecapture',\n    'move',\n    'moveend',\n    'movestart',\n    'propertychange',\n    'resizeend',\n    'resizestart',\n    'rowenter',\n    'rowexit',\n    'rowsdelete',\n    'rowsinserted',\n    'command',\n    'compassneedscalibration',\n    'deactivate',\n    'help',\n    'mscontentzoom',\n    'msmanipulationstatechanged',\n    'msgesturechange',\n    'msgesturedoubletap',\n    'msgestureend',\n    'msgesturehold',\n    'msgesturestart',\n    'msgesturetap',\n    'msgotpointercapture',\n    'msinertiastart',\n    'mslostpointercapture',\n    'mspointercancel',\n    'mspointerdown',\n    'mspointerenter',\n    'mspointerhover',\n    'mspointerleave',\n    'mspointermove',\n    'mspointerout',\n    'mspointerover',\n    'mspointerup',\n    'pointerout',\n    'mssitemodejumplistitemremoved',\n    'msthumbnailclick',\n    'stop',\n    'storagecommit'\n];\nvar webglEventNames = ['webglcontextrestored', 'webglcontextlost', 'webglcontextcreationerror'];\nvar formEventNames = ['autocomplete', 'autocompleteerror'];\nvar detailEventNames = ['toggle'];\nvar frameEventNames = ['load'];\nvar frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll'];\nvar marqueeEventNames = ['bounce', 'finish', 'start'];\nvar XMLHttpRequestEventNames = [\n    'loadstart', 'progress', 'abort', 'error', 'load', 'progress', 'timeout', 'loadend',\n    'readystatechange'\n];\nvar IDBIndexEventNames = ['upgradeneeded', 'complete', 'abort', 'success', 'error', 'blocked', 'versionchange', 'close'];\nvar websocketEventNames = ['close', 'error', 'open', 'message'];\nvar eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);\nfunction propertyDescriptorPatch(_global) {\n    if (isNode && !isMix) {\n        return;\n    }\n    var supportsWebSocket = typeof WebSocket !== 'undefined';\n    if (canPatchViaPropertyDescriptor()) {\n        // for browsers that we can patch the descriptor:  Chrome & Firefox\n        if (isBrowser) {\n            // in IE/Edge, onProp not exist in window object, but in WindowPrototype\n            // so we need to pass WindowPrototype to check onProp exist or not\n            patchOnProperties(window, eventNames, Object.getPrototypeOf(window));\n            patchOnProperties(Document.prototype, eventNames);\n            if (typeof window['SVGElement'] !== 'undefined') {\n                patchOnProperties(window['SVGElement'].prototype, eventNames);\n            }\n            patchOnProperties(Element.prototype, eventNames);\n            patchOnProperties(HTMLElement.prototype, eventNames);\n            patchOnProperties(HTMLMediaElement.prototype, mediaElementEventNames);\n            patchOnProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames));\n            patchOnProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames));\n            patchOnProperties(HTMLFrameElement.prototype, frameEventNames);\n            patchOnProperties(HTMLIFrameElement.prototype, frameEventNames);\n            var HTMLMarqueeElement_1 = window['HTMLMarqueeElement'];\n            if (HTMLMarqueeElement_1) {\n                patchOnProperties(HTMLMarqueeElement_1.prototype, marqueeEventNames);\n            }\n        }\n        patchOnProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames);\n        var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];\n        if (XMLHttpRequestEventTarget) {\n            patchOnProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames);\n        }\n        if (typeof IDBIndex !== 'undefined') {\n            patchOnProperties(IDBIndex.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBRequest.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBDatabase.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBTransaction.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBCursor.prototype, IDBIndexEventNames);\n        }\n        if (supportsWebSocket) {\n            patchOnProperties(WebSocket.prototype, websocketEventNames);\n        }\n    }\n    else {\n        // Safari, Android browsers (Jelly Bean)\n        patchViaCapturingAllTheEvents();\n        patchClass('XMLHttpRequest');\n        if (supportsWebSocket) {\n            apply(_global);\n        }\n    }\n}\nfunction canPatchViaPropertyDescriptor() {\n    if ((isBrowser || isMix) && !Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') &&\n        typeof Element !== 'undefined') {\n        // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364\n        // IDL interface attributes are not configurable\n        var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick');\n        if (desc && !desc.configurable)\n            return false;\n    }\n    var xhrDesc = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'onreadystatechange');\n    // add enumerable and configurable here because in opera\n    // by default XMLHttpRequest.prototype.onreadystatechange is undefined\n    // without adding enumerable and configurable will cause onreadystatechange\n    // non-configurable\n    // and if XMLHttpRequest.prototype.onreadystatechange is undefined,\n    // we should set a real desc instead a fake one\n    if (xhrDesc) {\n        Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {\n            enumerable: true,\n            configurable: true,\n            get: function () {\n                return true;\n            }\n        });\n        var req = new XMLHttpRequest();\n        var result = !!req.onreadystatechange;\n        // restore original desc\n        Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', xhrDesc || {});\n        return result;\n    }\n    else {\n        Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {\n            enumerable: true,\n            configurable: true,\n            get: function () {\n                return this[zoneSymbol('fakeonreadystatechange')];\n            },\n            set: function (value) {\n                this[zoneSymbol('fakeonreadystatechange')] = value;\n            }\n        });\n        var req = new XMLHttpRequest();\n        var detectFunc = function () { };\n        req.onreadystatechange = detectFunc;\n        var result = req[zoneSymbol('fakeonreadystatechange')] === detectFunc;\n        req.onreadystatechange = null;\n        return result;\n    }\n}\n\nvar unboundKey = zoneSymbol('unbound');\n// Whenever any eventListener fires, we check the eventListener target and all parents\n// for `onwhatever` properties and replace them with zone-bound functions\n// - Chrome (for now)\nfunction patchViaCapturingAllTheEvents() {\n    var _loop_1 = function (i) {\n        var property = eventNames[i];\n        var onproperty = 'on' + property;\n        self.addEventListener(property, function (event) {\n            var elt = event.target, bound, source;\n            if (elt) {\n                source = elt.constructor['name'] + '.' + onproperty;\n            }\n            else {\n                source = 'unknown.' + onproperty;\n            }\n            while (elt) {\n                if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n                    bound = Zone.current.wrap(elt[onproperty], source);\n                    bound[unboundKey] = elt[onproperty];\n                    elt[onproperty] = bound;\n                }\n                elt = elt.parentElement;\n            }\n        }, true);\n    };\n    for (var i = 0; i < eventNames.length; i++) {\n        _loop_1(i);\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nfunction registerElementPatch(_global) {\n    if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {\n        return;\n    }\n    var _registerElement = document.registerElement;\n    var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];\n    document.registerElement = function (name, opts) {\n        if (opts && opts.prototype) {\n            callbacks.forEach(function (callback) {\n                var source = 'Document.registerElement::' + callback;\n                if (opts.prototype.hasOwnProperty(callback)) {\n                    var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);\n                    if (descriptor && descriptor.value) {\n                        descriptor.value = Zone.current.wrap(descriptor.value, source);\n                        _redefineProperty(opts.prototype, callback, descriptor);\n                    }\n                    else {\n                        opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);\n                    }\n                }\n                else if (opts.prototype[callback]) {\n                    opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);\n                }\n            });\n        }\n        return _registerElement.apply(document, [name, opts]);\n    };\n    attachOriginToPatched(document.registerElement, _registerElement);\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nZone.__load_patch('timers', function (global, Zone, api) {\n    var set = 'set';\n    var clear = 'clear';\n    patchTimer(global, set, clear, 'Timeout');\n    patchTimer(global, set, clear, 'Interval');\n    patchTimer(global, set, clear, 'Immediate');\n    patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n    patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n    patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n});\nZone.__load_patch('blocking', function (global, Zone, api) {\n    var blockingMethods = ['alert', 'prompt', 'confirm'];\n    for (var i = 0; i < blockingMethods.length; i++) {\n        var name_1 = blockingMethods[i];\n        patchMethod(global, name_1, function (delegate, symbol, name) {\n            return function (s, args) {\n                return Zone.current.run(delegate, global, args, name);\n            };\n        });\n    }\n});\nZone.__load_patch('EventTarget', function (global, Zone, api) {\n    eventTargetPatch(global);\n    // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n    var XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n    if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n        patchEventTargetMethods(XMLHttpRequestEventTarget.prototype);\n    }\n    patchClass('MutationObserver');\n    patchClass('WebKitMutationObserver');\n    patchClass('FileReader');\n});\nZone.__load_patch('on_property', function (global, Zone, api) {\n    propertyDescriptorPatch(global);\n    propertyPatch();\n    registerElementPatch(global);\n});\nZone.__load_patch('canvas', function (global, Zone, api) {\n    var HTMLCanvasElement = global['HTMLCanvasElement'];\n    if (typeof HTMLCanvasElement !== 'undefined' && HTMLCanvasElement.prototype &&\n        HTMLCanvasElement.prototype.toBlob) {\n        patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', function (self, args) {\n            return { name: 'HTMLCanvasElement.toBlob', target: self, callbackIndex: 0, args: args };\n        });\n    }\n});\nZone.__load_patch('XHR', function (global, Zone, api) {\n    // Treat XMLHTTPRequest as a macrotask.\n    patchXHR(global);\n    var XHR_TASK = zoneSymbol('xhrTask');\n    var XHR_SYNC = zoneSymbol('xhrSync');\n    var XHR_LISTENER = zoneSymbol('xhrListener');\n    var XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n    function patchXHR(window) {\n        function findPendingTask(target) {\n            var pendingTask = target[XHR_TASK];\n            return pendingTask;\n        }\n        function scheduleTask(task) {\n            XMLHttpRequest[XHR_SCHEDULED] = false;\n            var data = task.data;\n            // remove existing event listener\n            var listener = data.target[XHR_LISTENER];\n            var oriAddListener = data.target[zoneSymbol('addEventListener')];\n            var oriRemoveListener = data.target[zoneSymbol('removeEventListener')];\n            if (listener) {\n                oriRemoveListener.apply(data.target, ['readystatechange', listener]);\n            }\n            var newListener = data.target[XHR_LISTENER] = function () {\n                if (data.target.readyState === data.target.DONE) {\n                    // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n                    // readyState=4 multiple times, so we need to check task state here\n                    if (!data.aborted && XMLHttpRequest[XHR_SCHEDULED] &&\n                        task.state === 'scheduled') {\n                        task.invoke();\n                    }\n                }\n            };\n            oriAddListener.apply(data.target, ['readystatechange', newListener]);\n            var storedTask = data.target[XHR_TASK];\n            if (!storedTask) {\n                data.target[XHR_TASK] = task;\n            }\n            sendNative.apply(data.target, data.args);\n            XMLHttpRequest[XHR_SCHEDULED] = true;\n            return task;\n        }\n        function placeholderCallback() { }\n        function clearTask(task) {\n            var data = task.data;\n            // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n            // to prevent it from firing. So instead, we store info for the event listener.\n            data.aborted = true;\n            return abortNative.apply(data.target, data.args);\n        }\n        var openNative = patchMethod(window.XMLHttpRequest.prototype, 'open', function () { return function (self, args) {\n            self[XHR_SYNC] = args[2] == false;\n            return openNative.apply(self, args);\n        }; });\n        var sendNative = patchMethod(window.XMLHttpRequest.prototype, 'send', function () { return function (self, args) {\n            var zone = Zone.current;\n            if (self[XHR_SYNC]) {\n                // if the XHR is sync there is no task to schedule, just execute the code.\n                return sendNative.apply(self, args);\n            }\n            else {\n                var options = { target: self, isPeriodic: false, delay: null, args: args, aborted: false };\n                return zone.scheduleMacroTask('XMLHttpRequest.send', placeholderCallback, options, scheduleTask, clearTask);\n            }\n        }; });\n        var abortNative = patchMethod(window.XMLHttpRequest.prototype, 'abort', function (delegate) { return function (self, args) {\n            var task = findPendingTask(self);\n            if (task && typeof task.type == 'string') {\n                // If the XHR has already completed, do nothing.\n                // If the XHR has already been aborted, do nothing.\n                // Fix #569, call abort multiple times before done will cause\n                // macroTask task count be negative number\n                if (task.cancelFn == null || (task.data && task.data.aborted)) {\n                    return;\n                }\n                task.zone.cancelTask(task);\n            }\n            // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n            // task\n            // to cancel. Do nothing.\n        }; });\n    }\n});\nZone.__load_patch('geolocation', function (global, Zone, api) {\n    /// GEO_LOCATION\n    if (global['navigator'] && global['navigator'].geolocation) {\n        patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n    }\n});\nZone.__load_patch('PromiseRejectionEvent', function (global, Zone, api) {\n    // handle unhandled promise rejection\n    function findPromiseRejectionHandler(evtName) {\n        return function (e) {\n            var eventTasks = findEventTask(global, evtName);\n            eventTasks.forEach(function (eventTask) {\n                // windows has added unhandledrejection event listener\n                // trigger the event listener\n                var PromiseRejectionEvent = global['PromiseRejectionEvent'];\n                if (PromiseRejectionEvent) {\n                    var evt = new PromiseRejectionEvent(evtName, { promise: e.promise, reason: e.rejection });\n                    eventTask.invoke(evt);\n                }\n            });\n        };\n    }\n    if (global['PromiseRejectionEvent']) {\n        Zone[zoneSymbol('unhandledPromiseRejectionHandler')] =\n            findPromiseRejectionHandler('unhandledrejection');\n        Zone[zoneSymbol('rejectionHandledHandler')] =\n            findPromiseRejectionHandler('rejectionhandled');\n    }\n});\nZone.__load_patch('util', function (global, Zone, api) {\n    api.patchEventTargetMethods = patchEventTargetMethods;\n    api.patchOnProperties = patchOnProperties;\n    api.patchMethod = patchMethod;\n});\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n\n})));"
  },
  {
    "path": "test/lib/angular-4.js",
    "content": "/**\n* @license\n* Copyright Google Inc. 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://angular.io/license\n*/\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(factory());\n}(this, (function () { 'use strict';\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar Zone$1 = (function (global) {\n    var performance = global['performance'];\n    function mark(name) {\n        performance && performance['mark'] && performance['mark'](name);\n    }\n    function performanceMeasure(name, label) {\n        performance && performance['measure'] && performance['measure'](name, label);\n    }\n    mark('Zone');\n    if (global['Zone']) {\n        throw new Error('Zone already loaded.');\n    }\n    var Zone = (function () {\n        function Zone(parent, zoneSpec) {\n            this._properties = null;\n            this._parent = parent;\n            this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>';\n            this._properties = zoneSpec && zoneSpec.properties || {};\n            this._zoneDelegate =\n                new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n        }\n        Zone.assertZonePatched = function () {\n            if (global['Promise'] !== patches['ZoneAwarePromise']) {\n                throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' +\n                    'has been overwritten.\\n' +\n                    'Most likely cause is that a Promise polyfill has been loaded ' +\n                    'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' +\n                    'If you must load one, do so before loading zone.js.)');\n            }\n        };\n        Object.defineProperty(Zone, \"root\", {\n            get: function () {\n                var zone = Zone.current;\n                while (zone.parent) {\n                    zone = zone.parent;\n                }\n                return zone;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Zone, \"current\", {\n            get: function () {\n                return _currentZoneFrame.zone;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Object.defineProperty(Zone, \"currentTask\", {\n            get: function () {\n                return _currentTask;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Zone.__load_patch = function (name, fn) {\n            if (patches.hasOwnProperty(name)) {\n                throw Error('Already loaded patch: ' + name);\n            }\n            else if (!global['__Zone_disable_' + name]) {\n                var perfName = 'Zone:' + name;\n                mark(perfName);\n                patches[name] = fn(global, Zone, _api);\n                performanceMeasure(perfName, perfName);\n            }\n        };\n        Object.defineProperty(Zone.prototype, \"parent\", {\n            get: function () {\n                return this._parent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Object.defineProperty(Zone.prototype, \"name\", {\n            get: function () {\n                return this._name;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        \n        Zone.prototype.get = function (key) {\n            var zone = this.getZoneWith(key);\n            if (zone)\n                return zone._properties[key];\n        };\n        Zone.prototype.getZoneWith = function (key) {\n            var current = this;\n            while (current) {\n                if (current._properties.hasOwnProperty(key)) {\n                    return current;\n                }\n                current = current._parent;\n            }\n            return null;\n        };\n        Zone.prototype.fork = function (zoneSpec) {\n            if (!zoneSpec)\n                throw new Error('ZoneSpec required!');\n            return this._zoneDelegate.fork(this, zoneSpec);\n        };\n        Zone.prototype.wrap = function (callback, source) {\n            if (typeof callback !== 'function') {\n                throw new Error('Expecting function got: ' + callback);\n            }\n            var _callback = this._zoneDelegate.intercept(this, callback, source);\n            var zone = this;\n            return function () {\n                return zone.runGuarded(_callback, this, arguments, source);\n            };\n        };\n        Zone.prototype.run = function (callback, applyThis, applyArgs, source) {\n            if (applyThis === void 0) { applyThis = undefined; }\n            if (applyArgs === void 0) { applyArgs = null; }\n            if (source === void 0) { source = null; }\n            _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n            try {\n                return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n            }\n            finally {\n                _currentZoneFrame = _currentZoneFrame.parent;\n            }\n        };\n        Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) {\n            if (applyThis === void 0) { applyThis = null; }\n            if (applyArgs === void 0) { applyArgs = null; }\n            if (source === void 0) { source = null; }\n            _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n            try {\n                try {\n                    return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n                }\n                catch (error) {\n                    if (this._zoneDelegate.handleError(this, error)) {\n                        throw error;\n                    }\n                }\n            }\n            finally {\n                _currentZoneFrame = _currentZoneFrame.parent;\n            }\n        };\n        Zone.prototype.runTask = function (task, applyThis, applyArgs) {\n            if (task.zone != this) {\n                throw new Error('A task can only be run in the zone of creation! (Creation: ' +\n                    (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n            }\n            // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n            // will run in notScheduled(canceled) state, we should not try to\n            // run such kind of task but just return\n            // we have to define an variable here, if not\n            // typescript compiler will complain below\n            var isNotScheduled = task.state === notScheduled;\n            if (isNotScheduled && task.type === eventTask) {\n                return;\n            }\n            var reEntryGuard = task.state != running;\n            reEntryGuard && task._transitionTo(running, scheduled);\n            task.runCount++;\n            var previousTask = _currentTask;\n            _currentTask = task;\n            _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n            try {\n                if (task.type == macroTask && task.data && !task.data.isPeriodic) {\n                    task.cancelFn = null;\n                }\n                try {\n                    return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);\n                }\n                catch (error) {\n                    if (this._zoneDelegate.handleError(this, error)) {\n                        throw error;\n                    }\n                }\n            }\n            finally {\n                // if the task's state is notScheduled or unknown, then it has already been cancelled\n                // we should not reset the state to scheduled\n                if (task.state !== notScheduled && task.state !== unknown) {\n                    if (task.type == eventTask || (task.data && task.data.isPeriodic)) {\n                        reEntryGuard && task._transitionTo(scheduled, running);\n                    }\n                    else {\n                        task.runCount = 0;\n                        this._updateTaskCount(task, -1);\n                        reEntryGuard &&\n                            task._transitionTo(notScheduled, running, notScheduled);\n                    }\n                }\n                _currentZoneFrame = _currentZoneFrame.parent;\n                _currentTask = previousTask;\n            }\n        };\n        Zone.prototype.scheduleTask = function (task) {\n            if (task.zone && task.zone !== this) {\n                // check if the task was rescheduled, the newZone\n                // should not be the children of the original zone\n                var newZone = this;\n                while (newZone) {\n                    if (newZone === task.zone) {\n                        throw Error(\"can not reschedule task to \" + this\n                            .name + \" which is descendants of the original zone \" + task.zone.name);\n                    }\n                    newZone = newZone.parent;\n                }\n            }\n            task._transitionTo(scheduling, notScheduled);\n            var zoneDelegates = [];\n            task._zoneDelegates = zoneDelegates;\n            task._zone = this;\n            try {\n                task = this._zoneDelegate.scheduleTask(this, task);\n            }\n            catch (err) {\n                // should set task's state to unknown when scheduleTask throw error\n                // because the err may from reschedule, so the fromState maybe notScheduled\n                task._transitionTo(unknown, scheduling, notScheduled);\n                // TODO: @JiaLiPassion, should we check the result from handleError?\n                this._zoneDelegate.handleError(this, err);\n                throw err;\n            }\n            if (task._zoneDelegates === zoneDelegates) {\n                // we have to check because internally the delegate can reschedule the task.\n                this._updateTaskCount(task, 1);\n            }\n            if (task.state == scheduling) {\n                task._transitionTo(scheduled, scheduling);\n            }\n            return task;\n        };\n        Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) {\n            return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, null));\n        };\n        Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) {\n            return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n        };\n        Zone.prototype.scheduleEventTask = function (source, callback, data, customSchedule, customCancel) {\n            return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n        };\n        Zone.prototype.cancelTask = function (task) {\n            if (task.zone != this)\n                throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' +\n                    (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n            task._transitionTo(canceling, scheduled, running);\n            try {\n                this._zoneDelegate.cancelTask(this, task);\n            }\n            catch (err) {\n                // if error occurs when cancelTask, transit the state to unknown\n                task._transitionTo(unknown, canceling);\n                this._zoneDelegate.handleError(this, err);\n                throw err;\n            }\n            this._updateTaskCount(task, -1);\n            task._transitionTo(notScheduled, canceling);\n            task.runCount = 0;\n            return task;\n        };\n        Zone.prototype._updateTaskCount = function (task, count) {\n            var zoneDelegates = task._zoneDelegates;\n            if (count == -1) {\n                task._zoneDelegates = null;\n            }\n            for (var i = 0; i < zoneDelegates.length; i++) {\n                zoneDelegates[i]._updateTaskCount(task.type, count);\n            }\n        };\n        return Zone;\n    }());\n    Zone.__symbol__ = __symbol__;\n    var DELEGATE_ZS = {\n        name: '',\n        onHasTask: function (delegate, _, target, hasTaskState) {\n            return delegate.hasTask(target, hasTaskState);\n        },\n        onScheduleTask: function (delegate, _, target, task) {\n            return delegate.scheduleTask(target, task);\n        },\n        onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) { return delegate.invokeTask(target, task, applyThis, applyArgs); },\n        onCancelTask: function (delegate, _, target, task) {\n            return delegate.cancelTask(target, task);\n        }\n    };\n    var ZoneDelegate = (function () {\n        function ZoneDelegate(zone, parentDelegate, zoneSpec) {\n            this._taskCounts = { 'microTask': 0, 'macroTask': 0, 'eventTask': 0 };\n            this.zone = zone;\n            this._parentDelegate = parentDelegate;\n            this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n            this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n            this._forkCurrZone = zoneSpec && (zoneSpec.onFork ? this.zone : parentDelegate.zone);\n            this._interceptZS =\n                zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n            this._interceptDlgt =\n                zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n            this._interceptCurrZone =\n                zoneSpec && (zoneSpec.onIntercept ? this.zone : parentDelegate.zone);\n            this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n            this._invokeDlgt =\n                zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n            this._invokeCurrZone = zoneSpec && (zoneSpec.onInvoke ? this.zone : parentDelegate.zone);\n            this._handleErrorZS =\n                zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n            this._handleErrorDlgt =\n                zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n            this._handleErrorCurrZone =\n                zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate.zone);\n            this._scheduleTaskZS =\n                zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n            this._scheduleTaskDlgt =\n                zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n            this._scheduleTaskCurrZone =\n                zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate.zone);\n            this._invokeTaskZS =\n                zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n            this._invokeTaskDlgt =\n                zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n            this._invokeTaskCurrZone =\n                zoneSpec && (zoneSpec.onInvokeTask ? this.zone : parentDelegate.zone);\n            this._cancelTaskZS =\n                zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n            this._cancelTaskDlgt =\n                zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n            this._cancelTaskCurrZone =\n                zoneSpec && (zoneSpec.onCancelTask ? this.zone : parentDelegate.zone);\n            this._hasTaskZS = null;\n            this._hasTaskDlgt = null;\n            this._hasTaskDlgtOwner = null;\n            this._hasTaskCurrZone = null;\n            var zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n            var parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n            if (zoneSpecHasTask || parentHasTask) {\n                // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n                // a case all task related interceptors must go through this ZD. We can't short circuit it.\n                this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n                this._hasTaskDlgt = parentDelegate;\n                this._hasTaskDlgtOwner = this;\n                this._hasTaskCurrZone = zone;\n                if (!zoneSpec.onScheduleTask) {\n                    this._scheduleTaskZS = DELEGATE_ZS;\n                    this._scheduleTaskDlgt = parentDelegate;\n                    this._scheduleTaskCurrZone = this.zone;\n                }\n                if (!zoneSpec.onInvokeTask) {\n                    this._invokeTaskZS = DELEGATE_ZS;\n                    this._invokeTaskDlgt = parentDelegate;\n                    this._invokeTaskCurrZone = this.zone;\n                }\n                if (!zoneSpec.onCancelTask) {\n                    this._cancelTaskZS = DELEGATE_ZS;\n                    this._cancelTaskDlgt = parentDelegate;\n                    this._cancelTaskCurrZone = this.zone;\n                }\n            }\n        }\n        ZoneDelegate.prototype.fork = function (targetZone, zoneSpec) {\n            return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) :\n                new Zone(targetZone, zoneSpec);\n        };\n        ZoneDelegate.prototype.intercept = function (targetZone, callback, source) {\n            return this._interceptZS ?\n                this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) :\n                callback;\n        };\n        ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) {\n            return this._invokeZS ?\n                this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :\n                callback.apply(applyThis, applyArgs);\n        };\n        ZoneDelegate.prototype.handleError = function (targetZone, error) {\n            return this._handleErrorZS ?\n                this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) :\n                true;\n        };\n        ZoneDelegate.prototype.scheduleTask = function (targetZone, task) {\n            var returnTask = task;\n            if (this._scheduleTaskZS) {\n                if (this._hasTaskZS) {\n                    returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n                }\n                returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n                if (!returnTask)\n                    returnTask = task;\n            }\n            else {\n                if (task.scheduleFn) {\n                    task.scheduleFn(task);\n                }\n                else if (task.type == microTask) {\n                    scheduleMicroTask(task);\n                }\n                else {\n                    throw new Error('Task is missing scheduleFn.');\n                }\n            }\n            return returnTask;\n        };\n        ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {\n            return this._invokeTaskZS ?\n                this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :\n                task.callback.apply(applyThis, applyArgs);\n        };\n        ZoneDelegate.prototype.cancelTask = function (targetZone, task) {\n            var value;\n            if (this._cancelTaskZS) {\n                value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n            }\n            else {\n                if (!task.cancelFn) {\n                    throw Error('Task is not cancelable');\n                }\n                value = task.cancelFn(task);\n            }\n            return value;\n        };\n        ZoneDelegate.prototype.hasTask = function (targetZone, isEmpty) {\n            // hasTask should not throw error so other ZoneDelegate\n            // can still trigger hasTask callback\n            try {\n                return this._hasTaskZS &&\n                    this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n            }\n            catch (err) {\n                this.handleError(targetZone, err);\n            }\n        };\n        ZoneDelegate.prototype._updateTaskCount = function (type, count) {\n            var counts = this._taskCounts;\n            var prev = counts[type];\n            var next = counts[type] = prev + count;\n            if (next < 0) {\n                throw new Error('More tasks executed then were scheduled.');\n            }\n            if (prev == 0 || next == 0) {\n                var isEmpty = {\n                    microTask: counts.microTask > 0,\n                    macroTask: counts.macroTask > 0,\n                    eventTask: counts.eventTask > 0,\n                    change: type\n                };\n                this.hasTask(this.zone, isEmpty);\n            }\n        };\n        return ZoneDelegate;\n    }());\n    var ZoneTask = (function () {\n        function ZoneTask(type, source, callback, options, scheduleFn, cancelFn) {\n            this._zone = null;\n            this.runCount = 0;\n            this._zoneDelegates = null;\n            this._state = 'notScheduled';\n            this.type = type;\n            this.source = source;\n            this.data = options;\n            this.scheduleFn = scheduleFn;\n            this.cancelFn = cancelFn;\n            this.callback = callback;\n            var self = this;\n            this.invoke = function () {\n                _numberOfNestedTaskFrames++;\n                try {\n                    self.runCount++;\n                    return self.zone.runTask(self, this, arguments);\n                }\n                finally {\n                    if (_numberOfNestedTaskFrames == 1) {\n                        drainMicroTaskQueue();\n                    }\n                    _numberOfNestedTaskFrames--;\n                }\n            };\n        }\n        Object.defineProperty(ZoneTask.prototype, \"zone\", {\n            get: function () {\n                return this._zone;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ZoneTask.prototype, \"state\", {\n            get: function () {\n                return this._state;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ZoneTask.prototype.cancelScheduleRequest = function () {\n            this._transitionTo(notScheduled, scheduling);\n        };\n        ZoneTask.prototype._transitionTo = function (toState, fromState1, fromState2) {\n            if (this._state === fromState1 || this._state === fromState2) {\n                this._state = toState;\n                if (toState == notScheduled) {\n                    this._zoneDelegates = null;\n                }\n            }\n            else {\n                throw new Error(this.type + \" '\" + this.source + \"': can not transition to '\" + toState + \"', expecting state '\" + fromState1 + \"'\" + (fromState2 ?\n                    ' or \\'' + fromState2 + '\\'' :\n                    '') + \", was '\" + this._state + \"'.\");\n            }\n        };\n        ZoneTask.prototype.toString = function () {\n            if (this.data && typeof this.data.handleId !== 'undefined') {\n                return this.data.handleId;\n            }\n            else {\n                return Object.prototype.toString.call(this);\n            }\n        };\n        // add toJSON method to prevent cyclic error when\n        // call JSON.stringify(zoneTask)\n        ZoneTask.prototype.toJSON = function () {\n            return {\n                type: this.type,\n                state: this.state,\n                source: this.source,\n                zone: this.zone.name,\n                invoke: this.invoke,\n                scheduleFn: this.scheduleFn,\n                cancelFn: this.cancelFn,\n                runCount: this.runCount,\n                callback: this.callback\n            };\n        };\n        return ZoneTask;\n    }());\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    ///  MICROTASK QUEUE\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    var symbolSetTimeout = __symbol__('setTimeout');\n    var symbolPromise = __symbol__('Promise');\n    var symbolThen = __symbol__('then');\n    var _microTaskQueue = [];\n    var _isDrainingMicrotaskQueue = false;\n    function scheduleMicroTask(task) {\n        // if we are not running in any task, and there has not been anything scheduled\n        // we must bootstrap the initial task creation by manually scheduling the drain\n        if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n            // We are not running in Task, so we need to kickstart the microtask queue.\n            if (global[symbolPromise]) {\n                global[symbolPromise].resolve(0)[symbolThen](drainMicroTaskQueue);\n            }\n            else {\n                global[symbolSetTimeout](drainMicroTaskQueue, 0);\n            }\n        }\n        task && _microTaskQueue.push(task);\n    }\n    function drainMicroTaskQueue() {\n        if (!_isDrainingMicrotaskQueue) {\n            _isDrainingMicrotaskQueue = true;\n            while (_microTaskQueue.length) {\n                var queue = _microTaskQueue;\n                _microTaskQueue = [];\n                for (var i = 0; i < queue.length; i++) {\n                    var task = queue[i];\n                    try {\n                        task.zone.runTask(task, null, null);\n                    }\n                    catch (error) {\n                        _api.onUnhandledError(error);\n                    }\n                }\n            }\n            var showError = !Zone[__symbol__('ignoreConsoleErrorUncaughtError')];\n            _api.microtaskDrainDone();\n            _isDrainingMicrotaskQueue = false;\n        }\n    }\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    ///  BOOTSTRAP\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    var NO_ZONE = { name: 'NO ZONE' };\n    var notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown';\n    var microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask';\n    var patches = {};\n    var _api = {\n        symbol: __symbol__,\n        currentZoneFrame: function () { return _currentZoneFrame; },\n        onUnhandledError: noop,\n        microtaskDrainDone: noop,\n        scheduleMicroTask: scheduleMicroTask,\n        showUncaughtError: function () { return !Zone[__symbol__('ignoreConsoleErrorUncaughtError')]; },\n        patchEventTargetMethods: function () { return false; },\n        patchOnProperties: noop,\n        patchMethod: function () { return noop; }\n    };\n    var _currentZoneFrame = { parent: null, zone: new Zone(null, null) };\n    var _currentTask = null;\n    var _numberOfNestedTaskFrames = 0;\n    function noop() { }\n    function __symbol__(name) {\n        return '__zone_symbol__' + name;\n    }\n    performanceMeasure('Zone', 'Zone');\n    return global['Zone'] = Zone;\n})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nZone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {\n    var __symbol__ = api.symbol;\n    var _uncaughtPromiseErrors = [];\n    var symbolPromise = __symbol__('Promise');\n    var symbolThen = __symbol__('then');\n    api.onUnhandledError = function (e) {\n        if (api.showUncaughtError()) {\n            var rejection = e && e.rejection;\n            if (rejection) {\n                console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n            }\n            console.error(e);\n        }\n    };\n    api.microtaskDrainDone = function () {\n        while (_uncaughtPromiseErrors.length) {\n            var _loop_1 = function () {\n                var uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n                try {\n                    uncaughtPromiseError.zone.runGuarded(function () {\n                        throw uncaughtPromiseError;\n                    });\n                }\n                catch (error) {\n                    handleUnhandledRejection(error);\n                }\n            };\n            while (_uncaughtPromiseErrors.length) {\n                _loop_1();\n            }\n        }\n    };\n    function handleUnhandledRejection(e) {\n        api.onUnhandledError(e);\n        try {\n            var handler = Zone[__symbol__('unhandledPromiseRejectionHandler')];\n            if (handler && typeof handler === 'function') {\n                handler.apply(this, [e]);\n            }\n        }\n        catch (err) {\n        }\n    }\n    function isThenable(value) {\n        return value && value.then;\n    }\n    function forwardResolution(value) {\n        return value;\n    }\n    function forwardRejection(rejection) {\n        return ZoneAwarePromise.reject(rejection);\n    }\n    var symbolState = __symbol__('state');\n    var symbolValue = __symbol__('value');\n    var source = 'Promise.then';\n    var UNRESOLVED = null;\n    var RESOLVED = true;\n    var REJECTED = false;\n    var REJECTED_NO_CATCH = 0;\n    function makeResolver(promise, state) {\n        return function (v) {\n            try {\n                resolvePromise(promise, state, v);\n            }\n            catch (err) {\n                resolvePromise(promise, false, err);\n            }\n            // Do not return value or you will break the Promise spec.\n        };\n    }\n    var once = function () {\n        var wasCalled = false;\n        return function wrapper(wrappedFunction) {\n            return function () {\n                if (wasCalled) {\n                    return;\n                }\n                wasCalled = true;\n                wrappedFunction.apply(null, arguments);\n            };\n        };\n    };\n    // Promise Resolution\n    function resolvePromise(promise, state, value) {\n        var onceWrapper = once();\n        if (promise === value) {\n            throw new TypeError('Promise resolved with itself');\n        }\n        if (promise[symbolState] === UNRESOLVED) {\n            // should only get value.then once based on promise spec.\n            var then = null;\n            try {\n                if (typeof value === 'object' || typeof value === 'function') {\n                    then = value && value.then;\n                }\n            }\n            catch (err) {\n                onceWrapper(function () {\n                    resolvePromise(promise, false, err);\n                })();\n                return promise;\n            }\n            // if (value instanceof ZoneAwarePromise) {\n            if (state !== REJECTED && value instanceof ZoneAwarePromise &&\n                value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) &&\n                value[symbolState] !== UNRESOLVED) {\n                clearRejectedNoCatch(value);\n                resolvePromise(promise, value[symbolState], value[symbolValue]);\n            }\n            else if (state !== REJECTED && typeof then === 'function') {\n                try {\n                    then.apply(value, [\n                        onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false))\n                    ]);\n                }\n                catch (err) {\n                    onceWrapper(function () {\n                        resolvePromise(promise, false, err);\n                    })();\n                }\n            }\n            else {\n                promise[symbolState] = state;\n                var queue = promise[symbolValue];\n                promise[symbolValue] = value;\n                // record task information in value when error occurs, so we can\n                // do some additional work such as render longStackTrace\n                if (state === REJECTED && value instanceof Error) {\n                    value[__symbol__('currentTask')] = Zone.currentTask;\n                }\n                for (var i = 0; i < queue.length;) {\n                    scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n                }\n                if (queue.length == 0 && state == REJECTED) {\n                    promise[symbolState] = REJECTED_NO_CATCH;\n                    try {\n                        throw new Error('Uncaught (in promise): ' + value +\n                            (value && value.stack ? '\\n' + value.stack : ''));\n                    }\n                    catch (err) {\n                        var error_1 = err;\n                        error_1.rejection = value;\n                        error_1.promise = promise;\n                        error_1.zone = Zone.current;\n                        error_1.task = Zone.currentTask;\n                        _uncaughtPromiseErrors.push(error_1);\n                        api.scheduleMicroTask(); // to make sure that it is running\n                    }\n                }\n            }\n        }\n        // Resolving an already resolved promise is a noop.\n        return promise;\n    }\n    function clearRejectedNoCatch(promise) {\n        if (promise[symbolState] === REJECTED_NO_CATCH) {\n            // if the promise is rejected no catch status\n            // and queue.length > 0, means there is a error handler\n            // here to handle the rejected promise, we should trigger\n            // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n            // eventHandler\n            try {\n                var handler = Zone[__symbol__('rejectionHandledHandler')];\n                if (handler && typeof handler === 'function') {\n                    handler.apply(this, [{ rejection: promise[symbolValue], promise: promise }]);\n                }\n            }\n            catch (err) {\n            }\n            promise[symbolState] = REJECTED;\n            for (var i = 0; i < _uncaughtPromiseErrors.length; i++) {\n                if (promise === _uncaughtPromiseErrors[i].promise) {\n                    _uncaughtPromiseErrors.splice(i, 1);\n                }\n            }\n        }\n    }\n    function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n        clearRejectedNoCatch(promise);\n        var delegate = promise[symbolState] ?\n            (typeof onFulfilled === 'function') ? onFulfilled : forwardResolution :\n            (typeof onRejected === 'function') ? onRejected : forwardRejection;\n        zone.scheduleMicroTask(source, function () {\n            try {\n                resolvePromise(chainPromise, true, zone.run(delegate, undefined, [promise[symbolValue]]));\n            }\n            catch (error) {\n                resolvePromise(chainPromise, false, error);\n            }\n        });\n    }\n    var ZoneAwarePromise = (function () {\n        function ZoneAwarePromise(executor) {\n            var promise = this;\n            if (!(promise instanceof ZoneAwarePromise)) {\n                throw new Error('Must be an instanceof Promise.');\n            }\n            promise[symbolState] = UNRESOLVED;\n            promise[symbolValue] = []; // queue;\n            try {\n                executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED));\n            }\n            catch (error) {\n                resolvePromise(promise, false, error);\n            }\n        }\n        ZoneAwarePromise.toString = function () {\n            return 'function ZoneAwarePromise() { [native code] }';\n        };\n        ZoneAwarePromise.resolve = function (value) {\n            return resolvePromise(new this(null), RESOLVED, value);\n        };\n        ZoneAwarePromise.reject = function (error) {\n            return resolvePromise(new this(null), REJECTED, error);\n        };\n        ZoneAwarePromise.race = function (values) {\n            var resolve;\n            var reject;\n            var promise = new this(function (res, rej) {\n                _a = [res, rej], resolve = _a[0], reject = _a[1];\n                var _a;\n            });\n            function onResolve(value) {\n                promise && (promise = null || resolve(value));\n            }\n            function onReject(error) {\n                promise && (promise = null || reject(error));\n            }\n            for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n                var value = values_1[_i];\n                if (!isThenable(value)) {\n                    value = this.resolve(value);\n                }\n                value.then(onResolve, onReject);\n            }\n            return promise;\n        };\n        ZoneAwarePromise.all = function (values) {\n            var resolve;\n            var reject;\n            var promise = new this(function (res, rej) {\n                resolve = res;\n                reject = rej;\n            });\n            var count = 0;\n            var resolvedValues = [];\n            for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {\n                var value = values_2[_i];\n                if (!isThenable(value)) {\n                    value = this.resolve(value);\n                }\n                value.then((function (index) { return function (value) {\n                    resolvedValues[index] = value;\n                    count--;\n                    if (!count) {\n                        resolve(resolvedValues);\n                    }\n                }; })(count), reject);\n                count++;\n            }\n            if (!count)\n                resolve(resolvedValues);\n            return promise;\n        };\n        ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {\n            var chainPromise = new this.constructor(null);\n            var zone = Zone.current;\n            if (this[symbolState] == UNRESOLVED) {\n                this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n            }\n            else {\n                scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n            }\n            return chainPromise;\n        };\n        ZoneAwarePromise.prototype.catch = function (onRejected) {\n            return this.then(null, onRejected);\n        };\n        return ZoneAwarePromise;\n    }());\n    // Protect against aggressive optimizers dropping seemingly unused properties.\n    // E.g. Closure Compiler in advanced mode.\n    ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n    ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n    ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n    ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n    var NativePromise = global[symbolPromise] = global['Promise'];\n    global['Promise'] = ZoneAwarePromise;\n    var symbolThenPatched = __symbol__('thenPatched');\n    function patchThen(Ctor) {\n        var proto = Ctor.prototype;\n        var originalThen = proto.then;\n        // Keep a reference to the original method.\n        proto[symbolThen] = originalThen;\n        Ctor.prototype.then = function (onResolve, onReject) {\n            var _this = this;\n            var wrapped = new ZoneAwarePromise(function (resolve, reject) {\n                originalThen.call(_this, resolve, reject);\n            });\n            return wrapped.then(onResolve, onReject);\n        };\n        Ctor[symbolThenPatched] = true;\n    }\n    function zoneify(fn) {\n        return function () {\n            var resultPromise = fn.apply(this, arguments);\n            if (resultPromise instanceof ZoneAwarePromise) {\n                return resultPromise;\n            }\n            var ctor = resultPromise.constructor;\n            if (!ctor[symbolThenPatched]) {\n                patchThen(ctor);\n            }\n            return resultPromise;\n        };\n    }\n    if (NativePromise) {\n        patchThen(NativePromise);\n        var fetch_1 = global['fetch'];\n        if (typeof fetch_1 == 'function') {\n            global['fetch'] = zoneify(fetch_1);\n        }\n    }\n    // This is not part of public API, but it is useful for tests, so we expose it.\n    Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n    return ZoneAwarePromise;\n});\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Suppress closure compiler errors about unknown 'Zone' variable\n * @fileoverview\n * @suppress {undefinedVars,globalThis}\n */\nvar zoneSymbol = function (n) { return \"__zone_symbol__\" + n; };\nvar _global = typeof window === 'object' && window || typeof self === 'object' && self || global;\nfunction bindArguments(args, source) {\n    for (var i = args.length - 1; i >= 0; i--) {\n        if (typeof args[i] === 'function') {\n            args[i] = Zone.current.wrap(args[i], source + '_' + i);\n        }\n    }\n    return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n    var source = prototype.constructor['name'];\n    var _loop_1 = function (i) {\n        var name_1 = fnNames[i];\n        var delegate = prototype[name_1];\n        if (delegate) {\n            prototype[name_1] = (function (delegate) {\n                var patched = function () {\n                    return delegate.apply(this, bindArguments(arguments, source + '.' + name_1));\n                };\n                attachOriginToPatched(patched, delegate);\n                return patched;\n            })(delegate);\n        }\n    };\n    for (var i = 0; i < fnNames.length; i++) {\n        _loop_1(i);\n    }\n}\nvar isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);\n// Make sure to access `process` through `_global` so that WebPack does not accidently browserify\n// this code.\nvar isNode = (!('nw' in _global) && typeof _global.process !== 'undefined' &&\n    {}.toString.call(_global.process) === '[object process]');\nvar isBrowser = !isNode && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']);\n// we are in electron of nw, so we are both browser and nodejs\n// Make sure to access `process` through `_global` so that WebPack does not accidently browserify\n// this code.\nvar isMix = typeof _global.process !== 'undefined' &&\n    {}.toString.call(_global.process) === '[object process]' && !isWebWorker &&\n    !!(typeof window !== 'undefined' && window['HTMLElement']);\nfunction patchProperty(obj, prop, prototype) {\n    var desc = Object.getOwnPropertyDescriptor(obj, prop);\n    if (!desc && prototype) {\n        // when patch window object, use prototype to check prop exist or not\n        var prototypeDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n        if (prototypeDesc) {\n            desc = { enumerable: true, configurable: true };\n        }\n    }\n    // if the descriptor not exists or is not configurable\n    // just return\n    if (!desc || !desc.configurable) {\n        return;\n    }\n    // A property descriptor cannot have getter/setter and be writable\n    // deleting the writable and value properties avoids this error:\n    //\n    // TypeError: property descriptors must not specify a value or be writable when a\n    // getter or setter has been specified\n    delete desc.writable;\n    delete desc.value;\n    var originalDescGet = desc.get;\n    // substr(2) cuz 'onclick' -> 'click', etc\n    var eventName = prop.substr(2);\n    var _prop = zoneSymbol('_' + prop);\n    desc.set = function (newValue) {\n        // in some of windows's onproperty callback, this is undefined\n        // so we need to check it\n        var target = this;\n        if (!target && obj === _global) {\n            target = _global;\n        }\n        if (!target) {\n            return;\n        }\n        var previousValue = target[_prop];\n        if (previousValue) {\n            target.removeEventListener(eventName, previousValue);\n        }\n        if (typeof newValue === 'function') {\n            var wrapFn = function (event) {\n                var result = newValue.apply(this, arguments);\n                if (result != undefined && !result) {\n                    event.preventDefault();\n                }\n                return result;\n            };\n            target[_prop] = wrapFn;\n            target.addEventListener(eventName, wrapFn, false);\n        }\n        else {\n            target[_prop] = null;\n        }\n    };\n    // The getter would return undefined for unassigned properties but the default value of an\n    // unassigned property is null\n    desc.get = function () {\n        // in some of windows's onproperty callback, this is undefined\n        // so we need to check it\n        var target = this;\n        if (!target && obj === _global) {\n            target = _global;\n        }\n        if (!target) {\n            return null;\n        }\n        if (target.hasOwnProperty(_prop)) {\n            return target[_prop];\n        }\n        else if (originalDescGet) {\n            // result will be null when use inline event attribute,\n            // such as <button onclick=\"func();\">OK</button>\n            // because the onclick function is internal raw uncompiled handler\n            // the onclick will be evaluated when first time event was triggered or\n            // the property is accessed, https://github.com/angular/zone.js/issues/525\n            // so we should use original native get to retrieve the handler\n            var value = originalDescGet && originalDescGet.apply(this);\n            if (value) {\n                desc.set.apply(this, [value]);\n                if (typeof target['removeAttribute'] === 'function') {\n                    target.removeAttribute(prop);\n                }\n                return value;\n            }\n        }\n        return null;\n    };\n    Object.defineProperty(obj, prop, desc);\n}\nfunction patchOnProperties(obj, properties, prototype) {\n    if (properties) {\n        for (var i = 0; i < properties.length; i++) {\n            patchProperty(obj, 'on' + properties[i], prototype);\n        }\n    }\n    else {\n        var onProperties = [];\n        for (var prop in obj) {\n            if (prop.substr(0, 2) == 'on') {\n                onProperties.push(prop);\n            }\n        }\n        for (var j = 0; j < onProperties.length; j++) {\n            patchProperty(obj, onProperties[j], prototype);\n        }\n    }\n}\nvar EVENT_TASKS = zoneSymbol('eventTasks');\n// For EventTarget\nvar ADD_EVENT_LISTENER = 'addEventListener';\nvar REMOVE_EVENT_LISTENER = 'removeEventListener';\n// compare the EventListenerOptionsOrCapture\n// 1. if the options is usCapture: boolean, compare the useCpature values directly\n// 2. if the options is EventListerOptions, only compare the capture\nfunction compareEventListenerOptions(left, right) {\n    var leftCapture = (typeof left === 'boolean') ?\n        left :\n        ((typeof left === 'object') ? (left && left.capture) : false);\n    var rightCapture = (typeof right === 'boolean') ?\n        right :\n        ((typeof right === 'object') ? (right && right.capture) : false);\n    return !!leftCapture === !!rightCapture;\n}\nfunction findExistingRegisteredTask(target, handler, name, options, remove) {\n    var eventTasks = target[EVENT_TASKS];\n    if (eventTasks) {\n        for (var i = 0; i < eventTasks.length; i++) {\n            var eventTask = eventTasks[i];\n            var data = eventTask.data;\n            var listener = data.handler;\n            if ((data.handler === handler || listener.listener === handler) &&\n                compareEventListenerOptions(data.options, options) && data.eventName === name) {\n                if (remove) {\n                    eventTasks.splice(i, 1);\n                }\n                return eventTask;\n            }\n        }\n    }\n    return null;\n}\nfunction attachRegisteredEvent(target, eventTask, isPrepend) {\n    var eventTasks = target[EVENT_TASKS];\n    if (!eventTasks) {\n        eventTasks = target[EVENT_TASKS] = [];\n    }\n    if (isPrepend) {\n        eventTasks.unshift(eventTask);\n    }\n    else {\n        eventTasks.push(eventTask);\n    }\n}\nvar defaultListenerMetaCreator = function (self, args) {\n    return {\n        options: args[2],\n        eventName: args[0],\n        handler: args[1],\n        target: self || _global,\n        name: args[0],\n        crossContext: false,\n        invokeAddFunc: function (addFnSymbol, delegate) {\n            // check if the data is cross site context, if it is, fallback to\n            // remove the delegate directly and try catch error\n            if (!this.crossContext) {\n                if (delegate && delegate.invoke) {\n                    return this.target[addFnSymbol](this.eventName, delegate.invoke, this.options);\n                }\n                else {\n                    return this.target[addFnSymbol](this.eventName, delegate, this.options);\n                }\n            }\n            else {\n                // add a if/else branch here for performance concern, for most times\n                // cross site context is false, so we don't need to try/catch\n                try {\n                    return this.target[addFnSymbol](this.eventName, delegate, this.options);\n                }\n                catch (err) {\n                    // do nothing here is fine, because objects in a cross-site context are unusable\n                }\n            }\n        },\n        invokeRemoveFunc: function (removeFnSymbol, delegate) {\n            // check if the data is cross site context, if it is, fallback to\n            // remove the delegate directly and try catch error\n            if (!this.crossContext) {\n                if (delegate && delegate.invoke) {\n                    return this.target[removeFnSymbol](this.eventName, delegate.invoke, this.options);\n                }\n                else {\n                    return this.target[removeFnSymbol](this.eventName, delegate, this.options);\n                }\n            }\n            else {\n                // add a if/else branch here for performance concern, for most times\n                // cross site context is false, so we don't need to try/catch\n                try {\n                    return this.target[removeFnSymbol](this.eventName, delegate, this.options);\n                }\n                catch (err) {\n                    // do nothing here is fine, because objects in a cross-site context are unusable\n                }\n            }\n        }\n    };\n};\nfunction makeZoneAwareAddListener(addFnName, removeFnName, useCapturingParam, allowDuplicates, isPrepend, metaCreator) {\n    if (useCapturingParam === void 0) { useCapturingParam = true; }\n    if (allowDuplicates === void 0) { allowDuplicates = false; }\n    if (isPrepend === void 0) { isPrepend = false; }\n    if (metaCreator === void 0) { metaCreator = defaultListenerMetaCreator; }\n    var addFnSymbol = zoneSymbol(addFnName);\n    var removeFnSymbol = zoneSymbol(removeFnName);\n    var defaultUseCapturing = useCapturingParam ? false : undefined;\n    function scheduleEventListener(eventTask) {\n        var meta = eventTask.data;\n        attachRegisteredEvent(meta.target, eventTask, isPrepend);\n        return meta.invokeAddFunc(addFnSymbol, eventTask);\n    }\n    function cancelEventListener(eventTask) {\n        var meta = eventTask.data;\n        findExistingRegisteredTask(meta.target, eventTask.invoke, meta.eventName, meta.options, true);\n        return meta.invokeRemoveFunc(removeFnSymbol, eventTask);\n    }\n    return function zoneAwareAddListener(self, args) {\n        var data = metaCreator(self, args);\n        data.options = data.options || defaultUseCapturing;\n        // - Inside a Web Worker, `this` is undefined, the context is `global`\n        // - When `addEventListener` is called on the global context in strict mode, `this` is undefined\n        // see https://github.com/angular/zone.js/issues/190\n        var delegate = null;\n        if (typeof data.handler == 'function') {\n            delegate = data.handler;\n        }\n        else if (data.handler && data.handler.handleEvent) {\n            delegate = function (event) { return data.handler.handleEvent(event); };\n        }\n        var validZoneHandler = false;\n        try {\n            // In cross site contexts (such as WebDriver frameworks like Selenium),\n            // accessing the handler object here will cause an exception to be thrown which\n            // will fail tests prematurely.\n            validZoneHandler = data.handler && data.handler.toString() === '[object FunctionWrapper]';\n        }\n        catch (error) {\n            // we can still try to add the data.handler even we are in cross site context\n            data.crossContext = true;\n            return data.invokeAddFunc(addFnSymbol, data.handler);\n        }\n        // Ignore special listeners of IE11 & Edge dev tools, see\n        // https://github.com/angular/zone.js/issues/150\n        if (!delegate || validZoneHandler) {\n            return data.invokeAddFunc(addFnSymbol, data.handler);\n        }\n        if (!allowDuplicates) {\n            var eventTask = findExistingRegisteredTask(data.target, data.handler, data.eventName, data.options, false);\n            if (eventTask) {\n                // we already registered, so this will have noop.\n                return data.invokeAddFunc(addFnSymbol, eventTask);\n            }\n        }\n        var zone = Zone.current;\n        var source = data.target.constructor['name'] + '.' + addFnName + ':' + data.eventName;\n        zone.scheduleEventTask(source, delegate, data, scheduleEventListener, cancelEventListener);\n    };\n}\nfunction makeZoneAwareRemoveListener(fnName, useCapturingParam, metaCreator) {\n    if (useCapturingParam === void 0) { useCapturingParam = true; }\n    if (metaCreator === void 0) { metaCreator = defaultListenerMetaCreator; }\n    var symbol = zoneSymbol(fnName);\n    var defaultUseCapturing = useCapturingParam ? false : undefined;\n    return function zoneAwareRemoveListener(self, args) {\n        var data = metaCreator(self, args);\n        data.options = data.options || defaultUseCapturing;\n        // - Inside a Web Worker, `this` is undefined, the context is `global`\n        // - When `addEventListener` is called on the global context in strict mode, `this` is undefined\n        // see https://github.com/angular/zone.js/issues/190\n        var delegate = null;\n        if (typeof data.handler == 'function') {\n            delegate = data.handler;\n        }\n        else if (data.handler && data.handler.handleEvent) {\n            delegate = function (event) { return data.handler.handleEvent(event); };\n        }\n        var validZoneHandler = false;\n        try {\n            // In cross site contexts (such as WebDriver frameworks like Selenium),\n            // accessing the handler object here will cause an exception to be thrown which\n            // will fail tests prematurely.\n            validZoneHandler = data.handler && data.handler.toString() === '[object FunctionWrapper]';\n        }\n        catch (error) {\n            data.crossContext = true;\n            return data.invokeRemoveFunc(symbol, data.handler);\n        }\n        // Ignore special listeners of IE11 & Edge dev tools, see\n        // https://github.com/angular/zone.js/issues/150\n        if (!delegate || validZoneHandler) {\n            return data.invokeRemoveFunc(symbol, data.handler);\n        }\n        var eventTask = findExistingRegisteredTask(data.target, data.handler, data.eventName, data.options, true);\n        if (eventTask) {\n            eventTask.zone.cancelTask(eventTask);\n        }\n        else {\n            data.invokeRemoveFunc(symbol, data.handler);\n        }\n    };\n}\n\n\nfunction patchEventTargetMethods(obj, addFnName, removeFnName, metaCreator) {\n    if (addFnName === void 0) { addFnName = ADD_EVENT_LISTENER; }\n    if (removeFnName === void 0) { removeFnName = REMOVE_EVENT_LISTENER; }\n    if (metaCreator === void 0) { metaCreator = defaultListenerMetaCreator; }\n    if (obj && obj[addFnName]) {\n        patchMethod(obj, addFnName, function () { return makeZoneAwareAddListener(addFnName, removeFnName, true, false, false, metaCreator); });\n        patchMethod(obj, removeFnName, function () { return makeZoneAwareRemoveListener(removeFnName, true, metaCreator); });\n        return true;\n    }\n    else {\n        return false;\n    }\n}\nvar originalInstanceKey = zoneSymbol('originalInstance');\n// wrap some native API on `window`\nfunction patchClass(className) {\n    var OriginalClass = _global[className];\n    if (!OriginalClass)\n        return;\n    // keep original class in global\n    _global[zoneSymbol(className)] = OriginalClass;\n    _global[className] = function () {\n        var a = bindArguments(arguments, className);\n        switch (a.length) {\n            case 0:\n                this[originalInstanceKey] = new OriginalClass();\n                break;\n            case 1:\n                this[originalInstanceKey] = new OriginalClass(a[0]);\n                break;\n            case 2:\n                this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n                break;\n            case 3:\n                this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n                break;\n            case 4:\n                this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n                break;\n            default:\n                throw new Error('Arg list too long.');\n        }\n    };\n    // attach original delegate to patched function\n    attachOriginToPatched(_global[className], OriginalClass);\n    var instance = new OriginalClass(function () { });\n    var prop;\n    for (prop in instance) {\n        // https://bugs.webkit.org/show_bug.cgi?id=44721\n        if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n            continue;\n        (function (prop) {\n            if (typeof instance[prop] === 'function') {\n                _global[className].prototype[prop] = function () {\n                    return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n                };\n            }\n            else {\n                Object.defineProperty(_global[className].prototype, prop, {\n                    set: function (fn) {\n                        if (typeof fn === 'function') {\n                            this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n                            // keep callback in wrapped function so we can\n                            // use it in Function.prototype.toString to return\n                            // the native one.\n                            attachOriginToPatched(this[originalInstanceKey][prop], fn);\n                        }\n                        else {\n                            this[originalInstanceKey][prop] = fn;\n                        }\n                    },\n                    get: function () {\n                        return this[originalInstanceKey][prop];\n                    }\n                });\n            }\n        }(prop));\n    }\n    for (prop in OriginalClass) {\n        if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n            _global[className][prop] = OriginalClass[prop];\n        }\n    }\n}\nfunction patchMethod(target, name, patchFn) {\n    var proto = target;\n    while (proto && !proto.hasOwnProperty(name)) {\n        proto = Object.getPrototypeOf(proto);\n    }\n    if (!proto && target[name]) {\n        // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n        proto = target;\n    }\n    var delegateName = zoneSymbol(name);\n    var delegate;\n    if (proto && !(delegate = proto[delegateName])) {\n        delegate = proto[delegateName] = proto[name];\n        var patchDelegate_1 = patchFn(delegate, delegateName, name);\n        proto[name] = function () {\n            return patchDelegate_1(this, arguments);\n        };\n        attachOriginToPatched(proto[name], delegate);\n    }\n    return delegate;\n}\n// TODO: @JiaLiPassion, support cancel task later if necessary\nfunction patchMacroTask(obj, funcName, metaCreator) {\n    var setNative = null;\n    function scheduleTask(task) {\n        var data = task.data;\n        data.args[data.callbackIndex] = function () {\n            task.invoke.apply(this, arguments);\n        };\n        setNative.apply(data.target, data.args);\n        return task;\n    }\n    setNative = patchMethod(obj, funcName, function (delegate) { return function (self, args) {\n        var meta = metaCreator(self, args);\n        if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') {\n            var task = Zone.current.scheduleMacroTask(meta.name, args[meta.callbackIndex], meta, scheduleTask, null);\n            return task;\n        }\n        else {\n            // cause an error by calling it directly.\n            return delegate.apply(self, args);\n        }\n    }; });\n}\n\nfunction findEventTask(target, evtName) {\n    var eventTasks = target[zoneSymbol('eventTasks')];\n    var result = [];\n    if (eventTasks) {\n        for (var i = 0; i < eventTasks.length; i++) {\n            var eventTask = eventTasks[i];\n            var data = eventTask.data;\n            var eventName = data && data.eventName;\n            if (eventName === evtName) {\n                result.push(eventTask);\n            }\n        }\n    }\n    return result;\n}\nfunction attachOriginToPatched(patched, original) {\n    patched[zoneSymbol('OriginalDelegate')] = original;\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// override Function.prototype.toString to make zone.js patched function\n// look like native function\nZone.__load_patch('toString', function (global, Zone, api) {\n    // patch Func.prototype.toString to let them look like native\n    var originalFunctionToString = Function.prototype.toString;\n    Function.prototype.toString = function () {\n        if (typeof this === 'function') {\n            var originalDelegate = this[zoneSymbol('OriginalDelegate')];\n            if (originalDelegate) {\n                if (typeof originalDelegate === 'function') {\n                    return originalFunctionToString.apply(this[zoneSymbol('OriginalDelegate')], arguments);\n                }\n                else {\n                    return Object.prototype.toString.call(originalDelegate);\n                }\n            }\n            if (this === Promise) {\n                var nativePromise = global[zoneSymbol('Promise')];\n                if (nativePromise) {\n                    return originalFunctionToString.apply(nativePromise, arguments);\n                }\n            }\n            if (this === Error) {\n                var nativeError = global[zoneSymbol('Error')];\n                if (nativeError) {\n                    return originalFunctionToString.apply(nativeError, arguments);\n                }\n            }\n        }\n        return originalFunctionToString.apply(this, arguments);\n    };\n    // patch Object.prototype.toString to let them look like native\n    var originalObjectToString = Object.prototype.toString;\n    Object.prototype.toString = function () {\n        if (this instanceof Promise) {\n            return '[object Promise]';\n        }\n        return originalObjectToString.apply(this, arguments);\n    };\n});\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nfunction patchTimer(window, setName, cancelName, nameSuffix) {\n    var setNative = null;\n    var clearNative = null;\n    setName += nameSuffix;\n    cancelName += nameSuffix;\n    var tasksByHandleId = {};\n    function scheduleTask(task) {\n        var data = task.data;\n        function timer() {\n            try {\n                task.invoke.apply(this, arguments);\n            }\n            finally {\n                if (typeof data.handleId === 'number') {\n                    // Node returns complex objects as handleIds\n                    delete tasksByHandleId[data.handleId];\n                }\n            }\n        }\n        data.args[0] = timer;\n        data.handleId = setNative.apply(window, data.args);\n        if (typeof data.handleId === 'number') {\n            // Node returns complex objects as handleIds -> no need to keep them around. Additionally,\n            // this throws an\n            // exception in older node versions and has no effect there, because of the stringified key.\n            tasksByHandleId[data.handleId] = task;\n        }\n        return task;\n    }\n    function clearTask(task) {\n        if (typeof task.data.handleId === 'number') {\n            // Node returns complex objects as handleIds\n            delete tasksByHandleId[task.data.handleId];\n        }\n        return clearNative(task.data.handleId);\n    }\n    setNative =\n        patchMethod(window, setName, function (delegate) { return function (self, args) {\n            if (typeof args[0] === 'function') {\n                var zone = Zone.current;\n                var options = {\n                    handleId: null,\n                    isPeriodic: nameSuffix === 'Interval',\n                    delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,\n                    args: args\n                };\n                var task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask);\n                if (!task) {\n                    return task;\n                }\n                // Node.js must additionally support the ref and unref functions.\n                var handle = task.data.handleId;\n                // check whether handle is null, because some polyfill or browser\n                // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame\n                if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&\n                    typeof handle.unref === 'function') {\n                    task.ref = handle.ref.bind(handle);\n                    task.unref = handle.unref.bind(handle);\n                }\n                return task;\n            }\n            else {\n                // cause an error by calling it directly.\n                return delegate.apply(window, args);\n            }\n        }; });\n    clearNative =\n        patchMethod(window, cancelName, function (delegate) { return function (self, args) {\n            var task = typeof args[0] === 'number' ? tasksByHandleId[args[0]] : args[0];\n            if (task && typeof task.type === 'string') {\n                if (task.state !== 'notScheduled' &&\n                    (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {\n                    // Do not cancel already canceled functions\n                    task.zone.cancelTask(task);\n                }\n            }\n            else {\n                // cause an error by calling it directly.\n                delegate.apply(window, args);\n            }\n        }; });\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/*\n * This is necessary for Chrome and Chrome mobile, to enable\n * things like redefining `createdCallback` on an element.\n */\nvar _defineProperty = Object[zoneSymbol('defineProperty')] = Object.defineProperty;\nvar _getOwnPropertyDescriptor = Object[zoneSymbol('getOwnPropertyDescriptor')] =\n    Object.getOwnPropertyDescriptor;\nvar _create = Object.create;\nvar unconfigurablesKey = zoneSymbol('unconfigurables');\nfunction propertyPatch() {\n    Object.defineProperty = function (obj, prop, desc) {\n        if (isUnconfigurable(obj, prop)) {\n            throw new TypeError('Cannot assign to read only property \\'' + prop + '\\' of ' + obj);\n        }\n        var originalConfigurableFlag = desc.configurable;\n        if (prop !== 'prototype') {\n            desc = rewriteDescriptor(obj, prop, desc);\n        }\n        return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);\n    };\n    Object.defineProperties = function (obj, props) {\n        Object.keys(props).forEach(function (prop) {\n            Object.defineProperty(obj, prop, props[prop]);\n        });\n        return obj;\n    };\n    Object.create = function (obj, proto) {\n        if (typeof proto === 'object' && !Object.isFrozen(proto)) {\n            Object.keys(proto).forEach(function (prop) {\n                proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);\n            });\n        }\n        return _create(obj, proto);\n    };\n    Object.getOwnPropertyDescriptor = function (obj, prop) {\n        var desc = _getOwnPropertyDescriptor(obj, prop);\n        if (isUnconfigurable(obj, prop)) {\n            desc.configurable = false;\n        }\n        return desc;\n    };\n}\nfunction _redefineProperty(obj, prop, desc) {\n    var originalConfigurableFlag = desc.configurable;\n    desc = rewriteDescriptor(obj, prop, desc);\n    return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);\n}\nfunction isUnconfigurable(obj, prop) {\n    return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop];\n}\nfunction rewriteDescriptor(obj, prop, desc) {\n    desc.configurable = true;\n    if (!desc.configurable) {\n        if (!obj[unconfigurablesKey]) {\n            _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} });\n        }\n        obj[unconfigurablesKey][prop] = true;\n    }\n    return desc;\n}\nfunction _tryDefineProperty(obj, prop, desc, originalConfigurableFlag) {\n    try {\n        return _defineProperty(obj, prop, desc);\n    }\n    catch (error) {\n        if (desc.configurable) {\n            // In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's\n            // retry with the original flag value\n            if (typeof originalConfigurableFlag == 'undefined') {\n                delete desc.configurable;\n            }\n            else {\n                desc.configurable = originalConfigurableFlag;\n            }\n            try {\n                return _defineProperty(obj, prop, desc);\n            }\n            catch (error) {\n                var descJson = null;\n                try {\n                    descJson = JSON.stringify(desc);\n                }\n                catch (error) {\n                    descJson = descJson.toString();\n                }\n                console.log(\"Attempting to configure '\" + prop + \"' with descriptor '\" + descJson + \"' on object '\" + obj + \"' and got error, giving up: \" + error);\n            }\n        }\n        else {\n            throw error;\n        }\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar WTF_ISSUE_555 = 'Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video';\nvar NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket'\n    .split(',');\nvar EVENT_TARGET = 'EventTarget';\nfunction eventTargetPatch(_global) {\n    var apis = [];\n    var isWtf = _global['wtf'];\n    if (isWtf) {\n        // Workaround for: https://github.com/google/tracing-framework/issues/555\n        apis = WTF_ISSUE_555.split(',').map(function (v) { return 'HTML' + v + 'Element'; }).concat(NO_EVENT_TARGET);\n    }\n    else if (_global[EVENT_TARGET]) {\n        apis.push(EVENT_TARGET);\n    }\n    else {\n        // Note: EventTarget is not available in all browsers,\n        // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget\n        apis = NO_EVENT_TARGET;\n    }\n    for (var i = 0; i < apis.length; i++) {\n        var type = _global[apis[i]];\n        patchEventTargetMethods(type && type.prototype);\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// we have to patch the instance since the proto is non-configurable\nfunction apply(_global) {\n    var WS = _global.WebSocket;\n    // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener\n    // On older Chrome, no need since EventTarget was already patched\n    if (!_global.EventTarget) {\n        patchEventTargetMethods(WS.prototype);\n    }\n    _global.WebSocket = function (a, b) {\n        var socket = arguments.length > 1 ? new WS(a, b) : new WS(a);\n        var proxySocket;\n        // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance\n        var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage');\n        if (onmessageDesc && onmessageDesc.configurable === false) {\n            proxySocket = Object.create(socket);\n            ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function (propName) {\n                proxySocket[propName] = function () {\n                    return socket[propName].apply(socket, arguments);\n                };\n            });\n        }\n        else {\n            // we can patch the real socket\n            proxySocket = socket;\n        }\n        patchOnProperties(proxySocket, ['close', 'error', 'message', 'open']);\n        return proxySocket;\n    };\n    for (var prop in WS) {\n        _global['WebSocket'][prop] = WS[prop];\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar globalEventHandlersEventNames = [\n    'abort',\n    'animationcancel',\n    'animationend',\n    'animationiteration',\n    'auxclick',\n    'beforeinput',\n    'blur',\n    'cancel',\n    'canplay',\n    'canplaythrough',\n    'change',\n    'compositionstart',\n    'compositionupdate',\n    'compositionend',\n    'cuechange',\n    'click',\n    'close',\n    'contextmenu',\n    'curechange',\n    'dblclick',\n    'drag',\n    'dragend',\n    'dragenter',\n    'dragexit',\n    'dragleave',\n    'dragover',\n    'drop',\n    'durationchange',\n    'emptied',\n    'ended',\n    'error',\n    'focus',\n    'focusin',\n    'focusout',\n    'gotpointercapture',\n    'input',\n    'invalid',\n    'keydown',\n    'keypress',\n    'keyup',\n    'load',\n    'loadstart',\n    'loadeddata',\n    'loadedmetadata',\n    'lostpointercapture',\n    'mousedown',\n    'mouseenter',\n    'mouseleave',\n    'mousemove',\n    'mouseout',\n    'mouseover',\n    'mouseup',\n    'mousewheel',\n    'pause',\n    'play',\n    'playing',\n    'pointercancel',\n    'pointerdown',\n    'pointerenter',\n    'pointerleave',\n    'pointerlockchange',\n    'mozpointerlockchange',\n    'webkitpointerlockerchange',\n    'pointerlockerror',\n    'mozpointerlockerror',\n    'webkitpointerlockerror',\n    'pointermove',\n    'pointout',\n    'pointerover',\n    'pointerup',\n    'progress',\n    'ratechange',\n    'reset',\n    'resize',\n    'scroll',\n    'seeked',\n    'seeking',\n    'select',\n    'selectionchange',\n    'selectstart',\n    'show',\n    'sort',\n    'stalled',\n    'submit',\n    'suspend',\n    'timeupdate',\n    'volumechange',\n    'touchcancel',\n    'touchmove',\n    'touchstart',\n    'transitioncancel',\n    'transitionend',\n    'waiting',\n    'wheel'\n];\nvar documentEventNames = [\n    'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'fullscreenchange',\n    'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror',\n    'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange'\n];\nvar windowEventNames = [\n    'absolutedeviceorientation',\n    'afterinput',\n    'afterprint',\n    'appinstalled',\n    'beforeinstallprompt',\n    'beforeprint',\n    'beforeunload',\n    'devicelight',\n    'devicemotion',\n    'deviceorientation',\n    'deviceorientationabsolute',\n    'deviceproximity',\n    'hashchange',\n    'languagechange',\n    'message',\n    'mozbeforepaint',\n    'offline',\n    'online',\n    'paint',\n    'pageshow',\n    'pagehide',\n    'popstate',\n    'rejectionhandled',\n    'storage',\n    'unhandledrejection',\n    'unload',\n    'userproximity',\n    'vrdisplyconnected',\n    'vrdisplaydisconnected',\n    'vrdisplaypresentchange'\n];\nvar htmlElementEventNames = [\n    'beforecopy', 'beforecut', 'beforepaste', 'copy', 'cut', 'paste', 'dragstart', 'loadend',\n    'animationstart', 'search', 'transitionrun', 'transitionstart', 'webkitanimationend',\n    'webkitanimationiteration', 'webkitanimationstart', 'webkittransitionend'\n];\nvar mediaElementEventNames = ['encrypted', 'waitingforkey', 'msneedkey', 'mozinterruptbegin', 'mozinterruptend'];\nvar ieElementEventNames = [\n    'activate',\n    'afterupdate',\n    'ariarequest',\n    'beforeactivate',\n    'beforedeactivate',\n    'beforeeditfocus',\n    'beforeupdate',\n    'cellchange',\n    'controlselect',\n    'dataavailable',\n    'datasetchanged',\n    'datasetcomplete',\n    'errorupdate',\n    'filterchange',\n    'layoutcomplete',\n    'losecapture',\n    'move',\n    'moveend',\n    'movestart',\n    'propertychange',\n    'resizeend',\n    'resizestart',\n    'rowenter',\n    'rowexit',\n    'rowsdelete',\n    'rowsinserted',\n    'command',\n    'compassneedscalibration',\n    'deactivate',\n    'help',\n    'mscontentzoom',\n    'msmanipulationstatechanged',\n    'msgesturechange',\n    'msgesturedoubletap',\n    'msgestureend',\n    'msgesturehold',\n    'msgesturestart',\n    'msgesturetap',\n    'msgotpointercapture',\n    'msinertiastart',\n    'mslostpointercapture',\n    'mspointercancel',\n    'mspointerdown',\n    'mspointerenter',\n    'mspointerhover',\n    'mspointerleave',\n    'mspointermove',\n    'mspointerout',\n    'mspointerover',\n    'mspointerup',\n    'pointerout',\n    'mssitemodejumplistitemremoved',\n    'msthumbnailclick',\n    'stop',\n    'storagecommit'\n];\nvar webglEventNames = ['webglcontextrestored', 'webglcontextlost', 'webglcontextcreationerror'];\nvar formEventNames = ['autocomplete', 'autocompleteerror'];\nvar detailEventNames = ['toggle'];\nvar frameEventNames = ['load'];\nvar frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll'];\nvar marqueeEventNames = ['bounce', 'finish', 'start'];\nvar XMLHttpRequestEventNames = [\n    'loadstart', 'progress', 'abort', 'error', 'load', 'progress', 'timeout', 'loadend',\n    'readystatechange'\n];\nvar IDBIndexEventNames = ['upgradeneeded', 'complete', 'abort', 'success', 'error', 'blocked', 'versionchange', 'close'];\nvar websocketEventNames = ['close', 'error', 'open', 'message'];\nvar eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);\nfunction propertyDescriptorPatch(_global) {\n    if (isNode && !isMix) {\n        return;\n    }\n    var supportsWebSocket = typeof WebSocket !== 'undefined';\n    if (canPatchViaPropertyDescriptor()) {\n        // for browsers that we can patch the descriptor:  Chrome & Firefox\n        if (isBrowser) {\n            // in IE/Edge, onProp not exist in window object, but in WindowPrototype\n            // so we need to pass WindowPrototype to check onProp exist or not\n            patchOnProperties(window, eventNames, Object.getPrototypeOf(window));\n            patchOnProperties(Document.prototype, eventNames);\n            if (typeof window['SVGElement'] !== 'undefined') {\n                patchOnProperties(window['SVGElement'].prototype, eventNames);\n            }\n            patchOnProperties(Element.prototype, eventNames);\n            patchOnProperties(HTMLElement.prototype, eventNames);\n            patchOnProperties(HTMLMediaElement.prototype, mediaElementEventNames);\n            patchOnProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames));\n            patchOnProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames));\n            patchOnProperties(HTMLFrameElement.prototype, frameEventNames);\n            patchOnProperties(HTMLIFrameElement.prototype, frameEventNames);\n            var HTMLMarqueeElement_1 = window['HTMLMarqueeElement'];\n            if (HTMLMarqueeElement_1) {\n                patchOnProperties(HTMLMarqueeElement_1.prototype, marqueeEventNames);\n            }\n        }\n        patchOnProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames);\n        var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];\n        if (XMLHttpRequestEventTarget) {\n            patchOnProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames);\n        }\n        if (typeof IDBIndex !== 'undefined') {\n            patchOnProperties(IDBIndex.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBRequest.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBDatabase.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBTransaction.prototype, IDBIndexEventNames);\n            patchOnProperties(IDBCursor.prototype, IDBIndexEventNames);\n        }\n        if (supportsWebSocket) {\n            patchOnProperties(WebSocket.prototype, websocketEventNames);\n        }\n    }\n    else {\n        // Safari, Android browsers (Jelly Bean)\n        patchViaCapturingAllTheEvents();\n        patchClass('XMLHttpRequest');\n        if (supportsWebSocket) {\n            apply(_global);\n        }\n    }\n}\nfunction canPatchViaPropertyDescriptor() {\n    if ((isBrowser || isMix) && !Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') &&\n        typeof Element !== 'undefined') {\n        // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364\n        // IDL interface attributes are not configurable\n        var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick');\n        if (desc && !desc.configurable)\n            return false;\n    }\n    var xhrDesc = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'onreadystatechange');\n    // add enumerable and configurable here because in opera\n    // by default XMLHttpRequest.prototype.onreadystatechange is undefined\n    // without adding enumerable and configurable will cause onreadystatechange\n    // non-configurable\n    // and if XMLHttpRequest.prototype.onreadystatechange is undefined,\n    // we should set a real desc instead a fake one\n    if (xhrDesc) {\n        Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {\n            enumerable: true,\n            configurable: true,\n            get: function () {\n                return true;\n            }\n        });\n        var req = new XMLHttpRequest();\n        var result = !!req.onreadystatechange;\n        // restore original desc\n        Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', xhrDesc || {});\n        return result;\n    }\n    else {\n        Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {\n            enumerable: true,\n            configurable: true,\n            get: function () {\n                return this[zoneSymbol('fakeonreadystatechange')];\n            },\n            set: function (value) {\n                this[zoneSymbol('fakeonreadystatechange')] = value;\n            }\n        });\n        var req = new XMLHttpRequest();\n        var detectFunc = function () { };\n        req.onreadystatechange = detectFunc;\n        var result = req[zoneSymbol('fakeonreadystatechange')] === detectFunc;\n        req.onreadystatechange = null;\n        return result;\n    }\n}\n\nvar unboundKey = zoneSymbol('unbound');\n// Whenever any eventListener fires, we check the eventListener target and all parents\n// for `onwhatever` properties and replace them with zone-bound functions\n// - Chrome (for now)\nfunction patchViaCapturingAllTheEvents() {\n    var _loop_1 = function (i) {\n        var property = eventNames[i];\n        var onproperty = 'on' + property;\n        self.addEventListener(property, function (event) {\n            var elt = event.target, bound, source;\n            if (elt) {\n                source = elt.constructor['name'] + '.' + onproperty;\n            }\n            else {\n                source = 'unknown.' + onproperty;\n            }\n            while (elt) {\n                if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n                    bound = Zone.current.wrap(elt[onproperty], source);\n                    bound[unboundKey] = elt[onproperty];\n                    elt[onproperty] = bound;\n                }\n                elt = elt.parentElement;\n            }\n        }, true);\n    };\n    for (var i = 0; i < eventNames.length; i++) {\n        _loop_1(i);\n    }\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nfunction registerElementPatch(_global) {\n    if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {\n        return;\n    }\n    var _registerElement = document.registerElement;\n    var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];\n    document.registerElement = function (name, opts) {\n        if (opts && opts.prototype) {\n            callbacks.forEach(function (callback) {\n                var source = 'Document.registerElement::' + callback;\n                if (opts.prototype.hasOwnProperty(callback)) {\n                    var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);\n                    if (descriptor && descriptor.value) {\n                        descriptor.value = Zone.current.wrap(descriptor.value, source);\n                        _redefineProperty(opts.prototype, callback, descriptor);\n                    }\n                    else {\n                        opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);\n                    }\n                }\n                else if (opts.prototype[callback]) {\n                    opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);\n                }\n            });\n        }\n        return _registerElement.apply(document, [name, opts]);\n    };\n    attachOriginToPatched(document.registerElement, _registerElement);\n}\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nZone.__load_patch('timers', function (global, Zone, api) {\n    var set = 'set';\n    var clear = 'clear';\n    patchTimer(global, set, clear, 'Timeout');\n    patchTimer(global, set, clear, 'Interval');\n    patchTimer(global, set, clear, 'Immediate');\n    patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n    patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n    patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n});\nZone.__load_patch('blocking', function (global, Zone, api) {\n    var blockingMethods = ['alert', 'prompt', 'confirm'];\n    for (var i = 0; i < blockingMethods.length; i++) {\n        var name_1 = blockingMethods[i];\n        patchMethod(global, name_1, function (delegate, symbol, name) {\n            return function (s, args) {\n                return Zone.current.run(delegate, global, args, name);\n            };\n        });\n    }\n});\nZone.__load_patch('EventTarget', function (global, Zone, api) {\n    eventTargetPatch(global);\n    // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n    var XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n    if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n        patchEventTargetMethods(XMLHttpRequestEventTarget.prototype);\n    }\n    patchClass('MutationObserver');\n    patchClass('WebKitMutationObserver');\n    patchClass('FileReader');\n});\nZone.__load_patch('on_property', function (global, Zone, api) {\n    propertyDescriptorPatch(global);\n    propertyPatch();\n    registerElementPatch(global);\n});\nZone.__load_patch('canvas', function (global, Zone, api) {\n    var HTMLCanvasElement = global['HTMLCanvasElement'];\n    if (typeof HTMLCanvasElement !== 'undefined' && HTMLCanvasElement.prototype &&\n        HTMLCanvasElement.prototype.toBlob) {\n        patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', function (self, args) {\n            return { name: 'HTMLCanvasElement.toBlob', target: self, callbackIndex: 0, args: args };\n        });\n    }\n});\nZone.__load_patch('XHR', function (global, Zone, api) {\n    // Treat XMLHTTPRequest as a macrotask.\n    patchXHR(global);\n    var XHR_TASK = zoneSymbol('xhrTask');\n    var XHR_SYNC = zoneSymbol('xhrSync');\n    var XHR_LISTENER = zoneSymbol('xhrListener');\n    var XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n    function patchXHR(window) {\n        function findPendingTask(target) {\n            var pendingTask = target[XHR_TASK];\n            return pendingTask;\n        }\n        function scheduleTask(task) {\n            XMLHttpRequest[XHR_SCHEDULED] = false;\n            var data = task.data;\n            // remove existing event listener\n            var listener = data.target[XHR_LISTENER];\n            var oriAddListener = data.target[zoneSymbol('addEventListener')];\n            var oriRemoveListener = data.target[zoneSymbol('removeEventListener')];\n            if (listener) {\n                oriRemoveListener.apply(data.target, ['readystatechange', listener]);\n            }\n            var newListener = data.target[XHR_LISTENER] = function () {\n                if (data.target.readyState === data.target.DONE) {\n                    // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n                    // readyState=4 multiple times, so we need to check task state here\n                    if (!data.aborted && XMLHttpRequest[XHR_SCHEDULED] &&\n                        task.state === 'scheduled') {\n                        task.invoke();\n                    }\n                }\n            };\n            oriAddListener.apply(data.target, ['readystatechange', newListener]);\n            var storedTask = data.target[XHR_TASK];\n            if (!storedTask) {\n                data.target[XHR_TASK] = task;\n            }\n            sendNative.apply(data.target, data.args);\n            XMLHttpRequest[XHR_SCHEDULED] = true;\n            return task;\n        }\n        function placeholderCallback() { }\n        function clearTask(task) {\n            var data = task.data;\n            // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n            // to prevent it from firing. So instead, we store info for the event listener.\n            data.aborted = true;\n            return abortNative.apply(data.target, data.args);\n        }\n        var openNative = patchMethod(window.XMLHttpRequest.prototype, 'open', function () { return function (self, args) {\n            self[XHR_SYNC] = args[2] == false;\n            return openNative.apply(self, args);\n        }; });\n        var sendNative = patchMethod(window.XMLHttpRequest.prototype, 'send', function () { return function (self, args) {\n            var zone = Zone.current;\n            if (self[XHR_SYNC]) {\n                // if the XHR is sync there is no task to schedule, just execute the code.\n                return sendNative.apply(self, args);\n            }\n            else {\n                var options = { target: self, isPeriodic: false, delay: null, args: args, aborted: false };\n                return zone.scheduleMacroTask('XMLHttpRequest.send', placeholderCallback, options, scheduleTask, clearTask);\n            }\n        }; });\n        var abortNative = patchMethod(window.XMLHttpRequest.prototype, 'abort', function (delegate) { return function (self, args) {\n            var task = findPendingTask(self);\n            if (task && typeof task.type == 'string') {\n                // If the XHR has already completed, do nothing.\n                // If the XHR has already been aborted, do nothing.\n                // Fix #569, call abort multiple times before done will cause\n                // macroTask task count be negative number\n                if (task.cancelFn == null || (task.data && task.data.aborted)) {\n                    return;\n                }\n                task.zone.cancelTask(task);\n            }\n            // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n            // task\n            // to cancel. Do nothing.\n        }; });\n    }\n});\nZone.__load_patch('geolocation', function (global, Zone, api) {\n    /// GEO_LOCATION\n    if (global['navigator'] && global['navigator'].geolocation) {\n        patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n    }\n});\nZone.__load_patch('PromiseRejectionEvent', function (global, Zone, api) {\n    // handle unhandled promise rejection\n    function findPromiseRejectionHandler(evtName) {\n        return function (e) {\n            var eventTasks = findEventTask(global, evtName);\n            eventTasks.forEach(function (eventTask) {\n                // windows has added unhandledrejection event listener\n                // trigger the event listener\n                var PromiseRejectionEvent = global['PromiseRejectionEvent'];\n                if (PromiseRejectionEvent) {\n                    var evt = new PromiseRejectionEvent(evtName, { promise: e.promise, reason: e.rejection });\n                    eventTask.invoke(evt);\n                }\n            });\n        };\n    }\n    if (global['PromiseRejectionEvent']) {\n        Zone[zoneSymbol('unhandledPromiseRejectionHandler')] =\n            findPromiseRejectionHandler('unhandledrejection');\n        Zone[zoneSymbol('rejectionHandledHandler')] =\n            findPromiseRejectionHandler('rejectionhandled');\n    }\n});\nZone.__load_patch('util', function (global, Zone, api) {\n    api.patchEventTargetMethods = patchEventTargetMethods;\n    api.patchOnProperties = patchOnProperties;\n    api.patchMethod = patchMethod;\n});\n\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n\n})));\n\n/*! *****************************************************************************\nCopyright (C) Microsoft. 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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n    \"use strict\";\n    var hasOwn = Object.prototype.hasOwnProperty;\n    // feature test for Symbol support\n    var supportsSymbol = typeof Symbol === \"function\";\n    var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n    var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n    var HashMap;\n    (function (HashMap) {\n        var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n        var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n        var downLevel = !supportsCreate && !supportsProto;\n        // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n        HashMap.create = supportsCreate\n            ? function () { return MakeDictionary(Object.create(null)); }\n            : supportsProto\n                ? function () { return MakeDictionary({ __proto__: null }); }\n                : function () { return MakeDictionary({}); };\n        HashMap.has = downLevel\n            ? function (map, key) { return hasOwn.call(map, key); }\n            : function (map, key) { return key in map; };\n        HashMap.get = downLevel\n            ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n            : function (map, key) { return map[key]; };\n    })(HashMap || (HashMap = {}));\n    // Load global or shim versions of Map, Set, and WeakMap\n    var functionPrototype = Object.getPrototypeOf(Function);\n    var usePolyfill = typeof process === \"object\" && process.env && process.env[\"REFLECT_METADATA_USE_MAP_POLYFILL\"] === \"true\";\n    var _Map = !usePolyfill && typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n    var _Set = !usePolyfill && typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n    var _WeakMap = !usePolyfill && typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n    // [[Metadata]] internal slot\n    // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n    var Metadata = new _WeakMap();\n    /**\n      * Applies a set of decorators to a property of a target object.\n      * @param decorators An array of decorators.\n      * @param target The target object.\n      * @param propertyKey (Optional) The property key to decorate.\n      * @param attributes (Optional) The property descriptor for the target key.\n      * @remarks Decorators are applied in reverse order.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     Example = Reflect.decorate(decoratorsArray, Example);\n      *\n      *     // property (on constructor)\n      *     Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     Object.defineProperty(Example, \"staticMethod\",\n      *         Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n      *             Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n      *\n      *     // method (on prototype)\n      *     Object.defineProperty(Example.prototype, \"method\",\n      *         Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n      *             Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n      *\n      */\n    function decorate(decorators, target, propertyKey, attributes) {\n        if (!IsUndefined(propertyKey)) {\n            if (!IsArray(decorators))\n                throw new TypeError();\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n                throw new TypeError();\n            if (IsNull(attributes))\n                attributes = undefined;\n            propertyKey = ToPropertyKey(propertyKey);\n            return DecorateProperty(decorators, target, propertyKey, attributes);\n        }\n        else {\n            if (!IsArray(decorators))\n                throw new TypeError();\n            if (!IsConstructor(target))\n                throw new TypeError();\n            return DecorateConstructor(decorators, target);\n        }\n    }\n    Reflect.decorate = decorate;\n    // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n    // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n    /**\n      * A default metadata decorator factory that can be used on a class, class member, or parameter.\n      * @param metadataKey The key for the metadata entry.\n      * @param metadataValue The value for the metadata entry.\n      * @returns A decorator function.\n      * @remarks\n      * If `metadataKey` is already defined for the target and target key, the\n      * metadataValue for that key will be overwritten.\n      * @example\n      *\n      *     // constructor\n      *     @Reflect.metadata(key, value)\n      *     class Example {\n      *     }\n      *\n      *     // property (on constructor, TypeScript only)\n      *     class Example {\n      *         @Reflect.metadata(key, value)\n      *         static staticProperty;\n      *     }\n      *\n      *     // property (on prototype, TypeScript only)\n      *     class Example {\n      *         @Reflect.metadata(key, value)\n      *         property;\n      *     }\n      *\n      *     // method (on constructor)\n      *     class Example {\n      *         @Reflect.metadata(key, value)\n      *         static staticMethod() { }\n      *     }\n      *\n      *     // method (on prototype)\n      *     class Example {\n      *         @Reflect.metadata(key, value)\n      *         method() { }\n      *     }\n      *\n      */\n    function metadata(metadataKey, metadataValue) {\n        function decorator(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n                throw new TypeError();\n            OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n        }\n        return decorator;\n    }\n    Reflect.metadata = metadata;\n    /**\n      * Define a unique metadata entry on the target.\n      * @param metadataKey A key used to store and retrieve metadata.\n      * @param metadataValue A value that contains attached metadata.\n      * @param target The target object on which to define metadata.\n      * @param propertyKey (Optional) The property key for the target.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     Reflect.defineMetadata(\"custom:annotation\", options, Example);\n      *\n      *     // property (on constructor)\n      *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n      *\n      *     // decorator factory as metadata-producing annotation.\n      *     function MyAnnotation(options): Decorator {\n      *         return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n      *     }\n      *\n      */\n    function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n    }\n    Reflect.defineMetadata = defineMetadata;\n    /**\n      * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n      * @param metadataKey A key used to store and retrieve metadata.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.hasMetadata(\"custom:annotation\", Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n      *\n      */\n    function hasMetadata(metadataKey, target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n    }\n    Reflect.hasMetadata = hasMetadata;\n    /**\n      * Gets a value indicating whether the target object has the provided metadata key defined.\n      * @param metadataKey A key used to store and retrieve metadata.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n      *\n      */\n    function hasOwnMetadata(metadataKey, target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n    }\n    Reflect.hasOwnMetadata = hasOwnMetadata;\n    /**\n      * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n      * @param metadataKey A key used to store and retrieve metadata.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.getMetadata(\"custom:annotation\", Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n      *\n      */\n    function getMetadata(metadataKey, target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n    }\n    Reflect.getMetadata = getMetadata;\n    /**\n      * Gets the metadata value for the provided metadata key on the target object.\n      * @param metadataKey A key used to store and retrieve metadata.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n      *\n      */\n    function getOwnMetadata(metadataKey, target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n    }\n    Reflect.getOwnMetadata = getOwnMetadata;\n    /**\n      * Gets the metadata keys defined on the target object or its prototype chain.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns An array of unique metadata keys.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.getMetadataKeys(Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n      *\n      */\n    function getMetadataKeys(target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryMetadataKeys(target, propertyKey);\n    }\n    Reflect.getMetadataKeys = getMetadataKeys;\n    /**\n      * Gets the unique metadata keys defined on the target object.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns An array of unique metadata keys.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.getOwnMetadataKeys(Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n      *\n      */\n    function getOwnMetadataKeys(target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        return OrdinaryOwnMetadataKeys(target, propertyKey);\n    }\n    Reflect.getOwnMetadataKeys = getOwnMetadataKeys;\n    /**\n      * Deletes the metadata entry from the target object with the provided key.\n      * @param metadataKey A key used to store and retrieve metadata.\n      * @param target The target object on which the metadata is defined.\n      * @param propertyKey (Optional) The property key for the target.\n      * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n      * @example\n      *\n      *     class Example {\n      *         // property declarations are not part of ES6, though they are valid in TypeScript:\n      *         // static staticProperty;\n      *         // property;\n      *\n      *         constructor(p) { }\n      *         static staticMethod(p) { }\n      *         method(p) { }\n      *     }\n      *\n      *     // constructor\n      *     result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n      *\n      *     // property (on constructor)\n      *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n      *\n      *     // property (on prototype)\n      *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n      *\n      *     // method (on constructor)\n      *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n      *\n      *     // method (on prototype)\n      *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n      *\n      */\n    function deleteMetadata(metadataKey, target, propertyKey) {\n        if (!IsObject(target))\n            throw new TypeError();\n        if (!IsUndefined(propertyKey))\n            propertyKey = ToPropertyKey(propertyKey);\n        var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false);\n        if (IsUndefined(metadataMap))\n            return false;\n        if (!metadataMap.delete(metadataKey))\n            return false;\n        if (metadataMap.size > 0)\n            return true;\n        var targetMetadata = Metadata.get(target);\n        targetMetadata.delete(propertyKey);\n        if (targetMetadata.size > 0)\n            return true;\n        Metadata.delete(target);\n        return true;\n    }\n    Reflect.deleteMetadata = deleteMetadata;\n    function DecorateConstructor(decorators, target) {\n        for (var i = decorators.length - 1; i >= 0; --i) {\n            var decorator = decorators[i];\n            var decorated = decorator(target);\n            if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                if (!IsConstructor(decorated))\n                    throw new TypeError();\n                target = decorated;\n            }\n        }\n        return target;\n    }\n    function DecorateProperty(decorators, target, propertyKey, descriptor) {\n        for (var i = decorators.length - 1; i >= 0; --i) {\n            var decorator = decorators[i];\n            var decorated = decorator(target, propertyKey, descriptor);\n            if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                if (!IsObject(decorated))\n                    throw new TypeError();\n                descriptor = decorated;\n            }\n        }\n        return descriptor;\n    }\n    function GetOrCreateMetadataMap(O, P, Create) {\n        var targetMetadata = Metadata.get(O);\n        if (IsUndefined(targetMetadata)) {\n            if (!Create)\n                return undefined;\n            targetMetadata = new _Map();\n            Metadata.set(O, targetMetadata);\n        }\n        var metadataMap = targetMetadata.get(P);\n        if (IsUndefined(metadataMap)) {\n            if (!Create)\n                return undefined;\n            metadataMap = new _Map();\n            targetMetadata.set(P, metadataMap);\n        }\n        return metadataMap;\n    }\n    // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n    function OrdinaryHasMetadata(MetadataKey, O, P) {\n        var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n        if (hasOwn)\n            return true;\n        var parent = OrdinaryGetPrototypeOf(O);\n        if (!IsNull(parent))\n            return OrdinaryHasMetadata(MetadataKey, parent, P);\n        return false;\n    }\n    // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n    function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n        if (IsUndefined(metadataMap))\n            return false;\n        return ToBoolean(metadataMap.has(MetadataKey));\n    }\n    // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n    function OrdinaryGetMetadata(MetadataKey, O, P) {\n        var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n        if (hasOwn)\n            return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n        var parent = OrdinaryGetPrototypeOf(O);\n        if (!IsNull(parent))\n            return OrdinaryGetMetadata(MetadataKey, parent, P);\n        return undefined;\n    }\n    // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n    function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n        if (IsUndefined(metadataMap))\n            return undefined;\n        return metadataMap.get(MetadataKey);\n    }\n    // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n    function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n        metadataMap.set(MetadataKey, MetadataValue);\n    }\n    // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n    function OrdinaryMetadataKeys(O, P) {\n        var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n        var parent = OrdinaryGetPrototypeOf(O);\n        if (parent === null)\n            return ownKeys;\n        var parentKeys = OrdinaryMetadataKeys(parent, P);\n        if (parentKeys.length <= 0)\n            return ownKeys;\n        if (ownKeys.length <= 0)\n            return parentKeys;\n        var set = new _Set();\n        var keys = [];\n        for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n            var key = ownKeys_1[_i];\n            var hasKey = set.has(key);\n            if (!hasKey) {\n                set.add(key);\n                keys.push(key);\n            }\n        }\n        for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n            var key = parentKeys_1[_a];\n            var hasKey = set.has(key);\n            if (!hasKey) {\n                set.add(key);\n                keys.push(key);\n            }\n        }\n        return keys;\n    }\n    // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n    function OrdinaryOwnMetadataKeys(O, P) {\n        var keys = [];\n        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n        if (IsUndefined(metadataMap))\n            return keys;\n        var keysObj = metadataMap.keys();\n        var iterator = GetIterator(keysObj);\n        var k = 0;\n        while (true) {\n            var next = IteratorStep(iterator);\n            if (!next) {\n                keys.length = k;\n                return keys;\n            }\n            var nextValue = IteratorValue(next);\n            try {\n                keys[k] = nextValue;\n            }\n            catch (e) {\n                try {\n                    IteratorClose(iterator);\n                }\n                finally {\n                    throw e;\n                }\n            }\n            k++;\n        }\n    }\n    // 6 ECMAScript Data Typ0es and Values\n    // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n    function Type(x) {\n        if (x === null)\n            return 1 /* Null */;\n        switch (typeof x) {\n            case \"undefined\": return 0 /* Undefined */;\n            case \"boolean\": return 2 /* Boolean */;\n            case \"string\": return 3 /* String */;\n            case \"symbol\": return 4 /* Symbol */;\n            case \"number\": return 5 /* Number */;\n            case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n            default: return 6 /* Object */;\n        }\n    }\n    // 6.1.1 The Undefined Type\n    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n    function IsUndefined(x) {\n        return x === undefined;\n    }\n    // 6.1.2 The Null Type\n    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n    function IsNull(x) {\n        return x === null;\n    }\n    // 6.1.5 The Symbol Type\n    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n    function IsSymbol(x) {\n        return typeof x === \"symbol\";\n    }\n    // 6.1.7 The Object Type\n    // https://tc39.github.io/ecma262/#sec-object-type\n    function IsObject(x) {\n        return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n    }\n    // 7.1 Type Conversion\n    // https://tc39.github.io/ecma262/#sec-type-conversion\n    // 7.1.1 ToPrimitive(input [, PreferredType])\n    // https://tc39.github.io/ecma262/#sec-toprimitive\n    function ToPrimitive(input, PreferredType) {\n        switch (Type(input)) {\n            case 0 /* Undefined */: return input;\n            case 1 /* Null */: return input;\n            case 2 /* Boolean */: return input;\n            case 3 /* String */: return input;\n            case 4 /* Symbol */: return input;\n            case 5 /* Number */: return input;\n        }\n        var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n        var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n        if (exoticToPrim !== undefined) {\n            var result = exoticToPrim.call(input, hint);\n            if (IsObject(result))\n                throw new TypeError();\n            return result;\n        }\n        return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n    }\n    // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n    // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n    function OrdinaryToPrimitive(O, hint) {\n        if (hint === \"string\") {\n            var toString_1 = O.toString;\n            if (IsCallable(toString_1)) {\n                var result = toString_1.call(O);\n                if (!IsObject(result))\n                    return result;\n            }\n            var valueOf = O.valueOf;\n            if (IsCallable(valueOf)) {\n                var result = valueOf.call(O);\n                if (!IsObject(result))\n                    return result;\n            }\n        }\n        else {\n            var valueOf = O.valueOf;\n            if (IsCallable(valueOf)) {\n                var result = valueOf.call(O);\n                if (!IsObject(result))\n                    return result;\n            }\n            var toString_2 = O.toString;\n            if (IsCallable(toString_2)) {\n                var result = toString_2.call(O);\n                if (!IsObject(result))\n                    return result;\n            }\n        }\n        throw new TypeError();\n    }\n    // 7.1.2 ToBoolean(argument)\n    // https://tc39.github.io/ecma262/2016/#sec-toboolean\n    function ToBoolean(argument) {\n        return !!argument;\n    }\n    // 7.1.12 ToString(argument)\n    // https://tc39.github.io/ecma262/#sec-tostring\n    function ToString(argument) {\n        return \"\" + argument;\n    }\n    // 7.1.14 ToPropertyKey(argument)\n    // https://tc39.github.io/ecma262/#sec-topropertykey\n    function ToPropertyKey(argument) {\n        var key = ToPrimitive(argument, 3 /* String */);\n        if (IsSymbol(key))\n            return key;\n        return ToString(key);\n    }\n    // 7.2 Testing and Comparison Operations\n    // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n    // 7.2.2 IsArray(argument)\n    // https://tc39.github.io/ecma262/#sec-isarray\n    function IsArray(argument) {\n        return Array.isArray\n            ? Array.isArray(argument)\n            : argument instanceof Object\n                ? argument instanceof Array\n                : Object.prototype.toString.call(argument) === \"[object Array]\";\n    }\n    // 7.2.3 IsCallable(argument)\n    // https://tc39.github.io/ecma262/#sec-iscallable\n    function IsCallable(argument) {\n        // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n        return typeof argument === \"function\";\n    }\n    // 7.2.4 IsConstructor(argument)\n    // https://tc39.github.io/ecma262/#sec-isconstructor\n    function IsConstructor(argument) {\n        // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n        return typeof argument === \"function\";\n    }\n    // 7.2.7 IsPropertyKey(argument)\n    // https://tc39.github.io/ecma262/#sec-ispropertykey\n    function IsPropertyKey(argument) {\n        switch (Type(argument)) {\n            case 3 /* String */: return true;\n            case 4 /* Symbol */: return true;\n            default: return false;\n        }\n    }\n    // 7.3 Operations on Objects\n    // https://tc39.github.io/ecma262/#sec-operations-on-objects\n    // 7.3.9 GetMethod(V, P)\n    // https://tc39.github.io/ecma262/#sec-getmethod\n    function GetMethod(V, P) {\n        var func = V[P];\n        if (func === undefined || func === null)\n            return undefined;\n        if (!IsCallable(func))\n            throw new TypeError();\n        return func;\n    }\n    // 7.4 Operations on Iterator Objects\n    // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n    function GetIterator(obj) {\n        var method = GetMethod(obj, iteratorSymbol);\n        if (!IsCallable(method))\n            throw new TypeError(); // from Call\n        var iterator = method.call(obj);\n        if (!IsObject(iterator))\n            throw new TypeError();\n        return iterator;\n    }\n    // 7.4.4 IteratorValue(iterResult)\n    // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n    function IteratorValue(iterResult) {\n        return iterResult.value;\n    }\n    // 7.4.5 IteratorStep(iterator)\n    // https://tc39.github.io/ecma262/#sec-iteratorstep\n    function IteratorStep(iterator) {\n        var result = iterator.next();\n        return result.done ? false : result;\n    }\n    // 7.4.6 IteratorClose(iterator, completion)\n    // https://tc39.github.io/ecma262/#sec-iteratorclose\n    function IteratorClose(iterator) {\n        var f = iterator[\"return\"];\n        if (f)\n            f.call(iterator);\n    }\n    // 9.1 Ordinary Object Internal Methods and Internal Slots\n    // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n    // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n    // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n    function OrdinaryGetPrototypeOf(O) {\n        var proto = Object.getPrototypeOf(O);\n        if (typeof O !== \"function\" || O === functionPrototype)\n            return proto;\n        // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n        // Try to determine the superclass constructor. Compatible implementations\n        // must either set __proto__ on a subclass constructor to the superclass constructor,\n        // or ensure each class has a valid `constructor` property on its prototype that\n        // points back to the constructor.\n        // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n        // This is the case when in ES6 or when using __proto__ in a compatible browser.\n        if (proto !== functionPrototype)\n            return proto;\n        // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n        var prototype = O.prototype;\n        var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n        if (prototypeProto == null || prototypeProto === Object.prototype)\n            return proto;\n        // If the constructor was not a function, then we cannot determine the heritage.\n        var constructor = prototypeProto.constructor;\n        if (typeof constructor !== \"function\")\n            return proto;\n        // If we have some kind of self-reference, then we cannot determine the heritage.\n        if (constructor === O)\n            return proto;\n        // we have a pretty good guess at the heritage.\n        return constructor;\n    }\n    // naive Map shim\n    function CreateMapPolyfill() {\n        var cacheSentinel = {};\n        var arraySentinel = [];\n        var MapIterator = (function () {\n            function MapIterator(keys, values, selector) {\n                this._index = 0;\n                this._keys = keys;\n                this._values = values;\n                this._selector = selector;\n            }\n            MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n            MapIterator.prototype[iteratorSymbol] = function () { return this; };\n            MapIterator.prototype.next = function () {\n                var index = this._index;\n                if (index >= 0 && index < this._keys.length) {\n                    var result = this._selector(this._keys[index], this._values[index]);\n                    if (index + 1 >= this._keys.length) {\n                        this._index = -1;\n                        this._keys = arraySentinel;\n                        this._values = arraySentinel;\n                    }\n                    else {\n                        this._index++;\n                    }\n                    return { value: result, done: false };\n                }\n                return { value: undefined, done: true };\n            };\n            MapIterator.prototype.throw = function (error) {\n                if (this._index >= 0) {\n                    this._index = -1;\n                    this._keys = arraySentinel;\n                    this._values = arraySentinel;\n                }\n                throw error;\n            };\n            MapIterator.prototype.return = function (value) {\n                if (this._index >= 0) {\n                    this._index = -1;\n                    this._keys = arraySentinel;\n                    this._values = arraySentinel;\n                }\n                return { value: value, done: true };\n            };\n            return MapIterator;\n        }());\n        return (function () {\n            function Map() {\n                this._keys = [];\n                this._values = [];\n                this._cacheKey = cacheSentinel;\n                this._cacheIndex = -2;\n            }\n            Object.defineProperty(Map.prototype, \"size\", {\n                get: function () { return this._keys.length; },\n                enumerable: true,\n                configurable: true\n            });\n            Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n            Map.prototype.get = function (key) {\n                var index = this._find(key, /*insert*/ false);\n                return index >= 0 ? this._values[index] : undefined;\n            };\n            Map.prototype.set = function (key, value) {\n                var index = this._find(key, /*insert*/ true);\n                this._values[index] = value;\n                return this;\n            };\n            Map.prototype.delete = function (key) {\n                var index = this._find(key, /*insert*/ false);\n                if (index >= 0) {\n                    var size = this._keys.length;\n                    for (var i = index + 1; i < size; i++) {\n                        this._keys[i - 1] = this._keys[i];\n                        this._values[i - 1] = this._values[i];\n                    }\n                    this._keys.length--;\n                    this._values.length--;\n                    if (key === this._cacheKey) {\n                        this._cacheKey = cacheSentinel;\n                        this._cacheIndex = -2;\n                    }\n                    return true;\n                }\n                return false;\n            };\n            Map.prototype.clear = function () {\n                this._keys.length = 0;\n                this._values.length = 0;\n                this._cacheKey = cacheSentinel;\n                this._cacheIndex = -2;\n            };\n            Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n            Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n            Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n            Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n            Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n            Map.prototype._find = function (key, insert) {\n                if (this._cacheKey !== key) {\n                    this._cacheIndex = this._keys.indexOf(this._cacheKey = key);\n                }\n                if (this._cacheIndex < 0 && insert) {\n                    this._cacheIndex = this._keys.length;\n                    this._keys.push(key);\n                    this._values.push(undefined);\n                }\n                return this._cacheIndex;\n            };\n            return Map;\n        }());\n        function getKey(key, _) {\n            return key;\n        }\n        function getValue(_, value) {\n            return value;\n        }\n        function getEntry(key, value) {\n            return [key, value];\n        }\n    }\n    // naive Set shim\n    function CreateSetPolyfill() {\n        return (function () {\n            function Set() {\n                this._map = new _Map();\n            }\n            Object.defineProperty(Set.prototype, \"size\", {\n                get: function () { return this._map.size; },\n                enumerable: true,\n                configurable: true\n            });\n            Set.prototype.has = function (value) { return this._map.has(value); };\n            Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n            Set.prototype.delete = function (value) { return this._map.delete(value); };\n            Set.prototype.clear = function () { this._map.clear(); };\n            Set.prototype.keys = function () { return this._map.keys(); };\n            Set.prototype.values = function () { return this._map.values(); };\n            Set.prototype.entries = function () { return this._map.entries(); };\n            Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n            Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n            return Set;\n        }());\n    }\n    // naive WeakMap shim\n    function CreateWeakMapPolyfill() {\n        var UUID_SIZE = 16;\n        var keys = HashMap.create();\n        var rootKey = CreateUniqueKey();\n        return (function () {\n            function WeakMap() {\n                this._key = CreateUniqueKey();\n            }\n            WeakMap.prototype.has = function (target) {\n                var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                return table !== undefined ? HashMap.has(table, this._key) : false;\n            };\n            WeakMap.prototype.get = function (target) {\n                var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                return table !== undefined ? HashMap.get(table, this._key) : undefined;\n            };\n            WeakMap.prototype.set = function (target, value) {\n                var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n                table[this._key] = value;\n                return this;\n            };\n            WeakMap.prototype.delete = function (target) {\n                var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                return table !== undefined ? delete table[this._key] : false;\n            };\n            WeakMap.prototype.clear = function () {\n                // NOTE: not a real clear, just makes the previous data unreachable\n                this._key = CreateUniqueKey();\n            };\n            return WeakMap;\n        }());\n        function CreateUniqueKey() {\n            var key;\n            do\n                key = \"@@WeakMap@@\" + CreateUUID();\n            while (HashMap.has(keys, key));\n            keys[key] = true;\n            return key;\n        }\n        function GetOrCreateWeakMapTable(target, create) {\n            if (!hasOwn.call(target, rootKey)) {\n                if (!create)\n                    return undefined;\n                Object.defineProperty(target, rootKey, { value: HashMap.create() });\n            }\n            return target[rootKey];\n        }\n        function FillRandomBytes(buffer, size) {\n            for (var i = 0; i < size; ++i)\n                buffer[i] = Math.random() * 0xff | 0;\n            return buffer;\n        }\n        function GenRandomBytes(size) {\n            if (typeof Uint8Array === \"function\") {\n                if (typeof crypto !== \"undefined\")\n                    return crypto.getRandomValues(new Uint8Array(size));\n                if (typeof msCrypto !== \"undefined\")\n                    return msCrypto.getRandomValues(new Uint8Array(size));\n                return FillRandomBytes(new Uint8Array(size), size);\n            }\n            return FillRandomBytes(new Array(size), size);\n        }\n        function CreateUUID() {\n            var data = GenRandomBytes(UUID_SIZE);\n            // mark as random - RFC 4122 § 4.4\n            data[6] = data[6] & 0x4f | 0x40;\n            data[8] = data[8] & 0xbf | 0x80;\n            var result = \"\";\n            for (var offset = 0; offset < UUID_SIZE; ++offset) {\n                var byte = data[offset];\n                if (offset === 4 || offset === 6 || offset === 8)\n                    result += \"-\";\n                if (byte < 16)\n                    result += \"0\";\n                result += byte.toString(16).toLowerCase();\n            }\n            return result;\n        }\n    }\n    // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n    function MakeDictionary(obj) {\n        obj.__ = undefined;\n        delete obj.__;\n        return obj;\n    }\n    // patch global Reflect\n    (function (__global) {\n        if (typeof __global.Reflect !== \"undefined\") {\n            if (__global.Reflect !== Reflect) {\n                for (var p in Reflect) {\n                    if (hasOwn.call(Reflect, p)) {\n                        __global.Reflect[p] = Reflect[p];\n                    }\n                }\n            }\n        }\n        else {\n            __global.Reflect = Reflect;\n        }\n    })(typeof global !== \"undefined\" ? global :\n        typeof self !== \"undefined\" ? self :\n            Function(\"return this;\")());\n})(Reflect || (Reflect = {}));\n//# sourceMappingURL=Reflect.js.map\n\n/**\n  @license\n  Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt\n **/\n/*\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n*****************************************************************************/\n(function(t,k){\"object\"===typeof exports&&\"undefined\"!==typeof module?k(exports):\"function\"===typeof define&&define.amd?define([\"exports\"],k):k(t.Rx=t.Rx||{})})(this,function(t){function k(b,a){function c(){this.constructor=b}ob(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function N(b){return\"function\"===typeof b}function pb(){try{return la.apply(this,arguments)}catch(b){return m.e=b,m}}function r(b){la=b;return pb}function ma(b){return b.reduce(function(a,c){return a.concat(c instanceof\n    O?c.errors:c)},[])}function na(b){var a=b.subject;a.next(b.value);a.complete()}function qb(b){b.subject.error(b.err)}function rb(b){var a=this,c=b.source,e=b.subscriber;b=b.context;var d=c.callbackFunc,f=c.args,h=c.scheduler,g=c.subject;if(!g){var g=c.subject=new L,k=function sb(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=sb.source,b=e.selector,e=e.subject,d=c.shift();d?a.add(h.schedule(da,0,{err:d,subject:e})):b?(c=r(b).apply(this,c),c===m?a.add(h.schedule(da,0,{err:m.e,subject:e})):\n    a.add(h.schedule(oa,0,{value:c,subject:e}))):a.add(h.schedule(oa,0,{value:1>=c.length?c[0]:c,subject:e}))};k.source=c;r(d).apply(b,f.concat(k))===m&&a.add(h.schedule(da,0,{err:m.e,subject:g}))}a.add(g.subscribe(e))}function oa(b){var a=b.subject;a.next(b.value);a.complete()}function da(b){b.subject.error(b.err)}function z(b){return b&&\"function\"===typeof b.schedule}function pa(b){return b&&\"function\"!==typeof b.subscribe&&\"function\"===typeof b.then}function p(b,a,c,e){var d=new qa(b,c,e);if(d.closed)return null;\n    if(a instanceof g)if(a._isScalar)d.next(a.value),d.complete();else return a.subscribe(d);else if(a&&\"number\"===typeof a.length){b=0;for(c=a.length;b<c&&!d.closed;b++)d.next(a[b]);d.closed||d.complete()}else{if(pa(a))return a.then(function(c){d.closed||(d.next(c),d.complete())},function(c){return d.error(c)}).then(null,function(c){n.setTimeout(function(){throw c;})}),d;if(a&&\"function\"===typeof a[A]){a=a[A]();do{b=a.next();if(b.done){d.complete();break}d.next(b.value);if(d.closed)break}while(1)}else if(a&&\n    \"function\"===typeof a[I])if(a=a[I](),\"function\"!==typeof a.subscribe)d.error(new TypeError(\"Provided object does not correctly implement Symbol.observable\"));else return a.subscribe(new qa(b,c,e));else d.error(new TypeError(\"You provided \"+(null!=a&&\"object\"===typeof a?\"an invalid object\":\"'\"+a+\"'\")+\" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.\"))}return null}function P(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=null;z(b[b.length-1])&&\n    (a=b.pop());return null===a&&1===b.length&&b[0]instanceof g?b[0]:(new E(b,a)).lift(new W(1))}function ra(b){var a=b.value;b=b.subscriber;b.closed||(b.next(a),b.complete())}function ub(b){var a=b.err;b=b.subscriber;b.closed||b.error(a)}function Q(b){return!D(b)&&0<=b-parseFloat(b)+1}function sa(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,e=b[b.length-1];z(e)?(c=b.pop(),1<b.length&&\"number\"===typeof b[b.length-1]&&(a=b.pop())):\"number\"===typeof e&&\n    (a=b.pop());return null===c&&1===b.length&&b[0]instanceof g?b[0]:(new E(b,c)).lift(new W(a))}function ta(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];if(1===b.length)if(D(b[0]))b=b[0];else return b[0];return(new E(b)).lift(new vb)}function wb(b){var a=b.obj,c=b.keys,e=b.index,d=b.subscriber;e===b.length?d.complete():(c=c[e],d.next([c,a[c]]),b.index=e+1,this.schedule(b))}function X(b){return b instanceof Date&&!isNaN(+b)}function ua(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=\n    arguments[a];a=b[b.length-1];\"function\"===typeof a&&b.pop();return(new E(b)).lift(new va(a))}function wa(b,a){if(\"function\"!==typeof b)throw new TypeError(\"argument is not a function. Are you looking for `mapTo()`?\");return this.lift(new xa(b,a))}function xb(b,a){void 0===a&&(a=null);return new J({method:\"GET\",url:b,headers:a})}function yb(b,a,c){return new J({method:\"POST\",url:b,body:a,headers:c})}function zb(b,a){return new J({method:\"DELETE\",url:b,headers:a})}function Ab(b,a,c){return new J({method:\"PUT\",\n    url:b,body:a,headers:c})}function Bb(b,a,c){return new J({method:\"PATCH\",url:b,body:a,headers:c})}function Cb(b,a){return(new J({method:\"GET\",url:b,responseType:\"json\",headers:a})).lift(new xa(function(c,a){return c.response},null))}function Db(b){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var c=a.length,e=0;e<c;e++){var d=a[e],f;for(f in d)d.hasOwnProperty(f)&&(b[f]=d[f])}return b}function ya(b){var a=b.subscriber,c=b.context;c&&a.closeContext(c);a.closed||(b.context=a.openContext(),\n    b.context.closeAction=this.schedule(b,b.bufferTimeSpan))}function Eb(b){var a=b.bufferCreationInterval,c=b.bufferTimeSpan,e=b.subscriber,d=b.scheduler,f=e.openContext();e.closed||(e.add(f.closeAction=d.schedule(za,c,{subscriber:e,context:f})),this.schedule(b,a))}function za(b){b.subscriber.closeContext(b.context)}function Aa(b){b=new Fb(b);var a=this.lift(b);return b.caught=a}function Ba(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);\"number\"===typeof a&&(c=a,a=null);return this.lift(new Ca(b,a,\n    c))}function Da(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);\"number\"===typeof a&&(c=a,a=null);return this.lift(new Ea(b,a,c))}function Gb(b){b.debouncedNext()}function Hb(){return function(){function b(){this._values=[]}b.prototype.add=function(a){this.has(a)||this._values.push(a)};b.prototype.has=function(a){return-1!==this._values.indexOf(a)};Object.defineProperty(b.prototype,\"size\",{get:function(){return this._values.length},enumerable:!0,configurable:!0});b.prototype.clear=function(){this._values.length=\n    0};return b}()}function Fa(b,a){return this.lift(new Ib(b,a))}function Ga(b,a,c){return this.lift(new Jb(b,a,c))}function ea(b,a){return this.lift(new Kb(b,a))}function Ha(b){return this.lift(new Lb(b))}function Mb(b){b.clearThrottle()}function Ia(b){return b(this)}function G(b,a){var c;c=\"function\"===typeof b?b:function(){return b};if(\"function\"===typeof a)return this.lift(new Nb(c,a));a=Object.create(this,Ob);a.source=this;a.subjectFactory=c;return a}function Pb(b,a){function c(){return!c.pred.apply(c.thisArg,\n    arguments)}c.pred=b;c.thisArg=a;return c}function Qb(b,a){return function(c){var e=c;for(c=0;c<a;c++)if(e=e[b[c]],\"undefined\"===typeof e)return;return e}}function Rb(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function Sb(){return new v}function Ja(){return this.lift(new Tb)}function Ub(b){b.subscriber.clearThrottle()}function Vb(b){var a=b.subscriber,c=b.windowTimeSpan,e=b.window;e&&a.closeWindow(e);b.window=a.openWindow();this.schedule(b,c)}function Wb(b){var a=b.windowTimeSpan,\n    c=b.subscriber,e=b.scheduler,d=b.windowCreationInterval,f=c.openWindow(),h={action:this,subscription:null};h.subscription=e.schedule(Ka,a,{subscriber:c,window:f,context:h});this.add(h.subscription);this.schedule(b,d)}function Ka(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription);a.closeWindow(c)}function La(b,a){for(var c=0,e=a.length;c<e;c++)for(var d=a[c],f=Object.getOwnPropertyNames(d.prototype),h=0,g=f.length;h<g;h++){var k=f[h];b.prototype[k]=\n    d.prototype[k]}}var ob=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},Xb=\"undefined\"!==typeof self&&\"undefined\"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Yb=\"undefined\"!==typeof global&&global,n=\"undefined\"!==typeof window&&window||Yb||Xb;if(!n)throw Error(\"RxJS could not find any global context (window, self, global)\");var D=Array.isArray||function(b){return b&&\"number\"===\n    typeof b.length},m={e:{}},la,O=function(b){function a(c){b.call(this);this.errors=c;c=Error.call(this,c?c.length+\" errors occurred during unsubscription:\\n  \"+c.map(function(c,a){return a+1+\") \"+c.toString()}).join(\"\\n  \"):\"\");this.name=c.name=\"UnsubscriptionError\";this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),u=function(){function b(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){var b=\n    this._parent,d=this._parents,f=this._unsubscribe,h=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var g=-1,k=d?d.length:0;b;)b.remove(this),b=++g<k&&d[g]||null;N(f)&&(b=r(f).call(this),b===m&&(a=!0,c=c||(m.e instanceof O?ma(m.e.errors):[m.e])));if(D(h))for(g=-1,k=h.length;++g<k;)b=h[g],null!=b&&\"object\"===typeof b&&(b=r(b.unsubscribe).call(b),b===m&&(a=!0,c=c||[],b=m.e,b instanceof O?c=c.concat(ma(b.errors)):c.push(b)));if(a)throw new O(c);}};b.prototype.add=\n    function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case \"function\":c=new b(a);case \"object\":if(c.closed||\"function\"!==typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;\"function\"!==typeof c._addParent&&(a=c,c=new b,c._subscriptions=[a]);break;default:throw Error(\"unrecognized teardown \"+a+\" added to Subscription.\");}(this._subscriptions||(this._subscriptions=[])).push(c);c._addParent(this);return c};b.prototype.remove=function(a){var c=\n    this._subscriptions;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))};b.prototype._addParent=function(a){var c=this._parent,b=this._parents;c&&c!==a?b?-1===b.indexOf(a)&&b.push(a):this._parents=[a]:this._parent=a};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),Y={closed:!0,next:function(b){},error:function(b){throw b;},complete:function(){}},fa=n.Symbol,R=\"function\"===typeof fa&&\"function\"===typeof fa.for?fa.for(\"rxSubscriber\"):\"@@rxSubscriber\",l=function(b){function a(c,e,d){b.call(this);\n    this.syncErrorValue=null;this.isStopped=this.syncErrorThrowable=this.syncErrorThrown=!1;switch(arguments.length){case 0:this.destination=Y;break;case 1:if(!c){this.destination=Y;break}if(\"object\"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new Ma(this,c));break}default:this.syncErrorThrowable=!0,this.destination=new Ma(this,c,e,d)}}k(a,b);a.prototype[R]=function(){return this};a.create=function(c,b,d){c=new a(c,b,d);c.syncErrorThrowable=\n    !1;return c};a.prototype.next=function(c){this.isStopped||this._next(c)};a.prototype.error=function(c){this.isStopped||(this.isStopped=!0,this._error(c))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,b.prototype.unsubscribe.call(this))};a.prototype._next=function(c){this.destination.next(c)};a.prototype._error=function(c){this.destination.error(c);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();\n    this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var c=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=c;this._parents=a;return this};return a}(u),Ma=function(b){function a(c,a,d,f){b.call(this);this._parentSubscriber=c;var e;c=this;N(a)?e=a:a&&(e=a.next,d=a.error,f=a.complete,a!==Y&&(c=Object.create(a),N(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this)));this._context=\n    c;this._next=e;this._error=d;this._complete=f}k(a,b);a.prototype.next=function(c){if(!this.isStopped&&this._next){var a=this._parentSubscriber;a.syncErrorThrowable?this.__tryOrSetError(a,this._next,c)&&this.unsubscribe():this.__tryOrUnsub(this._next,c)}};a.prototype.error=function(c){if(!this.isStopped){var a=this._parentSubscriber;if(this._error)a.syncErrorThrowable?this.__tryOrSetError(a,this._error,c):this.__tryOrUnsub(this._error,c),this.unsubscribe();else if(a.syncErrorThrowable)a.syncErrorValue=\n    c,a.syncErrorThrown=!0,this.unsubscribe();else throw this.unsubscribe(),c;}};a.prototype.complete=function(){var c=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var b=function(){return c._complete.call(c._context)};a.syncErrorThrowable?this.__tryOrSetError(a,b):this.__tryOrUnsub(b)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(c,a){try{c.call(this._context,a)}catch(d){throw this.unsubscribe(),d;}};a.prototype.__tryOrSetError=function(c,a,b){try{a.call(this._context,\n    b)}catch(f){return c.syncErrorValue=f,c.syncErrorThrown=!0}return!1};a.prototype._unsubscribe=function(){var c=this._parentSubscriber;this._parentSubscriber=this._context=null;c.unsubscribe()};return a}(l),I=function(b){var a=b.Symbol;\"function\"===typeof a?a.observable?b=a.observable:(b=a(\"observable\"),a.observable=b):b=\"@@observable\";return b}(n),g=function(){function b(a){this._isScalar=!1;a&&(this._subscribe=a)}b.prototype.lift=function(a){var c=new b;c.source=this;c.operator=a;return c};b.prototype.subscribe=\n    function(a,c,b){var e=this.operator;a:{if(a){if(a instanceof l)break a;if(a[R]){a=a[R]();break a}}a=a||c||b?new l(a,c,b):new l(Y)}e?e.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a));if(a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){a.syncErrorThrown=!0,a.syncErrorValue=c,a.error(c)}};b.prototype.forEach=function(a,c){var b=this;c||(n.Rx&&\n    n.Rx.config&&n.Rx.config.Promise?c=n.Rx.config.Promise:n.Promise&&(c=n.Promise));if(!c)throw Error(\"no Promise impl found\");return new c(function(c,e){var d;d=b.subscribe(function(c){if(d)try{a(c)}catch(C){e(C),d.unsubscribe()}else a(c)},e,c)})};b.prototype._subscribe=function(a){return this.source.subscribe(a)};b.prototype[I]=function(){return this};b.create=function(a){return new b(a)};return b}(),H=function(b){function a(){var c=b.call(this,\"object unsubscribed\");this.name=c.name=\"ObjectUnsubscribedError\";\n    this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),Na=function(b){function a(c,a){b.call(this);this.subject=c;this.subscriber=a;this.closed=!1}k(a,b);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var c=this.subject,a=c.observers;this.subject=null;!a||0===a.length||c.isStopped||c.closed||(c=a.indexOf(this.subscriber),-1!==c&&a.splice(c,1))}};return a}(u),Oa=function(b){function a(c){b.call(this,c);this.destination=c}k(a,b);return a}(l),v=function(b){function a(){b.call(this);\n    this.observers=[];this.hasError=this.isStopped=this.closed=!1;this.thrownError=null}k(a,b);a.prototype[R]=function(){return new Oa(this)};a.prototype.lift=function(c){var a=new Z(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new H;if(!this.isStopped)for(var a=this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].next(c)};a.prototype.error=function(c){if(this.closed)throw new H;this.hasError=!0;this.thrownError=c;this.isStopped=!0;for(var a=this.observers,b=a.length,\n    a=a.slice(),f=0;f<b;f++)a[f].error(c);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new H;this.isStopped=!0;for(var c=this.observers,a=c.length,c=c.slice(),b=0;b<a;b++)c[b].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(c){if(this.closed)throw new H;return b.prototype._trySubscribe.call(this,c)};a.prototype._subscribe=function(c){if(this.closed)throw new H;\n    if(this.hasError)return c.error(this.thrownError),u.EMPTY;if(this.isStopped)return c.complete(),u.EMPTY;this.observers.push(c);return new Na(this,c)};a.prototype.asObservable=function(){var c=new g;c.source=this;return c};a.create=function(c,a){return new Z(c,a)};return a}(g),Z=function(b){function a(c,a){b.call(this);this.destination=c;this.source=a}k(a,b);a.prototype.next=function(c){var a=this.destination;a&&a.next&&a.next(c)};a.prototype.error=function(c){var a=this.destination;a&&a.error&&this.destination.error(c)};\n    a.prototype.complete=function(){var c=this.destination;c&&c.complete&&this.destination.complete()};a.prototype._subscribe=function(c){return this.source?this.source.subscribe(c):u.EMPTY};return a}(v),L=function(b){function a(){b.apply(this,arguments);this.value=null;this.hasCompleted=this.hasNext=!1}k(a,b);a.prototype._subscribe=function(c){return this.hasError?(c.error(this.thrownError),u.EMPTY):this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),u.EMPTY):b.prototype._subscribe.call(this,\n    c)};a.prototype.next=function(c){this.hasCompleted||(this.value=c,this.hasNext=!0)};a.prototype.error=function(c){this.hasCompleted||b.prototype.error.call(this,c)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&b.prototype.next.call(this,this.value);b.prototype.complete.call(this)};return a}(v),Zb=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);\n    return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var b=this.callbackFunc,d=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(a.dispatch,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new L,f=function C(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=C.source,a=b.selector,b=b.subject;a?(c=r(a).apply(this,c),c===m?b.error(m.e):(b.next(c),b.complete())):\n    (b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,r(b).apply(this.context,d.concat(f))===m&&h.error(m.e));return h.subscribe(c)};a.dispatch=function(c){var a=this,b=c.source,f=c.subscriber;c=c.context;var h=b.callbackFunc,g=b.args,k=b.scheduler,B=b.subject;if(!B){var B=b.subject=new L,l=function tb(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=tb.source,b=e.selector,e=e.subject;b?(c=r(b).apply(this,c),c===m?a.add(k.schedule(qb,0,{err:m.e,subject:e})):a.add(k.schedule(na,\n    0,{value:c,subject:e}))):a.add(k.schedule(na,0,{value:1>=c.length?c[0]:c,subject:e}))};l.source=b;r(h).apply(c,g.concat(l))===m&&B.error(m.e)}a.add(B.subscribe(f))};return a}(g).create;g.bindCallback=Zb;var $b=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=\n    function(c){var a=this.callbackFunc,b=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(rb,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new L,f=function C(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=C.source,a=b.selector,b=b.subject,e=c.shift();e?b.error(e):a?(c=r(a).apply(this,c),c===m?b.error(m.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,r(a).apply(this.context,b.concat(f))===m&&h.error(m.e));\n    return h.subscribe(c)};return a}(g).create;g.bindNodeCallback=$b;var ga=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar=!0;a&&(this._isScalar=!1)}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.value,b=c.subscriber;c.done?b.complete():(b.next(a),b.closed||(c.done=!0,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.value,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{done:!1,value:b,subscriber:c});c.next(b);\n    c.closed||c.complete()};return a}(g),F=function(b){function a(c){b.call(this);this.scheduler=c}k(a,b);a.create=function(c){return new a(c)};a.dispatch=function(c){c.subscriber.complete()};a.prototype._subscribe=function(c){var b=this.scheduler;if(b)return b.schedule(a.dispatch,0,{subscriber:c});c.complete()};return a}(g),E=function(b){function a(c,a){b.call(this);this.array=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){return new a(c,b)};a.of=\n    function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];b=c[c.length-1];z(b)?c.pop():b=null;var d=c.length;return 1<d?new a(c,b):1===d?new ga(c[0],b):new F(b)};a.dispatch=function(c){var a=c.array,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a[b]),f.closed||(c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.array,d=b.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(f=0;f<d&&!c.closed;f++)c.next(b[f]);\n    c.complete()};return a}(g),q=function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.destination.next(a)};a.prototype.notifyError=function(c,a){this.destination.error(c)};a.prototype.notifyComplete=function(c){this.destination.complete()};return a}(l),A=function(b){var a=b.Symbol;if(\"function\"===typeof a)return a.iterator||(a.iterator=a(\"iterator polyfill\")),a.iterator;if((a=b.Set)&&\"function\"===typeof(new a)[\"@@iterator\"])return\"@@iterator\";if(b=b.Map)for(var a=\n    Object.getOwnPropertyNames(b.prototype),c=0;c<a.length;++c){var e=a[c];if(\"entries\"!==e&&\"size\"!==e&&b.prototype[e]===b.prototype.entries)return e}return\"@@iterator\"}(n),qa=function(b){function a(c,a,d){b.call(this);this.parent=c;this.outerValue=a;this.outerIndex=d;this.index=0}k(a,b);a.prototype._next=function(c){this.parent.notifyNext(this.outerValue,c,this.outerIndex,this.index++,this)};a.prototype._error=function(c){this.parent.notifyError(c,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);\n    this.unsubscribe()};return a}(l),Pa={},ha=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new ac(a,this.project))};return b}(),ac=function(b){function a(c,a){b.call(this,c);this.project=a;this.active=0;this.values=[];this.observables=[]}k(a,b);a.prototype._next=function(c){this.values.push(Pa);this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;\n    for(var b=0;b<a;b++){var f=c[b];this.add(p(this,f,f,b))}}};a.prototype.notifyComplete=function(c){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){c=this.values;f=c[b];f=this.toRespond?f===Pa?--this.toRespond:this.toRespond:0;c[b]=a;0===f&&(this.project?this._tryProject(c):this.destination.next(c.slice()))};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(q);\n    g.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=a=null;z(b[b.length-1])&&(c=b.pop());\"function\"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&D(b[0])&&(b=b[0]);return(new E(b,c)).lift(new ha(a))};var W=function(){function b(a){this.concurrent=a}b.prototype.call=function(a,c){return c.subscribe(new bc(a,this.concurrent))};return b}(),bc=function(b){function a(c,a){b.call(this,c);this.concurrent=a;this.hasCompleted=!1;this.buffer=[];this.active=0}k(a,\n    b);a.prototype._next=function(c){this.active<this.concurrent?(this.active++,this.add(p(this,c))):this.buffer.push(c)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyComplete=function(c){var a=this.buffer;this.remove(c);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.concat=P;var dc=function(b){function a(c){b.call(this);this.observableFactory=\n    c}k(a,b);a.create=function(c){return new a(c)};a.prototype._subscribe=function(c){return new cc(c,this.observableFactory)};return a}(g),cc=function(b){function a(c,a){b.call(this,c);this.factory=a;this.tryDefer()}k(a,b);a.prototype.tryDefer=function(){try{this._callFactory()}catch(c){this._error(c)}};a.prototype._callFactory=function(){var c=this.factory();c&&this.add(p(this,c))};return a}(q);g.defer=dc.create;g.empty=F.create;var fc=function(b){function a(c,a){b.call(this);this.sources=c;this.resultSelector=\n    a}k(a,b);a.create=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];if(null===c||0===arguments.length)return new F;b=null;\"function\"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return 0===c.length?new F:new a(c,b)};a.prototype._subscribe=function(c){return new ec(c,this.sources,this.resultSelector)};return a}(g),ec=function(b){function a(c,a,d){b.call(this,c);this.sources=a;this.resultSelector=d;this.haveValues=this.completed=0;this.total=c=a.length;this.values=\n    Array(c);for(d=0;d<c;d++){var e=p(this,a[d],null,d);e&&(e.outerIndex=d,this.add(e))}}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.values[b]=a;h._hasValue||(h._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(c){var a=this.destination,b=this.haveValues,f=this.resultSelector,h=this.values,g=h.length;c._hasValue?(this.completed++,this.completed===g&&(b===g&&(c=f?f.apply(this,h):h,a.next(c)),a.complete())):a.complete()};return a}(q);g.forkJoin=fc.create;var Qa=function(b){function a(c,\n    a){b.call(this);this.promise=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this,b=this.promise,f=this.scheduler;if(null==f)this._isScalar?c.closed||(c.next(this.value),c.complete()):b.then(function(b){a.value=b;a._isScalar=!0;c.closed||(c.next(b),c.complete())},function(a){c.closed||c.error(a)}).then(null,function(c){n.setTimeout(function(){throw c;})});else if(this._isScalar){if(!c.closed)return f.schedule(ra,0,{value:this.value,subscriber:c})}else b.then(function(b){a.value=\n    b;a._isScalar=!0;c.closed||c.add(f.schedule(ra,0,{value:b,subscriber:c}))},function(a){c.closed||c.add(f.schedule(ub,0,{err:a,subscriber:c}))}).then(null,function(c){n.setTimeout(function(){throw c;})})};return a}(g),ic=function(b){function a(c,a){b.call(this);this.scheduler=a;if(null==c)throw Error(\"iterator cannot be null.\");if((a=c[A])||\"string\"!==typeof c)if(a||void 0===c.length){if(!a)throw new TypeError(\"object is not iterable\");c=c[A]()}else c=new gc(c);else c=new hc(c);this.iterator=c}k(a,\n    b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.index,b=c.iterator,f=c.subscriber;if(c.hasError)f.error(c.error);else{var h=b.next();h.done?f.complete():(f.next(h.value),c.index=a+1,f.closed?\"function\"===typeof b.return&&b.return():this.schedule(c))}};a.prototype._subscribe=function(c){var b=this.iterator,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{index:0,iterator:b,subscriber:c});do{d=b.next();if(d.done){c.complete();break}else c.next(d.value);if(c.closed){\"function\"===\n    typeof b.return&&b.return();break}}while(1)};return a}(g),hc=function(){function b(a,c,b){void 0===c&&(c=0);void 0===b&&(b=a.length);this.str=a;this.idx=c;this.len=b}b.prototype[A]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}};return b}(),gc=function(){function b(a,c,b){void 0===c&&(c=0);if(void 0===b)if(b=+a.length,isNaN(b))b=0;else if(0!==b&&\"number\"===typeof b&&n.isFinite(b)){var e;e=+b;e=0===e?e:\n    isNaN(e)?e:0>e?-1:1;b=e*Math.floor(Math.abs(b));b=0>=b?0:b>Ra?Ra:b}this.arr=a;this.idx=c;this.len=b}b.prototype[A]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}};return b}(),Ra=Math.pow(2,53)-1,jc=function(b){function a(c,a){b.call(this);this.arrayLike=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){var e=c.length;return 0===e?new F:1===e?new ga(c[0],b):\n    new a(c,b)};a.dispatch=function(c){var a=c.arrayLike,b=c.index,f=c.subscriber;f.closed||(b>=c.length?f.complete():(f.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler,f=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:f,subscriber:c});for(d=0;d<f&&!c.closed;d++)c.next(b[d]);c.complete()};return a}(g),w=function(){function b(a,c,b){this.kind=a;this.value=c;this.error=b;this.hasValue=\"N\"===a}b.prototype.observe=\n    function(a){switch(this.kind){case \"N\":return a.next&&a.next(this.value);case \"E\":return a.error&&a.error(this.error);case \"C\":return a.complete&&a.complete()}};b.prototype.do=function(a,c,b){switch(this.kind){case \"N\":return a&&a(this.value);case \"E\":return c&&c(this.error);case \"C\":return b&&b()}};b.prototype.accept=function(a,c,b){return a&&\"function\"===typeof a.next?this.observe(a):this.do(a,c,b)};b.prototype.toObservable=function(){switch(this.kind){case \"N\":return g.of(this.value);case \"E\":return g.throw(this.error);\n    case \"C\":return g.empty()}throw Error(\"unexpected notification kind value\");};b.createNext=function(a){return\"undefined\"!==typeof a?new b(\"N\",a):this.undefinedValueNotification};b.createError=function(a){return new b(\"E\",void 0,a)};b.createComplete=function(){return this.completeNotification};b.completeNotification=new b(\"C\");b.undefinedValueNotification=new b(\"N\",void 0);return b}(),kc=function(){function b(a,c){void 0===c&&(c=0);this.scheduler=a;this.delay=c}b.prototype.call=function(a,c){return c.subscribe(new ia(a,\n    this.scheduler,this.delay))};return b}(),ia=function(b){function a(c,a,d){void 0===d&&(d=0);b.call(this,c);this.scheduler=a;this.delay=d}k(a,b);a.dispatch=function(c){c.notification.observe(c.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(c){this.add(this.scheduler.schedule(a.dispatch,this.delay,new lc(c,this.destination)))};a.prototype._next=function(c){this.scheduleMessage(w.createNext(c))};a.prototype._error=function(c){this.scheduleMessage(w.createError(c))};a.prototype._complete=\n    function(){this.scheduleMessage(w.createComplete())};return a}(l),lc=function(){return function(b,a){this.notification=b;this.destination=a}}(),Sa=function(b){function a(c,a){b.call(this,null);this.ish=c;this.scheduler=a}k(a,b);a.create=function(c,b){if(null!=c){if(\"function\"===typeof c[I])return c instanceof g&&!b?c:new a(c,b);if(D(c))return new E(c,b);if(pa(c))return new Qa(c,b);if(\"function\"===typeof c[A]||\"string\"===typeof c)return new ic(c,b);if(c&&\"number\"===typeof c.length)return new jc(c,\n    b)}throw new TypeError((null!==c&&typeof c||c)+\" is not observable\");};a.prototype._subscribe=function(c){var a=this.ish,b=this.scheduler;return null==b?a[I]().subscribe(c):a[I]().subscribe(new ia(c,b,0))};return a}(g);g.from=Sa.create;var Ta=Object.prototype.toString,mc=function(b){function a(c,a,d,f){b.call(this);this.sourceObj=c;this.eventName=a;this.selector=d;this.options=f}k(a,b);a.create=function(c,b,d,f){N(d)&&(f=d,d=void 0);return new a(c,b,f,d)};a.setupSubscription=function(c,b,d,f,h){var e;\n    if(c&&\"[object NodeList]\"===Ta.call(c)||c&&\"[object HTMLCollection]\"===Ta.call(c))for(var g=0,k=c.length;g<k;g++)a.setupSubscription(c[g],b,d,f,h);else if(c&&\"function\"===typeof c.addEventListener&&\"function\"===typeof c.removeEventListener)c.addEventListener(b,d,h),e=function(){return c.removeEventListener(b,d)};else if(c&&\"function\"===typeof c.on&&\"function\"===typeof c.off)c.on(b,d),e=function(){return c.off(b,d)};else if(c&&\"function\"===typeof c.addListener&&\"function\"===typeof c.removeListener)c.addListener(b,\n    d),e=function(){return c.removeListener(b,d)};else throw new TypeError(\"Invalid event target\");f.add(new u(e))};a.prototype._subscribe=function(c){var b=this.selector;a.setupSubscription(this.sourceObj,this.eventName,b?function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];a=r(b).apply(void 0,a);a===m?c.error(m.e):c.next(a)}:function(a){return c.next(a)},c,this.options)};return a}(g).create;g.fromEvent=mc;var nc=function(b){function a(c,a,d){b.call(this);this.addHandler=c;this.removeHandler=\n    a;this.selector=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){var a=this,b=this.removeHandler,f=this.selector?function(){for(var b=[],e=0;e<arguments.length;e++)b[e-0]=arguments[e];a._callSelector(c,b)}:function(a){c.next(a)},h=this._callAddHandler(f,c);N(b)&&c.add(new u(function(){b(f,h)}))};a.prototype._callSelector=function(c,a){try{var b=this.selector.apply(this,a);c.next(b)}catch(f){c.error(f)}};a.prototype._callAddHandler=function(c,a){try{return this.addHandler(c)||\n    null}catch(d){a.error(d)}};return a}(g).create;g.fromEventPattern=nc;g.fromPromise=Qa.create;var Ua=function(b){return b},oc=function(b){function a(c,a,d,f,h){b.call(this);this.initialState=c;this.condition=a;this.iterate=d;this.resultSelector=f;this.scheduler=h}k(a,b);a.create=function(c,b,d,f,h){return 1==arguments.length?new a(c.initialState,c.condition,c.iterate,c.resultSelector||Ua,c.scheduler):void 0===f||z(f)?new a(c,b,d,Ua,f):new a(c,b,d,f,h)};a.prototype._subscribe=function(c){var b=this.initialState;\n    if(this.scheduler)return this.scheduler.schedule(a.dispatch,0,{subscriber:c,iterate:this.iterate,condition:this.condition,resultSelector:this.resultSelector,state:b});var d=this.condition,f=this.resultSelector,h=this.iterate;do{if(d){var g=void 0;try{g=d(b)}catch(C){c.error(C);break}if(!g){c.complete();break}}g=void 0;try{g=f(b)}catch(C){c.error(C);break}c.next(g);if(c.closed)break;try{b=h(b)}catch(C){c.error(C);break}}while(1)};a.dispatch=function(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=\n    c.iterate(c.state)}catch(y){a.error(y);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(y){a.error(y);return}if(!f){a.complete();return}if(a.closed)return}var h;try{h=c.resultSelector(c.state)}catch(y){a.error(y);return}if(!a.closed&&(a.next(h),!a.closed))return this.schedule(c)}};return a}(g);g.generate=oc.create;var qc=function(b){function a(c,a,d){b.call(this);this.condition=c;this.thenSource=a;this.elseSource=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=\n    function(c){return new pc(c,this.condition,this.thenSource,this.elseSource)};return a}(g),pc=function(b){function a(c,a,d,f){b.call(this,c);this.condition=a;this.thenSource=d;this.elseSource=f;this.tryIf()}k(a,b);a.prototype.tryIf=function(){var c=this.condition,a=this.thenSource,b=this.elseSource,f;try{(c=(f=c())?a:b)?this.add(p(this,c)):this._complete()}catch(h){this._error(h)}};return a}(q);g.if=qc.create;var S=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a;this.pending=\n    !1}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(this.closed)return this;this.state=c;this.pending=!0;c=this.id;var b=this.scheduler;null!=c&&(this.id=this.recycleAsyncId(b,c,a));this.delay=a;this.id=this.id||this.requestAsyncId(b,this.id,a);return this};a.prototype.requestAsyncId=function(c,a,b){void 0===b&&(b=0);return n.setInterval(c.flush.bind(c,this),b)};a.prototype.recycleAsyncId=function(c,a,b){void 0===b&&(b=0);return null!==b&&this.delay===b&&!1===this.pending?a:(n.clearInterval(a),\n    void 0)};a.prototype.execute=function(c,a){if(this.closed)return Error(\"executing a cancelled action\");this.pending=!1;if(c=this._execute(c,a))return c;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(c,a){a=!1;var b=void 0;try{this.work(c)}catch(f){a=!0,b=!!f&&f||Error(f)}if(a)return this.unsubscribe(),b};a.prototype._unsubscribe=function(){var c=this.id,a=this.scheduler,b=a.actions,f=b.indexOf(this);this.state=this.work=\n    null;this.pending=!1;this.scheduler=null;-1!==f&&b.splice(f,1);null!=c&&(this.id=this.recycleAsyncId(a,c,null));this.delay=null};return a}(function(b){function a(c,a){b.call(this)}k(a,b);a.prototype.schedule=function(c,a){return this};return a}(u)),T=function(b){function a(){b.apply(this,arguments);this.actions=[];this.active=!1;this.scheduled=void 0}k(a,b);a.prototype.flush=function(c){var a=this.actions;if(this.active)a.push(c);else{var b;this.active=!0;do if(b=c.execute(c.state,c.delay))break;\n    while(c=a.shift());this.active=!1;if(b){for(;c=a.shift();)c.unsubscribe();throw b;}}};return a}(function(){function b(a,c){void 0===c&&(c=b.now);this.SchedulerAction=a;this.now=c}b.prototype.schedule=function(a,c,b){void 0===c&&(c=0);return(new this.SchedulerAction(this,a)).schedule(b,c)};b.now=Date.now?Date.now:function(){return+new Date};return b}()),x=new T(S),rc=function(b){function a(c,a){void 0===c&&(c=0);void 0===a&&(a=x);b.call(this);this.period=c;this.scheduler=a;if(!Q(c)||0>c)this.period=\n    0;a&&\"function\"===typeof a.schedule||(this.scheduler=x)}k(a,b);a.create=function(c,b){void 0===c&&(c=0);void 0===b&&(b=x);return new a(c,b)};a.dispatch=function(c){var a=c.subscriber,b=c.period;a.next(c.index);a.closed||(c.index+=1,this.schedule(c,b))};a.prototype._subscribe=function(c){var b=this.period;c.add(this.scheduler.schedule(a.dispatch,b,{index:0,subscriber:c,period:b}))};return a}(g).create;g.interval=rc;g.merge=sa;var vb=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new sc(a))};\n    return b}(),sc=function(b){function a(c){b.call(this,c);this.hasFirst=!1;this.observables=[];this.subscriptions=[]}k(a,b);a.prototype._next=function(c){this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{for(var b=0;b<a&&!this.hasFirst;b++){var f=c[b],f=p(this,f,f,b);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(c,a,b,f,h){if(!this.hasFirst){this.hasFirst=\n    !0;for(c=0;c<this.subscriptions.length;c++)c!==b&&(f=this.subscriptions[c],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(q);g.race=ta;var tc=function(b){function a(){b.call(this)}k(a,b);a.create=function(){return new a};a.prototype._subscribe=function(c){};return a}(g).create;g.never=tc;g.of=E.of;var Va=function(){function b(a){this.nextSources=a}b.prototype.call=function(a,c){return c.subscribe(new uc(a,this.nextSources))};return b}(),uc=function(b){function a(c,\n    a){b.call(this,c);this.destination=c;this.nextSources=a}k(a,b);a.prototype.notifyError=function(c,a){this.subscribeToNextSource()};a.prototype.notifyComplete=function(c){this.subscribeToNextSource()};a.prototype._error=function(c){this.subscribeToNextSource()};a.prototype._complete=function(){this.subscribeToNextSource()};a.prototype.subscribeToNextSource=function(){var c=this.nextSources.shift();c?this.add(p(this,c)):this.destination.complete()};return a}(q);g.onErrorResumeNext=function(){for(var b=\n    [],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);a=b.shift();return(new Sa(a,null)).lift(new Va(b))};var vc=function(b){function a(c,a){b.call(this);this.obj=c;this.scheduler=a;this.keys=Object.keys(c)}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.keys,b=this.scheduler,f=a.length;if(b)return b.schedule(wb,0,{obj:this.obj,keys:a,length:f,index:0,subscriber:c});for(b=0;b<f;b++){var h=a[b];c.next([h,this.obj[h]])}c.complete()};\n    return a}(g).create;g.pairs=vc;var wc=function(b){function a(c,a,d){b.call(this);this.start=c;this._count=a;this.scheduler=d}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);void 0===b&&(b=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.start,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a),f.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=0,d=this.start,f=this._count,h=this.scheduler;if(h)return h.schedule(a.dispatch,0,{index:b,count:f,\n    start:d,subscriber:c});do{if(b++>=f){c.complete();break}c.next(d++);if(c.closed)break}while(1)};return a}(g).create;g.range=wc;var yc=function(b){function a(c,a){b.call(this);this.resourceFactory=c;this.observableFactory=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.resourceFactory,b=this.observableFactory,f;try{return f=a(),new xc(c,f,b)}catch(h){c.error(h)}};return a}(g),xc=function(b){function a(c,a,d){b.call(this,c);this.resource=a;this.observableFactory=\n    d;c.add(a);this.tryUse()}k(a,b);a.prototype.tryUse=function(){try{var c=this.observableFactory.call(this,this.resource);c&&this.add(p(this,c))}catch(e){this._error(e)}};return a}(q);g.using=yc.create;var zc=function(b){function a(c,a){b.call(this);this.error=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){c.subscriber.error(c.error)};a.prototype._subscribe=function(c){var b=this.error,d=this.scheduler;c.syncErrorThrowable=!0;if(d)return d.schedule(a.dispatch,\n    0,{error:b,subscriber:c});c.error(b)};return a}(g).create;g.throw=zc;var Ac=function(b){function a(c,a,d){void 0===c&&(c=0);b.call(this);this.period=-1;this.dueTime=0;Q(a)?this.period=1>Number(a)&&1||Number(a):z(a)&&(d=a);z(d)||(d=x);this.scheduler=d;this.dueTime=X(c)?+c-this.scheduler.now():c}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.index,b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete();c.index=a+1;this.schedule(c,\n    b)}};a.prototype._subscribe=function(c){return this.scheduler.schedule(a.dispatch,this.dueTime,{index:0,period:this.period,subscriber:c})};return a}(g).create;g.timer=Ac;var va=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new Bc(a,this.project))};return b}(),Bc=function(b){function a(c,a,d){void 0===d&&(d=Object.create(null));b.call(this,c);this.iterators=[];this.active=0;this.project=\"function\"===typeof a?a:null;this.values=d}k(a,b);a.prototype._next=\n    function(c){var a=this.iterators;D(c)?a.push(new Cc(c)):\"function\"===typeof c[A]?a.push(new Dc(c[A]())):a.push(new Ec(this.destination,this,c))};a.prototype._complete=function(){var c=this.iterators,a=c.length;if(0===a)this.destination.complete();else{this.active=a;for(var b=0;b<a;b++){var f=c[b];f.stillUnsubscribed?this.add(f.subscribe(f,b)):this.active--}}};a.prototype.notifyInactive=function(){this.active--;0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var c=\n    this.iterators,a=c.length,b=this.destination,f=0;f<a;f++){var h=c[f];if(\"function\"===typeof h.hasValue&&!h.hasValue())return}for(var g=!1,k=[],f=0;f<a;f++){var h=c[f],l=h.next();h.hasCompleted()&&(g=!0);if(l.done){b.complete();return}k.push(l.value)}this.project?this._tryProject(k):b.next(k);g&&b.complete()};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(l),Dc=function(){function b(a){this.iterator=\n    a;this.nextResult=a.next()}b.prototype.hasValue=function(){return!0};b.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};b.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return b}(),Cc=function(){function b(a){this.array=a;this.length=this.index=0;this.length=a.length}b.prototype[A]=function(){return this};b.prototype.next=function(a){a=this.index++;var c=this.array;return a<this.length?{value:c[a],done:!1}:{value:null,done:!0}};\n    b.prototype.hasValue=function(){return this.array.length>this.index};b.prototype.hasCompleted=function(){return this.array.length===this.index};return b}(),Ec=function(b){function a(c,a,d){b.call(this,c);this.parent=a;this.observable=d;this.stillUnsubscribed=!0;this.buffer=[];this.isComplete=!1}k(a,b);a.prototype[A]=function(){return this};a.prototype.next=function(){var c=this.buffer;return 0===c.length&&this.isComplete?{value:null,done:!0}:{value:c.shift(),done:!1}};a.prototype.hasValue=function(){return 0<\n    this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(c,a){return p(this,this.observable,this,a)};return a}(q);g.zip=ua;var xa=function(){function b(a,c){this.project=a;this.thisArg=c}b.prototype.call=\n    function(a,c){return c.subscribe(new Fc(a,this.project,this.thisArg))};return b}(),Fc=function(b){function a(c,a,d){b.call(this,c);this.project=a;this.count=0;this.thisArg=d||this}k(a,b);a.prototype._next=function(c){var a;try{a=this.project.call(this.thisArg,c,this.count++)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(l),J=function(b){function a(c){b.call(this);var a={async:!0,createXHR:function(){var c;if(this.crossDomain)if(n.XMLHttpRequest)c=new n.XMLHttpRequest;\n    else if(n.XDomainRequest)c=new n.XDomainRequest;else throw Error(\"CORS is not supported by your browser\");else if(n.XMLHttpRequest)c=new n.XMLHttpRequest;else{var a=void 0;try{for(var b=[\"Msxml2.XMLHTTP\",\"Microsoft.XMLHTTP\",\"Msxml2.XMLHTTP.4.0\"],e=0;3>e;e++)try{a=b[e];new n.ActiveXObject(a);break}catch(B){}c=new n.ActiveXObject(a)}catch(B){throw Error(\"XMLHttpRequest is not supported by your browser\");}}return c},crossDomain:!1,withCredentials:!1,headers:{},method:\"GET\",responseType:\"json\",timeout:0};\n    if(\"string\"===typeof c)a.url=c;else for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);this.request=a}k(a,b);a.prototype._subscribe=function(c){return new Gc(c,this.request)};a.create=function(){var c=function(c){return new a(c)};c.get=xb;c.post=yb;c.delete=zb;c.put=Ab;c.patch=Bb;c.getJSON=Cb;return c}();return a}(g),Gc=function(b){function a(c,a){b.call(this,c);this.request=a;this.done=!1;c=a.headers=a.headers||{};a.crossDomain||c[\"X-Requested-With\"]||(c[\"X-Requested-With\"]=\"XMLHttpRequest\");\"Content-Type\"in\n    c||n.FormData&&a.body instanceof n.FormData||\"undefined\"===typeof a.body||(c[\"Content-Type\"]=\"application/x-www-form-urlencoded; charset\\x3dUTF-8\");a.body=this.serializeBody(a.body,a.headers[\"Content-Type\"]);this.send()}k(a,b);a.prototype.next=function(c){this.done=!0;var a=this.destination;c=new Wa(c,this.xhr,this.request);a.next(c)};a.prototype.send=function(){var c=this.request,a=this.request,b=a.user,f=a.method,h=a.url,g=a.async,k=a.password,l=a.headers,a=a.body,n=r(c.createXHR).call(c);if(n===\n    m)this.error(m.e);else{this.xhr=n;this.setupEvents(n,c);b=b?r(n.open).call(n,f,h,g,b,k):r(n.open).call(n,f,h,g);if(b===m)return this.error(m.e),null;g&&(n.timeout=c.timeout,n.responseType=c.responseType);\"withCredentials\"in n&&(n.withCredentials=!!c.withCredentials);this.setHeaders(n,l);b=a?r(n.send).call(n,a):r(n.send).call(n);if(b===m)return this.error(m.e),null}return n};a.prototype.serializeBody=function(c,a){if(!c||\"string\"===typeof c||n.FormData&&c instanceof n.FormData)return c;if(a){var b=\n    a.indexOf(\";\");-1!==b&&(a=a.substring(0,b))}switch(a){case \"application/x-www-form-urlencoded\":return Object.keys(c).map(function(a){return encodeURI(a)+\"\\x3d\"+encodeURI(c[a])}).join(\"\\x26\");case \"application/json\":return JSON.stringify(c);default:return c}};a.prototype.setHeaders=function(c,a){for(var b in a)a.hasOwnProperty(b)&&c.setRequestHeader(b,a[b])};a.prototype.setupEvents=function(c,a){function b(c){var a=b.subscriber,e=b.progressSubscriber,d=b.request;e&&e.error(c);a.error(new Xa(this,d))}\n    function e(c){var a=e.subscriber,b=e.progressSubscriber,d=e.request;if(4===this.readyState){var f=1223===this.status?204:this.status,h=\"text\"===this.responseType?this.response||this.responseText:this.response;0===f&&(f=h?200:0);200<=f&&300>f?(b&&b.complete(),a.next(c),a.complete()):(b&&b.error(c),a.error(new aa(\"ajax error \"+f,this,d)))}}var h=a.progressSubscriber;c.ontimeout=b;b.request=a;b.subscriber=this;b.progressSubscriber=h;if(c.upload&&\"withCredentials\"in c){if(h){var g;g=function(c){g.progressSubscriber.next(c)};\n    n.XDomainRequest?c.onprogress=g:c.upload.onprogress=g;g.progressSubscriber=h}var k;k=function(c){var a=k.progressSubscriber,b=k.subscriber,e=k.request;a&&a.error(c);b.error(new aa(\"ajax error\",this,e))};c.onerror=k;k.request=a;k.subscriber=this;k.progressSubscriber=h}c.onreadystatechange=e;e.subscriber=this;e.progressSubscriber=h;e.request=a};a.prototype.unsubscribe=function(){var c=this.xhr;!this.done&&c&&4!==c.readyState&&\"function\"===typeof c.abort&&c.abort();b.prototype.unsubscribe.call(this)};\n    return a}(l),Wa=function(){return function(b,a,c){this.originalEvent=b;this.xhr=a;this.request=c;this.status=a.status;this.responseType=a.responseType||c.responseType;switch(this.responseType){case \"json\":this.response=\"response\"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||\"null\"):JSON.parse(a.responseText||\"null\");break;case \"xml\":this.response=a.responseXML;break;default:this.response=\"response\"in a?a.response:a.responseText}}}(),aa=function(b){function a(c,a,d){b.call(this,\n    c);this.message=c;this.xhr=a;this.request=d;this.status=a.status}k(a,b);return a}(Error),Xa=function(b){function a(c,a){b.call(this,\"ajax timeout\",c,a)}k(a,b);return a}(aa);g.ajax=J.create;var Hc=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(0<a)return b.prototype.schedule.call(this,c,a);this.delay=a;this.state=c;this.scheduler.flush(this);return this};a.prototype.execute=function(c,a){return 0<a||this.closed?\n    b.prototype.execute.call(this,c,a):this._execute(c,a)};a.prototype.requestAsyncId=function(c,a,d){void 0===d&&(d=0);return null!==d&&0<d||null===d&&0<this.delay?b.prototype.requestAsyncId.call(this,c,a,d):c.flush(this)};return a}(S),Ya=new (function(b){function a(){b.apply(this,arguments)}k(a,b);return a}(T))(Hc),K=function(b){function a(c,a,d){void 0===c&&(c=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);b.call(this);this.scheduler=d;this._events=[];this._bufferSize=1>c?1:c;this._windowTime=\n    1>a?1:a}k(a,b);a.prototype.next=function(c){var a=this._getNow();this._events.push(new Ic(a,c));this._trimBufferThenGetEvents();b.prototype.next.call(this,c)};a.prototype._subscribe=function(c){var a=this._trimBufferThenGetEvents(),b=this.scheduler,f;if(this.closed)throw new H;this.hasError?f=u.EMPTY:this.isStopped?f=u.EMPTY:(this.observers.push(c),f=new Na(this,c));b&&c.add(c=new ia(c,b));for(var b=a.length,h=0;h<b&&!c.closed;h++)c.next(a[h].value);this.hasError?c.error(this.thrownError):this.isStopped&&\n    c.complete();return f};a.prototype._getNow=function(){return(this.scheduler||Ya).now()};a.prototype._trimBufferThenGetEvents=function(){for(var c=this._getNow(),a=this._bufferSize,b=this._windowTime,f=this._events,h=f.length,g=0;g<h&&!(c-f[g].time<b);)g++;h>a&&(g=Math.max(g,h-a));0<g&&f.splice(0,g);return f};return a}(v),Ic=function(){return function(b,a){this.time=b;this.value=a}}(),Jc=n.Object.assign||Db,Kc=function(b){function a(c,a){if(c instanceof g)b.call(this,a,c);else{b.call(this);this.WebSocketCtor=\n    n.WebSocket;this._output=new v;\"string\"===typeof c?this.url=c:Jc(this,c);if(!this.WebSocketCtor)throw Error(\"no WebSocket constructor can be found\");this.destination=new K}}k(a,b);a.prototype.resultSelector=function(c){return JSON.parse(c.data)};a.create=function(c){return new a(c)};a.prototype.lift=function(c){var b=new a(this,this.destination);b.operator=c;return b};a.prototype._resetState=function(){this.socket=null;this.source||(this.destination=new K);this._output=new v};a.prototype.multiplex=\n    function(c,a,b){var e=this;return new g(function(d){var f=r(c)();f===m?d.error(m.e):e.next(f);var h=e.subscribe(function(c){var a=r(b)(c);a===m?d.error(m.e):a&&d.next(c)},function(c){return d.error(c)},function(){return d.complete()});return function(){var c=r(a)();c===m?d.error(m.e):e.next(c);h.unsubscribe()}})};a.prototype._connectSocket=function(){var c=this,a=this.WebSocketCtor,b=this._output,f=null;try{this.socket=f=this.protocol?new a(this.url,this.protocol):new a(this.url),this.binaryType&&\n    (this.socket.binaryType=this.binaryType)}catch(y){b.error(y);return}var h=new u(function(){c.socket=null;f&&1===f.readyState&&f.close()});f.onopen=function(a){var e=c.openObserver;e&&e.next(a);a=c.destination;c.destination=l.create(function(c){return 1===f.readyState&&f.send(c)},function(a){var e=c.closingObserver;e&&e.next(void 0);a&&a.code?f.close(a.code,a.reason):b.error(new TypeError(\"WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }\"));\n    c._resetState()},function(){var a=c.closingObserver;a&&a.next(void 0);f.close();c._resetState()});a&&a instanceof K&&h.add(a.subscribe(c.destination))};f.onerror=function(a){c._resetState();b.error(a)};f.onclose=function(a){c._resetState();var e=c.closeObserver;e&&e.next(a);a.wasClean?b.complete():b.error(a)};f.onmessage=function(a){a=r(c.resultSelector)(a);a===m?b.error(m.e):b.next(a)}};a.prototype._subscribe=function(c){var a=this,b=this.source;if(b)return b.subscribe(c);this.socket||this._connectSocket();\n    b=new u;b.add(this._output.subscribe(c));b.add(function(){var c=a.socket;0===a._output.observers.length&&(c&&1===c.readyState&&c.close(),a._resetState())});return b};a.prototype.unsubscribe=function(){var c=this.source,a=this.socket;a&&1===a.readyState&&(a.close(),this._resetState());b.prototype.unsubscribe.call(this);c||(this.destination=new K)};return a}(Z).create;g.webSocket=Kc;var Mc=function(){function b(a){this.closingNotifier=a}b.prototype.call=function(a,c){return c.subscribe(new Lc(a,this.closingNotifier))};\n    return b}(),Lc=function(b){function a(c,a){b.call(this,c);this.buffer=[];this.add(p(this,a))}k(a,b);a.prototype._next=function(c){this.buffer.push(c)};a.prototype.notifyNext=function(c,a,b,f,h){c=this.buffer;this.buffer=[];this.destination.next(c)};return a}(q);g.prototype.buffer=function(b){return this.lift(new Mc(b))};var Pc=function(){function b(a,c){this.bufferSize=a;this.subscriberClass=(this.startBufferEvery=c)&&a!==c?Nc:Oc}b.prototype.call=function(a,c){return c.subscribe(new this.subscriberClass(a,\n    this.bufferSize,this.startBufferEvery))};return b}(),Oc=function(b){function a(c,a){b.call(this,c);this.bufferSize=a;this.buffer=[]}k(a,b);a.prototype._next=function(c){var a=this.buffer;a.push(c);a.length==this.bufferSize&&(this.destination.next(a),this.buffer=[])};a.prototype._complete=function(){var c=this.buffer;0<c.length&&this.destination.next(c);b.prototype._complete.call(this)};return a}(l),Nc=function(b){function a(c,a,d){b.call(this,c);this.bufferSize=a;this.startBufferEvery=d;this.buffers=\n    [];this.count=0}k(a,b);a.prototype._next=function(c){var a=this.bufferSize,b=this.startBufferEvery,f=this.buffers,h=this.count;this.count++;0===h%b&&f.push([]);for(b=f.length;b--;)h=f[b],h.push(c),h.length===a&&(f.splice(b,1),this.destination.next(h))};a.prototype._complete=function(){for(var c=this.buffers,a=this.destination;0<c.length;){var d=c.shift();0<d.length&&a.next(d)}b.prototype._complete.call(this)};return a}(l);g.prototype.bufferCount=function(b,a){void 0===a&&(a=null);return this.lift(new Pc(b,\n    a))};var Rc=function(){function b(a,c,b,d){this.bufferTimeSpan=a;this.bufferCreationInterval=c;this.maxBufferSize=b;this.scheduler=d}b.prototype.call=function(a,c){return c.subscribe(new Qc(a,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))};return b}(),Sc=function(){return function(){this.buffer=[]}}(),Qc=function(b){function a(c,a,d,f,h){b.call(this,c);this.bufferTimeSpan=a;this.bufferCreationInterval=d;this.maxBufferSize=f;this.scheduler=h;this.contexts=[];c=\n    this.openContext();(this.timespanOnly=null==d||0>d)?this.add(c.closeAction=h.schedule(ya,a,{subscriber:this,context:c,bufferTimeSpan:a})):(f={bufferTimeSpan:a,bufferCreationInterval:d,subscriber:this,scheduler:h},this.add(c.closeAction=h.schedule(za,a,{subscriber:this,context:c})),this.add(h.schedule(Eb,d,f)))}k(a,b);a.prototype._next=function(a){for(var c=this.contexts,b=c.length,f,h=0;h<b;h++){var g=c[h],k=g.buffer;k.push(a);k.length==this.maxBufferSize&&(f=g)}if(f)this.onBufferFull(f)};a.prototype._error=\n    function(a){this.contexts.length=0;b.prototype._error.call(this,a)};a.prototype._complete=function(){for(var a=this.contexts,e=this.destination;0<a.length;){var d=a.shift();e.next(d.buffer)}b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.contexts=null};a.prototype.onBufferFull=function(a){this.closeContext(a);a=a.closeAction;a.unsubscribe();this.remove(a);if(!this.closed&&this.timespanOnly){a=this.openContext();var c=this.bufferTimeSpan;this.add(a.closeAction=this.scheduler.schedule(ya,\n    c,{subscriber:this,context:a,bufferTimeSpan:c}))}};a.prototype.openContext=function(){var a=new Sc;this.contexts.push(a);return a};a.prototype.closeContext=function(a){this.destination.next(a.buffer);var c=this.contexts;0<=(c?c.indexOf(a):-1)&&c.splice(c.indexOf(a),1)};return a}(l);g.prototype.bufferTime=function(b){var a=arguments.length,c=x;z(arguments[arguments.length-1])&&(c=arguments[arguments.length-1],a--);var e=null;2<=a&&(e=arguments[1]);var d=Number.POSITIVE_INFINITY;3<=a&&(d=arguments[2]);\n    return this.lift(new Rc(b,e,d,c))};var Uc=function(){function b(a,c){this.openings=a;this.closingSelector=c}b.prototype.call=function(a,c){return c.subscribe(new Tc(a,this.openings,this.closingSelector))};return b}(),Tc=function(b){function a(a,e,d){b.call(this,a);this.openings=e;this.closingSelector=d;this.contexts=[];this.add(p(this,e))}k(a,b);a.prototype._next=function(a){for(var c=this.contexts,b=c.length,f=0;f<b;f++)c[f].buffer.push(a)};a.prototype._error=function(a){for(var c=this.contexts;0<\n    c.length;){var d=c.shift();d.subscription.unsubscribe();d.buffer=null;d.subscription=null}this.contexts=null;b.prototype._error.call(this,a)};a.prototype._complete=function(){for(var a=this.contexts;0<a.length;){var e=a.shift();this.destination.next(e.buffer);e.subscription.unsubscribe();e.buffer=null;e.subscription=null}this.contexts=null;b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){a?this.closeBuffer(a):this.openBuffer(b)};a.prototype.notifyComplete=function(a){this.closeBuffer(a.context)};\n    a.prototype.openBuffer=function(a){try{var c=this.closingSelector.call(this,a);c&&this.trySubscribe(c)}catch(d){this._error(d)}};a.prototype.closeBuffer=function(a){var c=this.contexts;if(c&&a){var b=a.subscription;this.destination.next(a.buffer);c.splice(c.indexOf(a),1);this.remove(b);b.unsubscribe()}};a.prototype.trySubscribe=function(a){var c=this.contexts,b=new u,f={buffer:[],subscription:b};c.push(f);a=p(this,a,f);!a||a.closed?this.closeBuffer(f):(a.context=f,this.add(a),b.add(a))};return a}(q);\n    g.prototype.bufferToggle=function(b,a){return this.lift(new Uc(b,a))};var Wc=function(){function b(a){this.closingSelector=a}b.prototype.call=function(a,c){return c.subscribe(new Vc(a,this.closingSelector))};return b}(),Vc=function(b){function a(a,e){b.call(this,a);this.closingSelector=e;this.subscribing=!1;this.openBuffer()}k(a,b);a.prototype._next=function(a){this.buffer.push(a)};a.prototype._complete=function(){var a=this.buffer;a&&this.destination.next(a);b.prototype._complete.call(this)};a.prototype._unsubscribe=\n    function(){this.buffer=null;this.subscribing=!1};a.prototype.notifyNext=function(a,b,d,f,h){this.openBuffer()};a.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()};a.prototype.openBuffer=function(){var a=this.closingSubscription;a&&(this.remove(a),a.unsubscribe());(a=this.buffer)&&this.destination.next(a);this.buffer=[];var b=r(this.closingSelector)();b===m?this.error(m.e):(this.closingSubscription=a=new u,this.add(a),this.subscribing=!0,a.add(p(this,b)),this.subscribing=\n    !1)};return a}(q);g.prototype.bufferWhen=function(b){return this.lift(new Wc(b))};var Fb=function(){function b(a){this.selector=a}b.prototype.call=function(a,c){return c.subscribe(new Xc(a,this.selector,this.caught))};return b}(),Xc=function(b){function a(a,e,d){b.call(this,a);this.selector=e;this.caught=d}k(a,b);a.prototype.error=function(a){if(!this.isStopped){var c=void 0;try{c=this.selector(a,this.caught)}catch(d){b.prototype.error.call(this,d);return}this._unsubscribeAndRecycle();this.add(p(this,\n    c))}};return a}(q);g.prototype.catch=Aa;g.prototype._catch=Aa;g.prototype.combineAll=function(b){return this.lift(new ha(b))};g.prototype.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=null;\"function\"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&D(b[0])&&(b=b[0].slice());b.unshift(this);return this.lift.call(new E(b),new ha(a))};g.prototype.concat=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return this.lift.call(P.apply(void 0,\n    [this].concat(b)))};g.prototype.concatAll=function(){return this.lift(new W(1))};var Ca=function(){function b(a,c,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.resultSelector=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new Yc(a,this.project,this.resultSelector,this.concurrent))};return b}(),Yc=function(b){function a(a,e,d,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b.call(this,a);this.project=e;this.resultSelector=d;this.concurrent=f;this.hasCompleted=!1;\n    this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(a){this.active<this.concurrent?this._tryNext(a):this.buffer.push(a)};a.prototype._tryNext=function(a){var c,b=this.index++;try{c=this.project(a,b)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(c,a,b)};a.prototype._innerSub=function(a,b,d){this.add(p(this,a,b,d))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=\n    function(a,b,d,f,h){this.resultSelector?this._notifyResultSelector(a,b,d,f):this.destination.next(b)};a.prototype._notifyResultSelector=function(a,b,d,f){var c;try{c=this.resultSelector(a,b,d,f)}catch(y){this.destination.error(y);return}this.destination.next(c)};a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.concatMap=function(b,a){return this.lift(new Ca(b,\n    a,1))};var Ea=function(){function b(a,c,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.ish=a;this.resultSelector=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new Zc(a,this.ish,this.resultSelector,this.concurrent))};return b}(),Zc=function(b){function a(a,e,d,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b.call(this,a);this.ish=e;this.resultSelector=d;this.concurrent=f;this.hasCompleted=!1;this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(a){if(this.active<\n    this.concurrent){var c=this.resultSelector,b=this.index++,f=this.ish,h=this.destination;this.active++;this._innerSub(f,h,c,a,b)}else this.buffer.push(a)};a.prototype._innerSub=function(a,b,d,f,h){this.add(p(this,a,f,h))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?this.trySelectResult(a,b,d,f):h.next(b)};a.prototype.trySelectResult=function(a,\n    b,d,f){var c=this.resultSelector,e=this.destination,g;try{g=c(a,b,d,f)}catch(B){e.error(B);return}e.next(g)};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.concatMapTo=function(b,a){return this.lift(new Ea(b,a,1))};var ad=function(){function b(a,c){this.predicate=a;this.source=\n    c}b.prototype.call=function(a,c){return c.subscribe(new $c(a,this.predicate,this.source))};return b}(),$c=function(b){function a(a,e,d){b.call(this,a);this.predicate=e;this.source=d;this.index=this.count=0}k(a,b);a.prototype._next=function(a){this.predicate?this._tryPredicate(a):this.count++};a.prototype._tryPredicate=function(a){var c;try{c=this.predicate(a,this.index++,this.source)}catch(d){this.destination.error(d);return}c&&this.count++};a.prototype._complete=function(){this.destination.next(this.count);\n    this.destination.complete()};return a}(l);g.prototype.count=function(b){return this.lift(new ad(b,this))};var cd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new bd(a))};return b}(),bd=function(b){function a(a){b.call(this,a)}k(a,b);a.prototype._next=function(a){a.observe(this.destination)};return a}(l);g.prototype.dematerialize=function(){return this.lift(new cd)};var ed=function(){function b(a){this.durationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new dd(a,\n    this.durationSelector))};return b}(),dd=function(b){function a(a,e){b.call(this,a);this.durationSelector=e;this.hasValue=!1;this.durationSubscription=null}k(a,b);a.prototype._next=function(a){try{var c=this.durationSelector.call(this,a);c&&this._tryNext(a,c)}catch(d){this.destination.error(d)}};a.prototype._complete=function(){this.emitValue();this.destination.complete()};a.prototype._tryNext=function(a,b){var c=this.durationSubscription;this.value=a;this.hasValue=!0;c&&(c.unsubscribe(),this.remove(c));\n    c=p(this,b);c.closed||this.add(this.durationSubscription=c)};a.prototype.notifyNext=function(a,b,d,f,h){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){if(this.hasValue){var a=this.value,e=this.durationSubscription;e&&(this.durationSubscription=null,e.unsubscribe(),this.remove(e));this.value=null;this.hasValue=!1;b.prototype._next.call(this,a)}};return a}(q);g.prototype.debounce=function(b){return this.lift(new ed(b))};var gd=function(){function b(a,\n    c){this.dueTime=a;this.scheduler=c}b.prototype.call=function(a,c){return c.subscribe(new fd(a,this.dueTime,this.scheduler))};return b}(),fd=function(b){function a(a,e,d){b.call(this,a);this.dueTime=e;this.scheduler=d;this.lastValue=this.debouncedSubscription=null;this.hasValue=!1}k(a,b);a.prototype._next=function(a){this.clearDebounce();this.lastValue=a;this.hasValue=!0;this.add(this.debouncedSubscription=this.scheduler.schedule(Gb,this.dueTime,this))};a.prototype._complete=function(){this.debouncedNext();\n    this.destination.complete()};a.prototype.debouncedNext=function(){this.clearDebounce();this.hasValue&&(this.destination.next(this.lastValue),this.lastValue=null,this.hasValue=!1)};a.prototype.clearDebounce=function(){var a=this.debouncedSubscription;null!==a&&(this.remove(a),a.unsubscribe(),this.debouncedSubscription=null)};return a}(l);g.prototype.debounceTime=function(b,a){void 0===a&&(a=x);return this.lift(new gd(b,a))};var id=function(){function b(a){this.defaultValue=a}b.prototype.call=function(a,\n    c){return c.subscribe(new hd(a,this.defaultValue))};return b}(),hd=function(b){function a(a,e){b.call(this,a);this.defaultValue=e;this.isEmpty=!0}k(a,b);a.prototype._next=function(a){this.isEmpty=!1;this.destination.next(a)};a.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue);this.destination.complete()};return a}(l);g.prototype.defaultIfEmpty=function(b){void 0===b&&(b=null);return this.lift(new id(b))};var kd=function(){function b(a,c){this.delay=a;this.scheduler=\n    c}b.prototype.call=function(a,c){return c.subscribe(new jd(a,this.delay,this.scheduler))};return b}(),jd=function(b){function a(a,e,d){b.call(this,a);this.delay=e;this.scheduler=d;this.queue=[];this.errored=this.active=!1}k(a,b);a.dispatch=function(a){for(var c=a.source,b=c.queue,f=a.scheduler,h=a.destination;0<b.length&&0>=b[0].time-f.now();)b.shift().notification.observe(h);0<b.length?(c=Math.max(0,b[0].time-f.now()),this.schedule(a,c)):c.active=!1};a.prototype._schedule=function(c){this.active=\n    !0;this.add(c.schedule(a.dispatch,this.delay,{source:this,destination:this.destination,scheduler:c}))};a.prototype.scheduleNotification=function(a){if(!0!==this.errored){var c=this.scheduler;a=new ld(c.now()+this.delay,a);this.queue.push(a);!1===this.active&&this._schedule(c)}};a.prototype._next=function(a){this.scheduleNotification(w.createNext(a))};a.prototype._error=function(a){this.errored=!0;this.queue=[];this.destination.error(a)};a.prototype._complete=function(){this.scheduleNotification(w.createComplete())};\n    return a}(l),ld=function(){return function(b,a){this.time=b;this.notification=a}}();g.prototype.delay=function(b,a){void 0===a&&(a=x);b=X(b)?+b-a.now():Math.abs(b);return this.lift(new kd(b,a))};var Za=function(){function b(a){this.delayDurationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new md(a,this.delayDurationSelector))};return b}(),md=function(b){function a(a,e){b.call(this,a);this.delayDurationSelector=e;this.completed=!1;this.delayNotifierSubscriptions=[];this.values=[]}k(a,\n    b);a.prototype.notifyNext=function(a,b,d,f,h){this.destination.next(a);this.removeSubscription(h);this.tryComplete()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=function(a){(a=this.removeSubscription(a))&&this.destination.next(a);this.tryComplete()};a.prototype._next=function(a){try{var c=this.delayDurationSelector(a);c&&this.tryDelay(c,a)}catch(d){this.destination.error(d)}};a.prototype._complete=function(){this.completed=!0;this.tryComplete()};a.prototype.removeSubscription=\n    function(a){a.unsubscribe();a=this.delayNotifierSubscriptions.indexOf(a);var c=null;-1!==a&&(c=this.values[a],this.delayNotifierSubscriptions.splice(a,1),this.values.splice(a,1));return c};a.prototype.tryDelay=function(a,b){(a=p(this,a,b))&&!a.closed&&(this.add(a),this.delayNotifierSubscriptions.push(a));this.values.push(b)};a.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()};return a}(q),od=function(b){function a(a,e){b.call(this);\n    this.source=a;this.subscriptionDelay=e}k(a,b);a.prototype._subscribe=function(a){this.subscriptionDelay.subscribe(new nd(a,this.source))};return a}(g),nd=function(b){function a(a,e){b.call(this);this.parent=a;this.source=e;this.sourceSubscribed=!1}k(a,b);a.prototype._next=function(a){this.subscribeToSource()};a.prototype._error=function(a){this.unsubscribe();this.parent.error(a)};a.prototype._complete=function(){this.subscribeToSource()};a.prototype.subscribeToSource=function(){this.sourceSubscribed||\n    (this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))};return a}(l);g.prototype.delayWhen=function(b,a){return a?(new od(this,a)).lift(new Za(b)):this.lift(new Za(b))};var pd=n.Set||Hb(),rd=function(){function b(a,c){this.keySelector=a;this.flushes=c}b.prototype.call=function(a,c){return c.subscribe(new qd(a,this.keySelector,this.flushes))};return b}(),qd=function(b){function a(a,e,d){b.call(this,a);this.keySelector=e;this.values=new pd;d&&this.add(p(this,d))}k(a,b);a.prototype.notifyNext=\n    function(a,b,d,f,h){this.values.clear()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype._next=function(a){this.keySelector?this._useKeySelector(a):this._finalizeNext(a,a)};a.prototype._useKeySelector=function(a){var c,b=this.destination;try{c=this.keySelector(a)}catch(f){b.error(f);return}this._finalizeNext(c,a)};a.prototype._finalizeNext=function(a,b){var c=this.values;c.has(a)||(c.add(a),this.destination.next(b))};return a}(q);g.prototype.distinct=function(b,a){return this.lift(new rd(b,\n    a))};var Ib=function(){function b(a,c){this.compare=a;this.keySelector=c}b.prototype.call=function(a,c){return c.subscribe(new sd(a,this.compare,this.keySelector))};return b}(),sd=function(b){function a(a,e,d){b.call(this,a);this.keySelector=d;this.hasKey=!1;\"function\"===typeof e&&(this.compare=e)}k(a,b);a.prototype.compare=function(a,b){return a===b};a.prototype._next=function(a){var c=a;if(this.keySelector&&(c=r(this.keySelector)(a),c===m))return this.destination.error(m.e);var b=!1;if(this.hasKey){if(b=\n    r(this.compare)(this.key,c),b===m)return this.destination.error(m.e)}else this.hasKey=!0;!1===!!b&&(this.key=c,this.destination.next(a))};return a}(l);g.prototype.distinctUntilChanged=Fa;g.prototype.distinctUntilKeyChanged=function(b,a){return Fa.call(this,function(c,e){return a?a(c[b],e[b]):c[b]===e[b]})};var Jb=function(){function b(a,c,b){this.nextOrObserver=a;this.error=c;this.complete=b}b.prototype.call=function(a,c){return c.subscribe(new td(a,this.nextOrObserver,this.error,this.complete))};\n    return b}(),td=function(b){function a(a,e,d,f){b.call(this,a);a=new l(e,d,f);a.syncErrorThrowable=!0;this.add(a);this.safeSubscriber=a}k(a,b);a.prototype._next=function(a){var c=this.safeSubscriber;c.next(a);c.syncErrorThrown?this.destination.error(c.syncErrorValue):this.destination.next(a)};a.prototype._error=function(a){var c=this.safeSubscriber;c.error(a);c.syncErrorThrown?this.destination.error(c.syncErrorValue):this.destination.error(a)};a.prototype._complete=function(){var a=this.safeSubscriber;\n    a.complete();a.syncErrorThrown?this.destination.error(a.syncErrorValue):this.destination.complete()};return a}(l);g.prototype.do=Ga;g.prototype._do=Ga;var vd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new ud(a))};return b}(),ud=function(b){function a(a){b.call(this,a);this.hasSubscription=this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){this.hasSubscription||(this.hasSubscription=!0,this.add(p(this,a)))};a.prototype._complete=function(){this.hasCompleted=!0;\n    this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(a){this.remove(a);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.exhaust=function(){return this.lift(new vd)};var xd=function(){function b(a,c){this.project=a;this.resultSelector=c}b.prototype.call=function(a,c){return c.subscribe(new wd(a,this.project,this.resultSelector))};return b}(),wd=function(b){function a(a,e,d){b.call(this,a);this.project=e;this.resultSelector=\n    d;this.hasCompleted=this.hasSubscription=!1;this.index=0}k(a,b);a.prototype._next=function(a){this.hasSubscription||this.tryNext(a)};a.prototype.tryNext=function(a){var c=this.index++,b=this.destination;try{var f=this.project(a,c);this.hasSubscription=!0;this.add(p(this,f,a,c))}catch(h){b.error(h)}};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?this.trySelectResult(a,\n    b,d,f):h.next(b)};a.prototype.trySelectResult=function(a,b,d,f){var c=this.resultSelector,e=this.destination;try{var g=c(a,b,d,f);e.next(g)}catch(B){e.error(B)}};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(a){this.remove(a);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.exhaustMap=function(b,a){return this.lift(new xd(b,a))};var zd=function(){function b(a,c,b){this.project=a;this.concurrent=c;\n    this.scheduler=b}b.prototype.call=function(a,c){return c.subscribe(new yd(a,this.project,this.concurrent,this.scheduler))};return b}(),yd=function(b){function a(a,e,d,f){b.call(this,a);this.project=e;this.concurrent=d;this.scheduler=f;this.active=this.index=0;this.hasCompleted=!1;d<Number.POSITIVE_INFINITY&&(this.buffer=[])}k(a,b);a.dispatch=function(a){a.subscriber.subscribeToProjection(a.result,a.value,a.index)};a.prototype._next=function(c){var b=this.destination;if(b.closed)this._complete();else{var d=\n    this.index++;if(this.active<this.concurrent){b.next(c);var f=r(this.project)(c,d);f===m?b.error(m.e):this.scheduler?this.add(this.scheduler.schedule(a.dispatch,0,{subscriber:this,result:f,value:c,index:d})):this.subscribeToProjection(f,c,d)}else this.buffer.push(c)}};a.prototype.subscribeToProjection=function(a,b,d){this.active++;this.add(p(this,a,b,d))};a.prototype._complete=function(){(this.hasCompleted=!0,0===this.active)&&this.destination.complete()};a.prototype.notifyNext=function(a,b,d,f,h){this._next(b)};\n    a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;c&&0<c.length&&this._next(c.shift());this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(q);g.prototype.expand=function(b,a,c){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===c&&(c=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return this.lift(new zd(b,a,c))};var M=function(b){function a(){var a=b.call(this,\"argument out of range\");this.name=a.name=\"ArgumentOutOfRangeError\";this.stack=a.stack;\n    this.message=a.message}k(a,b);return a}(Error),Bd=function(){function b(a,c){this.index=a;this.defaultValue=c;if(0>a)throw new M;}b.prototype.call=function(a,c){return c.subscribe(new Ad(a,this.index,this.defaultValue))};return b}(),Ad=function(b){function a(a,e,d){b.call(this,a);this.index=e;this.defaultValue=d}k(a,b);a.prototype._next=function(a){0===this.index--&&(this.destination.next(a),this.destination.complete())};a.prototype._complete=function(){var a=this.destination;0<=this.index&&(\"undefined\"!==\n    typeof this.defaultValue?a.next(this.defaultValue):a.error(new M));a.complete()};return a}(l);g.prototype.elementAt=function(b,a){return this.lift(new Bd(b,a))};var Kb=function(){function b(a,c){this.predicate=a;this.thisArg=c}b.prototype.call=function(a,c){return c.subscribe(new Cd(a,this.predicate,this.thisArg))};return b}(),Cd=function(b){function a(a,e,d){b.call(this,a);this.predicate=e;this.thisArg=d;this.count=0;this.predicate=e}k(a,b);a.prototype._next=function(a){var c;try{c=this.predicate.call(this.thisArg,\n    a,this.count++)}catch(d){this.destination.error(d);return}c&&this.destination.next(a)};return a}(l);g.prototype.filter=ea;var Lb=function(){function b(a){this.callback=a}b.prototype.call=function(a,c){return c.subscribe(new Dd(a,this.callback))};return b}(),Dd=function(b){function a(a,e){b.call(this,a);this.add(new u(e))}k(a,b);return a}(l);g.prototype.finally=Ha;g.prototype._finally=Ha;var $a=function(){function b(a,c,b,d){this.predicate=a;this.source=c;this.yieldIndex=b;this.thisArg=d}b.prototype.call=\n    function(a,c){return c.subscribe(new Ed(a,this.predicate,this.source,this.yieldIndex,this.thisArg))};return b}(),Ed=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.source=d;this.yieldIndex=f;this.thisArg=h;this.index=0}k(a,b);a.prototype.notifyComplete=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype._next=function(a){var c=this.predicate,b=this.thisArg,f=this.index++;try{c.call(b||this,a,f,this.source)&&this.notifyComplete(this.yieldIndex?f:a)}catch(h){this.destination.error(h)}};\n    a.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)};return a}(l);g.prototype.find=function(b,a){if(\"function\"!==typeof b)throw new TypeError(\"predicate is not a function\");return this.lift(new $a(b,this,!1,a))};g.prototype.findIndex=function(b,a){return this.lift(new $a(b,this,!0,a))};var ba=function(b){function a(){var a=b.call(this,\"no elements in sequence\");this.name=a.name=\"EmptyError\";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),Gd=function(){function b(a,\n    c,b,d){this.predicate=a;this.resultSelector=c;this.defaultValue=b;this.source=d}b.prototype.call=function(a,c){return c.subscribe(new Fd(a,this.predicate,this.resultSelector,this.defaultValue,this.source))};return b}(),Fd=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.resultSelector=d;this.defaultValue=f;this.source=h;this.index=0;this._emitted=this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){var c=this.index++;this.predicate?this._tryPredicate(a,c):this._emit(a,c)};\n    a.prototype._tryPredicate=function(a,b){var c;try{c=this.predicate(a,b,this.source)}catch(f){this.destination.error(f);return}c&&this._emit(a,b)};a.prototype._emit=function(a,b){this.resultSelector?this._tryResultSelector(a,b):this._emitFinal(a)};a.prototype._tryResultSelector=function(a,b){var c;try{c=this.resultSelector(a,b)}catch(f){this.destination.error(f);return}this._emitFinal(c)};a.prototype._emitFinal=function(a){var c=this.destination;this._emitted||(this._emitted=!0,c.next(a),c.complete(),\n    this.hasCompleted=!0)};a.prototype._complete=function(){var a=this.destination;this.hasCompleted||\"undefined\"===typeof this.defaultValue?this.hasCompleted||a.error(new ba):(a.next(this.defaultValue),a.complete())};return a}(l);g.prototype.first=function(b,a,c){return this.lift(new Gd(b,a,c,this))};var Hd=function(){function b(){this.size=0;this._values=[];this._keys=[]}b.prototype.get=function(a){a=this._keys.indexOf(a);return-1===a?void 0:this._values[a]};b.prototype.set=function(a,c){var b=this._keys.indexOf(a);\n    -1===b?(this._keys.push(a),this._values.push(c),this.size++):this._values[b]=c;return this};b.prototype.delete=function(a){a=this._keys.indexOf(a);if(-1===a)return!1;this._values.splice(a,1);this._keys.splice(a,1);this.size--;return!0};b.prototype.clear=function(){this._keys.length=0;this.size=this._values.length=0};b.prototype.forEach=function(a,c){for(var b=0;b<this.size;b++)a.call(c,this._values[b],this._keys[b])};return b}(),Id=n.Map||Hd,Jd=function(){function b(){this.values={}}b.prototype.delete=\n    function(a){this.values[a]=null;return!0};b.prototype.set=function(a,c){this.values[a]=c;return this};b.prototype.get=function(a){return this.values[a]};b.prototype.forEach=function(a,c){var b=this.values,d;for(d in b)b.hasOwnProperty(d)&&null!==b[d]&&a.call(c,b[d],d)};b.prototype.clear=function(){this.values={}};return b}(),Ld=function(){function b(a,c,b,d){this.keySelector=a;this.elementSelector=c;this.durationSelector=b;this.subjectSelector=d}b.prototype.call=function(a,c){return c.subscribe(new Kd(a,\n    this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return b}(),Kd=function(b){function a(a,e,d,f,h){b.call(this,a);this.keySelector=e;this.elementSelector=d;this.durationSelector=f;this.subjectSelector=h;this.groups=null;this.attemptedToUnsubscribe=!1;this.count=0}k(a,b);a.prototype._next=function(a){var c;try{c=this.keySelector(a)}catch(d){this.error(d);return}this._group(a,c)};a.prototype._group=function(a,b){var c=this.groups;c||(c=this.groups=\"string\"===typeof b?\n    new Jd:new Id);var e=c.get(b),h;if(this.elementSelector)try{h=this.elementSelector(a)}catch(y){this.error(y)}else h=a;if(!e&&(e=this.subjectSelector?this.subjectSelector():new v,c.set(b,e),a=new ab(b,e,this),this.destination.next(a),this.durationSelector)){a=void 0;try{a=this.durationSelector(new ab(b,e))}catch(y){this.error(y);return}this.add(a.subscribe(new Md(b,e,this)))}e.closed||e.next(h)};a.prototype._error=function(a){var c=this.groups;c&&(c.forEach(function(c,b){c.error(a)}),c.clear());this.destination.error(a)};\n    a.prototype._complete=function(){var a=this.groups;a&&(a.forEach(function(a,c){a.complete()}),a.clear());this.destination.complete()};a.prototype.removeGroup=function(a){this.groups.delete(a)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&b.prototype.unsubscribe.call(this))};return a}(l),Md=function(b){function a(a,e,d){b.call(this,e);this.key=a;this.group=e;this.parent=d}k(a,b);a.prototype._next=function(a){this.complete()};a.prototype._unsubscribe=\n    function(){var a=this.parent,b=this.key;this.key=this.parent=null;a&&a.removeGroup(b)};return a}(l),ab=function(b){function a(a,e,d){b.call(this);this.key=a;this.groupSubject=e;this.refCountSubscription=d}k(a,b);a.prototype._subscribe=function(a){var c=new u,b=this.refCountSubscription,f=this.groupSubject;b&&!b.closed&&c.add(new Nd(b));c.add(f.subscribe(a));return c};return a}(g),Nd=function(b){function a(a){b.call(this);this.parent=a;a.count++}k(a,b);a.prototype.unsubscribe=function(){var a=this.parent;\n    a.closed||this.closed||(b.prototype.unsubscribe.call(this),--a.count,0===a.count&&a.attemptedToUnsubscribe&&a.unsubscribe())};return a}(u);g.prototype.groupBy=function(b,a,c,e){return this.lift(new Ld(b,a,c,e))};var Pd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new Od(a))};return b}(),Od=function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype._next=function(a){};return a}(l);g.prototype.ignoreElements=function(){return this.lift(new Pd)};var Rd=function(){function b(){}\n    b.prototype.call=function(a,c){return c.subscribe(new Qd(a))};return b}(),Qd=function(b){function a(a){b.call(this,a)}k(a,b);a.prototype.notifyComplete=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype._next=function(a){this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l);g.prototype.isEmpty=function(){return this.lift(new Rd)};var Td=function(){function b(a){this.durationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new Sd(a,\n    this.durationSelector))};return b}(),Sd=function(b){function a(a,e){b.call(this,a);this.durationSelector=e;this.hasValue=!1}k(a,b);a.prototype._next=function(a){this.value=a;this.hasValue=!0;this.throttled||(a=r(this.durationSelector)(a),a===m?this.destination.error(m.e):(a=p(this,a),a.closed?this.clearThrottle():this.add(this.throttled=a)))};a.prototype.clearThrottle=function(){var a=this.value,b=this.hasValue,d=this.throttled;d&&(this.remove(d),this.throttled=null,d.unsubscribe());b&&(this.value=\n    null,this.hasValue=!1,this.destination.next(a))};a.prototype.notifyNext=function(a,b,d,f){this.clearThrottle()};a.prototype.notifyComplete=function(){this.clearThrottle()};return a}(q);g.prototype.audit=function(b){return this.lift(new Td(b))};var Vd=function(){function b(a,c){this.duration=a;this.scheduler=c}b.prototype.call=function(a,c){return c.subscribe(new Ud(a,this.duration,this.scheduler))};return b}(),Ud=function(b){function a(a,e,d){b.call(this,a);this.duration=e;this.scheduler=d;this.hasValue=\n    !1}k(a,b);a.prototype._next=function(a){this.value=a;this.hasValue=!0;this.throttled||this.add(this.throttled=this.scheduler.schedule(Mb,this.duration,this))};a.prototype.clearThrottle=function(){var a=this.value,b=this.hasValue,d=this.throttled;d&&(this.remove(d),this.throttled=null,d.unsubscribe());b&&(this.value=null,this.hasValue=!1,this.destination.next(a))};return a}(l);g.prototype.auditTime=function(b,a){void 0===a&&(a=x);return this.lift(new Vd(b,a))};var Xd=function(){function b(a,c,b,d){this.predicate=\n    a;this.resultSelector=c;this.defaultValue=b;this.source=d}b.prototype.call=function(a,c){return c.subscribe(new Wd(a,this.predicate,this.resultSelector,this.defaultValue,this.source))};return b}(),Wd=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.resultSelector=d;this.defaultValue=f;this.source=h;this.hasValue=!1;this.index=0;\"undefined\"!==typeof f&&(this.lastValue=f,this.hasValue=!0)}k(a,b);a.prototype._next=function(a){var c=this.index++;this.predicate?this._tryPredicate(a,\n    c):this.resultSelector?this._tryResultSelector(a,c):(this.lastValue=a,this.hasValue=!0)};a.prototype._tryPredicate=function(a,b){var c;try{c=this.predicate(a,b,this.source)}catch(f){this.destination.error(f);return}c&&(this.resultSelector?this._tryResultSelector(a,b):(this.lastValue=a,this.hasValue=!0))};a.prototype._tryResultSelector=function(a,b){var c;try{c=this.resultSelector(a,b)}catch(f){this.destination.error(f);return}this.lastValue=c;this.hasValue=!0};a.prototype._complete=function(){var a=\n    this.destination;this.hasValue?(a.next(this.lastValue),a.complete()):a.error(new ba)};return a}(l);g.prototype.last=function(b,a,c){return this.lift(new Xd(b,a,c,this))};g.prototype.let=Ia;g.prototype.letBind=Ia;var Zd=function(){function b(a,c,b){this.predicate=a;this.thisArg=c;this.source=b}b.prototype.call=function(a,c){return c.subscribe(new Yd(a,this.predicate,this.thisArg,this.source))};return b}(),Yd=function(b){function a(a,e,d,f){b.call(this,a);this.predicate=e;this.thisArg=d;this.source=\n    f;this.index=0;this.thisArg=d||this}k(a,b);a.prototype.notifyComplete=function(a){this.destination.next(a);this.destination.complete()};a.prototype._next=function(a){var c=!1;try{c=this.predicate.call(this.thisArg,a,this.index++,this.source)}catch(d){this.destination.error(d);return}c||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l);g.prototype.every=function(b,a){return this.lift(new Zd(b,a,this))};g.prototype.map=wa;var ae=function(){function b(a){this.value=\n    a}b.prototype.call=function(a,c){return c.subscribe(new $d(a,this.value))};return b}(),$d=function(b){function a(a,e){b.call(this,a);this.value=e}k(a,b);a.prototype._next=function(a){this.destination.next(this.value)};return a}(l);g.prototype.mapTo=function(b){return this.lift(new ae(b))};var ce=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new be(a))};return b}(),be=function(b){function a(a){b.call(this,a)}k(a,b);a.prototype._next=function(a){this.destination.next(w.createNext(a))};\n    a.prototype._error=function(a){var c=this.destination;c.next(w.createError(a));c.complete()};a.prototype._complete=function(){var a=this.destination;a.next(w.createComplete());a.complete()};return a}(l);g.prototype.materialize=function(){return this.lift(new ce)};var ja=function(){function b(a,c,b){void 0===b&&(b=!1);this.accumulator=a;this.seed=c;this.hasSeed=b}b.prototype.call=function(a,c){return c.subscribe(new de(a,this.accumulator,this.seed,this.hasSeed))};return b}(),de=function(b){function a(a,\n    e,d,f){b.call(this,a);this.accumulator=e;this.hasSeed=f;this.index=0;this.hasValue=!1;this.acc=d;this.hasSeed||this.index++}k(a,b);a.prototype._next=function(a){this.hasValue||(this.hasValue=this.hasSeed)?this._tryReduce(a):(this.acc=a,this.hasValue=!0)};a.prototype._tryReduce=function(a){var c;try{c=this.accumulator(this.acc,a,this.index++)}catch(d){this.destination.error(d);return}this.acc=c};a.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc);this.destination.complete()};\n    return a}(l);g.prototype.max=function(b){return this.lift(new ja(\"function\"===typeof b?function(a,c){return 0<b(a,c)?a:c}:function(a,c){return a>c?a:c}))};g.prototype.merge=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return this.lift.call(sa.apply(void 0,[this].concat(b)))};g.prototype.mergeAll=function(b){void 0===b&&(b=Number.POSITIVE_INFINITY);return this.lift(new W(b))};g.prototype.mergeMap=Ba;g.prototype.flatMap=Ba;g.prototype.flatMapTo=Da;g.prototype.mergeMapTo=Da;\n    var fe=function(){function b(a,c,b){this.accumulator=a;this.seed=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new ee(a,this.accumulator,this.seed,this.concurrent))};return b}(),ee=function(b){function a(a,e,d,f){b.call(this,a);this.accumulator=e;this.acc=d;this.concurrent=f;this.hasCompleted=this.hasValue=!1;this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(a){if(this.active<this.concurrent){var c=this.index++,b=r(this.accumulator)(this.acc,a),f=this.destination;\n    b===m?f.error(m.e):(this.active++,this._innerSub(b,a,c))}else this.buffer.push(a)};a.prototype._innerSub=function(a,b,d){this.add(p(this,a,b,d))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())};a.prototype.notifyNext=function(a,b,d,f,h){a=this.destination;this.acc=b;this.hasValue=!0;a.next(b)};a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;\n    0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())};return a}(q);g.prototype.mergeScan=function(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return this.lift(new fe(b,a,c))};g.prototype.min=function(b){return this.lift(new ja(\"function\"===typeof b?function(a,c){return 0>b(a,c)?a:c}:function(a,c){return a<c?a:c}))};var bb=function(b){function a(a,e){b.call(this);this.source=a;this.subjectFactory=\n    e;this._refCount=0;this._isComplete=!1}k(a,b);a.prototype._subscribe=function(a){return this.getSubject().subscribe(a)};a.prototype.getSubject=function(){var a=this._subject;if(!a||a.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var a=this._connection;a||(this._isComplete=!1,a=this._connection=new u,a.add(this.source.subscribe(new ge(this.getSubject(),this))),a.closed?(this._connection=null,a=u.EMPTY):this._connection=a);return a};a.prototype.refCount=\n    function(){return this.lift(new he(this))};return a}(g),U=bb.prototype,Ob={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:U._subscribe},_isComplete:{value:U._isComplete,writable:!0},getSubject:{value:U.getSubject},connect:{value:U.connect},refCount:{value:U.refCount}},ge=function(b){function a(a,e){b.call(this,a);this.connectable=e}k(a,b);a.prototype._error=function(a){this._unsubscribe();b.prototype._error.call(this,\n    a)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var a=this.connectable;if(a){this.connectable=null;var b=a._connection;a._refCount=0;a._subject=null;a._connection=null;b&&b.unsubscribe()}};return a}(Oa),he=function(){function b(a){this.connectable=a}b.prototype.call=function(a,c){var b=this.connectable;b._refCount++;a=new ie(a,b);c=c.subscribe(a);a.closed||(a.connection=b.connect());return c};\n    return b}(),ie=function(b){function a(a,e){b.call(this,a);this.connectable=e}k(a,b);a.prototype._unsubscribe=function(){var a=this.connectable;if(a){this.connectable=null;var b=a._refCount;0>=b?this.connection=null:(a._refCount=b-1,1<b?this.connection=null:(b=this.connection,a=a._connection,this.connection=null,!a||b&&a!==b||a.unsubscribe()))}else this.connection=null};return a}(l),Nb=function(){function b(a,c){this.subjectFactory=a;this.selector=c}b.prototype.call=function(a,c){var b=this.selector,\n    d=this.subjectFactory();a=b(d).subscribe(a);a.add(c.subscribe(d));return a};return b}();g.prototype.multicast=G;g.prototype.observeOn=function(b,a){void 0===a&&(a=0);return this.lift(new kc(b,a))};g.prototype.onErrorResumeNext=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);return this.lift(new Va(b))};var ke=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new je(a))};return b}(),je=function(b){function a(a){b.call(this,\n    a);this.hasPrev=!1}k(a,b);a.prototype._next=function(a){this.hasPrev?this.destination.next([this.prev,a]):this.hasPrev=!0;this.prev=a};return a}(l);g.prototype.pairwise=function(){return this.lift(new ke)};g.prototype.partition=function(b,a){return[ea.call(this,b,a),ea.call(this,Pb(b,a))]};g.prototype.pluck=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=b.length;if(0===a)throw Error(\"list of properties cannot be empty.\");return wa.call(this,Qb(b,a))};g.prototype.publish=\n    function(b){return b?G.call(this,function(){return new v},b):G.call(this,new v)};var cb=function(b){function a(a){b.call(this);this._value=a}k(a,b);Object.defineProperty(a.prototype,\"value\",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(a){var c=b.prototype._subscribe.call(this,a);c&&!c.closed&&a.next(this._value);return c};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new H;return this._value};\n    a.prototype.next=function(a){b.prototype.next.call(this,this._value=a)};return a}(v);g.prototype.publishBehavior=function(b){return G.call(this,new cb(b))};g.prototype.publishReplay=function(b,a,c){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);return G.call(this,new K(b,a,c))};g.prototype.publishLast=function(){return G.call(this,new L)};g.prototype.race=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);return this.lift.call(ta.apply(void 0,\n    [this].concat(b)))};g.prototype.reduce=function(b,a){var c=!1;2<=arguments.length&&(c=!0);return this.lift(new ja(b,a,c))};var db=function(){function b(a,c){this.count=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new le(a,this.count,this.source))};return b}(),le=function(b){function a(a,e,d){b.call(this,a);this.count=e;this.source=d}k(a,b);a.prototype.complete=function(){if(!this.isStopped){var a=this.source,e=this.count;if(0===e)return b.prototype.complete.call(this);-1<e&&(this.count=\n    e-1);a.subscribe(this._unsubscribeAndRecycle())}};return a}(l);g.prototype.repeat=function(b){void 0===b&&(b=-1);return 0===b?new F:0>b?this.lift(new db(-1,this)):this.lift(new db(b-1,this))};var ne=function(){function b(a){this.notifier=a}b.prototype.call=function(a,c){return c.subscribe(new me(a,this.notifier,c))};return b}(),me=function(b){function a(a,e,d){b.call(this,a);this.notifier=e;this.source=d;this.sourceIsBeingSubscribedTo=!0}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.sourceIsBeingSubscribedTo=\n    !0;this.source.subscribe(this)};a.prototype.notifyComplete=function(a){if(!1===this.sourceIsBeingSubscribedTo)return b.prototype.complete.call(this)};a.prototype.complete=function(){this.sourceIsBeingSubscribedTo=!1;if(!this.isStopped){if(!this.retries)this.subscribeToRetries();else if(this.retriesSubscription.closed)return b.prototype.complete.call(this);this._unsubscribeAndRecycle();this.notifications.next()}};a.prototype._unsubscribe=function(){var a=this.notifications,b=this.retriesSubscription;\n    a&&(a.unsubscribe(),this.notifications=null);b&&(b.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype._unsubscribeAndRecycle=function(){var a=this.notifications,e=this.retries,d=this.retriesSubscription;this.retriesSubscription=this.retries=this.notifications=null;b.prototype._unsubscribeAndRecycle.call(this);this.notifications=a;this.retries=e;this.retriesSubscription=d;return this};a.prototype.subscribeToRetries=function(){this.notifications=new v;var a=r(this.notifier)(this.notifications);\n    if(a===m)return b.prototype.complete.call(this);this.retries=a;this.retriesSubscription=p(this,a)};return a}(q);g.prototype.repeatWhen=function(b){return this.lift(new ne(b))};var pe=function(){function b(a,c){this.count=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new oe(a,this.count,this.source))};return b}(),oe=function(b){function a(a,e,d){b.call(this,a);this.count=e;this.source=d}k(a,b);a.prototype.error=function(a){if(!this.isStopped){var c=this.source,d=this.count;if(0===\n    d)return b.prototype.error.call(this,a);-1<d&&(this.count=d-1);c.subscribe(this._unsubscribeAndRecycle())}};return a}(l);g.prototype.retry=function(b){void 0===b&&(b=-1);return this.lift(new pe(b,this))};var re=function(){function b(a,c){this.notifier=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new qe(a,this.notifier,this.source))};return b}(),qe=function(b){function a(a,e,d){b.call(this,a);this.notifier=e;this.source=d}k(a,b);a.prototype.error=function(a){if(!this.isStopped){var c=\n    this.errors,d=this.retries,f=this.retriesSubscription;if(d)this.retriesSubscription=this.errors=null;else{c=new v;d=r(this.notifier)(c);if(d===m)return b.prototype.error.call(this,m.e);f=p(this,d)}this._unsubscribeAndRecycle();this.errors=c;this.retries=d;this.retriesSubscription=f;c.next(a)}};a.prototype._unsubscribe=function(){var a=this.errors,b=this.retriesSubscription;a&&(a.unsubscribe(),this.errors=null);b&&(b.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype.notifyNext=\n    function(a,b,d,f,h){a=this.errors;b=this.retries;d=this.retriesSubscription;this.retriesSubscription=this.retries=this.errors=null;this._unsubscribeAndRecycle();this.errors=a;this.retries=b;this.retriesSubscription=d;this.source.subscribe(this)};return a}(q);g.prototype.retryWhen=function(b){return this.lift(new re(b,this))};var te=function(){function b(a){this.notifier=a}b.prototype.call=function(a,c){a=new se(a);c=c.subscribe(a);c.add(p(a,this.notifier));return c};return b}(),se=function(b){function a(){b.apply(this,\n    arguments);this.hasValue=!1}k(a,b);a.prototype._next=function(a){this.value=a;this.hasValue=!0};a.prototype.notifyNext=function(a,b,d,f,h){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))};return a}(q);g.prototype.sample=function(b){return this.lift(new te(b))};var ve=function(){function b(a,c){this.period=a;this.scheduler=c}b.prototype.call=function(a,c){return c.subscribe(new ue(a,\n    this.period,this.scheduler))};return b}(),ue=function(b){function a(a,e,d){b.call(this,a);this.period=e;this.scheduler=d;this.hasValue=!1;this.add(d.schedule(Rb,e,{subscriber:this,period:e}))}k(a,b);a.prototype._next=function(a){this.lastValue=a;this.hasValue=!0};a.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return a}(l);g.prototype.sampleTime=function(b,a){void 0===a&&(a=x);return this.lift(new ve(b,a))};var xe=function(){function b(a,\n    c,b){void 0===b&&(b=!1);this.accumulator=a;this.seed=c;this.hasSeed=b}b.prototype.call=function(a,c){return c.subscribe(new we(a,this.accumulator,this.seed,this.hasSeed))};return b}(),we=function(b){function a(a,e,d,f){b.call(this,a);this.accumulator=e;this._seed=d;this.hasSeed=f;this.index=0}k(a,b);Object.defineProperty(a.prototype,\"seed\",{get:function(){return this._seed},set:function(a){this.hasSeed=!0;this._seed=a},enumerable:!0,configurable:!0});a.prototype._next=function(a){if(this.hasSeed)return this._tryNext(a);\n    this.seed=a;this.destination.next(a)};a.prototype._tryNext=function(a){var c=this.index++,b;try{b=this.accumulator(this.seed,a,c)}catch(f){this.destination.error(f)}this.seed=b;this.destination.next(b)};return a}(l);g.prototype.scan=function(b,a){var c=!1;2<=arguments.length&&(c=!0);return this.lift(new xe(b,a,c))};var ze=function(){function b(a,c){this.compareTo=a;this.comparor=c}b.prototype.call=function(a,c){return c.subscribe(new ye(a,this.compareTo,this.comparor))};return b}(),ye=function(b){function a(a,\n    e,d){b.call(this,a);this.compareTo=e;this.comparor=d;this._a=[];this._b=[];this._oneComplete=!1;this.add(e.subscribe(new Ae(a,this)))}k(a,b);a.prototype._next=function(a){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(a),this.checkValues())};a.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0};a.prototype.checkValues=function(){for(var a=this._a,b=this._b,d=this.comparor;0<a.length&&0<b.length;){var f=a.shift(),\n    h=b.shift();d?(f=r(d)(f,h),f===m&&this.destination.error(m.e)):f=f===h;f||this.emit(!1)}};a.prototype.emit=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype.nextB=function(a){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(a),this.checkValues())};return a}(l),Ae=function(b){function a(a,e){b.call(this,a);this.parent=e}k(a,b);a.prototype._next=function(a){this.parent.nextB(a)};a.prototype._error=function(a){this.parent.error(a)};a.prototype._complete=function(){this.parent._complete()};\n    return a}(l);g.prototype.sequenceEqual=function(b,a){return this.lift(new ze(b,a))};g.prototype.share=function(){return G.call(this,Sb).refCount()};g.prototype.shareReplay=function(b,a,c){var e;return G.call(this,function(){return this._isComplete?e:e=new K(b,a,c)}).refCount()};var Ce=function(){function b(a,c){this.predicate=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new Be(a,this.predicate,this.source))};return b}(),Be=function(b){function a(a,e,d){b.call(this,a);this.predicate=\n    e;this.source=d;this.seenValue=!1;this.index=0}k(a,b);a.prototype.applySingleValue=function(a){this.seenValue?this.destination.error(\"Sequence contains more than one element\"):(this.seenValue=!0,this.singleValue=a)};a.prototype._next=function(a){var c=this.index++;this.predicate?this.tryNext(a,c):this.applySingleValue(a)};a.prototype.tryNext=function(a,b){try{this.predicate(a,b,this.source)&&this.applySingleValue(a)}catch(d){this.destination.error(d)}};a.prototype._complete=function(){var a=this.destination;\n    0<this.index?(a.next(this.seenValue?this.singleValue:void 0),a.complete()):a.error(new ba)};return a}(l);g.prototype.single=function(b){return this.lift(new Ce(b,this))};var Ee=function(){function b(a){this.total=a}b.prototype.call=function(a,c){return c.subscribe(new De(a,this.total))};return b}(),De=function(b){function a(a,e){b.call(this,a);this.total=e;this.count=0}k(a,b);a.prototype._next=function(a){++this.count>this.total&&this.destination.next(a)};return a}(l);g.prototype.skip=function(b){return this.lift(new Ee(b))};\n    var Ge=function(){function b(a){this._skipCount=a;if(0>this._skipCount)throw new M;}b.prototype.call=function(a,c){return 0===this._skipCount?c.subscribe(new l(a)):c.subscribe(new Fe(a,this._skipCount))};return b}(),Fe=function(b){function a(a,e){b.call(this,a);this._skipCount=e;this._count=0;this._ring=Array(e)}k(a,b);a.prototype._next=function(a){var c=this._skipCount,b=this._count++;if(b<c)this._ring[b]=a;else{var c=b%c,b=this._ring,f=b[c];b[c]=a;this.destination.next(f)}};return a}(l);g.prototype.skipLast=\n    function(b){return this.lift(new Ge(b))};var Ie=function(){function b(a){this.notifier=a}b.prototype.call=function(a,c){return c.subscribe(new He(a,this.notifier))};return b}(),He=function(b){function a(a,e){b.call(this,a);this.isInnerStopped=this.hasValue=!1;this.add(p(this,e))}k(a,b);a.prototype._next=function(a){this.hasValue&&b.prototype._next.call(this,a)};a.prototype._complete=function(){this.isInnerStopped?b.prototype._complete.call(this):this.unsubscribe()};a.prototype.notifyNext=function(a,\n    b,d,f,h){this.hasValue=!0};a.prototype.notifyComplete=function(){this.isInnerStopped=!0;this.isStopped&&b.prototype._complete.call(this)};return a}(q);g.prototype.skipUntil=function(b){return this.lift(new Ie(b))};var Ke=function(){function b(a){this.predicate=a}b.prototype.call=function(a,b){return b.subscribe(new Je(a,this.predicate))};return b}(),Je=function(b){function a(a,e){b.call(this,a);this.predicate=e;this.skipping=!0;this.index=0}k(a,b);a.prototype._next=function(a){var b=this.destination;\n    this.skipping&&this.tryCallPredicate(a);this.skipping||b.next(a)};a.prototype.tryCallPredicate=function(a){try{this.skipping=!!this.predicate(a,this.index++)}catch(e){this.destination.error(e)}};return a}(l);g.prototype.skipWhile=function(b){return this.lift(new Ke(b))};g.prototype.startWith=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=b[b.length-1];z(a)?b.pop():a=null;var c=b.length;return 1===c?P(new ga(b[0],a),this):1<c?P(new E(b,a),this):P(new F(a),this)};var eb=new (function(){function b(a){this.root=\n    a;a.setImmediate&&\"function\"===typeof a.setImmediate?(this.setImmediate=a.setImmediate.bind(a),this.clearImmediate=a.clearImmediate.bind(a)):(this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.canUseProcessNextTick()?this.setImmediate=this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.setImmediate=this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.setImmediate=this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.setImmediate=\n    this.createReadyStateChangeSetImmediate():this.setImmediate=this.createSetTimeoutSetImmediate(),a=function e(a){delete e.instance.tasksByHandle[a]},a.instance=this,this.clearImmediate=a)}b.prototype.identify=function(a){return this.root.Object.prototype.toString.call(a)};b.prototype.canUseProcessNextTick=function(){return\"[object process]\"===this.identify(this.root.process)};b.prototype.canUseMessageChannel=function(){return!!this.root.MessageChannel};b.prototype.canUseReadyStateChange=function(){var a=\n    this.root.document;return!!(a&&\"onreadystatechange\"in a.createElement(\"script\"))};b.prototype.canUsePostMessage=function(){var a=this.root;if(a.postMessage&&!a.importScripts){var b=!0,e=a.onmessage;a.onmessage=function(){b=!1};a.postMessage(\"\",\"*\");a.onmessage=e;return b}return!1};b.prototype.partiallyApplied=function(a){for(var b=[],e=1;e<arguments.length;e++)b[e-1]=arguments[e];e=function f(){var a=f.handler,b=f.args;\"function\"===typeof a?a.apply(void 0,b):(new Function(\"\"+a))()};e.handler=a;e.args=\n    b;return e};b.prototype.addFromSetImmediateArguments=function(a){this.tasksByHandle[this.nextHandle]=this.partiallyApplied.apply(void 0,a);return this.nextHandle++};b.prototype.createProcessNextTickSetImmediate=function(){var a=function e(){var a=e.instance,b=a.addFromSetImmediateArguments(arguments);a.root.process.nextTick(a.partiallyApplied(a.runIfPresent,b));return b};a.instance=this;return a};b.prototype.createPostMessageSetImmediate=function(){var a=this.root,b=\"setImmediate$\"+a.Math.random()+\n    \"$\",e=function f(c){var e=f.instance;c.source===a&&\"string\"===typeof c.data&&0===c.data.indexOf(b)&&e.runIfPresent(+c.data.slice(b.length))};e.instance=this;a.addEventListener(\"message\",e,!1);e=function h(){var a=h,b=a.messagePrefix,a=a.instance,c=a.addFromSetImmediateArguments(arguments);a.root.postMessage(b+c,\"*\");return c};e.instance=this;e.messagePrefix=b;return e};b.prototype.runIfPresent=function(a){if(this.currentlyRunningATask)this.root.setTimeout(this.partiallyApplied(this.runIfPresent,a),\n    0);else{var b=this.tasksByHandle[a];if(b){this.currentlyRunningATask=!0;try{b()}finally{this.clearImmediate(a),this.currentlyRunningATask=!1}}}};b.prototype.createMessageChannelSetImmediate=function(){var a=this,b=new this.root.MessageChannel;b.port1.onmessage=function(b){a.runIfPresent(b.data)};var e=function f(){var a=f,b=a.channel,a=a.instance.addFromSetImmediateArguments(arguments);b.port2.postMessage(a);return a};e.channel=b;e.instance=this;return e};b.prototype.createReadyStateChangeSetImmediate=\n    function(){var a=function e(){var a=e.instance,b=a.root.document,h=b.documentElement,g=a.addFromSetImmediateArguments(arguments),k=b.createElement(\"script\");k.onreadystatechange=function(){a.runIfPresent(g);k.onreadystatechange=null;h.removeChild(k);k=null};h.appendChild(k);return g};a.instance=this;return a};b.prototype.createSetTimeoutSetImmediate=function(){var a=function e(){var a=e.instance,b=a.addFromSetImmediateArguments(arguments);a.root.setTimeout(a.partiallyApplied(a.runIfPresent,b),0);\n    return b};a.instance=this;return a};return b}())(n),Le=function(b){function a(a,e){b.call(this,a,e);this.scheduler=a;this.work=e}k(a,b);a.prototype.requestAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d)return b.prototype.requestAsyncId.call(this,a,e,d);a.actions.push(this);return a.scheduled||(a.scheduled=eb.setImmediate(a.flush.bind(a,null)))};a.prototype.recycleAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d||null===d&&0<this.delay)return b.prototype.recycleAsyncId.call(this,\n    a,e,d);0===a.actions.length&&(eb.clearImmediate(e),a.scheduled=void 0)};return a}(S),ca=new (function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.flush=function(a){this.active=!0;this.scheduled=void 0;var b=this.actions,c,f=-1,h=b.length;a=a||b.shift();do if(c=a.execute(a.state,a.delay))break;while(++f<h&&(a=b.shift()));this.active=!1;if(c){for(;++f<h&&(a=b.shift());)a.unsubscribe();throw c;}};return a}(T))(Le),Me=function(b){function a(a,e,d){void 0===e&&(e=0);void 0===d&&(d=ca);b.call(this);\n    this.source=a;this.delayTime=e;this.scheduler=d;if(!Q(e)||0>e)this.delayTime=0;d&&\"function\"===typeof d.schedule||(this.scheduler=ca)}k(a,b);a.create=function(b,e,d){void 0===e&&(e=0);void 0===d&&(d=ca);return new a(b,e,d)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};a.prototype._subscribe=function(b){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:b})};return a}(g),Ne=function(){function b(a,b){this.scheduler=a;this.delay=b}b.prototype.call=\n    function(a,b){return(new Me(b,this.delay,this.scheduler)).subscribe(a)};return b}();g.prototype.subscribeOn=function(b,a){void 0===a&&(a=0);return this.lift(new Ne(b,a))};var Tb=function(){function b(){}b.prototype.call=function(a,b){return b.subscribe(new Oe(a))};return b}(),Oe=function(b){function a(a){b.call(this,a);this.active=0;this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){this.unsubscribeInner();this.active++;this.add(this.innerSubscription=p(this,a))};a.prototype._complete=function(){this.hasCompleted=\n    !0;0===this.active&&this.destination.complete()};a.prototype.unsubscribeInner=function(){this.active=0<this.active?this.active-1:0;var a=this.innerSubscription;a&&(a.unsubscribe(),this.remove(a))};a.prototype.notifyNext=function(a,b,d,f,h){this.destination.next(b)};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(){this.unsubscribeInner();this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(q);g.prototype.switch=Ja;g.prototype._switch=\n    Ja;var Qe=function(){function b(a,b){this.project=a;this.resultSelector=b}b.prototype.call=function(a,b){return b.subscribe(new Pe(a,this.project,this.resultSelector))};return b}(),Pe=function(b){function a(a,e,d){b.call(this,a);this.project=e;this.resultSelector=d;this.index=0}k(a,b);a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(f){this.destination.error(f);return}this._innerSub(b,a,c)};a.prototype._innerSub=function(a,b,d){var c=this.innerSubscription;c&&c.unsubscribe();\n    this.add(this.innerSubscription=p(this,a,b,d))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);this.innerSubscription=null;this.isStopped&&b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){this.resultSelector?this._tryNotifyNext(a,b,d,f):this.destination.next(b)};a.prototype._tryNotifyNext=function(a,\n    b,d,f){var c;try{c=this.resultSelector(a,b,d,f)}catch(y){this.destination.error(y);return}this.destination.next(c)};return a}(q);g.prototype.switchMap=function(b,a){return this.lift(new Qe(b,a))};var Se=function(){function b(a,b){this.observable=a;this.resultSelector=b}b.prototype.call=function(a,b){return b.subscribe(new Re(a,this.observable,this.resultSelector))};return b}(),Re=function(b){function a(a,e,d){b.call(this,a);this.inner=e;this.resultSelector=d;this.index=0}k(a,b);a.prototype._next=\n    function(a){var b=this.innerSubscription;b&&b.unsubscribe();this.add(this.innerSubscription=p(this,this.inner,a,this.index++))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);this.innerSubscription=null;this.isStopped&&b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?\n    this.tryResultSelector(a,b,d,f):h.next(b)};a.prototype.tryResultSelector=function(a,b,d,f){var c=this.resultSelector,e=this.destination,g;try{g=c(a,b,d,f)}catch(B){e.error(B);return}e.next(g)};return a}(q);g.prototype.switchMapTo=function(b,a){return this.lift(new Se(b,a))};var Ue=function(){function b(a){this.total=a;if(0>this.total)throw new M;}b.prototype.call=function(a,b){return b.subscribe(new Te(a,this.total))};return b}(),Te=function(b){function a(a,e){b.call(this,a);this.total=e;this.count=\n    0}k(a,b);a.prototype._next=function(a){var b=this.total,c=++this.count;c<=b&&(this.destination.next(a),c===b&&(this.destination.complete(),this.unsubscribe()))};return a}(l);g.prototype.take=function(b){return 0===b?new F:this.lift(new Ue(b))};var We=function(){function b(a){this.total=a;if(0>this.total)throw new M;}b.prototype.call=function(a,b){return b.subscribe(new Ve(a,this.total))};return b}(),Ve=function(b){function a(a,e){b.call(this,a);this.total=e;this.ring=[];this.count=0}k(a,b);a.prototype._next=\n    function(a){var b=this.ring,c=this.total,f=this.count++;b.length<c?b.push(a):b[f%c]=a};a.prototype._complete=function(){var a=this.destination,b=this.count;if(0<b)for(var d=this.count>=this.total?this.total:this.count,f=this.ring,h=0;h<d;h++){var g=b++%d;a.next(f[g])}a.complete()};return a}(l);g.prototype.takeLast=function(b){return 0===b?new F:this.lift(new We(b))};var Ye=function(){function b(a){this.notifier=a}b.prototype.call=function(a,b){return b.subscribe(new Xe(a,this.notifier))};return b}(),\n    Xe=function(b){function a(a,e){b.call(this,a);this.notifier=e;this.add(p(this,e))}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.complete()};a.prototype.notifyComplete=function(){};return a}(q);g.prototype.takeUntil=function(b){return this.lift(new Ye(b))};var $e=function(){function b(a){this.predicate=a}b.prototype.call=function(a,b){return b.subscribe(new Ze(a,this.predicate))};return b}(),Ze=function(b){function a(a,e){b.call(this,a);this.predicate=e;this.index=0}k(a,b);a.prototype._next=\n    function(a){var b=this.destination,c;try{c=this.predicate(a,this.index++)}catch(f){b.error(f);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a,b){var c=this.destination;b?c.next(a):c.complete()};return a}(l);g.prototype.takeWhile=function(b){return this.lift(new $e(b))};var fb={leading:!0,trailing:!1},bf=function(){function b(a,b,e){this.durationSelector=a;this.leading=b;this.trailing=e}b.prototype.call=function(a,b){return b.subscribe(new af(a,this.durationSelector,this.leading,\n    this.trailing))};return b}(),af=function(b){function a(a,e,d,f){b.call(this,a);this.destination=a;this.durationSelector=e;this._leading=d;this._trailing=f;this._hasTrailingValue=!1}k(a,b);a.prototype._next=function(a){if(this.throttled)this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=a);else{var b=this.tryDurationSelector(a);b&&this.add(this.throttled=p(this,b));this._leading&&(this.destination.next(a),this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=a))}};a.prototype.tryDurationSelector=\n    function(a){try{return this.durationSelector(a)}catch(e){return this.destination.error(e),null}};a.prototype._unsubscribe=function(){var a=this.throttled;this._trailingValue=null;this._hasTrailingValue=!1;a&&(this.remove(a),this.throttled=null,a.unsubscribe())};a.prototype._sendTrailing=function(){var a=this.destination,b=this._trailing,d=this._trailingValue,f=this._hasTrailingValue;this.throttled&&b&&f&&(a.next(d),this._trailingValue=null,this._hasTrailingValue=!1)};a.prototype.notifyNext=function(a,\n    b,d,f,h){this._sendTrailing();this._unsubscribe()};a.prototype.notifyComplete=function(){this._sendTrailing();this._unsubscribe()};return a}(q);g.prototype.throttle=function(b,a){void 0===a&&(a=fb);return this.lift(new bf(b,a.leading,a.trailing))};var df=function(){function b(a,b,e,d){this.duration=a;this.scheduler=b;this.leading=e;this.trailing=d}b.prototype.call=function(a,b){return b.subscribe(new cf(a,this.duration,this.scheduler,this.leading,this.trailing))};return b}(),cf=function(b){function a(a,\n    e,d,f,h){b.call(this,a);this.duration=e;this.scheduler=d;this.leading=f;this.trailing=h;this._hasTrailingValue=!1;this._trailingValue=null}k(a,b);a.prototype._next=function(a){this.throttled?this.trailing&&(this._trailingValue=a,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Ub,this.duration,{subscriber:this})),this.leading&&this.destination.next(a))};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),\n    this._trailingValue=null,this._hasTrailingValue=!1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(l);g.prototype.throttleTime=function(b,a,c){void 0===a&&(a=x);void 0===c&&(c=fb);return this.lift(new df(b,a,c.leading,c.trailing))};var gb=function(){return function(b,a){this.value=b;this.interval=a}}(),ff=function(){function b(a){this.scheduler=a}b.prototype.call=function(a,b){return b.subscribe(new ef(a,this.scheduler))};return b}(),ef=function(b){function a(a,e){b.call(this,a);this.scheduler=\n    e;this.lastTime=0;this.lastTime=e.now()}k(a,b);a.prototype._next=function(a){var b=this.scheduler.now(),c=b-this.lastTime;this.lastTime=b;this.destination.next(new gb(a,c))};return a}(l);g.prototype.timeInterval=function(b){void 0===b&&(b=x);return this.lift(new ff(b))};var hb=function(b){function a(){var a=b.call(this,\"Timeout has occurred\");this.name=a.name=\"TimeoutError\";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),hf=function(){function b(a,b,e,d){this.waitFor=a;this.absoluteTimeout=\n    b;this.scheduler=e;this.errorInstance=d}b.prototype.call=function(a,b){return b.subscribe(new gf(a,this.absoluteTimeout,this.waitFor,this.scheduler,this.errorInstance))};return b}(),gf=function(b){function a(a,e,d,f,h){b.call(this,a);this.absoluteTimeout=e;this.waitFor=d;this.scheduler=f;this.errorInstance=h;this.action=null;this.scheduleTimeout()}k(a,b);a.dispatchTimeout=function(a){a.error(a.errorInstance)};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):\n    this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();b.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.errorInstance=this.scheduler=this.action=null};return a}(l);g.prototype.timeout=function(b,a){void 0===a&&(a=x);var c=X(b);b=c?+b-a.now():Math.abs(b);return this.lift(new hf(b,c,a,new hb))};var kf=function(){function b(a,b,e,d){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=\n    e;this.scheduler=d}b.prototype.call=function(a,b){return b.subscribe(new jf(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return b}(),jf=function(b){function a(a,e,d,f,h){b.call(this,a);this.absoluteTimeout=e;this.waitFor=d;this.withObservable=f;this.scheduler=h;this.action=null;this.scheduleTimeout()}k(a,b);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(p(a,b))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=\n    b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();b.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.withObservable=this.scheduler=this.action=null};return a}(q);g.prototype.timeoutWith=function(b,a,c){void 0===c&&(c=x);var e=X(b);b=e?+b-c.now():Math.abs(b);return this.lift(new kf(b,e,a,c))};var ib=function(){return function(b,a){this.value=\n    b;this.timestamp=a}}(),mf=function(){function b(a){this.scheduler=a}b.prototype.call=function(a,b){return b.subscribe(new lf(a,this.scheduler))};return b}(),lf=function(b){function a(a,e){b.call(this,a);this.scheduler=e}k(a,b);a.prototype._next=function(a){var b=this.scheduler.now();this.destination.next(new ib(a,b))};return a}(l);g.prototype.timestamp=function(b){void 0===b&&(b=x);return this.lift(new mf(b))};var of=function(){function b(){}b.prototype.call=function(a,b){return b.subscribe(new nf(a))};\n    return b}(),nf=function(b){function a(a){b.call(this,a);this.array=[]}k(a,b);a.prototype._next=function(a){this.array.push(a)};a.prototype._complete=function(){this.destination.next(this.array);this.destination.complete()};return a}(l);g.prototype.toArray=function(){return this.lift(new of)};g.prototype.toPromise=function(b){var a=this;b||(n.Rx&&n.Rx.config&&n.Rx.config.Promise?b=n.Rx.config.Promise:n.Promise&&(b=n.Promise));if(!b)throw Error(\"no Promise impl found\");return new b(function(b,e){var c;\n    a.subscribe(function(a){return c=a},function(a){return e(a)},function(){return b(c)})})};var qf=function(){function b(a){this.windowBoundaries=a}b.prototype.call=function(a,b){a=new pf(a);b=b.subscribe(a);b.closed||a.add(p(a,this.windowBoundaries));return b};return b}(),pf=function(b){function a(a){b.call(this,a);this.window=new v;a.next(this.window)}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.openWindow()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=\n    function(a){this._complete()};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a)};a.prototype._complete=function(){this.window.complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.window=null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,b=this.window=new v;a.next(b)};return a}(q);g.prototype.window=function(b){return this.lift(new qf(b))};var sf=\n    function(){function b(a,b){this.windowSize=a;this.startWindowEvery=b}b.prototype.call=function(a,b){return b.subscribe(new rf(a,this.windowSize,this.startWindowEvery))};return b}(),rf=function(b){function a(a,e,d){b.call(this,a);this.destination=a;this.windowSize=e;this.startWindowEvery=d;this.windows=[new v];this.count=0;a.next(this.windows[0])}k(a,b);a.prototype._next=function(a){for(var b=0<this.startWindowEvery?this.startWindowEvery:this.windowSize,c=this.destination,f=this.windowSize,h=this.windows,\n    g=h.length,k=0;k<g&&!this.closed;k++)h[k].next(a);a=this.count-f+1;0<=a&&0===a%b&&!this.closed&&h.shift().complete();0!==++this.count%b||this.closed||(b=new v,h.push(b),c.next(b))};a.prototype._error=function(a){var b=this.windows;if(b)for(;0<b.length&&!this.closed;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){var a=this.windows;if(a)for(;0<a.length&&!this.closed;)a.shift().complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.count=0;this.windows=\n    null};return a}(l);g.prototype.windowCount=function(b,a){void 0===a&&(a=0);return this.lift(new sf(b,a))};var uf=function(){function b(a,b,e,d){this.windowTimeSpan=a;this.windowCreationInterval=b;this.maxWindowSize=e;this.scheduler=d}b.prototype.call=function(a,b){return b.subscribe(new tf(a,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))};return b}(),vf=function(b){function a(){b.apply(this,arguments);this._numberOfNextedValues=0}k(a,b);a.prototype.next=function(a){this._numberOfNextedValues++;\n    b.prototype.next.call(this,a)};Object.defineProperty(a.prototype,\"numberOfNextedValues\",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0});return a}(v),tf=function(b){function a(a,e,d,f,h){b.call(this,a);this.destination=a;this.windowTimeSpan=e;this.windowCreationInterval=d;this.maxWindowSize=f;this.scheduler=h;this.windows=[];a=this.openWindow();null!==d&&0<=d?(f={windowTimeSpan:e,windowCreationInterval:d,subscriber:this,scheduler:h},this.add(h.schedule(Ka,e,{subscriber:this,\n    window:a,context:null})),this.add(h.schedule(Wb,d,f))):this.add(h.schedule(Vb,e,{subscriber:this,window:a,windowTimeSpan:e}))}k(a,b);a.prototype._next=function(a){for(var b=this.windows,c=b.length,f=0;f<c;f++){var h=b[f];h.closed||(h.next(a),h.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(h))}};a.prototype._error=function(a){for(var b=this.windows;0<b.length;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){for(var a=this.windows;0<a.length;){var b=a.shift();\n    b.closed||b.complete()}this.destination.complete()};a.prototype.openWindow=function(){var a=new vf;this.windows.push(a);this.destination.next(a);return a};a.prototype.closeWindow=function(a){a.complete();var b=this.windows;b.splice(b.indexOf(a),1)};return a}(l);g.prototype.windowTime=function(b,a,c,e){var d=x,f=null,h=Number.POSITIVE_INFINITY;z(e)&&(d=e);z(c)?d=c:Q(c)&&(h=c);z(a)?d=a:Q(a)&&(f=a);return this.lift(new uf(b,f,h,d))};var xf=function(){function b(a,b){this.openings=a;this.closingSelector=\n    b}b.prototype.call=function(a,b){return b.subscribe(new wf(a,this.openings,this.closingSelector))};return b}(),wf=function(b){function a(a,e,d){b.call(this,a);this.openings=e;this.closingSelector=d;this.contexts=[];this.add(this.openSubscription=p(this,e,e))}k(a,b);a.prototype._next=function(a){var b=this.contexts;if(b)for(var c=b.length,f=0;f<c;f++)b[f].window.next(a)};a.prototype._error=function(a){var c=this.contexts;this.contexts=null;if(c)for(var d=c.length,f=-1;++f<d;){var h=c[f];h.window.error(a);\n    h.subscription.unsubscribe()}b.prototype._error.call(this,a)};a.prototype._complete=function(){var a=this.contexts;this.contexts=null;if(a)for(var e=a.length,d=-1;++d<e;){var f=a[d];f.window.complete();f.subscription.unsubscribe()}b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var a=this.contexts;this.contexts=null;if(a)for(var b=a.length,d=-1;++d<b;){var f=a[d];f.window.unsubscribe();f.subscription.unsubscribe()}};a.prototype.notifyNext=function(a,b,d,f,h){if(a===this.openings){f=\n    r(this.closingSelector)(b);if(f===m)return this.error(m.e);a=new v;b=new u;d={window:a,subscription:b};this.contexts.push(d);f=p(this,f,d);f.closed?this.closeWindow(this.contexts.length-1):(f.context=d,b.add(f));this.destination.next(a)}else this.closeWindow(this.contexts.indexOf(a))};a.prototype.notifyError=function(a){this.error(a)};a.prototype.notifyComplete=function(a){a!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(a.context))};a.prototype.closeWindow=function(a){if(-1!==a){var b=\n    this.contexts,c=b[a],f=c.window,c=c.subscription;b.splice(a,1);f.complete();c.unsubscribe()}};return a}(q);g.prototype.windowToggle=function(b,a){return this.lift(new xf(b,a))};var zf=function(){function b(a){this.closingSelector=a}b.prototype.call=function(a,b){return b.subscribe(new yf(a,this.closingSelector))};return b}(),yf=function(b){function a(a,e){b.call(this,a);this.destination=a;this.closingSelector=e;this.openWindow()}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.openWindow(h)};\n    a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=function(a){this.openWindow(a)};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a);this.unsubscribeClosingNotification()};a.prototype._complete=function(){this.window.complete();this.destination.complete();this.unsubscribeClosingNotification()};a.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()};\n    a.prototype.openWindow=function(a){void 0===a&&(a=null);a&&(this.remove(a),a.unsubscribe());(a=this.window)&&a.complete();a=this.window=new v;this.destination.next(a);a=r(this.closingSelector)();a===m?(a=m.e,this.destination.error(a),this.window.error(a)):this.add(this.closingNotification=p(this,a))};return a}(q);g.prototype.windowWhen=function(b){return this.lift(new zf(b))};var Bf=function(){function b(a,b){this.observables=a;this.project=b}b.prototype.call=function(a,b){return b.subscribe(new Af(a,\n    this.observables,this.project))};return b}(),Af=function(b){function a(a,e,d){b.call(this,a);this.observables=e;this.project=d;this.toRespond=[];a=e.length;this.values=Array(a);for(d=0;d<a;d++)this.toRespond.push(d);for(d=0;d<a;d++){var c=e[d];this.add(p(this,c,c,d))}}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.values[d]=b;a=this.toRespond;0<a.length&&(d=a.indexOf(d),-1!==d&&a.splice(d,1))};a.prototype.notifyComplete=function(){};a.prototype._next=function(a){0===this.toRespond.length&&\n    (a=[a].concat(this.values),this.project?this._tryProject(a):this.destination.next(a))};a.prototype._tryProject=function(a){var b;try{b=this.project.apply(this,a)}catch(d){this.destination.error(d);return}this.destination.next(b)};return a}(q);g.prototype.withLatestFrom=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c;\"function\"===typeof b[b.length-1]&&(c=b.pop());return this.lift(new Bf(b,c))};g.prototype.zip=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];\n    return this.lift.call(ua.apply(void 0,[this].concat(b)))};g.prototype.zipAll=function(b){return this.lift(new va(b))};var V=function(){return function(b,a){void 0===a&&(a=Number.POSITIVE_INFINITY);this.subscribedFrame=b;this.unsubscribedFrame=a}}(),jb=function(){function b(){this.subscriptions=[]}b.prototype.logSubscribedFrame=function(){this.subscriptions.push(new V(this.scheduler.now()));return this.subscriptions.length-1};b.prototype.logUnsubscribedFrame=function(a){var b=this.subscriptions;b[a]=\n    new V(b[a].subscribedFrame,this.scheduler.now())};return b}(),ka=function(b){function a(a,e){b.call(this,function(a){var b=this,c=b.logSubscribedFrame();a.add(new u(function(){b.logUnsubscribedFrame(c)}));b.scheduleMessages(a);return a});this.messages=a;this.subscriptions=[];this.scheduler=e}k(a,b);a.prototype.scheduleMessages=function(a){for(var b=this.messages.length,c=0;c<b;c++){var f=this.messages[c];a.add(this.scheduler.schedule(function(a){a.message.notification.observe(a.subscriber)},f.frame,\n    {message:f,subscriber:a}))}};return a}(g);La(ka,[jb]);var kb=function(b){function a(a,e){b.call(this);this.messages=a;this.subscriptions=[];this.scheduler=e}k(a,b);a.prototype._subscribe=function(a){var c=this,d=c.logSubscribedFrame();a.add(new u(function(){c.logUnsubscribedFrame(d)}));return b.prototype._subscribe.call(this,a)};a.prototype.setup=function(){for(var a=this,b=a.messages.length,d=0;d<b;d++)(function(){var b=a.messages[d];a.scheduler.schedule(function(){b.notification.observe(a)},b.frame)})()};\n    return a}(v);La(kb,[jb]);var mb=function(b){function a(a,e){var c=this;void 0===a&&(a=lb);void 0===e&&(e=Number.POSITIVE_INFINITY);b.call(this,a,function(){return c.frame});this.maxFrames=e;this.frame=0;this.index=-1}k(a,b);a.prototype.flush=function(){for(var a=this.actions,b=this.maxFrames,d,f;(f=a.shift())&&(this.frame=f.delay)<=b&&!(d=f.execute(f.state,f.delay)););if(d){for(;f=a.shift();)f.unsubscribe();throw d;}};a.frameTimeFactor=10;return a}(T),lb=function(b){function a(a,e,d){void 0===d&&\n    (d=a.index+=1);b.call(this,a,e);this.scheduler=a;this.work=e;this.index=d;this.active=!0;this.index=a.index=d}k(a,b);a.prototype.schedule=function(c,e){void 0===e&&(e=0);if(!this.id)return b.prototype.schedule.call(this,c,e);this.active=!1;var d=new a(this.scheduler,this.work);this.add(d);return d.schedule(c,e)};a.prototype.requestAsyncId=function(b,e,d){void 0===d&&(d=0);this.delay=b.frame+d;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(a,b,d){};a.prototype._execute=\n    function(a,e){if(!0===this.active)return b.prototype._execute.call(this,a,e)};a.sortActions=function(a,b){return a.delay===b.delay?a.index===b.index?0:a.index>b.index?1:-1:a.delay>b.delay?1:-1};return a}(S),Cf=function(b){function a(a){b.call(this,lb,750);this.assertDeepEqual=a;this.hotObservables=[];this.coldObservables=[];this.flushTests=[]}k(a,b);a.prototype.createTime=function(b){b=b.indexOf(\"|\");if(-1===b)throw Error('marble diagram for time should have a completion marker \"|\"');return b*a.frameTimeFactor};\n    a.prototype.createColdObservable=function(b,e,d){if(-1!==b.indexOf(\"^\"))throw Error('cold observable cannot have subscription offset \"^\"');if(-1!==b.indexOf(\"!\"))throw Error('cold observable cannot have unsubscription marker \"!\"');b=a.parseMarbles(b,e,d);b=new ka(b,this);this.coldObservables.push(b);return b};a.prototype.createHotObservable=function(b,e,d){if(-1!==b.indexOf(\"!\"))throw Error('hot observable cannot have unsubscription marker \"!\"');b=a.parseMarbles(b,e,d);b=new kb(b,this);this.hotObservables.push(b);\n    return b};a.prototype.materializeInnerObservable=function(a,b){var c=this,e=[];a.subscribe(function(a){e.push({frame:c.frame-b,notification:w.createNext(a)})},function(a){e.push({frame:c.frame-b,notification:w.createError(a)})},function(){e.push({frame:c.frame-b,notification:w.createComplete()})});return e};a.prototype.expectObservable=function(b,e){var c=this;void 0===e&&(e=null);var f=[],h={actual:f,ready:!1};e=a.parseMarblesAsSubscriptions(e).unsubscribedFrame;var k;this.schedule(function(){k=\n    b.subscribe(function(a){var b=a;a instanceof g&&(b=c.materializeInnerObservable(b,c.frame));f.push({frame:c.frame,notification:w.createNext(b)})},function(a){f.push({frame:c.frame,notification:w.createError(a)})},function(){f.push({frame:c.frame,notification:w.createComplete()})})},0);e!==Number.POSITIVE_INFINITY&&this.schedule(function(){return k.unsubscribe()},e);this.flushTests.push(h);return{toBe:function(b,c,d){h.ready=!0;h.expected=a.parseMarbles(b,c,d,!0)}}};a.prototype.expectSubscriptions=\n    function(b){var c={actual:b,ready:!1};this.flushTests.push(c);return{toBe:function(b){b=\"string\"===typeof b?[b]:b;c.ready=!0;c.expected=b.map(function(b){return a.parseMarblesAsSubscriptions(b)})}}};a.prototype.flush=function(){for(var a=this.hotObservables;0<a.length;)a.shift().setup();b.prototype.flush.call(this);for(a=this.flushTests.filter(function(a){return a.ready});0<a.length;){var e=a.shift();this.assertDeepEqual(e.actual,e.expected)}};a.parseMarblesAsSubscriptions=function(a){if(\"string\"!==\n    typeof a)return new V(Number.POSITIVE_INFINITY);for(var b=a.length,c=-1,f=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,k=0;k<b;k++){var l=k*this.frameTimeFactor,m=a[k];switch(m){case \"-\":case \" \":break;case \"(\":c=l;break;case \")\":c=-1;break;case \"^\":if(f!==Number.POSITIVE_INFINITY)throw Error(\"found a second subscription point '^' in a subscription marble diagram. There can only be one.\");f=-1<c?c:l;break;case \"!\":if(g!==Number.POSITIVE_INFINITY)throw Error(\"found a second subscription point '^' in a subscription marble diagram. There can only be one.\");\n    g=-1<c?c:l;break;default:throw Error(\"there can only be '^' and '!' markers in a subscription marble diagram. Found instead '\"+m+\"'.\");}}return 0>g?new V(f):new V(f,g)};a.parseMarbles=function(a,b,d,f){void 0===f&&(f=!1);if(-1!==a.indexOf(\"!\"))throw Error('conventional marble diagrams cannot have the unsubscription marker \"!\"');for(var c=a.length,e=[],g=a.indexOf(\"^\"),g=-1===g?0:g*-this.frameTimeFactor,k=\"object\"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof ka?b[a].messages:\n    b[a]},l=-1,m=0;m<c;m++){var n=m*this.frameTimeFactor+g,p=void 0,q=a[m];switch(q){case \"-\":case \" \":break;case \"(\":l=n;break;case \")\":l=-1;break;case \"|\":p=w.createComplete();break;case \"^\":break;case \"#\":p=w.createError(d||\"error\");break;default:p=w.createNext(k(q))}p&&e.push({frame:-1<l?l:n,notification:p})}return e};return a}(mb),nb=new (function(){return function(b){b.requestAnimationFrame?(this.cancelAnimationFrame=b.cancelAnimationFrame.bind(b),this.requestAnimationFrame=b.requestAnimationFrame.bind(b)):\n    b.mozRequestAnimationFrame?(this.cancelAnimationFrame=b.mozCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.mozRequestAnimationFrame.bind(b)):b.webkitRequestAnimationFrame?(this.cancelAnimationFrame=b.webkitCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.webkitRequestAnimationFrame.bind(b)):b.msRequestAnimationFrame?(this.cancelAnimationFrame=b.msCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.msRequestAnimationFrame.bind(b)):b.oRequestAnimationFrame?(this.cancelAnimationFrame=\n    b.oCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.oRequestAnimationFrame.bind(b)):(this.cancelAnimationFrame=b.clearTimeout.bind(b),this.requestAnimationFrame=function(a){return b.setTimeout(a,1E3/60)})}}())(n),Df=function(b){function a(a,e){b.call(this,a,e);this.scheduler=a;this.work=e}k(a,b);a.prototype.requestAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d)return b.prototype.requestAsyncId.call(this,a,e,d);a.actions.push(this);return a.scheduled||(a.scheduled=nb.requestAnimationFrame(a.flush.bind(a,\n    null)))};a.prototype.recycleAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d||null===d&&0<this.delay)return b.prototype.recycleAsyncId.call(this,a,e,d);0===a.actions.length&&(nb.cancelAnimationFrame(e),a.scheduled=void 0)};return a}(S),Ef=new (function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.flush=function(a){this.active=!0;this.scheduled=void 0;var b=this.actions,c,f=-1,g=b.length;a=a||b.shift();do if(c=a.execute(a.state,a.delay))break;while(++f<g&&(a=b.shift()));this.active=\n    !1;if(c){for(;++f<g&&(a=b.shift());)a.unsubscribe();throw c;}};return a}(T))(Df),Ff={rxSubscriber:R,observable:I,iterator:A};t.Scheduler={asap:ca,queue:Ya,animationFrame:Ef,async:x};t.Symbol=Ff;t.Subject=v;t.AnonymousSubject=Z;t.Observable=g;t.Subscription=u;t.Subscriber=l;t.AsyncSubject=L;t.ReplaySubject=K;t.BehaviorSubject=cb;t.ConnectableObservable=bb;t.Notification=w;t.EmptyError=ba;t.ArgumentOutOfRangeError=M;t.ObjectUnsubscribedError=H;t.TimeoutError=hb;t.UnsubscriptionError=O;t.TimeInterval=\n    gb;t.Timestamp=ib;t.TestScheduler=Cf;t.VirtualTimeScheduler=mb;t.AjaxResponse=Wa;t.AjaxError=aa;t.AjaxTimeoutError=Xa;Object.defineProperty(t,\"__esModule\",{value:!0})});\n\n    /**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs/Observable'), require('rxjs/observable/merge'), require('rxjs/operator/share'), require('rxjs/Subject')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', 'rxjs/Observable', 'rxjs/observable/merge', 'rxjs/operator/share', 'rxjs/Subject'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.core = global.ng.core || {}),global.Rx,global.Rx.Observable,global.Rx.Observable.prototype,global.Rx));\n}(this, (function (exports,rxjs_Observable,rxjs_observable_merge,rxjs_operator_share,rxjs_Subject) { 'use strict';\n\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = Object.setPrototypeOf ||\n    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n    function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n\nfunction __extends(d, b) {\n    extendStatics(d, b);\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * ### Example ([live demo](http://plnkr.co/edit/Ys9ezXpj2Mnoy3Uc8KBp?p=preview))\n *\n * ```typescript\n * var t = new OpaqueToken(\"value\");\n *\n * var injector = Injector.resolveAndCreate([\n *   {provide: t, useValue: \"bindingValue\"}\n * ]);\n *\n * expect(injector.get(t)).toEqual(\"bindingValue\");\n * ```\n *\n * Using an `OpaqueToken` is preferable to using strings as tokens because of possible collisions\n * caused by multiple providers using the same string as two different tokens.\n *\n * Using an `OpaqueToken` is preferable to using an `Object` as tokens because it provides better\n * error messages.\n * @deprecated since v4.0.0 because it does not support type information, use `InjectionToken<?>`\n * instead.\n */\nvar OpaqueToken = (function () {\n    /**\n     * @param {?} _desc\n     */\n    function OpaqueToken(_desc) {\n        this._desc = _desc;\n    }\n    /**\n     * @return {?}\n     */\n    OpaqueToken.prototype.toString = function () { return \"Token \" + this._desc; };\n    return OpaqueToken;\n}());\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parametrized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides additional level of type safety.\n *\n * ```\n * interface MyInterface {...}\n * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));\n * // myInterface is inferred to be MyInterface.\n * ```\n *\n * ### Example\n *\n * {\\@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * \\@stable\n */\nvar InjectionToken = (function (_super) {\n    __extends(InjectionToken, _super);\n    /**\n     * @param {?} desc\n     */\n    function InjectionToken(desc) {\n        return _super.call(this, desc) || this;\n    }\n    /**\n     * @return {?}\n     */\n    InjectionToken.prototype.toString = function () { return \"InjectionToken \" + this._desc; };\n    return InjectionToken;\n}(OpaqueToken));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar __window = typeof window !== 'undefined' && window;\nvar __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n    self instanceof WorkerGlobalScope && self;\nvar __global = typeof global !== 'undefined' && global;\nvar _global = __window || __global || __self;\nvar _symbolIterator = null;\n/**\n * @return {?}\n */\nfunction getSymbolIterator() {\n    if (!_symbolIterator) {\n        var /** @type {?} */ Symbol = _global['Symbol'];\n        if (Symbol && Symbol.iterator) {\n            _symbolIterator = Symbol.iterator;\n        }\n        else {\n            // es6-shim specific logic\n            var /** @type {?} */ keys = Object.getOwnPropertyNames(Map.prototype);\n            for (var /** @type {?} */ i = 0; i < keys.length; ++i) {\n                var /** @type {?} */ key = keys[i];\n                if (key !== 'entries' && key !== 'size' &&\n                    ((Map)).prototype[key] === Map.prototype['entries']) {\n                    _symbolIterator = key;\n                }\n            }\n        }\n    }\n    return _symbolIterator;\n}\n/**\n * @param {?} fn\n * @return {?}\n */\nfunction scheduleMicroTask(fn) {\n    Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction looseIdentical(a, b) {\n    return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}\n/**\n * @param {?} token\n * @return {?}\n */\nfunction stringify(token) {\n    if (typeof token === 'string') {\n        return token;\n    }\n    if (token == null) {\n        return '' + token;\n    }\n    if (token.overriddenName) {\n        return \"\" + token.overriddenName;\n    }\n    if (token.name) {\n        return \"\" + token.name;\n    }\n    var /** @type {?} */ res = token.toString();\n    if (res == null) {\n        return '' + res;\n    }\n    var /** @type {?} */ newLineIndex = res.indexOf('\\n');\n    return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _nextClassId = 0;\nvar Reflect$1 = _global['Reflect'];\n/**\n * @param {?} annotation\n * @return {?}\n */\nfunction extractAnnotation(annotation) {\n    if (typeof annotation === 'function' && annotation.hasOwnProperty('annotation')) {\n        // it is a decorator, extract annotation\n        annotation = annotation.annotation;\n    }\n    return annotation;\n}\n/**\n * @param {?} fnOrArray\n * @param {?} key\n * @return {?}\n */\nfunction applyParams(fnOrArray, key) {\n    if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function ||\n        fnOrArray === Number || fnOrArray === Array) {\n        throw new Error(\"Can not use native \" + stringify(fnOrArray) + \" as constructor\");\n    }\n    if (typeof fnOrArray === 'function') {\n        return fnOrArray;\n    }\n    if (Array.isArray(fnOrArray)) {\n        var /** @type {?} */ annotations = (fnOrArray);\n        var /** @type {?} */ annoLength = annotations.length - 1;\n        var /** @type {?} */ fn = fnOrArray[annoLength];\n        if (typeof fn !== 'function') {\n            throw new Error(\"Last position of Class method array must be Function in key \" + key + \" was '\" + stringify(fn) + \"'\");\n        }\n        if (annoLength != fn.length) {\n            throw new Error(\"Number of annotations (\" + annoLength + \") does not match number of arguments (\" + fn.length + \") in the function: \" + stringify(fn));\n        }\n        var /** @type {?} */ paramsAnnotations = [];\n        for (var /** @type {?} */ i = 0, /** @type {?} */ ii = annotations.length - 1; i < ii; i++) {\n            var /** @type {?} */ paramAnnotations = [];\n            paramsAnnotations.push(paramAnnotations);\n            var /** @type {?} */ annotation = annotations[i];\n            if (Array.isArray(annotation)) {\n                for (var /** @type {?} */ j = 0; j < annotation.length; j++) {\n                    paramAnnotations.push(extractAnnotation(annotation[j]));\n                }\n            }\n            else if (typeof annotation === 'function') {\n                paramAnnotations.push(extractAnnotation(annotation));\n            }\n            else {\n                paramAnnotations.push(annotation);\n            }\n        }\n        Reflect$1.defineMetadata('parameters', paramsAnnotations, fn);\n        return fn;\n    }\n    throw new Error(\"Only Function or Array is supported in Class definition for key '\" + key + \"' is '\" + stringify(fnOrArray) + \"'\");\n}\n/**\n * Provides a way for expressing ES6 classes with parameter annotations in ES5.\n *\n * ## Basic Example\n *\n * ```\n * var Greeter = ng.Class({\n *   constructor: function(name) {\n *     this.name = name;\n *   },\n *\n *   greet: function() {\n *     alert('Hello ' + this.name + '!');\n *   }\n * });\n * ```\n *\n * is equivalent to ES6:\n *\n * ```\n * class Greeter {\n *   constructor(name) {\n *     this.name = name;\n *   }\n *\n *   greet() {\n *     alert('Hello ' + this.name + '!');\n *   }\n * }\n * ```\n *\n * or equivalent to ES5:\n *\n * ```\n * var Greeter = function (name) {\n *   this.name = name;\n * }\n *\n * Greeter.prototype.greet = function () {\n *   alert('Hello ' + this.name + '!');\n * }\n * ```\n *\n * ### Example with parameter annotations\n *\n * ```\n * var MyService = ng.Class({\n *   constructor: [String, [new Optional(), Service], function(name, myService) {\n *     ...\n *   }]\n * });\n * ```\n *\n * is equivalent to ES6:\n *\n * ```\n * class MyService {\n *   constructor(name: string, \\@Optional() myService: Service) {\n *     ...\n *   }\n * }\n * ```\n *\n * ### Example with inheritance\n *\n * ```\n * var Shape = ng.Class({\n *   constructor: (color) {\n *     this.color = color;\n *   }\n * });\n *\n * var Square = ng.Class({\n *   extends: Shape,\n *   constructor: function(color, size) {\n *     Shape.call(this, color);\n *     this.size = size;\n *   }\n * });\n * ```\n * @suppress {globalThis}\n * \\@stable\n * @param {?} clsDef\n * @return {?}\n */\nfunction Class(clsDef) {\n    var /** @type {?} */ constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');\n    var /** @type {?} */ proto = constructor.prototype;\n    if (clsDef.hasOwnProperty('extends')) {\n        if (typeof clsDef.extends === 'function') {\n            ((constructor)).prototype = proto =\n                Object.create(((clsDef.extends)).prototype);\n        }\n        else {\n            throw new Error(\"Class definition 'extends' property must be a constructor function was: \" + stringify(clsDef.extends));\n        }\n    }\n    for (var /** @type {?} */ key in clsDef) {\n        if (key !== 'extends' && key !== 'prototype' && clsDef.hasOwnProperty(key)) {\n            proto[key] = applyParams(clsDef[key], key);\n        }\n    }\n    if (this && this.annotations instanceof Array) {\n        Reflect$1.defineMetadata('annotations', this.annotations, constructor);\n    }\n    var /** @type {?} */ constructorName = constructor['name'];\n    if (!constructorName || constructorName === 'constructor') {\n        ((constructor))['overriddenName'] = \"class\" + _nextClassId++;\n    }\n    return (constructor);\n}\n/**\n * @suppress {globalThis}\n * @param {?} name\n * @param {?=} props\n * @param {?=} parentClass\n * @param {?=} chainFn\n * @return {?}\n */\nfunction makeDecorator(name, props, parentClass, chainFn) {\n    var /** @type {?} */ metaCtor = makeMetadataCtor(props);\n    /**\n     * @param {?} objOrType\n     * @return {?}\n     */\n    function DecoratorFactory(objOrType) {\n        if (!(Reflect$1 && Reflect$1.getOwnMetadata)) {\n            throw 'reflect-metadata shim is required when using class decorators';\n        }\n        if (this instanceof DecoratorFactory) {\n            metaCtor.call(this, objOrType);\n            return this;\n        }\n        var /** @type {?} */ annotationInstance = new ((DecoratorFactory))(objOrType);\n        var /** @type {?} */ chainAnnotation = typeof this === 'function' && Array.isArray(this.annotations) ? this.annotations : [];\n        chainAnnotation.push(annotationInstance);\n        var /** @type {?} */ TypeDecorator = (function TypeDecorator(cls) {\n            var /** @type {?} */ annotations = Reflect$1.getOwnMetadata('annotations', cls) || [];\n            annotations.push(annotationInstance);\n            Reflect$1.defineMetadata('annotations', annotations, cls);\n            return cls;\n        });\n        TypeDecorator.annotations = chainAnnotation;\n        TypeDecorator.Class = Class;\n        if (chainFn)\n            chainFn(TypeDecorator);\n        return TypeDecorator;\n    }\n    if (parentClass) {\n        DecoratorFactory.prototype = Object.create(parentClass.prototype);\n    }\n    DecoratorFactory.prototype.toString = function () { return \"@\" + name; };\n    ((DecoratorFactory)).annotationCls = DecoratorFactory;\n    return DecoratorFactory;\n}\n/**\n * @param {?=} props\n * @return {?}\n */\nfunction makeMetadataCtor(props) {\n    return function ctor() {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        if (props) {\n            var /** @type {?} */ values = props.apply(void 0, args);\n            for (var /** @type {?} */ propName in values) {\n                this[propName] = values[propName];\n            }\n        }\n    };\n}\n/**\n * @param {?} name\n * @param {?=} props\n * @param {?=} parentClass\n * @return {?}\n */\nfunction makeParamDecorator(name, props, parentClass) {\n    var /** @type {?} */ metaCtor = makeMetadataCtor(props);\n    /**\n     * @param {...?} args\n     * @return {?}\n     */\n    function ParamDecoratorFactory() {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        if (this instanceof ParamDecoratorFactory) {\n            metaCtor.apply(this, args);\n            return this;\n        }\n        var /** @type {?} */ annotationInstance = new (((ParamDecoratorFactory)).bind.apply(((ParamDecoratorFactory)), [void 0].concat(args)))();\n        ((ParamDecorator)).annotation = annotationInstance;\n        return ParamDecorator;\n        /**\n         * @param {?} cls\n         * @param {?} unusedKey\n         * @param {?} index\n         * @return {?}\n         */\n        function ParamDecorator(cls, unusedKey, index) {\n            var /** @type {?} */ parameters = Reflect$1.getOwnMetadata('parameters', cls) || [];\n            // there might be gaps if some in between parameters do not have annotations.\n            // we pad with nulls.\n            while (parameters.length <= index) {\n                parameters.push(null);\n            }\n            parameters[index] = parameters[index] || []; /** @type {?} */\n            ((parameters[index])).push(annotationInstance);\n            Reflect$1.defineMetadata('parameters', parameters, cls);\n            return cls;\n        }\n    }\n    if (parentClass) {\n        ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n    }\n    ParamDecoratorFactory.prototype.toString = function () { return \"@\" + name; };\n    ((ParamDecoratorFactory)).annotationCls = ParamDecoratorFactory;\n    return ParamDecoratorFactory;\n}\n/**\n * @param {?} name\n * @param {?=} props\n * @param {?=} parentClass\n * @return {?}\n */\nfunction makePropDecorator(name, props, parentClass) {\n    var /** @type {?} */ metaCtor = makeMetadataCtor(props);\n    /**\n     * @param {...?} args\n     * @return {?}\n     */\n    function PropDecoratorFactory() {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        if (this instanceof PropDecoratorFactory) {\n            metaCtor.apply(this, args);\n            return this;\n        }\n        var /** @type {?} */ decoratorInstance = new (((PropDecoratorFactory)).bind.apply(((PropDecoratorFactory)), [void 0].concat(args)))();\n        return function PropDecorator(target, name) {\n            var /** @type {?} */ meta = Reflect$1.getOwnMetadata('propMetadata', target.constructor) || {};\n            meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n            meta[name].unshift(decoratorInstance);\n            Reflect$1.defineMetadata('propMetadata', meta, target.constructor);\n        };\n    }\n    if (parentClass) {\n        PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n    }\n    PropDecoratorFactory.prototype.toString = function () { return \"@\" + name; };\n    ((PropDecoratorFactory)).annotationCls = PropDecoratorFactory;\n    return PropDecoratorFactory;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * This token can be used to create a virtual provider that will populate the\n * `entryComponents` fields of components and ng modules based on its `useValue`.\n * All components that are referenced in the `useValue` value (either directly\n * or in a nested array or map) will be added to the `entryComponents` property.\n *\n * ### Example\n * The following example shows how the router can populate the `entryComponents`\n * field of an NgModule based on the router configuration which refers\n * to components.\n *\n * ```typescript\n * // helper function inside the router\n * function provideRoutes(routes) {\n *   return [\n *     {provide: ROUTES, useValue: routes},\n *     {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}\n *   ];\n * }\n *\n * // user code\n * let routes = [\n *   {path: '/root', component: RootComp},\n *   {path: '/teams', component: TeamsComp}\n * ];\n *\n * \\@NgModule({\n *   providers: [provideRoutes(routes)]\n * })\n * class ModuleWithRoutes {}\n * ```\n *\n * \\@experimental\n */\nvar ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');\n/**\n * Attribute decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Attribute = makeParamDecorator('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });\n/**\n * Base class for query metadata.\n *\n * See {\\@link ContentChildren}, {\\@link ContentChild}, {\\@link ViewChildren}, {\\@link ViewChild} for\n * more information.\n *\n * \\@stable\n * @abstract\n */\nvar Query = (function () {\n    function Query() {\n    }\n    return Query;\n}());\n/**\n * ContentChildren decorator and metadata.\n *\n *  \\@stable\n *  \\@Annotation\n */\nvar ContentChildren = makePropDecorator('ContentChildren', function (selector, data) {\n    if (data === void 0) { data = {}; }\n    return (Object.assign({ selector: selector, first: false, isViewQuery: false, descendants: false }, data));\n}, Query);\n/**\n * ContentChild decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar ContentChild = makePropDecorator('ContentChild', function (selector, data) {\n    if (data === void 0) { data = {}; }\n    return (Object.assign({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));\n}, Query);\n/**\n * ViewChildren decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar ViewChildren = makePropDecorator('ViewChildren', function (selector, data) {\n    if (data === void 0) { data = {}; }\n    return (Object.assign({ selector: selector, first: false, isViewQuery: true, descendants: true }, data));\n}, Query);\n/**\n * ViewChild decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar ViewChild = makePropDecorator('ViewChild', function (selector, data) { return (Object.assign({ selector: selector, first: true, isViewQuery: true, descendants: true }, data)); }, Query);\nvar ChangeDetectionStrategy = {};\nChangeDetectionStrategy.OnPush = 0;\nChangeDetectionStrategy.Default = 1;\nChangeDetectionStrategy[ChangeDetectionStrategy.OnPush] = \"OnPush\";\nChangeDetectionStrategy[ChangeDetectionStrategy.Default] = \"Default\";\nvar ChangeDetectorStatus = {};\nChangeDetectorStatus.CheckOnce = 0;\nChangeDetectorStatus.Checked = 1;\nChangeDetectorStatus.CheckAlways = 2;\nChangeDetectorStatus.Detached = 3;\nChangeDetectorStatus.Errored = 4;\nChangeDetectorStatus.Destroyed = 5;\nChangeDetectorStatus[ChangeDetectorStatus.CheckOnce] = \"CheckOnce\";\nChangeDetectorStatus[ChangeDetectorStatus.Checked] = \"Checked\";\nChangeDetectorStatus[ChangeDetectorStatus.CheckAlways] = \"CheckAlways\";\nChangeDetectorStatus[ChangeDetectorStatus.Detached] = \"Detached\";\nChangeDetectorStatus[ChangeDetectorStatus.Errored] = \"Errored\";\nChangeDetectorStatus[ChangeDetectorStatus.Destroyed] = \"Destroyed\";\n/**\n * @param {?} changeDetectionStrategy\n * @return {?}\n */\nfunction isDefaultChangeDetectionStrategy(changeDetectionStrategy) {\n    return changeDetectionStrategy == null ||\n        changeDetectionStrategy === ChangeDetectionStrategy.Default;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Directive decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Directive = makeDecorator('Directive', function (dir) {\n    if (dir === void 0) { dir = {}; }\n    return dir;\n});\n/**\n * Component decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Component = makeDecorator('Component', function (c) {\n    if (c === void 0) { c = {}; }\n    return (Object.assign({ changeDetection: ChangeDetectionStrategy.Default }, c));\n}, Directive);\n/**\n * Pipe decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Pipe = makeDecorator('Pipe', function (p) { return (Object.assign({ pure: true }, p)); });\n/**\n * Input decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Input = makePropDecorator('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });\n/**\n * Output decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Output = makePropDecorator('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });\n/**\n * HostBinding decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar HostBinding = makePropDecorator('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });\n/**\n * HostListener decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar HostListener = makePropDecorator('HostListener', function (eventName, args) { return ({ eventName: eventName, args: args }); });\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Defines a schema that will allow:\n * - any non-Angular elements with a `-` in their name,\n * - any properties on elements with a `-` in their name which is the common rule for custom\n * elements.\n *\n * \\@stable\n */\nvar CUSTOM_ELEMENTS_SCHEMA = {\n    name: 'custom-elements'\n};\n/**\n * Defines a schema that will allow any property on any element.\n *\n * \\@experimental\n */\nvar NO_ERRORS_SCHEMA = {\n    name: 'no-errors-schema'\n};\n/**\n * NgModule decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule; });\nvar ViewEncapsulation = {};\nViewEncapsulation.Emulated = 0;\nViewEncapsulation.Native = 1;\nViewEncapsulation.None = 2;\nViewEncapsulation[ViewEncapsulation.Emulated] = \"Emulated\";\nViewEncapsulation[ViewEncapsulation.Native] = \"Native\";\nViewEncapsulation[ViewEncapsulation.None] = \"None\";\n/**\n * Metadata properties available for configuring Views.\n *\n * For details on the `\\@Component` annotation, see {\\@link Component}.\n *\n * ### Example\n *\n * ```\n * \\@Component({\n *   selector: 'greet',\n *   template: 'Hello {{name}}!',\n * })\n * class Greet {\n *   name: string;\n *\n *   constructor() {\n *     this.name = 'World';\n *   }\n * }\n * ```\n *\n * @deprecated Use Component instead.\n *\n * {\\@link Component}\n */\nvar ViewMetadata = (function () {\n    /**\n     * @param {?=} __0\n     */\n    function ViewMetadata(_a) {\n        var _b = _a === void 0 ? {} : _a, templateUrl = _b.templateUrl, template = _b.template, encapsulation = _b.encapsulation, styles = _b.styles, styleUrls = _b.styleUrls, animations = _b.animations, interpolation = _b.interpolation;\n        this.templateUrl = templateUrl;\n        this.template = template;\n        this.styleUrls = styleUrls;\n        this.styles = styles;\n        this.encapsulation = encapsulation;\n        this.animations = animations;\n        this.interpolation = interpolation;\n    }\n    return ViewMetadata;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@whatItDoes Represents the version of Angular\n *\n * \\@stable\n */\nvar Version = (function () {\n    /**\n     * @param {?} full\n     */\n    function Version(full) {\n        this.full = full;\n    }\n    Object.defineProperty(Version.prototype, \"major\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.full.split('.')[0]; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(Version.prototype, \"minor\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.full.split('.')[1]; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(Version.prototype, \"patch\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.full.split('.').slice(2).join('.'); },\n        enumerable: true,\n        configurable: true\n    });\n    return Version;\n}());\n/**\n * \\@stable\n */\nvar VERSION = new Version('4.2.3');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Inject decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Inject = makeParamDecorator('Inject', function (token) { return ({ token: token }); });\n/**\n * Optional decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Optional = makeParamDecorator('Optional');\n/**\n * Injectable decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Injectable = makeDecorator('Injectable');\n/**\n * Self decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Self = makeParamDecorator('Self');\n/**\n * SkipSelf decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar SkipSelf = makeParamDecorator('SkipSelf');\n/**\n * Host decorator and metadata.\n *\n * \\@stable\n * \\@Annotation\n */\nvar Host = makeParamDecorator('Host');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared,\n * but not yet defined. It is also used when the `token` which we use when creating a query is not\n * yet defined.\n *\n * ### Example\n * {\\@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n * \\@experimental\n * @param {?} forwardRefFn\n * @return {?}\n */\nfunction forwardRef(forwardRefFn) {\n    ((forwardRefFn)).__forward_ref__ = forwardRef;\n    ((forwardRefFn)).toString = function () { return stringify(this()); };\n    return (((forwardRefFn)));\n}\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * ### Example ([live demo](http://plnkr.co/edit/GU72mJrk1fiodChcmiDR?p=preview))\n *\n * {\\@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * See: {\\@link forwardRef}\n * \\@experimental\n * @param {?} type\n * @return {?}\n */\nfunction resolveForwardRef(type) {\n    if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__') &&\n        type.__forward_ref__ === forwardRef) {\n        return ((type))();\n    }\n    else {\n        return type;\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _THROW_IF_NOT_FOUND = new Object();\nvar THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\nvar _NullInjector = (function () {\n    function _NullInjector() {\n    }\n    /**\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    _NullInjector.prototype.get = function (token, notFoundValue) {\n        if (notFoundValue === void 0) { notFoundValue = _THROW_IF_NOT_FOUND; }\n        if (notFoundValue === _THROW_IF_NOT_FOUND) {\n            throw new Error(\"No provider for \" + stringify(token) + \"!\");\n        }\n        return notFoundValue;\n    };\n    return _NullInjector;\n}());\n/**\n * \\@whatItDoes Injector interface\n * \\@howToUse\n * ```\n * const injector: Injector = ...;\n * injector.get(...);\n * ```\n *\n * \\@description\n * For more details, see the {\\@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {\\@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n * {\\@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * \\@stable\n * @abstract\n */\nvar Injector = (function () {\n    function Injector() {\n    }\n    /**\n     * Retrieves an instance from the injector based on the provided token.\n     * If not found:\n     * - Throws an error if no `notFoundValue` that is not equal to\n     * Injector.THROW_IF_NOT_FOUND is given\n     * - Returns the `notFoundValue` otherwise\n     * @abstract\n     * @template T\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    Injector.prototype.get = function (token, notFoundValue) { };\n    /**\n     * @deprecated from v4.0.0 use Type<T> or InjectionToken<T>\n     * @suppress {duplicate}\n     * @abstract\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    Injector.prototype.get = function (token, notFoundValue) { };\n    return Injector;\n}());\nInjector.THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\nInjector.NULL = new _NullInjector();\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ERROR_COMPONENT_TYPE = 'ngComponentType';\nvar ERROR_DEBUG_CONTEXT = 'ngDebugContext';\nvar ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nvar ERROR_LOGGER = 'ngErrorLogger';\n/**\n * @param {?} error\n * @return {?}\n */\n/**\n * @param {?} error\n * @return {?}\n */\nfunction getDebugContext(error) {\n    return ((error))[ERROR_DEBUG_CONTEXT];\n}\n/**\n * @param {?} error\n * @return {?}\n */\nfunction getOriginalError(error) {\n    return ((error))[ERROR_ORIGINAL_ERROR];\n}\n/**\n * @param {?} error\n * @return {?}\n */\nfunction getErrorLogger(error) {\n    return ((error))[ERROR_LOGGER] || defaultErrorLogger;\n}\n/**\n * @param {?} console\n * @param {...?} values\n * @return {?}\n */\nfunction defaultErrorLogger(console) {\n    var values = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        values[_i - 1] = arguments[_i];\n    }\n    console.error.apply(console, values);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@whatItDoes Provides a hook for centralized exception handling.\n *\n * \\@description\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n *   handleError(error) {\n *     // do something with the exception\n *   }\n * }\n *\n * \\@NgModule({\n *   providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * \\@stable\n */\nvar ErrorHandler = (function () {\n    /**\n     * @param {?=} deprecatedParameter\n     */\n    function ErrorHandler(\n        /**\n         * @deprecated since v4.0 parameter no longer has an effect, as ErrorHandler will never\n         * rethrow.\n         */\n        deprecatedParameter) {\n        /**\n         * \\@internal\n         */\n        this._console = console;\n    }\n    /**\n     * @param {?} error\n     * @return {?}\n     */\n    ErrorHandler.prototype.handleError = function (error) {\n        var /** @type {?} */ originalError = this._findOriginalError(error);\n        var /** @type {?} */ context = this._findContext(error);\n        // Note: Browser consoles show the place from where console.error was called.\n        // We can use this to give users additional information about the error.\n        var /** @type {?} */ errorLogger = getErrorLogger(error);\n        errorLogger(this._console, \"ERROR\", error);\n        if (originalError) {\n            errorLogger(this._console, \"ORIGINAL ERROR\", originalError);\n        }\n        if (context) {\n            errorLogger(this._console, 'ERROR CONTEXT', context);\n        }\n    };\n    /**\n     * \\@internal\n     * @param {?} error\n     * @return {?}\n     */\n    ErrorHandler.prototype._findContext = function (error) {\n        if (error) {\n            return getDebugContext(error) ? getDebugContext(error) :\n                this._findContext(getOriginalError(error));\n        }\n        return null;\n    };\n    /**\n     * \\@internal\n     * @param {?} error\n     * @return {?}\n     */\n    ErrorHandler.prototype._findOriginalError = function (error) {\n        var /** @type {?} */ e = getOriginalError(error);\n        while (e && getOriginalError(e)) {\n            e = getOriginalError(e);\n        }\n        return e;\n    };\n    return ErrorHandler;\n}());\n/**\n * @param {?} message\n * @param {?} originalError\n * @return {?}\n */\nfunction wrappedError(message, originalError) {\n    var /** @type {?} */ msg = message + \" caused by: \" + (originalError instanceof Error ? originalError.message : originalError);\n    var /** @type {?} */ error = Error(msg);\n    ((error))[ERROR_ORIGINAL_ERROR] = originalError;\n    return error;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} keys\n * @return {?}\n */\nfunction findFirstClosedCycle(keys) {\n    var /** @type {?} */ res = [];\n    for (var /** @type {?} */ i = 0; i < keys.length; ++i) {\n        if (res.indexOf(keys[i]) > -1) {\n            res.push(keys[i]);\n            return res;\n        }\n        res.push(keys[i]);\n    }\n    return res;\n}\n/**\n * @param {?} keys\n * @return {?}\n */\nfunction constructResolvingPath(keys) {\n    if (keys.length > 1) {\n        var /** @type {?} */ reversed = findFirstClosedCycle(keys.slice().reverse());\n        var /** @type {?} */ tokenStrs = reversed.map(function (k) { return stringify(k.token); });\n        return ' (' + tokenStrs.join(' -> ') + ')';\n    }\n    return '';\n}\n/**\n * @param {?} injector\n * @param {?} key\n * @param {?} constructResolvingMessage\n * @param {?=} originalError\n * @return {?}\n */\nfunction injectionError(injector, key, constructResolvingMessage, originalError) {\n    var /** @type {?} */ keys = [key];\n    var /** @type {?} */ errMsg = constructResolvingMessage(keys);\n    var /** @type {?} */ error = ((originalError ? wrappedError(errMsg, originalError) : Error(errMsg)));\n    error.addKey = addKey;\n    error.keys = keys;\n    error.injectors = [injector];\n    error.constructResolvingMessage = constructResolvingMessage;\n    ((error))[ERROR_ORIGINAL_ERROR] = originalError;\n    return error;\n}\n/**\n * @this {?}\n * @param {?} injector\n * @param {?} key\n * @return {?}\n */\nfunction addKey(injector, key) {\n    this.injectors.push(injector);\n    this.keys.push(key);\n    // Note: This updated message won't be reflected in the `.stack` property\n    this.message = this.constructResolvingMessage(this.keys);\n}\n/**\n * Thrown when trying to retrieve a dependency by key from {\\@link Injector}, but the\n * {\\@link Injector} does not have a {\\@link Provider} for the given key.\n *\n * ### Example ([live demo](http://plnkr.co/edit/vq8D3FRB9aGbnWJqtEPE?p=preview))\n *\n * ```typescript\n * class A {\n *   constructor(b:B) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n * @param {?} injector\n * @param {?} key\n * @return {?}\n */\nfunction noProviderError(injector, key) {\n    return injectionError(injector, key, function (keys) {\n        var /** @type {?} */ first = stringify(keys[0].token);\n        return \"No provider for \" + first + \"!\" + constructResolvingPath(keys);\n    });\n}\n/**\n * Thrown when dependencies form a cycle.\n *\n * ### Example ([live demo](http://plnkr.co/edit/wYQdNos0Tzql3ei1EV9j?p=info))\n *\n * ```typescript\n * var injector = Injector.resolveAndCreate([\n *   {provide: \"one\", useFactory: (two) => \"two\", deps: [[new Inject(\"two\")]]},\n *   {provide: \"two\", useFactory: (one) => \"one\", deps: [[new Inject(\"one\")]]}\n * ]);\n *\n * expect(() => injector.get(\"one\")).toThrowError();\n * ```\n *\n * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.\n * @param {?} injector\n * @param {?} key\n * @return {?}\n */\nfunction cyclicDependencyError(injector, key) {\n    return injectionError(injector, key, function (keys) {\n        return \"Cannot instantiate cyclic dependency!\" + constructResolvingPath(keys);\n    });\n}\n/**\n * Thrown when a constructing type returns with an Error.\n *\n * The `InstantiationError` class contains the original error plus the dependency graph which caused\n * this object to be instantiated.\n *\n * ### Example ([live demo](http://plnkr.co/edit/7aWYdcqTQsP0eNqEdUAf?p=preview))\n *\n * ```typescript\n * class A {\n *   constructor() {\n *     throw new Error('message');\n *   }\n * }\n *\n * var injector = Injector.resolveAndCreate([A]);\n * try {\n *   injector.get(A);\n * } catch (e) {\n *   expect(e instanceof InstantiationError).toBe(true);\n *   expect(e.originalException.message).toEqual(\"message\");\n *   expect(e.originalStack).toBeDefined();\n * }\n * ```\n * @param {?} injector\n * @param {?} originalException\n * @param {?} originalStack\n * @param {?} key\n * @return {?}\n */\nfunction instantiationError(injector, originalException, originalStack, key) {\n    return injectionError(injector, key, function (keys) {\n        var /** @type {?} */ first = stringify(keys[0].token);\n        return originalException.message + \": Error during instantiation of \" + first + \"!\" + constructResolvingPath(keys) + \".\";\n    }, originalException);\n}\n/**\n * Thrown when an object other then {\\@link Provider} (or `Type`) is passed to {\\@link Injector}\n * creation.\n *\n * ### Example ([live demo](http://plnkr.co/edit/YatCFbPAMCL0JSSQ4mvH?p=preview))\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\"not a type\"])).toThrowError();\n * ```\n * @param {?} provider\n * @return {?}\n */\nfunction invalidProviderError(provider) {\n    return Error(\"Invalid provider - only instances of Provider and Type are allowed, got: \" + provider);\n}\n/**\n * Thrown when the class has no annotation information.\n *\n * Lack of annotation information prevents the {\\@link Injector} from determining which dependencies\n * need to be injected into the constructor.\n *\n * ### Example ([live demo](http://plnkr.co/edit/rHnZtlNS7vJOPQ6pcVkm?p=preview))\n *\n * ```typescript\n * class A {\n *   constructor(b) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n *\n * This error is also thrown when the class not marked with {\\@link Injectable} has parameter types.\n *\n * ```typescript\n * class B {}\n *\n * class A {\n *   constructor(b:B) {} // no information about the parameter types of A is available at runtime.\n * }\n *\n * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();\n * ```\n * \\@stable\n * @param {?} typeOrFunc\n * @param {?} params\n * @return {?}\n */\nfunction noAnnotationError(typeOrFunc, params) {\n    var /** @type {?} */ signature = [];\n    for (var /** @type {?} */ i = 0, /** @type {?} */ ii = params.length; i < ii; i++) {\n        var /** @type {?} */ parameter = params[i];\n        if (!parameter || parameter.length == 0) {\n            signature.push('?');\n        }\n        else {\n            signature.push(parameter.map(stringify).join(' '));\n        }\n    }\n    return Error('Cannot resolve all parameters for \\'' + stringify(typeOrFunc) + '\\'(' +\n        signature.join(', ') + '). ' +\n        'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \\'' +\n        stringify(typeOrFunc) + '\\' is decorated with Injectable.');\n}\n/**\n * Thrown when getting an object by index.\n *\n * ### Example ([live demo](http://plnkr.co/edit/bRs0SX2OTQiJzqvjgl8P?p=preview))\n *\n * ```typescript\n * class A {}\n *\n * var injector = Injector.resolveAndCreate([A]);\n *\n * expect(() => injector.getAt(100)).toThrowError();\n * ```\n * \\@stable\n * @param {?} index\n * @return {?}\n */\nfunction outOfBoundsError(index) {\n    return Error(\"Index \" + index + \" is out-of-bounds.\");\n}\n/**\n * Thrown when a multi provider and a regular provider are bound to the same token.\n *\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\n *   { provide: \"Strings\", useValue: \"string1\", multi: true},\n *   { provide: \"Strings\", useValue: \"string2\", multi: false}\n * ])).toThrowError();\n * ```\n * @param {?} provider1\n * @param {?} provider2\n * @return {?}\n */\nfunction mixingMultiProvidersWithRegularProvidersError(provider1, provider2) {\n    return Error(\"Cannot mix multi providers and regular providers, got: \" + provider1 + \" \" + provider2);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A unique object used for retrieving items from the {\\@link ReflectiveInjector}.\n *\n * Keys have:\n * - a system-wide unique `id`.\n * - a `token`.\n *\n * `Key` is used internally by {\\@link ReflectiveInjector} because its system-wide unique `id` allows\n * the\n * injector to store created objects in a more efficient way.\n *\n * `Key` should not be created directly. {\\@link ReflectiveInjector} creates keys automatically when\n * resolving\n * providers.\n * \\@experimental\n */\nvar ReflectiveKey = (function () {\n    /**\n     * Private\n     * @param {?} token\n     * @param {?} id\n     */\n    function ReflectiveKey(token, id) {\n        this.token = token;\n        this.id = id;\n        if (!token) {\n            throw new Error('Token must be defined!');\n        }\n    }\n    Object.defineProperty(ReflectiveKey.prototype, \"displayName\", {\n        /**\n         * Returns a stringified token.\n         * @return {?}\n         */\n        get: function () { return stringify(this.token); },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * Retrieves a `Key` for a token.\n     * @param {?} token\n     * @return {?}\n     */\n    ReflectiveKey.get = function (token) {\n        return _globalKeyRegistry.get(resolveForwardRef(token));\n    };\n    Object.defineProperty(ReflectiveKey, \"numberOfKeys\", {\n        /**\n         * @return {?} the number of keys registered in the system.\n         */\n        get: function () { return _globalKeyRegistry.numberOfKeys; },\n        enumerable: true,\n        configurable: true\n    });\n    return ReflectiveKey;\n}());\n/**\n * \\@internal\n */\nvar KeyRegistry = (function () {\n    function KeyRegistry() {\n        this._allKeys = new Map();\n    }\n    /**\n     * @param {?} token\n     * @return {?}\n     */\n    KeyRegistry.prototype.get = function (token) {\n        if (token instanceof ReflectiveKey)\n            return token;\n        if (this._allKeys.has(token)) {\n            return ((this._allKeys.get(token)));\n        }\n        var /** @type {?} */ newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);\n        this._allKeys.set(token, newKey);\n        return newKey;\n    };\n    Object.defineProperty(KeyRegistry.prototype, \"numberOfKeys\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._allKeys.size; },\n        enumerable: true,\n        configurable: true\n    });\n    return KeyRegistry;\n}());\nvar _globalKeyRegistry = new KeyRegistry();\n/**\n * \\@whatItDoes Represents a type that a Component or other object is instances of.\n *\n * \\@description\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by\n * the `MyCustomComponent` constructor function.\n *\n * \\@stable\n */\nvar Type = Function;\n/**\n * @param {?} v\n * @return {?}\n */\nfunction isType(v) {\n    return typeof v === 'function';\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Attention: This regex has to hold even if the code is minified!\n */\nvar DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*arguments\\)/;\nvar ReflectionCapabilities = (function () {\n    /**\n     * @param {?=} reflect\n     */\n    function ReflectionCapabilities(reflect) {\n        this._reflect = reflect || _global['Reflect'];\n    }\n    /**\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.isReflectionEnabled = function () { return true; };\n    /**\n     * @template T\n     * @param {?} t\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.factory = function (t) { return function () {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        return new (t.bind.apply(t, [void 0].concat(args)))();\n    }; };\n    /**\n     * \\@internal\n     * @param {?} paramTypes\n     * @param {?} paramAnnotations\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype._zipTypesAndAnnotations = function (paramTypes, paramAnnotations) {\n        var /** @type {?} */ result;\n        if (typeof paramTypes === 'undefined') {\n            result = new Array(paramAnnotations.length);\n        }\n        else {\n            result = new Array(paramTypes.length);\n        }\n        for (var /** @type {?} */ i = 0; i < result.length; i++) {\n            // TS outputs Object for parameters without types, while Traceur omits\n            // the annotations. For now we preserve the Traceur behavior to aid\n            // migration, but this can be revisited.\n            if (typeof paramTypes === 'undefined') {\n                result[i] = [];\n            }\n            else if (paramTypes[i] != Object) {\n                result[i] = [paramTypes[i]];\n            }\n            else {\n                result[i] = [];\n            }\n            if (paramAnnotations && paramAnnotations[i] != null) {\n                result[i] = result[i].concat(paramAnnotations[i]);\n            }\n        }\n        return result;\n    };\n    /**\n     * @param {?} type\n     * @param {?} parentCtor\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype._ownParameters = function (type, parentCtor) {\n        // If we have no decorators, we only have function.length as metadata.\n        // In that case, to detect whether a child class declared an own constructor or not,\n        // we need to look inside of that constructor to check whether it is\n        // just calling the parent.\n        // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n        // that sets 'design:paramtypes' to []\n        // if a class inherits from another class but has no ctor declared itself.\n        if (DELEGATE_CTOR.exec(type.toString())) {\n            return null;\n        }\n        // Prefer the direct API.\n        if (((type)).parameters && ((type)).parameters !== parentCtor.parameters) {\n            return ((type)).parameters;\n        }\n        // API of tsickle for lowering decorators to properties on the class.\n        var /** @type {?} */ tsickleCtorParams = ((type)).ctorParameters;\n        if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n            // Newer tsickle uses a function closure\n            // Retain the non-function case for compatibility with older tsickle\n            var /** @type {?} */ ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n            var /** @type {?} */ paramTypes = ctorParameters.map(function (ctorParam) { return ctorParam && ctorParam.type; });\n            var /** @type {?} */ paramAnnotations = ctorParameters.map(function (ctorParam) { return ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators); });\n            return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n        }\n        // API for metadata created by invoking the decorators.\n        if (this._reflect != null && this._reflect.getOwnMetadata != null) {\n            var /** @type {?} */ paramAnnotations = this._reflect.getOwnMetadata('parameters', type);\n            var /** @type {?} */ paramTypes = this._reflect.getOwnMetadata('design:paramtypes', type);\n            if (paramTypes || paramAnnotations) {\n                return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n            }\n        }\n        // If a class has no decorators, at least create metadata\n        // based on function.length.\n        // Note: We know that this is a real constructor as we checked\n        // the content of the constructor above.\n        return new Array(((type.length))).fill(undefined);\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.parameters = function (type) {\n        // Note: only report metadata if we have at least one class decorator\n        // to stay in sync with the static reflector.\n        if (!isType(type)) {\n            return [];\n        }\n        var /** @type {?} */ parentCtor = getParentCtor(type);\n        var /** @type {?} */ parameters = this._ownParameters(type, parentCtor);\n        if (!parameters && parentCtor !== Object) {\n            parameters = this.parameters(parentCtor);\n        }\n        return parameters || [];\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @param {?} parentCtor\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype._ownAnnotations = function (typeOrFunc, parentCtor) {\n        // Prefer the direct API.\n        if (((typeOrFunc)).annotations && ((typeOrFunc)).annotations !== parentCtor.annotations) {\n            var /** @type {?} */ annotations = ((typeOrFunc)).annotations;\n            if (typeof annotations === 'function' && annotations.annotations) {\n                annotations = annotations.annotations;\n            }\n            return annotations;\n        }\n        // API of tsickle for lowering decorators to properties on the class.\n        if (((typeOrFunc)).decorators && ((typeOrFunc)).decorators !== parentCtor.decorators) {\n            return convertTsickleDecoratorIntoMetadata(((typeOrFunc)).decorators);\n        }\n        // API for metadata created by invoking the decorators.\n        if (this._reflect && this._reflect.getOwnMetadata) {\n            return this._reflect.getOwnMetadata('annotations', typeOrFunc);\n        }\n        return null;\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.annotations = function (typeOrFunc) {\n        if (!isType(typeOrFunc)) {\n            return [];\n        }\n        var /** @type {?} */ parentCtor = getParentCtor(typeOrFunc);\n        var /** @type {?} */ ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n        var /** @type {?} */ parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n        return parentAnnotations.concat(ownAnnotations);\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @param {?} parentCtor\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype._ownPropMetadata = function (typeOrFunc, parentCtor) {\n        // Prefer the direct API.\n        if (((typeOrFunc)).propMetadata &&\n            ((typeOrFunc)).propMetadata !== parentCtor.propMetadata) {\n            var /** @type {?} */ propMetadata = ((typeOrFunc)).propMetadata;\n            if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n                propMetadata = propMetadata.propMetadata;\n            }\n            return propMetadata;\n        }\n        // API of tsickle for lowering decorators to properties on the class.\n        if (((typeOrFunc)).propDecorators &&\n            ((typeOrFunc)).propDecorators !== parentCtor.propDecorators) {\n            var /** @type {?} */ propDecorators_1 = ((typeOrFunc)).propDecorators;\n            var /** @type {?} */ propMetadata_1 = ({});\n            Object.keys(propDecorators_1).forEach(function (prop) {\n                propMetadata_1[prop] = convertTsickleDecoratorIntoMetadata(propDecorators_1[prop]);\n            });\n            return propMetadata_1;\n        }\n        // API for metadata created by invoking the decorators.\n        if (this._reflect && this._reflect.getOwnMetadata) {\n            return this._reflect.getOwnMetadata('propMetadata', typeOrFunc);\n        }\n        return null;\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.propMetadata = function (typeOrFunc) {\n        if (!isType(typeOrFunc)) {\n            return {};\n        }\n        var /** @type {?} */ parentCtor = getParentCtor(typeOrFunc);\n        var /** @type {?} */ propMetadata = {};\n        if (parentCtor !== Object) {\n            var /** @type {?} */ parentPropMetadata_1 = this.propMetadata(parentCtor);\n            Object.keys(parentPropMetadata_1).forEach(function (propName) {\n                propMetadata[propName] = parentPropMetadata_1[propName];\n            });\n        }\n        var /** @type {?} */ ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n        if (ownPropMetadata) {\n            Object.keys(ownPropMetadata).forEach(function (propName) {\n                var /** @type {?} */ decorators = [];\n                if (propMetadata.hasOwnProperty(propName)) {\n                    decorators.push.apply(decorators, propMetadata[propName]);\n                }\n                decorators.push.apply(decorators, ownPropMetadata[propName]);\n                propMetadata[propName] = decorators;\n            });\n        }\n        return propMetadata;\n    };\n    /**\n     * @param {?} type\n     * @param {?} lcProperty\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.hasLifecycleHook = function (type, lcProperty) {\n        return type instanceof Type && lcProperty in type.prototype;\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.getter = function (name) { return (new Function('o', 'return o.' + name + ';')); };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.setter = function (name) {\n        return (new Function('o', 'v', 'return o.' + name + ' = v;'));\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.method = function (name) {\n        var /** @type {?} */ functionBody = \"if (!o.\" + name + \") throw new Error('\\\"\" + name + \"\\\" is undefined');\\n        return o.\" + name + \".apply(o, args);\";\n        return (new Function('o', 'args', functionBody));\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.importUri = function (type) {\n        // StaticSymbol\n        if (typeof type === 'object' && type['filePath']) {\n            return type['filePath'];\n        }\n        // Runtime type\n        return \"./\" + stringify(type);\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.resourceUri = function (type) { return \"./\" + stringify(type); };\n    /**\n     * @param {?} name\n     * @param {?} moduleUrl\n     * @param {?} members\n     * @param {?} runtime\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.resolveIdentifier = function (name, moduleUrl, members, runtime) {\n        return runtime;\n    };\n    /**\n     * @param {?} enumIdentifier\n     * @param {?} name\n     * @return {?}\n     */\n    ReflectionCapabilities.prototype.resolveEnum = function (enumIdentifier, name) { return enumIdentifier[name]; };\n    return ReflectionCapabilities;\n}());\n/**\n * @param {?} decoratorInvocations\n * @return {?}\n */\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n    if (!decoratorInvocations) {\n        return [];\n    }\n    return decoratorInvocations.map(function (decoratorInvocation) {\n        var /** @type {?} */ decoratorType = decoratorInvocation.type;\n        var /** @type {?} */ annotationCls = decoratorType.annotationCls;\n        var /** @type {?} */ annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n        return new (annotationCls.bind.apply(annotationCls, [void 0].concat(annotationArgs)))();\n    });\n}\n/**\n * @param {?} ctor\n * @return {?}\n */\nfunction getParentCtor(ctor) {\n    var /** @type {?} */ parentProto = Object.getPrototypeOf(ctor.prototype);\n    var /** @type {?} */ parentCtor = parentProto ? parentProto.constructor : null;\n    // Note: We always use `Object` as the null value\n    // to simplify checking later on.\n    return parentCtor || Object;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Provides access to reflection data about symbols. Used internally by Angular\n * to power dependency injection and compilation.\n */\nvar Reflector = (function () {\n    /**\n     * @param {?} reflectionCapabilities\n     */\n    function Reflector(reflectionCapabilities) {\n        this.reflectionCapabilities = reflectionCapabilities;\n    }\n    /**\n     * @param {?} caps\n     * @return {?}\n     */\n    Reflector.prototype.updateCapabilities = function (caps) { this.reflectionCapabilities = caps; };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    Reflector.prototype.factory = function (type) { return this.reflectionCapabilities.factory(type); };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    Reflector.prototype.parameters = function (typeOrFunc) {\n        return this.reflectionCapabilities.parameters(typeOrFunc);\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    Reflector.prototype.annotations = function (typeOrFunc) {\n        return this.reflectionCapabilities.annotations(typeOrFunc);\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    Reflector.prototype.propMetadata = function (typeOrFunc) {\n        return this.reflectionCapabilities.propMetadata(typeOrFunc);\n    };\n    /**\n     * @param {?} type\n     * @param {?} lcProperty\n     * @return {?}\n     */\n    Reflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n        return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    Reflector.prototype.getter = function (name) { return this.reflectionCapabilities.getter(name); };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    Reflector.prototype.setter = function (name) { return this.reflectionCapabilities.setter(name); };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    Reflector.prototype.method = function (name) { return this.reflectionCapabilities.method(name); };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    Reflector.prototype.importUri = function (type) { return this.reflectionCapabilities.importUri(type); };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    Reflector.prototype.resourceUri = function (type) { return this.reflectionCapabilities.resourceUri(type); };\n    /**\n     * @param {?} name\n     * @param {?} moduleUrl\n     * @param {?} members\n     * @param {?} runtime\n     * @return {?}\n     */\n    Reflector.prototype.resolveIdentifier = function (name, moduleUrl, members, runtime) {\n        return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);\n    };\n    /**\n     * @param {?} identifier\n     * @param {?} name\n     * @return {?}\n     */\n    Reflector.prototype.resolveEnum = function (identifier, name) {\n        return this.reflectionCapabilities.resolveEnum(identifier, name);\n    };\n    return Reflector;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * The {\\@link Reflector} used internally in Angular to access metadata\n * about symbols.\n */\nvar reflector = new Reflector(new ReflectionCapabilities());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * `Dependency` is used by the framework to extend DI.\n * This is internal to Angular and should not be used directly.\n */\nvar ReflectiveDependency = (function () {\n    /**\n     * @param {?} key\n     * @param {?} optional\n     * @param {?} visibility\n     */\n    function ReflectiveDependency(key, optional, visibility) {\n        this.key = key;\n        this.optional = optional;\n        this.visibility = visibility;\n    }\n    /**\n     * @param {?} key\n     * @return {?}\n     */\n    ReflectiveDependency.fromKey = function (key) {\n        return new ReflectiveDependency(key, false, null);\n    };\n    return ReflectiveDependency;\n}());\nvar _EMPTY_LIST = [];\nvar ResolvedReflectiveProvider_ = (function () {\n    /**\n     * @param {?} key\n     * @param {?} resolvedFactories\n     * @param {?} multiProvider\n     */\n    function ResolvedReflectiveProvider_(key, resolvedFactories, multiProvider) {\n        this.key = key;\n        this.resolvedFactories = resolvedFactories;\n        this.multiProvider = multiProvider;\n    }\n    Object.defineProperty(ResolvedReflectiveProvider_.prototype, \"resolvedFactory\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.resolvedFactories[0]; },\n        enumerable: true,\n        configurable: true\n    });\n    return ResolvedReflectiveProvider_;\n}());\n/**\n * An internal resolved representation of a factory function created by resolving {\\@link\n * Provider}.\n * \\@experimental\n */\nvar ResolvedReflectiveFactory = (function () {\n    /**\n     * @param {?} factory\n     * @param {?} dependencies\n     */\n    function ResolvedReflectiveFactory(factory, dependencies) {\n        this.factory = factory;\n        this.dependencies = dependencies;\n    }\n    return ResolvedReflectiveFactory;\n}());\n/**\n * Resolve a single provider.\n * @param {?} provider\n * @return {?}\n */\nfunction resolveReflectiveFactory(provider) {\n    var /** @type {?} */ factoryFn;\n    var /** @type {?} */ resolvedDeps;\n    if (provider.useClass) {\n        var /** @type {?} */ useClass = resolveForwardRef(provider.useClass);\n        factoryFn = reflector.factory(useClass);\n        resolvedDeps = _dependenciesFor(useClass);\n    }\n    else if (provider.useExisting) {\n        factoryFn = function (aliasInstance) { return aliasInstance; };\n        resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n    }\n    else if (provider.useFactory) {\n        factoryFn = provider.useFactory;\n        resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n    }\n    else {\n        factoryFn = function () { return provider.useValue; };\n        resolvedDeps = _EMPTY_LIST;\n    }\n    return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}\n/**\n * Converts the {\\@link Provider} into {\\@link ResolvedProvider}.\n *\n * {\\@link Injector} internally only uses {\\@link ResolvedProvider}, {\\@link Provider} contains\n * convenience provider syntax.\n * @param {?} provider\n * @return {?}\n */\nfunction resolveReflectiveProvider(provider) {\n    return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}\n/**\n * Resolve a list of Providers.\n * @param {?} providers\n * @return {?}\n */\nfunction resolveReflectiveProviders(providers) {\n    var /** @type {?} */ normalized = _normalizeProviders(providers, []);\n    var /** @type {?} */ resolved = normalized.map(resolveReflectiveProvider);\n    var /** @type {?} */ resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n    return Array.from(resolvedProviderMap.values());\n}\n/**\n * Merges a list of ResolvedProviders into a list where\n * each key is contained exactly once and multi providers\n * have been merged.\n * @param {?} providers\n * @param {?} normalizedProvidersMap\n * @return {?}\n */\nfunction mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n    for (var /** @type {?} */ i = 0; i < providers.length; i++) {\n        var /** @type {?} */ provider = providers[i];\n        var /** @type {?} */ existing = normalizedProvidersMap.get(provider.key.id);\n        if (existing) {\n            if (provider.multiProvider !== existing.multiProvider) {\n                throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n            }\n            if (provider.multiProvider) {\n                for (var /** @type {?} */ j = 0; j < provider.resolvedFactories.length; j++) {\n                    existing.resolvedFactories.push(provider.resolvedFactories[j]);\n                }\n            }\n            else {\n                normalizedProvidersMap.set(provider.key.id, provider);\n            }\n        }\n        else {\n            var /** @type {?} */ resolvedProvider = void 0;\n            if (provider.multiProvider) {\n                resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n            }\n            else {\n                resolvedProvider = provider;\n            }\n            normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n        }\n    }\n    return normalizedProvidersMap;\n}\n/**\n * @param {?} providers\n * @param {?} res\n * @return {?}\n */\nfunction _normalizeProviders(providers, res) {\n    providers.forEach(function (b) {\n        if (b instanceof Type) {\n            res.push({ provide: b, useClass: b });\n        }\n        else if (b && typeof b == 'object' && ((b)).provide !== undefined) {\n            res.push(/** @type {?} */ (b));\n        }\n        else if (b instanceof Array) {\n            _normalizeProviders(b, res);\n        }\n        else {\n            throw invalidProviderError(b);\n        }\n    });\n    return res;\n}\n/**\n * @param {?} typeOrFunc\n * @param {?=} dependencies\n * @return {?}\n */\nfunction constructDependencies(typeOrFunc, dependencies) {\n    if (!dependencies) {\n        return _dependenciesFor(typeOrFunc);\n    }\n    else {\n        var /** @type {?} */ params_1 = dependencies.map(function (t) { return [t]; });\n        return dependencies.map(function (t) { return _extractToken(typeOrFunc, t, params_1); });\n    }\n}\n/**\n * @param {?} typeOrFunc\n * @return {?}\n */\nfunction _dependenciesFor(typeOrFunc) {\n    var /** @type {?} */ params = reflector.parameters(typeOrFunc);\n    if (!params)\n        return [];\n    if (params.some(function (p) { return p == null; })) {\n        throw noAnnotationError(typeOrFunc, params);\n    }\n    return params.map(function (p) { return _extractToken(typeOrFunc, p, params); });\n}\n/**\n * @param {?} typeOrFunc\n * @param {?} metadata\n * @param {?} params\n * @return {?}\n */\nfunction _extractToken(typeOrFunc, metadata, params) {\n    var /** @type {?} */ token = null;\n    var /** @type {?} */ optional = false;\n    if (!Array.isArray(metadata)) {\n        if (metadata instanceof Inject) {\n            return _createDependency(metadata.token, optional, null);\n        }\n        else {\n            return _createDependency(metadata, optional, null);\n        }\n    }\n    var /** @type {?} */ visibility = null;\n    for (var /** @type {?} */ i = 0; i < metadata.length; ++i) {\n        var /** @type {?} */ paramMetadata = metadata[i];\n        if (paramMetadata instanceof Type) {\n            token = paramMetadata;\n        }\n        else if (paramMetadata instanceof Inject) {\n            token = paramMetadata.token;\n        }\n        else if (paramMetadata instanceof Optional) {\n            optional = true;\n        }\n        else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {\n            visibility = paramMetadata;\n        }\n        else if (paramMetadata instanceof InjectionToken) {\n            token = paramMetadata;\n        }\n    }\n    token = resolveForwardRef(token);\n    if (token != null) {\n        return _createDependency(token, optional, visibility);\n    }\n    else {\n        throw noAnnotationError(typeOrFunc, params);\n    }\n}\n/**\n * @param {?} token\n * @param {?} optional\n * @param {?} visibility\n * @return {?}\n */\nfunction _createDependency(token, optional, visibility) {\n    return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// Threshold for the dynamic version\nvar UNDEFINED = new Object();\n/**\n * A ReflectiveDependency injection container used for instantiating objects and resolving\n * dependencies.\n *\n * An `Injector` is a replacement for a `new` operator, which can automatically resolve the\n * constructor dependencies.\n *\n * In typical use, application code asks for the dependencies in the constructor and they are\n * resolved by the `Injector`.\n *\n * ### Example ([live demo](http://plnkr.co/edit/jzjec0?p=preview))\n *\n * The following example creates an `Injector` configured to create `Engine` and `Car`.\n *\n * ```typescript\n * \\@Injectable()\n * class Engine {\n * }\n *\n * \\@Injectable()\n * class Car {\n *   constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * var car = injector.get(Car);\n * expect(car instanceof Car).toBe(true);\n * expect(car.engine instanceof Engine).toBe(true);\n * ```\n *\n * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`\n * resolve all of the object's dependencies automatically.\n *\n * \\@stable\n * @abstract\n */\nvar ReflectiveInjector = (function () {\n    function ReflectiveInjector() {\n    }\n    /**\n     * Turns an array of provider definitions into an array of resolved providers.\n     *\n     * A resolution is a process of flattening multiple nested arrays and converting individual\n     * providers into an array of {\\@link ResolvedReflectiveProvider}s.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/AiXTHi?p=preview))\n     *\n     * ```typescript\n     * \\@Injectable()\n     * class Engine {\n     * }\n     *\n     * \\@Injectable()\n     * class Car {\n     *   constructor(public engine:Engine) {}\n     * }\n     *\n     * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);\n     *\n     * expect(providers.length).toEqual(2);\n     *\n     * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);\n     * expect(providers[0].key.displayName).toBe(\"Car\");\n     * expect(providers[0].dependencies.length).toEqual(1);\n     * expect(providers[0].factory).toBeDefined();\n     *\n     * expect(providers[1].key.displayName).toBe(\"Engine\");\n     * });\n     * ```\n     *\n     * See {\\@link ReflectiveInjector#fromResolvedProviders} for more info.\n     * @param {?} providers\n     * @return {?}\n     */\n    ReflectiveInjector.resolve = function (providers) {\n        return resolveReflectiveProviders(providers);\n    };\n    /**\n     * Resolves an array of providers and creates an injector from those providers.\n     *\n     * The passed-in providers can be an array of `Type`, {\\@link Provider},\n     * or a recursive array of more providers.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))\n     *\n     * ```typescript\n     * \\@Injectable()\n     * class Engine {\n     * }\n     *\n     * \\@Injectable()\n     * class Car {\n     *   constructor(public engine:Engine) {}\n     * }\n     *\n     * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n     * expect(injector.get(Car) instanceof Car).toBe(true);\n     * ```\n     *\n     * This function is slower than the corresponding `fromResolvedProviders`\n     * because it needs to resolve the passed-in providers first.\n     * See {\\@link ReflectiveInjector#resolve} and {\\@link ReflectiveInjector#fromResolvedProviders}.\n     * @param {?} providers\n     * @param {?=} parent\n     * @return {?}\n     */\n    ReflectiveInjector.resolveAndCreate = function (providers, parent) {\n        var /** @type {?} */ ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n        return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);\n    };\n    /**\n     * Creates an injector from previously resolved providers.\n     *\n     * This API is the recommended way to construct injectors in performance-sensitive parts.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))\n     *\n     * ```typescript\n     * \\@Injectable()\n     * class Engine {\n     * }\n     *\n     * \\@Injectable()\n     * class Car {\n     *   constructor(public engine:Engine) {}\n     * }\n     *\n     * var providers = ReflectiveInjector.resolve([Car, Engine]);\n     * var injector = ReflectiveInjector.fromResolvedProviders(providers);\n     * expect(injector.get(Car) instanceof Car).toBe(true);\n     * ```\n     * \\@experimental\n     * @param {?} providers\n     * @param {?=} parent\n     * @return {?}\n     */\n    ReflectiveInjector.fromResolvedProviders = function (providers, parent) {\n        return new ReflectiveInjector_(providers, parent);\n    };\n    /**\n     * Parent of this injector.\n     *\n     * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n     * -->\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/eosMGo?p=preview))\n     *\n     * ```typescript\n     * var parent = ReflectiveInjector.resolveAndCreate([]);\n     * var child = parent.resolveAndCreateChild([]);\n     * expect(child.parent).toBe(parent);\n     * ```\n     * @abstract\n     * @return {?}\n     */\n    ReflectiveInjector.prototype.parent = function () { };\n    /**\n     * Resolves an array of providers and creates a child injector from those providers.\n     *\n     * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n     * -->\n     *\n     * The passed-in providers can be an array of `Type`, {\\@link Provider},\n     * or a recursive array of more providers.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/opB3T4?p=preview))\n     *\n     * ```typescript\n     * class ParentProvider {}\n     * class ChildProvider {}\n     *\n     * var parent = ReflectiveInjector.resolveAndCreate([ParentProvider]);\n     * var child = parent.resolveAndCreateChild([ChildProvider]);\n     *\n     * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n     * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n     * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n     * ```\n     *\n     * This function is slower than the corresponding `createChildFromResolved`\n     * because it needs to resolve the passed-in providers first.\n     * See {\\@link ReflectiveInjector#resolve} and {\\@link ReflectiveInjector#createChildFromResolved}.\n     * @abstract\n     * @param {?} providers\n     * @return {?}\n     */\n    ReflectiveInjector.prototype.resolveAndCreateChild = function (providers) { };\n    /**\n     * Creates a child injector from previously resolved providers.\n     *\n     * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n     * -->\n     *\n     * This API is the recommended way to construct injectors in performance-sensitive parts.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/VhyfjN?p=preview))\n     *\n     * ```typescript\n     * class ParentProvider {}\n     * class ChildProvider {}\n     *\n     * var parentProviders = ReflectiveInjector.resolve([ParentProvider]);\n     * var childProviders = ReflectiveInjector.resolve([ChildProvider]);\n     *\n     * var parent = ReflectiveInjector.fromResolvedProviders(parentProviders);\n     * var child = parent.createChildFromResolved(childProviders);\n     *\n     * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n     * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n     * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n     * ```\n     * @abstract\n     * @param {?} providers\n     * @return {?}\n     */\n    ReflectiveInjector.prototype.createChildFromResolved = function (providers) { };\n    /**\n     * Resolves a provider and instantiates an object in the context of the injector.\n     *\n     * The created object does not get cached by the injector.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/yvVXoB?p=preview))\n     *\n     * ```typescript\n     * \\@Injectable()\n     * class Engine {\n     * }\n     *\n     * \\@Injectable()\n     * class Car {\n     *   constructor(public engine:Engine) {}\n     * }\n     *\n     * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n     *\n     * var car = injector.resolveAndInstantiate(Car);\n     * expect(car.engine).toBe(injector.get(Engine));\n     * expect(car).not.toBe(injector.resolveAndInstantiate(Car));\n     * ```\n     * @abstract\n     * @param {?} provider\n     * @return {?}\n     */\n    ReflectiveInjector.prototype.resolveAndInstantiate = function (provider) { };\n    /**\n     * Instantiates an object using a resolved provider in the context of the injector.\n     *\n     * The created object does not get cached by the injector.\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/ptCImQ?p=preview))\n     *\n     * ```typescript\n     * \\@Injectable()\n     * class Engine {\n     * }\n     *\n     * \\@Injectable()\n     * class Car {\n     *   constructor(public engine:Engine) {}\n     * }\n     *\n     * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n     * var carProvider = ReflectiveInjector.resolve([Car])[0];\n     * var car = injector.instantiateResolved(carProvider);\n     * expect(car.engine).toBe(injector.get(Engine));\n     * expect(car).not.toBe(injector.instantiateResolved(carProvider));\n     * ```\n     * @abstract\n     * @param {?} provider\n     * @return {?}\n     */\n    ReflectiveInjector.prototype.instantiateResolved = function (provider) { };\n    /**\n     * @abstract\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    ReflectiveInjector.prototype.get = function (token, notFoundValue) { };\n    return ReflectiveInjector;\n}());\nvar ReflectiveInjector_ = (function () {\n    /**\n     * Private\n     * @param {?} _providers\n     * @param {?=} _parent\n     */\n    function ReflectiveInjector_(_providers, _parent) {\n        /**\n         * \\@internal\n         */\n        this._constructionCounter = 0;\n        this._providers = _providers;\n        this._parent = _parent || null;\n        var len = _providers.length;\n        this.keyIds = new Array(len);\n        this.objs = new Array(len);\n        for (var i = 0; i < len; i++) {\n            this.keyIds[i] = _providers[i].key.id;\n            this.objs[i] = UNDEFINED;\n        }\n    }\n    /**\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.get = function (token, notFoundValue) {\n        if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }\n        return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);\n    };\n    Object.defineProperty(ReflectiveInjector_.prototype, \"parent\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._parent; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} providers\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.resolveAndCreateChild = function (providers) {\n        var /** @type {?} */ ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n        return this.createChildFromResolved(ResolvedReflectiveProviders);\n    };\n    /**\n     * @param {?} providers\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.createChildFromResolved = function (providers) {\n        var /** @type {?} */ inj = new ReflectiveInjector_(providers);\n        inj._parent = this;\n        return inj;\n    };\n    /**\n     * @param {?} provider\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.resolveAndInstantiate = function (provider) {\n        return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);\n    };\n    /**\n     * @param {?} provider\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.instantiateResolved = function (provider) {\n        return this._instantiateProvider(provider);\n    };\n    /**\n     * @param {?} index\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.getProviderAtIndex = function (index) {\n        if (index < 0 || index >= this._providers.length) {\n            throw outOfBoundsError(index);\n        }\n        return this._providers[index];\n    };\n    /**\n     * \\@internal\n     * @param {?} provider\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._new = function (provider) {\n        if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {\n            throw cyclicDependencyError(this, provider.key);\n        }\n        return this._instantiateProvider(provider);\n    };\n    /**\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._getMaxNumberOfObjects = function () { return this.objs.length; };\n    /**\n     * @param {?} provider\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._instantiateProvider = function (provider) {\n        if (provider.multiProvider) {\n            var /** @type {?} */ res = new Array(provider.resolvedFactories.length);\n            for (var /** @type {?} */ i = 0; i < provider.resolvedFactories.length; ++i) {\n                res[i] = this._instantiate(provider, provider.resolvedFactories[i]);\n            }\n            return res;\n        }\n        else {\n            return this._instantiate(provider, provider.resolvedFactories[0]);\n        }\n    };\n    /**\n     * @param {?} provider\n     * @param {?} ResolvedReflectiveFactory\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._instantiate = function (provider, ResolvedReflectiveFactory$$1) {\n        var _this = this;\n        var /** @type {?} */ factory = ResolvedReflectiveFactory$$1.factory;\n        var /** @type {?} */ deps;\n        try {\n            deps =\n                ResolvedReflectiveFactory$$1.dependencies.map(function (dep) { return _this._getByReflectiveDependency(dep); });\n        }\n        catch (e) {\n            if (e.addKey) {\n                e.addKey(this, provider.key);\n            }\n            throw e;\n        }\n        var /** @type {?} */ obj;\n        try {\n            obj = factory.apply(void 0, deps);\n        }\n        catch (e) {\n            throw instantiationError(this, e, e.stack, provider.key);\n        }\n        return obj;\n    };\n    /**\n     * @param {?} dep\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._getByReflectiveDependency = function (dep) {\n        return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);\n    };\n    /**\n     * @param {?} key\n     * @param {?} visibility\n     * @param {?} notFoundValue\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._getByKey = function (key, visibility, notFoundValue) {\n        if (key === INJECTOR_KEY) {\n            return this;\n        }\n        if (visibility instanceof Self) {\n            return this._getByKeySelf(key, notFoundValue);\n        }\n        else {\n            return this._getByKeyDefault(key, notFoundValue, visibility);\n        }\n    };\n    /**\n     * @param {?} keyId\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._getObjByKeyId = function (keyId) {\n        for (var /** @type {?} */ i = 0; i < this.keyIds.length; i++) {\n            if (this.keyIds[i] === keyId) {\n                if (this.objs[i] === UNDEFINED) {\n                    this.objs[i] = this._new(this._providers[i]);\n                }\n                return this.objs[i];\n            }\n        }\n        return UNDEFINED;\n    };\n    /**\n     * \\@internal\n     * @param {?} key\n     * @param {?} notFoundValue\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._throwOrNull = function (key, notFoundValue) {\n        if (notFoundValue !== THROW_IF_NOT_FOUND) {\n            return notFoundValue;\n        }\n        else {\n            throw noProviderError(this, key);\n        }\n    };\n    /**\n     * \\@internal\n     * @param {?} key\n     * @param {?} notFoundValue\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._getByKeySelf = function (key, notFoundValue) {\n        var /** @type {?} */ obj = this._getObjByKeyId(key.id);\n        return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);\n    };\n    /**\n     * \\@internal\n     * @param {?} key\n     * @param {?} notFoundValue\n     * @param {?} visibility\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype._getByKeyDefault = function (key, notFoundValue, visibility) {\n        var /** @type {?} */ inj;\n        if (visibility instanceof SkipSelf) {\n            inj = this._parent;\n        }\n        else {\n            inj = this;\n        }\n        while (inj instanceof ReflectiveInjector_) {\n            var /** @type {?} */ inj_ = (inj);\n            var /** @type {?} */ obj = inj_._getObjByKeyId(key.id);\n            if (obj !== UNDEFINED)\n                return obj;\n            inj = inj_._parent;\n        }\n        if (inj !== null) {\n            return inj.get(key.token, notFoundValue);\n        }\n        else {\n            return this._throwOrNull(key, notFoundValue);\n        }\n    };\n    Object.defineProperty(ReflectiveInjector_.prototype, \"displayName\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ providers = _mapProviders(this, function (b) { return ' \"' + b.key.displayName + '\" '; })\n                .join(', ');\n            return \"ReflectiveInjector(providers: [\" + providers + \"])\";\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    ReflectiveInjector_.prototype.toString = function () { return this.displayName; };\n    return ReflectiveInjector_;\n}());\nvar INJECTOR_KEY = ReflectiveKey.get(Injector);\n/**\n * @param {?} injector\n * @param {?} fn\n * @return {?}\n */\nfunction _mapProviders(injector, fn) {\n    var /** @type {?} */ res = new Array(injector._providers.length);\n    for (var /** @type {?} */ i = 0; i < injector._providers.length; ++i) {\n        res[i] = fn(injector.getProviderAtIndex(i));\n    }\n    return res;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Determine if the argument is shaped like a Promise\n * @param {?} obj\n * @return {?}\n */\nfunction isPromise(obj) {\n    // allow any Promise/A+ compliant thenable.\n    // It's up to the caller to ensure that obj.then conforms to the spec\n    return !!obj && typeof obj.then === 'function';\n}\n/**\n * Determine if the argument is an Observable\n * @param {?} obj\n * @return {?}\n */\nfunction isObservable(obj) {\n    // TODO use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved\n    return !!obj && typeof obj.subscribe === 'function';\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A function that will be executed when an application is initialized.\n * \\@experimental\n */\nvar APP_INITIALIZER = new InjectionToken('Application Initializer');\n/**\n * A class that reflects the state of running {\\@link APP_INITIALIZER}s.\n *\n * \\@experimental\n */\nvar ApplicationInitStatus = (function () {\n    /**\n     * @param {?} appInits\n     */\n    function ApplicationInitStatus(appInits) {\n        var _this = this;\n        this.appInits = appInits;\n        this.initialized = false;\n        this._done = false;\n        this._donePromise = new Promise(function (res, rej) {\n            _this.resolve = res;\n            _this.reject = rej;\n        });\n    }\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    ApplicationInitStatus.prototype.runInitializers = function () {\n        var _this = this;\n        if (this.initialized) {\n            return;\n        }\n        var /** @type {?} */ asyncInitPromises = [];\n        var /** @type {?} */ complete = function () {\n            _this._done = true;\n            _this.resolve();\n        };\n        if (this.appInits) {\n            for (var /** @type {?} */ i = 0; i < this.appInits.length; i++) {\n                var /** @type {?} */ initResult = this.appInits[i]();\n                if (isPromise(initResult)) {\n                    asyncInitPromises.push(initResult);\n                }\n            }\n        }\n        Promise.all(asyncInitPromises).then(function () { complete(); }).catch(function (e) { _this.reject(e); });\n        if (asyncInitPromises.length === 0) {\n            complete();\n        }\n        this.initialized = true;\n    };\n    Object.defineProperty(ApplicationInitStatus.prototype, \"done\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._done; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ApplicationInitStatus.prototype, \"donePromise\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._donePromise; },\n        enumerable: true,\n        configurable: true\n    });\n    return ApplicationInitStatus;\n}());\nApplicationInitStatus.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nApplicationInitStatus.ctorParameters = function () { return [\n    { type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A DI Token representing a unique string id assigned to the application by Angular and used\n * primarily for prefixing application attributes and CSS styles when\n * {\\@link ViewEncapsulation#Emulated} is being used.\n *\n * If you need to avoid randomly generated value to be used as an application id, you can provide\n * a custom value via a DI provider <!-- TODO: provider --> configuring the root {\\@link Injector}\n * using this token.\n * \\@experimental\n */\nvar APP_ID = new InjectionToken('AppId');\n/**\n * @return {?}\n */\nfunction _appIdRandomProviderFactory() {\n    return \"\" + _randomChar() + _randomChar() + _randomChar();\n}\n/**\n * Providers that will generate a random APP_ID_TOKEN.\n * \\@experimental\n */\nvar APP_ID_RANDOM_PROVIDER = {\n    provide: APP_ID,\n    useFactory: _appIdRandomProviderFactory,\n    deps: [],\n};\n/**\n * @return {?}\n */\nfunction _randomChar() {\n    return String.fromCharCode(97 + Math.floor(Math.random() * 25));\n}\n/**\n * A function that will be executed when a platform is initialized.\n * \\@experimental\n */\nvar PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');\n/**\n * A token that indicates an opaque platform id.\n * \\@experimental\n */\nvar PLATFORM_ID = new InjectionToken('Platform ID');\n/**\n * All callbacks provided via this token will be called for every component that is bootstrapped.\n * Signature of the callback:\n *\n * `(componentRef: ComponentRef) => void`.\n *\n * \\@experimental\n */\nvar APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');\n/**\n * A token which indicates the root directory of the application\n * \\@experimental\n */\nvar PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar Console = (function () {\n    function Console() {\n    }\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Console.prototype.log = function (message) {\n        // tslint:disable-next-line:no-console\n        console.log(message);\n    };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Console.prototype.warn = function (message) {\n        // tslint:disable-next-line:no-console\n        console.warn(message);\n    };\n    return Console;\n}());\nConsole.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nConsole.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Combination of NgModuleFactory and ComponentFactorys.\n *\n * \\@experimental\n */\nvar ModuleWithComponentFactories = (function () {\n    /**\n     * @param {?} ngModuleFactory\n     * @param {?} componentFactories\n     */\n    function ModuleWithComponentFactories(ngModuleFactory, componentFactories) {\n        this.ngModuleFactory = ngModuleFactory;\n        this.componentFactories = componentFactories;\n    }\n    return ModuleWithComponentFactories;\n}());\n/**\n * @return {?}\n */\nfunction _throwError() {\n    throw new Error(\"Runtime compiler is not loaded\");\n}\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {\\@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `\\@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n * \\@stable\n */\nvar Compiler = (function () {\n    function Compiler() {\n    }\n    /**\n     * Compiles the given NgModule and all of its components. All templates of the components listed\n     * in `entryComponents` have to be inlined.\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    Compiler.prototype.compileModuleSync = function (moduleType) { throw _throwError(); };\n    /**\n     * Compiles the given NgModule and all of its components\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    Compiler.prototype.compileModuleAsync = function (moduleType) { throw _throwError(); };\n    /**\n     * Same as {\\@link #compileModuleSync} but also creates ComponentFactories for all components.\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    Compiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {\n        throw _throwError();\n    };\n    /**\n     * Same as {\\@link #compileModuleAsync} but also creates ComponentFactories for all components.\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    Compiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {\n        throw _throwError();\n    };\n    /**\n     * Exposes the CSS-style selectors that have been used in `ngContent` directives within\n     * the template of the given component.\n     * This is used by the `upgrade` library to compile the appropriate transclude content\n     * in the AngularJS wrapper component.\n     *\n     * @deprecated since v4. Use ComponentFactory.ngContentSelectors instead.\n     * @param {?} component\n     * @return {?}\n     */\n    Compiler.prototype.getNgContentSelectors = function (component) { throw _throwError(); };\n    /**\n     * Clears all caches.\n     * @return {?}\n     */\n    Compiler.prototype.clearCache = function () { };\n    /**\n     * Clears the cache for the given component/ngModule.\n     * @param {?} type\n     * @return {?}\n     */\n    Compiler.prototype.clearCacheFor = function (type) { };\n    return Compiler;\n}());\nCompiler.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nCompiler.ctorParameters = function () { return []; };\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * \\@experimental\n */\nvar COMPILER_OPTIONS = new InjectionToken('compilerOptions');\n/**\n * A factory for creating a Compiler\n *\n * \\@experimental\n * @abstract\n */\nvar CompilerFactory = (function () {\n    function CompilerFactory() {\n    }\n    /**\n     * @abstract\n     * @param {?=} options\n     * @return {?}\n     */\n    CompilerFactory.prototype.createCompiler = function (options) { };\n    return CompilerFactory;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Represents an instance of a Component created via a {\\@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {\\@link #destroy}\n * method.\n * \\@stable\n * @abstract\n */\nvar ComponentRef = (function () {\n    function ComponentRef() {\n    }\n    /**\n     * Location of the Host Element of this Component Instance.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.location = function () { };\n    /**\n     * The injector on which the component instance exists.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.injector = function () { };\n    /**\n     * The instance of the Component.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.instance = function () { };\n    /**\n     * The {\\@link ViewRef} of the Host View of this Component instance.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.hostView = function () { };\n    /**\n     * The {\\@link ChangeDetectorRef} of the Component instance.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.changeDetectorRef = function () { };\n    /**\n     * The component type.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.componentType = function () { };\n    /**\n     * Destroys the component instance and all of the data structures associated with it.\n     * @abstract\n     * @return {?}\n     */\n    ComponentRef.prototype.destroy = function () { };\n    /**\n     * Allows to register a callback that will be called when the component is destroyed.\n     * @abstract\n     * @param {?} callback\n     * @return {?}\n     */\n    ComponentRef.prototype.onDestroy = function (callback) { };\n    return ComponentRef;\n}());\n/**\n * \\@stable\n * @abstract\n */\nvar ComponentFactory = (function () {\n    function ComponentFactory() {\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ComponentFactory.prototype.selector = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ComponentFactory.prototype.componentType = function () { };\n    /**\n     * selector for all <ng-content> elements in the component.\n     * @abstract\n     * @return {?}\n     */\n    ComponentFactory.prototype.ngContentSelectors = function () { };\n    /**\n     * the inputs of the component.\n     * @abstract\n     * @return {?}\n     */\n    ComponentFactory.prototype.inputs = function () { };\n    /**\n     * the outputs of the component.\n     * @abstract\n     * @return {?}\n     */\n    ComponentFactory.prototype.outputs = function () { };\n    /**\n     * Creates a new component.\n     * @abstract\n     * @param {?} injector\n     * @param {?=} projectableNodes\n     * @param {?=} rootSelectorOrNode\n     * @param {?=} ngModule\n     * @return {?}\n     */\n    ComponentFactory.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) { };\n    return ComponentFactory;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} component\n * @return {?}\n */\nfunction noComponentFactoryError(component) {\n    var /** @type {?} */ error = Error(\"No component factory found for \" + stringify(component) + \". Did you add it to @NgModule.entryComponents?\");\n    ((error))[ERROR_COMPONENT] = component;\n    return error;\n}\nvar ERROR_COMPONENT = 'ngComponent';\n/**\n * @param {?} error\n * @return {?}\n */\nvar _NullComponentFactoryResolver = (function () {\n    function _NullComponentFactoryResolver() {\n    }\n    /**\n     * @template T\n     * @param {?} component\n     * @return {?}\n     */\n    _NullComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {\n        throw noComponentFactoryError(component);\n    };\n    return _NullComponentFactoryResolver;\n}());\n/**\n * \\@stable\n * @abstract\n */\nvar ComponentFactoryResolver = (function () {\n    function ComponentFactoryResolver() {\n    }\n    /**\n     * @abstract\n     * @template T\n     * @param {?} component\n     * @return {?}\n     */\n    ComponentFactoryResolver.prototype.resolveComponentFactory = function (component) { };\n    return ComponentFactoryResolver;\n}());\nComponentFactoryResolver.NULL = new _NullComponentFactoryResolver();\nvar CodegenComponentFactoryResolver = (function () {\n    /**\n     * @param {?} factories\n     * @param {?} _parent\n     * @param {?} _ngModule\n     */\n    function CodegenComponentFactoryResolver(factories, _parent, _ngModule) {\n        this._parent = _parent;\n        this._ngModule = _ngModule;\n        this._factories = new Map();\n        for (var i = 0; i < factories.length; i++) {\n            var factory = factories[i];\n            this._factories.set(factory.componentType, factory);\n        }\n    }\n    /**\n     * @template T\n     * @param {?} component\n     * @return {?}\n     */\n    CodegenComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {\n        var /** @type {?} */ factory = this._factories.get(component);\n        if (!factory && this._parent) {\n            factory = this._parent.resolveComponentFactory(component);\n        }\n        if (!factory) {\n            throw noComponentFactoryError(component);\n        }\n        return new ComponentFactoryBoundToModule(factory, this._ngModule);\n    };\n    return CodegenComponentFactoryResolver;\n}());\nvar ComponentFactoryBoundToModule = (function (_super) {\n    __extends(ComponentFactoryBoundToModule, _super);\n    /**\n     * @param {?} factory\n     * @param {?} ngModule\n     */\n    function ComponentFactoryBoundToModule(factory, ngModule) {\n        var _this = _super.call(this) || this;\n        _this.factory = factory;\n        _this.ngModule = ngModule;\n        return _this;\n    }\n    Object.defineProperty(ComponentFactoryBoundToModule.prototype, \"selector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.factory.selector; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentFactoryBoundToModule.prototype, \"componentType\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.factory.componentType; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentFactoryBoundToModule.prototype, \"ngContentSelectors\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.factory.ngContentSelectors; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentFactoryBoundToModule.prototype, \"inputs\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.factory.inputs; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentFactoryBoundToModule.prototype, \"outputs\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.factory.outputs; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} injector\n     * @param {?=} projectableNodes\n     * @param {?=} rootSelectorOrNode\n     * @param {?=} ngModule\n     * @return {?}\n     */\n    ComponentFactoryBoundToModule.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {\n        return this.factory.create(injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);\n    };\n    return ComponentFactoryBoundToModule;\n}(ComponentFactory));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Represents an instance of an NgModule created via a {\\@link NgModuleFactory}.\n *\n * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this\n * NgModule Instance.\n *\n * \\@stable\n * @abstract\n */\nvar NgModuleRef = (function () {\n    function NgModuleRef() {\n    }\n    /**\n     * The injector that contains all of the providers of the NgModule.\n     * @abstract\n     * @return {?}\n     */\n    NgModuleRef.prototype.injector = function () { };\n    /**\n     * The ComponentFactoryResolver to get hold of the ComponentFactories\n     * declared in the `entryComponents` property of the module.\n     * @abstract\n     * @return {?}\n     */\n    NgModuleRef.prototype.componentFactoryResolver = function () { };\n    /**\n     * The NgModule instance.\n     * @abstract\n     * @return {?}\n     */\n    NgModuleRef.prototype.instance = function () { };\n    /**\n     * Destroys the module instance and all of the data structures associated with it.\n     * @abstract\n     * @return {?}\n     */\n    NgModuleRef.prototype.destroy = function () { };\n    /**\n     * Allows to register a callback that will be called when the module is destroyed.\n     * @abstract\n     * @param {?} callback\n     * @return {?}\n     */\n    NgModuleRef.prototype.onDestroy = function (callback) { };\n    return NgModuleRef;\n}());\n/**\n * \\@experimental\n * @abstract\n */\nvar NgModuleFactory = (function () {\n    function NgModuleFactory() {\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    NgModuleFactory.prototype.moduleType = function () { };\n    /**\n     * @abstract\n     * @param {?} parentInjector\n     * @return {?}\n     */\n    NgModuleFactory.prototype.create = function (parentInjector) { };\n    return NgModuleFactory;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar trace;\nvar events;\n/**\n * @return {?}\n */\nfunction detectWTF() {\n    var /** @type {?} */ wtf = ((_global) /** TODO #9100 */)['wtf'];\n    if (wtf) {\n        trace = wtf['trace'];\n        if (trace) {\n            events = trace['events'];\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * @param {?} signature\n * @param {?=} flags\n * @return {?}\n */\nfunction createScope$1(signature, flags) {\n    if (flags === void 0) { flags = null; }\n    return events.createScope(signature, flags);\n}\n/**\n * @template T\n * @param {?} scope\n * @param {?=} returnValue\n * @return {?}\n */\nfunction leave(scope, returnValue) {\n    trace.leaveScope(scope, returnValue);\n    return returnValue;\n}\n/**\n * @param {?} rangeType\n * @param {?} action\n * @return {?}\n */\nfunction startTimeRange(rangeType, action) {\n    return trace.beginTimeRange(rangeType, action);\n}\n/**\n * @param {?} range\n * @return {?}\n */\nfunction endTimeRange(range) {\n    trace.endTimeRange(range);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * True if WTF is enabled.\n */\nvar wtfEnabled = detectWTF();\n/**\n * @param {?=} arg0\n * @param {?=} arg1\n * @return {?}\n */\nfunction noopScope(arg0, arg1) {\n    return null;\n}\n/**\n * Create trace scope.\n *\n * Scopes must be strictly nested and are analogous to stack frames, but\n * do not have to follow the stack frames. Instead it is recommended that they follow logical\n * nesting. You may want to use\n * [Event\n * Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)\n * as they are defined in WTF.\n *\n * Used to mark scope entry. The return value is used to leave the scope.\n *\n *     var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');\n *\n *     someMethod() {\n *        var s = myScope('Foo'); // 'Foo' gets stored in tracing UI\n *        // DO SOME WORK HERE\n *        return wtfLeave(s, 123); // Return value 123\n *     }\n *\n * Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can\n * negatively impact the performance of your application. For this reason we recommend that\n * you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and\n * so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to\n * exception, will produce incorrect trace, but presence of exception signifies logic error which\n * needs to be fixed before the app should be profiled. Add try-finally only when you expect that\n * an exception is expected during normal execution while profiling.\n *\n * \\@experimental\n */\nvar wtfCreateScope = wtfEnabled ? createScope$1 : function (signature, flags) { return noopScope; };\n/**\n * Used to mark end of Scope.\n *\n * - `scope` to end.\n * - `returnValue` (optional) to be passed to the WTF.\n *\n * Returns the `returnValue for easy chaining.\n * \\@experimental\n */\nvar wtfLeave = wtfEnabled ? leave : function (s, r) { return r; };\n/**\n * Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.\n * The return value is used in the call to [endAsync]. Async ranges only work if WTF has been\n * enabled.\n *\n *     someMethod() {\n *        var s = wtfStartTimeRange('HTTP:GET', 'some.url');\n *        var future = new Future.delay(5).then((_) {\n *          wtfEndTimeRange(s);\n *        });\n *     }\n * \\@experimental\n */\nvar wtfStartTimeRange = wtfEnabled ? startTimeRange : function (rangeType, action) { return null; };\n/**\n * Ends a async time range operation.\n * [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been\n * enabled.\n * \\@experimental\n */\nvar wtfEndTimeRange = wtfEnabled ? endTimeRange : function (r) { return null; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Use by directives and components to emit custom Events.\n *\n * ### Examples\n *\n * In the following example, `Zippy` alternatively emits `open` and `close` events when its\n * title gets clicked:\n *\n * ```\n * \\@Component({\n *   selector: 'zippy',\n *   template: `\n *   <div class=\"zippy\">\n *     <div (click)=\"toggle()\">Toggle</div>\n *     <div [hidden]=\"!visible\">\n *       <ng-content></ng-content>\n *     </div>\n *  </div>`})\n * export class Zippy {\n *   visible: boolean = true;\n *   \\@Output() open: EventEmitter<any> = new EventEmitter();\n *   \\@Output() close: EventEmitter<any> = new EventEmitter();\n *\n *   toggle() {\n *     this.visible = !this.visible;\n *     if (this.visible) {\n *       this.open.emit(null);\n *     } else {\n *       this.close.emit(null);\n *     }\n *   }\n * }\n * ```\n *\n * The events payload can be accessed by the parameter `$event` on the components output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n * \\@stable\n */\nvar EventEmitter = (function (_super) {\n    __extends(EventEmitter, _super);\n    /**\n     * Creates an instance of {\\@link EventEmitter}, which depending on `isAsync`,\n     * delivers events synchronously or asynchronously.\n     *\n     * @param {?=} isAsync By default, events are delivered synchronously (default value: `false`).\n     * Set to `true` for asynchronous event delivery.\n     */\n    function EventEmitter(isAsync) {\n        if (isAsync === void 0) { isAsync = false; }\n        var _this = _super.call(this) || this;\n        _this.__isAsync = isAsync;\n        return _this;\n    }\n    /**\n     * @param {?=} value\n     * @return {?}\n     */\n    EventEmitter.prototype.emit = function (value) { _super.prototype.next.call(this, value); };\n    /**\n     * @param {?=} generatorOrNext\n     * @param {?=} error\n     * @param {?=} complete\n     * @return {?}\n     */\n    EventEmitter.prototype.subscribe = function (generatorOrNext, error, complete) {\n        var /** @type {?} */ schedulerFn;\n        var /** @type {?} */ errorFn = function (err) { return null; };\n        var /** @type {?} */ completeFn = function () { return null; };\n        if (generatorOrNext && typeof generatorOrNext === 'object') {\n            schedulerFn = this.__isAsync ? function (value) {\n                setTimeout(function () { return generatorOrNext.next(value); });\n            } : function (value) { generatorOrNext.next(value); };\n            if (generatorOrNext.error) {\n                errorFn = this.__isAsync ? function (err) { setTimeout(function () { return generatorOrNext.error(err); }); } :\n                    function (err) { generatorOrNext.error(err); };\n            }\n            if (generatorOrNext.complete) {\n                completeFn = this.__isAsync ? function () { setTimeout(function () { return generatorOrNext.complete(); }); } :\n                    function () { generatorOrNext.complete(); };\n            }\n        }\n        else {\n            schedulerFn = this.__isAsync ? function (value) { setTimeout(function () { return generatorOrNext(value); }); } :\n                function (value) { generatorOrNext(value); };\n            if (error) {\n                errorFn =\n                    this.__isAsync ? function (err) { setTimeout(function () { return error(err); }); } : function (err) { error(err); };\n            }\n            if (complete) {\n                completeFn =\n                    this.__isAsync ? function () { setTimeout(function () { return complete(); }); } : function () { complete(); };\n            }\n        }\n        return _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);\n    };\n    return EventEmitter;\n}(rxjs_Subject.Subject));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {\\@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {\\@link #run}.\n *\n * <!-- TODO: add/fix links to:\n *   - docs explaining zones and the use of zones in Angular and change-detection\n *   - link to runOutsideAngular/run (throughout this file!)\n *   -->\n *\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '\\@angular/core';\n * import {NgIf} from '\\@angular/common';\n *\n * \\@Component({\n *   selector: 'ng-zone-demo'.\n *   template: `\n *     <h2>Demo: NgZone</h2>\n *\n *     <p>Progress: {{progress}}%</p>\n *     <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n *     <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n *     <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n *   `,\n * })\n * export class NgZoneDemo {\n *   progress: number = 0;\n *   label: string;\n *\n *   constructor(private _ngZone: NgZone) {}\n *\n *   // Loop inside the Angular zone\n *   // so the UI DOES refresh after each setTimeout cycle\n *   processWithinAngularZone() {\n *     this.label = 'inside';\n *     this.progress = 0;\n *     this._increaseProgress(() => console.log('Inside Done!'));\n *   }\n *\n *   // Loop outside of the Angular zone\n *   // so the UI DOES NOT refresh after each setTimeout cycle\n *   processOutsideOfAngularZone() {\n *     this.label = 'outside';\n *     this.progress = 0;\n *     this._ngZone.runOutsideAngular(() => {\n *       this._increaseProgress(() => {\n *       // reenter the Angular zone and display done\n *       this._ngZone.run(() => {console.log('Outside Done!') });\n *     }}));\n *   }\n *\n *   _increaseProgress(doneCallback: () => void) {\n *     this.progress += 1;\n *     console.log(`Current progress: ${this.progress}%`);\n *\n *     if (this.progress < 100) {\n *       window.setTimeout(() => this._increaseProgress(doneCallback)), 10)\n *     } else {\n *       doneCallback();\n *     }\n *   }\n * }\n * ```\n *\n * \\@experimental\n */\nvar NgZone = (function () {\n    /**\n     * @param {?} __0\n     */\n    function NgZone(_a) {\n        var _b = _a.enableLongStackTrace, enableLongStackTrace = _b === void 0 ? false : _b;\n        this._hasPendingMicrotasks = false;\n        this._hasPendingMacrotasks = false;\n        this._isStable = true;\n        this._nesting = 0;\n        this._onUnstable = new EventEmitter(false);\n        this._onMicrotaskEmpty = new EventEmitter(false);\n        this._onStable = new EventEmitter(false);\n        this._onErrorEvents = new EventEmitter(false);\n        if (typeof Zone == 'undefined') {\n            throw new Error('Angular requires Zone.js prolyfill.');\n        }\n        Zone.assertZonePatched();\n        this.outer = this.inner = Zone.current;\n        if (Zone['wtfZoneSpec']) {\n            this.inner = this.inner.fork(Zone['wtfZoneSpec']);\n        }\n        if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n            this.inner = this.inner.fork(Zone['longStackTraceZoneSpec']);\n        }\n        this.forkInnerZoneWithAngularBehavior();\n    }\n    /**\n     * @return {?}\n     */\n    NgZone.isInAngularZone = function () { return Zone.current.get('isAngularZone') === true; };\n    /**\n     * @return {?}\n     */\n    NgZone.assertInAngularZone = function () {\n        if (!NgZone.isInAngularZone()) {\n            throw new Error('Expected to be in Angular Zone, but it is not!');\n        }\n    };\n    /**\n     * @return {?}\n     */\n    NgZone.assertNotInAngularZone = function () {\n        if (NgZone.isInAngularZone()) {\n            throw new Error('Expected to not be in Angular Zone, but it is!');\n        }\n    };\n    /**\n     * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n     * the function.\n     *\n     * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n     * outside of the Angular zone (typically started via {\\@link #runOutsideAngular}).\n     *\n     * Any future tasks or microtasks scheduled from within this function will continue executing from\n     * within the Angular zone.\n     *\n     * If a synchronous error happens it will be rethrown and not reported via `onError`.\n     * @param {?} fn\n     * @return {?}\n     */\n    NgZone.prototype.run = function (fn) { return this.inner.run(fn); };\n    /**\n     * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n     * rethrown.\n     * @param {?} fn\n     * @return {?}\n     */\n    NgZone.prototype.runGuarded = function (fn) { return this.inner.runGuarded(fn); };\n    /**\n     * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n     * the function.\n     *\n     * Running functions via {\\@link #runOutsideAngular} allows you to escape Angular's zone and do\n     * work that\n     * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n     *\n     * Any future tasks or microtasks scheduled from within this function will continue executing from\n     * outside of the Angular zone.\n     *\n     * Use {\\@link #run} to reenter the Angular zone and do work that updates the application model.\n     * @param {?} fn\n     * @return {?}\n     */\n    NgZone.prototype.runOutsideAngular = function (fn) { return this.outer.run(fn); };\n    Object.defineProperty(NgZone.prototype, \"onUnstable\", {\n        /**\n         * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n         * @return {?}\n         */\n        get: function () { return this._onUnstable; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgZone.prototype, \"onMicrotaskEmpty\", {\n        /**\n         * Notifies when there is no more microtasks enqueue in the current VM Turn.\n         * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n         * For this reason this event can fire multiple times per VM Turn.\n         * @return {?}\n         */\n        get: function () { return this._onMicrotaskEmpty; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgZone.prototype, \"onStable\", {\n        /**\n         * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n         * implies we are about to relinquish VM turn.\n         * This event gets called just once.\n         * @return {?}\n         */\n        get: function () { return this._onStable; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgZone.prototype, \"onError\", {\n        /**\n         * Notify that an error has been delivered.\n         * @return {?}\n         */\n        get: function () { return this._onErrorEvents; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgZone.prototype, \"isStable\", {\n        /**\n         * Whether there are no outstanding microtasks or macrotasks.\n         * @return {?}\n         */\n        get: function () { return this._isStable; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgZone.prototype, \"hasPendingMicrotasks\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._hasPendingMicrotasks; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgZone.prototype, \"hasPendingMacrotasks\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._hasPendingMacrotasks; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    NgZone.prototype.checkStable = function () {\n        var _this = this;\n        if (this._nesting == 0 && !this._hasPendingMicrotasks && !this._isStable) {\n            try {\n                this._nesting++;\n                this._onMicrotaskEmpty.emit(null);\n            }\n            finally {\n                this._nesting--;\n                if (!this._hasPendingMicrotasks) {\n                    try {\n                        this.runOutsideAngular(function () { return _this._onStable.emit(null); });\n                    }\n                    finally {\n                        this._isStable = true;\n                    }\n                }\n            }\n        }\n    };\n    /**\n     * @return {?}\n     */\n    NgZone.prototype.forkInnerZoneWithAngularBehavior = function () {\n        var _this = this;\n        this.inner = this.inner.fork({\n            name: 'angular',\n            properties: /** @type {?} */ ({ 'isAngularZone': true }),\n            onInvokeTask: function (delegate, current, target, task, applyThis, applyArgs) {\n                try {\n                    _this.onEnter();\n                    return delegate.invokeTask(target, task, applyThis, applyArgs);\n                }\n                finally {\n                    _this.onLeave();\n                }\n            },\n            onInvoke: function (delegate, current, target, callback, applyThis, applyArgs, source) {\n                try {\n                    _this.onEnter();\n                    return delegate.invoke(target, callback, applyThis, applyArgs, source);\n                }\n                finally {\n                    _this.onLeave();\n                }\n            },\n            onHasTask: function (delegate, current, target, hasTaskState) {\n                delegate.hasTask(target, hasTaskState);\n                if (current === target) {\n                    // We are only interested in hasTask events which originate from our zone\n                    // (A child hasTask event is not interesting to us)\n                    if (hasTaskState.change == 'microTask') {\n                        _this.setHasMicrotask(hasTaskState.microTask);\n                    }\n                    else if (hasTaskState.change == 'macroTask') {\n                        _this.setHasMacrotask(hasTaskState.macroTask);\n                    }\n                }\n            },\n            onHandleError: function (delegate, current, target, error) {\n                delegate.handleError(target, error);\n                _this.triggerError(error);\n                return false;\n            }\n        });\n    };\n    /**\n     * @return {?}\n     */\n    NgZone.prototype.onEnter = function () {\n        this._nesting++;\n        if (this._isStable) {\n            this._isStable = false;\n            this._onUnstable.emit(null);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    NgZone.prototype.onLeave = function () {\n        this._nesting--;\n        this.checkStable();\n    };\n    /**\n     * @param {?} hasMicrotasks\n     * @return {?}\n     */\n    NgZone.prototype.setHasMicrotask = function (hasMicrotasks) {\n        this._hasPendingMicrotasks = hasMicrotasks;\n        this.checkStable();\n    };\n    /**\n     * @param {?} hasMacrotasks\n     * @return {?}\n     */\n    NgZone.prototype.setHasMacrotask = function (hasMacrotasks) { this._hasPendingMacrotasks = hasMacrotasks; };\n    /**\n     * @param {?} error\n     * @return {?}\n     */\n    NgZone.prototype.triggerError = function (error) { this._onErrorEvents.emit(error); };\n    return NgZone;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser and by services such as Protractor. Each bootstrapped Angular\n * application on the page will have an instance of Testability.\n * \\@experimental\n */\nvar Testability = (function () {\n    /**\n     * @param {?} _ngZone\n     */\n    function Testability(_ngZone) {\n        this._ngZone = _ngZone;\n        /**\n         * \\@internal\n         */\n        this._pendingCount = 0;\n        /**\n         * \\@internal\n         */\n        this._isZoneStable = true;\n        /**\n         * Whether any work was done since the last 'whenStable' callback. This is\n         * useful to detect if this could have potentially destabilized another\n         * component while it is stabilizing.\n         * \\@internal\n         */\n        this._didWork = false;\n        /**\n         * \\@internal\n         */\n        this._callbacks = [];\n        this._watchAngularEvents();\n    }\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    Testability.prototype._watchAngularEvents = function () {\n        var _this = this;\n        this._ngZone.onUnstable.subscribe({\n            next: function () {\n                _this._didWork = true;\n                _this._isZoneStable = false;\n            }\n        });\n        this._ngZone.runOutsideAngular(function () {\n            _this._ngZone.onStable.subscribe({\n                next: function () {\n                    NgZone.assertNotInAngularZone();\n                    scheduleMicroTask(function () {\n                        _this._isZoneStable = true;\n                        _this._runCallbacksIfReady();\n                    });\n                }\n            });\n        });\n    };\n    /**\n     * @return {?}\n     */\n    Testability.prototype.increasePendingRequestCount = function () {\n        this._pendingCount += 1;\n        this._didWork = true;\n        return this._pendingCount;\n    };\n    /**\n     * @return {?}\n     */\n    Testability.prototype.decreasePendingRequestCount = function () {\n        this._pendingCount -= 1;\n        if (this._pendingCount < 0) {\n            throw new Error('pending async requests below zero');\n        }\n        this._runCallbacksIfReady();\n        return this._pendingCount;\n    };\n    /**\n     * @return {?}\n     */\n    Testability.prototype.isStable = function () {\n        return this._isZoneStable && this._pendingCount == 0 && !this._ngZone.hasPendingMacrotasks;\n    };\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    Testability.prototype._runCallbacksIfReady = function () {\n        var _this = this;\n        if (this.isStable()) {\n            // Schedules the call backs in a new frame so that it is always async.\n            scheduleMicroTask(function () {\n                while (_this._callbacks.length !== 0) {\n                    (((_this._callbacks.pop())))(_this._didWork);\n                }\n                _this._didWork = false;\n            });\n        }\n        else {\n            // Not Ready\n            this._didWork = true;\n        }\n    };\n    /**\n     * @param {?} callback\n     * @return {?}\n     */\n    Testability.prototype.whenStable = function (callback) {\n        this._callbacks.push(callback);\n        this._runCallbacksIfReady();\n    };\n    /**\n     * @return {?}\n     */\n    Testability.prototype.getPendingRequestCount = function () { return this._pendingCount; };\n    /**\n     * @deprecated use findProviders\n     * @param {?} using\n     * @param {?} provider\n     * @param {?} exactMatch\n     * @return {?}\n     */\n    Testability.prototype.findBindings = function (using, provider, exactMatch) {\n        // TODO(juliemr): implement.\n        return [];\n    };\n    /**\n     * @param {?} using\n     * @param {?} provider\n     * @param {?} exactMatch\n     * @return {?}\n     */\n    Testability.prototype.findProviders = function (using, provider, exactMatch) {\n        // TODO(juliemr): implement.\n        return [];\n    };\n    return Testability;\n}());\nTestability.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nTestability.ctorParameters = function () { return [\n    { type: NgZone, },\n]; };\n/**\n * A global registry of {\\@link Testability} instances for specific elements.\n * \\@experimental\n */\nvar TestabilityRegistry = (function () {\n    function TestabilityRegistry() {\n        /**\n         * \\@internal\n         */\n        this._applications = new Map();\n        _testabilityGetter.addToWindow(this);\n    }\n    /**\n     * @param {?} token\n     * @param {?} testability\n     * @return {?}\n     */\n    TestabilityRegistry.prototype.registerApplication = function (token, testability) {\n        this._applications.set(token, testability);\n    };\n    /**\n     * @param {?} elem\n     * @return {?}\n     */\n    TestabilityRegistry.prototype.getTestability = function (elem) { return this._applications.get(elem) || null; };\n    /**\n     * @return {?}\n     */\n    TestabilityRegistry.prototype.getAllTestabilities = function () { return Array.from(this._applications.values()); };\n    /**\n     * @return {?}\n     */\n    TestabilityRegistry.prototype.getAllRootElements = function () { return Array.from(this._applications.keys()); };\n    /**\n     * @param {?} elem\n     * @param {?=} findInAncestors\n     * @return {?}\n     */\n    TestabilityRegistry.prototype.findTestabilityInTree = function (elem, findInAncestors) {\n        if (findInAncestors === void 0) { findInAncestors = true; }\n        return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);\n    };\n    return TestabilityRegistry;\n}());\nTestabilityRegistry.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nTestabilityRegistry.ctorParameters = function () { return []; };\nvar _NoopGetTestability = (function () {\n    function _NoopGetTestability() {\n    }\n    /**\n     * @param {?} registry\n     * @return {?}\n     */\n    _NoopGetTestability.prototype.addToWindow = function (registry) { };\n    /**\n     * @param {?} registry\n     * @param {?} elem\n     * @param {?} findInAncestors\n     * @return {?}\n     */\n    _NoopGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {\n        return null;\n    };\n    return _NoopGetTestability;\n}());\n/**\n * Set the {\\@link GetTestability} implementation used by the Angular testing framework.\n * \\@experimental\n * @param {?} getter\n * @return {?}\n */\nfunction setTestabilityGetter(getter) {\n    _testabilityGetter = getter;\n}\nvar _testabilityGetter = new _NoopGetTestability();\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _devMode = true;\nvar _runModeLocked = false;\nvar _platform;\nvar ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * \\@stable\n * @return {?}\n */\nfunction enableProdMode() {\n    if (_runModeLocked) {\n        throw new Error('Cannot enable prod mode after platform setup.');\n    }\n    _devMode = false;\n}\n/**\n * Returns whether Angular is in development mode. After called once,\n * the value is locked and won't change any more.\n *\n * By default, this is true, unless a user calls `enableProdMode` before calling this.\n *\n * \\@experimental APIs related to application bootstrap are currently under review.\n * @return {?}\n */\nfunction isDevMode() {\n    _runModeLocked = true;\n    return _devMode;\n}\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * \\@experimental\n */\nvar NgProbeToken = (function () {\n    /**\n     * @param {?} name\n     * @param {?} token\n     */\n    function NgProbeToken(name, token) {\n        this.name = name;\n        this.token = token;\n    }\n    return NgProbeToken;\n}());\n/**\n * Creates a platform.\n * Platforms have to be eagerly created via this function.\n *\n * \\@experimental APIs related to application bootstrap are currently under review.\n * @param {?} injector\n * @return {?}\n */\nfunction createPlatform(injector) {\n    if (_platform && !_platform.destroyed &&\n        !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n        throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n    }\n    _platform = injector.get(PlatformRef);\n    var /** @type {?} */ inits = injector.get(PLATFORM_INITIALIZER, null);\n    if (inits)\n        inits.forEach(function (init) { return init(); });\n    return _platform;\n}\n/**\n * Creates a factory for a platform\n *\n * \\@experimental APIs related to application bootstrap are currently under review.\n * @param {?} parentPlatformFactory\n * @param {?} name\n * @param {?=} providers\n * @return {?}\n */\nfunction createPlatformFactory(parentPlatformFactory, name, providers) {\n    if (providers === void 0) { providers = []; }\n    var /** @type {?} */ marker = new InjectionToken(\"Platform: \" + name);\n    return function (extraProviders) {\n        if (extraProviders === void 0) { extraProviders = []; }\n        var /** @type {?} */ platform = getPlatform();\n        if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n            if (parentPlatformFactory) {\n                parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n            }\n            else {\n                createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));\n            }\n        }\n        return assertPlatform(marker);\n    };\n}\n/**\n * Checks that there currently is a platform which contains the given token as a provider.\n *\n * \\@experimental APIs related to application bootstrap are currently under review.\n * @param {?} requiredToken\n * @return {?}\n */\nfunction assertPlatform(requiredToken) {\n    var /** @type {?} */ platform = getPlatform();\n    if (!platform) {\n        throw new Error('No platform exists!');\n    }\n    if (!platform.injector.get(requiredToken, null)) {\n        throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n    }\n    return platform;\n}\n/**\n * Destroy the existing platform.\n *\n * \\@experimental APIs related to application bootstrap are currently under review.\n * @return {?}\n */\nfunction destroyPlatform() {\n    if (_platform && !_platform.destroyed) {\n        _platform.destroy();\n    }\n}\n/**\n * Returns the current platform.\n *\n * \\@experimental APIs related to application bootstrap are currently under review.\n * @return {?}\n */\nfunction getPlatform() {\n    return _platform && !_platform.destroyed ? _platform : null;\n}\n/**\n * The Angular platform is the entry point for Angular on a web page. Each page\n * has exactly one platform, and services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n *\n * A page's platform is initialized implicitly when a platform is created via a platform factory\n * (e.g. {\\@link platformBrowser}), or explicitly by calling the {\\@link createPlatform} function.\n *\n * \\@stable\n * @abstract\n */\nvar PlatformRef = (function () {\n    function PlatformRef() {\n    }\n    /**\n     * Creates an instance of an `\\@NgModule` for the given platform\n     * for offline compilation.\n     *\n     * ## Simple Example\n     *\n     * ```typescript\n     * my_module.ts:\n     *\n     * \\@NgModule({\n     *   imports: [BrowserModule]\n     * })\n     * class MyModule {}\n     *\n     * main.ts:\n     * import {MyModuleNgFactory} from './my_module.ngfactory';\n     * import {platformBrowser} from '\\@angular/platform-browser';\n     *\n     * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);\n     * ```\n     *\n     * \\@experimental APIs related to application bootstrap are currently under review.\n     * @abstract\n     * @template M\n     * @param {?} moduleFactory\n     * @return {?}\n     */\n    PlatformRef.prototype.bootstrapModuleFactory = function (moduleFactory) { };\n    /**\n     * Creates an instance of an `\\@NgModule` for a given platform using the given runtime compiler.\n     *\n     * ## Simple Example\n     *\n     * ```typescript\n     * \\@NgModule({\n     *   imports: [BrowserModule]\n     * })\n     * class MyModule {}\n     *\n     * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n     * ```\n     * \\@stable\n     * @abstract\n     * @template M\n     * @param {?} moduleType\n     * @param {?=} compilerOptions\n     * @return {?}\n     */\n    PlatformRef.prototype.bootstrapModule = function (moduleType, compilerOptions) { };\n    /**\n     * Register a listener to be called when the platform is disposed.\n     * @abstract\n     * @param {?} callback\n     * @return {?}\n     */\n    PlatformRef.prototype.onDestroy = function (callback) { };\n    /**\n     * Retrieve the platform {\\@link Injector}, which is the parent injector for\n     * every Angular application on the page and provides singleton providers.\n     * @abstract\n     * @return {?}\n     */\n    PlatformRef.prototype.injector = function () { };\n    /**\n     * Destroy the Angular platform and all Angular applications on the page.\n     * @abstract\n     * @return {?}\n     */\n    PlatformRef.prototype.destroy = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformRef.prototype.destroyed = function () { };\n    return PlatformRef;\n}());\n/**\n * @param {?} errorHandler\n * @param {?} callback\n * @return {?}\n */\nfunction _callAndReportToErrorHandler(errorHandler, callback) {\n    try {\n        var /** @type {?} */ result = callback();\n        if (isPromise(result)) {\n            return result.catch(function (e) {\n                errorHandler.handleError(e);\n                // rethrow as the exception handler might not do it\n                throw e;\n            });\n        }\n        return result;\n    }\n    catch (e) {\n        errorHandler.handleError(e);\n        // rethrow as the exception handler might not do it\n        throw e;\n    }\n}\n/**\n * workaround https://github.com/angular/tsickle/issues/350\n * @suppress {checkTypes}\n */\nvar PlatformRef_ = (function (_super) {\n    __extends(PlatformRef_, _super);\n    /**\n     * @param {?} _injector\n     */\n    function PlatformRef_(_injector) {\n        var _this = _super.call(this) || this;\n        _this._injector = _injector;\n        _this._modules = [];\n        _this._destroyListeners = [];\n        _this._destroyed = false;\n        return _this;\n    }\n    /**\n     * @param {?} callback\n     * @return {?}\n     */\n    PlatformRef_.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };\n    Object.defineProperty(PlatformRef_.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._injector; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(PlatformRef_.prototype, \"destroyed\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._destroyed; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    PlatformRef_.prototype.destroy = function () {\n        if (this._destroyed) {\n            throw new Error('The platform has already been destroyed!');\n        }\n        this._modules.slice().forEach(function (module) { return module.destroy(); });\n        this._destroyListeners.forEach(function (listener) { return listener(); });\n        this._destroyed = true;\n    };\n    /**\n     * @template M\n     * @param {?} moduleFactory\n     * @return {?}\n     */\n    PlatformRef_.prototype.bootstrapModuleFactory = function (moduleFactory) {\n        return this._bootstrapModuleFactoryWithZone(moduleFactory);\n    };\n    /**\n     * @template M\n     * @param {?} moduleFactory\n     * @param {?=} ngZone\n     * @return {?}\n     */\n    PlatformRef_.prototype._bootstrapModuleFactoryWithZone = function (moduleFactory, ngZone) {\n        var _this = this;\n        // Note: We need to create the NgZone _before_ we instantiate the module,\n        // as instantiating the module creates some providers eagerly.\n        // So we create a mini parent injector that just contains the new NgZone and\n        // pass that as parent to the NgModuleFactory.\n        if (!ngZone)\n            ngZone = new NgZone({ enableLongStackTrace: isDevMode() });\n        // Attention: Don't use ApplicationRef.run here,\n        // as we want to be sure that all possible constructor calls are inside `ngZone.run`!\n        return ngZone.run(function () {\n            var /** @type {?} */ ngZoneInjector = ReflectiveInjector.resolveAndCreate([{ provide: NgZone, useValue: ngZone }], _this.injector);\n            var /** @type {?} */ moduleRef = (moduleFactory.create(ngZoneInjector));\n            var /** @type {?} */ exceptionHandler = moduleRef.injector.get(ErrorHandler, null);\n            if (!exceptionHandler) {\n                throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');\n            }\n            moduleRef.onDestroy(function () { return remove(_this._modules, moduleRef); }); /** @type {?} */\n            ((ngZone)).onError.subscribe({ next: function (error) { exceptionHandler.handleError(error); } });\n            return _callAndReportToErrorHandler(exceptionHandler, function () {\n                var /** @type {?} */ initStatus = moduleRef.injector.get(ApplicationInitStatus);\n                initStatus.runInitializers();\n                return initStatus.donePromise.then(function () {\n                    _this._moduleDoBootstrap(moduleRef);\n                    return moduleRef;\n                });\n            });\n        });\n    };\n    /**\n     * @template M\n     * @param {?} moduleType\n     * @param {?=} compilerOptions\n     * @return {?}\n     */\n    PlatformRef_.prototype.bootstrapModule = function (moduleType, compilerOptions) {\n        if (compilerOptions === void 0) { compilerOptions = []; }\n        return this._bootstrapModuleWithZone(moduleType, compilerOptions);\n    };\n    /**\n     * @template M\n     * @param {?} moduleType\n     * @param {?=} compilerOptions\n     * @param {?=} ngZone\n     * @return {?}\n     */\n    PlatformRef_.prototype._bootstrapModuleWithZone = function (moduleType, compilerOptions, ngZone) {\n        var _this = this;\n        if (compilerOptions === void 0) { compilerOptions = []; }\n        var /** @type {?} */ compilerFactory = this.injector.get(CompilerFactory);\n        var /** @type {?} */ compiler = compilerFactory.createCompiler(Array.isArray(compilerOptions) ? compilerOptions : [compilerOptions]);\n        return compiler.compileModuleAsync(moduleType)\n            .then(function (moduleFactory) { return _this._bootstrapModuleFactoryWithZone(moduleFactory, ngZone); });\n    };\n    /**\n     * @param {?} moduleRef\n     * @return {?}\n     */\n    PlatformRef_.prototype._moduleDoBootstrap = function (moduleRef) {\n        var /** @type {?} */ appRef = (moduleRef.injector.get(ApplicationRef));\n        if (moduleRef._bootstrapComponents.length > 0) {\n            moduleRef._bootstrapComponents.forEach(function (f) { return appRef.bootstrap(f); });\n        }\n        else if (moduleRef.instance.ngDoBootstrap) {\n            moduleRef.instance.ngDoBootstrap(appRef);\n        }\n        else {\n            throw new Error(\"The module \" + stringify(moduleRef.instance.constructor) + \" was bootstrapped, but it does not declare \\\"@NgModule.bootstrap\\\" components nor a \\\"ngDoBootstrap\\\" method. \" +\n                \"Please define one of these.\");\n        }\n        this._modules.push(moduleRef);\n    };\n    return PlatformRef_;\n}(PlatformRef));\nPlatformRef_.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nPlatformRef_.ctorParameters = function () { return [\n    { type: Injector, },\n]; };\n/**\n * A reference to an Angular application running on a page.\n *\n * \\@stable\n * @abstract\n */\nvar ApplicationRef = (function () {\n    function ApplicationRef() {\n    }\n    /**\n     * Bootstrap a new component at the root level of the application.\n     *\n     * ### Bootstrap process\n     *\n     * When bootstrapping a new root component into an application, Angular mounts the\n     * specified application component onto DOM elements identified by the [componentType]'s\n     * selector and kicks off automatic change detection to finish initializing the component.\n     *\n     * Optionally, a component can be mounted onto a DOM element that does not match the\n     * [componentType]'s selector.\n     *\n     * ### Example\n     * {\\@example core/ts/platform/platform.ts region='longform'}\n     * @abstract\n     * @template C\n     * @param {?} componentFactory\n     * @param {?=} rootSelectorOrNode\n     * @return {?}\n     */\n    ApplicationRef.prototype.bootstrap = function (componentFactory, rootSelectorOrNode) { };\n    /**\n     * Invoke this method to explicitly process change detection and its side-effects.\n     *\n     * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n     * further changes are detected. If additional changes are picked up during this second cycle,\n     * bindings in the app have side-effects that cannot be resolved in a single change detection\n     * pass.\n     * In this case, Angular throws an error, since an Angular application can only have one change\n     * detection pass during which all change detection must complete.\n     * @abstract\n     * @return {?}\n     */\n    ApplicationRef.prototype.tick = function () { };\n    /**\n     * Get a list of component types registered to this application.\n     * This list is populated even before the component is created.\n     * @abstract\n     * @return {?}\n     */\n    ApplicationRef.prototype.componentTypes = function () { };\n    /**\n     * Get a list of components registered to this application.\n     * @abstract\n     * @return {?}\n     */\n    ApplicationRef.prototype.components = function () { };\n    /**\n     * Attaches a view so that it will be dirty checked.\n     * The view will be automatically detached when it is destroyed.\n     * This will throw if the view is already attached to a ViewContainer.\n     * @abstract\n     * @param {?} view\n     * @return {?}\n     */\n    ApplicationRef.prototype.attachView = function (view) { };\n    /**\n     * Detaches a view from dirty checking again.\n     * @abstract\n     * @param {?} view\n     * @return {?}\n     */\n    ApplicationRef.prototype.detachView = function (view) { };\n    /**\n     * Returns the number of attached views.\n     * @abstract\n     * @return {?}\n     */\n    ApplicationRef.prototype.viewCount = function () { };\n    /**\n     * Returns an Observable that indicates when the application is stable or unstable.\n     * @abstract\n     * @return {?}\n     */\n    ApplicationRef.prototype.isStable = function () { };\n    return ApplicationRef;\n}());\n/**\n * workaround https://github.com/angular/tsickle/issues/350\n * @suppress {checkTypes}\n */\nvar ApplicationRef_ = (function (_super) {\n    __extends(ApplicationRef_, _super);\n    /**\n     * @param {?} _zone\n     * @param {?} _console\n     * @param {?} _injector\n     * @param {?} _exceptionHandler\n     * @param {?} _componentFactoryResolver\n     * @param {?} _initStatus\n     */\n    function ApplicationRef_(_zone, _console, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {\n        var _this = _super.call(this) || this;\n        _this._zone = _zone;\n        _this._console = _console;\n        _this._injector = _injector;\n        _this._exceptionHandler = _exceptionHandler;\n        _this._componentFactoryResolver = _componentFactoryResolver;\n        _this._initStatus = _initStatus;\n        _this._bootstrapListeners = [];\n        _this._rootComponents = [];\n        _this._rootComponentTypes = [];\n        _this._views = [];\n        _this._runningTick = false;\n        _this._enforceNoNewChanges = false;\n        _this._stable = true;\n        _this._enforceNoNewChanges = isDevMode();\n        _this._zone.onMicrotaskEmpty.subscribe({ next: function () { _this._zone.run(function () { _this.tick(); }); } });\n        var isCurrentlyStable = new rxjs_Observable.Observable(function (observer) {\n            _this._stable = _this._zone.isStable && !_this._zone.hasPendingMacrotasks &&\n                !_this._zone.hasPendingMicrotasks;\n            _this._zone.runOutsideAngular(function () {\n                observer.next(_this._stable);\n                observer.complete();\n            });\n        });\n        var isStable = new rxjs_Observable.Observable(function (observer) {\n            var stableSub = _this._zone.onStable.subscribe(function () {\n                NgZone.assertNotInAngularZone();\n                // Check whether there are no pending macro/micro tasks in the next tick\n                // to allow for NgZone to update the state.\n                scheduleMicroTask(function () {\n                    if (!_this._stable && !_this._zone.hasPendingMacrotasks &&\n                        !_this._zone.hasPendingMicrotasks) {\n                        _this._stable = true;\n                        observer.next(true);\n                    }\n                });\n            });\n            var unstableSub = _this._zone.onUnstable.subscribe(function () {\n                NgZone.assertInAngularZone();\n                if (_this._stable) {\n                    _this._stable = false;\n                    _this._zone.runOutsideAngular(function () { observer.next(false); });\n                }\n            });\n            return function () {\n                stableSub.unsubscribe();\n                unstableSub.unsubscribe();\n            };\n        });\n        _this._isStable = rxjs_observable_merge.merge(isCurrentlyStable, rxjs_operator_share.share.call(isStable));\n        return _this;\n    }\n    /**\n     * @param {?} viewRef\n     * @return {?}\n     */\n    ApplicationRef_.prototype.attachView = function (viewRef) {\n        var /** @type {?} */ view = ((viewRef));\n        this._views.push(view);\n        view.attachToAppRef(this);\n    };\n    /**\n     * @param {?} viewRef\n     * @return {?}\n     */\n    ApplicationRef_.prototype.detachView = function (viewRef) {\n        var /** @type {?} */ view = ((viewRef));\n        remove(this._views, view);\n        view.detachFromAppRef();\n    };\n    /**\n     * @template C\n     * @param {?} componentOrFactory\n     * @param {?=} rootSelectorOrNode\n     * @return {?}\n     */\n    ApplicationRef_.prototype.bootstrap = function (componentOrFactory, rootSelectorOrNode) {\n        var _this = this;\n        if (!this._initStatus.done) {\n            throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');\n        }\n        var /** @type {?} */ componentFactory;\n        if (componentOrFactory instanceof ComponentFactory) {\n            componentFactory = componentOrFactory;\n        }\n        else {\n            componentFactory = ((this._componentFactoryResolver.resolveComponentFactory(componentOrFactory)));\n        }\n        this._rootComponentTypes.push(componentFactory.componentType);\n        // Create a factory associated with the current module if it's not bound to some other\n        var /** @type {?} */ ngModule = componentFactory instanceof ComponentFactoryBoundToModule ?\n            null :\n            this._injector.get(NgModuleRef);\n        var /** @type {?} */ selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n        var /** @type {?} */ compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n        compRef.onDestroy(function () { _this._unloadComponent(compRef); });\n        var /** @type {?} */ testability = compRef.injector.get(Testability, null);\n        if (testability) {\n            compRef.injector.get(TestabilityRegistry)\n                .registerApplication(compRef.location.nativeElement, testability);\n        }\n        this._loadComponent(compRef);\n        if (isDevMode()) {\n            this._console.log(\"Angular is running in the development mode. Call enableProdMode() to enable the production mode.\");\n        }\n        return compRef;\n    };\n    /**\n     * @param {?} componentRef\n     * @return {?}\n     */\n    ApplicationRef_.prototype._loadComponent = function (componentRef) {\n        this.attachView(componentRef.hostView);\n        this.tick();\n        this._rootComponents.push(componentRef);\n        // Get the listeners lazily to prevent DI cycles.\n        var /** @type {?} */ listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);\n        listeners.forEach(function (listener) { return listener(componentRef); });\n    };\n    /**\n     * @param {?} componentRef\n     * @return {?}\n     */\n    ApplicationRef_.prototype._unloadComponent = function (componentRef) {\n        this.detachView(componentRef.hostView);\n        remove(this._rootComponents, componentRef);\n    };\n    /**\n     * @return {?}\n     */\n    ApplicationRef_.prototype.tick = function () {\n        if (this._runningTick) {\n            throw new Error('ApplicationRef.tick is called recursively');\n        }\n        var /** @type {?} */ scope = ApplicationRef_._tickScope();\n        try {\n            this._runningTick = true;\n            this._views.forEach(function (view) { return view.detectChanges(); });\n            if (this._enforceNoNewChanges) {\n                this._views.forEach(function (view) { return view.checkNoChanges(); });\n            }\n        }\n        catch (e) {\n            // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n            this._exceptionHandler.handleError(e);\n        }\n        finally {\n            this._runningTick = false;\n            wtfLeave(scope);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    ApplicationRef_.prototype.ngOnDestroy = function () {\n        // TODO(alxhub): Dispose of the NgZone.\n        this._views.slice().forEach(function (view) { return view.destroy(); });\n    };\n    Object.defineProperty(ApplicationRef_.prototype, \"viewCount\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._views.length; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ApplicationRef_.prototype, \"componentTypes\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._rootComponentTypes; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ApplicationRef_.prototype, \"components\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._rootComponents; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ApplicationRef_.prototype, \"isStable\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._isStable; },\n        enumerable: true,\n        configurable: true\n    });\n    return ApplicationRef_;\n}(ApplicationRef));\n/**\n * \\@internal\n */\nApplicationRef_._tickScope = wtfCreateScope('ApplicationRef#tick()');\nApplicationRef_.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nApplicationRef_.ctorParameters = function () { return [\n    { type: NgZone, },\n    { type: Console, },\n    { type: Injector, },\n    { type: ErrorHandler, },\n    { type: ComponentFactoryResolver, },\n    { type: ApplicationInitStatus, },\n]; };\n/**\n * @template T\n * @param {?} list\n * @param {?} el\n * @return {?}\n */\nfunction remove(list, el) {\n    var /** @type {?} */ index = list.indexOf(el);\n    if (index > -1) {\n        list.splice(index, 1);\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// Public API for Zone\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @deprecated Use `RendererType2` (and `Renderer2`) instead.\n */\nvar RenderComponentType = (function () {\n    /**\n     * @param {?} id\n     * @param {?} templateUrl\n     * @param {?} slotCount\n     * @param {?} encapsulation\n     * @param {?} styles\n     * @param {?} animations\n     */\n    function RenderComponentType(id, templateUrl, slotCount, encapsulation, styles, animations) {\n        this.id = id;\n        this.templateUrl = templateUrl;\n        this.slotCount = slotCount;\n        this.encapsulation = encapsulation;\n        this.styles = styles;\n        this.animations = animations;\n    }\n    return RenderComponentType;\n}());\n/**\n * @deprecated Debug info is handeled internally in the view engine now.\n * @abstract\n */\nvar RenderDebugInfo = (function () {\n    function RenderDebugInfo() {\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RenderDebugInfo.prototype.injector = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RenderDebugInfo.prototype.component = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RenderDebugInfo.prototype.providerTokens = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RenderDebugInfo.prototype.references = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RenderDebugInfo.prototype.context = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RenderDebugInfo.prototype.source = function () { };\n    return RenderDebugInfo;\n}());\n/**\n * @deprecated Use the `Renderer2` instead.\n * @abstract\n */\nvar Renderer = (function () {\n    function Renderer() {\n    }\n    /**\n     * @abstract\n     * @param {?} selectorOrNode\n     * @param {?=} debugInfo\n     * @return {?}\n     */\n    Renderer.prototype.selectRootElement = function (selectorOrNode, debugInfo) { };\n    /**\n     * @abstract\n     * @param {?} parentElement\n     * @param {?} name\n     * @param {?=} debugInfo\n     * @return {?}\n     */\n    Renderer.prototype.createElement = function (parentElement, name, debugInfo) { };\n    /**\n     * @abstract\n     * @param {?} hostElement\n     * @return {?}\n     */\n    Renderer.prototype.createViewRoot = function (hostElement) { };\n    /**\n     * @abstract\n     * @param {?} parentElement\n     * @param {?=} debugInfo\n     * @return {?}\n     */\n    Renderer.prototype.createTemplateAnchor = function (parentElement, debugInfo) { };\n    /**\n     * @abstract\n     * @param {?} parentElement\n     * @param {?} value\n     * @param {?=} debugInfo\n     * @return {?}\n     */\n    Renderer.prototype.createText = function (parentElement, value, debugInfo) { };\n    /**\n     * @abstract\n     * @param {?} parentElement\n     * @param {?} nodes\n     * @return {?}\n     */\n    Renderer.prototype.projectNodes = function (parentElement, nodes) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @param {?} viewRootNodes\n     * @return {?}\n     */\n    Renderer.prototype.attachViewAfter = function (node, viewRootNodes) { };\n    /**\n     * @abstract\n     * @param {?} viewRootNodes\n     * @return {?}\n     */\n    Renderer.prototype.detachView = function (viewRootNodes) { };\n    /**\n     * @abstract\n     * @param {?} hostElement\n     * @param {?} viewAllNodes\n     * @return {?}\n     */\n    Renderer.prototype.destroyView = function (hostElement, viewAllNodes) { };\n    /**\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} name\n     * @param {?} callback\n     * @return {?}\n     */\n    Renderer.prototype.listen = function (renderElement, name, callback) { };\n    /**\n     * @abstract\n     * @param {?} target\n     * @param {?} name\n     * @param {?} callback\n     * @return {?}\n     */\n    Renderer.prototype.listenGlobal = function (target, name, callback) { };\n    /**\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} propertyName\n     * @param {?} propertyValue\n     * @return {?}\n     */\n    Renderer.prototype.setElementProperty = function (renderElement, propertyName, propertyValue) { };\n    /**\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} attributeName\n     * @param {?} attributeValue\n     * @return {?}\n     */\n    Renderer.prototype.setElementAttribute = function (renderElement, attributeName, attributeValue) { };\n    /**\n     * Used only in debug mode to serialize property changes to dom nodes as attributes.\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} propertyName\n     * @param {?} propertyValue\n     * @return {?}\n     */\n    Renderer.prototype.setBindingDebugInfo = function (renderElement, propertyName, propertyValue) { };\n    /**\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} className\n     * @param {?} isAdd\n     * @return {?}\n     */\n    Renderer.prototype.setElementClass = function (renderElement, className, isAdd) { };\n    /**\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} styleName\n     * @param {?} styleValue\n     * @return {?}\n     */\n    Renderer.prototype.setElementStyle = function (renderElement, styleName, styleValue) { };\n    /**\n     * @abstract\n     * @param {?} renderElement\n     * @param {?} methodName\n     * @param {?=} args\n     * @return {?}\n     */\n    Renderer.prototype.invokeElementMethod = function (renderElement, methodName, args) { };\n    /**\n     * @abstract\n     * @param {?} renderNode\n     * @param {?} text\n     * @return {?}\n     */\n    Renderer.prototype.setText = function (renderNode, text) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} startingStyles\n     * @param {?} keyframes\n     * @param {?} duration\n     * @param {?} delay\n     * @param {?} easing\n     * @param {?=} previousPlayers\n     * @return {?}\n     */\n    Renderer.prototype.animate = function (element, startingStyles, keyframes, duration, delay, easing, previousPlayers) { };\n    return Renderer;\n}());\nvar Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');\n/**\n * Injectable service that provides a low-level interface for modifying the UI.\n *\n * Use this service to bypass Angular's templating and make custom UI changes that can't be\n * expressed declaratively. For example if you need to set a property or an attribute whose name is\n * not statically known, use {\\@link Renderer#setElementProperty} or {\\@link\n * Renderer#setElementAttribute}\n * respectively.\n *\n * If you are implementing a custom renderer, you must implement this interface.\n *\n * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.\n *\n * @deprecated Use `RendererFactory2` instead.\n * @abstract\n */\nvar RootRenderer = (function () {\n    function RootRenderer() {\n    }\n    /**\n     * @abstract\n     * @param {?} componentType\n     * @return {?}\n     */\n    RootRenderer.prototype.renderComponent = function (componentType) { };\n    return RootRenderer;\n}());\n/**\n * \\@experimental\n * @abstract\n */\nvar RendererFactory2 = (function () {\n    function RendererFactory2() {\n    }\n    /**\n     * @abstract\n     * @param {?} hostElement\n     * @param {?} type\n     * @return {?}\n     */\n    RendererFactory2.prototype.createRenderer = function (hostElement, type) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RendererFactory2.prototype.begin = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RendererFactory2.prototype.end = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    RendererFactory2.prototype.whenRenderingDone = function () { };\n    return RendererFactory2;\n}());\nvar RendererStyleFlags2 = {};\nRendererStyleFlags2.Important = 1;\nRendererStyleFlags2.DashCase = 2;\nRendererStyleFlags2[RendererStyleFlags2.Important] = \"Important\";\nRendererStyleFlags2[RendererStyleFlags2.DashCase] = \"DashCase\";\n/**\n * \\@experimental\n * @abstract\n */\nvar Renderer2 = (function () {\n    function Renderer2() {\n    }\n    /**\n     * This field can be used to store arbitrary data on this renderer instance.\n     * This is useful for renderers that delegate to other renderers.\n     * @abstract\n     * @return {?}\n     */\n    Renderer2.prototype.data = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    Renderer2.prototype.destroy = function () { };\n    /**\n     * @abstract\n     * @param {?} name\n     * @param {?=} namespace\n     * @return {?}\n     */\n    Renderer2.prototype.createElement = function (name, namespace) { };\n    /**\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    Renderer2.prototype.createComment = function (value) { };\n    /**\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    Renderer2.prototype.createText = function (value) { };\n    /**\n     * @abstract\n     * @param {?} parent\n     * @param {?} newChild\n     * @return {?}\n     */\n    Renderer2.prototype.appendChild = function (parent, newChild) { };\n    /**\n     * @abstract\n     * @param {?} parent\n     * @param {?} newChild\n     * @param {?} refChild\n     * @return {?}\n     */\n    Renderer2.prototype.insertBefore = function (parent, newChild, refChild) { };\n    /**\n     * @abstract\n     * @param {?} parent\n     * @param {?} oldChild\n     * @return {?}\n     */\n    Renderer2.prototype.removeChild = function (parent, oldChild) { };\n    /**\n     * @abstract\n     * @param {?} selectorOrNode\n     * @return {?}\n     */\n    Renderer2.prototype.selectRootElement = function (selectorOrNode) { };\n    /**\n     * Attention: On WebWorkers, this will always return a value,\n     * as we are asking for a result synchronously. I.e.\n     * the caller can't rely on checking whether this is null or not.\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    Renderer2.prototype.parentNode = function (node) { };\n    /**\n     * Attention: On WebWorkers, this will always return a value,\n     * as we are asking for a result synchronously. I.e.\n     * the caller can't rely on checking whether this is null or not.\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    Renderer2.prototype.nextSibling = function (node) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @param {?=} namespace\n     * @return {?}\n     */\n    Renderer2.prototype.setAttribute = function (el, name, value, namespace) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @param {?=} namespace\n     * @return {?}\n     */\n    Renderer2.prototype.removeAttribute = function (el, name, namespace) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    Renderer2.prototype.addClass = function (el, name) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    Renderer2.prototype.removeClass = function (el, name) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} style\n     * @param {?} value\n     * @param {?=} flags\n     * @return {?}\n     */\n    Renderer2.prototype.setStyle = function (el, style, value, flags) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} style\n     * @param {?=} flags\n     * @return {?}\n     */\n    Renderer2.prototype.removeStyle = function (el, style, flags) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    Renderer2.prototype.setProperty = function (el, name, value) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @param {?} value\n     * @return {?}\n     */\n    Renderer2.prototype.setValue = function (node, value) { };\n    /**\n     * @abstract\n     * @param {?} target\n     * @param {?} eventName\n     * @param {?} callback\n     * @return {?}\n     */\n    Renderer2.prototype.listen = function (target, eventName, callback) { };\n    return Renderer2;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// Public API for render\nvar ElementRef = (function () {\n    /**\n     * @param {?} nativeElement\n     */\n    function ElementRef(nativeElement) {\n        this.nativeElement = nativeElement;\n    }\n    return ElementRef;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Used to load ng module factories.\n * \\@stable\n * @abstract\n */\nvar NgModuleFactoryLoader = (function () {\n    function NgModuleFactoryLoader() {\n    }\n    /**\n     * @abstract\n     * @param {?} path\n     * @return {?}\n     */\n    NgModuleFactoryLoader.prototype.load = function (path) { };\n    return NgModuleFactoryLoader;\n}());\nvar moduleFactories = new Map();\n/**\n * Registers a loaded module. Should only be called from generated NgModuleFactory code.\n * \\@experimental\n * @param {?} id\n * @param {?} factory\n * @return {?}\n */\nfunction registerModuleFactory(id, factory) {\n    var /** @type {?} */ existing = moduleFactories.get(id);\n    if (existing) {\n        throw new Error(\"Duplicate module registered for \" + id + \" - \" + existing.moduleType.name + \" vs \" + factory.moduleType.name);\n    }\n    moduleFactories.set(id, factory);\n}\n/**\n * @return {?}\n */\n/**\n * Returns the NgModuleFactory with the given id, if it exists and has been loaded.\n * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module\n * cannot be found.\n * \\@experimental\n * @param {?} id\n * @return {?}\n */\nfunction getModuleFactory(id) {\n    var /** @type {?} */ factory = moduleFactories.get(id);\n    if (!factory)\n        throw new Error(\"No module with ID \" + id + \" loaded\");\n    return factory;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {\\@link ViewChildren}, {\\@link ContentChildren}, and {\\@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * ### Example ([live demo](http://plnkr.co/edit/RX8sJnQYl9FWuSCWme5z?p=preview))\n * ```typescript\n * \\@Component({...})\n * class Container {\n *   \\@ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n * \\@stable\n */\nvar QueryList = (function () {\n    function QueryList() {\n        this._dirty = true;\n        this._results = [];\n        this._emitter = new EventEmitter();\n    }\n    Object.defineProperty(QueryList.prototype, \"changes\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._emitter; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(QueryList.prototype, \"length\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._results.length; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(QueryList.prototype, \"first\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._results[0]; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(QueryList.prototype, \"last\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._results[this.length - 1]; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * See\n     * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n     * @template U\n     * @param {?} fn\n     * @return {?}\n     */\n    QueryList.prototype.map = function (fn) { return this._results.map(fn); };\n    /**\n     * See\n     * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n     * @param {?} fn\n     * @return {?}\n     */\n    QueryList.prototype.filter = function (fn) {\n        return this._results.filter(fn);\n    };\n    /**\n     * See\n     * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n     * @param {?} fn\n     * @return {?}\n     */\n    QueryList.prototype.find = function (fn) {\n        return this._results.find(fn);\n    };\n    /**\n     * See\n     * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n     * @template U\n     * @param {?} fn\n     * @param {?} init\n     * @return {?}\n     */\n    QueryList.prototype.reduce = function (fn, init) {\n        return this._results.reduce(fn, init);\n    };\n    /**\n     * See\n     * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n     * @param {?} fn\n     * @return {?}\n     */\n    QueryList.prototype.forEach = function (fn) { this._results.forEach(fn); };\n    /**\n     * See\n     * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n     * @param {?} fn\n     * @return {?}\n     */\n    QueryList.prototype.some = function (fn) {\n        return this._results.some(fn);\n    };\n    /**\n     * @return {?}\n     */\n    QueryList.prototype.toArray = function () { return this._results.slice(); };\n    /**\n     * @return {?}\n     */\n    QueryList.prototype[getSymbolIterator()] = function () { return ((this._results))[getSymbolIterator()](); };\n    /**\n     * @return {?}\n     */\n    QueryList.prototype.toString = function () { return this._results.toString(); };\n    /**\n     * @param {?} res\n     * @return {?}\n     */\n    QueryList.prototype.reset = function (res) {\n        this._results = flatten(res);\n        this._dirty = false;\n    };\n    /**\n     * @return {?}\n     */\n    QueryList.prototype.notifyOnChanges = function () { this._emitter.emit(this); };\n    /**\n     * internal\n     * @return {?}\n     */\n    QueryList.prototype.setDirty = function () { this._dirty = true; };\n    Object.defineProperty(QueryList.prototype, \"dirty\", {\n        /**\n         * internal\n         * @return {?}\n         */\n        get: function () { return this._dirty; },\n        enumerable: true,\n        configurable: true\n    });\n    return QueryList;\n}());\n/**\n * @template T\n * @param {?} list\n * @return {?}\n */\nfunction flatten(list) {\n    return list.reduce(function (flat, item) {\n        var /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;\n        return ((flat)).concat(flatItem);\n    }, []);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _SEPARATOR = '#';\nvar FACTORY_CLASS_SUFFIX = 'NgFactory';\n/**\n * Configuration for SystemJsNgModuleLoader.\n * token.\n *\n * \\@experimental\n * @abstract\n */\nvar SystemJsNgModuleLoaderConfig = (function () {\n    function SystemJsNgModuleLoaderConfig() {\n    }\n    return SystemJsNgModuleLoaderConfig;\n}());\nvar DEFAULT_CONFIG = {\n    factoryPathPrefix: '',\n    factoryPathSuffix: '.ngfactory',\n};\n/**\n * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n * \\@experimental\n */\nvar SystemJsNgModuleLoader = (function () {\n    /**\n     * @param {?} _compiler\n     * @param {?=} config\n     */\n    function SystemJsNgModuleLoader(_compiler, config) {\n        this._compiler = _compiler;\n        this._config = config || DEFAULT_CONFIG;\n    }\n    /**\n     * @param {?} path\n     * @return {?}\n     */\n    SystemJsNgModuleLoader.prototype.load = function (path) {\n        var /** @type {?} */ offlineMode = this._compiler instanceof Compiler;\n        return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n    };\n    /**\n     * @param {?} path\n     * @return {?}\n     */\n    SystemJsNgModuleLoader.prototype.loadAndCompile = function (path) {\n        var _this = this;\n        var _a = path.split(_SEPARATOR), module = _a[0], exportName = _a[1];\n        if (exportName === undefined) {\n            exportName = 'default';\n        }\n        return System.import(module)\n            .then(function (module) { return module[exportName]; })\n            .then(function (type) { return checkNotEmpty(type, module, exportName); })\n            .then(function (type) { return _this._compiler.compileModuleAsync(type); });\n    };\n    /**\n     * @param {?} path\n     * @return {?}\n     */\n    SystemJsNgModuleLoader.prototype.loadFactory = function (path) {\n        var _a = path.split(_SEPARATOR), module = _a[0], exportName = _a[1];\n        var /** @type {?} */ factoryClassSuffix = FACTORY_CLASS_SUFFIX;\n        if (exportName === undefined) {\n            exportName = 'default';\n            factoryClassSuffix = '';\n        }\n        return System.import(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)\n            .then(function (module) { return module[exportName + factoryClassSuffix]; })\n            .then(function (factory) { return checkNotEmpty(factory, module, exportName); });\n    };\n    return SystemJsNgModuleLoader;\n}());\nSystemJsNgModuleLoader.decorators = [\n    { type: Injectable },\n];\n/**\n * @nocollapse\n */\nSystemJsNgModuleLoader.ctorParameters = function () { return [\n    { type: Compiler, },\n    { type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional },] },\n]; };\n/**\n * @param {?} value\n * @param {?} modulePath\n * @param {?} exportName\n * @return {?}\n */\nfunction checkNotEmpty(value, modulePath, exportName) {\n    if (!value) {\n        throw new Error(\"Cannot find '\" + exportName + \"' in '\" + modulePath + \"'\");\n    }\n    return value;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Represents an Embedded Template that can be used to instantiate Embedded Views.\n *\n * You can access a `TemplateRef`, in two ways. Via a directive placed on a `<ng-template>` element\n * (or directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into\n * the constructor of the directive using the `TemplateRef` Token. Alternatively you can query for\n * the `TemplateRef` from a Component or a Directive via {\\@link Query}.\n *\n * To instantiate Embedded Views based on a Template, use\n * {\\@link ViewContainerRef#createEmbeddedView}, which will create the View and attach it to the\n * View Container.\n * \\@stable\n * @abstract\n */\nvar TemplateRef = (function () {\n    function TemplateRef() {\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    TemplateRef.prototype.elementRef = function () { };\n    /**\n     * @abstract\n     * @param {?} context\n     * @return {?}\n     */\n    TemplateRef.prototype.createEmbeddedView = function (context) { };\n    return TemplateRef;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Represents a container where one or more Views can be attached.\n *\n * The container can contain two kinds of Views. Host Views, created by instantiating a\n * {\\@link Component} via {\\@link #createComponent}, and Embedded Views, created by instantiating an\n * {\\@link TemplateRef Embedded Template} via {\\@link #createEmbeddedView}.\n *\n * The location of the View Container within the containing View is specified by the Anchor\n * `element`. Each View Container can have only one Anchor Element and each Anchor Element can only\n * have a single View Container.\n *\n * Root elements of Views attached to this container become siblings of the Anchor Element in\n * the Rendered View.\n *\n * To access a `ViewContainerRef` of an Element, you can either place a {\\@link Directive} injected\n * with `ViewContainerRef` on the Element, or you obtain it via a {\\@link ViewChild} query.\n * \\@stable\n * @abstract\n */\nvar ViewContainerRef = (function () {\n    function ViewContainerRef() {\n    }\n    /**\n     * Anchor element that specifies the location of this container in the containing View.\n     * <!-- TODO: rename to anchorElement -->\n     * @abstract\n     * @return {?}\n     */\n    ViewContainerRef.prototype.element = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ViewContainerRef.prototype.injector = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ViewContainerRef.prototype.parentInjector = function () { };\n    /**\n     * Destroys all Views in this container.\n     * @abstract\n     * @return {?}\n     */\n    ViewContainerRef.prototype.clear = function () { };\n    /**\n     * Returns the {\\@link ViewRef} for the View located in this container at the specified index.\n     * @abstract\n     * @param {?} index\n     * @return {?}\n     */\n    ViewContainerRef.prototype.get = function (index) { };\n    /**\n     * Returns the number of Views currently attached to this container.\n     * @abstract\n     * @return {?}\n     */\n    ViewContainerRef.prototype.length = function () { };\n    /**\n     * Instantiates an Embedded View based on the {\\@link TemplateRef `templateRef`} and inserts it\n     * into this container at the specified `index`.\n     *\n     * If `index` is not specified, the new View will be inserted as the last View in the container.\n     *\n     * Returns the {\\@link ViewRef} for the newly created View.\n     * @abstract\n     * @template C\n     * @param {?} templateRef\n     * @param {?=} context\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef.prototype.createEmbeddedView = function (templateRef, context, index) { };\n    /**\n     * Instantiates a single {\\@link Component} and inserts its Host View into this container at the\n     * specified `index`.\n     *\n     * The component is instantiated using its {\\@link ComponentFactory} which can be\n     * obtained via {\\@link ComponentFactoryResolver#resolveComponentFactory}.\n     *\n     * If `index` is not specified, the new View will be inserted as the last View in the container.\n     *\n     * You can optionally specify the {\\@link Injector} that will be used as parent for the Component.\n     *\n     * Returns the {\\@link ComponentRef} of the Host View created for the newly instantiated Component.\n     * @abstract\n     * @template C\n     * @param {?} componentFactory\n     * @param {?=} index\n     * @param {?=} injector\n     * @param {?=} projectableNodes\n     * @param {?=} ngModule\n     * @return {?}\n     */\n    ViewContainerRef.prototype.createComponent = function (componentFactory, index, injector, projectableNodes, ngModule) { };\n    /**\n     * Inserts a View identified by a {\\@link ViewRef} into the container at the specified `index`.\n     *\n     * If `index` is not specified, the new View will be inserted as the last View in the container.\n     *\n     * Returns the inserted {\\@link ViewRef}.\n     * @abstract\n     * @param {?} viewRef\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef.prototype.insert = function (viewRef, index) { };\n    /**\n     * Moves a View identified by a {\\@link ViewRef} into the container at the specified `index`.\n     *\n     * Returns the inserted {\\@link ViewRef}.\n     * @abstract\n     * @param {?} viewRef\n     * @param {?} currentIndex\n     * @return {?}\n     */\n    ViewContainerRef.prototype.move = function (viewRef, currentIndex) { };\n    /**\n     * Returns the index of the View, specified via {\\@link ViewRef}, within the current container or\n     * `-1` if this container doesn't contain the View.\n     * @abstract\n     * @param {?} viewRef\n     * @return {?}\n     */\n    ViewContainerRef.prototype.indexOf = function (viewRef) { };\n    /**\n     * Destroys a View attached to this container at the specified `index`.\n     *\n     * If `index` is not specified, the last View in the container will be removed.\n     * @abstract\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef.prototype.remove = function (index) { };\n    /**\n     * Use along with {\\@link #insert} to move a View within the current container.\n     *\n     * If the `index` param is omitted, the last {\\@link ViewRef} is detached.\n     * @abstract\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef.prototype.detach = function (index) { };\n    return ViewContainerRef;\n}());\n/**\n * \\@stable\n * @abstract\n */\nvar ChangeDetectorRef = (function () {\n    function ChangeDetectorRef() {\n    }\n    /**\n     * Marks all {\\@link ChangeDetectionStrategy#OnPush} ancestors as to be checked.\n     *\n     * <!-- TODO: Add a link to a chapter on OnPush components -->\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/GC512b?p=preview))\n     *\n     * ```typescript\n     * \\@Component({\n     *   selector: 'cmp',\n     *   changeDetection: ChangeDetectionStrategy.OnPush,\n     *   template: `Number of ticks: {{numberOfTicks}}`\n     * })\n     * class Cmp {\n     *   numberOfTicks = 0;\n     *\n     *   constructor(ref: ChangeDetectorRef) {\n     *     setInterval(() => {\n     *       this.numberOfTicks ++\n     *       // the following is required, otherwise the view will not be updated\n     *       this.ref.markForCheck();\n     *     }, 1000);\n     *   }\n     * }\n     *\n     * \\@Component({\n     *   selector: 'app',\n     *   changeDetection: ChangeDetectionStrategy.OnPush,\n     *   template: `\n     *     <cmp><cmp>\n     *   `,\n     * })\n     * class App {\n     * }\n     * ```\n     * @abstract\n     * @return {?}\n     */\n    ChangeDetectorRef.prototype.markForCheck = function () { };\n    /**\n     * Detaches the change detector from the change detector tree.\n     *\n     * The detached change detector will not be checked until it is reattached.\n     *\n     * This can also be used in combination with {\\@link ChangeDetectorRef#detectChanges} to implement\n     * local change\n     * detection checks.\n     *\n     * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n     * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n     *\n     * ### Example\n     *\n     * The following example defines a component with a large list of readonly data.\n     * Imagine the data changes constantly, many times per second. For performance reasons,\n     * we want to check and update the list every five seconds. We can do that by detaching\n     * the component's change detector and doing a local check every five seconds.\n     *\n     * ```typescript\n     * class DataProvider {\n     *   // in a real application the returned data will be different every time\n     *   get data() {\n     *     return [1,2,3,4,5];\n     *   }\n     * }\n     *\n     * \\@Component({\n     *   selector: 'giant-list',\n     *   template: `\n     *     <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</lig>\n     *   `,\n     * })\n     * class GiantList {\n     *   constructor(private ref: ChangeDetectorRef, private dataProvider:DataProvider) {\n     *     ref.detach();\n     *     setInterval(() => {\n     *       this.ref.detectChanges();\n     *     }, 5000);\n     *   }\n     * }\n     *\n     * \\@Component({\n     *   selector: 'app',\n     *   providers: [DataProvider],\n     *   template: `\n     *     <giant-list><giant-list>\n     *   `,\n     * })\n     * class App {\n     * }\n     * ```\n     * @abstract\n     * @return {?}\n     */\n    ChangeDetectorRef.prototype.detach = function () { };\n    /**\n     * Checks the change detector and its children.\n     *\n     * This can also be used in combination with {\\@link ChangeDetectorRef#detach} to implement local\n     * change detection\n     * checks.\n     *\n     * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n     * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n     *\n     * ### Example\n     *\n     * The following example defines a component with a large list of readonly data.\n     * Imagine, the data changes constantly, many times per second. For performance reasons,\n     * we want to check and update the list every five seconds.\n     *\n     * We can do that by detaching the component's change detector and doing a local change detection\n     * check\n     * every five seconds.\n     *\n     * See {\\@link ChangeDetectorRef#detach} for more information.\n     * @abstract\n     * @return {?}\n     */\n    ChangeDetectorRef.prototype.detectChanges = function () { };\n    /**\n     * Checks the change detector and its children, and throws if any changes are detected.\n     *\n     * This is used in development mode to verify that running change detection doesn't introduce\n     * other changes.\n     * @abstract\n     * @return {?}\n     */\n    ChangeDetectorRef.prototype.checkNoChanges = function () { };\n    /**\n     * Reattach the change detector to the change detector tree.\n     *\n     * This also marks OnPush ancestors as to be checked. This reattached change detector will be\n     * checked during the next change detection run.\n     *\n     * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n     *\n     * ### Example ([live demo](http://plnkr.co/edit/aUhZha?p=preview))\n     *\n     * The following example creates a component displaying `live` data. The component will detach\n     * its change detector from the main change detector tree when the component's live property\n     * is set to false.\n     *\n     * ```typescript\n     * class DataProvider {\n     *   data = 1;\n     *\n     *   constructor() {\n     *     setInterval(() => {\n     *       this.data = this.data * 2;\n     *     }, 500);\n     *   }\n     * }\n     *\n     * \\@Component({\n     *   selector: 'live-data',\n     *   inputs: ['live'],\n     *   template: 'Data: {{dataProvider.data}}'\n     * })\n     * class LiveData {\n     *   constructor(private ref: ChangeDetectorRef, private dataProvider:DataProvider) {}\n     *\n     *   set live(value) {\n     *     if (value)\n     *       this.ref.reattach();\n     *     else\n     *       this.ref.detach();\n     *   }\n     * }\n     *\n     * \\@Component({\n     *   selector: 'app',\n     *   providers: [DataProvider],\n     *   template: `\n     *     Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n     *     <live-data [live]=\"live\"><live-data>\n     *   `,\n     * })\n     * class App {\n     *   live = true;\n     * }\n     * ```\n     * @abstract\n     * @return {?}\n     */\n    ChangeDetectorRef.prototype.reattach = function () { };\n    return ChangeDetectorRef;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@stable\n * @abstract\n */\nvar ViewRef = (function (_super) {\n    __extends(ViewRef, _super);\n    function ViewRef() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * Destroys the view and all of the data structures associated with it.\n     * @abstract\n     * @return {?}\n     */\n    ViewRef.prototype.destroy = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ViewRef.prototype.destroyed = function () { };\n    /**\n     * @abstract\n     * @param {?} callback\n     * @return {?}\n     */\n    ViewRef.prototype.onDestroy = function (callback) { };\n    return ViewRef;\n}(ChangeDetectorRef));\n/**\n * Represents an Angular View.\n *\n * <!-- TODO: move the next two paragraphs to the dev guide -->\n * A View is a fundamental building block of the application UI. It is the smallest grouping of\n * Elements which are created and destroyed together.\n *\n * Properties of elements in a View can change, but the structure (number and order) of elements in\n * a View cannot. Changing the structure of Elements can only be done by inserting, moving or\n * removing nested Views via a {\\@link ViewContainerRef}. Each View can contain many View Containers.\n * <!-- /TODO -->\n *\n * ### Example\n *\n * Given this template...\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n *   <li *ngFor=\"let  item of items\">{{item}}</li>\n * </ul>\n * ```\n *\n * We have two {\\@link TemplateRef}s:\n *\n * Outer {\\@link TemplateRef}:\n * ```\n * Count: {{items.length}}\n * <ul>\n *   <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n * </ul>\n * ```\n *\n * Inner {\\@link TemplateRef}:\n * ```\n *   <li>{{item}}</li>\n * ```\n *\n * Notice that the original template is broken down into two separate {\\@link TemplateRef}s.\n *\n * The outer/inner {\\@link TemplateRef}s are then assembled into views like so:\n *\n * ```\n * <!-- ViewRef: outer-0 -->\n * Count: 2\n * <ul>\n *   <ng-template view-container-ref></ng-template>\n *   <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n *   <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n * </ul>\n * <!-- /ViewRef: outer-0 -->\n * ```\n * \\@experimental\n * @abstract\n */\nvar EmbeddedViewRef = (function (_super) {\n    __extends(EmbeddedViewRef, _super);\n    function EmbeddedViewRef() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    EmbeddedViewRef.prototype.context = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    EmbeddedViewRef.prototype.rootNodes = function () { };\n    return EmbeddedViewRef;\n}(ViewRef));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// Public API for compiler\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar EventListener = (function () {\n    /**\n     * @param {?} name\n     * @param {?} callback\n     */\n    function EventListener(name, callback) {\n        this.name = name;\n        this.callback = callback;\n    }\n    \n    return EventListener;\n}());\n/**\n * \\@experimental All debugging apis are currently experimental.\n */\nvar DebugNode = (function () {\n    /**\n     * @param {?} nativeNode\n     * @param {?} parent\n     * @param {?} _debugContext\n     */\n    function DebugNode(nativeNode, parent, _debugContext) {\n        this._debugContext = _debugContext;\n        this.nativeNode = nativeNode;\n        if (parent && parent instanceof DebugElement) {\n            parent.addChild(this);\n        }\n        else {\n            this.parent = null;\n        }\n        this.listeners = [];\n    }\n    Object.defineProperty(DebugNode.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._debugContext.injector; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugNode.prototype, \"componentInstance\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._debugContext.component; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugNode.prototype, \"context\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._debugContext.context; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugNode.prototype, \"references\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._debugContext.references; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugNode.prototype, \"providerTokens\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._debugContext.providerTokens; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugNode.prototype, \"source\", {\n        /**\n         * @deprecated since v4\n         * @return {?}\n         */\n        get: function () { return 'Deprecated since v4'; },\n        enumerable: true,\n        configurable: true\n    });\n    return DebugNode;\n}());\n/**\n * \\@experimental All debugging apis are currently experimental.\n */\nvar DebugElement = (function (_super) {\n    __extends(DebugElement, _super);\n    /**\n     * @param {?} nativeNode\n     * @param {?} parent\n     * @param {?} _debugContext\n     */\n    function DebugElement(nativeNode, parent, _debugContext) {\n        var _this = _super.call(this, nativeNode, parent, _debugContext) || this;\n        _this.properties = {};\n        _this.attributes = {};\n        _this.classes = {};\n        _this.styles = {};\n        _this.childNodes = [];\n        _this.nativeElement = nativeNode;\n        return _this;\n    }\n    /**\n     * @param {?} child\n     * @return {?}\n     */\n    DebugElement.prototype.addChild = function (child) {\n        if (child) {\n            this.childNodes.push(child);\n            child.parent = this;\n        }\n    };\n    /**\n     * @param {?} child\n     * @return {?}\n     */\n    DebugElement.prototype.removeChild = function (child) {\n        var /** @type {?} */ childIndex = this.childNodes.indexOf(child);\n        if (childIndex !== -1) {\n            child.parent = null;\n            this.childNodes.splice(childIndex, 1);\n        }\n    };\n    /**\n     * @param {?} child\n     * @param {?} newChildren\n     * @return {?}\n     */\n    DebugElement.prototype.insertChildrenAfter = function (child, newChildren) {\n        var _this = this;\n        var /** @type {?} */ siblingIndex = this.childNodes.indexOf(child);\n        if (siblingIndex !== -1) {\n            (_a = this.childNodes).splice.apply(_a, [siblingIndex + 1, 0].concat(newChildren));\n            newChildren.forEach(function (c) {\n                if (c.parent) {\n                    c.parent.removeChild(c);\n                }\n                c.parent = _this;\n            });\n        }\n        var _a;\n    };\n    /**\n     * @param {?} refChild\n     * @param {?} newChild\n     * @return {?}\n     */\n    DebugElement.prototype.insertBefore = function (refChild, newChild) {\n        var /** @type {?} */ refIndex = this.childNodes.indexOf(refChild);\n        if (refIndex === -1) {\n            this.addChild(newChild);\n        }\n        else {\n            if (newChild.parent) {\n                newChild.parent.removeChild(newChild);\n            }\n            newChild.parent = this;\n            this.childNodes.splice(refIndex, 0, newChild);\n        }\n    };\n    /**\n     * @param {?} predicate\n     * @return {?}\n     */\n    DebugElement.prototype.query = function (predicate) {\n        var /** @type {?} */ results = this.queryAll(predicate);\n        return results[0] || null;\n    };\n    /**\n     * @param {?} predicate\n     * @return {?}\n     */\n    DebugElement.prototype.queryAll = function (predicate) {\n        var /** @type {?} */ matches = [];\n        _queryElementChildren(this, predicate, matches);\n        return matches;\n    };\n    /**\n     * @param {?} predicate\n     * @return {?}\n     */\n    DebugElement.prototype.queryAllNodes = function (predicate) {\n        var /** @type {?} */ matches = [];\n        _queryNodeChildren(this, predicate, matches);\n        return matches;\n    };\n    Object.defineProperty(DebugElement.prototype, \"children\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return (this.childNodes.filter(function (node) { return node instanceof DebugElement; }));\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} eventName\n     * @param {?} eventObj\n     * @return {?}\n     */\n    DebugElement.prototype.triggerEventHandler = function (eventName, eventObj) {\n        this.listeners.forEach(function (listener) {\n            if (listener.name == eventName) {\n                listener.callback(eventObj);\n            }\n        });\n    };\n    return DebugElement;\n}(DebugNode));\n/**\n * \\@experimental\n * @param {?} debugEls\n * @return {?}\n */\nfunction asNativeElements(debugEls) {\n    return debugEls.map(function (el) { return el.nativeElement; });\n}\n/**\n * @param {?} element\n * @param {?} predicate\n * @param {?} matches\n * @return {?}\n */\nfunction _queryElementChildren(element, predicate, matches) {\n    element.childNodes.forEach(function (node) {\n        if (node instanceof DebugElement) {\n            if (predicate(node)) {\n                matches.push(node);\n            }\n            _queryElementChildren(node, predicate, matches);\n        }\n    });\n}\n/**\n * @param {?} parentNode\n * @param {?} predicate\n * @param {?} matches\n * @return {?}\n */\nfunction _queryNodeChildren(parentNode, predicate, matches) {\n    if (parentNode instanceof DebugElement) {\n        parentNode.childNodes.forEach(function (node) {\n            if (predicate(node)) {\n                matches.push(node);\n            }\n            if (node instanceof DebugElement) {\n                _queryNodeChildren(node, predicate, matches);\n            }\n        });\n    }\n}\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nvar _nativeNodeToDebugNode = new Map();\n/**\n * \\@experimental\n * @param {?} nativeNode\n * @return {?}\n */\nfunction getDebugNode(nativeNode) {\n    return _nativeNodeToDebugNode.get(nativeNode) || null;\n}\n/**\n * @return {?}\n */\n/**\n * @param {?} node\n * @return {?}\n */\nfunction indexDebugNode(node) {\n    _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\n/**\n * @param {?} node\n * @return {?}\n */\nfunction removeDebugNodeFromIndex(node) {\n    _nativeNodeToDebugNode.delete(node.nativeNode);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction devModeEqual(a, b) {\n    var /** @type {?} */ isListLikeIterableA = isListLikeIterable(a);\n    var /** @type {?} */ isListLikeIterableB = isListLikeIterable(b);\n    if (isListLikeIterableA && isListLikeIterableB) {\n        return areIterablesEqual(a, b, devModeEqual);\n    }\n    else {\n        var /** @type {?} */ isAObject = a && (typeof a === 'object' || typeof a === 'function');\n        var /** @type {?} */ isBObject = b && (typeof b === 'object' || typeof b === 'function');\n        if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n            return true;\n        }\n        else {\n            return looseIdentical(a, b);\n        }\n    }\n}\n/**\n * Indicates that the result of a {\\@link Pipe} transformation has changed even though the\n * reference\n * has not changed.\n *\n * The wrapped value will be unwrapped by change detection, and the unwrapped value will be stored.\n *\n * Example:\n *\n * ```\n * if (this._latestValue === this._latestReturnedValue) {\n *    return this._latestReturnedValue;\n *  } else {\n *    this._latestReturnedValue = this._latestValue;\n *    return WrappedValue.wrap(this._latestValue); // this will force update\n *  }\n * ```\n * \\@stable\n */\nvar WrappedValue = (function () {\n    /**\n     * @param {?} wrapped\n     */\n    function WrappedValue(wrapped) {\n        this.wrapped = wrapped;\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    WrappedValue.wrap = function (value) { return new WrappedValue(value); };\n    return WrappedValue;\n}());\n/**\n * Helper class for unwrapping WrappedValue s\n */\nvar ValueUnwrapper = (function () {\n    function ValueUnwrapper() {\n        this.hasWrappedValue = false;\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    ValueUnwrapper.prototype.unwrap = function (value) {\n        if (value instanceof WrappedValue) {\n            this.hasWrappedValue = true;\n            return value.wrapped;\n        }\n        return value;\n    };\n    /**\n     * @return {?}\n     */\n    ValueUnwrapper.prototype.reset = function () { this.hasWrappedValue = false; };\n    return ValueUnwrapper;\n}());\n/**\n * Represents a basic change from a previous to a new value.\n * \\@stable\n */\nvar SimpleChange = (function () {\n    /**\n     * @param {?} previousValue\n     * @param {?} currentValue\n     * @param {?} firstChange\n     */\n    function SimpleChange(previousValue, currentValue, firstChange) {\n        this.previousValue = previousValue;\n        this.currentValue = currentValue;\n        this.firstChange = firstChange;\n    }\n    /**\n     * Check whether the new value is the first value assigned.\n     * @return {?}\n     */\n    SimpleChange.prototype.isFirstChange = function () { return this.firstChange; };\n    return SimpleChange;\n}());\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction isListLikeIterable(obj) {\n    if (!isJsObject(obj))\n        return false;\n    return Array.isArray(obj) ||\n        (!(obj instanceof Map) &&\n            getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop\n}\n/**\n * @param {?} a\n * @param {?} b\n * @param {?} comparator\n * @return {?}\n */\nfunction areIterablesEqual(a, b, comparator) {\n    var /** @type {?} */ iterator1 = a[getSymbolIterator()]();\n    var /** @type {?} */ iterator2 = b[getSymbolIterator()]();\n    while (true) {\n        var /** @type {?} */ item1 = iterator1.next();\n        var /** @type {?} */ item2 = iterator2.next();\n        if (item1.done && item2.done)\n            return true;\n        if (item1.done || item2.done)\n            return false;\n        if (!comparator(item1.value, item2.value))\n            return false;\n    }\n}\n/**\n * @param {?} obj\n * @param {?} fn\n * @return {?}\n */\nfunction iterateListLike(obj, fn) {\n    if (Array.isArray(obj)) {\n        for (var /** @type {?} */ i = 0; i < obj.length; i++) {\n            fn(obj[i]);\n        }\n    }\n    else {\n        var /** @type {?} */ iterator = obj[getSymbolIterator()]();\n        var /** @type {?} */ item = void 0;\n        while (!((item = iterator.next()).done)) {\n            fn(item.value);\n        }\n    }\n}\n/**\n * @param {?} o\n * @return {?}\n */\nfunction isJsObject(o) {\n    return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar DefaultIterableDifferFactory = (function () {\n    function DefaultIterableDifferFactory() {\n    }\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    DefaultIterableDifferFactory.prototype.supports = function (obj) { return isListLikeIterable(obj); };\n    /**\n     * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter\n     * @template V\n     * @param {?=} cdRefOrTrackBy\n     * @param {?=} trackByFn\n     * @return {?}\n     */\n    DefaultIterableDifferFactory.prototype.create = function (cdRefOrTrackBy, trackByFn) {\n        return new DefaultIterableDiffer(trackByFn || (cdRefOrTrackBy));\n    };\n    return DefaultIterableDifferFactory;\n}());\nvar trackByIdentity = function (index, item) { return item; };\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n */\nvar DefaultIterableDiffer = (function () {\n    /**\n     * @param {?=} trackByFn\n     */\n    function DefaultIterableDiffer(trackByFn) {\n        this._length = 0;\n        this._collection = null;\n        this._linkedRecords = null;\n        this._unlinkedRecords = null;\n        this._previousItHead = null;\n        this._itHead = null;\n        this._itTail = null;\n        this._additionsHead = null;\n        this._additionsTail = null;\n        this._movesHead = null;\n        this._movesTail = null;\n        this._removalsHead = null;\n        this._removalsTail = null;\n        this._identityChangesHead = null;\n        this._identityChangesTail = null;\n        this._trackByFn = trackByFn || trackByIdentity;\n    }\n    Object.defineProperty(DefaultIterableDiffer.prototype, \"collection\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._collection; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DefaultIterableDiffer.prototype, \"length\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._length; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._itHead; record !== null; record = record._next) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachOperation = function (fn) {\n        var /** @type {?} */ nextIt = this._itHead;\n        var /** @type {?} */ nextRemove = this._removalsHead;\n        var /** @type {?} */ addRemoveOffset = 0;\n        var /** @type {?} */ moveOffsets = null;\n        while (nextIt || nextRemove) {\n            // Figure out which is the next record to process\n            // Order: remove, add, move\n            var /** @type {?} */ record = !nextRemove ||\n                nextIt && ((nextIt.currentIndex)) <\n                    getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? ((nextIt)) :\n                nextRemove;\n            var /** @type {?} */ adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n            var /** @type {?} */ currentIndex = record.currentIndex;\n            // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n            if (record === nextRemove) {\n                addRemoveOffset--;\n                nextRemove = nextRemove._nextRemoved;\n            }\n            else {\n                nextIt = ((nextIt))._next;\n                if (record.previousIndex == null) {\n                    addRemoveOffset++;\n                }\n                else {\n                    // INVARIANT:  currentIndex < previousIndex\n                    if (!moveOffsets)\n                        moveOffsets = [];\n                    var /** @type {?} */ localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n                    var /** @type {?} */ localCurrentIndex = ((currentIndex)) - addRemoveOffset;\n                    if (localMovePreviousIndex != localCurrentIndex) {\n                        for (var /** @type {?} */ i = 0; i < localMovePreviousIndex; i++) {\n                            var /** @type {?} */ offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n                            var /** @type {?} */ index = offset + i;\n                            if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n                                moveOffsets[i] = offset + 1;\n                            }\n                        }\n                        var /** @type {?} */ previousIndex = record.previousIndex;\n                        moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n                    }\n                }\n            }\n            if (adjPreviousIndex !== currentIndex) {\n                fn(record, adjPreviousIndex, currentIndex);\n            }\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachPreviousItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachAddedItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachMovedItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._movesHead; record !== null; record = record._nextMoved) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachRemovedItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.forEachIdentityChange = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} collection\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.diff = function (collection) {\n        if (collection == null)\n            collection = [];\n        if (!isListLikeIterable(collection)) {\n            throw new Error(\"Error trying to diff '\" + stringify(collection) + \"'. Only arrays and iterables are allowed\");\n        }\n        if (this.check(collection)) {\n            return this;\n        }\n        else {\n            return null;\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.onDestroy = function () { };\n    /**\n     * @param {?} collection\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.check = function (collection) {\n        var _this = this;\n        this._reset();\n        var /** @type {?} */ record = this._itHead;\n        var /** @type {?} */ mayBeDirty = false;\n        var /** @type {?} */ index;\n        var /** @type {?} */ item;\n        var /** @type {?} */ itemTrackBy;\n        if (Array.isArray(collection)) {\n            this._length = collection.length;\n            for (var /** @type {?} */ index_1 = 0; index_1 < this._length; index_1++) {\n                item = collection[index_1];\n                itemTrackBy = this._trackByFn(index_1, item);\n                if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n                    record = this._mismatch(record, item, itemTrackBy, index_1);\n                    mayBeDirty = true;\n                }\n                else {\n                    if (mayBeDirty) {\n                        // TODO(misko): can we limit this to duplicates only?\n                        record = this._verifyReinsertion(record, item, itemTrackBy, index_1);\n                    }\n                    if (!looseIdentical(record.item, item))\n                        this._addIdentityChange(record, item);\n                }\n                record = record._next;\n            }\n        }\n        else {\n            index = 0;\n            iterateListLike(collection, function (item) {\n                itemTrackBy = _this._trackByFn(index, item);\n                if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n                    record = _this._mismatch(record, item, itemTrackBy, index);\n                    mayBeDirty = true;\n                }\n                else {\n                    if (mayBeDirty) {\n                        // TODO(misko): can we limit this to duplicates only?\n                        record = _this._verifyReinsertion(record, item, itemTrackBy, index);\n                    }\n                    if (!looseIdentical(record.item, item))\n                        _this._addIdentityChange(record, item);\n                }\n                record = record._next;\n                index++;\n            });\n            this._length = index;\n        }\n        this._truncate(record);\n        this._collection = collection;\n        return this.isDirty;\n    };\n    Object.defineProperty(DefaultIterableDiffer.prototype, \"isDirty\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return this._additionsHead !== null || this._movesHead !== null ||\n                this._removalsHead !== null || this._identityChangesHead !== null;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * Reset the state of the change objects to show no changes. This means set previousKey to\n     * currentKey, and clear all of the queues (additions, moves, removals).\n     * Set the previousIndexes of moved and added items to their currentIndexes\n     * Reset the list of additions, moves and removals\n     *\n     * \\@internal\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._reset = function () {\n        if (this.isDirty) {\n            var /** @type {?} */ record = void 0;\n            var /** @type {?} */ nextRecord = void 0;\n            for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n                record._nextPrevious = record._next;\n            }\n            for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n                record.previousIndex = record.currentIndex;\n            }\n            this._additionsHead = this._additionsTail = null;\n            for (record = this._movesHead; record !== null; record = nextRecord) {\n                record.previousIndex = record.currentIndex;\n                nextRecord = record._nextMoved;\n            }\n            this._movesHead = this._movesTail = null;\n            this._removalsHead = this._removalsTail = null;\n            this._identityChangesHead = this._identityChangesTail = null;\n            // todo(vicb) when assert gets supported\n            // assert(!this.isDirty);\n        }\n    };\n    /**\n     * This is the core function which handles differences between collections.\n     *\n     * - `record` is the record which we saw at this position last time. If null then it is a new\n     *   item.\n     * - `item` is the current item in the collection\n     * - `index` is the position of the item in the collection\n     *\n     * \\@internal\n     * @param {?} record\n     * @param {?} item\n     * @param {?} itemTrackBy\n     * @param {?} index\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._mismatch = function (record, item, itemTrackBy, index) {\n        // The previous record after which we will append the current one.\n        var /** @type {?} */ previousRecord;\n        if (record === null) {\n            previousRecord = ((this._itTail));\n        }\n        else {\n            previousRecord = ((record._prev));\n            // Remove the record from the collection since we know it does not match the item.\n            this._remove(record);\n        }\n        // Attempt to see if we have seen the item before.\n        record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n        if (record !== null) {\n            // We have seen this before, we need to move it forward in the collection.\n            // But first we need to check if identity changed, so we can update in view if necessary\n            if (!looseIdentical(record.item, item))\n                this._addIdentityChange(record, item);\n            this._moveAfter(record, previousRecord, index);\n        }\n        else {\n            // Never seen it, check evicted list.\n            record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n            if (record !== null) {\n                // It is an item which we have evicted earlier: reinsert it back into the list.\n                // But first we need to check if identity changed, so we can update in view if necessary\n                if (!looseIdentical(record.item, item))\n                    this._addIdentityChange(record, item);\n                this._reinsertAfter(record, previousRecord, index);\n            }\n            else {\n                // It is a new item: add it.\n                record =\n                    this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);\n            }\n        }\n        return record;\n    };\n    /**\n     * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n     *\n     * Use case: `[a, a]` => `[b, a, a]`\n     *\n     * If we did not have this check then the insertion of `b` would:\n     *   1) evict first `a`\n     *   2) insert `b` at `0` index.\n     *   3) leave `a` at index `1` as is. <-- this is wrong!\n     *   3) reinsert `a` at index 2. <-- this is wrong!\n     *\n     * The correct behavior is:\n     *   1) evict first `a`\n     *   2) insert `b` at `0` index.\n     *   3) reinsert `a` at index 1.\n     *   3) move `a` at from `1` to `2`.\n     *\n     *\n     * Double check that we have not evicted a duplicate item. We need to check if the item type may\n     * have already been removed:\n     * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n     * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n     * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n     * at the end.\n     *\n     * \\@internal\n     * @param {?} record\n     * @param {?} item\n     * @param {?} itemTrackBy\n     * @param {?} index\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._verifyReinsertion = function (record, item, itemTrackBy, index) {\n        var /** @type {?} */ reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n        if (reinsertRecord !== null) {\n            record = this._reinsertAfter(reinsertRecord, /** @type {?} */ ((record._prev)), index);\n        }\n        else if (record.currentIndex != index) {\n            record.currentIndex = index;\n            this._addToMoves(record, index);\n        }\n        return record;\n    };\n    /**\n     * Get rid of any excess {\\@link IterableChangeRecord_}s from the previous collection\n     *\n     * - `record` The first excess {\\@link IterableChangeRecord_}.\n     *\n     * \\@internal\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._truncate = function (record) {\n        // Anything after that needs to be removed;\n        while (record !== null) {\n            var /** @type {?} */ nextRecord = record._next;\n            this._addToRemovals(this._unlink(record));\n            record = nextRecord;\n        }\n        if (this._unlinkedRecords !== null) {\n            this._unlinkedRecords.clear();\n        }\n        if (this._additionsTail !== null) {\n            this._additionsTail._nextAdded = null;\n        }\n        if (this._movesTail !== null) {\n            this._movesTail._nextMoved = null;\n        }\n        if (this._itTail !== null) {\n            this._itTail._next = null;\n        }\n        if (this._removalsTail !== null) {\n            this._removalsTail._nextRemoved = null;\n        }\n        if (this._identityChangesTail !== null) {\n            this._identityChangesTail._nextIdentityChange = null;\n        }\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @param {?} prevRecord\n     * @param {?} index\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._reinsertAfter = function (record, prevRecord, index) {\n        if (this._unlinkedRecords !== null) {\n            this._unlinkedRecords.remove(record);\n        }\n        var /** @type {?} */ prev = record._prevRemoved;\n        var /** @type {?} */ next = record._nextRemoved;\n        if (prev === null) {\n            this._removalsHead = next;\n        }\n        else {\n            prev._nextRemoved = next;\n        }\n        if (next === null) {\n            this._removalsTail = prev;\n        }\n        else {\n            next._prevRemoved = prev;\n        }\n        this._insertAfter(record, prevRecord, index);\n        this._addToMoves(record, index);\n        return record;\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @param {?} prevRecord\n     * @param {?} index\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._moveAfter = function (record, prevRecord, index) {\n        this._unlink(record);\n        this._insertAfter(record, prevRecord, index);\n        this._addToMoves(record, index);\n        return record;\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @param {?} prevRecord\n     * @param {?} index\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._addAfter = function (record, prevRecord, index) {\n        this._insertAfter(record, prevRecord, index);\n        if (this._additionsTail === null) {\n            // todo(vicb)\n            // assert(this._additionsHead === null);\n            this._additionsTail = this._additionsHead = record;\n        }\n        else {\n            // todo(vicb)\n            // assert(_additionsTail._nextAdded === null);\n            // assert(record._nextAdded === null);\n            this._additionsTail = this._additionsTail._nextAdded = record;\n        }\n        return record;\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @param {?} prevRecord\n     * @param {?} index\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._insertAfter = function (record, prevRecord, index) {\n        // todo(vicb)\n        // assert(record != prevRecord);\n        // assert(record._next === null);\n        // assert(record._prev === null);\n        var /** @type {?} */ next = prevRecord === null ? this._itHead : prevRecord._next;\n        // todo(vicb)\n        // assert(next != record);\n        // assert(prevRecord != record);\n        record._next = next;\n        record._prev = prevRecord;\n        if (next === null) {\n            this._itTail = record;\n        }\n        else {\n            next._prev = record;\n        }\n        if (prevRecord === null) {\n            this._itHead = record;\n        }\n        else {\n            prevRecord._next = record;\n        }\n        if (this._linkedRecords === null) {\n            this._linkedRecords = new _DuplicateMap();\n        }\n        this._linkedRecords.put(record);\n        record.currentIndex = index;\n        return record;\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._remove = function (record) {\n        return this._addToRemovals(this._unlink(record));\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._unlink = function (record) {\n        if (this._linkedRecords !== null) {\n            this._linkedRecords.remove(record);\n        }\n        var /** @type {?} */ prev = record._prev;\n        var /** @type {?} */ next = record._next;\n        // todo(vicb)\n        // assert((record._prev = null) === null);\n        // assert((record._next = null) === null);\n        if (prev === null) {\n            this._itHead = next;\n        }\n        else {\n            prev._next = next;\n        }\n        if (next === null) {\n            this._itTail = prev;\n        }\n        else {\n            next._prev = prev;\n        }\n        return record;\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @param {?} toIndex\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._addToMoves = function (record, toIndex) {\n        // todo(vicb)\n        // assert(record._nextMoved === null);\n        if (record.previousIndex === toIndex) {\n            return record;\n        }\n        if (this._movesTail === null) {\n            // todo(vicb)\n            // assert(_movesHead === null);\n            this._movesTail = this._movesHead = record;\n        }\n        else {\n            // todo(vicb)\n            // assert(_movesTail._nextMoved === null);\n            this._movesTail = this._movesTail._nextMoved = record;\n        }\n        return record;\n    };\n    /**\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._addToRemovals = function (record) {\n        if (this._unlinkedRecords === null) {\n            this._unlinkedRecords = new _DuplicateMap();\n        }\n        this._unlinkedRecords.put(record);\n        record.currentIndex = null;\n        record._nextRemoved = null;\n        if (this._removalsTail === null) {\n            // todo(vicb)\n            // assert(_removalsHead === null);\n            this._removalsTail = this._removalsHead = record;\n            record._prevRemoved = null;\n        }\n        else {\n            // todo(vicb)\n            // assert(_removalsTail._nextRemoved === null);\n            // assert(record._nextRemoved === null);\n            record._prevRemoved = this._removalsTail;\n            this._removalsTail = this._removalsTail._nextRemoved = record;\n        }\n        return record;\n    };\n    /**\n     * \\@internal\n     * @param {?} record\n     * @param {?} item\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype._addIdentityChange = function (record, item) {\n        record.item = item;\n        if (this._identityChangesTail === null) {\n            this._identityChangesTail = this._identityChangesHead = record;\n        }\n        else {\n            this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n        }\n        return record;\n    };\n    /**\n     * @return {?}\n     */\n    DefaultIterableDiffer.prototype.toString = function () {\n        var /** @type {?} */ list = [];\n        this.forEachItem(function (record) { return list.push(record); });\n        var /** @type {?} */ previous = [];\n        this.forEachPreviousItem(function (record) { return previous.push(record); });\n        var /** @type {?} */ additions = [];\n        this.forEachAddedItem(function (record) { return additions.push(record); });\n        var /** @type {?} */ moves = [];\n        this.forEachMovedItem(function (record) { return moves.push(record); });\n        var /** @type {?} */ removals = [];\n        this.forEachRemovedItem(function (record) { return removals.push(record); });\n        var /** @type {?} */ identityChanges = [];\n        this.forEachIdentityChange(function (record) { return identityChanges.push(record); });\n        return 'collection: ' + list.join(', ') + '\\n' +\n            'previous: ' + previous.join(', ') + '\\n' +\n            'additions: ' + additions.join(', ') + '\\n' +\n            'moves: ' + moves.join(', ') + '\\n' +\n            'removals: ' + removals.join(', ') + '\\n' +\n            'identityChanges: ' + identityChanges.join(', ') + '\\n';\n    };\n    return DefaultIterableDiffer;\n}());\n/**\n * \\@stable\n */\nvar IterableChangeRecord_ = (function () {\n    /**\n     * @param {?} item\n     * @param {?} trackById\n     */\n    function IterableChangeRecord_(item, trackById) {\n        this.item = item;\n        this.trackById = trackById;\n        this.currentIndex = null;\n        this.previousIndex = null;\n        /**\n         * \\@internal\n         */\n        this._nextPrevious = null;\n        /**\n         * \\@internal\n         */\n        this._prev = null;\n        /**\n         * \\@internal\n         */\n        this._next = null;\n        /**\n         * \\@internal\n         */\n        this._prevDup = null;\n        /**\n         * \\@internal\n         */\n        this._nextDup = null;\n        /**\n         * \\@internal\n         */\n        this._prevRemoved = null;\n        /**\n         * \\@internal\n         */\n        this._nextRemoved = null;\n        /**\n         * \\@internal\n         */\n        this._nextAdded = null;\n        /**\n         * \\@internal\n         */\n        this._nextMoved = null;\n        /**\n         * \\@internal\n         */\n        this._nextIdentityChange = null;\n    }\n    /**\n     * @return {?}\n     */\n    IterableChangeRecord_.prototype.toString = function () {\n        return this.previousIndex === this.currentIndex ? stringify(this.item) :\n            stringify(this.item) + '[' +\n                stringify(this.previousIndex) + '->' + stringify(this.currentIndex) + ']';\n    };\n    return IterableChangeRecord_;\n}());\nvar _DuplicateItemRecordList = (function () {\n    function _DuplicateItemRecordList() {\n        /**\n         * \\@internal\n         */\n        this._head = null;\n        /**\n         * \\@internal\n         */\n        this._tail = null;\n    }\n    /**\n     * Append the record to the list of duplicates.\n     *\n     * Note: by design all records in the list of duplicates hold the same value in record.item.\n     * @param {?} record\n     * @return {?}\n     */\n    _DuplicateItemRecordList.prototype.add = function (record) {\n        if (this._head === null) {\n            this._head = this._tail = record;\n            record._nextDup = null;\n            record._prevDup = null;\n        }\n        else {\n            ((\n            // todo(vicb)\n            // assert(record.item ==  _head.item ||\n            //       record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n            this._tail))._nextDup = record;\n            record._prevDup = this._tail;\n            record._nextDup = null;\n            this._tail = record;\n        }\n    };\n    /**\n     * @param {?} trackById\n     * @param {?} afterIndex\n     * @return {?}\n     */\n    _DuplicateItemRecordList.prototype.get = function (trackById, afterIndex) {\n        var /** @type {?} */ record;\n        for (record = this._head; record !== null; record = record._nextDup) {\n            if ((afterIndex === null || afterIndex < ((record.currentIndex))) &&\n                looseIdentical(record.trackById, trackById)) {\n                return record;\n            }\n        }\n        return null;\n    };\n    /**\n     * Remove one {\\@link IterableChangeRecord_} from the list of duplicates.\n     *\n     * Returns whether the list of duplicates is empty.\n     * @param {?} record\n     * @return {?}\n     */\n    _DuplicateItemRecordList.prototype.remove = function (record) {\n        // todo(vicb)\n        // assert(() {\n        //  // verify that the record being removed is in the list.\n        //  for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n        //    if (identical(cursor, record)) return true;\n        //  }\n        //  return false;\n        //});\n        var /** @type {?} */ prev = record._prevDup;\n        var /** @type {?} */ next = record._nextDup;\n        if (prev === null) {\n            this._head = next;\n        }\n        else {\n            prev._nextDup = next;\n        }\n        if (next === null) {\n            this._tail = prev;\n        }\n        else {\n            next._prevDup = prev;\n        }\n        return this._head === null;\n    };\n    return _DuplicateItemRecordList;\n}());\nvar _DuplicateMap = (function () {\n    function _DuplicateMap() {\n        this.map = new Map();\n    }\n    /**\n     * @param {?} record\n     * @return {?}\n     */\n    _DuplicateMap.prototype.put = function (record) {\n        var /** @type {?} */ key = record.trackById;\n        var /** @type {?} */ duplicates = this.map.get(key);\n        if (!duplicates) {\n            duplicates = new _DuplicateItemRecordList();\n            this.map.set(key, duplicates);\n        }\n        duplicates.add(record);\n    };\n    /**\n     * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n     * have already iterated over, we use the afterIndex to pretend it is not there.\n     *\n     * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n     * have any more `a`s needs to return the last `a` not the first or second.\n     * @param {?} trackById\n     * @param {?} afterIndex\n     * @return {?}\n     */\n    _DuplicateMap.prototype.get = function (trackById, afterIndex) {\n        var /** @type {?} */ key = trackById;\n        var /** @type {?} */ recordList = this.map.get(key);\n        return recordList ? recordList.get(trackById, afterIndex) : null;\n    };\n    /**\n     * Removes a {\\@link IterableChangeRecord_} from the list of duplicates.\n     *\n     * The list of duplicates also is removed from the map if it gets empty.\n     * @param {?} record\n     * @return {?}\n     */\n    _DuplicateMap.prototype.remove = function (record) {\n        var /** @type {?} */ key = record.trackById;\n        var /** @type {?} */ recordList = ((this.map.get(key)));\n        // Remove the list of duplicates when it gets empty\n        if (recordList.remove(record)) {\n            this.map.delete(key);\n        }\n        return record;\n    };\n    Object.defineProperty(_DuplicateMap.prototype, \"isEmpty\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.map.size === 0; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    _DuplicateMap.prototype.clear = function () { this.map.clear(); };\n    /**\n     * @return {?}\n     */\n    _DuplicateMap.prototype.toString = function () { return '_DuplicateMap(' + stringify(this.map) + ')'; };\n    return _DuplicateMap;\n}());\n/**\n * @param {?} item\n * @param {?} addRemoveOffset\n * @param {?} moveOffsets\n * @return {?}\n */\nfunction getPreviousIndex(item, addRemoveOffset, moveOffsets) {\n    var /** @type {?} */ previousIndex = item.previousIndex;\n    if (previousIndex === null)\n        return previousIndex;\n    var /** @type {?} */ moveOffset = 0;\n    if (moveOffsets && previousIndex < moveOffsets.length) {\n        moveOffset = moveOffsets[previousIndex];\n    }\n    return previousIndex + addRemoveOffset + moveOffset;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar DefaultKeyValueDifferFactory = (function () {\n    function DefaultKeyValueDifferFactory() {\n    }\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    DefaultKeyValueDifferFactory.prototype.supports = function (obj) { return obj instanceof Map || isJsObject(obj); };\n    /**\n     * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter\n     * @template K, V\n     * @param {?=} cd\n     * @return {?}\n     */\n    DefaultKeyValueDifferFactory.prototype.create = function (cd) {\n        return new DefaultKeyValueDiffer();\n    };\n    return DefaultKeyValueDifferFactory;\n}());\nvar DefaultKeyValueDiffer = (function () {\n    function DefaultKeyValueDiffer() {\n        this._records = new Map();\n        this._mapHead = null;\n        this._appendAfter = null;\n        this._previousMapHead = null;\n        this._changesHead = null;\n        this._changesTail = null;\n        this._additionsHead = null;\n        this._additionsTail = null;\n        this._removalsHead = null;\n        this._removalsTail = null;\n    }\n    Object.defineProperty(DefaultKeyValueDiffer.prototype, \"isDirty\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return this._additionsHead !== null || this._changesHead !== null ||\n                this._removalsHead !== null;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.forEachItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._mapHead; record !== null; record = record._next) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.forEachPreviousItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.forEachChangedItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._changesHead; record !== null; record = record._nextChanged) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.forEachAddedItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.forEachRemovedItem = function (fn) {\n        var /** @type {?} */ record;\n        for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n            fn(record);\n        }\n    };\n    /**\n     * @param {?=} map\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.diff = function (map) {\n        if (!map) {\n            map = new Map();\n        }\n        else if (!(map instanceof Map || isJsObject(map))) {\n            throw new Error(\"Error trying to diff '\" + stringify(map) + \"'. Only maps and objects are allowed\");\n        }\n        return this.check(map) ? this : null;\n    };\n    /**\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.onDestroy = function () { };\n    /**\n     * Check the current state of the map vs the previous.\n     * The algorithm is optimised for when the keys do no change.\n     * @param {?} map\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.check = function (map) {\n        var _this = this;\n        this._reset();\n        var /** @type {?} */ insertBefore = this._mapHead;\n        this._appendAfter = null;\n        this._forEach(map, function (value, key) {\n            if (insertBefore && insertBefore.key === key) {\n                _this._maybeAddToChanges(insertBefore, value);\n                _this._appendAfter = insertBefore;\n                insertBefore = insertBefore._next;\n            }\n            else {\n                var /** @type {?} */ record = _this._getOrCreateRecordForKey(key, value);\n                insertBefore = _this._insertBeforeOrAppend(insertBefore, record);\n            }\n        });\n        // Items remaining at the end of the list have been deleted\n        if (insertBefore) {\n            if (insertBefore._prev) {\n                insertBefore._prev._next = null;\n            }\n            this._removalsHead = insertBefore;\n            for (var /** @type {?} */ record = insertBefore; record !== null; record = record._nextRemoved) {\n                if (record === this._mapHead) {\n                    this._mapHead = null;\n                }\n                this._records.delete(record.key);\n                record._nextRemoved = record._next;\n                record.previousValue = record.currentValue;\n                record.currentValue = null;\n                record._prev = null;\n                record._next = null;\n            }\n        }\n        // Make sure tails have no next records from previous runs\n        if (this._changesTail)\n            this._changesTail._nextChanged = null;\n        if (this._additionsTail)\n            this._additionsTail._nextAdded = null;\n        return this.isDirty;\n    };\n    /**\n     * Inserts a record before `before` or append at the end of the list when `before` is null.\n     *\n     * Notes:\n     * - This method appends at `this._appendAfter`,\n     * - This method updates `this._appendAfter`,\n     * - The return value is the new value for the insertion pointer.\n     * @param {?} before\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._insertBeforeOrAppend = function (before, record) {\n        if (before) {\n            var /** @type {?} */ prev = before._prev;\n            record._next = before;\n            record._prev = prev;\n            before._prev = record;\n            if (prev) {\n                prev._next = record;\n            }\n            if (before === this._mapHead) {\n                this._mapHead = record;\n            }\n            this._appendAfter = before;\n            return before;\n        }\n        if (this._appendAfter) {\n            this._appendAfter._next = record;\n            record._prev = this._appendAfter;\n        }\n        else {\n            this._mapHead = record;\n        }\n        this._appendAfter = record;\n        return null;\n    };\n    /**\n     * @param {?} key\n     * @param {?} value\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey = function (key, value) {\n        if (this._records.has(key)) {\n            var /** @type {?} */ record_1 = ((this._records.get(key)));\n            this._maybeAddToChanges(record_1, value);\n            var /** @type {?} */ prev = record_1._prev;\n            var /** @type {?} */ next = record_1._next;\n            if (prev) {\n                prev._next = next;\n            }\n            if (next) {\n                next._prev = prev;\n            }\n            record_1._next = null;\n            record_1._prev = null;\n            return record_1;\n        }\n        var /** @type {?} */ record = new KeyValueChangeRecord_(key);\n        this._records.set(key, record);\n        record.currentValue = value;\n        this._addToAdditions(record);\n        return record;\n    };\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._reset = function () {\n        if (this.isDirty) {\n            var /** @type {?} */ record = void 0;\n            // let `_previousMapHead` contain the state of the map before the changes\n            this._previousMapHead = this._mapHead;\n            for (record = this._previousMapHead; record !== null; record = record._next) {\n                record._nextPrevious = record._next;\n            }\n            // Update `record.previousValue` with the value of the item before the changes\n            // We need to update all changed items (that's those which have been added and changed)\n            for (record = this._changesHead; record !== null; record = record._nextChanged) {\n                record.previousValue = record.currentValue;\n            }\n            for (record = this._additionsHead; record != null; record = record._nextAdded) {\n                record.previousValue = record.currentValue;\n            }\n            this._changesHead = this._changesTail = null;\n            this._additionsHead = this._additionsTail = null;\n            this._removalsHead = null;\n        }\n    };\n    /**\n     * @param {?} record\n     * @param {?} newValue\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._maybeAddToChanges = function (record, newValue) {\n        if (!looseIdentical(newValue, record.currentValue)) {\n            record.previousValue = record.currentValue;\n            record.currentValue = newValue;\n            this._addToChanges(record);\n        }\n    };\n    /**\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._addToAdditions = function (record) {\n        if (this._additionsHead === null) {\n            this._additionsHead = this._additionsTail = record;\n        }\n        else {\n            ((this._additionsTail))._nextAdded = record;\n            this._additionsTail = record;\n        }\n    };\n    /**\n     * @param {?} record\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._addToChanges = function (record) {\n        if (this._changesHead === null) {\n            this._changesHead = this._changesTail = record;\n        }\n        else {\n            ((this._changesTail))._nextChanged = record;\n            this._changesTail = record;\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype.toString = function () {\n        var /** @type {?} */ items = [];\n        var /** @type {?} */ previous = [];\n        var /** @type {?} */ changes = [];\n        var /** @type {?} */ additions = [];\n        var /** @type {?} */ removals = [];\n        this.forEachItem(function (r) { return items.push(stringify(r)); });\n        this.forEachPreviousItem(function (r) { return previous.push(stringify(r)); });\n        this.forEachChangedItem(function (r) { return changes.push(stringify(r)); });\n        this.forEachAddedItem(function (r) { return additions.push(stringify(r)); });\n        this.forEachRemovedItem(function (r) { return removals.push(stringify(r)); });\n        return 'map: ' + items.join(', ') + '\\n' +\n            'previous: ' + previous.join(', ') + '\\n' +\n            'additions: ' + additions.join(', ') + '\\n' +\n            'changes: ' + changes.join(', ') + '\\n' +\n            'removals: ' + removals.join(', ') + '\\n';\n    };\n    /**\n     * \\@internal\n     * @template K, V\n     * @param {?} obj\n     * @param {?} fn\n     * @return {?}\n     */\n    DefaultKeyValueDiffer.prototype._forEach = function (obj, fn) {\n        if (obj instanceof Map) {\n            obj.forEach(fn);\n        }\n        else {\n            Object.keys(obj).forEach(function (k) { return fn(obj[k], k); });\n        }\n    };\n    return DefaultKeyValueDiffer;\n}());\n/**\n * \\@stable\n */\nvar KeyValueChangeRecord_ = (function () {\n    /**\n     * @param {?} key\n     */\n    function KeyValueChangeRecord_(key) {\n        this.key = key;\n        this.previousValue = null;\n        this.currentValue = null;\n        /**\n         * \\@internal\n         */\n        this._nextPrevious = null;\n        /**\n         * \\@internal\n         */\n        this._next = null;\n        /**\n         * \\@internal\n         */\n        this._prev = null;\n        /**\n         * \\@internal\n         */\n        this._nextAdded = null;\n        /**\n         * \\@internal\n         */\n        this._nextRemoved = null;\n        /**\n         * \\@internal\n         */\n        this._nextChanged = null;\n    }\n    /**\n     * @return {?}\n     */\n    KeyValueChangeRecord_.prototype.toString = function () {\n        return looseIdentical(this.previousValue, this.currentValue) ?\n            stringify(this.key) :\n            (stringify(this.key) + '[' + stringify(this.previousValue) + '->' +\n                stringify(this.currentValue) + ']');\n    };\n    return KeyValueChangeRecord_;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n * \\@stable\n */\nvar IterableDiffers = (function () {\n    /**\n     * @param {?} factories\n     */\n    function IterableDiffers(factories) {\n        this.factories = factories;\n    }\n    /**\n     * @param {?} factories\n     * @param {?=} parent\n     * @return {?}\n     */\n    IterableDiffers.create = function (factories, parent) {\n        if (parent != null) {\n            var /** @type {?} */ copied = parent.factories.slice();\n            factories = factories.concat(copied);\n            return new IterableDiffers(factories);\n        }\n        else {\n            return new IterableDiffers(factories);\n        }\n    };\n    /**\n     * Takes an array of {\\@link IterableDifferFactory} and returns a provider used to extend the\n     * inherited {\\@link IterableDiffers} instance with the provided factories and return a new\n     * {\\@link IterableDiffers} instance.\n     *\n     * The following example shows how to extend an existing list of factories,\n     * which will only be applied to the injector for this component and its children.\n     * This step is all that's required to make a new {\\@link IterableDiffer} available.\n     *\n     * ### Example\n     *\n     * ```\n     * \\@Component({\n     *   viewProviders: [\n     *     IterableDiffers.extend([new ImmutableListDiffer()])\n     *   ]\n     * })\n     * ```\n     * @param {?} factories\n     * @return {?}\n     */\n    IterableDiffers.extend = function (factories) {\n        return {\n            provide: IterableDiffers,\n            useFactory: function (parent) {\n                if (!parent) {\n                    // Typically would occur when calling IterableDiffers.extend inside of dependencies passed\n                    // to\n                    // bootstrap(), which would override default pipes instead of extending them.\n                    throw new Error('Cannot extend IterableDiffers without a parent injector');\n                }\n                return IterableDiffers.create(factories, parent);\n            },\n            // Dependency technically isn't optional, but we can provide a better error message this way.\n            deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n        };\n    };\n    /**\n     * @param {?} iterable\n     * @return {?}\n     */\n    IterableDiffers.prototype.find = function (iterable) {\n        var /** @type {?} */ factory = this.factories.find(function (f) { return f.supports(iterable); });\n        if (factory != null) {\n            return factory;\n        }\n        else {\n            throw new Error(\"Cannot find a differ supporting object '\" + iterable + \"' of type '\" + getTypeNameForDebugging(iterable) + \"'\");\n        }\n    };\n    return IterableDiffers;\n}());\n/**\n * @param {?} type\n * @return {?}\n */\nfunction getTypeNameForDebugging(type) {\n    return type['name'] || typeof type;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n * \\@stable\n */\nvar KeyValueDiffers = (function () {\n    /**\n     * @param {?} factories\n     */\n    function KeyValueDiffers(factories) {\n        this.factories = factories;\n    }\n    /**\n     * @template S\n     * @param {?} factories\n     * @param {?=} parent\n     * @return {?}\n     */\n    KeyValueDiffers.create = function (factories, parent) {\n        if (parent) {\n            var /** @type {?} */ copied = parent.factories.slice();\n            factories = factories.concat(copied);\n        }\n        return new KeyValueDiffers(factories);\n    };\n    /**\n     * Takes an array of {\\@link KeyValueDifferFactory} and returns a provider used to extend the\n     * inherited {\\@link KeyValueDiffers} instance with the provided factories and return a new\n     * {\\@link KeyValueDiffers} instance.\n     *\n     * The following example shows how to extend an existing list of factories,\n     * which will only be applied to the injector for this component and its children.\n     * This step is all that's required to make a new {\\@link KeyValueDiffer} available.\n     *\n     * ### Example\n     *\n     * ```\n     * \\@Component({\n     *   viewProviders: [\n     *     KeyValueDiffers.extend([new ImmutableMapDiffer()])\n     *   ]\n     * })\n     * ```\n     * @template S\n     * @param {?} factories\n     * @return {?}\n     */\n    KeyValueDiffers.extend = function (factories) {\n        return {\n            provide: KeyValueDiffers,\n            useFactory: function (parent) {\n                if (!parent) {\n                    // Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed\n                    // to bootstrap(), which would override default pipes instead of extending them.\n                    throw new Error('Cannot extend KeyValueDiffers without a parent injector');\n                }\n                return KeyValueDiffers.create(factories, parent);\n            },\n            // Dependency technically isn't optional, but we can provide a better error message this way.\n            deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n        };\n    };\n    /**\n     * @param {?} kv\n     * @return {?}\n     */\n    KeyValueDiffers.prototype.find = function (kv) {\n        var /** @type {?} */ factory = this.factories.find(function (f) { return f.supports(kv); });\n        if (factory) {\n            return factory;\n        }\n        throw new Error(\"Cannot find a differ supporting object '\" + kv + \"'\");\n    };\n    return KeyValueDiffers;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nvar keyValDiff = [new DefaultKeyValueDifferFactory()];\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nvar iterableDiff = [new DefaultIterableDifferFactory()];\nvar defaultIterableDiffers = new IterableDiffers(iterableDiff);\nvar defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * Change detection enables data binding in Angular.\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction _reflector() {\n    return reflector;\n}\nvar _CORE_PLATFORM_PROVIDERS = [\n    // Set a default platform name for platforms that don't set it explicitly.\n    { provide: PLATFORM_ID, useValue: 'unknown' },\n    PlatformRef_,\n    { provide: PlatformRef, useExisting: PlatformRef_ },\n    { provide: Reflector, useFactory: _reflector, deps: [] },\n    TestabilityRegistry,\n    Console,\n];\n/**\n * This platform has to be included in any other platform\n *\n * \\@experimental\n */\nvar platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@experimental i18n support is experimental.\n */\nvar LOCALE_ID = new InjectionToken('LocaleId');\n/**\n * \\@experimental i18n support is experimental.\n */\nvar TRANSLATIONS = new InjectionToken('Translations');\n/**\n * \\@experimental i18n support is experimental.\n */\nvar TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');\nvar MissingTranslationStrategy = {};\nMissingTranslationStrategy.Error = 0;\nMissingTranslationStrategy.Warning = 1;\nMissingTranslationStrategy.Ignore = 2;\nMissingTranslationStrategy[MissingTranslationStrategy.Error] = \"Error\";\nMissingTranslationStrategy[MissingTranslationStrategy.Warning] = \"Warning\";\nMissingTranslationStrategy[MissingTranslationStrategy.Ignore] = \"Ignore\";\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @return {?}\n */\nfunction _iterableDiffersFactory() {\n    return defaultIterableDiffers;\n}\n/**\n * @return {?}\n */\nfunction _keyValueDiffersFactory() {\n    return defaultKeyValueDiffers;\n}\n/**\n * @param {?=} locale\n * @return {?}\n */\nfunction _localeFactory(locale) {\n    return locale || 'en-US';\n}\n/**\n * This module includes the providers of \\@angular/core that are needed\n * to bootstrap components via `ApplicationRef`.\n *\n * \\@experimental\n */\nvar ApplicationModule = (function () {\n    /**\n     * @param {?} appRef\n     */\n    function ApplicationModule(appRef) {\n    }\n    return ApplicationModule;\n}());\nApplicationModule.decorators = [\n    { type: NgModule, args: [{\n                providers: [\n                    ApplicationRef_,\n                    { provide: ApplicationRef, useExisting: ApplicationRef_ },\n                    ApplicationInitStatus,\n                    Compiler,\n                    APP_ID_RANDOM_PROVIDER,\n                    { provide: IterableDiffers, useFactory: _iterableDiffersFactory },\n                    { provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory },\n                    {\n                        provide: LOCALE_ID,\n                        useFactory: _localeFactory,\n                        deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]\n                    },\n                ]\n            },] },\n];\n/**\n * @nocollapse\n */\nApplicationModule.ctorParameters = function () { return [\n    { type: ApplicationRef, },\n]; };\nvar SecurityContext = {};\nSecurityContext.NONE = 0;\nSecurityContext.HTML = 1;\nSecurityContext.STYLE = 2;\nSecurityContext.SCRIPT = 3;\nSecurityContext.URL = 4;\nSecurityContext.RESOURCE_URL = 5;\nSecurityContext[SecurityContext.NONE] = \"NONE\";\nSecurityContext[SecurityContext.HTML] = \"HTML\";\nSecurityContext[SecurityContext.STYLE] = \"STYLE\";\nSecurityContext[SecurityContext.SCRIPT] = \"SCRIPT\";\nSecurityContext[SecurityContext.URL] = \"URL\";\nSecurityContext[SecurityContext.RESOURCE_URL] = \"RESOURCE_URL\";\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * \\@stable\n * @abstract\n */\nvar Sanitizer = (function () {\n    function Sanitizer() {\n    }\n    /**\n     * @abstract\n     * @param {?} context\n     * @param {?} value\n     * @return {?}\n     */\n    Sanitizer.prototype.sanitize = function (context, value) { };\n    return Sanitizer;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Node instance data.\n *\n * We have a separate type per NodeType to save memory\n * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>)\n *\n * To keep our code monomorphic,\n * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...).\n * This way, no usage site can get a `NodeData` from view.nodes and then use it for different\n * purposes.\n */\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nfunction asTextData(view, index) {\n    return (view.nodes[index]);\n}\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nfunction asElementData(view, index) {\n    return (view.nodes[index]);\n}\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nfunction asProviderData(view, index) {\n    return (view.nodes[index]);\n}\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nfunction asPureExpressionData(view, index) {\n    return (view.nodes[index]);\n}\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nfunction asQueryList(view, index) {\n    return (view.nodes[index]);\n}\n/**\n * @abstract\n */\nvar DebugContext = (function () {\n    function DebugContext() {\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.view = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.nodeIndex = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.injector = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.component = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.providerTokens = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.references = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.context = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.componentRenderElement = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DebugContext.prototype.renderNode = function () { };\n    /**\n     * @abstract\n     * @param {?} console\n     * @param {...?} values\n     * @return {?}\n     */\n    DebugContext.prototype.logError = function (console) {\n        var values = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            values[_i - 1] = arguments[_i];\n        }\n    };\n    return DebugContext;\n}());\n/**\n * This object is used to prevent cycles in the source files and to have a place where\n * debug mode can hook it. It is lazily filled when `isDevMode` is known.\n */\nvar Services = {\n    setCurrentNode: undefined,\n    createRootView: undefined,\n    createEmbeddedView: undefined,\n    createComponentView: undefined,\n    createNgModuleRef: undefined,\n    overrideProvider: undefined,\n    clearProviderOverrides: undefined,\n    checkAndUpdateView: undefined,\n    checkNoChangesView: undefined,\n    destroyView: undefined,\n    resolveDep: undefined,\n    createDebugContext: undefined,\n    handleEvent: undefined,\n    updateDirectives: undefined,\n    updateRenderer: undefined,\n    dirtyParentQueries: undefined,\n};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} context\n * @param {?} oldValue\n * @param {?} currValue\n * @param {?} isFirstCheck\n * @return {?}\n */\nfunction expressionChangedAfterItHasBeenCheckedError(context, oldValue, currValue, isFirstCheck) {\n    var /** @type {?} */ msg = \"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '\" + oldValue + \"'. Current value: '\" + currValue + \"'.\";\n    if (isFirstCheck) {\n        msg +=\n            \" It seems like the view has been created after its parent and its children have been dirty checked.\" +\n                \" Has it been created in a change detection hook ?\";\n    }\n    return viewDebugError(msg, context);\n}\n/**\n * @param {?} err\n * @param {?} context\n * @return {?}\n */\nfunction viewWrappedDebugError(err, context) {\n    if (!(err instanceof Error)) {\n        // errors that are not Error instances don't have a stack,\n        // so it is ok to wrap them into a new Error object...\n        err = new Error(err.toString());\n    }\n    _addDebugContext(err, context);\n    return err;\n}\n/**\n * @param {?} msg\n * @param {?} context\n * @return {?}\n */\nfunction viewDebugError(msg, context) {\n    var /** @type {?} */ err = new Error(msg);\n    _addDebugContext(err, context);\n    return err;\n}\n/**\n * @param {?} err\n * @param {?} context\n * @return {?}\n */\nfunction _addDebugContext(err, context) {\n    ((err))[ERROR_DEBUG_CONTEXT] = context;\n    ((err))[ERROR_LOGGER] = context.logError.bind(context);\n}\n/**\n * @param {?} err\n * @return {?}\n */\nfunction isViewDebugError(err) {\n    return !!getDebugContext(err);\n}\n/**\n * @param {?} action\n * @return {?}\n */\nfunction viewDestroyedError(action) {\n    return new Error(\"ViewDestroyedError: Attempt to use a destroyed view: \" + action);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar NOOP = function () { };\nvar _tokenKeyCache = new Map();\n/**\n * @param {?} token\n * @return {?}\n */\nfunction tokenKey(token) {\n    var /** @type {?} */ key = _tokenKeyCache.get(token);\n    if (!key) {\n        key = stringify(token) + '_' + _tokenKeyCache.size;\n        _tokenKeyCache.set(token, key);\n    }\n    return key;\n}\n/**\n * @param {?} view\n * @param {?} nodeIdx\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nfunction unwrapValue(view, nodeIdx, bindingIdx, value) {\n    if (value instanceof WrappedValue) {\n        value = value.wrapped;\n        var /** @type {?} */ globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;\n        var /** @type {?} */ oldValue = view.oldValues[globalBindingIdx];\n        if (oldValue instanceof WrappedValue) {\n            oldValue = oldValue.wrapped;\n        }\n        view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);\n    }\n    return value;\n}\nvar UNDEFINED_RENDERER_TYPE_ID = '$$undefined';\nvar EMPTY_RENDERER_TYPE_ID = '$$empty';\n/**\n * @param {?} values\n * @return {?}\n */\nfunction createRendererType2(values) {\n    return {\n        id: UNDEFINED_RENDERER_TYPE_ID,\n        styles: values.styles,\n        encapsulation: values.encapsulation,\n        data: values.data\n    };\n}\nvar _renderCompCount = 0;\n/**\n * @param {?=} type\n * @return {?}\n */\nfunction resolveRendererType2(type) {\n    if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {\n        // first time we see this RendererType2. Initialize it...\n        var /** @type {?} */ isFilled = ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||\n            type.styles.length || Object.keys(type.data).length);\n        if (isFilled) {\n            type.id = \"c\" + _renderCompCount++;\n        }\n        else {\n            type.id = EMPTY_RENDERER_TYPE_ID;\n        }\n    }\n    if (type && type.id === EMPTY_RENDERER_TYPE_ID) {\n        type = null;\n    }\n    return type || null;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nfunction checkBinding(view, def, bindingIdx, value) {\n    var /** @type {?} */ oldValues = view.oldValues;\n    if ((view.state & 2 /* FirstCheck */) ||\n        !looseIdentical(oldValues[def.bindingIndex + bindingIdx], value)) {\n        return true;\n    }\n    return false;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nfunction checkAndUpdateBinding(view, def, bindingIdx, value) {\n    if (checkBinding(view, def, bindingIdx, value)) {\n        view.oldValues[def.bindingIndex + bindingIdx] = value;\n        return true;\n    }\n    return false;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nfunction checkBindingNoChanges(view, def, bindingIdx, value) {\n    var /** @type {?} */ oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n    if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) {\n        throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.index), oldValue, value, (view.state & 1 /* BeforeFirstCheck */) !== 0);\n    }\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction markParentViewsForCheck(view) {\n    var /** @type {?} */ currView = view;\n    while (currView) {\n        if (currView.def.flags & 2 /* OnPush */) {\n            currView.state |= 8 /* ChecksEnabled */;\n        }\n        currView = currView.viewContainerParent || currView.parent;\n    }\n}\n/**\n * @param {?} view\n * @param {?} endView\n * @return {?}\n */\nfunction markParentViewsForCheckProjectedViews(view, endView) {\n    var /** @type {?} */ currView = view;\n    while (currView && currView !== endView) {\n        currView.state |= 64 /* CheckProjectedViews */;\n        currView = currView.viewContainerParent || currView.parent;\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @param {?} eventName\n * @param {?} event\n * @return {?}\n */\nfunction dispatchEvent(view, nodeIndex, eventName, event) {\n    var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];\n    var /** @type {?} */ startView = nodeDef.flags & 33554432 /* ComponentView */ ? asElementData(view, nodeIndex).componentView : view;\n    markParentViewsForCheck(startView);\n    return Services.handleEvent(view, nodeIndex, eventName, event);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction declaredViewContainer(view) {\n    if (view.parent) {\n        var /** @type {?} */ parentView = view.parent;\n        return asElementData(parentView, /** @type {?} */ ((view.parentNodeDef)).index);\n    }\n    return null;\n}\n/**\n * for component views, this is the host element.\n * for embedded views, this is the index of the parent node\n * that contains the view container.\n * @param {?} view\n * @return {?}\n */\nfunction viewParentEl(view) {\n    var /** @type {?} */ parentView = view.parent;\n    if (parentView) {\n        return ((view.parentNodeDef)).parent;\n    }\n    else {\n        return null;\n    }\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction renderNode(view, def) {\n    switch (def.flags & 201347067 /* Types */) {\n        case 1 /* TypeElement */:\n            return asElementData(view, def.index).renderElement;\n        case 2 /* TypeText */:\n            return asTextData(view, def.index).renderText;\n    }\n}\n/**\n * @param {?} target\n * @param {?} name\n * @return {?}\n */\nfunction elementEventFullName(target, name) {\n    return target ? target + \":\" + name : name;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction isComponentView(view) {\n    return !!view.parent && !!(((view.parentNodeDef)).flags & 32768 /* Component */);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction isEmbeddedView(view) {\n    return !!view.parent && !(((view.parentNodeDef)).flags & 32768 /* Component */);\n}\n/**\n * @param {?} queryId\n * @return {?}\n */\nfunction filterQueryId(queryId) {\n    return 1 << (queryId % 32);\n}\n/**\n * @param {?} matchedQueriesDsl\n * @return {?}\n */\nfunction splitMatchedQueriesDsl(matchedQueriesDsl) {\n    var /** @type {?} */ matchedQueries = {};\n    var /** @type {?} */ matchedQueryIds = 0;\n    var /** @type {?} */ references = {};\n    if (matchedQueriesDsl) {\n        matchedQueriesDsl.forEach(function (_a) {\n            var queryId = _a[0], valueType = _a[1];\n            if (typeof queryId === 'number') {\n                matchedQueries[queryId] = valueType;\n                matchedQueryIds |= filterQueryId(queryId);\n            }\n            else {\n                references[queryId] = valueType;\n            }\n        });\n    }\n    return { matchedQueries: matchedQueries, references: references, matchedQueryIds: matchedQueryIds };\n}\n/**\n * @param {?} deps\n * @return {?}\n */\nfunction splitDepsDsl(deps) {\n    return deps.map(function (value) {\n        var /** @type {?} */ token;\n        var /** @type {?} */ flags;\n        if (Array.isArray(value)) {\n            flags = value[0], token = value[1];\n        }\n        else {\n            flags = 0 /* None */;\n            token = value;\n        }\n        return { flags: flags, token: token, tokenKey: tokenKey(token) };\n    });\n}\n/**\n * @param {?} view\n * @param {?} renderHost\n * @param {?} def\n * @return {?}\n */\nfunction getParentRenderElement(view, renderHost, def) {\n    var /** @type {?} */ renderParent = def.renderParent;\n    if (renderParent) {\n        if ((renderParent.flags & 1 /* TypeElement */) === 0 ||\n            (renderParent.flags & 33554432 /* ComponentView */) === 0 ||\n            (((renderParent.element)).componentRendererType && ((((renderParent.element)).componentRendererType)).encapsulation ===\n                ViewEncapsulation.Native)) {\n            // only children of non components, or children of components with native encapsulation should\n            // be attached.\n            return asElementData(view, /** @type {?} */ ((def.renderParent)).index).renderElement;\n        }\n    }\n    else {\n        return renderHost;\n    }\n}\nvar DEFINITION_CACHE = new WeakMap();\n/**\n * @template D\n * @param {?} factory\n * @return {?}\n */\nfunction resolveDefinition(factory) {\n    var /** @type {?} */ value = (((DEFINITION_CACHE.get(factory))));\n    if (!value) {\n        value = factory(function () { return NOOP; });\n        value.factory = factory;\n        DEFINITION_CACHE.set(factory, value);\n    }\n    return value;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction rootRenderNodes(view) {\n    var /** @type {?} */ renderNodes = [];\n    visitRootRenderNodes(view, 0 /* Collect */, undefined, undefined, renderNodes);\n    return renderNodes;\n}\n/**\n * @param {?} view\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nfunction visitRootRenderNodes(view, action, parentNode, nextSibling, target) {\n    // We need to re-compute the parent node in case the nodes have been moved around manually\n    if (action === 3 /* RemoveChild */) {\n        parentNode = view.renderer.parentNode(renderNode(view, /** @type {?} */ ((view.def.lastRenderRootNode))));\n    }\n    visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);\n}\n/**\n * @param {?} view\n * @param {?} action\n * @param {?} startIndex\n * @param {?} endIndex\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nfunction visitSiblingRenderNodes(view, action, startIndex, endIndex, parentNode, nextSibling, target) {\n    for (var /** @type {?} */ i = startIndex; i <= endIndex; i++) {\n        var /** @type {?} */ nodeDef = view.def.nodes[i];\n        if (nodeDef.flags & (1 /* TypeElement */ | 2 /* TypeText */ | 8 /* TypeNgContent */)) {\n            visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);\n        }\n        // jump to next sibling\n        i += nodeDef.childCount;\n    }\n}\n/**\n * @param {?} view\n * @param {?} ngContentIndex\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nfunction visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nextSibling, target) {\n    var /** @type {?} */ compView = view;\n    while (compView && !isComponentView(compView)) {\n        compView = compView.parent;\n    }\n    var /** @type {?} */ hostView = ((compView)).parent;\n    var /** @type {?} */ hostElDef = viewParentEl(/** @type {?} */ ((compView)));\n    var /** @type {?} */ startIndex = ((hostElDef)).index + 1;\n    var /** @type {?} */ endIndex = ((hostElDef)).index + ((hostElDef)).childCount;\n    for (var /** @type {?} */ i = startIndex; i <= endIndex; i++) {\n        var /** @type {?} */ nodeDef = ((hostView)).def.nodes[i];\n        if (nodeDef.ngContentIndex === ngContentIndex) {\n            visitRenderNode(/** @type {?} */ ((hostView)), nodeDef, action, parentNode, nextSibling, target);\n        }\n        // jump to next sibling\n        i += nodeDef.childCount;\n    }\n    if (!((hostView)).parent) {\n        // a root view\n        var /** @type {?} */ projectedNodes = view.root.projectableNodes[ngContentIndex];\n        if (projectedNodes) {\n            for (var /** @type {?} */ i = 0; i < projectedNodes.length; i++) {\n                execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);\n            }\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nfunction visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target) {\n    if (nodeDef.flags & 8 /* TypeNgContent */) {\n        visitProjectedRenderNodes(view, /** @type {?} */ ((nodeDef.ngContent)).index, action, parentNode, nextSibling, target);\n    }\n    else {\n        var /** @type {?} */ rn = renderNode(view, nodeDef);\n        if (action === 3 /* RemoveChild */ && (nodeDef.flags & 33554432 /* ComponentView */) &&\n            (nodeDef.bindingFlags & 48 /* CatSyntheticProperty */)) {\n            // Note: we might need to do both actions.\n            if (nodeDef.bindingFlags & (16 /* SyntheticProperty */)) {\n                execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n            }\n            if (nodeDef.bindingFlags & (32 /* SyntheticHostProperty */)) {\n                var /** @type {?} */ compView = asElementData(view, nodeDef.index).componentView;\n                execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);\n            }\n        }\n        else {\n            execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n        }\n        if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n            var /** @type {?} */ embeddedViews = ((asElementData(view, nodeDef.index).viewContainer))._embeddedViews;\n            for (var /** @type {?} */ k = 0; k < embeddedViews.length; k++) {\n                visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);\n            }\n        }\n        if (nodeDef.flags & 1 /* TypeElement */ && !((nodeDef.element)).name) {\n            visitSiblingRenderNodes(view, action, nodeDef.index + 1, nodeDef.index + nodeDef.childCount, parentNode, nextSibling, target);\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} renderNode\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nfunction execRenderNodeAction(view, renderNode, action, parentNode, nextSibling, target) {\n    var /** @type {?} */ renderer = view.renderer;\n    switch (action) {\n        case 1 /* AppendChild */:\n            renderer.appendChild(parentNode, renderNode);\n            break;\n        case 2 /* InsertBefore */:\n            renderer.insertBefore(parentNode, renderNode, nextSibling);\n            break;\n        case 3 /* RemoveChild */:\n            renderer.removeChild(parentNode, renderNode);\n            break;\n        case 0 /* Collect */:\n            ((target)).push(renderNode);\n            break;\n    }\n}\nvar NS_PREFIX_RE = /^:([^:]+):(.+)$/;\n/**\n * @param {?} name\n * @return {?}\n */\nfunction splitNamespace(name) {\n    if (name[0] === ':') {\n        var /** @type {?} */ match = ((name.match(NS_PREFIX_RE)));\n        return [match[1], match[2]];\n    }\n    return ['', name];\n}\n/**\n * @param {?} bindings\n * @return {?}\n */\nfunction calcBindingFlags(bindings) {\n    var /** @type {?} */ flags = 0;\n    for (var /** @type {?} */ i = 0; i < bindings.length; i++) {\n        flags |= bindings[i].flags;\n    }\n    return flags;\n}\n/**\n * @param {?} valueCount\n * @param {?} constAndInterp\n * @return {?}\n */\nfunction interpolate(valueCount, constAndInterp) {\n    var /** @type {?} */ result = '';\n    for (var /** @type {?} */ i = 0; i < valueCount * 2; i = i + 2) {\n        result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);\n    }\n    return result + constAndInterp[valueCount * 2];\n}\n/**\n * @param {?} valueCount\n * @param {?} c0\n * @param {?} a1\n * @param {?} c1\n * @param {?=} a2\n * @param {?=} c2\n * @param {?=} a3\n * @param {?=} c3\n * @param {?=} a4\n * @param {?=} c4\n * @param {?=} a5\n * @param {?=} c5\n * @param {?=} a6\n * @param {?=} c6\n * @param {?=} a7\n * @param {?=} c7\n * @param {?=} a8\n * @param {?=} c8\n * @param {?=} a9\n * @param {?=} c9\n * @return {?}\n */\nfunction inlineInterpolate(valueCount, c0, a1, c1, a2, c2, a3, c3, a4, c4, a5, c5, a6, c6, a7, c7, a8, c8, a9, c9) {\n    switch (valueCount) {\n        case 1:\n            return c0 + _toStringWithNull(a1) + c1;\n        case 2:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;\n        case 3:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3;\n        case 4:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3 + _toStringWithNull(a4) + c4;\n        case 5:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;\n        case 6:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;\n        case 7:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n                c6 + _toStringWithNull(a7) + c7;\n        case 8:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n                c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;\n        case 9:\n            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n                c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;\n        default:\n            throw new Error(\"Does not support more than 9 expressions\");\n    }\n}\n/**\n * @param {?} v\n * @return {?}\n */\nfunction _toStringWithNull(v) {\n    return v != null ? v.toString() : '';\n}\nvar EMPTY_ARRAY = [];\nvar EMPTY_MAP = {};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} flags\n * @param {?} matchedQueriesDsl\n * @param {?} ngContentIndex\n * @param {?} childCount\n * @param {?=} handleEvent\n * @param {?=} templateFactory\n * @return {?}\n */\nfunction anchorDef(flags, matchedQueriesDsl, ngContentIndex, childCount, handleEvent, templateFactory) {\n    flags |= 1 /* TypeElement */;\n    var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;\n    var /** @type {?} */ template = templateFactory ? resolveDefinition(templateFactory) : null;\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: flags,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references, ngContentIndex: ngContentIndex, childCount: childCount,\n        bindings: [],\n        bindingFlags: 0,\n        outputs: [],\n        element: {\n            ns: null,\n            name: null,\n            attrs: null, template: template,\n            componentProvider: null,\n            componentView: null,\n            componentRendererType: null,\n            publicProviders: null,\n            allProviders: null,\n            handleEvent: handleEvent || NOOP\n        },\n        provider: null,\n        text: null,\n        query: null,\n        ngContent: null\n    };\n}\n/**\n * @param {?} flags\n * @param {?} matchedQueriesDsl\n * @param {?} ngContentIndex\n * @param {?} childCount\n * @param {?} namespaceAndName\n * @param {?=} fixedAttrs\n * @param {?=} bindings\n * @param {?=} outputs\n * @param {?=} handleEvent\n * @param {?=} componentView\n * @param {?=} componentRendererType\n * @return {?}\n */\nfunction elementDef(flags, matchedQueriesDsl, ngContentIndex, childCount, namespaceAndName, fixedAttrs, bindings, outputs, handleEvent, componentView, componentRendererType) {\n    if (fixedAttrs === void 0) { fixedAttrs = []; }\n    if (!handleEvent) {\n        handleEvent = NOOP;\n    }\n    var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;\n    var /** @type {?} */ ns = ((null));\n    var /** @type {?} */ name = ((null));\n    if (namespaceAndName) {\n        _b = splitNamespace(namespaceAndName), ns = _b[0], name = _b[1];\n    }\n    bindings = bindings || [];\n    var /** @type {?} */ bindingDefs = new Array(bindings.length);\n    for (var /** @type {?} */ i = 0; i < bindings.length; i++) {\n        var _c = bindings[i], bindingFlags = _c[0], namespaceAndName_1 = _c[1], suffixOrSecurityContext = _c[2];\n        var _d = splitNamespace(namespaceAndName_1), ns_1 = _d[0], name_1 = _d[1];\n        var /** @type {?} */ securityContext = ((undefined));\n        var /** @type {?} */ suffix = ((undefined));\n        switch (bindingFlags & 15 /* Types */) {\n            case 4 /* TypeElementStyle */:\n                suffix = (suffixOrSecurityContext);\n                break;\n            case 1 /* TypeElementAttribute */:\n            case 8 /* TypeProperty */:\n                securityContext = (suffixOrSecurityContext);\n                break;\n        }\n        bindingDefs[i] =\n            { flags: bindingFlags, ns: ns_1, name: name_1, nonMinifiedName: name_1, securityContext: securityContext, suffix: suffix };\n    }\n    outputs = outputs || [];\n    var /** @type {?} */ outputDefs = new Array(outputs.length);\n    for (var /** @type {?} */ i = 0; i < outputs.length; i++) {\n        var _e = outputs[i], target = _e[0], eventName = _e[1];\n        outputDefs[i] = {\n            type: 0 /* ElementOutput */,\n            target: /** @type {?} */ (target), eventName: eventName,\n            propName: null\n        };\n    }\n    fixedAttrs = fixedAttrs || [];\n    var /** @type {?} */ attrs = (fixedAttrs.map(function (_a) {\n        var namespaceAndName = _a[0], value = _a[1];\n        var _b = splitNamespace(namespaceAndName), ns = _b[0], name = _b[1];\n        return [ns, name, value];\n    }));\n    componentRendererType = resolveRendererType2(componentRendererType);\n    if (componentView) {\n        flags |= 33554432 /* ComponentView */;\n    }\n    flags |= 1 /* TypeElement */;\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: flags,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references, ngContentIndex: ngContentIndex, childCount: childCount,\n        bindings: bindingDefs,\n        bindingFlags: calcBindingFlags(bindingDefs),\n        outputs: outputDefs,\n        element: {\n            ns: ns,\n            name: name,\n            attrs: attrs,\n            template: null,\n            // will bet set by the view definition\n            componentProvider: null,\n            componentView: componentView || null,\n            componentRendererType: componentRendererType,\n            publicProviders: null,\n            allProviders: null,\n            handleEvent: handleEvent || NOOP,\n        },\n        provider: null,\n        text: null,\n        query: null,\n        ngContent: null\n    };\n    var _b;\n}\n/**\n * @param {?} view\n * @param {?} renderHost\n * @param {?} def\n * @return {?}\n */\nfunction createElement(view, renderHost, def) {\n    var /** @type {?} */ elDef = ((def.element));\n    var /** @type {?} */ rootSelectorOrNode = view.root.selectorOrNode;\n    var /** @type {?} */ renderer = view.renderer;\n    var /** @type {?} */ el;\n    if (view.parent || !rootSelectorOrNode) {\n        if (elDef.name) {\n            el = renderer.createElement(elDef.name, elDef.ns);\n        }\n        else {\n            el = renderer.createComment('');\n        }\n        var /** @type {?} */ parentEl = getParentRenderElement(view, renderHost, def);\n        if (parentEl) {\n            renderer.appendChild(parentEl, el);\n        }\n    }\n    else {\n        el = renderer.selectRootElement(rootSelectorOrNode);\n    }\n    if (elDef.attrs) {\n        for (var /** @type {?} */ i = 0; i < elDef.attrs.length; i++) {\n            var _a = elDef.attrs[i], ns = _a[0], name = _a[1], value = _a[2];\n            renderer.setAttribute(el, name, value, ns);\n        }\n    }\n    return el;\n}\n/**\n * @param {?} view\n * @param {?} compView\n * @param {?} def\n * @param {?} el\n * @return {?}\n */\nfunction listenToElementOutputs(view, compView, def, el) {\n    for (var /** @type {?} */ i = 0; i < def.outputs.length; i++) {\n        var /** @type {?} */ output = def.outputs[i];\n        var /** @type {?} */ handleEventClosure = renderEventHandlerClosure(view, def.index, elementEventFullName(output.target, output.eventName));\n        var /** @type {?} */ listenTarget = output.target;\n        var /** @type {?} */ listenerView = view;\n        if (output.target === 'component') {\n            listenTarget = null;\n            listenerView = compView;\n        }\n        var /** @type {?} */ disposable = (listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure)); /** @type {?} */\n        ((view.disposables))[def.outputIndex + i] = disposable;\n    }\n}\n/**\n * @param {?} view\n * @param {?} index\n * @param {?} eventName\n * @return {?}\n */\nfunction renderEventHandlerClosure(view, index, eventName) {\n    return function (event) {\n        try {\n            return dispatchEvent(view, index, eventName, event);\n        }\n        catch (e) {\n            // Attention: Don't rethrow, to keep in sync with directive events.\n            view.root.errorHandler.handleError(e);\n        }\n    };\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} v0\n * @param {?} v1\n * @param {?} v2\n * @param {?} v3\n * @param {?} v4\n * @param {?} v5\n * @param {?} v6\n * @param {?} v7\n * @param {?} v8\n * @param {?} v9\n * @return {?}\n */\nfunction checkAndUpdateElementInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ bindLen = def.bindings.length;\n    var /** @type {?} */ changed = false;\n    if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0))\n        changed = true;\n    if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1))\n        changed = true;\n    if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2))\n        changed = true;\n    if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3))\n        changed = true;\n    if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4))\n        changed = true;\n    if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5))\n        changed = true;\n    if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6))\n        changed = true;\n    if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7))\n        changed = true;\n    if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8))\n        changed = true;\n    if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9))\n        changed = true;\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} values\n * @return {?}\n */\nfunction checkAndUpdateElementDynamic(view, def, values) {\n    var /** @type {?} */ changed = false;\n    for (var /** @type {?} */ i = 0; i < values.length; i++) {\n        if (checkAndUpdateElementValue(view, def, i, values[i]))\n            changed = true;\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nfunction checkAndUpdateElementValue(view, def, bindingIdx, value) {\n    if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {\n        return false;\n    }\n    var /** @type {?} */ binding = def.bindings[bindingIdx];\n    var /** @type {?} */ elData = asElementData(view, def.index);\n    var /** @type {?} */ renderNode$$1 = elData.renderElement;\n    var /** @type {?} */ name = ((binding.name));\n    switch (binding.flags & 15 /* Types */) {\n        case 1 /* TypeElementAttribute */:\n            setElementAttribute(view, binding, renderNode$$1, binding.ns, name, value);\n            break;\n        case 2 /* TypeElementClass */:\n            setElementClass(view, renderNode$$1, name, value);\n            break;\n        case 4 /* TypeElementStyle */:\n            setElementStyle(view, binding, renderNode$$1, name, value);\n            break;\n        case 8 /* TypeProperty */:\n            var /** @type {?} */ bindView = (def.flags & 33554432 /* ComponentView */ &&\n                binding.flags & 32 /* SyntheticHostProperty */) ?\n                elData.componentView :\n                view;\n            setElementProperty(bindView, binding, renderNode$$1, name, value);\n            break;\n    }\n    return true;\n}\n/**\n * @param {?} view\n * @param {?} binding\n * @param {?} renderNode\n * @param {?} ns\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nfunction setElementAttribute(view, binding, renderNode$$1, ns, name, value) {\n    var /** @type {?} */ securityContext = binding.securityContext;\n    var /** @type {?} */ renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n    renderValue = renderValue != null ? renderValue.toString() : null;\n    var /** @type {?} */ renderer = view.renderer;\n    if (value != null) {\n        renderer.setAttribute(renderNode$$1, name, renderValue, ns);\n    }\n    else {\n        renderer.removeAttribute(renderNode$$1, name, ns);\n    }\n}\n/**\n * @param {?} view\n * @param {?} renderNode\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nfunction setElementClass(view, renderNode$$1, name, value) {\n    var /** @type {?} */ renderer = view.renderer;\n    if (value) {\n        renderer.addClass(renderNode$$1, name);\n    }\n    else {\n        renderer.removeClass(renderNode$$1, name);\n    }\n}\n/**\n * @param {?} view\n * @param {?} binding\n * @param {?} renderNode\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nfunction setElementStyle(view, binding, renderNode$$1, name, value) {\n    var /** @type {?} */ renderValue = view.root.sanitizer.sanitize(SecurityContext.STYLE, /** @type {?} */ (value));\n    if (renderValue != null) {\n        renderValue = renderValue.toString();\n        var /** @type {?} */ unit = binding.suffix;\n        if (unit != null) {\n            renderValue = renderValue + unit;\n        }\n    }\n    else {\n        renderValue = null;\n    }\n    var /** @type {?} */ renderer = view.renderer;\n    if (renderValue != null) {\n        renderer.setStyle(renderNode$$1, name, renderValue);\n    }\n    else {\n        renderer.removeStyle(renderNode$$1, name);\n    }\n}\n/**\n * @param {?} view\n * @param {?} binding\n * @param {?} renderNode\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nfunction setElementProperty(view, binding, renderNode$$1, name, value) {\n    var /** @type {?} */ securityContext = binding.securityContext;\n    var /** @type {?} */ renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n    view.renderer.setProperty(renderNode$$1, name, renderValue);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar NOT_CREATED$1 = new Object();\nvar InjectorRefTokenKey$1 = tokenKey(Injector);\nvar NgModuleRefTokenKey = tokenKey(NgModuleRef);\n/**\n * @param {?} flags\n * @param {?} token\n * @param {?} value\n * @param {?} deps\n * @return {?}\n */\nfunction moduleProvideDef(flags, token, value, deps) {\n    var /** @type {?} */ depDefs = splitDepsDsl(deps);\n    return {\n        // will bet set by the module definition\n        index: -1,\n        deps: depDefs, flags: flags, token: token, value: value\n    };\n}\n/**\n * @param {?} providers\n * @return {?}\n */\nfunction moduleDef(providers) {\n    var /** @type {?} */ providersByKey = {};\n    for (var /** @type {?} */ i = 0; i < providers.length; i++) {\n        var /** @type {?} */ provider = providers[i];\n        provider.index = i;\n        providersByKey[tokenKey(provider.token)] = provider;\n    }\n    return {\n        // Will be filled later...\n        factory: null,\n        providersByKey: providersByKey,\n        providers: providers\n    };\n}\n/**\n * @param {?} data\n * @return {?}\n */\nfunction initNgModule(data) {\n    var /** @type {?} */ def = data._def;\n    var /** @type {?} */ providers = data._providers = new Array(def.providers.length);\n    for (var /** @type {?} */ i = 0; i < def.providers.length; i++) {\n        var /** @type {?} */ provDef = def.providers[i];\n        providers[i] = provDef.flags & 4096 /* LazyProvider */ ? NOT_CREATED$1 :\n            _createProviderInstance$1(data, provDef);\n    }\n}\n/**\n * @param {?} data\n * @param {?} depDef\n * @param {?=} notFoundValue\n * @return {?}\n */\nfunction resolveNgModuleDep(data, depDef, notFoundValue) {\n    if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n    if (depDef.flags & 8 /* Value */) {\n        return depDef.token;\n    }\n    if (depDef.flags & 2 /* Optional */) {\n        notFoundValue = null;\n    }\n    if (depDef.flags & 1 /* SkipSelf */) {\n        return data._parent.get(depDef.token, notFoundValue);\n    }\n    var /** @type {?} */ tokenKey$$1 = depDef.tokenKey;\n    switch (tokenKey$$1) {\n        case InjectorRefTokenKey$1:\n        case NgModuleRefTokenKey:\n            return data;\n    }\n    var /** @type {?} */ providerDef = data._def.providersByKey[tokenKey$$1];\n    if (providerDef) {\n        var /** @type {?} */ providerInstance = data._providers[providerDef.index];\n        if (providerInstance === NOT_CREATED$1) {\n            providerInstance = data._providers[providerDef.index] =\n                _createProviderInstance$1(data, providerDef);\n        }\n        return providerInstance;\n    }\n    return data._parent.get(depDef.token, notFoundValue);\n}\n/**\n * @param {?} ngModule\n * @param {?} providerDef\n * @return {?}\n */\nfunction _createProviderInstance$1(ngModule, providerDef) {\n    var /** @type {?} */ injectable;\n    switch (providerDef.flags & 201347067 /* Types */) {\n        case 512 /* TypeClassProvider */:\n            injectable = _createClass(ngModule, providerDef.value, providerDef.deps);\n            break;\n        case 1024 /* TypeFactoryProvider */:\n            injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);\n            break;\n        case 2048 /* TypeUseExistingProvider */:\n            injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);\n            break;\n        case 256 /* TypeValueProvider */:\n            injectable = providerDef.value;\n            break;\n    }\n    return injectable;\n}\n/**\n * @param {?} ngModule\n * @param {?} ctor\n * @param {?} deps\n * @return {?}\n */\nfunction _createClass(ngModule, ctor, deps) {\n    var /** @type {?} */ len = deps.length;\n    var /** @type {?} */ injectable;\n    switch (len) {\n        case 0:\n            injectable = new ctor();\n            break;\n        case 1:\n            injectable = new ctor(resolveNgModuleDep(ngModule, deps[0]));\n            break;\n        case 2:\n            injectable =\n                new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n            break;\n        case 3:\n            injectable = new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));\n            break;\n        default:\n            var /** @type {?} */ depValues = new Array(len);\n            for (var /** @type {?} */ i = 0; i < len; i++) {\n                depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n            }\n            injectable = new (ctor.bind.apply(ctor, [void 0].concat(depValues)))();\n    }\n    return injectable;\n}\n/**\n * @param {?} ngModule\n * @param {?} factory\n * @param {?} deps\n * @return {?}\n */\nfunction _callFactory(ngModule, factory, deps) {\n    var /** @type {?} */ len = deps.length;\n    var /** @type {?} */ injectable;\n    switch (len) {\n        case 0:\n            injectable = factory();\n            break;\n        case 1:\n            injectable = factory(resolveNgModuleDep(ngModule, deps[0]));\n            break;\n        case 2:\n            injectable =\n                factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n            break;\n        case 3:\n            injectable = factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));\n            break;\n        default:\n            var /** @type {?} */ depValues = Array(len);\n            for (var /** @type {?} */ i = 0; i < len; i++) {\n                depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n            }\n            injectable = factory.apply(void 0, depValues);\n    }\n    return injectable;\n}\n/**\n * @param {?} ngModule\n * @param {?} lifecycles\n * @return {?}\n */\nfunction callNgModuleLifecycle(ngModule, lifecycles) {\n    var /** @type {?} */ def = ngModule._def;\n    for (var /** @type {?} */ i = 0; i < def.providers.length; i++) {\n        var /** @type {?} */ provDef = def.providers[i];\n        if (provDef.flags & 131072 /* OnDestroy */) {\n            var /** @type {?} */ instance = ngModule._providers[i];\n            if (instance && instance !== NOT_CREATED$1) {\n                instance.ngOnDestroy();\n            }\n        }\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} parentView\n * @param {?} elementData\n * @param {?} viewIndex\n * @param {?} view\n * @return {?}\n */\nfunction attachEmbeddedView(parentView, elementData, viewIndex, view) {\n    var /** @type {?} */ embeddedViews = ((elementData.viewContainer))._embeddedViews;\n    if (viewIndex === null || viewIndex === undefined) {\n        viewIndex = embeddedViews.length;\n    }\n    view.viewContainerParent = parentView;\n    addToArray(embeddedViews, /** @type {?} */ ((viewIndex)), view);\n    attachProjectedView(elementData, view);\n    Services.dirtyParentQueries(view);\n    var /** @type {?} */ prevView = ((viewIndex)) > 0 ? embeddedViews[((viewIndex)) - 1] : null;\n    renderAttachEmbeddedView(elementData, prevView, view);\n}\n/**\n * @param {?} vcElementData\n * @param {?} view\n * @return {?}\n */\nfunction attachProjectedView(vcElementData, view) {\n    var /** @type {?} */ dvcElementData = declaredViewContainer(view);\n    if (!dvcElementData || dvcElementData === vcElementData ||\n        view.state & 16 /* IsProjectedView */) {\n        return;\n    }\n    // Note: For performance reasons, we\n    // - add a view to template._projectedViews only 1x throughout its lifetime,\n    //   and remove it not until the view is destroyed.\n    //   (hard, as when a parent view is attached/detached we would need to attach/detach all\n    //    nested projected views as well, even accross component boundaries).\n    // - don't track the insertion order of views in the projected views array\n    //   (hard, as when the views of the same template are inserted different view containers)\n    view.state |= 16 /* IsProjectedView */;\n    var /** @type {?} */ projectedViews = dvcElementData.template._projectedViews;\n    if (!projectedViews) {\n        projectedViews = dvcElementData.template._projectedViews = [];\n    }\n    projectedViews.push(view);\n    // Note: we are changing the NodeDef here as we cannot calculate\n    // the fact whether a template is used for projection during compilation.\n    markNodeAsProjectedTemplate(/** @type {?} */ ((view.parent)).def, /** @type {?} */ ((view.parentNodeDef)));\n}\n/**\n * @param {?} viewDef\n * @param {?} nodeDef\n * @return {?}\n */\nfunction markNodeAsProjectedTemplate(viewDef, nodeDef) {\n    if (nodeDef.flags & 4 /* ProjectedTemplate */) {\n        return;\n    }\n    viewDef.nodeFlags |= 4 /* ProjectedTemplate */;\n    nodeDef.flags |= 4 /* ProjectedTemplate */;\n    var /** @type {?} */ parentNodeDef = nodeDef.parent;\n    while (parentNodeDef) {\n        parentNodeDef.childFlags |= 4 /* ProjectedTemplate */;\n        parentNodeDef = parentNodeDef.parent;\n    }\n}\n/**\n * @param {?} elementData\n * @param {?=} viewIndex\n * @return {?}\n */\nfunction detachEmbeddedView(elementData, viewIndex) {\n    var /** @type {?} */ embeddedViews = ((elementData.viewContainer))._embeddedViews;\n    if (viewIndex == null || viewIndex >= embeddedViews.length) {\n        viewIndex = embeddedViews.length - 1;\n    }\n    if (viewIndex < 0) {\n        return null;\n    }\n    var /** @type {?} */ view = embeddedViews[viewIndex];\n    view.viewContainerParent = null;\n    removeFromArray(embeddedViews, viewIndex);\n    // See attachProjectedView for why we don't update projectedViews here.\n    Services.dirtyParentQueries(view);\n    renderDetachView(view);\n    return view;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction detachProjectedView(view) {\n    if (!(view.state & 16 /* IsProjectedView */)) {\n        return;\n    }\n    var /** @type {?} */ dvcElementData = declaredViewContainer(view);\n    if (dvcElementData) {\n        var /** @type {?} */ projectedViews = dvcElementData.template._projectedViews;\n        if (projectedViews) {\n            removeFromArray(projectedViews, projectedViews.indexOf(view));\n            Services.dirtyParentQueries(view);\n        }\n    }\n}\n/**\n * @param {?} elementData\n * @param {?} oldViewIndex\n * @param {?} newViewIndex\n * @return {?}\n */\nfunction moveEmbeddedView(elementData, oldViewIndex, newViewIndex) {\n    var /** @type {?} */ embeddedViews = ((elementData.viewContainer))._embeddedViews;\n    var /** @type {?} */ view = embeddedViews[oldViewIndex];\n    removeFromArray(embeddedViews, oldViewIndex);\n    if (newViewIndex == null) {\n        newViewIndex = embeddedViews.length;\n    }\n    addToArray(embeddedViews, newViewIndex, view);\n    // Note: Don't need to change projectedViews as the order in there\n    // as always invalid...\n    Services.dirtyParentQueries(view);\n    renderDetachView(view);\n    var /** @type {?} */ prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;\n    renderAttachEmbeddedView(elementData, prevView, view);\n    return view;\n}\n/**\n * @param {?} elementData\n * @param {?} prevView\n * @param {?} view\n * @return {?}\n */\nfunction renderAttachEmbeddedView(elementData, prevView, view) {\n    var /** @type {?} */ prevRenderNode = prevView ? renderNode(prevView, /** @type {?} */ ((prevView.def.lastRenderRootNode))) :\n        elementData.renderElement;\n    var /** @type {?} */ parentNode = view.renderer.parentNode(prevRenderNode);\n    var /** @type {?} */ nextSibling = view.renderer.nextSibling(prevRenderNode);\n    // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!\n    // However, browsers automatically do `appendChild` when there is no `nextSibling`.\n    visitRootRenderNodes(view, 2 /* InsertBefore */, parentNode, nextSibling, undefined);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction renderDetachView(view) {\n    visitRootRenderNodes(view, 3 /* RemoveChild */, null, null, undefined);\n}\n/**\n * @param {?} arr\n * @param {?} index\n * @param {?} value\n * @return {?}\n */\nfunction addToArray(arr, index, value) {\n    // perf: array.push is faster than array.splice!\n    if (index >= arr.length) {\n        arr.push(value);\n    }\n    else {\n        arr.splice(index, 0, value);\n    }\n}\n/**\n * @param {?} arr\n * @param {?} index\n * @return {?}\n */\nfunction removeFromArray(arr, index) {\n    // perf: array.pop is faster than array.splice!\n    if (index >= arr.length - 1) {\n        arr.pop();\n    }\n    else {\n        arr.splice(index, 1);\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar EMPTY_CONTEXT = new Object();\n/**\n * @param {?} selector\n * @param {?} componentType\n * @param {?} viewDefFactory\n * @param {?} inputs\n * @param {?} outputs\n * @param {?} ngContentSelectors\n * @return {?}\n */\nfunction createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) {\n    return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);\n}\n/**\n * @param {?} componentFactory\n * @return {?}\n */\nfunction getComponentViewDefinitionFactory(componentFactory) {\n    return ((componentFactory)).viewDefFactory;\n}\nvar ComponentFactory_ = (function (_super) {\n    __extends(ComponentFactory_, _super);\n    /**\n     * @param {?} selector\n     * @param {?} componentType\n     * @param {?} viewDefFactory\n     * @param {?} _inputs\n     * @param {?} _outputs\n     * @param {?} ngContentSelectors\n     */\n    function ComponentFactory_(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) {\n        var _this = \n        // Attention: this ctor is called as top level function.\n        // Putting any logic in here will destroy closure tree shaking!\n        _super.call(this) || this;\n        _this.selector = selector;\n        _this.componentType = componentType;\n        _this._inputs = _inputs;\n        _this._outputs = _outputs;\n        _this.ngContentSelectors = ngContentSelectors;\n        _this.viewDefFactory = viewDefFactory;\n        return _this;\n    }\n    Object.defineProperty(ComponentFactory_.prototype, \"inputs\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ inputsArr = [];\n            var /** @type {?} */ inputs = ((this._inputs));\n            for (var /** @type {?} */ propName in inputs) {\n                var /** @type {?} */ templateName = inputs[propName];\n                inputsArr.push({ propName: propName, templateName: templateName });\n            }\n            return inputsArr;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentFactory_.prototype, \"outputs\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ outputsArr = [];\n            for (var /** @type {?} */ propName in this._outputs) {\n                var /** @type {?} */ templateName = this._outputs[propName];\n                outputsArr.push({ propName: propName, templateName: templateName });\n            }\n            return outputsArr;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * Creates a new component.\n     * @param {?} injector\n     * @param {?=} projectableNodes\n     * @param {?=} rootSelectorOrNode\n     * @param {?=} ngModule\n     * @return {?}\n     */\n    ComponentFactory_.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {\n        if (!ngModule) {\n            throw new Error('ngModule should be provided');\n        }\n        var /** @type {?} */ viewDef = resolveDefinition(this.viewDefFactory);\n        var /** @type {?} */ componentNodeIndex = ((((viewDef.nodes[0].element)).componentProvider)).index;\n        var /** @type {?} */ view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);\n        var /** @type {?} */ component = asProviderData(view, componentNodeIndex).instance;\n        if (rootSelectorOrNode) {\n            view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);\n        }\n        return new ComponentRef_(view, new ViewRef_(view), component);\n    };\n    return ComponentFactory_;\n}(ComponentFactory));\nvar ComponentRef_ = (function (_super) {\n    __extends(ComponentRef_, _super);\n    /**\n     * @param {?} _view\n     * @param {?} _viewRef\n     * @param {?} _component\n     */\n    function ComponentRef_(_view, _viewRef, _component) {\n        var _this = _super.call(this) || this;\n        _this._view = _view;\n        _this._viewRef = _viewRef;\n        _this._component = _component;\n        _this._elDef = _this._view.def.nodes[0];\n        return _this;\n    }\n    Object.defineProperty(ComponentRef_.prototype, \"location\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return new ElementRef(asElementData(this._view, this._elDef.index).renderElement);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentRef_.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return new Injector_(this._view, this._elDef); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ComponentRef_.prototype, \"instance\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._component; },\n        enumerable: true,\n        configurable: true\n    });\n    \n    Object.defineProperty(ComponentRef_.prototype, \"hostView\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._viewRef; },\n        enumerable: true,\n        configurable: true\n    });\n    \n    Object.defineProperty(ComponentRef_.prototype, \"changeDetectorRef\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._viewRef; },\n        enumerable: true,\n        configurable: true\n    });\n    \n    Object.defineProperty(ComponentRef_.prototype, \"componentType\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return (this._component.constructor); },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    ComponentRef_.prototype.destroy = function () { this._viewRef.destroy(); };\n    /**\n     * @param {?} callback\n     * @return {?}\n     */\n    ComponentRef_.prototype.onDestroy = function (callback) { this._viewRef.onDestroy(callback); };\n    return ComponentRef_;\n}(ComponentRef));\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} elData\n * @return {?}\n */\nfunction createViewContainerData(view, elDef, elData) {\n    return new ViewContainerRef_(view, elDef, elData);\n}\nvar ViewContainerRef_ = (function () {\n    /**\n     * @param {?} _view\n     * @param {?} _elDef\n     * @param {?} _data\n     */\n    function ViewContainerRef_(_view, _elDef, _data) {\n        this._view = _view;\n        this._elDef = _elDef;\n        this._data = _data;\n        /**\n         * \\@internal\n         */\n        this._embeddedViews = [];\n    }\n    Object.defineProperty(ViewContainerRef_.prototype, \"element\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return new ElementRef(this._data.renderElement); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ViewContainerRef_.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return new Injector_(this._view, this._elDef); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ViewContainerRef_.prototype, \"parentInjector\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ view = this._view;\n            var /** @type {?} */ elDef = this._elDef.parent;\n            while (!elDef && view) {\n                elDef = viewParentEl(view);\n                view = ((view.parent));\n            }\n            return view ? new Injector_(view, elDef) : new Injector_(this._view, null);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.clear = function () {\n        var /** @type {?} */ len = this._embeddedViews.length;\n        for (var /** @type {?} */ i = len - 1; i >= 0; i--) {\n            var /** @type {?} */ view = ((detachEmbeddedView(this._data, i)));\n            Services.destroyView(view);\n        }\n    };\n    /**\n     * @param {?} index\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.get = function (index) {\n        var /** @type {?} */ view = this._embeddedViews[index];\n        if (view) {\n            var /** @type {?} */ ref = new ViewRef_(view);\n            ref.attachToViewContainerRef(this);\n            return ref;\n        }\n        return null;\n    };\n    Object.defineProperty(ViewContainerRef_.prototype, \"length\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._embeddedViews.length; },\n        enumerable: true,\n        configurable: true\n    });\n    \n    /**\n     * @template C\n     * @param {?} templateRef\n     * @param {?=} context\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.createEmbeddedView = function (templateRef, context, index) {\n        var /** @type {?} */ viewRef = templateRef.createEmbeddedView(context || ({}));\n        this.insert(viewRef, index);\n        return viewRef;\n    };\n    /**\n     * @template C\n     * @param {?} componentFactory\n     * @param {?=} index\n     * @param {?=} injector\n     * @param {?=} projectableNodes\n     * @param {?=} ngModuleRef\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.createComponent = function (componentFactory, index, injector, projectableNodes, ngModuleRef) {\n        var /** @type {?} */ contextInjector = injector || this.parentInjector;\n        if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {\n            ngModuleRef = contextInjector.get(NgModuleRef);\n        }\n        var /** @type {?} */ componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n        this.insert(componentRef.hostView, index);\n        return componentRef;\n    };\n    /**\n     * @param {?} viewRef\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.insert = function (viewRef, index) {\n        var /** @type {?} */ viewRef_ = (viewRef);\n        var /** @type {?} */ viewData = viewRef_._view;\n        attachEmbeddedView(this._view, this._data, index, viewData);\n        viewRef_.attachToViewContainerRef(this);\n        return viewRef;\n    };\n    /**\n     * @param {?} viewRef\n     * @param {?} currentIndex\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.move = function (viewRef, currentIndex) {\n        var /** @type {?} */ previousIndex = this._embeddedViews.indexOf(viewRef._view);\n        moveEmbeddedView(this._data, previousIndex, currentIndex);\n        return viewRef;\n    };\n    /**\n     * @param {?} viewRef\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.indexOf = function (viewRef) {\n        return this._embeddedViews.indexOf(((viewRef))._view);\n    };\n    /**\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.remove = function (index) {\n        var /** @type {?} */ viewData = detachEmbeddedView(this._data, index);\n        if (viewData) {\n            Services.destroyView(viewData);\n        }\n    };\n    /**\n     * @param {?=} index\n     * @return {?}\n     */\n    ViewContainerRef_.prototype.detach = function (index) {\n        var /** @type {?} */ view = detachEmbeddedView(this._data, index);\n        return view ? new ViewRef_(view) : null;\n    };\n    return ViewContainerRef_;\n}());\n/**\n * @param {?} view\n * @return {?}\n */\nfunction createChangeDetectorRef(view) {\n    return new ViewRef_(view);\n}\nvar ViewRef_ = (function () {\n    /**\n     * @param {?} _view\n     */\n    function ViewRef_(_view) {\n        this._view = _view;\n        this._viewContainerRef = null;\n        this._appRef = null;\n    }\n    Object.defineProperty(ViewRef_.prototype, \"rootNodes\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return rootRenderNodes(this._view); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ViewRef_.prototype, \"context\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._view.context; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ViewRef_.prototype, \"destroyed\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return (this._view.state & 128 /* Destroyed */) !== 0; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.markForCheck = function () { markParentViewsForCheck(this._view); };\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.detach = function () { this._view.state &= ~4 /* Attached */; };\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.detectChanges = function () {\n        var /** @type {?} */ fs = this._view.root.rendererFactory;\n        if (fs.begin) {\n            fs.begin();\n        }\n        Services.checkAndUpdateView(this._view);\n        if (fs.end) {\n            fs.end();\n        }\n    };\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.checkNoChanges = function () { Services.checkNoChangesView(this._view); };\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.reattach = function () { this._view.state |= 4 /* Attached */; };\n    /**\n     * @param {?} callback\n     * @return {?}\n     */\n    ViewRef_.prototype.onDestroy = function (callback) {\n        if (!this._view.disposables) {\n            this._view.disposables = [];\n        }\n        this._view.disposables.push(/** @type {?} */ (callback));\n    };\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.destroy = function () {\n        if (this._appRef) {\n            this._appRef.detachView(this);\n        }\n        else if (this._viewContainerRef) {\n            this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));\n        }\n        Services.destroyView(this._view);\n    };\n    /**\n     * @return {?}\n     */\n    ViewRef_.prototype.detachFromAppRef = function () {\n        this._appRef = null;\n        renderDetachView(this._view);\n        Services.dirtyParentQueries(this._view);\n    };\n    /**\n     * @param {?} appRef\n     * @return {?}\n     */\n    ViewRef_.prototype.attachToAppRef = function (appRef) {\n        if (this._viewContainerRef) {\n            throw new Error('This view is already attached to a ViewContainer!');\n        }\n        this._appRef = appRef;\n    };\n    /**\n     * @param {?} vcRef\n     * @return {?}\n     */\n    ViewRef_.prototype.attachToViewContainerRef = function (vcRef) {\n        if (this._appRef) {\n            throw new Error('This view is already attached directly to the ApplicationRef!');\n        }\n        this._viewContainerRef = vcRef;\n    };\n    return ViewRef_;\n}());\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction createTemplateData(view, def) {\n    return new TemplateRef_(view, def);\n}\nvar TemplateRef_ = (function (_super) {\n    __extends(TemplateRef_, _super);\n    /**\n     * @param {?} _parentView\n     * @param {?} _def\n     */\n    function TemplateRef_(_parentView, _def) {\n        var _this = _super.call(this) || this;\n        _this._parentView = _parentView;\n        _this._def = _def;\n        return _this;\n    }\n    /**\n     * @param {?} context\n     * @return {?}\n     */\n    TemplateRef_.prototype.createEmbeddedView = function (context) {\n        return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, /** @type {?} */ ((((this._def.element)).template)), context));\n    };\n    Object.defineProperty(TemplateRef_.prototype, \"elementRef\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return new ElementRef(asElementData(this._parentView, this._def.index).renderElement);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    return TemplateRef_;\n}(TemplateRef));\n/**\n * @param {?} view\n * @param {?} elDef\n * @return {?}\n */\nfunction createInjector(view, elDef) {\n    return new Injector_(view, elDef);\n}\nvar Injector_ = (function () {\n    /**\n     * @param {?} view\n     * @param {?} elDef\n     */\n    function Injector_(view, elDef) {\n        this.view = view;\n        this.elDef = elDef;\n    }\n    /**\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    Injector_.prototype.get = function (token, notFoundValue) {\n        if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n        var /** @type {?} */ allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false;\n        return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token: token, tokenKey: tokenKey(token) }, notFoundValue);\n    };\n    return Injector_;\n}());\n/**\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nfunction nodeValue(view, index) {\n    var /** @type {?} */ def = view.def.nodes[index];\n    if (def.flags & 1 /* TypeElement */) {\n        var /** @type {?} */ elData = asElementData(view, def.index);\n        return ((def.element)).template ? elData.template : elData.renderElement;\n    }\n    else if (def.flags & 2 /* TypeText */) {\n        return asTextData(view, def.index).renderText;\n    }\n    else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) {\n        return asProviderData(view, def.index).instance;\n    }\n    throw new Error(\"Illegal state: read nodeValue for node index \" + index);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction createRendererV1(view) {\n    return new RendererAdapter(view.renderer);\n}\nvar RendererAdapter = (function () {\n    /**\n     * @param {?} delegate\n     */\n    function RendererAdapter(delegate) {\n        this.delegate = delegate;\n    }\n    /**\n     * @param {?} selectorOrNode\n     * @return {?}\n     */\n    RendererAdapter.prototype.selectRootElement = function (selectorOrNode) {\n        return this.delegate.selectRootElement(selectorOrNode);\n    };\n    /**\n     * @param {?} parent\n     * @param {?} namespaceAndName\n     * @return {?}\n     */\n    RendererAdapter.prototype.createElement = function (parent, namespaceAndName) {\n        var _a = splitNamespace(namespaceAndName), ns = _a[0], name = _a[1];\n        var /** @type {?} */ el = this.delegate.createElement(name, ns);\n        if (parent) {\n            this.delegate.appendChild(parent, el);\n        }\n        return el;\n    };\n    /**\n     * @param {?} hostElement\n     * @return {?}\n     */\n    RendererAdapter.prototype.createViewRoot = function (hostElement) { return hostElement; };\n    /**\n     * @param {?} parentElement\n     * @return {?}\n     */\n    RendererAdapter.prototype.createTemplateAnchor = function (parentElement) {\n        var /** @type {?} */ comment = this.delegate.createComment('');\n        if (parentElement) {\n            this.delegate.appendChild(parentElement, comment);\n        }\n        return comment;\n    };\n    /**\n     * @param {?} parentElement\n     * @param {?} value\n     * @return {?}\n     */\n    RendererAdapter.prototype.createText = function (parentElement, value) {\n        var /** @type {?} */ node = this.delegate.createText(value);\n        if (parentElement) {\n            this.delegate.appendChild(parentElement, node);\n        }\n        return node;\n    };\n    /**\n     * @param {?} parentElement\n     * @param {?} nodes\n     * @return {?}\n     */\n    RendererAdapter.prototype.projectNodes = function (parentElement, nodes) {\n        for (var /** @type {?} */ i = 0; i < nodes.length; i++) {\n            this.delegate.appendChild(parentElement, nodes[i]);\n        }\n    };\n    /**\n     * @param {?} node\n     * @param {?} viewRootNodes\n     * @return {?}\n     */\n    RendererAdapter.prototype.attachViewAfter = function (node, viewRootNodes) {\n        var /** @type {?} */ parentElement = this.delegate.parentNode(node);\n        var /** @type {?} */ nextSibling = this.delegate.nextSibling(node);\n        for (var /** @type {?} */ i = 0; i < viewRootNodes.length; i++) {\n            this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);\n        }\n    };\n    /**\n     * @param {?} viewRootNodes\n     * @return {?}\n     */\n    RendererAdapter.prototype.detachView = function (viewRootNodes) {\n        for (var /** @type {?} */ i = 0; i < viewRootNodes.length; i++) {\n            var /** @type {?} */ node = viewRootNodes[i];\n            var /** @type {?} */ parentElement = this.delegate.parentNode(node);\n            this.delegate.removeChild(parentElement, node);\n        }\n    };\n    /**\n     * @param {?} hostElement\n     * @param {?} viewAllNodes\n     * @return {?}\n     */\n    RendererAdapter.prototype.destroyView = function (hostElement, viewAllNodes) {\n        for (var /** @type {?} */ i = 0; i < viewAllNodes.length; i++) {\n            ((this.delegate.destroyNode))(viewAllNodes[i]);\n        }\n    };\n    /**\n     * @param {?} renderElement\n     * @param {?} name\n     * @param {?} callback\n     * @return {?}\n     */\n    RendererAdapter.prototype.listen = function (renderElement, name, callback) {\n        return this.delegate.listen(renderElement, name, /** @type {?} */ (callback));\n    };\n    /**\n     * @param {?} target\n     * @param {?} name\n     * @param {?} callback\n     * @return {?}\n     */\n    RendererAdapter.prototype.listenGlobal = function (target, name, callback) {\n        return this.delegate.listen(target, name, /** @type {?} */ (callback));\n    };\n    /**\n     * @param {?} renderElement\n     * @param {?} propertyName\n     * @param {?} propertyValue\n     * @return {?}\n     */\n    RendererAdapter.prototype.setElementProperty = function (renderElement, propertyName, propertyValue) {\n        this.delegate.setProperty(renderElement, propertyName, propertyValue);\n    };\n    /**\n     * @param {?} renderElement\n     * @param {?} namespaceAndName\n     * @param {?} attributeValue\n     * @return {?}\n     */\n    RendererAdapter.prototype.setElementAttribute = function (renderElement, namespaceAndName, attributeValue) {\n        var _a = splitNamespace(namespaceAndName), ns = _a[0], name = _a[1];\n        if (attributeValue != null) {\n            this.delegate.setAttribute(renderElement, name, attributeValue, ns);\n        }\n        else {\n            this.delegate.removeAttribute(renderElement, name, ns);\n        }\n    };\n    /**\n     * @param {?} renderElement\n     * @param {?} propertyName\n     * @param {?} propertyValue\n     * @return {?}\n     */\n    RendererAdapter.prototype.setBindingDebugInfo = function (renderElement, propertyName, propertyValue) { };\n    /**\n     * @param {?} renderElement\n     * @param {?} className\n     * @param {?} isAdd\n     * @return {?}\n     */\n    RendererAdapter.prototype.setElementClass = function (renderElement, className, isAdd) {\n        if (isAdd) {\n            this.delegate.addClass(renderElement, className);\n        }\n        else {\n            this.delegate.removeClass(renderElement, className);\n        }\n    };\n    /**\n     * @param {?} renderElement\n     * @param {?} styleName\n     * @param {?} styleValue\n     * @return {?}\n     */\n    RendererAdapter.prototype.setElementStyle = function (renderElement, styleName, styleValue) {\n        if (styleValue != null) {\n            this.delegate.setStyle(renderElement, styleName, styleValue);\n        }\n        else {\n            this.delegate.removeStyle(renderElement, styleName);\n        }\n    };\n    /**\n     * @param {?} renderElement\n     * @param {?} methodName\n     * @param {?} args\n     * @return {?}\n     */\n    RendererAdapter.prototype.invokeElementMethod = function (renderElement, methodName, args) {\n        ((renderElement))[methodName].apply(renderElement, args);\n    };\n    /**\n     * @param {?} renderNode\n     * @param {?} text\n     * @return {?}\n     */\n    RendererAdapter.prototype.setText = function (renderNode$$1, text) { this.delegate.setValue(renderNode$$1, text); };\n    /**\n     * @return {?}\n     */\n    RendererAdapter.prototype.animate = function () { throw new Error('Renderer.animate is no longer supported!'); };\n    return RendererAdapter;\n}());\n/**\n * @param {?} moduleType\n * @param {?} parent\n * @param {?} bootstrapComponents\n * @param {?} def\n * @return {?}\n */\nfunction createNgModuleRef(moduleType, parent, bootstrapComponents, def) {\n    return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);\n}\nvar NgModuleRef_ = (function () {\n    /**\n     * @param {?} _moduleType\n     * @param {?} _parent\n     * @param {?} _bootstrapComponents\n     * @param {?} _def\n     */\n    function NgModuleRef_(_moduleType, _parent, _bootstrapComponents, _def) {\n        this._moduleType = _moduleType;\n        this._parent = _parent;\n        this._bootstrapComponents = _bootstrapComponents;\n        this._def = _def;\n        this._destroyListeners = [];\n        this._destroyed = false;\n        initNgModule(this);\n    }\n    /**\n     * @param {?} token\n     * @param {?=} notFoundValue\n     * @return {?}\n     */\n    NgModuleRef_.prototype.get = function (token, notFoundValue) {\n        if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n        return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: 0 /* None */ }, notFoundValue);\n    };\n    Object.defineProperty(NgModuleRef_.prototype, \"instance\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.get(this._moduleType); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgModuleRef_.prototype, \"componentFactoryResolver\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.get(ComponentFactoryResolver); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgModuleRef_.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    NgModuleRef_.prototype.destroy = function () {\n        if (this._destroyed) {\n            throw new Error(\"The ng module \" + stringify(this.instance.constructor) + \" has already been destroyed.\");\n        }\n        this._destroyed = true;\n        callNgModuleLifecycle(this, 131072 /* OnDestroy */);\n        this._destroyListeners.forEach(function (listener) { return listener(); });\n    };\n    /**\n     * @param {?} callback\n     * @return {?}\n     */\n    NgModuleRef_.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };\n    return NgModuleRef_;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar RendererV1TokenKey = tokenKey(Renderer);\nvar Renderer2TokenKey = tokenKey(Renderer2);\nvar ElementRefTokenKey = tokenKey(ElementRef);\nvar ViewContainerRefTokenKey = tokenKey(ViewContainerRef);\nvar TemplateRefTokenKey = tokenKey(TemplateRef);\nvar ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);\nvar InjectorRefTokenKey = tokenKey(Injector);\nvar NOT_CREATED = new Object();\n/**\n * @param {?} flags\n * @param {?} matchedQueries\n * @param {?} childCount\n * @param {?} ctor\n * @param {?} deps\n * @param {?=} props\n * @param {?=} outputs\n * @return {?}\n */\nfunction directiveDef(flags, matchedQueries, childCount, ctor, deps, props, outputs) {\n    var /** @type {?} */ bindings = [];\n    if (props) {\n        for (var /** @type {?} */ prop in props) {\n            var _a = props[prop], bindingIndex = _a[0], nonMinifiedName = _a[1];\n            bindings[bindingIndex] = {\n                flags: 8 /* TypeProperty */,\n                name: prop, nonMinifiedName: nonMinifiedName,\n                ns: null,\n                securityContext: null,\n                suffix: null\n            };\n        }\n    }\n    var /** @type {?} */ outputDefs = [];\n    if (outputs) {\n        for (var /** @type {?} */ propName in outputs) {\n            outputDefs.push({ type: 1 /* DirectiveOutput */, propName: propName, target: null, eventName: outputs[propName] });\n        }\n    }\n    flags |= 16384 /* TypeDirective */;\n    return _def(flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);\n}\n/**\n * @param {?} flags\n * @param {?} ctor\n * @param {?} deps\n * @return {?}\n */\nfunction pipeDef(flags, ctor, deps) {\n    flags |= 16 /* TypePipe */;\n    return _def(flags, null, 0, ctor, ctor, deps);\n}\n/**\n * @param {?} flags\n * @param {?} matchedQueries\n * @param {?} token\n * @param {?} value\n * @param {?} deps\n * @return {?}\n */\nfunction providerDef(flags, matchedQueries, token, value, deps) {\n    return _def(flags, matchedQueries, 0, token, value, deps);\n}\n/**\n * @param {?} flags\n * @param {?} matchedQueriesDsl\n * @param {?} childCount\n * @param {?} token\n * @param {?} value\n * @param {?} deps\n * @param {?=} bindings\n * @param {?=} outputs\n * @return {?}\n */\nfunction _def(flags, matchedQueriesDsl, childCount, token, value, deps, bindings, outputs) {\n    var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;\n    if (!outputs) {\n        outputs = [];\n    }\n    if (!bindings) {\n        bindings = [];\n    }\n    var /** @type {?} */ depDefs = splitDepsDsl(deps);\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: flags,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references,\n        ngContentIndex: -1, childCount: childCount, bindings: bindings,\n        bindingFlags: calcBindingFlags(bindings), outputs: outputs,\n        element: null,\n        provider: { token: token, value: value, deps: depDefs },\n        text: null,\n        query: null,\n        ngContent: null\n    };\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction createProviderInstance(view, def) {\n    return def.flags & 4096 /* LazyProvider */ ? NOT_CREATED : _createProviderInstance(view, def);\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction createPipeInstance(view, def) {\n    // deps are looked up from component.\n    var /** @type {?} */ compView = view;\n    while (compView.parent && !isComponentView(compView)) {\n        compView = compView.parent;\n    }\n    // pipes can see the private services of the component\n    var /** @type {?} */ allowPrivateServices = true;\n    // pipes are always eager and classes!\n    return createClass(/** @type {?} */ ((compView.parent)), /** @type {?} */ ((viewParentEl(compView))), allowPrivateServices, /** @type {?} */ ((def.provider)).value, /** @type {?} */ ((def.provider)).deps);\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction createDirectiveInstance(view, def) {\n    // components can see other private services, other directives can't.\n    var /** @type {?} */ allowPrivateServices = (def.flags & 32768 /* Component */) > 0;\n    // directives are always eager and classes!\n    var /** @type {?} */ instance = createClass(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((def.provider)).value, /** @type {?} */ ((def.provider)).deps);\n    if (def.outputs.length) {\n        for (var /** @type {?} */ i = 0; i < def.outputs.length; i++) {\n            var /** @type {?} */ output = def.outputs[i];\n            var /** @type {?} */ subscription = instance[((output.propName))].subscribe(eventHandlerClosure(view, /** @type {?} */ ((def.parent)).index, output.eventName)); /** @type {?} */\n            ((view.disposables))[def.outputIndex + i] = subscription.unsubscribe.bind(subscription);\n        }\n    }\n    return instance;\n}\n/**\n * @param {?} view\n * @param {?} index\n * @param {?} eventName\n * @return {?}\n */\nfunction eventHandlerClosure(view, index, eventName) {\n    return function (event) {\n        try {\n            return dispatchEvent(view, index, eventName, event);\n        }\n        catch (e) {\n            // Attention: Don't rethrow, as it would cancel Observable subscriptions!\n            view.root.errorHandler.handleError(e);\n        }\n    };\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} v0\n * @param {?} v1\n * @param {?} v2\n * @param {?} v3\n * @param {?} v4\n * @param {?} v5\n * @param {?} v6\n * @param {?} v7\n * @param {?} v8\n * @param {?} v9\n * @return {?}\n */\nfunction checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ providerData = asProviderData(view, def.index);\n    var /** @type {?} */ directive = providerData.instance;\n    var /** @type {?} */ changed = false;\n    var /** @type {?} */ changes = ((undefined));\n    var /** @type {?} */ bindLen = def.bindings.length;\n    if (bindLen > 0 && checkBinding(view, def, 0, v0)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 0, v0, changes);\n    }\n    if (bindLen > 1 && checkBinding(view, def, 1, v1)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 1, v1, changes);\n    }\n    if (bindLen > 2 && checkBinding(view, def, 2, v2)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 2, v2, changes);\n    }\n    if (bindLen > 3 && checkBinding(view, def, 3, v3)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 3, v3, changes);\n    }\n    if (bindLen > 4 && checkBinding(view, def, 4, v4)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 4, v4, changes);\n    }\n    if (bindLen > 5 && checkBinding(view, def, 5, v5)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 5, v5, changes);\n    }\n    if (bindLen > 6 && checkBinding(view, def, 6, v6)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 6, v6, changes);\n    }\n    if (bindLen > 7 && checkBinding(view, def, 7, v7)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 7, v7, changes);\n    }\n    if (bindLen > 8 && checkBinding(view, def, 8, v8)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 8, v8, changes);\n    }\n    if (bindLen > 9 && checkBinding(view, def, 9, v9)) {\n        changed = true;\n        changes = updateProp(view, providerData, def, 9, v9, changes);\n    }\n    if (changes) {\n        directive.ngOnChanges(changes);\n    }\n    if ((view.state & 2 /* FirstCheck */) && (def.flags & 65536 /* OnInit */)) {\n        directive.ngOnInit();\n    }\n    if (def.flags & 262144 /* DoCheck */) {\n        directive.ngDoCheck();\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} values\n * @return {?}\n */\nfunction checkAndUpdateDirectiveDynamic(view, def, values) {\n    var /** @type {?} */ providerData = asProviderData(view, def.index);\n    var /** @type {?} */ directive = providerData.instance;\n    var /** @type {?} */ changed = false;\n    var /** @type {?} */ changes = ((undefined));\n    for (var /** @type {?} */ i = 0; i < values.length; i++) {\n        if (checkBinding(view, def, i, values[i])) {\n            changed = true;\n            changes = updateProp(view, providerData, def, i, values[i], changes);\n        }\n    }\n    if (changes) {\n        directive.ngOnChanges(changes);\n    }\n    if ((view.state & 2 /* FirstCheck */) && (def.flags & 65536 /* OnInit */)) {\n        directive.ngOnInit();\n    }\n    if (def.flags & 262144 /* DoCheck */) {\n        directive.ngDoCheck();\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction _createProviderInstance(view, def) {\n    // private services can see other private services\n    var /** @type {?} */ allowPrivateServices = (def.flags & 8192 /* PrivateProvider */) > 0;\n    var /** @type {?} */ providerDef = def.provider;\n    var /** @type {?} */ injectable;\n    switch (def.flags & 201347067 /* Types */) {\n        case 512 /* TypeClassProvider */:\n            injectable = createClass(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((providerDef)).value, /** @type {?} */ ((providerDef)).deps);\n            break;\n        case 1024 /* TypeFactoryProvider */:\n            injectable = callFactory(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((providerDef)).value, /** @type {?} */ ((providerDef)).deps);\n            break;\n        case 2048 /* TypeUseExistingProvider */:\n            injectable = resolveDep(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((providerDef)).deps[0]);\n            break;\n        case 256 /* TypeValueProvider */:\n            injectable = ((providerDef)).value;\n            break;\n    }\n    return injectable;\n}\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} allowPrivateServices\n * @param {?} ctor\n * @param {?} deps\n * @return {?}\n */\nfunction createClass(view, elDef, allowPrivateServices, ctor, deps) {\n    var /** @type {?} */ len = deps.length;\n    var /** @type {?} */ injectable;\n    switch (len) {\n        case 0:\n            injectable = new ctor();\n            break;\n        case 1:\n            injectable = new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n            break;\n        case 2:\n            injectable = new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));\n            break;\n        case 3:\n            injectable = new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));\n            break;\n        default:\n            var /** @type {?} */ depValues = new Array(len);\n            for (var /** @type {?} */ i = 0; i < len; i++) {\n                depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n            }\n            injectable = new (ctor.bind.apply(ctor, [void 0].concat(depValues)))();\n    }\n    return injectable;\n}\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} allowPrivateServices\n * @param {?} factory\n * @param {?} deps\n * @return {?}\n */\nfunction callFactory(view, elDef, allowPrivateServices, factory, deps) {\n    var /** @type {?} */ len = deps.length;\n    var /** @type {?} */ injectable;\n    switch (len) {\n        case 0:\n            injectable = factory();\n            break;\n        case 1:\n            injectable = factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n            break;\n        case 2:\n            injectable = factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));\n            break;\n        case 3:\n            injectable = factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));\n            break;\n        default:\n            var /** @type {?} */ depValues = Array(len);\n            for (var /** @type {?} */ i = 0; i < len; i++) {\n                depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n            }\n            injectable = factory.apply(void 0, depValues);\n    }\n    return injectable;\n}\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n//          mod1\n//         /\n//       el1   mod2\n//         \\  /\n//         el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nvar NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} allowPrivateServices\n * @param {?} depDef\n * @param {?=} notFoundValue\n * @return {?}\n */\nfunction resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue) {\n    if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }\n    if (depDef.flags & 8 /* Value */) {\n        return depDef.token;\n    }\n    var /** @type {?} */ startView = view;\n    if (depDef.flags & 2 /* Optional */) {\n        notFoundValue = null;\n    }\n    var /** @type {?} */ tokenKey$$1 = depDef.tokenKey;\n    if (tokenKey$$1 === ChangeDetectorRefTokenKey) {\n        // directives on the same element as a component should be able to control the change detector\n        // of that component as well.\n        allowPrivateServices = !!(elDef && ((elDef.element)).componentView);\n    }\n    if (elDef && (depDef.flags & 1 /* SkipSelf */)) {\n        allowPrivateServices = false;\n        elDef = ((elDef.parent));\n    }\n    while (view) {\n        if (elDef) {\n            switch (tokenKey$$1) {\n                case RendererV1TokenKey: {\n                    var /** @type {?} */ compView = findCompView(view, elDef, allowPrivateServices);\n                    return createRendererV1(compView);\n                }\n                case Renderer2TokenKey: {\n                    var /** @type {?} */ compView = findCompView(view, elDef, allowPrivateServices);\n                    return compView.renderer;\n                }\n                case ElementRefTokenKey:\n                    return new ElementRef(asElementData(view, elDef.index).renderElement);\n                case ViewContainerRefTokenKey:\n                    return asElementData(view, elDef.index).viewContainer;\n                case TemplateRefTokenKey: {\n                    if (((elDef.element)).template) {\n                        return asElementData(view, elDef.index).template;\n                    }\n                    break;\n                }\n                case ChangeDetectorRefTokenKey: {\n                    var /** @type {?} */ cdView = findCompView(view, elDef, allowPrivateServices);\n                    return createChangeDetectorRef(cdView);\n                }\n                case InjectorRefTokenKey:\n                    return createInjector(view, elDef);\n                default:\n                    var /** @type {?} */ providerDef_1 = (((allowPrivateServices ? ((elDef.element)).allProviders : ((elDef.element)).publicProviders)))[tokenKey$$1];\n                    if (providerDef_1) {\n                        var /** @type {?} */ providerData = asProviderData(view, providerDef_1.index);\n                        if (providerData.instance === NOT_CREATED) {\n                            providerData.instance = _createProviderInstance(view, providerDef_1);\n                        }\n                        return providerData.instance;\n                    }\n            }\n        }\n        allowPrivateServices = isComponentView(view);\n        elDef = ((viewParentEl(view)));\n        view = ((view.parent));\n    }\n    var /** @type {?} */ value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n    if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n        notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n        // Return the value from the root element injector when\n        // - it provides it\n        //   (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n        // - the module injector should not be checked\n        //   (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n        return value;\n    }\n    return startView.root.ngModule.injector.get(depDef.token, notFoundValue);\n}\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} allowPrivateServices\n * @return {?}\n */\nfunction findCompView(view, elDef, allowPrivateServices) {\n    var /** @type {?} */ compView;\n    if (allowPrivateServices) {\n        compView = asElementData(view, elDef.index).componentView;\n    }\n    else {\n        compView = view;\n        while (compView.parent && !isComponentView(compView)) {\n            compView = compView.parent;\n        }\n    }\n    return compView;\n}\n/**\n * @param {?} view\n * @param {?} providerData\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @param {?} changes\n * @return {?}\n */\nfunction updateProp(view, providerData, def, bindingIdx, value, changes) {\n    if (def.flags & 32768 /* Component */) {\n        var /** @type {?} */ compView = asElementData(view, /** @type {?} */ ((def.parent)).index).componentView;\n        if (compView.def.flags & 2 /* OnPush */) {\n            compView.state |= 8 /* ChecksEnabled */;\n        }\n    }\n    var /** @type {?} */ binding = def.bindings[bindingIdx];\n    var /** @type {?} */ propName = ((binding.name));\n    // Note: This is still safe with Closure Compiler as\n    // the user passed in the property name as an object has to `providerDef`,\n    // so Closure Compiler will have renamed the property correctly already.\n    providerData.instance[propName] = value;\n    if (def.flags & 524288 /* OnChanges */) {\n        changes = changes || {};\n        var /** @type {?} */ oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n        if (oldValue instanceof WrappedValue) {\n            oldValue = oldValue.wrapped;\n        }\n        var /** @type {?} */ binding_1 = def.bindings[bindingIdx];\n        changes[((binding_1.nonMinifiedName))] =\n            new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0);\n    }\n    view.oldValues[def.bindingIndex + bindingIdx] = value;\n    return changes;\n}\n/**\n * @param {?} view\n * @param {?} lifecycles\n * @return {?}\n */\nfunction callLifecycleHooksChildrenFirst(view, lifecycles) {\n    if (!(view.def.nodeFlags & lifecycles)) {\n        return;\n    }\n    var /** @type {?} */ nodes = view.def.nodes;\n    for (var /** @type {?} */ i = 0; i < nodes.length; i++) {\n        var /** @type {?} */ nodeDef = nodes[i];\n        var /** @type {?} */ parent = nodeDef.parent;\n        if (!parent && nodeDef.flags & lifecycles) {\n            // matching root node (e.g. a pipe)\n            callProviderLifecycles(view, i, nodeDef.flags & lifecycles);\n        }\n        if ((nodeDef.childFlags & lifecycles) === 0) {\n            // no child matches one of the lifecycles\n            i += nodeDef.childCount;\n        }\n        while (parent && (parent.flags & 1 /* TypeElement */) &&\n            i === parent.index + parent.childCount) {\n            // last child of an element\n            if (parent.directChildFlags & lifecycles) {\n                callElementProvidersLifecycles(view, parent, lifecycles);\n            }\n            parent = parent.parent;\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} lifecycles\n * @return {?}\n */\nfunction callElementProvidersLifecycles(view, elDef, lifecycles) {\n    for (var /** @type {?} */ i = elDef.index + 1; i <= elDef.index + elDef.childCount; i++) {\n        var /** @type {?} */ nodeDef = view.def.nodes[i];\n        if (nodeDef.flags & lifecycles) {\n            callProviderLifecycles(view, i, nodeDef.flags & lifecycles);\n        }\n        // only visit direct children\n        i += nodeDef.childCount;\n    }\n}\n/**\n * @param {?} view\n * @param {?} index\n * @param {?} lifecycles\n * @return {?}\n */\nfunction callProviderLifecycles(view, index, lifecycles) {\n    var /** @type {?} */ provider = asProviderData(view, index).instance;\n    if (provider === NOT_CREATED) {\n        return;\n    }\n    Services.setCurrentNode(view, index);\n    if (lifecycles & 1048576 /* AfterContentInit */) {\n        provider.ngAfterContentInit();\n    }\n    if (lifecycles & 2097152 /* AfterContentChecked */) {\n        provider.ngAfterContentChecked();\n    }\n    if (lifecycles & 4194304 /* AfterViewInit */) {\n        provider.ngAfterViewInit();\n    }\n    if (lifecycles & 8388608 /* AfterViewChecked */) {\n        provider.ngAfterViewChecked();\n    }\n    if (lifecycles & 131072 /* OnDestroy */) {\n        provider.ngOnDestroy();\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} flags\n * @param {?} id\n * @param {?} bindings\n * @return {?}\n */\nfunction queryDef(flags, id, bindings) {\n    var /** @type {?} */ bindingDefs = [];\n    for (var /** @type {?} */ propName in bindings) {\n        var /** @type {?} */ bindingType = bindings[propName];\n        bindingDefs.push({ propName: propName, bindingType: bindingType });\n    }\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: flags,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0,\n        ngContentIndex: -1,\n        matchedQueries: {},\n        matchedQueryIds: 0,\n        references: {},\n        childCount: 0,\n        bindings: [],\n        bindingFlags: 0,\n        outputs: [],\n        element: null,\n        provider: null,\n        text: null,\n        query: { id: id, filterId: filterQueryId(id), bindings: bindingDefs },\n        ngContent: null\n    };\n}\n/**\n * @return {?}\n */\nfunction createQuery() {\n    return new QueryList();\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction dirtyParentQueries(view) {\n    var /** @type {?} */ queryIds = view.def.nodeMatchedQueries;\n    while (view.parent && isEmbeddedView(view)) {\n        var /** @type {?} */ tplDef = ((view.parentNodeDef));\n        view = view.parent;\n        // content queries\n        var /** @type {?} */ end = tplDef.index + tplDef.childCount;\n        for (var /** @type {?} */ i = 0; i <= end; i++) {\n            var /** @type {?} */ nodeDef = view.def.nodes[i];\n            if ((nodeDef.flags & 67108864 /* TypeContentQuery */) &&\n                (nodeDef.flags & 536870912 /* DynamicQuery */) &&\n                (((nodeDef.query)).filterId & queryIds) === ((nodeDef.query)).filterId) {\n                asQueryList(view, i).setDirty();\n            }\n            if ((nodeDef.flags & 1 /* TypeElement */ && i + nodeDef.childCount < tplDef.index) ||\n                !(nodeDef.childFlags & 67108864 /* TypeContentQuery */) ||\n                !(nodeDef.childFlags & 536870912 /* DynamicQuery */)) {\n                // skip elements that don't contain the template element or no query.\n                i += nodeDef.childCount;\n            }\n        }\n    }\n    // view queries\n    if (view.def.nodeFlags & 134217728 /* TypeViewQuery */) {\n        for (var /** @type {?} */ i = 0; i < view.def.nodes.length; i++) {\n            var /** @type {?} */ nodeDef = view.def.nodes[i];\n            if ((nodeDef.flags & 134217728 /* TypeViewQuery */) && (nodeDef.flags & 536870912 /* DynamicQuery */)) {\n                asQueryList(view, i).setDirty();\n            }\n            // only visit the root nodes\n            i += nodeDef.childCount;\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @return {?}\n */\nfunction checkAndUpdateQuery(view, nodeDef) {\n    var /** @type {?} */ queryList = asQueryList(view, nodeDef.index);\n    if (!queryList.dirty) {\n        return;\n    }\n    var /** @type {?} */ directiveInstance;\n    var /** @type {?} */ newValues = ((undefined));\n    if (nodeDef.flags & 67108864 /* TypeContentQuery */) {\n        var /** @type {?} */ elementDef_1 = ((((nodeDef.parent)).parent));\n        newValues = calcQueryValues(view, elementDef_1.index, elementDef_1.index + elementDef_1.childCount, /** @type {?} */ ((nodeDef.query)), []);\n        directiveInstance = asProviderData(view, /** @type {?} */ ((nodeDef.parent)).index).instance;\n    }\n    else if (nodeDef.flags & 134217728 /* TypeViewQuery */) {\n        newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, /** @type {?} */ ((nodeDef.query)), []);\n        directiveInstance = view.component;\n    }\n    queryList.reset(newValues);\n    var /** @type {?} */ bindings = ((nodeDef.query)).bindings;\n    var /** @type {?} */ notify = false;\n    for (var /** @type {?} */ i = 0; i < bindings.length; i++) {\n        var /** @type {?} */ binding = bindings[i];\n        var /** @type {?} */ boundValue = void 0;\n        switch (binding.bindingType) {\n            case 0 /* First */:\n                boundValue = queryList.first;\n                break;\n            case 1 /* All */:\n                boundValue = queryList;\n                notify = true;\n                break;\n        }\n        directiveInstance[binding.propName] = boundValue;\n    }\n    if (notify) {\n        queryList.notifyOnChanges();\n    }\n}\n/**\n * @param {?} view\n * @param {?} startIndex\n * @param {?} endIndex\n * @param {?} queryDef\n * @param {?} values\n * @return {?}\n */\nfunction calcQueryValues(view, startIndex, endIndex, queryDef, values) {\n    for (var /** @type {?} */ i = startIndex; i <= endIndex; i++) {\n        var /** @type {?} */ nodeDef = view.def.nodes[i];\n        var /** @type {?} */ valueType = nodeDef.matchedQueries[queryDef.id];\n        if (valueType != null) {\n            values.push(getQueryValue(view, nodeDef, valueType));\n        }\n        if (nodeDef.flags & 1 /* TypeElement */ && ((nodeDef.element)).template &&\n            (((((nodeDef.element)).template)).nodeMatchedQueries & queryDef.filterId) ===\n                queryDef.filterId) {\n            // check embedded views that were attached at the place of their template.\n            var /** @type {?} */ elementData = asElementData(view, i);\n            if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n                var /** @type {?} */ embeddedViews = ((elementData.viewContainer))._embeddedViews;\n                for (var /** @type {?} */ k = 0; k < embeddedViews.length; k++) {\n                    var /** @type {?} */ embeddedView = embeddedViews[k];\n                    var /** @type {?} */ dvc = declaredViewContainer(embeddedView);\n                    if (dvc && dvc === elementData) {\n                        calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);\n                    }\n                }\n            }\n            var /** @type {?} */ projectedViews = elementData.template._projectedViews;\n            if (projectedViews) {\n                for (var /** @type {?} */ k = 0; k < projectedViews.length; k++) {\n                    var /** @type {?} */ projectedView = projectedViews[k];\n                    calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);\n                }\n            }\n        }\n        if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {\n            // if no child matches the query, skip the children.\n            i += nodeDef.childCount;\n        }\n    }\n    return values;\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} queryValueType\n * @return {?}\n */\nfunction getQueryValue(view, nodeDef, queryValueType) {\n    if (queryValueType != null) {\n        // a match\n        var /** @type {?} */ value = void 0;\n        switch (queryValueType) {\n            case 1 /* RenderElement */:\n                value = asElementData(view, nodeDef.index).renderElement;\n                break;\n            case 0 /* ElementRef */:\n                value = new ElementRef(asElementData(view, nodeDef.index).renderElement);\n                break;\n            case 2 /* TemplateRef */:\n                value = asElementData(view, nodeDef.index).template;\n                break;\n            case 3 /* ViewContainerRef */:\n                value = asElementData(view, nodeDef.index).viewContainer;\n                break;\n            case 4 /* Provider */:\n                value = asProviderData(view, nodeDef.index).instance;\n                break;\n        }\n        return value;\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} ngContentIndex\n * @param {?} index\n * @return {?}\n */\nfunction ngContentDef(ngContentIndex, index) {\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: 8 /* TypeNgContent */,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0,\n        matchedQueries: {},\n        matchedQueryIds: 0,\n        references: {}, ngContentIndex: ngContentIndex,\n        childCount: 0,\n        bindings: [],\n        bindingFlags: 0,\n        outputs: [],\n        element: null,\n        provider: null,\n        text: null,\n        query: null,\n        ngContent: { index: index }\n    };\n}\n/**\n * @param {?} view\n * @param {?} renderHost\n * @param {?} def\n * @return {?}\n */\nfunction appendNgContent(view, renderHost, def) {\n    var /** @type {?} */ parentEl = getParentRenderElement(view, renderHost, def);\n    if (!parentEl) {\n        // Nothing to do if there is no parent element.\n        return;\n    }\n    var /** @type {?} */ ngContentIndex = ((def.ngContent)).index;\n    visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} argCount\n * @return {?}\n */\nfunction purePipeDef(argCount) {\n    // argCount + 1 to include the pipe as first arg\n    return _pureExpressionDef(128 /* TypePurePipe */, new Array(argCount + 1));\n}\n/**\n * @param {?} argCount\n * @return {?}\n */\nfunction pureArrayDef(argCount) {\n    return _pureExpressionDef(32 /* TypePureArray */, new Array(argCount));\n}\n/**\n * @param {?} propertyNames\n * @return {?}\n */\nfunction pureObjectDef(propertyNames) {\n    return _pureExpressionDef(64 /* TypePureObject */, propertyNames);\n}\n/**\n * @param {?} flags\n * @param {?} propertyNames\n * @return {?}\n */\nfunction _pureExpressionDef(flags, propertyNames) {\n    var /** @type {?} */ bindings = new Array(propertyNames.length);\n    for (var /** @type {?} */ i = 0; i < propertyNames.length; i++) {\n        var /** @type {?} */ prop = propertyNames[i];\n        bindings[i] = {\n            flags: 8 /* TypeProperty */,\n            name: prop,\n            ns: null,\n            nonMinifiedName: prop,\n            securityContext: null,\n            suffix: null\n        };\n    }\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: flags,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0,\n        matchedQueries: {},\n        matchedQueryIds: 0,\n        references: {},\n        ngContentIndex: -1,\n        childCount: 0, bindings: bindings,\n        bindingFlags: calcBindingFlags(bindings),\n        outputs: [],\n        element: null,\n        provider: null,\n        text: null,\n        query: null,\n        ngContent: null\n    };\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nfunction createPureExpression(view, def) {\n    return { value: undefined };\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} v0\n * @param {?} v1\n * @param {?} v2\n * @param {?} v3\n * @param {?} v4\n * @param {?} v5\n * @param {?} v6\n * @param {?} v7\n * @param {?} v8\n * @param {?} v9\n * @return {?}\n */\nfunction checkAndUpdatePureExpressionInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ bindings = def.bindings;\n    var /** @type {?} */ changed = false;\n    var /** @type {?} */ bindLen = bindings.length;\n    if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))\n        changed = true;\n    if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))\n        changed = true;\n    if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))\n        changed = true;\n    if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))\n        changed = true;\n    if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))\n        changed = true;\n    if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))\n        changed = true;\n    if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))\n        changed = true;\n    if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))\n        changed = true;\n    if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))\n        changed = true;\n    if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))\n        changed = true;\n    if (changed) {\n        var /** @type {?} */ data = asPureExpressionData(view, def.index);\n        var /** @type {?} */ value = void 0;\n        switch (def.flags & 201347067 /* Types */) {\n            case 32 /* TypePureArray */:\n                value = new Array(bindings.length);\n                if (bindLen > 0)\n                    value[0] = v0;\n                if (bindLen > 1)\n                    value[1] = v1;\n                if (bindLen > 2)\n                    value[2] = v2;\n                if (bindLen > 3)\n                    value[3] = v3;\n                if (bindLen > 4)\n                    value[4] = v4;\n                if (bindLen > 5)\n                    value[5] = v5;\n                if (bindLen > 6)\n                    value[6] = v6;\n                if (bindLen > 7)\n                    value[7] = v7;\n                if (bindLen > 8)\n                    value[8] = v8;\n                if (bindLen > 9)\n                    value[9] = v9;\n                break;\n            case 64 /* TypePureObject */:\n                value = {};\n                if (bindLen > 0)\n                    value[((bindings[0].name))] = v0;\n                if (bindLen > 1)\n                    value[((bindings[1].name))] = v1;\n                if (bindLen > 2)\n                    value[((bindings[2].name))] = v2;\n                if (bindLen > 3)\n                    value[((bindings[3].name))] = v3;\n                if (bindLen > 4)\n                    value[((bindings[4].name))] = v4;\n                if (bindLen > 5)\n                    value[((bindings[5].name))] = v5;\n                if (bindLen > 6)\n                    value[((bindings[6].name))] = v6;\n                if (bindLen > 7)\n                    value[((bindings[7].name))] = v7;\n                if (bindLen > 8)\n                    value[((bindings[8].name))] = v8;\n                if (bindLen > 9)\n                    value[((bindings[9].name))] = v9;\n                break;\n            case 128 /* TypePurePipe */:\n                var /** @type {?} */ pipe = v0;\n                switch (bindLen) {\n                    case 1:\n                        value = pipe.transform(v0);\n                        break;\n                    case 2:\n                        value = pipe.transform(v1);\n                        break;\n                    case 3:\n                        value = pipe.transform(v1, v2);\n                        break;\n                    case 4:\n                        value = pipe.transform(v1, v2, v3);\n                        break;\n                    case 5:\n                        value = pipe.transform(v1, v2, v3, v4);\n                        break;\n                    case 6:\n                        value = pipe.transform(v1, v2, v3, v4, v5);\n                        break;\n                    case 7:\n                        value = pipe.transform(v1, v2, v3, v4, v5, v6);\n                        break;\n                    case 8:\n                        value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);\n                        break;\n                    case 9:\n                        value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);\n                        break;\n                    case 10:\n                        value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);\n                        break;\n                }\n                break;\n        }\n        data.value = value;\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} values\n * @return {?}\n */\nfunction checkAndUpdatePureExpressionDynamic(view, def, values) {\n    var /** @type {?} */ bindings = def.bindings;\n    var /** @type {?} */ changed = false;\n    for (var /** @type {?} */ i = 0; i < values.length; i++) {\n        // Note: We need to loop over all values, so that\n        // the old values are updates as well!\n        if (checkAndUpdateBinding(view, def, i, values[i])) {\n            changed = true;\n        }\n    }\n    if (changed) {\n        var /** @type {?} */ data = asPureExpressionData(view, def.index);\n        var /** @type {?} */ value = void 0;\n        switch (def.flags & 201347067 /* Types */) {\n            case 32 /* TypePureArray */:\n                value = values;\n                break;\n            case 64 /* TypePureObject */:\n                value = {};\n                for (var /** @type {?} */ i = 0; i < values.length; i++) {\n                    value[((bindings[i].name))] = values[i];\n                }\n                break;\n            case 128 /* TypePurePipe */:\n                var /** @type {?} */ pipe = values[0];\n                var /** @type {?} */ params = values.slice(1);\n                value = pipe.transform.apply(pipe, params);\n                break;\n        }\n        data.value = value;\n    }\n    return changed;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} ngContentIndex\n * @param {?} constants\n * @return {?}\n */\nfunction textDef(ngContentIndex, constants) {\n    var /** @type {?} */ bindings = new Array(constants.length - 1);\n    for (var /** @type {?} */ i = 1; i < constants.length; i++) {\n        bindings[i - 1] = {\n            flags: 8 /* TypeProperty */,\n            name: null,\n            ns: null,\n            nonMinifiedName: null,\n            securityContext: null,\n            suffix: constants[i]\n        };\n    }\n    var /** @type {?} */ flags = 2;\n    return {\n        // will bet set by the view definition\n        index: -1,\n        parent: null,\n        renderParent: null,\n        bindingIndex: -1,\n        outputIndex: -1,\n        // regular values\n        flags: flags,\n        childFlags: 0,\n        directChildFlags: 0,\n        childMatchedQueries: 0,\n        matchedQueries: {},\n        matchedQueryIds: 0,\n        references: {}, ngContentIndex: ngContentIndex,\n        childCount: 0, bindings: bindings,\n        bindingFlags: calcBindingFlags(bindings),\n        outputs: [],\n        element: null,\n        provider: null,\n        text: { prefix: constants[0] },\n        query: null,\n        ngContent: null\n    };\n}\n/**\n * @param {?} view\n * @param {?} renderHost\n * @param {?} def\n * @return {?}\n */\nfunction createText(view, renderHost, def) {\n    var /** @type {?} */ renderNode$$1;\n    var /** @type {?} */ renderer = view.renderer;\n    renderNode$$1 = renderer.createText(/** @type {?} */ ((def.text)).prefix);\n    var /** @type {?} */ parentEl = getParentRenderElement(view, renderHost, def);\n    if (parentEl) {\n        renderer.appendChild(parentEl, renderNode$$1);\n    }\n    return { renderText: renderNode$$1 };\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} v0\n * @param {?} v1\n * @param {?} v2\n * @param {?} v3\n * @param {?} v4\n * @param {?} v5\n * @param {?} v6\n * @param {?} v7\n * @param {?} v8\n * @param {?} v9\n * @return {?}\n */\nfunction checkAndUpdateTextInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ changed = false;\n    var /** @type {?} */ bindings = def.bindings;\n    var /** @type {?} */ bindLen = bindings.length;\n    if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))\n        changed = true;\n    if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))\n        changed = true;\n    if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))\n        changed = true;\n    if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))\n        changed = true;\n    if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))\n        changed = true;\n    if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))\n        changed = true;\n    if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))\n        changed = true;\n    if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))\n        changed = true;\n    if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))\n        changed = true;\n    if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))\n        changed = true;\n    if (changed) {\n        var /** @type {?} */ value = ((def.text)).prefix;\n        if (bindLen > 0)\n            value += _addInterpolationPart(v0, bindings[0]);\n        if (bindLen > 1)\n            value += _addInterpolationPart(v1, bindings[1]);\n        if (bindLen > 2)\n            value += _addInterpolationPart(v2, bindings[2]);\n        if (bindLen > 3)\n            value += _addInterpolationPart(v3, bindings[3]);\n        if (bindLen > 4)\n            value += _addInterpolationPart(v4, bindings[4]);\n        if (bindLen > 5)\n            value += _addInterpolationPart(v5, bindings[5]);\n        if (bindLen > 6)\n            value += _addInterpolationPart(v6, bindings[6]);\n        if (bindLen > 7)\n            value += _addInterpolationPart(v7, bindings[7]);\n        if (bindLen > 8)\n            value += _addInterpolationPart(v8, bindings[8]);\n        if (bindLen > 9)\n            value += _addInterpolationPart(v9, bindings[9]);\n        var /** @type {?} */ renderNode$$1 = asTextData(view, def.index).renderText;\n        view.renderer.setValue(renderNode$$1, value);\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} def\n * @param {?} values\n * @return {?}\n */\nfunction checkAndUpdateTextDynamic(view, def, values) {\n    var /** @type {?} */ bindings = def.bindings;\n    var /** @type {?} */ changed = false;\n    for (var /** @type {?} */ i = 0; i < values.length; i++) {\n        // Note: We need to loop over all values, so that\n        // the old values are updates as well!\n        if (checkAndUpdateBinding(view, def, i, values[i])) {\n            changed = true;\n        }\n    }\n    if (changed) {\n        var /** @type {?} */ value = '';\n        for (var /** @type {?} */ i = 0; i < values.length; i++) {\n            value = value + _addInterpolationPart(values[i], bindings[i]);\n        }\n        value = ((def.text)).prefix + value;\n        var /** @type {?} */ renderNode$$1 = asTextData(view, def.index).renderText;\n        view.renderer.setValue(renderNode$$1, value);\n    }\n    return changed;\n}\n/**\n * @param {?} value\n * @param {?} binding\n * @return {?}\n */\nfunction _addInterpolationPart(value, binding) {\n    var /** @type {?} */ valueStr = value != null ? value.toString() : '';\n    return valueStr + binding.suffix;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} flags\n * @param {?} nodes\n * @param {?=} updateDirectives\n * @param {?=} updateRenderer\n * @return {?}\n */\nfunction viewDef(flags, nodes, updateDirectives, updateRenderer) {\n    // clone nodes and set auto calculated values\n    var /** @type {?} */ viewBindingCount = 0;\n    var /** @type {?} */ viewDisposableCount = 0;\n    var /** @type {?} */ viewNodeFlags = 0;\n    var /** @type {?} */ viewRootNodeFlags = 0;\n    var /** @type {?} */ viewMatchedQueries = 0;\n    var /** @type {?} */ currentParent = null;\n    var /** @type {?} */ currentElementHasPublicProviders = false;\n    var /** @type {?} */ currentElementHasPrivateProviders = false;\n    var /** @type {?} */ lastRenderRootNode = null;\n    for (var /** @type {?} */ i = 0; i < nodes.length; i++) {\n        while (currentParent && i > currentParent.index + currentParent.childCount) {\n            var /** @type {?} */ newParent = currentParent.parent;\n            if (newParent) {\n                newParent.childFlags |= ((currentParent.childFlags));\n                newParent.childMatchedQueries |= currentParent.childMatchedQueries;\n            }\n            currentParent = newParent;\n        }\n        var /** @type {?} */ node = nodes[i];\n        node.index = i;\n        node.parent = currentParent;\n        node.bindingIndex = viewBindingCount;\n        node.outputIndex = viewDisposableCount;\n        // renderParent needs to account for ng-container!\n        var /** @type {?} */ currentRenderParent = void 0;\n        if (currentParent && currentParent.flags & 1 /* TypeElement */ &&\n            !((currentParent.element)).name) {\n            currentRenderParent = currentParent.renderParent;\n        }\n        else {\n            currentRenderParent = currentParent;\n        }\n        node.renderParent = currentRenderParent;\n        if (node.element) {\n            var /** @type {?} */ elDef = node.element;\n            elDef.publicProviders =\n                currentParent ? ((currentParent.element)).publicProviders : Object.create(null);\n            elDef.allProviders = elDef.publicProviders;\n            // Note: We assume that all providers of an element are before any child element!\n            currentElementHasPublicProviders = false;\n            currentElementHasPrivateProviders = false;\n        }\n        validateNode(currentParent, node, nodes.length);\n        viewNodeFlags |= node.flags;\n        viewMatchedQueries |= node.matchedQueryIds;\n        if (node.element && node.element.template) {\n            viewMatchedQueries |= node.element.template.nodeMatchedQueries;\n        }\n        if (currentParent) {\n            currentParent.childFlags |= node.flags;\n            currentParent.directChildFlags |= node.flags;\n            currentParent.childMatchedQueries |= node.matchedQueryIds;\n            if (node.element && node.element.template) {\n                currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;\n            }\n        }\n        else {\n            viewRootNodeFlags |= node.flags;\n        }\n        viewBindingCount += node.bindings.length;\n        viewDisposableCount += node.outputs.length;\n        if (!currentRenderParent && (node.flags & 3 /* CatRenderNode */)) {\n            lastRenderRootNode = node;\n        }\n        if (node.flags & 20224 /* CatProvider */) {\n            if (!currentElementHasPublicProviders) {\n                currentElementHasPublicProviders = true; /** @type {?} */\n                ((((\n                // Use prototypical inheritance to not get O(n^2) complexity...\n                currentParent)).element)).publicProviders =\n                    Object.create(/** @type {?} */ ((((currentParent)).element)).publicProviders); /** @type {?} */\n                ((((currentParent)).element)).allProviders = ((((currentParent)).element)).publicProviders;\n            }\n            var /** @type {?} */ isPrivateService = (node.flags & 8192 /* PrivateProvider */) !== 0;\n            var /** @type {?} */ isComponent = (node.flags & 32768 /* Component */) !== 0;\n            if (!isPrivateService || isComponent) {\n                ((((((currentParent)).element)).publicProviders))[tokenKey(/** @type {?} */ ((node.provider)).token)] = node;\n            }\n            else {\n                if (!currentElementHasPrivateProviders) {\n                    currentElementHasPrivateProviders = true; /** @type {?} */\n                    ((((\n                    // Use protoyypical inheritance to not get O(n^2) complexity...\n                    currentParent)).element)).allProviders =\n                        Object.create(/** @type {?} */ ((((currentParent)).element)).publicProviders);\n                } /** @type {?} */\n                ((((((currentParent)).element)).allProviders))[tokenKey(/** @type {?} */ ((node.provider)).token)] = node;\n            }\n            if (isComponent) {\n                ((((currentParent)).element)).componentProvider = node;\n            }\n        }\n        if (node.childCount) {\n            currentParent = node;\n        }\n    }\n    while (currentParent) {\n        var /** @type {?} */ newParent = currentParent.parent;\n        if (newParent) {\n            newParent.childFlags |= currentParent.childFlags;\n            newParent.childMatchedQueries |= currentParent.childMatchedQueries;\n        }\n        currentParent = newParent;\n    }\n    var /** @type {?} */ handleEvent = function (view, nodeIndex, eventName, event) { return ((((nodes[nodeIndex].element)).handleEvent))(view, eventName, event); };\n    return {\n        // Will be filled later...\n        factory: null,\n        nodeFlags: viewNodeFlags,\n        rootNodeFlags: viewRootNodeFlags,\n        nodeMatchedQueries: viewMatchedQueries, flags: flags,\n        nodes: nodes,\n        updateDirectives: updateDirectives || NOOP,\n        updateRenderer: updateRenderer || NOOP,\n        handleEvent: handleEvent || NOOP,\n        bindingCount: viewBindingCount,\n        outputCount: viewDisposableCount, lastRenderRootNode: lastRenderRootNode\n    };\n}\n/**\n * @param {?} parent\n * @param {?} node\n * @param {?} nodeCount\n * @return {?}\n */\nfunction validateNode(parent, node, nodeCount) {\n    var /** @type {?} */ template = node.element && node.element.template;\n    if (template) {\n        if (!template.lastRenderRootNode) {\n            throw new Error(\"Illegal State: Embedded templates without nodes are not allowed!\");\n        }\n        if (template.lastRenderRootNode &&\n            template.lastRenderRootNode.flags & 16777216 /* EmbeddedViews */) {\n            throw new Error(\"Illegal State: Last root node of a template can't have embedded views, at index \" + node.index + \"!\");\n        }\n    }\n    if (node.flags & 20224 /* CatProvider */) {\n        var /** @type {?} */ parentFlags = parent ? parent.flags : 0;\n        if ((parentFlags & 1 /* TypeElement */) === 0) {\n            throw new Error(\"Illegal State: Provider/Directive nodes need to be children of elements or anchors, at index \" + node.index + \"!\");\n        }\n    }\n    if (node.query) {\n        if (node.flags & 67108864 /* TypeContentQuery */ &&\n            (!parent || (parent.flags & 16384 /* TypeDirective */) === 0)) {\n            throw new Error(\"Illegal State: Content Query nodes need to be children of directives, at index \" + node.index + \"!\");\n        }\n        if (node.flags & 134217728 /* TypeViewQuery */ && parent) {\n            throw new Error(\"Illegal State: View Query nodes have to be top level nodes, at index \" + node.index + \"!\");\n        }\n    }\n    if (node.childCount) {\n        var /** @type {?} */ parentEnd = parent ? parent.index + parent.childCount : nodeCount - 1;\n        if (node.index <= parentEnd && node.index + node.childCount > parentEnd) {\n            throw new Error(\"Illegal State: childCount of node leads outside of parent, at index \" + node.index + \"!\");\n        }\n    }\n}\n/**\n * @param {?} parent\n * @param {?} anchorDef\n * @param {?} viewDef\n * @param {?=} context\n * @return {?}\n */\nfunction createEmbeddedView(parent, anchorDef$$1, viewDef, context) {\n    // embedded views are seen as siblings to the anchor, so we need\n    // to get the parent of the anchor and use it as parentIndex.\n    var /** @type {?} */ view = createView(parent.root, parent.renderer, parent, anchorDef$$1, viewDef);\n    initView(view, parent.component, context);\n    createViewNodes(view);\n    return view;\n}\n/**\n * @param {?} root\n * @param {?} def\n * @param {?=} context\n * @return {?}\n */\nfunction createRootView(root, def, context) {\n    var /** @type {?} */ view = createView(root, root.renderer, null, null, def);\n    initView(view, context, context);\n    createViewNodes(view);\n    return view;\n}\n/**\n * @param {?} parentView\n * @param {?} nodeDef\n * @param {?} viewDef\n * @param {?} hostElement\n * @return {?}\n */\nfunction createComponentView(parentView, nodeDef, viewDef, hostElement) {\n    var /** @type {?} */ rendererType = ((nodeDef.element)).componentRendererType;\n    var /** @type {?} */ compRenderer;\n    if (!rendererType) {\n        compRenderer = parentView.root.renderer;\n    }\n    else {\n        compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);\n    }\n    return createView(parentView.root, compRenderer, parentView, /** @type {?} */ ((nodeDef.element)).componentProvider, viewDef);\n}\n/**\n * @param {?} root\n * @param {?} renderer\n * @param {?} parent\n * @param {?} parentNodeDef\n * @param {?} def\n * @return {?}\n */\nfunction createView(root, renderer, parent, parentNodeDef, def) {\n    var /** @type {?} */ nodes = new Array(def.nodes.length);\n    var /** @type {?} */ disposables = def.outputCount ? new Array(def.outputCount) : null;\n    var /** @type {?} */ view = {\n        def: def,\n        parent: parent,\n        viewContainerParent: null, parentNodeDef: parentNodeDef,\n        context: null,\n        component: null, nodes: nodes,\n        state: 13 /* CatInit */, root: root, renderer: renderer,\n        oldValues: new Array(def.bindingCount), disposables: disposables\n    };\n    return view;\n}\n/**\n * @param {?} view\n * @param {?} component\n * @param {?} context\n * @return {?}\n */\nfunction initView(view, component, context) {\n    view.component = component;\n    view.context = context;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction createViewNodes(view) {\n    var /** @type {?} */ renderHost;\n    if (isComponentView(view)) {\n        var /** @type {?} */ hostDef = view.parentNodeDef;\n        renderHost = asElementData(/** @type {?} */ ((view.parent)), /** @type {?} */ ((((hostDef)).parent)).index).renderElement;\n    }\n    var /** @type {?} */ def = view.def;\n    var /** @type {?} */ nodes = view.nodes;\n    for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n        var /** @type {?} */ nodeDef = def.nodes[i];\n        Services.setCurrentNode(view, i);\n        var /** @type {?} */ nodeData = void 0;\n        switch (nodeDef.flags & 201347067 /* Types */) {\n            case 1 /* TypeElement */:\n                var /** @type {?} */ el = (createElement(view, renderHost, nodeDef));\n                var /** @type {?} */ componentView = ((undefined));\n                if (nodeDef.flags & 33554432 /* ComponentView */) {\n                    var /** @type {?} */ compViewDef = resolveDefinition(/** @type {?} */ ((((nodeDef.element)).componentView)));\n                    componentView = Services.createComponentView(view, nodeDef, compViewDef, el);\n                }\n                listenToElementOutputs(view, componentView, nodeDef, el);\n                nodeData = ({\n                    renderElement: el,\n                    componentView: componentView,\n                    viewContainer: null,\n                    template: /** @type {?} */ ((nodeDef.element)).template ? createTemplateData(view, nodeDef) : undefined\n                });\n                if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n                    nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);\n                }\n                break;\n            case 2 /* TypeText */:\n                nodeData = (createText(view, renderHost, nodeDef));\n                break;\n            case 512 /* TypeClassProvider */:\n            case 1024 /* TypeFactoryProvider */:\n            case 2048 /* TypeUseExistingProvider */:\n            case 256 /* TypeValueProvider */: {\n                var /** @type {?} */ instance = createProviderInstance(view, nodeDef);\n                nodeData = ({ instance: instance });\n                break;\n            }\n            case 16 /* TypePipe */: {\n                var /** @type {?} */ instance = createPipeInstance(view, nodeDef);\n                nodeData = ({ instance: instance });\n                break;\n            }\n            case 16384 /* TypeDirective */: {\n                var /** @type {?} */ instance = createDirectiveInstance(view, nodeDef);\n                nodeData = ({ instance: instance });\n                if (nodeDef.flags & 32768 /* Component */) {\n                    var /** @type {?} */ compView = asElementData(view, /** @type {?} */ ((nodeDef.parent)).index).componentView;\n                    initView(compView, instance, instance);\n                }\n                break;\n            }\n            case 32 /* TypePureArray */:\n            case 64 /* TypePureObject */:\n            case 128 /* TypePurePipe */:\n                nodeData = (createPureExpression(view, nodeDef));\n                break;\n            case 67108864 /* TypeContentQuery */:\n            case 134217728 /* TypeViewQuery */:\n                nodeData = (createQuery());\n                break;\n            case 8 /* TypeNgContent */:\n                appendNgContent(view, renderHost, nodeDef);\n                // no runtime data needed for NgContent...\n                nodeData = undefined;\n                break;\n        }\n        nodes[i] = nodeData;\n    }\n    // Create the ViewData.nodes of component views after we created everything else,\n    // so that e.g. ng-content works\n    execComponentViewsAction(view, ViewAction.CreateViewNodes);\n    // fill static content and view queries\n    execQueriesAction(view, 67108864 /* TypeContentQuery */ | 134217728 /* TypeViewQuery */, 268435456 /* StaticQuery */, 0 /* CheckAndUpdate */);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction checkNoChangesView(view) {\n    markProjectedViewsForCheck(view);\n    Services.updateDirectives(view, 1 /* CheckNoChanges */);\n    execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);\n    Services.updateRenderer(view, 1 /* CheckNoChanges */);\n    execComponentViewsAction(view, ViewAction.CheckNoChanges);\n    // Note: We don't check queries for changes as we didn't do this in v2.x.\n    // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.\n    view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction checkAndUpdateView(view) {\n    if (view.state & 1 /* BeforeFirstCheck */) {\n        view.state &= ~1 /* BeforeFirstCheck */;\n        view.state |= 2 /* FirstCheck */;\n    }\n    else {\n        view.state &= ~2 /* FirstCheck */;\n    }\n    markProjectedViewsForCheck(view);\n    Services.updateDirectives(view, 0 /* CheckAndUpdate */);\n    execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);\n    execQueriesAction(view, 67108864 /* TypeContentQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);\n    callLifecycleHooksChildrenFirst(view, 2097152 /* AfterContentChecked */ |\n        (view.state & 2 /* FirstCheck */ ? 1048576 /* AfterContentInit */ : 0));\n    Services.updateRenderer(view, 0 /* CheckAndUpdate */);\n    execComponentViewsAction(view, ViewAction.CheckAndUpdate);\n    execQueriesAction(view, 134217728 /* TypeViewQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);\n    callLifecycleHooksChildrenFirst(view, 8388608 /* AfterViewChecked */ |\n        (view.state & 2 /* FirstCheck */ ? 4194304 /* AfterViewInit */ : 0));\n    if (view.def.flags & 2 /* OnPush */) {\n        view.state &= ~8 /* ChecksEnabled */;\n    }\n    view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\n */\nfunction checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    if (argStyle === 0 /* Inline */) {\n        return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n    }\n    else {\n        return checkAndUpdateNodeDynamic(view, nodeDef, v0);\n    }\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction markProjectedViewsForCheck(view) {\n    var /** @type {?} */ def = view.def;\n    if (!(def.nodeFlags & 4 /* ProjectedTemplate */)) {\n        return;\n    }\n    for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n        var /** @type {?} */ nodeDef = def.nodes[i];\n        if (nodeDef.flags & 4 /* ProjectedTemplate */) {\n            var /** @type {?} */ projectedViews = asElementData(view, i).template._projectedViews;\n            if (projectedViews) {\n                for (var /** @type {?} */ i_1 = 0; i_1 < projectedViews.length; i_1++) {\n                    var /** @type {?} */ projectedView = projectedViews[i_1];\n                    projectedView.state |= 32 /* CheckProjectedView */;\n                    markParentViewsForCheckProjectedViews(projectedView, view);\n                }\n            }\n        }\n        else if ((nodeDef.childFlags & 4 /* ProjectedTemplate */) === 0) {\n            // a parent with leafs\n            // no child is a component,\n            // then skip the children\n            i += nodeDef.childCount;\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\n */\nfunction checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ changed = false;\n    switch (nodeDef.flags & 201347067 /* Types */) {\n        case 1 /* TypeElement */:\n            changed = checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            break;\n        case 2 /* TypeText */:\n            changed = checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            break;\n        case 16384 /* TypeDirective */:\n            changed =\n                checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            break;\n        case 32 /* TypePureArray */:\n        case 64 /* TypePureObject */:\n        case 128 /* TypePurePipe */:\n            changed =\n                checkAndUpdatePureExpressionInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n            break;\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} values\n * @return {?}\n */\nfunction checkAndUpdateNodeDynamic(view, nodeDef, values) {\n    var /** @type {?} */ changed = false;\n    switch (nodeDef.flags & 201347067 /* Types */) {\n        case 1 /* TypeElement */:\n            changed = checkAndUpdateElementDynamic(view, nodeDef, values);\n            break;\n        case 2 /* TypeText */:\n            changed = checkAndUpdateTextDynamic(view, nodeDef, values);\n            break;\n        case 16384 /* TypeDirective */:\n            changed = checkAndUpdateDirectiveDynamic(view, nodeDef, values);\n            break;\n        case 32 /* TypePureArray */:\n        case 64 /* TypePureObject */:\n        case 128 /* TypePurePipe */:\n            changed = checkAndUpdatePureExpressionDynamic(view, nodeDef, values);\n            break;\n    }\n    if (changed) {\n        // Update oldValues after all bindings have been updated,\n        // as a setter for a property might update other properties.\n        var /** @type {?} */ bindLen = nodeDef.bindings.length;\n        var /** @type {?} */ bindingStart = nodeDef.bindingIndex;\n        var /** @type {?} */ oldValues = view.oldValues;\n        for (var /** @type {?} */ i = 0; i < bindLen; i++) {\n            oldValues[bindingStart + i] = values[i];\n        }\n    }\n    return changed;\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\n */\nfunction checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    if (argStyle === 0 /* Inline */) {\n        checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n    }\n    else {\n        checkNoChangesNodeDynamic(view, nodeDef, v0);\n    }\n    // Returning false is ok here as we would have thrown in case of a change.\n    return false;\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} v0\n * @param {?} v1\n * @param {?} v2\n * @param {?} v3\n * @param {?} v4\n * @param {?} v5\n * @param {?} v6\n * @param {?} v7\n * @param {?} v8\n * @param {?} v9\n * @return {?}\n */\nfunction checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ bindLen = nodeDef.bindings.length;\n    if (bindLen > 0)\n        checkBindingNoChanges(view, nodeDef, 0, v0);\n    if (bindLen > 1)\n        checkBindingNoChanges(view, nodeDef, 1, v1);\n    if (bindLen > 2)\n        checkBindingNoChanges(view, nodeDef, 2, v2);\n    if (bindLen > 3)\n        checkBindingNoChanges(view, nodeDef, 3, v3);\n    if (bindLen > 4)\n        checkBindingNoChanges(view, nodeDef, 4, v4);\n    if (bindLen > 5)\n        checkBindingNoChanges(view, nodeDef, 5, v5);\n    if (bindLen > 6)\n        checkBindingNoChanges(view, nodeDef, 6, v6);\n    if (bindLen > 7)\n        checkBindingNoChanges(view, nodeDef, 7, v7);\n    if (bindLen > 8)\n        checkBindingNoChanges(view, nodeDef, 8, v8);\n    if (bindLen > 9)\n        checkBindingNoChanges(view, nodeDef, 9, v9);\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} values\n * @return {?}\n */\nfunction checkNoChangesNodeDynamic(view, nodeDef, values) {\n    for (var /** @type {?} */ i = 0; i < values.length; i++) {\n        checkBindingNoChanges(view, nodeDef, i, values[i]);\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @return {?}\n */\nfunction checkNoChangesQuery(view, nodeDef) {\n    var /** @type {?} */ queryList = asQueryList(view, nodeDef.index);\n    if (queryList.dirty) {\n        throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, nodeDef.index), \"Query \" + ((nodeDef.query)).id + \" not dirty\", \"Query \" + ((nodeDef.query)).id + \" dirty\", (view.state & 1 /* BeforeFirstCheck */) !== 0);\n    }\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction destroyView(view) {\n    if (view.state & 128 /* Destroyed */) {\n        return;\n    }\n    execEmbeddedViewsAction(view, ViewAction.Destroy);\n    execComponentViewsAction(view, ViewAction.Destroy);\n    callLifecycleHooksChildrenFirst(view, 131072 /* OnDestroy */);\n    if (view.disposables) {\n        for (var /** @type {?} */ i = 0; i < view.disposables.length; i++) {\n            view.disposables[i]();\n        }\n    }\n    detachProjectedView(view);\n    if (view.renderer.destroyNode) {\n        destroyViewNodes(view);\n    }\n    if (isComponentView(view)) {\n        view.renderer.destroy();\n    }\n    view.state |= 128 /* Destroyed */;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction destroyViewNodes(view) {\n    var /** @type {?} */ len = view.def.nodes.length;\n    for (var /** @type {?} */ i = 0; i < len; i++) {\n        var /** @type {?} */ def = view.def.nodes[i];\n        if (def.flags & 1 /* TypeElement */) {\n            ((view.renderer.destroyNode))(asElementData(view, i).renderElement);\n        }\n        else if (def.flags & 2 /* TypeText */) {\n            ((view.renderer.destroyNode))(asTextData(view, i).renderText);\n        }\n    }\n}\nvar ViewAction = {};\nViewAction.CreateViewNodes = 0;\nViewAction.CheckNoChanges = 1;\nViewAction.CheckNoChangesProjectedViews = 2;\nViewAction.CheckAndUpdate = 3;\nViewAction.CheckAndUpdateProjectedViews = 4;\nViewAction.Destroy = 5;\nViewAction[ViewAction.CreateViewNodes] = \"CreateViewNodes\";\nViewAction[ViewAction.CheckNoChanges] = \"CheckNoChanges\";\nViewAction[ViewAction.CheckNoChangesProjectedViews] = \"CheckNoChangesProjectedViews\";\nViewAction[ViewAction.CheckAndUpdate] = \"CheckAndUpdate\";\nViewAction[ViewAction.CheckAndUpdateProjectedViews] = \"CheckAndUpdateProjectedViews\";\nViewAction[ViewAction.Destroy] = \"Destroy\";\n/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction execComponentViewsAction(view, action) {\n    var /** @type {?} */ def = view.def;\n    if (!(def.nodeFlags & 33554432 /* ComponentView */)) {\n        return;\n    }\n    for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n        var /** @type {?} */ nodeDef = def.nodes[i];\n        if (nodeDef.flags & 33554432 /* ComponentView */) {\n            // a leaf\n            callViewAction(asElementData(view, i).componentView, action);\n        }\n        else if ((nodeDef.childFlags & 33554432 /* ComponentView */) === 0) {\n            // a parent with leafs\n            // no child is a component,\n            // then skip the children\n            i += nodeDef.childCount;\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction execEmbeddedViewsAction(view, action) {\n    var /** @type {?} */ def = view.def;\n    if (!(def.nodeFlags & 16777216 /* EmbeddedViews */)) {\n        return;\n    }\n    for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n        var /** @type {?} */ nodeDef = def.nodes[i];\n        if (nodeDef.flags & 16777216 /* EmbeddedViews */) {\n            // a leaf\n            var /** @type {?} */ embeddedViews = ((asElementData(view, i).viewContainer))._embeddedViews;\n            for (var /** @type {?} */ k = 0; k < embeddedViews.length; k++) {\n                callViewAction(embeddedViews[k], action);\n            }\n        }\n        else if ((nodeDef.childFlags & 16777216 /* EmbeddedViews */) === 0) {\n            // a parent with leafs\n            // no child is a component,\n            // then skip the children\n            i += nodeDef.childCount;\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction callViewAction(view, action) {\n    var /** @type {?} */ viewState = view.state;\n    switch (action) {\n        case ViewAction.CheckNoChanges:\n            if ((viewState & 128 /* Destroyed */) === 0) {\n                if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {\n                    checkNoChangesView(view);\n                }\n                else if (viewState & 64 /* CheckProjectedViews */) {\n                    execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);\n                }\n            }\n            break;\n        case ViewAction.CheckNoChangesProjectedViews:\n            if ((viewState & 128 /* Destroyed */) === 0) {\n                if (viewState & 32 /* CheckProjectedView */) {\n                    checkNoChangesView(view);\n                }\n                else if (viewState & 64 /* CheckProjectedViews */) {\n                    execProjectedViewsAction(view, action);\n                }\n            }\n            break;\n        case ViewAction.CheckAndUpdate:\n            if ((viewState & 128 /* Destroyed */) === 0) {\n                if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {\n                    checkAndUpdateView(view);\n                }\n                else if (viewState & 64 /* CheckProjectedViews */) {\n                    execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);\n                }\n            }\n            break;\n        case ViewAction.CheckAndUpdateProjectedViews:\n            if ((viewState & 128 /* Destroyed */) === 0) {\n                if (viewState & 32 /* CheckProjectedView */) {\n                    checkAndUpdateView(view);\n                }\n                else if (viewState & 64 /* CheckProjectedViews */) {\n                    execProjectedViewsAction(view, action);\n                }\n            }\n            break;\n        case ViewAction.Destroy:\n            // Note: destroyView recurses over all views,\n            // so we don't need to special case projected views here.\n            destroyView(view);\n            break;\n        case ViewAction.CreateViewNodes:\n            createViewNodes(view);\n            break;\n    }\n}\n/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction execProjectedViewsAction(view, action) {\n    execEmbeddedViewsAction(view, action);\n    execComponentViewsAction(view, action);\n}\n/**\n * @param {?} view\n * @param {?} queryFlags\n * @param {?} staticDynamicQueryFlag\n * @param {?} checkType\n * @return {?}\n */\nfunction execQueriesAction(view, queryFlags, staticDynamicQueryFlag, checkType) {\n    if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {\n        return;\n    }\n    var /** @type {?} */ nodeCount = view.def.nodes.length;\n    for (var /** @type {?} */ i = 0; i < nodeCount; i++) {\n        var /** @type {?} */ nodeDef = view.def.nodes[i];\n        if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {\n            Services.setCurrentNode(view, nodeDef.index);\n            switch (checkType) {\n                case 0 /* CheckAndUpdate */:\n                    checkAndUpdateQuery(view, nodeDef);\n                    break;\n                case 1 /* CheckNoChanges */:\n                    checkNoChangesQuery(view, nodeDef);\n                    break;\n            }\n        }\n        if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {\n            // no child has a matching query\n            // then skip the children\n            i += nodeDef.childCount;\n        }\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar initialized = false;\n/**\n * @return {?}\n */\nfunction initServicesIfNeeded() {\n    if (initialized) {\n        return;\n    }\n    initialized = true;\n    var /** @type {?} */ services = isDevMode() ? createDebugServices() : createProdServices();\n    Services.setCurrentNode = services.setCurrentNode;\n    Services.createRootView = services.createRootView;\n    Services.createEmbeddedView = services.createEmbeddedView;\n    Services.createComponentView = services.createComponentView;\n    Services.createNgModuleRef = services.createNgModuleRef;\n    Services.overrideProvider = services.overrideProvider;\n    Services.clearProviderOverrides = services.clearProviderOverrides;\n    Services.checkAndUpdateView = services.checkAndUpdateView;\n    Services.checkNoChangesView = services.checkNoChangesView;\n    Services.destroyView = services.destroyView;\n    Services.resolveDep = resolveDep;\n    Services.createDebugContext = services.createDebugContext;\n    Services.handleEvent = services.handleEvent;\n    Services.updateDirectives = services.updateDirectives;\n    Services.updateRenderer = services.updateRenderer;\n    Services.dirtyParentQueries = dirtyParentQueries;\n}\n/**\n * @return {?}\n */\nfunction createProdServices() {\n    return {\n        setCurrentNode: function () { },\n        createRootView: createProdRootView,\n        createEmbeddedView: createEmbeddedView,\n        createComponentView: createComponentView,\n        createNgModuleRef: createNgModuleRef,\n        overrideProvider: NOOP,\n        clearProviderOverrides: NOOP,\n        checkAndUpdateView: checkAndUpdateView,\n        checkNoChangesView: checkNoChangesView,\n        destroyView: destroyView,\n        createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },\n        handleEvent: function (view, nodeIndex, eventName, event) { return view.def.handleEvent(view, nodeIndex, eventName, event); },\n        updateDirectives: function (view, checkType) { return view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :\n            prodCheckNoChangesNode, view); },\n        updateRenderer: function (view, checkType) { return view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :\n            prodCheckNoChangesNode, view); },\n    };\n}\n/**\n * @return {?}\n */\nfunction createDebugServices() {\n    return {\n        setCurrentNode: debugSetCurrentNode,\n        createRootView: debugCreateRootView,\n        createEmbeddedView: debugCreateEmbeddedView,\n        createComponentView: debugCreateComponentView,\n        createNgModuleRef: debugCreateNgModuleRef,\n        overrideProvider: debugOverrideProvider,\n        clearProviderOverrides: debugClearProviderOverrides,\n        checkAndUpdateView: debugCheckAndUpdateView,\n        checkNoChangesView: debugCheckNoChangesView,\n        destroyView: debugDestroyView,\n        createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },\n        handleEvent: debugHandleEvent,\n        updateDirectives: debugUpdateDirectives,\n        updateRenderer: debugUpdateRenderer,\n    };\n}\n/**\n * @param {?} elInjector\n * @param {?} projectableNodes\n * @param {?} rootSelectorOrNode\n * @param {?} def\n * @param {?} ngModule\n * @param {?=} context\n * @return {?}\n */\nfunction createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {\n    var /** @type {?} */ rendererFactory = ngModule.injector.get(RendererFactory2);\n    return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context);\n}\n/**\n * @param {?} elInjector\n * @param {?} projectableNodes\n * @param {?} rootSelectorOrNode\n * @param {?} def\n * @param {?} ngModule\n * @param {?=} context\n * @return {?}\n */\nfunction debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {\n    var /** @type {?} */ rendererFactory = ngModule.injector.get(RendererFactory2);\n    var /** @type {?} */ root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode);\n    var /** @type {?} */ defWithOverride = applyProviderOverridesToView(def);\n    return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]);\n}\n/**\n * @param {?} elInjector\n * @param {?} ngModule\n * @param {?} rendererFactory\n * @param {?} projectableNodes\n * @param {?} rootSelectorOrNode\n * @return {?}\n */\nfunction createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) {\n    var /** @type {?} */ sanitizer = ngModule.injector.get(Sanitizer);\n    var /** @type {?} */ errorHandler = ngModule.injector.get(ErrorHandler);\n    var /** @type {?} */ renderer = rendererFactory.createRenderer(null, null);\n    return {\n        ngModule: ngModule,\n        injector: elInjector, projectableNodes: projectableNodes,\n        selectorOrNode: rootSelectorOrNode, sanitizer: sanitizer, rendererFactory: rendererFactory, renderer: renderer, errorHandler: errorHandler\n    };\n}\n/**\n * @param {?} parentView\n * @param {?} anchorDef\n * @param {?} viewDef\n * @param {?=} context\n * @return {?}\n */\nfunction debugCreateEmbeddedView(parentView, anchorDef, viewDef$$1, context) {\n    var /** @type {?} */ defWithOverride = applyProviderOverridesToView(viewDef$$1);\n    return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]);\n}\n/**\n * @param {?} parentView\n * @param {?} nodeDef\n * @param {?} viewDef\n * @param {?} hostElement\n * @return {?}\n */\nfunction debugCreateComponentView(parentView, nodeDef, viewDef$$1, hostElement) {\n    var /** @type {?} */ defWithOverride = applyProviderOverridesToView(viewDef$$1);\n    return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, defWithOverride, hostElement]);\n}\n/**\n * @param {?} moduleType\n * @param {?} parentInjector\n * @param {?} bootstrapComponents\n * @param {?} def\n * @return {?}\n */\nfunction debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) {\n    var /** @type {?} */ defWithOverride = applyProviderOverridesToNgModule(def);\n    return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);\n}\nvar providerOverrides = new Map();\n/**\n * @param {?} override\n * @return {?}\n */\nfunction debugOverrideProvider(override) {\n    providerOverrides.set(override.token, override);\n}\n/**\n * @return {?}\n */\nfunction debugClearProviderOverrides() {\n    providerOverrides.clear();\n}\n/**\n * @param {?} def\n * @return {?}\n */\nfunction applyProviderOverridesToView(def) {\n    if (providerOverrides.size === 0) {\n        return def;\n    }\n    var /** @type {?} */ elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);\n    if (elementIndicesWithOverwrittenProviders.length === 0) {\n        return def;\n    }\n    // clone the whole view definition,\n    // as it maintains references between the nodes that are hard to update.\n    def = ((def.factory))(function () { return NOOP; });\n    for (var /** @type {?} */ i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {\n        applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);\n    }\n    return def;\n    /**\n     * @param {?} def\n     * @return {?}\n     */\n    function findElementIndicesWithOverwrittenProviders(def) {\n        var /** @type {?} */ elIndicesWithOverwrittenProviders = [];\n        var /** @type {?} */ lastElementDef = null;\n        for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n            var /** @type {?} */ nodeDef = def.nodes[i];\n            if (nodeDef.flags & 1 /* TypeElement */) {\n                lastElementDef = nodeDef;\n            }\n            if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ &&\n                providerOverrides.has(/** @type {?} */ ((nodeDef.provider)).token)) {\n                elIndicesWithOverwrittenProviders.push(/** @type {?} */ ((lastElementDef)).index);\n                lastElementDef = null;\n            }\n        }\n        return elIndicesWithOverwrittenProviders;\n    }\n    /**\n     * @param {?} viewDef\n     * @param {?} elIndex\n     * @return {?}\n     */\n    function applyProviderOverridesToElement(viewDef$$1, elIndex) {\n        for (var /** @type {?} */ i = elIndex + 1; i < viewDef$$1.nodes.length; i++) {\n            var /** @type {?} */ nodeDef = viewDef$$1.nodes[i];\n            if (nodeDef.flags & 1 /* TypeElement */) {\n                // stop at the next element\n                return;\n            }\n            if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {\n                // Make all providers lazy, so that we don't get into trouble\n                // with ordering problems of providers on the same element\n                nodeDef.flags |= 4096 /* LazyProvider */;\n                var /** @type {?} */ provider = ((nodeDef.provider));\n                var /** @type {?} */ override = providerOverrides.get(provider.token);\n                if (override) {\n                    nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;\n                    provider.deps = splitDepsDsl(override.deps);\n                    provider.value = override.value;\n                }\n            }\n        }\n    }\n}\n/**\n * @param {?} def\n * @return {?}\n */\nfunction applyProviderOverridesToNgModule(def) {\n    if (providerOverrides.size === 0 || !hasOverrrides(def)) {\n        return def;\n    }\n    // clone the whole view definition,\n    // as it maintains references between the nodes that are hard to update.\n    def = ((def.factory))(function () { return NOOP; });\n    applyProviderOverrides(def);\n    return def;\n    /**\n     * @param {?} def\n     * @return {?}\n     */\n    function hasOverrrides(def) {\n        return def.providers.some(function (node) { return !!(node.flags & 3840 /* CatProviderNoDirective */) && providerOverrides.has(node.token); });\n    }\n    /**\n     * @param {?} def\n     * @return {?}\n     */\n    function applyProviderOverrides(def) {\n        for (var /** @type {?} */ i = 0; i < def.providers.length; i++) {\n            var /** @type {?} */ provider = def.providers[i];\n            // Make all providers lazy, so that we don't get into trouble\n            // with ordering problems of providers on the same element\n            provider.flags |= 4096 /* LazyProvider */;\n            var /** @type {?} */ override = providerOverrides.get(provider.token);\n            if (override) {\n                provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags;\n                provider.deps = splitDepsDsl(override.deps);\n                provider.value = override.value;\n            }\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\n */\nfunction prodCheckAndUpdateNode(view, nodeIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];\n    checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n    return (nodeDef.flags & 224 /* CatPureExpression */) ?\n        asPureExpressionData(view, nodeIndex).value :\n        undefined;\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\n */\nfunction prodCheckNoChangesNode(view, nodeIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {\n    var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];\n    checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n    return (nodeDef.flags & 224 /* CatPureExpression */) ?\n        asPureExpressionData(view, nodeIndex).value :\n        undefined;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction debugCheckAndUpdateView(view) {\n    return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction debugCheckNoChangesView(view) {\n    return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction debugDestroyView(view) {\n    return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);\n}\nvar DebugAction = {};\nDebugAction.create = 0;\nDebugAction.detectChanges = 1;\nDebugAction.checkNoChanges = 2;\nDebugAction.destroy = 3;\nDebugAction.handleEvent = 4;\nDebugAction[DebugAction.create] = \"create\";\nDebugAction[DebugAction.detectChanges] = \"detectChanges\";\nDebugAction[DebugAction.checkNoChanges] = \"checkNoChanges\";\nDebugAction[DebugAction.destroy] = \"destroy\";\nDebugAction[DebugAction.handleEvent] = \"handleEvent\";\nvar _currentAction;\nvar _currentView;\nvar _currentNodeIndex;\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction debugSetCurrentNode(view, nodeIndex) {\n    _currentView = view;\n    _currentNodeIndex = nodeIndex;\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @param {?} eventName\n * @param {?} event\n * @return {?}\n */\nfunction debugHandleEvent(view, nodeIndex, eventName, event) {\n    debugSetCurrentNode(view, nodeIndex);\n    return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);\n}\n/**\n * @param {?} view\n * @param {?} checkType\n * @return {?}\n */\nfunction debugUpdateDirectives(view, checkType) {\n    if (view.state & 128 /* Destroyed */) {\n        throw viewDestroyedError(DebugAction[_currentAction]);\n    }\n    debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));\n    return view.def.updateDirectives(debugCheckDirectivesFn, view);\n    /**\n     * @param {?} view\n     * @param {?} nodeIndex\n     * @param {?} argStyle\n     * @param {...?} values\n     * @return {?}\n     */\n    function debugCheckDirectivesFn(view, nodeIndex, argStyle) {\n        var values = [];\n        for (var _i = 3; _i < arguments.length; _i++) {\n            values[_i - 3] = arguments[_i];\n        }\n        var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];\n        if (checkType === 0 /* CheckAndUpdate */) {\n            debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n        }\n        else {\n            debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n        }\n        if (nodeDef.flags & 16384 /* TypeDirective */) {\n            debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));\n        }\n        return (nodeDef.flags & 224 /* CatPureExpression */) ?\n            asPureExpressionData(view, nodeDef.index).value :\n            undefined;\n    }\n}\n/**\n * @param {?} view\n * @param {?} checkType\n * @return {?}\n */\nfunction debugUpdateRenderer(view, checkType) {\n    if (view.state & 128 /* Destroyed */) {\n        throw viewDestroyedError(DebugAction[_currentAction]);\n    }\n    debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));\n    return view.def.updateRenderer(debugCheckRenderNodeFn, view);\n    /**\n     * @param {?} view\n     * @param {?} nodeIndex\n     * @param {?} argStyle\n     * @param {...?} values\n     * @return {?}\n     */\n    function debugCheckRenderNodeFn(view, nodeIndex, argStyle) {\n        var values = [];\n        for (var _i = 3; _i < arguments.length; _i++) {\n            values[_i - 3] = arguments[_i];\n        }\n        var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];\n        if (checkType === 0 /* CheckAndUpdate */) {\n            debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n        }\n        else {\n            debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n        }\n        if (nodeDef.flags & 3 /* CatRenderNode */) {\n            debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));\n        }\n        return (nodeDef.flags & 224 /* CatPureExpression */) ?\n            asPureExpressionData(view, nodeDef.index).value :\n            undefined;\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?} givenValues\n * @return {?}\n */\nfunction debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {\n    var /** @type {?} */ changed = ((checkAndUpdateNode)).apply(void 0, [view, nodeDef, argStyle].concat(givenValues));\n    if (changed) {\n        var /** @type {?} */ values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues;\n        if (nodeDef.flags & 16384 /* TypeDirective */) {\n            var /** @type {?} */ bindingValues = {};\n            for (var /** @type {?} */ i = 0; i < nodeDef.bindings.length; i++) {\n                var /** @type {?} */ binding = nodeDef.bindings[i];\n                var /** @type {?} */ value = values[i];\n                if (binding.flags & 8 /* TypeProperty */) {\n                    bindingValues[normalizeDebugBindingName(/** @type {?} */ ((binding.nonMinifiedName)))] =\n                        normalizeDebugBindingValue(value);\n                }\n            }\n            var /** @type {?} */ elDef = ((nodeDef.parent));\n            var /** @type {?} */ el = asElementData(view, elDef.index).renderElement;\n            if (!((elDef.element)).name) {\n                // a comment.\n                view.renderer.setValue(el, \"bindings=\" + JSON.stringify(bindingValues, null, 2));\n            }\n            else {\n                // a regular element.\n                for (var /** @type {?} */ attr in bindingValues) {\n                    var /** @type {?} */ value = bindingValues[attr];\n                    if (value != null) {\n                        view.renderer.setAttribute(el, attr, value);\n                    }\n                    else {\n                        view.renderer.removeAttribute(el, attr);\n                    }\n                }\n            }\n        }\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?} values\n * @return {?}\n */\nfunction debugCheckNoChangesNode(view, nodeDef, argStyle, values) {\n    ((checkNoChangesNode)).apply(void 0, [view, nodeDef, argStyle].concat(values));\n}\n/**\n * @param {?} name\n * @return {?}\n */\nfunction normalizeDebugBindingName(name) {\n    // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n    name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n    return \"ng-reflect-\" + name;\n}\nvar CAMEL_CASE_REGEXP = /([A-Z])/g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction camelCaseToDashCase(input) {\n    return input.replace(CAMEL_CASE_REGEXP, function () {\n        var m = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            m[_i] = arguments[_i];\n        }\n        return '-' + m[1].toLowerCase();\n    });\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction normalizeDebugBindingValue(value) {\n    try {\n        // Limit the size of the value as otherwise the DOM just gets polluted.\n        return value != null ? value.toString().slice(0, 30) : value;\n    }\n    catch (e) {\n        return '[ERROR] Exception while trying to serialize the value';\n    }\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction nextDirectiveWithBinding(view, nodeIndex) {\n    for (var /** @type {?} */ i = nodeIndex; i < view.def.nodes.length; i++) {\n        var /** @type {?} */ nodeDef = view.def.nodes[i];\n        if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) {\n            return i;\n        }\n    }\n    return null;\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction nextRenderNodeWithBinding(view, nodeIndex) {\n    for (var /** @type {?} */ i = nodeIndex; i < view.def.nodes.length; i++) {\n        var /** @type {?} */ nodeDef = view.def.nodes[i];\n        if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) {\n            return i;\n        }\n    }\n    return null;\n}\nvar DebugContext_ = (function () {\n    /**\n     * @param {?} view\n     * @param {?} nodeIndex\n     */\n    function DebugContext_(view, nodeIndex) {\n        this.view = view;\n        this.nodeIndex = nodeIndex;\n        if (nodeIndex == null) {\n            this.nodeIndex = nodeIndex = 0;\n        }\n        this.nodeDef = view.def.nodes[nodeIndex];\n        var elDef = this.nodeDef;\n        var elView = view;\n        while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {\n            elDef = elDef.parent;\n        }\n        if (!elDef) {\n            while (!elDef && elView) {\n                elDef = viewParentEl(elView);\n                elView = elView.parent;\n            }\n        }\n        this.elDef = elDef;\n        this.elView = elView;\n    }\n    Object.defineProperty(DebugContext_.prototype, \"elOrCompView\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            // Has to be done lazily as we use the DebugContext also during creation of elements...\n            return asElementData(this.elView, this.elDef.index).componentView || this.view;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return createInjector(this.elView, this.elDef); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"component\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.elOrCompView.component; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"context\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.elOrCompView.context; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"providerTokens\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ tokens = [];\n            if (this.elDef) {\n                for (var /** @type {?} */ i = this.elDef.index + 1; i <= this.elDef.index + this.elDef.childCount; i++) {\n                    var /** @type {?} */ childDef = this.elView.def.nodes[i];\n                    if (childDef.flags & 20224 /* CatProvider */) {\n                        tokens.push(/** @type {?} */ ((childDef.provider)).token);\n                    }\n                    i += childDef.childCount;\n                }\n            }\n            return tokens;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"references\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ references = {};\n            if (this.elDef) {\n                collectReferences(this.elView, this.elDef, references);\n                for (var /** @type {?} */ i = this.elDef.index + 1; i <= this.elDef.index + this.elDef.childCount; i++) {\n                    var /** @type {?} */ childDef = this.elView.def.nodes[i];\n                    if (childDef.flags & 20224 /* CatProvider */) {\n                        collectReferences(this.elView, childDef, references);\n                    }\n                    i += childDef.childCount;\n                }\n            }\n            return references;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"componentRenderElement\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ elData = findHostElement(this.elOrCompView);\n            return elData ? elData.renderElement : undefined;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(DebugContext_.prototype, \"renderNode\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) :\n                renderNode(this.elView, this.elDef);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} console\n     * @param {...?} values\n     * @return {?}\n     */\n    DebugContext_.prototype.logError = function (console) {\n        var values = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            values[_i - 1] = arguments[_i];\n        }\n        var /** @type {?} */ logViewDef;\n        var /** @type {?} */ logNodeIndex;\n        if (this.nodeDef.flags & 2 /* TypeText */) {\n            logViewDef = this.view.def;\n            logNodeIndex = this.nodeDef.index;\n        }\n        else {\n            logViewDef = this.elView.def;\n            logNodeIndex = this.elDef.index;\n        }\n        // Note: we only generate a log function for text and element nodes\n        // to make the generated code as small as possible.\n        var /** @type {?} */ renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);\n        var /** @type {?} */ currRenderNodeIndex = -1;\n        var /** @type {?} */ nodeLogger = function () {\n            currRenderNodeIndex++;\n            if (currRenderNodeIndex === renderNodeIndex) {\n                return (_a = console.error).bind.apply(_a, [console].concat(values));\n            }\n            else {\n                return NOOP;\n            }\n            var _a;\n        }; /** @type {?} */\n        ((logViewDef.factory))(nodeLogger);\n        if (currRenderNodeIndex < renderNodeIndex) {\n            console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');\n            console.error.apply(console, values);\n        }\n    };\n    return DebugContext_;\n}());\n/**\n * @param {?} viewDef\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction getRenderNodeIndex(viewDef$$1, nodeIndex) {\n    var /** @type {?} */ renderNodeIndex = -1;\n    for (var /** @type {?} */ i = 0; i <= nodeIndex; i++) {\n        var /** @type {?} */ nodeDef = viewDef$$1.nodes[i];\n        if (nodeDef.flags & 3 /* CatRenderNode */) {\n            renderNodeIndex++;\n        }\n    }\n    return renderNodeIndex;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction findHostElement(view) {\n    while (view && !isComponentView(view)) {\n        view = ((view.parent));\n    }\n    if (view.parent) {\n        return asElementData(view.parent, /** @type {?} */ ((viewParentEl(view))).index);\n    }\n    return null;\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} references\n * @return {?}\n */\nfunction collectReferences(view, nodeDef, references) {\n    for (var /** @type {?} */ refName in nodeDef.references) {\n        references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);\n    }\n}\n/**\n * @param {?} action\n * @param {?} fn\n * @param {?} self\n * @param {?} args\n * @return {?}\n */\nfunction callWithDebugContext(action, fn, self, args) {\n    var /** @type {?} */ oldAction = _currentAction;\n    var /** @type {?} */ oldView = _currentView;\n    var /** @type {?} */ oldNodeIndex = _currentNodeIndex;\n    try {\n        _currentAction = action;\n        var /** @type {?} */ result = fn.apply(self, args);\n        _currentView = oldView;\n        _currentNodeIndex = oldNodeIndex;\n        _currentAction = oldAction;\n        return result;\n    }\n    catch (e) {\n        if (isViewDebugError(e) || !_currentView) {\n            throw e;\n        }\n        throw viewWrappedDebugError(e, /** @type {?} */ ((getCurrentDebugContext())));\n    }\n}\n/**\n * @return {?}\n */\nfunction getCurrentDebugContext() {\n    return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;\n}\nvar DebugRendererFactory2 = (function () {\n    /**\n     * @param {?} delegate\n     */\n    function DebugRendererFactory2(delegate) {\n        this.delegate = delegate;\n    }\n    /**\n     * @param {?} element\n     * @param {?} renderData\n     * @return {?}\n     */\n    DebugRendererFactory2.prototype.createRenderer = function (element, renderData) {\n        return new DebugRenderer2(this.delegate.createRenderer(element, renderData));\n    };\n    /**\n     * @return {?}\n     */\n    DebugRendererFactory2.prototype.begin = function () {\n        if (this.delegate.begin) {\n            this.delegate.begin();\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DebugRendererFactory2.prototype.end = function () {\n        if (this.delegate.end) {\n            this.delegate.end();\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DebugRendererFactory2.prototype.whenRenderingDone = function () {\n        if (this.delegate.whenRenderingDone) {\n            return this.delegate.whenRenderingDone();\n        }\n        return Promise.resolve(null);\n    };\n    return DebugRendererFactory2;\n}());\nvar DebugRenderer2 = (function () {\n    /**\n     * @param {?} delegate\n     */\n    function DebugRenderer2(delegate) {\n        this.delegate = delegate;\n    }\n    Object.defineProperty(DebugRenderer2.prototype, \"data\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.delegate.data; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    DebugRenderer2.prototype.destroyNode = function (node) {\n        removeDebugNodeFromIndex(/** @type {?} */ ((getDebugNode(node))));\n        if (this.delegate.destroyNode) {\n            this.delegate.destroyNode(node);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DebugRenderer2.prototype.destroy = function () { this.delegate.destroy(); };\n    /**\n     * @param {?} name\n     * @param {?=} namespace\n     * @return {?}\n     */\n    DebugRenderer2.prototype.createElement = function (name, namespace) {\n        var /** @type {?} */ el = this.delegate.createElement(name, namespace);\n        var /** @type {?} */ debugCtx = getCurrentDebugContext();\n        if (debugCtx) {\n            var /** @type {?} */ debugEl = new DebugElement(el, null, debugCtx);\n            debugEl.name = name;\n            indexDebugNode(debugEl);\n        }\n        return el;\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DebugRenderer2.prototype.createComment = function (value) {\n        var /** @type {?} */ comment = this.delegate.createComment(value);\n        var /** @type {?} */ debugCtx = getCurrentDebugContext();\n        if (debugCtx) {\n            indexDebugNode(new DebugNode(comment, null, debugCtx));\n        }\n        return comment;\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DebugRenderer2.prototype.createText = function (value) {\n        var /** @type {?} */ text = this.delegate.createText(value);\n        var /** @type {?} */ debugCtx = getCurrentDebugContext();\n        if (debugCtx) {\n            indexDebugNode(new DebugNode(text, null, debugCtx));\n        }\n        return text;\n    };\n    /**\n     * @param {?} parent\n     * @param {?} newChild\n     * @return {?}\n     */\n    DebugRenderer2.prototype.appendChild = function (parent, newChild) {\n        var /** @type {?} */ debugEl = getDebugNode(parent);\n        var /** @type {?} */ debugChildEl = getDebugNode(newChild);\n        if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n            debugEl.addChild(debugChildEl);\n        }\n        this.delegate.appendChild(parent, newChild);\n    };\n    /**\n     * @param {?} parent\n     * @param {?} newChild\n     * @param {?} refChild\n     * @return {?}\n     */\n    DebugRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {\n        var /** @type {?} */ debugEl = getDebugNode(parent);\n        var /** @type {?} */ debugChildEl = getDebugNode(newChild);\n        var /** @type {?} */ debugRefEl = ((getDebugNode(refChild)));\n        if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n            debugEl.insertBefore(debugRefEl, debugChildEl);\n        }\n        this.delegate.insertBefore(parent, newChild, refChild);\n    };\n    /**\n     * @param {?} parent\n     * @param {?} oldChild\n     * @return {?}\n     */\n    DebugRenderer2.prototype.removeChild = function (parent, oldChild) {\n        var /** @type {?} */ debugEl = getDebugNode(parent);\n        var /** @type {?} */ debugChildEl = getDebugNode(oldChild);\n        if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n            debugEl.removeChild(debugChildEl);\n        }\n        this.delegate.removeChild(parent, oldChild);\n    };\n    /**\n     * @param {?} selectorOrNode\n     * @return {?}\n     */\n    DebugRenderer2.prototype.selectRootElement = function (selectorOrNode) {\n        var /** @type {?} */ el = this.delegate.selectRootElement(selectorOrNode);\n        var /** @type {?} */ debugCtx = getCurrentDebugContext();\n        if (debugCtx) {\n            indexDebugNode(new DebugElement(el, null, debugCtx));\n        }\n        return el;\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @param {?=} namespace\n     * @return {?}\n     */\n    DebugRenderer2.prototype.setAttribute = function (el, name, value, namespace) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            var /** @type {?} */ fullName = namespace ? namespace + ':' + name : name;\n            debugEl.attributes[fullName] = value;\n        }\n        this.delegate.setAttribute(el, name, value, namespace);\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?=} namespace\n     * @return {?}\n     */\n    DebugRenderer2.prototype.removeAttribute = function (el, name, namespace) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            var /** @type {?} */ fullName = namespace ? namespace + ':' + name : name;\n            debugEl.attributes[fullName] = null;\n        }\n        this.delegate.removeAttribute(el, name, namespace);\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    DebugRenderer2.prototype.addClass = function (el, name) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            debugEl.classes[name] = true;\n        }\n        this.delegate.addClass(el, name);\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    DebugRenderer2.prototype.removeClass = function (el, name) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            debugEl.classes[name] = false;\n        }\n        this.delegate.removeClass(el, name);\n    };\n    /**\n     * @param {?} el\n     * @param {?} style\n     * @param {?} value\n     * @param {?} flags\n     * @return {?}\n     */\n    DebugRenderer2.prototype.setStyle = function (el, style, value, flags) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            debugEl.styles[style] = value;\n        }\n        this.delegate.setStyle(el, style, value, flags);\n    };\n    /**\n     * @param {?} el\n     * @param {?} style\n     * @param {?} flags\n     * @return {?}\n     */\n    DebugRenderer2.prototype.removeStyle = function (el, style, flags) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            debugEl.styles[style] = null;\n        }\n        this.delegate.removeStyle(el, style, flags);\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DebugRenderer2.prototype.setProperty = function (el, name, value) {\n        var /** @type {?} */ debugEl = getDebugNode(el);\n        if (debugEl && debugEl instanceof DebugElement) {\n            debugEl.properties[name] = value;\n        }\n        this.delegate.setProperty(el, name, value);\n    };\n    /**\n     * @param {?} target\n     * @param {?} eventName\n     * @param {?} callback\n     * @return {?}\n     */\n    DebugRenderer2.prototype.listen = function (target, eventName, callback) {\n        if (typeof target !== 'string') {\n            var /** @type {?} */ debugEl = getDebugNode(target);\n            if (debugEl) {\n                debugEl.listeners.push(new EventListener(eventName, callback));\n            }\n        }\n        return this.delegate.listen(target, eventName, callback);\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    DebugRenderer2.prototype.parentNode = function (node) { return this.delegate.parentNode(node); };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    DebugRenderer2.prototype.nextSibling = function (node) { return this.delegate.nextSibling(node); };\n    /**\n     * @param {?} node\n     * @param {?} value\n     * @return {?}\n     */\n    DebugRenderer2.prototype.setValue = function (node, value) { return this.delegate.setValue(node, value); };\n    return DebugRenderer2;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} override\n * @return {?}\n */\nfunction overrideProvider(override) {\n    initServicesIfNeeded();\n    return Services.overrideProvider(override);\n}\n/**\n * @return {?}\n */\nfunction clearProviderOverrides() {\n    initServicesIfNeeded();\n    return Services.clearProviderOverrides();\n}\n/**\n * @param {?} ngModuleType\n * @param {?} bootstrapComponents\n * @param {?} defFactory\n * @return {?}\n */\nfunction createNgModuleFactory(ngModuleType, bootstrapComponents, defFactory) {\n    return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);\n}\nvar NgModuleFactory_ = (function (_super) {\n    __extends(NgModuleFactory_, _super);\n    /**\n     * @param {?} moduleType\n     * @param {?} _bootstrapComponents\n     * @param {?} _ngModuleDefFactory\n     */\n    function NgModuleFactory_(moduleType, _bootstrapComponents, _ngModuleDefFactory) {\n        var _this = \n        // Attention: this ctor is called as top level function.\n        // Putting any logic in here will destroy closure tree shaking!\n        _super.call(this) || this;\n        _this.moduleType = moduleType;\n        _this._bootstrapComponents = _bootstrapComponents;\n        _this._ngModuleDefFactory = _ngModuleDefFactory;\n        return _this;\n    }\n    /**\n     * @param {?} parentInjector\n     * @return {?}\n     */\n    NgModuleFactory_.prototype.create = function (parentInjector) {\n        initServicesIfNeeded();\n        var /** @type {?} */ def = resolveDefinition(this._ngModuleDefFactory);\n        return Services.createNgModuleRef(this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);\n    };\n    return NgModuleFactory_;\n}(NgModuleFactory));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@experimental Animation support is experimental.\n */\n/**\n * `trigger` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `trigger` Creates an animation trigger which will a list of {\\@link state state} and {\\@link\n * transition transition} entries that will be evaluated when the expression bound to the trigger\n * changes.\n *\n * Triggers are registered within the component annotation data under the {\\@link\n * Component#animations animations section}. An animation trigger can be placed on an element\n * within a template by referencing the name of the trigger followed by the expression value that the\n * trigger is bound to (in the form of `[\\@triggerName]=\"expression\"`.\n *\n * ### Usage\n *\n * `trigger` will create an animation trigger reference based on the provided `name` value. The\n * provided `animation` value is expected to be an array consisting of {\\@link state state} and {\\@link\n * transition transition} declarations.\n *\n * ```typescript\n * \\@Component({\n *   selector: 'my-component',\n *   templateUrl: 'my-component-tpl.html',\n *   animations: [\n *     trigger(\"myAnimationTrigger\", [\n *       state(...),\n *       state(...),\n *       transition(...),\n *       transition(...)\n *     ])\n *   ]\n * })\n * class MyComponent {\n *   myStatusExp = \"something\";\n * }\n * ```\n *\n * The template associated with this component will make use of the `myAnimationTrigger` animation\n * trigger by binding to an element within its template code.\n *\n * ```html\n * <!-- somewhere inside of my-component-tpl.html -->\n * <div [\\@myAnimationTrigger]=\"myStatusExp\">...</div>\n * tools/gulp-tasks/validate-commit-message.js ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} name\n * @param {?} definitions\n * @return {?}\n */\nfunction trigger$1(name, definitions) {\n    return { type: 7 /* Trigger */, name: name, definitions: definitions, options: {} };\n}\n/**\n * `animate` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `animate` specifies an animation step that will apply the provided `styles` data for a given\n * amount of time based on the provided `timing` expression value. Calls to `animate` are expected\n * to be used within {\\@link sequence an animation sequence}, {\\@link group group}, or {\\@link\n * transition transition}.\n *\n * ### Usage\n *\n * The `animate` function accepts two input parameters: `timing` and `styles`:\n *\n * - `timing` is a string based value that can be a combination of a duration with optional delay\n * and easing values. The format for the expression breaks down to `duration delay easing`\n * (therefore a value such as `1s 100ms ease-out` will be parse itself into `duration=1000,\n * delay=100, easing=ease-out`. If a numeric value is provided then that will be used as the\n * `duration` value in millisecond form.\n * - `styles` is the style input data which can either be a call to {\\@link style style} or {\\@link\n * keyframes keyframes}. If left empty then the styles from the destination state will be collected\n * and used (this is useful when describing an animation step that will complete an animation by\n * {\\@link transition#the-final-animate-call animating to the final state}).\n *\n * ```typescript\n * // various functions for specifying timing data\n * animate(500, style(...))\n * animate(\"1s\", style(...))\n * animate(\"100ms 0.5s\", style(...))\n * animate(\"5s ease\", style(...))\n * animate(\"5s 10ms cubic-bezier(.17,.67,.88,.1)\", style(...))\n *\n * // either style() of keyframes() can be used\n * animate(500, style({ background: \"red\" }))\n * animate(500, keyframes([\n *   style({ background: \"blue\" })),\n *   style({ background: \"red\" }))\n * ])\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} timings\n * @param {?=} styles\n * @return {?}\n */\nfunction animate$1(timings, styles) {\n    if (styles === void 0) { styles = null; }\n    return { type: 4 /* Animate */, styles: styles, timings: timings };\n}\n/**\n * `group` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `group` specifies a list of animation steps that are all run in parallel. Grouped animations are\n * useful when a series of styles must be animated/closed off at different statrting/ending times.\n *\n * The `group` function can either be used within a {\\@link sequence sequence} or a {\\@link transition\n * transition} and it will only continue to the next instruction once all of the inner animation\n * steps have completed.\n *\n * ### Usage\n *\n * The `steps` data that is passed into the `group` animation function can either consist of {\\@link\n * style style} or {\\@link animate animate} function calls. Each call to `style()` or `animate()`\n * within a group will be executed instantly (use {\\@link keyframes keyframes} or a {\\@link\n * animate#usage animate() with a delay value} to offset styles to be applied at a later time).\n *\n * ```typescript\n * group([\n *   animate(\"1s\", { background: \"black\" }))\n *   animate(\"2s\", { color: \"white\" }))\n * ])\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} steps\n * @param {?=} options\n * @return {?}\n */\nfunction group$1(steps, options) {\n    if (options === void 0) { options = null; }\n    return { type: 3 /* Group */, steps: steps, options: options };\n}\n/**\n * `sequence` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `sequence` Specifies a list of animation steps that are run one by one. (`sequence` is used by\n * default when an array is passed as animation data into {\\@link transition transition}.)\n *\n * The `sequence` function can either be used within a {\\@link group group} or a {\\@link transition\n * transition} and it will only continue to the next instruction once each of the inner animation\n * steps have completed.\n *\n * To perform animation styling in parallel with other animation steps then have a look at the\n * {\\@link group group} animation function.\n *\n * ### Usage\n *\n * The `steps` data that is passed into the `sequence` animation function can either consist of\n * {\\@link style style} or {\\@link animate animate} function calls. A call to `style()` will apply the\n * provided styling data immediately while a call to `animate()` will apply its styling data over a\n * given time depending on its timing data.\n *\n * ```typescript\n * sequence([\n *   style({ opacity: 0 })),\n *   animate(\"1s\", { opacity: 1 }))\n * ])\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} steps\n * @param {?=} options\n * @return {?}\n */\nfunction sequence$1(steps, options) {\n    if (options === void 0) { options = null; }\n    return { type: 2 /* Sequence */, steps: steps, options: options };\n}\n/**\n * `style` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `style` declares a key/value object containing CSS properties/styles that can then be used for\n * {\\@link state animation states}, within an {\\@link sequence animation sequence}, or as styling data\n * for both {\\@link animate animate} and {\\@link keyframes keyframes}.\n *\n * ### Usage\n *\n * `style` takes in a key/value string map as data and expects one or more CSS property/value pairs\n * to be defined.\n *\n * ```typescript\n * // string values are used for css properties\n * style({ background: \"red\", color: \"blue\" })\n *\n * // numerical (pixel) values are also supported\n * style({ width: 100, height: 0 })\n * ```\n *\n * #### Auto-styles (using `*`)\n *\n * When an asterix (`*`) character is used as a value then it will be detected from the element\n * being animated and applied as animation data when the animation starts.\n *\n * This feature proves useful for a state depending on layout and/or environment factors; in such\n * cases the styles are calculated just before the animation starts.\n *\n * ```typescript\n * // the steps below will animate from 0 to the\n * // actual height of the element\n * style({ height: 0 }),\n * animate(\"1s\", style({ height: \"*\" }))\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} tokens\n * @return {?}\n */\nfunction style$1(tokens) {\n    return { type: 6 /* Style */, styles: tokens, offset: null };\n}\n/**\n * `state` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `state` declares an animation state within the given trigger. When a state is active within a\n * component then its associated styles will persist on the element that the trigger is attached to\n * (even when the animation ends).\n *\n * To animate between states, have a look at the animation {\\@link transition transition} DSL\n * function. To register states to an animation trigger please have a look at the {\\@link trigger\n * trigger} function.\n *\n * #### The `void` state\n *\n * The `void` state value is a reserved word that angular uses to determine when the element is not\n * apart of the application anymore (e.g. when an `ngIf` evaluates to false then the state of the\n * associated element is void).\n *\n * #### The `*` (default) state\n *\n * The `*` state (when styled) is a fallback state that will be used if the state that is being\n * animated is not declared within the trigger.\n *\n * ### Usage\n *\n * `state` will declare an animation state with its associated styles\n * within the given trigger.\n *\n * - `stateNameExpr` can be one or more state names separated by commas.\n * - `styles` refers to the {\\@link style styling data} that will be persisted on the element once\n * the state has been reached.\n *\n * ```typescript\n * // \"void\" is a reserved name for a state and is used to represent\n * // the state in which an element is detached from from the application.\n * state(\"void\", style({ height: 0 }))\n *\n * // user-defined states\n * state(\"closed\", style({ height: 0 }))\n * state(\"open, visible\", style({ height: \"*\" }))\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} name\n * @param {?} styles\n * @return {?}\n */\nfunction state$1(name, styles) {\n    return { type: 0 /* State */, name: name, styles: styles };\n}\n/**\n * `keyframes` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `keyframes` specifies a collection of {\\@link style style} entries each optionally characterized\n * by an `offset` value.\n *\n * ### Usage\n *\n * The `keyframes` animation function is designed to be used alongside the {\\@link animate animate}\n * animation function. Instead of applying animations from where they are currently to their\n * destination, keyframes can describe how each style entry is applied and at what point within the\n * animation arc (much like CSS Keyframe Animations do).\n *\n * For each `style()` entry an `offset` value can be set. Doing so allows to specifiy at what\n * percentage of the animate time the styles will be applied.\n *\n * ```typescript\n * // the provided offset values describe when each backgroundColor value is applied.\n * animate(\"5s\", keyframes([\n *   style({ backgroundColor: \"red\", offset: 0 }),\n *   style({ backgroundColor: \"blue\", offset: 0.2 }),\n *   style({ backgroundColor: \"orange\", offset: 0.3 }),\n *   style({ backgroundColor: \"black\", offset: 1 })\n * ]))\n * ```\n *\n * Alternatively, if there are no `offset` values used within the style entries then the offsets\n * will be calculated automatically.\n *\n * ```typescript\n * animate(\"5s\", keyframes([\n *   style({ backgroundColor: \"red\" }) // offset = 0\n *   style({ backgroundColor: \"blue\" }) // offset = 0.33\n *   style({ backgroundColor: \"orange\" }) // offset = 0.66\n *   style({ backgroundColor: \"black\" }) // offset = 1\n * ]))\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} steps\n * @return {?}\n */\nfunction keyframes$1(steps) {\n    return { type: 5 /* Keyframes */, steps: steps };\n}\n/**\n * `transition` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the {\\@link\n * Component#animations component animations metadata page} to gain a better understanding of\n * how animations in Angular are used.\n *\n * `transition` declares the {\\@link sequence sequence of animation steps} that will be run when the\n * provided `stateChangeExpr` value is satisfied. The `stateChangeExpr` consists of a `state1 =>\n * state2` which consists of two known states (use an asterix (`*`) to refer to a dynamic starting\n * and/or ending state).\n *\n * A function can also be provided as the `stateChangeExpr` argument for a transition and this\n * function will be executed each time a state change occurs. If the value returned within the\n * function is true then the associated animation will be run.\n *\n * Animation transitions are placed within an {\\@link trigger animation trigger}. For an transition\n * to animate to a state value and persist its styles then one or more {\\@link state animation\n * states} is expected to be defined.\n *\n * ### Usage\n *\n * An animation transition is kicked off the `stateChangeExpr` predicate evaluates to true based on\n * what the previous state is and what the current state has become. In other words, if a transition\n * is defined that matches the old/current state criteria then the associated animation will be\n * triggered.\n *\n * ```typescript\n * // all transition/state changes are defined within an animation trigger\n * trigger(\"myAnimationTrigger\", [\n *   // if a state is defined then its styles will be persisted when the\n *   // animation has fully completed itself\n *   state(\"on\", style({ background: \"green\" })),\n *   state(\"off\", style({ background: \"grey\" })),\n *\n *   // a transition animation that will be kicked off when the state value\n *   // bound to \"myAnimationTrigger\" changes from \"on\" to \"off\"\n *   transition(\"on => off\", animate(500)),\n *\n *   // it is also possible to do run the same animation for both directions\n *   transition(\"on <=> off\", animate(500)),\n *\n *   // or to define multiple states pairs separated by commas\n *   transition(\"on => off, off => void\", animate(500)),\n *\n *   // this is a catch-all state change for when an element is inserted into\n *   // the page and the destination state is unknown\n *   transition(\"void => *\", [\n *     style({ opacity: 0 }),\n *     animate(500)\n *   ]),\n *\n *   // this will capture a state change between any states\n *   transition(\"* => *\", animate(\"1s 0s\")),\n *\n *   // you can also go full out and include a function\n *   transition((fromState, toState) => {\n *     // when `true` then it will allow the animation below to be invoked\n *     return fromState == \"off\" && toState == \"on\";\n *   }, animate(\"1s 0s\"))\n * ])\n * ```\n *\n * The template associated with this component will make use of the `myAnimationTrigger` animation\n * trigger by binding to an element within its template code.\n *\n * ```html\n * <!-- somewhere inside of my-component-tpl.html -->\n * <div [\\@myAnimationTrigger]=\"myStatusExp\">...</div>\n * ```\n *\n * #### The final `animate` call\n *\n * If the final step within the transition steps is a call to `animate()` that **only** uses a\n * timing value with **no style data** then it will be automatically used as the final animation arc\n * for the element to animate itself to the final state. This involves an automatic mix of\n * adding/removing CSS styles so that the element will be in the exact state it should be for the\n * applied state to be presented correctly.\n *\n * ```\n * // start off by hiding the element, but make sure that it animates properly to whatever state\n * // is currently active for \"myAnimationTrigger\"\n * transition(\"void => *\", [\n *   style({ opacity: 0 }),\n *   animate(500)\n * ])\n * ```\n *\n * ### Transition Aliases (`:enter` and `:leave`)\n *\n * Given that enter (insertion) and leave (removal) animations are so common, the `transition`\n * function accepts both `:enter` and `:leave` values which are aliases for the `void => *` and `*\n * => void` state changes.\n *\n * ```\n * transition(\":enter\", [\n *   style({ opacity: 0 }),\n *   animate(500, style({ opacity: 1 }))\n * ])\n * transition(\":leave\", [\n *   animate(500, style({ opacity: 0 }))\n * ])\n * ```\n *\n * {\\@example core/animation/ts/dsl/animation_example.ts region='Component'}\n *\n * \\@experimental Animation support is experimental.\n * @param {?} stateChangeExpr\n * @param {?} steps\n * @param {?=} options\n * @return {?}\n */\nfunction transition$1(stateChangeExpr, steps, options) {\n    if (options === void 0) { options = null; }\n    return { type: 1 /* Transition */, expr: stateChangeExpr, animation: steps, options: options };\n}\n/**\n * `animation` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language.\n *\n * `var myAnimation = animation(...)` is designed to produce a reusable animation that can be later\n * invoked in another animation or sequence. Reusable animations are designed to make use of\n * animation parameters and the produced animation can be used via the `useAnimation` method.\n *\n * ```\n * var fadeAnimation = animation([\n *   style({ opacity: '{{ start }}' }),\n *   animate('{{ time }}',\n *     style({ opacity: '{{ end }}'))\n * ], { params: { time: '1000ms', start: 0, end: 1 }});\n * ```\n *\n * If parameters are attached to an animation then they act as **default parameter values**. When an\n * animation is invoked via `useAnimation` then parameter values are allowed to be passed in\n * directly. If any of the passed in parameter values are missing then the default values will be\n * used.\n *\n * ```\n * useAnimation(fadeAnimation, {\n *   params: {\n *     time: '2s',\n *     start: 1,\n *     end: 0\n *   }\n * })\n * ```\n *\n * If one or more parameter values are missing before animated then an error will be thrown.\n *\n * \\@experimental Animation support is experimental.\n * @param {?} steps\n * @param {?=} options\n * @return {?}\n */\n/**\n * `animateChild` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. It works by allowing a queried element to execute its own\n * animation within the animation sequence.\n *\n * Each time an animation is triggered in angular, the parent animation\n * will always get priority and any child animations will be blocked. In order\n * for a child animation to run, the parent animation must query each of the elements\n * containing child animations and then allow the animations to run using `animateChild`.\n *\n * The example HTML code below shows both parent and child elements that have animation\n * triggers that will execute at the same time.\n *\n * ```html\n * <!-- parent-child.component.html -->\n * <button (click)=\"exp =! exp\">Toggle</button>\n * <hr>\n *\n * <div [\\@parentAnimation]=\"exp\">\n *   <header>Hello</header>\n *   <div [\\@childAnimation]=\"exp\">\n *       one\n *   </div>\n *   <div [\\@childAnimation]=\"exp\">\n *       two\n *   </div>\n *   <div [\\@childAnimation]=\"exp\">\n *       three\n *   </div>\n * </div>\n * ```\n *\n * Now when the `exp` value changes to true, only the `parentAnimation` animation will animate\n * because it has priority. However, using `query` and `animateChild` each of the inner animations\n * can also fire:\n *\n * ```ts\n * // parent-child.component.ts\n * import {trigger, transition, animate, style, query, animateChild} from '\\@angular/animations';\n * \\@Component({\n *   selector: 'parent-child-component',\n *   animations: [\n *     trigger('parentAnimation', [\n *       transition('false => true', [\n *         query('header', [\n *           style({ opacity: 0 }),\n *           animate(500, style({ opacity: 1 }))\n *         ]),\n *         query('\\@childAnimation', [\n *           animateChild()\n *         ])\n *       ])\n *     ]),\n *     trigger('childAnimation', [\n *       transition('false => true', [\n *         style({ opacity: 0 }),\n *         animate(500, style({ opacity: 1 }))\n *       ])\n *     ])\n *   ]\n * })\n * class ParentChildCmp {\n *   exp: boolean = false;\n * }\n * ```\n *\n * In the animation code above, when the `parentAnimation` transition kicks off it first queries to\n * find the header element and fades it in. It then finds each of the sub elements that contain the\n * `\\@childAnimation` trigger and then allows for their animations to fire.\n *\n * This example can be further extended by using stagger:\n *\n * ```ts\n * query('\\@childAnimation', stagger(100, [\n *   animateChild()\n * ]))\n * ```\n *\n * Now each of the sub animations start off with respect to the `100ms` staggering step.\n *\n * ## The first frame of child animations\n * When sub animations are executed using `animateChild` the animation engine will always apply the\n * first frame of every sub animation immediately at the start of the animation sequence. This way\n * the parent animation does not need to set any initial styling data on the sub elements before the\n * sub animations kick off.\n *\n * In the example above the first frame of the `childAnimation`'s `false => true` transition\n * consists of a style of `opacity: 0`. This is applied immediately when the `parentAnimation`\n * animation transition sequence starts. Only then when the `\\@childAnimation` is queried and called\n * with `animateChild` will it then animate to its destination of `opacity: 1`.\n *\n * Note that this feature designed to be used alongside {\\@link query query()} and it will only work\n * with animations that are assigned using the Angular animation DSL (this means that CSS keyframes\n * and transitions are not handled by this API).\n *\n * \\@experimental Animation support is experimental.\n * @param {?=} options\n * @return {?}\n */\n/**\n * `useAnimation` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. It is used to kick off a reusable animation that is created using {\\@link\n * animation animation()}.\n *\n * \\@experimental Animation support is experimental.\n * @param {?} animation\n * @param {?=} options\n * @return {?}\n */\n/**\n * `query` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language.\n *\n * query() is used to find one or more inner elements within the current element that is\n * being animated within the sequence. The provided animation steps are applied\n * to the queried element (by default, an array is provided, then this will be\n * treated as an animation sequence).\n *\n * ### Usage\n *\n * query() is designed to collect mutiple elements and works internally by using\n * `element.querySelectorAll`. An additional options object can be provided which\n * can be used to limit the total amount of items to be collected.\n *\n * ```js\n * query('div', [\n *   animate(...),\n *   animate(...)\n * ], { limit: 1 })\n * ```\n *\n * query(), by default, will throw an error when zero items are found. If a query\n * has the `optional` flag set to true then this error will be ignored.\n *\n * ```js\n * query('.some-element-that-may-not-be-there', [\n *   animate(...),\n *   animate(...)\n * ], { optional: true })\n * ```\n *\n * ### Special Selector Values\n *\n * The selector value within a query can collect elements that contain angular-specific\n * characteristics\n * using special pseudo-selectors tokens.\n *\n * These include:\n *\n *  - Querying for newly inserted/removed elements using `query(\":enter\")`/`query(\":leave\")`\n *  - Querying all currently animating elements using `query(\":animating\")`\n *  - Querying elements that contain an animation trigger using `query(\"\\@triggerName\")`\n *  - Querying all elements that contain an animation triggers using `query(\"\\@*\")`\n *  - Including the current element into the animation sequence using `query(\":self\")`\n *\n *\n *  Each of these pseudo-selector tokens can be merged together into a combined query selector\n * string:\n *\n *  ```\n *  query(':self, .record:enter, .record:leave, \\@subTrigger', [...])\n *  ```\n *\n * ### Demo\n *\n * ```\n * \\@Component({\n *   selector: 'inner',\n *   template: `\n *     <div [\\@queryAnimation]=\"exp\">\n *       <h1>Title</h1>\n *       <div class=\"content\">\n *         Blah blah blah\n *       </div>\n *     </div>\n *   `,\n *   animations: [\n *    trigger('queryAnimation', [\n *      transition('* => goAnimate', [\n *        // hide the inner elements\n *        query('h1', style({ opacity: 0 })),\n *        query('.content', style({ opacity: 0 })),\n *\n *        // animate the inner elements in, one by one\n *        query('h1', animate(1000, style({ opacity: 1 })),\n *        query('.content', animate(1000, style({ opacity: 1 })),\n *      ])\n *    ])\n *  ]\n * })\n * class Cmp {\n *   exp = '';\n *\n *   goAnimate() {\n *     this.exp = 'goAnimate';\n *   }\n * }\n * ```\n *\n * \\@experimental Animation support is experimental.\n * @param {?} selector\n * @param {?} animation\n * @param {?=} options\n * @return {?}\n */\n/**\n * `stagger` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. It is designed to be used inside of an animation {\\@link query query()}\n * and works by issuing a timing gap between after each queried item is animated.\n *\n * ### Usage\n *\n * In the example below there is a container element that wraps a list of items stamped out\n * by an ngFor. The container element contains an animation trigger that will later be set\n * to query for each of the inner items.\n *\n * ```html\n * <!-- list.component.html -->\n * <button (click)=\"toggle()\">Show / Hide Items</button>\n * <hr />\n * <div [\\@listAnimation]=\"items.length\">\n *   <div *ngFor=\"let item of items\">\n *     {{ item }}\n *   </div>\n * </div>\n * ```\n *\n * The component code for this looks as such:\n *\n * ```ts\n * import {trigger, transition, style, animate, query, stagger} from '\\@angular/animations';\n * \\@Component({\n *   templateUrl: 'list.component.html',\n *   animations: [\n *     trigger('listAnimation', [\n *        //...\n *     ])\n *   ]\n * })\n * class ListComponent {\n *   items = [];\n *\n *   showItems() {\n *     this.items = [0,1,2,3,4];\n *   }\n *\n *   hideItems() {\n *     this.items = [];\n *   }\n *\n *   toggle() {\n *     this.items.length ? this.hideItems() : this.showItems();\n *   }\n * }\n * ```\n *\n * And now for the animation trigger code:\n *\n * ```ts\n * trigger('listAnimation', [\n *   transition('* => *', [ // each time the binding value changes\n *     query(':leave', [\n *       stagger(100, [\n *         animate('0.5s', style({ opacity: 0 }))\n *       ])\n *     ]),\n *     query(':enter', [\n *       style({ opacity: 0 }),\n *       stagger(100, [\n *         animate('0.5s', style({ opacity: 1 }))\n *       ])\n *     ])\n *   ])\n * ])\n * ```\n *\n * Now each time the items are added/removed then either the opacity\n * fade-in animation will run or each removed item will be faded out.\n * When either of these animations occur then a stagger effect will be\n * applied after each item's animation is started.\n *\n * \\@experimental Animation support is experimental.\n * @param {?} timings\n * @param {?} animation\n * @return {?}\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n */\nvar AUTO_STYLE$$1 = '*';\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} name\n * @param {?} definitions\n * @return {?}\n */\nfunction trigger$$1(name, definitions) {\n    return trigger$1(name, definitions);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} timings\n * @param {?=} styles\n * @return {?}\n */\nfunction animate$$1(timings, styles) {\n    return animate$1(timings, styles);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} steps\n * @return {?}\n */\nfunction group$$1(steps) {\n    return group$1(steps);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} steps\n * @return {?}\n */\nfunction sequence$$1(steps) {\n    return sequence$1(steps);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} tokens\n * @return {?}\n */\nfunction style$$1(tokens) {\n    return style$1(tokens);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} name\n * @param {?} styles\n * @return {?}\n */\nfunction state$$1(name, styles) {\n    return state$1(name, styles);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} steps\n * @return {?}\n */\nfunction keyframes$$1(steps) {\n    return keyframes$1(steps);\n}\n/**\n * @deprecated This symbol has moved. Please Import from \\@angular/animations instead!\n * @param {?} stateChangeExpr\n * @param {?} steps\n * @return {?}\n */\nfunction transition$$1(stateChangeExpr, steps) {\n    return transition$1(stateChangeExpr, steps);\n}\n\nexports.Class = Class;\nexports.createPlatform = createPlatform;\nexports.assertPlatform = assertPlatform;\nexports.destroyPlatform = destroyPlatform;\nexports.getPlatform = getPlatform;\nexports.PlatformRef = PlatformRef;\nexports.ApplicationRef = ApplicationRef;\nexports.enableProdMode = enableProdMode;\nexports.isDevMode = isDevMode;\nexports.createPlatformFactory = createPlatformFactory;\nexports.NgProbeToken = NgProbeToken;\nexports.APP_ID = APP_ID;\nexports.PACKAGE_ROOT_URL = PACKAGE_ROOT_URL;\nexports.PLATFORM_INITIALIZER = PLATFORM_INITIALIZER;\nexports.PLATFORM_ID = PLATFORM_ID;\nexports.APP_BOOTSTRAP_LISTENER = APP_BOOTSTRAP_LISTENER;\nexports.APP_INITIALIZER = APP_INITIALIZER;\nexports.ApplicationInitStatus = ApplicationInitStatus;\nexports.DebugElement = DebugElement;\nexports.DebugNode = DebugNode;\nexports.asNativeElements = asNativeElements;\nexports.getDebugNode = getDebugNode;\nexports.Testability = Testability;\nexports.TestabilityRegistry = TestabilityRegistry;\nexports.setTestabilityGetter = setTestabilityGetter;\nexports.TRANSLATIONS = TRANSLATIONS;\nexports.TRANSLATIONS_FORMAT = TRANSLATIONS_FORMAT;\nexports.LOCALE_ID = LOCALE_ID;\nexports.MissingTranslationStrategy = MissingTranslationStrategy;\nexports.ApplicationModule = ApplicationModule;\nexports.wtfCreateScope = wtfCreateScope;\nexports.wtfLeave = wtfLeave;\nexports.wtfStartTimeRange = wtfStartTimeRange;\nexports.wtfEndTimeRange = wtfEndTimeRange;\nexports.Type = Type;\nexports.EventEmitter = EventEmitter;\nexports.ErrorHandler = ErrorHandler;\nexports.Sanitizer = Sanitizer;\nexports.SecurityContext = SecurityContext;\nexports.ANALYZE_FOR_ENTRY_COMPONENTS = ANALYZE_FOR_ENTRY_COMPONENTS;\nexports.Attribute = Attribute;\nexports.ContentChild = ContentChild;\nexports.ContentChildren = ContentChildren;\nexports.Query = Query;\nexports.ViewChild = ViewChild;\nexports.ViewChildren = ViewChildren;\nexports.Component = Component;\nexports.Directive = Directive;\nexports.HostBinding = HostBinding;\nexports.HostListener = HostListener;\nexports.Input = Input;\nexports.Output = Output;\nexports.Pipe = Pipe;\nexports.CUSTOM_ELEMENTS_SCHEMA = CUSTOM_ELEMENTS_SCHEMA;\nexports.NO_ERRORS_SCHEMA = NO_ERRORS_SCHEMA;\nexports.NgModule = NgModule;\nexports.ViewEncapsulation = ViewEncapsulation;\nexports.Version = Version;\nexports.VERSION = VERSION;\nexports.forwardRef = forwardRef;\nexports.resolveForwardRef = resolveForwardRef;\nexports.Injector = Injector;\nexports.ReflectiveInjector = ReflectiveInjector;\nexports.ResolvedReflectiveFactory = ResolvedReflectiveFactory;\nexports.ReflectiveKey = ReflectiveKey;\nexports.InjectionToken = InjectionToken;\nexports.OpaqueToken = OpaqueToken;\nexports.Inject = Inject;\nexports.Optional = Optional;\nexports.Injectable = Injectable;\nexports.Self = Self;\nexports.SkipSelf = SkipSelf;\nexports.Host = Host;\nexports.NgZone = NgZone;\nexports.RenderComponentType = RenderComponentType;\nexports.Renderer = Renderer;\nexports.Renderer2 = Renderer2;\nexports.RendererFactory2 = RendererFactory2;\nexports.RendererStyleFlags2 = RendererStyleFlags2;\nexports.RootRenderer = RootRenderer;\nexports.COMPILER_OPTIONS = COMPILER_OPTIONS;\nexports.Compiler = Compiler;\nexports.CompilerFactory = CompilerFactory;\nexports.ModuleWithComponentFactories = ModuleWithComponentFactories;\nexports.ComponentFactory = ComponentFactory;\nexports.ComponentRef = ComponentRef;\nexports.ComponentFactoryResolver = ComponentFactoryResolver;\nexports.ElementRef = ElementRef;\nexports.NgModuleFactory = NgModuleFactory;\nexports.NgModuleRef = NgModuleRef;\nexports.NgModuleFactoryLoader = NgModuleFactoryLoader;\nexports.getModuleFactory = getModuleFactory;\nexports.QueryList = QueryList;\nexports.SystemJsNgModuleLoader = SystemJsNgModuleLoader;\nexports.SystemJsNgModuleLoaderConfig = SystemJsNgModuleLoaderConfig;\nexports.TemplateRef = TemplateRef;\nexports.ViewContainerRef = ViewContainerRef;\nexports.EmbeddedViewRef = EmbeddedViewRef;\nexports.ViewRef = ViewRef;\nexports.ChangeDetectionStrategy = ChangeDetectionStrategy;\nexports.ChangeDetectorRef = ChangeDetectorRef;\nexports.DefaultIterableDiffer = DefaultIterableDiffer;\nexports.IterableDiffers = IterableDiffers;\nexports.KeyValueDiffers = KeyValueDiffers;\nexports.SimpleChange = SimpleChange;\nexports.WrappedValue = WrappedValue;\nexports.platformCore = platformCore;\nexports.ɵALLOW_MULTIPLE_PLATFORMS = ALLOW_MULTIPLE_PLATFORMS;\nexports.ɵAPP_ID_RANDOM_PROVIDER = APP_ID_RANDOM_PROVIDER;\nexports.ɵValueUnwrapper = ValueUnwrapper;\nexports.ɵdevModeEqual = devModeEqual;\nexports.ɵisListLikeIterable = isListLikeIterable;\nexports.ɵChangeDetectorStatus = ChangeDetectorStatus;\nexports.ɵisDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy;\nexports.ɵConsole = Console;\nexports.ɵERROR_COMPONENT_TYPE = ERROR_COMPONENT_TYPE;\nexports.ɵComponentFactory = ComponentFactory;\nexports.ɵCodegenComponentFactoryResolver = CodegenComponentFactoryResolver;\nexports.ɵViewMetadata = ViewMetadata;\nexports.ɵReflectionCapabilities = ReflectionCapabilities;\nexports.ɵRenderDebugInfo = RenderDebugInfo;\nexports.ɵglobal = _global;\nexports.ɵlooseIdentical = looseIdentical;\nexports.ɵstringify = stringify;\nexports.ɵmakeDecorator = makeDecorator;\nexports.ɵisObservable = isObservable;\nexports.ɵisPromise = isPromise;\nexports.ɵclearProviderOverrides = clearProviderOverrides;\nexports.ɵoverrideProvider = overrideProvider;\nexports.ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR;\nexports.ɵregisterModuleFactory = registerModuleFactory;\nexports.ɵEMPTY_ARRAY = EMPTY_ARRAY;\nexports.ɵEMPTY_MAP = EMPTY_MAP;\nexports.ɵand = anchorDef;\nexports.ɵccf = createComponentFactory;\nexports.ɵcmf = createNgModuleFactory;\nexports.ɵcrt = createRendererType2;\nexports.ɵdid = directiveDef;\nexports.ɵeld = elementDef;\nexports.ɵelementEventFullName = elementEventFullName;\nexports.ɵgetComponentViewDefinitionFactory = getComponentViewDefinitionFactory;\nexports.ɵinlineInterpolate = inlineInterpolate;\nexports.ɵinterpolate = interpolate;\nexports.ɵmod = moduleDef;\nexports.ɵmpd = moduleProvideDef;\nexports.ɵncd = ngContentDef;\nexports.ɵnov = nodeValue;\nexports.ɵpid = pipeDef;\nexports.ɵprd = providerDef;\nexports.ɵpad = pureArrayDef;\nexports.ɵpod = pureObjectDef;\nexports.ɵppd = purePipeDef;\nexports.ɵqud = queryDef;\nexports.ɵted = textDef;\nexports.ɵunv = unwrapValue;\nexports.ɵvid = viewDef;\nexports.AUTO_STYLE = AUTO_STYLE$$1;\nexports.trigger = trigger$$1;\nexports.animate = animate$$1;\nexports.group = group$$1;\nexports.sequence = sequence$$1;\nexports.style = style$$1;\nexports.state = state$$1;\nexports.keyframes = keyframes$$1;\nexports.transition = transition$$1;\nexports.ɵx = animate$1;\nexports.ɵy = group$1;\nexports.ɵbc = keyframes$1;\nexports.ɵz = sequence$1;\nexports.ɵbb = state$1;\nexports.ɵba = style$1;\nexports.ɵbd = transition$1;\nexports.ɵw = trigger$1;\nexports.ɵk = _iterableDiffersFactory;\nexports.ɵl = _keyValueDiffersFactory;\nexports.ɵm = _localeFactory;\nexports.ɵe = ApplicationRef_;\nexports.ɵf = _appIdRandomProviderFactory;\nexports.ɵg = defaultIterableDiffers;\nexports.ɵh = defaultKeyValueDiffers;\nexports.ɵi = DefaultIterableDifferFactory;\nexports.ɵj = DefaultKeyValueDifferFactory;\nexports.ɵb = ReflectiveInjector_;\nexports.ɵc = ReflectiveDependency;\nexports.ɵd = resolveReflectiveProviders;\nexports.ɵn = wtfEnabled;\nexports.ɵp = createScope$1;\nexports.ɵo = detectWTF;\nexports.ɵs = endTimeRange;\nexports.ɵq = leave;\nexports.ɵr = startTimeRange;\nexports.ɵa = makeParamDecorator;\nexports.ɵt = _def;\nexports.ɵu = DebugContext;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=core.umd.js.map\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', '@angular/core'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.common = global.ng.common || {}),global.ng.core));\n}(this, (function (exports,_angular_core) { 'use strict';\n\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = Object.setPrototypeOf ||\n    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n    function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n\nfunction __extends(d, b) {\n    extendStatics(d, b);\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * This class should not be used directly by an application developer. Instead, use\n * {\\@link Location}.\n *\n * `PlatformLocation` encapsulates all calls to DOM apis, which allows the Router to be platform\n * agnostic.\n * This means that we can have different implementation of `PlatformLocation` for the different\n * platforms that angular supports. For example, `\\@angular/platform-browser` provides an\n * implementation specific to the browser environment, while `\\@angular/platform-webworker` provides\n * one suitable for use with web workers.\n *\n * The `PlatformLocation` class is used directly by all implementations of {\\@link LocationStrategy}\n * when they need to interact with the DOM apis like pushState, popState, etc...\n *\n * {\\@link LocationStrategy} in turn is used by the {\\@link Location} service which is used directly\n * by the {\\@link Router} in order to navigate between routes. Since all interactions between {\\@link\n * Router} /\n * {\\@link Location} / {\\@link LocationStrategy} and DOM apis flow through the `PlatformLocation`\n * class they are all platform independent.\n *\n * \\@stable\n * @abstract\n */\nvar PlatformLocation = (function () {\n    function PlatformLocation() {\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformLocation.prototype.getBaseHrefFromDOM = function () { };\n    /**\n     * @abstract\n     * @param {?} fn\n     * @return {?}\n     */\n    PlatformLocation.prototype.onPopState = function (fn) { };\n    /**\n     * @abstract\n     * @param {?} fn\n     * @return {?}\n     */\n    PlatformLocation.prototype.onHashChange = function (fn) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformLocation.prototype.pathname = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformLocation.prototype.search = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformLocation.prototype.hash = function () { };\n    /**\n     * @abstract\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @return {?}\n     */\n    PlatformLocation.prototype.replaceState = function (state, title, url) { };\n    /**\n     * @abstract\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @return {?}\n     */\n    PlatformLocation.prototype.pushState = function (state, title, url) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformLocation.prototype.forward = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    PlatformLocation.prototype.back = function () { };\n    return PlatformLocation;\n}());\n/**\n * \\@whatItDoes indicates when a location is initialized\n * \\@experimental\n */\nvar LOCATION_INITIALIZED = new _angular_core.InjectionToken('Location Initialized');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * `LocationStrategy` is responsible for representing and reading route state\n * from the browser's URL. Angular provides two strategies:\n * {\\@link HashLocationStrategy} and {\\@link PathLocationStrategy}.\n *\n * This is used under the hood of the {\\@link Location} service.\n *\n * Applications should use the {\\@link Router} or {\\@link Location} services to\n * interact with application route state.\n *\n * For instance, {\\@link HashLocationStrategy} produces URLs like\n * `http://example.com#/foo`, and {\\@link PathLocationStrategy} produces\n * `http://example.com/foo` as an equivalent URL.\n *\n * See these two classes for more.\n *\n * \\@stable\n * @abstract\n */\nvar LocationStrategy = (function () {\n    function LocationStrategy() {\n    }\n    /**\n     * @abstract\n     * @param {?=} includeHash\n     * @return {?}\n     */\n    LocationStrategy.prototype.path = function (includeHash) { };\n    /**\n     * @abstract\n     * @param {?} internal\n     * @return {?}\n     */\n    LocationStrategy.prototype.prepareExternalUrl = function (internal) { };\n    /**\n     * @abstract\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @param {?} queryParams\n     * @return {?}\n     */\n    LocationStrategy.prototype.pushState = function (state, title, url, queryParams) { };\n    /**\n     * @abstract\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @param {?} queryParams\n     * @return {?}\n     */\n    LocationStrategy.prototype.replaceState = function (state, title, url, queryParams) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    LocationStrategy.prototype.forward = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    LocationStrategy.prototype.back = function () { };\n    /**\n     * @abstract\n     * @param {?} fn\n     * @return {?}\n     */\n    LocationStrategy.prototype.onPopState = function (fn) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    LocationStrategy.prototype.getBaseHref = function () { };\n    return LocationStrategy;\n}());\n/**\n * The `APP_BASE_HREF` token represents the base href to be used with the\n * {\\@link PathLocationStrategy}.\n *\n * If you're using {\\@link PathLocationStrategy}, you must provide a provider to a string\n * representing the URL prefix that should be preserved when generating and recognizing\n * URLs.\n *\n * ### Example\n *\n * ```typescript\n * import {Component, NgModule} from '\\@angular/core';\n * import {APP_BASE_HREF} from '\\@angular/common';\n *\n * \\@NgModule({\n *   providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n * })\n * class AppModule {}\n * ```\n *\n * \\@stable\n */\nvar APP_BASE_HREF = new _angular_core.InjectionToken('appBaseHref');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@whatItDoes `Location` is a service that applications can use to interact with a browser's URL.\n * \\@description\n * Depending on which {\\@link LocationStrategy} is used, `Location` will either persist\n * to the URL's path or the URL's hash segment.\n *\n * Note: it's better to use {\\@link Router#navigate} service to trigger route changes. Use\n * `Location` only if you need to interact with or create normalized URLs outside of\n * routing.\n *\n * `Location` is responsible for normalizing the URL against the application's base href.\n * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n * trailing slash:\n * - `/my/app/user/123` is normalized\n * - `my/app/user/123` **is not** normalized\n * - `/my/app/user/123/` **is not** normalized\n *\n * ### Example\n * {\\@example common/location/ts/path_location_component.ts region='LocationComponent'}\n * \\@stable\n */\nvar Location = (function () {\n    /**\n     * @param {?} platformStrategy\n     */\n    function Location(platformStrategy) {\n        var _this = this;\n        /**\n         * \\@internal\n         */\n        this._subject = new _angular_core.EventEmitter();\n        this._platformStrategy = platformStrategy;\n        var browserBaseHref = this._platformStrategy.getBaseHref();\n        this._baseHref = Location.stripTrailingSlash(_stripIndexHtml(browserBaseHref));\n        this._platformStrategy.onPopState(function (ev) {\n            _this._subject.emit({\n                'url': _this.path(true),\n                'pop': true,\n                'type': ev.type,\n            });\n        });\n    }\n    /**\n     * @param {?=} includeHash\n     * @return {?}\n     */\n    Location.prototype.path = function (includeHash) {\n        if (includeHash === void 0) { includeHash = false; }\n        return this.normalize(this._platformStrategy.path(includeHash));\n    };\n    /**\n     * Normalizes the given path and compares to the current normalized path.\n     * @param {?} path\n     * @param {?=} query\n     * @return {?}\n     */\n    Location.prototype.isCurrentPathEqualTo = function (path, query) {\n        if (query === void 0) { query = ''; }\n        return this.path() == this.normalize(path + Location.normalizeQueryParams(query));\n    };\n    /**\n     * Given a string representing a URL, returns the normalized URL path without leading or\n     * trailing slashes.\n     * @param {?} url\n     * @return {?}\n     */\n    Location.prototype.normalize = function (url) {\n        return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));\n    };\n    /**\n     * Given a string representing a URL, returns the platform-specific external URL path.\n     * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one\n     * before normalizing. This method will also add a hash if `HashLocationStrategy` is\n     * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n     * @param {?} url\n     * @return {?}\n     */\n    Location.prototype.prepareExternalUrl = function (url) {\n        if (url && url[0] !== '/') {\n            url = '/' + url;\n        }\n        return this._platformStrategy.prepareExternalUrl(url);\n    };\n    /**\n     * Changes the browsers URL to the normalized version of the given URL, and pushes a\n     * new item onto the platform's history.\n     * @param {?} path\n     * @param {?=} query\n     * @return {?}\n     */\n    Location.prototype.go = function (path, query) {\n        if (query === void 0) { query = ''; }\n        this._platformStrategy.pushState(null, '', path, query);\n    };\n    /**\n     * Changes the browsers URL to the normalized version of the given URL, and replaces\n     * the top item on the platform's history stack.\n     * @param {?} path\n     * @param {?=} query\n     * @return {?}\n     */\n    Location.prototype.replaceState = function (path, query) {\n        if (query === void 0) { query = ''; }\n        this._platformStrategy.replaceState(null, '', path, query);\n    };\n    /**\n     * Navigates forward in the platform's history.\n     * @return {?}\n     */\n    Location.prototype.forward = function () { this._platformStrategy.forward(); };\n    /**\n     * Navigates back in the platform's history.\n     * @return {?}\n     */\n    Location.prototype.back = function () { this._platformStrategy.back(); };\n    /**\n     * Subscribe to the platform's `popState` events.\n     * @param {?} onNext\n     * @param {?=} onThrow\n     * @param {?=} onReturn\n     * @return {?}\n     */\n    Location.prototype.subscribe = function (onNext, onThrow, onReturn) {\n        return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });\n    };\n    /**\n     * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as\n     * is.\n     * @param {?} params\n     * @return {?}\n     */\n    Location.normalizeQueryParams = function (params) {\n        return params && params[0] !== '?' ? '?' + params : params;\n    };\n    /**\n     * Given 2 parts of a url, join them with a slash if needed.\n     * @param {?} start\n     * @param {?} end\n     * @return {?}\n     */\n    Location.joinWithSlash = function (start, end) {\n        if (start.length == 0) {\n            return end;\n        }\n        if (end.length == 0) {\n            return start;\n        }\n        var /** @type {?} */ slashes = 0;\n        if (start.endsWith('/')) {\n            slashes++;\n        }\n        if (end.startsWith('/')) {\n            slashes++;\n        }\n        if (slashes == 2) {\n            return start + end.substring(1);\n        }\n        if (slashes == 1) {\n            return start + end;\n        }\n        return start + '/' + end;\n    };\n    /**\n     * If url has a trailing slash, remove it, otherwise return url as is. This\n     * method looks for the first occurence of either #, ?, or the end of the\n     * line as `/` characters after any of these should not be replaced.\n     * @param {?} url\n     * @return {?}\n     */\n    Location.stripTrailingSlash = function (url) {\n        var /** @type {?} */ match = url.match(/#|\\?|$/);\n        var /** @type {?} */ pathEndIdx = match && match.index || url.length;\n        var /** @type {?} */ droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n        return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n    };\n    return Location;\n}());\nLocation.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nLocation.ctorParameters = function () { return [\n    { type: LocationStrategy, },\n]; };\n/**\n * @param {?} baseHref\n * @param {?} url\n * @return {?}\n */\nfunction _stripBaseHref(baseHref, url) {\n    return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;\n}\n/**\n * @param {?} url\n * @return {?}\n */\nfunction _stripIndexHtml(url) {\n    return url.replace(/\\/index.html$/, '');\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@whatItDoes Use URL hash for storing application location data.\n * \\@description\n * `HashLocationStrategy` is a {\\@link LocationStrategy} used to configure the\n * {\\@link Location} service to represent its state in the\n * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)\n * of the browser's URL.\n *\n * For instance, if you call `location.go('/foo')`, the browser's URL will become\n * `example.com#/foo`.\n *\n * ### Example\n *\n * {\\@example common/location/ts/hash_location_component.ts region='LocationComponent'}\n *\n * \\@stable\n */\nvar HashLocationStrategy = (function (_super) {\n    __extends(HashLocationStrategy, _super);\n    /**\n     * @param {?} _platformLocation\n     * @param {?=} _baseHref\n     */\n    function HashLocationStrategy(_platformLocation, _baseHref) {\n        var _this = _super.call(this) || this;\n        _this._platformLocation = _platformLocation;\n        _this._baseHref = '';\n        if (_baseHref != null) {\n            _this._baseHref = _baseHref;\n        }\n        return _this;\n    }\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.onPopState = function (fn) {\n        this._platformLocation.onPopState(fn);\n        this._platformLocation.onHashChange(fn);\n    };\n    /**\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.getBaseHref = function () { return this._baseHref; };\n    /**\n     * @param {?=} includeHash\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.path = function (includeHash) {\n        if (includeHash === void 0) { includeHash = false; }\n        // the hash value is always prefixed with a `#`\n        // and if it is empty then it will stay empty\n        var /** @type {?} */ path = this._platformLocation.hash;\n        if (path == null)\n            path = '#';\n        return path.length > 0 ? path.substring(1) : path;\n    };\n    /**\n     * @param {?} internal\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.prepareExternalUrl = function (internal) {\n        var /** @type {?} */ url = Location.joinWithSlash(this._baseHref, internal);\n        return url.length > 0 ? ('#' + url) : url;\n    };\n    /**\n     * @param {?} state\n     * @param {?} title\n     * @param {?} path\n     * @param {?} queryParams\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.pushState = function (state, title, path, queryParams) {\n        var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));\n        if (url.length == 0) {\n            url = this._platformLocation.pathname;\n        }\n        this._platformLocation.pushState(state, title, url);\n    };\n    /**\n     * @param {?} state\n     * @param {?} title\n     * @param {?} path\n     * @param {?} queryParams\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.replaceState = function (state, title, path, queryParams) {\n        var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));\n        if (url.length == 0) {\n            url = this._platformLocation.pathname;\n        }\n        this._platformLocation.replaceState(state, title, url);\n    };\n    /**\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.forward = function () { this._platformLocation.forward(); };\n    /**\n     * @return {?}\n     */\n    HashLocationStrategy.prototype.back = function () { this._platformLocation.back(); };\n    return HashLocationStrategy;\n}(LocationStrategy));\nHashLocationStrategy.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nHashLocationStrategy.ctorParameters = function () { return [\n    { type: PlatformLocation, },\n    { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [APP_BASE_HREF,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@whatItDoes Use URL for storing application location data.\n * \\@description\n * `PathLocationStrategy` is a {\\@link LocationStrategy} used to configure the\n * {\\@link Location} service to represent its state in the\n * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n * browser's URL.\n *\n * If you're using `PathLocationStrategy`, you must provide a {\\@link APP_BASE_HREF}\n * or add a base element to the document. This URL prefix that will be preserved\n * when generating and recognizing URLs.\n *\n * For instance, if you provide an `APP_BASE_HREF` of `'/my/app'` and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * Similarly, if you add `<base href='/my/app'/>` to the document and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * ### Example\n *\n * {\\@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * \\@stable\n */\nvar PathLocationStrategy = (function (_super) {\n    __extends(PathLocationStrategy, _super);\n    /**\n     * @param {?} _platformLocation\n     * @param {?=} href\n     */\n    function PathLocationStrategy(_platformLocation, href) {\n        var _this = _super.call(this) || this;\n        _this._platformLocation = _platformLocation;\n        if (href == null) {\n            href = _this._platformLocation.getBaseHrefFromDOM();\n        }\n        if (href == null) {\n            throw new Error(\"No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.\");\n        }\n        _this._baseHref = href;\n        return _this;\n    }\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.onPopState = function (fn) {\n        this._platformLocation.onPopState(fn);\n        this._platformLocation.onHashChange(fn);\n    };\n    /**\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.getBaseHref = function () { return this._baseHref; };\n    /**\n     * @param {?} internal\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.prepareExternalUrl = function (internal) {\n        return Location.joinWithSlash(this._baseHref, internal);\n    };\n    /**\n     * @param {?=} includeHash\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.path = function (includeHash) {\n        if (includeHash === void 0) { includeHash = false; }\n        var /** @type {?} */ pathname = this._platformLocation.pathname +\n            Location.normalizeQueryParams(this._platformLocation.search);\n        var /** @type {?} */ hash = this._platformLocation.hash;\n        return hash && includeHash ? \"\" + pathname + hash : pathname;\n    };\n    /**\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @param {?} queryParams\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.pushState = function (state, title, url, queryParams) {\n        var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));\n        this._platformLocation.pushState(state, title, externalUrl);\n    };\n    /**\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @param {?} queryParams\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.replaceState = function (state, title, url, queryParams) {\n        var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));\n        this._platformLocation.replaceState(state, title, externalUrl);\n    };\n    /**\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.forward = function () { this._platformLocation.forward(); };\n    /**\n     * @return {?}\n     */\n    PathLocationStrategy.prototype.back = function () { this._platformLocation.back(); };\n    return PathLocationStrategy;\n}(LocationStrategy));\nPathLocationStrategy.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nPathLocationStrategy.ctorParameters = function () { return [\n    { type: PlatformLocation, },\n    { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [APP_BASE_HREF,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@experimental\n * @abstract\n */\nvar NgLocalization = (function () {\n    function NgLocalization() {\n    }\n    /**\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    NgLocalization.prototype.getPluralCategory = function (value) { };\n    return NgLocalization;\n}());\n/**\n * Returns the plural category for a given value.\n * - \"=value\" when the case exists,\n * - the plural category otherwise\n *\n * \\@internal\n * @param {?} value\n * @param {?} cases\n * @param {?} ngLocalization\n * @return {?}\n */\nfunction getPluralCategory(value, cases, ngLocalization) {\n    var /** @type {?} */ key = \"=\" + value;\n    if (cases.indexOf(key) > -1) {\n        return key;\n    }\n    key = ngLocalization.getPluralCategory(value);\n    if (cases.indexOf(key) > -1) {\n        return key;\n    }\n    if (cases.indexOf('other') > -1) {\n        return 'other';\n    }\n    throw new Error(\"No plural message found for value \\\"\" + value + \"\\\"\");\n}\n/**\n * Returns the plural case based on the locale\n *\n * \\@experimental\n */\nvar NgLocaleLocalization = (function (_super) {\n    __extends(NgLocaleLocalization, _super);\n    /**\n     * @param {?} locale\n     */\n    function NgLocaleLocalization(locale) {\n        var _this = _super.call(this) || this;\n        _this.locale = locale;\n        return _this;\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    NgLocaleLocalization.prototype.getPluralCategory = function (value) {\n        var /** @type {?} */ plural = getPluralCase(this.locale, value);\n        switch (plural) {\n            case Plural.Zero:\n                return 'zero';\n            case Plural.One:\n                return 'one';\n            case Plural.Two:\n                return 'two';\n            case Plural.Few:\n                return 'few';\n            case Plural.Many:\n                return 'many';\n            default:\n                return 'other';\n        }\n    };\n    return NgLocaleLocalization;\n}(NgLocalization));\nNgLocaleLocalization.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nNgLocaleLocalization.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_core.LOCALE_ID,] },] },\n]; };\nvar Plural = {};\nPlural.Zero = 0;\nPlural.One = 1;\nPlural.Two = 2;\nPlural.Few = 3;\nPlural.Many = 4;\nPlural.Other = 5;\nPlural[Plural.Zero] = \"Zero\";\nPlural[Plural.One] = \"One\";\nPlural[Plural.Two] = \"Two\";\nPlural[Plural.Few] = \"Few\";\nPlural[Plural.Many] = \"Many\";\nPlural[Plural.Other] = \"Other\";\n/**\n * Returns the plural case based on the locale\n *\n * \\@experimental\n * @param {?} locale\n * @param {?} nLike\n * @return {?}\n */\nfunction getPluralCase(locale, nLike) {\n    // TODO(vicb): lazy compute\n    if (typeof nLike === 'string') {\n        nLike = parseInt(/** @type {?} */ (nLike), 10);\n    }\n    var /** @type {?} */ n = (nLike);\n    var /** @type {?} */ nDecimal = n.toString().replace(/^[^.]*\\.?/, '');\n    var /** @type {?} */ i = Math.floor(Math.abs(n));\n    var /** @type {?} */ v = nDecimal.length;\n    var /** @type {?} */ f = parseInt(nDecimal, 10);\n    var /** @type {?} */ t = parseInt(n.toString().replace(/^[^.]*\\.?|0+$/g, ''), 10) || 0;\n    var /** @type {?} */ lang = locale.split('-')[0].toLowerCase();\n    switch (lang) {\n        case 'af':\n        case 'asa':\n        case 'az':\n        case 'bem':\n        case 'bez':\n        case 'bg':\n        case 'brx':\n        case 'ce':\n        case 'cgg':\n        case 'chr':\n        case 'ckb':\n        case 'ee':\n        case 'el':\n        case 'eo':\n        case 'es':\n        case 'eu':\n        case 'fo':\n        case 'fur':\n        case 'gsw':\n        case 'ha':\n        case 'haw':\n        case 'hu':\n        case 'jgo':\n        case 'jmc':\n        case 'ka':\n        case 'kk':\n        case 'kkj':\n        case 'kl':\n        case 'ks':\n        case 'ksb':\n        case 'ky':\n        case 'lb':\n        case 'lg':\n        case 'mas':\n        case 'mgo':\n        case 'ml':\n        case 'mn':\n        case 'nb':\n        case 'nd':\n        case 'ne':\n        case 'nn':\n        case 'nnh':\n        case 'nyn':\n        case 'om':\n        case 'or':\n        case 'os':\n        case 'ps':\n        case 'rm':\n        case 'rof':\n        case 'rwk':\n        case 'saq':\n        case 'seh':\n        case 'sn':\n        case 'so':\n        case 'sq':\n        case 'ta':\n        case 'te':\n        case 'teo':\n        case 'tk':\n        case 'tr':\n        case 'ug':\n        case 'uz':\n        case 'vo':\n        case 'vun':\n        case 'wae':\n        case 'xog':\n            if (n === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'ak':\n        case 'ln':\n        case 'mg':\n        case 'pa':\n        case 'ti':\n            if (n === Math.floor(n) && n >= 0 && n <= 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'am':\n        case 'as':\n        case 'bn':\n        case 'fa':\n        case 'gu':\n        case 'hi':\n        case 'kn':\n        case 'mr':\n        case 'zu':\n            if (i === 0 || n === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'ar':\n            if (n === 0)\n                return Plural.Zero;\n            if (n === 1)\n                return Plural.One;\n            if (n === 2)\n                return Plural.Two;\n            if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10)\n                return Plural.Few;\n            if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99)\n                return Plural.Many;\n            return Plural.Other;\n        case 'ast':\n        case 'ca':\n        case 'de':\n        case 'en':\n        case 'et':\n        case 'fi':\n        case 'fy':\n        case 'gl':\n        case 'it':\n        case 'nl':\n        case 'sv':\n        case 'sw':\n        case 'ur':\n        case 'yi':\n            if (i === 1 && v === 0)\n                return Plural.One;\n            return Plural.Other;\n        case 'be':\n            if (n % 10 === 1 && !(n % 100 === 11))\n                return Plural.One;\n            if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&\n                !(n % 100 >= 12 && n % 100 <= 14))\n                return Plural.Few;\n            if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||\n                n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)\n                return Plural.Many;\n            return Plural.Other;\n        case 'br':\n            if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91))\n                return Plural.One;\n            if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92))\n                return Plural.Two;\n            if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&\n                !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||\n                    n % 100 >= 90 && n % 100 <= 99))\n                return Plural.Few;\n            if (!(n === 0) && n % 1e6 === 0)\n                return Plural.Many;\n            return Plural.Other;\n        case 'bs':\n        case 'hr':\n        case 'sr':\n            if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))\n                return Plural.One;\n            if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n                !(i % 100 >= 12 && i % 100 <= 14) ||\n                f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&\n                    !(f % 100 >= 12 && f % 100 <= 14))\n                return Plural.Few;\n            return Plural.Other;\n        case 'cs':\n        case 'sk':\n            if (i === 1 && v === 0)\n                return Plural.One;\n            if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0)\n                return Plural.Few;\n            if (!(v === 0))\n                return Plural.Many;\n            return Plural.Other;\n        case 'cy':\n            if (n === 0)\n                return Plural.Zero;\n            if (n === 1)\n                return Plural.One;\n            if (n === 2)\n                return Plural.Two;\n            if (n === 3)\n                return Plural.Few;\n            if (n === 6)\n                return Plural.Many;\n            return Plural.Other;\n        case 'da':\n            if (n === 1 || !(t === 0) && (i === 0 || i === 1))\n                return Plural.One;\n            return Plural.Other;\n        case 'dsb':\n        case 'hsb':\n            if (v === 0 && i % 100 === 1 || f % 100 === 1)\n                return Plural.One;\n            if (v === 0 && i % 100 === 2 || f % 100 === 2)\n                return Plural.Two;\n            if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||\n                f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)\n                return Plural.Few;\n            return Plural.Other;\n        case 'ff':\n        case 'fr':\n        case 'hy':\n        case 'kab':\n            if (i === 0 || i === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'fil':\n            if (v === 0 && (i === 1 || i === 2 || i === 3) ||\n                v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||\n                !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))\n                return Plural.One;\n            return Plural.Other;\n        case 'ga':\n            if (n === 1)\n                return Plural.One;\n            if (n === 2)\n                return Plural.Two;\n            if (n === Math.floor(n) && n >= 3 && n <= 6)\n                return Plural.Few;\n            if (n === Math.floor(n) && n >= 7 && n <= 10)\n                return Plural.Many;\n            return Plural.Other;\n        case 'gd':\n            if (n === 1 || n === 11)\n                return Plural.One;\n            if (n === 2 || n === 12)\n                return Plural.Two;\n            if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19))\n                return Plural.Few;\n            return Plural.Other;\n        case 'gv':\n            if (v === 0 && i % 10 === 1)\n                return Plural.One;\n            if (v === 0 && i % 10 === 2)\n                return Plural.Two;\n            if (v === 0 &&\n                (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))\n                return Plural.Few;\n            if (!(v === 0))\n                return Plural.Many;\n            return Plural.Other;\n        case 'he':\n            if (i === 1 && v === 0)\n                return Plural.One;\n            if (i === 2 && v === 0)\n                return Plural.Two;\n            if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0)\n                return Plural.Many;\n            return Plural.Other;\n        case 'is':\n            if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0))\n                return Plural.One;\n            return Plural.Other;\n        case 'ksh':\n            if (n === 0)\n                return Plural.Zero;\n            if (n === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'kw':\n        case 'naq':\n        case 'se':\n        case 'smn':\n            if (n === 1)\n                return Plural.One;\n            if (n === 2)\n                return Plural.Two;\n            return Plural.Other;\n        case 'lag':\n            if (n === 0)\n                return Plural.Zero;\n            if ((i === 0 || i === 1) && !(n === 0))\n                return Plural.One;\n            return Plural.Other;\n        case 'lt':\n            if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19))\n                return Plural.One;\n            if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&\n                !(n % 100 >= 11 && n % 100 <= 19))\n                return Plural.Few;\n            if (!(f === 0))\n                return Plural.Many;\n            return Plural.Other;\n        case 'lv':\n        case 'prg':\n            if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||\n                v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)\n                return Plural.Zero;\n            if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||\n                !(v === 2) && f % 10 === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'mk':\n            if (v === 0 && i % 10 === 1 || f % 10 === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'mt':\n            if (n === 1)\n                return Plural.One;\n            if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)\n                return Plural.Few;\n            if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19)\n                return Plural.Many;\n            return Plural.Other;\n        case 'pl':\n            if (i === 1 && v === 0)\n                return Plural.One;\n            if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n                !(i % 100 >= 12 && i % 100 <= 14))\n                return Plural.Few;\n            if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||\n                v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n                v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)\n                return Plural.Many;\n            return Plural.Other;\n        case 'pt':\n            if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2))\n                return Plural.One;\n            return Plural.Other;\n        case 'ro':\n            if (i === 1 && v === 0)\n                return Plural.One;\n            if (!(v === 0) || n === 0 ||\n                !(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)\n                return Plural.Few;\n            return Plural.Other;\n        case 'ru':\n        case 'uk':\n            if (v === 0 && i % 10 === 1 && !(i % 100 === 11))\n                return Plural.One;\n            if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n                !(i % 100 >= 12 && i % 100 <= 14))\n                return Plural.Few;\n            if (v === 0 && i % 10 === 0 ||\n                v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n                v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)\n                return Plural.Many;\n            return Plural.Other;\n        case 'shi':\n            if (i === 0 || n === 1)\n                return Plural.One;\n            if (n === Math.floor(n) && n >= 2 && n <= 10)\n                return Plural.Few;\n            return Plural.Other;\n        case 'si':\n            if (n === 0 || n === 1 || i === 0 && f === 1)\n                return Plural.One;\n            return Plural.Other;\n        case 'sl':\n            if (v === 0 && i % 100 === 1)\n                return Plural.One;\n            if (v === 0 && i % 100 === 2)\n                return Plural.Two;\n            if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))\n                return Plural.Few;\n            return Plural.Other;\n        case 'tzm':\n            if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)\n                return Plural.One;\n            return Plural.Other;\n        // When there is no specification, the default is always \"other\"\n        // Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules\n        // > other (required—general plural form — also used if the language only has a single form)\n        default:\n            return Plural.Other;\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds and removes CSS classes on an HTML element.\n *\n * \\@howToUse\n * ```\n *     <some-element [ngClass]=\"'first second'\">...</some-element>\n *\n *     <some-element [ngClass]=\"['first', 'second']\">...</some-element>\n *\n *     <some-element [ngClass]=\"{'first': true, 'second': true, 'third': false}\">...</some-element>\n *\n *     <some-element [ngClass]=\"stringExp|arrayExp|objExp\">...</some-element>\n *\n *     <some-element [ngClass]=\"{'class1 class2 class3' : true}\">...</some-element>\n * ```\n *\n * \\@description\n *\n * The CSS classes are updated as follows, depending on the type of the expression evaluation:\n * - `string` - the CSS classes listed in the string (space delimited) are added,\n * - `Array` - the CSS classes declared as Array elements are added,\n * - `Object` - keys are CSS classes that get added when the expression given in the value\n *              evaluates to a truthy value, otherwise they are removed.\n *\n * \\@stable\n */\nvar NgClass = (function () {\n    /**\n     * @param {?} _iterableDiffers\n     * @param {?} _keyValueDiffers\n     * @param {?} _ngEl\n     * @param {?} _renderer\n     */\n    function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {\n        this._iterableDiffers = _iterableDiffers;\n        this._keyValueDiffers = _keyValueDiffers;\n        this._ngEl = _ngEl;\n        this._renderer = _renderer;\n        this._initialClasses = [];\n    }\n    Object.defineProperty(NgClass.prototype, \"klass\", {\n        /**\n         * @param {?} v\n         * @return {?}\n         */\n        set: function (v) {\n            this._applyInitialClasses(true);\n            this._initialClasses = typeof v === 'string' ? v.split(/\\s+/) : [];\n            this._applyInitialClasses(false);\n            this._applyClasses(this._rawClass, false);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgClass.prototype, \"ngClass\", {\n        /**\n         * @param {?} v\n         * @return {?}\n         */\n        set: function (v) {\n            this._cleanupClasses(this._rawClass);\n            this._iterableDiffer = null;\n            this._keyValueDiffer = null;\n            this._rawClass = typeof v === 'string' ? v.split(/\\s+/) : v;\n            if (this._rawClass) {\n                if (_angular_core.ɵisListLikeIterable(this._rawClass)) {\n                    this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();\n                }\n                else {\n                    this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();\n                }\n            }\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    NgClass.prototype.ngDoCheck = function () {\n        if (this._iterableDiffer) {\n            var /** @type {?} */ iterableChanges = this._iterableDiffer.diff(/** @type {?} */ (this._rawClass));\n            if (iterableChanges) {\n                this._applyIterableChanges(iterableChanges);\n            }\n        }\n        else if (this._keyValueDiffer) {\n            var /** @type {?} */ keyValueChanges = this._keyValueDiffer.diff(/** @type {?} */ (this._rawClass));\n            if (keyValueChanges) {\n                this._applyKeyValueChanges(keyValueChanges);\n            }\n        }\n    };\n    /**\n     * @param {?} rawClassVal\n     * @return {?}\n     */\n    NgClass.prototype._cleanupClasses = function (rawClassVal) {\n        this._applyClasses(rawClassVal, true);\n        this._applyInitialClasses(false);\n    };\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgClass.prototype._applyKeyValueChanges = function (changes) {\n        var _this = this;\n        changes.forEachAddedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n        changes.forEachChangedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });\n        changes.forEachRemovedItem(function (record) {\n            if (record.previousValue) {\n                _this._toggleClass(record.key, false);\n            }\n        });\n    };\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgClass.prototype._applyIterableChanges = function (changes) {\n        var _this = this;\n        changes.forEachAddedItem(function (record) {\n            if (typeof record.item === 'string') {\n                _this._toggleClass(record.item, true);\n            }\n            else {\n                throw new Error(\"NgClass can only toggle CSS classes expressed as strings, got \" + _angular_core.ɵstringify(record.item));\n            }\n        });\n        changes.forEachRemovedItem(function (record) { return _this._toggleClass(record.item, false); });\n    };\n    /**\n     * @param {?} isCleanup\n     * @return {?}\n     */\n    NgClass.prototype._applyInitialClasses = function (isCleanup) {\n        var _this = this;\n        this._initialClasses.forEach(function (klass) { return _this._toggleClass(klass, !isCleanup); });\n    };\n    /**\n     * @param {?} rawClassVal\n     * @param {?} isCleanup\n     * @return {?}\n     */\n    NgClass.prototype._applyClasses = function (rawClassVal, isCleanup) {\n        var _this = this;\n        if (rawClassVal) {\n            if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n                ((rawClassVal)).forEach(function (klass) { return _this._toggleClass(klass, !isCleanup); });\n            }\n            else {\n                Object.keys(rawClassVal).forEach(function (klass) {\n                    if (rawClassVal[klass] != null)\n                        _this._toggleClass(klass, !isCleanup);\n                });\n            }\n        }\n    };\n    /**\n     * @param {?} klass\n     * @param {?} enabled\n     * @return {?}\n     */\n    NgClass.prototype._toggleClass = function (klass, enabled) {\n        var _this = this;\n        klass = klass.trim();\n        if (klass) {\n            klass.split(/\\s+/g).forEach(function (klass) { _this._renderer.setElementClass(_this._ngEl.nativeElement, klass, !!enabled); });\n        }\n    };\n    return NgClass;\n}());\nNgClass.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngClass]' },] },\n];\n/**\n * @nocollapse\n */\nNgClass.ctorParameters = function () { return [\n    { type: _angular_core.IterableDiffers, },\n    { type: _angular_core.KeyValueDiffers, },\n    { type: _angular_core.ElementRef, },\n    { type: _angular_core.Renderer, },\n]; };\nNgClass.propDecorators = {\n    'klass': [{ type: _angular_core.Input, args: ['class',] },],\n    'ngClass': [{ type: _angular_core.Input },],\n};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Instantiates a single {\\@link Component} type and inserts its Host View into current View.\n * `NgComponentOutlet` provides a declarative approach for dynamic component creation.\n *\n * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and\n * any existing component will get destroyed.\n *\n * ### Fine tune control\n *\n * You can control the component creation process by using the following optional attributes:\n *\n * * `ngComponentOutletInjector`: Optional custom {\\@link Injector} that will be used as parent for\n * the Component. Defaults to the injector of the current view container.\n *\n * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content\n * section of the component, if exists.\n *\n * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other\n * module, then load a component from that module.\n *\n * ### Syntax\n *\n * Simple\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression\"></ng-container>\n * ```\n *\n * Customized injector/content\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n *                                   injector: injectorExpression;\n *                                   content: contentNodesExpression;\">\n * </ng-container>\n * ```\n *\n * Customized ngModuleFactory\n * ```\n * <ng-container *ngComponentOutlet=\"componentTypeExpression;\n *                                   ngModuleFactory: moduleFactory;\">\n * </ng-container>\n * ```\n * ## Example\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}\n *\n * A more complete example with additional options:\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}\n * A more complete example with ngModuleFactory:\n *\n * {\\@example common/ngComponentOutlet/ts/module.ts region='NgModuleFactoryExample'}\n *\n * \\@experimental\n */\nvar NgComponentOutlet = (function () {\n    /**\n     * @param {?} _viewContainerRef\n     */\n    function NgComponentOutlet(_viewContainerRef) {\n        this._viewContainerRef = _viewContainerRef;\n        this._componentRef = null;\n        this._moduleRef = null;\n    }\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgComponentOutlet.prototype.ngOnChanges = function (changes) {\n        this._viewContainerRef.clear();\n        this._componentRef = null;\n        if (this.ngComponentOutlet) {\n            var /** @type {?} */ elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;\n            if (changes['ngComponentOutletNgModuleFactory']) {\n                if (this._moduleRef)\n                    this._moduleRef.destroy();\n                if (this.ngComponentOutletNgModuleFactory) {\n                    var /** @type {?} */ parentModule = elInjector.get(_angular_core.NgModuleRef);\n                    this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);\n                }\n                else {\n                    this._moduleRef = null;\n                }\n            }\n            var /** @type {?} */ componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :\n                elInjector.get(_angular_core.ComponentFactoryResolver);\n            var /** @type {?} */ componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);\n            this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    NgComponentOutlet.prototype.ngOnDestroy = function () {\n        if (this._moduleRef)\n            this._moduleRef.destroy();\n    };\n    return NgComponentOutlet;\n}());\nNgComponentOutlet.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngComponentOutlet]' },] },\n];\n/**\n * @nocollapse\n */\nNgComponentOutlet.ctorParameters = function () { return [\n    { type: _angular_core.ViewContainerRef, },\n]; };\nNgComponentOutlet.propDecorators = {\n    'ngComponentOutlet': [{ type: _angular_core.Input },],\n    'ngComponentOutletInjector': [{ type: _angular_core.Input },],\n    'ngComponentOutletContent': [{ type: _angular_core.Input },],\n    'ngComponentOutletNgModuleFactory': [{ type: _angular_core.Input },],\n};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@stable\n */\nvar NgForOfContext = (function () {\n    /**\n     * @param {?} $implicit\n     * @param {?} ngForOf\n     * @param {?} index\n     * @param {?} count\n     */\n    function NgForOfContext($implicit, ngForOf, index, count) {\n        this.$implicit = $implicit;\n        this.ngForOf = ngForOf;\n        this.index = index;\n        this.count = count;\n    }\n    Object.defineProperty(NgForOfContext.prototype, \"first\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.index === 0; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgForOfContext.prototype, \"last\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.index === this.count - 1; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgForOfContext.prototype, \"even\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.index % 2 === 0; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgForOfContext.prototype, \"odd\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return !this.even; },\n        enumerable: true,\n        configurable: true\n    });\n    return NgForOfContext;\n}());\n/**\n * The `NgForOf` directive instantiates a template once per item from an iterable. The context\n * for each instantiated template inherits from the outer context with the given loop variable\n * set to the current item from the iterable.\n *\n * ### Local Variables\n *\n * `NgForOf` provides several exported values that can be aliased to local variables:\n *\n * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).\n * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is\n * more complex then a property access, for example when using the async pipe (`userStreams |\n * async`).\n * - `index: number`: The index of the current item in the iterable.\n * - `first: boolean`: True when the item is the first item in the iterable.\n * - `last: boolean`: True when the item is the last item in the iterable.\n * - `even: boolean`: True when the item has an even index in the iterable.\n * - `odd: boolean`: True when the item has an odd index in the iterable.\n *\n * ```\n * <li *ngFor=\"let user of userObservable | async as users; index as i; first as isFirst\">\n *    {{i}}/{{users.length}}. {{user}} <span *ngIf=\"isFirst\">default</span>\n * </li>\n * ```\n *\n * ### Change Propagation\n *\n * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n * * Otherwise, the DOM element for that item will remain the same.\n *\n * Angular uses object identity to track insertions and deletions within the iterator and reproduce\n * those changes in the DOM. This has important implications for animations and any stateful\n * controls (such as `<input>` elements which accept user input) that are present. Inserted rows can\n * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state\n * such as user input.\n *\n * It is possible for the identities of elements in the iterator to change while the data does not.\n * This can happen, for example, if the iterator produced from an RPC to the server, and that\n * RPC is re-run. Even if the data hasn't changed, the second response will produce objects with\n * different identities, and Angular will tear down the entire DOM and rebuild it (as if all old\n * elements were deleted and all new elements inserted). This is an expensive operation and should\n * be avoided if possible.\n *\n * To customize the default tracking algorithm, `NgForOf` supports `trackBy` option.\n * `trackBy` takes a function which has two arguments: `index` and `item`.\n * If `trackBy` is given, Angular tracks changes by the return value of the function.\n *\n * ### Syntax\n *\n * - `<li *ngFor=\"let item of items; index as i; trackBy: trackByFn\">...</li>`\n * - `<li template=\"ngFor let item of items; index as i; trackBy: trackByFn\">...</li>`\n *\n * With `<ng-template>` element:\n *\n * ```\n * <ng-template ngFor let-item [ngForOf]=\"items\" let-i=\"index\" [ngForTrackBy]=\"trackByFn\">\n *   <li>...</li>\n * </ng-template>\n * ```\n *\n * ### Example\n *\n * See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed\n * example.\n *\n * \\@stable\n */\nvar NgForOf = (function () {\n    /**\n     * @param {?} _viewContainer\n     * @param {?} _template\n     * @param {?} _differs\n     */\n    function NgForOf(_viewContainer, _template, _differs) {\n        this._viewContainer = _viewContainer;\n        this._template = _template;\n        this._differs = _differs;\n        this._differ = null;\n    }\n    Object.defineProperty(NgForOf.prototype, \"ngForTrackBy\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._trackByFn; },\n        /**\n         * @param {?} fn\n         * @return {?}\n         */\n        set: function (fn) {\n            if (_angular_core.isDevMode() && fn != null && typeof fn !== 'function') {\n                // TODO(vicb): use a log service once there is a public one available\n                if ((console) && (console.warn)) {\n                    console.warn(\"trackBy must be a function, but received \" + JSON.stringify(fn) + \". \" +\n                        \"See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information.\");\n                }\n            }\n            this._trackByFn = fn;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgForOf.prototype, \"ngForTemplate\", {\n        /**\n         * @param {?} value\n         * @return {?}\n         */\n        set: function (value) {\n            // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1\n            // The current type is too restrictive; a template that just uses index, for example,\n            // should be acceptable.\n            if (value) {\n                this._template = value;\n            }\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgForOf.prototype.ngOnChanges = function (changes) {\n        if ('ngForOf' in changes) {\n            // React on ngForOf changes only once all inputs have been initialized\n            var /** @type {?} */ value = changes['ngForOf'].currentValue;\n            if (!this._differ && value) {\n                try {\n                    this._differ = this._differs.find(value).create(this.ngForTrackBy);\n                }\n                catch (e) {\n                    throw new Error(\"Cannot find a differ supporting object '\" + value + \"' of type '\" + getTypeNameForDebugging(value) + \"'. NgFor only supports binding to Iterables such as Arrays.\");\n                }\n            }\n        }\n    };\n    /**\n     * @return {?}\n     */\n    NgForOf.prototype.ngDoCheck = function () {\n        if (this._differ) {\n            var /** @type {?} */ changes = this._differ.diff(this.ngForOf);\n            if (changes)\n                this._applyChanges(changes);\n        }\n    };\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgForOf.prototype._applyChanges = function (changes) {\n        var _this = this;\n        var /** @type {?} */ insertTuples = [];\n        changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {\n            if (item.previousIndex == null) {\n                var /** @type {?} */ view = _this._viewContainer.createEmbeddedView(_this._template, new NgForOfContext(/** @type {?} */ ((null)), _this.ngForOf, -1, -1), currentIndex);\n                var /** @type {?} */ tuple = new RecordViewTuple(item, view);\n                insertTuples.push(tuple);\n            }\n            else if (currentIndex == null) {\n                _this._viewContainer.remove(adjustedPreviousIndex);\n            }\n            else {\n                var /** @type {?} */ view = ((_this._viewContainer.get(adjustedPreviousIndex)));\n                _this._viewContainer.move(view, currentIndex);\n                var /** @type {?} */ tuple = new RecordViewTuple(item, /** @type {?} */ (view));\n                insertTuples.push(tuple);\n            }\n        });\n        for (var /** @type {?} */ i = 0; i < insertTuples.length; i++) {\n            this._perViewChange(insertTuples[i].view, insertTuples[i].record);\n        }\n        for (var /** @type {?} */ i = 0, /** @type {?} */ ilen = this._viewContainer.length; i < ilen; i++) {\n            var /** @type {?} */ viewRef = (this._viewContainer.get(i));\n            viewRef.context.index = i;\n            viewRef.context.count = ilen;\n        }\n        changes.forEachIdentityChange(function (record) {\n            var /** @type {?} */ viewRef = (_this._viewContainer.get(record.currentIndex));\n            viewRef.context.$implicit = record.item;\n        });\n    };\n    /**\n     * @param {?} view\n     * @param {?} record\n     * @return {?}\n     */\n    NgForOf.prototype._perViewChange = function (view, record) {\n        view.context.$implicit = record.item;\n    };\n    return NgForOf;\n}());\nNgForOf.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngFor][ngForOf]' },] },\n];\n/**\n * @nocollapse\n */\nNgForOf.ctorParameters = function () { return [\n    { type: _angular_core.ViewContainerRef, },\n    { type: _angular_core.TemplateRef, },\n    { type: _angular_core.IterableDiffers, },\n]; };\nNgForOf.propDecorators = {\n    'ngForOf': [{ type: _angular_core.Input },],\n    'ngForTrackBy': [{ type: _angular_core.Input },],\n    'ngForTemplate': [{ type: _angular_core.Input },],\n};\nvar RecordViewTuple = (function () {\n    /**\n     * @param {?} record\n     * @param {?} view\n     */\n    function RecordViewTuple(record, view) {\n        this.record = record;\n        this.view = view;\n    }\n    return RecordViewTuple;\n}());\n/**\n * @deprecated from v4.0.0 - Use NgForOf instead.\n */\nvar NgFor = NgForOf;\n/**\n * @param {?} type\n * @return {?}\n */\nfunction getTypeNameForDebugging(type) {\n    return type['name'] || typeof type;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Conditionally includes a template based on the value of an `expression`.\n *\n * `ngIf` evaluates the `expression` and then renders the `then` or `else` template in its place\n * when expression is truthy or falsy respectively. Typically the:\n *  - `then` template is the inline template of `ngIf` unless bound to a different value.\n *  - `else` template is blank unless it is bound.\n *\n * ## Most common usage\n *\n * The most common usage of the `ngIf` directive is to conditionally show the inline template as\n * seen in this example:\n * {\\@example common/ngIf/ts/module.ts region='NgIfSimple'}\n *\n * ## Showing an alternative template using `else`\n *\n * If it is necessary to display a template when the `expression` is falsy use the `else` template\n * binding as shown. Note that the `else` binding points to a `<ng-template>` labeled `#elseBlock`.\n * The template can be defined anywhere in the component view but is typically placed right after\n * `ngIf` for readability.\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfElse'}\n *\n * ## Using non-inlined `then` template\n *\n * Usually the `then` template is the inlined template of the `ngIf`, but it can be changed using\n * a binding (just like `else`). Because `then` and `else` are bindings, the template references can\n * change at runtime as shown in this example.\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfThenElse'}\n *\n * ## Storing conditional result in a variable\n *\n * A common pattern is that we need to show a set of properties from the same object. If the\n * object is undefined, then we have to use the safe-traversal-operator `?.` to guard against\n * dereferencing a `null` value. This is especially the case when waiting on async data such as\n * when using the `async` pipe as shown in folowing example:\n *\n * ```\n * Hello {{ (userStream|async)?.last }}, {{ (userStream|async)?.first }}!\n * ```\n *\n * There are several inefficiencies in the above example:\n *  - We create multiple subscriptions on `userStream`. One for each `async` pipe, or two in the\n *    example above.\n *  - We cannot display an alternative screen while waiting for the data to arrive asynchronously.\n *  - We have to use the safe-traversal-operator `?.` to access properties, which is cumbersome.\n *  - We have to place the `async` pipe in parenthesis.\n *\n * A better way to do this is to use `ngIf` and store the result of the condition in a local\n * variable as shown in the the example below:\n *\n * {\\@example common/ngIf/ts/module.ts region='NgIfAs'}\n *\n * Notice that:\n *  - We use only one `async` pipe and hence only one subscription gets created.\n *  - `ngIf` stores the result of the `userStream|async` in the local variable `user`.\n *  - The local `user` can then be bound repeatedly in a more efficient way.\n *  - No need to use the safe-traversal-operator `?.` to access properties as `ngIf` will only\n *    display the data if `userStream` returns a value.\n *  - We can display an alternative template while waiting for the data.\n *\n * ### Syntax\n *\n * Simple form:\n * - `<div *ngIf=\"condition\">...</div>`\n * - `<div template=\"ngIf condition\">...</div>`\n * - `<ng-template [ngIf]=\"condition\"><div>...</div></ng-template>`\n *\n * Form with an else block:\n * ```\n * <div *ngIf=\"condition; else elseBlock\">...</div>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * Form with a `then` and `else` block:\n * ```\n * <div *ngIf=\"condition; then thenBlock else elseBlock\"></div>\n * <ng-template #thenBlock>...</ng-template>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * Form with storing the value locally:\n * ```\n * <div *ngIf=\"condition as value; else elseBlock\">{{value}}</div>\n * <ng-template #elseBlock>...</ng-template>\n * ```\n *\n * \\@stable\n */\nvar NgIf = (function () {\n    /**\n     * @param {?} _viewContainer\n     * @param {?} templateRef\n     */\n    function NgIf(_viewContainer, templateRef) {\n        this._viewContainer = _viewContainer;\n        this._context = new NgIfContext();\n        this._thenTemplateRef = null;\n        this._elseTemplateRef = null;\n        this._thenViewRef = null;\n        this._elseViewRef = null;\n        this._thenTemplateRef = templateRef;\n    }\n    Object.defineProperty(NgIf.prototype, \"ngIf\", {\n        /**\n         * @param {?} condition\n         * @return {?}\n         */\n        set: function (condition) {\n            this._context.$implicit = this._context.ngIf = condition;\n            this._updateView();\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgIf.prototype, \"ngIfThen\", {\n        /**\n         * @param {?} templateRef\n         * @return {?}\n         */\n        set: function (templateRef) {\n            this._thenTemplateRef = templateRef;\n            this._thenViewRef = null; // clear previous view if any.\n            this._updateView();\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(NgIf.prototype, \"ngIfElse\", {\n        /**\n         * @param {?} templateRef\n         * @return {?}\n         */\n        set: function (templateRef) {\n            this._elseTemplateRef = templateRef;\n            this._elseViewRef = null; // clear previous view if any.\n            this._updateView();\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    NgIf.prototype._updateView = function () {\n        if (this._context.$implicit) {\n            if (!this._thenViewRef) {\n                this._viewContainer.clear();\n                this._elseViewRef = null;\n                if (this._thenTemplateRef) {\n                    this._thenViewRef =\n                        this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);\n                }\n            }\n        }\n        else {\n            if (!this._elseViewRef) {\n                this._viewContainer.clear();\n                this._thenViewRef = null;\n                if (this._elseTemplateRef) {\n                    this._elseViewRef =\n                        this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);\n                }\n            }\n        }\n    };\n    return NgIf;\n}());\nNgIf.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngIf]' },] },\n];\n/**\n * @nocollapse\n */\nNgIf.ctorParameters = function () { return [\n    { type: _angular_core.ViewContainerRef, },\n    { type: _angular_core.TemplateRef, },\n]; };\nNgIf.propDecorators = {\n    'ngIf': [{ type: _angular_core.Input },],\n    'ngIfThen': [{ type: _angular_core.Input },],\n    'ngIfElse': [{ type: _angular_core.Input },],\n};\n/**\n * \\@stable\n */\nvar NgIfContext = (function () {\n    function NgIfContext() {\n        this.$implicit = null;\n        this.ngIf = null;\n    }\n    return NgIfContext;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar SwitchView = (function () {\n    /**\n     * @param {?} _viewContainerRef\n     * @param {?} _templateRef\n     */\n    function SwitchView(_viewContainerRef, _templateRef) {\n        this._viewContainerRef = _viewContainerRef;\n        this._templateRef = _templateRef;\n        this._created = false;\n    }\n    /**\n     * @return {?}\n     */\n    SwitchView.prototype.create = function () {\n        this._created = true;\n        this._viewContainerRef.createEmbeddedView(this._templateRef);\n    };\n    /**\n     * @return {?}\n     */\n    SwitchView.prototype.destroy = function () {\n        this._created = false;\n        this._viewContainerRef.clear();\n    };\n    /**\n     * @param {?} created\n     * @return {?}\n     */\n    SwitchView.prototype.enforceState = function (created) {\n        if (created && !this._created) {\n            this.create();\n        }\n        else if (!created && this._created) {\n            this.destroy();\n        }\n    };\n    return SwitchView;\n}());\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds / removes DOM sub-trees when the nest match expressions matches the switch\n *             expression.\n *\n * \\@howToUse\n * ```\n *     <container-element [ngSwitch]=\"switch_expression\">\n *       <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n *       <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n *       <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n *       <ng-container *ngSwitchCase=\"match_expression_3\">\n *         <!-- use a ng-container to group multiple root nodes -->\n *         <inner-element></inner-element>\n *         <inner-other-element></inner-other-element>\n *       </ng-container>\n *       <some-element *ngSwitchDefault>...</some-element>\n *     </container-element>\n * ```\n * \\@description\n *\n * `NgSwitch` stamps out nested views when their match expression value matches the value of the\n * switch expression.\n *\n * In other words:\n * - you define a container element (where you place the directive with a switch expression on the\n * `[ngSwitch]=\"...\"` attribute)\n * - you define inner views inside the `NgSwitch` and place a `*ngSwitchCase` attribute on the view\n * root elements.\n *\n * Elements within `NgSwitch` but outside of a `NgSwitchCase` or `NgSwitchDefault` directives will\n * be preserved at the location.\n *\n * The `ngSwitchCase` directive informs the parent `NgSwitch` of which view to display when the\n * expression is evaluated.\n * When no matching expression is found on a `ngSwitchCase` view, the `ngSwitchDefault` view is\n * stamped out.\n *\n * \\@stable\n */\nvar NgSwitch = (function () {\n    function NgSwitch() {\n        this._defaultUsed = false;\n        this._caseCount = 0;\n        this._lastCaseCheckIndex = 0;\n        this._lastCasesMatched = false;\n    }\n    Object.defineProperty(NgSwitch.prototype, \"ngSwitch\", {\n        /**\n         * @param {?} newValue\n         * @return {?}\n         */\n        set: function (newValue) {\n            this._ngSwitch = newValue;\n            if (this._caseCount === 0) {\n                this._updateDefaultCases(true);\n            }\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    NgSwitch.prototype._addCase = function () { return this._caseCount++; };\n    /**\n     * \\@internal\n     * @param {?} view\n     * @return {?}\n     */\n    NgSwitch.prototype._addDefault = function (view) {\n        if (!this._defaultViews) {\n            this._defaultViews = [];\n        }\n        this._defaultViews.push(view);\n    };\n    /**\n     * \\@internal\n     * @param {?} value\n     * @return {?}\n     */\n    NgSwitch.prototype._matchCase = function (value) {\n        var /** @type {?} */ matched = value == this._ngSwitch;\n        this._lastCasesMatched = this._lastCasesMatched || matched;\n        this._lastCaseCheckIndex++;\n        if (this._lastCaseCheckIndex === this._caseCount) {\n            this._updateDefaultCases(!this._lastCasesMatched);\n            this._lastCaseCheckIndex = 0;\n            this._lastCasesMatched = false;\n        }\n        return matched;\n    };\n    /**\n     * @param {?} useDefault\n     * @return {?}\n     */\n    NgSwitch.prototype._updateDefaultCases = function (useDefault) {\n        if (this._defaultViews && useDefault !== this._defaultUsed) {\n            this._defaultUsed = useDefault;\n            for (var /** @type {?} */ i = 0; i < this._defaultViews.length; i++) {\n                var /** @type {?} */ defaultView = this._defaultViews[i];\n                defaultView.enforceState(useDefault);\n            }\n        }\n    };\n    return NgSwitch;\n}());\nNgSwitch.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngSwitch]' },] },\n];\n/**\n * @nocollapse\n */\nNgSwitch.ctorParameters = function () { return []; };\nNgSwitch.propDecorators = {\n    'ngSwitch': [{ type: _angular_core.Input },],\n};\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Creates a view that will be added/removed from the parent {\\@link NgSwitch} when the\n *             given expression evaluate to respectively the same/different value as the switch\n *             expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n *   <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * </container-element>\n * ```\n * \\@description\n *\n * Insert the sub-tree when the expression evaluates to the same value as the enclosing switch\n * expression.\n *\n * If multiple match expressions match the switch expression value, all of them are displayed.\n *\n * See {\\@link NgSwitch} for more details and example.\n *\n * \\@stable\n */\nvar NgSwitchCase = (function () {\n    /**\n     * @param {?} viewContainer\n     * @param {?} templateRef\n     * @param {?} ngSwitch\n     */\n    function NgSwitchCase(viewContainer, templateRef, ngSwitch) {\n        this.ngSwitch = ngSwitch;\n        ngSwitch._addCase();\n        this._view = new SwitchView(viewContainer, templateRef);\n    }\n    /**\n     * @return {?}\n     */\n    NgSwitchCase.prototype.ngDoCheck = function () { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); };\n    return NgSwitchCase;\n}());\nNgSwitchCase.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngSwitchCase]' },] },\n];\n/**\n * @nocollapse\n */\nNgSwitchCase.ctorParameters = function () { return [\n    { type: _angular_core.ViewContainerRef, },\n    { type: _angular_core.TemplateRef, },\n    { type: NgSwitch, decorators: [{ type: _angular_core.Host },] },\n]; };\nNgSwitchCase.propDecorators = {\n    'ngSwitchCase': [{ type: _angular_core.Input },],\n};\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Creates a view that is added to the parent {\\@link NgSwitch} when no case expressions\n * match the\n *             switch expression.\n *\n * \\@howToUse\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n *   <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n *   <some-other-element *ngSwitchDefault>...</some-other-element>\n * </container-element>\n * ```\n *\n * \\@description\n *\n * Insert the sub-tree when no case expressions evaluate to the same value as the enclosing switch\n * expression.\n *\n * See {\\@link NgSwitch} for more details and example.\n *\n * \\@stable\n */\nvar NgSwitchDefault = (function () {\n    /**\n     * @param {?} viewContainer\n     * @param {?} templateRef\n     * @param {?} ngSwitch\n     */\n    function NgSwitchDefault(viewContainer, templateRef, ngSwitch) {\n        ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));\n    }\n    return NgSwitchDefault;\n}());\nNgSwitchDefault.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngSwitchDefault]' },] },\n];\n/**\n * @nocollapse\n */\nNgSwitchDefault.ctorParameters = function () { return [\n    { type: _angular_core.ViewContainerRef, },\n    { type: _angular_core.TemplateRef, },\n    { type: NgSwitch, decorators: [{ type: _angular_core.Host },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.\n *\n * \\@howToUse\n * ```\n * <some-element [ngPlural]=\"value\">\n *   <ng-template ngPluralCase=\"=0\">there is nothing</ng-template>\n *   <ng-template ngPluralCase=\"=1\">there is one</ng-template>\n *   <ng-template ngPluralCase=\"few\">there are a few</ng-template>\n * </some-element>\n * ```\n *\n * \\@description\n *\n * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees\n * that match the switch expression's pluralization category.\n *\n * To use this directive you must provide a container element that sets the `[ngPlural]` attribute\n * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their\n * expression:\n * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value\n *   matches the switch expression exactly,\n * - otherwise, the view will be treated as a \"category match\", and will only display if exact\n *   value matches aren't found and the value maps to its category for the defined locale.\n *\n * See http://cldr.unicode.org/index/cldr-spec/plural-rules\n *\n * \\@experimental\n */\nvar NgPlural = (function () {\n    /**\n     * @param {?} _localization\n     */\n    function NgPlural(_localization) {\n        this._localization = _localization;\n        this._caseViews = {};\n    }\n    Object.defineProperty(NgPlural.prototype, \"ngPlural\", {\n        /**\n         * @param {?} value\n         * @return {?}\n         */\n        set: function (value) {\n            this._switchValue = value;\n            this._updateView();\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} value\n     * @param {?} switchView\n     * @return {?}\n     */\n    NgPlural.prototype.addCase = function (value, switchView) { this._caseViews[value] = switchView; };\n    /**\n     * @return {?}\n     */\n    NgPlural.prototype._updateView = function () {\n        this._clearViews();\n        var /** @type {?} */ cases = Object.keys(this._caseViews);\n        var /** @type {?} */ key = getPluralCategory(this._switchValue, cases, this._localization);\n        this._activateView(this._caseViews[key]);\n    };\n    /**\n     * @return {?}\n     */\n    NgPlural.prototype._clearViews = function () {\n        if (this._activeView)\n            this._activeView.destroy();\n    };\n    /**\n     * @param {?} view\n     * @return {?}\n     */\n    NgPlural.prototype._activateView = function (view) {\n        if (view) {\n            this._activeView = view;\n            this._activeView.create();\n        }\n    };\n    return NgPlural;\n}());\nNgPlural.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngPlural]' },] },\n];\n/**\n * @nocollapse\n */\nNgPlural.ctorParameters = function () { return [\n    { type: NgLocalization, },\n]; };\nNgPlural.propDecorators = {\n    'ngPlural': [{ type: _angular_core.Input },],\n};\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Creates a view that will be added/removed from the parent {\\@link NgPlural} when the\n *             given expression matches the plural expression according to CLDR rules.\n *\n * \\@howToUse\n * ```\n * <some-element [ngPlural]=\"value\">\n *   <ng-template ngPluralCase=\"=0\">...</ng-template>\n *   <ng-template ngPluralCase=\"other\">...</ng-template>\n * </some-element>\n * ```\n *\n * See {\\@link NgPlural} for more details and example.\n *\n * \\@experimental\n */\nvar NgPluralCase = (function () {\n    /**\n     * @param {?} value\n     * @param {?} template\n     * @param {?} viewContainer\n     * @param {?} ngPlural\n     */\n    function NgPluralCase(value, template, viewContainer, ngPlural) {\n        this.value = value;\n        var isANumber = !isNaN(Number(value));\n        ngPlural.addCase(isANumber ? \"=\" + value : value, new SwitchView(viewContainer, template));\n    }\n    return NgPluralCase;\n}());\nNgPluralCase.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngPluralCase]' },] },\n];\n/**\n * @nocollapse\n */\nNgPluralCase.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Attribute, args: ['ngPluralCase',] },] },\n    { type: _angular_core.TemplateRef, },\n    { type: _angular_core.ViewContainerRef, },\n    { type: NgPlural, decorators: [{ type: _angular_core.Host },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Update an HTML element styles.\n *\n * \\@howToUse\n * ```\n * <some-element [ngStyle]=\"{'font-style': styleExp}\">...</some-element>\n *\n * <some-element [ngStyle]=\"{'max-width.px': widthExp}\">...</some-element>\n *\n * <some-element [ngStyle]=\"objExp\">...</some-element>\n * ```\n *\n * \\@description\n *\n * The styles are updated according to the value of the expression evaluation:\n * - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),\n * - values are the values assigned to those properties (expressed in the given unit).\n *\n * \\@stable\n */\nvar NgStyle = (function () {\n    /**\n     * @param {?} _differs\n     * @param {?} _ngEl\n     * @param {?} _renderer\n     */\n    function NgStyle(_differs, _ngEl, _renderer) {\n        this._differs = _differs;\n        this._ngEl = _ngEl;\n        this._renderer = _renderer;\n    }\n    Object.defineProperty(NgStyle.prototype, \"ngStyle\", {\n        /**\n         * @param {?} v\n         * @return {?}\n         */\n        set: function (v) {\n            this._ngStyle = v;\n            if (!this._differ && v) {\n                this._differ = this._differs.find(v).create();\n            }\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    NgStyle.prototype.ngDoCheck = function () {\n        if (this._differ) {\n            var /** @type {?} */ changes = this._differ.diff(this._ngStyle);\n            if (changes) {\n                this._applyChanges(changes);\n            }\n        }\n    };\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgStyle.prototype._applyChanges = function (changes) {\n        var _this = this;\n        changes.forEachRemovedItem(function (record) { return _this._setStyle(record.key, null); });\n        changes.forEachAddedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n        changes.forEachChangedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });\n    };\n    /**\n     * @param {?} nameAndUnit\n     * @param {?} value\n     * @return {?}\n     */\n    NgStyle.prototype._setStyle = function (nameAndUnit, value) {\n        var _a = nameAndUnit.split('.'), name = _a[0], unit = _a[1];\n        value = value != null && unit ? \"\" + value + unit : value;\n        this._renderer.setElementStyle(this._ngEl.nativeElement, name, /** @type {?} */ (value));\n    };\n    return NgStyle;\n}());\nNgStyle.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngStyle]' },] },\n];\n/**\n * @nocollapse\n */\nNgStyle.ctorParameters = function () { return [\n    { type: _angular_core.KeyValueDiffers, },\n    { type: _angular_core.ElementRef, },\n    { type: _angular_core.Renderer, },\n]; };\nNgStyle.propDecorators = {\n    'ngStyle': [{ type: _angular_core.Input },],\n};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n *\n * \\@whatItDoes Inserts an embedded view from a prepared `TemplateRef`\n *\n * \\@howToUse\n * ```\n * <ng-container *ngTemplateOutlet=\"templateRefExp; context: contextExp\"></ng-container>\n * ```\n *\n * \\@description\n *\n * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.\n * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding\n * by the local template `let` declarations.\n *\n * Note: using the key `$implicit` in the context object will set it's value as default.\n *\n * ## Example\n *\n * {\\@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}\n *\n * \\@experimental\n */\nvar NgTemplateOutlet = (function () {\n    /**\n     * @param {?} _viewContainerRef\n     */\n    function NgTemplateOutlet(_viewContainerRef) {\n        this._viewContainerRef = _viewContainerRef;\n    }\n    Object.defineProperty(NgTemplateOutlet.prototype, \"ngOutletContext\", {\n        /**\n         * @deprecated v4.0.0 - Renamed to ngTemplateOutletContext.\n         * @param {?} context\n         * @return {?}\n         */\n        set: function (context) { this.ngTemplateOutletContext = context; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    NgTemplateOutlet.prototype.ngOnChanges = function (changes) {\n        if (this._viewRef) {\n            this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));\n        }\n        if (this.ngTemplateOutlet) {\n            this._viewRef = this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext);\n        }\n    };\n    return NgTemplateOutlet;\n}());\nNgTemplateOutlet.decorators = [\n    { type: _angular_core.Directive, args: [{ selector: '[ngTemplateOutlet]' },] },\n];\n/**\n * @nocollapse\n */\nNgTemplateOutlet.ctorParameters = function () { return [\n    { type: _angular_core.ViewContainerRef, },\n]; };\nNgTemplateOutlet.propDecorators = {\n    'ngTemplateOutletContext': [{ type: _angular_core.Input },],\n    'ngTemplateOutlet': [{ type: _angular_core.Input },],\n    'ngOutletContext': [{ type: _angular_core.Input },],\n};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A collection of Angular directives that are likely to be used in each and every Angular\n * application.\n */\nvar COMMON_DIRECTIVES = [\n    NgClass,\n    NgComponentOutlet,\n    NgForOf,\n    NgIf,\n    NgTemplateOutlet,\n    NgStyle,\n    NgSwitch,\n    NgSwitchCase,\n    NgSwitchDefault,\n    NgPlural,\n    NgPluralCase,\n];\n/**\n * A collection of deprecated directives that are no longer part of the core module.\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} type\n * @param {?} value\n * @return {?}\n */\nfunction invalidPipeArgumentError(type, value) {\n    return Error(\"InvalidPipeArgument: '\" + value + \"' for pipe '\" + _angular_core.ɵstringify(type) + \"'\");\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ObservableStrategy = (function () {\n    function ObservableStrategy() {\n    }\n    /**\n     * @param {?} async\n     * @param {?} updateLatestValue\n     * @return {?}\n     */\n    ObservableStrategy.prototype.createSubscription = function (async, updateLatestValue) {\n        return async.subscribe({ next: updateLatestValue, error: function (e) { throw e; } });\n    };\n    /**\n     * @param {?} subscription\n     * @return {?}\n     */\n    ObservableStrategy.prototype.dispose = function (subscription) { subscription.unsubscribe(); };\n    /**\n     * @param {?} subscription\n     * @return {?}\n     */\n    ObservableStrategy.prototype.onDestroy = function (subscription) { subscription.unsubscribe(); };\n    return ObservableStrategy;\n}());\nvar PromiseStrategy = (function () {\n    function PromiseStrategy() {\n    }\n    /**\n     * @param {?} async\n     * @param {?} updateLatestValue\n     * @return {?}\n     */\n    PromiseStrategy.prototype.createSubscription = function (async, updateLatestValue) {\n        return async.then(updateLatestValue, function (e) { throw e; });\n    };\n    /**\n     * @param {?} subscription\n     * @return {?}\n     */\n    PromiseStrategy.prototype.dispose = function (subscription) { };\n    /**\n     * @param {?} subscription\n     * @return {?}\n     */\n    PromiseStrategy.prototype.onDestroy = function (subscription) { };\n    return PromiseStrategy;\n}());\nvar _promiseStrategy = new PromiseStrategy();\nvar _observableStrategy = new ObservableStrategy();\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Unwraps a value from an asynchronous primitive.\n * \\@howToUse `observable_or_promise_expression | async`\n * \\@description\n * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has\n * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for\n * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid\n * potential memory leaks.\n *\n *\n * ## Examples\n *\n * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the\n * promise.\n *\n * {\\@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}\n *\n * It's also possible to use `async` with Observables. The example below binds the `time` Observable\n * to the view. The Observable continuously updates the view with the current time.\n *\n * {\\@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}\n *\n * \\@stable\n */\nvar AsyncPipe = (function () {\n    /**\n     * @param {?} _ref\n     */\n    function AsyncPipe(_ref) {\n        this._ref = _ref;\n        this._latestValue = null;\n        this._latestReturnedValue = null;\n        this._subscription = null;\n        this._obj = null;\n        this._strategy = ((null));\n    }\n    /**\n     * @return {?}\n     */\n    AsyncPipe.prototype.ngOnDestroy = function () {\n        if (this._subscription) {\n            this._dispose();\n        }\n    };\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    AsyncPipe.prototype.transform = function (obj) {\n        if (!this._obj) {\n            if (obj) {\n                this._subscribe(obj);\n            }\n            this._latestReturnedValue = this._latestValue;\n            return this._latestValue;\n        }\n        if (obj !== this._obj) {\n            this._dispose();\n            return this.transform(/** @type {?} */ (obj));\n        }\n        if (this._latestValue === this._latestReturnedValue) {\n            return this._latestReturnedValue;\n        }\n        this._latestReturnedValue = this._latestValue;\n        return _angular_core.WrappedValue.wrap(this._latestValue);\n    };\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    AsyncPipe.prototype._subscribe = function (obj) {\n        var _this = this;\n        this._obj = obj;\n        this._strategy = this._selectStrategy(obj);\n        this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });\n    };\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    AsyncPipe.prototype._selectStrategy = function (obj) {\n        if (_angular_core.ɵisPromise(obj)) {\n            return _promiseStrategy;\n        }\n        if (_angular_core.ɵisObservable(obj)) {\n            return _observableStrategy;\n        }\n        throw invalidPipeArgumentError(AsyncPipe, obj);\n    };\n    /**\n     * @return {?}\n     */\n    AsyncPipe.prototype._dispose = function () {\n        this._strategy.dispose(/** @type {?} */ ((this._subscription)));\n        this._latestValue = null;\n        this._latestReturnedValue = null;\n        this._subscription = null;\n        this._obj = null;\n    };\n    /**\n     * @param {?} async\n     * @param {?} value\n     * @return {?}\n     */\n    AsyncPipe.prototype._updateLatestValue = function (async, value) {\n        if (async === this._obj) {\n            this._latestValue = value;\n            this._ref.markForCheck();\n        }\n    };\n    return AsyncPipe;\n}());\nAsyncPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'async', pure: false },] },\n];\n/**\n * @nocollapse\n */\nAsyncPipe.ctorParameters = function () { return [\n    { type: _angular_core.ChangeDetectorRef, },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Transforms text to lowercase.\n *\n * {\\@example  common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe' }\n *\n * \\@stable\n */\nvar LowerCasePipe = (function () {\n    function LowerCasePipe() {\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    LowerCasePipe.prototype.transform = function (value) {\n        if (!value)\n            return value;\n        if (typeof value !== 'string') {\n            throw invalidPipeArgumentError(LowerCasePipe, value);\n        }\n        return value.toLowerCase();\n    };\n    return LowerCasePipe;\n}());\nLowerCasePipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'lowercase' },] },\n];\n/**\n * @nocollapse\n */\nLowerCasePipe.ctorParameters = function () { return []; };\n/**\n * Helper method to transform a single word to titlecase.\n *\n * \\@stable\n * @param {?} word\n * @return {?}\n */\nfunction titleCaseWord(word) {\n    if (!word)\n        return word;\n    return word[0].toUpperCase() + word.substr(1).toLowerCase();\n}\n/**\n * Transforms text to titlecase.\n *\n * \\@stable\n */\nvar TitleCasePipe = (function () {\n    function TitleCasePipe() {\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    TitleCasePipe.prototype.transform = function (value) {\n        if (!value)\n            return value;\n        if (typeof value !== 'string') {\n            throw invalidPipeArgumentError(TitleCasePipe, value);\n        }\n        return value.split(/\\b/g).map(function (word) { return titleCaseWord(word); }).join('');\n    };\n    return TitleCasePipe;\n}());\nTitleCasePipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'titlecase' },] },\n];\n/**\n * @nocollapse\n */\nTitleCasePipe.ctorParameters = function () { return []; };\n/**\n * Transforms text to uppercase.\n *\n * \\@stable\n */\nvar UpperCasePipe = (function () {\n    function UpperCasePipe() {\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    UpperCasePipe.prototype.transform = function (value) {\n        if (!value)\n            return value;\n        if (typeof value !== 'string') {\n            throw invalidPipeArgumentError(UpperCasePipe, value);\n        }\n        return value.toUpperCase();\n    };\n    return UpperCasePipe;\n}());\nUpperCasePipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'uppercase' },] },\n];\n/**\n * @nocollapse\n */\nUpperCasePipe.ctorParameters = function () { return []; };\nvar NumberFormatStyle = {};\nNumberFormatStyle.Decimal = 0;\nNumberFormatStyle.Percent = 1;\nNumberFormatStyle.Currency = 2;\nNumberFormatStyle[NumberFormatStyle.Decimal] = \"Decimal\";\nNumberFormatStyle[NumberFormatStyle.Percent] = \"Percent\";\nNumberFormatStyle[NumberFormatStyle.Currency] = \"Currency\";\nvar NumberFormatter = (function () {\n    function NumberFormatter() {\n    }\n    /**\n     * @param {?} num\n     * @param {?} locale\n     * @param {?} style\n     * @param {?=} __3\n     * @return {?}\n     */\n    NumberFormatter.format = function (num, locale, style, _a) {\n        var _b = _a === void 0 ? {} : _a, minimumIntegerDigits = _b.minimumIntegerDigits, minimumFractionDigits = _b.minimumFractionDigits, maximumFractionDigits = _b.maximumFractionDigits, currency = _b.currency, _c = _b.currencyAsSymbol, currencyAsSymbol = _c === void 0 ? false : _c;\n        var /** @type {?} */ options = {\n            minimumIntegerDigits: minimumIntegerDigits,\n            minimumFractionDigits: minimumFractionDigits,\n            maximumFractionDigits: maximumFractionDigits,\n            style: NumberFormatStyle[style].toLowerCase()\n        };\n        if (style == NumberFormatStyle.Currency) {\n            options.currency = typeof currency == 'string' ? currency : undefined;\n            options.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code';\n        }\n        return new Intl.NumberFormat(locale, options).format(num);\n    };\n    return NumberFormatter;\n}());\nvar DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;\nvar PATTERN_ALIASES = {\n    // Keys are quoted so they do not get renamed during closure compilation.\n    'yMMMdjms': datePartGetterFactory(combine([\n        digitCondition('year', 1),\n        nameCondition('month', 3),\n        digitCondition('day', 1),\n        digitCondition('hour', 1),\n        digitCondition('minute', 1),\n        digitCondition('second', 1),\n    ])),\n    'yMdjm': datePartGetterFactory(combine([\n        digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),\n        digitCondition('hour', 1), digitCondition('minute', 1)\n    ])),\n    'yMMMMEEEEd': datePartGetterFactory(combine([\n        digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),\n        digitCondition('day', 1)\n    ])),\n    'yMMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),\n    'yMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),\n    'yMd': datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),\n    'jms': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),\n    'jm': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))\n};\nvar DATE_FORMATS = {\n    // Keys are quoted so they do not get renamed.\n    'yyyy': datePartGetterFactory(digitCondition('year', 4)),\n    'yy': datePartGetterFactory(digitCondition('year', 2)),\n    'y': datePartGetterFactory(digitCondition('year', 1)),\n    'MMMM': datePartGetterFactory(nameCondition('month', 4)),\n    'MMM': datePartGetterFactory(nameCondition('month', 3)),\n    'MM': datePartGetterFactory(digitCondition('month', 2)),\n    'M': datePartGetterFactory(digitCondition('month', 1)),\n    'LLLL': datePartGetterFactory(nameCondition('month', 4)),\n    'L': datePartGetterFactory(nameCondition('month', 1)),\n    'dd': datePartGetterFactory(digitCondition('day', 2)),\n    'd': datePartGetterFactory(digitCondition('day', 1)),\n    'HH': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),\n    'H': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),\n    'hh': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),\n    'h': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),\n    'jj': datePartGetterFactory(digitCondition('hour', 2)),\n    'j': datePartGetterFactory(digitCondition('hour', 1)),\n    'mm': digitModifier(datePartGetterFactory(digitCondition('minute', 2))),\n    'm': datePartGetterFactory(digitCondition('minute', 1)),\n    'ss': digitModifier(datePartGetterFactory(digitCondition('second', 2))),\n    's': datePartGetterFactory(digitCondition('second', 1)),\n    // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n    // we can be just safely rely on using `sss` since we currently don't support single or two digit\n    // fractions\n    'sss': datePartGetterFactory(digitCondition('second', 3)),\n    'EEEE': datePartGetterFactory(nameCondition('weekday', 4)),\n    'EEE': datePartGetterFactory(nameCondition('weekday', 3)),\n    'EE': datePartGetterFactory(nameCondition('weekday', 2)),\n    'E': datePartGetterFactory(nameCondition('weekday', 1)),\n    'a': hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),\n    'Z': timeZoneGetter('short'),\n    'z': timeZoneGetter('long'),\n    'ww': datePartGetterFactory({}),\n    // first Thursday of the year. not support ?\n    'w': datePartGetterFactory({}),\n    // of the year not support ?\n    'G': datePartGetterFactory(nameCondition('era', 1)),\n    'GG': datePartGetterFactory(nameCondition('era', 2)),\n    'GGG': datePartGetterFactory(nameCondition('era', 3)),\n    'GGGG': datePartGetterFactory(nameCondition('era', 4))\n};\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction digitModifier(inner) {\n    return function (date, locale) {\n        var /** @type {?} */ result = inner(date, locale);\n        return result.length == 1 ? '0' + result : result;\n    };\n}\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction hourClockExtractor(inner) {\n    return function (date, locale) { return inner(date, locale).split(' ')[1]; };\n}\n/**\n * @param {?} inner\n * @return {?}\n */\nfunction hourExtractor(inner) {\n    return function (date, locale) { return inner(date, locale).split(' ')[0]; };\n}\n/**\n * @param {?} date\n * @param {?} locale\n * @param {?} options\n * @return {?}\n */\nfunction intlDateFormat(date, locale, options) {\n    return new Intl.DateTimeFormat(locale, options).format(date).replace(/[\\u200e\\u200f]/g, '');\n}\n/**\n * @param {?} timezone\n * @return {?}\n */\nfunction timeZoneGetter(timezone) {\n    // To workaround `Intl` API restriction for single timezone let format with 24 hours\n    var /** @type {?} */ options = { hour: '2-digit', hour12: false, timeZoneName: timezone };\n    return function (date, locale) {\n        var /** @type {?} */ result = intlDateFormat(date, locale, options);\n        // Then extract first 3 letters that related to hours\n        return result ? result.substring(3) : '';\n    };\n}\n/**\n * @param {?} options\n * @param {?} value\n * @return {?}\n */\nfunction hour12Modify(options, value) {\n    options.hour12 = value;\n    return options;\n}\n/**\n * @param {?} prop\n * @param {?} len\n * @return {?}\n */\nfunction digitCondition(prop, len) {\n    var /** @type {?} */ result = {};\n    result[prop] = len === 2 ? '2-digit' : 'numeric';\n    return result;\n}\n/**\n * @param {?} prop\n * @param {?} len\n * @return {?}\n */\nfunction nameCondition(prop, len) {\n    var /** @type {?} */ result = {};\n    if (len < 4) {\n        result[prop] = len > 1 ? 'short' : 'narrow';\n    }\n    else {\n        result[prop] = 'long';\n    }\n    return result;\n}\n/**\n * @param {?} options\n * @return {?}\n */\nfunction combine(options) {\n    return ((Object)).assign.apply(((Object)), [{}].concat(options));\n}\n/**\n * @param {?} ret\n * @return {?}\n */\nfunction datePartGetterFactory(ret) {\n    return function (date, locale) { return intlDateFormat(date, locale, ret); };\n}\nvar DATE_FORMATTER_CACHE = new Map();\n/**\n * @param {?} format\n * @param {?} date\n * @param {?} locale\n * @return {?}\n */\nfunction dateFormatter(format, date, locale) {\n    var /** @type {?} */ fn = PATTERN_ALIASES[format];\n    if (fn)\n        return fn(date, locale);\n    var /** @type {?} */ cacheKey = format;\n    var /** @type {?} */ parts = DATE_FORMATTER_CACHE.get(cacheKey);\n    if (!parts) {\n        parts = [];\n        var /** @type {?} */ match = void 0;\n        DATE_FORMATS_SPLIT.exec(format);\n        var /** @type {?} */ _format = format;\n        while (_format) {\n            match = DATE_FORMATS_SPLIT.exec(_format);\n            if (match) {\n                parts = parts.concat(match.slice(1));\n                _format = ((parts.pop()));\n            }\n            else {\n                parts.push(_format);\n                _format = null;\n            }\n        }\n        DATE_FORMATTER_CACHE.set(cacheKey, parts);\n    }\n    return parts.reduce(function (text, part) {\n        var /** @type {?} */ fn = DATE_FORMATS[part];\n        return text + (fn ? fn(date, locale) : partToTime(part));\n    }, '');\n}\n/**\n * @param {?} part\n * @return {?}\n */\nfunction partToTime(part) {\n    return part === '\\'\\'' ? '\\'' : part.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n}\nvar DateFormatter = (function () {\n    function DateFormatter() {\n    }\n    /**\n     * @param {?} date\n     * @param {?} locale\n     * @param {?} pattern\n     * @return {?}\n     */\n    DateFormatter.format = function (date, locale, pattern) {\n        return dateFormatter(pattern, date, locale);\n    };\n    return DateFormatter;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _NUMBER_FORMAT_REGEXP = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\n/**\n * @param {?} pipe\n * @param {?} locale\n * @param {?} value\n * @param {?} style\n * @param {?=} digits\n * @param {?=} currency\n * @param {?=} currencyAsSymbol\n * @return {?}\n */\nfunction formatNumber(pipe, locale, value, style, digits, currency, currencyAsSymbol) {\n    if (currency === void 0) { currency = null; }\n    if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }\n    if (value == null)\n        return null;\n    // Convert strings to numbers\n    value = typeof value === 'string' && isNumeric(value) ? +value : value;\n    if (typeof value !== 'number') {\n        throw invalidPipeArgumentError(pipe, value);\n    }\n    var /** @type {?} */ minInt = undefined;\n    var /** @type {?} */ minFraction = undefined;\n    var /** @type {?} */ maxFraction = undefined;\n    if (style !== NumberFormatStyle.Currency) {\n        // rely on Intl default for currency\n        minInt = 1;\n        minFraction = 0;\n        maxFraction = 3;\n    }\n    if (digits) {\n        var /** @type {?} */ parts = digits.match(_NUMBER_FORMAT_REGEXP);\n        if (parts === null) {\n            throw new Error(digits + \" is not a valid digit info for number pipes\");\n        }\n        if (parts[1] != null) {\n            minInt = parseIntAutoRadix(parts[1]);\n        }\n        if (parts[3] != null) {\n            minFraction = parseIntAutoRadix(parts[3]);\n        }\n        if (parts[5] != null) {\n            maxFraction = parseIntAutoRadix(parts[5]);\n        }\n    }\n    return NumberFormatter.format(/** @type {?} */ (value), locale, style, {\n        minimumIntegerDigits: minInt,\n        minimumFractionDigits: minFraction,\n        maximumFractionDigits: maxFraction,\n        currency: currency,\n        currencyAsSymbol: currencyAsSymbol,\n    });\n}\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number according to locale rules.\n * \\@howToUse `number_expression | number[:digitInfo]`\n *\n * Formats a number as text. Group sizing and separator and other locale-specific\n * configurations are based on the active locale.\n *\n * where `expression` is a number:\n *  - `digitInfo` is a `string` which has a following format: <br>\n *     <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>\n *   - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.\n *   - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.\n *   - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.\n *\n * For more information on the acceptable range for each of these numbers and other\n * details see your native internationalization library.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='NumberPipe'}\n *\n * \\@stable\n */\nvar DecimalPipe = (function () {\n    /**\n     * @param {?} _locale\n     */\n    function DecimalPipe(_locale) {\n        this._locale = _locale;\n    }\n    /**\n     * @param {?} value\n     * @param {?=} digits\n     * @return {?}\n     */\n    DecimalPipe.prototype.transform = function (value, digits) {\n        return formatNumber(DecimalPipe, this._locale, value, NumberFormatStyle.Decimal, digits);\n    };\n    return DecimalPipe;\n}());\nDecimalPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'number' },] },\n];\n/**\n * @nocollapse\n */\nDecimalPipe.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_core.LOCALE_ID,] },] },\n]; };\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as a percentage according to locale rules.\n * \\@howToUse `number_expression | percent[:digitInfo]`\n *\n * \\@description\n *\n * Formats a number as percentage.\n *\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='PercentPipe'}\n *\n * \\@stable\n */\nvar PercentPipe = (function () {\n    /**\n     * @param {?} _locale\n     */\n    function PercentPipe(_locale) {\n        this._locale = _locale;\n    }\n    /**\n     * @param {?} value\n     * @param {?=} digits\n     * @return {?}\n     */\n    PercentPipe.prototype.transform = function (value, digits) {\n        return formatNumber(PercentPipe, this._locale, value, NumberFormatStyle.Percent, digits);\n    };\n    return PercentPipe;\n}());\nPercentPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'percent' },] },\n];\n/**\n * @nocollapse\n */\nPercentPipe.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_core.LOCALE_ID,] },] },\n]; };\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a number as currency using locale rules.\n * \\@howToUse `number_expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]`\n * \\@description\n *\n * Use `currency` to format a number as currency.\n *\n * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such\n *    as `USD` for the US dollar and `EUR` for the euro.\n * - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.\n *   - `true`: use symbol (e.g. `$`).\n *   - `false`(default): use code (e.g. `USD`).\n * - `digitInfo` See {\\@link DecimalPipe} for detailed description.\n *\n * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers\n * and may require a polyfill. See [Browser Support](guide/browser-support) for details.\n *\n * ### Example\n *\n * {\\@example common/pipes/ts/number_pipe.ts region='CurrencyPipe'}\n *\n * \\@stable\n */\nvar CurrencyPipe = (function () {\n    /**\n     * @param {?} _locale\n     */\n    function CurrencyPipe(_locale) {\n        this._locale = _locale;\n    }\n    /**\n     * @param {?} value\n     * @param {?=} currencyCode\n     * @param {?=} symbolDisplay\n     * @param {?=} digits\n     * @return {?}\n     */\n    CurrencyPipe.prototype.transform = function (value, currencyCode, symbolDisplay, digits) {\n        if (currencyCode === void 0) { currencyCode = 'USD'; }\n        if (symbolDisplay === void 0) { symbolDisplay = false; }\n        return formatNumber(CurrencyPipe, this._locale, value, NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay);\n    };\n    return CurrencyPipe;\n}());\nCurrencyPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'currency' },] },\n];\n/**\n * @nocollapse\n */\nCurrencyPipe.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_core.LOCALE_ID,] },] },\n]; };\n/**\n * @param {?} text\n * @return {?}\n */\nfunction parseIntAutoRadix(text) {\n    var /** @type {?} */ result = parseInt(text);\n    if (isNaN(result)) {\n        throw new Error('Invalid integer literal when parsing ' + text);\n    }\n    return result;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isNumeric(value) {\n    return !isNaN(value - parseFloat(value));\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ISO8601_DATE_REGEX = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Formats a date according to locale rules.\n * \\@howToUse `date_expression | date[:format]`\n * \\@description\n *\n * Where:\n * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string\n * (https://www.w3.org/TR/NOTE-datetime).\n * - `format` indicates which date/time components to include. The format can be predefined as\n *   shown below or custom as shown in the table.\n *   - `'medium'`: equivalent to `'yMMMdjms'` (e.g. `Sep 3, 2010, 12:05:08 PM` for `en-US`)\n *   - `'short'`: equivalent to `'yMdjm'` (e.g. `9/3/2010, 12:05 PM` for `en-US`)\n *   - `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. `Friday, September 3, 2010` for `en-US`)\n *   - `'longDate'`: equivalent to `'yMMMMd'` (e.g. `September 3, 2010` for `en-US`)\n *   - `'mediumDate'`: equivalent to `'yMMMd'` (e.g. `Sep 3, 2010` for `en-US`)\n *   - `'shortDate'`: equivalent to `'yMd'` (e.g. `9/3/2010` for `en-US`)\n *   - `'mediumTime'`: equivalent to `'jms'` (e.g. `12:05:08 PM` for `en-US`)\n *   - `'shortTime'`: equivalent to `'jm'` (e.g. `12:05 PM` for `en-US`)\n *\n *\n *  | Component | Symbol | Narrow | Short Form   | Long Form         | Numeric   | 2-digit   |\n *  |-----------|:------:|--------|--------------|-------------------|-----------|-----------|\n *  | era       |   G    | G (A)  | GGG (AD)     | GGGG (Anno Domini)| -         | -         |\n *  | year      |   y    | -      | -            | -                 | y (2015)  | yy (15)   |\n *  | month     |   M    | L (S)  | MMM (Sep)    | MMMM (September)  | M (9)     | MM (09)   |\n *  | day       |   d    | -      | -            | -                 | d (3)     | dd (03)   |\n *  | weekday   |   E    | E (S)  | EEE (Sun)    | EEEE (Sunday)     | -         | -         |\n *  | hour      |   j    | -      | -            | -                 | j (13)    | jj (13)   |\n *  | hour12    |   h    | -      | -            | -                 | h (1 PM)  | hh (01 PM)|\n *  | hour24    |   H    | -      | -            | -                 | H (13)    | HH (13)   |\n *  | minute    |   m    | -      | -            | -                 | m (5)     | mm (05)   |\n *  | second    |   s    | -      | -            | -                 | s (9)     | ss (09)   |\n *  | timezone  |   z    | -      | -            | z (Pacific Standard Time)| -  | -         |\n *  | timezone  |   Z    | -      | Z (GMT-8:00) | -                 | -         | -         |\n *  | timezone  |   a    | -      | a (PM)       | -                 | -         | -         |\n *\n * In javascript, only the components specified will be respected (not the ordering,\n * punctuations, ...) and details of the formatting will be dependent on the locale.\n *\n * Timezone of the formatted text will be the local system timezone of the end-user's machine.\n *\n * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not\n * applied and the formatted text will have the same day, month and year of the expression.\n *\n * WARNINGS:\n * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.\n *   Instead users should treat the date as an immutable object and change the reference when the\n *   pipe needs to re-run (this is to avoid reformatting the date on every change detection run\n *   which would be an expensive operation).\n * - this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera\n *   browsers.\n *\n * ### Examples\n *\n * Assuming `dateObj` is (year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11)\n * in the _local_ time and locale is 'en-US':\n *\n * ```\n *     {{ dateObj | date }}               // output is 'Jun 15, 2015'\n *     {{ dateObj | date:'medium' }}      // output is 'Jun 15, 2015, 9:43:11 PM'\n *     {{ dateObj | date:'shortTime' }}   // output is '9:43 PM'\n *     {{ dateObj | date:'mmss' }}        // output is '43:11'\n * ```\n *\n * {\\@example common/pipes/ts/date_pipe.ts region='DatePipe'}\n *\n * \\@stable\n */\nvar DatePipe = (function () {\n    /**\n     * @param {?} _locale\n     */\n    function DatePipe(_locale) {\n        this._locale = _locale;\n    }\n    /**\n     * @param {?} value\n     * @param {?=} pattern\n     * @return {?}\n     */\n    DatePipe.prototype.transform = function (value, pattern) {\n        if (pattern === void 0) { pattern = 'mediumDate'; }\n        var /** @type {?} */ date;\n        if (isBlank(value) || value !== value)\n            return null;\n        if (typeof value === 'string') {\n            value = value.trim();\n        }\n        if (isDate(value)) {\n            date = value;\n        }\n        else if (isNumeric(value)) {\n            date = new Date(parseFloat(value));\n        }\n        else if (typeof value === 'string' && /^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n            /**\n             * For ISO Strings without time the day, month and year must be extracted from the ISO String\n             * before Date creation to avoid time offset and errors in the new Date.\n             * If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n             * date, some browsers (e.g. IE 9) will throw an invalid Date error\n             * If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n             * is applied\n             * Note: ISO months are 0 for January, 1 for February, ...\n             */\n            var _a = value.split('-').map(function (val) { return parseInt(val, 10); }), y = _a[0], m = _a[1], d = _a[2];\n            date = new Date(y, m - 1, d);\n        }\n        else {\n            date = new Date(value);\n        }\n        if (!isDate(date)) {\n            var /** @type {?} */ match = void 0;\n            if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {\n                date = isoStringToDate(match);\n            }\n            else {\n                throw invalidPipeArgumentError(DatePipe, value);\n            }\n        }\n        return DateFormatter.format(date, this._locale, DatePipe._ALIASES[pattern] || pattern);\n    };\n    return DatePipe;\n}());\n/**\n * \\@internal\n */\nDatePipe._ALIASES = {\n    'medium': 'yMMMdjms',\n    'short': 'yMdjm',\n    'fullDate': 'yMMMMEEEEd',\n    'longDate': 'yMMMMd',\n    'mediumDate': 'yMMMd',\n    'shortDate': 'yMd',\n    'mediumTime': 'jms',\n    'shortTime': 'jm'\n};\nDatePipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'date', pure: true },] },\n];\n/**\n * @nocollapse\n */\nDatePipe.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_core.LOCALE_ID,] },] },\n]; };\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction isBlank(obj) {\n    return obj == null || obj === '';\n}\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction isDate(obj) {\n    return obj instanceof Date && !isNaN(obj.valueOf());\n}\n/**\n * @param {?} match\n * @return {?}\n */\nfunction isoStringToDate(match) {\n    var /** @type {?} */ date = new Date(0);\n    var /** @type {?} */ tzHour = 0;\n    var /** @type {?} */ tzMin = 0;\n    var /** @type {?} */ dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n    var /** @type {?} */ timeSetter = match[8] ? date.setUTCHours : date.setHours;\n    if (match[9]) {\n        tzHour = toInt(match[9] + match[10]);\n        tzMin = toInt(match[9] + match[11]);\n    }\n    dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n    var /** @type {?} */ h = toInt(match[4] || '0') - tzHour;\n    var /** @type {?} */ m = toInt(match[5] || '0') - tzMin;\n    var /** @type {?} */ s = toInt(match[6] || '0');\n    var /** @type {?} */ ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n    timeSetter.call(date, h, m, s, ms);\n    return date;\n}\n/**\n * @param {?} str\n * @return {?}\n */\nfunction toInt(str) {\n    return parseInt(str, 10);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _INTERPOLATION_REGEXP = /#/g;\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Maps a value to a string that pluralizes the value according to locale rules.\n * \\@howToUse `expression | i18nPlural:mapping`\n * \\@description\n *\n *  Where:\n *  - `expression` is a number.\n *  - `mapping` is an object that mimics the ICU format, see\n *    http://userguide.icu-project.org/formatparse/messages\n *\n *  ## Example\n *\n * {\\@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}\n *\n * \\@experimental\n */\nvar I18nPluralPipe = (function () {\n    /**\n     * @param {?} _localization\n     */\n    function I18nPluralPipe(_localization) {\n        this._localization = _localization;\n    }\n    /**\n     * @param {?} value\n     * @param {?} pluralMap\n     * @return {?}\n     */\n    I18nPluralPipe.prototype.transform = function (value, pluralMap) {\n        if (value == null)\n            return '';\n        if (typeof pluralMap !== 'object' || pluralMap === null) {\n            throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);\n        }\n        var /** @type {?} */ key = getPluralCategory(value, Object.keys(pluralMap), this._localization);\n        return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());\n    };\n    return I18nPluralPipe;\n}());\nI18nPluralPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'i18nPlural', pure: true },] },\n];\n/**\n * @nocollapse\n */\nI18nPluralPipe.ctorParameters = function () { return [\n    { type: NgLocalization, },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Generic selector that displays the string that matches the current value.\n * \\@howToUse `expression | i18nSelect:mapping`\n * \\@description\n *\n *  Where `mapping` is an object that indicates the text that should be displayed\n *  for different values of the provided `expression`.\n *  If none of the keys of the mapping match the value of the `expression`, then the content\n *  of the `other` key is returned when present, otherwise an empty string is returned.\n *\n *  ## Example\n *\n * {\\@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}\n *\n *  \\@experimental\n */\nvar I18nSelectPipe = (function () {\n    function I18nSelectPipe() {\n    }\n    /**\n     * @param {?} value\n     * @param {?} mapping\n     * @return {?}\n     */\n    I18nSelectPipe.prototype.transform = function (value, mapping) {\n        if (value == null)\n            return '';\n        if (typeof mapping !== 'object' || typeof value !== 'string') {\n            throw invalidPipeArgumentError(I18nSelectPipe, mapping);\n        }\n        if (mapping.hasOwnProperty(value)) {\n            return mapping[value];\n        }\n        if (mapping.hasOwnProperty('other')) {\n            return mapping['other'];\n        }\n        return '';\n    };\n    return I18nSelectPipe;\n}());\nI18nSelectPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'i18nSelect', pure: true },] },\n];\n/**\n * @nocollapse\n */\nI18nSelectPipe.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Converts value into JSON string.\n * \\@howToUse `expression | json`\n * \\@description\n *\n * Converts value into string using `JSON.stringify`. Useful for debugging.\n *\n * ### Example\n * {\\@example common/pipes/ts/json_pipe.ts region='JsonPipe'}\n *\n * \\@stable\n */\nvar JsonPipe = (function () {\n    function JsonPipe() {\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    JsonPipe.prototype.transform = function (value) { return JSON.stringify(value, null, 2); };\n    return JsonPipe;\n}());\nJsonPipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'json', pure: false },] },\n];\n/**\n * @nocollapse\n */\nJsonPipe.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@ngModule CommonModule\n * \\@whatItDoes Creates a new List or String containing a subset (slice) of the elements.\n * \\@howToUse `array_or_string_expression | slice:start[:end]`\n * \\@description\n *\n * Where the input expression is a `List` or `String`, and:\n * - `start`: The starting index of the subset to return.\n *   - **a positive integer**: return the item at `start` index and all items after\n *     in the list or string expression.\n *   - **a negative integer**: return the item at `start` index from the end and all items after\n *     in the list or string expression.\n *   - **if positive and greater than the size of the expression**: return an empty list or string.\n *   - **if negative and greater than the size of the expression**: return entire list or string.\n * - `end`: The ending index of the subset to return.\n *   - **omitted**: return all items until the end.\n *   - **if positive**: return all items before `end` index of the list or string.\n *   - **if negative**: return all items before `end` index from the end of the list or string.\n *\n * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`\n * and `String.prototype.slice()`.\n *\n * When operating on a [List], the returned list is always a copy even when all\n * the elements are being returned.\n *\n * When operating on a blank value, the pipe returns the blank value.\n *\n * ## List Example\n *\n * This `ngFor` example:\n *\n * {\\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}\n *\n * produces the following:\n *\n *     <li>b</li>\n *     <li>c</li>\n *\n * ## String Examples\n *\n * {\\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}\n *\n * \\@stable\n */\nvar SlicePipe = (function () {\n    function SlicePipe() {\n    }\n    /**\n     * @param {?} value\n     * @param {?} start\n     * @param {?=} end\n     * @return {?}\n     */\n    SlicePipe.prototype.transform = function (value, start, end) {\n        if (value == null)\n            return value;\n        if (!this.supports(value)) {\n            throw invalidPipeArgumentError(SlicePipe, value);\n        }\n        return value.slice(start, end);\n    };\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    SlicePipe.prototype.supports = function (obj) { return typeof obj === 'string' || Array.isArray(obj); };\n    return SlicePipe;\n}());\nSlicePipe.decorators = [\n    { type: _angular_core.Pipe, args: [{ name: 'slice', pure: false },] },\n];\n/**\n * @nocollapse\n */\nSlicePipe.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * This module provides a set of common Pipes.\n */\n/**\n * A collection of Angular pipes that are likely to be used in each and every application.\n */\nvar COMMON_PIPES = [\n    AsyncPipe,\n    UpperCasePipe,\n    LowerCasePipe,\n    JsonPipe,\n    SlicePipe,\n    DecimalPipe,\n    PercentPipe,\n    TitleCasePipe,\n    CurrencyPipe,\n    DatePipe,\n    I18nPluralPipe,\n    I18nSelectPipe,\n];\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * The module that includes all the basic Angular directives like {\\@link NgIf}, {\\@link NgForOf}, ...\n *\n * \\@stable\n */\nvar CommonModule = (function () {\n    function CommonModule() {\n    }\n    return CommonModule;\n}());\nCommonModule.decorators = [\n    { type: _angular_core.NgModule, args: [{\n                declarations: [COMMON_DIRECTIVES, COMMON_PIPES],\n                exports: [COMMON_DIRECTIVES, COMMON_PIPES],\n                providers: [\n                    { provide: NgLocalization, useClass: NgLocaleLocalization },\n                ],\n            },] },\n];\n/**\n * @nocollapse\n */\nCommonModule.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar PLATFORM_BROWSER_ID = 'browser';\nvar PLATFORM_SERVER_ID = 'server';\nvar PLATFORM_WORKER_APP_ID = 'browserWorkerApp';\nvar PLATFORM_WORKER_UI_ID = 'browserWorkerUi';\n/**\n * Returns whether a platform id represents a browser platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformBrowser(platformId) {\n    return platformId === PLATFORM_BROWSER_ID;\n}\n/**\n * Returns whether a platform id represents a server platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformServer(platformId) {\n    return platformId === PLATFORM_SERVER_ID;\n}\n/**\n * Returns whether a platform id represents a web worker app platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformWorkerApp(platformId) {\n    return platformId === PLATFORM_WORKER_APP_ID;\n}\n/**\n * Returns whether a platform id represents a web worker UI platform.\n * \\@experimental\n * @param {?} platformId\n * @return {?}\n */\nfunction isPlatformWorkerUi(platformId) {\n    return platformId === PLATFORM_WORKER_UI_ID;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n/**\n * \\@stable\n */\nvar VERSION = new _angular_core.Version('4.2.3');\n\nexports.NgLocaleLocalization = NgLocaleLocalization;\nexports.NgLocalization = NgLocalization;\nexports.CommonModule = CommonModule;\nexports.NgClass = NgClass;\nexports.NgFor = NgFor;\nexports.NgForOf = NgForOf;\nexports.NgForOfContext = NgForOfContext;\nexports.NgIf = NgIf;\nexports.NgIfContext = NgIfContext;\nexports.NgPlural = NgPlural;\nexports.NgPluralCase = NgPluralCase;\nexports.NgStyle = NgStyle;\nexports.NgSwitch = NgSwitch;\nexports.NgSwitchCase = NgSwitchCase;\nexports.NgSwitchDefault = NgSwitchDefault;\nexports.NgTemplateOutlet = NgTemplateOutlet;\nexports.NgComponentOutlet = NgComponentOutlet;\nexports.AsyncPipe = AsyncPipe;\nexports.DatePipe = DatePipe;\nexports.I18nPluralPipe = I18nPluralPipe;\nexports.I18nSelectPipe = I18nSelectPipe;\nexports.JsonPipe = JsonPipe;\nexports.LowerCasePipe = LowerCasePipe;\nexports.CurrencyPipe = CurrencyPipe;\nexports.DecimalPipe = DecimalPipe;\nexports.PercentPipe = PercentPipe;\nexports.SlicePipe = SlicePipe;\nexports.UpperCasePipe = UpperCasePipe;\nexports.TitleCasePipe = TitleCasePipe;\nexports.ɵPLATFORM_BROWSER_ID = PLATFORM_BROWSER_ID;\nexports.ɵPLATFORM_SERVER_ID = PLATFORM_SERVER_ID;\nexports.ɵPLATFORM_WORKER_APP_ID = PLATFORM_WORKER_APP_ID;\nexports.ɵPLATFORM_WORKER_UI_ID = PLATFORM_WORKER_UI_ID;\nexports.isPlatformBrowser = isPlatformBrowser;\nexports.isPlatformServer = isPlatformServer;\nexports.isPlatformWorkerApp = isPlatformWorkerApp;\nexports.isPlatformWorkerUi = isPlatformWorkerUi;\nexports.VERSION = VERSION;\nexports.PlatformLocation = PlatformLocation;\nexports.LOCATION_INITIALIZED = LOCATION_INITIALIZED;\nexports.LocationStrategy = LocationStrategy;\nexports.APP_BASE_HREF = APP_BASE_HREF;\nexports.HashLocationStrategy = HashLocationStrategy;\nexports.PathLocationStrategy = PathLocationStrategy;\nexports.Location = Location;\nexports.ɵa = COMMON_DIRECTIVES;\nexports.ɵb = COMMON_PIPES;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=common.umd.js.map\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', '@angular/core'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.compiler = global.ng.compiler || {}),global.ng.core));\n}(this, (function (exports,_angular_core) { 'use strict';\n\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = Object.setPrototypeOf ||\n    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n    function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n\nfunction __extends(d, b) {\n    extendStatics(d, b);\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n/**\n * \\@stable\n */\nvar VERSION = new _angular_core.Version('4.2.3');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A segment of text within the template.\n */\nvar TextAst = (function () {\n    /**\n     * @param {?} value\n     * @param {?} ngContentIndex\n     * @param {?} sourceSpan\n     */\n    function TextAst(value, ngContentIndex, sourceSpan) {\n        this.value = value;\n        this.ngContentIndex = ngContentIndex;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    TextAst.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };\n    return TextAst;\n}());\n/**\n * A bound expression within the text of a template.\n */\nvar BoundTextAst = (function () {\n    /**\n     * @param {?} value\n     * @param {?} ngContentIndex\n     * @param {?} sourceSpan\n     */\n    function BoundTextAst(value, ngContentIndex, sourceSpan) {\n        this.value = value;\n        this.ngContentIndex = ngContentIndex;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    BoundTextAst.prototype.visit = function (visitor, context) {\n        return visitor.visitBoundText(this, context);\n    };\n    return BoundTextAst;\n}());\n/**\n * A plain attribute on an element.\n */\nvar AttrAst = (function () {\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function AttrAst(name, value, sourceSpan) {\n        this.name = name;\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    AttrAst.prototype.visit = function (visitor, context) { return visitor.visitAttr(this, context); };\n    return AttrAst;\n}());\n/**\n * A binding for an element property (e.g. `[property]=\"expression\"`) or an animation trigger (e.g.\n * `[\\@trigger]=\"stateExp\"`)\n */\nvar BoundElementPropertyAst = (function () {\n    /**\n     * @param {?} name\n     * @param {?} type\n     * @param {?} securityContext\n     * @param {?} value\n     * @param {?} unit\n     * @param {?} sourceSpan\n     */\n    function BoundElementPropertyAst(name, type, securityContext, value, unit, sourceSpan) {\n        this.name = name;\n        this.type = type;\n        this.securityContext = securityContext;\n        this.value = value;\n        this.unit = unit;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    BoundElementPropertyAst.prototype.visit = function (visitor, context) {\n        return visitor.visitElementProperty(this, context);\n    };\n    Object.defineProperty(BoundElementPropertyAst.prototype, \"isAnimation\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.type === PropertyBindingType.Animation; },\n        enumerable: true,\n        configurable: true\n    });\n    return BoundElementPropertyAst;\n}());\n/**\n * A binding for an element event (e.g. `(event)=\"handler()\"`) or an animation trigger event (e.g.\n * `(\\@trigger.phase)=\"callback($event)\"`).\n */\nvar BoundEventAst = (function () {\n    /**\n     * @param {?} name\n     * @param {?} target\n     * @param {?} phase\n     * @param {?} handler\n     * @param {?} sourceSpan\n     */\n    function BoundEventAst(name, target, phase, handler, sourceSpan) {\n        this.name = name;\n        this.target = target;\n        this.phase = phase;\n        this.handler = handler;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} name\n     * @param {?} target\n     * @param {?} phase\n     * @return {?}\n     */\n    BoundEventAst.calcFullName = function (name, target, phase) {\n        if (target) {\n            return target + \":\" + name;\n        }\n        else if (phase) {\n            return \"@\" + name + \".\" + phase;\n        }\n        else {\n            return name;\n        }\n    };\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    BoundEventAst.prototype.visit = function (visitor, context) {\n        return visitor.visitEvent(this, context);\n    };\n    Object.defineProperty(BoundEventAst.prototype, \"fullName\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return BoundEventAst.calcFullName(this.name, this.target, this.phase); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BoundEventAst.prototype, \"isAnimation\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return !!this.phase; },\n        enumerable: true,\n        configurable: true\n    });\n    return BoundEventAst;\n}());\n/**\n * A reference declaration on an element (e.g. `let someName=\"expression\"`).\n */\nvar ReferenceAst = (function () {\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function ReferenceAst(name, value, sourceSpan) {\n        this.name = name;\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ReferenceAst.prototype.visit = function (visitor, context) {\n        return visitor.visitReference(this, context);\n    };\n    return ReferenceAst;\n}());\n/**\n * A variable declaration on a <ng-template> (e.g. `var-someName=\"someLocalName\"`).\n */\nvar VariableAst = (function () {\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function VariableAst(name, value, sourceSpan) {\n        this.name = name;\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    VariableAst.prototype.visit = function (visitor, context) {\n        return visitor.visitVariable(this, context);\n    };\n    return VariableAst;\n}());\n/**\n * An element declaration in a template.\n */\nvar ElementAst = (function () {\n    /**\n     * @param {?} name\n     * @param {?} attrs\n     * @param {?} inputs\n     * @param {?} outputs\n     * @param {?} references\n     * @param {?} directives\n     * @param {?} providers\n     * @param {?} hasViewContainer\n     * @param {?} queryMatches\n     * @param {?} children\n     * @param {?} ngContentIndex\n     * @param {?} sourceSpan\n     * @param {?} endSourceSpan\n     */\n    function ElementAst(name, attrs, inputs, outputs, references, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan, endSourceSpan) {\n        this.name = name;\n        this.attrs = attrs;\n        this.inputs = inputs;\n        this.outputs = outputs;\n        this.references = references;\n        this.directives = directives;\n        this.providers = providers;\n        this.hasViewContainer = hasViewContainer;\n        this.queryMatches = queryMatches;\n        this.children = children;\n        this.ngContentIndex = ngContentIndex;\n        this.sourceSpan = sourceSpan;\n        this.endSourceSpan = endSourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ElementAst.prototype.visit = function (visitor, context) {\n        return visitor.visitElement(this, context);\n    };\n    return ElementAst;\n}());\n/**\n * A `<ng-template>` element included in an Angular template.\n */\nvar EmbeddedTemplateAst = (function () {\n    /**\n     * @param {?} attrs\n     * @param {?} outputs\n     * @param {?} references\n     * @param {?} variables\n     * @param {?} directives\n     * @param {?} providers\n     * @param {?} hasViewContainer\n     * @param {?} queryMatches\n     * @param {?} children\n     * @param {?} ngContentIndex\n     * @param {?} sourceSpan\n     */\n    function EmbeddedTemplateAst(attrs, outputs, references, variables, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan) {\n        this.attrs = attrs;\n        this.outputs = outputs;\n        this.references = references;\n        this.variables = variables;\n        this.directives = directives;\n        this.providers = providers;\n        this.hasViewContainer = hasViewContainer;\n        this.queryMatches = queryMatches;\n        this.children = children;\n        this.ngContentIndex = ngContentIndex;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    EmbeddedTemplateAst.prototype.visit = function (visitor, context) {\n        return visitor.visitEmbeddedTemplate(this, context);\n    };\n    return EmbeddedTemplateAst;\n}());\n/**\n * A directive property with a bound value (e.g. `*ngIf=\"condition\").\n */\nvar BoundDirectivePropertyAst = (function () {\n    /**\n     * @param {?} directiveName\n     * @param {?} templateName\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function BoundDirectivePropertyAst(directiveName, templateName, value, sourceSpan) {\n        this.directiveName = directiveName;\n        this.templateName = templateName;\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    BoundDirectivePropertyAst.prototype.visit = function (visitor, context) {\n        return visitor.visitDirectiveProperty(this, context);\n    };\n    return BoundDirectivePropertyAst;\n}());\n/**\n * A directive declared on an element.\n */\nvar DirectiveAst = (function () {\n    /**\n     * @param {?} directive\n     * @param {?} inputs\n     * @param {?} hostProperties\n     * @param {?} hostEvents\n     * @param {?} contentQueryStartId\n     * @param {?} sourceSpan\n     */\n    function DirectiveAst(directive, inputs, hostProperties, hostEvents, contentQueryStartId, sourceSpan) {\n        this.directive = directive;\n        this.inputs = inputs;\n        this.hostProperties = hostProperties;\n        this.hostEvents = hostEvents;\n        this.contentQueryStartId = contentQueryStartId;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    DirectiveAst.prototype.visit = function (visitor, context) {\n        return visitor.visitDirective(this, context);\n    };\n    return DirectiveAst;\n}());\n/**\n * A provider declared on an element\n */\nvar ProviderAst = (function () {\n    /**\n     * @param {?} token\n     * @param {?} multiProvider\n     * @param {?} eager\n     * @param {?} providers\n     * @param {?} providerType\n     * @param {?} lifecycleHooks\n     * @param {?} sourceSpan\n     */\n    function ProviderAst(token, multiProvider, eager, providers, providerType, lifecycleHooks, sourceSpan) {\n        this.token = token;\n        this.multiProvider = multiProvider;\n        this.eager = eager;\n        this.providers = providers;\n        this.providerType = providerType;\n        this.lifecycleHooks = lifecycleHooks;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ProviderAst.prototype.visit = function (visitor, context) {\n        // No visit method in the visitor for now...\n        return null;\n    };\n    return ProviderAst;\n}());\nvar ProviderAstType = {};\nProviderAstType.PublicService = 0;\nProviderAstType.PrivateService = 1;\nProviderAstType.Component = 2;\nProviderAstType.Directive = 3;\nProviderAstType.Builtin = 4;\nProviderAstType[ProviderAstType.PublicService] = \"PublicService\";\nProviderAstType[ProviderAstType.PrivateService] = \"PrivateService\";\nProviderAstType[ProviderAstType.Component] = \"Component\";\nProviderAstType[ProviderAstType.Directive] = \"Directive\";\nProviderAstType[ProviderAstType.Builtin] = \"Builtin\";\n/**\n * Position where content is to be projected (instance of `<ng-content>` in a template).\n */\nvar NgContentAst = (function () {\n    /**\n     * @param {?} index\n     * @param {?} ngContentIndex\n     * @param {?} sourceSpan\n     */\n    function NgContentAst(index, ngContentIndex, sourceSpan) {\n        this.index = index;\n        this.ngContentIndex = ngContentIndex;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    NgContentAst.prototype.visit = function (visitor, context) {\n        return visitor.visitNgContent(this, context);\n    };\n    return NgContentAst;\n}());\nvar PropertyBindingType = {};\nPropertyBindingType.Property = 0;\nPropertyBindingType.Attribute = 1;\nPropertyBindingType.Class = 2;\nPropertyBindingType.Style = 3;\nPropertyBindingType.Animation = 4;\nPropertyBindingType[PropertyBindingType.Property] = \"Property\";\nPropertyBindingType[PropertyBindingType.Attribute] = \"Attribute\";\nPropertyBindingType[PropertyBindingType.Class] = \"Class\";\nPropertyBindingType[PropertyBindingType.Style] = \"Style\";\nPropertyBindingType[PropertyBindingType.Animation] = \"Animation\";\n/**\n * A visitor that accepts each node but doesn't do anything. It is intended to be used\n * as the base class for a visitor that is only interested in a subset of the node types.\n */\nvar NullTemplateVisitor = (function () {\n    function NullTemplateVisitor() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitNgContent = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitEmbeddedTemplate = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitElement = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitReference = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitVariable = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitEvent = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitElementProperty = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitAttr = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitBoundText = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitText = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitDirective = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullTemplateVisitor.prototype.visitDirectiveProperty = function (ast, context) { };\n    return NullTemplateVisitor;\n}());\n/**\n * Base class that can be used to build a visitor that visits each node\n * in an template ast recursively.\n */\nvar RecursiveTemplateAstVisitor = (function (_super) {\n    __extends(RecursiveTemplateAstVisitor, _super);\n    function RecursiveTemplateAstVisitor() {\n        return _super.call(this) || this;\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate = function (ast, context) {\n        return this.visitChildren(context, function (visit) {\n            visit(ast.attrs);\n            visit(ast.references);\n            visit(ast.variables);\n            visit(ast.directives);\n            visit(ast.providers);\n            visit(ast.children);\n        });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveTemplateAstVisitor.prototype.visitElement = function (ast, context) {\n        return this.visitChildren(context, function (visit) {\n            visit(ast.attrs);\n            visit(ast.inputs);\n            visit(ast.outputs);\n            visit(ast.references);\n            visit(ast.directives);\n            visit(ast.providers);\n            visit(ast.children);\n        });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveTemplateAstVisitor.prototype.visitDirective = function (ast, context) {\n        return this.visitChildren(context, function (visit) {\n            visit(ast.inputs);\n            visit(ast.hostProperties);\n            visit(ast.hostEvents);\n        });\n    };\n    /**\n     * @template T\n     * @param {?} context\n     * @param {?} cb\n     * @return {?}\n     */\n    RecursiveTemplateAstVisitor.prototype.visitChildren = function (context, cb) {\n        var /** @type {?} */ results = [];\n        var /** @type {?} */ t = this;\n        /**\n         * @template T\n         * @param {?} children\n         * @return {?}\n         */\n        function visit(children) {\n            if (children && children.length)\n                results.push(templateVisitAll(t, children, context));\n        }\n        cb(visit);\n        return [].concat.apply([], results);\n    };\n    return RecursiveTemplateAstVisitor;\n}(NullTemplateVisitor));\n/**\n * Visit every node in a list of {\\@link TemplateAst}s with the given {\\@link TemplateAstVisitor}.\n * @param {?} visitor\n * @param {?} asts\n * @param {?=} context\n * @return {?}\n */\nfunction templateVisitAll(visitor, asts, context) {\n    if (context === void 0) { context = null; }\n    var /** @type {?} */ result = [];\n    var /** @type {?} */ visit = visitor.visit ?\n        function (ast) { return ((visitor.visit))(ast, context) || ast.visit(visitor, context); } :\n        function (ast) { return ast.visit(visitor, context); };\n    asts.forEach(function (ast) {\n        var /** @type {?} */ astResult = visit(ast);\n        if (astResult) {\n            result.push(astResult);\n        }\n    });\n    return result;\n}\n/**\n * A token representing the a reference to a static type.\n *\n * This token is unique for a filePath and name and can be used as a hash table key.\n */\nvar StaticSymbol = (function () {\n    /**\n     * @param {?} filePath\n     * @param {?} name\n     * @param {?} members\n     */\n    function StaticSymbol(filePath, name, members) {\n        this.filePath = filePath;\n        this.name = name;\n        this.members = members;\n    }\n    /**\n     * @return {?}\n     */\n    StaticSymbol.prototype.assertNoMembers = function () {\n        if (this.members.length) {\n            throw new Error(\"Illegal state: symbol without members expected, but got \" + JSON.stringify(this) + \".\");\n        }\n    };\n    return StaticSymbol;\n}());\n/**\n * A cache of static symbol used by the StaticReflector to return the same symbol for the\n * same symbol values.\n */\nvar StaticSymbolCache = (function () {\n    function StaticSymbolCache() {\n        this.cache = new Map();\n    }\n    /**\n     * @param {?} declarationFile\n     * @param {?} name\n     * @param {?=} members\n     * @return {?}\n     */\n    StaticSymbolCache.prototype.get = function (declarationFile, name, members) {\n        members = members || [];\n        var /** @type {?} */ memberSuffix = members.length ? \".\" + members.join('.') : '';\n        var /** @type {?} */ key = \"\\\"\" + declarationFile + \"\\\".\" + name + memberSuffix;\n        var /** @type {?} */ result = this.cache.get(key);\n        if (!result) {\n            result = new StaticSymbol(declarationFile, name, members);\n            this.cache.set(key, result);\n        }\n        return result;\n    };\n    return StaticSymbolCache;\n}());\nvar TagContentType = {};\nTagContentType.RAW_TEXT = 0;\nTagContentType.ESCAPABLE_RAW_TEXT = 1;\nTagContentType.PARSABLE_DATA = 2;\nTagContentType[TagContentType.RAW_TEXT] = \"RAW_TEXT\";\nTagContentType[TagContentType.ESCAPABLE_RAW_TEXT] = \"ESCAPABLE_RAW_TEXT\";\nTagContentType[TagContentType.PARSABLE_DATA] = \"PARSABLE_DATA\";\n/**\n * @param {?} elementName\n * @return {?}\n */\nfunction splitNsName(elementName) {\n    if (elementName[0] != ':') {\n        return [null, elementName];\n    }\n    var /** @type {?} */ colonIndex = elementName.indexOf(':', 1);\n    if (colonIndex == -1) {\n        throw new Error(\"Unsupported format \\\"\" + elementName + \"\\\" expecting \\\":namespace:name\\\"\");\n    }\n    return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction isNgContainer(tagName) {\n    return splitNsName(tagName)[1] === 'ng-container';\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction isNgContent(tagName) {\n    return splitNsName(tagName)[1] === 'ng-content';\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction isNgTemplate(tagName) {\n    return splitNsName(tagName)[1] === 'ng-template';\n}\n/**\n * @param {?} fullName\n * @return {?}\n */\nfunction getNsPrefix(fullName) {\n    return fullName === null ? null : splitNsName(fullName)[0];\n}\n/**\n * @param {?} prefix\n * @param {?} localName\n * @return {?}\n */\nfunction mergeNsAndName(prefix, localName) {\n    return prefix ? \":\" + prefix + \":\" + localName : localName;\n}\n// see http://www.w3.org/TR/html51/syntax.html#named-character-references\n// see https://html.spec.whatwg.org/multipage/entities.json\n// This list is not exhaustive to keep the compiler footprint low.\n// The `&#123;` / `&#x1ab;` syntax should be used when the named character reference does not\n// exist.\nvar NAMED_ENTITIES = {\n    'Aacute': '\\u00C1',\n    'aacute': '\\u00E1',\n    'Acirc': '\\u00C2',\n    'acirc': '\\u00E2',\n    'acute': '\\u00B4',\n    'AElig': '\\u00C6',\n    'aelig': '\\u00E6',\n    'Agrave': '\\u00C0',\n    'agrave': '\\u00E0',\n    'alefsym': '\\u2135',\n    'Alpha': '\\u0391',\n    'alpha': '\\u03B1',\n    'amp': '&',\n    'and': '\\u2227',\n    'ang': '\\u2220',\n    'apos': '\\u0027',\n    'Aring': '\\u00C5',\n    'aring': '\\u00E5',\n    'asymp': '\\u2248',\n    'Atilde': '\\u00C3',\n    'atilde': '\\u00E3',\n    'Auml': '\\u00C4',\n    'auml': '\\u00E4',\n    'bdquo': '\\u201E',\n    'Beta': '\\u0392',\n    'beta': '\\u03B2',\n    'brvbar': '\\u00A6',\n    'bull': '\\u2022',\n    'cap': '\\u2229',\n    'Ccedil': '\\u00C7',\n    'ccedil': '\\u00E7',\n    'cedil': '\\u00B8',\n    'cent': '\\u00A2',\n    'Chi': '\\u03A7',\n    'chi': '\\u03C7',\n    'circ': '\\u02C6',\n    'clubs': '\\u2663',\n    'cong': '\\u2245',\n    'copy': '\\u00A9',\n    'crarr': '\\u21B5',\n    'cup': '\\u222A',\n    'curren': '\\u00A4',\n    'dagger': '\\u2020',\n    'Dagger': '\\u2021',\n    'darr': '\\u2193',\n    'dArr': '\\u21D3',\n    'deg': '\\u00B0',\n    'Delta': '\\u0394',\n    'delta': '\\u03B4',\n    'diams': '\\u2666',\n    'divide': '\\u00F7',\n    'Eacute': '\\u00C9',\n    'eacute': '\\u00E9',\n    'Ecirc': '\\u00CA',\n    'ecirc': '\\u00EA',\n    'Egrave': '\\u00C8',\n    'egrave': '\\u00E8',\n    'empty': '\\u2205',\n    'emsp': '\\u2003',\n    'ensp': '\\u2002',\n    'Epsilon': '\\u0395',\n    'epsilon': '\\u03B5',\n    'equiv': '\\u2261',\n    'Eta': '\\u0397',\n    'eta': '\\u03B7',\n    'ETH': '\\u00D0',\n    'eth': '\\u00F0',\n    'Euml': '\\u00CB',\n    'euml': '\\u00EB',\n    'euro': '\\u20AC',\n    'exist': '\\u2203',\n    'fnof': '\\u0192',\n    'forall': '\\u2200',\n    'frac12': '\\u00BD',\n    'frac14': '\\u00BC',\n    'frac34': '\\u00BE',\n    'frasl': '\\u2044',\n    'Gamma': '\\u0393',\n    'gamma': '\\u03B3',\n    'ge': '\\u2265',\n    'gt': '>',\n    'harr': '\\u2194',\n    'hArr': '\\u21D4',\n    'hearts': '\\u2665',\n    'hellip': '\\u2026',\n    'Iacute': '\\u00CD',\n    'iacute': '\\u00ED',\n    'Icirc': '\\u00CE',\n    'icirc': '\\u00EE',\n    'iexcl': '\\u00A1',\n    'Igrave': '\\u00CC',\n    'igrave': '\\u00EC',\n    'image': '\\u2111',\n    'infin': '\\u221E',\n    'int': '\\u222B',\n    'Iota': '\\u0399',\n    'iota': '\\u03B9',\n    'iquest': '\\u00BF',\n    'isin': '\\u2208',\n    'Iuml': '\\u00CF',\n    'iuml': '\\u00EF',\n    'Kappa': '\\u039A',\n    'kappa': '\\u03BA',\n    'Lambda': '\\u039B',\n    'lambda': '\\u03BB',\n    'lang': '\\u27E8',\n    'laquo': '\\u00AB',\n    'larr': '\\u2190',\n    'lArr': '\\u21D0',\n    'lceil': '\\u2308',\n    'ldquo': '\\u201C',\n    'le': '\\u2264',\n    'lfloor': '\\u230A',\n    'lowast': '\\u2217',\n    'loz': '\\u25CA',\n    'lrm': '\\u200E',\n    'lsaquo': '\\u2039',\n    'lsquo': '\\u2018',\n    'lt': '<',\n    'macr': '\\u00AF',\n    'mdash': '\\u2014',\n    'micro': '\\u00B5',\n    'middot': '\\u00B7',\n    'minus': '\\u2212',\n    'Mu': '\\u039C',\n    'mu': '\\u03BC',\n    'nabla': '\\u2207',\n    'nbsp': '\\u00A0',\n    'ndash': '\\u2013',\n    'ne': '\\u2260',\n    'ni': '\\u220B',\n    'not': '\\u00AC',\n    'notin': '\\u2209',\n    'nsub': '\\u2284',\n    'Ntilde': '\\u00D1',\n    'ntilde': '\\u00F1',\n    'Nu': '\\u039D',\n    'nu': '\\u03BD',\n    'Oacute': '\\u00D3',\n    'oacute': '\\u00F3',\n    'Ocirc': '\\u00D4',\n    'ocirc': '\\u00F4',\n    'OElig': '\\u0152',\n    'oelig': '\\u0153',\n    'Ograve': '\\u00D2',\n    'ograve': '\\u00F2',\n    'oline': '\\u203E',\n    'Omega': '\\u03A9',\n    'omega': '\\u03C9',\n    'Omicron': '\\u039F',\n    'omicron': '\\u03BF',\n    'oplus': '\\u2295',\n    'or': '\\u2228',\n    'ordf': '\\u00AA',\n    'ordm': '\\u00BA',\n    'Oslash': '\\u00D8',\n    'oslash': '\\u00F8',\n    'Otilde': '\\u00D5',\n    'otilde': '\\u00F5',\n    'otimes': '\\u2297',\n    'Ouml': '\\u00D6',\n    'ouml': '\\u00F6',\n    'para': '\\u00B6',\n    'permil': '\\u2030',\n    'perp': '\\u22A5',\n    'Phi': '\\u03A6',\n    'phi': '\\u03C6',\n    'Pi': '\\u03A0',\n    'pi': '\\u03C0',\n    'piv': '\\u03D6',\n    'plusmn': '\\u00B1',\n    'pound': '\\u00A3',\n    'prime': '\\u2032',\n    'Prime': '\\u2033',\n    'prod': '\\u220F',\n    'prop': '\\u221D',\n    'Psi': '\\u03A8',\n    'psi': '\\u03C8',\n    'quot': '\\u0022',\n    'radic': '\\u221A',\n    'rang': '\\u27E9',\n    'raquo': '\\u00BB',\n    'rarr': '\\u2192',\n    'rArr': '\\u21D2',\n    'rceil': '\\u2309',\n    'rdquo': '\\u201D',\n    'real': '\\u211C',\n    'reg': '\\u00AE',\n    'rfloor': '\\u230B',\n    'Rho': '\\u03A1',\n    'rho': '\\u03C1',\n    'rlm': '\\u200F',\n    'rsaquo': '\\u203A',\n    'rsquo': '\\u2019',\n    'sbquo': '\\u201A',\n    'Scaron': '\\u0160',\n    'scaron': '\\u0161',\n    'sdot': '\\u22C5',\n    'sect': '\\u00A7',\n    'shy': '\\u00AD',\n    'Sigma': '\\u03A3',\n    'sigma': '\\u03C3',\n    'sigmaf': '\\u03C2',\n    'sim': '\\u223C',\n    'spades': '\\u2660',\n    'sub': '\\u2282',\n    'sube': '\\u2286',\n    'sum': '\\u2211',\n    'sup': '\\u2283',\n    'sup1': '\\u00B9',\n    'sup2': '\\u00B2',\n    'sup3': '\\u00B3',\n    'supe': '\\u2287',\n    'szlig': '\\u00DF',\n    'Tau': '\\u03A4',\n    'tau': '\\u03C4',\n    'there4': '\\u2234',\n    'Theta': '\\u0398',\n    'theta': '\\u03B8',\n    'thetasym': '\\u03D1',\n    'thinsp': '\\u2009',\n    'THORN': '\\u00DE',\n    'thorn': '\\u00FE',\n    'tilde': '\\u02DC',\n    'times': '\\u00D7',\n    'trade': '\\u2122',\n    'Uacute': '\\u00DA',\n    'uacute': '\\u00FA',\n    'uarr': '\\u2191',\n    'uArr': '\\u21D1',\n    'Ucirc': '\\u00DB',\n    'ucirc': '\\u00FB',\n    'Ugrave': '\\u00D9',\n    'ugrave': '\\u00F9',\n    'uml': '\\u00A8',\n    'upsih': '\\u03D2',\n    'Upsilon': '\\u03A5',\n    'upsilon': '\\u03C5',\n    'Uuml': '\\u00DC',\n    'uuml': '\\u00FC',\n    'weierp': '\\u2118',\n    'Xi': '\\u039E',\n    'xi': '\\u03BE',\n    'Yacute': '\\u00DD',\n    'yacute': '\\u00FD',\n    'yen': '\\u00A5',\n    'yuml': '\\u00FF',\n    'Yuml': '\\u0178',\n    'Zeta': '\\u0396',\n    'zeta': '\\u03B6',\n    'zwj': '\\u200D',\n    'zwnj': '\\u200C',\n};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar HtmlTagDefinition = (function () {\n    /**\n     * @param {?=} __0\n     */\n    function HtmlTagDefinition(_a) {\n        var _b = _a === void 0 ? {} : _a, closedByChildren = _b.closedByChildren, requiredParents = _b.requiredParents, implicitNamespacePrefix = _b.implicitNamespacePrefix, _c = _b.contentType, contentType = _c === void 0 ? TagContentType.PARSABLE_DATA : _c, _d = _b.closedByParent, closedByParent = _d === void 0 ? false : _d, _e = _b.isVoid, isVoid = _e === void 0 ? false : _e, _f = _b.ignoreFirstLf, ignoreFirstLf = _f === void 0 ? false : _f;\n        var _this = this;\n        this.closedByChildren = {};\n        this.closedByParent = false;\n        this.canSelfClose = false;\n        if (closedByChildren && closedByChildren.length > 0) {\n            closedByChildren.forEach(function (tagName) { return _this.closedByChildren[tagName] = true; });\n        }\n        this.isVoid = isVoid;\n        this.closedByParent = closedByParent || isVoid;\n        if (requiredParents && requiredParents.length > 0) {\n            this.requiredParents = {};\n            // The first parent is the list is automatically when none of the listed parents are present\n            this.parentToAdd = requiredParents[0];\n            requiredParents.forEach(function (tagName) { return _this.requiredParents[tagName] = true; });\n        }\n        this.implicitNamespacePrefix = implicitNamespacePrefix || null;\n        this.contentType = contentType;\n        this.ignoreFirstLf = ignoreFirstLf;\n    }\n    /**\n     * @param {?} currentParent\n     * @return {?}\n     */\n    HtmlTagDefinition.prototype.requireExtraParent = function (currentParent) {\n        if (!this.requiredParents) {\n            return false;\n        }\n        if (!currentParent) {\n            return true;\n        }\n        var /** @type {?} */ lcParent = currentParent.toLowerCase();\n        var /** @type {?} */ isParentTemplate = lcParent === 'template' || currentParent === 'ng-template';\n        return !isParentTemplate && this.requiredParents[lcParent] != true;\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    HtmlTagDefinition.prototype.isClosedByChild = function (name) {\n        return this.isVoid || name.toLowerCase() in this.closedByChildren;\n    };\n    return HtmlTagDefinition;\n}());\n// see http://www.w3.org/TR/html51/syntax.html#optional-tags\n// This implementation does not fully conform to the HTML5 spec.\nvar TAG_DEFINITIONS = {\n    'base': new HtmlTagDefinition({ isVoid: true }),\n    'meta': new HtmlTagDefinition({ isVoid: true }),\n    'area': new HtmlTagDefinition({ isVoid: true }),\n    'embed': new HtmlTagDefinition({ isVoid: true }),\n    'link': new HtmlTagDefinition({ isVoid: true }),\n    'img': new HtmlTagDefinition({ isVoid: true }),\n    'input': new HtmlTagDefinition({ isVoid: true }),\n    'param': new HtmlTagDefinition({ isVoid: true }),\n    'hr': new HtmlTagDefinition({ isVoid: true }),\n    'br': new HtmlTagDefinition({ isVoid: true }),\n    'source': new HtmlTagDefinition({ isVoid: true }),\n    'track': new HtmlTagDefinition({ isVoid: true }),\n    'wbr': new HtmlTagDefinition({ isVoid: true }),\n    'p': new HtmlTagDefinition({\n        closedByChildren: [\n            'address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset', 'footer', 'form',\n            'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr',\n            'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'\n        ],\n        closedByParent: true\n    }),\n    'thead': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'] }),\n    'tbody': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'], closedByParent: true }),\n    'tfoot': new HtmlTagDefinition({ closedByChildren: ['tbody'], closedByParent: true }),\n    'tr': new HtmlTagDefinition({\n        closedByChildren: ['tr'],\n        requiredParents: ['tbody', 'tfoot', 'thead'],\n        closedByParent: true\n    }),\n    'td': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),\n    'th': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),\n    'col': new HtmlTagDefinition({ requiredParents: ['colgroup'], isVoid: true }),\n    'svg': new HtmlTagDefinition({ implicitNamespacePrefix: 'svg' }),\n    'math': new HtmlTagDefinition({ implicitNamespacePrefix: 'math' }),\n    'li': new HtmlTagDefinition({ closedByChildren: ['li'], closedByParent: true }),\n    'dt': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'] }),\n    'dd': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'], closedByParent: true }),\n    'rb': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n    'rt': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n    'rtc': new HtmlTagDefinition({ closedByChildren: ['rb', 'rtc', 'rp'], closedByParent: true }),\n    'rp': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n    'optgroup': new HtmlTagDefinition({ closedByChildren: ['optgroup'], closedByParent: true }),\n    'option': new HtmlTagDefinition({ closedByChildren: ['option', 'optgroup'], closedByParent: true }),\n    'pre': new HtmlTagDefinition({ ignoreFirstLf: true }),\n    'listing': new HtmlTagDefinition({ ignoreFirstLf: true }),\n    'style': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),\n    'script': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),\n    'title': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT }),\n    'textarea': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true }),\n};\nvar _DEFAULT_TAG_DEFINITION = new HtmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction getHtmlTagDefinition(tagName) {\n    return TAG_DEFINITIONS[tagName.toLowerCase()] || _DEFAULT_TAG_DEFINITION;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _SELECTOR_REGEXP = new RegExp('(\\\\:not\\\\()|' +\n    '([-\\\\w]+)|' +\n    '(?:\\\\.([-\\\\w]+))|' +\n    // \"-\" should appear first in the regexp below as FF31 parses \"[.-\\w]\" as a range\n    '(?:\\\\[([-.\\\\w*]+)(?:=([\\\"\\']?)([^\\\\]\\\"\\']*)\\\\5)?\\\\])|' +\n    // \"[name=\"value\"]\",\n    // \"[name='value']\"\n    '(\\\\))|' +\n    '(\\\\s*,\\\\s*)', // \",\"\n'g');\n/**\n * A css selector contains an element name,\n * css classes and attribute/value pairs with the purpose\n * of selecting subsets out of them.\n */\nvar CssSelector = (function () {\n    function CssSelector() {\n        this.element = null;\n        this.classNames = [];\n        this.attrs = [];\n        this.notSelectors = [];\n    }\n    /**\n     * @param {?} selector\n     * @return {?}\n     */\n    CssSelector.parse = function (selector) {\n        var /** @type {?} */ results = [];\n        var /** @type {?} */ _addResult = function (res, cssSel) {\n            if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&\n                cssSel.attrs.length == 0) {\n                cssSel.element = '*';\n            }\n            res.push(cssSel);\n        };\n        var /** @type {?} */ cssSelector = new CssSelector();\n        var /** @type {?} */ match;\n        var /** @type {?} */ current = cssSelector;\n        var /** @type {?} */ inNot = false;\n        _SELECTOR_REGEXP.lastIndex = 0;\n        while (match = _SELECTOR_REGEXP.exec(selector)) {\n            if (match[1]) {\n                if (inNot) {\n                    throw new Error('Nesting :not is not allowed in a selector');\n                }\n                inNot = true;\n                current = new CssSelector();\n                cssSelector.notSelectors.push(current);\n            }\n            if (match[2]) {\n                current.setElement(match[2]);\n            }\n            if (match[3]) {\n                current.addClassName(match[3]);\n            }\n            if (match[4]) {\n                current.addAttribute(match[4], match[6]);\n            }\n            if (match[7]) {\n                inNot = false;\n                current = cssSelector;\n            }\n            if (match[8]) {\n                if (inNot) {\n                    throw new Error('Multiple selectors in :not are not supported');\n                }\n                _addResult(results, cssSelector);\n                cssSelector = current = new CssSelector();\n            }\n        }\n        _addResult(results, cssSelector);\n        return results;\n    };\n    /**\n     * @return {?}\n     */\n    CssSelector.prototype.isElementSelector = function () {\n        return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&\n            this.notSelectors.length === 0;\n    };\n    /**\n     * @return {?}\n     */\n    CssSelector.prototype.hasElementSelector = function () { return !!this.element; };\n    /**\n     * @param {?=} element\n     * @return {?}\n     */\n    CssSelector.prototype.setElement = function (element) {\n        if (element === void 0) { element = null; }\n        this.element = element;\n    };\n    /**\n     * Gets a template string for an element that matches the selector.\n     * @return {?}\n     */\n    CssSelector.prototype.getMatchingElementTemplate = function () {\n        var /** @type {?} */ tagName = this.element || 'div';\n        var /** @type {?} */ classAttr = this.classNames.length > 0 ? \" class=\\\"\" + this.classNames.join(' ') + \"\\\"\" : '';\n        var /** @type {?} */ attrs = '';\n        for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n            var /** @type {?} */ attrName = this.attrs[i];\n            var /** @type {?} */ attrValue = this.attrs[i + 1] !== '' ? \"=\\\"\" + this.attrs[i + 1] + \"\\\"\" : '';\n            attrs += \" \" + attrName + attrValue;\n        }\n        return getHtmlTagDefinition(tagName).isVoid ? \"<\" + tagName + classAttr + attrs + \"/>\" :\n            \"<\" + tagName + classAttr + attrs + \"></\" + tagName + \">\";\n    };\n    /**\n     * @param {?} name\n     * @param {?=} value\n     * @return {?}\n     */\n    CssSelector.prototype.addAttribute = function (name, value) {\n        if (value === void 0) { value = ''; }\n        this.attrs.push(name, value && value.toLowerCase() || '');\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    CssSelector.prototype.addClassName = function (name) { this.classNames.push(name.toLowerCase()); };\n    /**\n     * @return {?}\n     */\n    CssSelector.prototype.toString = function () {\n        var /** @type {?} */ res = this.element || '';\n        if (this.classNames) {\n            this.classNames.forEach(function (klass) { return res += \".\" + klass; });\n        }\n        if (this.attrs) {\n            for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n                var /** @type {?} */ name = this.attrs[i];\n                var /** @type {?} */ value = this.attrs[i + 1];\n                res += \"[\" + name + (value ? '=' + value : '') + \"]\";\n            }\n        }\n        this.notSelectors.forEach(function (notSelector) { return res += \":not(\" + notSelector + \")\"; });\n        return res;\n    };\n    return CssSelector;\n}());\n/**\n * Reads a list of CssSelectors and allows to calculate which ones\n * are contained in a given CssSelector.\n */\nvar SelectorMatcher = (function () {\n    function SelectorMatcher() {\n        this._elementMap = new Map();\n        this._elementPartialMap = new Map();\n        this._classMap = new Map();\n        this._classPartialMap = new Map();\n        this._attrValueMap = new Map();\n        this._attrValuePartialMap = new Map();\n        this._listContexts = [];\n    }\n    /**\n     * @param {?} notSelectors\n     * @return {?}\n     */\n    SelectorMatcher.createNotMatcher = function (notSelectors) {\n        var /** @type {?} */ notMatcher = new SelectorMatcher();\n        notMatcher.addSelectables(notSelectors, null);\n        return notMatcher;\n    };\n    /**\n     * @param {?} cssSelectors\n     * @param {?=} callbackCtxt\n     * @return {?}\n     */\n    SelectorMatcher.prototype.addSelectables = function (cssSelectors, callbackCtxt) {\n        var /** @type {?} */ listContext = ((null));\n        if (cssSelectors.length > 1) {\n            listContext = new SelectorListContext(cssSelectors);\n            this._listContexts.push(listContext);\n        }\n        for (var /** @type {?} */ i = 0; i < cssSelectors.length; i++) {\n            this._addSelectable(cssSelectors[i], callbackCtxt, listContext);\n        }\n    };\n    /**\n     * Add an object that can be found later on by calling `match`.\n     * @param {?} cssSelector A css selector\n     * @param {?} callbackCtxt An opaque object that will be given to the callback of the `match` function\n     * @param {?} listContext\n     * @return {?}\n     */\n    SelectorMatcher.prototype._addSelectable = function (cssSelector, callbackCtxt, listContext) {\n        var /** @type {?} */ matcher = this;\n        var /** @type {?} */ element = cssSelector.element;\n        var /** @type {?} */ classNames = cssSelector.classNames;\n        var /** @type {?} */ attrs = cssSelector.attrs;\n        var /** @type {?} */ selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n        if (element) {\n            var /** @type {?} */ isTerminal = attrs.length === 0 && classNames.length === 0;\n            if (isTerminal) {\n                this._addTerminal(matcher._elementMap, element, selectable);\n            }\n            else {\n                matcher = this._addPartial(matcher._elementPartialMap, element);\n            }\n        }\n        if (classNames) {\n            for (var /** @type {?} */ i = 0; i < classNames.length; i++) {\n                var /** @type {?} */ isTerminal = attrs.length === 0 && i === classNames.length - 1;\n                var /** @type {?} */ className = classNames[i];\n                if (isTerminal) {\n                    this._addTerminal(matcher._classMap, className, selectable);\n                }\n                else {\n                    matcher = this._addPartial(matcher._classPartialMap, className);\n                }\n            }\n        }\n        if (attrs) {\n            for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n                var /** @type {?} */ isTerminal = i === attrs.length - 2;\n                var /** @type {?} */ name = attrs[i];\n                var /** @type {?} */ value = attrs[i + 1];\n                if (isTerminal) {\n                    var /** @type {?} */ terminalMap = matcher._attrValueMap;\n                    var /** @type {?} */ terminalValuesMap = terminalMap.get(name);\n                    if (!terminalValuesMap) {\n                        terminalValuesMap = new Map();\n                        terminalMap.set(name, terminalValuesMap);\n                    }\n                    this._addTerminal(terminalValuesMap, value, selectable);\n                }\n                else {\n                    var /** @type {?} */ partialMap = matcher._attrValuePartialMap;\n                    var /** @type {?} */ partialValuesMap = partialMap.get(name);\n                    if (!partialValuesMap) {\n                        partialValuesMap = new Map();\n                        partialMap.set(name, partialValuesMap);\n                    }\n                    matcher = this._addPartial(partialValuesMap, value);\n                }\n            }\n        }\n    };\n    /**\n     * @param {?} map\n     * @param {?} name\n     * @param {?} selectable\n     * @return {?}\n     */\n    SelectorMatcher.prototype._addTerminal = function (map, name, selectable) {\n        var /** @type {?} */ terminalList = map.get(name);\n        if (!terminalList) {\n            terminalList = [];\n            map.set(name, terminalList);\n        }\n        terminalList.push(selectable);\n    };\n    /**\n     * @param {?} map\n     * @param {?} name\n     * @return {?}\n     */\n    SelectorMatcher.prototype._addPartial = function (map, name) {\n        var /** @type {?} */ matcher = map.get(name);\n        if (!matcher) {\n            matcher = new SelectorMatcher();\n            map.set(name, matcher);\n        }\n        return matcher;\n    };\n    /**\n     * Find the objects that have been added via `addSelectable`\n     * whose css selector is contained in the given css selector.\n     * @param {?} cssSelector A css selector\n     * @param {?} matchedCallback This callback will be called with the object handed into `addSelectable`\n     * @return {?} boolean true if a match was found\n     */\n    SelectorMatcher.prototype.match = function (cssSelector, matchedCallback) {\n        var /** @type {?} */ result = false;\n        var /** @type {?} */ element = ((cssSelector.element));\n        var /** @type {?} */ classNames = cssSelector.classNames;\n        var /** @type {?} */ attrs = cssSelector.attrs;\n        for (var /** @type {?} */ i = 0; i < this._listContexts.length; i++) {\n            this._listContexts[i].alreadyMatched = false;\n        }\n        result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;\n        result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) ||\n            result;\n        if (classNames) {\n            for (var /** @type {?} */ i = 0; i < classNames.length; i++) {\n                var /** @type {?} */ className = classNames[i];\n                result =\n                    this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;\n                result =\n                    this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||\n                        result;\n            }\n        }\n        if (attrs) {\n            for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n                var /** @type {?} */ name = attrs[i];\n                var /** @type {?} */ value = attrs[i + 1];\n                var /** @type {?} */ terminalValuesMap = ((this._attrValueMap.get(name)));\n                if (value) {\n                    result =\n                        this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;\n                }\n                result =\n                    this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;\n                var /** @type {?} */ partialValuesMap = ((this._attrValuePartialMap.get(name)));\n                if (value) {\n                    result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;\n                }\n                result =\n                    this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;\n            }\n        }\n        return result;\n    };\n    /**\n     * \\@internal\n     * @param {?} map\n     * @param {?} name\n     * @param {?} cssSelector\n     * @param {?} matchedCallback\n     * @return {?}\n     */\n    SelectorMatcher.prototype._matchTerminal = function (map, name, cssSelector, matchedCallback) {\n        if (!map || typeof name !== 'string') {\n            return false;\n        }\n        var /** @type {?} */ selectables = map.get(name) || [];\n        var /** @type {?} */ starSelectables = ((map.get('*')));\n        if (starSelectables) {\n            selectables = selectables.concat(starSelectables);\n        }\n        if (selectables.length === 0) {\n            return false;\n        }\n        var /** @type {?} */ selectable;\n        var /** @type {?} */ result = false;\n        for (var /** @type {?} */ i = 0; i < selectables.length; i++) {\n            selectable = selectables[i];\n            result = selectable.finalize(cssSelector, matchedCallback) || result;\n        }\n        return result;\n    };\n    /**\n     * \\@internal\n     * @param {?} map\n     * @param {?} name\n     * @param {?} cssSelector\n     * @param {?} matchedCallback\n     * @return {?}\n     */\n    SelectorMatcher.prototype._matchPartial = function (map, name, cssSelector, matchedCallback) {\n        if (!map || typeof name !== 'string') {\n            return false;\n        }\n        var /** @type {?} */ nestedSelector = map.get(name);\n        if (!nestedSelector) {\n            return false;\n        }\n        // TODO(perf): get rid of recursion and measure again\n        // TODO(perf): don't pass the whole selector into the recursion,\n        // but only the not processed parts\n        return nestedSelector.match(cssSelector, matchedCallback);\n    };\n    return SelectorMatcher;\n}());\nvar SelectorListContext = (function () {\n    /**\n     * @param {?} selectors\n     */\n    function SelectorListContext(selectors) {\n        this.selectors = selectors;\n        this.alreadyMatched = false;\n    }\n    return SelectorListContext;\n}());\nvar SelectorContext = (function () {\n    /**\n     * @param {?} selector\n     * @param {?} cbContext\n     * @param {?} listContext\n     */\n    function SelectorContext(selector, cbContext, listContext) {\n        this.selector = selector;\n        this.cbContext = cbContext;\n        this.listContext = listContext;\n        this.notSelectors = selector.notSelectors;\n    }\n    /**\n     * @param {?} cssSelector\n     * @param {?} callback\n     * @return {?}\n     */\n    SelectorContext.prototype.finalize = function (cssSelector, callback) {\n        var /** @type {?} */ result = true;\n        if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n            var /** @type {?} */ notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);\n            result = !notMatcher.match(cssSelector, null);\n        }\n        if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {\n            if (this.listContext) {\n                this.listContext.alreadyMatched = true;\n            }\n            callback(this.selector, this.cbContext);\n        }\n        return result;\n    };\n    return SelectorContext;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar MODULE_SUFFIX = '';\nvar DASH_CASE_REGEXP = /-+([a-z0-9])/g;\n/**\n * @param {?} input\n * @return {?}\n */\n/**\n * @param {?} input\n * @return {?}\n */\nfunction dashCaseToCamelCase(input) {\n    return input.replace(DASH_CASE_REGEXP, function () {\n        var m = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            m[_i] = arguments[_i];\n        }\n        return m[1].toUpperCase();\n    });\n}\n/**\n * @param {?} input\n * @param {?} defaultValues\n * @return {?}\n */\nfunction splitAtColon(input, defaultValues) {\n    return _splitAt(input, ':', defaultValues);\n}\n/**\n * @param {?} input\n * @param {?} defaultValues\n * @return {?}\n */\nfunction splitAtPeriod(input, defaultValues) {\n    return _splitAt(input, '.', defaultValues);\n}\n/**\n * @param {?} input\n * @param {?} character\n * @param {?} defaultValues\n * @return {?}\n */\nfunction _splitAt(input, character, defaultValues) {\n    var /** @type {?} */ characterIndex = input.indexOf(character);\n    if (characterIndex == -1)\n        return defaultValues;\n    return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];\n}\n/**\n * @param {?} value\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\nfunction visitValue(value, visitor, context) {\n    if (Array.isArray(value)) {\n        return visitor.visitArray(/** @type {?} */ (value), context);\n    }\n    if (isStrictStringMap(value)) {\n        return visitor.visitStringMap(/** @type {?} */ (value), context);\n    }\n    if (value == null || typeof value == 'string' || typeof value == 'number' ||\n        typeof value == 'boolean') {\n        return visitor.visitPrimitive(value, context);\n    }\n    return visitor.visitOther(value, context);\n}\n/**\n * @param {?} val\n * @return {?}\n */\nfunction isDefined(val) {\n    return val !== null && val !== undefined;\n}\n/**\n * @template T\n * @param {?} val\n * @return {?}\n */\nfunction noUndefined(val) {\n    return val === undefined ? ((null)) : val;\n}\nvar ValueTransformer = (function () {\n    function ValueTransformer() {\n    }\n    /**\n     * @param {?} arr\n     * @param {?} context\n     * @return {?}\n     */\n    ValueTransformer.prototype.visitArray = function (arr, context) {\n        var _this = this;\n        return arr.map(function (value) { return visitValue(value, _this, context); });\n    };\n    /**\n     * @param {?} map\n     * @param {?} context\n     * @return {?}\n     */\n    ValueTransformer.prototype.visitStringMap = function (map, context) {\n        var _this = this;\n        var /** @type {?} */ result = {};\n        Object.keys(map).forEach(function (key) { result[key] = visitValue(map[key], _this, context); });\n        return result;\n    };\n    /**\n     * @param {?} value\n     * @param {?} context\n     * @return {?}\n     */\n    ValueTransformer.prototype.visitPrimitive = function (value, context) { return value; };\n    /**\n     * @param {?} value\n     * @param {?} context\n     * @return {?}\n     */\n    ValueTransformer.prototype.visitOther = function (value, context) { return value; };\n    return ValueTransformer;\n}());\nvar SyncAsync = {\n    assertSync: function (value) {\n        if (_angular_core.ɵisPromise(value)) {\n            throw new Error(\"Illegal state: value cannot be a promise\");\n        }\n        return value;\n    },\n    then: function (value, cb) { return _angular_core.ɵisPromise(value) ? value.then(cb) : cb(value); },\n    all: function (syncAsyncValues) {\n        return syncAsyncValues.some(_angular_core.ɵisPromise) ? Promise.all(syncAsyncValues) : (syncAsyncValues);\n    }\n};\n/**\n * @param {?} msg\n * @return {?}\n */\nfunction syntaxError(msg) {\n    var /** @type {?} */ error = Error(msg);\n    ((error))[ERROR_SYNTAX_ERROR] = true;\n    return error;\n}\nvar ERROR_SYNTAX_ERROR = 'ngSyntaxError';\n/**\n * @param {?} error\n * @return {?}\n */\nfunction isSyntaxError(error) {\n    return ((error))[ERROR_SYNTAX_ERROR];\n}\n/**\n * @param {?} s\n * @return {?}\n */\nfunction escapeRegExp(s) {\n    return s.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n}\nvar STRING_MAP_PROTO = Object.getPrototypeOf({});\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction isStrictStringMap(obj) {\n    return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;\n}\n/**\n * @param {?} str\n * @return {?}\n */\nfunction utf8Encode(str) {\n    var /** @type {?} */ encoded = '';\n    for (var /** @type {?} */ index = 0; index < str.length; index++) {\n        var /** @type {?} */ codePoint = str.charCodeAt(index);\n        // decode surrogate\n        // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n        if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {\n            var /** @type {?} */ low = str.charCodeAt(index + 1);\n            if (low >= 0xdc00 && low <= 0xdfff) {\n                index++;\n                codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;\n            }\n        }\n        if (codePoint <= 0x7f) {\n            encoded += String.fromCharCode(codePoint);\n        }\n        else if (codePoint <= 0x7ff) {\n            encoded += String.fromCharCode(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);\n        }\n        else if (codePoint <= 0xffff) {\n            encoded += String.fromCharCode((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n        }\n        else if (codePoint <= 0x1fffff) {\n            encoded += String.fromCharCode(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n        }\n    }\n    return encoded;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// group 0: \"[prop] or (event) or @trigger\"\n// group 1: \"prop\" from \"[prop]\"\n// group 2: \"event\" from \"(event)\"\n// group 3: \"@trigger\" from \"@trigger\"\nvar HOST_REG_EXP = /^(?:(?:\\[([^\\]]+)\\])|(?:\\(([^\\)]+)\\)))|(\\@[-\\w]+)$/;\nvar CompileAnimationEntryMetadata = (function () {\n    /**\n     * @param {?=} name\n     * @param {?=} definitions\n     */\n    function CompileAnimationEntryMetadata(name, definitions) {\n        if (name === void 0) { name = null; }\n        if (definitions === void 0) { definitions = null; }\n        this.name = name;\n        this.definitions = definitions;\n    }\n    return CompileAnimationEntryMetadata;\n}());\n/**\n * @abstract\n */\nvar CompileAnimationStateMetadata = (function () {\n    function CompileAnimationStateMetadata() {\n    }\n    return CompileAnimationStateMetadata;\n}());\nvar CompileAnimationStateDeclarationMetadata = (function (_super) {\n    __extends(CompileAnimationStateDeclarationMetadata, _super);\n    /**\n     * @param {?} stateNameExpr\n     * @param {?} styles\n     */\n    function CompileAnimationStateDeclarationMetadata(stateNameExpr, styles) {\n        var _this = _super.call(this) || this;\n        _this.stateNameExpr = stateNameExpr;\n        _this.styles = styles;\n        return _this;\n    }\n    return CompileAnimationStateDeclarationMetadata;\n}(CompileAnimationStateMetadata));\nvar CompileAnimationStateTransitionMetadata = (function (_super) {\n    __extends(CompileAnimationStateTransitionMetadata, _super);\n    /**\n     * @param {?} stateChangeExpr\n     * @param {?} steps\n     */\n    function CompileAnimationStateTransitionMetadata(stateChangeExpr, steps) {\n        var _this = _super.call(this) || this;\n        _this.stateChangeExpr = stateChangeExpr;\n        _this.steps = steps;\n        return _this;\n    }\n    return CompileAnimationStateTransitionMetadata;\n}(CompileAnimationStateMetadata));\n/**\n * @abstract\n */\nvar CompileAnimationMetadata = (function () {\n    function CompileAnimationMetadata() {\n    }\n    return CompileAnimationMetadata;\n}());\nvar CompileAnimationKeyframesSequenceMetadata = (function (_super) {\n    __extends(CompileAnimationKeyframesSequenceMetadata, _super);\n    /**\n     * @param {?=} steps\n     */\n    function CompileAnimationKeyframesSequenceMetadata(steps) {\n        if (steps === void 0) { steps = []; }\n        var _this = _super.call(this) || this;\n        _this.steps = steps;\n        return _this;\n    }\n    return CompileAnimationKeyframesSequenceMetadata;\n}(CompileAnimationMetadata));\nvar CompileAnimationStyleMetadata = (function (_super) {\n    __extends(CompileAnimationStyleMetadata, _super);\n    /**\n     * @param {?} offset\n     * @param {?=} styles\n     */\n    function CompileAnimationStyleMetadata(offset, styles) {\n        if (styles === void 0) { styles = null; }\n        var _this = _super.call(this) || this;\n        _this.offset = offset;\n        _this.styles = styles;\n        return _this;\n    }\n    return CompileAnimationStyleMetadata;\n}(CompileAnimationMetadata));\nvar CompileAnimationAnimateMetadata = (function (_super) {\n    __extends(CompileAnimationAnimateMetadata, _super);\n    /**\n     * @param {?=} timings\n     * @param {?=} styles\n     */\n    function CompileAnimationAnimateMetadata(timings, styles) {\n        if (timings === void 0) { timings = 0; }\n        if (styles === void 0) { styles = null; }\n        var _this = _super.call(this) || this;\n        _this.timings = timings;\n        _this.styles = styles;\n        return _this;\n    }\n    return CompileAnimationAnimateMetadata;\n}(CompileAnimationMetadata));\n/**\n * @abstract\n */\nvar CompileAnimationWithStepsMetadata = (function (_super) {\n    __extends(CompileAnimationWithStepsMetadata, _super);\n    /**\n     * @param {?=} steps\n     */\n    function CompileAnimationWithStepsMetadata(steps) {\n        if (steps === void 0) { steps = null; }\n        var _this = _super.call(this) || this;\n        _this.steps = steps;\n        return _this;\n    }\n    return CompileAnimationWithStepsMetadata;\n}(CompileAnimationMetadata));\nvar CompileAnimationSequenceMetadata = (function (_super) {\n    __extends(CompileAnimationSequenceMetadata, _super);\n    /**\n     * @param {?=} steps\n     */\n    function CompileAnimationSequenceMetadata(steps) {\n        if (steps === void 0) { steps = null; }\n        return _super.call(this, steps) || this;\n    }\n    return CompileAnimationSequenceMetadata;\n}(CompileAnimationWithStepsMetadata));\nvar CompileAnimationGroupMetadata = (function (_super) {\n    __extends(CompileAnimationGroupMetadata, _super);\n    /**\n     * @param {?=} steps\n     */\n    function CompileAnimationGroupMetadata(steps) {\n        if (steps === void 0) { steps = null; }\n        return _super.call(this, steps) || this;\n    }\n    return CompileAnimationGroupMetadata;\n}(CompileAnimationWithStepsMetadata));\n/**\n * @param {?} name\n * @return {?}\n */\nfunction _sanitizeIdentifier(name) {\n    return name.replace(/\\W/g, '_');\n}\nvar _anonymousTypeIndex = 0;\n/**\n * @param {?} compileIdentifier\n * @return {?}\n */\nfunction identifierName(compileIdentifier) {\n    if (!compileIdentifier || !compileIdentifier.reference) {\n        return null;\n    }\n    var /** @type {?} */ ref = compileIdentifier.reference;\n    if (ref instanceof StaticSymbol) {\n        return ref.name;\n    }\n    if (ref['__anonymousType']) {\n        return ref['__anonymousType'];\n    }\n    var /** @type {?} */ identifier = _angular_core.ɵstringify(ref);\n    if (identifier.indexOf('(') >= 0) {\n        // case: anonymous functions!\n        identifier = \"anonymous_\" + _anonymousTypeIndex++;\n        ref['__anonymousType'] = identifier;\n    }\n    else {\n        identifier = _sanitizeIdentifier(identifier);\n    }\n    return identifier;\n}\n/**\n * @param {?} compileIdentifier\n * @return {?}\n */\nfunction identifierModuleUrl(compileIdentifier) {\n    var /** @type {?} */ ref = compileIdentifier.reference;\n    if (ref instanceof StaticSymbol) {\n        return ref.filePath;\n    }\n    // Runtime type\n    return \"./\" + _angular_core.ɵstringify(ref);\n}\n/**\n * @param {?} compType\n * @param {?} embeddedTemplateIndex\n * @return {?}\n */\nfunction viewClassName(compType, embeddedTemplateIndex) {\n    return \"View_\" + identifierName({ reference: compType }) + \"_\" + embeddedTemplateIndex;\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nfunction rendererTypeName(compType) {\n    return \"RenderType_\" + identifierName({ reference: compType });\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nfunction hostViewClassName(compType) {\n    return \"HostView_\" + identifierName({ reference: compType });\n}\n/**\n * @param {?} dirType\n * @return {?}\n */\nfunction dirWrapperClassName(dirType) {\n    return \"Wrapper_\" + identifierName({ reference: dirType });\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nfunction componentFactoryName(compType) {\n    return identifierName({ reference: compType }) + \"NgFactory\";\n}\nvar CompileSummaryKind = {};\nCompileSummaryKind.Pipe = 0;\nCompileSummaryKind.Directive = 1;\nCompileSummaryKind.NgModule = 2;\nCompileSummaryKind.Injectable = 3;\nCompileSummaryKind[CompileSummaryKind.Pipe] = \"Pipe\";\nCompileSummaryKind[CompileSummaryKind.Directive] = \"Directive\";\nCompileSummaryKind[CompileSummaryKind.NgModule] = \"NgModule\";\nCompileSummaryKind[CompileSummaryKind.Injectable] = \"Injectable\";\n/**\n * @param {?} token\n * @return {?}\n */\nfunction tokenName(token) {\n    return token.value != null ? _sanitizeIdentifier(token.value) : identifierName(token.identifier);\n}\n/**\n * @param {?} token\n * @return {?}\n */\nfunction tokenReference(token) {\n    if (token.identifier != null) {\n        return token.identifier.reference;\n    }\n    else {\n        return token.value;\n    }\n}\n/**\n * Metadata about a stylesheet\n */\nvar CompileStylesheetMetadata = (function () {\n    /**\n     * @param {?=} __0\n     */\n    function CompileStylesheetMetadata(_a) {\n        var _b = _a === void 0 ? {} : _a, moduleUrl = _b.moduleUrl, styles = _b.styles, styleUrls = _b.styleUrls;\n        this.moduleUrl = moduleUrl || null;\n        this.styles = _normalizeArray(styles);\n        this.styleUrls = _normalizeArray(styleUrls);\n    }\n    return CompileStylesheetMetadata;\n}());\n/**\n * Metadata regarding compilation of a template.\n */\nvar CompileTemplateMetadata = (function () {\n    /**\n     * @param {?} __0\n     */\n    function CompileTemplateMetadata(_a) {\n        var encapsulation = _a.encapsulation, template = _a.template, templateUrl = _a.templateUrl, styles = _a.styles, styleUrls = _a.styleUrls, externalStylesheets = _a.externalStylesheets, animations = _a.animations, ngContentSelectors = _a.ngContentSelectors, interpolation = _a.interpolation, isInline = _a.isInline;\n        this.encapsulation = encapsulation;\n        this.template = template;\n        this.templateUrl = templateUrl;\n        this.styles = _normalizeArray(styles);\n        this.styleUrls = _normalizeArray(styleUrls);\n        this.externalStylesheets = _normalizeArray(externalStylesheets);\n        this.animations = animations ? flatten(animations) : [];\n        this.ngContentSelectors = ngContentSelectors || [];\n        if (interpolation && interpolation.length != 2) {\n            throw new Error(\"'interpolation' should have a start and an end symbol.\");\n        }\n        this.interpolation = interpolation;\n        this.isInline = isInline;\n    }\n    /**\n     * @return {?}\n     */\n    CompileTemplateMetadata.prototype.toSummary = function () {\n        return {\n            animations: this.animations.map(function (anim) { return anim.name; }),\n            ngContentSelectors: this.ngContentSelectors,\n            encapsulation: this.encapsulation,\n        };\n    };\n    return CompileTemplateMetadata;\n}());\n/**\n * Metadata regarding compilation of a directive.\n */\nvar CompileDirectiveMetadata = (function () {\n    /**\n     * @param {?} __0\n     */\n    function CompileDirectiveMetadata(_a) {\n        var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, hostListeners = _a.hostListeners, hostProperties = _a.hostProperties, hostAttributes = _a.hostAttributes, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;\n        this.isHost = !!isHost;\n        this.type = type;\n        this.isComponent = isComponent;\n        this.selector = selector;\n        this.exportAs = exportAs;\n        this.changeDetection = changeDetection;\n        this.inputs = inputs;\n        this.outputs = outputs;\n        this.hostListeners = hostListeners;\n        this.hostProperties = hostProperties;\n        this.hostAttributes = hostAttributes;\n        this.providers = _normalizeArray(providers);\n        this.viewProviders = _normalizeArray(viewProviders);\n        this.queries = _normalizeArray(queries);\n        this.viewQueries = _normalizeArray(viewQueries);\n        this.entryComponents = _normalizeArray(entryComponents);\n        this.template = template;\n        this.componentViewType = componentViewType;\n        this.rendererType = rendererType;\n        this.componentFactory = componentFactory;\n    }\n    /**\n     * @param {?} __0\n     * @return {?}\n     */\n    CompileDirectiveMetadata.create = function (_a) {\n        var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, host = _a.host, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;\n        var /** @type {?} */ hostListeners = {};\n        var /** @type {?} */ hostProperties = {};\n        var /** @type {?} */ hostAttributes = {};\n        if (host != null) {\n            Object.keys(host).forEach(function (key) {\n                var /** @type {?} */ value = host[key];\n                var /** @type {?} */ matches = key.match(HOST_REG_EXP);\n                if (matches === null) {\n                    hostAttributes[key] = value;\n                }\n                else if (matches[1] != null) {\n                    hostProperties[matches[1]] = value;\n                }\n                else if (matches[2] != null) {\n                    hostListeners[matches[2]] = value;\n                }\n            });\n        }\n        var /** @type {?} */ inputsMap = {};\n        if (inputs != null) {\n            inputs.forEach(function (bindConfig) {\n                // canonical syntax: `dirProp: elProp`\n                // if there is no `:`, use dirProp = elProp\n                var /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n                inputsMap[parts[0]] = parts[1];\n            });\n        }\n        var /** @type {?} */ outputsMap = {};\n        if (outputs != null) {\n            outputs.forEach(function (bindConfig) {\n                // canonical syntax: `dirProp: elProp`\n                // if there is no `:`, use dirProp = elProp\n                var /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n                outputsMap[parts[0]] = parts[1];\n            });\n        }\n        return new CompileDirectiveMetadata({\n            isHost: isHost,\n            type: type,\n            isComponent: !!isComponent, selector: selector, exportAs: exportAs, changeDetection: changeDetection,\n            inputs: inputsMap,\n            outputs: outputsMap,\n            hostListeners: hostListeners,\n            hostProperties: hostProperties,\n            hostAttributes: hostAttributes,\n            providers: providers,\n            viewProviders: viewProviders,\n            queries: queries,\n            viewQueries: viewQueries,\n            entryComponents: entryComponents,\n            template: template,\n            componentViewType: componentViewType,\n            rendererType: rendererType,\n            componentFactory: componentFactory,\n        });\n    };\n    /**\n     * @return {?}\n     */\n    CompileDirectiveMetadata.prototype.toSummary = function () {\n        return {\n            summaryKind: CompileSummaryKind.Directive,\n            type: this.type,\n            isComponent: this.isComponent,\n            selector: this.selector,\n            exportAs: this.exportAs,\n            inputs: this.inputs,\n            outputs: this.outputs,\n            hostListeners: this.hostListeners,\n            hostProperties: this.hostProperties,\n            hostAttributes: this.hostAttributes,\n            providers: this.providers,\n            viewProviders: this.viewProviders,\n            queries: this.queries,\n            viewQueries: this.viewQueries,\n            entryComponents: this.entryComponents,\n            changeDetection: this.changeDetection,\n            template: this.template && this.template.toSummary(),\n            componentViewType: this.componentViewType,\n            rendererType: this.rendererType,\n            componentFactory: this.componentFactory\n        };\n    };\n    return CompileDirectiveMetadata;\n}());\n/**\n * Construct {\\@link CompileDirectiveMetadata} from {\\@link ComponentTypeMetadata} and a selector.\n * @param {?} hostTypeReference\n * @param {?} compMeta\n * @param {?} hostViewType\n * @return {?}\n */\nfunction createHostComponentMeta(hostTypeReference, compMeta, hostViewType) {\n    var /** @type {?} */ template = CssSelector.parse(/** @type {?} */ ((compMeta.selector)))[0].getMatchingElementTemplate();\n    return CompileDirectiveMetadata.create({\n        isHost: true,\n        type: { reference: hostTypeReference, diDeps: [], lifecycleHooks: [] },\n        template: new CompileTemplateMetadata({\n            encapsulation: _angular_core.ViewEncapsulation.None,\n            template: template,\n            templateUrl: '',\n            styles: [],\n            styleUrls: [],\n            ngContentSelectors: [],\n            animations: [],\n            isInline: true,\n            externalStylesheets: [],\n            interpolation: null\n        }),\n        exportAs: null,\n        changeDetection: _angular_core.ChangeDetectionStrategy.Default,\n        inputs: [],\n        outputs: [],\n        host: {},\n        isComponent: true,\n        selector: '*',\n        providers: [],\n        viewProviders: [],\n        queries: [],\n        viewQueries: [],\n        componentViewType: hostViewType,\n        rendererType: { id: '__Host__', encapsulation: _angular_core.ViewEncapsulation.None, styles: [], data: {} },\n        entryComponents: [],\n        componentFactory: null\n    });\n}\nvar CompilePipeMetadata = (function () {\n    /**\n     * @param {?} __0\n     */\n    function CompilePipeMetadata(_a) {\n        var type = _a.type, name = _a.name, pure = _a.pure;\n        this.type = type;\n        this.name = name;\n        this.pure = !!pure;\n    }\n    /**\n     * @return {?}\n     */\n    CompilePipeMetadata.prototype.toSummary = function () {\n        return {\n            summaryKind: CompileSummaryKind.Pipe,\n            type: this.type,\n            name: this.name,\n            pure: this.pure\n        };\n    };\n    return CompilePipeMetadata;\n}());\n/**\n * Metadata regarding compilation of a module.\n */\nvar CompileNgModuleMetadata = (function () {\n    /**\n     * @param {?} __0\n     */\n    function CompileNgModuleMetadata(_a) {\n        var type = _a.type, providers = _a.providers, declaredDirectives = _a.declaredDirectives, exportedDirectives = _a.exportedDirectives, declaredPipes = _a.declaredPipes, exportedPipes = _a.exportedPipes, entryComponents = _a.entryComponents, bootstrapComponents = _a.bootstrapComponents, importedModules = _a.importedModules, exportedModules = _a.exportedModules, schemas = _a.schemas, transitiveModule = _a.transitiveModule, id = _a.id;\n        this.type = type || null;\n        this.declaredDirectives = _normalizeArray(declaredDirectives);\n        this.exportedDirectives = _normalizeArray(exportedDirectives);\n        this.declaredPipes = _normalizeArray(declaredPipes);\n        this.exportedPipes = _normalizeArray(exportedPipes);\n        this.providers = _normalizeArray(providers);\n        this.entryComponents = _normalizeArray(entryComponents);\n        this.bootstrapComponents = _normalizeArray(bootstrapComponents);\n        this.importedModules = _normalizeArray(importedModules);\n        this.exportedModules = _normalizeArray(exportedModules);\n        this.schemas = _normalizeArray(schemas);\n        this.id = id || null;\n        this.transitiveModule = transitiveModule || null;\n    }\n    /**\n     * @return {?}\n     */\n    CompileNgModuleMetadata.prototype.toSummary = function () {\n        var /** @type {?} */ module = ((this.transitiveModule));\n        return {\n            summaryKind: CompileSummaryKind.NgModule,\n            type: this.type,\n            entryComponents: module.entryComponents,\n            providers: module.providers,\n            modules: module.modules,\n            exportedDirectives: module.exportedDirectives,\n            exportedPipes: module.exportedPipes\n        };\n    };\n    return CompileNgModuleMetadata;\n}());\nvar TransitiveCompileNgModuleMetadata = (function () {\n    function TransitiveCompileNgModuleMetadata() {\n        this.directivesSet = new Set();\n        this.directives = [];\n        this.exportedDirectivesSet = new Set();\n        this.exportedDirectives = [];\n        this.pipesSet = new Set();\n        this.pipes = [];\n        this.exportedPipesSet = new Set();\n        this.exportedPipes = [];\n        this.modulesSet = new Set();\n        this.modules = [];\n        this.entryComponentsSet = new Set();\n        this.entryComponents = [];\n        this.providers = [];\n    }\n    /**\n     * @param {?} provider\n     * @param {?} module\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addProvider = function (provider, module) {\n        this.providers.push({ provider: provider, module: module });\n    };\n    /**\n     * @param {?} id\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addDirective = function (id) {\n        if (!this.directivesSet.has(id.reference)) {\n            this.directivesSet.add(id.reference);\n            this.directives.push(id);\n        }\n    };\n    /**\n     * @param {?} id\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addExportedDirective = function (id) {\n        if (!this.exportedDirectivesSet.has(id.reference)) {\n            this.exportedDirectivesSet.add(id.reference);\n            this.exportedDirectives.push(id);\n        }\n    };\n    /**\n     * @param {?} id\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addPipe = function (id) {\n        if (!this.pipesSet.has(id.reference)) {\n            this.pipesSet.add(id.reference);\n            this.pipes.push(id);\n        }\n    };\n    /**\n     * @param {?} id\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addExportedPipe = function (id) {\n        if (!this.exportedPipesSet.has(id.reference)) {\n            this.exportedPipesSet.add(id.reference);\n            this.exportedPipes.push(id);\n        }\n    };\n    /**\n     * @param {?} id\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addModule = function (id) {\n        if (!this.modulesSet.has(id.reference)) {\n            this.modulesSet.add(id.reference);\n            this.modules.push(id);\n        }\n    };\n    /**\n     * @param {?} ec\n     * @return {?}\n     */\n    TransitiveCompileNgModuleMetadata.prototype.addEntryComponent = function (ec) {\n        if (!this.entryComponentsSet.has(ec.componentType)) {\n            this.entryComponentsSet.add(ec.componentType);\n            this.entryComponents.push(ec);\n        }\n    };\n    return TransitiveCompileNgModuleMetadata;\n}());\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction _normalizeArray(obj) {\n    return obj || [];\n}\nvar ProviderMeta = (function () {\n    /**\n     * @param {?} token\n     * @param {?} __1\n     */\n    function ProviderMeta(token, _a) {\n        var useClass = _a.useClass, useValue = _a.useValue, useExisting = _a.useExisting, useFactory = _a.useFactory, deps = _a.deps, multi = _a.multi;\n        this.token = token;\n        this.useClass = useClass || null;\n        this.useValue = useValue;\n        this.useExisting = useExisting;\n        this.useFactory = useFactory || null;\n        this.dependencies = deps || null;\n        this.multi = !!multi;\n    }\n    return ProviderMeta;\n}());\n/**\n * @template T\n * @param {?} list\n * @return {?}\n */\nfunction flatten(list) {\n    return list.reduce(function (flat, item) {\n        var /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;\n        return ((flat)).concat(flatItem);\n    }, []);\n}\n/**\n * @param {?} url\n * @return {?}\n */\nfunction sourceUrl(url) {\n    // Note: We need 3 \"/\" so that ng shows up as a separate domain\n    // in the chrome dev tools.\n    return url.replace(/(\\w+:\\/\\/[\\w:-]+)?(\\/+)?/, 'ng:///');\n}\n/**\n * @param {?} ngModuleType\n * @param {?} compMeta\n * @param {?} templateMeta\n * @return {?}\n */\nfunction templateSourceUrl(ngModuleType, compMeta, templateMeta) {\n    var /** @type {?} */ url;\n    if (templateMeta.isInline) {\n        if (compMeta.type.reference instanceof StaticSymbol) {\n            // Note: a .ts file might contain multiple components with inline templates,\n            // so we need to give them unique urls, as these will be used for sourcemaps.\n            url = compMeta.type.reference.filePath + \".\" + compMeta.type.reference.name + \".html\";\n        }\n        else {\n            url = identifierName(ngModuleType) + \"/\" + identifierName(compMeta.type) + \".html\";\n        }\n    }\n    else {\n        url = ((templateMeta.templateUrl));\n    }\n    // always prepend ng:// to make angular resources easy to find and not clobber\n    // user resources.\n    return sourceUrl(url);\n}\n/**\n * @param {?} meta\n * @param {?} id\n * @return {?}\n */\nfunction sharedStylesheetJitUrl(meta, id) {\n    var /** @type {?} */ pathParts = ((meta.moduleUrl)).split(/\\/\\\\/g);\n    var /** @type {?} */ baseName = pathParts[pathParts.length - 1];\n    return sourceUrl(\"css/\" + id + baseName + \".ngstyle.js\");\n}\n/**\n * @param {?} moduleMeta\n * @return {?}\n */\nfunction ngModuleJitUrl(moduleMeta) {\n    return sourceUrl(identifierName(moduleMeta.type) + \"/module.ngfactory.js\");\n}\n/**\n * @param {?} ngModuleType\n * @param {?} compMeta\n * @return {?}\n */\nfunction templateJitUrl(ngModuleType, compMeta) {\n    return sourceUrl(identifierName(ngModuleType) + \"/\" + identifierName(compMeta.type) + \".ngfactory.js\");\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Provides access to reflection data about symbols that the compiler needs.\n * @abstract\n */\nvar CompileReflector = (function () {\n    function CompileReflector() {\n    }\n    /**\n     * @abstract\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    CompileReflector.prototype.parameters = function (typeOrFunc) { };\n    /**\n     * @abstract\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    CompileReflector.prototype.annotations = function (typeOrFunc) { };\n    /**\n     * @abstract\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    CompileReflector.prototype.propMetadata = function (typeOrFunc) { };\n    /**\n     * @abstract\n     * @param {?} type\n     * @param {?} lcProperty\n     * @return {?}\n     */\n    CompileReflector.prototype.hasLifecycleHook = function (type, lcProperty) { };\n    /**\n     * @abstract\n     * @param {?} type\n     * @param {?} cmpMetadata\n     * @return {?}\n     */\n    CompileReflector.prototype.componentModuleUrl = function (type, cmpMetadata) { };\n    /**\n     * @abstract\n     * @param {?} ref\n     * @return {?}\n     */\n    CompileReflector.prototype.resolveExternalReference = function (ref) { };\n    return CompileReflector;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar CompilerConfig = (function () {\n    /**\n     * @param {?=} __0\n     */\n    function CompilerConfig(_a) {\n        var _b = _a === void 0 ? {} : _a, _c = _b.defaultEncapsulation, defaultEncapsulation = _c === void 0 ? _angular_core.ViewEncapsulation.Emulated : _c, _d = _b.useJit, useJit = _d === void 0 ? true : _d, missingTranslation = _b.missingTranslation, enableLegacyTemplate = _b.enableLegacyTemplate;\n        this.defaultEncapsulation = defaultEncapsulation;\n        this.useJit = !!useJit;\n        this.missingTranslation = missingTranslation || null;\n        this.enableLegacyTemplate = enableLegacyTemplate !== false;\n    }\n    return CompilerConfig;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ParserError = (function () {\n    /**\n     * @param {?} message\n     * @param {?} input\n     * @param {?} errLocation\n     * @param {?=} ctxLocation\n     */\n    function ParserError(message, input, errLocation, ctxLocation) {\n        this.input = input;\n        this.errLocation = errLocation;\n        this.ctxLocation = ctxLocation;\n        this.message = \"Parser Error: \" + message + \" \" + errLocation + \" [\" + input + \"] in \" + ctxLocation;\n    }\n    return ParserError;\n}());\nvar ParseSpan = (function () {\n    /**\n     * @param {?} start\n     * @param {?} end\n     */\n    function ParseSpan(start, end) {\n        this.start = start;\n        this.end = end;\n    }\n    return ParseSpan;\n}());\nvar AST = (function () {\n    /**\n     * @param {?} span\n     */\n    function AST(span) {\n        this.span = span;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    AST.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return null;\n    };\n    /**\n     * @return {?}\n     */\n    AST.prototype.toString = function () { return 'AST'; };\n    return AST;\n}());\n/**\n * Represents a quoted expression of the form:\n *\n * quote = prefix `:` uninterpretedExpression\n * prefix = identifier\n * uninterpretedExpression = arbitrary string\n *\n * A quoted expression is meant to be pre-processed by an AST transformer that\n * converts it into another AST that no longer contains quoted expressions.\n * It is meant to allow third-party developers to extend Angular template\n * expression language. The `uninterpretedExpression` part of the quote is\n * therefore not interpreted by the Angular's own expression parser.\n */\nvar Quote = (function (_super) {\n    __extends(Quote, _super);\n    /**\n     * @param {?} span\n     * @param {?} prefix\n     * @param {?} uninterpretedExpression\n     * @param {?} location\n     */\n    function Quote(span, prefix, uninterpretedExpression, location) {\n        var _this = _super.call(this, span) || this;\n        _this.prefix = prefix;\n        _this.uninterpretedExpression = uninterpretedExpression;\n        _this.location = location;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Quote.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitQuote(this, context);\n    };\n    /**\n     * @return {?}\n     */\n    Quote.prototype.toString = function () { return 'Quote'; };\n    return Quote;\n}(AST));\nvar EmptyExpr = (function (_super) {\n    __extends(EmptyExpr, _super);\n    function EmptyExpr() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    EmptyExpr.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        // do nothing\n    };\n    return EmptyExpr;\n}(AST));\nvar ImplicitReceiver = (function (_super) {\n    __extends(ImplicitReceiver, _super);\n    function ImplicitReceiver() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    ImplicitReceiver.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitImplicitReceiver(this, context);\n    };\n    return ImplicitReceiver;\n}(AST));\n/**\n * Multiple expressions separated by a semicolon.\n */\nvar Chain = (function (_super) {\n    __extends(Chain, _super);\n    /**\n     * @param {?} span\n     * @param {?} expressions\n     */\n    function Chain(span, expressions) {\n        var _this = _super.call(this, span) || this;\n        _this.expressions = expressions;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Chain.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitChain(this, context);\n    };\n    return Chain;\n}(AST));\nvar Conditional = (function (_super) {\n    __extends(Conditional, _super);\n    /**\n     * @param {?} span\n     * @param {?} condition\n     * @param {?} trueExp\n     * @param {?} falseExp\n     */\n    function Conditional(span, condition, trueExp, falseExp) {\n        var _this = _super.call(this, span) || this;\n        _this.condition = condition;\n        _this.trueExp = trueExp;\n        _this.falseExp = falseExp;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Conditional.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitConditional(this, context);\n    };\n    return Conditional;\n}(AST));\nvar PropertyRead = (function (_super) {\n    __extends(PropertyRead, _super);\n    /**\n     * @param {?} span\n     * @param {?} receiver\n     * @param {?} name\n     */\n    function PropertyRead(span, receiver, name) {\n        var _this = _super.call(this, span) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    PropertyRead.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitPropertyRead(this, context);\n    };\n    return PropertyRead;\n}(AST));\nvar PropertyWrite = (function (_super) {\n    __extends(PropertyWrite, _super);\n    /**\n     * @param {?} span\n     * @param {?} receiver\n     * @param {?} name\n     * @param {?} value\n     */\n    function PropertyWrite(span, receiver, name, value) {\n        var _this = _super.call(this, span) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    PropertyWrite.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitPropertyWrite(this, context);\n    };\n    return PropertyWrite;\n}(AST));\nvar SafePropertyRead = (function (_super) {\n    __extends(SafePropertyRead, _super);\n    /**\n     * @param {?} span\n     * @param {?} receiver\n     * @param {?} name\n     */\n    function SafePropertyRead(span, receiver, name) {\n        var _this = _super.call(this, span) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    SafePropertyRead.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitSafePropertyRead(this, context);\n    };\n    return SafePropertyRead;\n}(AST));\nvar KeyedRead = (function (_super) {\n    __extends(KeyedRead, _super);\n    /**\n     * @param {?} span\n     * @param {?} obj\n     * @param {?} key\n     */\n    function KeyedRead(span, obj, key) {\n        var _this = _super.call(this, span) || this;\n        _this.obj = obj;\n        _this.key = key;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    KeyedRead.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitKeyedRead(this, context);\n    };\n    return KeyedRead;\n}(AST));\nvar KeyedWrite = (function (_super) {\n    __extends(KeyedWrite, _super);\n    /**\n     * @param {?} span\n     * @param {?} obj\n     * @param {?} key\n     * @param {?} value\n     */\n    function KeyedWrite(span, obj, key, value) {\n        var _this = _super.call(this, span) || this;\n        _this.obj = obj;\n        _this.key = key;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    KeyedWrite.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitKeyedWrite(this, context);\n    };\n    return KeyedWrite;\n}(AST));\nvar BindingPipe = (function (_super) {\n    __extends(BindingPipe, _super);\n    /**\n     * @param {?} span\n     * @param {?} exp\n     * @param {?} name\n     * @param {?} args\n     */\n    function BindingPipe(span, exp, name, args) {\n        var _this = _super.call(this, span) || this;\n        _this.exp = exp;\n        _this.name = name;\n        _this.args = args;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    BindingPipe.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitPipe(this, context);\n    };\n    return BindingPipe;\n}(AST));\nvar LiteralPrimitive = (function (_super) {\n    __extends(LiteralPrimitive, _super);\n    /**\n     * @param {?} span\n     * @param {?} value\n     */\n    function LiteralPrimitive(span, value) {\n        var _this = _super.call(this, span) || this;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    LiteralPrimitive.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitLiteralPrimitive(this, context);\n    };\n    return LiteralPrimitive;\n}(AST));\nvar LiteralArray = (function (_super) {\n    __extends(LiteralArray, _super);\n    /**\n     * @param {?} span\n     * @param {?} expressions\n     */\n    function LiteralArray(span, expressions) {\n        var _this = _super.call(this, span) || this;\n        _this.expressions = expressions;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    LiteralArray.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitLiteralArray(this, context);\n    };\n    return LiteralArray;\n}(AST));\nvar LiteralMap = (function (_super) {\n    __extends(LiteralMap, _super);\n    /**\n     * @param {?} span\n     * @param {?} keys\n     * @param {?} values\n     */\n    function LiteralMap(span, keys, values) {\n        var _this = _super.call(this, span) || this;\n        _this.keys = keys;\n        _this.values = values;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    LiteralMap.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitLiteralMap(this, context);\n    };\n    return LiteralMap;\n}(AST));\nvar Interpolation = (function (_super) {\n    __extends(Interpolation, _super);\n    /**\n     * @param {?} span\n     * @param {?} strings\n     * @param {?} expressions\n     */\n    function Interpolation(span, strings, expressions) {\n        var _this = _super.call(this, span) || this;\n        _this.strings = strings;\n        _this.expressions = expressions;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Interpolation.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitInterpolation(this, context);\n    };\n    return Interpolation;\n}(AST));\nvar Binary = (function (_super) {\n    __extends(Binary, _super);\n    /**\n     * @param {?} span\n     * @param {?} operation\n     * @param {?} left\n     * @param {?} right\n     */\n    function Binary(span, operation, left, right) {\n        var _this = _super.call(this, span) || this;\n        _this.operation = operation;\n        _this.left = left;\n        _this.right = right;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Binary.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitBinary(this, context);\n    };\n    return Binary;\n}(AST));\nvar PrefixNot = (function (_super) {\n    __extends(PrefixNot, _super);\n    /**\n     * @param {?} span\n     * @param {?} expression\n     */\n    function PrefixNot(span, expression) {\n        var _this = _super.call(this, span) || this;\n        _this.expression = expression;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    PrefixNot.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitPrefixNot(this, context);\n    };\n    return PrefixNot;\n}(AST));\nvar NonNullAssert = (function (_super) {\n    __extends(NonNullAssert, _super);\n    /**\n     * @param {?} span\n     * @param {?} expression\n     */\n    function NonNullAssert(span, expression) {\n        var _this = _super.call(this, span) || this;\n        _this.expression = expression;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    NonNullAssert.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitNonNullAssert(this, context);\n    };\n    return NonNullAssert;\n}(AST));\nvar MethodCall = (function (_super) {\n    __extends(MethodCall, _super);\n    /**\n     * @param {?} span\n     * @param {?} receiver\n     * @param {?} name\n     * @param {?} args\n     */\n    function MethodCall(span, receiver, name, args) {\n        var _this = _super.call(this, span) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        _this.args = args;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    MethodCall.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitMethodCall(this, context);\n    };\n    return MethodCall;\n}(AST));\nvar SafeMethodCall = (function (_super) {\n    __extends(SafeMethodCall, _super);\n    /**\n     * @param {?} span\n     * @param {?} receiver\n     * @param {?} name\n     * @param {?} args\n     */\n    function SafeMethodCall(span, receiver, name, args) {\n        var _this = _super.call(this, span) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        _this.args = args;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    SafeMethodCall.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitSafeMethodCall(this, context);\n    };\n    return SafeMethodCall;\n}(AST));\nvar FunctionCall = (function (_super) {\n    __extends(FunctionCall, _super);\n    /**\n     * @param {?} span\n     * @param {?} target\n     * @param {?} args\n     */\n    function FunctionCall(span, target, args) {\n        var _this = _super.call(this, span) || this;\n        _this.target = target;\n        _this.args = args;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    FunctionCall.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return visitor.visitFunctionCall(this, context);\n    };\n    return FunctionCall;\n}(AST));\nvar ASTWithSource = (function (_super) {\n    __extends(ASTWithSource, _super);\n    /**\n     * @param {?} ast\n     * @param {?} source\n     * @param {?} location\n     * @param {?} errors\n     */\n    function ASTWithSource(ast, source, location, errors) {\n        var _this = _super.call(this, new ParseSpan(0, source == null ? 0 : source.length)) || this;\n        _this.ast = ast;\n        _this.source = source;\n        _this.location = location;\n        _this.errors = errors;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    ASTWithSource.prototype.visit = function (visitor, context) {\n        if (context === void 0) { context = null; }\n        return this.ast.visit(visitor, context);\n    };\n    /**\n     * @return {?}\n     */\n    ASTWithSource.prototype.toString = function () { return this.source + \" in \" + this.location; };\n    return ASTWithSource;\n}(AST));\nvar TemplateBinding = (function () {\n    /**\n     * @param {?} span\n     * @param {?} key\n     * @param {?} keyIsVar\n     * @param {?} name\n     * @param {?} expression\n     */\n    function TemplateBinding(span, key, keyIsVar, name, expression) {\n        this.span = span;\n        this.key = key;\n        this.keyIsVar = keyIsVar;\n        this.name = name;\n        this.expression = expression;\n    }\n    return TemplateBinding;\n}());\nvar NullAstVisitor = (function () {\n    function NullAstVisitor() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitBinary = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitChain = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitConditional = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitFunctionCall = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitInterpolation = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitKeyedRead = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitKeyedWrite = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitLiteralArray = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitLiteralMap = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitMethodCall = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitPipe = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitPrefixNot = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitNonNullAssert = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitPropertyRead = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitPropertyWrite = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitQuote = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitSafeMethodCall = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    NullAstVisitor.prototype.visitSafePropertyRead = function (ast, context) { };\n    return NullAstVisitor;\n}());\nvar RecursiveAstVisitor = (function () {\n    function RecursiveAstVisitor() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitBinary = function (ast, context) {\n        ast.left.visit(this);\n        ast.right.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitChain = function (ast, context) { return this.visitAll(ast.expressions, context); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitConditional = function (ast, context) {\n        ast.condition.visit(this);\n        ast.trueExp.visit(this);\n        ast.falseExp.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitPipe = function (ast, context) {\n        ast.exp.visit(this);\n        this.visitAll(ast.args, context);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitFunctionCall = function (ast, context) {\n        ((ast.target)).visit(this);\n        this.visitAll(ast.args, context);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { return null; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitInterpolation = function (ast, context) {\n        return this.visitAll(ast.expressions, context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitKeyedRead = function (ast, context) {\n        ast.obj.visit(this);\n        ast.key.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitKeyedWrite = function (ast, context) {\n        ast.obj.visit(this);\n        ast.key.visit(this);\n        ast.value.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitLiteralArray = function (ast, context) {\n        return this.visitAll(ast.expressions, context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitLiteralMap = function (ast, context) { return this.visitAll(ast.values, context); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { return null; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitMethodCall = function (ast, context) {\n        ast.receiver.visit(this);\n        return this.visitAll(ast.args, context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitPrefixNot = function (ast, context) {\n        ast.expression.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitNonNullAssert = function (ast, context) {\n        ast.expression.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitPropertyRead = function (ast, context) {\n        ast.receiver.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitPropertyWrite = function (ast, context) {\n        ast.receiver.visit(this);\n        ast.value.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitSafePropertyRead = function (ast, context) {\n        ast.receiver.visit(this);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitSafeMethodCall = function (ast, context) {\n        ast.receiver.visit(this);\n        return this.visitAll(ast.args, context);\n    };\n    /**\n     * @param {?} asts\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitAll = function (asts, context) {\n        var _this = this;\n        asts.forEach(function (ast) { return ast.visit(_this, context); });\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor.prototype.visitQuote = function (ast, context) { return null; };\n    return RecursiveAstVisitor;\n}());\nvar AstTransformer = (function () {\n    function AstTransformer() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitImplicitReceiver = function (ast, context) { return ast; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitInterpolation = function (ast, context) {\n        return new Interpolation(ast.span, ast.strings, this.visitAll(ast.expressions));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitLiteralPrimitive = function (ast, context) {\n        return new LiteralPrimitive(ast.span, ast.value);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitPropertyRead = function (ast, context) {\n        return new PropertyRead(ast.span, ast.receiver.visit(this), ast.name);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitPropertyWrite = function (ast, context) {\n        return new PropertyWrite(ast.span, ast.receiver.visit(this), ast.name, ast.value.visit(this));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitSafePropertyRead = function (ast, context) {\n        return new SafePropertyRead(ast.span, ast.receiver.visit(this), ast.name);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitMethodCall = function (ast, context) {\n        return new MethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitSafeMethodCall = function (ast, context) {\n        return new SafeMethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitFunctionCall = function (ast, context) {\n        return new FunctionCall(ast.span, /** @type {?} */ ((ast.target)).visit(this), this.visitAll(ast.args));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitLiteralArray = function (ast, context) {\n        return new LiteralArray(ast.span, this.visitAll(ast.expressions));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitLiteralMap = function (ast, context) {\n        return new LiteralMap(ast.span, ast.keys, this.visitAll(ast.values));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitBinary = function (ast, context) {\n        return new Binary(ast.span, ast.operation, ast.left.visit(this), ast.right.visit(this));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitPrefixNot = function (ast, context) {\n        return new PrefixNot(ast.span, ast.expression.visit(this));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitNonNullAssert = function (ast, context) {\n        return new NonNullAssert(ast.span, ast.expression.visit(this));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitConditional = function (ast, context) {\n        return new Conditional(ast.span, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitPipe = function (ast, context) {\n        return new BindingPipe(ast.span, ast.exp.visit(this), ast.name, this.visitAll(ast.args));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitKeyedRead = function (ast, context) {\n        return new KeyedRead(ast.span, ast.obj.visit(this), ast.key.visit(this));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitKeyedWrite = function (ast, context) {\n        return new KeyedWrite(ast.span, ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this));\n    };\n    /**\n     * @param {?} asts\n     * @return {?}\n     */\n    AstTransformer.prototype.visitAll = function (asts) {\n        var /** @type {?} */ res = new Array(asts.length);\n        for (var /** @type {?} */ i = 0; i < asts.length; ++i) {\n            res[i] = asts[i].visit(this);\n        }\n        return res;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitChain = function (ast, context) {\n        return new Chain(ast.span, this.visitAll(ast.expressions));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer.prototype.visitQuote = function (ast, context) {\n        return new Quote(ast.span, ast.prefix, ast.uninterpretedExpression, ast.location);\n    };\n    return AstTransformer;\n}());\n/**\n * @param {?} ast\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\nfunction visitAstChildren(ast, visitor, context) {\n    /**\n     * @param {?} ast\n     * @return {?}\n     */\n    function visit(ast) {\n        visitor.visit && visitor.visit(ast, context) || ast.visit(visitor, context);\n    }\n    /**\n     * @template T\n     * @param {?} asts\n     * @return {?}\n     */\n    function visitAll(asts) { asts.forEach(visit); }\n    ast.visit({\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitBinary: function (ast) {\n            visit(ast.left);\n            visit(ast.right);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitChain: function (ast) { visitAll(ast.expressions); },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitConditional: function (ast) {\n            visit(ast.condition);\n            visit(ast.trueExp);\n            visit(ast.falseExp);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitFunctionCall: function (ast) {\n            if (ast.target) {\n                visit(ast.target);\n            }\n            visitAll(ast.args);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitImplicitReceiver: function (ast) { },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitInterpolation: function (ast) { visitAll(ast.expressions); },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitKeyedRead: function (ast) {\n            visit(ast.obj);\n            visit(ast.key);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitKeyedWrite: function (ast) {\n            visit(ast.obj);\n            visit(ast.key);\n            visit(ast.obj);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitLiteralArray: function (ast) { visitAll(ast.expressions); },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitLiteralMap: function (ast) { },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitLiteralPrimitive: function (ast) { },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitMethodCall: function (ast) {\n            visit(ast.receiver);\n            visitAll(ast.args);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitPipe: function (ast) {\n            visit(ast.exp);\n            visitAll(ast.args);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitPrefixNot: function (ast) { visit(ast.expression); },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitNonNullAssert: function (ast) { visit(ast.expression); },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitPropertyRead: function (ast) { visit(ast.receiver); },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitPropertyWrite: function (ast) {\n            visit(ast.receiver);\n            visit(ast.value);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitQuote: function (ast) { },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitSafeMethodCall: function (ast) {\n            visit(ast.receiver);\n            visitAll(ast.args);\n        },\n        /**\n         * @param {?} ast\n         * @return {?}\n         */\n        visitSafePropertyRead: function (ast) { visit(ast.receiver); },\n    });\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar $EOF = 0;\nvar $TAB = 9;\nvar $LF = 10;\nvar $VTAB = 11;\nvar $FF = 12;\nvar $CR = 13;\nvar $SPACE = 32;\nvar $BANG = 33;\nvar $DQ = 34;\nvar $HASH = 35;\nvar $$ = 36;\nvar $PERCENT = 37;\nvar $AMPERSAND = 38;\nvar $SQ = 39;\nvar $LPAREN = 40;\nvar $RPAREN = 41;\nvar $STAR = 42;\nvar $PLUS = 43;\nvar $COMMA = 44;\nvar $MINUS = 45;\nvar $PERIOD = 46;\nvar $SLASH = 47;\nvar $COLON = 58;\nvar $SEMICOLON = 59;\nvar $LT = 60;\nvar $EQ = 61;\nvar $GT = 62;\nvar $QUESTION = 63;\nvar $0 = 48;\nvar $9 = 57;\nvar $A = 65;\nvar $E = 69;\nvar $F = 70;\nvar $X = 88;\nvar $Z = 90;\nvar $LBRACKET = 91;\nvar $BACKSLASH = 92;\nvar $RBRACKET = 93;\nvar $CARET = 94;\nvar $_ = 95;\nvar $a = 97;\nvar $e = 101;\nvar $f = 102;\nvar $n = 110;\nvar $r = 114;\nvar $t = 116;\nvar $u = 117;\nvar $v = 118;\nvar $x = 120;\nvar $z = 122;\nvar $LBRACE = 123;\nvar $BAR = 124;\nvar $RBRACE = 125;\nvar $NBSP = 160;\nvar $BT = 96;\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isWhitespace(code) {\n    return (code >= $TAB && code <= $SPACE) || (code == $NBSP);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isDigit(code) {\n    return $0 <= code && code <= $9;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isAsciiLetter(code) {\n    return code >= $a && code <= $z || code >= $A && code <= $Z;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isAsciiHexDigit(code) {\n    return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);\n}\n/**\n * A replacement for \\@Injectable to be used in the compiler, so that\n * we don't try to evaluate the metadata in the compiler during AoT.\n * This decorator is enough to make the compiler work with the ReflectiveInjector though.\n * \\@Annotation\n * @return {?}\n */\nfunction CompilerInjectable() {\n    return function (x) { return x; };\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} identifier\n * @param {?} value\n * @return {?}\n */\nfunction assertArrayOfStrings(identifier, value) {\n    if (!_angular_core.isDevMode() || value == null) {\n        return;\n    }\n    if (!Array.isArray(value)) {\n        throw new Error(\"Expected '\" + identifier + \"' to be an array of strings.\");\n    }\n    for (var /** @type {?} */ i = 0; i < value.length; i += 1) {\n        if (typeof value[i] !== 'string') {\n            throw new Error(\"Expected '\" + identifier + \"' to be an array of strings.\");\n        }\n    }\n}\nvar INTERPOLATION_BLACKLIST_REGEXPS = [\n    /^\\s*$/,\n    /[<>]/,\n    /^[{}]$/,\n    /&(#|[a-z])/i,\n    /^\\/\\//,\n];\n/**\n * @param {?} identifier\n * @param {?} value\n * @return {?}\n */\nfunction assertInterpolationSymbols(identifier, value) {\n    if (value != null && !(Array.isArray(value) && value.length == 2)) {\n        throw new Error(\"Expected '\" + identifier + \"' to be an array, [start, end].\");\n    }\n    else if (_angular_core.isDevMode() && value != null) {\n        var /** @type {?} */ start_1 = (value[0]);\n        var /** @type {?} */ end_1 = (value[1]);\n        // black list checking\n        INTERPOLATION_BLACKLIST_REGEXPS.forEach(function (regexp) {\n            if (regexp.test(start_1) || regexp.test(end_1)) {\n                throw new Error(\"['\" + start_1 + \"', '\" + end_1 + \"'] contains unusable interpolation symbol.\");\n            }\n        });\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar InterpolationConfig = (function () {\n    /**\n     * @param {?} start\n     * @param {?} end\n     */\n    function InterpolationConfig(start, end) {\n        this.start = start;\n        this.end = end;\n    }\n    /**\n     * @param {?} markers\n     * @return {?}\n     */\n    InterpolationConfig.fromArray = function (markers) {\n        if (!markers) {\n            return DEFAULT_INTERPOLATION_CONFIG;\n        }\n        assertInterpolationSymbols('interpolation', markers);\n        return new InterpolationConfig(markers[0], markers[1]);\n    };\n    \n    return InterpolationConfig;\n}());\nvar DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar TokenType = {};\nTokenType.Character = 0;\nTokenType.Identifier = 1;\nTokenType.Keyword = 2;\nTokenType.String = 3;\nTokenType.Operator = 4;\nTokenType.Number = 5;\nTokenType.Error = 6;\nTokenType[TokenType.Character] = \"Character\";\nTokenType[TokenType.Identifier] = \"Identifier\";\nTokenType[TokenType.Keyword] = \"Keyword\";\nTokenType[TokenType.String] = \"String\";\nTokenType[TokenType.Operator] = \"Operator\";\nTokenType[TokenType.Number] = \"Number\";\nTokenType[TokenType.Error] = \"Error\";\nvar KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];\nvar Lexer = (function () {\n    function Lexer() {\n    }\n    /**\n     * @param {?} text\n     * @return {?}\n     */\n    Lexer.prototype.tokenize = function (text) {\n        var /** @type {?} */ scanner = new _Scanner(text);\n        var /** @type {?} */ tokens = [];\n        var /** @type {?} */ token = scanner.scanToken();\n        while (token != null) {\n            tokens.push(token);\n            token = scanner.scanToken();\n        }\n        return tokens;\n    };\n    return Lexer;\n}());\nLexer.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nLexer.ctorParameters = function () { return []; };\nvar Token = (function () {\n    /**\n     * @param {?} index\n     * @param {?} type\n     * @param {?} numValue\n     * @param {?} strValue\n     */\n    function Token(index, type, numValue, strValue) {\n        this.index = index;\n        this.type = type;\n        this.numValue = numValue;\n        this.strValue = strValue;\n    }\n    /**\n     * @param {?} code\n     * @return {?}\n     */\n    Token.prototype.isCharacter = function (code) {\n        return this.type == TokenType.Character && this.numValue == code;\n    };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isNumber = function () { return this.type == TokenType.Number; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isString = function () { return this.type == TokenType.String; };\n    /**\n     * @param {?} operater\n     * @return {?}\n     */\n    Token.prototype.isOperator = function (operater) {\n        return this.type == TokenType.Operator && this.strValue == operater;\n    };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isIdentifier = function () { return this.type == TokenType.Identifier; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeyword = function () { return this.type == TokenType.Keyword; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordLet = function () { return this.type == TokenType.Keyword && this.strValue == 'let'; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordAs = function () { return this.type == TokenType.Keyword && this.strValue == 'as'; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordNull = function () { return this.type == TokenType.Keyword && this.strValue == 'null'; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordUndefined = function () {\n        return this.type == TokenType.Keyword && this.strValue == 'undefined';\n    };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordTrue = function () { return this.type == TokenType.Keyword && this.strValue == 'true'; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordFalse = function () { return this.type == TokenType.Keyword && this.strValue == 'false'; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isKeywordThis = function () { return this.type == TokenType.Keyword && this.strValue == 'this'; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.isError = function () { return this.type == TokenType.Error; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.toNumber = function () { return this.type == TokenType.Number ? this.numValue : -1; };\n    /**\n     * @return {?}\n     */\n    Token.prototype.toString = function () {\n        switch (this.type) {\n            case TokenType.Character:\n            case TokenType.Identifier:\n            case TokenType.Keyword:\n            case TokenType.Operator:\n            case TokenType.String:\n            case TokenType.Error:\n                return this.strValue;\n            case TokenType.Number:\n                return this.numValue.toString();\n            default:\n                return null;\n        }\n    };\n    return Token;\n}());\n/**\n * @param {?} index\n * @param {?} code\n * @return {?}\n */\nfunction newCharacterToken(index, code) {\n    return new Token(index, TokenType.Character, code, String.fromCharCode(code));\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newIdentifierToken(index, text) {\n    return new Token(index, TokenType.Identifier, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newKeywordToken(index, text) {\n    return new Token(index, TokenType.Keyword, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newOperatorToken(index, text) {\n    return new Token(index, TokenType.Operator, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newStringToken(index, text) {\n    return new Token(index, TokenType.String, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} n\n * @return {?}\n */\nfunction newNumberToken(index, n) {\n    return new Token(index, TokenType.Number, n, '');\n}\n/**\n * @param {?} index\n * @param {?} message\n * @return {?}\n */\nfunction newErrorToken(index, message) {\n    return new Token(index, TokenType.Error, 0, message);\n}\nvar EOF = new Token(-1, TokenType.Character, 0, '');\nvar _Scanner = (function () {\n    /**\n     * @param {?} input\n     */\n    function _Scanner(input) {\n        this.input = input;\n        this.peek = 0;\n        this.index = -1;\n        this.length = input.length;\n        this.advance();\n    }\n    /**\n     * @return {?}\n     */\n    _Scanner.prototype.advance = function () {\n        this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);\n    };\n    /**\n     * @return {?}\n     */\n    _Scanner.prototype.scanToken = function () {\n        var /** @type {?} */ input = this.input, /** @type {?} */ length = this.length;\n        var /** @type {?} */ peek = this.peek, /** @type {?} */ index = this.index;\n        // Skip whitespace.\n        while (peek <= $SPACE) {\n            if (++index >= length) {\n                peek = $EOF;\n                break;\n            }\n            else {\n                peek = input.charCodeAt(index);\n            }\n        }\n        this.peek = peek;\n        this.index = index;\n        if (index >= length) {\n            return null;\n        }\n        // Handle identifiers and numbers.\n        if (isIdentifierStart(peek))\n            return this.scanIdentifier();\n        if (isDigit(peek))\n            return this.scanNumber(index);\n        var /** @type {?} */ start = index;\n        switch (peek) {\n            case $PERIOD:\n                this.advance();\n                return isDigit(this.peek) ? this.scanNumber(start) :\n                    newCharacterToken(start, $PERIOD);\n            case $LPAREN:\n            case $RPAREN:\n            case $LBRACE:\n            case $RBRACE:\n            case $LBRACKET:\n            case $RBRACKET:\n            case $COMMA:\n            case $COLON:\n            case $SEMICOLON:\n                return this.scanCharacter(start, peek);\n            case $SQ:\n            case $DQ:\n                return this.scanString();\n            case $HASH:\n            case $PLUS:\n            case $MINUS:\n            case $STAR:\n            case $SLASH:\n            case $PERCENT:\n            case $CARET:\n                return this.scanOperator(start, String.fromCharCode(peek));\n            case $QUESTION:\n                return this.scanComplexOperator(start, '?', $PERIOD, '.');\n            case $LT:\n            case $GT:\n                return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');\n            case $BANG:\n            case $EQ:\n                return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');\n            case $AMPERSAND:\n                return this.scanComplexOperator(start, '&', $AMPERSAND, '&');\n            case $BAR:\n                return this.scanComplexOperator(start, '|', $BAR, '|');\n            case $NBSP:\n                while (isWhitespace(this.peek))\n                    this.advance();\n                return this.scanToken();\n        }\n        this.advance();\n        return this.error(\"Unexpected character [\" + String.fromCharCode(peek) + \"]\", 0);\n    };\n    /**\n     * @param {?} start\n     * @param {?} code\n     * @return {?}\n     */\n    _Scanner.prototype.scanCharacter = function (start, code) {\n        this.advance();\n        return newCharacterToken(start, code);\n    };\n    /**\n     * @param {?} start\n     * @param {?} str\n     * @return {?}\n     */\n    _Scanner.prototype.scanOperator = function (start, str) {\n        this.advance();\n        return newOperatorToken(start, str);\n    };\n    /**\n     * Tokenize a 2/3 char long operator\n     *\n     * @param {?} start start index in the expression\n     * @param {?} one first symbol (always part of the operator)\n     * @param {?} twoCode code point for the second symbol\n     * @param {?} two second symbol (part of the operator when the second code point matches)\n     * @param {?=} threeCode code point for the third symbol\n     * @param {?=} three third symbol (part of the operator when provided and matches source expression)\n     * @return {?}\n     */\n    _Scanner.prototype.scanComplexOperator = function (start, one, twoCode, two, threeCode, three) {\n        this.advance();\n        var /** @type {?} */ str = one;\n        if (this.peek == twoCode) {\n            this.advance();\n            str += two;\n        }\n        if (threeCode != null && this.peek == threeCode) {\n            this.advance();\n            str += three;\n        }\n        return newOperatorToken(start, str);\n    };\n    /**\n     * @return {?}\n     */\n    _Scanner.prototype.scanIdentifier = function () {\n        var /** @type {?} */ start = this.index;\n        this.advance();\n        while (isIdentifierPart(this.peek))\n            this.advance();\n        var /** @type {?} */ str = this.input.substring(start, this.index);\n        return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, str) :\n            newIdentifierToken(start, str);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Scanner.prototype.scanNumber = function (start) {\n        var /** @type {?} */ simple = (this.index === start);\n        this.advance(); // Skip initial digit.\n        while (true) {\n            if (isDigit(this.peek)) {\n                // Do nothing.\n            }\n            else if (this.peek == $PERIOD) {\n                simple = false;\n            }\n            else if (isExponentStart(this.peek)) {\n                this.advance();\n                if (isExponentSign(this.peek))\n                    this.advance();\n                if (!isDigit(this.peek))\n                    return this.error('Invalid exponent', -1);\n                simple = false;\n            }\n            else {\n                break;\n            }\n            this.advance();\n        }\n        var /** @type {?} */ str = this.input.substring(start, this.index);\n        var /** @type {?} */ value = simple ? parseIntAutoRadix(str) : parseFloat(str);\n        return newNumberToken(start, value);\n    };\n    /**\n     * @return {?}\n     */\n    _Scanner.prototype.scanString = function () {\n        var /** @type {?} */ start = this.index;\n        var /** @type {?} */ quote = this.peek;\n        this.advance(); // Skip initial quote.\n        var /** @type {?} */ buffer = '';\n        var /** @type {?} */ marker = this.index;\n        var /** @type {?} */ input = this.input;\n        while (this.peek != quote) {\n            if (this.peek == $BACKSLASH) {\n                buffer += input.substring(marker, this.index);\n                this.advance();\n                var /** @type {?} */ unescapedCode = void 0;\n                // Workaround for TS2.1-introduced type strictness\n                this.peek = this.peek;\n                if (this.peek == $u) {\n                    // 4 character hex code for unicode character.\n                    var /** @type {?} */ hex = input.substring(this.index + 1, this.index + 5);\n                    if (/^[0-9a-f]+$/i.test(hex)) {\n                        unescapedCode = parseInt(hex, 16);\n                    }\n                    else {\n                        return this.error(\"Invalid unicode escape [\\\\u\" + hex + \"]\", 0);\n                    }\n                    for (var /** @type {?} */ i = 0; i < 5; i++) {\n                        this.advance();\n                    }\n                }\n                else {\n                    unescapedCode = unescape(this.peek);\n                    this.advance();\n                }\n                buffer += String.fromCharCode(unescapedCode);\n                marker = this.index;\n            }\n            else if (this.peek == $EOF) {\n                return this.error('Unterminated quote', 0);\n            }\n            else {\n                this.advance();\n            }\n        }\n        var /** @type {?} */ last = input.substring(marker, this.index);\n        this.advance(); // Skip terminating quote.\n        return newStringToken(start, buffer + last);\n    };\n    /**\n     * @param {?} message\n     * @param {?} offset\n     * @return {?}\n     */\n    _Scanner.prototype.error = function (message, offset) {\n        var /** @type {?} */ position = this.index + offset;\n        return newErrorToken(position, \"Lexer Error: \" + message + \" at column \" + position + \" in expression [\" + this.input + \"]\");\n    };\n    return _Scanner;\n}());\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isIdentifierStart(code) {\n    return ($a <= code && code <= $z) || ($A <= code && code <= $Z) ||\n        (code == $_) || (code == $$);\n}\n/**\n * @param {?} input\n * @return {?}\n */\nfunction isIdentifier(input) {\n    if (input.length == 0)\n        return false;\n    var /** @type {?} */ scanner = new _Scanner(input);\n    if (!isIdentifierStart(scanner.peek))\n        return false;\n    scanner.advance();\n    while (scanner.peek !== $EOF) {\n        if (!isIdentifierPart(scanner.peek))\n            return false;\n        scanner.advance();\n    }\n    return true;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isIdentifierPart(code) {\n    return isAsciiLetter(code) || isDigit(code) || (code == $_) ||\n        (code == $$);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isExponentStart(code) {\n    return code == $e || code == $E;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isExponentSign(code) {\n    return code == $MINUS || code == $PLUS;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isQuote(code) {\n    return code === $SQ || code === $DQ || code === $BT;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction unescape(code) {\n    switch (code) {\n        case $n:\n            return $LF;\n        case $f:\n            return $FF;\n        case $r:\n            return $CR;\n        case $t:\n            return $TAB;\n        case $v:\n            return $VTAB;\n        default:\n            return code;\n    }\n}\n/**\n * @param {?} text\n * @return {?}\n */\nfunction parseIntAutoRadix(text) {\n    var /** @type {?} */ result = parseInt(text);\n    if (isNaN(result)) {\n        throw new Error('Invalid integer literal when parsing ' + text);\n    }\n    return result;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar SplitInterpolation = (function () {\n    /**\n     * @param {?} strings\n     * @param {?} expressions\n     * @param {?} offsets\n     */\n    function SplitInterpolation(strings, expressions, offsets) {\n        this.strings = strings;\n        this.expressions = expressions;\n        this.offsets = offsets;\n    }\n    return SplitInterpolation;\n}());\nvar TemplateBindingParseResult = (function () {\n    /**\n     * @param {?} templateBindings\n     * @param {?} warnings\n     * @param {?} errors\n     */\n    function TemplateBindingParseResult(templateBindings, warnings, errors) {\n        this.templateBindings = templateBindings;\n        this.warnings = warnings;\n        this.errors = errors;\n    }\n    return TemplateBindingParseResult;\n}());\n/**\n * @param {?} config\n * @return {?}\n */\nfunction _createInterpolateRegExp(config) {\n    var /** @type {?} */ pattern = escapeRegExp(config.start) + '([\\\\s\\\\S]*?)' + escapeRegExp(config.end);\n    return new RegExp(pattern, 'g');\n}\nvar Parser = (function () {\n    /**\n     * @param {?} _lexer\n     */\n    function Parser(_lexer) {\n        this._lexer = _lexer;\n        this.errors = [];\n    }\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype.parseAction = function (input, location, interpolationConfig) {\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        this._checkNoInterpolation(input, location, interpolationConfig);\n        var /** @type {?} */ sourceToLex = this._stripComments(input);\n        var /** @type {?} */ tokens = this._lexer.tokenize(this._stripComments(input));\n        var /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, true, this.errors, input.length - sourceToLex.length)\n            .parseChain();\n        return new ASTWithSource(ast, input, location, this.errors);\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype.parseBinding = function (input, location, interpolationConfig) {\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);\n        return new ASTWithSource(ast, input, location, this.errors);\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype.parseSimpleBinding = function (input, location, interpolationConfig) {\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);\n        var /** @type {?} */ errors = SimpleExpressionChecker.check(ast);\n        if (errors.length > 0) {\n            this._reportError(\"Host binding expression cannot contain \" + errors.join(' '), input, location);\n        }\n        return new ASTWithSource(ast, input, location, this.errors);\n    };\n    /**\n     * @param {?} message\n     * @param {?} input\n     * @param {?} errLocation\n     * @param {?=} ctxLocation\n     * @return {?}\n     */\n    Parser.prototype._reportError = function (message, input, errLocation, ctxLocation) {\n        this.errors.push(new ParserError(message, input, errLocation, ctxLocation));\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype._parseBindingAst = function (input, location, interpolationConfig) {\n        // Quotes expressions use 3rd-party expression language. We don't want to use\n        // our lexer or parser for that, so we check for that ahead of time.\n        var /** @type {?} */ quote = this._parseQuote(input, location);\n        if (quote != null) {\n            return quote;\n        }\n        this._checkNoInterpolation(input, location, interpolationConfig);\n        var /** @type {?} */ sourceToLex = this._stripComments(input);\n        var /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);\n        return new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, input.length - sourceToLex.length)\n            .parseChain();\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @return {?}\n     */\n    Parser.prototype._parseQuote = function (input, location) {\n        if (input == null)\n            return null;\n        var /** @type {?} */ prefixSeparatorIndex = input.indexOf(':');\n        if (prefixSeparatorIndex == -1)\n            return null;\n        var /** @type {?} */ prefix = input.substring(0, prefixSeparatorIndex).trim();\n        if (!isIdentifier(prefix))\n            return null;\n        var /** @type {?} */ uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);\n        return new Quote(new ParseSpan(0, input.length), prefix, uninterpretedExpression, location);\n    };\n    /**\n     * @param {?} prefixToken\n     * @param {?} input\n     * @param {?} location\n     * @return {?}\n     */\n    Parser.prototype.parseTemplateBindings = function (prefixToken, input, location) {\n        var /** @type {?} */ tokens = this._lexer.tokenize(input);\n        if (prefixToken) {\n            // Prefix the tokens with the tokens from prefixToken but have them take no space (0 index).\n            var /** @type {?} */ prefixTokens = this._lexer.tokenize(prefixToken).map(function (t) {\n                t.index = 0;\n                return t;\n            });\n            tokens.unshift.apply(tokens, prefixTokens);\n        }\n        return new _ParseAST(input, location, tokens, input.length, false, this.errors, 0)\n            .parseTemplateBindings();\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype.parseInterpolation = function (input, location, interpolationConfig) {\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        var /** @type {?} */ split = this.splitInterpolation(input, location, interpolationConfig);\n        if (split == null)\n            return null;\n        var /** @type {?} */ expressions = [];\n        for (var /** @type {?} */ i = 0; i < split.expressions.length; ++i) {\n            var /** @type {?} */ expressionText = split.expressions[i];\n            var /** @type {?} */ sourceToLex = this._stripComments(expressionText);\n            var /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);\n            var /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, split.offsets[i] + (expressionText.length - sourceToLex.length))\n                .parseChain();\n            expressions.push(ast);\n        }\n        return new ASTWithSource(new Interpolation(new ParseSpan(0, input == null ? 0 : input.length), split.strings, expressions), input, location, this.errors);\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype.splitInterpolation = function (input, location, interpolationConfig) {\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);\n        var /** @type {?} */ parts = input.split(regexp);\n        if (parts.length <= 1) {\n            return null;\n        }\n        var /** @type {?} */ strings = [];\n        var /** @type {?} */ expressions = [];\n        var /** @type {?} */ offsets = [];\n        var /** @type {?} */ offset = 0;\n        for (var /** @type {?} */ i = 0; i < parts.length; i++) {\n            var /** @type {?} */ part = parts[i];\n            if (i % 2 === 0) {\n                // fixed string\n                strings.push(part);\n                offset += part.length;\n            }\n            else if (part.trim().length > 0) {\n                offset += interpolationConfig.start.length;\n                expressions.push(part);\n                offsets.push(offset);\n                offset += part.length + interpolationConfig.end.length;\n            }\n            else {\n                this._reportError('Blank expressions are not allowed in interpolated strings', input, \"at column \" + this._findInterpolationErrorColumn(parts, i, interpolationConfig) + \" in\", location);\n                expressions.push('$implict');\n                offsets.push(offset);\n            }\n        }\n        return new SplitInterpolation(strings, expressions, offsets);\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @return {?}\n     */\n    Parser.prototype.wrapLiteralPrimitive = function (input, location) {\n        return new ASTWithSource(new LiteralPrimitive(new ParseSpan(0, input == null ? 0 : input.length), input), input, location, this.errors);\n    };\n    /**\n     * @param {?} input\n     * @return {?}\n     */\n    Parser.prototype._stripComments = function (input) {\n        var /** @type {?} */ i = this._commentStart(input);\n        return i != null ? input.substring(0, i).trim() : input;\n    };\n    /**\n     * @param {?} input\n     * @return {?}\n     */\n    Parser.prototype._commentStart = function (input) {\n        var /** @type {?} */ outerQuote = null;\n        for (var /** @type {?} */ i = 0; i < input.length - 1; i++) {\n            var /** @type {?} */ char = input.charCodeAt(i);\n            var /** @type {?} */ nextChar = input.charCodeAt(i + 1);\n            if (char === $SLASH && nextChar == $SLASH && outerQuote == null)\n                return i;\n            if (outerQuote === char) {\n                outerQuote = null;\n            }\n            else if (outerQuote == null && isQuote(char)) {\n                outerQuote = char;\n            }\n        }\n        return null;\n    };\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype._checkNoInterpolation = function (input, location, interpolationConfig) {\n        var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);\n        var /** @type {?} */ parts = input.split(regexp);\n        if (parts.length > 1) {\n            this._reportError(\"Got interpolation (\" + interpolationConfig.start + interpolationConfig.end + \") where expression was expected\", input, \"at column \" + this._findInterpolationErrorColumn(parts, 1, interpolationConfig) + \" in\", location);\n        }\n    };\n    /**\n     * @param {?} parts\n     * @param {?} partInErrIdx\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    Parser.prototype._findInterpolationErrorColumn = function (parts, partInErrIdx, interpolationConfig) {\n        var /** @type {?} */ errLocation = '';\n        for (var /** @type {?} */ j = 0; j < partInErrIdx; j++) {\n            errLocation += j % 2 === 0 ?\n                parts[j] :\n                \"\" + interpolationConfig.start + parts[j] + interpolationConfig.end;\n        }\n        return errLocation.length;\n    };\n    return Parser;\n}());\nParser.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nParser.ctorParameters = function () { return [\n    { type: Lexer, },\n]; };\nvar _ParseAST = (function () {\n    /**\n     * @param {?} input\n     * @param {?} location\n     * @param {?} tokens\n     * @param {?} inputLength\n     * @param {?} parseAction\n     * @param {?} errors\n     * @param {?} offset\n     */\n    function _ParseAST(input, location, tokens, inputLength, parseAction, errors, offset) {\n        this.input = input;\n        this.location = location;\n        this.tokens = tokens;\n        this.inputLength = inputLength;\n        this.parseAction = parseAction;\n        this.errors = errors;\n        this.offset = offset;\n        this.rparensExpected = 0;\n        this.rbracketsExpected = 0;\n        this.rbracesExpected = 0;\n        this.index = 0;\n    }\n    /**\n     * @param {?} offset\n     * @return {?}\n     */\n    _ParseAST.prototype.peek = function (offset) {\n        var /** @type {?} */ i = this.index + offset;\n        return i < this.tokens.length ? this.tokens[i] : EOF;\n    };\n    Object.defineProperty(_ParseAST.prototype, \"next\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.peek(0); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(_ParseAST.prototype, \"inputIndex\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return (this.index < this.tokens.length) ? this.next.index + this.offset :\n                this.inputLength + this.offset;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _ParseAST.prototype.span = function (start) { return new ParseSpan(start, this.inputIndex); };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.advance = function () { this.index++; };\n    /**\n     * @param {?} code\n     * @return {?}\n     */\n    _ParseAST.prototype.optionalCharacter = function (code) {\n        if (this.next.isCharacter(code)) {\n            this.advance();\n            return true;\n        }\n        else {\n            return false;\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.peekKeywordLet = function () { return this.next.isKeywordLet(); };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.peekKeywordAs = function () { return this.next.isKeywordAs(); };\n    /**\n     * @param {?} code\n     * @return {?}\n     */\n    _ParseAST.prototype.expectCharacter = function (code) {\n        if (this.optionalCharacter(code))\n            return;\n        this.error(\"Missing expected \" + String.fromCharCode(code));\n    };\n    /**\n     * @param {?} op\n     * @return {?}\n     */\n    _ParseAST.prototype.optionalOperator = function (op) {\n        if (this.next.isOperator(op)) {\n            this.advance();\n            return true;\n        }\n        else {\n            return false;\n        }\n    };\n    /**\n     * @param {?} operator\n     * @return {?}\n     */\n    _ParseAST.prototype.expectOperator = function (operator) {\n        if (this.optionalOperator(operator))\n            return;\n        this.error(\"Missing expected operator \" + operator);\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.expectIdentifierOrKeyword = function () {\n        var /** @type {?} */ n = this.next;\n        if (!n.isIdentifier() && !n.isKeyword()) {\n            this.error(\"Unexpected token \" + n + \", expected identifier or keyword\");\n            return '';\n        }\n        this.advance();\n        return n.toString();\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.expectIdentifierOrKeywordOrString = function () {\n        var /** @type {?} */ n = this.next;\n        if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {\n            this.error(\"Unexpected token \" + n + \", expected identifier, keyword, or string\");\n            return '';\n        }\n        this.advance();\n        return n.toString();\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseChain = function () {\n        var /** @type {?} */ exprs = [];\n        var /** @type {?} */ start = this.inputIndex;\n        while (this.index < this.tokens.length) {\n            var /** @type {?} */ expr = this.parsePipe();\n            exprs.push(expr);\n            if (this.optionalCharacter($SEMICOLON)) {\n                if (!this.parseAction) {\n                    this.error('Binding expression cannot contain chained expression');\n                }\n                while (this.optionalCharacter($SEMICOLON)) {\n                } // read all semicolons\n            }\n            else if (this.index < this.tokens.length) {\n                this.error(\"Unexpected token '\" + this.next + \"'\");\n            }\n        }\n        if (exprs.length == 0)\n            return new EmptyExpr(this.span(start));\n        if (exprs.length == 1)\n            return exprs[0];\n        return new Chain(this.span(start), exprs);\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parsePipe = function () {\n        var /** @type {?} */ result = this.parseExpression();\n        if (this.optionalOperator('|')) {\n            if (this.parseAction) {\n                this.error('Cannot have a pipe in an action expression');\n            }\n            do {\n                var /** @type {?} */ name = ((this.expectIdentifierOrKeyword()));\n                var /** @type {?} */ args = [];\n                while (this.optionalCharacter($COLON)) {\n                    args.push(this.parseExpression());\n                }\n                result = new BindingPipe(this.span(result.span.start), result, name, args);\n            } while (this.optionalOperator('|'));\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseExpression = function () { return this.parseConditional(); };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseConditional = function () {\n        var /** @type {?} */ start = this.inputIndex;\n        var /** @type {?} */ result = this.parseLogicalOr();\n        if (this.optionalOperator('?')) {\n            var /** @type {?} */ yes = this.parsePipe();\n            var /** @type {?} */ no = void 0;\n            if (!this.optionalCharacter($COLON)) {\n                var /** @type {?} */ end = this.inputIndex;\n                var /** @type {?} */ expression = this.input.substring(start, end);\n                this.error(\"Conditional expression \" + expression + \" requires all 3 expressions\");\n                no = new EmptyExpr(this.span(start));\n            }\n            else {\n                no = this.parsePipe();\n            }\n            return new Conditional(this.span(start), result, yes, no);\n        }\n        else {\n            return result;\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseLogicalOr = function () {\n        // '||'\n        var /** @type {?} */ result = this.parseLogicalAnd();\n        while (this.optionalOperator('||')) {\n            var /** @type {?} */ right = this.parseLogicalAnd();\n            result = new Binary(this.span(result.span.start), '||', result, right);\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseLogicalAnd = function () {\n        // '&&'\n        var /** @type {?} */ result = this.parseEquality();\n        while (this.optionalOperator('&&')) {\n            var /** @type {?} */ right = this.parseEquality();\n            result = new Binary(this.span(result.span.start), '&&', result, right);\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseEquality = function () {\n        // '==','!=','===','!=='\n        var /** @type {?} */ result = this.parseRelational();\n        while (this.next.type == TokenType.Operator) {\n            var /** @type {?} */ operator = this.next.strValue;\n            switch (operator) {\n                case '==':\n                case '===':\n                case '!=':\n                case '!==':\n                    this.advance();\n                    var /** @type {?} */ right = this.parseRelational();\n                    result = new Binary(this.span(result.span.start), operator, result, right);\n                    continue;\n            }\n            break;\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseRelational = function () {\n        // '<', '>', '<=', '>='\n        var /** @type {?} */ result = this.parseAdditive();\n        while (this.next.type == TokenType.Operator) {\n            var /** @type {?} */ operator = this.next.strValue;\n            switch (operator) {\n                case '<':\n                case '>':\n                case '<=':\n                case '>=':\n                    this.advance();\n                    var /** @type {?} */ right = this.parseAdditive();\n                    result = new Binary(this.span(result.span.start), operator, result, right);\n                    continue;\n            }\n            break;\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseAdditive = function () {\n        // '+', '-'\n        var /** @type {?} */ result = this.parseMultiplicative();\n        while (this.next.type == TokenType.Operator) {\n            var /** @type {?} */ operator = this.next.strValue;\n            switch (operator) {\n                case '+':\n                case '-':\n                    this.advance();\n                    var /** @type {?} */ right = this.parseMultiplicative();\n                    result = new Binary(this.span(result.span.start), operator, result, right);\n                    continue;\n            }\n            break;\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseMultiplicative = function () {\n        // '*', '%', '/'\n        var /** @type {?} */ result = this.parsePrefix();\n        while (this.next.type == TokenType.Operator) {\n            var /** @type {?} */ operator = this.next.strValue;\n            switch (operator) {\n                case '*':\n                case '%':\n                case '/':\n                    this.advance();\n                    var /** @type {?} */ right = this.parsePrefix();\n                    result = new Binary(this.span(result.span.start), operator, result, right);\n                    continue;\n            }\n            break;\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parsePrefix = function () {\n        if (this.next.type == TokenType.Operator) {\n            var /** @type {?} */ start = this.inputIndex;\n            var /** @type {?} */ operator = this.next.strValue;\n            var /** @type {?} */ result = void 0;\n            switch (operator) {\n                case '+':\n                    this.advance();\n                    return this.parsePrefix();\n                case '-':\n                    this.advance();\n                    result = this.parsePrefix();\n                    return new Binary(this.span(start), operator, new LiteralPrimitive(new ParseSpan(start, start), 0), result);\n                case '!':\n                    this.advance();\n                    result = this.parsePrefix();\n                    return new PrefixNot(this.span(start), result);\n            }\n        }\n        return this.parseCallChain();\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseCallChain = function () {\n        var /** @type {?} */ result = this.parsePrimary();\n        while (true) {\n            if (this.optionalCharacter($PERIOD)) {\n                result = this.parseAccessMemberOrMethodCall(result, false);\n            }\n            else if (this.optionalOperator('?.')) {\n                result = this.parseAccessMemberOrMethodCall(result, true);\n            }\n            else if (this.optionalCharacter($LBRACKET)) {\n                this.rbracketsExpected++;\n                var /** @type {?} */ key = this.parsePipe();\n                this.rbracketsExpected--;\n                this.expectCharacter($RBRACKET);\n                if (this.optionalOperator('=')) {\n                    var /** @type {?} */ value = this.parseConditional();\n                    result = new KeyedWrite(this.span(result.span.start), result, key, value);\n                }\n                else {\n                    result = new KeyedRead(this.span(result.span.start), result, key);\n                }\n            }\n            else if (this.optionalCharacter($LPAREN)) {\n                this.rparensExpected++;\n                var /** @type {?} */ args = this.parseCallArguments();\n                this.rparensExpected--;\n                this.expectCharacter($RPAREN);\n                result = new FunctionCall(this.span(result.span.start), result, args);\n            }\n            else if (this.optionalOperator('!')) {\n                result = new NonNullAssert(this.span(result.span.start), result);\n            }\n            else {\n                return result;\n            }\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parsePrimary = function () {\n        var /** @type {?} */ start = this.inputIndex;\n        if (this.optionalCharacter($LPAREN)) {\n            this.rparensExpected++;\n            var /** @type {?} */ result = this.parsePipe();\n            this.rparensExpected--;\n            this.expectCharacter($RPAREN);\n            return result;\n        }\n        else if (this.next.isKeywordNull()) {\n            this.advance();\n            return new LiteralPrimitive(this.span(start), null);\n        }\n        else if (this.next.isKeywordUndefined()) {\n            this.advance();\n            return new LiteralPrimitive(this.span(start), void 0);\n        }\n        else if (this.next.isKeywordTrue()) {\n            this.advance();\n            return new LiteralPrimitive(this.span(start), true);\n        }\n        else if (this.next.isKeywordFalse()) {\n            this.advance();\n            return new LiteralPrimitive(this.span(start), false);\n        }\n        else if (this.next.isKeywordThis()) {\n            this.advance();\n            return new ImplicitReceiver(this.span(start));\n        }\n        else if (this.optionalCharacter($LBRACKET)) {\n            this.rbracketsExpected++;\n            var /** @type {?} */ elements = this.parseExpressionList($RBRACKET);\n            this.rbracketsExpected--;\n            this.expectCharacter($RBRACKET);\n            return new LiteralArray(this.span(start), elements);\n        }\n        else if (this.next.isCharacter($LBRACE)) {\n            return this.parseLiteralMap();\n        }\n        else if (this.next.isIdentifier()) {\n            return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start)), false);\n        }\n        else if (this.next.isNumber()) {\n            var /** @type {?} */ value = this.next.toNumber();\n            this.advance();\n            return new LiteralPrimitive(this.span(start), value);\n        }\n        else if (this.next.isString()) {\n            var /** @type {?} */ literalValue = this.next.toString();\n            this.advance();\n            return new LiteralPrimitive(this.span(start), literalValue);\n        }\n        else if (this.index >= this.tokens.length) {\n            this.error(\"Unexpected end of expression: \" + this.input);\n            return new EmptyExpr(this.span(start));\n        }\n        else {\n            this.error(\"Unexpected token \" + this.next);\n            return new EmptyExpr(this.span(start));\n        }\n    };\n    /**\n     * @param {?} terminator\n     * @return {?}\n     */\n    _ParseAST.prototype.parseExpressionList = function (terminator) {\n        var /** @type {?} */ result = [];\n        if (!this.next.isCharacter(terminator)) {\n            do {\n                result.push(this.parsePipe());\n            } while (this.optionalCharacter($COMMA));\n        }\n        return result;\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseLiteralMap = function () {\n        var /** @type {?} */ keys = [];\n        var /** @type {?} */ values = [];\n        var /** @type {?} */ start = this.inputIndex;\n        this.expectCharacter($LBRACE);\n        if (!this.optionalCharacter($RBRACE)) {\n            this.rbracesExpected++;\n            do {\n                var /** @type {?} */ key = ((this.expectIdentifierOrKeywordOrString()));\n                keys.push(key);\n                this.expectCharacter($COLON);\n                values.push(this.parsePipe());\n            } while (this.optionalCharacter($COMMA));\n            this.rbracesExpected--;\n            this.expectCharacter($RBRACE);\n        }\n        return new LiteralMap(this.span(start), keys, values);\n    };\n    /**\n     * @param {?} receiver\n     * @param {?=} isSafe\n     * @return {?}\n     */\n    _ParseAST.prototype.parseAccessMemberOrMethodCall = function (receiver, isSafe) {\n        if (isSafe === void 0) { isSafe = false; }\n        var /** @type {?} */ start = receiver.span.start;\n        var /** @type {?} */ id = ((this.expectIdentifierOrKeyword()));\n        if (this.optionalCharacter($LPAREN)) {\n            this.rparensExpected++;\n            var /** @type {?} */ args = this.parseCallArguments();\n            this.expectCharacter($RPAREN);\n            this.rparensExpected--;\n            var /** @type {?} */ span = this.span(start);\n            return isSafe ? new SafeMethodCall(span, receiver, id, args) :\n                new MethodCall(span, receiver, id, args);\n        }\n        else {\n            if (isSafe) {\n                if (this.optionalOperator('=')) {\n                    this.error('The \\'?.\\' operator cannot be used in the assignment');\n                    return new EmptyExpr(this.span(start));\n                }\n                else {\n                    return new SafePropertyRead(this.span(start), receiver, id);\n                }\n            }\n            else {\n                if (this.optionalOperator('=')) {\n                    if (!this.parseAction) {\n                        this.error('Bindings cannot contain assignments');\n                        return new EmptyExpr(this.span(start));\n                    }\n                    var /** @type {?} */ value = this.parseConditional();\n                    return new PropertyWrite(this.span(start), receiver, id, value);\n                }\n                else {\n                    return new PropertyRead(this.span(start), receiver, id);\n                }\n            }\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseCallArguments = function () {\n        if (this.next.isCharacter($RPAREN))\n            return [];\n        var /** @type {?} */ positionals = [];\n        do {\n            positionals.push(this.parsePipe());\n        } while (this.optionalCharacter($COMMA));\n        return (positionals);\n    };\n    /**\n     * An identifier, a keyword, a string with an optional `-` inbetween.\n     * @return {?}\n     */\n    _ParseAST.prototype.expectTemplateBindingKey = function () {\n        var /** @type {?} */ result = '';\n        var /** @type {?} */ operatorFound = false;\n        do {\n            result += this.expectIdentifierOrKeywordOrString();\n            operatorFound = this.optionalOperator('-');\n            if (operatorFound) {\n                result += '-';\n            }\n        } while (operatorFound);\n        return result.toString();\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.parseTemplateBindings = function () {\n        var /** @type {?} */ bindings = [];\n        var /** @type {?} */ prefix = ((null));\n        var /** @type {?} */ warnings = [];\n        while (this.index < this.tokens.length) {\n            var /** @type {?} */ start = this.inputIndex;\n            var /** @type {?} */ keyIsVar = this.peekKeywordLet();\n            if (keyIsVar) {\n                this.advance();\n            }\n            var /** @type {?} */ rawKey = this.expectTemplateBindingKey();\n            var /** @type {?} */ key = rawKey;\n            if (!keyIsVar) {\n                if (prefix == null) {\n                    prefix = key;\n                }\n                else {\n                    key = prefix + key[0].toUpperCase() + key.substring(1);\n                }\n            }\n            this.optionalCharacter($COLON);\n            var /** @type {?} */ name = ((null));\n            var /** @type {?} */ expression = ((null));\n            if (keyIsVar) {\n                if (this.optionalOperator('=')) {\n                    name = this.expectTemplateBindingKey();\n                }\n                else {\n                    name = '\\$implicit';\n                }\n            }\n            else if (this.peekKeywordAs()) {\n                var /** @type {?} */ letStart = this.inputIndex;\n                this.advance(); // consume `as`\n                name = rawKey;\n                key = this.expectTemplateBindingKey(); // read local var name\n                keyIsVar = true;\n            }\n            else if (this.next !== EOF && !this.peekKeywordLet()) {\n                var /** @type {?} */ start_2 = this.inputIndex;\n                var /** @type {?} */ ast = this.parsePipe();\n                var /** @type {?} */ source = this.input.substring(start_2 - this.offset, this.inputIndex - this.offset);\n                expression = new ASTWithSource(ast, source, this.location, this.errors);\n            }\n            bindings.push(new TemplateBinding(this.span(start), key, keyIsVar, name, expression));\n            if (this.peekKeywordAs() && !keyIsVar) {\n                var /** @type {?} */ letStart = this.inputIndex;\n                this.advance(); // consume `as`\n                var /** @type {?} */ letName = this.expectTemplateBindingKey(); // read local var name\n                bindings.push(new TemplateBinding(this.span(letStart), letName, true, key, /** @type {?} */ ((null))));\n            }\n            if (!this.optionalCharacter($SEMICOLON)) {\n                this.optionalCharacter($COMMA);\n            }\n        }\n        return new TemplateBindingParseResult(bindings, warnings, this.errors);\n    };\n    /**\n     * @param {?} message\n     * @param {?=} index\n     * @return {?}\n     */\n    _ParseAST.prototype.error = function (message, index) {\n        if (index === void 0) { index = null; }\n        this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));\n        this.skip();\n    };\n    /**\n     * @param {?=} index\n     * @return {?}\n     */\n    _ParseAST.prototype.locationText = function (index) {\n        if (index === void 0) { index = null; }\n        if (index == null)\n            index = this.index;\n        return (index < this.tokens.length) ? \"at column \" + (this.tokens[index].index + 1) + \" in\" :\n            \"at the end of the expression\";\n    };\n    /**\n     * @return {?}\n     */\n    _ParseAST.prototype.skip = function () {\n        var /** @type {?} */ n = this.next;\n        while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) &&\n            (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&\n            (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&\n            (this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET))) {\n            if (this.next.isError()) {\n                this.errors.push(new ParserError(/** @type {?} */ ((this.next.toString())), this.input, this.locationText(), this.location));\n            }\n            this.advance();\n            n = this.next;\n        }\n    };\n    return _ParseAST;\n}());\nvar SimpleExpressionChecker = (function () {\n    function SimpleExpressionChecker() {\n        this.errors = [];\n    }\n    /**\n     * @param {?} ast\n     * @return {?}\n     */\n    SimpleExpressionChecker.check = function (ast) {\n        var /** @type {?} */ s = new SimpleExpressionChecker();\n        ast.visit(s);\n        return s.errors;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitImplicitReceiver = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitInterpolation = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitLiteralPrimitive = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitPropertyRead = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitPropertyWrite = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitSafePropertyRead = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitMethodCall = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitSafeMethodCall = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitFunctionCall = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitLiteralArray = function (ast, context) { this.visitAll(ast.expressions); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitLiteralMap = function (ast, context) { this.visitAll(ast.values); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitBinary = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitPrefixNot = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitNonNullAssert = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitConditional = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitPipe = function (ast, context) { this.errors.push('pipes'); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitKeyedRead = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitKeyedWrite = function (ast, context) { };\n    /**\n     * @param {?} asts\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitAll = function (asts) {\n        var _this = this;\n        return asts.map(function (node) { return node.visit(_this); });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitChain = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    SimpleExpressionChecker.prototype.visitQuote = function (ast, context) { };\n    return SimpleExpressionChecker;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ParseLocation = (function () {\n    /**\n     * @param {?} file\n     * @param {?} offset\n     * @param {?} line\n     * @param {?} col\n     */\n    function ParseLocation(file, offset, line, col) {\n        this.file = file;\n        this.offset = offset;\n        this.line = line;\n        this.col = col;\n    }\n    /**\n     * @return {?}\n     */\n    ParseLocation.prototype.toString = function () {\n        return this.offset != null ? this.file.url + \"@\" + this.line + \":\" + this.col : this.file.url;\n    };\n    /**\n     * @param {?} delta\n     * @return {?}\n     */\n    ParseLocation.prototype.moveBy = function (delta) {\n        var /** @type {?} */ source = this.file.content;\n        var /** @type {?} */ len = source.length;\n        var /** @type {?} */ offset = this.offset;\n        var /** @type {?} */ line = this.line;\n        var /** @type {?} */ col = this.col;\n        while (offset > 0 && delta < 0) {\n            offset--;\n            delta++;\n            var /** @type {?} */ ch = source.charCodeAt(offset);\n            if (ch == $LF) {\n                line--;\n                var /** @type {?} */ priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));\n                col = priorLine > 0 ? offset - priorLine : offset;\n            }\n            else {\n                col--;\n            }\n        }\n        while (offset < len && delta > 0) {\n            var /** @type {?} */ ch = source.charCodeAt(offset);\n            offset++;\n            delta--;\n            if (ch == $LF) {\n                line++;\n                col = 0;\n            }\n            else {\n                col++;\n            }\n        }\n        return new ParseLocation(this.file, offset, line, col);\n    };\n    /**\n     * @param {?} maxChars\n     * @param {?} maxLines\n     * @return {?}\n     */\n    ParseLocation.prototype.getContext = function (maxChars, maxLines) {\n        var /** @type {?} */ content = this.file.content;\n        var /** @type {?} */ startOffset = this.offset;\n        if (startOffset != null) {\n            if (startOffset > content.length - 1) {\n                startOffset = content.length - 1;\n            }\n            var /** @type {?} */ endOffset = startOffset;\n            var /** @type {?} */ ctxChars = 0;\n            var /** @type {?} */ ctxLines = 0;\n            while (ctxChars < maxChars && startOffset > 0) {\n                startOffset--;\n                ctxChars++;\n                if (content[startOffset] == '\\n') {\n                    if (++ctxLines == maxLines) {\n                        break;\n                    }\n                }\n            }\n            ctxChars = 0;\n            ctxLines = 0;\n            while (ctxChars < maxChars && endOffset < content.length - 1) {\n                endOffset++;\n                ctxChars++;\n                if (content[endOffset] == '\\n') {\n                    if (++ctxLines == maxLines) {\n                        break;\n                    }\n                }\n            }\n            return {\n                before: content.substring(startOffset, this.offset),\n                after: content.substring(this.offset, endOffset + 1),\n            };\n        }\n        return null;\n    };\n    return ParseLocation;\n}());\nvar ParseSourceFile = (function () {\n    /**\n     * @param {?} content\n     * @param {?} url\n     */\n    function ParseSourceFile(content, url) {\n        this.content = content;\n        this.url = url;\n    }\n    return ParseSourceFile;\n}());\nvar ParseSourceSpan = (function () {\n    /**\n     * @param {?} start\n     * @param {?} end\n     * @param {?=} details\n     */\n    function ParseSourceSpan(start, end, details) {\n        if (details === void 0) { details = null; }\n        this.start = start;\n        this.end = end;\n        this.details = details;\n    }\n    /**\n     * @return {?}\n     */\n    ParseSourceSpan.prototype.toString = function () {\n        return this.start.file.content.substring(this.start.offset, this.end.offset);\n    };\n    return ParseSourceSpan;\n}());\nvar ParseErrorLevel = {};\nParseErrorLevel.WARNING = 0;\nParseErrorLevel.ERROR = 1;\nParseErrorLevel[ParseErrorLevel.WARNING] = \"WARNING\";\nParseErrorLevel[ParseErrorLevel.ERROR] = \"ERROR\";\nvar ParseError = (function () {\n    /**\n     * @param {?} span\n     * @param {?} msg\n     * @param {?=} level\n     */\n    function ParseError(span, msg, level) {\n        if (level === void 0) { level = ParseErrorLevel.ERROR; }\n        this.span = span;\n        this.msg = msg;\n        this.level = level;\n    }\n    /**\n     * @return {?}\n     */\n    ParseError.prototype.toString = function () {\n        var /** @type {?} */ ctx = this.span.start.getContext(100, 3);\n        var /** @type {?} */ contextStr = ctx ? \" (\\\"\" + ctx.before + \"[\" + ParseErrorLevel[this.level] + \" ->]\" + ctx.after + \"\\\")\" : '';\n        var /** @type {?} */ details = this.span.details ? \", \" + this.span.details : '';\n        return \"\" + this.msg + contextStr + \": \" + this.span.start + details;\n    };\n    return ParseError;\n}());\n/**\n * @param {?} kind\n * @param {?} type\n * @return {?}\n */\nfunction typeSourceSpan(kind, type) {\n    var /** @type {?} */ moduleUrl = identifierModuleUrl(type);\n    var /** @type {?} */ sourceFileName = moduleUrl != null ? \"in \" + kind + \" \" + identifierName(type) + \" in \" + moduleUrl :\n        \"in \" + kind + \" \" + identifierName(type);\n    var /** @type {?} */ sourceFile = new ParseSourceFile('', sourceFileName);\n    return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));\n}\n/**\n * A path is an ordered set of elements. Typically a path is to  a\n * particular offset in a source file. The head of the list is the top\n * most node. The tail is the node that contains the offset directly.\n *\n * For example, the expresion `a + b + c` might have an ast that looks\n * like:\n *     +\n *    / \\\n *   a   +\n *      / \\\n *     b   c\n *\n * The path to the node at offset 9 would be `['+' at 1-10, '+' at 7-10,\n * 'c' at 9-10]` and the path the node at offset 1 would be\n * `['+' at 1-10, 'a' at 1-2]`.\n */\nvar AstPath = (function () {\n    /**\n     * @param {?} path\n     * @param {?=} position\n     */\n    function AstPath(path, position) {\n        if (position === void 0) { position = -1; }\n        this.path = path;\n        this.position = position;\n    }\n    Object.defineProperty(AstPath.prototype, \"empty\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return !this.path || !this.path.length; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(AstPath.prototype, \"head\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.path[0]; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(AstPath.prototype, \"tail\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.path[this.path.length - 1]; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    AstPath.prototype.parentOf = function (node) {\n        return node && this.path[this.path.indexOf(node) - 1];\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    AstPath.prototype.childOf = function (node) { return this.path[this.path.indexOf(node) + 1]; };\n    /**\n     * @template N\n     * @param {?} ctor\n     * @return {?}\n     */\n    AstPath.prototype.first = function (ctor) {\n        for (var /** @type {?} */ i = this.path.length - 1; i >= 0; i--) {\n            var /** @type {?} */ item = this.path[i];\n            if (item instanceof ctor)\n                return (item);\n        }\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    AstPath.prototype.push = function (node) { this.path.push(node); };\n    /**\n     * @return {?}\n     */\n    AstPath.prototype.pop = function () { return ((this.path.pop())); };\n    return AstPath;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar Text = (function () {\n    /**\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function Text(value, sourceSpan) {\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Text.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };\n    return Text;\n}());\nvar Expansion = (function () {\n    /**\n     * @param {?} switchValue\n     * @param {?} type\n     * @param {?} cases\n     * @param {?} sourceSpan\n     * @param {?} switchValueSourceSpan\n     */\n    function Expansion(switchValue, type, cases, sourceSpan, switchValueSourceSpan) {\n        this.switchValue = switchValue;\n        this.type = type;\n        this.cases = cases;\n        this.sourceSpan = sourceSpan;\n        this.switchValueSourceSpan = switchValueSourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Expansion.prototype.visit = function (visitor, context) { return visitor.visitExpansion(this, context); };\n    return Expansion;\n}());\nvar ExpansionCase = (function () {\n    /**\n     * @param {?} value\n     * @param {?} expression\n     * @param {?} sourceSpan\n     * @param {?} valueSourceSpan\n     * @param {?} expSourceSpan\n     */\n    function ExpansionCase(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {\n        this.value = value;\n        this.expression = expression;\n        this.sourceSpan = sourceSpan;\n        this.valueSourceSpan = valueSourceSpan;\n        this.expSourceSpan = expSourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ExpansionCase.prototype.visit = function (visitor, context) { return visitor.visitExpansionCase(this, context); };\n    return ExpansionCase;\n}());\nvar Attribute$1 = (function () {\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @param {?=} valueSpan\n     */\n    function Attribute$1(name, value, sourceSpan, valueSpan) {\n        this.name = name;\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n        this.valueSpan = valueSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Attribute$1.prototype.visit = function (visitor, context) { return visitor.visitAttribute(this, context); };\n    return Attribute$1;\n}());\nvar Element = (function () {\n    /**\n     * @param {?} name\n     * @param {?} attrs\n     * @param {?} children\n     * @param {?} sourceSpan\n     * @param {?=} startSourceSpan\n     * @param {?=} endSourceSpan\n     */\n    function Element(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan) {\n        if (startSourceSpan === void 0) { startSourceSpan = null; }\n        if (endSourceSpan === void 0) { endSourceSpan = null; }\n        this.name = name;\n        this.attrs = attrs;\n        this.children = children;\n        this.sourceSpan = sourceSpan;\n        this.startSourceSpan = startSourceSpan;\n        this.endSourceSpan = endSourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Element.prototype.visit = function (visitor, context) { return visitor.visitElement(this, context); };\n    return Element;\n}());\nvar Comment = (function () {\n    /**\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function Comment(value, sourceSpan) {\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Comment.prototype.visit = function (visitor, context) { return visitor.visitComment(this, context); };\n    return Comment;\n}());\n/**\n * @param {?} visitor\n * @param {?} nodes\n * @param {?=} context\n * @return {?}\n */\nfunction visitAll(visitor, nodes, context) {\n    if (context === void 0) { context = null; }\n    var /** @type {?} */ result = [];\n    var /** @type {?} */ visit = visitor.visit ?\n        function (ast) { return ((visitor.visit))(ast, context) || ast.visit(visitor, context); } :\n        function (ast) { return ast.visit(visitor, context); };\n    nodes.forEach(function (ast) {\n        var /** @type {?} */ astResult = visit(ast);\n        if (astResult) {\n            result.push(astResult);\n        }\n    });\n    return result;\n}\nvar RecursiveVisitor = (function () {\n    function RecursiveVisitor() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitElement = function (ast, context) {\n        this.visitChildren(context, function (visit) {\n            visit(ast.attrs);\n            visit(ast.children);\n        });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitAttribute = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitText = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitComment = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitExpansion = function (ast, context) {\n        return this.visitChildren(context, function (visit) { visit(ast.cases); });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitExpansionCase = function (ast, context) { };\n    /**\n     * @template T\n     * @param {?} context\n     * @param {?} cb\n     * @return {?}\n     */\n    RecursiveVisitor.prototype.visitChildren = function (context, cb) {\n        var /** @type {?} */ results = [];\n        var /** @type {?} */ t = this;\n        /**\n         * @template T\n         * @param {?} children\n         * @return {?}\n         */\n        function visit(children) {\n            if (children)\n                results.push(visitAll(t, children, context));\n        }\n        cb(visit);\n        return [].concat.apply([], results);\n    };\n    return RecursiveVisitor;\n}());\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction spanOf(ast) {\n    var /** @type {?} */ start = ast.sourceSpan.start.offset;\n    var /** @type {?} */ end = ast.sourceSpan.end.offset;\n    if (ast instanceof Element) {\n        if (ast.endSourceSpan) {\n            end = ast.endSourceSpan.end.offset;\n        }\n        else if (ast.children && ast.children.length) {\n            end = spanOf(ast.children[ast.children.length - 1]).end;\n        }\n    }\n    return { start: start, end: end };\n}\n/**\n * @param {?} nodes\n * @param {?} position\n * @return {?}\n */\nfunction findNode(nodes, position) {\n    var /** @type {?} */ path = [];\n    var /** @type {?} */ visitor = new (function (_super) {\n        __extends(class_1, _super);\n        function class_1() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        /**\n         * @param {?} ast\n         * @param {?} context\n         * @return {?}\n         */\n        class_1.prototype.visit = function (ast, context) {\n            var /** @type {?} */ span = spanOf(ast);\n            if (span.start <= position && position < span.end) {\n                path.push(ast);\n            }\n            else {\n                // Returning a value here will result in the children being skipped.\n                return true;\n            }\n        };\n        return class_1;\n    }(RecursiveVisitor));\n    visitAll(visitor, nodes);\n    return new AstPath(path, position);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar TokenType$1 = {};\nTokenType$1.TAG_OPEN_START = 0;\nTokenType$1.TAG_OPEN_END = 1;\nTokenType$1.TAG_OPEN_END_VOID = 2;\nTokenType$1.TAG_CLOSE = 3;\nTokenType$1.TEXT = 4;\nTokenType$1.ESCAPABLE_RAW_TEXT = 5;\nTokenType$1.RAW_TEXT = 6;\nTokenType$1.COMMENT_START = 7;\nTokenType$1.COMMENT_END = 8;\nTokenType$1.CDATA_START = 9;\nTokenType$1.CDATA_END = 10;\nTokenType$1.ATTR_NAME = 11;\nTokenType$1.ATTR_VALUE = 12;\nTokenType$1.DOC_TYPE = 13;\nTokenType$1.EXPANSION_FORM_START = 14;\nTokenType$1.EXPANSION_CASE_VALUE = 15;\nTokenType$1.EXPANSION_CASE_EXP_START = 16;\nTokenType$1.EXPANSION_CASE_EXP_END = 17;\nTokenType$1.EXPANSION_FORM_END = 18;\nTokenType$1.EOF = 19;\nTokenType$1[TokenType$1.TAG_OPEN_START] = \"TAG_OPEN_START\";\nTokenType$1[TokenType$1.TAG_OPEN_END] = \"TAG_OPEN_END\";\nTokenType$1[TokenType$1.TAG_OPEN_END_VOID] = \"TAG_OPEN_END_VOID\";\nTokenType$1[TokenType$1.TAG_CLOSE] = \"TAG_CLOSE\";\nTokenType$1[TokenType$1.TEXT] = \"TEXT\";\nTokenType$1[TokenType$1.ESCAPABLE_RAW_TEXT] = \"ESCAPABLE_RAW_TEXT\";\nTokenType$1[TokenType$1.RAW_TEXT] = \"RAW_TEXT\";\nTokenType$1[TokenType$1.COMMENT_START] = \"COMMENT_START\";\nTokenType$1[TokenType$1.COMMENT_END] = \"COMMENT_END\";\nTokenType$1[TokenType$1.CDATA_START] = \"CDATA_START\";\nTokenType$1[TokenType$1.CDATA_END] = \"CDATA_END\";\nTokenType$1[TokenType$1.ATTR_NAME] = \"ATTR_NAME\";\nTokenType$1[TokenType$1.ATTR_VALUE] = \"ATTR_VALUE\";\nTokenType$1[TokenType$1.DOC_TYPE] = \"DOC_TYPE\";\nTokenType$1[TokenType$1.EXPANSION_FORM_START] = \"EXPANSION_FORM_START\";\nTokenType$1[TokenType$1.EXPANSION_CASE_VALUE] = \"EXPANSION_CASE_VALUE\";\nTokenType$1[TokenType$1.EXPANSION_CASE_EXP_START] = \"EXPANSION_CASE_EXP_START\";\nTokenType$1[TokenType$1.EXPANSION_CASE_EXP_END] = \"EXPANSION_CASE_EXP_END\";\nTokenType$1[TokenType$1.EXPANSION_FORM_END] = \"EXPANSION_FORM_END\";\nTokenType$1[TokenType$1.EOF] = \"EOF\";\nvar Token$1 = (function () {\n    /**\n     * @param {?} type\n     * @param {?} parts\n     * @param {?} sourceSpan\n     */\n    function Token$1(type, parts, sourceSpan) {\n        this.type = type;\n        this.parts = parts;\n        this.sourceSpan = sourceSpan;\n    }\n    return Token$1;\n}());\nvar TokenError = (function (_super) {\n    __extends(TokenError, _super);\n    /**\n     * @param {?} errorMsg\n     * @param {?} tokenType\n     * @param {?} span\n     */\n    function TokenError(errorMsg, tokenType, span) {\n        var _this = _super.call(this, span, errorMsg) || this;\n        _this.tokenType = tokenType;\n        return _this;\n    }\n    return TokenError;\n}(ParseError));\nvar TokenizeResult = (function () {\n    /**\n     * @param {?} tokens\n     * @param {?} errors\n     */\n    function TokenizeResult(tokens, errors) {\n        this.tokens = tokens;\n        this.errors = errors;\n    }\n    return TokenizeResult;\n}());\n/**\n * @param {?} source\n * @param {?} url\n * @param {?} getTagDefinition\n * @param {?=} tokenizeExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\nfunction tokenize(source, url, getTagDefinition, tokenizeExpansionForms, interpolationConfig) {\n    if (tokenizeExpansionForms === void 0) { tokenizeExpansionForms = false; }\n    if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n    return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, tokenizeExpansionForms, interpolationConfig)\n        .tokenize();\n}\nvar _CR_OR_CRLF_REGEXP = /\\r\\n?/g;\n/**\n * @param {?} charCode\n * @return {?}\n */\nfunction _unexpectedCharacterErrorMsg(charCode) {\n    var /** @type {?} */ char = charCode === $EOF ? 'EOF' : String.fromCharCode(charCode);\n    return \"Unexpected character \\\"\" + char + \"\\\"\";\n}\n/**\n * @param {?} entitySrc\n * @return {?}\n */\nfunction _unknownEntityErrorMsg(entitySrc) {\n    return \"Unknown entity \\\"\" + entitySrc + \"\\\" - use the \\\"&#<decimal>;\\\" or  \\\"&#x<hex>;\\\" syntax\";\n}\nvar _ControlFlowError = (function () {\n    /**\n     * @param {?} error\n     */\n    function _ControlFlowError(error) {\n        this.error = error;\n    }\n    return _ControlFlowError;\n}());\nvar _Tokenizer = (function () {\n    /**\n     * @param {?} _file The html source\n     * @param {?} _getTagDefinition\n     * @param {?} _tokenizeIcu Whether to tokenize ICU messages (considered as text nodes when false)\n     * @param {?=} _interpolationConfig\n     */\n    function _Tokenizer(_file, _getTagDefinition, _tokenizeIcu, _interpolationConfig) {\n        if (_interpolationConfig === void 0) { _interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        this._file = _file;\n        this._getTagDefinition = _getTagDefinition;\n        this._tokenizeIcu = _tokenizeIcu;\n        this._interpolationConfig = _interpolationConfig;\n        this._peek = -1;\n        this._nextPeek = -1;\n        this._index = -1;\n        this._line = 0;\n        this._column = -1;\n        this._expansionCaseStack = [];\n        this._inInterpolation = false;\n        this.tokens = [];\n        this.errors = [];\n        this._input = _file.content;\n        this._length = _file.content.length;\n        this._advance();\n    }\n    /**\n     * @param {?} content\n     * @return {?}\n     */\n    _Tokenizer.prototype._processCarriageReturns = function (content) {\n        // http://www.w3.org/TR/html5/syntax.html#preprocessing-the-input-stream\n        // In order to keep the original position in the source, we can not\n        // pre-process it.\n        // Instead CRs are processed right before instantiating the tokens.\n        return content.replace(_CR_OR_CRLF_REGEXP, '\\n');\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype.tokenize = function () {\n        while (this._peek !== $EOF) {\n            var /** @type {?} */ start = this._getLocation();\n            try {\n                if (this._attemptCharCode($LT)) {\n                    if (this._attemptCharCode($BANG)) {\n                        if (this._attemptCharCode($LBRACKET)) {\n                            this._consumeCdata(start);\n                        }\n                        else if (this._attemptCharCode($MINUS)) {\n                            this._consumeComment(start);\n                        }\n                        else {\n                            this._consumeDocType(start);\n                        }\n                    }\n                    else if (this._attemptCharCode($SLASH)) {\n                        this._consumeTagClose(start);\n                    }\n                    else {\n                        this._consumeTagOpen(start);\n                    }\n                }\n                else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {\n                    this._consumeText();\n                }\n            }\n            catch (e) {\n                if (e instanceof _ControlFlowError) {\n                    this.errors.push(e.error);\n                }\n                else {\n                    throw e;\n                }\n            }\n        }\n        this._beginToken(TokenType$1.EOF);\n        this._endToken([]);\n        return new TokenizeResult(mergeTextTokens(this.tokens), this.errors);\n    };\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    _Tokenizer.prototype._tokenizeExpansionForm = function () {\n        if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {\n            this._consumeExpansionFormStart();\n            return true;\n        }\n        if (isExpansionCaseStart(this._peek) && this._isInExpansionForm()) {\n            this._consumeExpansionCaseStart();\n            return true;\n        }\n        if (this._peek === $RBRACE) {\n            if (this._isInExpansionCase()) {\n                this._consumeExpansionCaseEnd();\n                return true;\n            }\n            if (this._isInExpansionForm()) {\n                this._consumeExpansionFormEnd();\n                return true;\n            }\n        }\n        return false;\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._getLocation = function () {\n        return new ParseLocation(this._file, this._index, this._line, this._column);\n    };\n    /**\n     * @param {?=} start\n     * @param {?=} end\n     * @return {?}\n     */\n    _Tokenizer.prototype._getSpan = function (start, end) {\n        if (start === void 0) { start = this._getLocation(); }\n        if (end === void 0) { end = this._getLocation(); }\n        return new ParseSourceSpan(start, end);\n    };\n    /**\n     * @param {?} type\n     * @param {?=} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._beginToken = function (type, start) {\n        if (start === void 0) { start = this._getLocation(); }\n        this._currentTokenStart = start;\n        this._currentTokenType = type;\n    };\n    /**\n     * @param {?} parts\n     * @param {?=} end\n     * @return {?}\n     */\n    _Tokenizer.prototype._endToken = function (parts, end) {\n        if (end === void 0) { end = this._getLocation(); }\n        var /** @type {?} */ token = new Token$1(this._currentTokenType, parts, new ParseSourceSpan(this._currentTokenStart, end));\n        this.tokens.push(token);\n        this._currentTokenStart = ((null));\n        this._currentTokenType = ((null));\n        return token;\n    };\n    /**\n     * @param {?} msg\n     * @param {?} span\n     * @return {?}\n     */\n    _Tokenizer.prototype._createError = function (msg, span) {\n        if (this._isInExpansionForm()) {\n            msg += \" (Do you have an unescaped \\\"{\\\" in your template? Use \\\"{{ '{' }}\\\") to escape it.)\";\n        }\n        var /** @type {?} */ error = new TokenError(msg, this._currentTokenType, span);\n        this._currentTokenStart = ((null));\n        this._currentTokenType = ((null));\n        return new _ControlFlowError(error);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._advance = function () {\n        if (this._index >= this._length) {\n            throw this._createError(_unexpectedCharacterErrorMsg($EOF), this._getSpan());\n        }\n        if (this._peek === $LF) {\n            this._line++;\n            this._column = 0;\n        }\n        else if (this._peek !== $LF && this._peek !== $CR) {\n            this._column++;\n        }\n        this._index++;\n        this._peek = this._index >= this._length ? $EOF : this._input.charCodeAt(this._index);\n        this._nextPeek =\n            this._index + 1 >= this._length ? $EOF : this._input.charCodeAt(this._index + 1);\n    };\n    /**\n     * @param {?} charCode\n     * @return {?}\n     */\n    _Tokenizer.prototype._attemptCharCode = function (charCode) {\n        if (this._peek === charCode) {\n            this._advance();\n            return true;\n        }\n        return false;\n    };\n    /**\n     * @param {?} charCode\n     * @return {?}\n     */\n    _Tokenizer.prototype._attemptCharCodeCaseInsensitive = function (charCode) {\n        if (compareCharCodeCaseInsensitive(this._peek, charCode)) {\n            this._advance();\n            return true;\n        }\n        return false;\n    };\n    /**\n     * @param {?} charCode\n     * @return {?}\n     */\n    _Tokenizer.prototype._requireCharCode = function (charCode) {\n        var /** @type {?} */ location = this._getLocation();\n        if (!this._attemptCharCode(charCode)) {\n            throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location, location));\n        }\n    };\n    /**\n     * @param {?} chars\n     * @return {?}\n     */\n    _Tokenizer.prototype._attemptStr = function (chars) {\n        var /** @type {?} */ len = chars.length;\n        if (this._index + len > this._length) {\n            return false;\n        }\n        var /** @type {?} */ initialPosition = this._savePosition();\n        for (var /** @type {?} */ i = 0; i < len; i++) {\n            if (!this._attemptCharCode(chars.charCodeAt(i))) {\n                // If attempting to parse the string fails, we want to reset the parser\n                // to where it was before the attempt\n                this._restorePosition(initialPosition);\n                return false;\n            }\n        }\n        return true;\n    };\n    /**\n     * @param {?} chars\n     * @return {?}\n     */\n    _Tokenizer.prototype._attemptStrCaseInsensitive = function (chars) {\n        for (var /** @type {?} */ i = 0; i < chars.length; i++) {\n            if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {\n                return false;\n            }\n        }\n        return true;\n    };\n    /**\n     * @param {?} chars\n     * @return {?}\n     */\n    _Tokenizer.prototype._requireStr = function (chars) {\n        var /** @type {?} */ location = this._getLocation();\n        if (!this._attemptStr(chars)) {\n            throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location));\n        }\n    };\n    /**\n     * @param {?} predicate\n     * @return {?}\n     */\n    _Tokenizer.prototype._attemptCharCodeUntilFn = function (predicate) {\n        while (!predicate(this._peek)) {\n            this._advance();\n        }\n    };\n    /**\n     * @param {?} predicate\n     * @param {?} len\n     * @return {?}\n     */\n    _Tokenizer.prototype._requireCharCodeUntilFn = function (predicate, len) {\n        var /** @type {?} */ start = this._getLocation();\n        this._attemptCharCodeUntilFn(predicate);\n        if (this._index - start.offset < len) {\n            throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(start, start));\n        }\n    };\n    /**\n     * @param {?} char\n     * @return {?}\n     */\n    _Tokenizer.prototype._attemptUntilChar = function (char) {\n        while (this._peek !== char) {\n            this._advance();\n        }\n    };\n    /**\n     * @param {?} decodeEntities\n     * @return {?}\n     */\n    _Tokenizer.prototype._readChar = function (decodeEntities) {\n        if (decodeEntities && this._peek === $AMPERSAND) {\n            return this._decodeEntity();\n        }\n        else {\n            var /** @type {?} */ index = this._index;\n            this._advance();\n            return this._input[index];\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._decodeEntity = function () {\n        var /** @type {?} */ start = this._getLocation();\n        this._advance();\n        if (this._attemptCharCode($HASH)) {\n            var /** @type {?} */ isHex = this._attemptCharCode($x) || this._attemptCharCode($X);\n            var /** @type {?} */ numberStart = this._getLocation().offset;\n            this._attemptCharCodeUntilFn(isDigitEntityEnd);\n            if (this._peek != $SEMICOLON) {\n                throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());\n            }\n            this._advance();\n            var /** @type {?} */ strNum = this._input.substring(numberStart, this._index - 1);\n            try {\n                var /** @type {?} */ charCode = parseInt(strNum, isHex ? 16 : 10);\n                return String.fromCharCode(charCode);\n            }\n            catch (e) {\n                var /** @type {?} */ entity = this._input.substring(start.offset + 1, this._index - 1);\n                throw this._createError(_unknownEntityErrorMsg(entity), this._getSpan(start));\n            }\n        }\n        else {\n            var /** @type {?} */ startPosition = this._savePosition();\n            this._attemptCharCodeUntilFn(isNamedEntityEnd);\n            if (this._peek != $SEMICOLON) {\n                this._restorePosition(startPosition);\n                return '&';\n            }\n            this._advance();\n            var /** @type {?} */ name = this._input.substring(start.offset + 1, this._index - 1);\n            var /** @type {?} */ char = NAMED_ENTITIES[name];\n            if (!char) {\n                throw this._createError(_unknownEntityErrorMsg(name), this._getSpan(start));\n            }\n            return char;\n        }\n    };\n    /**\n     * @param {?} decodeEntities\n     * @param {?} firstCharOfEnd\n     * @param {?} attemptEndRest\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeRawText = function (decodeEntities, firstCharOfEnd, attemptEndRest) {\n        var /** @type {?} */ tagCloseStart;\n        var /** @type {?} */ textStart = this._getLocation();\n        this._beginToken(decodeEntities ? TokenType$1.ESCAPABLE_RAW_TEXT : TokenType$1.RAW_TEXT, textStart);\n        var /** @type {?} */ parts = [];\n        while (true) {\n            tagCloseStart = this._getLocation();\n            if (this._attemptCharCode(firstCharOfEnd) && attemptEndRest()) {\n                break;\n            }\n            if (this._index > tagCloseStart.offset) {\n                // add the characters consumed by the previous if statement to the output\n                parts.push(this._input.substring(tagCloseStart.offset, this._index));\n            }\n            while (this._peek !== firstCharOfEnd) {\n                parts.push(this._readChar(decodeEntities));\n            }\n        }\n        return this._endToken([this._processCarriageReturns(parts.join(''))], tagCloseStart);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeComment = function (start) {\n        var _this = this;\n        this._beginToken(TokenType$1.COMMENT_START, start);\n        this._requireCharCode($MINUS);\n        this._endToken([]);\n        var /** @type {?} */ textToken = this._consumeRawText(false, $MINUS, function () { return _this._attemptStr('->'); });\n        this._beginToken(TokenType$1.COMMENT_END, textToken.sourceSpan.end);\n        this._endToken([]);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeCdata = function (start) {\n        var _this = this;\n        this._beginToken(TokenType$1.CDATA_START, start);\n        this._requireStr('CDATA[');\n        this._endToken([]);\n        var /** @type {?} */ textToken = this._consumeRawText(false, $RBRACKET, function () { return _this._attemptStr(']>'); });\n        this._beginToken(TokenType$1.CDATA_END, textToken.sourceSpan.end);\n        this._endToken([]);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeDocType = function (start) {\n        this._beginToken(TokenType$1.DOC_TYPE, start);\n        this._attemptUntilChar($GT);\n        this._advance();\n        this._endToken([this._input.substring(start.offset + 2, this._index - 1)]);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumePrefixAndName = function () {\n        var /** @type {?} */ nameOrPrefixStart = this._index;\n        var /** @type {?} */ prefix = ((null));\n        while (this._peek !== $COLON && !isPrefixEnd(this._peek)) {\n            this._advance();\n        }\n        var /** @type {?} */ nameStart;\n        if (this._peek === $COLON) {\n            this._advance();\n            prefix = this._input.substring(nameOrPrefixStart, this._index - 1);\n            nameStart = this._index;\n        }\n        else {\n            nameStart = nameOrPrefixStart;\n        }\n        this._requireCharCodeUntilFn(isNameEnd, this._index === nameStart ? 1 : 0);\n        var /** @type {?} */ name = this._input.substring(nameStart, this._index);\n        return [prefix, name];\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeTagOpen = function (start) {\n        var /** @type {?} */ savedPos = this._savePosition();\n        var /** @type {?} */ tagName;\n        var /** @type {?} */ lowercaseTagName;\n        try {\n            if (!isAsciiLetter(this._peek)) {\n                throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());\n            }\n            var /** @type {?} */ nameStart = this._index;\n            this._consumeTagOpenStart(start);\n            tagName = this._input.substring(nameStart, this._index);\n            lowercaseTagName = tagName.toLowerCase();\n            this._attemptCharCodeUntilFn(isNotWhitespace);\n            while (this._peek !== $SLASH && this._peek !== $GT) {\n                this._consumeAttributeName();\n                this._attemptCharCodeUntilFn(isNotWhitespace);\n                if (this._attemptCharCode($EQ)) {\n                    this._attemptCharCodeUntilFn(isNotWhitespace);\n                    this._consumeAttributeValue();\n                }\n                this._attemptCharCodeUntilFn(isNotWhitespace);\n            }\n            this._consumeTagOpenEnd();\n        }\n        catch (e) {\n            if (e instanceof _ControlFlowError) {\n                // When the start tag is invalid, assume we want a \"<\"\n                this._restorePosition(savedPos);\n                // Back to back text tokens are merged at the end\n                this._beginToken(TokenType$1.TEXT, start);\n                this._endToken(['<']);\n                return;\n            }\n            throw e;\n        }\n        var /** @type {?} */ contentTokenType = this._getTagDefinition(tagName).contentType;\n        if (contentTokenType === TagContentType.RAW_TEXT) {\n            this._consumeRawTextWithTagClose(lowercaseTagName, false);\n        }\n        else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {\n            this._consumeRawTextWithTagClose(lowercaseTagName, true);\n        }\n    };\n    /**\n     * @param {?} lowercaseTagName\n     * @param {?} decodeEntities\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeRawTextWithTagClose = function (lowercaseTagName, decodeEntities) {\n        var _this = this;\n        var /** @type {?} */ textToken = this._consumeRawText(decodeEntities, $LT, function () {\n            if (!_this._attemptCharCode($SLASH))\n                return false;\n            _this._attemptCharCodeUntilFn(isNotWhitespace);\n            if (!_this._attemptStrCaseInsensitive(lowercaseTagName))\n                return false;\n            _this._attemptCharCodeUntilFn(isNotWhitespace);\n            return _this._attemptCharCode($GT);\n        });\n        this._beginToken(TokenType$1.TAG_CLOSE, textToken.sourceSpan.end);\n        this._endToken([/** @type {?} */ ((null)), lowercaseTagName]);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeTagOpenStart = function (start) {\n        this._beginToken(TokenType$1.TAG_OPEN_START, start);\n        var /** @type {?} */ parts = this._consumePrefixAndName();\n        this._endToken(parts);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeAttributeName = function () {\n        this._beginToken(TokenType$1.ATTR_NAME);\n        var /** @type {?} */ prefixAndName = this._consumePrefixAndName();\n        this._endToken(prefixAndName);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeAttributeValue = function () {\n        this._beginToken(TokenType$1.ATTR_VALUE);\n        var /** @type {?} */ value;\n        if (this._peek === $SQ || this._peek === $DQ) {\n            var /** @type {?} */ quoteChar = this._peek;\n            this._advance();\n            var /** @type {?} */ parts = [];\n            while (this._peek !== quoteChar) {\n                parts.push(this._readChar(true));\n            }\n            value = parts.join('');\n            this._advance();\n        }\n        else {\n            var /** @type {?} */ valueStart = this._index;\n            this._requireCharCodeUntilFn(isNameEnd, 1);\n            value = this._input.substring(valueStart, this._index);\n        }\n        this._endToken([this._processCarriageReturns(value)]);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeTagOpenEnd = function () {\n        var /** @type {?} */ tokenType = this._attemptCharCode($SLASH) ? TokenType$1.TAG_OPEN_END_VOID : TokenType$1.TAG_OPEN_END;\n        this._beginToken(tokenType);\n        this._requireCharCode($GT);\n        this._endToken([]);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeTagClose = function (start) {\n        this._beginToken(TokenType$1.TAG_CLOSE, start);\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n        var /** @type {?} */ prefixAndName = this._consumePrefixAndName();\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n        this._requireCharCode($GT);\n        this._endToken(prefixAndName);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeExpansionFormStart = function () {\n        this._beginToken(TokenType$1.EXPANSION_FORM_START, this._getLocation());\n        this._requireCharCode($LBRACE);\n        this._endToken([]);\n        this._expansionCaseStack.push(TokenType$1.EXPANSION_FORM_START);\n        this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());\n        var /** @type {?} */ condition = this._readUntil($COMMA);\n        this._endToken([condition], this._getLocation());\n        this._requireCharCode($COMMA);\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n        this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());\n        var /** @type {?} */ type = this._readUntil($COMMA);\n        this._endToken([type], this._getLocation());\n        this._requireCharCode($COMMA);\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeExpansionCaseStart = function () {\n        this._beginToken(TokenType$1.EXPANSION_CASE_VALUE, this._getLocation());\n        var /** @type {?} */ value = this._readUntil($LBRACE).trim();\n        this._endToken([value], this._getLocation());\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n        this._beginToken(TokenType$1.EXPANSION_CASE_EXP_START, this._getLocation());\n        this._requireCharCode($LBRACE);\n        this._endToken([], this._getLocation());\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n        this._expansionCaseStack.push(TokenType$1.EXPANSION_CASE_EXP_START);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeExpansionCaseEnd = function () {\n        this._beginToken(TokenType$1.EXPANSION_CASE_EXP_END, this._getLocation());\n        this._requireCharCode($RBRACE);\n        this._endToken([], this._getLocation());\n        this._attemptCharCodeUntilFn(isNotWhitespace);\n        this._expansionCaseStack.pop();\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeExpansionFormEnd = function () {\n        this._beginToken(TokenType$1.EXPANSION_FORM_END, this._getLocation());\n        this._requireCharCode($RBRACE);\n        this._endToken([]);\n        this._expansionCaseStack.pop();\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._consumeText = function () {\n        var /** @type {?} */ start = this._getLocation();\n        this._beginToken(TokenType$1.TEXT, start);\n        var /** @type {?} */ parts = [];\n        do {\n            if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {\n                parts.push(this._interpolationConfig.start);\n                this._inInterpolation = true;\n            }\n            else if (this._interpolationConfig && this._inInterpolation &&\n                this._attemptStr(this._interpolationConfig.end)) {\n                parts.push(this._interpolationConfig.end);\n                this._inInterpolation = false;\n            }\n            else {\n                parts.push(this._readChar(true));\n            }\n        } while (!this._isTextEnd());\n        this._endToken([this._processCarriageReturns(parts.join(''))]);\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._isTextEnd = function () {\n        if (this._peek === $LT || this._peek === $EOF) {\n            return true;\n        }\n        if (this._tokenizeIcu && !this._inInterpolation) {\n            if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {\n                // start of an expansion form\n                return true;\n            }\n            if (this._peek === $RBRACE && this._isInExpansionCase()) {\n                // end of and expansion case\n                return true;\n            }\n        }\n        return false;\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._savePosition = function () {\n        return [this._peek, this._index, this._column, this._line, this.tokens.length];\n    };\n    /**\n     * @param {?} char\n     * @return {?}\n     */\n    _Tokenizer.prototype._readUntil = function (char) {\n        var /** @type {?} */ start = this._index;\n        this._attemptUntilChar(char);\n        return this._input.substring(start, this._index);\n    };\n    /**\n     * @param {?} position\n     * @return {?}\n     */\n    _Tokenizer.prototype._restorePosition = function (position) {\n        this._peek = position[0];\n        this._index = position[1];\n        this._column = position[2];\n        this._line = position[3];\n        var /** @type {?} */ nbTokens = position[4];\n        if (nbTokens < this.tokens.length) {\n            // remove any extra tokens\n            this.tokens = this.tokens.slice(0, nbTokens);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._isInExpansionCase = function () {\n        return this._expansionCaseStack.length > 0 &&\n            this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n                TokenType$1.EXPANSION_CASE_EXP_START;\n    };\n    /**\n     * @return {?}\n     */\n    _Tokenizer.prototype._isInExpansionForm = function () {\n        return this._expansionCaseStack.length > 0 &&\n            this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n                TokenType$1.EXPANSION_FORM_START;\n    };\n    return _Tokenizer;\n}());\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNotWhitespace(code) {\n    return !isWhitespace(code) || code === $EOF;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNameEnd(code) {\n    return isWhitespace(code) || code === $GT || code === $SLASH ||\n        code === $SQ || code === $DQ || code === $EQ;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isPrefixEnd(code) {\n    return (code < $a || $z < code) && (code < $A || $Z < code) &&\n        (code < $0 || code > $9);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isDigitEntityEnd(code) {\n    return code == $SEMICOLON || code == $EOF || !isAsciiHexDigit(code);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNamedEntityEnd(code) {\n    return code == $SEMICOLON || code == $EOF || !isAsciiLetter(code);\n}\n/**\n * @param {?} input\n * @param {?} offset\n * @param {?} interpolationConfig\n * @return {?}\n */\nfunction isExpansionFormStart(input, offset, interpolationConfig) {\n    var /** @type {?} */ isInterpolationStart = interpolationConfig ? input.indexOf(interpolationConfig.start, offset) == offset : false;\n    return input.charCodeAt(offset) == $LBRACE && !isInterpolationStart;\n}\n/**\n * @param {?} peek\n * @return {?}\n */\nfunction isExpansionCaseStart(peek) {\n    return peek === $EQ || isAsciiLetter(peek);\n}\n/**\n * @param {?} code1\n * @param {?} code2\n * @return {?}\n */\nfunction compareCharCodeCaseInsensitive(code1, code2) {\n    return toUpperCaseCharCode(code1) == toUpperCaseCharCode(code2);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction toUpperCaseCharCode(code) {\n    return code >= $a && code <= $z ? code - $a + $A : code;\n}\n/**\n * @param {?} srcTokens\n * @return {?}\n */\nfunction mergeTextTokens(srcTokens) {\n    var /** @type {?} */ dstTokens = [];\n    var /** @type {?} */ lastDstToken = undefined;\n    for (var /** @type {?} */ i = 0; i < srcTokens.length; i++) {\n        var /** @type {?} */ token = srcTokens[i];\n        if (lastDstToken && lastDstToken.type == TokenType$1.TEXT && token.type == TokenType$1.TEXT) {\n            lastDstToken.parts[0] += token.parts[0];\n            lastDstToken.sourceSpan.end = token.sourceSpan.end;\n        }\n        else {\n            lastDstToken = token;\n            dstTokens.push(lastDstToken);\n        }\n    }\n    return dstTokens;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar TreeError = (function (_super) {\n    __extends(TreeError, _super);\n    /**\n     * @param {?} elementName\n     * @param {?} span\n     * @param {?} msg\n     */\n    function TreeError(elementName, span, msg) {\n        var _this = _super.call(this, span, msg) || this;\n        _this.elementName = elementName;\n        return _this;\n    }\n    /**\n     * @param {?} elementName\n     * @param {?} span\n     * @param {?} msg\n     * @return {?}\n     */\n    TreeError.create = function (elementName, span, msg) {\n        return new TreeError(elementName, span, msg);\n    };\n    return TreeError;\n}(ParseError));\nvar ParseTreeResult = (function () {\n    /**\n     * @param {?} rootNodes\n     * @param {?} errors\n     */\n    function ParseTreeResult(rootNodes, errors) {\n        this.rootNodes = rootNodes;\n        this.errors = errors;\n    }\n    return ParseTreeResult;\n}());\nvar Parser$1 = (function () {\n    /**\n     * @param {?} getTagDefinition\n     */\n    function Parser$1(getTagDefinition) {\n        this.getTagDefinition = getTagDefinition;\n    }\n    /**\n     * @param {?} source\n     * @param {?} url\n     * @param {?=} parseExpansionForms\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    Parser$1.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n        if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        var /** @type {?} */ tokensAndErrors = tokenize(source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);\n        var /** @type {?} */ treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();\n        return new ParseTreeResult(treeAndErrors.rootNodes, ((tokensAndErrors.errors)).concat(treeAndErrors.errors));\n    };\n    return Parser$1;\n}());\nvar _TreeBuilder = (function () {\n    /**\n     * @param {?} tokens\n     * @param {?} getTagDefinition\n     */\n    function _TreeBuilder(tokens, getTagDefinition) {\n        this.tokens = tokens;\n        this.getTagDefinition = getTagDefinition;\n        this._index = -1;\n        this._rootNodes = [];\n        this._errors = [];\n        this._elementStack = [];\n        this._advance();\n    }\n    /**\n     * @return {?}\n     */\n    _TreeBuilder.prototype.build = function () {\n        while (this._peek.type !== TokenType$1.EOF) {\n            if (this._peek.type === TokenType$1.TAG_OPEN_START) {\n                this._consumeStartTag(this._advance());\n            }\n            else if (this._peek.type === TokenType$1.TAG_CLOSE) {\n                this._consumeEndTag(this._advance());\n            }\n            else if (this._peek.type === TokenType$1.CDATA_START) {\n                this._closeVoidElement();\n                this._consumeCdata(this._advance());\n            }\n            else if (this._peek.type === TokenType$1.COMMENT_START) {\n                this._closeVoidElement();\n                this._consumeComment(this._advance());\n            }\n            else if (this._peek.type === TokenType$1.TEXT || this._peek.type === TokenType$1.RAW_TEXT ||\n                this._peek.type === TokenType$1.ESCAPABLE_RAW_TEXT) {\n                this._closeVoidElement();\n                this._consumeText(this._advance());\n            }\n            else if (this._peek.type === TokenType$1.EXPANSION_FORM_START) {\n                this._consumeExpansion(this._advance());\n            }\n            else {\n                // Skip all other tokens...\n                this._advance();\n            }\n        }\n        return new ParseTreeResult(this._rootNodes, this._errors);\n    };\n    /**\n     * @return {?}\n     */\n    _TreeBuilder.prototype._advance = function () {\n        var /** @type {?} */ prev = this._peek;\n        if (this._index < this.tokens.length - 1) {\n            // Note: there is always an EOF token at the end\n            this._index++;\n        }\n        this._peek = this.tokens[this._index];\n        return prev;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    _TreeBuilder.prototype._advanceIf = function (type) {\n        if (this._peek.type === type) {\n            return this._advance();\n        }\n        return null;\n    };\n    /**\n     * @param {?} startToken\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeCdata = function (startToken) {\n        this._consumeText(this._advance());\n        this._advanceIf(TokenType$1.CDATA_END);\n    };\n    /**\n     * @param {?} token\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeComment = function (token) {\n        var /** @type {?} */ text = this._advanceIf(TokenType$1.RAW_TEXT);\n        this._advanceIf(TokenType$1.COMMENT_END);\n        var /** @type {?} */ value = text != null ? text.parts[0].trim() : null;\n        this._addToParent(new Comment(value, token.sourceSpan));\n    };\n    /**\n     * @param {?} token\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeExpansion = function (token) {\n        var /** @type {?} */ switchValue = this._advance();\n        var /** @type {?} */ type = this._advance();\n        var /** @type {?} */ cases = [];\n        // read =\n        while (this._peek.type === TokenType$1.EXPANSION_CASE_VALUE) {\n            var /** @type {?} */ expCase = this._parseExpansionCase();\n            if (!expCase)\n                return; // error\n            cases.push(expCase);\n        }\n        // read the final }\n        if (this._peek.type !== TokenType$1.EXPANSION_FORM_END) {\n            this._errors.push(TreeError.create(null, this._peek.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n            return;\n        }\n        var /** @type {?} */ sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);\n        this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));\n        this._advance();\n    };\n    /**\n     * @return {?}\n     */\n    _TreeBuilder.prototype._parseExpansionCase = function () {\n        var /** @type {?} */ value = this._advance();\n        // read {\n        if (this._peek.type !== TokenType$1.EXPANSION_CASE_EXP_START) {\n            this._errors.push(TreeError.create(null, this._peek.sourceSpan, \"Invalid ICU message. Missing '{'.\"));\n            return null;\n        }\n        // read until }\n        var /** @type {?} */ start = this._advance();\n        var /** @type {?} */ exp = this._collectExpansionExpTokens(start);\n        if (!exp)\n            return null;\n        var /** @type {?} */ end = this._advance();\n        exp.push(new Token$1(TokenType$1.EOF, [], end.sourceSpan));\n        // parse everything in between { and }\n        var /** @type {?} */ parsedExp = new _TreeBuilder(exp, this.getTagDefinition).build();\n        if (parsedExp.errors.length > 0) {\n            this._errors = this._errors.concat(/** @type {?} */ (parsedExp.errors));\n            return null;\n        }\n        var /** @type {?} */ sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);\n        var /** @type {?} */ expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);\n        return new ExpansionCase(value.parts[0], parsedExp.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);\n    };\n    /**\n     * @param {?} start\n     * @return {?}\n     */\n    _TreeBuilder.prototype._collectExpansionExpTokens = function (start) {\n        var /** @type {?} */ exp = [];\n        var /** @type {?} */ expansionFormStack = [TokenType$1.EXPANSION_CASE_EXP_START];\n        while (true) {\n            if (this._peek.type === TokenType$1.EXPANSION_FORM_START ||\n                this._peek.type === TokenType$1.EXPANSION_CASE_EXP_START) {\n                expansionFormStack.push(this._peek.type);\n            }\n            if (this._peek.type === TokenType$1.EXPANSION_CASE_EXP_END) {\n                if (lastOnStack(expansionFormStack, TokenType$1.EXPANSION_CASE_EXP_START)) {\n                    expansionFormStack.pop();\n                    if (expansionFormStack.length == 0)\n                        return exp;\n                }\n                else {\n                    this._errors.push(TreeError.create(null, start.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                    return null;\n                }\n            }\n            if (this._peek.type === TokenType$1.EXPANSION_FORM_END) {\n                if (lastOnStack(expansionFormStack, TokenType$1.EXPANSION_FORM_START)) {\n                    expansionFormStack.pop();\n                }\n                else {\n                    this._errors.push(TreeError.create(null, start.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                    return null;\n                }\n            }\n            if (this._peek.type === TokenType$1.EOF) {\n                this._errors.push(TreeError.create(null, start.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n                return null;\n            }\n            exp.push(this._advance());\n        }\n    };\n    /**\n     * @param {?} token\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeText = function (token) {\n        var /** @type {?} */ text = token.parts[0];\n        if (text.length > 0 && text[0] == '\\n') {\n            var /** @type {?} */ parent = this._getParentElement();\n            if (parent != null && parent.children.length == 0 &&\n                this.getTagDefinition(parent.name).ignoreFirstLf) {\n                text = text.substring(1);\n            }\n        }\n        if (text.length > 0) {\n            this._addToParent(new Text(text, token.sourceSpan));\n        }\n    };\n    /**\n     * @return {?}\n     */\n    _TreeBuilder.prototype._closeVoidElement = function () {\n        if (this._elementStack.length > 0) {\n            var /** @type {?} */ el = this._elementStack[this._elementStack.length - 1];\n            if (this.getTagDefinition(el.name).isVoid) {\n                this._elementStack.pop();\n            }\n        }\n    };\n    /**\n     * @param {?} startTagToken\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeStartTag = function (startTagToken) {\n        var /** @type {?} */ prefix = startTagToken.parts[0];\n        var /** @type {?} */ name = startTagToken.parts[1];\n        var /** @type {?} */ attrs = [];\n        while (this._peek.type === TokenType$1.ATTR_NAME) {\n            attrs.push(this._consumeAttr(this._advance()));\n        }\n        var /** @type {?} */ fullName = this._getElementFullName(prefix, name, this._getParentElement());\n        var /** @type {?} */ selfClosing = false;\n        // Note: There could have been a tokenizer error\n        // so that we don't get a token for the end tag...\n        if (this._peek.type === TokenType$1.TAG_OPEN_END_VOID) {\n            this._advance();\n            selfClosing = true;\n            var /** @type {?} */ tagDef = this.getTagDefinition(fullName);\n            if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {\n                this._errors.push(TreeError.create(fullName, startTagToken.sourceSpan, \"Only void and foreign elements can be self closed \\\"\" + startTagToken.parts[1] + \"\\\"\"));\n            }\n        }\n        else if (this._peek.type === TokenType$1.TAG_OPEN_END) {\n            this._advance();\n            selfClosing = false;\n        }\n        var /** @type {?} */ end = this._peek.sourceSpan.start;\n        var /** @type {?} */ span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);\n        var /** @type {?} */ el = new Element(fullName, attrs, [], span, span, undefined);\n        this._pushElement(el);\n        if (selfClosing) {\n            this._popElement(fullName);\n            el.endSourceSpan = span;\n        }\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    _TreeBuilder.prototype._pushElement = function (el) {\n        if (this._elementStack.length > 0) {\n            var /** @type {?} */ parentEl = this._elementStack[this._elementStack.length - 1];\n            if (this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {\n                this._elementStack.pop();\n            }\n        }\n        var /** @type {?} */ tagDef = this.getTagDefinition(el.name);\n        var _a = this._getParentElementSkippingContainers(), parent = _a.parent, container = _a.container;\n        if (parent && tagDef.requireExtraParent(parent.name)) {\n            var /** @type {?} */ newParent = new Element(tagDef.parentToAdd, [], [], el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n            this._insertBeforeContainer(parent, container, newParent);\n        }\n        this._addToParent(el);\n        this._elementStack.push(el);\n    };\n    /**\n     * @param {?} endTagToken\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeEndTag = function (endTagToken) {\n        var /** @type {?} */ fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement());\n        if (this._getParentElement()) {\n            ((this._getParentElement())).endSourceSpan = endTagToken.sourceSpan;\n        }\n        if (this.getTagDefinition(fullName).isVoid) {\n            this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, \"Void elements do not have end tags \\\"\" + endTagToken.parts[1] + \"\\\"\"));\n        }\n        else if (!this._popElement(fullName)) {\n            var /** @type {?} */ errMsg = \"Unexpected closing tag \\\"\" + fullName + \"\\\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags\";\n            this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));\n        }\n    };\n    /**\n     * @param {?} fullName\n     * @return {?}\n     */\n    _TreeBuilder.prototype._popElement = function (fullName) {\n        for (var /** @type {?} */ stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n            var /** @type {?} */ el = this._elementStack[stackIndex];\n            if (el.name == fullName) {\n                this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);\n                return true;\n            }\n            if (!this.getTagDefinition(el.name).closedByParent) {\n                return false;\n            }\n        }\n        return false;\n    };\n    /**\n     * @param {?} attrName\n     * @return {?}\n     */\n    _TreeBuilder.prototype._consumeAttr = function (attrName) {\n        var /** @type {?} */ fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);\n        var /** @type {?} */ end = attrName.sourceSpan.end;\n        var /** @type {?} */ value = '';\n        var /** @type {?} */ valueSpan = ((undefined));\n        if (this._peek.type === TokenType$1.ATTR_VALUE) {\n            var /** @type {?} */ valueToken = this._advance();\n            value = valueToken.parts[0];\n            end = valueToken.sourceSpan.end;\n            valueSpan = valueToken.sourceSpan;\n        }\n        return new Attribute$1(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);\n    };\n    /**\n     * @return {?}\n     */\n    _TreeBuilder.prototype._getParentElement = function () {\n        return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;\n    };\n    /**\n     * Returns the parent in the DOM and the container.\n     *\n     * `<ng-container>` elements are skipped as they are not rendered as DOM element.\n     * @return {?}\n     */\n    _TreeBuilder.prototype._getParentElementSkippingContainers = function () {\n        var /** @type {?} */ container = null;\n        for (var /** @type {?} */ i = this._elementStack.length - 1; i >= 0; i--) {\n            if (!isNgContainer(this._elementStack[i].name)) {\n                return { parent: this._elementStack[i], container: container };\n            }\n            container = this._elementStack[i];\n        }\n        return { parent: this._elementStack[this._elementStack.length - 1], container: container };\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    _TreeBuilder.prototype._addToParent = function (node) {\n        var /** @type {?} */ parent = this._getParentElement();\n        if (parent != null) {\n            parent.children.push(node);\n        }\n        else {\n            this._rootNodes.push(node);\n        }\n    };\n    /**\n     * Insert a node between the parent and the container.\n     * When no container is given, the node is appended as a child of the parent.\n     * Also updates the element stack accordingly.\n     *\n     * \\@internal\n     * @param {?} parent\n     * @param {?} container\n     * @param {?} node\n     * @return {?}\n     */\n    _TreeBuilder.prototype._insertBeforeContainer = function (parent, container, node) {\n        if (!container) {\n            this._addToParent(node);\n            this._elementStack.push(node);\n        }\n        else {\n            if (parent) {\n                // replace the container with the new node in the children\n                var /** @type {?} */ index = parent.children.indexOf(container);\n                parent.children[index] = node;\n            }\n            else {\n                this._rootNodes.push(node);\n            }\n            node.children.push(container);\n            this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n        }\n    };\n    /**\n     * @param {?} prefix\n     * @param {?} localName\n     * @param {?} parentElement\n     * @return {?}\n     */\n    _TreeBuilder.prototype._getElementFullName = function (prefix, localName, parentElement) {\n        if (prefix == null) {\n            prefix = ((this.getTagDefinition(localName).implicitNamespacePrefix));\n            if (prefix == null && parentElement != null) {\n                prefix = getNsPrefix(parentElement.name);\n            }\n        }\n        return mergeNsAndName(prefix, localName);\n    };\n    return _TreeBuilder;\n}());\n/**\n * @param {?} stack\n * @param {?} element\n * @return {?}\n */\nfunction lastOnStack(stack, element) {\n    return stack.length > 0 && stack[stack.length - 1] === element;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar Message = (function () {\n    /**\n     * @param {?} nodes message AST\n     * @param {?} placeholders maps placeholder names to static content\n     * @param {?} placeholderToMessage maps placeholder names to messages (used for nested ICU messages)\n     * @param {?} meaning\n     * @param {?} description\n     * @param {?} id\n     */\n    function Message(nodes, placeholders, placeholderToMessage, meaning, description, id) {\n        this.nodes = nodes;\n        this.placeholders = placeholders;\n        this.placeholderToMessage = placeholderToMessage;\n        this.meaning = meaning;\n        this.description = description;\n        this.id = id;\n        if (nodes.length) {\n            this.sources = [{\n                    filePath: nodes[0].sourceSpan.start.file.url,\n                    startLine: nodes[0].sourceSpan.start.line + 1,\n                    startCol: nodes[0].sourceSpan.start.col + 1,\n                    endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,\n                    endCol: nodes[0].sourceSpan.start.col + 1\n                }];\n        }\n        else {\n            this.sources = [];\n        }\n    }\n    return Message;\n}());\nvar Text$1 = (function () {\n    /**\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function Text$1(value, sourceSpan) {\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Text$1.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };\n    return Text$1;\n}());\nvar Container = (function () {\n    /**\n     * @param {?} children\n     * @param {?} sourceSpan\n     */\n    function Container(children, sourceSpan) {\n        this.children = children;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Container.prototype.visit = function (visitor, context) { return visitor.visitContainer(this, context); };\n    return Container;\n}());\nvar Icu = (function () {\n    /**\n     * @param {?} expression\n     * @param {?} type\n     * @param {?} cases\n     * @param {?} sourceSpan\n     */\n    function Icu(expression, type, cases, sourceSpan) {\n        this.expression = expression;\n        this.type = type;\n        this.cases = cases;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Icu.prototype.visit = function (visitor, context) { return visitor.visitIcu(this, context); };\n    return Icu;\n}());\nvar TagPlaceholder = (function () {\n    /**\n     * @param {?} tag\n     * @param {?} attrs\n     * @param {?} startName\n     * @param {?} closeName\n     * @param {?} children\n     * @param {?} isVoid\n     * @param {?} sourceSpan\n     */\n    function TagPlaceholder(tag, attrs, startName, closeName, children, isVoid, sourceSpan) {\n        this.tag = tag;\n        this.attrs = attrs;\n        this.startName = startName;\n        this.closeName = closeName;\n        this.children = children;\n        this.isVoid = isVoid;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    TagPlaceholder.prototype.visit = function (visitor, context) { return visitor.visitTagPlaceholder(this, context); };\n    return TagPlaceholder;\n}());\nvar Placeholder = (function () {\n    /**\n     * @param {?} value\n     * @param {?} name\n     * @param {?} sourceSpan\n     */\n    function Placeholder(value, name, sourceSpan) {\n        this.value = value;\n        this.name = name;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    Placeholder.prototype.visit = function (visitor, context) { return visitor.visitPlaceholder(this, context); };\n    return Placeholder;\n}());\nvar IcuPlaceholder = (function () {\n    /**\n     * @param {?} value\n     * @param {?} name\n     * @param {?} sourceSpan\n     */\n    function IcuPlaceholder(value, name, sourceSpan) {\n        this.value = value;\n        this.name = name;\n        this.sourceSpan = sourceSpan;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?=} context\n     * @return {?}\n     */\n    IcuPlaceholder.prototype.visit = function (visitor, context) { return visitor.visitIcuPlaceholder(this, context); };\n    return IcuPlaceholder;\n}());\nvar CloneVisitor = (function () {\n    function CloneVisitor() {\n    }\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    CloneVisitor.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };\n    /**\n     * @param {?} container\n     * @param {?=} context\n     * @return {?}\n     */\n    CloneVisitor.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        var /** @type {?} */ children = container.children.map(function (n) { return n.visit(_this, context); });\n        return new Container(children, container.sourceSpan);\n    };\n    /**\n     * @param {?} icu\n     * @param {?=} context\n     * @return {?}\n     */\n    CloneVisitor.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ cases = {};\n        Object.keys(icu.cases).forEach(function (key) { return cases[key] = icu.cases[key].visit(_this, context); });\n        var /** @type {?} */ msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan);\n        msg.expressionPlaceholder = icu.expressionPlaceholder;\n        return msg;\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    CloneVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n        var _this = this;\n        var /** @type {?} */ children = ph.children.map(function (n) { return n.visit(_this, context); });\n        return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan);\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    CloneVisitor.prototype.visitPlaceholder = function (ph, context) {\n        return new Placeholder(ph.value, ph.name, ph.sourceSpan);\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    CloneVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n        return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);\n    };\n    return CloneVisitor;\n}());\nvar RecurseVisitor = (function () {\n    function RecurseVisitor() {\n    }\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    RecurseVisitor.prototype.visitText = function (text, context) { };\n    \n    /**\n     * @param {?} container\n     * @param {?=} context\n     * @return {?}\n     */\n    RecurseVisitor.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        container.children.forEach(function (child) { return child.visit(_this); });\n    };\n    /**\n     * @param {?} icu\n     * @param {?=} context\n     * @return {?}\n     */\n    RecurseVisitor.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        Object.keys(icu.cases).forEach(function (k) { icu.cases[k].visit(_this); });\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    RecurseVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n        var _this = this;\n        ph.children.forEach(function (child) { return child.visit(_this); });\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    RecurseVisitor.prototype.visitPlaceholder = function (ph, context) { };\n    \n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    RecurseVisitor.prototype.visitIcuPlaceholder = function (ph, context) { };\n    \n    return RecurseVisitor;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar TAG_TO_PLACEHOLDER_NAMES = {\n    'A': 'LINK',\n    'B': 'BOLD_TEXT',\n    'BR': 'LINE_BREAK',\n    'EM': 'EMPHASISED_TEXT',\n    'H1': 'HEADING_LEVEL1',\n    'H2': 'HEADING_LEVEL2',\n    'H3': 'HEADING_LEVEL3',\n    'H4': 'HEADING_LEVEL4',\n    'H5': 'HEADING_LEVEL5',\n    'H6': 'HEADING_LEVEL6',\n    'HR': 'HORIZONTAL_RULE',\n    'I': 'ITALIC_TEXT',\n    'LI': 'LIST_ITEM',\n    'LINK': 'MEDIA_LINK',\n    'OL': 'ORDERED_LIST',\n    'P': 'PARAGRAPH',\n    'Q': 'QUOTATION',\n    'S': 'STRIKETHROUGH_TEXT',\n    'SMALL': 'SMALL_TEXT',\n    'SUB': 'SUBSTRIPT',\n    'SUP': 'SUPERSCRIPT',\n    'TBODY': 'TABLE_BODY',\n    'TD': 'TABLE_CELL',\n    'TFOOT': 'TABLE_FOOTER',\n    'TH': 'TABLE_HEADER_CELL',\n    'THEAD': 'TABLE_HEADER',\n    'TR': 'TABLE_ROW',\n    'TT': 'MONOSPACED_TEXT',\n    'U': 'UNDERLINED_TEXT',\n    'UL': 'UNORDERED_LIST',\n};\n/**\n * Creates unique names for placeholder with different content.\n *\n * Returns the same placeholder name when the content is identical.\n *\n * \\@internal\n */\nvar PlaceholderRegistry = (function () {\n    function PlaceholderRegistry() {\n        this._placeHolderNameCounts = {};\n        this._signatureToName = {};\n    }\n    /**\n     * @param {?} tag\n     * @param {?} attrs\n     * @param {?} isVoid\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype.getStartTagPlaceholderName = function (tag, attrs, isVoid) {\n        var /** @type {?} */ signature = this._hashTag(tag, attrs, isVoid);\n        if (this._signatureToName[signature]) {\n            return this._signatureToName[signature];\n        }\n        var /** @type {?} */ upperTag = tag.toUpperCase();\n        var /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || \"TAG_\" + upperTag;\n        var /** @type {?} */ name = this._generateUniqueName(isVoid ? baseName : \"START_\" + baseName);\n        this._signatureToName[signature] = name;\n        return name;\n    };\n    /**\n     * @param {?} tag\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype.getCloseTagPlaceholderName = function (tag) {\n        var /** @type {?} */ signature = this._hashClosingTag(tag);\n        if (this._signatureToName[signature]) {\n            return this._signatureToName[signature];\n        }\n        var /** @type {?} */ upperTag = tag.toUpperCase();\n        var /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || \"TAG_\" + upperTag;\n        var /** @type {?} */ name = this._generateUniqueName(\"CLOSE_\" + baseName);\n        this._signatureToName[signature] = name;\n        return name;\n    };\n    /**\n     * @param {?} name\n     * @param {?} content\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype.getPlaceholderName = function (name, content) {\n        var /** @type {?} */ upperName = name.toUpperCase();\n        var /** @type {?} */ signature = \"PH: \" + upperName + \"=\" + content;\n        if (this._signatureToName[signature]) {\n            return this._signatureToName[signature];\n        }\n        var /** @type {?} */ uniqueName = this._generateUniqueName(upperName);\n        this._signatureToName[signature] = uniqueName;\n        return uniqueName;\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype.getUniquePlaceholder = function (name) {\n        return this._generateUniqueName(name.toUpperCase());\n    };\n    /**\n     * @param {?} tag\n     * @param {?} attrs\n     * @param {?} isVoid\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype._hashTag = function (tag, attrs, isVoid) {\n        var /** @type {?} */ start = \"<\" + tag;\n        var /** @type {?} */ strAttrs = Object.keys(attrs).sort().map(function (name) { return \" \" + name + \"=\" + attrs[name]; }).join('');\n        var /** @type {?} */ end = isVoid ? '/>' : \"></\" + tag + \">\";\n        return start + strAttrs + end;\n    };\n    /**\n     * @param {?} tag\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype._hashClosingTag = function (tag) { return this._hashTag(\"/\" + tag, {}, false); };\n    /**\n     * @param {?} base\n     * @return {?}\n     */\n    PlaceholderRegistry.prototype._generateUniqueName = function (base) {\n        var /** @type {?} */ seen = this._placeHolderNameCounts.hasOwnProperty(base);\n        if (!seen) {\n            this._placeHolderNameCounts[base] = 1;\n            return base;\n        }\n        var /** @type {?} */ id = this._placeHolderNameCounts[base];\n        this._placeHolderNameCounts[base] = id + 1;\n        return base + \"_\" + id;\n    };\n    return PlaceholderRegistry;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _expParser = new Parser(new Lexer());\n/**\n * Returns a function converting html nodes to an i18n Message given an interpolationConfig\n * @param {?} interpolationConfig\n * @return {?}\n */\nfunction createI18nMessageFactory(interpolationConfig) {\n    var /** @type {?} */ visitor = new _I18nVisitor(_expParser, interpolationConfig);\n    return function (nodes, meaning, description, id) { return visitor.toI18nMessage(nodes, meaning, description, id); };\n}\nvar _I18nVisitor = (function () {\n    /**\n     * @param {?} _expressionParser\n     * @param {?} _interpolationConfig\n     */\n    function _I18nVisitor(_expressionParser, _interpolationConfig) {\n        this._expressionParser = _expressionParser;\n        this._interpolationConfig = _interpolationConfig;\n    }\n    /**\n     * @param {?} nodes\n     * @param {?} meaning\n     * @param {?} description\n     * @param {?} id\n     * @return {?}\n     */\n    _I18nVisitor.prototype.toI18nMessage = function (nodes, meaning, description, id) {\n        this._isIcu = nodes.length == 1 && nodes[0] instanceof Expansion;\n        this._icuDepth = 0;\n        this._placeholderRegistry = new PlaceholderRegistry();\n        this._placeholderToContent = {};\n        this._placeholderToMessage = {};\n        var /** @type {?} */ i18nodes = visitAll(this, nodes, {});\n        return new Message(i18nodes, this._placeholderToContent, this._placeholderToMessage, meaning, description, id);\n    };\n    /**\n     * @param {?} el\n     * @param {?} context\n     * @return {?}\n     */\n    _I18nVisitor.prototype.visitElement = function (el, context) {\n        var /** @type {?} */ children = visitAll(this, el.children);\n        var /** @type {?} */ attrs = {};\n        el.attrs.forEach(function (attr) {\n            // Do not visit the attributes, translatable ones are top-level ASTs\n            attrs[attr.name] = attr.value;\n        });\n        var /** @type {?} */ isVoid = getHtmlTagDefinition(el.name).isVoid;\n        var /** @type {?} */ startPhName = this._placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);\n        this._placeholderToContent[startPhName] = ((el.sourceSpan)).toString();\n        var /** @type {?} */ closePhName = '';\n        if (!isVoid) {\n            closePhName = this._placeholderRegistry.getCloseTagPlaceholderName(el.name);\n            this._placeholderToContent[closePhName] = \"</\" + el.name + \">\";\n        }\n        return new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, /** @type {?} */ ((el.sourceSpan)));\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    _I18nVisitor.prototype.visitAttribute = function (attribute, context) {\n        return this._visitTextWithInterpolation(attribute.value, attribute.sourceSpan);\n    };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    _I18nVisitor.prototype.visitText = function (text, context) {\n        return this._visitTextWithInterpolation(text.value, /** @type {?} */ ((text.sourceSpan)));\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    _I18nVisitor.prototype.visitComment = function (comment, context) { return null; };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    _I18nVisitor.prototype.visitExpansion = function (icu, context) {\n        var _this = this;\n        this._icuDepth++;\n        var /** @type {?} */ i18nIcuCases = {};\n        var /** @type {?} */ i18nIcu = new Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);\n        icu.cases.forEach(function (caze) {\n            i18nIcuCases[caze.value] = new Container(caze.expression.map(function (node) { return node.visit(_this, {}); }), caze.expSourceSpan);\n        });\n        this._icuDepth--;\n        if (this._isIcu || this._icuDepth > 0) {\n            // Returns an ICU node when:\n            // - the message (vs a part of the message) is an ICU message, or\n            // - the ICU message is nested.\n            var /** @type {?} */ expPh = this._placeholderRegistry.getUniquePlaceholder(\"VAR_\" + icu.type);\n            i18nIcu.expressionPlaceholder = expPh;\n            this._placeholderToContent[expPh] = icu.switchValue;\n            return i18nIcu;\n        }\n        // Else returns a placeholder\n        // ICU placeholders should not be replaced with their original content but with the their\n        // translations. We need to create a new visitor (they are not re-entrant) to compute the\n        // message id.\n        // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg\n        var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());\n        var /** @type {?} */ visitor = new _I18nVisitor(this._expressionParser, this._interpolationConfig);\n        this._placeholderToMessage[phName] = visitor.toI18nMessage([icu], '', '', '');\n        return new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);\n    };\n    /**\n     * @param {?} icuCase\n     * @param {?} context\n     * @return {?}\n     */\n    _I18nVisitor.prototype.visitExpansionCase = function (icuCase, context) {\n        throw new Error('Unreachable code');\n    };\n    /**\n     * @param {?} text\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    _I18nVisitor.prototype._visitTextWithInterpolation = function (text, sourceSpan) {\n        var /** @type {?} */ splitInterpolation = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig);\n        if (!splitInterpolation) {\n            // No expression, return a single text\n            return new Text$1(text, sourceSpan);\n        }\n        // Return a group of text + expressions\n        var /** @type {?} */ nodes = [];\n        var /** @type {?} */ container = new Container(nodes, sourceSpan);\n        var _a = this._interpolationConfig, sDelimiter = _a.start, eDelimiter = _a.end;\n        for (var /** @type {?} */ i = 0; i < splitInterpolation.strings.length - 1; i++) {\n            var /** @type {?} */ expression = splitInterpolation.expressions[i];\n            var /** @type {?} */ baseName = _extractPlaceholderName(expression) || 'INTERPOLATION';\n            var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName(baseName, expression);\n            if (splitInterpolation.strings[i].length) {\n                // No need to add empty strings\n                nodes.push(new Text$1(splitInterpolation.strings[i], sourceSpan));\n            }\n            nodes.push(new Placeholder(expression, phName, sourceSpan));\n            this._placeholderToContent[phName] = sDelimiter + expression + eDelimiter;\n        }\n        // The last index contains no expression\n        var /** @type {?} */ lastStringIdx = splitInterpolation.strings.length - 1;\n        if (splitInterpolation.strings[lastStringIdx].length) {\n            nodes.push(new Text$1(splitInterpolation.strings[lastStringIdx], sourceSpan));\n        }\n        return container;\n    };\n    return _I18nVisitor;\n}());\nvar _CUSTOM_PH_EXP = /\\/\\/[\\s\\S]*i18n[\\s\\S]*\\([\\s\\S]*ph[\\s\\S]*=[\\s\\S]*(\"|')([\\s\\S]*?)\\1[\\s\\S]*\\)/g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction _extractPlaceholderName(input) {\n    return input.split(_CUSTOM_PH_EXP)[2];\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * An i18n error.\n */\nvar I18nError = (function (_super) {\n    __extends(I18nError, _super);\n    /**\n     * @param {?} span\n     * @param {?} msg\n     */\n    function I18nError(span, msg) {\n        return _super.call(this, span, msg) || this;\n    }\n    return I18nError;\n}(ParseError));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _I18N_ATTR = 'i18n';\nvar _I18N_ATTR_PREFIX = 'i18n-';\nvar _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;\nvar MEANING_SEPARATOR = '|';\nvar ID_SEPARATOR = '@@';\n/**\n * Extract translatable messages from an html AST\n * @param {?} nodes\n * @param {?} interpolationConfig\n * @param {?} implicitTags\n * @param {?} implicitAttrs\n * @return {?}\n */\nfunction extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {\n    var /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);\n    return visitor.extract(nodes, interpolationConfig);\n}\n/**\n * @param {?} nodes\n * @param {?} translations\n * @param {?} interpolationConfig\n * @param {?} implicitTags\n * @param {?} implicitAttrs\n * @return {?}\n */\nfunction mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {\n    var /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);\n    return visitor.merge(nodes, translations, interpolationConfig);\n}\nvar ExtractionResult = (function () {\n    /**\n     * @param {?} messages\n     * @param {?} errors\n     */\n    function ExtractionResult(messages, errors) {\n        this.messages = messages;\n        this.errors = errors;\n    }\n    return ExtractionResult;\n}());\nvar _VisitorMode = {};\n_VisitorMode.Extract = 0;\n_VisitorMode.Merge = 1;\n_VisitorMode[_VisitorMode.Extract] = \"Extract\";\n_VisitorMode[_VisitorMode.Merge] = \"Merge\";\n/**\n * This Visitor is used:\n * 1. to extract all the translatable strings from an html AST (see `extract()`),\n * 2. to replace the translatable strings with the actual translations (see `merge()`)\n *\n * \\@internal\n */\nvar _Visitor = (function () {\n    /**\n     * @param {?} _implicitTags\n     * @param {?} _implicitAttrs\n     */\n    function _Visitor(_implicitTags, _implicitAttrs) {\n        this._implicitTags = _implicitTags;\n        this._implicitAttrs = _implicitAttrs;\n    }\n    /**\n     * Extracts the messages from the tree\n     * @param {?} nodes\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    _Visitor.prototype.extract = function (nodes, interpolationConfig) {\n        var _this = this;\n        this._init(_VisitorMode.Extract, interpolationConfig);\n        nodes.forEach(function (node) { return node.visit(_this, null); });\n        if (this._inI18nBlock) {\n            this._reportError(nodes[nodes.length - 1], 'Unclosed block');\n        }\n        return new ExtractionResult(this._messages, this._errors);\n    };\n    /**\n     * Returns a tree where all translatable nodes are translated\n     * @param {?} nodes\n     * @param {?} translations\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    _Visitor.prototype.merge = function (nodes, translations, interpolationConfig) {\n        this._init(_VisitorMode.Merge, interpolationConfig);\n        this._translations = translations;\n        // Construct a single fake root element\n        var /** @type {?} */ wrapper = new Element('wrapper', [], nodes, /** @type {?} */ ((undefined)), undefined, undefined);\n        var /** @type {?} */ translatedNode = wrapper.visit(this, null);\n        if (this._inI18nBlock) {\n            this._reportError(nodes[nodes.length - 1], 'Unclosed block');\n        }\n        return new ParseTreeResult(translatedNode.children, this._errors);\n    };\n    /**\n     * @param {?} icuCase\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor.prototype.visitExpansionCase = function (icuCase, context) {\n        // Parse cases for translatable html attributes\n        var /** @type {?} */ expression = visitAll(this, icuCase.expression, context);\n        if (this._mode === _VisitorMode.Merge) {\n            return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);\n        }\n    };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor.prototype.visitExpansion = function (icu, context) {\n        this._mayBeAddBlockChildren(icu);\n        var /** @type {?} */ wasInIcu = this._inIcu;\n        if (!this._inIcu) {\n            // nested ICU messages should not be extracted but top-level translated as a whole\n            if (this._isInTranslatableSection) {\n                this._addMessage([icu]);\n            }\n            this._inIcu = true;\n        }\n        var /** @type {?} */ cases = visitAll(this, icu.cases, context);\n        if (this._mode === _VisitorMode.Merge) {\n            icu = new Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan);\n        }\n        this._inIcu = wasInIcu;\n        return icu;\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor.prototype.visitComment = function (comment, context) {\n        var /** @type {?} */ isOpening = _isOpeningComment(comment);\n        if (isOpening && this._isInTranslatableSection) {\n            this._reportError(comment, 'Could not start a block inside a translatable section');\n            return;\n        }\n        var /** @type {?} */ isClosing = _isClosingComment(comment);\n        if (isClosing && !this._inI18nBlock) {\n            this._reportError(comment, 'Trying to close an unopened block');\n            return;\n        }\n        if (!this._inI18nNode && !this._inIcu) {\n            if (!this._inI18nBlock) {\n                if (isOpening) {\n                    this._inI18nBlock = true;\n                    this._blockStartDepth = this._depth;\n                    this._blockChildren = [];\n                    this._blockMeaningAndDesc = ((comment.value)).replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim();\n                    this._openTranslatableSection(comment);\n                }\n            }\n            else {\n                if (isClosing) {\n                    if (this._depth == this._blockStartDepth) {\n                        this._closeTranslatableSection(comment, this._blockChildren);\n                        this._inI18nBlock = false;\n                        var /** @type {?} */ message = ((this._addMessage(this._blockChildren, this._blockMeaningAndDesc)));\n                        // merge attributes in sections\n                        var /** @type {?} */ nodes = this._translateMessage(comment, message);\n                        return visitAll(this, nodes);\n                    }\n                    else {\n                        this._reportError(comment, 'I18N blocks should not cross element boundaries');\n                        return;\n                    }\n                }\n            }\n        }\n    };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor.prototype.visitText = function (text, context) {\n        if (this._isInTranslatableSection) {\n            this._mayBeAddBlockChildren(text);\n        }\n        return text;\n    };\n    /**\n     * @param {?} el\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor.prototype.visitElement = function (el, context) {\n        var _this = this;\n        this._mayBeAddBlockChildren(el);\n        this._depth++;\n        var /** @type {?} */ wasInI18nNode = this._inI18nNode;\n        var /** @type {?} */ wasInImplicitNode = this._inImplicitNode;\n        var /** @type {?} */ childNodes = [];\n        var /** @type {?} */ translatedChildNodes = ((undefined));\n        // Extract:\n        // - top level nodes with the (implicit) \"i18n\" attribute if not already in a section\n        // - ICU messages\n        var /** @type {?} */ i18nAttr = _getI18nAttr(el);\n        var /** @type {?} */ i18nMeta = i18nAttr ? i18nAttr.value : '';\n        var /** @type {?} */ isImplicit = this._implicitTags.some(function (tag) { return el.name === tag; }) && !this._inIcu &&\n            !this._isInTranslatableSection;\n        var /** @type {?} */ isTopLevelImplicit = !wasInImplicitNode && isImplicit;\n        this._inImplicitNode = wasInImplicitNode || isImplicit;\n        if (!this._isInTranslatableSection && !this._inIcu) {\n            if (i18nAttr || isTopLevelImplicit) {\n                this._inI18nNode = true;\n                var /** @type {?} */ message = ((this._addMessage(el.children, i18nMeta)));\n                translatedChildNodes = this._translateMessage(el, message);\n            }\n            if (this._mode == _VisitorMode.Extract) {\n                var /** @type {?} */ isTranslatable = i18nAttr || isTopLevelImplicit;\n                if (isTranslatable)\n                    this._openTranslatableSection(el);\n                visitAll(this, el.children);\n                if (isTranslatable)\n                    this._closeTranslatableSection(el, el.children);\n            }\n        }\n        else {\n            if (i18nAttr || isTopLevelImplicit) {\n                this._reportError(el, 'Could not mark an element as translatable inside a translatable section');\n            }\n            if (this._mode == _VisitorMode.Extract) {\n                // Descend into child nodes for extraction\n                visitAll(this, el.children);\n            }\n        }\n        if (this._mode === _VisitorMode.Merge) {\n            var /** @type {?} */ visitNodes = translatedChildNodes || el.children;\n            visitNodes.forEach(function (child) {\n                var /** @type {?} */ visited = child.visit(_this, context);\n                if (visited && !_this._isInTranslatableSection) {\n                    // Do not add the children from translatable sections (= i18n blocks here)\n                    // They will be added later in this loop when the block closes (i.e. on `<!-- /i18n -->`)\n                    childNodes = childNodes.concat(visited);\n                }\n            });\n        }\n        this._visitAttributesOf(el);\n        this._depth--;\n        this._inI18nNode = wasInI18nNode;\n        this._inImplicitNode = wasInImplicitNode;\n        if (this._mode === _VisitorMode.Merge) {\n            var /** @type {?} */ translatedAttrs = this._translateAttributes(el);\n            return new Element(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n        }\n        return null;\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor.prototype.visitAttribute = function (attribute, context) {\n        throw new Error('unreachable code');\n    };\n    /**\n     * @param {?} mode\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    _Visitor.prototype._init = function (mode, interpolationConfig) {\n        this._mode = mode;\n        this._inI18nBlock = false;\n        this._inI18nNode = false;\n        this._depth = 0;\n        this._inIcu = false;\n        this._msgCountAtSectionStart = undefined;\n        this._errors = [];\n        this._messages = [];\n        this._inImplicitNode = false;\n        this._createI18nMessage = createI18nMessageFactory(interpolationConfig);\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    _Visitor.prototype._visitAttributesOf = function (el) {\n        var _this = this;\n        var /** @type {?} */ explicitAttrNameToValue = {};\n        var /** @type {?} */ implicitAttrNames = this._implicitAttrs[el.name] || [];\n        el.attrs.filter(function (attr) { return attr.name.startsWith(_I18N_ATTR_PREFIX); })\n            .forEach(function (attr) { return explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n            attr.value; });\n        el.attrs.forEach(function (attr) {\n            if (attr.name in explicitAttrNameToValue) {\n                _this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n            }\n            else if (implicitAttrNames.some(function (name) { return attr.name === name; })) {\n                _this._addMessage([attr]);\n            }\n        });\n    };\n    /**\n     * @param {?} ast\n     * @param {?=} msgMeta\n     * @return {?}\n     */\n    _Visitor.prototype._addMessage = function (ast, msgMeta) {\n        if (ast.length == 0 ||\n            ast.length == 1 && ast[0] instanceof Attribute$1 && !((ast[0])).value) {\n            // Do not create empty messages\n            return null;\n        }\n        var _a = _parseMessageMeta(msgMeta), meaning = _a.meaning, description = _a.description, id = _a.id;\n        var /** @type {?} */ message = this._createI18nMessage(ast, meaning, description, id);\n        this._messages.push(message);\n        return message;\n    };\n    /**\n     * @param {?} el\n     * @param {?} message\n     * @return {?}\n     */\n    _Visitor.prototype._translateMessage = function (el, message) {\n        if (message && this._mode === _VisitorMode.Merge) {\n            var /** @type {?} */ nodes = this._translations.get(message);\n            if (nodes) {\n                return nodes;\n            }\n            this._reportError(el, \"Translation unavailable for message id=\\\"\" + this._translations.digest(message) + \"\\\"\");\n        }\n        return [];\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    _Visitor.prototype._translateAttributes = function (el) {\n        var _this = this;\n        var /** @type {?} */ attributes = el.attrs;\n        var /** @type {?} */ i18nParsedMessageMeta = {};\n        attributes.forEach(function (attr) {\n            if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n                i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n                    _parseMessageMeta(attr.value);\n            }\n        });\n        var /** @type {?} */ translatedAttributes = [];\n        attributes.forEach(function (attr) {\n            if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n                // strip i18n specific attributes\n                return;\n            }\n            if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {\n                var _a = i18nParsedMessageMeta[attr.name], meaning = _a.meaning, description = _a.description, id = _a.id;\n                var /** @type {?} */ message = _this._createI18nMessage([attr], meaning, description, id);\n                var /** @type {?} */ nodes = _this._translations.get(message);\n                if (nodes) {\n                    if (nodes.length == 0) {\n                        translatedAttributes.push(new Attribute$1(attr.name, '', attr.sourceSpan));\n                    }\n                    else if (nodes[0] instanceof Text) {\n                        var /** @type {?} */ value = ((nodes[0])).value;\n                        translatedAttributes.push(new Attribute$1(attr.name, value, attr.sourceSpan));\n                    }\n                    else {\n                        _this._reportError(el, \"Unexpected translation for attribute \\\"\" + attr.name + \"\\\" (id=\\\"\" + (id || _this._translations.digest(message)) + \"\\\")\");\n                    }\n                }\n                else {\n                    _this._reportError(el, \"Translation unavailable for attribute \\\"\" + attr.name + \"\\\" (id=\\\"\" + (id || _this._translations.digest(message)) + \"\\\")\");\n                }\n            }\n            else {\n                translatedAttributes.push(attr);\n            }\n        });\n        return translatedAttributes;\n    };\n    /**\n     * Add the node as a child of the block when:\n     * - we are in a block,\n     * - we are not inside a ICU message (those are handled separately),\n     * - the node is a \"direct child\" of the block\n     * @param {?} node\n     * @return {?}\n     */\n    _Visitor.prototype._mayBeAddBlockChildren = function (node) {\n        if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {\n            this._blockChildren.push(node);\n        }\n    };\n    /**\n     * Marks the start of a section, see `_closeTranslatableSection`\n     * @param {?} node\n     * @return {?}\n     */\n    _Visitor.prototype._openTranslatableSection = function (node) {\n        if (this._isInTranslatableSection) {\n            this._reportError(node, 'Unexpected section start');\n        }\n        else {\n            this._msgCountAtSectionStart = this._messages.length;\n        }\n    };\n    Object.defineProperty(_Visitor.prototype, \"_isInTranslatableSection\", {\n        /**\n         * A translatable section could be:\n         * - the content of translatable element,\n         * - nodes between `<!-- i18n -->` and `<!-- /i18n -->` comments\n         * @return {?}\n         */\n        get: function () {\n            return this._msgCountAtSectionStart !== void 0;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * Terminates a section.\n     *\n     * If a section has only one significant children (comments not significant) then we should not\n     * keep the message from this children:\n     *\n     * `<p i18n=\"meaning|description\">{ICU message}</p>` would produce two messages:\n     * - one for the <p> content with meaning and description,\n     * - another one for the ICU message.\n     *\n     * In this case the last message is discarded as it contains less information (the AST is\n     * otherwise identical).\n     *\n     * Note that we should still keep messages extracted from attributes inside the section (ie in the\n     * ICU message here)\n     * @param {?} node\n     * @param {?} directChildren\n     * @return {?}\n     */\n    _Visitor.prototype._closeTranslatableSection = function (node, directChildren) {\n        if (!this._isInTranslatableSection) {\n            this._reportError(node, 'Unexpected section end');\n            return;\n        }\n        var /** @type {?} */ startIndex = this._msgCountAtSectionStart;\n        var /** @type {?} */ significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment ? 0 : 1); }, 0);\n        if (significantChildren == 1) {\n            for (var /** @type {?} */ i = this._messages.length - 1; i >= ((startIndex)); i--) {\n                var /** @type {?} */ ast = this._messages[i].nodes;\n                if (!(ast.length == 1 && ast[0] instanceof Text$1)) {\n                    this._messages.splice(i, 1);\n                    break;\n                }\n            }\n        }\n        this._msgCountAtSectionStart = undefined;\n    };\n    /**\n     * @param {?} node\n     * @param {?} msg\n     * @return {?}\n     */\n    _Visitor.prototype._reportError = function (node, msg) {\n        this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), msg));\n    };\n    return _Visitor;\n}());\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isOpeningComment(n) {\n    return !!(n instanceof Comment && n.value && n.value.startsWith('i18n'));\n}\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isClosingComment(n) {\n    return !!(n instanceof Comment && n.value && n.value === '/i18n');\n}\n/**\n * @param {?} p\n * @return {?}\n */\nfunction _getI18nAttr(p) {\n    return p.attrs.find(function (attr) { return attr.name === _I18N_ATTR; }) || null;\n}\n/**\n * @param {?=} i18n\n * @return {?}\n */\nfunction _parseMessageMeta(i18n) {\n    if (!i18n)\n        return { meaning: '', description: '', id: '' };\n    var /** @type {?} */ idIndex = i18n.indexOf(ID_SEPARATOR);\n    var /** @type {?} */ descIndex = i18n.indexOf(MEANING_SEPARATOR);\n    var _a = (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], meaningAndDesc = _a[0], id = _a[1];\n    var _b = (descIndex > -1) ?\n        [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :\n        ['', meaningAndDesc], meaning = _b[0], description = _b[1];\n    return { meaning: meaning, description: description, id: id };\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar XmlTagDefinition = (function () {\n    function XmlTagDefinition() {\n        this.closedByParent = false;\n        this.contentType = TagContentType.PARSABLE_DATA;\n        this.isVoid = false;\n        this.ignoreFirstLf = false;\n        this.canSelfClose = true;\n    }\n    /**\n     * @param {?} currentParent\n     * @return {?}\n     */\n    XmlTagDefinition.prototype.requireExtraParent = function (currentParent) { return false; };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    XmlTagDefinition.prototype.isClosedByChild = function (name) { return false; };\n    return XmlTagDefinition;\n}());\nvar _TAG_DEFINITION = new XmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction getXmlTagDefinition(tagName) {\n    return _TAG_DEFINITION;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar XmlParser = (function (_super) {\n    __extends(XmlParser, _super);\n    function XmlParser() {\n        return _super.call(this, getXmlTagDefinition) || this;\n    }\n    /**\n     * @param {?} source\n     * @param {?} url\n     * @param {?=} parseExpansionForms\n     * @return {?}\n     */\n    XmlParser.prototype.parse = function (source, url, parseExpansionForms) {\n        if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n        return _super.prototype.parse.call(this, source, url, parseExpansionForms);\n    };\n    return XmlParser;\n}(Parser$1));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} message\n * @return {?}\n */\nfunction digest(message) {\n    return message.id || sha1(serializeNodes(message.nodes).join('') + (\"[\" + message.meaning + \"]\"));\n}\n/**\n * @param {?} message\n * @return {?}\n */\nfunction decimalDigest(message) {\n    if (message.id) {\n        return message.id;\n    }\n    var /** @type {?} */ visitor = new _SerializerIgnoreIcuExpVisitor();\n    var /** @type {?} */ parts = message.nodes.map(function (a) { return a.visit(visitor, null); });\n    return computeMsgId(parts.join(''), message.meaning);\n}\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * The visitor is also used in the i18n parser tests\n *\n * \\@internal\n */\nvar _SerializerVisitor = (function () {\n    function _SerializerVisitor() {\n    }\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    _SerializerVisitor.prototype.visitText = function (text, context) { return text.value; };\n    /**\n     * @param {?} container\n     * @param {?} context\n     * @return {?}\n     */\n    _SerializerVisitor.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        return \"[\" + container.children.map(function (child) { return child.visit(_this); }).join(', ') + \"]\";\n    };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    _SerializerVisitor.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ strCases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n        return \"{\" + icu.expression + \", \" + icu.type + \", \" + strCases.join(', ') + \"}\";\n    };\n    /**\n     * @param {?} ph\n     * @param {?} context\n     * @return {?}\n     */\n    _SerializerVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n        var _this = this;\n        return ph.isVoid ?\n            \"<ph tag name=\\\"\" + ph.startName + \"\\\"/>\" :\n            \"<ph tag name=\\\"\" + ph.startName + \"\\\">\" + ph.children.map(function (child) { return child.visit(_this); }).join(', ') + \"</ph name=\\\"\" + ph.closeName + \"\\\">\";\n    };\n    /**\n     * @param {?} ph\n     * @param {?} context\n     * @return {?}\n     */\n    _SerializerVisitor.prototype.visitPlaceholder = function (ph, context) {\n        return ph.value ? \"<ph name=\\\"\" + ph.name + \"\\\">\" + ph.value + \"</ph>\" : \"<ph name=\\\"\" + ph.name + \"\\\"/>\";\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _SerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n        return \"<ph icu name=\\\"\" + ph.name + \"\\\">\" + ph.value.visit(this) + \"</ph>\";\n    };\n    return _SerializerVisitor;\n}());\nvar serializerVisitor = new _SerializerVisitor();\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction serializeNodes(nodes) {\n    return nodes.map(function (a) { return a.visit(serializerVisitor, null); });\n}\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.\n *\n * \\@internal\n */\nvar _SerializerIgnoreIcuExpVisitor = (function (_super) {\n    __extends(_SerializerIgnoreIcuExpVisitor, _super);\n    function _SerializerIgnoreIcuExpVisitor() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    _SerializerIgnoreIcuExpVisitor.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ strCases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n        // Do not take the expression into account\n        return \"{\" + icu.type + \", \" + strCases.join(', ') + \"}\";\n    };\n    return _SerializerIgnoreIcuExpVisitor;\n}(_SerializerVisitor));\n/**\n * Compute the SHA1 of the given string\n *\n * see http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\n *\n * WARNING: this function has not been designed not tested with security in mind.\n *          DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.\n * @param {?} str\n * @return {?}\n */\nfunction sha1(str) {\n    var /** @type {?} */ utf8 = utf8Encode(str);\n    var /** @type {?} */ words32 = stringToWords32(utf8, Endian.Big);\n    var /** @type {?} */ len = utf8.length * 8;\n    var /** @type {?} */ w = new Array(80);\n    var _a = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0], a = _a[0], b = _a[1], c = _a[2], d = _a[3], e = _a[4];\n    words32[len >> 5] |= 0x80 << (24 - len % 32);\n    words32[((len + 64 >> 9) << 4) + 15] = len;\n    for (var /** @type {?} */ i = 0; i < words32.length; i += 16) {\n        var _b = [a, b, c, d, e], h0 = _b[0], h1 = _b[1], h2 = _b[2], h3 = _b[3], h4 = _b[4];\n        for (var /** @type {?} */ j = 0; j < 80; j++) {\n            if (j < 16) {\n                w[j] = words32[i + j];\n            }\n            else {\n                w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n            }\n            var _c = fk(j, b, c, d), f = _c[0], k = _c[1];\n            var /** @type {?} */ temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);\n            _d = [d, c, rol32(b, 30), a, temp], e = _d[0], d = _d[1], c = _d[2], b = _d[3], a = _d[4];\n        }\n        _e = [add32(a, h0), add32(b, h1), add32(c, h2), add32(d, h3), add32(e, h4)], a = _e[0], b = _e[1], c = _e[2], d = _e[3], e = _e[4];\n    }\n    return byteStringToHexString(words32ToByteString([a, b, c, d, e]));\n    var _d, _e;\n}\n/**\n * @param {?} index\n * @param {?} b\n * @param {?} c\n * @param {?} d\n * @return {?}\n */\nfunction fk(index, b, c, d) {\n    if (index < 20) {\n        return [(b & c) | (~b & d), 0x5a827999];\n    }\n    if (index < 40) {\n        return [b ^ c ^ d, 0x6ed9eba1];\n    }\n    if (index < 60) {\n        return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];\n    }\n    return [b ^ c ^ d, 0xca62c1d6];\n}\n/**\n * Compute the fingerprint of the given string\n *\n * The output is 64 bit number encoded as a decimal string\n *\n * based on:\n * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java\n * @param {?} str\n * @return {?}\n */\nfunction fingerprint(str) {\n    var /** @type {?} */ utf8 = utf8Encode(str);\n    var _a = [hash32(utf8, 0), hash32(utf8, 102072)], hi = _a[0], lo = _a[1];\n    if (hi == 0 && (lo == 0 || lo == 1)) {\n        hi = hi ^ 0x130f9bef;\n        lo = lo ^ -0x6b5f56d8;\n    }\n    return [hi, lo];\n}\n/**\n * @param {?} msg\n * @param {?} meaning\n * @return {?}\n */\nfunction computeMsgId(msg, meaning) {\n    var _a = fingerprint(msg), hi = _a[0], lo = _a[1];\n    if (meaning) {\n        var _b = fingerprint(meaning), him = _b[0], lom = _b[1];\n        _c = add64(rol64([hi, lo], 1), [him, lom]), hi = _c[0], lo = _c[1];\n    }\n    return byteStringToDecString(words32ToByteString([hi & 0x7fffffff, lo]));\n    var _c;\n}\n/**\n * @param {?} str\n * @param {?} c\n * @return {?}\n */\nfunction hash32(str, c) {\n    var _a = [0x9e3779b9, 0x9e3779b9], a = _a[0], b = _a[1];\n    var /** @type {?} */ i;\n    var /** @type {?} */ len = str.length;\n    for (i = 0; i + 12 <= len; i += 12) {\n        a = add32(a, wordAt(str, i, Endian.Little));\n        b = add32(b, wordAt(str, i + 4, Endian.Little));\n        c = add32(c, wordAt(str, i + 8, Endian.Little));\n        _b = mix([a, b, c]), a = _b[0], b = _b[1], c = _b[2];\n    }\n    a = add32(a, wordAt(str, i, Endian.Little));\n    b = add32(b, wordAt(str, i + 4, Endian.Little));\n    // the first byte of c is reserved for the length\n    c = add32(c, len);\n    c = add32(c, wordAt(str, i + 8, Endian.Little) << 8);\n    return mix([a, b, c])[2];\n    var _b;\n}\n/**\n * @param {?} __0\n * @return {?}\n */\nfunction mix(_a) {\n    var a = _a[0], b = _a[1], c = _a[2];\n    a = sub32(a, b);\n    a = sub32(a, c);\n    a ^= c >>> 13;\n    b = sub32(b, c);\n    b = sub32(b, a);\n    b ^= a << 8;\n    c = sub32(c, a);\n    c = sub32(c, b);\n    c ^= b >>> 13;\n    a = sub32(a, b);\n    a = sub32(a, c);\n    a ^= c >>> 12;\n    b = sub32(b, c);\n    b = sub32(b, a);\n    b ^= a << 16;\n    c = sub32(c, a);\n    c = sub32(c, b);\n    c ^= b >>> 5;\n    a = sub32(a, b);\n    a = sub32(a, c);\n    a ^= c >>> 3;\n    b = sub32(b, c);\n    b = sub32(b, a);\n    b ^= a << 10;\n    c = sub32(c, a);\n    c = sub32(c, b);\n    c ^= b >>> 15;\n    return [a, b, c];\n}\nvar Endian = {};\nEndian.Little = 0;\nEndian.Big = 1;\nEndian[Endian.Little] = \"Little\";\nEndian[Endian.Big] = \"Big\";\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction add32(a, b) {\n    return add32to64(a, b)[1];\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction add32to64(a, b) {\n    var /** @type {?} */ low = (a & 0xffff) + (b & 0xffff);\n    var /** @type {?} */ high = (a >>> 16) + (b >>> 16) + (low >>> 16);\n    return [high >>> 16, (high << 16) | (low & 0xffff)];\n}\n/**\n * @param {?} __0\n * @param {?} __1\n * @return {?}\n */\nfunction add64(_a, _b) {\n    var ah = _a[0], al = _a[1];\n    var bh = _b[0], bl = _b[1];\n    var _c = add32to64(al, bl), carry = _c[0], l = _c[1];\n    var /** @type {?} */ h = add32(add32(ah, bh), carry);\n    return [h, l];\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction sub32(a, b) {\n    var /** @type {?} */ low = (a & 0xffff) - (b & 0xffff);\n    var /** @type {?} */ high = (a >> 16) - (b >> 16) + (low >> 16);\n    return (high << 16) | (low & 0xffff);\n}\n/**\n * @param {?} a\n * @param {?} count\n * @return {?}\n */\nfunction rol32(a, count) {\n    return (a << count) | (a >>> (32 - count));\n}\n/**\n * @param {?} __0\n * @param {?} count\n * @return {?}\n */\nfunction rol64(_a, count) {\n    var hi = _a[0], lo = _a[1];\n    var /** @type {?} */ h = (hi << count) | (lo >>> (32 - count));\n    var /** @type {?} */ l = (lo << count) | (hi >>> (32 - count));\n    return [h, l];\n}\n/**\n * @param {?} str\n * @param {?} endian\n * @return {?}\n */\nfunction stringToWords32(str, endian) {\n    var /** @type {?} */ words32 = Array((str.length + 3) >>> 2);\n    for (var /** @type {?} */ i = 0; i < words32.length; i++) {\n        words32[i] = wordAt(str, i * 4, endian);\n    }\n    return words32;\n}\n/**\n * @param {?} str\n * @param {?} index\n * @return {?}\n */\nfunction byteAt(str, index) {\n    return index >= str.length ? 0 : str.charCodeAt(index) & 0xff;\n}\n/**\n * @param {?} str\n * @param {?} index\n * @param {?} endian\n * @return {?}\n */\nfunction wordAt(str, index, endian) {\n    var /** @type {?} */ word = 0;\n    if (endian === Endian.Big) {\n        for (var /** @type {?} */ i = 0; i < 4; i++) {\n            word += byteAt(str, index + i) << (24 - 8 * i);\n        }\n    }\n    else {\n        for (var /** @type {?} */ i = 0; i < 4; i++) {\n            word += byteAt(str, index + i) << 8 * i;\n        }\n    }\n    return word;\n}\n/**\n * @param {?} words32\n * @return {?}\n */\nfunction words32ToByteString(words32) {\n    return words32.reduce(function (str, word) { return str + word32ToByteString(word); }, '');\n}\n/**\n * @param {?} word\n * @return {?}\n */\nfunction word32ToByteString(word) {\n    var /** @type {?} */ str = '';\n    for (var /** @type {?} */ i = 0; i < 4; i++) {\n        str += String.fromCharCode((word >>> 8 * (3 - i)) & 0xff);\n    }\n    return str;\n}\n/**\n * @param {?} str\n * @return {?}\n */\nfunction byteStringToHexString(str) {\n    var /** @type {?} */ hex = '';\n    for (var /** @type {?} */ i = 0; i < str.length; i++) {\n        var /** @type {?} */ b = byteAt(str, i);\n        hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);\n    }\n    return hex.toLowerCase();\n}\n/**\n * @param {?} str\n * @return {?}\n */\nfunction byteStringToDecString(str) {\n    var /** @type {?} */ decimal = '';\n    var /** @type {?} */ toThePower = '1';\n    for (var /** @type {?} */ i = str.length - 1; i >= 0; i--) {\n        decimal = addBigInt(decimal, numberTimesBigInt(byteAt(str, i), toThePower));\n        toThePower = numberTimesBigInt(256, toThePower);\n    }\n    return decimal.split('').reverse().join('');\n}\n/**\n * @param {?} x\n * @param {?} y\n * @return {?}\n */\nfunction addBigInt(x, y) {\n    var /** @type {?} */ sum = '';\n    var /** @type {?} */ len = Math.max(x.length, y.length);\n    for (var /** @type {?} */ i = 0, /** @type {?} */ carry = 0; i < len || carry; i++) {\n        var /** @type {?} */ tmpSum = carry + +(x[i] || 0) + +(y[i] || 0);\n        if (tmpSum >= 10) {\n            carry = 1;\n            sum += tmpSum - 10;\n        }\n        else {\n            carry = 0;\n            sum += tmpSum;\n        }\n    }\n    return sum;\n}\n/**\n * @param {?} num\n * @param {?} b\n * @return {?}\n */\nfunction numberTimesBigInt(num, b) {\n    var /** @type {?} */ product = '';\n    var /** @type {?} */ bToThePower = b;\n    for (; num !== 0; num = num >>> 1) {\n        if (num & 1)\n            product = addBigInt(product, bToThePower);\n        bToThePower = addBigInt(bToThePower, bToThePower);\n    }\n    return product;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @abstract\n */\nvar Serializer = (function () {\n    function Serializer() {\n    }\n    /**\n     * @abstract\n     * @param {?} messages\n     * @param {?} locale\n     * @return {?}\n     */\n    Serializer.prototype.write = function (messages, locale) { };\n    /**\n     * @abstract\n     * @param {?} content\n     * @param {?} url\n     * @return {?}\n     */\n    Serializer.prototype.load = function (content, url) { };\n    /**\n     * @abstract\n     * @param {?} message\n     * @return {?}\n     */\n    Serializer.prototype.digest = function (message) { };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Serializer.prototype.createNameMapper = function (message) { return null; };\n    return Serializer;\n}());\n/**\n * A simple mapper that take a function to transform an internal name to a public name\n */\nvar SimplePlaceholderMapper = (function (_super) {\n    __extends(SimplePlaceholderMapper, _super);\n    /**\n     * @param {?} message\n     * @param {?} mapName\n     */\n    function SimplePlaceholderMapper(message, mapName) {\n        var _this = _super.call(this) || this;\n        _this.mapName = mapName;\n        _this.internalToPublic = {};\n        _this.publicToNextId = {};\n        _this.publicToInternal = {};\n        message.nodes.forEach(function (node) { return node.visit(_this); });\n        return _this;\n    }\n    /**\n     * @param {?} internalName\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.toPublicName = function (internalName) {\n        return this.internalToPublic.hasOwnProperty(internalName) ?\n            this.internalToPublic[internalName] :\n            null;\n    };\n    /**\n     * @param {?} publicName\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.toInternalName = function (publicName) {\n        return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :\n            null;\n    };\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.visitText = function (text, context) { return null; };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.visitTagPlaceholder = function (ph, context) {\n        this.visitPlaceholderName(ph.startName);\n        _super.prototype.visitTagPlaceholder.call(this, ph, context);\n        this.visitPlaceholderName(ph.closeName);\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.visitPlaceholder = function (ph, context) { this.visitPlaceholderName(ph.name); };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.visitIcuPlaceholder = function (ph, context) {\n        this.visitPlaceholderName(ph.name);\n    };\n    /**\n     * @param {?} internalName\n     * @return {?}\n     */\n    SimplePlaceholderMapper.prototype.visitPlaceholderName = function (internalName) {\n        if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n            return;\n        }\n        var /** @type {?} */ publicName = this.mapName(internalName);\n        if (this.publicToInternal.hasOwnProperty(publicName)) {\n            // Create a new XMB when it has already been used\n            var /** @type {?} */ nextId = this.publicToNextId[publicName];\n            this.publicToNextId[publicName] = nextId + 1;\n            publicName = publicName + \"_\" + nextId;\n        }\n        else {\n            this.publicToNextId[publicName] = 1;\n        }\n        this.internalToPublic[internalName] = publicName;\n        this.publicToInternal[publicName] = internalName;\n    };\n    return SimplePlaceholderMapper;\n}(RecurseVisitor));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _Visitor$1 = (function () {\n    function _Visitor$1() {\n    }\n    /**\n     * @param {?} tag\n     * @return {?}\n     */\n    _Visitor$1.prototype.visitTag = function (tag) {\n        var _this = this;\n        var /** @type {?} */ strAttrs = this._serializeAttributes(tag.attrs);\n        if (tag.children.length == 0) {\n            return \"<\" + tag.name + strAttrs + \"/>\";\n        }\n        var /** @type {?} */ strChildren = tag.children.map(function (node) { return node.visit(_this); });\n        return \"<\" + tag.name + strAttrs + \">\" + strChildren.join('') + \"</\" + tag.name + \">\";\n    };\n    /**\n     * @param {?} text\n     * @return {?}\n     */\n    _Visitor$1.prototype.visitText = function (text) { return text.value; };\n    /**\n     * @param {?} decl\n     * @return {?}\n     */\n    _Visitor$1.prototype.visitDeclaration = function (decl) {\n        return \"<?xml\" + this._serializeAttributes(decl.attrs) + \" ?>\";\n    };\n    /**\n     * @param {?} attrs\n     * @return {?}\n     */\n    _Visitor$1.prototype._serializeAttributes = function (attrs) {\n        var /** @type {?} */ strAttrs = Object.keys(attrs).map(function (name) { return name + \"=\\\"\" + attrs[name] + \"\\\"\"; }).join(' ');\n        return strAttrs.length > 0 ? ' ' + strAttrs : '';\n    };\n    /**\n     * @param {?} doctype\n     * @return {?}\n     */\n    _Visitor$1.prototype.visitDoctype = function (doctype) {\n        return \"<!DOCTYPE \" + doctype.rootTag + \" [\\n\" + doctype.dtd + \"\\n]>\";\n    };\n    return _Visitor$1;\n}());\nvar _visitor = new _Visitor$1();\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction serialize(nodes) {\n    return nodes.map(function (node) { return node.visit(_visitor); }).join('');\n}\nvar Declaration = (function () {\n    /**\n     * @param {?} unescapedAttrs\n     */\n    function Declaration(unescapedAttrs) {\n        var _this = this;\n        this.attrs = {};\n        Object.keys(unescapedAttrs).forEach(function (k) {\n            _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n        });\n    }\n    /**\n     * @param {?} visitor\n     * @return {?}\n     */\n    Declaration.prototype.visit = function (visitor) { return visitor.visitDeclaration(this); };\n    return Declaration;\n}());\nvar Doctype = (function () {\n    /**\n     * @param {?} rootTag\n     * @param {?} dtd\n     */\n    function Doctype(rootTag, dtd) {\n        this.rootTag = rootTag;\n        this.dtd = dtd;\n    }\n    \n    /**\n     * @param {?} visitor\n     * @return {?}\n     */\n    Doctype.prototype.visit = function (visitor) { return visitor.visitDoctype(this); };\n    return Doctype;\n}());\nvar Tag = (function () {\n    /**\n     * @param {?} name\n     * @param {?=} unescapedAttrs\n     * @param {?=} children\n     */\n    function Tag(name, unescapedAttrs, children) {\n        if (unescapedAttrs === void 0) { unescapedAttrs = {}; }\n        if (children === void 0) { children = []; }\n        var _this = this;\n        this.name = name;\n        this.children = children;\n        this.attrs = {};\n        Object.keys(unescapedAttrs).forEach(function (k) {\n            _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n        });\n    }\n    /**\n     * @param {?} visitor\n     * @return {?}\n     */\n    Tag.prototype.visit = function (visitor) { return visitor.visitTag(this); };\n    return Tag;\n}());\nvar Text$2 = (function () {\n    /**\n     * @param {?} unescapedValue\n     */\n    function Text$2(unescapedValue) {\n        this.value = _escapeXml(unescapedValue);\n    }\n    \n    /**\n     * @param {?} visitor\n     * @return {?}\n     */\n    Text$2.prototype.visit = function (visitor) { return visitor.visitText(this); };\n    return Text$2;\n}());\nvar CR = (function (_super) {\n    __extends(CR, _super);\n    /**\n     * @param {?=} ws\n     */\n    function CR(ws) {\n        if (ws === void 0) { ws = 0; }\n        return _super.call(this, \"\\n\" + new Array(ws + 1).join(' ')) || this;\n    }\n    return CR;\n}(Text$2));\nvar _ESCAPED_CHARS = [\n    [/&/g, '&amp;'],\n    [/\"/g, '&quot;'],\n    [/'/g, '&apos;'],\n    [/</g, '&lt;'],\n    [/>/g, '&gt;'],\n];\n/**\n * @param {?} text\n * @return {?}\n */\nfunction _escapeXml(text) {\n    return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _VERSION = '1.2';\nvar _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';\n// TODO(vicb): make this a param (s/_/-/)\nvar _DEFAULT_SOURCE_LANG = 'en';\nvar _PLACEHOLDER_TAG = 'x';\nvar _FILE_TAG = 'file';\nvar _SOURCE_TAG = 'source';\nvar _TARGET_TAG = 'target';\nvar _UNIT_TAG = 'trans-unit';\nvar _CONTEXT_GROUP_TAG = 'context-group';\nvar _CONTEXT_TAG = 'context';\nvar Xliff = (function (_super) {\n    __extends(Xliff, _super);\n    function Xliff() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} messages\n     * @param {?} locale\n     * @return {?}\n     */\n    Xliff.prototype.write = function (messages, locale) {\n        var /** @type {?} */ visitor = new _WriteVisitor();\n        var /** @type {?} */ transUnits = [];\n        messages.forEach(function (message) {\n            var /** @type {?} */ contextTags = [];\n            message.sources.forEach(function (source) {\n                var /** @type {?} */ contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });\n                contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new Text$2(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new Text$2(\"\" + source.startLine)]), new CR(8));\n                contextTags.push(new CR(8), contextGroupTag);\n            });\n            var /** @type {?} */ transUnit = new Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });\n            (_a = transUnit.children).push.apply(_a, [new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), new CR(8), new Tag(_TARGET_TAG)].concat(contextTags));\n            if (message.description) {\n                transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));\n            }\n            if (message.meaning) {\n                transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));\n            }\n            transUnit.children.push(new CR(6));\n            transUnits.push(new CR(6), transUnit);\n            var _a;\n        });\n        var /** @type {?} */ body = new Tag('body', {}, transUnits.concat([new CR(4)]));\n        var /** @type {?} */ file = new Tag('file', {\n            'source-language': locale || _DEFAULT_SOURCE_LANG,\n            datatype: 'plaintext',\n            original: 'ng2.template',\n        }, [new CR(4), body, new CR(2)]);\n        var /** @type {?} */ xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new CR(2), file, new CR()]);\n        return serialize([\n            new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n        ]);\n    };\n    /**\n     * @param {?} content\n     * @param {?} url\n     * @return {?}\n     */\n    Xliff.prototype.load = function (content, url) {\n        // xliff to xml nodes\n        var /** @type {?} */ xliffParser = new XliffParser();\n        var _a = xliffParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n        // xml nodes to i18n nodes\n        var /** @type {?} */ i18nNodesByMsgId = {};\n        var /** @type {?} */ converter = new XmlToI18n();\n        Object.keys(msgIdToHtml).forEach(function (msgId) {\n            var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n            errors.push.apply(errors, e);\n            i18nNodesByMsgId[msgId] = i18nNodes;\n        });\n        if (errors.length) {\n            throw new Error(\"xliff parse errors:\\n\" + errors.join('\\n'));\n        }\n        return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };\n    };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Xliff.prototype.digest = function (message) { return digest(message); };\n    return Xliff;\n}(Serializer));\nvar _WriteVisitor = (function () {\n    function _WriteVisitor() {\n    }\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n    /**\n     * @param {?} container\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        var /** @type {?} */ nodes = [];\n        container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n        return nodes;\n    };\n    /**\n     * @param {?} icu\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n        Object.keys(icu.cases).forEach(function (c) {\n            nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n        });\n        nodes.push(new Text$2(\"}\"));\n        return nodes;\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n        var /** @type {?} */ ctype = getCtypeForTag(ph.tag);\n        var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype });\n        if (ph.isVoid) {\n            // void tags have no children nor closing tags\n            return [startTagPh];\n        }\n        var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ctype });\n        return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor.prototype.visitPlaceholder = function (ph, context) {\n        return [new Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n        return [new Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n    };\n    /**\n     * @param {?} nodes\n     * @return {?}\n     */\n    _WriteVisitor.prototype.serialize = function (nodes) {\n        var _this = this;\n        return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n    };\n    return _WriteVisitor;\n}());\nvar XliffParser = (function () {\n    function XliffParser() {\n        this._locale = null;\n    }\n    /**\n     * @param {?} xliff\n     * @param {?} url\n     * @return {?}\n     */\n    XliffParser.prototype.parse = function (xliff, url) {\n        this._unitMlString = null;\n        this._msgIdToHtml = {};\n        var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n        this._errors = xml.errors;\n        visitAll(this, xml.rootNodes, null);\n        return {\n            msgIdToHtml: this._msgIdToHtml,\n            errors: this._errors,\n            locale: this._locale,\n        };\n    };\n    /**\n     * @param {?} element\n     * @param {?} context\n     * @return {?}\n     */\n    XliffParser.prototype.visitElement = function (element, context) {\n        switch (element.name) {\n            case _UNIT_TAG:\n                this._unitMlString = ((null));\n                var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n                if (!idAttr) {\n                    this._addError(element, \"<\" + _UNIT_TAG + \"> misses the \\\"id\\\" attribute\");\n                }\n                else {\n                    var /** @type {?} */ id = idAttr.value;\n                    if (this._msgIdToHtml.hasOwnProperty(id)) {\n                        this._addError(element, \"Duplicated translations for msg \" + id);\n                    }\n                    else {\n                        visitAll(this, element.children, null);\n                        if (typeof this._unitMlString === 'string') {\n                            this._msgIdToHtml[id] = this._unitMlString;\n                        }\n                        else {\n                            this._addError(element, \"Message \" + id + \" misses a translation\");\n                        }\n                    }\n                }\n                break;\n            case _SOURCE_TAG:\n                // ignore source message\n                break;\n            case _TARGET_TAG:\n                var /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n                var /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n                var /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n                var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n                this._unitMlString = innerText;\n                break;\n            case _FILE_TAG:\n                var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'target-language'; });\n                if (localeAttr) {\n                    this._locale = localeAttr.value;\n                }\n                visitAll(this, element.children, null);\n                break;\n            default:\n                // TODO(vicb): assert file structure, xliff version\n                // For now only recurse on unhandled nodes\n                visitAll(this, element.children, null);\n        }\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    XliffParser.prototype.visitAttribute = function (attribute, context) { };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    XliffParser.prototype.visitText = function (text, context) { };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    XliffParser.prototype.visitComment = function (comment, context) { };\n    /**\n     * @param {?} expansion\n     * @param {?} context\n     * @return {?}\n     */\n    XliffParser.prototype.visitExpansion = function (expansion, context) { };\n    /**\n     * @param {?} expansionCase\n     * @param {?} context\n     * @return {?}\n     */\n    XliffParser.prototype.visitExpansionCase = function (expansionCase, context) { };\n    /**\n     * @param {?} node\n     * @param {?} message\n     * @return {?}\n     */\n    XliffParser.prototype._addError = function (node, message) {\n        this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n    };\n    return XliffParser;\n}());\nvar XmlToI18n = (function () {\n    function XmlToI18n() {\n    }\n    /**\n     * @param {?} message\n     * @param {?} url\n     * @return {?}\n     */\n    XmlToI18n.prototype.convert = function (message, url) {\n        var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n        this._errors = xmlIcu.errors;\n        var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n            [] :\n            visitAll(this, xmlIcu.rootNodes);\n        return {\n            i18nNodes: i18nNodes,\n            errors: this._errors,\n        };\n    };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n.prototype.visitText = function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };\n    /**\n     * @param {?} el\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n.prototype.visitElement = function (el, context) {\n        if (el.name === _PLACEHOLDER_TAG) {\n            var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'id'; });\n            if (nameAttr) {\n                return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n            }\n            this._addError(el, \"<\" + _PLACEHOLDER_TAG + \"> misses the \\\"id\\\" attribute\");\n        }\n        else {\n            this._addError(el, \"Unexpected tag\");\n        }\n        return null;\n    };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n.prototype.visitExpansion = function (icu, context) {\n        var /** @type {?} */ caseMap = {};\n        visitAll(this, icu.cases).forEach(function (c) {\n            caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n        });\n        return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n    };\n    /**\n     * @param {?} icuCase\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {\n        return {\n            value: icuCase.value,\n            nodes: visitAll(this, icuCase.expression),\n        };\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n.prototype.visitComment = function (comment, context) { };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n.prototype.visitAttribute = function (attribute, context) { };\n    /**\n     * @param {?} node\n     * @param {?} message\n     * @return {?}\n     */\n    XmlToI18n.prototype._addError = function (node, message) {\n        this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n    };\n    return XmlToI18n;\n}());\n/**\n * @param {?} tag\n * @return {?}\n */\nfunction getCtypeForTag(tag) {\n    switch (tag.toLowerCase()) {\n        case 'br':\n            return 'lb';\n        case 'img':\n            return 'image';\n        default:\n            return \"x-\" + tag;\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _VERSION$1 = '2.0';\nvar _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:2.0';\n// TODO(vicb): make this a param (s/_/-/)\nvar _DEFAULT_SOURCE_LANG$1 = 'en';\nvar _PLACEHOLDER_TAG$1 = 'ph';\nvar _PLACEHOLDER_SPANNING_TAG = 'pc';\nvar _XLIFF_TAG = 'xliff';\nvar _SOURCE_TAG$1 = 'source';\nvar _TARGET_TAG$1 = 'target';\nvar _UNIT_TAG$1 = 'unit';\nvar Xliff2 = (function (_super) {\n    __extends(Xliff2, _super);\n    function Xliff2() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} messages\n     * @param {?} locale\n     * @return {?}\n     */\n    Xliff2.prototype.write = function (messages, locale) {\n        var /** @type {?} */ visitor = new _WriteVisitor$1();\n        var /** @type {?} */ units = [];\n        messages.forEach(function (message) {\n            var /** @type {?} */ unit = new Tag(_UNIT_TAG$1, { id: message.id });\n            var /** @type {?} */ notes = new Tag('notes');\n            if (message.description || message.meaning) {\n                if (message.description) {\n                    notes.children.push(new CR(8), new Tag('note', { category: 'description' }, [new Text$2(message.description)]));\n                }\n                if (message.meaning) {\n                    notes.children.push(new CR(8), new Tag('note', { category: 'meaning' }, [new Text$2(message.meaning)]));\n                }\n            }\n            message.sources.forEach(function (source) {\n                notes.children.push(new CR(8), new Tag('note', { category: 'location' }, [\n                    new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n                ]));\n            });\n            notes.children.push(new CR(6));\n            unit.children.push(new CR(6), notes);\n            var /** @type {?} */ segment = new Tag('segment');\n            segment.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), new CR(6));\n            unit.children.push(new CR(6), segment, new CR(4));\n            units.push(new CR(4), unit);\n        });\n        var /** @type {?} */ file = new Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, units.concat([new CR(2)]));\n        var /** @type {?} */ xliff = new Tag(_XLIFF_TAG, { version: _VERSION$1, xmlns: _XMLNS$1, srcLang: locale || _DEFAULT_SOURCE_LANG$1 }, [new CR(2), file, new CR()]);\n        return serialize([\n            new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n        ]);\n    };\n    /**\n     * @param {?} content\n     * @param {?} url\n     * @return {?}\n     */\n    Xliff2.prototype.load = function (content, url) {\n        // xliff to xml nodes\n        var /** @type {?} */ xliff2Parser = new Xliff2Parser();\n        var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n        // xml nodes to i18n nodes\n        var /** @type {?} */ i18nNodesByMsgId = {};\n        var /** @type {?} */ converter = new XmlToI18n$1();\n        Object.keys(msgIdToHtml).forEach(function (msgId) {\n            var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n            errors.push.apply(errors, e);\n            i18nNodesByMsgId[msgId] = i18nNodes;\n        });\n        if (errors.length) {\n            throw new Error(\"xliff2 parse errors:\\n\" + errors.join('\\n'));\n        }\n        return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };\n    };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Xliff2.prototype.digest = function (message) { return decimalDigest(message); };\n    return Xliff2;\n}(Serializer));\nvar _WriteVisitor$1 = (function () {\n    function _WriteVisitor$1() {\n    }\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n    /**\n     * @param {?} container\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        var /** @type {?} */ nodes = [];\n        container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n        return nodes;\n    };\n    /**\n     * @param {?} icu\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n        Object.keys(icu.cases).forEach(function (c) {\n            nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n        });\n        nodes.push(new Text$2(\"}\"));\n        return nodes;\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.visitTagPlaceholder = function (ph, context) {\n        var _this = this;\n        var /** @type {?} */ type = getTypeForTag(ph.tag);\n        if (ph.isVoid) {\n            var /** @type {?} */ tagPh = new Tag(_PLACEHOLDER_TAG$1, {\n                id: (this._nextPlaceholderId++).toString(),\n                equiv: ph.startName,\n                type: type,\n                disp: \"<\" + ph.tag + \"/>\",\n            });\n            return [tagPh];\n        }\n        var /** @type {?} */ tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {\n            id: (this._nextPlaceholderId++).toString(),\n            equivStart: ph.startName,\n            equivEnd: ph.closeName,\n            type: type,\n            dispStart: \"<\" + ph.tag + \">\",\n            dispEnd: \"</\" + ph.tag + \">\",\n        });\n        var /** @type {?} */ nodes = [].concat.apply([], ph.children.map(function (node) { return node.visit(_this); }));\n        if (nodes.length) {\n            nodes.forEach(function (node) { return tagPc.children.push(node); });\n        }\n        else {\n            tagPc.children.push(new Text$2(''));\n        }\n        return [tagPc];\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.visitPlaceholder = function (ph, context) {\n        return [new Tag(_PLACEHOLDER_TAG$1, {\n                id: (this._nextPlaceholderId++).toString(),\n                equiv: ph.name,\n                disp: \"{{\" + ph.value + \"}}\",\n            })];\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.visitIcuPlaceholder = function (ph, context) {\n        return [new Tag(_PLACEHOLDER_TAG$1, { id: (this._nextPlaceholderId++).toString() })];\n    };\n    /**\n     * @param {?} nodes\n     * @return {?}\n     */\n    _WriteVisitor$1.prototype.serialize = function (nodes) {\n        var _this = this;\n        this._nextPlaceholderId = 0;\n        return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n    };\n    return _WriteVisitor$1;\n}());\nvar Xliff2Parser = (function () {\n    function Xliff2Parser() {\n        this._locale = null;\n    }\n    /**\n     * @param {?} xliff\n     * @param {?} url\n     * @return {?}\n     */\n    Xliff2Parser.prototype.parse = function (xliff, url) {\n        this._unitMlString = null;\n        this._msgIdToHtml = {};\n        var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n        this._errors = xml.errors;\n        visitAll(this, xml.rootNodes, null);\n        return {\n            msgIdToHtml: this._msgIdToHtml,\n            errors: this._errors,\n            locale: this._locale,\n        };\n    };\n    /**\n     * @param {?} element\n     * @param {?} context\n     * @return {?}\n     */\n    Xliff2Parser.prototype.visitElement = function (element, context) {\n        switch (element.name) {\n            case _UNIT_TAG$1:\n                this._unitMlString = null;\n                var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n                if (!idAttr) {\n                    this._addError(element, \"<\" + _UNIT_TAG$1 + \"> misses the \\\"id\\\" attribute\");\n                }\n                else {\n                    var /** @type {?} */ id = idAttr.value;\n                    if (this._msgIdToHtml.hasOwnProperty(id)) {\n                        this._addError(element, \"Duplicated translations for msg \" + id);\n                    }\n                    else {\n                        visitAll(this, element.children, null);\n                        if (typeof this._unitMlString === 'string') {\n                            this._msgIdToHtml[id] = this._unitMlString;\n                        }\n                        else {\n                            this._addError(element, \"Message \" + id + \" misses a translation\");\n                        }\n                    }\n                }\n                break;\n            case _SOURCE_TAG$1:\n                // ignore source message\n                break;\n            case _TARGET_TAG$1:\n                var /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n                var /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n                var /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n                var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n                this._unitMlString = innerText;\n                break;\n            case _XLIFF_TAG:\n                var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });\n                if (localeAttr) {\n                    this._locale = localeAttr.value;\n                }\n                var /** @type {?} */ versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });\n                if (versionAttr) {\n                    var /** @type {?} */ version = versionAttr.value;\n                    if (version !== '2.0') {\n                        this._addError(element, \"The XLIFF file version \" + version + \" is not compatible with XLIFF 2.0 serializer\");\n                    }\n                    else {\n                        visitAll(this, element.children, null);\n                    }\n                }\n                break;\n            default:\n                visitAll(this, element.children, null);\n        }\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    Xliff2Parser.prototype.visitAttribute = function (attribute, context) { };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    Xliff2Parser.prototype.visitText = function (text, context) { };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    Xliff2Parser.prototype.visitComment = function (comment, context) { };\n    /**\n     * @param {?} expansion\n     * @param {?} context\n     * @return {?}\n     */\n    Xliff2Parser.prototype.visitExpansion = function (expansion, context) { };\n    /**\n     * @param {?} expansionCase\n     * @param {?} context\n     * @return {?}\n     */\n    Xliff2Parser.prototype.visitExpansionCase = function (expansionCase, context) { };\n    /**\n     * @param {?} node\n     * @param {?} message\n     * @return {?}\n     */\n    Xliff2Parser.prototype._addError = function (node, message) {\n        this._errors.push(new I18nError(node.sourceSpan, message));\n    };\n    return Xliff2Parser;\n}());\nvar XmlToI18n$1 = (function () {\n    function XmlToI18n$1() {\n    }\n    /**\n     * @param {?} message\n     * @param {?} url\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.convert = function (message, url) {\n        var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n        this._errors = xmlIcu.errors;\n        var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n            [] : [].concat.apply([], visitAll(this, xmlIcu.rootNodes));\n        return {\n            i18nNodes: i18nNodes,\n            errors: this._errors,\n        };\n    };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };\n    /**\n     * @param {?} el\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.visitElement = function (el, context) {\n        var _this = this;\n        switch (el.name) {\n            case _PLACEHOLDER_TAG$1:\n                var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });\n                if (nameAttr) {\n                    return [new Placeholder('', nameAttr.value, el.sourceSpan)];\n                }\n                this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equiv\\\" attribute\");\n                break;\n            case _PLACEHOLDER_SPANNING_TAG:\n                var /** @type {?} */ startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });\n                var /** @type {?} */ endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });\n                if (!startAttr) {\n                    this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equivStart\\\" attribute\");\n                }\n                else if (!endAttr) {\n                    this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equivEnd\\\" attribute\");\n                }\n                else {\n                    var /** @type {?} */ startId = startAttr.value;\n                    var /** @type {?} */ endId = endAttr.value;\n                    var /** @type {?} */ nodes = [];\n                    return nodes.concat.apply(nodes, [new Placeholder('', startId, el.sourceSpan)].concat(el.children.map(function (node) { return node.visit(_this, null); }), [new Placeholder('', endId, el.sourceSpan)]));\n                }\n                break;\n            default:\n                this._addError(el, \"Unexpected tag\");\n        }\n        return null;\n    };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.visitExpansion = function (icu, context) {\n        var /** @type {?} */ caseMap = {};\n        visitAll(this, icu.cases).forEach(function (c) {\n            caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n        });\n        return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n    };\n    /**\n     * @param {?} icuCase\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.visitExpansionCase = function (icuCase, context) {\n        return {\n            value: icuCase.value,\n            nodes: [].concat.apply([], visitAll(this, icuCase.expression)),\n        };\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.visitComment = function (comment, context) { };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$1.prototype.visitAttribute = function (attribute, context) { };\n    /**\n     * @param {?} node\n     * @param {?} message\n     * @return {?}\n     */\n    XmlToI18n$1.prototype._addError = function (node, message) {\n        this._errors.push(new I18nError(node.sourceSpan, message));\n    };\n    return XmlToI18n$1;\n}());\n/**\n * @param {?} tag\n * @return {?}\n */\nfunction getTypeForTag(tag) {\n    switch (tag.toLowerCase()) {\n        case 'br':\n        case 'b':\n        case 'i':\n        case 'u':\n            return 'fmt';\n        case 'img':\n            return 'image';\n        case 'a':\n            return 'link';\n        default:\n            return 'other';\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _MESSAGES_TAG = 'messagebundle';\nvar _MESSAGE_TAG = 'msg';\nvar _PLACEHOLDER_TAG$2 = 'ph';\nvar _EXEMPLE_TAG = 'ex';\nvar _SOURCE_TAG$2 = 'source';\nvar _DOCTYPE = \"<!ELEMENT messagebundle (msg)*>\\n<!ATTLIST messagebundle class CDATA #IMPLIED>\\n\\n<!ELEMENT msg (#PCDATA|ph|source)*>\\n<!ATTLIST msg id CDATA #IMPLIED>\\n<!ATTLIST msg seq CDATA #IMPLIED>\\n<!ATTLIST msg name CDATA #IMPLIED>\\n<!ATTLIST msg desc CDATA #IMPLIED>\\n<!ATTLIST msg meaning CDATA #IMPLIED>\\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\\n<!ATTLIST msg xml:space (default|preserve) \\\"default\\\">\\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\\n\\n<!ELEMENT source (#PCDATA)>\\n\\n<!ELEMENT ph (#PCDATA|ex)*>\\n<!ATTLIST ph name CDATA #REQUIRED>\\n\\n<!ELEMENT ex (#PCDATA)>\";\nvar Xmb = (function (_super) {\n    __extends(Xmb, _super);\n    function Xmb() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} messages\n     * @param {?} locale\n     * @return {?}\n     */\n    Xmb.prototype.write = function (messages, locale) {\n        var /** @type {?} */ exampleVisitor = new ExampleVisitor();\n        var /** @type {?} */ visitor = new _Visitor$2();\n        var /** @type {?} */ rootNode = new Tag(_MESSAGES_TAG);\n        messages.forEach(function (message) {\n            var /** @type {?} */ attrs = { id: message.id };\n            if (message.description) {\n                attrs['desc'] = message.description;\n            }\n            if (message.meaning) {\n                attrs['meaning'] = message.meaning;\n            }\n            var /** @type {?} */ sourceTags = [];\n            message.sources.forEach(function (source) {\n                sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [\n                    new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n                ]));\n            });\n            rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, sourceTags.concat(visitor.serialize(message.nodes))));\n        });\n        rootNode.children.push(new CR());\n        return serialize([\n            new Declaration({ version: '1.0', encoding: 'UTF-8' }),\n            new CR(),\n            new Doctype(_MESSAGES_TAG, _DOCTYPE),\n            new CR(),\n            exampleVisitor.addDefaultExamples(rootNode),\n            new CR(),\n        ]);\n    };\n    /**\n     * @param {?} content\n     * @param {?} url\n     * @return {?}\n     */\n    Xmb.prototype.load = function (content, url) {\n        throw new Error('Unsupported');\n    };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Xmb.prototype.digest = function (message) { return digest$1(message); };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Xmb.prototype.createNameMapper = function (message) {\n        return new SimplePlaceholderMapper(message, toPublicName);\n    };\n    return Xmb;\n}(Serializer));\nvar _Visitor$2 = (function () {\n    function _Visitor$2() {\n    }\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    _Visitor$2.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n    /**\n     * @param {?} container\n     * @param {?} context\n     * @return {?}\n     */\n    _Visitor$2.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        var /** @type {?} */ nodes = [];\n        container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n        return nodes;\n    };\n    /**\n     * @param {?} icu\n     * @param {?=} context\n     * @return {?}\n     */\n    _Visitor$2.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n        Object.keys(icu.cases).forEach(function (c) {\n            nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n        });\n        nodes.push(new Text$2(\"}\"));\n        return nodes;\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _Visitor$2.prototype.visitTagPlaceholder = function (ph, context) {\n        var /** @type {?} */ startEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"<\" + ph.tag + \">\")]);\n        var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.startName }, [startEx]);\n        if (ph.isVoid) {\n            // void tags have no children nor closing tags\n            return [startTagPh];\n        }\n        var /** @type {?} */ closeEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"</\" + ph.tag + \">\")]);\n        var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.closeName }, [closeEx]);\n        return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _Visitor$2.prototype.visitPlaceholder = function (ph, context) {\n        return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name })];\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    _Visitor$2.prototype.visitIcuPlaceholder = function (ph, context) {\n        return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name })];\n    };\n    /**\n     * @param {?} nodes\n     * @return {?}\n     */\n    _Visitor$2.prototype.serialize = function (nodes) {\n        var _this = this;\n        return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n    };\n    return _Visitor$2;\n}());\n/**\n * @param {?} message\n * @return {?}\n */\nfunction digest$1(message) {\n    return decimalDigest(message);\n}\nvar ExampleVisitor = (function () {\n    function ExampleVisitor() {\n    }\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    ExampleVisitor.prototype.addDefaultExamples = function (node) {\n        node.visit(this);\n        return node;\n    };\n    /**\n     * @param {?} tag\n     * @return {?}\n     */\n    ExampleVisitor.prototype.visitTag = function (tag) {\n        var _this = this;\n        if (tag.name === _PLACEHOLDER_TAG$2) {\n            if (!tag.children || tag.children.length == 0) {\n                var /** @type {?} */ exText = new Text$2(tag.attrs['name'] || '...');\n                tag.children = [new Tag(_EXEMPLE_TAG, {}, [exText])];\n            }\n        }\n        else if (tag.children) {\n            tag.children.forEach(function (node) { return node.visit(_this); });\n        }\n    };\n    /**\n     * @param {?} text\n     * @return {?}\n     */\n    ExampleVisitor.prototype.visitText = function (text) { };\n    /**\n     * @param {?} decl\n     * @return {?}\n     */\n    ExampleVisitor.prototype.visitDeclaration = function (decl) { };\n    /**\n     * @param {?} doctype\n     * @return {?}\n     */\n    ExampleVisitor.prototype.visitDoctype = function (doctype) { };\n    return ExampleVisitor;\n}());\n/**\n * @param {?} internalName\n * @return {?}\n */\nfunction toPublicName(internalName) {\n    return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _TRANSLATIONS_TAG = 'translationbundle';\nvar _TRANSLATION_TAG = 'translation';\nvar _PLACEHOLDER_TAG$3 = 'ph';\nvar Xtb = (function (_super) {\n    __extends(Xtb, _super);\n    function Xtb() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} messages\n     * @param {?} locale\n     * @return {?}\n     */\n    Xtb.prototype.write = function (messages, locale) { throw new Error('Unsupported'); };\n    /**\n     * @param {?} content\n     * @param {?} url\n     * @return {?}\n     */\n    Xtb.prototype.load = function (content, url) {\n        // xtb to xml nodes\n        var /** @type {?} */ xtbParser = new XtbParser();\n        var _a = xtbParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n        // xml nodes to i18n nodes\n        var /** @type {?} */ i18nNodesByMsgId = {};\n        var /** @type {?} */ converter = new XmlToI18n$2();\n        // Because we should be able to load xtb files that rely on features not supported by angular,\n        // we need to delay the conversion of html to i18n nodes so that non angular messages are not\n        // converted\n        Object.keys(msgIdToHtml).forEach(function (msgId) {\n            var /** @type {?} */ valueFn = function () {\n                var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, errors = _a.errors;\n                if (errors.length) {\n                    throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n                }\n                return i18nNodes;\n            };\n            createLazyProperty(i18nNodesByMsgId, msgId, valueFn);\n        });\n        if (errors.length) {\n            throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n        }\n        return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };\n    };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Xtb.prototype.digest = function (message) { return digest$1(message); };\n    /**\n     * @param {?} message\n     * @return {?}\n     */\n    Xtb.prototype.createNameMapper = function (message) {\n        return new SimplePlaceholderMapper(message, toPublicName);\n    };\n    return Xtb;\n}(Serializer));\n/**\n * @param {?} messages\n * @param {?} id\n * @param {?} valueFn\n * @return {?}\n */\nfunction createLazyProperty(messages, id, valueFn) {\n    Object.defineProperty(messages, id, {\n        configurable: true,\n        enumerable: true,\n        get: function () {\n            var /** @type {?} */ value = valueFn();\n            Object.defineProperty(messages, id, { enumerable: true, value: value });\n            return value;\n        },\n        set: function (_) { throw new Error('Could not overwrite an XTB translation'); },\n    });\n}\nvar XtbParser = (function () {\n    function XtbParser() {\n        this._locale = null;\n    }\n    /**\n     * @param {?} xtb\n     * @param {?} url\n     * @return {?}\n     */\n    XtbParser.prototype.parse = function (xtb, url) {\n        this._bundleDepth = 0;\n        this._msgIdToHtml = {};\n        // We can not parse the ICU messages at this point as some messages might not originate\n        // from Angular that could not be lex'd.\n        var /** @type {?} */ xml = new XmlParser().parse(xtb, url, false);\n        this._errors = xml.errors;\n        visitAll(this, xml.rootNodes);\n        return {\n            msgIdToHtml: this._msgIdToHtml,\n            errors: this._errors,\n            locale: this._locale,\n        };\n    };\n    /**\n     * @param {?} element\n     * @param {?} context\n     * @return {?}\n     */\n    XtbParser.prototype.visitElement = function (element, context) {\n        switch (element.name) {\n            case _TRANSLATIONS_TAG:\n                this._bundleDepth++;\n                if (this._bundleDepth > 1) {\n                    this._addError(element, \"<\" + _TRANSLATIONS_TAG + \"> elements can not be nested\");\n                }\n                var /** @type {?} */ langAttr = element.attrs.find(function (attr) { return attr.name === 'lang'; });\n                if (langAttr) {\n                    this._locale = langAttr.value;\n                }\n                visitAll(this, element.children, null);\n                this._bundleDepth--;\n                break;\n            case _TRANSLATION_TAG:\n                var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n                if (!idAttr) {\n                    this._addError(element, \"<\" + _TRANSLATION_TAG + \"> misses the \\\"id\\\" attribute\");\n                }\n                else {\n                    var /** @type {?} */ id = idAttr.value;\n                    if (this._msgIdToHtml.hasOwnProperty(id)) {\n                        this._addError(element, \"Duplicated translations for msg \" + id);\n                    }\n                    else {\n                        var /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n                        var /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n                        var /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n                        var /** @type {?} */ innerText = content.slice(/** @type {?} */ ((innerTextStart)), /** @type {?} */ ((innerTextEnd)));\n                        this._msgIdToHtml[id] = innerText;\n                    }\n                }\n                break;\n            default:\n                this._addError(element, 'Unexpected tag');\n        }\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    XtbParser.prototype.visitAttribute = function (attribute, context) { };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    XtbParser.prototype.visitText = function (text, context) { };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    XtbParser.prototype.visitComment = function (comment, context) { };\n    /**\n     * @param {?} expansion\n     * @param {?} context\n     * @return {?}\n     */\n    XtbParser.prototype.visitExpansion = function (expansion, context) { };\n    /**\n     * @param {?} expansionCase\n     * @param {?} context\n     * @return {?}\n     */\n    XtbParser.prototype.visitExpansionCase = function (expansionCase, context) { };\n    /**\n     * @param {?} node\n     * @param {?} message\n     * @return {?}\n     */\n    XtbParser.prototype._addError = function (node, message) {\n        this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n    };\n    return XtbParser;\n}());\nvar XmlToI18n$2 = (function () {\n    function XmlToI18n$2() {\n    }\n    /**\n     * @param {?} message\n     * @param {?} url\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.convert = function (message, url) {\n        var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n        this._errors = xmlIcu.errors;\n        var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n            [] :\n            visitAll(this, xmlIcu.rootNodes);\n        return {\n            i18nNodes: i18nNodes,\n            errors: this._errors,\n        };\n    };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.visitText = function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.visitExpansion = function (icu, context) {\n        var /** @type {?} */ caseMap = {};\n        visitAll(this, icu.cases).forEach(function (c) {\n            caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n        });\n        return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n    };\n    /**\n     * @param {?} icuCase\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.visitExpansionCase = function (icuCase, context) {\n        return {\n            value: icuCase.value,\n            nodes: visitAll(this, icuCase.expression),\n        };\n    };\n    /**\n     * @param {?} el\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.visitElement = function (el, context) {\n        if (el.name === _PLACEHOLDER_TAG$3) {\n            var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'name'; });\n            if (nameAttr) {\n                return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n            }\n            this._addError(el, \"<\" + _PLACEHOLDER_TAG$3 + \"> misses the \\\"name\\\" attribute\");\n        }\n        else {\n            this._addError(el, \"Unexpected tag\");\n        }\n        return null;\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.visitComment = function (comment, context) { };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    XmlToI18n$2.prototype.visitAttribute = function (attribute, context) { };\n    /**\n     * @param {?} node\n     * @param {?} message\n     * @return {?}\n     */\n    XmlToI18n$2.prototype._addError = function (node, message) {\n        this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n    };\n    return XmlToI18n$2;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar HtmlParser = (function (_super) {\n    __extends(HtmlParser, _super);\n    function HtmlParser() {\n        return _super.call(this, getHtmlTagDefinition) || this;\n    }\n    /**\n     * @param {?} source\n     * @param {?} url\n     * @param {?=} parseExpansionForms\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    HtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n        if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);\n    };\n    return HtmlParser;\n}(Parser$1));\nHtmlParser.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nHtmlParser.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A container for translated messages\n */\nvar TranslationBundle = (function () {\n    /**\n     * @param {?=} _i18nNodesByMsgId\n     * @param {?=} locale\n     * @param {?=} digest\n     * @param {?=} mapperFactory\n     * @param {?=} missingTranslationStrategy\n     * @param {?=} console\n     */\n    function TranslationBundle(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console) {\n        if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n        if (missingTranslationStrategy === void 0) { missingTranslationStrategy = _angular_core.MissingTranslationStrategy.Warning; }\n        this._i18nNodesByMsgId = _i18nNodesByMsgId;\n        this.digest = digest;\n        this.mapperFactory = mapperFactory;\n        this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console);\n    }\n    /**\n     * @param {?} content\n     * @param {?} url\n     * @param {?} serializer\n     * @param {?} missingTranslationStrategy\n     * @param {?=} console\n     * @return {?}\n     */\n    TranslationBundle.load = function (content, url, serializer, missingTranslationStrategy, console) {\n        var _a = serializer.load(content, url), locale = _a.locale, i18nNodesByMsgId = _a.i18nNodesByMsgId;\n        var /** @type {?} */ digestFn = function (m) { return serializer.digest(m); };\n        var /** @type {?} */ mapperFactory = function (m) { return ((serializer.createNameMapper(m))); };\n        return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);\n    };\n    /**\n     * @param {?} srcMsg\n     * @return {?}\n     */\n    TranslationBundle.prototype.get = function (srcMsg) {\n        var /** @type {?} */ html = this._i18nToHtml.convert(srcMsg);\n        if (html.errors.length) {\n            throw new Error(html.errors.join('\\n'));\n        }\n        return html.nodes;\n    };\n    /**\n     * @param {?} srcMsg\n     * @return {?}\n     */\n    TranslationBundle.prototype.has = function (srcMsg) { return this.digest(srcMsg) in this._i18nNodesByMsgId; };\n    return TranslationBundle;\n}());\nvar I18nToHtmlVisitor = (function () {\n    /**\n     * @param {?=} _i18nNodesByMsgId\n     * @param {?=} _locale\n     * @param {?=} _digest\n     * @param {?=} _mapperFactory\n     * @param {?=} _missingTranslationStrategy\n     * @param {?=} _console\n     */\n    function I18nToHtmlVisitor(_i18nNodesByMsgId, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {\n        if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n        this._i18nNodesByMsgId = _i18nNodesByMsgId;\n        this._locale = _locale;\n        this._digest = _digest;\n        this._mapperFactory = _mapperFactory;\n        this._missingTranslationStrategy = _missingTranslationStrategy;\n        this._console = _console;\n        this._contextStack = [];\n        this._errors = [];\n    }\n    /**\n     * @param {?} srcMsg\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.convert = function (srcMsg) {\n        this._contextStack.length = 0;\n        this._errors.length = 0;\n        // i18n to text\n        var /** @type {?} */ text = this._convertToText(srcMsg);\n        // text to html\n        var /** @type {?} */ url = srcMsg.nodes[0].sourceSpan.start.file.url;\n        var /** @type {?} */ html = new HtmlParser().parse(text, url, true);\n        return {\n            nodes: html.rootNodes,\n            errors: this._errors.concat(html.errors),\n        };\n    };\n    /**\n     * @param {?} text\n     * @param {?=} context\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.visitText = function (text, context) { return text.value; };\n    /**\n     * @param {?} container\n     * @param {?=} context\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.visitContainer = function (container, context) {\n        var _this = this;\n        return container.children.map(function (n) { return n.visit(_this); }).join('');\n    };\n    /**\n     * @param {?} icu\n     * @param {?=} context\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.visitIcu = function (icu, context) {\n        var _this = this;\n        var /** @type {?} */ cases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n        // TODO(vicb): Once all format switch to using expression placeholders\n        // we should throw when the placeholder is not in the source message\n        var /** @type {?} */ exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ?\n            this._srcMsg.placeholders[icu.expression] :\n            icu.expression;\n        return \"{\" + exp + \", \" + icu.type + \", \" + cases.join(' ') + \"}\";\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.visitPlaceholder = function (ph, context) {\n        var /** @type {?} */ phName = this._mapper(ph.name);\n        if (this._srcMsg.placeholders.hasOwnProperty(phName)) {\n            return this._srcMsg.placeholders[phName];\n        }\n        if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {\n            return this._convertToText(this._srcMsg.placeholderToMessage[phName]);\n        }\n        this._addError(ph, \"Unknown placeholder \\\"\" + ph.name + \"\\\"\");\n        return '';\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n        var _this = this;\n        var /** @type {?} */ tag = \"\" + ph.tag;\n        var /** @type {?} */ attrs = Object.keys(ph.attrs).map(function (name) { return name + \"=\\\"\" + ph.attrs[name] + \"\\\"\"; }).join(' ');\n        if (ph.isVoid) {\n            return \"<\" + tag + \" \" + attrs + \"/>\";\n        }\n        var /** @type {?} */ children = ph.children.map(function (c) { return c.visit(_this); }).join('');\n        return \"<\" + tag + \" \" + attrs + \">\" + children + \"</\" + tag + \">\";\n    };\n    /**\n     * @param {?} ph\n     * @param {?=} context\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n        // An ICU placeholder references the source message to be serialized\n        return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);\n    };\n    /**\n     * Convert a source message to a translated text string:\n     * - text nodes are replaced with their translation,\n     * - placeholders are replaced with their content,\n     * - ICU nodes are converted to ICU expressions.\n     * @param {?} srcMsg\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype._convertToText = function (srcMsg) {\n        var _this = this;\n        var /** @type {?} */ id = this._digest(srcMsg);\n        var /** @type {?} */ mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;\n        var /** @type {?} */ nodes;\n        this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });\n        this._srcMsg = srcMsg;\n        if (this._i18nNodesByMsgId.hasOwnProperty(id)) {\n            // When there is a translation use its nodes as the source\n            // And create a mapper to convert serialized placeholder names to internal names\n            nodes = this._i18nNodesByMsgId[id];\n            this._mapper = function (name) { return mapper ? ((mapper.toInternalName(name))) : name; };\n        }\n        else {\n            // When no translation has been found\n            // - report an error / a warning / nothing,\n            // - use the nodes from the original message\n            // - placeholders are already internal and need no mapper\n            if (this._missingTranslationStrategy === _angular_core.MissingTranslationStrategy.Error) {\n                var /** @type {?} */ ctx = this._locale ? \" for locale \\\"\" + this._locale + \"\\\"\" : '';\n                this._addError(srcMsg.nodes[0], \"Missing translation for message \\\"\" + id + \"\\\"\" + ctx);\n            }\n            else if (this._console &&\n                this._missingTranslationStrategy === _angular_core.MissingTranslationStrategy.Warning) {\n                var /** @type {?} */ ctx = this._locale ? \" for locale \\\"\" + this._locale + \"\\\"\" : '';\n                this._console.warn(\"Missing translation for message \\\"\" + id + \"\\\"\" + ctx);\n            }\n            nodes = srcMsg.nodes;\n            this._mapper = function (name) { return name; };\n        }\n        var /** @type {?} */ text = nodes.map(function (node) { return node.visit(_this); }).join('');\n        var /** @type {?} */ context = ((this._contextStack.pop()));\n        this._srcMsg = context.msg;\n        this._mapper = context.mapper;\n        return text;\n    };\n    /**\n     * @param {?} el\n     * @param {?} msg\n     * @return {?}\n     */\n    I18nToHtmlVisitor.prototype._addError = function (el, msg) {\n        this._errors.push(new I18nError(el.sourceSpan, msg));\n    };\n    return I18nToHtmlVisitor;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar I18NHtmlParser = (function () {\n    /**\n     * @param {?} _htmlParser\n     * @param {?=} translations\n     * @param {?=} translationsFormat\n     * @param {?=} missingTranslation\n     * @param {?=} console\n     */\n    function I18NHtmlParser(_htmlParser, translations, translationsFormat, missingTranslation, console) {\n        if (missingTranslation === void 0) { missingTranslation = _angular_core.MissingTranslationStrategy.Warning; }\n        this._htmlParser = _htmlParser;\n        if (translations) {\n            var serializer = createSerializer(translationsFormat);\n            this._translationBundle =\n                TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console);\n        }\n    }\n    /**\n     * @param {?} source\n     * @param {?} url\n     * @param {?=} parseExpansionForms\n     * @param {?=} interpolationConfig\n     * @return {?}\n     */\n    I18NHtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n        if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n        if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n        var /** @type {?} */ parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);\n        if (!this._translationBundle) {\n            // Do not enable i18n when no translation bundle is provided\n            return parseResult;\n        }\n        if (parseResult.errors.length) {\n            return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);\n        }\n        return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});\n    };\n    return I18NHtmlParser;\n}());\n/**\n * @param {?=} format\n * @return {?}\n */\nfunction createSerializer(format) {\n    format = (format || 'xlf').toLowerCase();\n    switch (format) {\n        case 'xmb':\n            return new Xmb();\n        case 'xtb':\n            return new Xtb();\n        case 'xliff2':\n        case 'xlf2':\n            return new Xliff2();\n        case 'xliff':\n        case 'xlf':\n        default:\n            return new Xliff();\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar CORE = '@angular/core';\nvar Identifiers = (function () {\n    function Identifiers() {\n    }\n    return Identifiers;\n}());\nIdentifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {\n    name: 'ANALYZE_FOR_ENTRY_COMPONENTS',\n    moduleName: CORE,\n    runtime: _angular_core.ANALYZE_FOR_ENTRY_COMPONENTS\n};\nIdentifiers.ElementRef = { name: 'ElementRef', moduleName: CORE, runtime: _angular_core.ElementRef };\nIdentifiers.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE, runtime: _angular_core.NgModuleRef };\nIdentifiers.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE, runtime: _angular_core.ViewContainerRef };\nIdentifiers.ChangeDetectorRef = {\n    name: 'ChangeDetectorRef',\n    moduleName: CORE,\n    runtime: _angular_core.ChangeDetectorRef\n};\nIdentifiers.QueryList = { name: 'QueryList', moduleName: CORE, runtime: _angular_core.QueryList };\nIdentifiers.TemplateRef = { name: 'TemplateRef', moduleName: CORE, runtime: _angular_core.TemplateRef };\nIdentifiers.CodegenComponentFactoryResolver = {\n    name: 'ɵCodegenComponentFactoryResolver',\n    moduleName: CORE,\n    runtime: _angular_core.ɵCodegenComponentFactoryResolver\n};\nIdentifiers.ComponentFactoryResolver = {\n    name: 'ComponentFactoryResolver',\n    moduleName: CORE,\n    runtime: _angular_core.ComponentFactoryResolver\n};\nIdentifiers.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE, runtime: _angular_core.ComponentFactory };\nIdentifiers.ComponentRef = { name: 'ComponentRef', moduleName: CORE, runtime: _angular_core.ComponentRef };\nIdentifiers.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE, runtime: _angular_core.NgModuleFactory };\nIdentifiers.createModuleFactory = {\n    name: 'ɵcmf',\n    moduleName: CORE,\n    runtime: _angular_core.ɵcmf,\n};\nIdentifiers.moduleDef = {\n    name: 'ɵmod',\n    moduleName: CORE,\n    runtime: _angular_core.ɵmod,\n};\nIdentifiers.moduleProviderDef = {\n    name: 'ɵmpd',\n    moduleName: CORE,\n    runtime: _angular_core.ɵmpd,\n};\nIdentifiers.RegisterModuleFactoryFn = {\n    name: 'ɵregisterModuleFactory',\n    moduleName: CORE,\n    runtime: _angular_core.ɵregisterModuleFactory,\n};\nIdentifiers.Injector = { name: 'Injector', moduleName: CORE, runtime: _angular_core.Injector };\nIdentifiers.ViewEncapsulation = {\n    name: 'ViewEncapsulation',\n    moduleName: CORE,\n    runtime: _angular_core.ViewEncapsulation\n};\nIdentifiers.ChangeDetectionStrategy = {\n    name: 'ChangeDetectionStrategy',\n    moduleName: CORE,\n    runtime: _angular_core.ChangeDetectionStrategy\n};\nIdentifiers.SecurityContext = {\n    name: 'SecurityContext',\n    moduleName: CORE,\n    runtime: _angular_core.SecurityContext,\n};\nIdentifiers.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE, runtime: _angular_core.LOCALE_ID };\nIdentifiers.TRANSLATIONS_FORMAT = {\n    name: 'TRANSLATIONS_FORMAT',\n    moduleName: CORE,\n    runtime: _angular_core.TRANSLATIONS_FORMAT\n};\nIdentifiers.inlineInterpolate = {\n    name: 'ɵinlineInterpolate',\n    moduleName: CORE,\n    runtime: _angular_core.ɵinlineInterpolate\n};\nIdentifiers.interpolate = { name: 'ɵinterpolate', moduleName: CORE, runtime: _angular_core.ɵinterpolate };\nIdentifiers.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE, runtime: _angular_core.ɵEMPTY_ARRAY };\nIdentifiers.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE, runtime: _angular_core.ɵEMPTY_MAP };\nIdentifiers.Renderer = { name: 'Renderer', moduleName: CORE, runtime: _angular_core.Renderer };\nIdentifiers.viewDef = { name: 'ɵvid', moduleName: CORE, runtime: _angular_core.ɵvid };\nIdentifiers.elementDef = { name: 'ɵeld', moduleName: CORE, runtime: _angular_core.ɵeld };\nIdentifiers.anchorDef = { name: 'ɵand', moduleName: CORE, runtime: _angular_core.ɵand };\nIdentifiers.textDef = { name: 'ɵted', moduleName: CORE, runtime: _angular_core.ɵted };\nIdentifiers.directiveDef = { name: 'ɵdid', moduleName: CORE, runtime: _angular_core.ɵdid };\nIdentifiers.providerDef = { name: 'ɵprd', moduleName: CORE, runtime: _angular_core.ɵprd };\nIdentifiers.queryDef = { name: 'ɵqud', moduleName: CORE, runtime: _angular_core.ɵqud };\nIdentifiers.pureArrayDef = { name: 'ɵpad', moduleName: CORE, runtime: _angular_core.ɵpad };\nIdentifiers.pureObjectDef = { name: 'ɵpod', moduleName: CORE, runtime: _angular_core.ɵpod };\nIdentifiers.purePipeDef = { name: 'ɵppd', moduleName: CORE, runtime: _angular_core.ɵppd };\nIdentifiers.pipeDef = { name: 'ɵpid', moduleName: CORE, runtime: _angular_core.ɵpid };\nIdentifiers.nodeValue = { name: 'ɵnov', moduleName: CORE, runtime: _angular_core.ɵnov };\nIdentifiers.ngContentDef = { name: 'ɵncd', moduleName: CORE, runtime: _angular_core.ɵncd };\nIdentifiers.unwrapValue = { name: 'ɵunv', moduleName: CORE, runtime: _angular_core.ɵunv };\nIdentifiers.createRendererType2 = { name: 'ɵcrt', moduleName: CORE, runtime: _angular_core.ɵcrt };\nIdentifiers.RendererType2 = {\n    name: 'RendererType2',\n    moduleName: CORE,\n    // type only\n    runtime: null\n};\nIdentifiers.ViewDefinition = {\n    name: 'ɵViewDefinition',\n    moduleName: CORE,\n    // type only\n    runtime: null\n};\nIdentifiers.createComponentFactory = { name: 'ɵccf', moduleName: CORE, runtime: _angular_core.ɵccf };\n/**\n * @param {?} reference\n * @return {?}\n */\nfunction createTokenForReference(reference) {\n    return { identifier: { reference: reference } };\n}\n/**\n * @param {?} reflector\n * @param {?} reference\n * @return {?}\n */\nfunction createTokenForExternalReference(reflector, reference) {\n    return createTokenForReference(reflector.resolveExternalReference(reference));\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// http://cldr.unicode.org/index/cldr-spec/plural-rules\nvar PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n/**\n * Expands special forms into elements.\n *\n * For example,\n *\n * ```\n * { messages.length, plural,\n *   =0 {zero}\n *   =1 {one}\n *   other {more than one}\n * }\n * ```\n *\n * will be expanded into\n *\n * ```\n * <ng-container [ngPlural]=\"messages.length\">\n *   <ng-template ngPluralCase=\"=0\">zero</ng-template>\n *   <ng-template ngPluralCase=\"=1\">one</ng-template>\n *   <ng-template ngPluralCase=\"other\">more than one</ng-template>\n * </ng-container>\n * ```\n * @param {?} nodes\n * @return {?}\n */\nfunction expandNodes(nodes) {\n    var /** @type {?} */ expander = new _Expander();\n    return new ExpansionResult(visitAll(expander, nodes), expander.isExpanded, expander.errors);\n}\nvar ExpansionResult = (function () {\n    /**\n     * @param {?} nodes\n     * @param {?} expanded\n     * @param {?} errors\n     */\n    function ExpansionResult(nodes, expanded, errors) {\n        this.nodes = nodes;\n        this.expanded = expanded;\n        this.errors = errors;\n    }\n    return ExpansionResult;\n}());\nvar ExpansionError = (function (_super) {\n    __extends(ExpansionError, _super);\n    /**\n     * @param {?} span\n     * @param {?} errorMsg\n     */\n    function ExpansionError(span, errorMsg) {\n        return _super.call(this, span, errorMsg) || this;\n    }\n    return ExpansionError;\n}(ParseError));\n/**\n * Expand expansion forms (plural, select) to directives\n *\n * \\@internal\n */\nvar _Expander = (function () {\n    function _Expander() {\n        this.isExpanded = false;\n        this.errors = [];\n    }\n    /**\n     * @param {?} element\n     * @param {?} context\n     * @return {?}\n     */\n    _Expander.prototype.visitElement = function (element, context) {\n        return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    _Expander.prototype.visitAttribute = function (attribute, context) { return attribute; };\n    /**\n     * @param {?} text\n     * @param {?} context\n     * @return {?}\n     */\n    _Expander.prototype.visitText = function (text, context) { return text; };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    _Expander.prototype.visitComment = function (comment, context) { return comment; };\n    /**\n     * @param {?} icu\n     * @param {?} context\n     * @return {?}\n     */\n    _Expander.prototype.visitExpansion = function (icu, context) {\n        this.isExpanded = true;\n        return icu.type == 'plural' ? _expandPluralForm(icu, this.errors) :\n            _expandDefaultForm(icu, this.errors);\n    };\n    /**\n     * @param {?} icuCase\n     * @param {?} context\n     * @return {?}\n     */\n    _Expander.prototype.visitExpansionCase = function (icuCase, context) {\n        throw new Error('Should not be reached');\n    };\n    return _Expander;\n}());\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandPluralForm(ast, errors) {\n    var /** @type {?} */ children = ast.cases.map(function (c) {\n        if (PLURAL_CASES.indexOf(c.value) == -1 && !c.value.match(/^=\\d+$/)) {\n            errors.push(new ExpansionError(c.valueSourceSpan, \"Plural cases should be \\\"=<number>\\\" or one of \" + PLURAL_CASES.join(\", \")));\n        }\n        var /** @type {?} */ expansionResult = expandNodes(c.expression);\n        errors.push.apply(errors, expansionResult.errors);\n        return new Element(\"ng-template\", [new Attribute$1('ngPluralCase', \"\" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n    });\n    var /** @type {?} */ switchAttr = new Attribute$1('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan);\n    return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandDefaultForm(ast, errors) {\n    var /** @type {?} */ children = ast.cases.map(function (c) {\n        var /** @type {?} */ expansionResult = expandNodes(c.expression);\n        errors.push.apply(errors, expansionResult.errors);\n        if (c.value === 'other') {\n            // other is the default case when no values match\n            return new Element(\"ng-template\", [new Attribute$1('ngSwitchDefault', '', c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n        }\n        return new Element(\"ng-template\", [new Attribute$1('ngSwitchCase', \"\" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n    });\n    var /** @type {?} */ switchAttr = new Attribute$1('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan);\n    return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ProviderError = (function (_super) {\n    __extends(ProviderError, _super);\n    /**\n     * @param {?} message\n     * @param {?} span\n     */\n    function ProviderError(message, span) {\n        return _super.call(this, span, message) || this;\n    }\n    return ProviderError;\n}(ParseError));\nvar ProviderViewContext = (function () {\n    /**\n     * @param {?} reflector\n     * @param {?} component\n     */\n    function ProviderViewContext(reflector, component) {\n        var _this = this;\n        this.reflector = reflector;\n        this.component = component;\n        this.errors = [];\n        this.viewQueries = _getViewQueries(component);\n        this.viewProviders = new Map();\n        component.viewProviders.forEach(function (provider) {\n            if (_this.viewProviders.get(tokenReference(provider.token)) == null) {\n                _this.viewProviders.set(tokenReference(provider.token), true);\n            }\n        });\n    }\n    return ProviderViewContext;\n}());\nvar ProviderElementContext = (function () {\n    /**\n     * @param {?} viewContext\n     * @param {?} _parent\n     * @param {?} _isViewRoot\n     * @param {?} _directiveAsts\n     * @param {?} attrs\n     * @param {?} refs\n     * @param {?} isTemplate\n     * @param {?} contentQueryStartId\n     * @param {?} _sourceSpan\n     */\n    function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {\n        var _this = this;\n        this.viewContext = viewContext;\n        this._parent = _parent;\n        this._isViewRoot = _isViewRoot;\n        this._directiveAsts = _directiveAsts;\n        this._sourceSpan = _sourceSpan;\n        this._transformedProviders = new Map();\n        this._seenProviders = new Map();\n        this._hasViewContainer = false;\n        this._queriedTokens = new Map();\n        this._attrs = {};\n        attrs.forEach(function (attrAst) { return _this._attrs[attrAst.name] = attrAst.value; });\n        var directivesMeta = _directiveAsts.map(function (directiveAst) { return directiveAst.directive; });\n        this._allProviders =\n            _resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);\n        this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);\n        Array.from(this._allProviders.values()).forEach(function (provider) {\n            _this._addQueryReadsTo(provider.token, provider.token, _this._queriedTokens);\n        });\n        if (isTemplate) {\n            var templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers.TemplateRef);\n            this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);\n        }\n        refs.forEach(function (refAst) {\n            var defaultQueryValue = refAst.value ||\n                createTokenForExternalReference(_this.viewContext.reflector, Identifiers.ElementRef);\n            _this._addQueryReadsTo({ value: refAst.name }, defaultQueryValue, _this._queriedTokens);\n        });\n        if (this._queriedTokens.get(this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef))) {\n            this._hasViewContainer = true;\n        }\n        // create the providers that we know are eager first\n        Array.from(this._allProviders.values()).forEach(function (provider) {\n            var eager = provider.eager || _this._queriedTokens.get(tokenReference(provider.token));\n            if (eager) {\n                _this._getOrCreateLocalProvider(provider.providerType, provider.token, true);\n            }\n        });\n    }\n    /**\n     * @return {?}\n     */\n    ProviderElementContext.prototype.afterElement = function () {\n        var _this = this;\n        // collect lazy providers\n        Array.from(this._allProviders.values()).forEach(function (provider) {\n            _this._getOrCreateLocalProvider(provider.providerType, provider.token, false);\n        });\n    };\n    Object.defineProperty(ProviderElementContext.prototype, \"transformProviders\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            // Note: Maps keep their insertion order.\n            var /** @type {?} */ lazyProviders = [];\n            var /** @type {?} */ eagerProviders = [];\n            this._transformedProviders.forEach(function (provider) {\n                if (provider.eager) {\n                    eagerProviders.push(provider);\n                }\n                else {\n                    lazyProviders.push(provider);\n                }\n            });\n            return lazyProviders.concat(eagerProviders);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ProviderElementContext.prototype, \"transformedDirectiveAsts\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ sortedProviderTypes = this.transformProviders.map(function (provider) { return provider.token.identifier; });\n            var /** @type {?} */ sortedDirectives = this._directiveAsts.slice();\n            sortedDirectives.sort(function (dir1, dir2) { return sortedProviderTypes.indexOf(dir1.directive.type) -\n                sortedProviderTypes.indexOf(dir2.directive.type); });\n            return sortedDirectives;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ProviderElementContext.prototype, \"transformedHasViewContainer\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._hasViewContainer; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ProviderElementContext.prototype, \"queryMatches\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            var /** @type {?} */ allMatches = [];\n            this._queriedTokens.forEach(function (matches) { allMatches.push.apply(allMatches, matches); });\n            return allMatches;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} token\n     * @param {?} defaultValue\n     * @param {?} queryReadTokens\n     * @return {?}\n     */\n    ProviderElementContext.prototype._addQueryReadsTo = function (token, defaultValue, queryReadTokens) {\n        this._getQueriesFor(token).forEach(function (query) {\n            var /** @type {?} */ queryValue = query.meta.read || defaultValue;\n            var /** @type {?} */ tokenRef = tokenReference(queryValue);\n            var /** @type {?} */ queryMatches = queryReadTokens.get(tokenRef);\n            if (!queryMatches) {\n                queryMatches = [];\n                queryReadTokens.set(tokenRef, queryMatches);\n            }\n            queryMatches.push({ queryId: query.queryId, value: queryValue });\n        });\n    };\n    /**\n     * @param {?} token\n     * @return {?}\n     */\n    ProviderElementContext.prototype._getQueriesFor = function (token) {\n        var /** @type {?} */ result = [];\n        var /** @type {?} */ currentEl = this;\n        var /** @type {?} */ distance = 0;\n        var /** @type {?} */ queries;\n        while (currentEl !== null) {\n            queries = currentEl._contentQueries.get(tokenReference(token));\n            if (queries) {\n                result.push.apply(result, queries.filter(function (query) { return query.meta.descendants || distance <= 1; }));\n            }\n            if (currentEl._directiveAsts.length > 0) {\n                distance++;\n            }\n            currentEl = currentEl._parent;\n        }\n        queries = this.viewContext.viewQueries.get(tokenReference(token));\n        if (queries) {\n            result.push.apply(result, queries);\n        }\n        return result;\n    };\n    /**\n     * @param {?} requestingProviderType\n     * @param {?} token\n     * @param {?} eager\n     * @return {?}\n     */\n    ProviderElementContext.prototype._getOrCreateLocalProvider = function (requestingProviderType, token, eager) {\n        var _this = this;\n        var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n        if (!resolvedProvider || ((requestingProviderType === ProviderAstType.Directive ||\n            requestingProviderType === ProviderAstType.PublicService) &&\n            resolvedProvider.providerType === ProviderAstType.PrivateService) ||\n            ((requestingProviderType === ProviderAstType.PrivateService ||\n                requestingProviderType === ProviderAstType.PublicService) &&\n                resolvedProvider.providerType === ProviderAstType.Builtin)) {\n            return null;\n        }\n        var /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n        if (transformedProviderAst) {\n            return transformedProviderAst;\n        }\n        if (this._seenProviders.get(tokenReference(token)) != null) {\n            this.viewContext.errors.push(new ProviderError(\"Cannot instantiate cyclic dependency! \" + tokenName(token), this._sourceSpan));\n            return null;\n        }\n        this._seenProviders.set(tokenReference(token), true);\n        var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {\n            var /** @type {?} */ transformedUseValue = provider.useValue;\n            var /** @type {?} */ transformedUseExisting = ((provider.useExisting));\n            var /** @type {?} */ transformedDeps = ((undefined));\n            if (provider.useExisting != null) {\n                var /** @type {?} */ existingDiDep = ((_this._getDependency(resolvedProvider.providerType, { token: provider.useExisting }, eager)));\n                if (existingDiDep.token != null) {\n                    transformedUseExisting = existingDiDep.token;\n                }\n                else {\n                    transformedUseExisting = ((null));\n                    transformedUseValue = existingDiDep.value;\n                }\n            }\n            else if (provider.useFactory) {\n                var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n                transformedDeps =\n                    deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });\n            }\n            else if (provider.useClass) {\n                var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n                transformedDeps =\n                    deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });\n            }\n            return _transformProvider(provider, {\n                useExisting: transformedUseExisting,\n                useValue: transformedUseValue,\n                deps: transformedDeps\n            });\n        });\n        transformedProviderAst =\n            _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n        this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n        return transformedProviderAst;\n    };\n    /**\n     * @param {?} requestingProviderType\n     * @param {?} dep\n     * @param {?=} eager\n     * @return {?}\n     */\n    ProviderElementContext.prototype._getLocalDependency = function (requestingProviderType, dep, eager) {\n        if (eager === void 0) { eager = false; }\n        if (dep.isAttribute) {\n            var /** @type {?} */ attrValue = this._attrs[((dep.token)).value];\n            return { isValue: true, value: attrValue == null ? null : attrValue };\n        }\n        if (dep.token != null) {\n            // access builtints\n            if ((requestingProviderType === ProviderAstType.Directive ||\n                requestingProviderType === ProviderAstType.Component)) {\n                if (tokenReference(dep.token) ===\n                    this.viewContext.reflector.resolveExternalReference(Identifiers.Renderer) ||\n                    tokenReference(dep.token) ===\n                        this.viewContext.reflector.resolveExternalReference(Identifiers.ElementRef) ||\n                    tokenReference(dep.token) ===\n                        this.viewContext.reflector.resolveExternalReference(Identifiers.ChangeDetectorRef) ||\n                    tokenReference(dep.token) ===\n                        this.viewContext.reflector.resolveExternalReference(Identifiers.TemplateRef)) {\n                    return dep;\n                }\n                if (tokenReference(dep.token) ===\n                    this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {\n                    this._hasViewContainer = true;\n                }\n            }\n            // access the injector\n            if (tokenReference(dep.token) ===\n                this.viewContext.reflector.resolveExternalReference(Identifiers.Injector)) {\n                return dep;\n            }\n            // access providers\n            if (this._getOrCreateLocalProvider(requestingProviderType, dep.token, eager) != null) {\n                return dep;\n            }\n        }\n        return null;\n    };\n    /**\n     * @param {?} requestingProviderType\n     * @param {?} dep\n     * @param {?=} eager\n     * @return {?}\n     */\n    ProviderElementContext.prototype._getDependency = function (requestingProviderType, dep, eager) {\n        if (eager === void 0) { eager = false; }\n        var /** @type {?} */ currElement = this;\n        var /** @type {?} */ currEager = eager;\n        var /** @type {?} */ result = null;\n        if (!dep.isSkipSelf) {\n            result = this._getLocalDependency(requestingProviderType, dep, eager);\n        }\n        if (dep.isSelf) {\n            if (!result && dep.isOptional) {\n                result = { isValue: true, value: null };\n            }\n        }\n        else {\n            // check parent elements\n            while (!result && currElement._parent) {\n                var /** @type {?} */ prevElement = currElement;\n                currElement = currElement._parent;\n                if (prevElement._isViewRoot) {\n                    currEager = false;\n                }\n                result = currElement._getLocalDependency(ProviderAstType.PublicService, dep, currEager);\n            }\n            // check @Host restriction\n            if (!result) {\n                if (!dep.isHost || this.viewContext.component.isHost ||\n                    this.viewContext.component.type.reference === tokenReference(/** @type {?} */ ((dep.token))) ||\n                    this.viewContext.viewProviders.get(tokenReference(/** @type {?} */ ((dep.token)))) != null) {\n                    result = dep;\n                }\n                else {\n                    result = dep.isOptional ? result = { isValue: true, value: null } : null;\n                }\n            }\n        }\n        if (!result) {\n            this.viewContext.errors.push(new ProviderError(\"No provider for \" + tokenName(/** @type {?} */ ((dep.token))), this._sourceSpan));\n        }\n        return result;\n    };\n    return ProviderElementContext;\n}());\nvar NgModuleProviderAnalyzer = (function () {\n    /**\n     * @param {?} reflector\n     * @param {?} ngModule\n     * @param {?} extraProviders\n     * @param {?} sourceSpan\n     */\n    function NgModuleProviderAnalyzer(reflector, ngModule, extraProviders, sourceSpan) {\n        var _this = this;\n        this.reflector = reflector;\n        this._transformedProviders = new Map();\n        this._seenProviders = new Map();\n        this._errors = [];\n        this._allProviders = new Map();\n        ngModule.transitiveModule.modules.forEach(function (ngModuleType) {\n            var ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };\n            _resolveProviders([ngModuleProvider], ProviderAstType.PublicService, true, sourceSpan, _this._errors, _this._allProviders);\n        });\n        _resolveProviders(ngModule.transitiveModule.providers.map(function (entry) { return entry.provider; }).concat(extraProviders), ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders);\n    }\n    /**\n     * @return {?}\n     */\n    NgModuleProviderAnalyzer.prototype.parse = function () {\n        var _this = this;\n        Array.from(this._allProviders.values()).forEach(function (provider) {\n            _this._getOrCreateLocalProvider(provider.token, provider.eager);\n        });\n        if (this._errors.length > 0) {\n            var /** @type {?} */ errorString = this._errors.join('\\n');\n            throw new Error(\"Provider parse errors:\\n\" + errorString);\n        }\n        // Note: Maps keep their insertion order.\n        var /** @type {?} */ lazyProviders = [];\n        var /** @type {?} */ eagerProviders = [];\n        this._transformedProviders.forEach(function (provider) {\n            if (provider.eager) {\n                eagerProviders.push(provider);\n            }\n            else {\n                lazyProviders.push(provider);\n            }\n        });\n        return lazyProviders.concat(eagerProviders);\n    };\n    /**\n     * @param {?} token\n     * @param {?} eager\n     * @return {?}\n     */\n    NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider = function (token, eager) {\n        var _this = this;\n        var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n        if (!resolvedProvider) {\n            return null;\n        }\n        var /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n        if (transformedProviderAst) {\n            return transformedProviderAst;\n        }\n        if (this._seenProviders.get(tokenReference(token)) != null) {\n            this._errors.push(new ProviderError(\"Cannot instantiate cyclic dependency! \" + tokenName(token), resolvedProvider.sourceSpan));\n            return null;\n        }\n        this._seenProviders.set(tokenReference(token), true);\n        var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {\n            var /** @type {?} */ transformedUseValue = provider.useValue;\n            var /** @type {?} */ transformedUseExisting = ((provider.useExisting));\n            var /** @type {?} */ transformedDeps = ((undefined));\n            if (provider.useExisting != null) {\n                var /** @type {?} */ existingDiDep = _this._getDependency({ token: provider.useExisting }, eager, resolvedProvider.sourceSpan);\n                if (existingDiDep.token != null) {\n                    transformedUseExisting = existingDiDep.token;\n                }\n                else {\n                    transformedUseExisting = ((null));\n                    transformedUseValue = existingDiDep.value;\n                }\n            }\n            else if (provider.useFactory) {\n                var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n                transformedDeps =\n                    deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n            }\n            else if (provider.useClass) {\n                var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n                transformedDeps =\n                    deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n            }\n            return _transformProvider(provider, {\n                useExisting: transformedUseExisting,\n                useValue: transformedUseValue,\n                deps: transformedDeps\n            });\n        });\n        transformedProviderAst =\n            _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n        this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n        return transformedProviderAst;\n    };\n    /**\n     * @param {?} dep\n     * @param {?=} eager\n     * @param {?=} requestorSourceSpan\n     * @return {?}\n     */\n    NgModuleProviderAnalyzer.prototype._getDependency = function (dep, eager, requestorSourceSpan) {\n        if (eager === void 0) { eager = false; }\n        var /** @type {?} */ foundLocal = false;\n        if (!dep.isSkipSelf && dep.token != null) {\n            // access the injector\n            if (tokenReference(dep.token) ===\n                this.reflector.resolveExternalReference(Identifiers.Injector) ||\n                tokenReference(dep.token) ===\n                    this.reflector.resolveExternalReference(Identifiers.ComponentFactoryResolver)) {\n                foundLocal = true;\n                // access providers\n            }\n            else if (this._getOrCreateLocalProvider(dep.token, eager) != null) {\n                foundLocal = true;\n            }\n        }\n        var /** @type {?} */ result = dep;\n        if (dep.isSelf && !foundLocal) {\n            if (dep.isOptional) {\n                result = { isValue: true, value: null };\n            }\n            else {\n                this._errors.push(new ProviderError(\"No provider for \" + tokenName(/** @type {?} */ ((dep.token))), requestorSourceSpan));\n            }\n        }\n        return result;\n    };\n    return NgModuleProviderAnalyzer;\n}());\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProvider(provider, _a) {\n    var useExisting = _a.useExisting, useValue = _a.useValue, deps = _a.deps;\n    return {\n        token: provider.token,\n        useClass: provider.useClass,\n        useExisting: useExisting,\n        useFactory: provider.useFactory,\n        useValue: useValue,\n        deps: deps,\n        multi: provider.multi\n    };\n}\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProviderAst(provider, _a) {\n    var eager = _a.eager, providers = _a.providers;\n    return new ProviderAst(provider.token, provider.multiProvider, provider.eager || eager, providers, provider.providerType, provider.lifecycleHooks, provider.sourceSpan);\n}\n/**\n * @param {?} directives\n * @param {?} sourceSpan\n * @param {?} targetErrors\n * @return {?}\n */\nfunction _resolveProvidersFromDirectives(directives, sourceSpan, targetErrors) {\n    var /** @type {?} */ providersByToken = new Map();\n    directives.forEach(function (directive) {\n        var /** @type {?} */ dirProvider = { token: { identifier: directive.type }, useClass: directive.type };\n        _resolveProviders([dirProvider], directive.isComponent ? ProviderAstType.Component : ProviderAstType.Directive, true, sourceSpan, targetErrors, providersByToken);\n    });\n    // Note: directives need to be able to overwrite providers of a component!\n    var /** @type {?} */ directivesWithComponentFirst = directives.filter(function (dir) { return dir.isComponent; }).concat(directives.filter(function (dir) { return !dir.isComponent; }));\n    directivesWithComponentFirst.forEach(function (directive) {\n        _resolveProviders(directive.providers, ProviderAstType.PublicService, false, sourceSpan, targetErrors, providersByToken);\n        _resolveProviders(directive.viewProviders, ProviderAstType.PrivateService, false, sourceSpan, targetErrors, providersByToken);\n    });\n    return providersByToken;\n}\n/**\n * @param {?} providers\n * @param {?} providerType\n * @param {?} eager\n * @param {?} sourceSpan\n * @param {?} targetErrors\n * @param {?} targetProvidersByToken\n * @return {?}\n */\nfunction _resolveProviders(providers, providerType, eager, sourceSpan, targetErrors, targetProvidersByToken) {\n    providers.forEach(function (provider) {\n        var /** @type {?} */ resolvedProvider = targetProvidersByToken.get(tokenReference(provider.token));\n        if (resolvedProvider != null && !!resolvedProvider.multiProvider !== !!provider.multi) {\n            targetErrors.push(new ProviderError(\"Mixing multi and non multi provider is not possible for token \" + tokenName(resolvedProvider.token), sourceSpan));\n        }\n        if (!resolvedProvider) {\n            var /** @type {?} */ lifecycleHooks = provider.token.identifier &&\n                ((provider.token.identifier)).lifecycleHooks ?\n                ((provider.token.identifier)).lifecycleHooks :\n                [];\n            var /** @type {?} */ isUseValue = !(provider.useClass || provider.useExisting || provider.useFactory);\n            resolvedProvider = new ProviderAst(provider.token, !!provider.multi, eager || isUseValue, [provider], providerType, lifecycleHooks, sourceSpan);\n            targetProvidersByToken.set(tokenReference(provider.token), resolvedProvider);\n        }\n        else {\n            if (!provider.multi) {\n                resolvedProvider.providers.length = 0;\n            }\n            resolvedProvider.providers.push(provider);\n        }\n    });\n}\n/**\n * @param {?} component\n * @return {?}\n */\nfunction _getViewQueries(component) {\n    // Note: queries start with id 1 so we can use the number in a Bloom filter!\n    var /** @type {?} */ viewQueryId = 1;\n    var /** @type {?} */ viewQueries = new Map();\n    if (component.viewQueries) {\n        component.viewQueries.forEach(function (query) { return _addQueryToTokenMap(viewQueries, { meta: query, queryId: viewQueryId++ }); });\n    }\n    return viewQueries;\n}\n/**\n * @param {?} contentQueryStartId\n * @param {?} directives\n * @return {?}\n */\nfunction _getContentQueries(contentQueryStartId, directives) {\n    var /** @type {?} */ contentQueryId = contentQueryStartId;\n    var /** @type {?} */ contentQueries = new Map();\n    directives.forEach(function (directive, directiveIndex) {\n        if (directive.queries) {\n            directive.queries.forEach(function (query) { return _addQueryToTokenMap(contentQueries, { meta: query, queryId: contentQueryId++ }); });\n        }\n    });\n    return contentQueries;\n}\n/**\n * @param {?} map\n * @param {?} query\n * @return {?}\n */\nfunction _addQueryToTokenMap(map, query) {\n    query.meta.selectors.forEach(function (token) {\n        var /** @type {?} */ entry = map.get(tokenReference(token));\n        if (!entry) {\n            entry = [];\n            map.set(tokenReference(token), entry);\n        }\n        entry.push(query);\n    });\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @abstract\n */\nvar ElementSchemaRegistry = (function () {\n    function ElementSchemaRegistry() {\n    }\n    /**\n     * @abstract\n     * @param {?} tagName\n     * @param {?} propName\n     * @param {?} schemaMetas\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.hasProperty = function (tagName, propName, schemaMetas) { };\n    /**\n     * @abstract\n     * @param {?} tagName\n     * @param {?} schemaMetas\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.hasElement = function (tagName, schemaMetas) { };\n    /**\n     * @abstract\n     * @param {?} elementName\n     * @param {?} propName\n     * @param {?} isAttribute\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.securityContext = function (elementName, propName, isAttribute) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.allKnownElementNames = function () { };\n    /**\n     * @abstract\n     * @param {?} propName\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.getMappedPropName = function (propName) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.getDefaultComponentElementName = function () { };\n    /**\n     * @abstract\n     * @param {?} name\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.validateProperty = function (name) { };\n    /**\n     * @abstract\n     * @param {?} name\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.validateAttribute = function (name) { };\n    /**\n     * @abstract\n     * @param {?} propName\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = function (propName) { };\n    /**\n     * @abstract\n     * @param {?} camelCaseProp\n     * @param {?} userProvidedProp\n     * @param {?} val\n     * @return {?}\n     */\n    ElementSchemaRegistry.prototype.normalizeAnimationStyleValue = function (camelCaseProp, userProvidedProp, val) { };\n    return ElementSchemaRegistry;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar StyleWithImports = (function () {\n    /**\n     * @param {?} style\n     * @param {?} styleUrls\n     */\n    function StyleWithImports(style$$1, styleUrls) {\n        this.style = style$$1;\n        this.styleUrls = styleUrls;\n    }\n    return StyleWithImports;\n}());\n/**\n * @param {?} url\n * @return {?}\n */\nfunction isStyleUrlResolvable(url) {\n    if (url == null || url.length === 0 || url[0] == '/')\n        return false;\n    var /** @type {?} */ schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);\n    return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';\n}\n/**\n * Rewrites stylesheets by resolving and removing the \\@import urls that\n * are either relative or don't have a `package:` scheme\n * @param {?} resolver\n * @param {?} baseUrl\n * @param {?} cssText\n * @return {?}\n */\nfunction extractStyleUrls(resolver, baseUrl, cssText) {\n    var /** @type {?} */ foundUrls = [];\n    var /** @type {?} */ modifiedCssText = cssText.replace(CSS_COMMENT_REGEXP, '').replace(CSS_IMPORT_REGEXP, function () {\n        var m = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            m[_i] = arguments[_i];\n        }\n        var /** @type {?} */ url = m[1] || m[2];\n        if (!isStyleUrlResolvable(url)) {\n            // Do not attempt to resolve non-package absolute URLs with URI scheme\n            return m[0];\n        }\n        foundUrls.push(resolver.resolve(baseUrl, url));\n        return '';\n    });\n    return new StyleWithImports(modifiedCssText, foundUrls);\n}\nvar CSS_IMPORT_REGEXP = /@import\\s+(?:url\\()?\\s*(?:(?:['\"]([^'\"]*))|([^;\\)\\s]*))[^;]*;?/g;\nvar CSS_COMMENT_REGEXP = /\\/\\*.+?\\*\\//g;\nvar URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar PROPERTY_PARTS_SEPARATOR = '.';\nvar ATTRIBUTE_PREFIX = 'attr';\nvar CLASS_PREFIX = 'class';\nvar STYLE_PREFIX = 'style';\nvar ANIMATE_PROP_PREFIX = 'animate-';\nvar BoundPropertyType = {};\nBoundPropertyType.DEFAULT = 0;\nBoundPropertyType.LITERAL_ATTR = 1;\nBoundPropertyType.ANIMATION = 2;\nBoundPropertyType[BoundPropertyType.DEFAULT] = \"DEFAULT\";\nBoundPropertyType[BoundPropertyType.LITERAL_ATTR] = \"LITERAL_ATTR\";\nBoundPropertyType[BoundPropertyType.ANIMATION] = \"ANIMATION\";\n/**\n * Represents a parsed property.\n */\nvar BoundProperty = (function () {\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} type\n     * @param {?} sourceSpan\n     */\n    function BoundProperty(name, expression, type, sourceSpan) {\n        this.name = name;\n        this.expression = expression;\n        this.type = type;\n        this.sourceSpan = sourceSpan;\n    }\n    Object.defineProperty(BoundProperty.prototype, \"isLiteral\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.type === BoundPropertyType.LITERAL_ATTR; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BoundProperty.prototype, \"isAnimation\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.type === BoundPropertyType.ANIMATION; },\n        enumerable: true,\n        configurable: true\n    });\n    return BoundProperty;\n}());\n/**\n * Parses bindings in templates and in the directive host area.\n */\nvar BindingParser = (function () {\n    /**\n     * @param {?} _exprParser\n     * @param {?} _interpolationConfig\n     * @param {?} _schemaRegistry\n     * @param {?} pipes\n     * @param {?} _targetErrors\n     */\n    function BindingParser(_exprParser, _interpolationConfig, _schemaRegistry, pipes, _targetErrors) {\n        var _this = this;\n        this._exprParser = _exprParser;\n        this._interpolationConfig = _interpolationConfig;\n        this._schemaRegistry = _schemaRegistry;\n        this._targetErrors = _targetErrors;\n        this.pipesByName = new Map();\n        this._usedPipes = new Map();\n        pipes.forEach(function (pipe) { return _this.pipesByName.set(pipe.name, pipe); });\n    }\n    /**\n     * @return {?}\n     */\n    BindingParser.prototype.getUsedPipes = function () { return Array.from(this._usedPipes.values()); };\n    /**\n     * @param {?} dirMeta\n     * @param {?} elementSelector\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype.createDirectiveHostPropertyAsts = function (dirMeta, elementSelector, sourceSpan) {\n        var _this = this;\n        if (dirMeta.hostProperties) {\n            var /** @type {?} */ boundProps_1 = [];\n            Object.keys(dirMeta.hostProperties).forEach(function (propName) {\n                var /** @type {?} */ expression = dirMeta.hostProperties[propName];\n                if (typeof expression === 'string') {\n                    _this.parsePropertyBinding(propName, expression, true, sourceSpan, [], boundProps_1);\n                }\n                else {\n                    _this._reportError(\"Value of the host property binding \\\"\" + propName + \"\\\" needs to be a string representing an expression but got \\\"\" + expression + \"\\\" (\" + typeof expression + \")\", sourceSpan);\n                }\n            });\n            return boundProps_1.map(function (prop) { return _this.createElementPropertyAst(elementSelector, prop); });\n        }\n        return null;\n    };\n    /**\n     * @param {?} dirMeta\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype.createDirectiveHostEventAsts = function (dirMeta, sourceSpan) {\n        var _this = this;\n        if (dirMeta.hostListeners) {\n            var /** @type {?} */ targetEventAsts_1 = [];\n            Object.keys(dirMeta.hostListeners).forEach(function (propName) {\n                var /** @type {?} */ expression = dirMeta.hostListeners[propName];\n                if (typeof expression === 'string') {\n                    _this.parseEvent(propName, expression, sourceSpan, [], targetEventAsts_1);\n                }\n                else {\n                    _this._reportError(\"Value of the host listener \\\"\" + propName + \"\\\" needs to be a string representing an expression but got \\\"\" + expression + \"\\\" (\" + typeof expression + \")\", sourceSpan);\n                }\n            });\n            return targetEventAsts_1;\n        }\n        return null;\n    };\n    /**\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype.parseInterpolation = function (value, sourceSpan) {\n        var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n        try {\n            var /** @type {?} */ ast = ((this._exprParser.parseInterpolation(value, sourceInfo, this._interpolationConfig)));\n            if (ast)\n                this._reportExpressionParserErrors(ast.errors, sourceSpan);\n            this._checkPipes(ast, sourceSpan);\n            return ast;\n        }\n        catch (e) {\n            this._reportError(\"\" + e, sourceSpan);\n            return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n        }\n    };\n    /**\n     * @param {?} prefixToken\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @param {?} targetVars\n     * @return {?}\n     */\n    BindingParser.prototype.parseInlineTemplateBinding = function (prefixToken, value, sourceSpan, targetMatchableAttrs, targetProps, targetVars) {\n        var /** @type {?} */ bindings = this._parseTemplateBindings(prefixToken, value, sourceSpan);\n        for (var /** @type {?} */ i = 0; i < bindings.length; i++) {\n            var /** @type {?} */ binding = bindings[i];\n            if (binding.keyIsVar) {\n                targetVars.push(new VariableAst(binding.key, binding.name, sourceSpan));\n            }\n            else if (binding.expression) {\n                this._parsePropertyAst(binding.key, binding.expression, sourceSpan, targetMatchableAttrs, targetProps);\n            }\n            else {\n                targetMatchableAttrs.push([binding.key, '']);\n                this.parseLiteralAttr(binding.key, null, sourceSpan, targetMatchableAttrs, targetProps);\n            }\n        }\n    };\n    /**\n     * @param {?} prefixToken\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype._parseTemplateBindings = function (prefixToken, value, sourceSpan) {\n        var _this = this;\n        var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n        try {\n            var /** @type {?} */ bindingsResult = this._exprParser.parseTemplateBindings(prefixToken, value, sourceInfo);\n            this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);\n            bindingsResult.templateBindings.forEach(function (binding) {\n                if (binding.expression) {\n                    _this._checkPipes(binding.expression, sourceSpan);\n                }\n            });\n            bindingsResult.warnings.forEach(function (warning) { _this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING); });\n            return bindingsResult.templateBindings;\n        }\n        catch (e) {\n            this._reportError(\"\" + e, sourceSpan);\n            return [];\n        }\n    };\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @return {?}\n     */\n    BindingParser.prototype.parseLiteralAttr = function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n        if (_isAnimationLabel(name)) {\n            name = name.substring(1);\n            if (value) {\n                this._reportError(\"Assigning animation triggers via @prop=\\\"exp\\\" attributes with an expression is invalid.\" +\n                    \" Use property bindings (e.g. [@prop]=\\\"exp\\\") or use an attribute without a value (e.g. @prop) instead.\", sourceSpan, ParseErrorLevel.ERROR);\n            }\n            this._parseAnimation(name, value, sourceSpan, targetMatchableAttrs, targetProps);\n        }\n        else {\n            targetProps.push(new BoundProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), BoundPropertyType.LITERAL_ATTR, sourceSpan));\n        }\n    };\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} isHost\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @return {?}\n     */\n    BindingParser.prototype.parsePropertyBinding = function (name, expression, isHost, sourceSpan, targetMatchableAttrs, targetProps) {\n        var /** @type {?} */ isAnimationProp = false;\n        if (name.startsWith(ANIMATE_PROP_PREFIX)) {\n            isAnimationProp = true;\n            name = name.substring(ANIMATE_PROP_PREFIX.length);\n        }\n        else if (_isAnimationLabel(name)) {\n            isAnimationProp = true;\n            name = name.substring(1);\n        }\n        if (isAnimationProp) {\n            this._parseAnimation(name, expression, sourceSpan, targetMatchableAttrs, targetProps);\n        }\n        else {\n            this._parsePropertyAst(name, this._parseBinding(expression, isHost, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps);\n        }\n    };\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @return {?}\n     */\n    BindingParser.prototype.parsePropertyInterpolation = function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n        var /** @type {?} */ expr = this.parseInterpolation(value, sourceSpan);\n        if (expr) {\n            this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps);\n            return true;\n        }\n        return false;\n    };\n    /**\n     * @param {?} name\n     * @param {?} ast\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @return {?}\n     */\n    BindingParser.prototype._parsePropertyAst = function (name, ast, sourceSpan, targetMatchableAttrs, targetProps) {\n        targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);\n        targetProps.push(new BoundProperty(name, ast, BoundPropertyType.DEFAULT, sourceSpan));\n    };\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @return {?}\n     */\n    BindingParser.prototype._parseAnimation = function (name, expression, sourceSpan, targetMatchableAttrs, targetProps) {\n        // This will occur when a @trigger is not paired with an expression.\n        // For animations it is valid to not have an expression since */void\n        // states will be applied by angular when the element is attached/detached\n        var /** @type {?} */ ast = this._parseBinding(expression || 'null', false, sourceSpan);\n        targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);\n        targetProps.push(new BoundProperty(name, ast, BoundPropertyType.ANIMATION, sourceSpan));\n    };\n    /**\n     * @param {?} value\n     * @param {?} isHostBinding\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype._parseBinding = function (value, isHostBinding, sourceSpan) {\n        var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n        try {\n            var /** @type {?} */ ast = isHostBinding ?\n                this._exprParser.parseSimpleBinding(value, sourceInfo, this._interpolationConfig) :\n                this._exprParser.parseBinding(value, sourceInfo, this._interpolationConfig);\n            if (ast)\n                this._reportExpressionParserErrors(ast.errors, sourceSpan);\n            this._checkPipes(ast, sourceSpan);\n            return ast;\n        }\n        catch (e) {\n            this._reportError(\"\" + e, sourceSpan);\n            return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n        }\n    };\n    /**\n     * @param {?} elementSelector\n     * @param {?} boundProp\n     * @return {?}\n     */\n    BindingParser.prototype.createElementPropertyAst = function (elementSelector, boundProp) {\n        if (boundProp.isAnimation) {\n            return new BoundElementPropertyAst(boundProp.name, PropertyBindingType.Animation, _angular_core.SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan);\n        }\n        var /** @type {?} */ unit = null;\n        var /** @type {?} */ bindingType = ((undefined));\n        var /** @type {?} */ boundPropertyName = null;\n        var /** @type {?} */ parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);\n        var /** @type {?} */ securityContexts = ((undefined));\n        // Check check for special cases (prefix style, attr, class)\n        if (parts.length > 1) {\n            if (parts[0] == ATTRIBUTE_PREFIX) {\n                boundPropertyName = parts[1];\n                this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);\n                securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);\n                var /** @type {?} */ nsSeparatorIdx = boundPropertyName.indexOf(':');\n                if (nsSeparatorIdx > -1) {\n                    var /** @type {?} */ ns = boundPropertyName.substring(0, nsSeparatorIdx);\n                    var /** @type {?} */ name = boundPropertyName.substring(nsSeparatorIdx + 1);\n                    boundPropertyName = mergeNsAndName(ns, name);\n                }\n                bindingType = PropertyBindingType.Attribute;\n            }\n            else if (parts[0] == CLASS_PREFIX) {\n                boundPropertyName = parts[1];\n                bindingType = PropertyBindingType.Class;\n                securityContexts = [_angular_core.SecurityContext.NONE];\n            }\n            else if (parts[0] == STYLE_PREFIX) {\n                unit = parts.length > 2 ? parts[2] : null;\n                boundPropertyName = parts[1];\n                bindingType = PropertyBindingType.Style;\n                securityContexts = [_angular_core.SecurityContext.STYLE];\n            }\n        }\n        // If not a special case, use the full property name\n        if (boundPropertyName === null) {\n            boundPropertyName = this._schemaRegistry.getMappedPropName(boundProp.name);\n            securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, false);\n            bindingType = PropertyBindingType.Property;\n            this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, false);\n        }\n        return new BoundElementPropertyAst(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan);\n    };\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetEvents\n     * @return {?}\n     */\n    BindingParser.prototype.parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n        if (_isAnimationLabel(name)) {\n            name = name.substr(1);\n            this._parseAnimationEvent(name, expression, sourceSpan, targetEvents);\n        }\n        else {\n            this._parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents);\n        }\n    };\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} sourceSpan\n     * @param {?} targetEvents\n     * @return {?}\n     */\n    BindingParser.prototype._parseAnimationEvent = function (name, expression, sourceSpan, targetEvents) {\n        var /** @type {?} */ matches = splitAtPeriod(name, [name, '']);\n        var /** @type {?} */ eventName = matches[0];\n        var /** @type {?} */ phase = matches[1].toLowerCase();\n        if (phase) {\n            switch (phase) {\n                case 'start':\n                case 'done':\n                    var /** @type {?} */ ast = this._parseAction(expression, sourceSpan);\n                    targetEvents.push(new BoundEventAst(eventName, null, phase, ast, sourceSpan));\n                    break;\n                default:\n                    this._reportError(\"The provided animation output phase value \\\"\" + phase + \"\\\" for \\\"@\" + eventName + \"\\\" is not supported (use start or done)\", sourceSpan);\n                    break;\n            }\n        }\n        else {\n            this._reportError(\"The animation trigger output event (@\" + eventName + \") is missing its phase value name (start or done are currently supported)\", sourceSpan);\n        }\n    };\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetEvents\n     * @return {?}\n     */\n    BindingParser.prototype._parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n        // long format: 'target: eventName'\n        var _a = splitAtColon(name, [/** @type {?} */ ((null)), name]), target = _a[0], eventName = _a[1];\n        var /** @type {?} */ ast = this._parseAction(expression, sourceSpan);\n        targetMatchableAttrs.push([/** @type {?} */ ((name)), /** @type {?} */ ((ast.source))]);\n        targetEvents.push(new BoundEventAst(eventName, target, null, ast, sourceSpan));\n        // Don't detect directives for event names for now,\n        // so don't add the event name to the matchableAttrs\n    };\n    /**\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype._parseAction = function (value, sourceSpan) {\n        var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n        try {\n            var /** @type {?} */ ast = this._exprParser.parseAction(value, sourceInfo, this._interpolationConfig);\n            if (ast) {\n                this._reportExpressionParserErrors(ast.errors, sourceSpan);\n            }\n            if (!ast || ast.ast instanceof EmptyExpr) {\n                this._reportError(\"Empty expressions are not allowed\", sourceSpan);\n                return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n            }\n            this._checkPipes(ast, sourceSpan);\n            return ast;\n        }\n        catch (e) {\n            this._reportError(\"\" + e, sourceSpan);\n            return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n        }\n    };\n    /**\n     * @param {?} message\n     * @param {?} sourceSpan\n     * @param {?=} level\n     * @return {?}\n     */\n    BindingParser.prototype._reportError = function (message, sourceSpan, level) {\n        if (level === void 0) { level = ParseErrorLevel.ERROR; }\n        this._targetErrors.push(new ParseError(sourceSpan, message, level));\n    };\n    /**\n     * @param {?} errors\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype._reportExpressionParserErrors = function (errors, sourceSpan) {\n        for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\n            var error = errors_1[_i];\n            this._reportError(error.message, sourceSpan);\n        }\n    };\n    /**\n     * @param {?} ast\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    BindingParser.prototype._checkPipes = function (ast, sourceSpan) {\n        var _this = this;\n        if (ast) {\n            var /** @type {?} */ collector = new PipeCollector();\n            ast.visit(collector);\n            collector.pipes.forEach(function (ast, pipeName) {\n                var /** @type {?} */ pipeMeta = _this.pipesByName.get(pipeName);\n                if (!pipeMeta) {\n                    _this._reportError(\"The pipe '\" + pipeName + \"' could not be found\", new ParseSourceSpan(sourceSpan.start.moveBy(ast.span.start), sourceSpan.start.moveBy(ast.span.end)));\n                }\n                else {\n                    _this._usedPipes.set(pipeName, pipeMeta);\n                }\n            });\n        }\n    };\n    /**\n     * @param {?} propName the name of the property / attribute\n     * @param {?} sourceSpan\n     * @param {?} isAttr true when binding to an attribute\n     * @return {?}\n     */\n    BindingParser.prototype._validatePropertyOrAttributeName = function (propName, sourceSpan, isAttr) {\n        var /** @type {?} */ report = isAttr ? this._schemaRegistry.validateAttribute(propName) :\n            this._schemaRegistry.validateProperty(propName);\n        if (report.error) {\n            this._reportError(/** @type {?} */ ((report.msg)), sourceSpan, ParseErrorLevel.ERROR);\n        }\n    };\n    return BindingParser;\n}());\nvar PipeCollector = (function (_super) {\n    __extends(PipeCollector, _super);\n    function PipeCollector() {\n        var _this = _super.apply(this, arguments) || this;\n        _this.pipes = new Map();\n        return _this;\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    PipeCollector.prototype.visitPipe = function (ast, context) {\n        this.pipes.set(ast.name, ast);\n        ast.exp.visit(this);\n        this.visitAll(ast.args, context);\n        return null;\n    };\n    return PipeCollector;\n}(RecursiveAstVisitor));\n/**\n * @param {?} name\n * @return {?}\n */\nfunction _isAnimationLabel(name) {\n    return name[0] == '@';\n}\n/**\n * @param {?} registry\n * @param {?} selector\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\nfunction calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {\n    var /** @type {?} */ ctxs = [];\n    CssSelector.parse(selector).forEach(function (selector) {\n        var /** @type {?} */ elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();\n        var /** @type {?} */ notElementNames = new Set(selector.notSelectors.filter(function (selector) { return selector.isElementSelector(); })\n            .map(function (selector) { return selector.element; }));\n        var /** @type {?} */ possibleElementNames = elementNames.filter(function (elementName) { return !notElementNames.has(elementName); });\n        ctxs.push.apply(ctxs, possibleElementNames.map(function (elementName) { return registry.securityContext(elementName, propName, isAttribute); }));\n    });\n    return ctxs.length === 0 ? [_angular_core.SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar NG_CONTENT_SELECT_ATTR = 'select';\nvar LINK_ELEMENT = 'link';\nvar LINK_STYLE_REL_ATTR = 'rel';\nvar LINK_STYLE_HREF_ATTR = 'href';\nvar LINK_STYLE_REL_VALUE = 'stylesheet';\nvar STYLE_ELEMENT = 'style';\nvar SCRIPT_ELEMENT = 'script';\nvar NG_NON_BINDABLE_ATTR = 'ngNonBindable';\nvar NG_PROJECT_AS = 'ngProjectAs';\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction preparseElement(ast) {\n    var /** @type {?} */ selectAttr = ((null));\n    var /** @type {?} */ hrefAttr = ((null));\n    var /** @type {?} */ relAttr = ((null));\n    var /** @type {?} */ nonBindable = false;\n    var /** @type {?} */ projectAs = ((null));\n    ast.attrs.forEach(function (attr) {\n        var /** @type {?} */ lcAttrName = attr.name.toLowerCase();\n        if (lcAttrName == NG_CONTENT_SELECT_ATTR) {\n            selectAttr = attr.value;\n        }\n        else if (lcAttrName == LINK_STYLE_HREF_ATTR) {\n            hrefAttr = attr.value;\n        }\n        else if (lcAttrName == LINK_STYLE_REL_ATTR) {\n            relAttr = attr.value;\n        }\n        else if (attr.name == NG_NON_BINDABLE_ATTR) {\n            nonBindable = true;\n        }\n        else if (attr.name == NG_PROJECT_AS) {\n            if (attr.value.length > 0) {\n                projectAs = attr.value;\n            }\n        }\n    });\n    selectAttr = normalizeNgContentSelect(selectAttr);\n    var /** @type {?} */ nodeName = ast.name.toLowerCase();\n    var /** @type {?} */ type = PreparsedElementType.OTHER;\n    if (isNgContent(nodeName)) {\n        type = PreparsedElementType.NG_CONTENT;\n    }\n    else if (nodeName == STYLE_ELEMENT) {\n        type = PreparsedElementType.STYLE;\n    }\n    else if (nodeName == SCRIPT_ELEMENT) {\n        type = PreparsedElementType.SCRIPT;\n    }\n    else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {\n        type = PreparsedElementType.STYLESHEET;\n    }\n    return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);\n}\nvar PreparsedElementType = {};\nPreparsedElementType.NG_CONTENT = 0;\nPreparsedElementType.STYLE = 1;\nPreparsedElementType.STYLESHEET = 2;\nPreparsedElementType.SCRIPT = 3;\nPreparsedElementType.OTHER = 4;\nPreparsedElementType[PreparsedElementType.NG_CONTENT] = \"NG_CONTENT\";\nPreparsedElementType[PreparsedElementType.STYLE] = \"STYLE\";\nPreparsedElementType[PreparsedElementType.STYLESHEET] = \"STYLESHEET\";\nPreparsedElementType[PreparsedElementType.SCRIPT] = \"SCRIPT\";\nPreparsedElementType[PreparsedElementType.OTHER] = \"OTHER\";\nvar PreparsedElement = (function () {\n    /**\n     * @param {?} type\n     * @param {?} selectAttr\n     * @param {?} hrefAttr\n     * @param {?} nonBindable\n     * @param {?} projectAs\n     */\n    function PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs) {\n        this.type = type;\n        this.selectAttr = selectAttr;\n        this.hrefAttr = hrefAttr;\n        this.nonBindable = nonBindable;\n        this.projectAs = projectAs;\n    }\n    return PreparsedElement;\n}());\n/**\n * @param {?} selectAttr\n * @return {?}\n */\nfunction normalizeNgContentSelect(selectAttr) {\n    if (selectAttr === null || selectAttr.length === 0) {\n        return '*';\n    }\n    return selectAttr;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\\[\\(([^\\)]+)\\)\\]|\\[([^\\]]+)\\]|\\(([^\\)]+)\\))$/;\n// Group 1 = \"bind-\"\nvar KW_BIND_IDX = 1;\n// Group 2 = \"let-\"\nvar KW_LET_IDX = 2;\n// Group 3 = \"ref-/#\"\nvar KW_REF_IDX = 3;\n// Group 4 = \"on-\"\nvar KW_ON_IDX = 4;\n// Group 5 = \"bindon-\"\nvar KW_BINDON_IDX = 5;\n// Group 6 = \"@\"\nvar KW_AT_IDX = 6;\n// Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\nvar IDENT_KW_IDX = 7;\n// Group 8 = identifier inside [()]\nvar IDENT_BANANA_BOX_IDX = 8;\n// Group 9 = identifier inside []\nvar IDENT_PROPERTY_IDX = 9;\n// Group 10 = identifier inside ()\nvar IDENT_EVENT_IDX = 10;\n// deprecated in 4.x\nvar TEMPLATE_ELEMENT = 'template';\n// deprecated in 4.x\nvar TEMPLATE_ATTR = 'template';\nvar TEMPLATE_ATTR_PREFIX = '*';\nvar CLASS_ATTR = 'class';\nvar TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];\nvar TEMPLATE_ELEMENT_DEPRECATION_WARNING = 'The <template> element is deprecated. Use <ng-template> instead';\nvar TEMPLATE_ATTR_DEPRECATION_WARNING = 'The template attribute is deprecated. Use an ng-template element instead.';\nvar warningCounts = {};\n/**\n * @param {?} warnings\n * @return {?}\n */\nfunction warnOnlyOnce(warnings) {\n    return function (error) {\n        if (warnings.indexOf(error.msg) !== -1) {\n            warningCounts[error.msg] = (warningCounts[error.msg] || 0) + 1;\n            return warningCounts[error.msg] <= 1;\n        }\n        return true;\n    };\n}\n/**\n * Provides an array of {\\@link TemplateAstVisitor}s which will be used to transform\n * parsed templates before compilation is invoked, allowing custom expression syntax\n * and other advanced transformations.\n *\n * This is currently an internal-only feature and not meant for general use.\n */\nvar TEMPLATE_TRANSFORMS = new _angular_core.InjectionToken('TemplateTransforms');\nvar TemplateParseError = (function (_super) {\n    __extends(TemplateParseError, _super);\n    /**\n     * @param {?} message\n     * @param {?} span\n     * @param {?} level\n     */\n    function TemplateParseError(message, span, level) {\n        return _super.call(this, span, message, level) || this;\n    }\n    return TemplateParseError;\n}(ParseError));\nvar TemplateParseResult = (function () {\n    /**\n     * @param {?=} templateAst\n     * @param {?=} usedPipes\n     * @param {?=} errors\n     */\n    function TemplateParseResult(templateAst, usedPipes, errors) {\n        this.templateAst = templateAst;\n        this.usedPipes = usedPipes;\n        this.errors = errors;\n    }\n    return TemplateParseResult;\n}());\nvar TemplateParser = (function () {\n    /**\n     * @param {?} _config\n     * @param {?} _reflector\n     * @param {?} _exprParser\n     * @param {?} _schemaRegistry\n     * @param {?} _htmlParser\n     * @param {?} _console\n     * @param {?} transforms\n     */\n    function TemplateParser(_config, _reflector, _exprParser, _schemaRegistry, _htmlParser, _console, transforms) {\n        this._config = _config;\n        this._reflector = _reflector;\n        this._exprParser = _exprParser;\n        this._schemaRegistry = _schemaRegistry;\n        this._htmlParser = _htmlParser;\n        this._console = _console;\n        this.transforms = transforms;\n    }\n    /**\n     * @param {?} component\n     * @param {?} template\n     * @param {?} directives\n     * @param {?} pipes\n     * @param {?} schemas\n     * @param {?} templateUrl\n     * @return {?}\n     */\n    TemplateParser.prototype.parse = function (component, template, directives, pipes, schemas, templateUrl) {\n        var /** @type {?} */ result = this.tryParse(component, template, directives, pipes, schemas, templateUrl);\n        var /** @type {?} */ warnings = ((result.errors)).filter(function (error) { return error.level === ParseErrorLevel.WARNING; })\n            .filter(warnOnlyOnce([TEMPLATE_ATTR_DEPRECATION_WARNING, TEMPLATE_ELEMENT_DEPRECATION_WARNING]));\n        var /** @type {?} */ errors = ((result.errors)).filter(function (error) { return error.level === ParseErrorLevel.ERROR; });\n        if (warnings.length > 0) {\n            this._console.warn(\"Template parse warnings:\\n\" + warnings.join('\\n'));\n        }\n        if (errors.length > 0) {\n            var /** @type {?} */ errorString = errors.join('\\n');\n            throw syntaxError(\"Template parse errors:\\n\" + errorString);\n        }\n        return { template: /** @type {?} */ ((result.templateAst)), pipes: /** @type {?} */ ((result.usedPipes)) };\n    };\n    /**\n     * @param {?} component\n     * @param {?} template\n     * @param {?} directives\n     * @param {?} pipes\n     * @param {?} schemas\n     * @param {?} templateUrl\n     * @return {?}\n     */\n    TemplateParser.prototype.tryParse = function (component, template, directives, pipes, schemas, templateUrl) {\n        return this.tryParseHtml(this.expandHtml(/** @type {?} */ ((this._htmlParser)).parse(template, templateUrl, true, this.getInterpolationConfig(component))), component, directives, pipes, schemas);\n    };\n    /**\n     * @param {?} htmlAstWithErrors\n     * @param {?} component\n     * @param {?} directives\n     * @param {?} pipes\n     * @param {?} schemas\n     * @return {?}\n     */\n    TemplateParser.prototype.tryParseHtml = function (htmlAstWithErrors, component, directives, pipes, schemas) {\n        var /** @type {?} */ result;\n        var /** @type {?} */ errors = htmlAstWithErrors.errors;\n        var /** @type {?} */ usedPipes = [];\n        if (htmlAstWithErrors.rootNodes.length > 0) {\n            var /** @type {?} */ uniqDirectives = removeSummaryDuplicates(directives);\n            var /** @type {?} */ uniqPipes = removeSummaryDuplicates(pipes);\n            var /** @type {?} */ providerViewContext = new ProviderViewContext(this._reflector, component);\n            var /** @type {?} */ interpolationConfig = ((undefined));\n            if (component.template && component.template.interpolation) {\n                interpolationConfig = {\n                    start: component.template.interpolation[0],\n                    end: component.template.interpolation[1]\n                };\n            }\n            var /** @type {?} */ bindingParser = new BindingParser(this._exprParser, /** @type {?} */ ((interpolationConfig)), this._schemaRegistry, uniqPipes, errors);\n            var /** @type {?} */ parseVisitor = new TemplateParseVisitor(this._reflector, this._config, providerViewContext, uniqDirectives, bindingParser, this._schemaRegistry, schemas, errors);\n            result = visitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);\n            errors.push.apply(errors, providerViewContext.errors);\n            usedPipes.push.apply(usedPipes, bindingParser.getUsedPipes());\n        }\n        else {\n            result = [];\n        }\n        this._assertNoReferenceDuplicationOnTemplate(result, errors);\n        if (errors.length > 0) {\n            return new TemplateParseResult(result, usedPipes, errors);\n        }\n        if (this.transforms) {\n            this.transforms.forEach(function (transform) { result = templateVisitAll(transform, result); });\n        }\n        return new TemplateParseResult(result, usedPipes, errors);\n    };\n    /**\n     * @param {?} htmlAstWithErrors\n     * @param {?=} forced\n     * @return {?}\n     */\n    TemplateParser.prototype.expandHtml = function (htmlAstWithErrors, forced) {\n        if (forced === void 0) { forced = false; }\n        var /** @type {?} */ errors = htmlAstWithErrors.errors;\n        if (errors.length == 0 || forced) {\n            // Transform ICU messages to angular directives\n            var /** @type {?} */ expandedHtmlAst = expandNodes(htmlAstWithErrors.rootNodes);\n            errors.push.apply(errors, expandedHtmlAst.errors);\n            htmlAstWithErrors = new ParseTreeResult(expandedHtmlAst.nodes, errors);\n        }\n        return htmlAstWithErrors;\n    };\n    /**\n     * @param {?} component\n     * @return {?}\n     */\n    TemplateParser.prototype.getInterpolationConfig = function (component) {\n        if (component.template) {\n            return InterpolationConfig.fromArray(component.template.interpolation);\n        }\n        return undefined;\n    };\n    /**\n     * \\@internal\n     * @param {?} result\n     * @param {?} errors\n     * @return {?}\n     */\n    TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate = function (result, errors) {\n        var /** @type {?} */ existingReferences = [];\n        result.filter(function (element) { return !!((element)).references; })\n            .forEach(function (element) { return ((element)).references.forEach(function (reference) {\n            var /** @type {?} */ name = reference.name;\n            if (existingReferences.indexOf(name) < 0) {\n                existingReferences.push(name);\n            }\n            else {\n                var /** @type {?} */ error = new TemplateParseError(\"Reference \\\"#\" + name + \"\\\" is defined several times\", reference.sourceSpan, ParseErrorLevel.ERROR);\n                errors.push(error);\n            }\n        }); });\n    };\n    return TemplateParser;\n}());\nTemplateParser.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nTemplateParser.ctorParameters = function () { return [\n    { type: CompilerConfig, },\n    { type: CompileReflector, },\n    { type: Parser, },\n    { type: ElementSchemaRegistry, },\n    { type: I18NHtmlParser, },\n    { type: _angular_core.ɵConsole, },\n    { type: Array, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [TEMPLATE_TRANSFORMS,] },] },\n]; };\nvar TemplateParseVisitor = (function () {\n    /**\n     * @param {?} reflector\n     * @param {?} config\n     * @param {?} providerViewContext\n     * @param {?} directives\n     * @param {?} _bindingParser\n     * @param {?} _schemaRegistry\n     * @param {?} _schemas\n     * @param {?} _targetErrors\n     */\n    function TemplateParseVisitor(reflector, config, providerViewContext, directives, _bindingParser, _schemaRegistry, _schemas, _targetErrors) {\n        var _this = this;\n        this.reflector = reflector;\n        this.config = config;\n        this.providerViewContext = providerViewContext;\n        this._bindingParser = _bindingParser;\n        this._schemaRegistry = _schemaRegistry;\n        this._schemas = _schemas;\n        this._targetErrors = _targetErrors;\n        this.selectorMatcher = new SelectorMatcher();\n        this.directivesIndex = new Map();\n        this.ngContentCount = 0;\n        // Note: queries start with id 1 so we can use the number in a Bloom filter!\n        this.contentQueryStartId = providerViewContext.component.viewQueries.length + 1;\n        directives.forEach(function (directive, index) {\n            var selector = CssSelector.parse(directive.selector);\n            _this.selectorMatcher.addSelectables(selector, directive);\n            _this.directivesIndex.set(directive, index);\n        });\n    }\n    /**\n     * @param {?} expansion\n     * @param {?} context\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype.visitExpansion = function (expansion, context) { return null; };\n    /**\n     * @param {?} expansionCase\n     * @param {?} context\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return null; };\n    /**\n     * @param {?} text\n     * @param {?} parent\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype.visitText = function (text, parent) {\n        var /** @type {?} */ ngContentIndex = ((parent.findNgContentIndex(TEXT_CSS_SELECTOR)));\n        var /** @type {?} */ expr = this._bindingParser.parseInterpolation(text.value, /** @type {?} */ ((text.sourceSpan)));\n        return expr ? new BoundTextAst(expr, ngContentIndex, /** @type {?} */ ((text.sourceSpan))) :\n            new TextAst(text.value, ngContentIndex, /** @type {?} */ ((text.sourceSpan)));\n    };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype.visitAttribute = function (attribute, context) {\n        return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype.visitComment = function (comment, context) { return null; };\n    /**\n     * @param {?} element\n     * @param {?} parent\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype.visitElement = function (element, parent) {\n        var _this = this;\n        var /** @type {?} */ queryStartIndex = this.contentQueryStartId;\n        var /** @type {?} */ nodeName = element.name;\n        var /** @type {?} */ preparsedElement = preparseElement(element);\n        if (preparsedElement.type === PreparsedElementType.SCRIPT ||\n            preparsedElement.type === PreparsedElementType.STYLE) {\n            // Skipping <script> for security reasons\n            // Skipping <style> as we already processed them\n            // in the StyleCompiler\n            return null;\n        }\n        if (preparsedElement.type === PreparsedElementType.STYLESHEET &&\n            isStyleUrlResolvable(preparsedElement.hrefAttr)) {\n            // Skipping stylesheets with either relative urls or package scheme as we already processed\n            // them in the StyleCompiler\n            return null;\n        }\n        var /** @type {?} */ matchableAttrs = [];\n        var /** @type {?} */ elementOrDirectiveProps = [];\n        var /** @type {?} */ elementOrDirectiveRefs = [];\n        var /** @type {?} */ elementVars = [];\n        var /** @type {?} */ events = [];\n        var /** @type {?} */ templateElementOrDirectiveProps = [];\n        var /** @type {?} */ templateMatchableAttrs = [];\n        var /** @type {?} */ templateElementVars = [];\n        var /** @type {?} */ hasInlineTemplates = false;\n        var /** @type {?} */ attrs = [];\n        var /** @type {?} */ isTemplateElement = isTemplate(element, this.config.enableLegacyTemplate, function (m, span) { return _this._reportError(m, span, ParseErrorLevel.WARNING); });\n        element.attrs.forEach(function (attr) {\n            var /** @type {?} */ hasBinding = _this._parseAttr(isTemplateElement, attr, matchableAttrs, elementOrDirectiveProps, events, elementOrDirectiveRefs, elementVars);\n            var /** @type {?} */ templateBindingsSource;\n            var /** @type {?} */ prefixToken;\n            var /** @type {?} */ normalizedName = _this._normalizeAttributeName(attr.name);\n            if (_this.config.enableLegacyTemplate && normalizedName == TEMPLATE_ATTR) {\n                _this._reportError(TEMPLATE_ATTR_DEPRECATION_WARNING, attr.sourceSpan, ParseErrorLevel.WARNING);\n                templateBindingsSource = attr.value;\n            }\n            else if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {\n                templateBindingsSource = attr.value;\n                prefixToken = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length) + ':';\n            }\n            var /** @type {?} */ hasTemplateBinding = templateBindingsSource != null;\n            if (hasTemplateBinding) {\n                if (hasInlineTemplates) {\n                    _this._reportError(\"Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *\", attr.sourceSpan);\n                }\n                hasInlineTemplates = true;\n                _this._bindingParser.parseInlineTemplateBinding(/** @type {?} */ ((prefixToken)), /** @type {?} */ ((templateBindingsSource)), attr.sourceSpan, templateMatchableAttrs, templateElementOrDirectiveProps, templateElementVars);\n            }\n            if (!hasBinding && !hasTemplateBinding) {\n                // don't include the bindings as attributes as well in the AST\n                attrs.push(_this.visitAttribute(attr, null));\n                matchableAttrs.push([attr.name, attr.value]);\n            }\n        });\n        var /** @type {?} */ elementCssSelector = createElementCssSelector(nodeName, matchableAttrs);\n        var _a = this._parseDirectives(this.selectorMatcher, elementCssSelector), directiveMetas = _a.directives, matchElement = _a.matchElement;\n        var /** @type {?} */ references = [];\n        var /** @type {?} */ boundDirectivePropNames = new Set();\n        var /** @type {?} */ directiveAsts = this._createDirectiveAsts(isTemplateElement, element.name, directiveMetas, elementOrDirectiveProps, elementOrDirectiveRefs, /** @type {?} */ ((element.sourceSpan)), references, boundDirectivePropNames);\n        var /** @type {?} */ elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, boundDirectivePropNames);\n        var /** @type {?} */ isViewRoot = parent.isTemplateElement || hasInlineTemplates;\n        var /** @type {?} */ providerContext = new ProviderElementContext(this.providerViewContext, /** @type {?} */ ((parent.providerContext)), isViewRoot, directiveAsts, attrs, references, isTemplateElement, queryStartIndex, /** @type {?} */ ((element.sourceSpan)));\n        var /** @type {?} */ children = visitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, ElementContext.create(isTemplateElement, directiveAsts, isTemplateElement ? ((parent.providerContext)) : providerContext));\n        providerContext.afterElement();\n        // Override the actual selector when the `ngProjectAs` attribute is provided\n        var /** @type {?} */ projectionSelector = preparsedElement.projectAs != null ?\n            CssSelector.parse(preparsedElement.projectAs)[0] :\n            elementCssSelector;\n        var /** @type {?} */ ngContentIndex = ((parent.findNgContentIndex(projectionSelector)));\n        var /** @type {?} */ parsedElement;\n        if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {\n            if (element.children && !element.children.every(_isEmptyTextNode)) {\n                this._reportError(\"<ng-content> element cannot have content.\", /** @type {?} */ ((element.sourceSpan)));\n            }\n            parsedElement = new NgContentAst(this.ngContentCount++, hasInlineTemplates ? ((null)) : ngContentIndex, /** @type {?} */ ((element.sourceSpan)));\n        }\n        else if (isTemplateElement) {\n            this._assertAllEventsPublishedByDirectives(directiveAsts, events);\n            this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts, elementProps, /** @type {?} */ ((element.sourceSpan)));\n            parsedElement = new EmbeddedTemplateAst(attrs, events, references, elementVars, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? ((null)) : ngContentIndex, /** @type {?} */ ((element.sourceSpan)));\n        }\n        else {\n            this._assertElementExists(matchElement, element);\n            this._assertOnlyOneComponent(directiveAsts, /** @type {?} */ ((element.sourceSpan)));\n            var /** @type {?} */ ngContentIndex_1 = hasInlineTemplates ? null : parent.findNgContentIndex(projectionSelector);\n            parsedElement = new ElementAst(nodeName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan, element.endSourceSpan || null);\n        }\n        if (hasInlineTemplates) {\n            var /** @type {?} */ templateQueryStartIndex = this.contentQueryStartId;\n            var /** @type {?} */ templateSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs);\n            var templateDirectiveMetas = this._parseDirectives(this.selectorMatcher, templateSelector).directives;\n            var /** @type {?} */ templateBoundDirectivePropNames = new Set();\n            var /** @type {?} */ templateDirectiveAsts = this._createDirectiveAsts(true, element.name, templateDirectiveMetas, templateElementOrDirectiveProps, [], /** @type {?} */ ((element.sourceSpan)), [], templateBoundDirectivePropNames);\n            var /** @type {?} */ templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateBoundDirectivePropNames);\n            this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts, templateElementProps, /** @type {?} */ ((element.sourceSpan)));\n            var /** @type {?} */ templateProviderContext = new ProviderElementContext(this.providerViewContext, /** @type {?} */ ((parent.providerContext)), parent.isTemplateElement, templateDirectiveAsts, [], [], true, templateQueryStartIndex, /** @type {?} */ ((element.sourceSpan)));\n            templateProviderContext.afterElement();\n            parsedElement = new EmbeddedTemplateAst([], [], [], templateElementVars, templateProviderContext.transformedDirectiveAsts, templateProviderContext.transformProviders, templateProviderContext.transformedHasViewContainer, templateProviderContext.queryMatches, [parsedElement], ngContentIndex, /** @type {?} */ ((element.sourceSpan)));\n        }\n        return parsedElement;\n    };\n    /**\n     * @param {?} isTemplateElement\n     * @param {?} attr\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetProps\n     * @param {?} targetEvents\n     * @param {?} targetRefs\n     * @param {?} targetVars\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._parseAttr = function (isTemplateElement, attr, targetMatchableAttrs, targetProps, targetEvents, targetRefs, targetVars) {\n        var /** @type {?} */ name = this._normalizeAttributeName(attr.name);\n        var /** @type {?} */ value = attr.value;\n        var /** @type {?} */ srcSpan = attr.sourceSpan;\n        var /** @type {?} */ bindParts = name.match(BIND_NAME_REGEXP);\n        var /** @type {?} */ hasBinding = false;\n        if (bindParts !== null) {\n            hasBinding = true;\n            if (bindParts[KW_BIND_IDX] != null) {\n                this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);\n            }\n            else if (bindParts[KW_LET_IDX]) {\n                if (isTemplateElement) {\n                    var /** @type {?} */ identifier = bindParts[IDENT_KW_IDX];\n                    this._parseVariable(identifier, value, srcSpan, targetVars);\n                }\n                else {\n                    this._reportError(\"\\\"let-\\\" is only supported on template elements.\", srcSpan);\n                }\n            }\n            else if (bindParts[KW_REF_IDX]) {\n                var /** @type {?} */ identifier = bindParts[IDENT_KW_IDX];\n                this._parseReference(identifier, value, srcSpan, targetRefs);\n            }\n            else if (bindParts[KW_ON_IDX]) {\n                this._bindingParser.parseEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);\n            }\n            else if (bindParts[KW_BINDON_IDX]) {\n                this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);\n                this._parseAssignmentEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);\n            }\n            else if (bindParts[KW_AT_IDX]) {\n                this._bindingParser.parseLiteralAttr(name, value, srcSpan, targetMatchableAttrs, targetProps);\n            }\n            else if (bindParts[IDENT_BANANA_BOX_IDX]) {\n                this._bindingParser.parsePropertyBinding(bindParts[IDENT_BANANA_BOX_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);\n                this._parseAssignmentEvent(bindParts[IDENT_BANANA_BOX_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);\n            }\n            else if (bindParts[IDENT_PROPERTY_IDX]) {\n                this._bindingParser.parsePropertyBinding(bindParts[IDENT_PROPERTY_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);\n            }\n            else if (bindParts[IDENT_EVENT_IDX]) {\n                this._bindingParser.parseEvent(bindParts[IDENT_EVENT_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);\n            }\n        }\n        else {\n            hasBinding = this._bindingParser.parsePropertyInterpolation(name, value, srcSpan, targetMatchableAttrs, targetProps);\n        }\n        if (!hasBinding) {\n            this._bindingParser.parseLiteralAttr(name, value, srcSpan, targetMatchableAttrs, targetProps);\n        }\n        return hasBinding;\n    };\n    /**\n     * @param {?} attrName\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._normalizeAttributeName = function (attrName) {\n        return /^data-/i.test(attrName) ? attrName.substring(5) : attrName;\n    };\n    /**\n     * @param {?} identifier\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @param {?} targetVars\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._parseVariable = function (identifier, value, sourceSpan, targetVars) {\n        if (identifier.indexOf('-') > -1) {\n            this._reportError(\"\\\"-\\\" is not allowed in variable names\", sourceSpan);\n        }\n        targetVars.push(new VariableAst(identifier, value, sourceSpan));\n    };\n    /**\n     * @param {?} identifier\n     * @param {?} value\n     * @param {?} sourceSpan\n     * @param {?} targetRefs\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._parseReference = function (identifier, value, sourceSpan, targetRefs) {\n        if (identifier.indexOf('-') > -1) {\n            this._reportError(\"\\\"-\\\" is not allowed in reference names\", sourceSpan);\n        }\n        targetRefs.push(new ElementOrDirectiveRef(identifier, value, sourceSpan));\n    };\n    /**\n     * @param {?} name\n     * @param {?} expression\n     * @param {?} sourceSpan\n     * @param {?} targetMatchableAttrs\n     * @param {?} targetEvents\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._parseAssignmentEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n        this._bindingParser.parseEvent(name + \"Change\", expression + \"=$event\", sourceSpan, targetMatchableAttrs, targetEvents);\n    };\n    /**\n     * @param {?} selectorMatcher\n     * @param {?} elementCssSelector\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._parseDirectives = function (selectorMatcher, elementCssSelector) {\n        var _this = this;\n        // Need to sort the directives so that we get consistent results throughout,\n        // as selectorMatcher uses Maps inside.\n        // Also deduplicate directives as they might match more than one time!\n        var /** @type {?} */ directives = new Array(this.directivesIndex.size);\n        // Whether any directive selector matches on the element name\n        var /** @type {?} */ matchElement = false;\n        selectorMatcher.match(elementCssSelector, function (selector, directive) {\n            directives[((_this.directivesIndex.get(directive)))] = directive;\n            matchElement = matchElement || selector.hasElementSelector();\n        });\n        return {\n            directives: directives.filter(function (dir) { return !!dir; }),\n            matchElement: matchElement,\n        };\n    };\n    /**\n     * @param {?} isTemplateElement\n     * @param {?} elementName\n     * @param {?} directives\n     * @param {?} props\n     * @param {?} elementOrDirectiveRefs\n     * @param {?} elementSourceSpan\n     * @param {?} targetReferences\n     * @param {?} targetBoundDirectivePropNames\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._createDirectiveAsts = function (isTemplateElement, elementName, directives, props, elementOrDirectiveRefs, elementSourceSpan, targetReferences, targetBoundDirectivePropNames) {\n        var _this = this;\n        var /** @type {?} */ matchedReferences = new Set();\n        var /** @type {?} */ component = ((null));\n        var /** @type {?} */ directiveAsts = directives.map(function (directive) {\n            var /** @type {?} */ sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, \"Directive \" + identifierName(directive.type));\n            if (directive.isComponent) {\n                component = directive;\n            }\n            var /** @type {?} */ directiveProperties = [];\n            var /** @type {?} */ hostProperties = ((_this._bindingParser.createDirectiveHostPropertyAsts(directive, elementName, sourceSpan)));\n            // Note: We need to check the host properties here as well,\n            // as we don't know the element name in the DirectiveWrapperCompiler yet.\n            hostProperties = _this._checkPropertiesInSchema(elementName, hostProperties);\n            var /** @type {?} */ hostEvents = ((_this._bindingParser.createDirectiveHostEventAsts(directive, sourceSpan)));\n            _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties, targetBoundDirectivePropNames);\n            elementOrDirectiveRefs.forEach(function (elOrDirRef) {\n                if ((elOrDirRef.value.length === 0 && directive.isComponent) ||\n                    (directive.exportAs == elOrDirRef.value)) {\n                    targetReferences.push(new ReferenceAst(elOrDirRef.name, createTokenForReference(directive.type.reference), elOrDirRef.sourceSpan));\n                    matchedReferences.add(elOrDirRef.name);\n                }\n            });\n            var /** @type {?} */ contentQueryStartId = _this.contentQueryStartId;\n            _this.contentQueryStartId += directive.queries.length;\n            return new DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, contentQueryStartId, sourceSpan);\n        });\n        elementOrDirectiveRefs.forEach(function (elOrDirRef) {\n            if (elOrDirRef.value.length > 0) {\n                if (!matchedReferences.has(elOrDirRef.name)) {\n                    _this._reportError(\"There is no directive with \\\"exportAs\\\" set to \\\"\" + elOrDirRef.value + \"\\\"\", elOrDirRef.sourceSpan);\n                }\n            }\n            else if (!component) {\n                var /** @type {?} */ refToken = ((null));\n                if (isTemplateElement) {\n                    refToken = createTokenForExternalReference(_this.reflector, Identifiers.TemplateRef);\n                }\n                targetReferences.push(new ReferenceAst(elOrDirRef.name, refToken, elOrDirRef.sourceSpan));\n            }\n        });\n        return directiveAsts;\n    };\n    /**\n     * @param {?} directiveProperties\n     * @param {?} boundProps\n     * @param {?} targetBoundDirectiveProps\n     * @param {?} targetBoundDirectivePropNames\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._createDirectivePropertyAsts = function (directiveProperties, boundProps, targetBoundDirectiveProps, targetBoundDirectivePropNames) {\n        if (directiveProperties) {\n            var /** @type {?} */ boundPropsByName_1 = new Map();\n            boundProps.forEach(function (boundProp) {\n                var /** @type {?} */ prevValue = boundPropsByName_1.get(boundProp.name);\n                if (!prevValue || prevValue.isLiteral) {\n                    // give [a]=\"b\" a higher precedence than a=\"b\" on the same element\n                    boundPropsByName_1.set(boundProp.name, boundProp);\n                }\n            });\n            Object.keys(directiveProperties).forEach(function (dirProp) {\n                var /** @type {?} */ elProp = directiveProperties[dirProp];\n                var /** @type {?} */ boundProp = boundPropsByName_1.get(elProp);\n                // Bindings are optional, so this binding only needs to be set up if an expression is given.\n                if (boundProp) {\n                    targetBoundDirectivePropNames.add(boundProp.name);\n                    if (!isEmptyExpression(boundProp.expression)) {\n                        targetBoundDirectiveProps.push(new BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceSpan));\n                    }\n                }\n            });\n        }\n    };\n    /**\n     * @param {?} elementName\n     * @param {?} props\n     * @param {?} boundDirectivePropNames\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._createElementPropertyAsts = function (elementName, props, boundDirectivePropNames) {\n        var _this = this;\n        var /** @type {?} */ boundElementProps = [];\n        props.forEach(function (prop) {\n            if (!prop.isLiteral && !boundDirectivePropNames.has(prop.name)) {\n                boundElementProps.push(_this._bindingParser.createElementPropertyAst(elementName, prop));\n            }\n        });\n        return this._checkPropertiesInSchema(elementName, boundElementProps);\n    };\n    /**\n     * @param {?} directives\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._findComponentDirectives = function (directives) {\n        return directives.filter(function (directive) { return directive.directive.isComponent; });\n    };\n    /**\n     * @param {?} directives\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._findComponentDirectiveNames = function (directives) {\n        return this._findComponentDirectives(directives)\n            .map(function (directive) { return ((identifierName(directive.directive.type))); });\n    };\n    /**\n     * @param {?} directives\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._assertOnlyOneComponent = function (directives, sourceSpan) {\n        var /** @type {?} */ componentTypeNames = this._findComponentDirectiveNames(directives);\n        if (componentTypeNames.length > 1) {\n            this._reportError(\"More than one component matched on this element.\\n\" +\n                \"Make sure that only one component's selector can match a given element.\\n\" +\n                (\"Conflicting components: \" + componentTypeNames.join(',')), sourceSpan);\n        }\n    };\n    /**\n     * Make sure that non-angular tags conform to the schemas.\n     *\n     * Note: An element is considered an angular tag when at least one directive selector matches the\n     * tag name.\n     *\n     * @param {?} matchElement Whether any directive has matched on the tag name\n     * @param {?} element the html element\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._assertElementExists = function (matchElement, element) {\n        var /** @type {?} */ elName = element.name.replace(/^:xhtml:/, '');\n        if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n            var /** @type {?} */ errorMsg = \"'\" + elName + \"' is not a known element:\\n\";\n            errorMsg +=\n                \"1. If '\" + elName + \"' is an Angular component, then verify that it is part of this module.\\n\";\n            if (elName.indexOf('-') > -1) {\n                errorMsg +=\n                    \"2. If '\" + elName + \"' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\";\n            }\n            else {\n                errorMsg +=\n                    \"2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n            }\n            this._reportError(errorMsg, /** @type {?} */ ((element.sourceSpan)));\n        }\n    };\n    /**\n     * @param {?} directives\n     * @param {?} elementProps\n     * @param {?} sourceSpan\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function (directives, elementProps, sourceSpan) {\n        var _this = this;\n        var /** @type {?} */ componentTypeNames = this._findComponentDirectiveNames(directives);\n        if (componentTypeNames.length > 0) {\n            this._reportError(\"Components on an embedded template: \" + componentTypeNames.join(','), sourceSpan);\n        }\n        elementProps.forEach(function (prop) {\n            _this._reportError(\"Property binding \" + prop.name + \" not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \\\"@NgModule.declarations\\\".\", sourceSpan);\n        });\n    };\n    /**\n     * @param {?} directives\n     * @param {?} events\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function (directives, events) {\n        var _this = this;\n        var /** @type {?} */ allDirectiveEvents = new Set();\n        directives.forEach(function (directive) {\n            Object.keys(directive.directive.outputs).forEach(function (k) {\n                var /** @type {?} */ eventName = directive.directive.outputs[k];\n                allDirectiveEvents.add(eventName);\n            });\n        });\n        events.forEach(function (event) {\n            if (event.target != null || !allDirectiveEvents.has(event.name)) {\n                _this._reportError(\"Event binding \" + event.fullName + \" not emitted by any directive on an embedded template. Make sure that the event name is spelled correctly and all directives are listed in the \\\"@NgModule.declarations\\\".\", event.sourceSpan);\n            }\n        });\n    };\n    /**\n     * @param {?} elementName\n     * @param {?} boundProps\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._checkPropertiesInSchema = function (elementName, boundProps) {\n        var _this = this;\n        // Note: We can't filter out empty expressions before this method,\n        // as we still want to validate them!\n        return boundProps.filter(function (boundProp) {\n            if (boundProp.type === PropertyBindingType.Property &&\n                !_this._schemaRegistry.hasProperty(elementName, boundProp.name, _this._schemas)) {\n                var /** @type {?} */ errorMsg = \"Can't bind to '\" + boundProp.name + \"' since it isn't a known property of '\" + elementName + \"'.\";\n                if (elementName.startsWith('ng-')) {\n                    errorMsg +=\n                        \"\\n1. If '\" + boundProp.name + \"' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.\" +\n                            \"\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n                }\n                else if (elementName.indexOf('-') > -1) {\n                    errorMsg +=\n                        \"\\n1. If '\" + elementName + \"' is an Angular component and it has '\" + boundProp.name + \"' input, then verify that it is part of this module.\" +\n                            (\"\\n2. If '\" + elementName + \"' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\") +\n                            \"\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.\";\n                }\n                _this._reportError(errorMsg, boundProp.sourceSpan);\n            }\n            return !isEmptyExpression(boundProp.value);\n        });\n    };\n    /**\n     * @param {?} message\n     * @param {?} sourceSpan\n     * @param {?=} level\n     * @return {?}\n     */\n    TemplateParseVisitor.prototype._reportError = function (message, sourceSpan, level) {\n        if (level === void 0) { level = ParseErrorLevel.ERROR; }\n        this._targetErrors.push(new ParseError(sourceSpan, message, level));\n    };\n    return TemplateParseVisitor;\n}());\nvar NonBindableVisitor = (function () {\n    function NonBindableVisitor() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} parent\n     * @return {?}\n     */\n    NonBindableVisitor.prototype.visitElement = function (ast, parent) {\n        var /** @type {?} */ preparsedElement = preparseElement(ast);\n        if (preparsedElement.type === PreparsedElementType.SCRIPT ||\n            preparsedElement.type === PreparsedElementType.STYLE ||\n            preparsedElement.type === PreparsedElementType.STYLESHEET) {\n            // Skipping <script> for security reasons\n            // Skipping <style> and stylesheets as we already processed them\n            // in the StyleCompiler\n            return null;\n        }\n        var /** @type {?} */ attrNameAndValues = ast.attrs.map(function (attr) { return [attr.name, attr.value]; });\n        var /** @type {?} */ selector = createElementCssSelector(ast.name, attrNameAndValues);\n        var /** @type {?} */ ngContentIndex = parent.findNgContentIndex(selector);\n        var /** @type {?} */ children = visitAll(this, ast.children, EMPTY_ELEMENT_CONTEXT);\n        return new ElementAst(ast.name, visitAll(this, ast.attrs), [], [], [], [], [], false, [], children, ngContentIndex, ast.sourceSpan, ast.endSourceSpan);\n    };\n    /**\n     * @param {?} comment\n     * @param {?} context\n     * @return {?}\n     */\n    NonBindableVisitor.prototype.visitComment = function (comment, context) { return null; };\n    /**\n     * @param {?} attribute\n     * @param {?} context\n     * @return {?}\n     */\n    NonBindableVisitor.prototype.visitAttribute = function (attribute, context) {\n        return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);\n    };\n    /**\n     * @param {?} text\n     * @param {?} parent\n     * @return {?}\n     */\n    NonBindableVisitor.prototype.visitText = function (text, parent) {\n        var /** @type {?} */ ngContentIndex = ((parent.findNgContentIndex(TEXT_CSS_SELECTOR)));\n        return new TextAst(text.value, ngContentIndex, /** @type {?} */ ((text.sourceSpan)));\n    };\n    /**\n     * @param {?} expansion\n     * @param {?} context\n     * @return {?}\n     */\n    NonBindableVisitor.prototype.visitExpansion = function (expansion, context) { return expansion; };\n    /**\n     * @param {?} expansionCase\n     * @param {?} context\n     * @return {?}\n     */\n    NonBindableVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return expansionCase; };\n    return NonBindableVisitor;\n}());\nvar ElementOrDirectiveRef = (function () {\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?} sourceSpan\n     */\n    function ElementOrDirectiveRef(name, value, sourceSpan) {\n        this.name = name;\n        this.value = value;\n        this.sourceSpan = sourceSpan;\n    }\n    return ElementOrDirectiveRef;\n}());\n/**\n * @param {?} classAttrValue\n * @return {?}\n */\nfunction splitClasses(classAttrValue) {\n    return classAttrValue.trim().split(/\\s+/g);\n}\nvar ElementContext = (function () {\n    /**\n     * @param {?} isTemplateElement\n     * @param {?} _ngContentIndexMatcher\n     * @param {?} _wildcardNgContentIndex\n     * @param {?} providerContext\n     */\n    function ElementContext(isTemplateElement, _ngContentIndexMatcher, _wildcardNgContentIndex, providerContext) {\n        this.isTemplateElement = isTemplateElement;\n        this._ngContentIndexMatcher = _ngContentIndexMatcher;\n        this._wildcardNgContentIndex = _wildcardNgContentIndex;\n        this.providerContext = providerContext;\n    }\n    /**\n     * @param {?} isTemplateElement\n     * @param {?} directives\n     * @param {?} providerContext\n     * @return {?}\n     */\n    ElementContext.create = function (isTemplateElement, directives, providerContext) {\n        var /** @type {?} */ matcher = new SelectorMatcher();\n        var /** @type {?} */ wildcardNgContentIndex = ((null));\n        var /** @type {?} */ component = directives.find(function (directive) { return directive.directive.isComponent; });\n        if (component) {\n            var /** @type {?} */ ngContentSelectors = ((component.directive.template)).ngContentSelectors;\n            for (var /** @type {?} */ i = 0; i < ngContentSelectors.length; i++) {\n                var /** @type {?} */ selector = ngContentSelectors[i];\n                if (selector === '*') {\n                    wildcardNgContentIndex = i;\n                }\n                else {\n                    matcher.addSelectables(CssSelector.parse(ngContentSelectors[i]), i);\n                }\n            }\n        }\n        return new ElementContext(isTemplateElement, matcher, wildcardNgContentIndex, providerContext);\n    };\n    /**\n     * @param {?} selector\n     * @return {?}\n     */\n    ElementContext.prototype.findNgContentIndex = function (selector) {\n        var /** @type {?} */ ngContentIndices = [];\n        this._ngContentIndexMatcher.match(selector, function (selector, ngContentIndex) { ngContentIndices.push(ngContentIndex); });\n        ngContentIndices.sort();\n        if (this._wildcardNgContentIndex != null) {\n            ngContentIndices.push(this._wildcardNgContentIndex);\n        }\n        return ngContentIndices.length > 0 ? ngContentIndices[0] : null;\n    };\n    return ElementContext;\n}());\n/**\n * @param {?} elementName\n * @param {?} attributes\n * @return {?}\n */\nfunction createElementCssSelector(elementName, attributes) {\n    var /** @type {?} */ cssSelector = new CssSelector();\n    var /** @type {?} */ elNameNoNs = splitNsName(elementName)[1];\n    cssSelector.setElement(elNameNoNs);\n    for (var /** @type {?} */ i = 0; i < attributes.length; i++) {\n        var /** @type {?} */ attrName = attributes[i][0];\n        var /** @type {?} */ attrNameNoNs = splitNsName(attrName)[1];\n        var /** @type {?} */ attrValue = attributes[i][1];\n        cssSelector.addAttribute(attrNameNoNs, attrValue);\n        if (attrName.toLowerCase() == CLASS_ATTR) {\n            var /** @type {?} */ classes = splitClasses(attrValue);\n            classes.forEach(function (className) { return cssSelector.addClassName(className); });\n        }\n    }\n    return cssSelector;\n}\nvar EMPTY_ELEMENT_CONTEXT = new ElementContext(true, new SelectorMatcher(), null, null);\nvar NON_BINDABLE_VISITOR = new NonBindableVisitor();\n/**\n * @param {?} node\n * @return {?}\n */\nfunction _isEmptyTextNode(node) {\n    return node instanceof Text && node.value.trim().length == 0;\n}\n/**\n * @template T\n * @param {?} items\n * @return {?}\n */\nfunction removeSummaryDuplicates(items) {\n    var /** @type {?} */ map = new Map();\n    items.forEach(function (item) {\n        if (!map.get(item.type.reference)) {\n            map.set(item.type.reference, item);\n        }\n    });\n    return Array.from(map.values());\n}\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction isEmptyExpression(ast) {\n    if (ast instanceof ASTWithSource) {\n        ast = ast.ast;\n    }\n    return ast instanceof EmptyExpr;\n}\n/**\n * @param {?} el\n * @param {?} enableLegacyTemplate\n * @param {?} reportDeprecation\n * @return {?}\n */\nfunction isTemplate(el, enableLegacyTemplate, reportDeprecation) {\n    if (isNgTemplate(el.name))\n        return true;\n    var /** @type {?} */ tagNoNs = splitNsName(el.name)[1];\n    // `<template>` is HTML and case insensitive\n    if (tagNoNs.toLowerCase() === TEMPLATE_ELEMENT) {\n        if (enableLegacyTemplate && tagNoNs.toLowerCase() === TEMPLATE_ELEMENT) {\n            reportDeprecation(TEMPLATE_ELEMENT_DEPRECATION_WARNING, /** @type {?} */ ((el.sourceSpan)));\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * An interface for retrieving documents by URL that the compiler uses\n * to load templates.\n */\nvar ResourceLoader = (function () {\n    function ResourceLoader() {\n    }\n    /**\n     * @param {?} url\n     * @return {?}\n     */\n    ResourceLoader.prototype.get = function (url) { return ''; };\n    return ResourceLoader;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Create a {\\@link UrlResolver} with no package prefix.\n * @return {?}\n */\nfunction createUrlResolverWithoutPackagePrefix() {\n    return new UrlResolver();\n}\n/**\n * @return {?}\n */\nfunction createOfflineCompileUrlResolver() {\n    return new UrlResolver('.');\n}\n/**\n * A default provider for {\\@link PACKAGE_ROOT_URL} that maps to '/'.\n */\nvar DEFAULT_PACKAGE_URL_PROVIDER = {\n    provide: _angular_core.PACKAGE_ROOT_URL,\n    useValue: '/'\n};\n/**\n * Used by the {\\@link Compiler} when resolving HTML and CSS template URLs.\n *\n * This class can be overridden by the application developer to create custom behavior.\n *\n * See {\\@link Compiler}\n *\n * ## Example\n *\n * {\\@example compiler/ts/url_resolver/url_resolver.ts region='url_resolver'}\n *\n * \\@security When compiling templates at runtime, you must\n * ensure that the entire template comes from a trusted source.\n * Attacker-controlled data introduced by a template could expose your\n * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).\n */\nvar UrlResolver = (function () {\n    /**\n     * @param {?=} _packagePrefix\n     */\n    function UrlResolver(_packagePrefix) {\n        if (_packagePrefix === void 0) { _packagePrefix = null; }\n        this._packagePrefix = _packagePrefix;\n    }\n    /**\n     * Resolves the `url` given the `baseUrl`:\n     * - when the `url` is null, the `baseUrl` is returned,\n     * - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of\n     * `baseUrl` and `url`,\n     * - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is\n     * returned as is (ignoring the `baseUrl`)\n     * @param {?} baseUrl\n     * @param {?} url\n     * @return {?}\n     */\n    UrlResolver.prototype.resolve = function (baseUrl, url) {\n        var /** @type {?} */ resolvedUrl = url;\n        if (baseUrl != null && baseUrl.length > 0) {\n            resolvedUrl = _resolveUrl(baseUrl, resolvedUrl);\n        }\n        var /** @type {?} */ resolvedParts = _split(resolvedUrl);\n        var /** @type {?} */ prefix = this._packagePrefix;\n        if (prefix != null && resolvedParts != null &&\n            resolvedParts[_ComponentIndex.Scheme] == 'package') {\n            var /** @type {?} */ path = resolvedParts[_ComponentIndex.Path];\n            prefix = prefix.replace(/\\/+$/, '');\n            path = path.replace(/^\\/+/, '');\n            return prefix + \"/\" + path;\n        }\n        return resolvedUrl;\n    };\n    return UrlResolver;\n}());\nUrlResolver.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nUrlResolver.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_core.PACKAGE_ROOT_URL,] },] },\n]; };\n/**\n * Extract the scheme of a URL.\n * @param {?} url\n * @return {?}\n */\nfunction getUrlScheme(url) {\n    var /** @type {?} */ match = _split(url);\n    return (match && match[_ComponentIndex.Scheme]) || '';\n}\n/**\n * Builds a URI string from already-encoded parts.\n *\n * No encoding is performed.  Any component may be omitted as either null or\n * undefined.\n *\n * @param {?=} opt_scheme The scheme such as 'http'.\n * @param {?=} opt_userInfo The user name before the '\\@'.\n * @param {?=} opt_domain The domain such as 'www.google.com', already\n *     URI-encoded.\n * @param {?=} opt_port The port number.\n * @param {?=} opt_path The path, already URI-encoded.  If it is not\n *     empty, it must begin with a slash.\n * @param {?=} opt_queryData The URI-encoded query data.\n * @param {?=} opt_fragment The URI-encoded fragment identifier.\n * @return {?} The fully combined URI.\n */\nfunction _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {\n    var /** @type {?} */ out = [];\n    if (opt_scheme != null) {\n        out.push(opt_scheme + ':');\n    }\n    if (opt_domain != null) {\n        out.push('//');\n        if (opt_userInfo != null) {\n            out.push(opt_userInfo + '@');\n        }\n        out.push(opt_domain);\n        if (opt_port != null) {\n            out.push(':' + opt_port);\n        }\n    }\n    if (opt_path != null) {\n        out.push(opt_path);\n    }\n    if (opt_queryData != null) {\n        out.push('?' + opt_queryData);\n    }\n    if (opt_fragment != null) {\n        out.push('#' + opt_fragment);\n    }\n    return out.join('');\n}\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {\\@link http://www.gbiv.com/protocols/uri/rfc/rfc3986.html#RFC2234} says\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n *  12            3  4          5       6  7        8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n *     http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n *    $1 = http:\n *    $2 = http\n *    $3 = //www.ics.uci.edu\n *    $4 = www.ics.uci.edu\n *    $5 = /pub/ietf/uri/\n *    $6 = <undefined>\n *    $7 = <undefined>\n *    $8 = #Related\n *    $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n *    scheme    = $2\n *    authority = $4\n *    path      = $5\n *    query     = $7\n *    fragment  = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n *    $1 = http              scheme\n *    $2 = <undefined>       userInfo -\\\n *    $3 = www.ics.uci.edu   domain     | authority\n *    $4 = <undefined>       port     -/\n *    $5 = /pub/ietf/uri/    path\n *    $6 = <undefined>       query without ?\n *    $7 = Related           fragment without #\n * </pre>\n * \\@internal\n */\nvar _splitRe = new RegExp('^' +\n    '(?:' +\n    '([^:/?#.]+)' +\n    // used by other URL parts such as :,\n    // ?, /, #, and .\n    ':)?' +\n    '(?://' +\n    '(?:([^/?#]*)@)?' +\n    '([\\\\w\\\\d\\\\-\\\\u0100-\\\\uffff.%]*)' +\n    // digits, dashes, dots, percent\n    // escapes, and unicode characters.\n    '(?::([0-9]+))?' +\n    ')?' +\n    '([^?#]+)?' +\n    '(?:\\\\?([^#]*))?' +\n    '(?:#(.*))?' +\n    '$');\nvar _ComponentIndex = {};\n_ComponentIndex.Scheme = 1;\n_ComponentIndex.UserInfo = 2;\n_ComponentIndex.Domain = 3;\n_ComponentIndex.Port = 4;\n_ComponentIndex.Path = 5;\n_ComponentIndex.QueryData = 6;\n_ComponentIndex.Fragment = 7;\n_ComponentIndex[_ComponentIndex.Scheme] = \"Scheme\";\n_ComponentIndex[_ComponentIndex.UserInfo] = \"UserInfo\";\n_ComponentIndex[_ComponentIndex.Domain] = \"Domain\";\n_ComponentIndex[_ComponentIndex.Port] = \"Port\";\n_ComponentIndex[_ComponentIndex.Path] = \"Path\";\n_ComponentIndex[_ComponentIndex.QueryData] = \"QueryData\";\n_ComponentIndex[_ComponentIndex.Fragment] = \"Fragment\";\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {?} uri The URI string to examine.\n * @return {?} Each component still URI-encoded.\n *     Each component that is present will contain the encoded value, whereas\n *     components that are not present will be undefined or empty, depending\n *     on the browser's regular expression implementation.  Never null, since\n *     arbitrary strings may still look like path names.\n */\nfunction _split(uri) {\n    return ((uri.match(_splitRe)));\n}\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {?} path A non-empty path component.\n * @return {?} Path component with removed dot segments.\n */\nfunction _removeDotSegments(path) {\n    if (path == '/')\n        return '/';\n    var /** @type {?} */ leadingSlash = path[0] == '/' ? '/' : '';\n    var /** @type {?} */ trailingSlash = path[path.length - 1] === '/' ? '/' : '';\n    var /** @type {?} */ segments = path.split('/');\n    var /** @type {?} */ out = [];\n    var /** @type {?} */ up = 0;\n    for (var /** @type {?} */ pos = 0; pos < segments.length; pos++) {\n        var /** @type {?} */ segment = segments[pos];\n        switch (segment) {\n            case '':\n            case '.':\n                break;\n            case '..':\n                if (out.length > 0) {\n                    out.pop();\n                }\n                else {\n                    up++;\n                }\n                break;\n            default:\n                out.push(segment);\n        }\n    }\n    if (leadingSlash == '') {\n        while (up-- > 0) {\n            out.unshift('..');\n        }\n        if (out.length === 0)\n            out.push('.');\n    }\n    return leadingSlash + out.join('/') + trailingSlash;\n}\n/**\n * Takes an array of the parts from split and canonicalizes the path part\n * and then joins all the parts.\n * @param {?} parts\n * @return {?}\n */\nfunction _joinAndCanonicalizePath(parts) {\n    var /** @type {?} */ path = parts[_ComponentIndex.Path];\n    path = path == null ? '' : _removeDotSegments(path);\n    parts[_ComponentIndex.Path] = path;\n    return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}\n/**\n * Resolves a URL.\n * @param {?} base The URL acting as the base URL.\n * @param {?} url\n * @return {?}\n */\nfunction _resolveUrl(base, url) {\n    var /** @type {?} */ parts = _split(encodeURI(url));\n    var /** @type {?} */ baseParts = _split(base);\n    if (parts[_ComponentIndex.Scheme] != null) {\n        return _joinAndCanonicalizePath(parts);\n    }\n    else {\n        parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme];\n    }\n    for (var /** @type {?} */ i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) {\n        if (parts[i] == null) {\n            parts[i] = baseParts[i];\n        }\n    }\n    if (parts[_ComponentIndex.Path][0] == '/') {\n        return _joinAndCanonicalizePath(parts);\n    }\n    var /** @type {?} */ path = baseParts[_ComponentIndex.Path];\n    if (path == null)\n        path = '/';\n    var /** @type {?} */ index = path.lastIndexOf('/');\n    path = path.substring(0, index + 1) + parts[_ComponentIndex.Path];\n    parts[_ComponentIndex.Path] = path;\n    return _joinAndCanonicalizePath(parts);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar DirectiveNormalizer = (function () {\n    /**\n     * @param {?} _resourceLoader\n     * @param {?} _urlResolver\n     * @param {?} _htmlParser\n     * @param {?} _config\n     */\n    function DirectiveNormalizer(_resourceLoader, _urlResolver, _htmlParser, _config) {\n        this._resourceLoader = _resourceLoader;\n        this._urlResolver = _urlResolver;\n        this._htmlParser = _htmlParser;\n        this._config = _config;\n        this._resourceLoaderCache = new Map();\n    }\n    /**\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.clearCache = function () { this._resourceLoaderCache.clear(); };\n    /**\n     * @param {?} normalizedDirective\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.clearCacheFor = function (normalizedDirective) {\n        var _this = this;\n        if (!normalizedDirective.isComponent) {\n            return;\n        }\n        var /** @type {?} */ template = ((normalizedDirective.template));\n        this._resourceLoaderCache.delete(/** @type {?} */ ((template.templateUrl)));\n        template.externalStylesheets.forEach(function (stylesheet) { _this._resourceLoaderCache.delete(/** @type {?} */ ((stylesheet.moduleUrl))); });\n    };\n    /**\n     * @param {?} url\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype._fetch = function (url) {\n        var /** @type {?} */ result = this._resourceLoaderCache.get(url);\n        if (!result) {\n            result = this._resourceLoader.get(url);\n            this._resourceLoaderCache.set(url, result);\n        }\n        return result;\n    };\n    /**\n     * @param {?} prenormData\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.normalizeTemplate = function (prenormData) {\n        var _this = this;\n        if (isDefined(prenormData.template)) {\n            if (isDefined(prenormData.templateUrl)) {\n                throw syntaxError(\"'\" + _angular_core.ɵstringify(prenormData.componentType) + \"' component cannot define both template and templateUrl\");\n            }\n            if (typeof prenormData.template !== 'string') {\n                throw syntaxError(\"The template specified for component \" + _angular_core.ɵstringify(prenormData.componentType) + \" is not a string\");\n            }\n        }\n        else if (isDefined(prenormData.templateUrl)) {\n            if (typeof prenormData.templateUrl !== 'string') {\n                throw syntaxError(\"The templateUrl specified for component \" + _angular_core.ɵstringify(prenormData.componentType) + \" is not a string\");\n            }\n        }\n        else {\n            throw syntaxError(\"No template specified for component \" + _angular_core.ɵstringify(prenormData.componentType));\n        }\n        return SyncAsync.then(this.normalizeTemplateOnly(prenormData), function (result) { return _this.normalizeExternalStylesheets(result); });\n    };\n    /**\n     * @param {?} prenomData\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.normalizeTemplateOnly = function (prenomData) {\n        var _this = this;\n        var /** @type {?} */ template;\n        var /** @type {?} */ templateUrl;\n        if (prenomData.template != null) {\n            template = prenomData.template;\n            templateUrl = prenomData.moduleUrl;\n        }\n        else {\n            templateUrl = this._urlResolver.resolve(prenomData.moduleUrl, /** @type {?} */ ((prenomData.templateUrl)));\n            template = this._fetch(templateUrl);\n        }\n        return SyncAsync.then(template, function (template) { return _this.normalizeLoadedTemplate(prenomData, template, templateUrl); });\n    };\n    /**\n     * @param {?} prenormData\n     * @param {?} template\n     * @param {?} templateAbsUrl\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.normalizeLoadedTemplate = function (prenormData, template, templateAbsUrl) {\n        var /** @type {?} */ isInline = !!prenormData.template;\n        var /** @type {?} */ interpolationConfig = InterpolationConfig.fromArray(/** @type {?} */ ((prenormData.interpolation)));\n        var /** @type {?} */ rootNodesAndErrors = this._htmlParser.parse(template, templateSourceUrl({ reference: prenormData.ngModuleType }, { type: { reference: prenormData.componentType } }, { isInline: isInline, templateUrl: templateAbsUrl }), true, interpolationConfig);\n        if (rootNodesAndErrors.errors.length > 0) {\n            var /** @type {?} */ errorString = rootNodesAndErrors.errors.join('\\n');\n            throw syntaxError(\"Template parse errors:\\n\" + errorString);\n        }\n        var /** @type {?} */ templateMetadataStyles = this.normalizeStylesheet(new CompileStylesheetMetadata({\n            styles: prenormData.styles,\n            styleUrls: prenormData.styleUrls,\n            moduleUrl: prenormData.moduleUrl\n        }));\n        var /** @type {?} */ visitor = new TemplatePreparseVisitor();\n        visitAll(visitor, rootNodesAndErrors.rootNodes);\n        var /** @type {?} */ templateStyles = this.normalizeStylesheet(new CompileStylesheetMetadata({ styles: visitor.styles, styleUrls: visitor.styleUrls, moduleUrl: templateAbsUrl }));\n        var /** @type {?} */ encapsulation = prenormData.encapsulation;\n        if (encapsulation == null) {\n            encapsulation = this._config.defaultEncapsulation;\n        }\n        var /** @type {?} */ styles = templateMetadataStyles.styles.concat(templateStyles.styles);\n        var /** @type {?} */ styleUrls = templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls);\n        if (encapsulation === _angular_core.ViewEncapsulation.Emulated && styles.length === 0 &&\n            styleUrls.length === 0) {\n            encapsulation = _angular_core.ViewEncapsulation.None;\n        }\n        return new CompileTemplateMetadata({\n            encapsulation: encapsulation,\n            template: template,\n            templateUrl: templateAbsUrl, styles: styles, styleUrls: styleUrls,\n            ngContentSelectors: visitor.ngContentSelectors,\n            animations: prenormData.animations,\n            interpolation: prenormData.interpolation, isInline: isInline,\n            externalStylesheets: []\n        });\n    };\n    /**\n     * @param {?} templateMeta\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.normalizeExternalStylesheets = function (templateMeta) {\n        return SyncAsync.then(this._loadMissingExternalStylesheets(templateMeta.styleUrls), function (externalStylesheets) { return new CompileTemplateMetadata({\n            encapsulation: templateMeta.encapsulation,\n            template: templateMeta.template,\n            templateUrl: templateMeta.templateUrl,\n            styles: templateMeta.styles,\n            styleUrls: templateMeta.styleUrls,\n            externalStylesheets: externalStylesheets,\n            ngContentSelectors: templateMeta.ngContentSelectors,\n            animations: templateMeta.animations,\n            interpolation: templateMeta.interpolation,\n            isInline: templateMeta.isInline,\n        }); });\n    };\n    /**\n     * @param {?} styleUrls\n     * @param {?=} loadedStylesheets\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype._loadMissingExternalStylesheets = function (styleUrls, loadedStylesheets) {\n        var _this = this;\n        if (loadedStylesheets === void 0) { loadedStylesheets = new Map(); }\n        return SyncAsync.then(SyncAsync.all(styleUrls.filter(function (styleUrl) { return !loadedStylesheets.has(styleUrl); })\n            .map(function (styleUrl) { return SyncAsync.then(_this._fetch(styleUrl), function (loadedStyle) {\n            var /** @type {?} */ stylesheet = _this.normalizeStylesheet(new CompileStylesheetMetadata({ styles: [loadedStyle], moduleUrl: styleUrl }));\n            loadedStylesheets.set(styleUrl, stylesheet);\n            return _this._loadMissingExternalStylesheets(stylesheet.styleUrls, loadedStylesheets);\n        }); })), function (_) { return Array.from(loadedStylesheets.values()); });\n    };\n    /**\n     * @param {?} stylesheet\n     * @return {?}\n     */\n    DirectiveNormalizer.prototype.normalizeStylesheet = function (stylesheet) {\n        var _this = this;\n        var /** @type {?} */ moduleUrl = ((stylesheet.moduleUrl));\n        var /** @type {?} */ allStyleUrls = stylesheet.styleUrls.filter(isStyleUrlResolvable)\n            .map(function (url) { return _this._urlResolver.resolve(moduleUrl, url); });\n        var /** @type {?} */ allStyles = stylesheet.styles.map(function (style$$1) {\n            var /** @type {?} */ styleWithImports = extractStyleUrls(_this._urlResolver, moduleUrl, style$$1);\n            allStyleUrls.push.apply(allStyleUrls, styleWithImports.styleUrls);\n            return styleWithImports.style;\n        });\n        return new CompileStylesheetMetadata({ styles: allStyles, styleUrls: allStyleUrls, moduleUrl: moduleUrl });\n    };\n    return DirectiveNormalizer;\n}());\nDirectiveNormalizer.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nDirectiveNormalizer.ctorParameters = function () { return [\n    { type: ResourceLoader, },\n    { type: UrlResolver, },\n    { type: HtmlParser, },\n    { type: CompilerConfig, },\n]; };\nvar TemplatePreparseVisitor = (function () {\n    function TemplatePreparseVisitor() {\n        this.ngContentSelectors = [];\n        this.styles = [];\n        this.styleUrls = [];\n        this.ngNonBindableStackCount = 0;\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    TemplatePreparseVisitor.prototype.visitElement = function (ast, context) {\n        var /** @type {?} */ preparsedElement = preparseElement(ast);\n        switch (preparsedElement.type) {\n            case PreparsedElementType.NG_CONTENT:\n                if (this.ngNonBindableStackCount === 0) {\n                    this.ngContentSelectors.push(preparsedElement.selectAttr);\n                }\n                break;\n            case PreparsedElementType.STYLE:\n                var /** @type {?} */ textContent_1 = '';\n                ast.children.forEach(function (child) {\n                    if (child instanceof Text) {\n                        textContent_1 += child.value;\n                    }\n                });\n                this.styles.push(textContent_1);\n                break;\n            case PreparsedElementType.STYLESHEET:\n                this.styleUrls.push(preparsedElement.hrefAttr);\n                break;\n            default:\n                break;\n        }\n        if (preparsedElement.nonBindable) {\n            this.ngNonBindableStackCount++;\n        }\n        visitAll(this, ast.children);\n        if (preparsedElement.nonBindable) {\n            this.ngNonBindableStackCount--;\n        }\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    TemplatePreparseVisitor.prototype.visitExpansion = function (ast, context) { visitAll(this, ast.cases); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    TemplatePreparseVisitor.prototype.visitExpansionCase = function (ast, context) {\n        visitAll(this, ast.expression);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    TemplatePreparseVisitor.prototype.visitComment = function (ast, context) { return null; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    TemplatePreparseVisitor.prototype.visitAttribute = function (ast, context) { return null; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    TemplatePreparseVisitor.prototype.visitText = function (ast, context) { return null; };\n    return TemplatePreparseVisitor;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar DirectiveResolver = (function () {\n    /**\n     * @param {?} _reflector\n     */\n    function DirectiveResolver(_reflector) {\n        this._reflector = _reflector;\n    }\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    DirectiveResolver.prototype.isDirective = function (type) {\n        var /** @type {?} */ typeMetadata = this._reflector.annotations(_angular_core.resolveForwardRef(type));\n        return typeMetadata && typeMetadata.some(isDirectiveMetadata);\n    };\n    /**\n     * @param {?} type\n     * @param {?=} throwIfNotFound\n     * @return {?}\n     */\n    DirectiveResolver.prototype.resolve = function (type, throwIfNotFound) {\n        if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n        var /** @type {?} */ typeMetadata = this._reflector.annotations(_angular_core.resolveForwardRef(type));\n        if (typeMetadata) {\n            var /** @type {?} */ metadata = findLast(typeMetadata, isDirectiveMetadata);\n            if (metadata) {\n                var /** @type {?} */ propertyMetadata = this._reflector.propMetadata(type);\n                return this._mergeWithPropertyMetadata(metadata, propertyMetadata, type);\n            }\n        }\n        if (throwIfNotFound) {\n            throw new Error(\"No Directive annotation found on \" + _angular_core.ɵstringify(type));\n        }\n        return null;\n    };\n    /**\n     * @param {?} dm\n     * @param {?} propertyMetadata\n     * @param {?} directiveType\n     * @return {?}\n     */\n    DirectiveResolver.prototype._mergeWithPropertyMetadata = function (dm, propertyMetadata, directiveType) {\n        var /** @type {?} */ inputs = [];\n        var /** @type {?} */ outputs = [];\n        var /** @type {?} */ host = {};\n        var /** @type {?} */ queries = {};\n        Object.keys(propertyMetadata).forEach(function (propName) {\n            var /** @type {?} */ input = findLast(propertyMetadata[propName], function (a) { return a instanceof _angular_core.Input; });\n            if (input) {\n                if (input.bindingPropertyName) {\n                    inputs.push(propName + \": \" + input.bindingPropertyName);\n                }\n                else {\n                    inputs.push(propName);\n                }\n            }\n            var /** @type {?} */ output = findLast(propertyMetadata[propName], function (a) { return a instanceof _angular_core.Output; });\n            if (output) {\n                if (output.bindingPropertyName) {\n                    outputs.push(propName + \": \" + output.bindingPropertyName);\n                }\n                else {\n                    outputs.push(propName);\n                }\n            }\n            var /** @type {?} */ hostBindings = propertyMetadata[propName].filter(function (a) { return a && a instanceof _angular_core.HostBinding; });\n            hostBindings.forEach(function (hostBinding) {\n                if (hostBinding.hostPropertyName) {\n                    var /** @type {?} */ startWith = hostBinding.hostPropertyName[0];\n                    if (startWith === '(') {\n                        throw new Error(\"@HostBinding can not bind to events. Use @HostListener instead.\");\n                    }\n                    else if (startWith === '[') {\n                        throw new Error(\"@HostBinding parameter should be a property name, 'class.<name>', or 'attr.<name>'.\");\n                    }\n                    host[\"[\" + hostBinding.hostPropertyName + \"]\"] = propName;\n                }\n                else {\n                    host[\"[\" + propName + \"]\"] = propName;\n                }\n            });\n            var /** @type {?} */ hostListeners = propertyMetadata[propName].filter(function (a) { return a && a instanceof _angular_core.HostListener; });\n            hostListeners.forEach(function (hostListener) {\n                var /** @type {?} */ args = hostListener.args || [];\n                host[\"(\" + hostListener.eventName + \")\"] = propName + \"(\" + args.join(',') + \")\";\n            });\n            var /** @type {?} */ query = findLast(propertyMetadata[propName], function (a) { return a instanceof _angular_core.Query; });\n            if (query) {\n                queries[propName] = query;\n            }\n        });\n        return this._merge(dm, inputs, outputs, host, queries, directiveType);\n    };\n    /**\n     * @param {?} def\n     * @return {?}\n     */\n    DirectiveResolver.prototype._extractPublicName = function (def) { return splitAtColon(def, [/** @type {?} */ ((null)), def])[1].trim(); };\n    /**\n     * @param {?} bindings\n     * @return {?}\n     */\n    DirectiveResolver.prototype._dedupeBindings = function (bindings) {\n        var /** @type {?} */ names = new Set();\n        var /** @type {?} */ reversedResult = [];\n        // go last to first to allow later entries to overwrite previous entries\n        for (var /** @type {?} */ i = bindings.length - 1; i >= 0; i--) {\n            var /** @type {?} */ binding = bindings[i];\n            var /** @type {?} */ name = this._extractPublicName(binding);\n            if (!names.has(name)) {\n                names.add(name);\n                reversedResult.push(binding);\n            }\n        }\n        return reversedResult.reverse();\n    };\n    /**\n     * @param {?} directive\n     * @param {?} inputs\n     * @param {?} outputs\n     * @param {?} host\n     * @param {?} queries\n     * @param {?} directiveType\n     * @return {?}\n     */\n    DirectiveResolver.prototype._merge = function (directive, inputs, outputs, host, queries, directiveType) {\n        var /** @type {?} */ mergedInputs = this._dedupeBindings(directive.inputs ? directive.inputs.concat(inputs) : inputs);\n        var /** @type {?} */ mergedOutputs = this._dedupeBindings(directive.outputs ? directive.outputs.concat(outputs) : outputs);\n        var /** @type {?} */ mergedHost = directive.host ? Object.assign({}, directive.host, host) : host;\n        var /** @type {?} */ mergedQueries = directive.queries ? Object.assign({}, directive.queries, queries) : queries;\n        if (directive instanceof _angular_core.Component) {\n            return new _angular_core.Component({\n                selector: directive.selector,\n                inputs: mergedInputs,\n                outputs: mergedOutputs,\n                host: mergedHost,\n                exportAs: directive.exportAs,\n                moduleId: directive.moduleId,\n                queries: mergedQueries,\n                changeDetection: directive.changeDetection,\n                providers: directive.providers,\n                viewProviders: directive.viewProviders,\n                entryComponents: directive.entryComponents,\n                template: directive.template,\n                templateUrl: directive.templateUrl,\n                styles: directive.styles,\n                styleUrls: directive.styleUrls,\n                encapsulation: directive.encapsulation,\n                animations: directive.animations,\n                interpolation: directive.interpolation\n            });\n        }\n        else {\n            return new _angular_core.Directive({\n                selector: directive.selector,\n                inputs: mergedInputs,\n                outputs: mergedOutputs,\n                host: mergedHost,\n                exportAs: directive.exportAs,\n                queries: mergedQueries,\n                providers: directive.providers\n            });\n        }\n    };\n    return DirectiveResolver;\n}());\nDirectiveResolver.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nDirectiveResolver.ctorParameters = function () { return [\n    { type: CompileReflector, },\n]; };\n/**\n * @param {?} type\n * @return {?}\n */\nfunction isDirectiveMetadata(type) {\n    return type instanceof _angular_core.Directive;\n}\n/**\n * @template T\n * @param {?} arr\n * @param {?} condition\n * @return {?}\n */\nfunction findLast(arr, condition) {\n    for (var /** @type {?} */ i = arr.length - 1; i >= 0; i--) {\n        if (condition(arr[i])) {\n            return arr[i];\n        }\n    }\n    return null;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar STRIP_SRC_FILE_SUFFIXES = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\nvar GENERATED_FILE = /\\.ngfactory\\.|\\.ngsummary\\./;\nvar JIT_SUMMARY_FILE = /\\.ngsummary\\./;\nvar JIT_SUMMARY_NAME = /NgSummary$/;\n/**\n * @param {?} filePath\n * @param {?=} forceSourceFile\n * @return {?}\n */\nfunction ngfactoryFilePath(filePath, forceSourceFile) {\n    if (forceSourceFile === void 0) { forceSourceFile = false; }\n    var /** @type {?} */ urlWithSuffix = splitTypescriptSuffix(filePath, forceSourceFile);\n    return urlWithSuffix[0] + \".ngfactory\" + urlWithSuffix[1];\n}\n/**\n * @param {?} filePath\n * @return {?}\n */\nfunction stripGeneratedFileSuffix(filePath) {\n    return filePath.replace(GENERATED_FILE, '.');\n}\n/**\n * @param {?} filePath\n * @return {?}\n */\nfunction isGeneratedFile(filePath) {\n    return GENERATED_FILE.test(filePath);\n}\n/**\n * @param {?} path\n * @param {?=} forceSourceFile\n * @return {?}\n */\nfunction splitTypescriptSuffix(path, forceSourceFile) {\n    if (forceSourceFile === void 0) { forceSourceFile = false; }\n    if (path.endsWith('.d.ts')) {\n        return [path.slice(0, -5), forceSourceFile ? '.ts' : '.d.ts'];\n    }\n    var /** @type {?} */ lastDot = path.lastIndexOf('.');\n    if (lastDot !== -1) {\n        return [path.substring(0, lastDot), path.substring(lastDot)];\n    }\n    return [path, ''];\n}\n/**\n * @param {?} fileName\n * @return {?}\n */\nfunction summaryFileName(fileName) {\n    var /** @type {?} */ fileNameWithoutSuffix = fileName.replace(STRIP_SRC_FILE_SUFFIXES, '');\n    return fileNameWithoutSuffix + \".ngsummary.json\";\n}\n/**\n * @param {?} fileName\n * @param {?=} forceSourceFile\n * @return {?}\n */\nfunction summaryForJitFileName(fileName, forceSourceFile) {\n    if (forceSourceFile === void 0) { forceSourceFile = false; }\n    var /** @type {?} */ urlWithSuffix = splitTypescriptSuffix(stripGeneratedFileSuffix(fileName), forceSourceFile);\n    return urlWithSuffix[0] + \".ngsummary\" + urlWithSuffix[1];\n}\n/**\n * @param {?} filePath\n * @return {?}\n */\nfunction stripSummaryForJitFileSuffix(filePath) {\n    return filePath.replace(JIT_SUMMARY_FILE, '.');\n}\n/**\n * @param {?} symbolName\n * @return {?}\n */\nfunction summaryForJitName(symbolName) {\n    return symbolName + \"NgSummary\";\n}\n/**\n * @param {?} symbolName\n * @return {?}\n */\nfunction stripSummaryForJitNameSuffix(symbolName) {\n    return symbolName.replace(JIT_SUMMARY_NAME, '');\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar LifecycleHooks = {};\nLifecycleHooks.OnInit = 0;\nLifecycleHooks.OnDestroy = 1;\nLifecycleHooks.DoCheck = 2;\nLifecycleHooks.OnChanges = 3;\nLifecycleHooks.AfterContentInit = 4;\nLifecycleHooks.AfterContentChecked = 5;\nLifecycleHooks.AfterViewInit = 6;\nLifecycleHooks.AfterViewChecked = 7;\nLifecycleHooks[LifecycleHooks.OnInit] = \"OnInit\";\nLifecycleHooks[LifecycleHooks.OnDestroy] = \"OnDestroy\";\nLifecycleHooks[LifecycleHooks.DoCheck] = \"DoCheck\";\nLifecycleHooks[LifecycleHooks.OnChanges] = \"OnChanges\";\nLifecycleHooks[LifecycleHooks.AfterContentInit] = \"AfterContentInit\";\nLifecycleHooks[LifecycleHooks.AfterContentChecked] = \"AfterContentChecked\";\nLifecycleHooks[LifecycleHooks.AfterViewInit] = \"AfterViewInit\";\nLifecycleHooks[LifecycleHooks.AfterViewChecked] = \"AfterViewChecked\";\nvar LIFECYCLE_HOOKS_VALUES = [\n    LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,\n    LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,\n    LifecycleHooks.AfterViewChecked\n];\n/**\n * @param {?} reflector\n * @param {?} hook\n * @param {?} token\n * @return {?}\n */\nfunction hasLifecycleHook(reflector, hook, token) {\n    return reflector.hasLifecycleHook(token, getHookName(hook));\n}\n/**\n * @param {?} reflector\n * @param {?} token\n * @return {?}\n */\nfunction getAllLifecycleHooks(reflector, token) {\n    return LIFECYCLE_HOOKS_VALUES.filter(function (hook) { return hasLifecycleHook(reflector, hook, token); });\n}\n/**\n * @param {?} hook\n * @return {?}\n */\nfunction getHookName(hook) {\n    switch (hook) {\n        case LifecycleHooks.OnInit:\n            return 'ngOnInit';\n        case LifecycleHooks.OnDestroy:\n            return 'ngOnDestroy';\n        case LifecycleHooks.DoCheck:\n            return 'ngDoCheck';\n        case LifecycleHooks.OnChanges:\n            return 'ngOnChanges';\n        case LifecycleHooks.AfterContentInit:\n            return 'ngAfterContentInit';\n        case LifecycleHooks.AfterContentChecked:\n            return 'ngAfterContentChecked';\n        case LifecycleHooks.AfterViewInit:\n            return 'ngAfterViewInit';\n        case LifecycleHooks.AfterViewChecked:\n            return 'ngAfterViewChecked';\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction _isNgModuleMetadata(obj) {\n    return obj instanceof _angular_core.NgModule;\n}\n/**\n * Resolves types to {\\@link NgModule}.\n */\nvar NgModuleResolver = (function () {\n    /**\n     * @param {?} _reflector\n     */\n    function NgModuleResolver(_reflector) {\n        this._reflector = _reflector;\n    }\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    NgModuleResolver.prototype.isNgModule = function (type) { return this._reflector.annotations(type).some(_isNgModuleMetadata); };\n    /**\n     * @param {?} type\n     * @param {?=} throwIfNotFound\n     * @return {?}\n     */\n    NgModuleResolver.prototype.resolve = function (type, throwIfNotFound) {\n        if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n        var /** @type {?} */ ngModuleMeta = findLast(this._reflector.annotations(type), _isNgModuleMetadata);\n        if (ngModuleMeta) {\n            return ngModuleMeta;\n        }\n        else {\n            if (throwIfNotFound) {\n                throw new Error(\"No NgModule metadata found for '\" + _angular_core.ɵstringify(type) + \"'.\");\n            }\n            return null;\n        }\n    };\n    return NgModuleResolver;\n}());\nNgModuleResolver.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nNgModuleResolver.ctorParameters = function () { return [\n    { type: CompileReflector, },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} type\n * @return {?}\n */\nfunction _isPipeMetadata(type) {\n    return type instanceof _angular_core.Pipe;\n}\n/**\n * Resolve a `Type` for {\\@link Pipe}.\n *\n * This interface can be overridden by the application developer to create custom behavior.\n *\n * See {\\@link Compiler}\n */\nvar PipeResolver = (function () {\n    /**\n     * @param {?} _reflector\n     */\n    function PipeResolver(_reflector) {\n        this._reflector = _reflector;\n    }\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    PipeResolver.prototype.isPipe = function (type) {\n        var /** @type {?} */ typeMetadata = this._reflector.annotations(_angular_core.resolveForwardRef(type));\n        return typeMetadata && typeMetadata.some(_isPipeMetadata);\n    };\n    /**\n     * Return {\\@link Pipe} for a given `Type`.\n     * @param {?} type\n     * @param {?=} throwIfNotFound\n     * @return {?}\n     */\n    PipeResolver.prototype.resolve = function (type, throwIfNotFound) {\n        if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n        var /** @type {?} */ metas = this._reflector.annotations(_angular_core.resolveForwardRef(type));\n        if (metas) {\n            var /** @type {?} */ annotation = findLast(metas, _isPipeMetadata);\n            if (annotation) {\n                return annotation;\n            }\n        }\n        if (throwIfNotFound) {\n            throw new Error(\"No Pipe decorator found on \" + _angular_core.ɵstringify(type));\n        }\n        return null;\n    };\n    return PipeResolver;\n}());\nPipeResolver.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nPipeResolver.ctorParameters = function () { return [\n    { type: CompileReflector, },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @abstract\n */\nvar SummaryResolver = (function () {\n    function SummaryResolver() {\n    }\n    /**\n     * @abstract\n     * @param {?} fileName\n     * @return {?}\n     */\n    SummaryResolver.prototype.isLibraryFile = function (fileName) { };\n    /**\n     * @abstract\n     * @param {?} fileName\n     * @return {?}\n     */\n    SummaryResolver.prototype.getLibraryFileName = function (fileName) { };\n    /**\n     * @abstract\n     * @param {?} reference\n     * @return {?}\n     */\n    SummaryResolver.prototype.resolveSummary = function (reference) { };\n    /**\n     * @abstract\n     * @param {?} filePath\n     * @return {?}\n     */\n    SummaryResolver.prototype.getSymbolsOf = function (filePath) { };\n    /**\n     * @abstract\n     * @param {?} reference\n     * @return {?}\n     */\n    SummaryResolver.prototype.getImportAs = function (reference) { };\n    /**\n     * @abstract\n     * @param {?} summary\n     * @return {?}\n     */\n    SummaryResolver.prototype.addSummary = function (summary) { };\n    return SummaryResolver;\n}());\nvar JitSummaryResolver = (function () {\n    function JitSummaryResolver() {\n        this._summaries = new Map();\n    }\n    /**\n     * @param {?} fileName\n     * @return {?}\n     */\n    JitSummaryResolver.prototype.isLibraryFile = function (fileName) { return false; };\n    \n    /**\n     * @param {?} fileName\n     * @return {?}\n     */\n    JitSummaryResolver.prototype.getLibraryFileName = function (fileName) { return null; };\n    /**\n     * @param {?} reference\n     * @return {?}\n     */\n    JitSummaryResolver.prototype.resolveSummary = function (reference) {\n        return this._summaries.get(reference) || null;\n    };\n    \n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    JitSummaryResolver.prototype.getSymbolsOf = function (filePath) { return []; };\n    /**\n     * @param {?} reference\n     * @return {?}\n     */\n    JitSummaryResolver.prototype.getImportAs = function (reference) { return reference; };\n    /**\n     * @param {?} summary\n     * @return {?}\n     */\n    JitSummaryResolver.prototype.addSummary = function (summary) { this._summaries.set(summary.symbol, summary); };\n    \n    return JitSummaryResolver;\n}());\nJitSummaryResolver.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nJitSummaryResolver.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ERROR_COLLECTOR_TOKEN = new _angular_core.InjectionToken('ErrorCollector');\nvar CompileMetadataResolver = (function () {\n    /**\n     * @param {?} _config\n     * @param {?} _ngModuleResolver\n     * @param {?} _directiveResolver\n     * @param {?} _pipeResolver\n     * @param {?} _summaryResolver\n     * @param {?} _schemaRegistry\n     * @param {?} _directiveNormalizer\n     * @param {?} _console\n     * @param {?} _staticSymbolCache\n     * @param {?} _reflector\n     * @param {?=} _errorCollector\n     */\n    function CompileMetadataResolver(_config, _ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _console, _staticSymbolCache, _reflector, _errorCollector) {\n        this._config = _config;\n        this._ngModuleResolver = _ngModuleResolver;\n        this._directiveResolver = _directiveResolver;\n        this._pipeResolver = _pipeResolver;\n        this._summaryResolver = _summaryResolver;\n        this._schemaRegistry = _schemaRegistry;\n        this._directiveNormalizer = _directiveNormalizer;\n        this._console = _console;\n        this._staticSymbolCache = _staticSymbolCache;\n        this._reflector = _reflector;\n        this._errorCollector = _errorCollector;\n        this._nonNormalizedDirectiveCache = new Map();\n        this._directiveCache = new Map();\n        this._summaryCache = new Map();\n        this._pipeCache = new Map();\n        this._ngModuleCache = new Map();\n        this._ngModuleOfTypes = new Map();\n    }\n    /**\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getReflector = function () { return this._reflector; };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.clearCacheFor = function (type) {\n        var /** @type {?} */ dirMeta = this._directiveCache.get(type);\n        this._directiveCache.delete(type);\n        this._nonNormalizedDirectiveCache.delete(type);\n        this._summaryCache.delete(type);\n        this._pipeCache.delete(type);\n        this._ngModuleOfTypes.delete(type);\n        // Clear all of the NgModule as they contain transitive information!\n        this._ngModuleCache.clear();\n        if (dirMeta) {\n            this._directiveNormalizer.clearCacheFor(dirMeta);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.clearCache = function () {\n        this._directiveCache.clear();\n        this._nonNormalizedDirectiveCache.clear();\n        this._summaryCache.clear();\n        this._pipeCache.clear();\n        this._ngModuleCache.clear();\n        this._ngModuleOfTypes.clear();\n        this._directiveNormalizer.clearCache();\n    };\n    /**\n     * @param {?} baseType\n     * @param {?} name\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._createProxyClass = function (baseType, name) {\n        var /** @type {?} */ delegate = null;\n        var /** @type {?} */ proxyClass = (function () {\n            if (!delegate) {\n                throw new Error(\"Illegal state: Class \" + name + \" for type \" + _angular_core.ɵstringify(baseType) + \" is not compiled yet!\");\n            }\n            return delegate.apply(this, arguments);\n        });\n        proxyClass.setDelegate = function (d) {\n            delegate = d;\n            ((proxyClass)).prototype = d.prototype;\n        };\n        // Make stringify work correctly\n        ((proxyClass)).overriddenName = name;\n        return proxyClass;\n    };\n    /**\n     * @param {?} dirType\n     * @param {?} name\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getGeneratedClass = function (dirType, name) {\n        if (dirType instanceof StaticSymbol) {\n            return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), name);\n        }\n        else {\n            return this._createProxyClass(dirType, name);\n        }\n    };\n    /**\n     * @param {?} dirType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getComponentViewClass = function (dirType) {\n        return this.getGeneratedClass(dirType, viewClassName(dirType, 0));\n    };\n    /**\n     * @param {?} dirType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getHostComponentViewClass = function (dirType) {\n        return this.getGeneratedClass(dirType, hostViewClassName(dirType));\n    };\n    /**\n     * @param {?} dirType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getHostComponentType = function (dirType) {\n        var /** @type {?} */ name = identifierName({ reference: dirType }) + \"_Host\";\n        if (dirType instanceof StaticSymbol) {\n            return this._staticSymbolCache.get(dirType.filePath, name);\n        }\n        else {\n            var /** @type {?} */ HostClass = (function HostClass() { });\n            HostClass.overriddenName = name;\n            return HostClass;\n        }\n    };\n    /**\n     * @param {?} dirType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getRendererType = function (dirType) {\n        if (dirType instanceof StaticSymbol) {\n            return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), rendererTypeName(dirType));\n        }\n        else {\n            // returning an object as proxy,\n            // that we fill later during runtime compilation.\n            return ({});\n        }\n    };\n    /**\n     * @param {?} selector\n     * @param {?} dirType\n     * @param {?} inputs\n     * @param {?} outputs\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getComponentFactory = function (selector, dirType, inputs, outputs) {\n        if (dirType instanceof StaticSymbol) {\n            return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), componentFactoryName(dirType));\n        }\n        else {\n            var /** @type {?} */ hostView = this.getHostComponentViewClass(dirType);\n            // Note: ngContentSelectors will be filled later once the template is\n            // loaded.\n            return _angular_core.ɵccf(selector, dirType, /** @type {?} */ (hostView), inputs, outputs, []);\n        }\n    };\n    /**\n     * @param {?} factory\n     * @param {?} ngContentSelectors\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.initComponentFactory = function (factory, ngContentSelectors) {\n        if (!(factory instanceof StaticSymbol)) {\n            (_a = factory.ngContentSelectors).push.apply(_a, ngContentSelectors);\n        }\n        var _a;\n    };\n    /**\n     * @param {?} type\n     * @param {?} kind\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._loadSummary = function (type, kind) {\n        var /** @type {?} */ typeSummary = this._summaryCache.get(type);\n        if (!typeSummary) {\n            var /** @type {?} */ summary = this._summaryResolver.resolveSummary(type);\n            typeSummary = summary ? summary.type : null;\n            this._summaryCache.set(type, typeSummary || null);\n        }\n        return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;\n    };\n    /**\n     * @param {?} ngModuleType\n     * @param {?} directiveType\n     * @param {?} isSync\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.loadDirectiveMetadata = function (ngModuleType, directiveType, isSync) {\n        var _this = this;\n        if (this._directiveCache.has(directiveType)) {\n            return null;\n        }\n        directiveType = _angular_core.resolveForwardRef(directiveType);\n        var _a = ((this.getNonNormalizedDirectiveMetadata(directiveType))), annotation = _a.annotation, metadata = _a.metadata;\n        var /** @type {?} */ createDirectiveMetadata = function (templateMetadata) {\n            var /** @type {?} */ normalizedDirMeta = new CompileDirectiveMetadata({\n                isHost: false,\n                type: metadata.type,\n                isComponent: metadata.isComponent,\n                selector: metadata.selector,\n                exportAs: metadata.exportAs,\n                changeDetection: metadata.changeDetection,\n                inputs: metadata.inputs,\n                outputs: metadata.outputs,\n                hostListeners: metadata.hostListeners,\n                hostProperties: metadata.hostProperties,\n                hostAttributes: metadata.hostAttributes,\n                providers: metadata.providers,\n                viewProviders: metadata.viewProviders,\n                queries: metadata.queries,\n                viewQueries: metadata.viewQueries,\n                entryComponents: metadata.entryComponents,\n                componentViewType: metadata.componentViewType,\n                rendererType: metadata.rendererType,\n                componentFactory: metadata.componentFactory,\n                template: templateMetadata\n            });\n            if (templateMetadata) {\n                _this.initComponentFactory(/** @type {?} */ ((metadata.componentFactory)), templateMetadata.ngContentSelectors);\n            }\n            _this._directiveCache.set(directiveType, normalizedDirMeta);\n            _this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());\n            return null;\n        };\n        if (metadata.isComponent) {\n            var /** @type {?} */ template = ((metadata.template));\n            var /** @type {?} */ templateMeta = this._directiveNormalizer.normalizeTemplate({\n                ngModuleType: ngModuleType,\n                componentType: directiveType,\n                moduleUrl: this._reflector.componentModuleUrl(directiveType, annotation),\n                encapsulation: template.encapsulation,\n                template: template.template,\n                templateUrl: template.templateUrl,\n                styles: template.styles,\n                styleUrls: template.styleUrls,\n                animations: template.animations,\n                interpolation: template.interpolation\n            });\n            if (_angular_core.ɵisPromise(templateMeta) && isSync) {\n                this._reportError(componentStillLoadingError(directiveType), directiveType);\n                return null;\n            }\n            return SyncAsync.then(templateMeta, createDirectiveMetadata);\n        }\n        else {\n            // directive\n            createDirectiveMetadata(null);\n            return null;\n        }\n    };\n    /**\n     * @param {?} directiveType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = function (directiveType) {\n        var _this = this;\n        directiveType = _angular_core.resolveForwardRef(directiveType);\n        if (!directiveType) {\n            return null;\n        }\n        var /** @type {?} */ cacheEntry = this._nonNormalizedDirectiveCache.get(directiveType);\n        if (cacheEntry) {\n            return cacheEntry;\n        }\n        var /** @type {?} */ dirMeta = this._directiveResolver.resolve(directiveType, false);\n        if (!dirMeta) {\n            return null;\n        }\n        var /** @type {?} */ nonNormalizedTemplateMetadata = ((undefined));\n        if (dirMeta instanceof _angular_core.Component) {\n            // component\n            assertArrayOfStrings('styles', dirMeta.styles);\n            assertArrayOfStrings('styleUrls', dirMeta.styleUrls);\n            assertInterpolationSymbols('interpolation', dirMeta.interpolation);\n            var /** @type {?} */ animations = dirMeta.animations;\n            nonNormalizedTemplateMetadata = new CompileTemplateMetadata({\n                encapsulation: noUndefined(dirMeta.encapsulation),\n                template: noUndefined(dirMeta.template),\n                templateUrl: noUndefined(dirMeta.templateUrl),\n                styles: dirMeta.styles || [],\n                styleUrls: dirMeta.styleUrls || [],\n                animations: animations || [],\n                interpolation: noUndefined(dirMeta.interpolation),\n                isInline: !!dirMeta.template,\n                externalStylesheets: [],\n                ngContentSelectors: []\n            });\n        }\n        var /** @type {?} */ changeDetectionStrategy = ((null));\n        var /** @type {?} */ viewProviders = [];\n        var /** @type {?} */ entryComponentMetadata = [];\n        var /** @type {?} */ selector = dirMeta.selector;\n        if (dirMeta instanceof _angular_core.Component) {\n            // Component\n            changeDetectionStrategy = ((dirMeta.changeDetection));\n            if (dirMeta.viewProviders) {\n                viewProviders = this._getProvidersMetadata(dirMeta.viewProviders, entryComponentMetadata, \"viewProviders for \\\"\" + stringifyType(directiveType) + \"\\\"\", [], directiveType);\n            }\n            if (dirMeta.entryComponents) {\n                entryComponentMetadata = flattenAndDedupeArray(dirMeta.entryComponents)\n                    .map(function (type) { return ((_this._getEntryComponentMetadata(type))); })\n                    .concat(entryComponentMetadata);\n            }\n            if (!selector) {\n                selector = this._schemaRegistry.getDefaultComponentElementName();\n            }\n        }\n        else {\n            // Directive\n            if (!selector) {\n                this._reportError(syntaxError(\"Directive \" + stringifyType(directiveType) + \" has no selector, please add it!\"), directiveType);\n                selector = 'error';\n            }\n        }\n        var /** @type {?} */ providers = [];\n        if (dirMeta.providers != null) {\n            providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, \"providers for \\\"\" + stringifyType(directiveType) + \"\\\"\", [], directiveType);\n        }\n        var /** @type {?} */ queries = [];\n        var /** @type {?} */ viewQueries = [];\n        if (dirMeta.queries != null) {\n            queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);\n            viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);\n        }\n        var /** @type {?} */ metadata = CompileDirectiveMetadata.create({\n            isHost: false,\n            selector: selector,\n            exportAs: noUndefined(dirMeta.exportAs),\n            isComponent: !!nonNormalizedTemplateMetadata,\n            type: this._getTypeMetadata(directiveType),\n            template: nonNormalizedTemplateMetadata,\n            changeDetection: changeDetectionStrategy,\n            inputs: dirMeta.inputs || [],\n            outputs: dirMeta.outputs || [],\n            host: dirMeta.host || {},\n            providers: providers || [],\n            viewProviders: viewProviders || [],\n            queries: queries || [],\n            viewQueries: viewQueries || [],\n            entryComponents: entryComponentMetadata,\n            componentViewType: nonNormalizedTemplateMetadata ? this.getComponentViewClass(directiveType) :\n                null,\n            rendererType: nonNormalizedTemplateMetadata ? this.getRendererType(directiveType) : null,\n            componentFactory: null\n        });\n        if (nonNormalizedTemplateMetadata) {\n            metadata.componentFactory =\n                this.getComponentFactory(selector, directiveType, metadata.inputs, metadata.outputs);\n        }\n        cacheEntry = { metadata: metadata, annotation: dirMeta };\n        this._nonNormalizedDirectiveCache.set(directiveType, cacheEntry);\n        return cacheEntry;\n    };\n    /**\n     * Gets the metadata for the given directive.\n     * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n     * @param {?} directiveType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getDirectiveMetadata = function (directiveType) {\n        var /** @type {?} */ dirMeta = ((this._directiveCache.get(directiveType)));\n        if (!dirMeta) {\n            this._reportError(syntaxError(\"Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive \" + stringifyType(directiveType) + \".\"), directiveType);\n        }\n        return dirMeta;\n    };\n    /**\n     * @param {?} dirType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getDirectiveSummary = function (dirType) {\n        var /** @type {?} */ dirSummary = (this._loadSummary(dirType, CompileSummaryKind.Directive));\n        if (!dirSummary) {\n            this._reportError(syntaxError(\"Illegal state: Could not load the summary for directive \" + stringifyType(dirType) + \".\"), dirType);\n        }\n        return dirSummary;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.isDirective = function (type) {\n        return !!this._loadSummary(type, CompileSummaryKind.Directive) ||\n            this._directiveResolver.isDirective(type);\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.isPipe = function (type) {\n        return !!this._loadSummary(type, CompileSummaryKind.Pipe) ||\n            this._pipeResolver.isPipe(type);\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.isNgModule = function (type) {\n        return !!this._loadSummary(type, CompileSummaryKind.NgModule) ||\n            this._ngModuleResolver.isNgModule(type);\n    };\n    /**\n     * @param {?} moduleType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getNgModuleSummary = function (moduleType) {\n        var /** @type {?} */ moduleSummary = (this._loadSummary(moduleType, CompileSummaryKind.NgModule));\n        if (!moduleSummary) {\n            var /** @type {?} */ moduleMeta = this.getNgModuleMetadata(moduleType, false);\n            moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;\n            if (moduleSummary) {\n                this._summaryCache.set(moduleType, moduleSummary);\n            }\n        }\n        return moduleSummary;\n    };\n    /**\n     * Loads the declared directives and pipes of an NgModule.\n     * @param {?} moduleType\n     * @param {?} isSync\n     * @param {?=} throwIfNotFound\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = function (moduleType, isSync, throwIfNotFound) {\n        var _this = this;\n        if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n        var /** @type {?} */ ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);\n        var /** @type {?} */ loading = [];\n        if (ngModule) {\n            ngModule.declaredDirectives.forEach(function (id) {\n                var /** @type {?} */ promise = _this.loadDirectiveMetadata(moduleType, id.reference, isSync);\n                if (promise) {\n                    loading.push(promise);\n                }\n            });\n            ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });\n        }\n        return Promise.all(loading);\n    };\n    /**\n     * @param {?} moduleType\n     * @param {?=} throwIfNotFound\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getNgModuleMetadata = function (moduleType, throwIfNotFound) {\n        var _this = this;\n        if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n        moduleType = _angular_core.resolveForwardRef(moduleType);\n        var /** @type {?} */ compileMeta = this._ngModuleCache.get(moduleType);\n        if (compileMeta) {\n            return compileMeta;\n        }\n        var /** @type {?} */ meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);\n        if (!meta) {\n            return null;\n        }\n        var /** @type {?} */ declaredDirectives = [];\n        var /** @type {?} */ exportedNonModuleIdentifiers = [];\n        var /** @type {?} */ declaredPipes = [];\n        var /** @type {?} */ importedModules = [];\n        var /** @type {?} */ exportedModules = [];\n        var /** @type {?} */ providers = [];\n        var /** @type {?} */ entryComponents = [];\n        var /** @type {?} */ bootstrapComponents = [];\n        var /** @type {?} */ schemas = [];\n        if (meta.imports) {\n            flattenAndDedupeArray(meta.imports).forEach(function (importedType) {\n                var /** @type {?} */ importedModuleType = ((undefined));\n                if (isValidType(importedType)) {\n                    importedModuleType = importedType;\n                }\n                else if (importedType && importedType.ngModule) {\n                    var /** @type {?} */ moduleWithProviders = importedType;\n                    importedModuleType = moduleWithProviders.ngModule;\n                    if (moduleWithProviders.providers) {\n                        providers.push.apply(providers, _this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, \"provider for the NgModule '\" + stringifyType(importedModuleType) + \"'\", [], importedType));\n                    }\n                }\n                if (importedModuleType) {\n                    if (_this._checkSelfImport(moduleType, importedModuleType))\n                        return;\n                    var /** @type {?} */ importedModuleSummary = _this.getNgModuleSummary(importedModuleType);\n                    if (!importedModuleSummary) {\n                        _this._reportError(syntaxError(\"Unexpected \" + _this._getTypeDescriptor(importedType) + \" '\" + stringifyType(importedType) + \"' imported by the module '\" + stringifyType(moduleType) + \"'. Please add a @NgModule annotation.\"), moduleType);\n                        return;\n                    }\n                    importedModules.push(importedModuleSummary);\n                }\n                else {\n                    _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(importedType) + \"' imported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                    return;\n                }\n            });\n        }\n        if (meta.exports) {\n            flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {\n                if (!isValidType(exportedType)) {\n                    _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(exportedType) + \"' exported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                    return;\n                }\n                var /** @type {?} */ exportedModuleSummary = _this.getNgModuleSummary(exportedType);\n                if (exportedModuleSummary) {\n                    exportedModules.push(exportedModuleSummary);\n                }\n                else {\n                    exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));\n                }\n            });\n        }\n        // Note: This will be modified later, so we rely on\n        // getting a new instance every time!\n        var /** @type {?} */ transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);\n        if (meta.declarations) {\n            flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {\n                if (!isValidType(declaredType)) {\n                    _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(declaredType) + \"' declared by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                    return;\n                }\n                var /** @type {?} */ declaredIdentifier = _this._getIdentifierMetadata(declaredType);\n                if (_this.isDirective(declaredType)) {\n                    transitiveModule.addDirective(declaredIdentifier);\n                    declaredDirectives.push(declaredIdentifier);\n                    _this._addTypeToModule(declaredType, moduleType);\n                }\n                else if (_this.isPipe(declaredType)) {\n                    transitiveModule.addPipe(declaredIdentifier);\n                    transitiveModule.pipes.push(declaredIdentifier);\n                    declaredPipes.push(declaredIdentifier);\n                    _this._addTypeToModule(declaredType, moduleType);\n                }\n                else {\n                    _this._reportError(syntaxError(\"Unexpected \" + _this._getTypeDescriptor(declaredType) + \" '\" + stringifyType(declaredType) + \"' declared by the module '\" + stringifyType(moduleType) + \"'. Please add a @Pipe/@Directive/@Component annotation.\"), moduleType);\n                    return;\n                }\n            });\n        }\n        var /** @type {?} */ exportedDirectives = [];\n        var /** @type {?} */ exportedPipes = [];\n        exportedNonModuleIdentifiers.forEach(function (exportedId) {\n            if (transitiveModule.directivesSet.has(exportedId.reference)) {\n                exportedDirectives.push(exportedId);\n                transitiveModule.addExportedDirective(exportedId);\n            }\n            else if (transitiveModule.pipesSet.has(exportedId.reference)) {\n                exportedPipes.push(exportedId);\n                transitiveModule.addExportedPipe(exportedId);\n            }\n            else {\n                _this._reportError(syntaxError(\"Can't export \" + _this._getTypeDescriptor(exportedId.reference) + \" \" + stringifyType(exportedId.reference) + \" from \" + stringifyType(moduleType) + \" as it was neither declared nor imported!\"), moduleType);\n                return;\n            }\n        });\n        // The providers of the module have to go last\n        // so that they overwrite any other provider we already added.\n        if (meta.providers) {\n            providers.push.apply(providers, this._getProvidersMetadata(meta.providers, entryComponents, \"provider for the NgModule '\" + stringifyType(moduleType) + \"'\", [], moduleType));\n        }\n        if (meta.entryComponents) {\n            entryComponents.push.apply(entryComponents, flattenAndDedupeArray(meta.entryComponents)\n                .map(function (type) { return ((_this._getEntryComponentMetadata(type))); }));\n        }\n        if (meta.bootstrap) {\n            flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {\n                if (!isValidType(type)) {\n                    _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(type) + \"' used in the bootstrap property of module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n                    return;\n                }\n                bootstrapComponents.push(_this._getIdentifierMetadata(type));\n            });\n        }\n        entryComponents.push.apply(entryComponents, bootstrapComponents.map(function (type) { return ((_this._getEntryComponentMetadata(type.reference))); }));\n        if (meta.schemas) {\n            schemas.push.apply(schemas, flattenAndDedupeArray(meta.schemas));\n        }\n        compileMeta = new CompileNgModuleMetadata({\n            type: this._getTypeMetadata(moduleType),\n            providers: providers,\n            entryComponents: entryComponents,\n            bootstrapComponents: bootstrapComponents,\n            schemas: schemas,\n            declaredDirectives: declaredDirectives,\n            exportedDirectives: exportedDirectives,\n            declaredPipes: declaredPipes,\n            exportedPipes: exportedPipes,\n            importedModules: importedModules,\n            exportedModules: exportedModules,\n            transitiveModule: transitiveModule,\n            id: meta.id || null,\n        });\n        entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });\n        providers.forEach(function (provider) { return transitiveModule.addProvider(provider, /** @type {?} */ ((compileMeta)).type); });\n        transitiveModule.addModule(compileMeta.type);\n        this._ngModuleCache.set(moduleType, compileMeta);\n        return compileMeta;\n    };\n    /**\n     * @param {?} moduleType\n     * @param {?} importedModuleType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._checkSelfImport = function (moduleType, importedModuleType) {\n        if (moduleType === importedModuleType) {\n            this._reportError(syntaxError(\"'\" + stringifyType(moduleType) + \"' module can't import itself\"), moduleType);\n            return true;\n        }\n        return false;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getTypeDescriptor = function (type) {\n        if (this.isDirective(type)) {\n            return 'directive';\n        }\n        if (this.isPipe(type)) {\n            return 'pipe';\n        }\n        if (this.isNgModule(type)) {\n            return 'module';\n        }\n        if (((type)).provide) {\n            return 'provider';\n        }\n        return 'value';\n    };\n    /**\n     * @param {?} type\n     * @param {?} moduleType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._addTypeToModule = function (type, moduleType) {\n        var /** @type {?} */ oldModule = this._ngModuleOfTypes.get(type);\n        if (oldModule && oldModule !== moduleType) {\n            this._reportError(syntaxError(\"Type \" + stringifyType(type) + \" is part of the declarations of 2 modules: \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \"! \" +\n                (\"Please consider moving \" + stringifyType(type) + \" to a higher module that imports \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \". \") +\n                (\"You can also create a new NgModule that exports and includes \" + stringifyType(type) + \" then import that NgModule in \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \".\")), moduleType);\n            return;\n        }\n        this._ngModuleOfTypes.set(type, moduleType);\n    };\n    /**\n     * @param {?} importedModules\n     * @param {?} exportedModules\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = function (importedModules, exportedModules) {\n        // collect `providers` / `entryComponents` from all imported and all exported modules\n        var /** @type {?} */ result = new TransitiveCompileNgModuleMetadata();\n        var /** @type {?} */ modulesByToken = new Map();\n        importedModules.concat(exportedModules).forEach(function (modSummary) {\n            modSummary.modules.forEach(function (mod) { return result.addModule(mod); });\n            modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });\n            var /** @type {?} */ addedTokens = new Set();\n            modSummary.providers.forEach(function (entry) {\n                var /** @type {?} */ tokenRef = tokenReference(entry.provider.token);\n                var /** @type {?} */ prevModules = modulesByToken.get(tokenRef);\n                if (!prevModules) {\n                    prevModules = new Set();\n                    modulesByToken.set(tokenRef, prevModules);\n                }\n                var /** @type {?} */ moduleRef = entry.module.reference;\n                // Note: the providers of one module may still contain multiple providers\n                // per token (e.g. for multi providers), and we need to preserve these.\n                if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {\n                    prevModules.add(moduleRef);\n                    addedTokens.add(tokenRef);\n                    result.addProvider(entry.provider, entry.module);\n                }\n            });\n        });\n        exportedModules.forEach(function (modSummary) {\n            modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });\n            modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });\n        });\n        importedModules.forEach(function (modSummary) {\n            modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });\n            modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });\n        });\n        return result;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getIdentifierMetadata = function (type) {\n        type = _angular_core.resolveForwardRef(type);\n        return { reference: type };\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.isInjectable = function (type) {\n        var /** @type {?} */ annotations = this._reflector.annotations(type);\n        // Note: We need an exact check here as @Component / @Directive / ... inherit\n        // from @CompilerInjectable!\n        return annotations.some(function (ann) { return ann.constructor === _angular_core.Injectable; });\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getInjectableSummary = function (type) {\n        return {\n            summaryKind: CompileSummaryKind.Injectable,\n            type: this._getTypeMetadata(type, null, false)\n        };\n    };\n    /**\n     * @param {?} type\n     * @param {?=} dependencies\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getInjectableMetadata = function (type, dependencies) {\n        if (dependencies === void 0) { dependencies = null; }\n        var /** @type {?} */ typeSummary = this._loadSummary(type, CompileSummaryKind.Injectable);\n        if (typeSummary) {\n            return typeSummary.type;\n        }\n        return this._getTypeMetadata(type, dependencies);\n    };\n    /**\n     * @param {?} type\n     * @param {?=} dependencies\n     * @param {?=} throwOnUnknownDeps\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getTypeMetadata = function (type, dependencies, throwOnUnknownDeps) {\n        if (dependencies === void 0) { dependencies = null; }\n        if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n        var /** @type {?} */ identifier = this._getIdentifierMetadata(type);\n        return {\n            reference: identifier.reference,\n            diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),\n            lifecycleHooks: getAllLifecycleHooks(this._reflector, identifier.reference),\n        };\n    };\n    /**\n     * @param {?} factory\n     * @param {?=} dependencies\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getFactoryMetadata = function (factory, dependencies) {\n        if (dependencies === void 0) { dependencies = null; }\n        factory = _angular_core.resolveForwardRef(factory);\n        return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };\n    };\n    /**\n     * Gets the metadata for the given pipe.\n     * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n     * @param {?} pipeType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getPipeMetadata = function (pipeType) {\n        var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);\n        if (!pipeMeta) {\n            this._reportError(syntaxError(\"Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe \" + stringifyType(pipeType) + \".\"), pipeType);\n        }\n        return pipeMeta || null;\n    };\n    /**\n     * @param {?} pipeType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getPipeSummary = function (pipeType) {\n        var /** @type {?} */ pipeSummary = (this._loadSummary(pipeType, CompileSummaryKind.Pipe));\n        if (!pipeSummary) {\n            this._reportError(syntaxError(\"Illegal state: Could not load the summary for pipe \" + stringifyType(pipeType) + \".\"), pipeType);\n        }\n        return pipeSummary;\n    };\n    /**\n     * @param {?} pipeType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getOrLoadPipeMetadata = function (pipeType) {\n        var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);\n        if (!pipeMeta) {\n            pipeMeta = this._loadPipeMetadata(pipeType);\n        }\n        return pipeMeta;\n    };\n    /**\n     * @param {?} pipeType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._loadPipeMetadata = function (pipeType) {\n        pipeType = _angular_core.resolveForwardRef(pipeType);\n        var /** @type {?} */ pipeAnnotation = ((this._pipeResolver.resolve(pipeType)));\n        var /** @type {?} */ pipeMeta = new CompilePipeMetadata({\n            type: this._getTypeMetadata(pipeType),\n            name: pipeAnnotation.name,\n            pure: !!pipeAnnotation.pure\n        });\n        this._pipeCache.set(pipeType, pipeMeta);\n        this._summaryCache.set(pipeType, pipeMeta.toSummary());\n        return pipeMeta;\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @param {?} dependencies\n     * @param {?=} throwOnUnknownDeps\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getDependenciesMetadata = function (typeOrFunc, dependencies, throwOnUnknownDeps) {\n        var _this = this;\n        if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n        var /** @type {?} */ hasUnknownDeps = false;\n        var /** @type {?} */ params = dependencies || this._reflector.parameters(typeOrFunc) || [];\n        var /** @type {?} */ dependenciesMetadata = params.map(function (param) {\n            var /** @type {?} */ isAttribute = false;\n            var /** @type {?} */ isHost = false;\n            var /** @type {?} */ isSelf = false;\n            var /** @type {?} */ isSkipSelf = false;\n            var /** @type {?} */ isOptional = false;\n            var /** @type {?} */ token = null;\n            if (Array.isArray(param)) {\n                param.forEach(function (paramEntry) {\n                    if (paramEntry instanceof _angular_core.Host) {\n                        isHost = true;\n                    }\n                    else if (paramEntry instanceof _angular_core.Self) {\n                        isSelf = true;\n                    }\n                    else if (paramEntry instanceof _angular_core.SkipSelf) {\n                        isSkipSelf = true;\n                    }\n                    else if (paramEntry instanceof _angular_core.Optional) {\n                        isOptional = true;\n                    }\n                    else if (paramEntry instanceof _angular_core.Attribute) {\n                        isAttribute = true;\n                        token = paramEntry.attributeName;\n                    }\n                    else if (paramEntry instanceof _angular_core.Inject) {\n                        token = paramEntry.token;\n                    }\n                    else if (paramEntry instanceof _angular_core.InjectionToken) {\n                        token = paramEntry;\n                    }\n                    else if (isValidType(paramEntry) && token == null) {\n                        token = paramEntry;\n                    }\n                });\n            }\n            else {\n                token = param;\n            }\n            if (token == null) {\n                hasUnknownDeps = true;\n                return ((null));\n            }\n            return {\n                isAttribute: isAttribute,\n                isHost: isHost,\n                isSelf: isSelf,\n                isSkipSelf: isSkipSelf,\n                isOptional: isOptional,\n                token: _this._getTokenMetadata(token)\n            };\n        });\n        if (hasUnknownDeps) {\n            var /** @type {?} */ depsTokens = dependenciesMetadata.map(function (dep) { return dep ? stringifyType(dep.token) : '?'; }).join(', ');\n            var /** @type {?} */ message = \"Can't resolve all parameters for \" + stringifyType(typeOrFunc) + \": (\" + depsTokens + \").\";\n            if (throwOnUnknownDeps) {\n                this._reportError(syntaxError(message), typeOrFunc);\n            }\n            else {\n                this._console.warn(\"Warning: \" + message + \" This will become an error in Angular v5.x\");\n            }\n        }\n        return dependenciesMetadata;\n    };\n    /**\n     * @param {?} token\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getTokenMetadata = function (token) {\n        token = _angular_core.resolveForwardRef(token);\n        var /** @type {?} */ compileToken;\n        if (typeof token === 'string') {\n            compileToken = { value: token };\n        }\n        else {\n            compileToken = { identifier: { reference: token } };\n        }\n        return compileToken;\n    };\n    /**\n     * @param {?} providers\n     * @param {?} targetEntryComponents\n     * @param {?=} debugInfo\n     * @param {?=} compileProviders\n     * @param {?=} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getProvidersMetadata = function (providers, targetEntryComponents, debugInfo, compileProviders, type) {\n        var _this = this;\n        if (compileProviders === void 0) { compileProviders = []; }\n        providers.forEach(function (provider, providerIdx) {\n            if (Array.isArray(provider)) {\n                _this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);\n            }\n            else {\n                provider = _angular_core.resolveForwardRef(provider);\n                var /** @type {?} */ providerMeta = ((undefined));\n                if (provider && typeof provider === 'object' && provider.hasOwnProperty('provide')) {\n                    _this._validateProvider(provider);\n                    providerMeta = new ProviderMeta(provider.provide, provider);\n                }\n                else if (isValidType(provider)) {\n                    providerMeta = new ProviderMeta(provider, { useClass: provider });\n                }\n                else if (provider === void 0) {\n                    _this._reportError(syntaxError(\"Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files.\"));\n                    return;\n                }\n                else {\n                    var /** @type {?} */ providersInfo = ((providers.reduce(function (soFar, seenProvider, seenProviderIdx) {\n                        if (seenProviderIdx < providerIdx) {\n                            soFar.push(\"\" + stringifyType(seenProvider));\n                        }\n                        else if (seenProviderIdx == providerIdx) {\n                            soFar.push(\"?\" + stringifyType(seenProvider) + \"?\");\n                        }\n                        else if (seenProviderIdx == providerIdx + 1) {\n                            soFar.push('...');\n                        }\n                        return soFar;\n                    }, [])))\n                        .join(', ');\n                    _this._reportError(syntaxError(\"Invalid \" + (debugInfo ? debugInfo : 'provider') + \" - only instances of Provider and Type are allowed, got: [\" + providersInfo + \"]\"), type);\n                    return;\n                }\n                if (providerMeta.token ===\n                    _this._reflector.resolveExternalReference(Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS)) {\n                    targetEntryComponents.push.apply(targetEntryComponents, _this._getEntryComponentsFromProvider(providerMeta, type));\n                }\n                else {\n                    compileProviders.push(_this.getProviderMetadata(providerMeta));\n                }\n            }\n        });\n        return compileProviders;\n    };\n    /**\n     * @param {?} provider\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._validateProvider = function (provider) {\n        if (provider.hasOwnProperty('useClass') && provider.useClass == null) {\n            this._reportError(syntaxError(\"Invalid provider for \" + stringifyType(provider.provide) + \". useClass cannot be \" + provider.useClass + \".\\n           Usually it happens when:\\n           1. There's a circular dependency (might be caused by using index.ts (barrel) files).\\n           2. Class was used before it was declared. Use forwardRef in this case.\"));\n        }\n    };\n    /**\n     * @param {?} provider\n     * @param {?=} type\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getEntryComponentsFromProvider = function (provider, type) {\n        var _this = this;\n        var /** @type {?} */ components = [];\n        var /** @type {?} */ collectedIdentifiers = [];\n        if (provider.useFactory || provider.useExisting || provider.useClass) {\n            this._reportError(syntaxError(\"The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!\"), type);\n            return [];\n        }\n        if (!provider.multi) {\n            this._reportError(syntaxError(\"The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!\"), type);\n            return [];\n        }\n        extractIdentifiers(provider.useValue, collectedIdentifiers);\n        collectedIdentifiers.forEach(function (identifier) {\n            var /** @type {?} */ entry = _this._getEntryComponentMetadata(identifier.reference, false);\n            if (entry) {\n                components.push(entry);\n            }\n        });\n        return components;\n    };\n    /**\n     * @param {?} dirType\n     * @param {?=} throwIfNotFound\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getEntryComponentMetadata = function (dirType, throwIfNotFound) {\n        if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n        var /** @type {?} */ dirMeta = this.getNonNormalizedDirectiveMetadata(dirType);\n        if (dirMeta && dirMeta.metadata.isComponent) {\n            return { componentType: dirType, componentFactory: /** @type {?} */ ((dirMeta.metadata.componentFactory)) };\n        }\n        var /** @type {?} */ dirSummary = (this._loadSummary(dirType, CompileSummaryKind.Directive));\n        if (dirSummary && dirSummary.isComponent) {\n            return { componentType: dirType, componentFactory: /** @type {?} */ ((dirSummary.componentFactory)) };\n        }\n        if (throwIfNotFound) {\n            throw syntaxError(dirType.name + \" cannot be used as an entry component.\");\n        }\n        return null;\n    };\n    /**\n     * @param {?} provider\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype.getProviderMetadata = function (provider) {\n        var /** @type {?} */ compileDeps = ((undefined));\n        var /** @type {?} */ compileTypeMetadata = ((null));\n        var /** @type {?} */ compileFactoryMetadata = ((null));\n        var /** @type {?} */ token = this._getTokenMetadata(provider.token);\n        if (provider.useClass) {\n            compileTypeMetadata = this._getInjectableMetadata(provider.useClass, provider.dependencies);\n            compileDeps = compileTypeMetadata.diDeps;\n            if (provider.token === provider.useClass) {\n                // use the compileTypeMetadata as it contains information about lifecycleHooks...\n                token = { identifier: compileTypeMetadata };\n            }\n        }\n        else if (provider.useFactory) {\n            compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);\n            compileDeps = compileFactoryMetadata.diDeps;\n        }\n        return {\n            token: token,\n            useClass: compileTypeMetadata,\n            useValue: provider.useValue,\n            useFactory: compileFactoryMetadata,\n            useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : undefined,\n            deps: compileDeps,\n            multi: provider.multi\n        };\n    };\n    /**\n     * @param {?} queries\n     * @param {?} isViewQuery\n     * @param {?} directiveType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getQueriesMetadata = function (queries, isViewQuery, directiveType) {\n        var _this = this;\n        var /** @type {?} */ res = [];\n        Object.keys(queries).forEach(function (propertyName) {\n            var /** @type {?} */ query = queries[propertyName];\n            if (query.isViewQuery === isViewQuery) {\n                res.push(_this._getQueryMetadata(query, propertyName, directiveType));\n            }\n        });\n        return res;\n    };\n    /**\n     * @param {?} selector\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._queryVarBindings = function (selector) { return selector.split(/\\s*,\\s*/); };\n    /**\n     * @param {?} q\n     * @param {?} propertyName\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._getQueryMetadata = function (q, propertyName, typeOrFunc) {\n        var _this = this;\n        var /** @type {?} */ selectors;\n        if (typeof q.selector === 'string') {\n            selectors =\n                this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });\n        }\n        else {\n            if (!q.selector) {\n                this._reportError(syntaxError(\"Can't construct a query for the property \\\"\" + propertyName + \"\\\" of \\\"\" + stringifyType(typeOrFunc) + \"\\\" since the query selector wasn't defined.\"), typeOrFunc);\n                selectors = [];\n            }\n            else {\n                selectors = [this._getTokenMetadata(q.selector)];\n            }\n        }\n        return {\n            selectors: selectors,\n            first: q.first,\n            descendants: q.descendants, propertyName: propertyName,\n            read: q.read ? this._getTokenMetadata(q.read) : ((null))\n        };\n    };\n    /**\n     * @param {?} error\n     * @param {?=} type\n     * @param {?=} otherType\n     * @return {?}\n     */\n    CompileMetadataResolver.prototype._reportError = function (error, type, otherType) {\n        if (this._errorCollector) {\n            this._errorCollector(error, type);\n            if (otherType) {\n                this._errorCollector(error, otherType);\n            }\n        }\n        else {\n            throw error;\n        }\n    };\n    return CompileMetadataResolver;\n}());\nCompileMetadataResolver.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nCompileMetadataResolver.ctorParameters = function () { return [\n    { type: CompilerConfig, },\n    { type: NgModuleResolver, },\n    { type: DirectiveResolver, },\n    { type: PipeResolver, },\n    { type: SummaryResolver, },\n    { type: ElementSchemaRegistry, },\n    { type: DirectiveNormalizer, },\n    { type: _angular_core.ɵConsole, },\n    { type: StaticSymbolCache, decorators: [{ type: _angular_core.Optional },] },\n    { type: CompileReflector, },\n    { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [ERROR_COLLECTOR_TOKEN,] },] },\n]; };\n/**\n * @param {?} tree\n * @param {?=} out\n * @return {?}\n */\nfunction flattenArray(tree, out) {\n    if (out === void 0) { out = []; }\n    if (tree) {\n        for (var /** @type {?} */ i = 0; i < tree.length; i++) {\n            var /** @type {?} */ item = _angular_core.resolveForwardRef(tree[i]);\n            if (Array.isArray(item)) {\n                flattenArray(item, out);\n            }\n            else {\n                out.push(item);\n            }\n        }\n    }\n    return out;\n}\n/**\n * @param {?} array\n * @return {?}\n */\nfunction dedupeArray(array) {\n    if (array) {\n        return Array.from(new Set(array));\n    }\n    return [];\n}\n/**\n * @param {?} tree\n * @return {?}\n */\nfunction flattenAndDedupeArray(tree) {\n    return dedupeArray(flattenArray(tree));\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isValidType(value) {\n    return (value instanceof StaticSymbol) || (value instanceof _angular_core.Type);\n}\n/**\n * @param {?} value\n * @param {?} targetIdentifiers\n * @return {?}\n */\nfunction extractIdentifiers(value, targetIdentifiers) {\n    visitValue(value, new _CompileValueConverter(), targetIdentifiers);\n}\nvar _CompileValueConverter = (function (_super) {\n    __extends(_CompileValueConverter, _super);\n    function _CompileValueConverter() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} value\n     * @param {?} targetIdentifiers\n     * @return {?}\n     */\n    _CompileValueConverter.prototype.visitOther = function (value, targetIdentifiers) {\n        targetIdentifiers.push({ reference: value });\n    };\n    return _CompileValueConverter;\n}(ValueTransformer));\n/**\n * @param {?} type\n * @return {?}\n */\nfunction stringifyType(type) {\n    if (type instanceof StaticSymbol) {\n        return type.name + \" in \" + type.filePath;\n    }\n    else {\n        return _angular_core.ɵstringify(type);\n    }\n}\n/**\n * Indicates that a component is still being loaded in a synchronous compile.\n * @param {?} compType\n * @return {?}\n */\nfunction componentStillLoadingError(compType) {\n    var /** @type {?} */ error = Error(\"Can't compile synchronously as \" + _angular_core.ɵstringify(compType) + \" is still being loaded!\");\n    ((error))[_angular_core.ɵERROR_COMPONENT_TYPE] = compType;\n    return error;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar TypeModifier = {};\nTypeModifier.Const = 0;\nTypeModifier[TypeModifier.Const] = \"Const\";\n/**\n * @abstract\n */\nvar Type$1 = (function () {\n    /**\n     * @param {?=} modifiers\n     */\n    function Type$1(modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        this.modifiers = modifiers;\n        if (!modifiers) {\n            this.modifiers = [];\n        }\n    }\n    /**\n     * @abstract\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Type$1.prototype.visitType = function (visitor, context) { };\n    /**\n     * @param {?} modifier\n     * @return {?}\n     */\n    Type$1.prototype.hasModifier = function (modifier) { return ((this.modifiers)).indexOf(modifier) !== -1; };\n    return Type$1;\n}());\nvar BuiltinTypeName = {};\nBuiltinTypeName.Dynamic = 0;\nBuiltinTypeName.Bool = 1;\nBuiltinTypeName.String = 2;\nBuiltinTypeName.Int = 3;\nBuiltinTypeName.Number = 4;\nBuiltinTypeName.Function = 5;\nBuiltinTypeName.Inferred = 6;\nBuiltinTypeName[BuiltinTypeName.Dynamic] = \"Dynamic\";\nBuiltinTypeName[BuiltinTypeName.Bool] = \"Bool\";\nBuiltinTypeName[BuiltinTypeName.String] = \"String\";\nBuiltinTypeName[BuiltinTypeName.Int] = \"Int\";\nBuiltinTypeName[BuiltinTypeName.Number] = \"Number\";\nBuiltinTypeName[BuiltinTypeName.Function] = \"Function\";\nBuiltinTypeName[BuiltinTypeName.Inferred] = \"Inferred\";\nvar BuiltinType = (function (_super) {\n    __extends(BuiltinType, _super);\n    /**\n     * @param {?} name\n     * @param {?=} modifiers\n     */\n    function BuiltinType(name, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers) || this;\n        _this.name = name;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    BuiltinType.prototype.visitType = function (visitor, context) {\n        return visitor.visitBuiltintType(this, context);\n    };\n    return BuiltinType;\n}(Type$1));\nvar ExpressionType = (function (_super) {\n    __extends(ExpressionType, _super);\n    /**\n     * @param {?} value\n     * @param {?=} modifiers\n     */\n    function ExpressionType(value, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers) || this;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ExpressionType.prototype.visitType = function (visitor, context) {\n        return visitor.visitExpressionType(this, context);\n    };\n    return ExpressionType;\n}(Type$1));\nvar ArrayType = (function (_super) {\n    __extends(ArrayType, _super);\n    /**\n     * @param {?} of\n     * @param {?=} modifiers\n     */\n    function ArrayType(of, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers) || this;\n        _this.of = of;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ArrayType.prototype.visitType = function (visitor, context) {\n        return visitor.visitArrayType(this, context);\n    };\n    return ArrayType;\n}(Type$1));\nvar MapType = (function (_super) {\n    __extends(MapType, _super);\n    /**\n     * @param {?} valueType\n     * @param {?=} modifiers\n     */\n    function MapType(valueType, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers) || this;\n        _this.valueType = valueType || null;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    MapType.prototype.visitType = function (visitor, context) { return visitor.visitMapType(this, context); };\n    return MapType;\n}(Type$1));\nvar DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);\nvar INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);\nvar BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);\nvar INT_TYPE = new BuiltinType(BuiltinTypeName.Int);\nvar NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);\nvar STRING_TYPE = new BuiltinType(BuiltinTypeName.String);\nvar FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);\nvar BinaryOperator = {};\nBinaryOperator.Equals = 0;\nBinaryOperator.NotEquals = 1;\nBinaryOperator.Identical = 2;\nBinaryOperator.NotIdentical = 3;\nBinaryOperator.Minus = 4;\nBinaryOperator.Plus = 5;\nBinaryOperator.Divide = 6;\nBinaryOperator.Multiply = 7;\nBinaryOperator.Modulo = 8;\nBinaryOperator.And = 9;\nBinaryOperator.Or = 10;\nBinaryOperator.Lower = 11;\nBinaryOperator.LowerEquals = 12;\nBinaryOperator.Bigger = 13;\nBinaryOperator.BiggerEquals = 14;\nBinaryOperator[BinaryOperator.Equals] = \"Equals\";\nBinaryOperator[BinaryOperator.NotEquals] = \"NotEquals\";\nBinaryOperator[BinaryOperator.Identical] = \"Identical\";\nBinaryOperator[BinaryOperator.NotIdentical] = \"NotIdentical\";\nBinaryOperator[BinaryOperator.Minus] = \"Minus\";\nBinaryOperator[BinaryOperator.Plus] = \"Plus\";\nBinaryOperator[BinaryOperator.Divide] = \"Divide\";\nBinaryOperator[BinaryOperator.Multiply] = \"Multiply\";\nBinaryOperator[BinaryOperator.Modulo] = \"Modulo\";\nBinaryOperator[BinaryOperator.And] = \"And\";\nBinaryOperator[BinaryOperator.Or] = \"Or\";\nBinaryOperator[BinaryOperator.Lower] = \"Lower\";\nBinaryOperator[BinaryOperator.LowerEquals] = \"LowerEquals\";\nBinaryOperator[BinaryOperator.Bigger] = \"Bigger\";\nBinaryOperator[BinaryOperator.BiggerEquals] = \"BiggerEquals\";\n/**\n * @abstract\n */\nvar Expression = (function () {\n    /**\n     * @param {?} type\n     * @param {?=} sourceSpan\n     */\n    function Expression(type, sourceSpan) {\n        this.type = type || null;\n        this.sourceSpan = sourceSpan || null;\n    }\n    /**\n     * @abstract\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Expression.prototype.visitExpression = function (visitor, context) { };\n    /**\n     * @param {?} name\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.prop = function (name, sourceSpan) {\n        return new ReadPropExpr(this, name, null, sourceSpan);\n    };\n    /**\n     * @param {?} index\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.key = function (index, type, sourceSpan) {\n        return new ReadKeyExpr(this, index, type, sourceSpan);\n    };\n    /**\n     * @param {?} name\n     * @param {?} params\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.callMethod = function (name, params, sourceSpan) {\n        return new InvokeMethodExpr(this, name, params, null, sourceSpan);\n    };\n    /**\n     * @param {?} params\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.callFn = function (params, sourceSpan) {\n        return new InvokeFunctionExpr(this, params, null, sourceSpan);\n    };\n    /**\n     * @param {?} params\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.instantiate = function (params, type, sourceSpan) {\n        return new InstantiateExpr(this, params, type, sourceSpan);\n    };\n    /**\n     * @param {?} trueCase\n     * @param {?=} falseCase\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.conditional = function (trueCase, falseCase, sourceSpan) {\n        if (falseCase === void 0) { falseCase = null; }\n        return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.equals = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.notEquals = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.identical = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.notIdentical = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.minus = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.plus = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.divide = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.multiply = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.modulo = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.and = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.or = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.lower = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.lowerEquals = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.bigger = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?} rhs\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.biggerEquals = function (rhs, sourceSpan) {\n        return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);\n    };\n    /**\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.isBlank = function (sourceSpan) {\n        // Note: We use equals by purpose here to compare to null and undefined in JS.\n        // We use the typed null to allow strictNullChecks to narrow types.\n        return this.equals(TYPED_NULL_EXPR, sourceSpan);\n    };\n    /**\n     * @param {?} type\n     * @param {?=} sourceSpan\n     * @return {?}\n     */\n    Expression.prototype.cast = function (type, sourceSpan) {\n        return new CastExpr(this, type, sourceSpan);\n    };\n    /**\n     * @return {?}\n     */\n    Expression.prototype.toStmt = function () { return new ExpressionStatement(this, null); };\n    return Expression;\n}());\nvar BuiltinVar = {};\nBuiltinVar.This = 0;\nBuiltinVar.Super = 1;\nBuiltinVar.CatchError = 2;\nBuiltinVar.CatchStack = 3;\nBuiltinVar[BuiltinVar.This] = \"This\";\nBuiltinVar[BuiltinVar.Super] = \"Super\";\nBuiltinVar[BuiltinVar.CatchError] = \"CatchError\";\nBuiltinVar[BuiltinVar.CatchStack] = \"CatchStack\";\nvar ReadVarExpr = (function (_super) {\n    __extends(ReadVarExpr, _super);\n    /**\n     * @param {?} name\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function ReadVarExpr(name, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        if (typeof name === 'string') {\n            _this.name = name;\n            _this.builtin = null;\n        }\n        else {\n            _this.name = null;\n            _this.builtin = name;\n        }\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ReadVarExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitReadVarExpr(this, context);\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    ReadVarExpr.prototype.set = function (value) {\n        if (!this.name) {\n            throw new Error(\"Built in variable \" + this.builtin + \" can not be assigned to.\");\n        }\n        return new WriteVarExpr(this.name, value, null, this.sourceSpan);\n    };\n    return ReadVarExpr;\n}(Expression));\nvar WriteVarExpr = (function (_super) {\n    __extends(WriteVarExpr, _super);\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function WriteVarExpr(name, value, type, sourceSpan) {\n        var _this = _super.call(this, type || value.type, sourceSpan) || this;\n        _this.name = name;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    WriteVarExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitWriteVarExpr(this, context);\n    };\n    /**\n     * @param {?=} type\n     * @param {?=} modifiers\n     * @return {?}\n     */\n    WriteVarExpr.prototype.toDeclStmt = function (type, modifiers) {\n        return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);\n    };\n    return WriteVarExpr;\n}(Expression));\nvar WriteKeyExpr = (function (_super) {\n    __extends(WriteKeyExpr, _super);\n    /**\n     * @param {?} receiver\n     * @param {?} index\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function WriteKeyExpr(receiver, index, value, type, sourceSpan) {\n        var _this = _super.call(this, type || value.type, sourceSpan) || this;\n        _this.receiver = receiver;\n        _this.index = index;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    WriteKeyExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitWriteKeyExpr(this, context);\n    };\n    return WriteKeyExpr;\n}(Expression));\nvar WritePropExpr = (function (_super) {\n    __extends(WritePropExpr, _super);\n    /**\n     * @param {?} receiver\n     * @param {?} name\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function WritePropExpr(receiver, name, value, type, sourceSpan) {\n        var _this = _super.call(this, type || value.type, sourceSpan) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    WritePropExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitWritePropExpr(this, context);\n    };\n    return WritePropExpr;\n}(Expression));\nvar BuiltinMethod = {};\nBuiltinMethod.ConcatArray = 0;\nBuiltinMethod.SubscribeObservable = 1;\nBuiltinMethod.Bind = 2;\nBuiltinMethod[BuiltinMethod.ConcatArray] = \"ConcatArray\";\nBuiltinMethod[BuiltinMethod.SubscribeObservable] = \"SubscribeObservable\";\nBuiltinMethod[BuiltinMethod.Bind] = \"Bind\";\nvar InvokeMethodExpr = (function (_super) {\n    __extends(InvokeMethodExpr, _super);\n    /**\n     * @param {?} receiver\n     * @param {?} method\n     * @param {?} args\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function InvokeMethodExpr(receiver, method, args, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.receiver = receiver;\n        _this.args = args;\n        if (typeof method === 'string') {\n            _this.name = method;\n            _this.builtin = null;\n        }\n        else {\n            _this.name = null;\n            _this.builtin = method;\n        }\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    InvokeMethodExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitInvokeMethodExpr(this, context);\n    };\n    return InvokeMethodExpr;\n}(Expression));\nvar InvokeFunctionExpr = (function (_super) {\n    __extends(InvokeFunctionExpr, _super);\n    /**\n     * @param {?} fn\n     * @param {?} args\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function InvokeFunctionExpr(fn, args, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.fn = fn;\n        _this.args = args;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    InvokeFunctionExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitInvokeFunctionExpr(this, context);\n    };\n    return InvokeFunctionExpr;\n}(Expression));\nvar InstantiateExpr = (function (_super) {\n    __extends(InstantiateExpr, _super);\n    /**\n     * @param {?} classExpr\n     * @param {?} args\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function InstantiateExpr(classExpr, args, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.classExpr = classExpr;\n        _this.args = args;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    InstantiateExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitInstantiateExpr(this, context);\n    };\n    return InstantiateExpr;\n}(Expression));\nvar LiteralExpr = (function (_super) {\n    __extends(LiteralExpr, _super);\n    /**\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function LiteralExpr(value, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    LiteralExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitLiteralExpr(this, context);\n    };\n    return LiteralExpr;\n}(Expression));\nvar ExternalExpr = (function (_super) {\n    __extends(ExternalExpr, _super);\n    /**\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} typeParams\n     * @param {?=} sourceSpan\n     */\n    function ExternalExpr(value, type, typeParams, sourceSpan) {\n        if (typeParams === void 0) { typeParams = null; }\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.value = value;\n        _this.typeParams = typeParams;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ExternalExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitExternalExpr(this, context);\n    };\n    return ExternalExpr;\n}(Expression));\nvar ExternalReference = (function () {\n    /**\n     * @param {?} moduleName\n     * @param {?} name\n     * @param {?} runtime\n     */\n    function ExternalReference(moduleName, name, runtime) {\n        this.moduleName = moduleName;\n        this.name = name;\n        this.runtime = runtime;\n    }\n    return ExternalReference;\n}());\nvar ConditionalExpr = (function (_super) {\n    __extends(ConditionalExpr, _super);\n    /**\n     * @param {?} condition\n     * @param {?} trueCase\n     * @param {?=} falseCase\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function ConditionalExpr(condition, trueCase, falseCase, type, sourceSpan) {\n        if (falseCase === void 0) { falseCase = null; }\n        var _this = _super.call(this, type || trueCase.type, sourceSpan) || this;\n        _this.condition = condition;\n        _this.falseCase = falseCase;\n        _this.trueCase = trueCase;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ConditionalExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitConditionalExpr(this, context);\n    };\n    return ConditionalExpr;\n}(Expression));\nvar NotExpr = (function (_super) {\n    __extends(NotExpr, _super);\n    /**\n     * @param {?} condition\n     * @param {?=} sourceSpan\n     */\n    function NotExpr(condition, sourceSpan) {\n        var _this = _super.call(this, BOOL_TYPE, sourceSpan) || this;\n        _this.condition = condition;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    NotExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitNotExpr(this, context);\n    };\n    return NotExpr;\n}(Expression));\nvar AssertNotNull = (function (_super) {\n    __extends(AssertNotNull, _super);\n    /**\n     * @param {?} condition\n     * @param {?=} sourceSpan\n     */\n    function AssertNotNull(condition, sourceSpan) {\n        var _this = _super.call(this, condition.type, sourceSpan) || this;\n        _this.condition = condition;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    AssertNotNull.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitAssertNotNullExpr(this, context);\n    };\n    return AssertNotNull;\n}(Expression));\nvar CastExpr = (function (_super) {\n    __extends(CastExpr, _super);\n    /**\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function CastExpr(value, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    CastExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitCastExpr(this, context);\n    };\n    return CastExpr;\n}(Expression));\nvar FnParam = (function () {\n    /**\n     * @param {?} name\n     * @param {?=} type\n     */\n    function FnParam(name, type) {\n        if (type === void 0) { type = null; }\n        this.name = name;\n        this.type = type;\n    }\n    return FnParam;\n}());\nvar FunctionExpr = (function (_super) {\n    __extends(FunctionExpr, _super);\n    /**\n     * @param {?} params\n     * @param {?} statements\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function FunctionExpr(params, statements, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.params = params;\n        _this.statements = statements;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    FunctionExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitFunctionExpr(this, context);\n    };\n    /**\n     * @param {?} name\n     * @param {?=} modifiers\n     * @return {?}\n     */\n    FunctionExpr.prototype.toDeclStmt = function (name, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);\n    };\n    return FunctionExpr;\n}(Expression));\nvar BinaryOperatorExpr = (function (_super) {\n    __extends(BinaryOperatorExpr, _super);\n    /**\n     * @param {?} operator\n     * @param {?} lhs\n     * @param {?} rhs\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function BinaryOperatorExpr(operator, lhs, rhs, type, sourceSpan) {\n        var _this = _super.call(this, type || lhs.type, sourceSpan) || this;\n        _this.operator = operator;\n        _this.rhs = rhs;\n        _this.lhs = lhs;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    BinaryOperatorExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitBinaryOperatorExpr(this, context);\n    };\n    return BinaryOperatorExpr;\n}(Expression));\nvar ReadPropExpr = (function (_super) {\n    __extends(ReadPropExpr, _super);\n    /**\n     * @param {?} receiver\n     * @param {?} name\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function ReadPropExpr(receiver, name, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.receiver = receiver;\n        _this.name = name;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ReadPropExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitReadPropExpr(this, context);\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    ReadPropExpr.prototype.set = function (value) {\n        return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan);\n    };\n    return ReadPropExpr;\n}(Expression));\nvar ReadKeyExpr = (function (_super) {\n    __extends(ReadKeyExpr, _super);\n    /**\n     * @param {?} receiver\n     * @param {?} index\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function ReadKeyExpr(receiver, index, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.receiver = receiver;\n        _this.index = index;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ReadKeyExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitReadKeyExpr(this, context);\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    ReadKeyExpr.prototype.set = function (value) {\n        return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan);\n    };\n    return ReadKeyExpr;\n}(Expression));\nvar LiteralArrayExpr = (function (_super) {\n    __extends(LiteralArrayExpr, _super);\n    /**\n     * @param {?} entries\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function LiteralArrayExpr(entries, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.entries = entries;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    LiteralArrayExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitLiteralArrayExpr(this, context);\n    };\n    return LiteralArrayExpr;\n}(Expression));\nvar LiteralMapEntry = (function () {\n    /**\n     * @param {?} key\n     * @param {?} value\n     * @param {?=} quoted\n     */\n    function LiteralMapEntry(key, value, quoted) {\n        if (quoted === void 0) { quoted = false; }\n        this.key = key;\n        this.value = value;\n        this.quoted = quoted;\n    }\n    return LiteralMapEntry;\n}());\nvar LiteralMapExpr = (function (_super) {\n    __extends(LiteralMapExpr, _super);\n    /**\n     * @param {?} entries\n     * @param {?=} type\n     * @param {?=} sourceSpan\n     */\n    function LiteralMapExpr(entries, type, sourceSpan) {\n        var _this = _super.call(this, type, sourceSpan) || this;\n        _this.entries = entries;\n        _this.valueType = null;\n        if (type) {\n            _this.valueType = type.valueType;\n        }\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    LiteralMapExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitLiteralMapExpr(this, context);\n    };\n    return LiteralMapExpr;\n}(Expression));\nvar CommaExpr = (function (_super) {\n    __extends(CommaExpr, _super);\n    /**\n     * @param {?} parts\n     * @param {?=} sourceSpan\n     */\n    function CommaExpr(parts, sourceSpan) {\n        var _this = _super.call(this, parts[parts.length - 1].type, sourceSpan) || this;\n        _this.parts = parts;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    CommaExpr.prototype.visitExpression = function (visitor, context) {\n        return visitor.visitCommaExpr(this, context);\n    };\n    return CommaExpr;\n}(Expression));\nvar THIS_EXPR = new ReadVarExpr(BuiltinVar.This, null, null);\nvar SUPER_EXPR = new ReadVarExpr(BuiltinVar.Super, null, null);\nvar CATCH_ERROR_VAR = new ReadVarExpr(BuiltinVar.CatchError, null, null);\nvar CATCH_STACK_VAR = new ReadVarExpr(BuiltinVar.CatchStack, null, null);\nvar NULL_EXPR = new LiteralExpr(null, null, null);\nvar TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);\nvar StmtModifier = {};\nStmtModifier.Final = 0;\nStmtModifier.Private = 1;\nStmtModifier.Exported = 2;\nStmtModifier[StmtModifier.Final] = \"Final\";\nStmtModifier[StmtModifier.Private] = \"Private\";\nStmtModifier[StmtModifier.Exported] = \"Exported\";\n/**\n * @abstract\n */\nvar Statement = (function () {\n    /**\n     * @param {?=} modifiers\n     * @param {?=} sourceSpan\n     */\n    function Statement(modifiers, sourceSpan) {\n        this.modifiers = modifiers || [];\n        this.sourceSpan = sourceSpan || null;\n    }\n    /**\n     * @abstract\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    Statement.prototype.visitStatement = function (visitor, context) { };\n    /**\n     * @param {?} modifier\n     * @return {?}\n     */\n    Statement.prototype.hasModifier = function (modifier) { return ((this.modifiers)).indexOf(modifier) !== -1; };\n    return Statement;\n}());\nvar DeclareVarStmt = (function (_super) {\n    __extends(DeclareVarStmt, _super);\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @param {?=} type\n     * @param {?=} modifiers\n     * @param {?=} sourceSpan\n     */\n    function DeclareVarStmt(name, value, type, modifiers, sourceSpan) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers, sourceSpan) || this;\n        _this.name = name;\n        _this.value = value;\n        _this.type = type || value.type;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    DeclareVarStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitDeclareVarStmt(this, context);\n    };\n    return DeclareVarStmt;\n}(Statement));\nvar DeclareFunctionStmt = (function (_super) {\n    __extends(DeclareFunctionStmt, _super);\n    /**\n     * @param {?} name\n     * @param {?} params\n     * @param {?} statements\n     * @param {?=} type\n     * @param {?=} modifiers\n     * @param {?=} sourceSpan\n     */\n    function DeclareFunctionStmt(name, params, statements, type, modifiers, sourceSpan) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers, sourceSpan) || this;\n        _this.name = name;\n        _this.params = params;\n        _this.statements = statements;\n        _this.type = type || null;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    DeclareFunctionStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitDeclareFunctionStmt(this, context);\n    };\n    return DeclareFunctionStmt;\n}(Statement));\nvar ExpressionStatement = (function (_super) {\n    __extends(ExpressionStatement, _super);\n    /**\n     * @param {?} expr\n     * @param {?=} sourceSpan\n     */\n    function ExpressionStatement(expr, sourceSpan) {\n        var _this = _super.call(this, null, sourceSpan) || this;\n        _this.expr = expr;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ExpressionStatement.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitExpressionStmt(this, context);\n    };\n    return ExpressionStatement;\n}(Statement));\nvar ReturnStatement = (function (_super) {\n    __extends(ReturnStatement, _super);\n    /**\n     * @param {?} value\n     * @param {?=} sourceSpan\n     */\n    function ReturnStatement(value, sourceSpan) {\n        var _this = _super.call(this, null, sourceSpan) || this;\n        _this.value = value;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ReturnStatement.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitReturnStmt(this, context);\n    };\n    return ReturnStatement;\n}(Statement));\nvar AbstractClassPart = (function () {\n    /**\n     * @param {?} type\n     * @param {?} modifiers\n     */\n    function AbstractClassPart(type, modifiers) {\n        this.modifiers = modifiers;\n        if (!modifiers) {\n            this.modifiers = [];\n        }\n        this.type = type || null;\n    }\n    /**\n     * @param {?} modifier\n     * @return {?}\n     */\n    AbstractClassPart.prototype.hasModifier = function (modifier) { return ((this.modifiers)).indexOf(modifier) !== -1; };\n    return AbstractClassPart;\n}());\nvar ClassMethod = (function (_super) {\n    __extends(ClassMethod, _super);\n    /**\n     * @param {?} name\n     * @param {?} params\n     * @param {?} body\n     * @param {?=} type\n     * @param {?=} modifiers\n     */\n    function ClassMethod(name, params, body, type, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, type, modifiers) || this;\n        _this.name = name;\n        _this.params = params;\n        _this.body = body;\n        return _this;\n    }\n    return ClassMethod;\n}(AbstractClassPart));\nvar ClassGetter = (function (_super) {\n    __extends(ClassGetter, _super);\n    /**\n     * @param {?} name\n     * @param {?} body\n     * @param {?=} type\n     * @param {?=} modifiers\n     */\n    function ClassGetter(name, body, type, modifiers) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, type, modifiers) || this;\n        _this.name = name;\n        _this.body = body;\n        return _this;\n    }\n    return ClassGetter;\n}(AbstractClassPart));\nvar ClassStmt = (function (_super) {\n    __extends(ClassStmt, _super);\n    /**\n     * @param {?} name\n     * @param {?} parent\n     * @param {?} fields\n     * @param {?} getters\n     * @param {?} constructorMethod\n     * @param {?} methods\n     * @param {?=} modifiers\n     * @param {?=} sourceSpan\n     */\n    function ClassStmt(name, parent, fields, getters, constructorMethod, methods, modifiers, sourceSpan) {\n        if (modifiers === void 0) { modifiers = null; }\n        var _this = _super.call(this, modifiers, sourceSpan) || this;\n        _this.name = name;\n        _this.parent = parent;\n        _this.fields = fields;\n        _this.getters = getters;\n        _this.constructorMethod = constructorMethod;\n        _this.methods = methods;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ClassStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitDeclareClassStmt(this, context);\n    };\n    return ClassStmt;\n}(Statement));\nvar IfStmt = (function (_super) {\n    __extends(IfStmt, _super);\n    /**\n     * @param {?} condition\n     * @param {?} trueCase\n     * @param {?=} falseCase\n     * @param {?=} sourceSpan\n     */\n    function IfStmt(condition, trueCase, falseCase, sourceSpan) {\n        if (falseCase === void 0) { falseCase = []; }\n        var _this = _super.call(this, null, sourceSpan) || this;\n        _this.condition = condition;\n        _this.trueCase = trueCase;\n        _this.falseCase = falseCase;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    IfStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitIfStmt(this, context);\n    };\n    return IfStmt;\n}(Statement));\nvar CommentStmt = (function (_super) {\n    __extends(CommentStmt, _super);\n    /**\n     * @param {?} comment\n     * @param {?=} sourceSpan\n     */\n    function CommentStmt(comment, sourceSpan) {\n        var _this = _super.call(this, null, sourceSpan) || this;\n        _this.comment = comment;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    CommentStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitCommentStmt(this, context);\n    };\n    return CommentStmt;\n}(Statement));\nvar TryCatchStmt = (function (_super) {\n    __extends(TryCatchStmt, _super);\n    /**\n     * @param {?} bodyStmts\n     * @param {?} catchStmts\n     * @param {?=} sourceSpan\n     */\n    function TryCatchStmt(bodyStmts, catchStmts, sourceSpan) {\n        var _this = _super.call(this, null, sourceSpan) || this;\n        _this.bodyStmts = bodyStmts;\n        _this.catchStmts = catchStmts;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    TryCatchStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitTryCatchStmt(this, context);\n    };\n    return TryCatchStmt;\n}(Statement));\nvar ThrowStmt = (function (_super) {\n    __extends(ThrowStmt, _super);\n    /**\n     * @param {?} error\n     * @param {?=} sourceSpan\n     */\n    function ThrowStmt(error, sourceSpan) {\n        var _this = _super.call(this, null, sourceSpan) || this;\n        _this.error = error;\n        return _this;\n    }\n    /**\n     * @param {?} visitor\n     * @param {?} context\n     * @return {?}\n     */\n    ThrowStmt.prototype.visitStatement = function (visitor, context) {\n        return visitor.visitThrowStmt(this, context);\n    };\n    return ThrowStmt;\n}(Statement));\nvar AstTransformer$1 = (function () {\n    function AstTransformer$1() {\n    }\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.transformExpr = function (expr, context) { return expr; };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.transformStmt = function (stmt, context) { return stmt; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitReadVarExpr = function (ast, context) { return this.transformExpr(ast, context); };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitWriteVarExpr = function (expr, context) {\n        return this.transformExpr(new WriteVarExpr(expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n    };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitWriteKeyExpr = function (expr, context) {\n        return this.transformExpr(new WriteKeyExpr(expr.receiver.visitExpression(this, context), expr.index.visitExpression(this, context), expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n    };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitWritePropExpr = function (expr, context) {\n        return this.transformExpr(new WritePropExpr(expr.receiver.visitExpression(this, context), expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitInvokeMethodExpr = function (ast, context) {\n        var /** @type {?} */ method = ast.builtin || ast.name;\n        return this.transformExpr(new InvokeMethodExpr(ast.receiver.visitExpression(this, context), /** @type {?} */ ((method)), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitInvokeFunctionExpr = function (ast, context) {\n        return this.transformExpr(new InvokeFunctionExpr(ast.fn.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitInstantiateExpr = function (ast, context) {\n        return this.transformExpr(new InstantiateExpr(ast.classExpr.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitLiteralExpr = function (ast, context) { return this.transformExpr(ast, context); };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitExternalExpr = function (ast, context) {\n        return this.transformExpr(ast, context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitConditionalExpr = function (ast, context) {\n        return this.transformExpr(new ConditionalExpr(ast.condition.visitExpression(this, context), ast.trueCase.visitExpression(this, context), /** @type {?} */ ((ast.falseCase)).visitExpression(this, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitNotExpr = function (ast, context) {\n        return this.transformExpr(new NotExpr(ast.condition.visitExpression(this, context), ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitAssertNotNullExpr = function (ast, context) {\n        return this.transformExpr(new AssertNotNull(ast.condition.visitExpression(this, context), ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitCastExpr = function (ast, context) {\n        return this.transformExpr(new CastExpr(ast.value.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitFunctionExpr = function (ast, context) {\n        return this.transformExpr(new FunctionExpr(ast.params, this.visitAllStatements(ast.statements, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitBinaryOperatorExpr = function (ast, context) {\n        return this.transformExpr(new BinaryOperatorExpr(ast.operator, ast.lhs.visitExpression(this, context), ast.rhs.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitReadPropExpr = function (ast, context) {\n        return this.transformExpr(new ReadPropExpr(ast.receiver.visitExpression(this, context), ast.name, ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitReadKeyExpr = function (ast, context) {\n        return this.transformExpr(new ReadKeyExpr(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitLiteralArrayExpr = function (ast, context) {\n        return this.transformExpr(new LiteralArrayExpr(this.visitAllExpressions(ast.entries, context), ast.type, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitLiteralMapExpr = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ entries = ast.entries.map(function (entry) { return new LiteralMapEntry(entry.key, entry.value.visitExpression(_this, context), entry.quoted); });\n        var /** @type {?} */ mapType = new MapType(ast.valueType, null);\n        return this.transformExpr(new LiteralMapExpr(entries, mapType, ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitCommaExpr = function (ast, context) {\n        return this.transformExpr(new CommaExpr(this.visitAllExpressions(ast.parts, context), ast.sourceSpan), context);\n    };\n    /**\n     * @param {?} exprs\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitAllExpressions = function (exprs, context) {\n        var _this = this;\n        return exprs.map(function (expr) { return expr.visitExpression(_this, context); });\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitDeclareVarStmt = function (stmt, context) {\n        return this.transformStmt(new DeclareVarStmt(stmt.name, stmt.value.visitExpression(this, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitDeclareFunctionStmt = function (stmt, context) {\n        return this.transformStmt(new DeclareFunctionStmt(stmt.name, stmt.params, this.visitAllStatements(stmt.statements, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitExpressionStmt = function (stmt, context) {\n        return this.transformStmt(new ExpressionStatement(stmt.expr.visitExpression(this, context), stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitReturnStmt = function (stmt, context) {\n        return this.transformStmt(new ReturnStatement(stmt.value.visitExpression(this, context), stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitDeclareClassStmt = function (stmt, context) {\n        var _this = this;\n        var /** @type {?} */ parent = ((stmt.parent)).visitExpression(this, context);\n        var /** @type {?} */ getters = stmt.getters.map(function (getter) { return new ClassGetter(getter.name, _this.visitAllStatements(getter.body, context), getter.type, getter.modifiers); });\n        var /** @type {?} */ ctorMethod = stmt.constructorMethod &&\n            new ClassMethod(stmt.constructorMethod.name, stmt.constructorMethod.params, this.visitAllStatements(stmt.constructorMethod.body, context), stmt.constructorMethod.type, stmt.constructorMethod.modifiers);\n        var /** @type {?} */ methods = stmt.methods.map(function (method) { return new ClassMethod(method.name, method.params, _this.visitAllStatements(method.body, context), method.type, method.modifiers); });\n        return this.transformStmt(new ClassStmt(stmt.name, parent, stmt.fields, getters, ctorMethod, methods, stmt.modifiers, stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitIfStmt = function (stmt, context) {\n        return this.transformStmt(new IfStmt(stmt.condition.visitExpression(this, context), this.visitAllStatements(stmt.trueCase, context), this.visitAllStatements(stmt.falseCase, context), stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitTryCatchStmt = function (stmt, context) {\n        return this.transformStmt(new TryCatchStmt(this.visitAllStatements(stmt.bodyStmts, context), this.visitAllStatements(stmt.catchStmts, context), stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitThrowStmt = function (stmt, context) {\n        return this.transformStmt(new ThrowStmt(stmt.error.visitExpression(this, context), stmt.sourceSpan), context);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitCommentStmt = function (stmt, context) {\n        return this.transformStmt(stmt, context);\n    };\n    /**\n     * @param {?} stmts\n     * @param {?} context\n     * @return {?}\n     */\n    AstTransformer$1.prototype.visitAllStatements = function (stmts, context) {\n        var _this = this;\n        return stmts.map(function (stmt) { return stmt.visitStatement(_this, context); });\n    };\n    return AstTransformer$1;\n}());\nvar RecursiveAstVisitor$1 = (function () {\n    function RecursiveAstVisitor$1() {\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitReadVarExpr = function (ast, context) { return ast; };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitWriteVarExpr = function (expr, context) {\n        expr.value.visitExpression(this, context);\n        return expr;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitWriteKeyExpr = function (expr, context) {\n        expr.receiver.visitExpression(this, context);\n        expr.index.visitExpression(this, context);\n        expr.value.visitExpression(this, context);\n        return expr;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitWritePropExpr = function (expr, context) {\n        expr.receiver.visitExpression(this, context);\n        expr.value.visitExpression(this, context);\n        return expr;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitInvokeMethodExpr = function (ast, context) {\n        ast.receiver.visitExpression(this, context);\n        this.visitAllExpressions(ast.args, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitInvokeFunctionExpr = function (ast, context) {\n        ast.fn.visitExpression(this, context);\n        this.visitAllExpressions(ast.args, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitInstantiateExpr = function (ast, context) {\n        ast.classExpr.visitExpression(this, context);\n        this.visitAllExpressions(ast.args, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitLiteralExpr = function (ast, context) { return ast; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitExternalExpr = function (ast, context) { return ast; };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitConditionalExpr = function (ast, context) {\n        ast.condition.visitExpression(this, context);\n        ast.trueCase.visitExpression(this, context); /** @type {?} */\n        ((ast.falseCase)).visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitNotExpr = function (ast, context) {\n        ast.condition.visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitAssertNotNullExpr = function (ast, context) {\n        ast.condition.visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitCastExpr = function (ast, context) {\n        ast.value.visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitFunctionExpr = function (ast, context) {\n        this.visitAllStatements(ast.statements, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitBinaryOperatorExpr = function (ast, context) {\n        ast.lhs.visitExpression(this, context);\n        ast.rhs.visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitReadPropExpr = function (ast, context) {\n        ast.receiver.visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitReadKeyExpr = function (ast, context) {\n        ast.receiver.visitExpression(this, context);\n        ast.index.visitExpression(this, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitLiteralArrayExpr = function (ast, context) {\n        this.visitAllExpressions(ast.entries, context);\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitLiteralMapExpr = function (ast, context) {\n        var _this = this;\n        ast.entries.forEach(function (entry) { return entry.value.visitExpression(_this, context); });\n        return ast;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitCommaExpr = function (ast, context) {\n        this.visitAllExpressions(ast.parts, context);\n    };\n    /**\n     * @param {?} exprs\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitAllExpressions = function (exprs, context) {\n        var _this = this;\n        exprs.forEach(function (expr) { return expr.visitExpression(_this, context); });\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitDeclareVarStmt = function (stmt, context) {\n        stmt.value.visitExpression(this, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitDeclareFunctionStmt = function (stmt, context) {\n        this.visitAllStatements(stmt.statements, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitExpressionStmt = function (stmt, context) {\n        stmt.expr.visitExpression(this, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitReturnStmt = function (stmt, context) {\n        stmt.value.visitExpression(this, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitDeclareClassStmt = function (stmt, context) {\n        var _this = this;\n        ((stmt.parent)).visitExpression(this, context);\n        stmt.getters.forEach(function (getter) { return _this.visitAllStatements(getter.body, context); });\n        if (stmt.constructorMethod) {\n            this.visitAllStatements(stmt.constructorMethod.body, context);\n        }\n        stmt.methods.forEach(function (method) { return _this.visitAllStatements(method.body, context); });\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitIfStmt = function (stmt, context) {\n        stmt.condition.visitExpression(this, context);\n        this.visitAllStatements(stmt.trueCase, context);\n        this.visitAllStatements(stmt.falseCase, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitTryCatchStmt = function (stmt, context) {\n        this.visitAllStatements(stmt.bodyStmts, context);\n        this.visitAllStatements(stmt.catchStmts, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitThrowStmt = function (stmt, context) {\n        stmt.error.visitExpression(this, context);\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitCommentStmt = function (stmt, context) { return stmt; };\n    /**\n     * @param {?} stmts\n     * @param {?} context\n     * @return {?}\n     */\n    RecursiveAstVisitor$1.prototype.visitAllStatements = function (stmts, context) {\n        var _this = this;\n        stmts.forEach(function (stmt) { return stmt.visitStatement(_this, context); });\n    };\n    return RecursiveAstVisitor$1;\n}());\n/**\n * @param {?} stmts\n * @return {?}\n */\nfunction findReadVarNames(stmts) {\n    var /** @type {?} */ visitor = new _ReadVarVisitor();\n    visitor.visitAllStatements(stmts, null);\n    return visitor.varNames;\n}\nvar _ReadVarVisitor = (function (_super) {\n    __extends(_ReadVarVisitor, _super);\n    function _ReadVarVisitor() {\n        var _this = _super.apply(this, arguments) || this;\n        _this.varNames = new Set();\n        return _this;\n    }\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    _ReadVarVisitor.prototype.visitDeclareFunctionStmt = function (stmt, context) {\n        // Don't descend into nested functions\n        return stmt;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    _ReadVarVisitor.prototype.visitDeclareClassStmt = function (stmt, context) {\n        // Don't descend into nested classes\n        return stmt;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    _ReadVarVisitor.prototype.visitReadVarExpr = function (ast, context) {\n        if (ast.name) {\n            this.varNames.add(ast.name);\n        }\n        return null;\n    };\n    return _ReadVarVisitor;\n}(RecursiveAstVisitor$1));\n/**\n * @param {?} stmt\n * @param {?} sourceSpan\n * @return {?}\n */\nfunction applySourceSpanToStatementIfNeeded(stmt, sourceSpan) {\n    if (!sourceSpan) {\n        return stmt;\n    }\n    var /** @type {?} */ transformer = new _ApplySourceSpanTransformer(sourceSpan);\n    return stmt.visitStatement(transformer, null);\n}\n/**\n * @param {?} expr\n * @param {?} sourceSpan\n * @return {?}\n */\nfunction applySourceSpanToExpressionIfNeeded(expr, sourceSpan) {\n    if (!sourceSpan) {\n        return expr;\n    }\n    var /** @type {?} */ transformer = new _ApplySourceSpanTransformer(sourceSpan);\n    return expr.visitExpression(transformer, null);\n}\nvar _ApplySourceSpanTransformer = (function (_super) {\n    __extends(_ApplySourceSpanTransformer, _super);\n    /**\n     * @param {?} sourceSpan\n     */\n    function _ApplySourceSpanTransformer(sourceSpan) {\n        var _this = _super.call(this) || this;\n        _this.sourceSpan = sourceSpan;\n        return _this;\n    }\n    /**\n     * @param {?} obj\n     * @return {?}\n     */\n    _ApplySourceSpanTransformer.prototype._clone = function (obj) {\n        var /** @type {?} */ clone = Object.create(obj.constructor.prototype);\n        for (var /** @type {?} */ prop in obj) {\n            clone[prop] = obj[prop];\n        }\n        return clone;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} context\n     * @return {?}\n     */\n    _ApplySourceSpanTransformer.prototype.transformExpr = function (expr, context) {\n        if (!expr.sourceSpan) {\n            expr = this._clone(expr);\n            expr.sourceSpan = this.sourceSpan;\n        }\n        return expr;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    _ApplySourceSpanTransformer.prototype.transformStmt = function (stmt, context) {\n        if (!stmt.sourceSpan) {\n            stmt = this._clone(stmt);\n            stmt.sourceSpan = this.sourceSpan;\n        }\n        return stmt;\n    };\n    return _ApplySourceSpanTransformer;\n}(AstTransformer$1));\n/**\n * @param {?} name\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction variable(name, type, sourceSpan) {\n    return new ReadVarExpr(name, type, sourceSpan);\n}\n/**\n * @param {?} id\n * @param {?=} typeParams\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction importExpr(id, typeParams, sourceSpan) {\n    if (typeParams === void 0) { typeParams = null; }\n    return new ExternalExpr(id, null, typeParams, sourceSpan);\n}\n/**\n * @param {?} id\n * @param {?=} typeParams\n * @param {?=} typeModifiers\n * @return {?}\n */\nfunction importType(id, typeParams, typeModifiers) {\n    if (typeParams === void 0) { typeParams = null; }\n    if (typeModifiers === void 0) { typeModifiers = null; }\n    return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;\n}\n/**\n * @param {?} expr\n * @param {?=} typeModifiers\n * @return {?}\n */\nfunction expressionType(expr, typeModifiers) {\n    if (typeModifiers === void 0) { typeModifiers = null; }\n    return expr != null ? ((new ExpressionType(expr, typeModifiers))) : null;\n}\n/**\n * @param {?} values\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction literalArr(values, type, sourceSpan) {\n    return new LiteralArrayExpr(values, type, sourceSpan);\n}\n/**\n * @param {?} values\n * @param {?=} type\n * @param {?=} quoted\n * @return {?}\n */\nfunction literalMap(values, type, quoted) {\n    if (type === void 0) { type = null; }\n    if (quoted === void 0) { quoted = false; }\n    return new LiteralMapExpr(values.map(function (entry) { return new LiteralMapEntry(entry[0], entry[1], quoted); }), type, null);\n}\n/**\n * @param {?} expr\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction not(expr, sourceSpan) {\n    return new NotExpr(expr, sourceSpan);\n}\n/**\n * @param {?} expr\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction assertNotNull(expr, sourceSpan) {\n    return new AssertNotNull(expr, sourceSpan);\n}\n/**\n * @param {?} params\n * @param {?} body\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction fn(params, body, type, sourceSpan) {\n    return new FunctionExpr(params, body, type, sourceSpan);\n}\n/**\n * @param {?} value\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction literal(value, type, sourceSpan) {\n    return new LiteralExpr(value, type, sourceSpan);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar QUOTED_KEYS = '$quoted$';\n/**\n * @param {?} ctx\n * @param {?} value\n * @param {?=} type\n * @return {?}\n */\nfunction convertValueToOutputAst(ctx, value, type) {\n    if (type === void 0) { type = null; }\n    return visitValue(value, new _ValueOutputAstTransformer(ctx), type);\n}\nvar _ValueOutputAstTransformer = (function () {\n    /**\n     * @param {?} ctx\n     */\n    function _ValueOutputAstTransformer(ctx) {\n        this.ctx = ctx;\n    }\n    /**\n     * @param {?} arr\n     * @param {?} type\n     * @return {?}\n     */\n    _ValueOutputAstTransformer.prototype.visitArray = function (arr, type) {\n        var _this = this;\n        return literalArr(arr.map(function (value) { return visitValue(value, _this, null); }), type);\n    };\n    /**\n     * @param {?} map\n     * @param {?} type\n     * @return {?}\n     */\n    _ValueOutputAstTransformer.prototype.visitStringMap = function (map, type) {\n        var _this = this;\n        var /** @type {?} */ entries = [];\n        var /** @type {?} */ quotedSet = new Set(map && map[QUOTED_KEYS]);\n        Object.keys(map).forEach(function (key) {\n            entries.push(new LiteralMapEntry(key, visitValue(map[key], _this, null), quotedSet.has(key)));\n        });\n        return new LiteralMapExpr(entries, type);\n    };\n    /**\n     * @param {?} value\n     * @param {?} type\n     * @return {?}\n     */\n    _ValueOutputAstTransformer.prototype.visitPrimitive = function (value, type) { return literal(value, type); };\n    /**\n     * @param {?} value\n     * @param {?} type\n     * @return {?}\n     */\n    _ValueOutputAstTransformer.prototype.visitOther = function (value, type) {\n        if (value instanceof Expression) {\n            return value;\n        }\n        else {\n            return this.ctx.importExpr(value);\n        }\n    };\n    return _ValueOutputAstTransformer;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} ctx\n * @param {?} providerAst\n * @return {?}\n */\nfunction providerDef(ctx, providerAst) {\n    var /** @type {?} */ flags = 0;\n    if (!providerAst.eager) {\n        flags |= 4096 /* LazyProvider */;\n    }\n    if (providerAst.providerType === ProviderAstType.PrivateService) {\n        flags |= 8192 /* PrivateProvider */;\n    }\n    providerAst.lifecycleHooks.forEach(function (lifecycleHook) {\n        // for regular providers, we only support ngOnDestroy\n        if (lifecycleHook === LifecycleHooks.OnDestroy ||\n            providerAst.providerType === ProviderAstType.Directive ||\n            providerAst.providerType === ProviderAstType.Component) {\n            flags |= lifecycleHookToNodeFlag(lifecycleHook);\n        }\n    });\n    var _a = providerAst.multiProvider ?\n        multiProviderDef(ctx, flags, providerAst.providers) :\n        singleProviderDef(ctx, flags, providerAst.providerType, providerAst.providers[0]), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;\n    return {\n        providerExpr: providerExpr,\n        flags: providerFlags, depsExpr: depsExpr,\n        tokenExpr: tokenExpr(ctx, providerAst.token),\n    };\n}\n/**\n * @param {?} ctx\n * @param {?} flags\n * @param {?} providers\n * @return {?}\n */\nfunction multiProviderDef(ctx, flags, providers) {\n    var /** @type {?} */ allDepDefs = [];\n    var /** @type {?} */ allParams = [];\n    var /** @type {?} */ exprs = providers.map(function (provider, providerIndex) {\n        var /** @type {?} */ expr;\n        if (provider.useClass) {\n            var /** @type {?} */ depExprs = convertDeps(providerIndex, provider.deps || provider.useClass.diDeps);\n            expr = ctx.importExpr(provider.useClass.reference).instantiate(depExprs);\n        }\n        else if (provider.useFactory) {\n            var /** @type {?} */ depExprs = convertDeps(providerIndex, provider.deps || provider.useFactory.diDeps);\n            expr = ctx.importExpr(provider.useFactory.reference).callFn(depExprs);\n        }\n        else if (provider.useExisting) {\n            var /** @type {?} */ depExprs = convertDeps(providerIndex, [{ token: provider.useExisting }]);\n            expr = depExprs[0];\n        }\n        else {\n            expr = convertValueToOutputAst(ctx, provider.useValue);\n        }\n        return expr;\n    });\n    var /** @type {?} */ providerExpr = fn(allParams, [new ReturnStatement(literalArr(exprs))], INFERRED_TYPE);\n    return {\n        providerExpr: providerExpr,\n        flags: flags | 1024 /* TypeFactoryProvider */,\n        depsExpr: literalArr(allDepDefs)\n    };\n    /**\n     * @param {?} providerIndex\n     * @param {?} deps\n     * @return {?}\n     */\n    function convertDeps(providerIndex, deps) {\n        return deps.map(function (dep, depIndex) {\n            var /** @type {?} */ paramName = \"p\" + providerIndex + \"_\" + depIndex;\n            allParams.push(new FnParam(paramName, DYNAMIC_TYPE));\n            allDepDefs.push(depDef(ctx, dep));\n            return variable(paramName);\n        });\n    }\n}\n/**\n * @param {?} ctx\n * @param {?} flags\n * @param {?} providerType\n * @param {?} providerMeta\n * @return {?}\n */\nfunction singleProviderDef(ctx, flags, providerType, providerMeta) {\n    var /** @type {?} */ providerExpr;\n    var /** @type {?} */ deps;\n    if (providerType === ProviderAstType.Directive || providerType === ProviderAstType.Component) {\n        providerExpr = ctx.importExpr(/** @type {?} */ ((providerMeta.useClass)).reference);\n        flags |= 16384 /* TypeDirective */;\n        deps = providerMeta.deps || ((providerMeta.useClass)).diDeps;\n    }\n    else {\n        if (providerMeta.useClass) {\n            providerExpr = ctx.importExpr(providerMeta.useClass.reference);\n            flags |= 512 /* TypeClassProvider */;\n            deps = providerMeta.deps || providerMeta.useClass.diDeps;\n        }\n        else if (providerMeta.useFactory) {\n            providerExpr = ctx.importExpr(providerMeta.useFactory.reference);\n            flags |= 1024 /* TypeFactoryProvider */;\n            deps = providerMeta.deps || providerMeta.useFactory.diDeps;\n        }\n        else if (providerMeta.useExisting) {\n            providerExpr = NULL_EXPR;\n            flags |= 2048 /* TypeUseExistingProvider */;\n            deps = [{ token: providerMeta.useExisting }];\n        }\n        else {\n            providerExpr = convertValueToOutputAst(ctx, providerMeta.useValue);\n            flags |= 256 /* TypeValueProvider */;\n            deps = [];\n        }\n    }\n    var /** @type {?} */ depsExpr = literalArr(deps.map(function (dep) { return depDef(ctx, dep); }));\n    return { providerExpr: providerExpr, flags: flags, depsExpr: depsExpr };\n}\n/**\n * @param {?} ctx\n * @param {?} tokenMeta\n * @return {?}\n */\nfunction tokenExpr(ctx, tokenMeta) {\n    return tokenMeta.identifier ? ctx.importExpr(tokenMeta.identifier.reference) :\n        literal(tokenMeta.value);\n}\n/**\n * @param {?} ctx\n * @param {?} dep\n * @return {?}\n */\nfunction depDef(ctx, dep) {\n    // Note: the following fields have already been normalized out by provider_analyzer:\n    // - isAttribute, isSelf, isHost\n    var /** @type {?} */ expr = dep.isValue ? convertValueToOutputAst(ctx, dep.value) : tokenExpr(ctx, /** @type {?} */ ((dep.token)));\n    var /** @type {?} */ flags = 0;\n    if (dep.isSkipSelf) {\n        flags |= 1 /* SkipSelf */;\n    }\n    if (dep.isOptional) {\n        flags |= 2 /* Optional */;\n    }\n    if (dep.isValue) {\n        flags |= 8 /* Value */;\n    }\n    return flags === 0 /* None */ ? expr : literalArr([literal(flags), expr]);\n}\n/**\n * @param {?} lifecycleHook\n * @return {?}\n */\nfunction lifecycleHookToNodeFlag(lifecycleHook) {\n    var /** @type {?} */ nodeFlag = 0;\n    switch (lifecycleHook) {\n        case LifecycleHooks.AfterContentChecked:\n            nodeFlag = 2097152 /* AfterContentChecked */;\n            break;\n        case LifecycleHooks.AfterContentInit:\n            nodeFlag = 1048576 /* AfterContentInit */;\n            break;\n        case LifecycleHooks.AfterViewChecked:\n            nodeFlag = 8388608 /* AfterViewChecked */;\n            break;\n        case LifecycleHooks.AfterViewInit:\n            nodeFlag = 4194304 /* AfterViewInit */;\n            break;\n        case LifecycleHooks.DoCheck:\n            nodeFlag = 262144 /* DoCheck */;\n            break;\n        case LifecycleHooks.OnChanges:\n            nodeFlag = 524288 /* OnChanges */;\n            break;\n        case LifecycleHooks.OnDestroy:\n            nodeFlag = 131072 /* OnDestroy */;\n            break;\n        case LifecycleHooks.OnInit:\n            nodeFlag = 65536 /* OnInit */;\n            break;\n    }\n    return nodeFlag;\n}\n/**\n * @param {?} reflector\n * @param {?} ctx\n * @param {?} flags\n * @param {?} entryComponents\n * @return {?}\n */\nfunction componentFactoryResolverProviderDef(reflector, ctx, flags, entryComponents) {\n    var /** @type {?} */ entryComponentFactories = entryComponents.map(function (entryComponent) { return ctx.importExpr(entryComponent.componentFactory); });\n    var /** @type {?} */ token = createTokenForExternalReference(reflector, Identifiers.ComponentFactoryResolver);\n    var /** @type {?} */ classMeta = {\n        diDeps: [\n            { isValue: true, value: literalArr(entryComponentFactories) },\n            { token: token, isSkipSelf: true, isOptional: true },\n            { token: createTokenForExternalReference(reflector, Identifiers.NgModuleRef) },\n        ],\n        lifecycleHooks: [],\n        reference: reflector.resolveExternalReference(Identifiers.CodegenComponentFactoryResolver)\n    };\n    var _a = singleProviderDef(ctx, flags, ProviderAstType.PrivateService, {\n        token: token,\n        multi: false,\n        useClass: classMeta,\n    }), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;\n    return { providerExpr: providerExpr, flags: providerFlags, depsExpr: depsExpr, tokenExpr: tokenExpr(ctx, token) };\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar NgModuleCompileResult = (function () {\n    /**\n     * @param {?} ngModuleFactoryVar\n     */\n    function NgModuleCompileResult(ngModuleFactoryVar) {\n        this.ngModuleFactoryVar = ngModuleFactoryVar;\n    }\n    return NgModuleCompileResult;\n}());\nvar LOG_VAR = variable('_l');\nvar NgModuleCompiler = (function () {\n    /**\n     * @param {?} reflector\n     */\n    function NgModuleCompiler(reflector) {\n        this.reflector = reflector;\n    }\n    /**\n     * @param {?} ctx\n     * @param {?} ngModuleMeta\n     * @param {?} extraProviders\n     * @return {?}\n     */\n    NgModuleCompiler.prototype.compile = function (ctx, ngModuleMeta, extraProviders) {\n        var /** @type {?} */ sourceSpan = typeSourceSpan('NgModule', ngModuleMeta.type);\n        var /** @type {?} */ entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;\n        var /** @type {?} */ bootstrapComponents = ngModuleMeta.bootstrapComponents;\n        var /** @type {?} */ providerParser = new NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);\n        var /** @type {?} */ providerDefs = [componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]\n            .concat(providerParser.parse().map(function (provider) { return providerDef(ctx, provider); }))\n            .map(function (_a) {\n            var providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;\n            return importExpr(Identifiers.moduleProviderDef).callFn([\n                literal(flags), tokenExpr, providerExpr, depsExpr\n            ]);\n        });\n        var /** @type {?} */ ngModuleDef = importExpr(Identifiers.moduleDef).callFn([literalArr(providerDefs)]);\n        var /** @type {?} */ ngModuleDefFactory = fn([new FnParam(/** @type {?} */ ((LOG_VAR.name)))], [new ReturnStatement(ngModuleDef)], INFERRED_TYPE);\n        var /** @type {?} */ ngModuleFactoryVar = identifierName(ngModuleMeta.type) + \"NgFactory\";\n        this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, importExpr(Identifiers.createModuleFactory).callFn([\n            ctx.importExpr(ngModuleMeta.type.reference),\n            literalArr(bootstrapComponents.map(function (id) { return ctx.importExpr(id.reference); })),\n            ngModuleDefFactory\n        ]));\n        if (ngModuleMeta.id) {\n            var /** @type {?} */ registerFactoryStmt = importExpr(Identifiers.RegisterModuleFactoryFn)\n                .callFn([literal(ngModuleMeta.id), variable(ngModuleFactoryVar)])\n                .toStmt();\n            ctx.statements.push(registerFactoryStmt);\n        }\n        return new NgModuleCompileResult(ngModuleFactoryVar);\n    };\n    /**\n     * @param {?} ctx\n     * @param {?} ngModuleReference\n     * @return {?}\n     */\n    NgModuleCompiler.prototype.createStub = function (ctx, ngModuleReference) {\n        this._createNgModuleFactory(ctx, ngModuleReference, NULL_EXPR);\n    };\n    /**\n     * @param {?} ctx\n     * @param {?} reference\n     * @param {?} value\n     * @return {?}\n     */\n    NgModuleCompiler.prototype._createNgModuleFactory = function (ctx, reference, value) {\n        var /** @type {?} */ ngModuleFactoryVar = identifierName({ reference: reference }) + \"NgFactory\";\n        var /** @type {?} */ ngModuleFactoryStmt = variable(ngModuleFactoryVar)\n            .set(value)\n            .toDeclStmt(importType(Identifiers.NgModuleFactory, [/** @type {?} */ ((expressionType(ctx.importExpr(reference))))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]);\n        ctx.statements.push(ngModuleFactoryStmt);\n    };\n    return NgModuleCompiler;\n}());\nNgModuleCompiler.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nNgModuleCompiler.ctorParameters = function () { return [\n    { type: CompileReflector, },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\nvar VERSION$1 = 3;\nvar JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';\nvar SourceMapGenerator = (function () {\n    /**\n     * @param {?=} file\n     */\n    function SourceMapGenerator(file) {\n        if (file === void 0) { file = null; }\n        this.file = file;\n        this.sourcesContent = new Map();\n        this.lines = [];\n        this.lastCol0 = 0;\n        this.hasMappings = false;\n    }\n    /**\n     * @param {?} url\n     * @param {?=} content\n     * @return {?}\n     */\n    SourceMapGenerator.prototype.addSource = function (url, content) {\n        if (content === void 0) { content = null; }\n        if (!this.sourcesContent.has(url)) {\n            this.sourcesContent.set(url, content);\n        }\n        return this;\n    };\n    /**\n     * @return {?}\n     */\n    SourceMapGenerator.prototype.addLine = function () {\n        this.lines.push([]);\n        this.lastCol0 = 0;\n        return this;\n    };\n    /**\n     * @param {?} col0\n     * @param {?=} sourceUrl\n     * @param {?=} sourceLine0\n     * @param {?=} sourceCol0\n     * @return {?}\n     */\n    SourceMapGenerator.prototype.addMapping = function (col0, sourceUrl, sourceLine0, sourceCol0) {\n        if (!this.currentLine) {\n            throw new Error(\"A line must be added before mappings can be added\");\n        }\n        if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {\n            throw new Error(\"Unknown source file \\\"\" + sourceUrl + \"\\\"\");\n        }\n        if (col0 == null) {\n            throw new Error(\"The column in the generated code must be provided\");\n        }\n        if (col0 < this.lastCol0) {\n            throw new Error(\"Mapping should be added in output order\");\n        }\n        if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {\n            throw new Error(\"The source location must be provided when a source url is provided\");\n        }\n        this.hasMappings = true;\n        this.lastCol0 = col0;\n        this.currentLine.push({ col0: col0, sourceUrl: sourceUrl, sourceLine0: sourceLine0, sourceCol0: sourceCol0 });\n        return this;\n    };\n    Object.defineProperty(SourceMapGenerator.prototype, \"currentLine\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this.lines.slice(-1)[0]; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    SourceMapGenerator.prototype.toJSON = function () {\n        var _this = this;\n        if (!this.hasMappings) {\n            return null;\n        }\n        var /** @type {?} */ sourcesIndex = new Map();\n        var /** @type {?} */ sources = [];\n        var /** @type {?} */ sourcesContent = [];\n        Array.from(this.sourcesContent.keys()).forEach(function (url, i) {\n            sourcesIndex.set(url, i);\n            sources.push(url);\n            sourcesContent.push(_this.sourcesContent.get(url) || null);\n        });\n        var /** @type {?} */ mappings = '';\n        var /** @type {?} */ lastCol0 = 0;\n        var /** @type {?} */ lastSourceIndex = 0;\n        var /** @type {?} */ lastSourceLine0 = 0;\n        var /** @type {?} */ lastSourceCol0 = 0;\n        this.lines.forEach(function (segments) {\n            lastCol0 = 0;\n            mappings += segments\n                .map(function (segment) {\n                // zero-based starting column of the line in the generated code\n                var /** @type {?} */ segAsStr = toBase64VLQ(segment.col0 - lastCol0);\n                lastCol0 = segment.col0;\n                if (segment.sourceUrl != null) {\n                    // zero-based index into the “sources” list\n                    segAsStr +=\n                        toBase64VLQ(/** @type {?} */ ((sourcesIndex.get(segment.sourceUrl))) - lastSourceIndex);\n                    lastSourceIndex = ((sourcesIndex.get(segment.sourceUrl)));\n                    // the zero-based starting line in the original source\n                    segAsStr += toBase64VLQ(/** @type {?} */ ((segment.sourceLine0)) - lastSourceLine0);\n                    lastSourceLine0 = ((segment.sourceLine0));\n                    // the zero-based starting column in the original source\n                    segAsStr += toBase64VLQ(/** @type {?} */ ((segment.sourceCol0)) - lastSourceCol0);\n                    lastSourceCol0 = ((segment.sourceCol0));\n                }\n                return segAsStr;\n            })\n                .join(',');\n            mappings += ';';\n        });\n        mappings = mappings.slice(0, -1);\n        return {\n            'file': this.file || '',\n            'version': VERSION$1,\n            'sourceRoot': '',\n            'sources': sources,\n            'sourcesContent': sourcesContent,\n            'mappings': mappings,\n        };\n    };\n    /**\n     * @return {?}\n     */\n    SourceMapGenerator.prototype.toJsComment = function () {\n        return this.hasMappings ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) :\n            '';\n    };\n    return SourceMapGenerator;\n}());\n/**\n * @param {?} value\n * @return {?}\n */\nfunction toBase64String(value) {\n    var /** @type {?} */ b64 = '';\n    value = utf8Encode(value);\n    for (var /** @type {?} */ i = 0; i < value.length;) {\n        var /** @type {?} */ i1 = value.charCodeAt(i++);\n        var /** @type {?} */ i2 = value.charCodeAt(i++);\n        var /** @type {?} */ i3 = value.charCodeAt(i++);\n        b64 += toBase64Digit(i1 >> 2);\n        b64 += toBase64Digit(((i1 & 3) << 4) | (isNaN(i2) ? 0 : i2 >> 4));\n        b64 += isNaN(i2) ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 >> 6));\n        b64 += isNaN(i2) || isNaN(i3) ? '=' : toBase64Digit(i3 & 63);\n    }\n    return b64;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction toBase64VLQ(value) {\n    value = value < 0 ? ((-value) << 1) + 1 : value << 1;\n    var /** @type {?} */ out = '';\n    do {\n        var /** @type {?} */ digit = value & 31;\n        value = value >> 5;\n        if (value > 0) {\n            digit = digit | 32;\n        }\n        out += toBase64Digit(digit);\n    } while (value > 0);\n    return out;\n}\nvar B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n/**\n * @param {?} value\n * @return {?}\n */\nfunction toBase64Digit(value) {\n    if (value < 0 || value >= 64) {\n        throw new Error(\"Can only encode value in the range [0, 63]\");\n    }\n    return B64_DIGITS[value];\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\\\|\\n|\\r|\\$/g;\nvar _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;\nvar _INDENT_WITH = '  ';\nvar CATCH_ERROR_VAR$1 = variable('error', null, null);\nvar CATCH_STACK_VAR$1 = variable('stack', null, null);\n/**\n * @abstract\n */\nvar _EmittedLine = (function () {\n    /**\n     * @param {?} indent\n     */\n    function _EmittedLine(indent) {\n        this.indent = indent;\n        this.partsLength = 0;\n        this.parts = [];\n        this.srcSpans = [];\n    }\n    return _EmittedLine;\n}());\nvar EmitterVisitorContext = (function () {\n    /**\n     * @param {?} _indent\n     */\n    function EmitterVisitorContext(_indent) {\n        this._indent = _indent;\n        this._classes = [];\n        this._preambleLineCount = 0;\n        this._lines = [new _EmittedLine(_indent)];\n    }\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.createRoot = function () { return new EmitterVisitorContext(0); };\n    Object.defineProperty(EmitterVisitorContext.prototype, \"_currentLine\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._lines[this._lines.length - 1]; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?=} from\n     * @param {?=} lastPart\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.println = function (from, lastPart) {\n        if (lastPart === void 0) { lastPart = ''; }\n        this.print(from || null, lastPart, true);\n    };\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.lineIsEmpty = function () { return this._currentLine.parts.length === 0; };\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.lineLength = function () {\n        return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;\n    };\n    /**\n     * @param {?} from\n     * @param {?} part\n     * @param {?=} newLine\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.print = function (from, part, newLine) {\n        if (newLine === void 0) { newLine = false; }\n        if (part.length > 0) {\n            this._currentLine.parts.push(part);\n            this._currentLine.partsLength += part.length;\n            this._currentLine.srcSpans.push(from && from.sourceSpan || null);\n        }\n        if (newLine) {\n            this._lines.push(new _EmittedLine(this._indent));\n        }\n    };\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.removeEmptyLastLine = function () {\n        if (this.lineIsEmpty()) {\n            this._lines.pop();\n        }\n    };\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.incIndent = function () {\n        this._indent++;\n        if (this.lineIsEmpty()) {\n            this._currentLine.indent = this._indent;\n        }\n    };\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.decIndent = function () {\n        this._indent--;\n        if (this.lineIsEmpty()) {\n            this._currentLine.indent = this._indent;\n        }\n    };\n    /**\n     * @param {?} clazz\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.pushClass = function (clazz) { this._classes.push(clazz); };\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.popClass = function () { return ((this._classes.pop())); };\n    Object.defineProperty(EmitterVisitorContext.prototype, \"currentClass\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return this._classes.length > 0 ? this._classes[this._classes.length - 1] : null;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.toSource = function () {\n        return this.sourceLines\n            .map(function (l) { return l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''; })\n            .join('\\n');\n    };\n    /**\n     * @param {?} sourceFilePath\n     * @param {?} genFilePath\n     * @param {?=} startsAtLine\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.toSourceMapGenerator = function (sourceFilePath, genFilePath, startsAtLine) {\n        if (startsAtLine === void 0) { startsAtLine = 0; }\n        var /** @type {?} */ map = new SourceMapGenerator(genFilePath);\n        var /** @type {?} */ firstOffsetMapped = false;\n        var /** @type {?} */ mapFirstOffsetIfNeeded = function () {\n            if (!firstOffsetMapped) {\n                // Add a single space so that tools won't try to load the file from disk.\n                // Note: We are using virtual urls like `ng:///`, so we have to\n                // provide a content here.\n                map.addSource(sourceFilePath, ' ').addMapping(0, sourceFilePath, 0, 0);\n                firstOffsetMapped = true;\n            }\n        };\n        for (var /** @type {?} */ i = 0; i < startsAtLine; i++) {\n            map.addLine();\n            mapFirstOffsetIfNeeded();\n        }\n        this.sourceLines.forEach(function (line, lineIdx) {\n            map.addLine();\n            var /** @type {?} */ spans = line.srcSpans;\n            var /** @type {?} */ parts = line.parts;\n            var /** @type {?} */ col0 = line.indent * _INDENT_WITH.length;\n            var /** @type {?} */ spanIdx = 0;\n            // skip leading parts without source spans\n            while (spanIdx < spans.length && !spans[spanIdx]) {\n                col0 += parts[spanIdx].length;\n                spanIdx++;\n            }\n            if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {\n                firstOffsetMapped = true;\n            }\n            else {\n                mapFirstOffsetIfNeeded();\n            }\n            while (spanIdx < spans.length) {\n                var /** @type {?} */ span = ((spans[spanIdx]));\n                var /** @type {?} */ source = span.start.file;\n                var /** @type {?} */ sourceLine = span.start.line;\n                var /** @type {?} */ sourceCol = span.start.col;\n                map.addSource(source.url, source.content)\n                    .addMapping(col0, source.url, sourceLine, sourceCol);\n                col0 += parts[spanIdx].length;\n                spanIdx++;\n                // assign parts without span or the same span to the previous segment\n                while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {\n                    col0 += parts[spanIdx].length;\n                    spanIdx++;\n                }\n            }\n        });\n        return map;\n    };\n    /**\n     * @param {?} count\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.setPreambleLineCount = function (count) { return this._preambleLineCount = count; };\n    /**\n     * @param {?} line\n     * @param {?} column\n     * @return {?}\n     */\n    EmitterVisitorContext.prototype.spanOf = function (line, column) {\n        var /** @type {?} */ emittedLine = this._lines[line - this._preambleLineCount];\n        if (emittedLine) {\n            var /** @type {?} */ columnsLeft = column - emittedLine.indent;\n            for (var /** @type {?} */ partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {\n                var /** @type {?} */ part = emittedLine.parts[partIndex];\n                if (part.length > columnsLeft) {\n                    return emittedLine.srcSpans[partIndex];\n                }\n                columnsLeft -= part.length;\n            }\n        }\n        return null;\n    };\n    Object.defineProperty(EmitterVisitorContext.prototype, \"sourceLines\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {\n                return this._lines.slice(0, -1);\n            }\n            return this._lines;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    return EmitterVisitorContext;\n}());\n/**\n * @abstract\n */\nvar AbstractEmitterVisitor = (function () {\n    /**\n     * @param {?} _escapeDollarInStrings\n     */\n    function AbstractEmitterVisitor(_escapeDollarInStrings) {\n        this._escapeDollarInStrings = _escapeDollarInStrings;\n    }\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitExpressionStmt = function (stmt, ctx) {\n        stmt.expr.visitExpression(this, ctx);\n        ctx.println(stmt, ';');\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitReturnStmt = function (stmt, ctx) {\n        ctx.print(stmt, \"return \");\n        stmt.value.visitExpression(this, ctx);\n        ctx.println(stmt, ';');\n        return null;\n    };\n    /**\n     * @abstract\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitCastExpr = function (ast, context) { };\n    /**\n     * @abstract\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) { };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitIfStmt = function (stmt, ctx) {\n        ctx.print(stmt, \"if (\");\n        stmt.condition.visitExpression(this, ctx);\n        ctx.print(stmt, \") {\");\n        var /** @type {?} */ hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;\n        if (stmt.trueCase.length <= 1 && !hasElseCase) {\n            ctx.print(stmt, \" \");\n            this.visitAllStatements(stmt.trueCase, ctx);\n            ctx.removeEmptyLastLine();\n            ctx.print(stmt, \" \");\n        }\n        else {\n            ctx.println();\n            ctx.incIndent();\n            this.visitAllStatements(stmt.trueCase, ctx);\n            ctx.decIndent();\n            if (hasElseCase) {\n                ctx.println(stmt, \"} else {\");\n                ctx.incIndent();\n                this.visitAllStatements(stmt.falseCase, ctx);\n                ctx.decIndent();\n            }\n        }\n        ctx.println(stmt, \"}\");\n        return null;\n    };\n    /**\n     * @abstract\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) { };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitThrowStmt = function (stmt, ctx) {\n        ctx.print(stmt, \"throw \");\n        stmt.error.visitExpression(this, ctx);\n        ctx.println(stmt, \";\");\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitCommentStmt = function (stmt, ctx) {\n        var /** @type {?} */ lines = stmt.comment.split('\\n');\n        lines.forEach(function (line) { ctx.println(stmt, \"// \" + line); });\n        return null;\n    };\n    /**\n     * @abstract\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) { };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitWriteVarExpr = function (expr, ctx) {\n        var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();\n        if (!lineWasEmpty) {\n            ctx.print(expr, '(');\n        }\n        ctx.print(expr, expr.name + \" = \");\n        expr.value.visitExpression(this, ctx);\n        if (!lineWasEmpty) {\n            ctx.print(expr, ')');\n        }\n        return null;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitWriteKeyExpr = function (expr, ctx) {\n        var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();\n        if (!lineWasEmpty) {\n            ctx.print(expr, '(');\n        }\n        expr.receiver.visitExpression(this, ctx);\n        ctx.print(expr, \"[\");\n        expr.index.visitExpression(this, ctx);\n        ctx.print(expr, \"] = \");\n        expr.value.visitExpression(this, ctx);\n        if (!lineWasEmpty) {\n            ctx.print(expr, ')');\n        }\n        return null;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitWritePropExpr = function (expr, ctx) {\n        var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();\n        if (!lineWasEmpty) {\n            ctx.print(expr, '(');\n        }\n        expr.receiver.visitExpression(this, ctx);\n        ctx.print(expr, \".\" + expr.name + \" = \");\n        expr.value.visitExpression(this, ctx);\n        if (!lineWasEmpty) {\n            ctx.print(expr, ')');\n        }\n        return null;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitInvokeMethodExpr = function (expr, ctx) {\n        expr.receiver.visitExpression(this, ctx);\n        var /** @type {?} */ name = expr.name;\n        if (expr.builtin != null) {\n            name = this.getBuiltinMethodName(expr.builtin);\n            if (name == null) {\n                // some builtins just mean to skip the call.\n                return null;\n            }\n        }\n        ctx.print(expr, \".\" + name + \"(\");\n        this.visitAllExpressions(expr.args, ctx, \",\");\n        ctx.print(expr, \")\");\n        return null;\n    };\n    /**\n     * @abstract\n     * @param {?} method\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.getBuiltinMethodName = function (method) { };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr, ctx) {\n        expr.fn.visitExpression(this, ctx);\n        ctx.print(expr, \"(\");\n        this.visitAllExpressions(expr.args, ctx, ',');\n        ctx.print(expr, \")\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitReadVarExpr = function (ast, ctx) {\n        var /** @type {?} */ varName = ((ast.name));\n        if (ast.builtin != null) {\n            switch (ast.builtin) {\n                case BuiltinVar.Super:\n                    varName = 'super';\n                    break;\n                case BuiltinVar.This:\n                    varName = 'this';\n                    break;\n                case BuiltinVar.CatchError:\n                    varName = ((CATCH_ERROR_VAR$1.name));\n                    break;\n                case BuiltinVar.CatchStack:\n                    varName = ((CATCH_STACK_VAR$1.name));\n                    break;\n                default:\n                    throw new Error(\"Unknown builtin variable \" + ast.builtin);\n            }\n        }\n        ctx.print(ast, varName);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitInstantiateExpr = function (ast, ctx) {\n        ctx.print(ast, \"new \");\n        ast.classExpr.visitExpression(this, ctx);\n        ctx.print(ast, \"(\");\n        this.visitAllExpressions(ast.args, ctx, ',');\n        ctx.print(ast, \")\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitLiteralExpr = function (ast, ctx) {\n        var /** @type {?} */ value = ast.value;\n        if (typeof value === 'string') {\n            ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));\n        }\n        else {\n            ctx.print(ast, \"\" + value);\n        }\n        return null;\n    };\n    /**\n     * @abstract\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) { };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitConditionalExpr = function (ast, ctx) {\n        ctx.print(ast, \"(\");\n        ast.condition.visitExpression(this, ctx);\n        ctx.print(ast, '? ');\n        ast.trueCase.visitExpression(this, ctx);\n        ctx.print(ast, ': '); /** @type {?} */\n        ((ast.falseCase)).visitExpression(this, ctx);\n        ctx.print(ast, \")\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitNotExpr = function (ast, ctx) {\n        ctx.print(ast, '!');\n        ast.condition.visitExpression(this, ctx);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitAssertNotNullExpr = function (ast, ctx) {\n        ast.condition.visitExpression(this, ctx);\n        return null;\n    };\n    /**\n     * @abstract\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) { };\n    /**\n     * @abstract\n     * @param {?} stmt\n     * @param {?} context\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr = function (ast, ctx) {\n        var /** @type {?} */ opStr;\n        switch (ast.operator) {\n            case BinaryOperator.Equals:\n                opStr = '==';\n                break;\n            case BinaryOperator.Identical:\n                opStr = '===';\n                break;\n            case BinaryOperator.NotEquals:\n                opStr = '!=';\n                break;\n            case BinaryOperator.NotIdentical:\n                opStr = '!==';\n                break;\n            case BinaryOperator.And:\n                opStr = '&&';\n                break;\n            case BinaryOperator.Or:\n                opStr = '||';\n                break;\n            case BinaryOperator.Plus:\n                opStr = '+';\n                break;\n            case BinaryOperator.Minus:\n                opStr = '-';\n                break;\n            case BinaryOperator.Divide:\n                opStr = '/';\n                break;\n            case BinaryOperator.Multiply:\n                opStr = '*';\n                break;\n            case BinaryOperator.Modulo:\n                opStr = '%';\n                break;\n            case BinaryOperator.Lower:\n                opStr = '<';\n                break;\n            case BinaryOperator.LowerEquals:\n                opStr = '<=';\n                break;\n            case BinaryOperator.Bigger:\n                opStr = '>';\n                break;\n            case BinaryOperator.BiggerEquals:\n                opStr = '>=';\n                break;\n            default:\n                throw new Error(\"Unknown operator \" + ast.operator);\n        }\n        ctx.print(ast, \"(\");\n        ast.lhs.visitExpression(this, ctx);\n        ctx.print(ast, \" \" + opStr + \" \");\n        ast.rhs.visitExpression(this, ctx);\n        ctx.print(ast, \")\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitReadPropExpr = function (ast, ctx) {\n        ast.receiver.visitExpression(this, ctx);\n        ctx.print(ast, \".\");\n        ctx.print(ast, ast.name);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitReadKeyExpr = function (ast, ctx) {\n        ast.receiver.visitExpression(this, ctx);\n        ctx.print(ast, \"[\");\n        ast.index.visitExpression(this, ctx);\n        ctx.print(ast, \"]\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitLiteralArrayExpr = function (ast, ctx) {\n        ctx.print(ast, \"[\");\n        this.visitAllExpressions(ast.entries, ctx, ',');\n        ctx.print(ast, \"]\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitLiteralMapExpr = function (ast, ctx) {\n        var _this = this;\n        ctx.print(ast, \"{\");\n        this.visitAllObjects(function (entry) {\n            ctx.print(ast, escapeIdentifier(entry.key, _this._escapeDollarInStrings, entry.quoted) + \":\");\n            entry.value.visitExpression(_this, ctx);\n        }, ast.entries, ctx, ',');\n        ctx.print(ast, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitCommaExpr = function (ast, ctx) {\n        ctx.print(ast, '(');\n        this.visitAllExpressions(ast.parts, ctx, ',');\n        ctx.print(ast, ')');\n        return null;\n    };\n    /**\n     * @param {?} expressions\n     * @param {?} ctx\n     * @param {?} separator\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitAllExpressions = function (expressions, ctx, separator) {\n        var _this = this;\n        this.visitAllObjects(function (expr) { return expr.visitExpression(_this, ctx); }, expressions, ctx, separator);\n    };\n    /**\n     * @template T\n     * @param {?} handler\n     * @param {?} expressions\n     * @param {?} ctx\n     * @param {?} separator\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitAllObjects = function (handler, expressions, ctx, separator) {\n        var /** @type {?} */ incrementedIndent = false;\n        for (var /** @type {?} */ i = 0; i < expressions.length; i++) {\n            if (i > 0) {\n                if (ctx.lineLength() > 80) {\n                    ctx.print(null, separator, true);\n                    if (!incrementedIndent) {\n                        // continuation are marked with double indent.\n                        ctx.incIndent();\n                        ctx.incIndent();\n                        incrementedIndent = true;\n                    }\n                }\n                else {\n                    ctx.print(null, separator, false);\n                }\n            }\n            handler(expressions[i]);\n        }\n        if (incrementedIndent) {\n            // continuation are marked with double indent.\n            ctx.decIndent();\n            ctx.decIndent();\n        }\n    };\n    /**\n     * @param {?} statements\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractEmitterVisitor.prototype.visitAllStatements = function (statements, ctx) {\n        var _this = this;\n        statements.forEach(function (stmt) { return stmt.visitStatement(_this, ctx); });\n    };\n    return AbstractEmitterVisitor;\n}());\n/**\n * @param {?} input\n * @param {?} escapeDollar\n * @param {?=} alwaysQuote\n * @return {?}\n */\nfunction escapeIdentifier(input, escapeDollar, alwaysQuote) {\n    if (alwaysQuote === void 0) { alwaysQuote = true; }\n    if (input == null) {\n        return null;\n    }\n    var /** @type {?} */ body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, function () {\n        var match = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            match[_i] = arguments[_i];\n        }\n        if (match[0] == '$') {\n            return escapeDollar ? '\\\\$' : '$';\n        }\n        else if (match[0] == '\\n') {\n            return '\\\\n';\n        }\n        else if (match[0] == '\\r') {\n            return '\\\\r';\n        }\n        else {\n            return \"\\\\\" + match[0];\n        }\n    });\n    var /** @type {?} */ requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);\n    return requiresQuotes ? \"'\" + body + \"'\" : body;\n}\n/**\n * @param {?} count\n * @return {?}\n */\nfunction _createIndent(count) {\n    var /** @type {?} */ res = '';\n    for (var /** @type {?} */ i = 0; i < count; i++) {\n        res += _INDENT_WITH;\n    }\n    return res;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction debugOutputAstAsTypeScript(ast) {\n    var /** @type {?} */ converter = new _TsEmitterVisitor();\n    var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();\n    var /** @type {?} */ asts = Array.isArray(ast) ? ast : [ast];\n    asts.forEach(function (ast) {\n        if (ast instanceof Statement) {\n            ast.visitStatement(converter, ctx);\n        }\n        else if (ast instanceof Expression) {\n            ast.visitExpression(converter, ctx);\n        }\n        else if (ast instanceof Type$1) {\n            ast.visitType(converter, ctx);\n        }\n        else {\n            throw new Error(\"Don't know how to print debug info for \" + ast);\n        }\n    });\n    return ctx.toSource();\n}\nvar TypeScriptEmitter = (function () {\n    function TypeScriptEmitter() {\n    }\n    /**\n     * @param {?} srcFilePath\n     * @param {?} genFilePath\n     * @param {?} stmts\n     * @param {?=} preamble\n     * @param {?=} emitSourceMaps\n     * @return {?}\n     */\n    TypeScriptEmitter.prototype.emitStatementsAndContext = function (srcFilePath, genFilePath, stmts, preamble, emitSourceMaps) {\n        if (preamble === void 0) { preamble = ''; }\n        if (emitSourceMaps === void 0) { emitSourceMaps = true; }\n        var /** @type {?} */ converter = new _TsEmitterVisitor();\n        var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();\n        converter.visitAllStatements(stmts, ctx);\n        var /** @type {?} */ preambleLines = preamble ? preamble.split('\\n') : [];\n        converter.reexports.forEach(function (reexports, exportedModuleName) {\n            var /** @type {?} */ reexportsCode = reexports.map(function (reexport) { return reexport.name + \" as \" + reexport.as; }).join(',');\n            preambleLines.push(\"export {\" + reexportsCode + \"} from '\" + exportedModuleName + \"';\");\n        });\n        converter.importsWithPrefixes.forEach(function (prefix, importedModuleName) {\n            // Note: can't write the real word for import as it screws up system.js auto detection...\n            preambleLines.push(\"imp\" +\n                (\"ort * as \" + prefix + \" from '\" + importedModuleName + \"';\"));\n        });\n        var /** @type {?} */ sm = emitSourceMaps ?\n            ctx.toSourceMapGenerator(srcFilePath, genFilePath, preambleLines.length).toJsComment() :\n            '';\n        var /** @type {?} */ lines = preambleLines.concat([ctx.toSource(), sm]);\n        if (sm) {\n            // always add a newline at the end, as some tools have bugs without it.\n            lines.push('');\n        }\n        ctx.setPreambleLineCount(preambleLines.length);\n        return { sourceText: lines.join('\\n'), context: ctx };\n    };\n    /**\n     * @param {?} srcFilePath\n     * @param {?} genFilePath\n     * @param {?} stmts\n     * @param {?=} preamble\n     * @return {?}\n     */\n    TypeScriptEmitter.prototype.emitStatements = function (srcFilePath, genFilePath, stmts, preamble) {\n        if (preamble === void 0) { preamble = ''; }\n        return this.emitStatementsAndContext(srcFilePath, genFilePath, stmts, preamble).sourceText;\n    };\n    return TypeScriptEmitter;\n}());\nvar _TsEmitterVisitor = (function (_super) {\n    __extends(_TsEmitterVisitor, _super);\n    function _TsEmitterVisitor() {\n        var _this = _super.call(this, false) || this;\n        _this.typeExpression = 0;\n        _this.importsWithPrefixes = new Map();\n        _this.reexports = new Map();\n        return _this;\n    }\n    /**\n     * @param {?} t\n     * @param {?} ctx\n     * @param {?=} defaultType\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitType = function (t, ctx, defaultType) {\n        if (defaultType === void 0) { defaultType = 'any'; }\n        if (t) {\n            this.typeExpression++;\n            t.visitType(this, ctx);\n            this.typeExpression--;\n        }\n        else {\n            ctx.print(null, defaultType);\n        }\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitLiteralExpr = function (ast, ctx) {\n        var /** @type {?} */ value = ast.value;\n        if (value == null && ast.type != INFERRED_TYPE) {\n            ctx.print(ast, \"(\" + value + \" as any)\");\n            return null;\n        }\n        return _super.prototype.visitLiteralExpr.call(this, ast, ctx);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitLiteralArrayExpr = function (ast, ctx) {\n        if (ast.entries.length === 0) {\n            ctx.print(ast, '(');\n        }\n        var /** @type {?} */ result = _super.prototype.visitLiteralArrayExpr.call(this, ast, ctx);\n        if (ast.entries.length === 0) {\n            ctx.print(ast, ' as any[])');\n        }\n        return result;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) {\n        this._visitIdentifier(ast.value, ast.typeParams, ctx);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitAssertNotNullExpr = function (ast, ctx) {\n        var /** @type {?} */ result = _super.prototype.visitAssertNotNullExpr.call(this, ast, ctx);\n        ctx.print(ast, '!');\n        return result;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n        if (stmt.hasModifier(StmtModifier.Exported) && stmt.value instanceof ExternalExpr &&\n            !stmt.type) {\n            // check for a reexport\n            var _a = stmt.value.value, name = _a.name, moduleName = _a.moduleName;\n            if (moduleName) {\n                var /** @type {?} */ reexports = this.reexports.get(moduleName);\n                if (!reexports) {\n                    reexports = [];\n                    this.reexports.set(moduleName, reexports);\n                }\n                reexports.push({ name: /** @type {?} */ ((name)), as: stmt.name });\n                return null;\n            }\n        }\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            ctx.print(stmt, \"export \");\n        }\n        if (stmt.hasModifier(StmtModifier.Final)) {\n            ctx.print(stmt, \"const\");\n        }\n        else {\n            ctx.print(stmt, \"var\");\n        }\n        ctx.print(stmt, \" \" + stmt.name);\n        this._printColonType(stmt.type, ctx);\n        ctx.print(stmt, \" = \");\n        stmt.value.visitExpression(this, ctx);\n        ctx.println(stmt, \";\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitCastExpr = function (ast, ctx) {\n        ctx.print(ast, \"(<\"); /** @type {?} */\n        ((ast.type)).visitType(this, ctx);\n        ctx.print(ast, \">\");\n        ast.value.visitExpression(this, ctx);\n        ctx.print(ast, \")\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitInstantiateExpr = function (ast, ctx) {\n        ctx.print(ast, \"new \");\n        this.typeExpression++;\n        ast.classExpr.visitExpression(this, ctx);\n        this.typeExpression--;\n        ctx.print(ast, \"(\");\n        this.visitAllExpressions(ast.args, ctx, ',');\n        ctx.print(ast, \")\");\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n        var _this = this;\n        ctx.pushClass(stmt);\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            ctx.print(stmt, \"export \");\n        }\n        ctx.print(stmt, \"class \" + stmt.name);\n        if (stmt.parent != null) {\n            ctx.print(stmt, \" extends \");\n            this.typeExpression++;\n            stmt.parent.visitExpression(this, ctx);\n            this.typeExpression--;\n        }\n        ctx.println(stmt, \" {\");\n        ctx.incIndent();\n        stmt.fields.forEach(function (field) { return _this._visitClassField(field, ctx); });\n        if (stmt.constructorMethod != null) {\n            this._visitClassConstructor(stmt, ctx);\n        }\n        stmt.getters.forEach(function (getter) { return _this._visitClassGetter(getter, ctx); });\n        stmt.methods.forEach(function (method) { return _this._visitClassMethod(method, ctx); });\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n        ctx.popClass();\n        return null;\n    };\n    /**\n     * @param {?} field\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._visitClassField = function (field, ctx) {\n        if (field.hasModifier(StmtModifier.Private)) {\n            // comment out as a workaround for #10967\n            ctx.print(null, \"/*private*/ \");\n        }\n        ctx.print(null, field.name);\n        this._printColonType(field.type, ctx);\n        ctx.println(null, \";\");\n    };\n    /**\n     * @param {?} getter\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._visitClassGetter = function (getter, ctx) {\n        if (getter.hasModifier(StmtModifier.Private)) {\n            ctx.print(null, \"private \");\n        }\n        ctx.print(null, \"get \" + getter.name + \"()\");\n        this._printColonType(getter.type, ctx);\n        ctx.println(null, \" {\");\n        ctx.incIndent();\n        this.visitAllStatements(getter.body, ctx);\n        ctx.decIndent();\n        ctx.println(null, \"}\");\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._visitClassConstructor = function (stmt, ctx) {\n        ctx.print(stmt, \"constructor(\");\n        this._visitParams(stmt.constructorMethod.params, ctx);\n        ctx.println(stmt, \") {\");\n        ctx.incIndent();\n        this.visitAllStatements(stmt.constructorMethod.body, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n    };\n    /**\n     * @param {?} method\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._visitClassMethod = function (method, ctx) {\n        if (method.hasModifier(StmtModifier.Private)) {\n            ctx.print(null, \"private \");\n        }\n        ctx.print(null, method.name + \"(\");\n        this._visitParams(method.params, ctx);\n        ctx.print(null, \")\");\n        this._printColonType(method.type, ctx, 'void');\n        ctx.println(null, \" {\");\n        ctx.incIndent();\n        this.visitAllStatements(method.body, ctx);\n        ctx.decIndent();\n        ctx.println(null, \"}\");\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) {\n        ctx.print(ast, \"(\");\n        this._visitParams(ast.params, ctx);\n        ctx.print(ast, \")\");\n        this._printColonType(ast.type, ctx, 'void');\n        ctx.println(ast, \" => {\");\n        ctx.incIndent();\n        this.visitAllStatements(ast.statements, ctx);\n        ctx.decIndent();\n        ctx.print(ast, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            ctx.print(stmt, \"export \");\n        }\n        ctx.print(stmt, \"function \" + stmt.name + \"(\");\n        this._visitParams(stmt.params, ctx);\n        ctx.print(stmt, \")\");\n        this._printColonType(stmt.type, ctx, 'void');\n        ctx.println(stmt, \" {\");\n        ctx.incIndent();\n        this.visitAllStatements(stmt.statements, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) {\n        ctx.println(stmt, \"try {\");\n        ctx.incIndent();\n        this.visitAllStatements(stmt.bodyStmts, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"} catch (\" + CATCH_ERROR_VAR$1.name + \") {\");\n        ctx.incIndent();\n        var /** @type {?} */ catchStmts = [/** @type {?} */ (CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack', null)).toDeclStmt(null, [\n                StmtModifier.Final\n            ]))].concat(stmt.catchStmts);\n        this.visitAllStatements(catchStmts, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} type\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitBuiltintType = function (type, ctx) {\n        var /** @type {?} */ typeStr;\n        switch (type.name) {\n            case BuiltinTypeName.Bool:\n                typeStr = 'boolean';\n                break;\n            case BuiltinTypeName.Dynamic:\n                typeStr = 'any';\n                break;\n            case BuiltinTypeName.Function:\n                typeStr = 'Function';\n                break;\n            case BuiltinTypeName.Number:\n                typeStr = 'number';\n                break;\n            case BuiltinTypeName.Int:\n                typeStr = 'number';\n                break;\n            case BuiltinTypeName.String:\n                typeStr = 'string';\n                break;\n            default:\n                throw new Error(\"Unsupported builtin type \" + type.name);\n        }\n        ctx.print(null, typeStr);\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitExpressionType = function (ast, ctx) {\n        ast.value.visitExpression(this, ctx);\n        return null;\n    };\n    /**\n     * @param {?} type\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitArrayType = function (type, ctx) {\n        this.visitType(type.of, ctx);\n        ctx.print(null, \"[]\");\n        return null;\n    };\n    /**\n     * @param {?} type\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.visitMapType = function (type, ctx) {\n        ctx.print(null, \"{[key: string]:\");\n        this.visitType(type.valueType, ctx);\n        ctx.print(null, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} method\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype.getBuiltinMethodName = function (method) {\n        var /** @type {?} */ name;\n        switch (method) {\n            case BuiltinMethod.ConcatArray:\n                name = 'concat';\n                break;\n            case BuiltinMethod.SubscribeObservable:\n                name = 'subscribe';\n                break;\n            case BuiltinMethod.Bind:\n                name = 'bind';\n                break;\n            default:\n                throw new Error(\"Unknown builtin method: \" + method);\n        }\n        return name;\n    };\n    /**\n     * @param {?} params\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._visitParams = function (params, ctx) {\n        var _this = this;\n        this.visitAllObjects(function (param) {\n            ctx.print(null, param.name);\n            _this._printColonType(param.type, ctx);\n        }, params, ctx, ',');\n    };\n    /**\n     * @param {?} value\n     * @param {?} typeParams\n     * @param {?} ctx\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._visitIdentifier = function (value, typeParams, ctx) {\n        var _this = this;\n        var name = value.name, moduleName = value.moduleName;\n        if (moduleName) {\n            var /** @type {?} */ prefix = this.importsWithPrefixes.get(moduleName);\n            if (prefix == null) {\n                prefix = \"i\" + this.importsWithPrefixes.size;\n                this.importsWithPrefixes.set(moduleName, prefix);\n            }\n            ctx.print(null, prefix + \".\");\n        }\n        ctx.print(null, /** @type {?} */ ((name)));\n        if (this.typeExpression > 0) {\n            // If we are in a type expression that refers to a generic type then supply\n            // the required type parameters. If there were not enough type parameters\n            // supplied, supply any as the type. Outside a type expression the reference\n            // should not supply type parameters and be treated as a simple value reference\n            // to the constructor function itself.\n            var /** @type {?} */ suppliedParameters = typeParams || [];\n            if (suppliedParameters.length > 0) {\n                ctx.print(null, \"<\");\n                this.visitAllObjects(function (type) { return type.visitType(_this, ctx); }, /** @type {?} */ ((typeParams)), ctx, ',');\n                ctx.print(null, \">\");\n            }\n        }\n    };\n    /**\n     * @param {?} type\n     * @param {?} ctx\n     * @param {?=} defaultType\n     * @return {?}\n     */\n    _TsEmitterVisitor.prototype._printColonType = function (type, ctx, defaultType) {\n        if (type !== INFERRED_TYPE) {\n            ctx.print(null, ':');\n            this.visitType(type, ctx, defaultType);\n        }\n    };\n    return _TsEmitterVisitor;\n}(AbstractEmitterVisitor));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Map from tagName|propertyName SecurityContext. Properties applying to all tags use '*'.\n */\nvar SECURITY_SCHEMA = {};\n/**\n * @param {?} ctx\n * @param {?} specs\n * @return {?}\n */\nfunction registerContext(ctx, specs) {\n    for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) {\n        var spec = specs_1[_i];\n        SECURITY_SCHEMA[spec.toLowerCase()] = ctx;\n    }\n}\n// Case is insignificant below, all element and attribute names are lower-cased for lookup.\nregisterContext(_angular_core.SecurityContext.HTML, [\n    'iframe|srcdoc',\n    '*|innerHTML',\n    '*|outerHTML',\n]);\nregisterContext(_angular_core.SecurityContext.STYLE, ['*|style']);\n// NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.\nregisterContext(_angular_core.SecurityContext.URL, [\n    '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',\n    'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',\n    'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',\n    'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',\n]);\nregisterContext(_angular_core.SecurityContext.RESOURCE_URL, [\n    'applet|code',\n    'applet|codebase',\n    'base|href',\n    'embed|src',\n    'frame|src',\n    'head|profile',\n    'html|manifest',\n    'iframe|src',\n    'link|href',\n    'media|src',\n    'object|codebase',\n    'object|data',\n    'script|src',\n]);\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar BOOLEAN = 'boolean';\nvar NUMBER = 'number';\nvar STRING = 'string';\nvar OBJECT = 'object';\n/**\n * This array represents the DOM schema. It encodes inheritance, properties, and events.\n *\n * ## Overview\n *\n * Each line represents one kind of element. The `element_inheritance` and properties are joined\n * using `element_inheritance|properties` syntax.\n *\n * ## Element Inheritance\n *\n * The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`.\n * Here the individual elements are separated by `,` (commas). Every element in the list\n * has identical properties.\n *\n * An `element` may inherit additional properties from `parentElement` If no `^parentElement` is\n * specified then `\"\"` (blank) element is assumed.\n *\n * NOTE: The blank element inherits from root `[Element]` element, the super element of all\n * elements.\n *\n * NOTE an element prefix such as `:svg:` has no special meaning to the schema.\n *\n * ## Properties\n *\n * Each element has a set of properties separated by `,` (commas). Each property can be prefixed\n * by a special character designating its type:\n *\n * - (no prefix): property is a string.\n * - `*`: property represents an event.\n * - `!`: property is a boolean.\n * - `#`: property is a number.\n * - `%`: property is an object.\n *\n * ## Query\n *\n * The class creates an internal squas representation which allows to easily answer the query of\n * if a given property exist on a given element.\n *\n * NOTE: We don't yet support querying for types or events.\n * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder,\n *       see dom_element_schema_registry_spec.ts\n */\n// =================================================================================================\n// =================================================================================================\n// =========== S T O P   -  S T O P   -  S T O P   -  S T O P   -  S T O P   -  S T O P  ===========\n// =================================================================================================\n// =================================================================================================\n//\n//                       DO NOT EDIT THIS DOM SCHEMA WITHOUT A SECURITY REVIEW!\n//\n// Newly added properties must be security reviewed and assigned an appropriate SecurityContext in\n// dom_security_schema.ts. Reach out to mprobst & rjamet for details.\n//\n// =================================================================================================\nvar SCHEMA = [\n    '[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop',\n    '[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate',\n    'abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate',\n    'media^[HTMLElement]|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,%srcObject,#volume',\n    ':svg:^[HTMLElement]|*abort,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',\n    ':svg:graphics^:svg:|',\n    ':svg:animation^:svg:|*begin,*end,*repeat',\n    ':svg:geometry^:svg:|',\n    ':svg:componentTransferFunction^:svg:|',\n    ':svg:gradient^:svg:|',\n    ':svg:textContent^:svg:graphics|',\n    ':svg:textPositioning^:svg:textContent|',\n    'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username',\n    'area^[HTMLElement]|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,search,shape,target,username',\n    'audio^media|',\n    'br^[HTMLElement]|clear',\n    'base^[HTMLElement]|href,target',\n    'body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',\n    'button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',\n    'canvas^[HTMLElement]|#height,#width',\n    'content^[HTMLElement]|select',\n    'dl^[HTMLElement]|!compact',\n    'datalist^[HTMLElement]|',\n    'details^[HTMLElement]|!open',\n    'dialog^[HTMLElement]|!open,returnValue',\n    'dir^[HTMLElement]|!compact',\n    'div^[HTMLElement]|align',\n    'embed^[HTMLElement]|align,height,name,src,type,width',\n    'fieldset^[HTMLElement]|!disabled,name',\n    'font^[HTMLElement]|color,face,size',\n    'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',\n    'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',\n    'frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',\n    'hr^[HTMLElement]|align,color,!noShade,size,width',\n    'head^[HTMLElement]|',\n    'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',\n    'html^[HTMLElement]|version',\n    'iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',\n    'img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',\n    'input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',\n    'keygen^[HTMLElement]|!autofocus,challenge,!disabled,keytype,name',\n    'li^[HTMLElement]|type,#value',\n    'label^[HTMLElement]|htmlFor',\n    'legend^[HTMLElement]|align',\n    'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',\n    'map^[HTMLElement]|name',\n    'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',\n    'menu^[HTMLElement]|!compact',\n    'meta^[HTMLElement]|content,httpEquiv,name,scheme',\n    'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',\n    'ins,del^[HTMLElement]|cite,dateTime',\n    'ol^[HTMLElement]|!compact,!reversed,#start,type',\n    'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',\n    'optgroup^[HTMLElement]|!disabled,label',\n    'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value',\n    'output^[HTMLElement]|defaultValue,%htmlFor,name,value',\n    'p^[HTMLElement]|align',\n    'param^[HTMLElement]|name,type,value,valueType',\n    'picture^[HTMLElement]|',\n    'pre^[HTMLElement]|#width',\n    'progress^[HTMLElement]|#max,#value',\n    'q,blockquote,cite^[HTMLElement]|',\n    'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',\n    'select^[HTMLElement]|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',\n    'shadow^[HTMLElement]|',\n    'source^[HTMLElement]|media,sizes,src,srcset,type',\n    'span^[HTMLElement]|',\n    'style^[HTMLElement]|!disabled,media,type',\n    'caption^[HTMLElement]|align',\n    'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',\n    'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width',\n    'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',\n    'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',\n    'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',\n    'template^[HTMLElement]|',\n    'textarea^[HTMLElement]|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',\n    'title^[HTMLElement]|text',\n    'track^[HTMLElement]|!default,kind,label,src,srclang',\n    'ul^[HTMLElement]|!compact,type',\n    'unknown^[HTMLElement]|',\n    'video^media|#height,poster,#width',\n    ':svg:a^:svg:graphics|',\n    ':svg:animate^:svg:animation|',\n    ':svg:animateMotion^:svg:animation|',\n    ':svg:animateTransform^:svg:animation|',\n    ':svg:circle^:svg:geometry|',\n    ':svg:clipPath^:svg:graphics|',\n    ':svg:cursor^:svg:|',\n    ':svg:defs^:svg:graphics|',\n    ':svg:desc^:svg:|',\n    ':svg:discard^:svg:|',\n    ':svg:ellipse^:svg:geometry|',\n    ':svg:feBlend^:svg:|',\n    ':svg:feColorMatrix^:svg:|',\n    ':svg:feComponentTransfer^:svg:|',\n    ':svg:feComposite^:svg:|',\n    ':svg:feConvolveMatrix^:svg:|',\n    ':svg:feDiffuseLighting^:svg:|',\n    ':svg:feDisplacementMap^:svg:|',\n    ':svg:feDistantLight^:svg:|',\n    ':svg:feDropShadow^:svg:|',\n    ':svg:feFlood^:svg:|',\n    ':svg:feFuncA^:svg:componentTransferFunction|',\n    ':svg:feFuncB^:svg:componentTransferFunction|',\n    ':svg:feFuncG^:svg:componentTransferFunction|',\n    ':svg:feFuncR^:svg:componentTransferFunction|',\n    ':svg:feGaussianBlur^:svg:|',\n    ':svg:feImage^:svg:|',\n    ':svg:feMerge^:svg:|',\n    ':svg:feMergeNode^:svg:|',\n    ':svg:feMorphology^:svg:|',\n    ':svg:feOffset^:svg:|',\n    ':svg:fePointLight^:svg:|',\n    ':svg:feSpecularLighting^:svg:|',\n    ':svg:feSpotLight^:svg:|',\n    ':svg:feTile^:svg:|',\n    ':svg:feTurbulence^:svg:|',\n    ':svg:filter^:svg:|',\n    ':svg:foreignObject^:svg:graphics|',\n    ':svg:g^:svg:graphics|',\n    ':svg:image^:svg:graphics|',\n    ':svg:line^:svg:geometry|',\n    ':svg:linearGradient^:svg:gradient|',\n    ':svg:mpath^:svg:|',\n    ':svg:marker^:svg:|',\n    ':svg:mask^:svg:|',\n    ':svg:metadata^:svg:|',\n    ':svg:path^:svg:geometry|',\n    ':svg:pattern^:svg:|',\n    ':svg:polygon^:svg:geometry|',\n    ':svg:polyline^:svg:geometry|',\n    ':svg:radialGradient^:svg:gradient|',\n    ':svg:rect^:svg:geometry|',\n    ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',\n    ':svg:script^:svg:|type',\n    ':svg:set^:svg:animation|',\n    ':svg:stop^:svg:|',\n    ':svg:style^:svg:|!disabled,media,title,type',\n    ':svg:switch^:svg:graphics|',\n    ':svg:symbol^:svg:|',\n    ':svg:tspan^:svg:textPositioning|',\n    ':svg:text^:svg:textPositioning|',\n    ':svg:textPath^:svg:textContent|',\n    ':svg:title^:svg:|',\n    ':svg:use^:svg:graphics|',\n    ':svg:view^:svg:|#zoomAndPan',\n    'data^[HTMLElement]|value',\n    'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default',\n    'summary^[HTMLElement]|',\n    'time^[HTMLElement]|dateTime',\n];\nvar _ATTR_TO_PROP = {\n    'class': 'className',\n    'for': 'htmlFor',\n    'formaction': 'formAction',\n    'innerHtml': 'innerHTML',\n    'readonly': 'readOnly',\n    'tabindex': 'tabIndex',\n};\nvar DomElementSchemaRegistry = (function (_super) {\n    __extends(DomElementSchemaRegistry, _super);\n    function DomElementSchemaRegistry() {\n        var _this = _super.call(this) || this;\n        _this._schema = {};\n        SCHEMA.forEach(function (encodedType) {\n            var type = {};\n            var _a = encodedType.split('|'), strType = _a[0], strProperties = _a[1];\n            var properties = strProperties.split(',');\n            var _b = strType.split('^'), typeNames = _b[0], superName = _b[1];\n            typeNames.split(',').forEach(function (tag) { return _this._schema[tag.toLowerCase()] = type; });\n            var superType = superName && _this._schema[superName.toLowerCase()];\n            if (superType) {\n                Object.keys(superType).forEach(function (prop) { type[prop] = superType[prop]; });\n            }\n            properties.forEach(function (property) {\n                if (property.length > 0) {\n                    switch (property[0]) {\n                        case '*':\n                            // We don't yet support events.\n                            // If ever allowing to bind to events, GO THROUGH A SECURITY REVIEW, allowing events\n                            // will\n                            // almost certainly introduce bad XSS vulnerabilities.\n                            // type[property.substring(1)] = EVENT;\n                            break;\n                        case '!':\n                            type[property.substring(1)] = BOOLEAN;\n                            break;\n                        case '#':\n                            type[property.substring(1)] = NUMBER;\n                            break;\n                        case '%':\n                            type[property.substring(1)] = OBJECT;\n                            break;\n                        default:\n                            type[property] = STRING;\n                    }\n                }\n            });\n        });\n        return _this;\n    }\n    /**\n     * @param {?} tagName\n     * @param {?} propName\n     * @param {?} schemaMetas\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.hasProperty = function (tagName, propName, schemaMetas) {\n        if (schemaMetas.some(function (schema) { return schema.name === _angular_core.NO_ERRORS_SCHEMA.name; })) {\n            return true;\n        }\n        if (tagName.indexOf('-') > -1) {\n            if (isNgContainer(tagName) || isNgContent(tagName)) {\n                return false;\n            }\n            if (schemaMetas.some(function (schema) { return schema.name === _angular_core.CUSTOM_ELEMENTS_SCHEMA.name; })) {\n                // Can't tell now as we don't know which properties a custom element will get\n                // once it is instantiated\n                return true;\n            }\n        }\n        var /** @type {?} */ elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];\n        return !!elementProperties[propName];\n    };\n    /**\n     * @param {?} tagName\n     * @param {?} schemaMetas\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.hasElement = function (tagName, schemaMetas) {\n        if (schemaMetas.some(function (schema) { return schema.name === _angular_core.NO_ERRORS_SCHEMA.name; })) {\n            return true;\n        }\n        if (tagName.indexOf('-') > -1) {\n            if (isNgContainer(tagName) || isNgContent(tagName)) {\n                return true;\n            }\n            if (schemaMetas.some(function (schema) { return schema.name === _angular_core.CUSTOM_ELEMENTS_SCHEMA.name; })) {\n                // Allow any custom elements\n                return true;\n            }\n        }\n        return !!this._schema[tagName.toLowerCase()];\n    };\n    /**\n     * securityContext returns the security context for the given property on the given DOM tag.\n     *\n     * Tag and property name are statically known and cannot change at runtime, i.e. it is not\n     * possible to bind a value into a changing attribute or tag name.\n     *\n     * The filtering is white list based. All attributes in the schema above are assumed to have the\n     * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known\n     * attack vectors are assigned their appropriate context.\n     * @param {?} tagName\n     * @param {?} propName\n     * @param {?} isAttribute\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.securityContext = function (tagName, propName, isAttribute) {\n        if (isAttribute) {\n            // NB: For security purposes, use the mapped property name, not the attribute name.\n            propName = this.getMappedPropName(propName);\n        }\n        // Make sure comparisons are case insensitive, so that case differences between attribute and\n        // property names do not have a security impact.\n        tagName = tagName.toLowerCase();\n        propName = propName.toLowerCase();\n        var /** @type {?} */ ctx = SECURITY_SCHEMA[tagName + '|' + propName];\n        if (ctx) {\n            return ctx;\n        }\n        ctx = SECURITY_SCHEMA['*|' + propName];\n        return ctx ? ctx : _angular_core.SecurityContext.NONE;\n    };\n    /**\n     * @param {?} propName\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.getMappedPropName = function (propName) { return _ATTR_TO_PROP[propName] || propName; };\n    /**\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.getDefaultComponentElementName = function () { return 'ng-component'; };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.validateProperty = function (name) {\n        if (name.toLowerCase().startsWith('on')) {\n            var /** @type {?} */ msg = \"Binding to event property '\" + name + \"' is disallowed for security reasons, \" +\n                (\"please use (\" + name.slice(2) + \")=...\") +\n                (\"\\nIf '\" + name + \"' is a directive input, make sure the directive is imported by the\") +\n                \" current module.\";\n            return { error: true, msg: msg };\n        }\n        else {\n            return { error: false };\n        }\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.validateAttribute = function (name) {\n        if (name.toLowerCase().startsWith('on')) {\n            var /** @type {?} */ msg = \"Binding to event attribute '\" + name + \"' is disallowed for security reasons, \" +\n                (\"please use (\" + name.slice(2) + \")=...\");\n            return { error: true, msg: msg };\n        }\n        else {\n            return { error: false };\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.allKnownElementNames = function () { return Object.keys(this._schema); };\n    /**\n     * @param {?} propName\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = function (propName) {\n        return dashCaseToCamelCase(propName);\n    };\n    /**\n     * @param {?} camelCaseProp\n     * @param {?} userProvidedProp\n     * @param {?} val\n     * @return {?}\n     */\n    DomElementSchemaRegistry.prototype.normalizeAnimationStyleValue = function (camelCaseProp, userProvidedProp, val) {\n        var /** @type {?} */ unit = '';\n        var /** @type {?} */ strVal = val.toString().trim();\n        var /** @type {?} */ errorMsg = ((null));\n        if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') {\n            if (typeof val === 'number') {\n                unit = 'px';\n            }\n            else {\n                var /** @type {?} */ valAndSuffixMatch = val.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n                if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n                    errorMsg = \"Please provide a CSS unit value for \" + userProvidedProp + \":\" + val;\n                }\n            }\n        }\n        return { error: errorMsg, value: strVal + unit };\n    };\n    return DomElementSchemaRegistry;\n}(ElementSchemaRegistry));\nDomElementSchemaRegistry.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nDomElementSchemaRegistry.ctorParameters = function () { return []; };\n/**\n * @param {?} prop\n * @return {?}\n */\nfunction _isPixelDimensionStyle(prop) {\n    switch (prop) {\n        case 'width':\n        case 'height':\n        case 'minWidth':\n        case 'minHeight':\n        case 'maxWidth':\n        case 'maxHeight':\n        case 'left':\n        case 'top':\n        case 'bottom':\n        case 'right':\n        case 'fontSize':\n        case 'outlineWidth':\n        case 'outlineOffset':\n        case 'paddingTop':\n        case 'paddingLeft':\n        case 'paddingBottom':\n        case 'paddingRight':\n        case 'marginTop':\n        case 'marginLeft':\n        case 'marginBottom':\n        case 'marginRight':\n        case 'borderRadius':\n        case 'borderWidth':\n        case 'borderTopWidth':\n        case 'borderLeftWidth':\n        case 'borderRightWidth':\n        case 'borderBottomWidth':\n        case 'textIndent':\n            return true;\n        default:\n            return false;\n    }\n}\nvar ShadowCss = (function () {\n    function ShadowCss() {\n        this.strictStyling = true;\n    }\n    /**\n     * @param {?} cssText\n     * @param {?} selector\n     * @param {?=} hostSelector\n     * @return {?}\n     */\n    ShadowCss.prototype.shimCssText = function (cssText, selector, hostSelector) {\n        if (hostSelector === void 0) { hostSelector = ''; }\n        var /** @type {?} */ sourceMappingUrl = extractSourceMappingUrl(cssText);\n        cssText = stripComments(cssText);\n        cssText = this._insertDirectives(cssText);\n        return this._scopeCssText(cssText, selector, hostSelector) + sourceMappingUrl;\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._insertDirectives = function (cssText) {\n        cssText = this._insertPolyfillDirectivesInCssText(cssText);\n        return this._insertPolyfillRulesInCssText(cssText);\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._insertPolyfillDirectivesInCssText = function (cssText) {\n        // Difference with webcomponents.js: does not handle comments\n        return cssText.replace(_cssContentNextSelectorRe, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            return m[2] + '{';\n        });\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._insertPolyfillRulesInCssText = function (cssText) {\n        // Difference with webcomponents.js: does not handle comments\n        return cssText.replace(_cssContentRuleRe, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            var /** @type {?} */ rule = m[0].replace(m[1], '').replace(m[2], '');\n            return m[4] + rule;\n        });\n    };\n    /**\n     * @param {?} cssText\n     * @param {?} scopeSelector\n     * @param {?} hostSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._scopeCssText = function (cssText, scopeSelector, hostSelector) {\n        var /** @type {?} */ unscopedRules = this._extractUnscopedRulesFromCssText(cssText);\n        // replace :host and :host-context -shadowcsshost and -shadowcsshost respectively\n        cssText = this._insertPolyfillHostInCssText(cssText);\n        cssText = this._convertColonHost(cssText);\n        cssText = this._convertColonHostContext(cssText);\n        cssText = this._convertShadowDOMSelectors(cssText);\n        if (scopeSelector) {\n            cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);\n        }\n        cssText = cssText + '\\n' + unscopedRules;\n        return cssText.trim();\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._extractUnscopedRulesFromCssText = function (cssText) {\n        // Difference with webcomponents.js: does not handle comments\n        var /** @type {?} */ r = '';\n        var /** @type {?} */ m;\n        _cssContentUnscopedRuleRe.lastIndex = 0;\n        while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {\n            var /** @type {?} */ rule = m[0].replace(m[2], '').replace(m[1], m[4]);\n            r += rule + '\\n\\n';\n        }\n        return r;\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._convertColonHost = function (cssText) {\n        return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer);\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._convertColonHostContext = function (cssText) {\n        return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer);\n    };\n    /**\n     * @param {?} cssText\n     * @param {?} regExp\n     * @param {?} partReplacer\n     * @return {?}\n     */\n    ShadowCss.prototype._convertColonRule = function (cssText, regExp, partReplacer) {\n        // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule\n        return cssText.replace(regExp, function () {\n            var m = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                m[_i] = arguments[_i];\n            }\n            if (m[2]) {\n                var /** @type {?} */ parts = m[2].split(',');\n                var /** @type {?} */ r = [];\n                for (var /** @type {?} */ i = 0; i < parts.length; i++) {\n                    var /** @type {?} */ p = parts[i].trim();\n                    if (!p)\n                        break;\n                    r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));\n                }\n                return r.join(',');\n            }\n            else {\n                return _polyfillHostNoCombinator + m[3];\n            }\n        });\n    };\n    /**\n     * @param {?} host\n     * @param {?} part\n     * @param {?} suffix\n     * @return {?}\n     */\n    ShadowCss.prototype._colonHostContextPartReplacer = function (host, part, suffix) {\n        if (part.indexOf(_polyfillHost) > -1) {\n            return this._colonHostPartReplacer(host, part, suffix);\n        }\n        else {\n            return host + part + suffix + ', ' + part + ' ' + host + suffix;\n        }\n    };\n    /**\n     * @param {?} host\n     * @param {?} part\n     * @param {?} suffix\n     * @return {?}\n     */\n    ShadowCss.prototype._colonHostPartReplacer = function (host, part, suffix) {\n        return host + part.replace(_polyfillHost, '') + suffix;\n    };\n    /**\n     * @param {?} cssText\n     * @return {?}\n     */\n    ShadowCss.prototype._convertShadowDOMSelectors = function (cssText) {\n        return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText);\n    };\n    /**\n     * @param {?} cssText\n     * @param {?} scopeSelector\n     * @param {?} hostSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._scopeSelectors = function (cssText, scopeSelector, hostSelector) {\n        var _this = this;\n        return processRules(cssText, function (rule) {\n            var /** @type {?} */ selector = rule.selector;\n            var /** @type {?} */ content = rule.content;\n            if (rule.selector[0] != '@') {\n                selector =\n                    _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling);\n            }\n            else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n                rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {\n                content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n            }\n            return new CssRule(selector, content);\n        });\n    };\n    /**\n     * @param {?} selector\n     * @param {?} scopeSelector\n     * @param {?} hostSelector\n     * @param {?} strict\n     * @return {?}\n     */\n    ShadowCss.prototype._scopeSelector = function (selector, scopeSelector, hostSelector, strict) {\n        var _this = this;\n        return selector.split(',')\n            .map(function (part) { return part.trim().split(_shadowDeepSelectors); })\n            .map(function (deepParts) {\n            var shallowPart = deepParts[0], otherParts = deepParts.slice(1);\n            var /** @type {?} */ applyScope = function (shallowPart) {\n                if (_this._selectorNeedsScoping(shallowPart, scopeSelector)) {\n                    return strict ?\n                        _this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :\n                        _this._applySelectorScope(shallowPart, scopeSelector, hostSelector);\n                }\n                else {\n                    return shallowPart;\n                }\n            };\n            return [applyScope(shallowPart)].concat(otherParts).join(' ');\n        })\n            .join(', ');\n    };\n    /**\n     * @param {?} selector\n     * @param {?} scopeSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._selectorNeedsScoping = function (selector, scopeSelector) {\n        var /** @type {?} */ re = this._makeScopeMatcher(scopeSelector);\n        return !re.test(selector);\n    };\n    /**\n     * @param {?} scopeSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._makeScopeMatcher = function (scopeSelector) {\n        var /** @type {?} */ lre = /\\[/g;\n        var /** @type {?} */ rre = /\\]/g;\n        scopeSelector = scopeSelector.replace(lre, '\\\\[').replace(rre, '\\\\]');\n        return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');\n    };\n    /**\n     * @param {?} selector\n     * @param {?} scopeSelector\n     * @param {?} hostSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._applySelectorScope = function (selector, scopeSelector, hostSelector) {\n        // Difference from webcomponents.js: scopeSelector could not be an array\n        return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);\n    };\n    /**\n     * @param {?} selector\n     * @param {?} scopeSelector\n     * @param {?} hostSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._applySimpleSelectorScope = function (selector, scopeSelector, hostSelector) {\n        // In Android browser, the lastIndex is not reset when the regex is used in String.replace()\n        _polyfillHostRe.lastIndex = 0;\n        if (_polyfillHostRe.test(selector)) {\n            var /** @type {?} */ replaceBy_1 = this.strictStyling ? \"[\" + hostSelector + \"]\" : scopeSelector;\n            return selector\n                .replace(_polyfillHostNoCombinatorRe, function (hnc, selector) {\n                return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) {\n                    return before + replaceBy_1 + colon + after;\n                });\n            })\n                .replace(_polyfillHostRe, replaceBy_1 + ' ');\n        }\n        return scopeSelector + ' ' + selector;\n    };\n    /**\n     * @param {?} selector\n     * @param {?} scopeSelector\n     * @param {?} hostSelector\n     * @return {?}\n     */\n    ShadowCss.prototype._applyStrictSelectorScope = function (selector, scopeSelector, hostSelector) {\n        var _this = this;\n        var /** @type {?} */ isRe = /\\[is=([^\\]]*)\\]/g;\n        scopeSelector = scopeSelector.replace(isRe, function (_) {\n            var parts = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                parts[_i - 1] = arguments[_i];\n            }\n            return parts[0];\n        });\n        var /** @type {?} */ attrName = '[' + scopeSelector + ']';\n        var /** @type {?} */ _scopeSelectorPart = function (p) {\n            var /** @type {?} */ scopedP = p.trim();\n            if (!scopedP) {\n                return '';\n            }\n            if (p.indexOf(_polyfillHostNoCombinator) > -1) {\n                scopedP = _this._applySimpleSelectorScope(p, scopeSelector, hostSelector);\n            }\n            else {\n                // remove :host since it should be unnecessary\n                var /** @type {?} */ t = p.replace(_polyfillHostRe, '');\n                if (t.length > 0) {\n                    var /** @type {?} */ matches = t.match(/([^:]*)(:*)(.*)/);\n                    if (matches) {\n                        scopedP = matches[1] + attrName + matches[2] + matches[3];\n                    }\n                }\n            }\n            return scopedP;\n        };\n        var /** @type {?} */ safeContent = new SafeSelector(selector);\n        selector = safeContent.content();\n        var /** @type {?} */ scopedSelector = '';\n        var /** @type {?} */ startIndex = 0;\n        var /** @type {?} */ res;\n        var /** @type {?} */ sep = /( |>|\\+|~(?!=))\\s*/g;\n        var /** @type {?} */ scopeAfter = selector.indexOf(_polyfillHostNoCombinator);\n        while ((res = sep.exec(selector)) !== null) {\n            var /** @type {?} */ separator = res[1];\n            var /** @type {?} */ part = selector.slice(startIndex, res.index).trim();\n            // if a selector appears before :host-context it should not be shimmed as it\n            // matches on ancestor elements and not on elements in the host's shadow\n            var /** @type {?} */ scopedPart = startIndex >= scopeAfter ? _scopeSelectorPart(part) : part;\n            scopedSelector += scopedPart + \" \" + separator + \" \";\n            startIndex = sep.lastIndex;\n        }\n        scopedSelector += _scopeSelectorPart(selector.substring(startIndex));\n        // replace the placeholders with their original values\n        return safeContent.restore(scopedSelector);\n    };\n    /**\n     * @param {?} selector\n     * @return {?}\n     */\n    ShadowCss.prototype._insertPolyfillHostInCssText = function (selector) {\n        return selector.replace(_colonHostContextRe, _polyfillHostContext)\n            .replace(_colonHostRe, _polyfillHost);\n    };\n    return ShadowCss;\n}());\nvar SafeSelector = (function () {\n    /**\n     * @param {?} selector\n     */\n    function SafeSelector(selector) {\n        var _this = this;\n        this.placeholders = [];\n        this.index = 0;\n        // Replaces attribute selectors with placeholders.\n        // The WS in [attr=\"va lue\"] would otherwise be interpreted as a selector separator.\n        selector = selector.replace(/(\\[[^\\]]*\\])/g, function (_, keep) {\n            var replaceBy = \"__ph-\" + _this.index + \"__\";\n            _this.placeholders.push(keep);\n            _this.index++;\n            return replaceBy;\n        });\n        // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.\n        // WS and \"+\" would otherwise be interpreted as selector separators.\n        this._content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, function (_, pseudo, exp) {\n            var replaceBy = \"__ph-\" + _this.index + \"__\";\n            _this.placeholders.push(exp);\n            _this.index++;\n            return pseudo + replaceBy;\n        });\n    }\n    \n    /**\n     * @param {?} content\n     * @return {?}\n     */\n    SafeSelector.prototype.restore = function (content) {\n        var _this = this;\n        return content.replace(/__ph-(\\d+)__/g, function (ph, index) { return _this.placeholders[+index]; });\n    };\n    /**\n     * @return {?}\n     */\n    SafeSelector.prototype.content = function () { return this._content; };\n    return SafeSelector;\n}());\nvar _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\\s]*?(['\"])(.*?)\\1[;\\s]*}([^{]*?){/gim;\nvar _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nvar _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nvar _polyfillHost = '-shadowcsshost';\n// note: :host-context pre-processed to -shadowcsshostcontext.\nvar _polyfillHostContext = '-shadowcsscontext';\nvar _parenSuffix = ')(?:\\\\((' +\n    '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n    ')\\\\))?([^,{]*)';\nvar _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');\nvar _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');\nvar _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';\nvar _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s]*)/;\nvar _shadowDOMSelectorsRe = [\n    /::shadow/g,\n    /::content/g,\n    // Deprecated selectors\n    /\\/shadow-deep\\//g,\n    /\\/shadow\\//g,\n];\nvar _shadowDeepSelectors = /(?:>>>)|(?:\\/deep\\/)/g;\nvar _selectorReSuffix = '([>\\\\s~+\\[.,{:][\\\\s\\\\S]*)?$';\nvar _polyfillHostRe = /-shadowcsshost/gim;\nvar _colonHostRe = /:host/gim;\nvar _colonHostContextRe = /:host-context/gim;\nvar _commentRe = /\\/\\*\\s*[\\s\\S]*?\\*\\//g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction stripComments(input) {\n    return input.replace(_commentRe, '');\n}\n// all comments except inline source mapping\nvar _sourceMappingUrlRe = /\\/\\*\\s*#\\s*sourceMappingURL=[\\s\\S]+?\\*\\//;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction extractSourceMappingUrl(input) {\n    var /** @type {?} */ matcher = input.match(_sourceMappingUrlRe);\n    return matcher ? matcher[0] : '';\n}\nvar _ruleRe = /(\\s*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))/g;\nvar _curlyRe = /([{}])/g;\nvar OPEN_CURLY = '{';\nvar CLOSE_CURLY = '}';\nvar BLOCK_PLACEHOLDER = '%BLOCK%';\nvar CssRule = (function () {\n    /**\n     * @param {?} selector\n     * @param {?} content\n     */\n    function CssRule(selector, content) {\n        this.selector = selector;\n        this.content = content;\n    }\n    return CssRule;\n}());\n/**\n * @param {?} input\n * @param {?} ruleCallback\n * @return {?}\n */\nfunction processRules(input, ruleCallback) {\n    var /** @type {?} */ inputWithEscapedBlocks = escapeBlocks(input);\n    var /** @type {?} */ nextBlockIndex = 0;\n    return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () {\n        var m = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            m[_i] = arguments[_i];\n        }\n        var /** @type {?} */ selector = m[2];\n        var /** @type {?} */ content = '';\n        var /** @type {?} */ suffix = m[4];\n        var /** @type {?} */ contentPrefix = '';\n        if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {\n            content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n            suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n            contentPrefix = '{';\n        }\n        var /** @type {?} */ rule = ruleCallback(new CssRule(selector, content));\n        return \"\" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix;\n    });\n}\nvar StringWithEscapedBlocks = (function () {\n    /**\n     * @param {?} escapedString\n     * @param {?} blocks\n     */\n    function StringWithEscapedBlocks(escapedString, blocks) {\n        this.escapedString = escapedString;\n        this.blocks = blocks;\n    }\n    return StringWithEscapedBlocks;\n}());\n/**\n * @param {?} input\n * @return {?}\n */\nfunction escapeBlocks(input) {\n    var /** @type {?} */ inputParts = input.split(_curlyRe);\n    var /** @type {?} */ resultParts = [];\n    var /** @type {?} */ escapedBlocks = [];\n    var /** @type {?} */ bracketCount = 0;\n    var /** @type {?} */ currentBlockParts = [];\n    for (var /** @type {?} */ partIndex = 0; partIndex < inputParts.length; partIndex++) {\n        var /** @type {?} */ part = inputParts[partIndex];\n        if (part == CLOSE_CURLY) {\n            bracketCount--;\n        }\n        if (bracketCount > 0) {\n            currentBlockParts.push(part);\n        }\n        else {\n            if (currentBlockParts.length > 0) {\n                escapedBlocks.push(currentBlockParts.join(''));\n                resultParts.push(BLOCK_PLACEHOLDER);\n                currentBlockParts = [];\n            }\n            resultParts.push(part);\n        }\n        if (part == OPEN_CURLY) {\n            bracketCount++;\n        }\n    }\n    if (currentBlockParts.length > 0) {\n        escapedBlocks.push(currentBlockParts.join(''));\n        resultParts.push(BLOCK_PLACEHOLDER);\n    }\n    return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar COMPONENT_VARIABLE = '%COMP%';\nvar HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\nvar CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\nvar StylesCompileDependency = (function () {\n    /**\n     * @param {?} name\n     * @param {?} moduleUrl\n     * @param {?} setValue\n     */\n    function StylesCompileDependency(name, moduleUrl, setValue) {\n        this.name = name;\n        this.moduleUrl = moduleUrl;\n        this.setValue = setValue;\n    }\n    return StylesCompileDependency;\n}());\nvar CompiledStylesheet = (function () {\n    /**\n     * @param {?} outputCtx\n     * @param {?} stylesVar\n     * @param {?} dependencies\n     * @param {?} isShimmed\n     * @param {?} meta\n     */\n    function CompiledStylesheet(outputCtx, stylesVar, dependencies, isShimmed, meta) {\n        this.outputCtx = outputCtx;\n        this.stylesVar = stylesVar;\n        this.dependencies = dependencies;\n        this.isShimmed = isShimmed;\n        this.meta = meta;\n    }\n    return CompiledStylesheet;\n}());\nvar StyleCompiler = (function () {\n    /**\n     * @param {?} _urlResolver\n     */\n    function StyleCompiler(_urlResolver) {\n        this._urlResolver = _urlResolver;\n        this._shadowCss = new ShadowCss();\n    }\n    /**\n     * @param {?} outputCtx\n     * @param {?} comp\n     * @return {?}\n     */\n    StyleCompiler.prototype.compileComponent = function (outputCtx, comp) {\n        var /** @type {?} */ template = ((comp.template));\n        return this._compileStyles(outputCtx, comp, new CompileStylesheetMetadata({\n            styles: template.styles,\n            styleUrls: template.styleUrls,\n            moduleUrl: identifierModuleUrl(comp.type)\n        }), true);\n    };\n    /**\n     * @param {?} outputCtx\n     * @param {?} comp\n     * @param {?} stylesheet\n     * @return {?}\n     */\n    StyleCompiler.prototype.compileStyles = function (outputCtx, comp, stylesheet) {\n        return this._compileStyles(outputCtx, comp, stylesheet, false);\n    };\n    /**\n     * @param {?} comp\n     * @return {?}\n     */\n    StyleCompiler.prototype.needsStyleShim = function (comp) {\n        return ((comp.template)).encapsulation === _angular_core.ViewEncapsulation.Emulated;\n    };\n    /**\n     * @param {?} outputCtx\n     * @param {?} comp\n     * @param {?} stylesheet\n     * @param {?} isComponentStylesheet\n     * @return {?}\n     */\n    StyleCompiler.prototype._compileStyles = function (outputCtx, comp, stylesheet, isComponentStylesheet) {\n        var _this = this;\n        var /** @type {?} */ shim = this.needsStyleShim(comp);\n        var /** @type {?} */ styleExpressions = stylesheet.styles.map(function (plainStyle) { return literal(_this._shimIfNeeded(plainStyle, shim)); });\n        var /** @type {?} */ dependencies = [];\n        stylesheet.styleUrls.forEach(function (styleUrl) {\n            var /** @type {?} */ exprIndex = styleExpressions.length;\n            // Note: This placeholder will be filled later.\n            styleExpressions.push(/** @type {?} */ ((null)));\n            dependencies.push(new StylesCompileDependency(getStylesVarName(null), styleUrl, function (value) { return styleExpressions[exprIndex] = outputCtx.importExpr(value); }));\n        });\n        // styles variable contains plain strings and arrays of other styles arrays (recursive),\n        // so we set its type to dynamic.\n        var /** @type {?} */ stylesVar = getStylesVarName(isComponentStylesheet ? comp : null);\n        var /** @type {?} */ stmt = variable(stylesVar)\n            .set(literalArr(styleExpressions, new ArrayType(DYNAMIC_TYPE, [TypeModifier.Const])))\n            .toDeclStmt(null, isComponentStylesheet ? [StmtModifier.Final] : [\n            StmtModifier.Final, StmtModifier.Exported\n        ]);\n        outputCtx.statements.push(stmt);\n        return new CompiledStylesheet(outputCtx, stylesVar, dependencies, shim, stylesheet);\n    };\n    /**\n     * @param {?} style\n     * @param {?} shim\n     * @return {?}\n     */\n    StyleCompiler.prototype._shimIfNeeded = function (style$$1, shim) {\n        return shim ? this._shadowCss.shimCssText(style$$1, CONTENT_ATTR, HOST_ATTR) : style$$1;\n    };\n    return StyleCompiler;\n}());\nStyleCompiler.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nStyleCompiler.ctorParameters = function () { return [\n    { type: UrlResolver, },\n]; };\n/**\n * @param {?} component\n * @return {?}\n */\nfunction getStylesVarName(component) {\n    var /** @type {?} */ result = \"styles\";\n    if (component) {\n        result += \"_\" + identifierName(component.type);\n    }\n    return result;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar EventHandlerVars = (function () {\n    function EventHandlerVars() {\n    }\n    return EventHandlerVars;\n}());\nEventHandlerVars.event = variable('$event');\nvar ConvertActionBindingResult = (function () {\n    /**\n     * @param {?} stmts\n     * @param {?} allowDefault\n     */\n    function ConvertActionBindingResult(stmts, allowDefault) {\n        this.stmts = stmts;\n        this.allowDefault = allowDefault;\n    }\n    return ConvertActionBindingResult;\n}());\n/**\n * Converts the given expression AST into an executable output AST, assuming the expression is\n * used in an action binding (e.g. an event handler).\n * @param {?} localResolver\n * @param {?} implicitReceiver\n * @param {?} action\n * @param {?} bindingId\n * @return {?}\n */\nfunction convertActionBinding(localResolver, implicitReceiver, action, bindingId) {\n    if (!localResolver) {\n        localResolver = new DefaultLocalResolver();\n    }\n    var /** @type {?} */ actionWithoutBuiltins = convertPropertyBindingBuiltins({\n        createLiteralArrayConverter: function (argCount) {\n            // Note: no caching for literal arrays in actions.\n            return function (args) { return literalArr(args); };\n        },\n        createLiteralMapConverter: function (keys) {\n            // Note: no caching for literal maps in actions.\n            return function (args) { return literalMap(/** @type {?} */ (keys.map(function (key, i) { return [key, args[i]]; }))); };\n        },\n        createPipeConverter: function (name) {\n            throw new Error(\"Illegal State: Actions are not allowed to contain pipes. Pipe: \" + name);\n        }\n    }, action);\n    var /** @type {?} */ visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId);\n    var /** @type {?} */ actionStmts = [];\n    flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);\n    prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);\n    var /** @type {?} */ lastIndex = actionStmts.length - 1;\n    var /** @type {?} */ preventDefaultVar = ((null));\n    if (lastIndex >= 0) {\n        var /** @type {?} */ lastStatement = actionStmts[lastIndex];\n        var /** @type {?} */ returnExpr = convertStmtIntoExpression(lastStatement);\n        if (returnExpr) {\n            // Note: We need to cast the result of the method call to dynamic,\n            // as it might be a void method!\n            preventDefaultVar = createPreventDefaultVar(bindingId);\n            actionStmts[lastIndex] =\n                preventDefaultVar.set(returnExpr.cast(DYNAMIC_TYPE).notIdentical(literal(false)))\n                    .toDeclStmt(null, [StmtModifier.Final]);\n        }\n    }\n    return new ConvertActionBindingResult(actionStmts, preventDefaultVar);\n}\n/**\n * @param {?} converterFactory\n * @param {?} ast\n * @return {?}\n */\nfunction convertPropertyBindingBuiltins(converterFactory, ast) {\n    return convertBuiltins(converterFactory, ast);\n}\nvar ConvertPropertyBindingResult = (function () {\n    /**\n     * @param {?} stmts\n     * @param {?} currValExpr\n     */\n    function ConvertPropertyBindingResult(stmts, currValExpr) {\n        this.stmts = stmts;\n        this.currValExpr = currValExpr;\n    }\n    return ConvertPropertyBindingResult;\n}());\n/**\n * Converts the given expression AST into an executable output AST, assuming the expression\n * is used in property binding. The expression has to be preprocessed via\n * `convertPropertyBindingBuiltins`.\n * @param {?} localResolver\n * @param {?} implicitReceiver\n * @param {?} expressionWithoutBuiltins\n * @param {?} bindingId\n * @return {?}\n */\nfunction convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId) {\n    if (!localResolver) {\n        localResolver = new DefaultLocalResolver();\n    }\n    var /** @type {?} */ currValExpr = createCurrValueExpr(bindingId);\n    var /** @type {?} */ stmts = [];\n    var /** @type {?} */ visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId);\n    var /** @type {?} */ outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);\n    if (visitor.temporaryCount) {\n        for (var /** @type {?} */ i = 0; i < visitor.temporaryCount; i++) {\n            stmts.push(temporaryDeclaration(bindingId, i));\n        }\n    }\n    stmts.push(currValExpr.set(outputExpr).toDeclStmt(null, [StmtModifier.Final]));\n    return new ConvertPropertyBindingResult(stmts, currValExpr);\n}\n/**\n * @param {?} converterFactory\n * @param {?} ast\n * @return {?}\n */\nfunction convertBuiltins(converterFactory, ast) {\n    var /** @type {?} */ visitor = new _BuiltinAstConverter(converterFactory);\n    return ast.visit(visitor);\n}\n/**\n * @param {?} bindingId\n * @param {?} temporaryNumber\n * @return {?}\n */\nfunction temporaryName(bindingId, temporaryNumber) {\n    return \"tmp_\" + bindingId + \"_\" + temporaryNumber;\n}\n/**\n * @param {?} bindingId\n * @param {?} temporaryNumber\n * @return {?}\n */\nfunction temporaryDeclaration(bindingId, temporaryNumber) {\n    return new DeclareVarStmt(temporaryName(bindingId, temporaryNumber), NULL_EXPR);\n}\n/**\n * @param {?} temporaryCount\n * @param {?} bindingId\n * @param {?} statements\n * @return {?}\n */\nfunction prependTemporaryDecls(temporaryCount, bindingId, statements) {\n    for (var /** @type {?} */ i = temporaryCount - 1; i >= 0; i--) {\n        statements.unshift(temporaryDeclaration(bindingId, i));\n    }\n}\nvar _Mode = {};\n_Mode.Statement = 0;\n_Mode.Expression = 1;\n_Mode[_Mode.Statement] = \"Statement\";\n_Mode[_Mode.Expression] = \"Expression\";\n/**\n * @param {?} mode\n * @param {?} ast\n * @return {?}\n */\nfunction ensureStatementMode(mode, ast) {\n    if (mode !== _Mode.Statement) {\n        throw new Error(\"Expected a statement, but saw \" + ast);\n    }\n}\n/**\n * @param {?} mode\n * @param {?} ast\n * @return {?}\n */\nfunction ensureExpressionMode(mode, ast) {\n    if (mode !== _Mode.Expression) {\n        throw new Error(\"Expected an expression, but saw \" + ast);\n    }\n}\n/**\n * @param {?} mode\n * @param {?} expr\n * @return {?}\n */\nfunction convertToStatementIfNeeded(mode, expr) {\n    if (mode === _Mode.Statement) {\n        return expr.toStmt();\n    }\n    else {\n        return expr;\n    }\n}\nvar _BuiltinAstConverter = (function (_super) {\n    __extends(_BuiltinAstConverter, _super);\n    /**\n     * @param {?} _converterFactory\n     */\n    function _BuiltinAstConverter(_converterFactory) {\n        var _this = _super.call(this) || this;\n        _this._converterFactory = _converterFactory;\n        return _this;\n    }\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    _BuiltinAstConverter.prototype.visitPipe = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ args = [ast.exp].concat(ast.args).map(function (ast) { return ast.visit(_this, context); });\n        return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createPipeConverter(ast.name, args.length));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    _BuiltinAstConverter.prototype.visitLiteralArray = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ args = ast.expressions.map(function (ast) { return ast.visit(_this, context); });\n        return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createLiteralArrayConverter(ast.expressions.length));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    _BuiltinAstConverter.prototype.visitLiteralMap = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ args = ast.values.map(function (ast) { return ast.visit(_this, context); });\n        return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createLiteralMapConverter(ast.keys));\n    };\n    return _BuiltinAstConverter;\n}(AstTransformer));\nvar _AstToIrVisitor = (function () {\n    /**\n     * @param {?} _localResolver\n     * @param {?} _implicitReceiver\n     * @param {?} bindingId\n     */\n    function _AstToIrVisitor(_localResolver, _implicitReceiver, bindingId) {\n        this._localResolver = _localResolver;\n        this._implicitReceiver = _implicitReceiver;\n        this.bindingId = bindingId;\n        this._nodeMap = new Map();\n        this._resultMap = new Map();\n        this._currentTemporary = 0;\n        this.temporaryCount = 0;\n    }\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitBinary = function (ast, mode) {\n        var /** @type {?} */ op;\n        switch (ast.operation) {\n            case '+':\n                op = BinaryOperator.Plus;\n                break;\n            case '-':\n                op = BinaryOperator.Minus;\n                break;\n            case '*':\n                op = BinaryOperator.Multiply;\n                break;\n            case '/':\n                op = BinaryOperator.Divide;\n                break;\n            case '%':\n                op = BinaryOperator.Modulo;\n                break;\n            case '&&':\n                op = BinaryOperator.And;\n                break;\n            case '||':\n                op = BinaryOperator.Or;\n                break;\n            case '==':\n                op = BinaryOperator.Equals;\n                break;\n            case '!=':\n                op = BinaryOperator.NotEquals;\n                break;\n            case '===':\n                op = BinaryOperator.Identical;\n                break;\n            case '!==':\n                op = BinaryOperator.NotIdentical;\n                break;\n            case '<':\n                op = BinaryOperator.Lower;\n                break;\n            case '>':\n                op = BinaryOperator.Bigger;\n                break;\n            case '<=':\n                op = BinaryOperator.LowerEquals;\n                break;\n            case '>=':\n                op = BinaryOperator.BiggerEquals;\n                break;\n            default:\n                throw new Error(\"Unsupported operation \" + ast.operation);\n        }\n        return convertToStatementIfNeeded(mode, new BinaryOperatorExpr(op, this._visit(ast.left, _Mode.Expression), this._visit(ast.right, _Mode.Expression)));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitChain = function (ast, mode) {\n        ensureStatementMode(mode, ast);\n        return this.visitAll(ast.expressions, mode);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitConditional = function (ast, mode) {\n        var /** @type {?} */ value = this._visit(ast.condition, _Mode.Expression);\n        return convertToStatementIfNeeded(mode, value.conditional(this._visit(ast.trueExp, _Mode.Expression), this._visit(ast.falseExp, _Mode.Expression)));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitPipe = function (ast, mode) {\n        throw new Error(\"Illegal state: Pipes should have been converted into functions. Pipe: \" + ast.name);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitFunctionCall = function (ast, mode) {\n        var /** @type {?} */ convertedArgs = this.visitAll(ast.args, _Mode.Expression);\n        var /** @type {?} */ fnResult;\n        if (ast instanceof BuiltinFunctionCall) {\n            fnResult = ast.converter(convertedArgs);\n        }\n        else {\n            fnResult = this._visit(/** @type {?} */ ((ast.target)), _Mode.Expression).callFn(convertedArgs);\n        }\n        return convertToStatementIfNeeded(mode, fnResult);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitImplicitReceiver = function (ast, mode) {\n        ensureExpressionMode(mode, ast);\n        return this._implicitReceiver;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitInterpolation = function (ast, mode) {\n        ensureExpressionMode(mode, ast);\n        var /** @type {?} */ args = [literal(ast.expressions.length)];\n        for (var /** @type {?} */ i = 0; i < ast.strings.length - 1; i++) {\n            args.push(literal(ast.strings[i]));\n            args.push(this._visit(ast.expressions[i], _Mode.Expression));\n        }\n        args.push(literal(ast.strings[ast.strings.length - 1]));\n        return ast.expressions.length <= 9 ?\n            importExpr(Identifiers.inlineInterpolate).callFn(args) :\n            importExpr(Identifiers.interpolate).callFn([args[0], literalArr(args.slice(1))]);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitKeyedRead = function (ast, mode) {\n        var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);\n        if (leftMostSafe) {\n            return this.convertSafeAccess(ast, leftMostSafe, mode);\n        }\n        else {\n            return convertToStatementIfNeeded(mode, this._visit(ast.obj, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression)));\n        }\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitKeyedWrite = function (ast, mode) {\n        var /** @type {?} */ obj = this._visit(ast.obj, _Mode.Expression);\n        var /** @type {?} */ key = this._visit(ast.key, _Mode.Expression);\n        var /** @type {?} */ value = this._visit(ast.value, _Mode.Expression);\n        return convertToStatementIfNeeded(mode, obj.key(key).set(value));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitLiteralArray = function (ast, mode) {\n        throw new Error(\"Illegal State: literal arrays should have been converted into functions\");\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitLiteralMap = function (ast, mode) {\n        throw new Error(\"Illegal State: literal maps should have been converted into functions\");\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitLiteralPrimitive = function (ast, mode) {\n        return convertToStatementIfNeeded(mode, literal(ast.value));\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype._getLocal = function (name) { return this._localResolver.getLocal(name); };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitMethodCall = function (ast, mode) {\n        var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);\n        if (leftMostSafe) {\n            return this.convertSafeAccess(ast, leftMostSafe, mode);\n        }\n        else {\n            var /** @type {?} */ args = this.visitAll(ast.args, _Mode.Expression);\n            var /** @type {?} */ result = null;\n            var /** @type {?} */ receiver = this._visit(ast.receiver, _Mode.Expression);\n            if (receiver === this._implicitReceiver) {\n                var /** @type {?} */ varExpr = this._getLocal(ast.name);\n                if (varExpr) {\n                    result = varExpr.callFn(args);\n                }\n            }\n            if (result == null) {\n                result = receiver.callMethod(ast.name, args);\n            }\n            return convertToStatementIfNeeded(mode, result);\n        }\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitPrefixNot = function (ast, mode) {\n        return convertToStatementIfNeeded(mode, not(this._visit(ast.expression, _Mode.Expression)));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitNonNullAssert = function (ast, mode) {\n        return convertToStatementIfNeeded(mode, assertNotNull(this._visit(ast.expression, _Mode.Expression)));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitPropertyRead = function (ast, mode) {\n        var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);\n        if (leftMostSafe) {\n            return this.convertSafeAccess(ast, leftMostSafe, mode);\n        }\n        else {\n            var /** @type {?} */ result = null;\n            var /** @type {?} */ receiver = this._visit(ast.receiver, _Mode.Expression);\n            if (receiver === this._implicitReceiver) {\n                result = this._getLocal(ast.name);\n            }\n            if (result == null) {\n                result = receiver.prop(ast.name);\n            }\n            return convertToStatementIfNeeded(mode, result);\n        }\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitPropertyWrite = function (ast, mode) {\n        var /** @type {?} */ receiver = this._visit(ast.receiver, _Mode.Expression);\n        if (receiver === this._implicitReceiver) {\n            var /** @type {?} */ varExpr = this._getLocal(ast.name);\n            if (varExpr) {\n                throw new Error('Cannot assign to a reference or variable!');\n            }\n        }\n        return convertToStatementIfNeeded(mode, receiver.prop(ast.name).set(this._visit(ast.value, _Mode.Expression)));\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitSafePropertyRead = function (ast, mode) {\n        return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitSafeMethodCall = function (ast, mode) {\n        return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);\n    };\n    /**\n     * @param {?} asts\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitAll = function (asts, mode) {\n        var _this = this;\n        return asts.map(function (ast) { return _this._visit(ast, mode); });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.visitQuote = function (ast, mode) {\n        throw new Error(\"Quotes are not supported for evaluation!\\n        Statement: \" + ast.uninterpretedExpression + \" located at \" + ast.location);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype._visit = function (ast, mode) {\n        var /** @type {?} */ result = this._resultMap.get(ast);\n        if (result)\n            return result;\n        return (this._nodeMap.get(ast) || ast).visit(this, mode);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} leftMostSafe\n     * @param {?} mode\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.convertSafeAccess = function (ast, leftMostSafe, mode) {\n        // If the expression contains a safe access node on the left it needs to be converted to\n        // an expression that guards the access to the member by checking the receiver for blank. As\n        // execution proceeds from left to right, the left most part of the expression must be guarded\n        // first but, because member access is left associative, the right side of the expression is at\n        // the top of the AST. The desired result requires lifting a copy of the the left part of the\n        // expression up to test it for blank before generating the unguarded version.\n        // Consider, for example the following expression: a?.b.c?.d.e\n        // This results in the ast:\n        //         .\n        //        / \\\n        //       ?.   e\n        //      /  \\\n        //     .    d\n        //    / \\\n        //   ?.  c\n        //  /  \\\n        // a    b\n        // The following tree should be generated:\n        //\n        //        /---- ? ----\\\n        //       /      |      \\\n        //     a   /--- ? ---\\  null\n        //        /     |     \\\n        //       .      .     null\n        //      / \\    / \\\n        //     .  c   .   e\n        //    / \\    / \\\n        //   a   b  ,   d\n        //         / \\\n        //        .   c\n        //       / \\\n        //      a   b\n        //\n        // Notice that the first guard condition is the left hand of the left most safe access node\n        // which comes in as leftMostSafe to this routine.\n        var /** @type {?} */ guardedExpression = this._visit(leftMostSafe.receiver, _Mode.Expression);\n        var /** @type {?} */ temporary = ((undefined));\n        if (this.needsTemporary(leftMostSafe.receiver)) {\n            // If the expression has method calls or pipes then we need to save the result into a\n            // temporary variable to avoid calling stateful or impure code more than once.\n            temporary = this.allocateTemporary();\n            // Preserve the result in the temporary variable\n            guardedExpression = temporary.set(guardedExpression);\n            // Ensure all further references to the guarded expression refer to the temporary instead.\n            this._resultMap.set(leftMostSafe.receiver, temporary);\n        }\n        var /** @type {?} */ condition = guardedExpression.isBlank();\n        // Convert the ast to an unguarded access to the receiver's member. The map will substitute\n        // leftMostNode with its unguarded version in the call to `this.visit()`.\n        if (leftMostSafe instanceof SafeMethodCall) {\n            this._nodeMap.set(leftMostSafe, new MethodCall(leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name, leftMostSafe.args));\n        }\n        else {\n            this._nodeMap.set(leftMostSafe, new PropertyRead(leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name));\n        }\n        // Recursively convert the node now without the guarded member access.\n        var /** @type {?} */ access = this._visit(ast, _Mode.Expression);\n        // Remove the mapping. This is not strictly required as the converter only traverses each node\n        // once but is safer if the conversion is changed to traverse the nodes more than once.\n        this._nodeMap.delete(leftMostSafe);\n        // If we allocated a temporary, release it.\n        if (temporary) {\n            this.releaseTemporary(temporary);\n        }\n        // Produce the conditional\n        return convertToStatementIfNeeded(mode, condition.conditional(literal(null), access));\n    };\n    /**\n     * @param {?} ast\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.leftMostSafeNode = function (ast) {\n        var _this = this;\n        var /** @type {?} */ visit = function (visitor, ast) {\n            return (_this._nodeMap.get(ast) || ast).visit(visitor);\n        };\n        return ast.visit({\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitBinary: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitChain: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitConditional: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitFunctionCall: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitImplicitReceiver: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitInterpolation: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitKeyedRead: function (ast) { return visit(this, ast.obj); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitKeyedWrite: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitLiteralArray: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitLiteralMap: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitLiteralPrimitive: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitMethodCall: function (ast) { return visit(this, ast.receiver); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPipe: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPrefixNot: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitNonNullAssert: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPropertyRead: function (ast) { return visit(this, ast.receiver); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPropertyWrite: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitQuote: function (ast) { return null; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitSafeMethodCall: function (ast) { return visit(this, ast.receiver) || ast; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitSafePropertyRead: function (ast) {\n                return visit(this, ast.receiver) || ast;\n            }\n        });\n    };\n    /**\n     * @param {?} ast\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.needsTemporary = function (ast) {\n        var _this = this;\n        var /** @type {?} */ visit = function (visitor, ast) {\n            return ast && (_this._nodeMap.get(ast) || ast).visit(visitor);\n        };\n        var /** @type {?} */ visitSome = function (visitor, ast) {\n            return ast.some(function (ast) { return visit(visitor, ast); });\n        };\n        return ast.visit({\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitBinary: function (ast) { return visit(this, ast.left) || visit(this, ast.right); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitChain: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitConditional: function (ast) {\n                return visit(this, ast.condition) || visit(this, ast.trueExp) ||\n                    visit(this, ast.falseExp);\n            },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitFunctionCall: function (ast) { return true; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitImplicitReceiver: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitInterpolation: function (ast) { return visitSome(this, ast.expressions); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitKeyedRead: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitKeyedWrite: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitLiteralArray: function (ast) { return true; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitLiteralMap: function (ast) { return true; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitLiteralPrimitive: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitMethodCall: function (ast) { return true; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPipe: function (ast) { return true; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPrefixNot: function (ast) { return visit(this, ast.expression); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitNonNullAssert: function (ast) { return visit(this, ast.expression); },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPropertyRead: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitPropertyWrite: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitQuote: function (ast) { return false; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitSafeMethodCall: function (ast) { return true; },\n            /**\n             * @param {?} ast\n             * @return {?}\n             */\n            visitSafePropertyRead: function (ast) { return false; }\n        });\n    };\n    /**\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.allocateTemporary = function () {\n        var /** @type {?} */ tempNumber = this._currentTemporary++;\n        this.temporaryCount = Math.max(this._currentTemporary, this.temporaryCount);\n        return new ReadVarExpr(temporaryName(this.bindingId, tempNumber));\n    };\n    /**\n     * @param {?} temporary\n     * @return {?}\n     */\n    _AstToIrVisitor.prototype.releaseTemporary = function (temporary) {\n        this._currentTemporary--;\n        if (temporary.name != temporaryName(this.bindingId, this._currentTemporary)) {\n            throw new Error(\"Temporary \" + temporary.name + \" released out of order\");\n        }\n    };\n    return _AstToIrVisitor;\n}());\n/**\n * @param {?} arg\n * @param {?} output\n * @return {?}\n */\nfunction flattenStatements(arg, output) {\n    if (Array.isArray(arg)) {\n        ((arg)).forEach(function (entry) { return flattenStatements(entry, output); });\n    }\n    else {\n        output.push(arg);\n    }\n}\nvar DefaultLocalResolver = (function () {\n    function DefaultLocalResolver() {\n    }\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    DefaultLocalResolver.prototype.getLocal = function (name) {\n        if (name === EventHandlerVars.event.name) {\n            return EventHandlerVars.event;\n        }\n        return null;\n    };\n    return DefaultLocalResolver;\n}());\n/**\n * @param {?} bindingId\n * @return {?}\n */\nfunction createCurrValueExpr(bindingId) {\n    return variable(\"currVal_\" + bindingId); // fix syntax highlighting: `\n}\n/**\n * @param {?} bindingId\n * @return {?}\n */\nfunction createPreventDefaultVar(bindingId) {\n    return variable(\"pd_\" + bindingId);\n}\n/**\n * @param {?} stmt\n * @return {?}\n */\nfunction convertStmtIntoExpression(stmt) {\n    if (stmt instanceof ExpressionStatement) {\n        return stmt.expr;\n    }\n    else if (stmt instanceof ReturnStatement) {\n        return stmt.value;\n    }\n    return null;\n}\nvar BuiltinFunctionCall = (function (_super) {\n    __extends(BuiltinFunctionCall, _super);\n    /**\n     * @param {?} span\n     * @param {?} args\n     * @param {?} converter\n     */\n    function BuiltinFunctionCall(span, args, converter) {\n        var _this = _super.call(this, span, null, args) || this;\n        _this.args = args;\n        _this.converter = converter;\n        return _this;\n    }\n    return BuiltinFunctionCall;\n}(FunctionCall));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar CLASS_ATTR$1 = 'class';\nvar STYLE_ATTR = 'style';\nvar IMPLICIT_TEMPLATE_VAR = '\\$implicit';\nvar ViewCompileResult = (function () {\n    /**\n     * @param {?} viewClassVar\n     * @param {?} rendererTypeVar\n     */\n    function ViewCompileResult(viewClassVar, rendererTypeVar) {\n        this.viewClassVar = viewClassVar;\n        this.rendererTypeVar = rendererTypeVar;\n    }\n    return ViewCompileResult;\n}());\nvar ViewCompiler = (function () {\n    /**\n     * @param {?} _config\n     * @param {?} _reflector\n     * @param {?} _schemaRegistry\n     */\n    function ViewCompiler(_config, _reflector, _schemaRegistry) {\n        this._config = _config;\n        this._reflector = _reflector;\n        this._schemaRegistry = _schemaRegistry;\n    }\n    /**\n     * @param {?} outputCtx\n     * @param {?} component\n     * @param {?} template\n     * @param {?} styles\n     * @param {?} usedPipes\n     * @return {?}\n     */\n    ViewCompiler.prototype.compileComponent = function (outputCtx, component, template, styles, usedPipes) {\n        var _this = this;\n        var /** @type {?} */ embeddedViewCount = 0;\n        var /** @type {?} */ staticQueryIds = findStaticQueryIds(template);\n        var /** @type {?} */ renderComponentVarName = ((undefined));\n        if (!component.isHost) {\n            var /** @type {?} */ template_1 = ((component.template));\n            var /** @type {?} */ customRenderData = [];\n            if (template_1.animations && template_1.animations.length) {\n                customRenderData.push(new LiteralMapEntry('animation', convertValueToOutputAst(outputCtx, template_1.animations), true));\n            }\n            var /** @type {?} */ renderComponentVar = variable(rendererTypeName(component.type.reference));\n            renderComponentVarName = ((renderComponentVar.name));\n            outputCtx.statements.push(renderComponentVar\n                .set(importExpr(Identifiers.createRendererType2).callFn([new LiteralMapExpr([\n                    new LiteralMapEntry('encapsulation', literal(template_1.encapsulation)),\n                    new LiteralMapEntry('styles', styles),\n                    new LiteralMapEntry('data', new LiteralMapExpr(customRenderData))\n                ])]))\n                .toDeclStmt(importType(Identifiers.RendererType2), [StmtModifier.Final, StmtModifier.Exported]));\n        }\n        var /** @type {?} */ viewBuilderFactory = function (parent) {\n            var /** @type {?} */ embeddedViewIndex = embeddedViewCount++;\n            return new ViewBuilder(_this._reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, staticQueryIds, viewBuilderFactory);\n        };\n        var /** @type {?} */ visitor = viewBuilderFactory(null);\n        visitor.visitAll([], template);\n        (_a = outputCtx.statements).push.apply(_a, visitor.build());\n        return new ViewCompileResult(visitor.viewName, renderComponentVarName);\n        var _a;\n    };\n    return ViewCompiler;\n}());\nViewCompiler.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nViewCompiler.ctorParameters = function () { return [\n    { type: CompilerConfig, },\n    { type: CompileReflector, },\n    { type: ElementSchemaRegistry, },\n]; };\nvar LOG_VAR$1 = variable('_l');\nvar VIEW_VAR = variable('_v');\nvar CHECK_VAR = variable('_ck');\nvar COMP_VAR = variable('_co');\nvar EVENT_NAME_VAR = variable('en');\nvar ALLOW_DEFAULT_VAR = variable(\"ad\");\nvar ViewBuilder = (function () {\n    /**\n     * @param {?} reflector\n     * @param {?} outputCtx\n     * @param {?} parent\n     * @param {?} component\n     * @param {?} embeddedViewIndex\n     * @param {?} usedPipes\n     * @param {?} staticQueryIds\n     * @param {?} viewBuilderFactory\n     */\n    function ViewBuilder(reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, staticQueryIds, viewBuilderFactory) {\n        this.reflector = reflector;\n        this.outputCtx = outputCtx;\n        this.parent = parent;\n        this.component = component;\n        this.embeddedViewIndex = embeddedViewIndex;\n        this.usedPipes = usedPipes;\n        this.staticQueryIds = staticQueryIds;\n        this.viewBuilderFactory = viewBuilderFactory;\n        this.nodes = [];\n        this.purePipeNodeIndices = Object.create(null);\n        this.refNodeIndices = Object.create(null);\n        this.variables = [];\n        this.children = [];\n        // TODO(tbosch): The old view compiler used to use an `any` type\n        // for the context in any embedded view. We keep this behaivor for now\n        // to be able to introduce the new view compiler without too many errors.\n        this.compType = this.embeddedViewIndex > 0 ?\n            DYNAMIC_TYPE :\n            expressionType(outputCtx.importExpr(this.component.type.reference));\n    }\n    Object.defineProperty(ViewBuilder.prototype, \"viewName\", {\n        /**\n         * @return {?}\n         */\n        get: function () {\n            return viewClassName(this.component.type.reference, this.embeddedViewIndex);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} variables\n     * @param {?} astNodes\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitAll = function (variables, astNodes) {\n        var _this = this;\n        this.variables = variables;\n        // create the pipes for the pure pipes immediately, so that we know their indices.\n        if (!this.parent) {\n            this.usedPipes.forEach(function (pipe) {\n                if (pipe.pure) {\n                    _this.purePipeNodeIndices[pipe.name] = _this._createPipe(null, pipe);\n                }\n            });\n        }\n        if (!this.parent) {\n            var /** @type {?} */ queryIds_1 = staticViewQueryIds(this.staticQueryIds);\n            this.component.viewQueries.forEach(function (query, queryIndex) {\n                // Note: queries start with id 1 so we can use the number in a Bloom filter!\n                var /** @type {?} */ queryId = queryIndex + 1;\n                var /** @type {?} */ bindingType = query.first ? 0 /* First */ : 1;\n                var /** @type {?} */ flags = 134217728 /* TypeViewQuery */ | calcStaticDynamicQueryFlags(queryIds_1, queryId, query.first);\n                _this.nodes.push(function () { return ({\n                    sourceSpan: null,\n                    nodeFlags: flags,\n                    nodeDef: importExpr(Identifiers.queryDef).callFn([\n                        literal(flags), literal(queryId),\n                        new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType))])\n                    ])\n                }); });\n            });\n        }\n        templateVisitAll(this, astNodes);\n        if (this.parent && (astNodes.length === 0 || needsAdditionalRootNode(astNodes))) {\n            // if the view is an embedded view, then we need to add an additional root node in some cases\n            this.nodes.push(function () { return ({\n                sourceSpan: null,\n                nodeFlags: 1 /* TypeElement */,\n                nodeDef: importExpr(Identifiers.anchorDef).callFn([\n                    literal(0 /* None */), NULL_EXPR, NULL_EXPR, literal(0)\n                ])\n            }); });\n        }\n    };\n    /**\n     * @param {?=} targetStatements\n     * @return {?}\n     */\n    ViewBuilder.prototype.build = function (targetStatements) {\n        if (targetStatements === void 0) { targetStatements = []; }\n        this.children.forEach(function (child) { return child.build(targetStatements); });\n        var _a = this._createNodeExpressions(), updateRendererStmts = _a.updateRendererStmts, updateDirectivesStmts = _a.updateDirectivesStmts, nodeDefExprs = _a.nodeDefExprs;\n        var /** @type {?} */ updateRendererFn = this._createUpdateFn(updateRendererStmts);\n        var /** @type {?} */ updateDirectivesFn = this._createUpdateFn(updateDirectivesStmts);\n        var /** @type {?} */ viewFlags = 0;\n        if (!this.parent && this.component.changeDetection === _angular_core.ChangeDetectionStrategy.OnPush) {\n            viewFlags |= 2 /* OnPush */;\n        }\n        var /** @type {?} */ viewFactory = new DeclareFunctionStmt(this.viewName, [new FnParam(/** @type {?} */ ((LOG_VAR$1.name)))], [new ReturnStatement(importExpr(Identifiers.viewDef).callFn([\n                literal(viewFlags),\n                literalArr(nodeDefExprs),\n                updateDirectivesFn,\n                updateRendererFn,\n            ]))], importType(Identifiers.ViewDefinition), this.embeddedViewIndex === 0 ? [StmtModifier.Exported] : []);\n        targetStatements.push(viewFactory);\n        return targetStatements;\n    };\n    /**\n     * @param {?} updateStmts\n     * @return {?}\n     */\n    ViewBuilder.prototype._createUpdateFn = function (updateStmts) {\n        var /** @type {?} */ updateFn;\n        if (updateStmts.length > 0) {\n            var /** @type {?} */ preStmts = [];\n            if (!this.component.isHost && findReadVarNames(updateStmts).has(/** @type {?} */ ((COMP_VAR.name)))) {\n                preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));\n            }\n            updateFn = fn([\n                new FnParam(/** @type {?} */ ((CHECK_VAR.name)), INFERRED_TYPE),\n                new FnParam(/** @type {?} */ ((VIEW_VAR.name)), INFERRED_TYPE)\n            ], preStmts.concat(updateStmts), INFERRED_TYPE);\n        }\n        else {\n            updateFn = NULL_EXPR;\n        }\n        return updateFn;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitNgContent = function (ast, context) {\n        // ngContentDef(ngContentIndex: number, index: number): NodeDef;\n        this.nodes.push(function () { return ({\n            sourceSpan: ast.sourceSpan,\n            nodeFlags: 8 /* TypeNgContent */,\n            nodeDef: importExpr(Identifiers.ngContentDef).callFn([\n                literal(ast.ngContentIndex), literal(ast.index)\n            ])\n        }); });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitText = function (ast, context) {\n        // textDef(ngContentIndex: number, constants: string[]): NodeDef;\n        this.nodes.push(function () { return ({\n            sourceSpan: ast.sourceSpan,\n            nodeFlags: 2 /* TypeText */,\n            nodeDef: importExpr(Identifiers.textDef).callFn([\n                literal(ast.ngContentIndex), literalArr([literal(ast.value)])\n            ])\n        }); });\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitBoundText = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // reserve the space in the nodeDefs array\n        this.nodes.push(/** @type {?} */ ((null)));\n        var /** @type {?} */ astWithSource = (ast.value);\n        var /** @type {?} */ inter = (astWithSource.ast);\n        var /** @type {?} */ updateRendererExpressions = inter.expressions.map(function (expr, bindingIndex) { return _this._preprocessUpdateExpression({ nodeIndex: nodeIndex, bindingIndex: bindingIndex, sourceSpan: ast.sourceSpan, context: COMP_VAR, value: expr }); });\n        // textDef(ngContentIndex: number, constants: string[]): NodeDef;\n        this.nodes[nodeIndex] = function () { return ({\n            sourceSpan: ast.sourceSpan,\n            nodeFlags: 2 /* TypeText */,\n            nodeDef: importExpr(Identifiers.textDef).callFn([\n                literal(ast.ngContentIndex), literalArr(inter.strings.map(function (s) { return literal(s); }))\n            ]),\n            updateRenderer: updateRendererExpressions\n        }); };\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitEmbeddedTemplate = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // reserve the space in the nodeDefs array\n        this.nodes.push(/** @type {?} */ ((null)));\n        var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, queryMatchesExpr = _a.queryMatchesExpr, hostEvents = _a.hostEvents;\n        var /** @type {?} */ childVisitor = this.viewBuilderFactory(this);\n        this.children.push(childVisitor);\n        childVisitor.visitAll(ast.variables, ast.children);\n        var /** @type {?} */ childCount = this.nodes.length - nodeIndex - 1;\n        // anchorDef(\n        //   flags: NodeFlags, matchedQueries: [string, QueryValueType][], ngContentIndex: number,\n        //   childCount: number, handleEventFn?: ElementHandleEventFn, templateFactory?:\n        //   ViewDefinitionFactory): NodeDef;\n        this.nodes[nodeIndex] = function () { return ({\n            sourceSpan: ast.sourceSpan,\n            nodeFlags: 1 /* TypeElement */ | flags,\n            nodeDef: importExpr(Identifiers.anchorDef).callFn([\n                literal(flags),\n                queryMatchesExpr,\n                literal(ast.ngContentIndex),\n                literal(childCount),\n                _this._createElementHandleEventFn(nodeIndex, hostEvents),\n                variable(childVisitor.viewName),\n            ])\n        }); };\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitElement = function (ast, context) {\n        var _this = this;\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // reserve the space in the nodeDefs array so we can add children\n        this.nodes.push(/** @type {?} */ ((null)));\n        // Using a null element name creates an anchor.\n        var /** @type {?} */ elName = isNgContainer(ast.name) ? null : ast.name;\n        var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, usedEvents = _a.usedEvents, queryMatchesExpr = _a.queryMatchesExpr, dirHostBindings = _a.hostBindings, hostEvents = _a.hostEvents;\n        var /** @type {?} */ inputDefs = [];\n        var /** @type {?} */ updateRendererExpressions = [];\n        var /** @type {?} */ outputDefs = [];\n        if (elName) {\n            var /** @type {?} */ hostBindings = ast.inputs\n                .map(function (inputAst) { return ({\n                context: /** @type {?} */ (COMP_VAR),\n                inputAst: inputAst,\n                dirAst: /** @type {?} */ (null),\n            }); })\n                .concat(dirHostBindings);\n            if (hostBindings.length) {\n                updateRendererExpressions =\n                    hostBindings.map(function (hostBinding, bindingIndex) { return _this._preprocessUpdateExpression({\n                        context: hostBinding.context,\n                        nodeIndex: nodeIndex,\n                        bindingIndex: bindingIndex,\n                        sourceSpan: hostBinding.inputAst.sourceSpan,\n                        value: hostBinding.inputAst.value\n                    }); });\n                inputDefs = hostBindings.map(function (hostBinding) { return elementBindingDef(hostBinding.inputAst, hostBinding.dirAst); });\n            }\n            outputDefs = usedEvents.map(function (_a) {\n                var target = _a[0], eventName = _a[1];\n                return literalArr([literal(target), literal(eventName)]);\n            });\n        }\n        templateVisitAll(this, ast.children);\n        var /** @type {?} */ childCount = this.nodes.length - nodeIndex - 1;\n        var /** @type {?} */ compAst = ast.directives.find(function (dirAst) { return dirAst.directive.isComponent; });\n        var /** @type {?} */ compRendererType = (NULL_EXPR);\n        var /** @type {?} */ compView = (NULL_EXPR);\n        if (compAst) {\n            compView = this.outputCtx.importExpr(compAst.directive.componentViewType);\n            compRendererType = this.outputCtx.importExpr(compAst.directive.rendererType);\n        }\n        // elementDef(\n        //   flags: NodeFlags, matchedQueriesDsl: [string | number, QueryValueType][],\n        //   ngContentIndex: number, childCount: number, namespaceAndName: string,\n        //   fixedAttrs: [string, string][] = [],\n        //   bindings?: [BindingFlags, string, string | SecurityContext][],\n        //   outputs?: ([OutputType.ElementOutput | OutputType.DirectiveHostOutput, string, string])[],\n        //   handleEvent?: ElementHandleEventFn,\n        //   componentView?: () => ViewDefinition, componentRendererType?: RendererType2): NodeDef;\n        this.nodes[nodeIndex] = function () { return ({\n            sourceSpan: ast.sourceSpan,\n            nodeFlags: 1 /* TypeElement */ | flags,\n            nodeDef: importExpr(Identifiers.elementDef).callFn([\n                literal(flags),\n                queryMatchesExpr,\n                literal(ast.ngContentIndex),\n                literal(childCount),\n                literal(elName),\n                elName ? fixedAttrsDef(ast) : NULL_EXPR,\n                inputDefs.length ? literalArr(inputDefs) : NULL_EXPR,\n                outputDefs.length ? literalArr(outputDefs) : NULL_EXPR,\n                _this._createElementHandleEventFn(nodeIndex, hostEvents),\n                compView,\n                compRendererType,\n            ]),\n            updateRenderer: updateRendererExpressions\n        }); };\n    };\n    /**\n     * @param {?} nodeIndex\n     * @param {?} ast\n     * @return {?}\n     */\n    ViewBuilder.prototype._visitElementOrTemplate = function (nodeIndex, ast) {\n        var _this = this;\n        var /** @type {?} */ flags = 0;\n        if (ast.hasViewContainer) {\n            flags |= 16777216 /* EmbeddedViews */;\n        }\n        var /** @type {?} */ usedEvents = new Map();\n        ast.outputs.forEach(function (event) {\n            var _a = elementEventNameAndTarget(event, null), name = _a.name, target = _a.target;\n            usedEvents.set(_angular_core.ɵelementEventFullName(target, name), [target, name]);\n        });\n        ast.directives.forEach(function (dirAst) {\n            dirAst.hostEvents.forEach(function (event) {\n                var _a = elementEventNameAndTarget(event, dirAst), name = _a.name, target = _a.target;\n                usedEvents.set(_angular_core.ɵelementEventFullName(target, name), [target, name]);\n            });\n        });\n        var /** @type {?} */ hostBindings = [];\n        var /** @type {?} */ hostEvents = [];\n        this._visitComponentFactoryResolverProvider(ast.directives);\n        ast.providers.forEach(function (providerAst, providerIndex) {\n            var /** @type {?} */ dirAst = ((undefined));\n            var /** @type {?} */ dirIndex = ((undefined));\n            ast.directives.forEach(function (localDirAst, i) {\n                if (localDirAst.directive.type.reference === tokenReference(providerAst.token)) {\n                    dirAst = localDirAst;\n                    dirIndex = i;\n                }\n            });\n            if (dirAst) {\n                var _a = _this._visitDirective(providerAst, dirAst, dirIndex, nodeIndex, ast.references, ast.queryMatches, usedEvents, /** @type {?} */ ((_this.staticQueryIds.get(/** @type {?} */ (ast))))), dirHostBindings = _a.hostBindings, dirHostEvents = _a.hostEvents;\n                hostBindings.push.apply(hostBindings, dirHostBindings);\n                hostEvents.push.apply(hostEvents, dirHostEvents);\n            }\n            else {\n                _this._visitProvider(providerAst, ast.queryMatches);\n            }\n        });\n        var /** @type {?} */ queryMatchExprs = [];\n        ast.queryMatches.forEach(function (match) {\n            var /** @type {?} */ valueType = ((undefined));\n            if (tokenReference(match.value) ===\n                _this.reflector.resolveExternalReference(Identifiers.ElementRef)) {\n                valueType = 0 /* ElementRef */;\n            }\n            else if (tokenReference(match.value) ===\n                _this.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {\n                valueType = 3 /* ViewContainerRef */;\n            }\n            else if (tokenReference(match.value) ===\n                _this.reflector.resolveExternalReference(Identifiers.TemplateRef)) {\n                valueType = 2 /* TemplateRef */;\n            }\n            if (valueType != null) {\n                queryMatchExprs.push(literalArr([literal(match.queryId), literal(valueType)]));\n            }\n        });\n        ast.references.forEach(function (ref) {\n            var /** @type {?} */ valueType = ((undefined));\n            if (!ref.value) {\n                valueType = 1 /* RenderElement */;\n            }\n            else if (tokenReference(ref.value) ===\n                _this.reflector.resolveExternalReference(Identifiers.TemplateRef)) {\n                valueType = 2 /* TemplateRef */;\n            }\n            if (valueType != null) {\n                _this.refNodeIndices[ref.name] = nodeIndex;\n                queryMatchExprs.push(literalArr([literal(ref.name), literal(valueType)]));\n            }\n        });\n        ast.outputs.forEach(function (outputAst) {\n            hostEvents.push({ context: COMP_VAR, eventAst: outputAst, dirAst: /** @type {?} */ ((null)) });\n        });\n        return {\n            flags: flags,\n            usedEvents: Array.from(usedEvents.values()),\n            queryMatchesExpr: queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,\n            hostBindings: hostBindings,\n            hostEvents: hostEvents\n        };\n    };\n    /**\n     * @param {?} providerAst\n     * @param {?} dirAst\n     * @param {?} directiveIndex\n     * @param {?} elementNodeIndex\n     * @param {?} refs\n     * @param {?} queryMatches\n     * @param {?} usedEvents\n     * @param {?} queryIds\n     * @return {?}\n     */\n    ViewBuilder.prototype._visitDirective = function (providerAst, dirAst, directiveIndex, elementNodeIndex, refs, queryMatches, usedEvents, queryIds) {\n        var _this = this;\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // reserve the space in the nodeDefs array so we can add children\n        this.nodes.push(/** @type {?} */ ((null)));\n        dirAst.directive.queries.forEach(function (query, queryIndex) {\n            var /** @type {?} */ queryId = dirAst.contentQueryStartId + queryIndex;\n            var /** @type {?} */ flags = 67108864 /* TypeContentQuery */ | calcStaticDynamicQueryFlags(queryIds, queryId, query.first);\n            var /** @type {?} */ bindingType = query.first ? 0 /* First */ : 1;\n            _this.nodes.push(function () { return ({\n                sourceSpan: dirAst.sourceSpan,\n                nodeFlags: flags,\n                nodeDef: importExpr(Identifiers.queryDef).callFn([\n                    literal(flags), literal(queryId),\n                    new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType))])\n                ]),\n            }); });\n        });\n        // Note: the operation below might also create new nodeDefs,\n        // but we don't want them to be a child of a directive,\n        // as they might be a provider/pipe on their own.\n        // I.e. we only allow queries as children of directives nodes.\n        var /** @type {?} */ childCount = this.nodes.length - nodeIndex - 1;\n        var _a = this._visitProviderOrDirective(providerAst, queryMatches), flags = _a.flags, queryMatchExprs = _a.queryMatchExprs, providerExpr = _a.providerExpr, depsExpr = _a.depsExpr;\n        refs.forEach(function (ref) {\n            if (ref.value && tokenReference(ref.value) === tokenReference(providerAst.token)) {\n                _this.refNodeIndices[ref.name] = nodeIndex;\n                queryMatchExprs.push(literalArr([literal(ref.name), literal(4 /* Provider */)]));\n            }\n        });\n        if (dirAst.directive.isComponent) {\n            flags |= 32768 /* Component */;\n        }\n        var /** @type {?} */ inputDefs = dirAst.inputs.map(function (inputAst, inputIndex) {\n            var /** @type {?} */ mapValue = literalArr([literal(inputIndex), literal(inputAst.directiveName)]);\n            // Note: it's important to not quote the key so that we can capture renames by minifiers!\n            return new LiteralMapEntry(inputAst.directiveName, mapValue, false);\n        });\n        var /** @type {?} */ outputDefs = [];\n        var /** @type {?} */ dirMeta = dirAst.directive;\n        Object.keys(dirMeta.outputs).forEach(function (propName) {\n            var /** @type {?} */ eventName = dirMeta.outputs[propName];\n            if (usedEvents.has(eventName)) {\n                // Note: it's important to not quote the key so that we can capture renames by minifiers!\n                outputDefs.push(new LiteralMapEntry(propName, literal(eventName), false));\n            }\n        });\n        var /** @type {?} */ updateDirectiveExpressions = [];\n        if (dirAst.inputs.length || (flags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0) {\n            updateDirectiveExpressions =\n                dirAst.inputs.map(function (input, bindingIndex) { return _this._preprocessUpdateExpression({\n                    nodeIndex: nodeIndex,\n                    bindingIndex: bindingIndex,\n                    sourceSpan: input.sourceSpan,\n                    context: COMP_VAR,\n                    value: input.value\n                }); });\n        }\n        var /** @type {?} */ dirContextExpr = importExpr(Identifiers.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);\n        var /** @type {?} */ hostBindings = dirAst.hostProperties.map(function (inputAst) { return ({\n            context: dirContextExpr,\n            dirAst: dirAst,\n            inputAst: inputAst,\n        }); });\n        var /** @type {?} */ hostEvents = dirAst.hostEvents.map(function (hostEventAst) { return ({\n            context: dirContextExpr,\n            eventAst: hostEventAst, dirAst: dirAst,\n        }); });\n        // directiveDef(\n        //   flags: NodeFlags, matchedQueries: [string, QueryValueType][], childCount: number, ctor:\n        //   any,\n        //   deps: ([DepFlags, any] | any)[], props?: {[name: string]: [number, string]},\n        //   outputs?: {[name: string]: string}, component?: () => ViewDefinition): NodeDef;\n        this.nodes[nodeIndex] = function () { return ({\n            sourceSpan: dirAst.sourceSpan,\n            nodeFlags: 16384 /* TypeDirective */ | flags,\n            nodeDef: importExpr(Identifiers.directiveDef).callFn([\n                literal(flags), queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,\n                literal(childCount), providerExpr, depsExpr,\n                inputDefs.length ? new LiteralMapExpr(inputDefs) : NULL_EXPR,\n                outputDefs.length ? new LiteralMapExpr(outputDefs) : NULL_EXPR\n            ]),\n            updateDirectives: updateDirectiveExpressions,\n            directive: dirAst.directive.type,\n        }); };\n        return { hostBindings: hostBindings, hostEvents: hostEvents };\n    };\n    /**\n     * @param {?} providerAst\n     * @param {?} queryMatches\n     * @return {?}\n     */\n    ViewBuilder.prototype._visitProvider = function (providerAst, queryMatches) {\n        this._addProviderNode(this._visitProviderOrDirective(providerAst, queryMatches));\n    };\n    /**\n     * @param {?} directives\n     * @return {?}\n     */\n    ViewBuilder.prototype._visitComponentFactoryResolverProvider = function (directives) {\n        var /** @type {?} */ componentDirMeta = directives.find(function (dirAst) { return dirAst.directive.isComponent; });\n        if (componentDirMeta && componentDirMeta.directive.entryComponents.length) {\n            var _a = componentFactoryResolverProviderDef(this.reflector, this.outputCtx, 8192 /* PrivateProvider */, componentDirMeta.directive.entryComponents), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr_1 = _a.tokenExpr;\n            this._addProviderNode({\n                providerExpr: providerExpr,\n                depsExpr: depsExpr,\n                flags: flags,\n                tokenExpr: tokenExpr_1,\n                queryMatchExprs: [],\n                sourceSpan: componentDirMeta.sourceSpan\n            });\n        }\n    };\n    /**\n     * @param {?} data\n     * @return {?}\n     */\n    ViewBuilder.prototype._addProviderNode = function (data) {\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // providerDef(\n        //   flags: NodeFlags, matchedQueries: [string, QueryValueType][], token:any,\n        //   value: any, deps: ([DepFlags, any] | any)[]): NodeDef;\n        this.nodes.push(function () { return ({\n            sourceSpan: data.sourceSpan,\n            nodeFlags: data.flags,\n            nodeDef: importExpr(Identifiers.providerDef).callFn([\n                literal(data.flags),\n                data.queryMatchExprs.length ? literalArr(data.queryMatchExprs) : NULL_EXPR,\n                data.tokenExpr, data.providerExpr, data.depsExpr\n            ])\n        }); });\n    };\n    /**\n     * @param {?} providerAst\n     * @param {?} queryMatches\n     * @return {?}\n     */\n    ViewBuilder.prototype._visitProviderOrDirective = function (providerAst, queryMatches) {\n        var /** @type {?} */ flags = 0;\n        var /** @type {?} */ queryMatchExprs = [];\n        queryMatches.forEach(function (match) {\n            if (tokenReference(match.value) === tokenReference(providerAst.token)) {\n                queryMatchExprs.push(literalArr([literal(match.queryId), literal(4 /* Provider */)]));\n            }\n        });\n        var _a = providerDef(this.outputCtx, providerAst), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, providerFlags = _a.flags, tokenExpr = _a.tokenExpr;\n        return {\n            flags: flags | providerFlags,\n            queryMatchExprs: queryMatchExprs,\n            providerExpr: providerExpr,\n            depsExpr: depsExpr,\n            tokenExpr: tokenExpr,\n            sourceSpan: providerAst.sourceSpan\n        };\n    };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    ViewBuilder.prototype.getLocal = function (name) {\n        if (name == EventHandlerVars.event.name) {\n            return EventHandlerVars.event;\n        }\n        var /** @type {?} */ currViewExpr = VIEW_VAR;\n        for (var /** @type {?} */ currBuilder = this; currBuilder; currBuilder = currBuilder.parent,\n            currViewExpr = currViewExpr.prop('parent').cast(DYNAMIC_TYPE)) {\n            // check references\n            var /** @type {?} */ refNodeIndex = currBuilder.refNodeIndices[name];\n            if (refNodeIndex != null) {\n                return importExpr(Identifiers.nodeValue).callFn([currViewExpr, literal(refNodeIndex)]);\n            }\n            // check variables\n            var /** @type {?} */ varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });\n            if (varAst) {\n                var /** @type {?} */ varValue = varAst.value || IMPLICIT_TEMPLATE_VAR;\n                return currViewExpr.prop('context').prop(varValue);\n            }\n        }\n        return null;\n    };\n    /**\n     * @param {?} sourceSpan\n     * @param {?} argCount\n     * @return {?}\n     */\n    ViewBuilder.prototype.createLiteralArrayConverter = function (sourceSpan, argCount) {\n        if (argCount === 0) {\n            var /** @type {?} */ valueExpr_1 = importExpr(Identifiers.EMPTY_ARRAY);\n            return function () { return valueExpr_1; };\n        }\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // pureArrayDef(argCount: number): NodeDef;\n        this.nodes.push(function () { return ({\n            sourceSpan: sourceSpan,\n            nodeFlags: 32 /* TypePureArray */,\n            nodeDef: importExpr(Identifiers.pureArrayDef).callFn([literal(argCount)])\n        }); });\n        return function (args) { return callCheckStmt(nodeIndex, args); };\n    };\n    /**\n     * @param {?} sourceSpan\n     * @param {?} keys\n     * @return {?}\n     */\n    ViewBuilder.prototype.createLiteralMapConverter = function (sourceSpan, keys) {\n        if (keys.length === 0) {\n            var /** @type {?} */ valueExpr_2 = importExpr(Identifiers.EMPTY_MAP);\n            return function () { return valueExpr_2; };\n        }\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        // function pureObjectDef(propertyNames: string[]): NodeDef\n        this.nodes.push(function () { return ({\n            sourceSpan: sourceSpan,\n            nodeFlags: 64 /* TypePureObject */,\n            nodeDef: importExpr(Identifiers.pureObjectDef).callFn([literalArr(keys.map(function (key) { return literal(key); }))])\n        }); });\n        return function (args) { return callCheckStmt(nodeIndex, args); };\n    };\n    /**\n     * @param {?} expression\n     * @param {?} name\n     * @param {?} argCount\n     * @return {?}\n     */\n    ViewBuilder.prototype.createPipeConverter = function (expression, name, argCount) {\n        var /** @type {?} */ pipe = ((this.usedPipes.find(function (pipeSummary) { return pipeSummary.name === name; })));\n        if (pipe.pure) {\n            var /** @type {?} */ nodeIndex_1 = this.nodes.length;\n            // function purePipeDef(argCount: number): NodeDef;\n            this.nodes.push(function () { return ({\n                sourceSpan: expression.sourceSpan,\n                nodeFlags: 128 /* TypePurePipe */,\n                nodeDef: importExpr(Identifiers.purePipeDef).callFn([literal(argCount)])\n            }); });\n            // find underlying pipe in the component view\n            var /** @type {?} */ compViewExpr = VIEW_VAR;\n            var /** @type {?} */ compBuilder = this;\n            while (compBuilder.parent) {\n                compBuilder = compBuilder.parent;\n                compViewExpr = compViewExpr.prop('parent').cast(DYNAMIC_TYPE);\n            }\n            var /** @type {?} */ pipeNodeIndex = compBuilder.purePipeNodeIndices[name];\n            var /** @type {?} */ pipeValueExpr_1 = importExpr(Identifiers.nodeValue).callFn([compViewExpr, literal(pipeNodeIndex)]);\n            return function (args) { return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, callCheckStmt(nodeIndex_1, [pipeValueExpr_1].concat(args))); };\n        }\n        else {\n            var /** @type {?} */ nodeIndex = this._createPipe(expression.sourceSpan, pipe);\n            var /** @type {?} */ nodeValueExpr_1 = importExpr(Identifiers.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);\n            return function (args) { return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, nodeValueExpr_1.callMethod('transform', args)); };\n        }\n    };\n    /**\n     * @param {?} sourceSpan\n     * @param {?} pipe\n     * @return {?}\n     */\n    ViewBuilder.prototype._createPipe = function (sourceSpan, pipe) {\n        var _this = this;\n        var /** @type {?} */ nodeIndex = this.nodes.length;\n        var /** @type {?} */ flags = 0;\n        pipe.type.lifecycleHooks.forEach(function (lifecycleHook) {\n            // for pipes, we only support ngOnDestroy\n            if (lifecycleHook === LifecycleHooks.OnDestroy) {\n                flags |= lifecycleHookToNodeFlag(lifecycleHook);\n            }\n        });\n        var /** @type {?} */ depExprs = pipe.type.diDeps.map(function (diDep) { return depDef(_this.outputCtx, diDep); });\n        // function pipeDef(\n        //   flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef\n        this.nodes.push(function () { return ({\n            sourceSpan: sourceSpan,\n            nodeFlags: 16 /* TypePipe */,\n            nodeDef: importExpr(Identifiers.pipeDef).callFn([\n                literal(flags), _this.outputCtx.importExpr(pipe.type.reference), literalArr(depExprs)\n            ])\n        }); });\n        return nodeIndex;\n    };\n    /**\n     * @param {?} expression\n     * @return {?}\n     */\n    ViewBuilder.prototype._preprocessUpdateExpression = function (expression) {\n        var _this = this;\n        return {\n            nodeIndex: expression.nodeIndex,\n            bindingIndex: expression.bindingIndex,\n            sourceSpan: expression.sourceSpan,\n            context: expression.context,\n            value: convertPropertyBindingBuiltins({\n                createLiteralArrayConverter: function (argCount) { return _this.createLiteralArrayConverter(expression.sourceSpan, argCount); },\n                createLiteralMapConverter: function (keys) { return _this.createLiteralMapConverter(expression.sourceSpan, keys); },\n                createPipeConverter: function (name, argCount) { return _this.createPipeConverter(expression, name, argCount); }\n            }, expression.value)\n        };\n    };\n    /**\n     * @return {?}\n     */\n    ViewBuilder.prototype._createNodeExpressions = function () {\n        var /** @type {?} */ self = this;\n        var /** @type {?} */ updateBindingCount = 0;\n        var /** @type {?} */ updateRendererStmts = [];\n        var /** @type {?} */ updateDirectivesStmts = [];\n        var /** @type {?} */ nodeDefExprs = this.nodes.map(function (factory, nodeIndex) {\n            var _a = factory(), nodeDef = _a.nodeDef, nodeFlags = _a.nodeFlags, updateDirectives = _a.updateDirectives, updateRenderer = _a.updateRenderer, sourceSpan = _a.sourceSpan;\n            if (updateRenderer) {\n                updateRendererStmts.push.apply(updateRendererStmts, createUpdateStatements(nodeIndex, sourceSpan, updateRenderer, false));\n            }\n            if (updateDirectives) {\n                updateDirectivesStmts.push.apply(updateDirectivesStmts, createUpdateStatements(nodeIndex, sourceSpan, updateDirectives, (nodeFlags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0));\n            }\n            // We use a comma expression to call the log function before\n            // the nodeDef function, but still use the result of the nodeDef function\n            // as the value.\n            // Note: We only add the logger to elements / text nodes,\n            // so we don't generate too much code.\n            var /** @type {?} */ logWithNodeDef = nodeFlags & 3 /* CatRenderNode */ ?\n                new CommaExpr([LOG_VAR$1.callFn([]).callFn([]), nodeDef]) :\n                nodeDef;\n            return applySourceSpanToExpressionIfNeeded(logWithNodeDef, sourceSpan);\n        });\n        return { updateRendererStmts: updateRendererStmts, updateDirectivesStmts: updateDirectivesStmts, nodeDefExprs: nodeDefExprs };\n        /**\n         * @param {?} nodeIndex\n         * @param {?} sourceSpan\n         * @param {?} expressions\n         * @param {?} allowEmptyExprs\n         * @return {?}\n         */\n        function createUpdateStatements(nodeIndex, sourceSpan, expressions, allowEmptyExprs) {\n            var /** @type {?} */ updateStmts = [];\n            var /** @type {?} */ exprs = expressions.map(function (_a) {\n                var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;\n                var /** @type {?} */ bindingId = \"\" + updateBindingCount++;\n                var /** @type {?} */ nameResolver = context === COMP_VAR ? self : null;\n                var _b = convertPropertyBinding(nameResolver, context, value, bindingId), stmts = _b.stmts, currValExpr = _b.currValExpr;\n                updateStmts.push.apply(updateStmts, stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }));\n                return applySourceSpanToExpressionIfNeeded(currValExpr, sourceSpan);\n            });\n            if (expressions.length || allowEmptyExprs) {\n                updateStmts.push(applySourceSpanToStatementIfNeeded(callCheckStmt(nodeIndex, exprs).toStmt(), sourceSpan));\n            }\n            return updateStmts;\n        }\n    };\n    /**\n     * @param {?} nodeIndex\n     * @param {?} handlers\n     * @return {?}\n     */\n    ViewBuilder.prototype._createElementHandleEventFn = function (nodeIndex, handlers) {\n        var _this = this;\n        var /** @type {?} */ handleEventStmts = [];\n        var /** @type {?} */ handleEventBindingCount = 0;\n        handlers.forEach(function (_a) {\n            var context = _a.context, eventAst = _a.eventAst, dirAst = _a.dirAst;\n            var /** @type {?} */ bindingId = \"\" + handleEventBindingCount++;\n            var /** @type {?} */ nameResolver = context === COMP_VAR ? _this : null;\n            var _b = convertActionBinding(nameResolver, context, eventAst.handler, bindingId), stmts = _b.stmts, allowDefault = _b.allowDefault;\n            var /** @type {?} */ trueStmts = stmts;\n            if (allowDefault) {\n                trueStmts.push(ALLOW_DEFAULT_VAR.set(allowDefault.and(ALLOW_DEFAULT_VAR)).toStmt());\n            }\n            var _c = elementEventNameAndTarget(eventAst, dirAst), eventTarget = _c.target, eventName = _c.name;\n            var /** @type {?} */ fullEventName = _angular_core.ɵelementEventFullName(eventTarget, eventName);\n            handleEventStmts.push(applySourceSpanToStatementIfNeeded(new IfStmt(literal(fullEventName).identical(EVENT_NAME_VAR), trueStmts), eventAst.sourceSpan));\n        });\n        var /** @type {?} */ handleEventFn;\n        if (handleEventStmts.length > 0) {\n            var /** @type {?} */ preStmts = [ALLOW_DEFAULT_VAR.set(literal(true)).toDeclStmt(BOOL_TYPE)];\n            if (!this.component.isHost && findReadVarNames(handleEventStmts).has(/** @type {?} */ ((COMP_VAR.name)))) {\n                preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));\n            }\n            handleEventFn = fn([\n                new FnParam(/** @type {?} */ ((VIEW_VAR.name)), INFERRED_TYPE),\n                new FnParam(/** @type {?} */ ((EVENT_NAME_VAR.name)), INFERRED_TYPE),\n                new FnParam(/** @type {?} */ ((EventHandlerVars.event.name)), INFERRED_TYPE)\n            ], preStmts.concat(handleEventStmts, [new ReturnStatement(ALLOW_DEFAULT_VAR)]), INFERRED_TYPE);\n        }\n        else {\n            handleEventFn = NULL_EXPR;\n        }\n        return handleEventFn;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitDirective = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitDirectiveProperty = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitReference = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitVariable = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitEvent = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitElementProperty = function (ast, context) { };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    ViewBuilder.prototype.visitAttr = function (ast, context) { };\n    return ViewBuilder;\n}());\n/**\n * @param {?} astNodes\n * @return {?}\n */\nfunction needsAdditionalRootNode(astNodes) {\n    var /** @type {?} */ lastAstNode = astNodes[astNodes.length - 1];\n    if (lastAstNode instanceof EmbeddedTemplateAst) {\n        return lastAstNode.hasViewContainer;\n    }\n    if (lastAstNode instanceof ElementAst) {\n        if (isNgContainer(lastAstNode.name) && lastAstNode.children.length) {\n            return needsAdditionalRootNode(lastAstNode.children);\n        }\n        return lastAstNode.hasViewContainer;\n    }\n    return lastAstNode instanceof NgContentAst;\n}\n/**\n * @param {?} inputAst\n * @param {?} dirAst\n * @return {?}\n */\nfunction elementBindingDef(inputAst, dirAst) {\n    switch (inputAst.type) {\n        case PropertyBindingType.Attribute:\n            return literalArr([\n                literal(1 /* TypeElementAttribute */), literal(inputAst.name),\n                literal(inputAst.securityContext)\n            ]);\n        case PropertyBindingType.Property:\n            return literalArr([\n                literal(8 /* TypeProperty */), literal(inputAst.name),\n                literal(inputAst.securityContext)\n            ]);\n        case PropertyBindingType.Animation:\n            var /** @type {?} */ bindingType = 8 /* TypeProperty */ |\n                (dirAst && dirAst.directive.isComponent ? 32 /* SyntheticHostProperty */ :\n                    16 /* SyntheticProperty */);\n            return literalArr([\n                literal(bindingType), literal('@' + inputAst.name), literal(inputAst.securityContext)\n            ]);\n        case PropertyBindingType.Class:\n            return literalArr([literal(2 /* TypeElementClass */), literal(inputAst.name), NULL_EXPR]);\n        case PropertyBindingType.Style:\n            return literalArr([\n                literal(4 /* TypeElementStyle */), literal(inputAst.name), literal(inputAst.unit)\n            ]);\n    }\n}\n/**\n * @param {?} elementAst\n * @return {?}\n */\nfunction fixedAttrsDef(elementAst) {\n    var /** @type {?} */ mapResult = Object.create(null);\n    elementAst.attrs.forEach(function (attrAst) { mapResult[attrAst.name] = attrAst.value; });\n    elementAst.directives.forEach(function (dirAst) {\n        Object.keys(dirAst.directive.hostAttributes).forEach(function (name) {\n            var /** @type {?} */ value = dirAst.directive.hostAttributes[name];\n            var /** @type {?} */ prevValue = mapResult[name];\n            mapResult[name] = prevValue != null ? mergeAttributeValue(name, prevValue, value) : value;\n        });\n    });\n    // Note: We need to sort to get a defined output order\n    // for tests and for caching generated artifacts...\n    return literalArr(Object.keys(mapResult).sort().map(function (attrName) { return literalArr([literal(attrName), literal(mapResult[attrName])]); }));\n}\n/**\n * @param {?} attrName\n * @param {?} attrValue1\n * @param {?} attrValue2\n * @return {?}\n */\nfunction mergeAttributeValue(attrName, attrValue1, attrValue2) {\n    if (attrName == CLASS_ATTR$1 || attrName == STYLE_ATTR) {\n        return attrValue1 + \" \" + attrValue2;\n    }\n    else {\n        return attrValue2;\n    }\n}\n/**\n * @param {?} nodeIndex\n * @param {?} exprs\n * @return {?}\n */\nfunction callCheckStmt(nodeIndex, exprs) {\n    if (exprs.length > 10) {\n        return CHECK_VAR.callFn([VIEW_VAR, literal(nodeIndex), literal(1 /* Dynamic */), literalArr(exprs)]);\n    }\n    else {\n        return CHECK_VAR.callFn([VIEW_VAR, literal(nodeIndex), literal(0 /* Inline */)].concat(exprs));\n    }\n}\n/**\n * @param {?} nodeIndex\n * @param {?} bindingIdx\n * @param {?} expr\n * @return {?}\n */\nfunction callUnwrapValue(nodeIndex, bindingIdx, expr) {\n    return importExpr(Identifiers.unwrapValue).callFn([\n        VIEW_VAR, literal(nodeIndex), literal(bindingIdx), expr\n    ]);\n}\n/**\n * @param {?} nodes\n * @param {?=} result\n * @return {?}\n */\nfunction findStaticQueryIds(nodes, result) {\n    if (result === void 0) { result = new Map(); }\n    nodes.forEach(function (node) {\n        var /** @type {?} */ staticQueryIds = new Set();\n        var /** @type {?} */ dynamicQueryIds = new Set();\n        var /** @type {?} */ queryMatches = ((undefined));\n        if (node instanceof ElementAst) {\n            findStaticQueryIds(node.children, result);\n            node.children.forEach(function (child) {\n                var /** @type {?} */ childData = ((result.get(child)));\n                childData.staticQueryIds.forEach(function (queryId) { return staticQueryIds.add(queryId); });\n                childData.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });\n            });\n            queryMatches = node.queryMatches;\n        }\n        else if (node instanceof EmbeddedTemplateAst) {\n            findStaticQueryIds(node.children, result);\n            node.children.forEach(function (child) {\n                var /** @type {?} */ childData = ((result.get(child)));\n                childData.staticQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });\n                childData.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });\n            });\n            queryMatches = node.queryMatches;\n        }\n        if (queryMatches) {\n            queryMatches.forEach(function (match) { return staticQueryIds.add(match.queryId); });\n        }\n        dynamicQueryIds.forEach(function (queryId) { return staticQueryIds.delete(queryId); });\n        result.set(node, { staticQueryIds: staticQueryIds, dynamicQueryIds: dynamicQueryIds });\n    });\n    return result;\n}\n/**\n * @param {?} nodeStaticQueryIds\n * @return {?}\n */\nfunction staticViewQueryIds(nodeStaticQueryIds) {\n    var /** @type {?} */ staticQueryIds = new Set();\n    var /** @type {?} */ dynamicQueryIds = new Set();\n    Array.from(nodeStaticQueryIds.values()).forEach(function (entry) {\n        entry.staticQueryIds.forEach(function (queryId) { return staticQueryIds.add(queryId); });\n        entry.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });\n    });\n    dynamicQueryIds.forEach(function (queryId) { return staticQueryIds.delete(queryId); });\n    return { staticQueryIds: staticQueryIds, dynamicQueryIds: dynamicQueryIds };\n}\n/**\n * @param {?} eventAst\n * @param {?} dirAst\n * @return {?}\n */\nfunction elementEventNameAndTarget(eventAst, dirAst) {\n    if (eventAst.isAnimation) {\n        return {\n            name: \"@\" + eventAst.name + \".\" + eventAst.phase,\n            target: dirAst && dirAst.directive.isComponent ? 'component' : null\n        };\n    }\n    else {\n        return eventAst;\n    }\n}\n/**\n * @param {?} queryIds\n * @param {?} queryId\n * @param {?} isFirst\n * @return {?}\n */\nfunction calcStaticDynamicQueryFlags(queryIds, queryId, isFirst) {\n    var /** @type {?} */ flags = 0;\n    // Note: We only make queries static that query for a single item.\n    // This is because of backwards compatibility with the old view compiler...\n    if (isFirst && (queryIds.staticQueryIds.has(queryId) || !queryIds.dynamicQueryIds.has(queryId))) {\n        flags |= 268435456 /* StaticQuery */;\n    }\n    else {\n        flags |= 536870912 /* DynamicQuery */;\n    }\n    return flags;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar GeneratedFile = (function () {\n    /**\n     * @param {?} srcFileUrl\n     * @param {?} genFileUrl\n     * @param {?} sourceOrStmts\n     */\n    function GeneratedFile(srcFileUrl, genFileUrl, sourceOrStmts) {\n        this.srcFileUrl = srcFileUrl;\n        this.genFileUrl = genFileUrl;\n        if (typeof sourceOrStmts === 'string') {\n            this.source = sourceOrStmts;\n            this.stmts = null;\n        }\n        else {\n            this.source = null;\n            this.stmts = sourceOrStmts;\n        }\n    }\n    return GeneratedFile;\n}());\n/**\n * @param {?} file\n * @param {?=} preamble\n * @return {?}\n */\nfunction toTypeScript(file, preamble) {\n    if (preamble === void 0) { preamble = ''; }\n    if (!file.stmts) {\n        throw new Error(\"Illegal state: No stmts present on GeneratedFile \" + file.genFileUrl);\n    }\n    return new TypeScriptEmitter().emitStatements(sourceUrl(file.srcFileUrl), file.genFileUrl, file.stmts, preamble);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} forJitCtx\n * @param {?} summaryResolver\n * @param {?} symbolResolver\n * @param {?} symbols\n * @param {?} types\n * @return {?}\n */\nfunction serializeSummaries(forJitCtx, summaryResolver, symbolResolver, symbols, types) {\n    var /** @type {?} */ toJsonSerializer = new ToJsonSerializer(symbolResolver, summaryResolver);\n    var /** @type {?} */ forJitSerializer = new ForJitSerializer(forJitCtx, symbolResolver);\n    // for symbols, we use everything except for the class metadata itself\n    // (we keep the statics though), as the class metadata is contained in the\n    // CompileTypeSummary.\n    symbols.forEach(function (resolvedSymbol) { return toJsonSerializer.addOrMergeSummary({ symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata }); });\n    // Add summaries that are referenced by the given symbols (transitively)\n    // Note: the serializer.symbols array might be growing while\n    // we execute the loop!\n    for (var /** @type {?} */ processedIndex = 0; processedIndex < toJsonSerializer.symbols.length; processedIndex++) {\n        var /** @type {?} */ symbol = toJsonSerializer.symbols[processedIndex];\n        if (summaryResolver.isLibraryFile(symbol.filePath)) {\n            var /** @type {?} */ summary = summaryResolver.resolveSummary(symbol);\n            if (!summary) {\n                // some symbols might originate from a plain typescript library\n                // that just exported .d.ts and .metadata.json files, i.e. where no summary\n                // files were created.\n                var /** @type {?} */ resolvedSymbol = symbolResolver.resolveSymbol(symbol);\n                if (resolvedSymbol) {\n                    summary = { symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata };\n                }\n            }\n            if (summary) {\n                if (summary.type) {\n                    forJitSerializer.addLibType(summary.type);\n                }\n                toJsonSerializer.addOrMergeSummary(summary);\n            }\n        }\n    }\n    // Add type summaries.\n    // Note: We don't add the summaries of all referenced symbols as for the ResolvedSymbols,\n    // as the type summaries already contain the transitive data that they require\n    // (in a minimal way).\n    types.forEach(function (_a) {\n        var summary = _a.summary, metadata = _a.metadata;\n        forJitSerializer.addSourceType(summary, metadata);\n        toJsonSerializer.addOrMergeSummary({ symbol: summary.type.reference, metadata: null, type: summary });\n        if (summary.summaryKind === CompileSummaryKind.NgModule) {\n            var /** @type {?} */ ngModuleSummary = (summary);\n            ngModuleSummary.exportedDirectives.concat(ngModuleSummary.exportedPipes).forEach(function (id) {\n                var /** @type {?} */ symbol = id.reference;\n                if (summaryResolver.isLibraryFile(symbol.filePath)) {\n                    var /** @type {?} */ summary_1 = summaryResolver.resolveSummary(symbol);\n                    if (summary_1) {\n                        toJsonSerializer.addOrMergeSummary(summary_1);\n                    }\n                }\n            });\n        }\n    });\n    var _a = toJsonSerializer.serialize(), json = _a.json, exportAs = _a.exportAs;\n    forJitSerializer.serialize(exportAs);\n    return { json: json, exportAs: exportAs };\n}\n/**\n * @param {?} symbolCache\n * @param {?} json\n * @return {?}\n */\nfunction deserializeSummaries(symbolCache, json) {\n    var /** @type {?} */ deserializer = new FromJsonDeserializer(symbolCache);\n    return deserializer.deserialize(json);\n}\n/**\n * @param {?} outputCtx\n * @param {?} reference\n * @return {?}\n */\nfunction createForJitStub(outputCtx, reference) {\n    return createSummaryForJitFunction(outputCtx, reference, NULL_EXPR);\n}\n/**\n * @param {?} outputCtx\n * @param {?} reference\n * @param {?} value\n * @return {?}\n */\nfunction createSummaryForJitFunction(outputCtx, reference, value) {\n    var /** @type {?} */ fnName = summaryForJitName(reference.name);\n    outputCtx.statements.push(fn([], [new ReturnStatement(value)], new ArrayType(DYNAMIC_TYPE)).toDeclStmt(fnName, [\n        StmtModifier.Final, StmtModifier.Exported\n    ]));\n}\nvar ToJsonSerializer = (function (_super) {\n    __extends(ToJsonSerializer, _super);\n    /**\n     * @param {?} symbolResolver\n     * @param {?} summaryResolver\n     */\n    function ToJsonSerializer(symbolResolver, summaryResolver) {\n        var _this = _super.call(this) || this;\n        _this.symbolResolver = symbolResolver;\n        _this.summaryResolver = summaryResolver;\n        // Note: This only contains symbols without members.\n        _this.symbols = [];\n        _this.indexBySymbol = new Map();\n        _this.processedSummaryBySymbol = new Map();\n        _this.processedSummaries = [];\n        return _this;\n    }\n    /**\n     * @param {?} summary\n     * @return {?}\n     */\n    ToJsonSerializer.prototype.addOrMergeSummary = function (summary) {\n        var /** @type {?} */ symbolMeta = summary.metadata;\n        if (symbolMeta && symbolMeta.__symbolic === 'class') {\n            // For classes, we keep everything except their class decorators.\n            // We need to keep e.g. the ctor args, method names, method decorators\n            // so that the class can be extended in another compilation unit.\n            // We don't keep the class decorators as\n            // 1) they refer to data\n            //   that should not cause a rebuild of downstream compilation units\n            //   (e.g. inline templates of @Component, or @NgModule.declarations)\n            // 2) their data is already captured in TypeSummaries, e.g. DirectiveSummary.\n            var /** @type {?} */ clone_1 = {};\n            Object.keys(symbolMeta).forEach(function (propName) {\n                if (propName !== 'decorators') {\n                    clone_1[propName] = symbolMeta[propName];\n                }\n            });\n            symbolMeta = clone_1;\n        }\n        var /** @type {?} */ processedSummary = this.processedSummaryBySymbol.get(summary.symbol);\n        if (!processedSummary) {\n            processedSummary = this.processValue({ symbol: summary.symbol });\n            this.processedSummaries.push(processedSummary);\n            this.processedSummaryBySymbol.set(summary.symbol, processedSummary);\n        }\n        // Note: == on purpose to compare with undefined!\n        if (processedSummary.metadata == null && symbolMeta != null) {\n            processedSummary.metadata = this.processValue(symbolMeta);\n        }\n        // Note: == on purpose to compare with undefined!\n        if (processedSummary.type == null && summary.type != null) {\n            processedSummary.type = this.processValue(summary.type);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    ToJsonSerializer.prototype.serialize = function () {\n        var _this = this;\n        var /** @type {?} */ exportAs = [];\n        var /** @type {?} */ json = JSON.stringify({\n            summaries: this.processedSummaries,\n            symbols: this.symbols.map(function (symbol, index) {\n                symbol.assertNoMembers();\n                var /** @type {?} */ importAs = ((undefined));\n                if (_this.summaryResolver.isLibraryFile(symbol.filePath)) {\n                    importAs = symbol.name + \"_\" + index;\n                    exportAs.push({ symbol: symbol, exportAs: importAs });\n                }\n                return {\n                    __symbol: index,\n                    name: symbol.name,\n                    // We convert the source filenames tinto output filenames,\n                    // as the generated summary file will be used when teh current\n                    // compilation unit is used as a library\n                    filePath: _this.summaryResolver.getLibraryFileName(symbol.filePath),\n                    importAs: importAs\n                };\n            })\n        });\n        return { json: json, exportAs: exportAs };\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    ToJsonSerializer.prototype.processValue = function (value) { return visitValue(value, this, null); };\n    /**\n     * @param {?} value\n     * @param {?} context\n     * @return {?}\n     */\n    ToJsonSerializer.prototype.visitOther = function (value, context) {\n        if (value instanceof StaticSymbol) {\n            var /** @type {?} */ baseSymbol = this.symbolResolver.getStaticSymbol(value.filePath, value.name);\n            var /** @type {?} */ index = this.indexBySymbol.get(baseSymbol);\n            // Note: == on purpose to compare with undefined!\n            if (index == null) {\n                index = this.indexBySymbol.size;\n                this.indexBySymbol.set(baseSymbol, index);\n                this.symbols.push(baseSymbol);\n            }\n            return { __symbol: index, members: value.members };\n        }\n    };\n    return ToJsonSerializer;\n}(ValueTransformer));\nvar ForJitSerializer = (function () {\n    /**\n     * @param {?} outputCtx\n     * @param {?} symbolResolver\n     */\n    function ForJitSerializer(outputCtx, symbolResolver) {\n        this.outputCtx = outputCtx;\n        this.symbolResolver = symbolResolver;\n        this.data = new Map();\n    }\n    /**\n     * @param {?} summary\n     * @param {?} metadata\n     * @return {?}\n     */\n    ForJitSerializer.prototype.addSourceType = function (summary, metadata) {\n        this.data.set(summary.type.reference, { summary: summary, metadata: metadata, isLibrary: false });\n    };\n    /**\n     * @param {?} summary\n     * @return {?}\n     */\n    ForJitSerializer.prototype.addLibType = function (summary) {\n        this.data.set(summary.type.reference, { summary: summary, metadata: null, isLibrary: true });\n    };\n    /**\n     * @param {?} exportAs\n     * @return {?}\n     */\n    ForJitSerializer.prototype.serialize = function (exportAs) {\n        var _this = this;\n        var /** @type {?} */ ngModuleSymbols = new Set();\n        Array.from(this.data.values()).forEach(function (_a) {\n            var summary = _a.summary, metadata = _a.metadata, isLibrary = _a.isLibrary;\n            if (summary.summaryKind === CompileSummaryKind.NgModule) {\n                // collect the symbols that refer to NgModule classes.\n                // Note: we can't just rely on `summary.type.summaryKind` to determine this as\n                // we don't add the summaries of all referenced symbols when we serialize type summaries.\n                // See serializeSummaries for details.\n                ngModuleSymbols.add(summary.type.reference);\n                var /** @type {?} */ modSummary = (summary);\n                modSummary.modules.forEach(function (mod) { ngModuleSymbols.add(mod.reference); });\n            }\n            if (!isLibrary) {\n                var /** @type {?} */ fnName = summaryForJitName(summary.type.reference.name);\n                createSummaryForJitFunction(_this.outputCtx, summary.type.reference, _this.serializeSummaryWithDeps(summary, /** @type {?} */ ((metadata))));\n            }\n        });\n        exportAs.forEach(function (entry) {\n            var /** @type {?} */ symbol = entry.symbol;\n            if (ngModuleSymbols.has(symbol)) {\n                var /** @type {?} */ jitExportAsName = summaryForJitName(entry.exportAs);\n                _this.outputCtx.statements.push(variable(jitExportAsName).set(_this.serializeSummaryRef(symbol)).toDeclStmt(null, [\n                    StmtModifier.Exported\n                ]));\n            }\n        });\n    };\n    /**\n     * @param {?} summary\n     * @param {?} metadata\n     * @return {?}\n     */\n    ForJitSerializer.prototype.serializeSummaryWithDeps = function (summary, metadata) {\n        var _this = this;\n        var /** @type {?} */ expressions = [this.serializeSummary(summary)];\n        var /** @type {?} */ providers = [];\n        if (metadata instanceof CompileNgModuleMetadata) {\n            expressions.push.apply(expressions, \n            // For directives / pipes, we only add the declared ones,\n            // and rely on transitively importing NgModules to get the transitive\n            // summaries.\n            metadata.declaredDirectives.concat(metadata.declaredPipes)\n                .map(function (type) { return type.reference; })\n                .concat(metadata.transitiveModule.modules.map(function (type) { return type.reference; })\n                .filter(function (ref) { return ref !== metadata.type.reference; }))\n                .map(function (ref) { return _this.serializeSummaryRef(ref); }));\n            // Note: We don't use `NgModuleSummary.providers`, as that one is transitive,\n            // and we already have transitive modules.\n            providers = metadata.providers;\n        }\n        else if (summary.summaryKind === CompileSummaryKind.Directive) {\n            var /** @type {?} */ dirSummary = (summary);\n            providers = dirSummary.providers.concat(dirSummary.viewProviders);\n        }\n        // Note: We can't just refer to the `ngsummary.ts` files for `useClass` providers (as we do for\n        // declaredDirectives / declaredPipes), as we allow\n        // providers without ctor arguments to skip the `@Injectable` decorator,\n        // i.e. we didn't generate .ngsummary.ts files for these.\n        expressions.push.apply(expressions, providers.filter(function (provider) { return !!provider.useClass; }).map(function (provider) { return _this.serializeSummary(/** @type {?} */ ({\n            summaryKind: CompileSummaryKind.Injectable, type: provider.useClass\n        })); }));\n        return literalArr(expressions);\n    };\n    /**\n     * @param {?} typeSymbol\n     * @return {?}\n     */\n    ForJitSerializer.prototype.serializeSummaryRef = function (typeSymbol) {\n        var /** @type {?} */ jitImportedSymbol = this.symbolResolver.getStaticSymbol(summaryForJitFileName(typeSymbol.filePath), summaryForJitName(typeSymbol.name));\n        return this.outputCtx.importExpr(jitImportedSymbol);\n    };\n    /**\n     * @param {?} data\n     * @return {?}\n     */\n    ForJitSerializer.prototype.serializeSummary = function (data) {\n        var /** @type {?} */ outputCtx = this.outputCtx;\n        var Transformer = (function () {\n            function Transformer() {\n            }\n            /**\n             * @param {?} arr\n             * @param {?} context\n             * @return {?}\n             */\n            Transformer.prototype.visitArray = function (arr, context) {\n                var _this = this;\n                return literalArr(arr.map(function (entry) { return visitValue(entry, _this, context); }));\n            };\n            /**\n             * @param {?} map\n             * @param {?} context\n             * @return {?}\n             */\n            Transformer.prototype.visitStringMap = function (map, context) {\n                var _this = this;\n                return new LiteralMapExpr(Object.keys(map).map(function (key) { return new LiteralMapEntry(key, visitValue(map[key], _this, context)); }));\n            };\n            /**\n             * @param {?} value\n             * @param {?} context\n             * @return {?}\n             */\n            Transformer.prototype.visitPrimitive = function (value, context) { return literal(value); };\n            /**\n             * @param {?} value\n             * @param {?} context\n             * @return {?}\n             */\n            Transformer.prototype.visitOther = function (value, context) {\n                if (value instanceof StaticSymbol) {\n                    return outputCtx.importExpr(value);\n                }\n                else {\n                    throw new Error(\"Illegal State: Encountered value \" + value);\n                }\n            };\n            return Transformer;\n        }());\n        return visitValue(data, new Transformer(), null);\n    };\n    return ForJitSerializer;\n}());\nvar FromJsonDeserializer = (function (_super) {\n    __extends(FromJsonDeserializer, _super);\n    /**\n     * @param {?} symbolCache\n     */\n    function FromJsonDeserializer(symbolCache) {\n        var _this = _super.call(this) || this;\n        _this.symbolCache = symbolCache;\n        return _this;\n    }\n    /**\n     * @param {?} json\n     * @return {?}\n     */\n    FromJsonDeserializer.prototype.deserialize = function (json) {\n        var _this = this;\n        var /** @type {?} */ data = JSON.parse(json);\n        var /** @type {?} */ importAs = [];\n        this.symbols = [];\n        data.symbols.forEach(function (serializedSymbol) {\n            var /** @type {?} */ symbol = _this.symbolCache.get(serializedSymbol.filePath, serializedSymbol.name);\n            _this.symbols.push(symbol);\n            if (serializedSymbol.importAs) {\n                importAs.push({ symbol: symbol, importAs: serializedSymbol.importAs });\n            }\n        });\n        var /** @type {?} */ summaries = visitValue(data.summaries, this, null);\n        return { summaries: summaries, importAs: importAs };\n    };\n    /**\n     * @param {?} map\n     * @param {?} context\n     * @return {?}\n     */\n    FromJsonDeserializer.prototype.visitStringMap = function (map, context) {\n        if ('__symbol' in map) {\n            var /** @type {?} */ baseSymbol = this.symbols[map['__symbol']];\n            var /** @type {?} */ members = map['members'];\n            return members.length ? this.symbolCache.get(baseSymbol.filePath, baseSymbol.name, members) :\n                baseSymbol;\n        }\n        else {\n            return _super.prototype.visitStringMap.call(this, map, context);\n        }\n    };\n    return FromJsonDeserializer;\n}(ValueTransformer));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar AotCompiler = (function () {\n    /**\n     * @param {?} _config\n     * @param {?} _host\n     * @param {?} _reflector\n     * @param {?} _metadataResolver\n     * @param {?} _templateParser\n     * @param {?} _styleCompiler\n     * @param {?} _viewCompiler\n     * @param {?} _ngModuleCompiler\n     * @param {?} _outputEmitter\n     * @param {?} _summaryResolver\n     * @param {?} _localeId\n     * @param {?} _translationFormat\n     * @param {?} _enableSummariesForJit\n     * @param {?} _symbolResolver\n     */\n    function AotCompiler(_config, _host, _reflector, _metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _outputEmitter, _summaryResolver, _localeId, _translationFormat, _enableSummariesForJit, _symbolResolver) {\n        this._config = _config;\n        this._host = _host;\n        this._reflector = _reflector;\n        this._metadataResolver = _metadataResolver;\n        this._templateParser = _templateParser;\n        this._styleCompiler = _styleCompiler;\n        this._viewCompiler = _viewCompiler;\n        this._ngModuleCompiler = _ngModuleCompiler;\n        this._outputEmitter = _outputEmitter;\n        this._summaryResolver = _summaryResolver;\n        this._localeId = _localeId;\n        this._translationFormat = _translationFormat;\n        this._enableSummariesForJit = _enableSummariesForJit;\n        this._symbolResolver = _symbolResolver;\n    }\n    /**\n     * @return {?}\n     */\n    AotCompiler.prototype.clearCache = function () { this._metadataResolver.clearCache(); };\n    /**\n     * @param {?} rootFiles\n     * @return {?}\n     */\n    AotCompiler.prototype.analyzeModulesSync = function (rootFiles) {\n        var _this = this;\n        var /** @type {?} */ programSymbols = extractProgramSymbols(this._symbolResolver, rootFiles, this._host);\n        var /** @type {?} */ analyzeResult = analyzeAndValidateNgModules(programSymbols, this._host, this._metadataResolver);\n        analyzeResult.ngModules.forEach(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true); });\n        return analyzeResult;\n    };\n    /**\n     * @param {?} rootFiles\n     * @return {?}\n     */\n    AotCompiler.prototype.analyzeModulesAsync = function (rootFiles) {\n        var _this = this;\n        var /** @type {?} */ programSymbols = extractProgramSymbols(this._symbolResolver, rootFiles, this._host);\n        var /** @type {?} */ analyzeResult = analyzeAndValidateNgModules(programSymbols, this._host, this._metadataResolver);\n        return Promise\n            .all(analyzeResult.ngModules.map(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))\n            .then(function () { return analyzeResult; });\n    };\n    /**\n     * @param {?} analyzeResult\n     * @return {?}\n     */\n    AotCompiler.prototype.emitAllStubs = function (analyzeResult) {\n        var _this = this;\n        var files = analyzeResult.files;\n        var /** @type {?} */ sourceModules = files.map(function (file) { return _this._compileStubFile(file.srcUrl, file.directives, file.ngModules); });\n        return flatten(sourceModules);\n    };\n    /**\n     * @param {?} analyzeResult\n     * @return {?}\n     */\n    AotCompiler.prototype.emitAllImpls = function (analyzeResult) {\n        var _this = this;\n        var ngModuleByPipeOrDirective = analyzeResult.ngModuleByPipeOrDirective, files = analyzeResult.files;\n        var /** @type {?} */ sourceModules = files.map(function (file) { return _this._compileImplFile(file.srcUrl, ngModuleByPipeOrDirective, file.directives, file.pipes, file.ngModules, file.injectables); });\n        return flatten(sourceModules);\n    };\n    /**\n     * @param {?} srcFileUrl\n     * @param {?} directives\n     * @param {?} ngModules\n     * @return {?}\n     */\n    AotCompiler.prototype._compileStubFile = function (srcFileUrl, directives, ngModules) {\n        var _this = this;\n        var /** @type {?} */ fileSuffix = splitTypescriptSuffix(srcFileUrl, true)[1];\n        var /** @type {?} */ generatedFiles = [];\n        var /** @type {?} */ jitSummaryStmts = [];\n        var /** @type {?} */ ngFactoryStms = [];\n        var /** @type {?} */ ngFactoryOutputCtx = this._createOutputContext(ngfactoryFilePath(srcFileUrl, true));\n        var /** @type {?} */ jitSummaryOutputCtx = this._createOutputContext(summaryForJitFileName(srcFileUrl, true));\n        // create exports that user code can reference\n        ngModules.forEach(function (ngModuleReference) {\n            _this._ngModuleCompiler.createStub(ngFactoryOutputCtx, ngModuleReference);\n            createForJitStub(jitSummaryOutputCtx, ngModuleReference);\n        });\n        // Note: we are creating stub ngfactory/ngsummary for all source files,\n        // as the real calculation requires almost the same logic as producing the real content for\n        // them.\n        // Our pipeline will filter out empty ones at the end.\n        generatedFiles.push(this._codegenSourceModule(srcFileUrl, ngFactoryOutputCtx));\n        generatedFiles.push(this._codegenSourceModule(srcFileUrl, jitSummaryOutputCtx));\n        // create stubs for external stylesheets (always empty, as users should not import anything from\n        // the generated code)\n        directives.forEach(function (dirType) {\n            var /** @type {?} */ compMeta = _this._metadataResolver.getDirectiveMetadata(/** @type {?} */ (dirType));\n            if (!compMeta.isComponent) {\n                return;\n            } /** @type {?} */\n            ((\n            // Note: compMeta is a component and therefore template is non null.\n            compMeta.template)).externalStylesheets.forEach(function (stylesheetMeta) {\n                generatedFiles.push(_this._codegenSourceModule(/** @type {?} */ ((stylesheetMeta.moduleUrl)), _this._createOutputContext(_stylesModuleUrl(/** @type {?} */ ((stylesheetMeta.moduleUrl)), _this._styleCompiler.needsStyleShim(compMeta), fileSuffix))));\n            });\n        });\n        return generatedFiles;\n    };\n    /**\n     * @param {?} srcFileUrl\n     * @param {?} ngModuleByPipeOrDirective\n     * @param {?} directives\n     * @param {?} pipes\n     * @param {?} ngModules\n     * @param {?} injectables\n     * @return {?}\n     */\n    AotCompiler.prototype._compileImplFile = function (srcFileUrl, ngModuleByPipeOrDirective, directives, pipes, ngModules, injectables) {\n        var _this = this;\n        var /** @type {?} */ fileSuffix = splitTypescriptSuffix(srcFileUrl, true)[1];\n        var /** @type {?} */ generatedFiles = [];\n        var /** @type {?} */ outputCtx = this._createOutputContext(ngfactoryFilePath(srcFileUrl, true));\n        generatedFiles.push.apply(generatedFiles, this._createSummary(srcFileUrl, directives, pipes, ngModules, injectables, outputCtx));\n        // compile all ng modules\n        ngModules.forEach(function (ngModuleType) { return _this._compileModule(outputCtx, ngModuleType); });\n        // compile components\n        directives.forEach(function (dirType) {\n            var /** @type {?} */ compMeta = _this._metadataResolver.getDirectiveMetadata(/** @type {?} */ (dirType));\n            if (!compMeta.isComponent) {\n                return;\n            }\n            var /** @type {?} */ ngModule = ngModuleByPipeOrDirective.get(dirType);\n            if (!ngModule) {\n                throw new Error(\"Internal Error: cannot determine the module for component \" + identifierName(compMeta.type) + \"!\");\n            }\n            // compile styles\n            var /** @type {?} */ componentStylesheet = _this._styleCompiler.compileComponent(outputCtx, compMeta); /** @type {?} */\n            ((\n            // Note: compMeta is a component and therefore template is non null.\n            compMeta.template)).externalStylesheets.forEach(function (stylesheetMeta) {\n                generatedFiles.push(_this._codegenStyles(/** @type {?} */ ((stylesheetMeta.moduleUrl)), compMeta, stylesheetMeta, fileSuffix));\n            });\n            // compile components\n            var /** @type {?} */ compViewVars = _this._compileComponent(outputCtx, compMeta, ngModule, ngModule.transitiveModule.directives, componentStylesheet, fileSuffix);\n            _this._compileComponentFactory(outputCtx, compMeta, ngModule, fileSuffix);\n        });\n        if (outputCtx.statements.length > 0) {\n            var /** @type {?} */ srcModule = this._codegenSourceModule(srcFileUrl, outputCtx);\n            generatedFiles.unshift(srcModule);\n        }\n        return generatedFiles;\n    };\n    /**\n     * @param {?} srcFileUrl\n     * @param {?} directives\n     * @param {?} pipes\n     * @param {?} ngModules\n     * @param {?} injectables\n     * @param {?} ngFactoryCtx\n     * @return {?}\n     */\n    AotCompiler.prototype._createSummary = function (srcFileUrl, directives, pipes, ngModules, injectables, ngFactoryCtx) {\n        var _this = this;\n        var /** @type {?} */ symbolSummaries = this._symbolResolver.getSymbolsOf(srcFileUrl)\n            .map(function (symbol) { return _this._symbolResolver.resolveSymbol(symbol); });\n        var /** @type {?} */ typeData = ngModules.map(function (ref) { return ({\n            summary: /** @type {?} */ ((_this._metadataResolver.getNgModuleSummary(ref))),\n            metadata: /** @type {?} */ ((_this._metadataResolver.getNgModuleMetadata(ref)))\n        }); }).concat(directives.map(function (ref) { return ({\n            summary: /** @type {?} */ ((_this._metadataResolver.getDirectiveSummary(ref))),\n            metadata: /** @type {?} */ ((_this._metadataResolver.getDirectiveMetadata(ref)))\n        }); }), pipes.map(function (ref) { return ({\n            summary: /** @type {?} */ ((_this._metadataResolver.getPipeSummary(ref))),\n            metadata: /** @type {?} */ ((_this._metadataResolver.getPipeMetadata(ref)))\n        }); }), injectables.map(function (ref) { return ({\n            summary: /** @type {?} */ ((_this._metadataResolver.getInjectableSummary(ref))),\n            metadata: /** @type {?} */ ((_this._metadataResolver.getInjectableSummary(ref))).type\n        }); }));\n        var /** @type {?} */ forJitOutputCtx = this._createOutputContext(summaryForJitFileName(srcFileUrl, true));\n        var _a = serializeSummaries(forJitOutputCtx, this._summaryResolver, this._symbolResolver, symbolSummaries, typeData), json = _a.json, exportAs = _a.exportAs;\n        exportAs.forEach(function (entry) {\n            ngFactoryCtx.statements.push(variable(entry.exportAs).set(ngFactoryCtx.importExpr(entry.symbol)).toDeclStmt(null, [\n                StmtModifier.Exported\n            ]));\n        });\n        var /** @type {?} */ summaryJson = new GeneratedFile(srcFileUrl, summaryFileName(srcFileUrl), json);\n        if (this._enableSummariesForJit) {\n            return [summaryJson, this._codegenSourceModule(srcFileUrl, forJitOutputCtx)];\n        }\n        return [summaryJson];\n    };\n    /**\n     * @param {?} outputCtx\n     * @param {?} ngModuleType\n     * @return {?}\n     */\n    AotCompiler.prototype._compileModule = function (outputCtx, ngModuleType) {\n        var /** @type {?} */ ngModule = ((this._metadataResolver.getNgModuleMetadata(ngModuleType)));\n        var /** @type {?} */ providers = [];\n        if (this._localeId) {\n            providers.push({\n                token: createTokenForExternalReference(this._reflector, Identifiers.LOCALE_ID),\n                useValue: this._localeId,\n            });\n        }\n        if (this._translationFormat) {\n            providers.push({\n                token: createTokenForExternalReference(this._reflector, Identifiers.TRANSLATIONS_FORMAT),\n                useValue: this._translationFormat\n            });\n        }\n        this._ngModuleCompiler.compile(outputCtx, ngModule, providers);\n    };\n    /**\n     * @param {?} outputCtx\n     * @param {?} compMeta\n     * @param {?} ngModule\n     * @param {?} fileSuffix\n     * @return {?}\n     */\n    AotCompiler.prototype._compileComponentFactory = function (outputCtx, compMeta, ngModule, fileSuffix) {\n        var /** @type {?} */ hostType = this._metadataResolver.getHostComponentType(compMeta.type.reference);\n        var /** @type {?} */ hostMeta = createHostComponentMeta(hostType, compMeta, this._metadataResolver.getHostComponentViewClass(hostType));\n        var /** @type {?} */ hostViewFactoryVar = this._compileComponent(outputCtx, hostMeta, ngModule, [compMeta.type], null, fileSuffix)\n            .viewClassVar;\n        var /** @type {?} */ compFactoryVar = componentFactoryName(compMeta.type.reference);\n        var /** @type {?} */ inputsExprs = [];\n        for (var /** @type {?} */ propName in compMeta.inputs) {\n            var /** @type {?} */ templateName = compMeta.inputs[propName];\n            // Don't quote so that the key gets minified...\n            inputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));\n        }\n        var /** @type {?} */ outputsExprs = [];\n        for (var /** @type {?} */ propName in compMeta.outputs) {\n            var /** @type {?} */ templateName = compMeta.outputs[propName];\n            // Don't quote so that the key gets minified...\n            outputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));\n        }\n        outputCtx.statements.push(variable(compFactoryVar)\n            .set(importExpr(Identifiers.createComponentFactory).callFn([\n            literal(compMeta.selector), outputCtx.importExpr(compMeta.type.reference),\n            variable(hostViewFactoryVar), new LiteralMapExpr(inputsExprs),\n            new LiteralMapExpr(outputsExprs),\n            literalArr(/** @type {?} */ ((compMeta.template)).ngContentSelectors.map(function (selector) { return literal(selector); }))\n        ]))\n            .toDeclStmt(importType(Identifiers.ComponentFactory, [/** @type {?} */ ((expressionType(outputCtx.importExpr(compMeta.type.reference))))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]));\n    };\n    /**\n     * @param {?} outputCtx\n     * @param {?} compMeta\n     * @param {?} ngModule\n     * @param {?} directiveIdentifiers\n     * @param {?} componentStyles\n     * @param {?} fileSuffix\n     * @return {?}\n     */\n    AotCompiler.prototype._compileComponent = function (outputCtx, compMeta, ngModule, directiveIdentifiers, componentStyles, fileSuffix) {\n        var _this = this;\n        var /** @type {?} */ directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });\n        var /** @type {?} */ pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });\n        var _a = this._templateParser.parse(compMeta, /** @type {?} */ ((((compMeta.template)).template)), directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, /** @type {?} */ ((compMeta.template)))), parsedTemplate = _a.template, usedPipes = _a.pipes;\n        var /** @type {?} */ stylesExpr = componentStyles ? variable(componentStyles.stylesVar) : literalArr([]);\n        var /** @type {?} */ viewResult = this._viewCompiler.compileComponent(outputCtx, compMeta, parsedTemplate, stylesExpr, usedPipes);\n        if (componentStyles) {\n            _resolveStyleStatements(this._symbolResolver, componentStyles, this._styleCompiler.needsStyleShim(compMeta), fileSuffix);\n        }\n        return viewResult;\n    };\n    /**\n     * @param {?} genFilePath\n     * @return {?}\n     */\n    AotCompiler.prototype._createOutputContext = function (genFilePath) {\n        var _this = this;\n        var /** @type {?} */ importExpr$$1 = function (symbol, typeParams) {\n            if (typeParams === void 0) { typeParams = null; }\n            if (!(symbol instanceof StaticSymbol)) {\n                throw new Error(\"Internal error: unknown identifier \" + JSON.stringify(symbol));\n            }\n            var /** @type {?} */ arity = _this._symbolResolver.getTypeArity(symbol) || 0;\n            var _a = _this._symbolResolver.getImportAs(symbol) || symbol, filePath = _a.filePath, name = _a.name, members = _a.members;\n            var /** @type {?} */ moduleName = _this._symbolResolver.fileNameToModuleName(filePath, genFilePath);\n            // If we are in a type expression that refers to a generic type then supply\n            // the required type parameters. If there were not enough type parameters\n            // supplied, supply any as the type. Outside a type expression the reference\n            // should not supply type parameters and be treated as a simple value reference\n            // to the constructor function itself.\n            var /** @type {?} */ suppliedTypeParams = typeParams || [];\n            var /** @type {?} */ missingTypeParamsCount = arity - suppliedTypeParams.length;\n            var /** @type {?} */ allTypeParams = suppliedTypeParams.concat(new Array(missingTypeParamsCount).fill(DYNAMIC_TYPE));\n            return members.reduce(function (expr, memberName) { return expr.prop(memberName); }, /** @type {?} */ (importExpr(new ExternalReference(moduleName, name, null), allTypeParams)));\n        };\n        return { statements: [], genFilePath: genFilePath, importExpr: importExpr$$1 };\n    };\n    /**\n     * @param {?} srcFileUrl\n     * @param {?} compMeta\n     * @param {?} stylesheetMetadata\n     * @param {?} fileSuffix\n     * @return {?}\n     */\n    AotCompiler.prototype._codegenStyles = function (srcFileUrl, compMeta, stylesheetMetadata, fileSuffix) {\n        var /** @type {?} */ outputCtx = this._createOutputContext(_stylesModuleUrl(/** @type {?} */ ((stylesheetMetadata.moduleUrl)), this._styleCompiler.needsStyleShim(compMeta), fileSuffix));\n        var /** @type {?} */ compiledStylesheet = this._styleCompiler.compileStyles(outputCtx, compMeta, stylesheetMetadata);\n        _resolveStyleStatements(this._symbolResolver, compiledStylesheet, this._styleCompiler.needsStyleShim(compMeta), fileSuffix);\n        return this._codegenSourceModule(srcFileUrl, outputCtx);\n    };\n    /**\n     * @param {?} srcFileUrl\n     * @param {?} ctx\n     * @return {?}\n     */\n    AotCompiler.prototype._codegenSourceModule = function (srcFileUrl, ctx) {\n        return new GeneratedFile(srcFileUrl, ctx.genFilePath, ctx.statements);\n    };\n    return AotCompiler;\n}());\n/**\n * @param {?} symbolResolver\n * @param {?} compileResult\n * @param {?} needsShim\n * @param {?} fileSuffix\n * @return {?}\n */\nfunction _resolveStyleStatements(symbolResolver, compileResult, needsShim, fileSuffix) {\n    compileResult.dependencies.forEach(function (dep) {\n        dep.setValue(symbolResolver.getStaticSymbol(_stylesModuleUrl(dep.moduleUrl, needsShim, fileSuffix), dep.name));\n    });\n}\n/**\n * @param {?} stylesheetUrl\n * @param {?} shim\n * @param {?} suffix\n * @return {?}\n */\nfunction _stylesModuleUrl(stylesheetUrl, shim, suffix) {\n    return \"\" + stylesheetUrl + (shim ? '.shim' : '') + \".ngstyle\" + suffix;\n}\n/**\n * @param {?} programStaticSymbols\n * @param {?} host\n * @param {?} metadataResolver\n * @return {?}\n */\nfunction analyzeNgModules(programStaticSymbols, host, metadataResolver) {\n    var _a = _createNgModules(programStaticSymbols, host, metadataResolver), ngModules = _a.ngModules, symbolsMissingModule = _a.symbolsMissingModule;\n    return _analyzeNgModules(programStaticSymbols, ngModules, symbolsMissingModule, metadataResolver);\n}\n/**\n * @param {?} programStaticSymbols\n * @param {?} host\n * @param {?} metadataResolver\n * @return {?}\n */\nfunction analyzeAndValidateNgModules(programStaticSymbols, host, metadataResolver) {\n    var /** @type {?} */ result = analyzeNgModules(programStaticSymbols, host, metadataResolver);\n    if (result.symbolsMissingModule && result.symbolsMissingModule.length) {\n        var /** @type {?} */ messages = result.symbolsMissingModule.map(function (s) { return \"Cannot determine the module for class \" + s.name + \" in \" + s.filePath + \"! Add \" + s.name + \" to the NgModule to fix it.\"; });\n        throw syntaxError(messages.join('\\n'));\n    }\n    return result;\n}\n/**\n * @param {?} programSymbols\n * @param {?} ngModuleMetas\n * @param {?} symbolsMissingModule\n * @param {?} metadataResolver\n * @return {?}\n */\nfunction _analyzeNgModules(programSymbols, ngModuleMetas, symbolsMissingModule, metadataResolver) {\n    var /** @type {?} */ moduleMetasByRef = new Map();\n    ngModuleMetas.forEach(function (ngModule) { return moduleMetasByRef.set(ngModule.type.reference, ngModule); });\n    var /** @type {?} */ ngModuleByPipeOrDirective = new Map();\n    var /** @type {?} */ ngModulesByFile = new Map();\n    var /** @type {?} */ ngDirectivesByFile = new Map();\n    var /** @type {?} */ ngPipesByFile = new Map();\n    var /** @type {?} */ ngInjectablesByFile = new Map();\n    var /** @type {?} */ filePaths = new Set();\n    // Make sure we produce an analyzed file for each input file\n    programSymbols.forEach(function (symbol) {\n        var /** @type {?} */ filePath = symbol.filePath;\n        filePaths.add(filePath);\n        if (metadataResolver.isInjectable(symbol)) {\n            ngInjectablesByFile.set(filePath, (ngInjectablesByFile.get(filePath) || []).concat(symbol));\n        }\n    });\n    // Looping over all modules to construct:\n    // - a map from file to modules `ngModulesByFile`,\n    // - a map from file to directives `ngDirectivesByFile`,\n    // - a map from file to pipes `ngPipesByFile`,\n    // - a map from directive/pipe to module `ngModuleByPipeOrDirective`.\n    ngModuleMetas.forEach(function (ngModuleMeta) {\n        var /** @type {?} */ srcFileUrl = ngModuleMeta.type.reference.filePath;\n        filePaths.add(srcFileUrl);\n        ngModulesByFile.set(srcFileUrl, (ngModulesByFile.get(srcFileUrl) || []).concat(ngModuleMeta.type.reference));\n        ngModuleMeta.declaredDirectives.forEach(function (dirIdentifier) {\n            var /** @type {?} */ fileUrl = dirIdentifier.reference.filePath;\n            filePaths.add(fileUrl);\n            ngDirectivesByFile.set(fileUrl, (ngDirectivesByFile.get(fileUrl) || []).concat(dirIdentifier.reference));\n            ngModuleByPipeOrDirective.set(dirIdentifier.reference, ngModuleMeta);\n        });\n        ngModuleMeta.declaredPipes.forEach(function (pipeIdentifier) {\n            var /** @type {?} */ fileUrl = pipeIdentifier.reference.filePath;\n            filePaths.add(fileUrl);\n            ngPipesByFile.set(fileUrl, (ngPipesByFile.get(fileUrl) || []).concat(pipeIdentifier.reference));\n            ngModuleByPipeOrDirective.set(pipeIdentifier.reference, ngModuleMeta);\n        });\n    });\n    var /** @type {?} */ files = [];\n    filePaths.forEach(function (srcUrl) {\n        var /** @type {?} */ directives = ngDirectivesByFile.get(srcUrl) || [];\n        var /** @type {?} */ pipes = ngPipesByFile.get(srcUrl) || [];\n        var /** @type {?} */ ngModules = ngModulesByFile.get(srcUrl) || [];\n        var /** @type {?} */ injectables = ngInjectablesByFile.get(srcUrl) || [];\n        files.push({ srcUrl: srcUrl, directives: directives, pipes: pipes, ngModules: ngModules, injectables: injectables });\n    });\n    return {\n        // map directive/pipe to module\n        ngModuleByPipeOrDirective: ngModuleByPipeOrDirective,\n        // list modules and directives for every source file\n        files: files,\n        ngModules: ngModuleMetas, symbolsMissingModule: symbolsMissingModule\n    };\n}\n/**\n * @param {?} staticSymbolResolver\n * @param {?} files\n * @param {?} host\n * @return {?}\n */\nfunction extractProgramSymbols(staticSymbolResolver, files, host) {\n    var /** @type {?} */ staticSymbols = [];\n    files.filter(function (fileName) { return host.isSourceFile(fileName); }).forEach(function (sourceFile) {\n        staticSymbolResolver.getSymbolsOf(sourceFile).forEach(function (symbol) {\n            var /** @type {?} */ resolvedSymbol = staticSymbolResolver.resolveSymbol(symbol);\n            var /** @type {?} */ symbolMeta = resolvedSymbol.metadata;\n            if (symbolMeta) {\n                if (symbolMeta.__symbolic != 'error') {\n                    // Ignore symbols that are only included to record error information.\n                    staticSymbols.push(resolvedSymbol.symbol);\n                }\n            }\n        });\n    });\n    return staticSymbols;\n}\n/**\n * @param {?} programStaticSymbols\n * @param {?} host\n * @param {?} metadataResolver\n * @return {?}\n */\nfunction _createNgModules(programStaticSymbols, host, metadataResolver) {\n    var /** @type {?} */ ngModules = new Map();\n    var /** @type {?} */ programPipesAndDirectives = [];\n    var /** @type {?} */ ngModulePipesAndDirective = new Set();\n    var /** @type {?} */ addNgModule = function (staticSymbol) {\n        if (ngModules.has(staticSymbol) || !host.isSourceFile(staticSymbol.filePath)) {\n            return false;\n        }\n        var /** @type {?} */ ngModule = metadataResolver.getNgModuleMetadata(staticSymbol, false);\n        if (ngModule) {\n            ngModules.set(ngModule.type.reference, ngModule);\n            ngModule.declaredDirectives.forEach(function (dir) { return ngModulePipesAndDirective.add(dir.reference); });\n            ngModule.declaredPipes.forEach(function (pipe) { return ngModulePipesAndDirective.add(pipe.reference); });\n            // For every input module add the list of transitively included modules\n            ngModule.transitiveModule.modules.forEach(function (modMeta) { return addNgModule(modMeta.reference); });\n        }\n        return !!ngModule;\n    };\n    programStaticSymbols.forEach(function (staticSymbol) {\n        if (!addNgModule(staticSymbol) &&\n            (metadataResolver.isDirective(staticSymbol) || metadataResolver.isPipe(staticSymbol))) {\n            programPipesAndDirectives.push(staticSymbol);\n        }\n    });\n    // Throw an error if any of the program pipe or directives is not declared by a module\n    var /** @type {?} */ symbolsMissingModule = programPipesAndDirectives.filter(function (s) { return !ngModulePipesAndDirective.has(s); });\n    return { ngModules: Array.from(ngModules.values()), symbolsMissingModule: symbolsMissingModule };\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ANGULAR_CORE = '@angular/core';\nvar HIDDEN_KEY = /^\\$.*\\$$/;\nvar IGNORE = {\n    __symbolic: 'ignore'\n};\n/**\n * @param {?} value\n * @return {?}\n */\nfunction shouldIgnore(value) {\n    return value && value.__symbolic == 'ignore';\n}\n/**\n * A static reflector implements enough of the Reflector API that is necessary to compile\n * templates statically.\n */\nvar StaticReflector = (function () {\n    /**\n     * @param {?} summaryResolver\n     * @param {?} symbolResolver\n     * @param {?=} knownMetadataClasses\n     * @param {?=} knownMetadataFunctions\n     * @param {?=} errorRecorder\n     */\n    function StaticReflector(summaryResolver, symbolResolver, knownMetadataClasses, knownMetadataFunctions, errorRecorder) {\n        if (knownMetadataClasses === void 0) { knownMetadataClasses = []; }\n        if (knownMetadataFunctions === void 0) { knownMetadataFunctions = []; }\n        var _this = this;\n        this.summaryResolver = summaryResolver;\n        this.symbolResolver = symbolResolver;\n        this.errorRecorder = errorRecorder;\n        this.annotationCache = new Map();\n        this.propertyCache = new Map();\n        this.parameterCache = new Map();\n        this.methodCache = new Map();\n        this.conversionMap = new Map();\n        this.annotationForParentClassWithSummaryKind = new Map();\n        this.annotationNames = new Map();\n        this.initializeConversionMap();\n        knownMetadataClasses.forEach(function (kc) { return _this._registerDecoratorOrConstructor(_this.getStaticSymbol(kc.filePath, kc.name), kc.ctor); });\n        knownMetadataFunctions.forEach(function (kf) { return _this._registerFunction(_this.getStaticSymbol(kf.filePath, kf.name), kf.fn); });\n        this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Directive, [_angular_core.Directive, _angular_core.Component]);\n        this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Pipe, [_angular_core.Pipe]);\n        this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.NgModule, [_angular_core.NgModule]);\n        this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Injectable, [_angular_core.Injectable, _angular_core.Pipe, _angular_core.Directive, _angular_core.Component, _angular_core.NgModule]);\n        this.annotationNames.set(_angular_core.Directive, 'Directive');\n        this.annotationNames.set(_angular_core.Component, 'Component');\n        this.annotationNames.set(_angular_core.Pipe, 'Pipe');\n        this.annotationNames.set(_angular_core.NgModule, 'NgModule');\n        this.annotationNames.set(_angular_core.Injectable, 'Injectable');\n    }\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    StaticReflector.prototype.componentModuleUrl = function (typeOrFunc) {\n        var /** @type {?} */ staticSymbol = this.findSymbolDeclaration(typeOrFunc);\n        return this.symbolResolver.getResourcePath(staticSymbol);\n    };\n    /**\n     * @param {?} ref\n     * @return {?}\n     */\n    StaticReflector.prototype.resolveExternalReference = function (ref) {\n        var /** @type {?} */ importSymbol = this.getStaticSymbol(/** @type {?} */ ((ref.moduleName)), /** @type {?} */ ((ref.name)));\n        var /** @type {?} */ rootSymbol = this.findDeclaration(/** @type {?} */ ((ref.moduleName)), /** @type {?} */ ((ref.name)));\n        if (importSymbol != rootSymbol) {\n            this.symbolResolver.recordImportAs(rootSymbol, importSymbol);\n        }\n        return rootSymbol;\n    };\n    /**\n     * @param {?} moduleUrl\n     * @param {?} name\n     * @param {?=} containingFile\n     * @return {?}\n     */\n    StaticReflector.prototype.findDeclaration = function (moduleUrl, name, containingFile) {\n        return this.findSymbolDeclaration(this.symbolResolver.getSymbolByModule(moduleUrl, name, containingFile));\n    };\n    /**\n     * @param {?} symbol\n     * @return {?}\n     */\n    StaticReflector.prototype.findSymbolDeclaration = function (symbol) {\n        var /** @type {?} */ resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);\n        if (resolvedSymbol && resolvedSymbol.metadata instanceof StaticSymbol) {\n            return this.findSymbolDeclaration(resolvedSymbol.metadata);\n        }\n        else {\n            return symbol;\n        }\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    StaticReflector.prototype.annotations = function (type) {\n        var _this = this;\n        var /** @type {?} */ annotations = this.annotationCache.get(type);\n        if (!annotations) {\n            annotations = [];\n            var /** @type {?} */ classMetadata = this.getTypeMetadata(type);\n            var /** @type {?} */ parentType = this.findParentType(type, classMetadata);\n            if (parentType) {\n                var /** @type {?} */ parentAnnotations = this.annotations(parentType);\n                annotations.push.apply(annotations, parentAnnotations);\n            }\n            var /** @type {?} */ ownAnnotations_1 = [];\n            if (classMetadata['decorators']) {\n                ownAnnotations_1 = this.simplify(type, classMetadata['decorators']);\n                annotations.push.apply(annotations, ownAnnotations_1);\n            }\n            if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&\n                this.summaryResolver.isLibraryFile(parentType.filePath)) {\n                var /** @type {?} */ summary = this.summaryResolver.resolveSummary(parentType);\n                if (summary && summary.type) {\n                    var /** @type {?} */ requiredAnnotationTypes = ((this.annotationForParentClassWithSummaryKind.get(/** @type {?} */ ((summary.type.summaryKind)))));\n                    var /** @type {?} */ typeHasRequiredAnnotation = requiredAnnotationTypes.some(function (requiredType) { return ownAnnotations_1.some(function (ann) { return ann instanceof requiredType; }); });\n                    if (!typeHasRequiredAnnotation) {\n                        this.reportError(syntaxError(\"Class \" + type.name + \" in \" + type.filePath + \" extends from a \" + CompileSummaryKind[((summary.type.summaryKind))] + \" in another compilation unit without duplicating the decorator. \" +\n                            (\"Please add a \" + requiredAnnotationTypes.map(function (type) { return _this.annotationNames.get(type); }).join(' or ') + \" decorator to the class.\")), type);\n                    }\n                }\n            }\n            this.annotationCache.set(type, annotations.filter(function (ann) { return !!ann; }));\n        }\n        return annotations;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    StaticReflector.prototype.propMetadata = function (type) {\n        var _this = this;\n        var /** @type {?} */ propMetadata = this.propertyCache.get(type);\n        if (!propMetadata) {\n            var /** @type {?} */ classMetadata = this.getTypeMetadata(type);\n            propMetadata = {};\n            var /** @type {?} */ parentType = this.findParentType(type, classMetadata);\n            if (parentType) {\n                var /** @type {?} */ parentPropMetadata_1 = this.propMetadata(parentType);\n                Object.keys(parentPropMetadata_1).forEach(function (parentProp) {\n                    ((propMetadata))[parentProp] = parentPropMetadata_1[parentProp];\n                });\n            }\n            var /** @type {?} */ members_1 = classMetadata['members'] || {};\n            Object.keys(members_1).forEach(function (propName) {\n                var /** @type {?} */ propData = members_1[propName];\n                var /** @type {?} */ prop = ((propData))\n                    .find(function (a) { return a['__symbolic'] == 'property' || a['__symbolic'] == 'method'; });\n                var /** @type {?} */ decorators = [];\n                if (((propMetadata))[propName]) {\n                    decorators.push.apply(decorators, ((propMetadata))[propName]);\n                } /** @type {?} */\n                ((propMetadata))[propName] = decorators;\n                if (prop && prop['decorators']) {\n                    decorators.push.apply(decorators, _this.simplify(type, prop['decorators']));\n                }\n            });\n            this.propertyCache.set(type, propMetadata);\n        }\n        return propMetadata;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    StaticReflector.prototype.parameters = function (type) {\n        var _this = this;\n        if (!(type instanceof StaticSymbol)) {\n            this.reportError(new Error(\"parameters received \" + JSON.stringify(type) + \" which is not a StaticSymbol\"), type);\n            return [];\n        }\n        try {\n            var /** @type {?} */ parameters_1 = this.parameterCache.get(type);\n            if (!parameters_1) {\n                var /** @type {?} */ classMetadata = this.getTypeMetadata(type);\n                var /** @type {?} */ parentType = this.findParentType(type, classMetadata);\n                var /** @type {?} */ members = classMetadata ? classMetadata['members'] : null;\n                var /** @type {?} */ ctorData = members ? members['__ctor__'] : null;\n                if (ctorData) {\n                    var /** @type {?} */ ctor = ((ctorData)).find(function (a) { return a['__symbolic'] == 'constructor'; });\n                    var /** @type {?} */ rawParameterTypes = (ctor['parameters']) || [];\n                    var /** @type {?} */ parameterDecorators_1 = (this.simplify(type, ctor['parameterDecorators'] || []));\n                    parameters_1 = [];\n                    rawParameterTypes.forEach(function (rawParamType, index) {\n                        var /** @type {?} */ nestedResult = [];\n                        var /** @type {?} */ paramType = _this.trySimplify(type, rawParamType);\n                        if (paramType)\n                            nestedResult.push(paramType);\n                        var /** @type {?} */ decorators = parameterDecorators_1 ? parameterDecorators_1[index] : null;\n                        if (decorators) {\n                            nestedResult.push.apply(nestedResult, decorators);\n                        } /** @type {?} */\n                        ((parameters_1)).push(nestedResult);\n                    });\n                }\n                else if (parentType) {\n                    parameters_1 = this.parameters(parentType);\n                }\n                if (!parameters_1) {\n                    parameters_1 = [];\n                }\n                this.parameterCache.set(type, parameters_1);\n            }\n            return parameters_1;\n        }\n        catch (e) {\n            console.error(\"Failed on type \" + JSON.stringify(type) + \" with error \" + e);\n            throw e;\n        }\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    StaticReflector.prototype._methodNames = function (type) {\n        var /** @type {?} */ methodNames = this.methodCache.get(type);\n        if (!methodNames) {\n            var /** @type {?} */ classMetadata = this.getTypeMetadata(type);\n            methodNames = {};\n            var /** @type {?} */ parentType = this.findParentType(type, classMetadata);\n            if (parentType) {\n                var /** @type {?} */ parentMethodNames_1 = this._methodNames(parentType);\n                Object.keys(parentMethodNames_1).forEach(function (parentProp) {\n                    ((methodNames))[parentProp] = parentMethodNames_1[parentProp];\n                });\n            }\n            var /** @type {?} */ members_2 = classMetadata['members'] || {};\n            Object.keys(members_2).forEach(function (propName) {\n                var /** @type {?} */ propData = members_2[propName];\n                var /** @type {?} */ isMethod = ((propData)).some(function (a) { return a['__symbolic'] == 'method'; }); /** @type {?} */\n                ((methodNames))[propName] = ((methodNames))[propName] || isMethod;\n            });\n            this.methodCache.set(type, methodNames);\n        }\n        return methodNames;\n    };\n    /**\n     * @param {?} type\n     * @param {?} classMetadata\n     * @return {?}\n     */\n    StaticReflector.prototype.findParentType = function (type, classMetadata) {\n        var /** @type {?} */ parentType = this.trySimplify(type, classMetadata['extends']);\n        if (parentType instanceof StaticSymbol) {\n            return parentType;\n        }\n    };\n    /**\n     * @param {?} type\n     * @param {?} lcProperty\n     * @return {?}\n     */\n    StaticReflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n        if (!(type instanceof StaticSymbol)) {\n            this.reportError(new Error(\"hasLifecycleHook received \" + JSON.stringify(type) + \" which is not a StaticSymbol\"), type);\n        }\n        try {\n            return !!this._methodNames(type)[lcProperty];\n        }\n        catch (e) {\n            console.error(\"Failed on type \" + JSON.stringify(type) + \" with error \" + e);\n            throw e;\n        }\n    };\n    /**\n     * @param {?} type\n     * @param {?} ctor\n     * @return {?}\n     */\n    StaticReflector.prototype._registerDecoratorOrConstructor = function (type, ctor) {\n        this.conversionMap.set(type, function (context, args) { return new (ctor.bind.apply(ctor, [void 0].concat(args)))(); });\n    };\n    /**\n     * @param {?} type\n     * @param {?} fn\n     * @return {?}\n     */\n    StaticReflector.prototype._registerFunction = function (type, fn) {\n        this.conversionMap.set(type, function (context, args) { return fn.apply(undefined, args); });\n    };\n    /**\n     * @return {?}\n     */\n    StaticReflector.prototype.initializeConversionMap = function () {\n        this.injectionToken = this.findDeclaration(ANGULAR_CORE, 'InjectionToken');\n        this.opaqueToken = this.findDeclaration(ANGULAR_CORE, 'OpaqueToken');\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), _angular_core.Host);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Injectable'), _angular_core.Injectable);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), _angular_core.Self);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), _angular_core.SkipSelf);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Inject'), _angular_core.Inject);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), _angular_core.Optional);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Attribute'), _angular_core.Attribute);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChild'), _angular_core.ContentChild);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChildren'), _angular_core.ContentChildren);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChild'), _angular_core.ViewChild);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChildren'), _angular_core.ViewChildren);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Input'), _angular_core.Input);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Output'), _angular_core.Output);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Pipe'), _angular_core.Pipe);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostBinding'), _angular_core.HostBinding);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostListener'), _angular_core.HostListener);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Directive'), _angular_core.Directive);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Component'), _angular_core.Component);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'NgModule'), _angular_core.NgModule);\n        // Note: Some metadata classes can be used directly with Provider.deps.\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), _angular_core.Host);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), _angular_core.Self);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), _angular_core.SkipSelf);\n        this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), _angular_core.Optional);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'trigger'), _angular_core.trigger);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'state'), _angular_core.state);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'transition'), _angular_core.transition);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'style'), _angular_core.style);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'animate'), _angular_core.animate);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'keyframes'), _angular_core.keyframes);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'sequence'), _angular_core.sequence);\n        this._registerFunction(this.findDeclaration(ANGULAR_CORE, 'group'), _angular_core.group);\n    };\n    /**\n     * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.\n     * All types passed to the StaticResolver should be pseudo-types returned by this method.\n     *\n     * @param {?} declarationFile the absolute path of the file where the symbol is declared\n     * @param {?} name the name of the type.\n     * @param {?=} members\n     * @return {?}\n     */\n    StaticReflector.prototype.getStaticSymbol = function (declarationFile, name, members) {\n        return this.symbolResolver.getStaticSymbol(declarationFile, name, members);\n    };\n    /**\n     * @param {?} error\n     * @param {?} context\n     * @param {?=} path\n     * @return {?}\n     */\n    StaticReflector.prototype.reportError = function (error, context, path) {\n        if (this.errorRecorder) {\n            this.errorRecorder(error, (context && context.filePath) || path);\n        }\n        else {\n            throw error;\n        }\n    };\n    /**\n     * Simplify but discard any errors\n     * @param {?} context\n     * @param {?} value\n     * @return {?}\n     */\n    StaticReflector.prototype.trySimplify = function (context, value) {\n        var /** @type {?} */ originalRecorder = this.errorRecorder;\n        this.errorRecorder = function (error, fileName) { };\n        var /** @type {?} */ result = this.simplify(context, value);\n        this.errorRecorder = originalRecorder;\n        return result;\n    };\n    /**\n     * \\@internal\n     * @param {?} context\n     * @param {?} value\n     * @return {?}\n     */\n    StaticReflector.prototype.simplify = function (context, value) {\n        var _this = this;\n        var /** @type {?} */ self = this;\n        var /** @type {?} */ scope = BindingScope.empty;\n        var /** @type {?} */ calling = new Map();\n        /**\n         * @param {?} context\n         * @param {?} value\n         * @param {?} depth\n         * @return {?}\n         */\n        function simplifyInContext(context, value, depth) {\n            /**\n             * @param {?} staticSymbol\n             * @return {?}\n             */\n            function resolveReferenceValue(staticSymbol) {\n                var /** @type {?} */ resolvedSymbol = self.symbolResolver.resolveSymbol(staticSymbol);\n                return resolvedSymbol ? resolvedSymbol.metadata : null;\n            }\n            /**\n             * @param {?} functionSymbol\n             * @param {?} targetFunction\n             * @param {?} args\n             * @return {?}\n             */\n            function simplifyCall(functionSymbol, targetFunction, args) {\n                if (targetFunction && targetFunction['__symbolic'] == 'function') {\n                    if (calling.get(functionSymbol)) {\n                        throw new Error('Recursion not supported');\n                    }\n                    calling.set(functionSymbol, true);\n                    try {\n                        var /** @type {?} */ value_1 = targetFunction['value'];\n                        if (value_1 && (depth != 0 || value_1.__symbolic != 'error')) {\n                            var /** @type {?} */ parameters = targetFunction['parameters'];\n                            var /** @type {?} */ defaults = targetFunction.defaults;\n                            args = args.map(function (arg) { return simplifyInContext(context, arg, depth + 1); })\n                                .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });\n                            if (defaults && defaults.length > args.length) {\n                                args.push.apply(args, defaults.slice(args.length).map(function (value) { return simplify(value); }));\n                            }\n                            var /** @type {?} */ functionScope = BindingScope.build();\n                            for (var /** @type {?} */ i = 0; i < parameters.length; i++) {\n                                functionScope.define(parameters[i], args[i]);\n                            }\n                            var /** @type {?} */ oldScope = scope;\n                            var /** @type {?} */ result_1;\n                            try {\n                                scope = functionScope.done();\n                                result_1 = simplifyInContext(functionSymbol, value_1, depth + 1);\n                            }\n                            finally {\n                                scope = oldScope;\n                            }\n                            return result_1;\n                        }\n                    }\n                    finally {\n                        calling.delete(functionSymbol);\n                    }\n                }\n                if (depth === 0) {\n                    // If depth is 0 we are evaluating the top level expression that is describing element\n                    // decorator. In this case, it is a decorator we don't understand, such as a custom\n                    // non-angular decorator, and we should just ignore it.\n                    return IGNORE;\n                }\n                return simplify({ __symbolic: 'error', message: 'Function call not supported', context: functionSymbol });\n            }\n            /**\n             * @param {?} expression\n             * @return {?}\n             */\n            function simplify(expression) {\n                if (isPrimitive(expression)) {\n                    return expression;\n                }\n                if (expression instanceof Array) {\n                    var /** @type {?} */ result_2 = [];\n                    for (var _i = 0, _a = ((expression)); _i < _a.length; _i++) {\n                        var item = _a[_i];\n                        // Check for a spread expression\n                        if (item && item.__symbolic === 'spread') {\n                            var /** @type {?} */ spreadArray = simplify(item.expression);\n                            if (Array.isArray(spreadArray)) {\n                                for (var _b = 0, spreadArray_1 = spreadArray; _b < spreadArray_1.length; _b++) {\n                                    var spreadItem = spreadArray_1[_b];\n                                    result_2.push(spreadItem);\n                                }\n                                continue;\n                            }\n                        }\n                        var /** @type {?} */ value_2 = simplify(item);\n                        if (shouldIgnore(value_2)) {\n                            continue;\n                        }\n                        result_2.push(value_2);\n                    }\n                    return result_2;\n                }\n                if (expression instanceof StaticSymbol) {\n                    // Stop simplification at builtin symbols\n                    if (expression === self.injectionToken || expression === self.opaqueToken ||\n                        self.conversionMap.has(expression)) {\n                        return expression;\n                    }\n                    else {\n                        var /** @type {?} */ staticSymbol = expression;\n                        var /** @type {?} */ declarationValue = resolveReferenceValue(staticSymbol);\n                        if (declarationValue) {\n                            return simplifyInContext(staticSymbol, declarationValue, depth + 1);\n                        }\n                        else {\n                            return staticSymbol;\n                        }\n                    }\n                }\n                if (expression) {\n                    if (expression['__symbolic']) {\n                        var /** @type {?} */ staticSymbol = void 0;\n                        switch (expression['__symbolic']) {\n                            case 'binop':\n                                var /** @type {?} */ left = simplify(expression['left']);\n                                if (shouldIgnore(left))\n                                    return left;\n                                var /** @type {?} */ right = simplify(expression['right']);\n                                if (shouldIgnore(right))\n                                    return right;\n                                switch (expression['operator']) {\n                                    case '&&':\n                                        return left && right;\n                                    case '||':\n                                        return left || right;\n                                    case '|':\n                                        return left | right;\n                                    case '^':\n                                        return left ^ right;\n                                    case '&':\n                                        return left & right;\n                                    case '==':\n                                        return left == right;\n                                    case '!=':\n                                        return left != right;\n                                    case '===':\n                                        return left === right;\n                                    case '!==':\n                                        return left !== right;\n                                    case '<':\n                                        return left < right;\n                                    case '>':\n                                        return left > right;\n                                    case '<=':\n                                        return left <= right;\n                                    case '>=':\n                                        return left >= right;\n                                    case '<<':\n                                        return left << right;\n                                    case '>>':\n                                        return left >> right;\n                                    case '+':\n                                        return left + right;\n                                    case '-':\n                                        return left - right;\n                                    case '*':\n                                        return left * right;\n                                    case '/':\n                                        return left / right;\n                                    case '%':\n                                        return left % right;\n                                }\n                                return null;\n                            case 'if':\n                                var /** @type {?} */ condition = simplify(expression['condition']);\n                                return condition ? simplify(expression['thenExpression']) :\n                                    simplify(expression['elseExpression']);\n                            case 'pre':\n                                var /** @type {?} */ operand = simplify(expression['operand']);\n                                if (shouldIgnore(operand))\n                                    return operand;\n                                switch (expression['operator']) {\n                                    case '+':\n                                        return operand;\n                                    case '-':\n                                        return -operand;\n                                    case '!':\n                                        return !operand;\n                                    case '~':\n                                        return ~operand;\n                                }\n                                return null;\n                            case 'index':\n                                var /** @type {?} */ indexTarget = simplify(expression['expression']);\n                                var /** @type {?} */ index = simplify(expression['index']);\n                                if (indexTarget && isPrimitive(index))\n                                    return indexTarget[index];\n                                return null;\n                            case 'select':\n                                var /** @type {?} */ member = expression['member'];\n                                var /** @type {?} */ selectContext = context;\n                                var /** @type {?} */ selectTarget = simplify(expression['expression']);\n                                if (selectTarget instanceof StaticSymbol) {\n                                    var /** @type {?} */ members = selectTarget.members.concat(member);\n                                    selectContext =\n                                        self.getStaticSymbol(selectTarget.filePath, selectTarget.name, members);\n                                    var /** @type {?} */ declarationValue = resolveReferenceValue(selectContext);\n                                    if (declarationValue) {\n                                        return simplifyInContext(selectContext, declarationValue, depth + 1);\n                                    }\n                                    else {\n                                        return selectContext;\n                                    }\n                                }\n                                if (selectTarget && isPrimitive(member))\n                                    return simplifyInContext(selectContext, selectTarget[member], depth + 1);\n                                return null;\n                            case 'reference':\n                                // Note: This only has to deal with variable references,\n                                // as symbol references have been converted into StaticSymbols already\n                                // in the StaticSymbolResolver!\n                                var /** @type {?} */ name = expression['name'];\n                                var /** @type {?} */ localValue = scope.resolve(name);\n                                if (localValue != BindingScope.missing) {\n                                    return localValue;\n                                }\n                                break;\n                            case 'class':\n                                return context;\n                            case 'function':\n                                return context;\n                            case 'new':\n                            case 'call':\n                                // Determine if the function is a built-in conversion\n                                staticSymbol = simplifyInContext(context, expression['expression'], depth + 1);\n                                if (staticSymbol instanceof StaticSymbol) {\n                                    if (staticSymbol === self.injectionToken || staticSymbol === self.opaqueToken) {\n                                        // if somebody calls new InjectionToken, don't create an InjectionToken,\n                                        // but rather return the symbol to which the InjectionToken is assigned to.\n                                        return context;\n                                    }\n                                    var /** @type {?} */ argExpressions = expression['arguments'] || [];\n                                    var /** @type {?} */ converter = self.conversionMap.get(staticSymbol);\n                                    if (converter) {\n                                        var /** @type {?} */ args = argExpressions.map(function (arg) { return simplifyInContext(context, arg, depth + 1); })\n                                            .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });\n                                        return converter(context, args);\n                                    }\n                                    else {\n                                        // Determine if the function is one we can simplify.\n                                        var /** @type {?} */ targetFunction = resolveReferenceValue(staticSymbol);\n                                        return simplifyCall(staticSymbol, targetFunction, argExpressions);\n                                    }\n                                }\n                                return IGNORE;\n                            case 'error':\n                                var /** @type {?} */ message = produceErrorMessage(expression);\n                                if (expression['line']) {\n                                    message =\n                                        message + \" (position \" + (expression['line'] + 1) + \":\" + (expression['character'] + 1) + \" in the original .ts file)\";\n                                    self.reportError(positionalError(message, context.filePath, expression['line'], expression['character']), context);\n                                }\n                                else {\n                                    self.reportError(new Error(message), context);\n                                }\n                                return IGNORE;\n                            case 'ignore':\n                                return expression;\n                        }\n                        return null;\n                    }\n                    return mapStringMap(expression, function (value, name) { return simplify(value); });\n                }\n                return IGNORE;\n            }\n            try {\n                return simplify(value);\n            }\n            catch (e) {\n                var /** @type {?} */ members = context.members.length ? \".\" + context.members.join('.') : '';\n                var /** @type {?} */ message = e.message + \", resolving symbol \" + context.name + members + \" in \" + context.filePath;\n                if (e.fileName) {\n                    throw positionalError(message, e.fileName, e.line, e.column);\n                }\n                throw syntaxError(message);\n            }\n        }\n        var /** @type {?} */ recordedSimplifyInContext = function (context, value, depth) {\n            try {\n                return simplifyInContext(context, value, depth);\n            }\n            catch (e) {\n                _this.reportError(e, context);\n            }\n        };\n        var /** @type {?} */ result = this.errorRecorder ? recordedSimplifyInContext(context, value, 0) :\n            simplifyInContext(context, value, 0);\n        if (shouldIgnore(result)) {\n            return undefined;\n        }\n        return result;\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    StaticReflector.prototype.getTypeMetadata = function (type) {\n        var /** @type {?} */ resolvedSymbol = this.symbolResolver.resolveSymbol(type);\n        return resolvedSymbol && resolvedSymbol.metadata ? resolvedSymbol.metadata :\n            { __symbolic: 'class' };\n    };\n    return StaticReflector;\n}());\n/**\n * @param {?} error\n * @return {?}\n */\nfunction expandedMessage(error) {\n    switch (error.message) {\n        case 'Reference to non-exported class':\n            if (error.context && error.context.className) {\n                return \"Reference to a non-exported class \" + error.context.className + \". Consider exporting the class\";\n            }\n            break;\n        case 'Variable not initialized':\n            return 'Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler';\n        case 'Destructuring not supported':\n            return 'Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring';\n        case 'Could not resolve type':\n            if (error.context && error.context.typeName) {\n                return \"Could not resolve type \" + error.context.typeName;\n            }\n            break;\n        case 'Function call not supported':\n            var /** @type {?} */ prefix = error.context && error.context.name ? \"Calling function '\" + error.context.name + \"', f\" : 'F';\n            return prefix +\n                'unction calls are not supported. Consider replacing the function or lambda with a reference to an exported function';\n        case 'Reference to a local symbol':\n            if (error.context && error.context.name) {\n                return \"Reference to a local (non-exported) symbol '\" + error.context.name + \"'. Consider exporting the symbol\";\n            }\n            break;\n    }\n    return error.message;\n}\n/**\n * @param {?} error\n * @return {?}\n */\nfunction produceErrorMessage(error) {\n    return \"Error encountered resolving symbol values statically. \" + expandedMessage(error);\n}\n/**\n * @param {?} input\n * @param {?} transform\n * @return {?}\n */\nfunction mapStringMap(input, transform) {\n    if (!input)\n        return {};\n    var /** @type {?} */ result = {};\n    Object.keys(input).forEach(function (key) {\n        var /** @type {?} */ value = transform(input[key], key);\n        if (!shouldIgnore(value)) {\n            if (HIDDEN_KEY.test(key)) {\n                Object.defineProperty(result, key, { enumerable: false, configurable: true, value: value });\n            }\n            else {\n                result[key] = value;\n            }\n        }\n    });\n    return result;\n}\n/**\n * @param {?} o\n * @return {?}\n */\nfunction isPrimitive(o) {\n    return o === null || (typeof o !== 'function' && typeof o !== 'object');\n}\n/**\n * @abstract\n */\nvar BindingScope = (function () {\n    function BindingScope() {\n    }\n    /**\n     * @abstract\n     * @param {?} name\n     * @return {?}\n     */\n    BindingScope.prototype.resolve = function (name) { };\n    /**\n     * @return {?}\n     */\n    BindingScope.build = function () {\n        var /** @type {?} */ current = new Map();\n        return {\n            define: function (name, value) {\n                current.set(name, value);\n                return this;\n            },\n            done: function () {\n                return current.size > 0 ? new PopulatedScope(current) : BindingScope.empty;\n            }\n        };\n    };\n    return BindingScope;\n}());\nBindingScope.missing = {};\nBindingScope.empty = { resolve: function (name) { return BindingScope.missing; } };\nvar PopulatedScope = (function (_super) {\n    __extends(PopulatedScope, _super);\n    /**\n     * @param {?} bindings\n     */\n    function PopulatedScope(bindings) {\n        var _this = _super.call(this) || this;\n        _this.bindings = bindings;\n        return _this;\n    }\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    PopulatedScope.prototype.resolve = function (name) {\n        return this.bindings.has(name) ? this.bindings.get(name) : BindingScope.missing;\n    };\n    return PopulatedScope;\n}(BindingScope));\n/**\n * @param {?} message\n * @param {?} fileName\n * @param {?} line\n * @param {?} column\n * @return {?}\n */\nfunction positionalError(message, fileName, line, column) {\n    var /** @type {?} */ result = new Error(message);\n    ((result)).fileName = fileName;\n    ((result)).line = line;\n    ((result)).column = column;\n    return result;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ResolvedStaticSymbol = (function () {\n    /**\n     * @param {?} symbol\n     * @param {?} metadata\n     */\n    function ResolvedStaticSymbol(symbol, metadata) {\n        this.symbol = symbol;\n        this.metadata = metadata;\n    }\n    return ResolvedStaticSymbol;\n}());\nvar SUPPORTED_SCHEMA_VERSION = 3;\n/**\n * This class is responsible for loading metadata per symbol,\n * and normalizing references between symbols.\n *\n * Internally, it only uses symbols without members,\n * and deduces the values for symbols with members based\n * on these symbols.\n */\nvar StaticSymbolResolver = (function () {\n    /**\n     * @param {?} host\n     * @param {?} staticSymbolCache\n     * @param {?} summaryResolver\n     * @param {?=} errorRecorder\n     */\n    function StaticSymbolResolver(host, staticSymbolCache, summaryResolver, errorRecorder) {\n        this.host = host;\n        this.staticSymbolCache = staticSymbolCache;\n        this.summaryResolver = summaryResolver;\n        this.errorRecorder = errorRecorder;\n        this.metadataCache = new Map();\n        this.resolvedSymbols = new Map();\n        this.resolvedFilePaths = new Set();\n        this.importAs = new Map();\n        this.symbolResourcePaths = new Map();\n        this.symbolFromFile = new Map();\n        this.knownFileNameToModuleNames = new Map();\n    }\n    /**\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.resolveSymbol = function (staticSymbol) {\n        if (staticSymbol.members.length > 0) {\n            return ((this._resolveSymbolMembers(staticSymbol)));\n        }\n        var /** @type {?} */ result = this.resolvedSymbols.get(staticSymbol);\n        if (result) {\n            return result;\n        }\n        result = ((this._resolveSymbolFromSummary(staticSymbol)));\n        if (result) {\n            return result;\n        }\n        // Note: Some users use libraries that were not compiled with ngc, i.e. they don't\n        // have summaries, only .d.ts files. So we always need to check both, the summary\n        // and metadata.\n        this._createSymbolsOf(staticSymbol.filePath);\n        result = ((this.resolvedSymbols.get(staticSymbol)));\n        return result;\n    };\n    /**\n     * getImportAs produces a symbol that can be used to import the given symbol.\n     * The import might be different than the symbol if the symbol is exported from\n     * a library with a summary; in which case we want to import the symbol from the\n     * ngfactory re-export instead of directly to avoid introducing a direct dependency\n     * on an otherwise indirect dependency.\n     *\n     * @param {?} staticSymbol the symbol for which to generate a import symbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getImportAs = function (staticSymbol) {\n        if (staticSymbol.members.length) {\n            var /** @type {?} */ baseSymbol = this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name);\n            var /** @type {?} */ baseImportAs = this.getImportAs(baseSymbol);\n            return baseImportAs ?\n                this.getStaticSymbol(baseImportAs.filePath, baseImportAs.name, staticSymbol.members) :\n                null;\n        }\n        var /** @type {?} */ summarizedFileName = stripSummaryForJitFileSuffix(staticSymbol.filePath);\n        if (summarizedFileName !== staticSymbol.filePath) {\n            var /** @type {?} */ summarizedName = stripSummaryForJitNameSuffix(staticSymbol.name);\n            var /** @type {?} */ baseSymbol = this.getStaticSymbol(summarizedFileName, summarizedName, staticSymbol.members);\n            var /** @type {?} */ baseImportAs = this.getImportAs(baseSymbol);\n            return baseImportAs ?\n                this.getStaticSymbol(summaryForJitFileName(baseImportAs.filePath), summaryForJitName(baseImportAs.name), baseSymbol.members) :\n                null;\n        }\n        var /** @type {?} */ result = this.summaryResolver.getImportAs(staticSymbol);\n        if (!result) {\n            result = ((this.importAs.get(staticSymbol)));\n        }\n        return result;\n    };\n    /**\n     * getResourcePath produces the path to the original location of the symbol and should\n     * be used to determine the relative location of resource references recorded in\n     * symbol metadata.\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getResourcePath = function (staticSymbol) {\n        return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;\n    };\n    /**\n     * getTypeArity returns the number of generic type parameters the given symbol\n     * has. If the symbol is not a type the result is null.\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getTypeArity = function (staticSymbol) {\n        // If the file is a factory/ngsummary file, don't resolve the symbol as doing so would\n        // cause the metadata for an factory/ngsummary file to be loaded which doesn't exist.\n        // All references to generated classes must include the correct arity whenever\n        // generating code.\n        if (isGeneratedFile(staticSymbol.filePath)) {\n            return null;\n        }\n        var /** @type {?} */ resolvedSymbol = this.resolveSymbol(staticSymbol);\n        while (resolvedSymbol && resolvedSymbol.metadata instanceof StaticSymbol) {\n            resolvedSymbol = this.resolveSymbol(resolvedSymbol.metadata);\n        }\n        return (resolvedSymbol && resolvedSymbol.metadata && resolvedSymbol.metadata.arity) || null;\n    };\n    /**\n     * Converts a file path to a module name that can be used as an `import`.\n     * @param {?} importedFilePath\n     * @param {?} containingFilePath\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.fileNameToModuleName = function (importedFilePath, containingFilePath) {\n        if (importedFilePath === containingFilePath) {\n            return null;\n        }\n        return this.knownFileNameToModuleNames.get(importedFilePath) ||\n            this.host.fileNameToModuleName(importedFilePath, containingFilePath);\n    };\n    /**\n     * @param {?} sourceSymbol\n     * @param {?} targetSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.recordImportAs = function (sourceSymbol, targetSymbol) {\n        sourceSymbol.assertNoMembers();\n        targetSymbol.assertNoMembers();\n        this.importAs.set(sourceSymbol, targetSymbol);\n    };\n    /**\n     * Invalidate all information derived from the given file.\n     *\n     * @param {?} fileName the file to invalidate\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.invalidateFile = function (fileName) {\n        this.metadataCache.delete(fileName);\n        this.resolvedFilePaths.delete(fileName);\n        var /** @type {?} */ symbols = this.symbolFromFile.get(fileName);\n        if (symbols) {\n            this.symbolFromFile.delete(fileName);\n            for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {\n                var symbol = symbols_1[_i];\n                this.resolvedSymbols.delete(symbol);\n                this.importAs.delete(symbol);\n                this.symbolResourcePaths.delete(symbol);\n            }\n        }\n    };\n    /**\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype._resolveSymbolMembers = function (staticSymbol) {\n        var /** @type {?} */ members = staticSymbol.members;\n        var /** @type {?} */ baseResolvedSymbol = this.resolveSymbol(this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name));\n        if (!baseResolvedSymbol) {\n            return null;\n        }\n        var /** @type {?} */ baseMetadata = baseResolvedSymbol.metadata;\n        if (baseMetadata instanceof StaticSymbol) {\n            return new ResolvedStaticSymbol(staticSymbol, this.getStaticSymbol(baseMetadata.filePath, baseMetadata.name, members));\n        }\n        else if (baseMetadata && baseMetadata.__symbolic === 'class') {\n            if (baseMetadata.statics && members.length === 1) {\n                return new ResolvedStaticSymbol(staticSymbol, baseMetadata.statics[members[0]]);\n            }\n        }\n        else {\n            var /** @type {?} */ value = baseMetadata;\n            for (var /** @type {?} */ i = 0; i < members.length && value; i++) {\n                value = value[members[i]];\n            }\n            return new ResolvedStaticSymbol(staticSymbol, value);\n        }\n        return null;\n    };\n    /**\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype._resolveSymbolFromSummary = function (staticSymbol) {\n        var /** @type {?} */ summary = this.summaryResolver.resolveSummary(staticSymbol);\n        return summary ? new ResolvedStaticSymbol(staticSymbol, summary.metadata) : null;\n    };\n    /**\n     * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.\n     * All types passed to the StaticResolver should be pseudo-types returned by this method.\n     *\n     * @param {?} declarationFile the absolute path of the file where the symbol is declared\n     * @param {?} name the name of the type.\n     * @param {?=} members a symbol for a static member of the named type\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getStaticSymbol = function (declarationFile, name, members) {\n        return this.staticSymbolCache.get(declarationFile, name, members);\n    };\n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getSymbolsOf = function (filePath) {\n        // Note: Some users use libraries that were not compiled with ngc, i.e. they don't\n        // have summaries, only .d.ts files. So we always need to check both, the summary\n        // and metadata.\n        var /** @type {?} */ symbols = new Set(this.summaryResolver.getSymbolsOf(filePath));\n        this._createSymbolsOf(filePath);\n        this.resolvedSymbols.forEach(function (resolvedSymbol) {\n            if (resolvedSymbol.symbol.filePath === filePath) {\n                symbols.add(resolvedSymbol.symbol);\n            }\n        });\n        return Array.from(symbols);\n    };\n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype._createSymbolsOf = function (filePath) {\n        var _this = this;\n        if (this.resolvedFilePaths.has(filePath)) {\n            return;\n        }\n        this.resolvedFilePaths.add(filePath);\n        var /** @type {?} */ resolvedSymbols = [];\n        var /** @type {?} */ metadata = this.getModuleMetadata(filePath);\n        if (metadata['importAs']) {\n            // Index bundle indices should use the importAs module name defined\n            // in the bundle.\n            this.knownFileNameToModuleNames.set(filePath, metadata['importAs']);\n        }\n        if (metadata['metadata']) {\n            // handle direct declarations of the symbol\n            var /** @type {?} */ topLevelSymbolNames_1 = new Set(Object.keys(metadata['metadata']).map(unescapeIdentifier));\n            var /** @type {?} */ origins_1 = metadata['origins'] || {};\n            Object.keys(metadata['metadata']).forEach(function (metadataKey) {\n                var /** @type {?} */ symbolMeta = metadata['metadata'][metadataKey];\n                var /** @type {?} */ name = unescapeIdentifier(metadataKey);\n                var /** @type {?} */ symbol = _this.getStaticSymbol(filePath, name);\n                var /** @type {?} */ origin = origins_1.hasOwnProperty(metadataKey) && origins_1[metadataKey];\n                if (origin) {\n                    // If the symbol is from a bundled index, use the declaration location of the\n                    // symbol so relative references (such as './my.html') will be calculated\n                    // correctly.\n                    var /** @type {?} */ originFilePath = _this.resolveModule(origin, filePath);\n                    if (!originFilePath) {\n                        _this.reportError(new Error(\"Couldn't resolve original symbol for \" + origin + \" from \" + filePath));\n                    }\n                    else {\n                        _this.symbolResourcePaths.set(symbol, originFilePath);\n                    }\n                }\n                resolvedSymbols.push(_this.createResolvedSymbol(symbol, filePath, topLevelSymbolNames_1, symbolMeta));\n            });\n        }\n        // handle the symbols in one of the re-export location\n        if (metadata['exports']) {\n            var _loop_1 = function (moduleExport) {\n                // handle the symbols in the list of explicitly re-exported symbols.\n                if (moduleExport.export) {\n                    moduleExport.export.forEach(function (exportSymbol) {\n                        var /** @type {?} */ symbolName;\n                        if (typeof exportSymbol === 'string') {\n                            symbolName = exportSymbol;\n                        }\n                        else {\n                            symbolName = exportSymbol.as;\n                        }\n                        symbolName = unescapeIdentifier(symbolName);\n                        var /** @type {?} */ symName = symbolName;\n                        if (typeof exportSymbol !== 'string') {\n                            symName = unescapeIdentifier(exportSymbol.name);\n                        }\n                        var /** @type {?} */ resolvedModule = _this.resolveModule(moduleExport.from, filePath);\n                        if (resolvedModule) {\n                            var /** @type {?} */ targetSymbol = _this.getStaticSymbol(resolvedModule, symName);\n                            var /** @type {?} */ sourceSymbol = _this.getStaticSymbol(filePath, symbolName);\n                            resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));\n                        }\n                    });\n                }\n                else {\n                    // handle the symbols via export * directives.\n                    var /** @type {?} */ resolvedModule = this_1.resolveModule(moduleExport.from, filePath);\n                    if (resolvedModule) {\n                        var /** @type {?} */ nestedExports = this_1.getSymbolsOf(resolvedModule);\n                        nestedExports.forEach(function (targetSymbol) {\n                            var /** @type {?} */ sourceSymbol = _this.getStaticSymbol(filePath, targetSymbol.name);\n                            resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));\n                        });\n                    }\n                }\n            };\n            var this_1 = this;\n            for (var _i = 0, _a = metadata['exports']; _i < _a.length; _i++) {\n                var moduleExport = _a[_i];\n                _loop_1(/** @type {?} */ moduleExport);\n            }\n        }\n        resolvedSymbols.forEach(function (resolvedSymbol) { return _this.resolvedSymbols.set(resolvedSymbol.symbol, resolvedSymbol); });\n        this.symbolFromFile.set(filePath, resolvedSymbols.map(function (resolvedSymbol) { return resolvedSymbol.symbol; }));\n    };\n    /**\n     * @param {?} sourceSymbol\n     * @param {?} topLevelPath\n     * @param {?} topLevelSymbolNames\n     * @param {?} metadata\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.createResolvedSymbol = function (sourceSymbol, topLevelPath, topLevelSymbolNames, metadata) {\n        // For classes that don't have Angular summaries / metadata,\n        // we only keep their arity, but nothing else\n        // (e.g. their constructor parameters).\n        // We do this to prevent introducing deep imports\n        // as we didn't generate .ngfactory.ts files with proper reexports.\n        if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) && metadata &&\n            metadata['__symbolic'] === 'class') {\n            var /** @type {?} */ transformedMeta_1 = { __symbolic: 'class', arity: metadata.arity };\n            return new ResolvedStaticSymbol(sourceSymbol, transformedMeta_1);\n        }\n        var /** @type {?} */ self = this;\n        var ReferenceTransformer = (function (_super) {\n            __extends(ReferenceTransformer, _super);\n            function ReferenceTransformer() {\n                return _super !== null && _super.apply(this, arguments) || this;\n            }\n            /**\n             * @param {?} map\n             * @param {?} functionParams\n             * @return {?}\n             */\n            ReferenceTransformer.prototype.visitStringMap = function (map, functionParams) {\n                var /** @type {?} */ symbolic = map['__symbolic'];\n                if (symbolic === 'function') {\n                    var /** @type {?} */ oldLen = functionParams.length;\n                    functionParams.push.apply(functionParams, (map['parameters'] || []));\n                    var /** @type {?} */ result = _super.prototype.visitStringMap.call(this, map, functionParams);\n                    functionParams.length = oldLen;\n                    return result;\n                }\n                else if (symbolic === 'reference') {\n                    var /** @type {?} */ module_1 = map['module'];\n                    var /** @type {?} */ name = map['name'] ? unescapeIdentifier(map['name']) : map['name'];\n                    if (!name) {\n                        return null;\n                    }\n                    var /** @type {?} */ filePath = void 0;\n                    if (module_1) {\n                        filePath = ((self.resolveModule(module_1, sourceSymbol.filePath)));\n                        if (!filePath) {\n                            return {\n                                __symbolic: 'error',\n                                message: \"Could not resolve \" + module_1 + \" relative to \" + sourceSymbol.filePath + \".\"\n                            };\n                        }\n                        return self.getStaticSymbol(filePath, name);\n                    }\n                    else if (functionParams.indexOf(name) >= 0) {\n                        // reference to a function parameter\n                        return { __symbolic: 'reference', name: name };\n                    }\n                    else {\n                        if (topLevelSymbolNames.has(name)) {\n                            return self.getStaticSymbol(topLevelPath, name);\n                        }\n                        // ambient value\n                        null;\n                    }\n                }\n                else {\n                    return _super.prototype.visitStringMap.call(this, map, functionParams);\n                }\n            };\n            return ReferenceTransformer;\n        }(ValueTransformer));\n        var /** @type {?} */ transformedMeta = visitValue(metadata, new ReferenceTransformer(), []);\n        if (transformedMeta instanceof StaticSymbol) {\n            return this.createExport(sourceSymbol, transformedMeta);\n        }\n        return new ResolvedStaticSymbol(sourceSymbol, transformedMeta);\n    };\n    /**\n     * @param {?} sourceSymbol\n     * @param {?} targetSymbol\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.createExport = function (sourceSymbol, targetSymbol) {\n        sourceSymbol.assertNoMembers();\n        targetSymbol.assertNoMembers();\n        if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath)) {\n            // This case is for an ng library importing symbols from a plain ts library\n            // transitively.\n            // Note: We rely on the fact that we discover symbols in the direction\n            // from source files to library files\n            this.importAs.set(targetSymbol, this.getImportAs(sourceSymbol) || sourceSymbol);\n        }\n        return new ResolvedStaticSymbol(sourceSymbol, targetSymbol);\n    };\n    /**\n     * @param {?} error\n     * @param {?=} context\n     * @param {?=} path\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.reportError = function (error, context, path) {\n        if (this.errorRecorder) {\n            this.errorRecorder(error, (context && context.filePath) || path);\n        }\n        else {\n            throw error;\n        }\n    };\n    /**\n     * @param {?} module an absolute path to a module file.\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getModuleMetadata = function (module) {\n        var /** @type {?} */ moduleMetadata = this.metadataCache.get(module);\n        if (!moduleMetadata) {\n            var /** @type {?} */ moduleMetadatas = this.host.getMetadataFor(module);\n            if (moduleMetadatas) {\n                var /** @type {?} */ maxVersion_1 = -1;\n                moduleMetadatas.forEach(function (md) {\n                    if (md['version'] > maxVersion_1) {\n                        maxVersion_1 = md['version'];\n                        moduleMetadata = md;\n                    }\n                });\n            }\n            if (!moduleMetadata) {\n                moduleMetadata =\n                    { __symbolic: 'module', version: SUPPORTED_SCHEMA_VERSION, module: module, metadata: {} };\n            }\n            if (moduleMetadata['version'] != SUPPORTED_SCHEMA_VERSION) {\n                var /** @type {?} */ errorMessage = moduleMetadata['version'] == 2 ?\n                    \"Unsupported metadata version \" + moduleMetadata['version'] + \" for module \" + module + \". This module should be compiled with a newer version of ngc\" :\n                    \"Metadata version mismatch for module \" + module + \", found version \" + moduleMetadata['version'] + \", expected \" + SUPPORTED_SCHEMA_VERSION;\n                this.reportError(new Error(errorMessage));\n            }\n            this.metadataCache.set(module, moduleMetadata);\n        }\n        return moduleMetadata;\n    };\n    /**\n     * @param {?} module\n     * @param {?} symbolName\n     * @param {?=} containingFile\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.getSymbolByModule = function (module, symbolName, containingFile) {\n        var /** @type {?} */ filePath = this.resolveModule(module, containingFile);\n        if (!filePath) {\n            this.reportError(new Error(\"Could not resolve module \" + module + (containingFile ? \" relative to $ {\\n            containingFile\\n          } \" : '')));\n            return this.getStaticSymbol(\"ERROR:\" + module, symbolName);\n        }\n        return this.getStaticSymbol(filePath, symbolName);\n    };\n    /**\n     * @param {?} module\n     * @param {?=} containingFile\n     * @return {?}\n     */\n    StaticSymbolResolver.prototype.resolveModule = function (module, containingFile) {\n        try {\n            return this.host.moduleNameToFileName(module, containingFile);\n        }\n        catch (e) {\n            console.error(\"Could not resolve module '\" + module + \"' relative to file \" + containingFile);\n            this.reportError(e, undefined, containingFile);\n        }\n        return null;\n    };\n    return StaticSymbolResolver;\n}());\n/**\n * @param {?} identifier\n * @return {?}\n */\nfunction unescapeIdentifier(identifier) {\n    return identifier.startsWith('___') ? identifier.substr(1) : identifier;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar AotSummaryResolver = (function () {\n    /**\n     * @param {?} host\n     * @param {?} staticSymbolCache\n     */\n    function AotSummaryResolver(host, staticSymbolCache) {\n        this.host = host;\n        this.staticSymbolCache = staticSymbolCache;\n        this.summaryCache = new Map();\n        this.loadedFilePaths = new Set();\n        this.importAs = new Map();\n    }\n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    AotSummaryResolver.prototype.isLibraryFile = function (filePath) {\n        // Note: We need to strip the .ngfactory. file path,\n        // so this method also works for generated files\n        // (for which host.isSourceFile will always return false).\n        return !this.host.isSourceFile(stripGeneratedFileSuffix(filePath));\n    };\n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    AotSummaryResolver.prototype.getLibraryFileName = function (filePath) { return this.host.getOutputFileName(filePath); };\n    /**\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    AotSummaryResolver.prototype.resolveSummary = function (staticSymbol) {\n        staticSymbol.assertNoMembers();\n        var /** @type {?} */ summary = this.summaryCache.get(staticSymbol);\n        if (!summary) {\n            this._loadSummaryFile(staticSymbol.filePath);\n            summary = ((this.summaryCache.get(staticSymbol)));\n        }\n        return summary;\n    };\n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    AotSummaryResolver.prototype.getSymbolsOf = function (filePath) {\n        this._loadSummaryFile(filePath);\n        return Array.from(this.summaryCache.keys()).filter(function (symbol) { return symbol.filePath === filePath; });\n    };\n    /**\n     * @param {?} staticSymbol\n     * @return {?}\n     */\n    AotSummaryResolver.prototype.getImportAs = function (staticSymbol) {\n        staticSymbol.assertNoMembers();\n        return ((this.importAs.get(staticSymbol)));\n    };\n    /**\n     * @param {?} summary\n     * @return {?}\n     */\n    AotSummaryResolver.prototype.addSummary = function (summary) { this.summaryCache.set(summary.symbol, summary); };\n    /**\n     * @param {?} filePath\n     * @return {?}\n     */\n    AotSummaryResolver.prototype._loadSummaryFile = function (filePath) {\n        var _this = this;\n        if (this.loadedFilePaths.has(filePath)) {\n            return;\n        }\n        this.loadedFilePaths.add(filePath);\n        if (this.isLibraryFile(filePath)) {\n            var /** @type {?} */ summaryFilePath = summaryFileName(filePath);\n            var /** @type {?} */ json = void 0;\n            try {\n                json = this.host.loadSummary(summaryFilePath);\n            }\n            catch (e) {\n                console.error(\"Error loading summary file \" + summaryFilePath);\n                throw e;\n            }\n            if (json) {\n                var _a = deserializeSummaries(this.staticSymbolCache, json), summaries = _a.summaries, importAs = _a.importAs;\n                summaries.forEach(function (summary) { return _this.summaryCache.set(summary.symbol, summary); });\n                importAs.forEach(function (importAs) {\n                    _this.importAs.set(importAs.symbol, _this.staticSymbolCache.get(ngfactoryFilePath(filePath), importAs.importAs));\n                });\n            }\n        }\n    };\n    return AotSummaryResolver;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Creates a new AotCompiler based on options and a host.\n * @param {?} compilerHost\n * @param {?} options\n * @return {?}\n */\nfunction createAotCompiler(compilerHost, options) {\n    var /** @type {?} */ translations = options.translations || '';\n    var /** @type {?} */ urlResolver = createOfflineCompileUrlResolver();\n    var /** @type {?} */ symbolCache = new StaticSymbolCache();\n    var /** @type {?} */ summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n    var /** @type {?} */ symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n    var /** @type {?} */ staticReflector = new StaticReflector(summaryResolver, symbolResolver);\n    var /** @type {?} */ console = new _angular_core.ɵConsole();\n    var /** @type {?} */ htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n    var /** @type {?} */ config = new CompilerConfig({\n        defaultEncapsulation: _angular_core.ViewEncapsulation.Emulated,\n        useJit: false,\n        enableLegacyTemplate: options.enableLegacyTemplate !== false,\n        missingTranslation: options.missingTranslation,\n    });\n    var /** @type {?} */ normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);\n    var /** @type {?} */ expressionParser = new Parser(new Lexer());\n    var /** @type {?} */ elementSchemaRegistry = new DomElementSchemaRegistry();\n    var /** @type {?} */ tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n    var /** @type {?} */ resolver = new CompileMetadataResolver(config, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector);\n    // TODO(vicb): do not pass options.i18nFormat here\n    var /** @type {?} */ viewCompiler = new ViewCompiler(config, staticReflector, elementSchemaRegistry);\n    var /** @type {?} */ compiler = new AotCompiler(config, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, new NgModuleCompiler(staticReflector), new TypeScriptEmitter(), summaryResolver, options.locale || null, options.i18nFormat || null, options.enableSummariesForJit || null, symbolResolver);\n    return { compiler: compiler, reflector: staticReflector };\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} statements\n * @return {?}\n */\nfunction interpretStatements(statements) {\n    var /** @type {?} */ ctx = new _ExecutionContext(null, null, null, new Map());\n    var /** @type {?} */ visitor = new StatementInterpreter();\n    visitor.visitAllStatements(statements, ctx);\n    var /** @type {?} */ result = {};\n    ctx.exports.forEach(function (exportName) { result[exportName] = ctx.vars.get(exportName); });\n    return result;\n}\n/**\n * @param {?} varNames\n * @param {?} varValues\n * @param {?} statements\n * @param {?} ctx\n * @param {?} visitor\n * @return {?}\n */\nfunction _executeFunctionStatements(varNames, varValues, statements, ctx, visitor) {\n    var /** @type {?} */ childCtx = ctx.createChildWihtLocalVars();\n    for (var /** @type {?} */ i = 0; i < varNames.length; i++) {\n        childCtx.vars.set(varNames[i], varValues[i]);\n    }\n    var /** @type {?} */ result = visitor.visitAllStatements(statements, childCtx);\n    return result ? result.value : null;\n}\nvar _ExecutionContext = (function () {\n    /**\n     * @param {?} parent\n     * @param {?} instance\n     * @param {?} className\n     * @param {?} vars\n     */\n    function _ExecutionContext(parent, instance, className, vars) {\n        this.parent = parent;\n        this.instance = instance;\n        this.className = className;\n        this.vars = vars;\n        this.exports = [];\n    }\n    /**\n     * @return {?}\n     */\n    _ExecutionContext.prototype.createChildWihtLocalVars = function () {\n        return new _ExecutionContext(this, this.instance, this.className, new Map());\n    };\n    return _ExecutionContext;\n}());\nvar ReturnValue = (function () {\n    /**\n     * @param {?} value\n     */\n    function ReturnValue(value) {\n        this.value = value;\n    }\n    return ReturnValue;\n}());\n/**\n * @param {?} _classStmt\n * @param {?} _ctx\n * @param {?} _visitor\n * @return {?}\n */\nfunction createDynamicClass(_classStmt, _ctx, _visitor) {\n    var /** @type {?} */ propertyDescriptors = {};\n    _classStmt.getters.forEach(function (getter) {\n        // Note: use `function` instead of arrow function to capture `this`\n        propertyDescriptors[getter.name] = {\n            configurable: false,\n            get: function () {\n                var /** @type {?} */ instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);\n                return _executeFunctionStatements([], [], getter.body, instanceCtx, _visitor);\n            }\n        };\n    });\n    _classStmt.methods.forEach(function (method) {\n        var /** @type {?} */ paramNames = method.params.map(function (param) { return param.name; });\n        // Note: use `function` instead of arrow function to capture `this`\n        propertyDescriptors[((method.name))] = {\n            writable: false,\n            configurable: false,\n            value: function () {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                var /** @type {?} */ instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);\n                return _executeFunctionStatements(paramNames, args, method.body, instanceCtx, _visitor);\n            }\n        };\n    });\n    var /** @type {?} */ ctorParamNames = _classStmt.constructorMethod.params.map(function (param) { return param.name; });\n    // Note: use `function` instead of arrow function to capture `this`\n    var /** @type {?} */ ctor = function () {\n        var _this = this;\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        var /** @type {?} */ instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);\n        _classStmt.fields.forEach(function (field) { _this[field.name] = undefined; });\n        _executeFunctionStatements(ctorParamNames, args, _classStmt.constructorMethod.body, instanceCtx, _visitor);\n    };\n    var /** @type {?} */ superClass = _classStmt.parent ? _classStmt.parent.visitExpression(_visitor, _ctx) : Object;\n    ctor.prototype = Object.create(superClass.prototype, propertyDescriptors);\n    return ctor;\n}\nvar StatementInterpreter = (function () {\n    function StatementInterpreter() {\n    }\n    /**\n     * @param {?} ast\n     * @return {?}\n     */\n    StatementInterpreter.prototype.debugAst = function (ast) { return debugOutputAstAsTypeScript(ast); };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n        ctx.vars.set(stmt.name, stmt.value.visitExpression(this, ctx));\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            ctx.exports.push(stmt.name);\n        }\n        return null;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitWriteVarExpr = function (expr, ctx) {\n        var /** @type {?} */ value = expr.value.visitExpression(this, ctx);\n        var /** @type {?} */ currCtx = ctx;\n        while (currCtx != null) {\n            if (currCtx.vars.has(expr.name)) {\n                currCtx.vars.set(expr.name, value);\n                return value;\n            }\n            currCtx = ((currCtx.parent));\n        }\n        throw new Error(\"Not declared variable \" + expr.name);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitReadVarExpr = function (ast, ctx) {\n        var /** @type {?} */ varName = ((ast.name));\n        if (ast.builtin != null) {\n            switch (ast.builtin) {\n                case BuiltinVar.Super:\n                    return ctx.instance.__proto__;\n                case BuiltinVar.This:\n                    return ctx.instance;\n                case BuiltinVar.CatchError:\n                    varName = CATCH_ERROR_VAR$2;\n                    break;\n                case BuiltinVar.CatchStack:\n                    varName = CATCH_STACK_VAR$2;\n                    break;\n                default:\n                    throw new Error(\"Unknown builtin variable \" + ast.builtin);\n            }\n        }\n        var /** @type {?} */ currCtx = ctx;\n        while (currCtx != null) {\n            if (currCtx.vars.has(varName)) {\n                return currCtx.vars.get(varName);\n            }\n            currCtx = ((currCtx.parent));\n        }\n        throw new Error(\"Not declared variable \" + varName);\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitWriteKeyExpr = function (expr, ctx) {\n        var /** @type {?} */ receiver = expr.receiver.visitExpression(this, ctx);\n        var /** @type {?} */ index = expr.index.visitExpression(this, ctx);\n        var /** @type {?} */ value = expr.value.visitExpression(this, ctx);\n        receiver[index] = value;\n        return value;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitWritePropExpr = function (expr, ctx) {\n        var /** @type {?} */ receiver = expr.receiver.visitExpression(this, ctx);\n        var /** @type {?} */ value = expr.value.visitExpression(this, ctx);\n        receiver[expr.name] = value;\n        return value;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitInvokeMethodExpr = function (expr, ctx) {\n        var /** @type {?} */ receiver = expr.receiver.visitExpression(this, ctx);\n        var /** @type {?} */ args = this.visitAllExpressions(expr.args, ctx);\n        var /** @type {?} */ result;\n        if (expr.builtin != null) {\n            switch (expr.builtin) {\n                case BuiltinMethod.ConcatArray:\n                    result = receiver.concat.apply(receiver, args);\n                    break;\n                case BuiltinMethod.SubscribeObservable:\n                    result = receiver.subscribe({ next: args[0] });\n                    break;\n                case BuiltinMethod.Bind:\n                    result = receiver.bind.apply(receiver, args);\n                    break;\n                default:\n                    throw new Error(\"Unknown builtin method \" + expr.builtin);\n            }\n        }\n        else {\n            result = receiver[((expr.name))].apply(receiver, args);\n        }\n        return result;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitInvokeFunctionExpr = function (stmt, ctx) {\n        var /** @type {?} */ args = this.visitAllExpressions(stmt.args, ctx);\n        var /** @type {?} */ fnExpr = stmt.fn;\n        if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === BuiltinVar.Super) {\n            ctx.instance.constructor.prototype.constructor.apply(ctx.instance, args);\n            return null;\n        }\n        else {\n            var /** @type {?} */ fn$$1 = stmt.fn.visitExpression(this, ctx);\n            return fn$$1.apply(null, args);\n        }\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitReturnStmt = function (stmt, ctx) {\n        return new ReturnValue(stmt.value.visitExpression(this, ctx));\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n        var /** @type {?} */ clazz = createDynamicClass(stmt, ctx, this);\n        ctx.vars.set(stmt.name, clazz);\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            ctx.exports.push(stmt.name);\n        }\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitExpressionStmt = function (stmt, ctx) {\n        return stmt.expr.visitExpression(this, ctx);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitIfStmt = function (stmt, ctx) {\n        var /** @type {?} */ condition = stmt.condition.visitExpression(this, ctx);\n        if (condition) {\n            return this.visitAllStatements(stmt.trueCase, ctx);\n        }\n        else if (stmt.falseCase != null) {\n            return this.visitAllStatements(stmt.falseCase, ctx);\n        }\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitTryCatchStmt = function (stmt, ctx) {\n        try {\n            return this.visitAllStatements(stmt.bodyStmts, ctx);\n        }\n        catch (e) {\n            var /** @type {?} */ childCtx = ctx.createChildWihtLocalVars();\n            childCtx.vars.set(CATCH_ERROR_VAR$2, e);\n            childCtx.vars.set(CATCH_STACK_VAR$2, e.stack);\n            return this.visitAllStatements(stmt.catchStmts, childCtx);\n        }\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitThrowStmt = function (stmt, ctx) {\n        throw stmt.error.visitExpression(this, ctx);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?=} context\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitCommentStmt = function (stmt, context) { return null; };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitInstantiateExpr = function (ast, ctx) {\n        var /** @type {?} */ args = this.visitAllExpressions(ast.args, ctx);\n        var /** @type {?} */ clazz = ast.classExpr.visitExpression(this, ctx);\n        return new (clazz.bind.apply(clazz, [void 0].concat(args)))();\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitLiteralExpr = function (ast, ctx) { return ast.value; };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitExternalExpr = function (ast, ctx) { return ast.value.runtime; };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitConditionalExpr = function (ast, ctx) {\n        if (ast.condition.visitExpression(this, ctx)) {\n            return ast.trueCase.visitExpression(this, ctx);\n        }\n        else if (ast.falseCase != null) {\n            return ast.falseCase.visitExpression(this, ctx);\n        }\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitNotExpr = function (ast, ctx) {\n        return !ast.condition.visitExpression(this, ctx);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitAssertNotNullExpr = function (ast, ctx) {\n        return ast.condition.visitExpression(this, ctx);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitCastExpr = function (ast, ctx) {\n        return ast.value.visitExpression(this, ctx);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitFunctionExpr = function (ast, ctx) {\n        var /** @type {?} */ paramNames = ast.params.map(function (param) { return param.name; });\n        return _declareFn(paramNames, ast.statements, ctx, this);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n        var /** @type {?} */ paramNames = stmt.params.map(function (param) { return param.name; });\n        ctx.vars.set(stmt.name, _declareFn(paramNames, stmt.statements, ctx, this));\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            ctx.exports.push(stmt.name);\n        }\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitBinaryOperatorExpr = function (ast, ctx) {\n        var _this = this;\n        var /** @type {?} */ lhs = function () { return ast.lhs.visitExpression(_this, ctx); };\n        var /** @type {?} */ rhs = function () { return ast.rhs.visitExpression(_this, ctx); };\n        switch (ast.operator) {\n            case BinaryOperator.Equals:\n                return lhs() == rhs();\n            case BinaryOperator.Identical:\n                return lhs() === rhs();\n            case BinaryOperator.NotEquals:\n                return lhs() != rhs();\n            case BinaryOperator.NotIdentical:\n                return lhs() !== rhs();\n            case BinaryOperator.And:\n                return lhs() && rhs();\n            case BinaryOperator.Or:\n                return lhs() || rhs();\n            case BinaryOperator.Plus:\n                return lhs() + rhs();\n            case BinaryOperator.Minus:\n                return lhs() - rhs();\n            case BinaryOperator.Divide:\n                return lhs() / rhs();\n            case BinaryOperator.Multiply:\n                return lhs() * rhs();\n            case BinaryOperator.Modulo:\n                return lhs() % rhs();\n            case BinaryOperator.Lower:\n                return lhs() < rhs();\n            case BinaryOperator.LowerEquals:\n                return lhs() <= rhs();\n            case BinaryOperator.Bigger:\n                return lhs() > rhs();\n            case BinaryOperator.BiggerEquals:\n                return lhs() >= rhs();\n            default:\n                throw new Error(\"Unknown operator \" + ast.operator);\n        }\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitReadPropExpr = function (ast, ctx) {\n        var /** @type {?} */ result;\n        var /** @type {?} */ receiver = ast.receiver.visitExpression(this, ctx);\n        result = receiver[ast.name];\n        return result;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitReadKeyExpr = function (ast, ctx) {\n        var /** @type {?} */ receiver = ast.receiver.visitExpression(this, ctx);\n        var /** @type {?} */ prop = ast.index.visitExpression(this, ctx);\n        return receiver[prop];\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitLiteralArrayExpr = function (ast, ctx) {\n        return this.visitAllExpressions(ast.entries, ctx);\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitLiteralMapExpr = function (ast, ctx) {\n        var _this = this;\n        var /** @type {?} */ result = {};\n        ast.entries.forEach(function (entry) { return ((result))[entry.key] = entry.value.visitExpression(_this, ctx); });\n        return result;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} context\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitCommaExpr = function (ast, context) {\n        var /** @type {?} */ values = this.visitAllExpressions(ast.parts, context);\n        return values[values.length - 1];\n    };\n    /**\n     * @param {?} expressions\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitAllExpressions = function (expressions, ctx) {\n        var _this = this;\n        return expressions.map(function (expr) { return expr.visitExpression(_this, ctx); });\n    };\n    /**\n     * @param {?} statements\n     * @param {?} ctx\n     * @return {?}\n     */\n    StatementInterpreter.prototype.visitAllStatements = function (statements, ctx) {\n        for (var /** @type {?} */ i = 0; i < statements.length; i++) {\n            var /** @type {?} */ stmt = statements[i];\n            var /** @type {?} */ val = stmt.visitStatement(this, ctx);\n            if (val instanceof ReturnValue) {\n                return val;\n            }\n        }\n        return null;\n    };\n    return StatementInterpreter;\n}());\n/**\n * @param {?} varNames\n * @param {?} statements\n * @param {?} ctx\n * @param {?} visitor\n * @return {?}\n */\nfunction _declareFn(varNames, statements, ctx, visitor) {\n    return function () {\n        var args = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            args[_i] = arguments[_i];\n        }\n        return _executeFunctionStatements(varNames, args, statements, ctx, visitor);\n    };\n}\nvar CATCH_ERROR_VAR$2 = 'error';\nvar CATCH_STACK_VAR$2 = 'stack';\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @abstract\n */\nvar AbstractJsEmitterVisitor = (function (_super) {\n    __extends(AbstractJsEmitterVisitor, _super);\n    function AbstractJsEmitterVisitor() {\n        return _super.call(this, false) || this;\n    }\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n        var _this = this;\n        ctx.pushClass(stmt);\n        this._visitClassConstructor(stmt, ctx);\n        if (stmt.parent != null) {\n            ctx.print(stmt, stmt.name + \".prototype = Object.create(\");\n            stmt.parent.visitExpression(this, ctx);\n            ctx.println(stmt, \".prototype);\");\n        }\n        stmt.getters.forEach(function (getter) { return _this._visitClassGetter(stmt, getter, ctx); });\n        stmt.methods.forEach(function (method) { return _this._visitClassMethod(stmt, method, ctx); });\n        ctx.popClass();\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype._visitClassConstructor = function (stmt, ctx) {\n        ctx.print(stmt, \"function \" + stmt.name + \"(\");\n        if (stmt.constructorMethod != null) {\n            this._visitParams(stmt.constructorMethod.params, ctx);\n        }\n        ctx.println(stmt, \") {\");\n        ctx.incIndent();\n        if (stmt.constructorMethod != null) {\n            if (stmt.constructorMethod.body.length > 0) {\n                ctx.println(stmt, \"var self = this;\");\n                this.visitAllStatements(stmt.constructorMethod.body, ctx);\n            }\n        }\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} getter\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype._visitClassGetter = function (stmt, getter, ctx) {\n        ctx.println(stmt, \"Object.defineProperty(\" + stmt.name + \".prototype, '\" + getter.name + \"', { get: function() {\");\n        ctx.incIndent();\n        if (getter.body.length > 0) {\n            ctx.println(stmt, \"var self = this;\");\n            this.visitAllStatements(getter.body, ctx);\n        }\n        ctx.decIndent();\n        ctx.println(stmt, \"}});\");\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} method\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype._visitClassMethod = function (stmt, method, ctx) {\n        ctx.print(stmt, stmt.name + \".prototype.\" + method.name + \" = function(\");\n        this._visitParams(method.params, ctx);\n        ctx.println(stmt, \") {\");\n        ctx.incIndent();\n        if (method.body.length > 0) {\n            ctx.println(stmt, \"var self = this;\");\n            this.visitAllStatements(method.body, ctx);\n        }\n        ctx.decIndent();\n        ctx.println(stmt, \"};\");\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitReadVarExpr = function (ast, ctx) {\n        if (ast.builtin === BuiltinVar.This) {\n            ctx.print(ast, 'self');\n        }\n        else if (ast.builtin === BuiltinVar.Super) {\n            throw new Error(\"'super' needs to be handled at a parent ast node, not at the variable level!\");\n        }\n        else {\n            _super.prototype.visitReadVarExpr.call(this, ast, ctx);\n        }\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n        ctx.print(stmt, \"var \" + stmt.name + \" = \");\n        stmt.value.visitExpression(this, ctx);\n        ctx.println(stmt, \";\");\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitCastExpr = function (ast, ctx) {\n        ast.value.visitExpression(this, ctx);\n        return null;\n    };\n    /**\n     * @param {?} expr\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr, ctx) {\n        var /** @type {?} */ fnExpr = expr.fn;\n        if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === BuiltinVar.Super) {\n            ((((ctx.currentClass)).parent)).visitExpression(this, ctx);\n            ctx.print(expr, \".call(this\");\n            if (expr.args.length > 0) {\n                ctx.print(expr, \", \");\n                this.visitAllExpressions(expr.args, ctx, ',');\n            }\n            ctx.print(expr, \")\");\n        }\n        else {\n            _super.prototype.visitInvokeFunctionExpr.call(this, expr, ctx);\n        }\n        return null;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) {\n        ctx.print(ast, \"function(\");\n        this._visitParams(ast.params, ctx);\n        ctx.println(ast, \") {\");\n        ctx.incIndent();\n        this.visitAllStatements(ast.statements, ctx);\n        ctx.decIndent();\n        ctx.print(ast, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n        ctx.print(stmt, \"function \" + stmt.name + \"(\");\n        this._visitParams(stmt.params, ctx);\n        ctx.println(stmt, \") {\");\n        ctx.incIndent();\n        this.visitAllStatements(stmt.statements, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) {\n        ctx.println(stmt, \"try {\");\n        ctx.incIndent();\n        this.visitAllStatements(stmt.bodyStmts, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"} catch (\" + CATCH_ERROR_VAR$1.name + \") {\");\n        ctx.incIndent();\n        var /** @type {?} */ catchStmts = [/** @type {?} */ (CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack')).toDeclStmt(null, [\n                StmtModifier.Final\n            ]))].concat(stmt.catchStmts);\n        this.visitAllStatements(catchStmts, ctx);\n        ctx.decIndent();\n        ctx.println(stmt, \"}\");\n        return null;\n    };\n    /**\n     * @param {?} params\n     * @param {?} ctx\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype._visitParams = function (params, ctx) {\n        this.visitAllObjects(function (param) { return ctx.print(null, param.name); }, params, ctx, ',');\n    };\n    /**\n     * @param {?} method\n     * @return {?}\n     */\n    AbstractJsEmitterVisitor.prototype.getBuiltinMethodName = function (method) {\n        var /** @type {?} */ name;\n        switch (method) {\n            case BuiltinMethod.ConcatArray:\n                name = 'concat';\n                break;\n            case BuiltinMethod.SubscribeObservable:\n                name = 'subscribe';\n                break;\n            case BuiltinMethod.Bind:\n                name = 'bind';\n                break;\n            default:\n                throw new Error(\"Unknown builtin method: \" + method);\n        }\n        return name;\n    };\n    return AbstractJsEmitterVisitor;\n}(AbstractEmitterVisitor));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} sourceUrl\n * @param {?} ctx\n * @param {?} vars\n * @return {?}\n */\nfunction evalExpression(sourceUrl$$1, ctx, vars) {\n    var /** @type {?} */ fnBody = ctx.toSource() + \"\\n//# sourceURL=\" + sourceUrl$$1;\n    var /** @type {?} */ fnArgNames = [];\n    var /** @type {?} */ fnArgValues = [];\n    for (var /** @type {?} */ argName in vars) {\n        fnArgNames.push(argName);\n        fnArgValues.push(vars[argName]);\n    }\n    if (_angular_core.isDevMode()) {\n        // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise\n        // E.g. ```\n        // function anonymous(a,b,c\n        // /**/) { ... }```\n        // We don't want to hard code this fact, so we auto detect it via an empty function first.\n        var /** @type {?} */ emptyFn = new (Function.bind.apply(Function, [void 0].concat(fnArgNames.concat('return null;'))))().toString();\n        var /** @type {?} */ headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\\n').length - 1;\n        fnBody += \"\\n\" + ctx.toSourceMapGenerator(sourceUrl$$1, sourceUrl$$1, headerLines).toJsComment();\n    }\n    return new (Function.bind.apply(Function, [void 0].concat(fnArgNames.concat(fnBody))))().apply(void 0, fnArgValues);\n}\n/**\n * @param {?} sourceUrl\n * @param {?} statements\n * @return {?}\n */\nfunction jitStatements(sourceUrl$$1, statements) {\n    var /** @type {?} */ converter = new JitEmitterVisitor();\n    var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();\n    converter.visitAllStatements(statements, ctx);\n    converter.createReturnStmt(ctx);\n    return evalExpression(sourceUrl$$1, ctx, converter.getArgs());\n}\nvar JitEmitterVisitor = (function (_super) {\n    __extends(JitEmitterVisitor, _super);\n    function JitEmitterVisitor() {\n        var _this = _super.apply(this, arguments) || this;\n        _this._evalArgNames = [];\n        _this._evalArgValues = [];\n        _this._evalExportedVars = [];\n        return _this;\n    }\n    /**\n     * @param {?} ctx\n     * @return {?}\n     */\n    JitEmitterVisitor.prototype.createReturnStmt = function (ctx) {\n        var /** @type {?} */ stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map(function (resultVar) { return new LiteralMapEntry(resultVar, variable(resultVar)); })));\n        stmt.visitStatement(this, ctx);\n    };\n    /**\n     * @return {?}\n     */\n    JitEmitterVisitor.prototype.getArgs = function () {\n        var /** @type {?} */ result = {};\n        for (var /** @type {?} */ i = 0; i < this._evalArgNames.length; i++) {\n            result[this._evalArgNames[i]] = this._evalArgValues[i];\n        }\n        return result;\n    };\n    /**\n     * @param {?} ast\n     * @param {?} ctx\n     * @return {?}\n     */\n    JitEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) {\n        var /** @type {?} */ value = ast.value.runtime;\n        var /** @type {?} */ id = this._evalArgValues.indexOf(value);\n        if (id === -1) {\n            id = this._evalArgValues.length;\n            this._evalArgValues.push(value);\n            var /** @type {?} */ name = identifierName({ reference: ast.value.runtime }) || 'val';\n            this._evalArgNames.push(\"jit_\" + name + id);\n        }\n        ctx.print(ast, this._evalArgNames[id]);\n        return null;\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    JitEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            this._evalExportedVars.push(stmt.name);\n        }\n        return _super.prototype.visitDeclareVarStmt.call(this, stmt, ctx);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    JitEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            this._evalExportedVars.push(stmt.name);\n        }\n        return _super.prototype.visitDeclareFunctionStmt.call(this, stmt, ctx);\n    };\n    /**\n     * @param {?} stmt\n     * @param {?} ctx\n     * @return {?}\n     */\n    JitEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {\n        if (stmt.hasModifier(StmtModifier.Exported)) {\n            this._evalExportedVars.push(stmt.name);\n        }\n        return _super.prototype.visitDeclareClassStmt.call(this, stmt, ctx);\n    };\n    return JitEmitterVisitor;\n}(AbstractJsEmitterVisitor));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * An internal module of the Angular compiler that begins with component types,\n * extracts templates, and eventually produces a compiled version of the component\n * ready for linking into an application.\n *\n * \\@security When compiling templates at runtime, you must ensure that the entire template comes\n * from a trusted source. Attacker-controlled data introduced by a template could expose your\n * application to XSS risks.  For more detail, see the [Security Guide](http://g.co/ng/security).\n */\nvar JitCompiler = (function () {\n    /**\n     * @param {?} _injector\n     * @param {?} _metadataResolver\n     * @param {?} _templateParser\n     * @param {?} _styleCompiler\n     * @param {?} _viewCompiler\n     * @param {?} _ngModuleCompiler\n     * @param {?} _summaryResolver\n     * @param {?} _compilerConfig\n     * @param {?} _console\n     */\n    function JitCompiler(_injector, _metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _summaryResolver, _compilerConfig, _console) {\n        this._injector = _injector;\n        this._metadataResolver = _metadataResolver;\n        this._templateParser = _templateParser;\n        this._styleCompiler = _styleCompiler;\n        this._viewCompiler = _viewCompiler;\n        this._ngModuleCompiler = _ngModuleCompiler;\n        this._summaryResolver = _summaryResolver;\n        this._compilerConfig = _compilerConfig;\n        this._console = _console;\n        this._compiledTemplateCache = new Map();\n        this._compiledHostTemplateCache = new Map();\n        this._compiledDirectiveWrapperCache = new Map();\n        this._compiledNgModuleCache = new Map();\n        this._sharedStylesheetCount = 0;\n    }\n    Object.defineProperty(JitCompiler.prototype, \"injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._injector; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    JitCompiler.prototype.compileModuleSync = function (moduleType) {\n        return SyncAsync.assertSync(this._compileModuleAndComponents(moduleType, true));\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    JitCompiler.prototype.compileModuleAsync = function (moduleType) {\n        return Promise.resolve(this._compileModuleAndComponents(moduleType, false));\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    JitCompiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {\n        return SyncAsync.assertSync(this._compileModuleAndAllComponents(moduleType, true));\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    JitCompiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {\n        return Promise.resolve(this._compileModuleAndAllComponents(moduleType, false));\n    };\n    /**\n     * @param {?} component\n     * @return {?}\n     */\n    JitCompiler.prototype.getNgContentSelectors = function (component) {\n        this._console.warn('Compiler.getNgContentSelectors is deprecated. Use ComponentFactory.ngContentSelectors instead!');\n        var /** @type {?} */ template = this._compiledTemplateCache.get(component);\n        if (!template) {\n            throw new Error(\"The component \" + _angular_core.ɵstringify(component) + \" is not yet compiled!\");\n        }\n        return ((template.compMeta.template)).ngContentSelectors;\n    };\n    /**\n     * @template T\n     * @param {?} component\n     * @return {?}\n     */\n    JitCompiler.prototype.getComponentFactory = function (component) {\n        var /** @type {?} */ summary = this._metadataResolver.getDirectiveSummary(component);\n        return (summary.componentFactory);\n    };\n    /**\n     * @param {?} summaries\n     * @return {?}\n     */\n    JitCompiler.prototype.loadAotSummaries = function (summaries) {\n        var _this = this;\n        this.clearCache();\n        flattenSummaries(summaries).forEach(function (summary) {\n            _this._summaryResolver.addSummary({ symbol: summary.type.reference, metadata: null, type: summary });\n        });\n    };\n    /**\n     * @param {?} ref\n     * @return {?}\n     */\n    JitCompiler.prototype.hasAotSummary = function (ref) { return !!this._summaryResolver.resolveSummary(ref); };\n    /**\n     * @param {?} ids\n     * @return {?}\n     */\n    JitCompiler.prototype._filterJitIdentifiers = function (ids) {\n        var _this = this;\n        return ids.map(function (mod) { return mod.reference; }).filter(function (ref) { return !_this.hasAotSummary(ref); });\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @param {?} isSync\n     * @return {?}\n     */\n    JitCompiler.prototype._compileModuleAndComponents = function (moduleType, isSync) {\n        var _this = this;\n        return SyncAsync.then(this._loadModules(moduleType, isSync), function () {\n            _this._compileComponents(moduleType, null);\n            return _this._compileModule(moduleType);\n        });\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @param {?} isSync\n     * @return {?}\n     */\n    JitCompiler.prototype._compileModuleAndAllComponents = function (moduleType, isSync) {\n        var _this = this;\n        return SyncAsync.then(this._loadModules(moduleType, isSync), function () {\n            var /** @type {?} */ componentFactories = [];\n            _this._compileComponents(moduleType, componentFactories);\n            return new _angular_core.ModuleWithComponentFactories(_this._compileModule(moduleType), componentFactories);\n        });\n    };\n    /**\n     * @param {?} mainModule\n     * @param {?} isSync\n     * @return {?}\n     */\n    JitCompiler.prototype._loadModules = function (mainModule, isSync) {\n        var _this = this;\n        var /** @type {?} */ loading = [];\n        var /** @type {?} */ mainNgModule = ((this._metadataResolver.getNgModuleMetadata(mainModule)));\n        // Note: for runtime compilation, we want to transitively compile all modules,\n        // so we also need to load the declared directives / pipes for all nested modules.\n        this._filterJitIdentifiers(mainNgModule.transitiveModule.modules).forEach(function (nestedNgModule) {\n            // getNgModuleMetadata only returns null if the value passed in is not an NgModule\n            var /** @type {?} */ moduleMeta = ((_this._metadataResolver.getNgModuleMetadata(nestedNgModule)));\n            _this._filterJitIdentifiers(moduleMeta.declaredDirectives).forEach(function (ref) {\n                var /** @type {?} */ promise = _this._metadataResolver.loadDirectiveMetadata(moduleMeta.type.reference, ref, isSync);\n                if (promise) {\n                    loading.push(promise);\n                }\n            });\n            _this._filterJitIdentifiers(moduleMeta.declaredPipes)\n                .forEach(function (ref) { return _this._metadataResolver.getOrLoadPipeMetadata(ref); });\n        });\n        return SyncAsync.all(loading);\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    JitCompiler.prototype._compileModule = function (moduleType) {\n        var _this = this;\n        var /** @type {?} */ ngModuleFactory = ((this._compiledNgModuleCache.get(moduleType)));\n        if (!ngModuleFactory) {\n            var /** @type {?} */ moduleMeta_1 = ((this._metadataResolver.getNgModuleMetadata(moduleType)));\n            // Always provide a bound Compiler\n            var /** @type {?} */ extraProviders = [this._metadataResolver.getProviderMetadata(new ProviderMeta(_angular_core.Compiler, { useFactory: function () { return new ModuleBoundCompiler(_this, moduleMeta_1.type.reference); } }))];\n            var /** @type {?} */ outputCtx = createOutputContext();\n            var /** @type {?} */ compileResult = this._ngModuleCompiler.compile(outputCtx, moduleMeta_1, extraProviders);\n            if (!this._compilerConfig.useJit) {\n                ngModuleFactory =\n                    interpretStatements(outputCtx.statements)[compileResult.ngModuleFactoryVar];\n            }\n            else {\n                ngModuleFactory = jitStatements(ngModuleJitUrl(moduleMeta_1), outputCtx.statements)[compileResult.ngModuleFactoryVar];\n            }\n            this._compiledNgModuleCache.set(moduleMeta_1.type.reference, ngModuleFactory);\n        }\n        return ngModuleFactory;\n    };\n    /**\n     * \\@internal\n     * @param {?} mainModule\n     * @param {?} allComponentFactories\n     * @return {?}\n     */\n    JitCompiler.prototype._compileComponents = function (mainModule, allComponentFactories) {\n        var _this = this;\n        var /** @type {?} */ ngModule = ((this._metadataResolver.getNgModuleMetadata(mainModule)));\n        var /** @type {?} */ moduleByJitDirective = new Map();\n        var /** @type {?} */ templates = new Set();\n        var /** @type {?} */ transJitModules = this._filterJitIdentifiers(ngModule.transitiveModule.modules);\n        transJitModules.forEach(function (localMod) {\n            var /** @type {?} */ localModuleMeta = ((_this._metadataResolver.getNgModuleMetadata(localMod)));\n            _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {\n                moduleByJitDirective.set(dirRef, localModuleMeta);\n                var /** @type {?} */ dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);\n                if (dirMeta.isComponent) {\n                    templates.add(_this._createCompiledTemplate(dirMeta, localModuleMeta));\n                    if (allComponentFactories) {\n                        var /** @type {?} */ template = _this._createCompiledHostTemplate(dirMeta.type.reference, localModuleMeta);\n                        templates.add(template);\n                        allComponentFactories.push(/** @type {?} */ (dirMeta.componentFactory));\n                    }\n                }\n            });\n        });\n        transJitModules.forEach(function (localMod) {\n            var /** @type {?} */ localModuleMeta = ((_this._metadataResolver.getNgModuleMetadata(localMod)));\n            _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {\n                var /** @type {?} */ dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);\n                if (dirMeta.isComponent) {\n                    dirMeta.entryComponents.forEach(function (entryComponentType) {\n                        var /** @type {?} */ moduleMeta = ((moduleByJitDirective.get(entryComponentType.componentType)));\n                        templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));\n                    });\n                }\n            });\n            localModuleMeta.entryComponents.forEach(function (entryComponentType) {\n                if (!_this.hasAotSummary(entryComponentType.componentType.reference)) {\n                    var /** @type {?} */ moduleMeta = ((moduleByJitDirective.get(entryComponentType.componentType)));\n                    templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));\n                }\n            });\n        });\n        templates.forEach(function (template) { return _this._compileTemplate(template); });\n    };\n    /**\n     * @param {?} type\n     * @return {?}\n     */\n    JitCompiler.prototype.clearCacheFor = function (type) {\n        this._compiledNgModuleCache.delete(type);\n        this._metadataResolver.clearCacheFor(type);\n        this._compiledHostTemplateCache.delete(type);\n        var /** @type {?} */ compiledTemplate = this._compiledTemplateCache.get(type);\n        if (compiledTemplate) {\n            this._compiledTemplateCache.delete(type);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    JitCompiler.prototype.clearCache = function () {\n        this._metadataResolver.clearCache();\n        this._compiledTemplateCache.clear();\n        this._compiledHostTemplateCache.clear();\n        this._compiledNgModuleCache.clear();\n    };\n    /**\n     * @param {?} compType\n     * @param {?} ngModule\n     * @return {?}\n     */\n    JitCompiler.prototype._createCompiledHostTemplate = function (compType, ngModule) {\n        if (!ngModule) {\n            throw new Error(\"Component \" + _angular_core.ɵstringify(compType) + \" is not part of any NgModule or the module has not been imported into your module.\");\n        }\n        var /** @type {?} */ compiledTemplate = this._compiledHostTemplateCache.get(compType);\n        if (!compiledTemplate) {\n            var /** @type {?} */ compMeta = this._metadataResolver.getDirectiveMetadata(compType);\n            assertComponent(compMeta);\n            var /** @type {?} */ componentFactory = (compMeta.componentFactory);\n            var /** @type {?} */ hostClass = this._metadataResolver.getHostComponentType(compType);\n            var /** @type {?} */ hostMeta = createHostComponentMeta(hostClass, compMeta, /** @type {?} */ (_angular_core.ɵgetComponentViewDefinitionFactory(componentFactory)));\n            compiledTemplate =\n                new CompiledTemplate(true, compMeta.type, hostMeta, ngModule, [compMeta.type]);\n            this._compiledHostTemplateCache.set(compType, compiledTemplate);\n        }\n        return compiledTemplate;\n    };\n    /**\n     * @param {?} compMeta\n     * @param {?} ngModule\n     * @return {?}\n     */\n    JitCompiler.prototype._createCompiledTemplate = function (compMeta, ngModule) {\n        var /** @type {?} */ compiledTemplate = this._compiledTemplateCache.get(compMeta.type.reference);\n        if (!compiledTemplate) {\n            assertComponent(compMeta);\n            compiledTemplate = new CompiledTemplate(false, compMeta.type, compMeta, ngModule, ngModule.transitiveModule.directives);\n            this._compiledTemplateCache.set(compMeta.type.reference, compiledTemplate);\n        }\n        return compiledTemplate;\n    };\n    /**\n     * @param {?} template\n     * @return {?}\n     */\n    JitCompiler.prototype._compileTemplate = function (template) {\n        var _this = this;\n        if (template.isCompiled) {\n            return;\n        }\n        var /** @type {?} */ compMeta = template.compMeta;\n        var /** @type {?} */ externalStylesheetsByModuleUrl = new Map();\n        var /** @type {?} */ outputContext = createOutputContext();\n        var /** @type {?} */ componentStylesheet = this._styleCompiler.compileComponent(outputContext, compMeta); /** @type {?} */\n        ((compMeta.template)).externalStylesheets.forEach(function (stylesheetMeta) {\n            var /** @type {?} */ compiledStylesheet = _this._styleCompiler.compileStyles(createOutputContext(), compMeta, stylesheetMeta);\n            externalStylesheetsByModuleUrl.set(/** @type {?} */ ((stylesheetMeta.moduleUrl)), compiledStylesheet);\n        });\n        this._resolveStylesCompileResult(componentStylesheet, externalStylesheetsByModuleUrl);\n        var /** @type {?} */ directives = template.directives.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });\n        var /** @type {?} */ pipes = template.ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });\n        var _a = this._templateParser.parse(compMeta, /** @type {?} */ ((((compMeta.template)).template)), directives, pipes, template.ngModule.schemas, templateSourceUrl(template.ngModule.type, template.compMeta, /** @type {?} */ ((template.compMeta.template)))), parsedTemplate = _a.template, usedPipes = _a.pipes;\n        var /** @type {?} */ compileResult = this._viewCompiler.compileComponent(outputContext, compMeta, parsedTemplate, variable(componentStylesheet.stylesVar), usedPipes);\n        var /** @type {?} */ evalResult;\n        if (!this._compilerConfig.useJit) {\n            evalResult = interpretStatements(outputContext.statements);\n        }\n        else {\n            evalResult = jitStatements(templateJitUrl(template.ngModule.type, template.compMeta), outputContext.statements);\n        }\n        var /** @type {?} */ viewClass = evalResult[compileResult.viewClassVar];\n        var /** @type {?} */ rendererType = evalResult[compileResult.rendererTypeVar];\n        template.compiled(viewClass, rendererType);\n    };\n    /**\n     * @param {?} result\n     * @param {?} externalStylesheetsByModuleUrl\n     * @return {?}\n     */\n    JitCompiler.prototype._resolveStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {\n        var _this = this;\n        result.dependencies.forEach(function (dep, i) {\n            var /** @type {?} */ nestedCompileResult = ((externalStylesheetsByModuleUrl.get(dep.moduleUrl)));\n            var /** @type {?} */ nestedStylesArr = _this._resolveAndEvalStylesCompileResult(nestedCompileResult, externalStylesheetsByModuleUrl);\n            dep.setValue(nestedStylesArr);\n        });\n    };\n    /**\n     * @param {?} result\n     * @param {?} externalStylesheetsByModuleUrl\n     * @return {?}\n     */\n    JitCompiler.prototype._resolveAndEvalStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {\n        this._resolveStylesCompileResult(result, externalStylesheetsByModuleUrl);\n        if (!this._compilerConfig.useJit) {\n            return interpretStatements(result.outputCtx.statements)[result.stylesVar];\n        }\n        else {\n            return jitStatements(sharedStylesheetJitUrl(result.meta, this._sharedStylesheetCount++), result.outputCtx.statements)[result.stylesVar];\n        }\n    };\n    return JitCompiler;\n}());\nJitCompiler.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nJitCompiler.ctorParameters = function () { return [\n    { type: _angular_core.Injector, },\n    { type: CompileMetadataResolver, },\n    { type: TemplateParser, },\n    { type: StyleCompiler, },\n    { type: ViewCompiler, },\n    { type: NgModuleCompiler, },\n    { type: SummaryResolver, },\n    { type: CompilerConfig, },\n    { type: _angular_core.ɵConsole, },\n]; };\nvar CompiledTemplate = (function () {\n    /**\n     * @param {?} isHost\n     * @param {?} compType\n     * @param {?} compMeta\n     * @param {?} ngModule\n     * @param {?} directives\n     */\n    function CompiledTemplate(isHost, compType, compMeta, ngModule, directives) {\n        this.isHost = isHost;\n        this.compType = compType;\n        this.compMeta = compMeta;\n        this.ngModule = ngModule;\n        this.directives = directives;\n        this._viewClass = ((null));\n        this.isCompiled = false;\n    }\n    /**\n     * @param {?} viewClass\n     * @param {?} rendererType\n     * @return {?}\n     */\n    CompiledTemplate.prototype.compiled = function (viewClass, rendererType) {\n        this._viewClass = viewClass;\n        ((this.compMeta.componentViewType)).setDelegate(viewClass);\n        for (var /** @type {?} */ prop in rendererType) {\n            ((this.compMeta.rendererType))[prop] = rendererType[prop];\n        }\n        this.isCompiled = true;\n    };\n    return CompiledTemplate;\n}());\n/**\n * @param {?} meta\n * @return {?}\n */\nfunction assertComponent(meta) {\n    if (!meta.isComponent) {\n        throw new Error(\"Could not compile '\" + identifierName(meta.type) + \"' because it is not a component.\");\n    }\n}\n/**\n * Implements `Compiler` by delegating to the JitCompiler using a known module.\n */\nvar ModuleBoundCompiler = (function () {\n    /**\n     * @param {?} _delegate\n     * @param {?} _ngModule\n     */\n    function ModuleBoundCompiler(_delegate, _ngModule) {\n        this._delegate = _delegate;\n        this._ngModule = _ngModule;\n    }\n    Object.defineProperty(ModuleBoundCompiler.prototype, \"_injector\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._delegate.injector; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.compileModuleSync = function (moduleType) {\n        return this._delegate.compileModuleSync(moduleType);\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.compileModuleAsync = function (moduleType) {\n        return this._delegate.compileModuleAsync(moduleType);\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {\n        return this._delegate.compileModuleAndAllComponentsSync(moduleType);\n    };\n    /**\n     * @template T\n     * @param {?} moduleType\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {\n        return this._delegate.compileModuleAndAllComponentsAsync(moduleType);\n    };\n    /**\n     * @param {?} component\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.getNgContentSelectors = function (component) {\n        return this._delegate.getNgContentSelectors(component);\n    };\n    /**\n     * Clears all caches\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.clearCache = function () { this._delegate.clearCache(); };\n    /**\n     * Clears the cache for the given component/ngModule.\n     * @param {?} type\n     * @return {?}\n     */\n    ModuleBoundCompiler.prototype.clearCacheFor = function (type) { this._delegate.clearCacheFor(type); };\n    return ModuleBoundCompiler;\n}());\n/**\n * @param {?} fn\n * @param {?=} out\n * @return {?}\n */\nfunction flattenSummaries(fn$$1, out) {\n    if (out === void 0) { out = []; }\n    fn$$1().forEach(function (entry) {\n        if (typeof entry === 'function') {\n            flattenSummaries(entry, out);\n        }\n        else {\n            out.push(entry);\n        }\n    });\n    return out;\n}\n/**\n * @return {?}\n */\nfunction createOutputContext() {\n    var /** @type {?} */ importExpr$$1 = function (symbol) { return importExpr({ name: identifierName(symbol), moduleName: null, runtime: symbol }); };\n    return { statements: [], genFilePath: '', importExpr: importExpr$$1 };\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A container for message extracted from the templates.\n */\nvar MessageBundle = (function () {\n    /**\n     * @param {?} _htmlParser\n     * @param {?} _implicitTags\n     * @param {?} _implicitAttrs\n     * @param {?=} _locale\n     */\n    function MessageBundle(_htmlParser, _implicitTags, _implicitAttrs, _locale) {\n        if (_locale === void 0) { _locale = null; }\n        this._htmlParser = _htmlParser;\n        this._implicitTags = _implicitTags;\n        this._implicitAttrs = _implicitAttrs;\n        this._locale = _locale;\n        this._messages = [];\n    }\n    /**\n     * @param {?} html\n     * @param {?} url\n     * @param {?} interpolationConfig\n     * @return {?}\n     */\n    MessageBundle.prototype.updateFromTemplate = function (html, url, interpolationConfig) {\n        var /** @type {?} */ htmlParserResult = this._htmlParser.parse(html, url, true, interpolationConfig);\n        if (htmlParserResult.errors.length) {\n            return htmlParserResult.errors;\n        }\n        var /** @type {?} */ i18nParserResult = extractMessages(htmlParserResult.rootNodes, interpolationConfig, this._implicitTags, this._implicitAttrs);\n        if (i18nParserResult.errors.length) {\n            return i18nParserResult.errors;\n        }\n        (_a = this._messages).push.apply(_a, i18nParserResult.messages);\n        return [];\n        var _a;\n    };\n    /**\n     * @return {?}\n     */\n    MessageBundle.prototype.getMessages = function () { return this._messages; };\n    /**\n     * @param {?} serializer\n     * @param {?=} filterSources\n     * @return {?}\n     */\n    MessageBundle.prototype.write = function (serializer, filterSources) {\n        var /** @type {?} */ messages = {};\n        var /** @type {?} */ mapperVisitor = new MapPlaceholderNames();\n        // Deduplicate messages based on their ID\n        this._messages.forEach(function (message) {\n            var /** @type {?} */ id = serializer.digest(message);\n            if (!messages.hasOwnProperty(id)) {\n                messages[id] = message;\n            }\n            else {\n                (_a = messages[id].sources).push.apply(_a, message.sources);\n            }\n            var _a;\n        });\n        // Transform placeholder names using the serializer mapping\n        var /** @type {?} */ msgList = Object.keys(messages).map(function (id) {\n            var /** @type {?} */ mapper = serializer.createNameMapper(messages[id]);\n            var /** @type {?} */ src = messages[id];\n            var /** @type {?} */ nodes = mapper ? mapperVisitor.convert(src.nodes, mapper) : src.nodes;\n            var /** @type {?} */ transformedMessage = new Message(nodes, {}, {}, src.meaning, src.description, id);\n            transformedMessage.sources = src.sources;\n            if (filterSources) {\n                transformedMessage.sources.forEach(function (source) { return source.filePath = filterSources(source.filePath); });\n            }\n            return transformedMessage;\n        });\n        return serializer.write(msgList, this._locale);\n    };\n    return MessageBundle;\n}());\nvar MapPlaceholderNames = (function (_super) {\n    __extends(MapPlaceholderNames, _super);\n    function MapPlaceholderNames() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} nodes\n     * @param {?} mapper\n     * @return {?}\n     */\n    MapPlaceholderNames.prototype.convert = function (nodes, mapper) {\n        var _this = this;\n        return mapper ? nodes.map(function (n) { return n.visit(_this, mapper); }) : nodes;\n    };\n    /**\n     * @param {?} ph\n     * @param {?} mapper\n     * @return {?}\n     */\n    MapPlaceholderNames.prototype.visitTagPlaceholder = function (ph, mapper) {\n        var _this = this;\n        var /** @type {?} */ startName = ((mapper.toPublicName(ph.startName)));\n        var /** @type {?} */ closeName = ph.closeName ? ((mapper.toPublicName(ph.closeName))) : ph.closeName;\n        var /** @type {?} */ children = ph.children.map(function (n) { return n.visit(_this, mapper); });\n        return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan);\n    };\n    /**\n     * @param {?} ph\n     * @param {?} mapper\n     * @return {?}\n     */\n    MapPlaceholderNames.prototype.visitPlaceholder = function (ph, mapper) {\n        return new Placeholder(ph.value, /** @type {?} */ ((mapper.toPublicName(ph.name))), ph.sourceSpan);\n    };\n    /**\n     * @param {?} ph\n     * @param {?} mapper\n     * @return {?}\n     */\n    MapPlaceholderNames.prototype.visitIcuPlaceholder = function (ph, mapper) {\n        return new IcuPlaceholder(ph.value, /** @type {?} */ ((mapper.toPublicName(ph.name))), ph.sourceSpan);\n    };\n    return MapPlaceholderNames;\n}(CloneVisitor));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Extract i18n messages from source code\n */\nvar Extractor = (function () {\n    /**\n     * @param {?} host\n     * @param {?} staticSymbolResolver\n     * @param {?} messageBundle\n     * @param {?} metadataResolver\n     */\n    function Extractor(host, staticSymbolResolver, messageBundle, metadataResolver) {\n        this.host = host;\n        this.staticSymbolResolver = staticSymbolResolver;\n        this.messageBundle = messageBundle;\n        this.metadataResolver = metadataResolver;\n    }\n    /**\n     * @param {?} rootFiles\n     * @return {?}\n     */\n    Extractor.prototype.extract = function (rootFiles) {\n        var _this = this;\n        var /** @type {?} */ programSymbols = extractProgramSymbols(this.staticSymbolResolver, rootFiles, this.host);\n        var _a = analyzeAndValidateNgModules(programSymbols, this.host, this.metadataResolver), files = _a.files, ngModules = _a.ngModules;\n        return Promise\n            .all(ngModules.map(function (ngModule) { return _this.metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))\n            .then(function () {\n            var /** @type {?} */ errors = [];\n            files.forEach(function (file) {\n                var /** @type {?} */ compMetas = [];\n                file.directives.forEach(function (directiveType) {\n                    var /** @type {?} */ dirMeta = _this.metadataResolver.getDirectiveMetadata(directiveType);\n                    if (dirMeta && dirMeta.isComponent) {\n                        compMetas.push(dirMeta);\n                    }\n                });\n                compMetas.forEach(function (compMeta) {\n                    var /** @type {?} */ html = ((((compMeta.template)).template));\n                    var /** @type {?} */ interpolationConfig = InterpolationConfig.fromArray(/** @type {?} */ ((compMeta.template)).interpolation);\n                    errors.push.apply(errors, ((_this.messageBundle.updateFromTemplate(html, file.srcUrl, interpolationConfig))));\n                });\n            });\n            if (errors.length) {\n                throw new Error(errors.map(function (e) { return e.toString(); }).join('\\n'));\n            }\n            return _this.messageBundle;\n        });\n    };\n    /**\n     * @param {?} host\n     * @param {?} locale\n     * @return {?}\n     */\n    Extractor.create = function (host, locale) {\n        var /** @type {?} */ htmlParser = new I18NHtmlParser(new HtmlParser());\n        var /** @type {?} */ urlResolver = createOfflineCompileUrlResolver();\n        var /** @type {?} */ symbolCache = new StaticSymbolCache();\n        var /** @type {?} */ summaryResolver = new AotSummaryResolver(host, symbolCache);\n        var /** @type {?} */ staticSymbolResolver = new StaticSymbolResolver(host, symbolCache, summaryResolver);\n        var /** @type {?} */ staticReflector = new StaticReflector(summaryResolver, staticSymbolResolver);\n        var /** @type {?} */ config = new CompilerConfig({ defaultEncapsulation: _angular_core.ViewEncapsulation.Emulated, useJit: false });\n        var /** @type {?} */ normalizer = new DirectiveNormalizer({ get: function (url) { return host.loadResource(url); } }, urlResolver, htmlParser, config);\n        var /** @type {?} */ elementSchemaRegistry = new DomElementSchemaRegistry();\n        var /** @type {?} */ resolver = new CompileMetadataResolver(config, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, new _angular_core.ɵConsole(), symbolCache, staticReflector);\n        // TODO(vicb): implicit tags & attributes\n        var /** @type {?} */ messageBundle = new MessageBundle(htmlParser, [], {}, locale);\n        var /** @type {?} */ extractor = new Extractor(host, staticSymbolResolver, messageBundle, resolver);\n        return { extractor: extractor, staticReflector: staticReflector };\n    };\n    return Extractor;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar JitReflector = (function () {\n    function JitReflector() {\n        this.reflectionCapabilities = new _angular_core.ɵReflectionCapabilities();\n    }\n    /**\n     * @param {?} type\n     * @param {?} cmpMetadata\n     * @return {?}\n     */\n    JitReflector.prototype.componentModuleUrl = function (type, cmpMetadata) {\n        var /** @type {?} */ moduleId = cmpMetadata.moduleId;\n        if (typeof moduleId === 'string') {\n            var /** @type {?} */ scheme = getUrlScheme(moduleId);\n            return scheme ? moduleId : \"package:\" + moduleId + MODULE_SUFFIX;\n        }\n        else if (moduleId !== null && moduleId !== void 0) {\n            throw syntaxError(\"moduleId should be a string in \\\"\" + _angular_core.ɵstringify(type) + \"\\\". See https://goo.gl/wIDDiL for more information.\\n\" +\n                \"If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.\");\n        }\n        return \"./\" + _angular_core.ɵstringify(type);\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    JitReflector.prototype.parameters = function (typeOrFunc) {\n        return this.reflectionCapabilities.parameters(typeOrFunc);\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    JitReflector.prototype.annotations = function (typeOrFunc) {\n        return this.reflectionCapabilities.annotations(typeOrFunc);\n    };\n    /**\n     * @param {?} typeOrFunc\n     * @return {?}\n     */\n    JitReflector.prototype.propMetadata = function (typeOrFunc) {\n        return this.reflectionCapabilities.propMetadata(typeOrFunc);\n    };\n    /**\n     * @param {?} type\n     * @param {?} lcProperty\n     * @return {?}\n     */\n    JitReflector.prototype.hasLifecycleHook = function (type, lcProperty) {\n        return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n    };\n    /**\n     * @param {?} ref\n     * @return {?}\n     */\n    JitReflector.prototype.resolveExternalReference = function (ref) { return ref.runtime; };\n    return JitReflector;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _NO_RESOURCE_LOADER = {\n    /**\n     * @param {?} url\n     * @return {?}\n     */\n    get: function (url) {\n        throw new Error(\"No ResourceLoader implementation has been provided. Can't read the url \\\"\" + url + \"\\\"\");\n    }\n};\nvar baseHtmlParser = new _angular_core.InjectionToken('HtmlParser');\n/**\n * A set of providers that provide `JitCompiler` and its dependencies to use for\n * template compilation.\n */\nvar COMPILER_PROVIDERS = [\n    { provide: CompileReflector, useValue: new JitReflector() },\n    { provide: ResourceLoader, useValue: _NO_RESOURCE_LOADER },\n    JitSummaryResolver,\n    { provide: SummaryResolver, useExisting: JitSummaryResolver },\n    _angular_core.ɵConsole,\n    Lexer,\n    Parser,\n    {\n        provide: baseHtmlParser,\n        useClass: HtmlParser,\n    },\n    {\n        provide: I18NHtmlParser,\n        useFactory: function (parser, translations, format, config, console) { return new I18NHtmlParser(parser, translations, format, config.missingTranslation, console); },\n        deps: [\n            baseHtmlParser,\n            [new _angular_core.Optional(), new _angular_core.Inject(_angular_core.TRANSLATIONS)],\n            [new _angular_core.Optional(), new _angular_core.Inject(_angular_core.TRANSLATIONS_FORMAT)],\n            [CompilerConfig],\n            [_angular_core.ɵConsole],\n        ]\n    },\n    {\n        provide: HtmlParser,\n        useExisting: I18NHtmlParser,\n    },\n    TemplateParser,\n    DirectiveNormalizer,\n    CompileMetadataResolver,\n    DEFAULT_PACKAGE_URL_PROVIDER,\n    StyleCompiler,\n    ViewCompiler,\n    NgModuleCompiler,\n    { provide: CompilerConfig, useValue: new CompilerConfig() },\n    JitCompiler,\n    { provide: _angular_core.Compiler, useExisting: JitCompiler },\n    DomElementSchemaRegistry,\n    { provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry },\n    UrlResolver,\n    DirectiveResolver,\n    PipeResolver,\n    NgModuleResolver,\n];\nvar JitCompilerFactory = (function () {\n    /**\n     * @param {?} defaultOptions\n     */\n    function JitCompilerFactory(defaultOptions) {\n        var compilerOptions = {\n            useDebug: _angular_core.isDevMode(),\n            useJit: true,\n            defaultEncapsulation: _angular_core.ViewEncapsulation.Emulated,\n            missingTranslation: _angular_core.MissingTranslationStrategy.Warning,\n            enableLegacyTemplate: true,\n        };\n        this._defaultOptions = [compilerOptions].concat(defaultOptions);\n    }\n    /**\n     * @param {?=} options\n     * @return {?}\n     */\n    JitCompilerFactory.prototype.createCompiler = function (options) {\n        if (options === void 0) { options = []; }\n        var /** @type {?} */ opts = _mergeOptions(this._defaultOptions.concat(options));\n        var /** @type {?} */ injector = _angular_core.ReflectiveInjector.resolveAndCreate([\n            COMPILER_PROVIDERS, {\n                provide: CompilerConfig,\n                useFactory: function () {\n                    return new CompilerConfig({\n                        // let explicit values from the compiler options overwrite options\n                        // from the app providers\n                        useJit: opts.useJit,\n                        // let explicit values from the compiler options overwrite options\n                        // from the app providers\n                        defaultEncapsulation: opts.defaultEncapsulation,\n                        missingTranslation: opts.missingTranslation,\n                        enableLegacyTemplate: opts.enableLegacyTemplate,\n                    });\n                },\n                deps: []\n            }, /** @type {?} */ ((opts.providers))\n        ]);\n        return injector.get(_angular_core.Compiler);\n    };\n    return JitCompilerFactory;\n}());\nJitCompilerFactory.decorators = [\n    { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nJitCompilerFactory.ctorParameters = function () { return [\n    { type: Array, decorators: [{ type: _angular_core.Inject, args: [_angular_core.COMPILER_OPTIONS,] },] },\n]; };\n/**\n * A platform that included corePlatform and the compiler.\n *\n * \\@experimental\n */\nvar platformCoreDynamic = _angular_core.createPlatformFactory(_angular_core.platformCore, 'coreDynamic', [\n    { provide: _angular_core.COMPILER_OPTIONS, useValue: {}, multi: true },\n    { provide: _angular_core.CompilerFactory, useClass: JitCompilerFactory },\n]);\n/**\n * @param {?} optionsArr\n * @return {?}\n */\nfunction _mergeOptions(optionsArr) {\n    return {\n        useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),\n        defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),\n        providers: _mergeArrays(optionsArr.map(function (options) { return ((options.providers)); })),\n        missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),\n        enableLegacyTemplate: _lastDefined(optionsArr.map(function (options) { return options.enableLegacyTemplate; })),\n    };\n}\n/**\n * @template T\n * @param {?} args\n * @return {?}\n */\nfunction _lastDefined(args) {\n    for (var /** @type {?} */ i = args.length - 1; i >= 0; i--) {\n        if (args[i] !== undefined) {\n            return args[i];\n        }\n    }\n    return undefined;\n}\n/**\n * @param {?} parts\n * @return {?}\n */\nfunction _mergeArrays(parts) {\n    var /** @type {?} */ result = [];\n    parts.forEach(function (part) { return part && result.push.apply(result, part); });\n    return result;\n}\n\nexports.VERSION = VERSION;\nexports.TEMPLATE_TRANSFORMS = TEMPLATE_TRANSFORMS;\nexports.CompilerConfig = CompilerConfig;\nexports.JitCompiler = JitCompiler;\nexports.DirectiveResolver = DirectiveResolver;\nexports.PipeResolver = PipeResolver;\nexports.NgModuleResolver = NgModuleResolver;\nexports.DEFAULT_INTERPOLATION_CONFIG = DEFAULT_INTERPOLATION_CONFIG;\nexports.InterpolationConfig = InterpolationConfig;\nexports.NgModuleCompiler = NgModuleCompiler;\nexports.AssertNotNull = AssertNotNull;\nexports.BinaryOperator = BinaryOperator;\nexports.BinaryOperatorExpr = BinaryOperatorExpr;\nexports.BuiltinMethod = BuiltinMethod;\nexports.BuiltinVar = BuiltinVar;\nexports.CastExpr = CastExpr;\nexports.ClassStmt = ClassStmt;\nexports.CommaExpr = CommaExpr;\nexports.CommentStmt = CommentStmt;\nexports.ConditionalExpr = ConditionalExpr;\nexports.DeclareFunctionStmt = DeclareFunctionStmt;\nexports.DeclareVarStmt = DeclareVarStmt;\nexports.ExpressionStatement = ExpressionStatement;\nexports.ExternalExpr = ExternalExpr;\nexports.ExternalReference = ExternalReference;\nexports.FunctionExpr = FunctionExpr;\nexports.IfStmt = IfStmt;\nexports.InstantiateExpr = InstantiateExpr;\nexports.InvokeFunctionExpr = InvokeFunctionExpr;\nexports.InvokeMethodExpr = InvokeMethodExpr;\nexports.LiteralArrayExpr = LiteralArrayExpr;\nexports.LiteralExpr = LiteralExpr;\nexports.LiteralMapExpr = LiteralMapExpr;\nexports.NotExpr = NotExpr;\nexports.ReadKeyExpr = ReadKeyExpr;\nexports.ReadPropExpr = ReadPropExpr;\nexports.ReadVarExpr = ReadVarExpr;\nexports.ReturnStatement = ReturnStatement;\nexports.ThrowStmt = ThrowStmt;\nexports.TryCatchStmt = TryCatchStmt;\nexports.WriteKeyExpr = WriteKeyExpr;\nexports.WritePropExpr = WritePropExpr;\nexports.WriteVarExpr = WriteVarExpr;\nexports.StmtModifier = StmtModifier;\nexports.Statement = Statement;\nexports.EmitterVisitorContext = EmitterVisitorContext;\nexports.ViewCompiler = ViewCompiler;\nexports.isSyntaxError = isSyntaxError;\nexports.syntaxError = syntaxError;\nexports.TextAst = TextAst;\nexports.BoundTextAst = BoundTextAst;\nexports.AttrAst = AttrAst;\nexports.BoundElementPropertyAst = BoundElementPropertyAst;\nexports.BoundEventAst = BoundEventAst;\nexports.ReferenceAst = ReferenceAst;\nexports.VariableAst = VariableAst;\nexports.ElementAst = ElementAst;\nexports.EmbeddedTemplateAst = EmbeddedTemplateAst;\nexports.BoundDirectivePropertyAst = BoundDirectivePropertyAst;\nexports.DirectiveAst = DirectiveAst;\nexports.ProviderAst = ProviderAst;\nexports.ProviderAstType = ProviderAstType;\nexports.NgContentAst = NgContentAst;\nexports.PropertyBindingType = PropertyBindingType;\nexports.NullTemplateVisitor = NullTemplateVisitor;\nexports.RecursiveTemplateAstVisitor = RecursiveTemplateAstVisitor;\nexports.templateVisitAll = templateVisitAll;\nexports.CompileAnimationEntryMetadata = CompileAnimationEntryMetadata;\nexports.CompileAnimationStateMetadata = CompileAnimationStateMetadata;\nexports.CompileAnimationStateDeclarationMetadata = CompileAnimationStateDeclarationMetadata;\nexports.CompileAnimationStateTransitionMetadata = CompileAnimationStateTransitionMetadata;\nexports.CompileAnimationMetadata = CompileAnimationMetadata;\nexports.CompileAnimationKeyframesSequenceMetadata = CompileAnimationKeyframesSequenceMetadata;\nexports.CompileAnimationStyleMetadata = CompileAnimationStyleMetadata;\nexports.CompileAnimationAnimateMetadata = CompileAnimationAnimateMetadata;\nexports.CompileAnimationWithStepsMetadata = CompileAnimationWithStepsMetadata;\nexports.CompileAnimationSequenceMetadata = CompileAnimationSequenceMetadata;\nexports.CompileAnimationGroupMetadata = CompileAnimationGroupMetadata;\nexports.identifierName = identifierName;\nexports.identifierModuleUrl = identifierModuleUrl;\nexports.viewClassName = viewClassName;\nexports.rendererTypeName = rendererTypeName;\nexports.hostViewClassName = hostViewClassName;\nexports.dirWrapperClassName = dirWrapperClassName;\nexports.componentFactoryName = componentFactoryName;\nexports.CompileSummaryKind = CompileSummaryKind;\nexports.tokenName = tokenName;\nexports.tokenReference = tokenReference;\nexports.CompileStylesheetMetadata = CompileStylesheetMetadata;\nexports.CompileTemplateMetadata = CompileTemplateMetadata;\nexports.CompileDirectiveMetadata = CompileDirectiveMetadata;\nexports.createHostComponentMeta = createHostComponentMeta;\nexports.CompilePipeMetadata = CompilePipeMetadata;\nexports.CompileNgModuleMetadata = CompileNgModuleMetadata;\nexports.TransitiveCompileNgModuleMetadata = TransitiveCompileNgModuleMetadata;\nexports.ProviderMeta = ProviderMeta;\nexports.flatten = flatten;\nexports.sourceUrl = sourceUrl;\nexports.templateSourceUrl = templateSourceUrl;\nexports.sharedStylesheetJitUrl = sharedStylesheetJitUrl;\nexports.ngModuleJitUrl = ngModuleJitUrl;\nexports.templateJitUrl = templateJitUrl;\nexports.createAotCompiler = createAotCompiler;\nexports.AotCompiler = AotCompiler;\nexports.analyzeNgModules = analyzeNgModules;\nexports.analyzeAndValidateNgModules = analyzeAndValidateNgModules;\nexports.extractProgramSymbols = extractProgramSymbols;\nexports.GeneratedFile = GeneratedFile;\nexports.toTypeScript = toTypeScript;\nexports.StaticReflector = StaticReflector;\nexports.StaticSymbol = StaticSymbol;\nexports.StaticSymbolCache = StaticSymbolCache;\nexports.ResolvedStaticSymbol = ResolvedStaticSymbol;\nexports.StaticSymbolResolver = StaticSymbolResolver;\nexports.unescapeIdentifier = unescapeIdentifier;\nexports.AotSummaryResolver = AotSummaryResolver;\nexports.AstPath = AstPath;\nexports.SummaryResolver = SummaryResolver;\nexports.JitSummaryResolver = JitSummaryResolver;\nexports.COMPILER_PROVIDERS = COMPILER_PROVIDERS;\nexports.JitCompilerFactory = JitCompilerFactory;\nexports.platformCoreDynamic = platformCoreDynamic;\nexports.JitReflector = JitReflector;\nexports.CompileReflector = CompileReflector;\nexports.createUrlResolverWithoutPackagePrefix = createUrlResolverWithoutPackagePrefix;\nexports.createOfflineCompileUrlResolver = createOfflineCompileUrlResolver;\nexports.DEFAULT_PACKAGE_URL_PROVIDER = DEFAULT_PACKAGE_URL_PROVIDER;\nexports.UrlResolver = UrlResolver;\nexports.getUrlScheme = getUrlScheme;\nexports.ResourceLoader = ResourceLoader;\nexports.ElementSchemaRegistry = ElementSchemaRegistry;\nexports.Extractor = Extractor;\nexports.I18NHtmlParser = I18NHtmlParser;\nexports.MessageBundle = MessageBundle;\nexports.Serializer = Serializer;\nexports.Xliff = Xliff;\nexports.Xliff2 = Xliff2;\nexports.Xmb = Xmb;\nexports.Xtb = Xtb;\nexports.DirectiveNormalizer = DirectiveNormalizer;\nexports.ParserError = ParserError;\nexports.ParseSpan = ParseSpan;\nexports.AST = AST;\nexports.Quote = Quote;\nexports.EmptyExpr = EmptyExpr;\nexports.ImplicitReceiver = ImplicitReceiver;\nexports.Chain = Chain;\nexports.Conditional = Conditional;\nexports.PropertyRead = PropertyRead;\nexports.PropertyWrite = PropertyWrite;\nexports.SafePropertyRead = SafePropertyRead;\nexports.KeyedRead = KeyedRead;\nexports.KeyedWrite = KeyedWrite;\nexports.BindingPipe = BindingPipe;\nexports.LiteralPrimitive = LiteralPrimitive;\nexports.LiteralArray = LiteralArray;\nexports.LiteralMap = LiteralMap;\nexports.Interpolation = Interpolation;\nexports.Binary = Binary;\nexports.PrefixNot = PrefixNot;\nexports.NonNullAssert = NonNullAssert;\nexports.MethodCall = MethodCall;\nexports.SafeMethodCall = SafeMethodCall;\nexports.FunctionCall = FunctionCall;\nexports.ASTWithSource = ASTWithSource;\nexports.TemplateBinding = TemplateBinding;\nexports.NullAstVisitor = NullAstVisitor;\nexports.RecursiveAstVisitor = RecursiveAstVisitor;\nexports.AstTransformer = AstTransformer;\nexports.visitAstChildren = visitAstChildren;\nexports.TokenType = TokenType;\nexports.Lexer = Lexer;\nexports.Token = Token;\nexports.EOF = EOF;\nexports.isIdentifier = isIdentifier;\nexports.isQuote = isQuote;\nexports.SplitInterpolation = SplitInterpolation;\nexports.TemplateBindingParseResult = TemplateBindingParseResult;\nexports.Parser = Parser;\nexports._ParseAST = _ParseAST;\nexports.ERROR_COLLECTOR_TOKEN = ERROR_COLLECTOR_TOKEN;\nexports.CompileMetadataResolver = CompileMetadataResolver;\nexports.Text = Text;\nexports.Expansion = Expansion;\nexports.ExpansionCase = ExpansionCase;\nexports.Attribute = Attribute$1;\nexports.Element = Element;\nexports.Comment = Comment;\nexports.visitAll = visitAll;\nexports.RecursiveVisitor = RecursiveVisitor;\nexports.findNode = findNode;\nexports.ParseTreeResult = ParseTreeResult;\nexports.TreeError = TreeError;\nexports.HtmlParser = HtmlParser;\nexports.HtmlTagDefinition = HtmlTagDefinition;\nexports.getHtmlTagDefinition = getHtmlTagDefinition;\nexports.TagContentType = TagContentType;\nexports.splitNsName = splitNsName;\nexports.isNgContainer = isNgContainer;\nexports.isNgContent = isNgContent;\nexports.isNgTemplate = isNgTemplate;\nexports.getNsPrefix = getNsPrefix;\nexports.mergeNsAndName = mergeNsAndName;\nexports.NAMED_ENTITIES = NAMED_ENTITIES;\nexports.debugOutputAstAsTypeScript = debugOutputAstAsTypeScript;\nexports.TypeScriptEmitter = TypeScriptEmitter;\nexports.ParseLocation = ParseLocation;\nexports.ParseSourceFile = ParseSourceFile;\nexports.ParseSourceSpan = ParseSourceSpan;\nexports.ParseErrorLevel = ParseErrorLevel;\nexports.ParseError = ParseError;\nexports.typeSourceSpan = typeSourceSpan;\nexports.DomElementSchemaRegistry = DomElementSchemaRegistry;\nexports.CssSelector = CssSelector;\nexports.SelectorMatcher = SelectorMatcher;\nexports.SelectorListContext = SelectorListContext;\nexports.SelectorContext = SelectorContext;\nexports.StylesCompileDependency = StylesCompileDependency;\nexports.CompiledStylesheet = CompiledStylesheet;\nexports.StyleCompiler = StyleCompiler;\nexports.TemplateParseError = TemplateParseError;\nexports.TemplateParseResult = TemplateParseResult;\nexports.TemplateParser = TemplateParser;\nexports.splitClasses = splitClasses;\nexports.createElementCssSelector = createElementCssSelector;\nexports.removeSummaryDuplicates = removeSummaryDuplicates;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=compiler.umd.js.map\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', '@angular/common', '@angular/core'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.platformBrowser = global.ng.platformBrowser || {}),global.ng.common,global.ng.core));\n}(this, (function (exports,_angular_common,_angular_core) { 'use strict';\n\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = Object.setPrototypeOf ||\n    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n    function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n\nfunction __extends(d, b) {\n    extendStatics(d, b);\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _DOM = ((null));\n/**\n * @return {?}\n */\nfunction getDOM() {\n    return _DOM;\n}\n/**\n * @param {?} adapter\n * @return {?}\n */\n/**\n * @param {?} adapter\n * @return {?}\n */\nfunction setRootDomAdapter(adapter) {\n    if (!_DOM) {\n        _DOM = adapter;\n    }\n}\n/**\n * Provides DOM operations in an environment-agnostic way.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n * @abstract\n */\nvar DomAdapter = (function () {\n    function DomAdapter() {\n        this.resourceLoaderType = ((null));\n    }\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    DomAdapter.prototype.hasProperty = function (element, name) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setProperty = function (el, name, value) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    DomAdapter.prototype.getProperty = function (el, name) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} methodName\n     * @param {?} args\n     * @return {?}\n     */\n    DomAdapter.prototype.invoke = function (el, methodName, args) { };\n    /**\n     * @abstract\n     * @param {?} error\n     * @return {?}\n     */\n    DomAdapter.prototype.logError = function (error) { };\n    /**\n     * @abstract\n     * @param {?} error\n     * @return {?}\n     */\n    DomAdapter.prototype.log = function (error) { };\n    /**\n     * @abstract\n     * @param {?} error\n     * @return {?}\n     */\n    DomAdapter.prototype.logGroup = function (error) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.logGroupEnd = function () { };\n    Object.defineProperty(DomAdapter.prototype, \"attrToPropMap\", {\n        /**\n         * Maps attribute names to their corresponding property names for cases\n         * where attribute name doesn't match property name.\n         * @return {?}\n         */\n        get: function () { return this._attrToPropMap; },\n        /**\n         * @param {?} value\n         * @return {?}\n         */\n        set: function (value) { this._attrToPropMap = value; },\n        enumerable: true,\n        configurable: true\n    });\n    \n    \n    /**\n     * @abstract\n     * @param {?} nodeA\n     * @param {?} nodeB\n     * @return {?}\n     */\n    DomAdapter.prototype.contains = function (nodeA, nodeB) { };\n    /**\n     * @abstract\n     * @param {?} templateHtml\n     * @return {?}\n     */\n    DomAdapter.prototype.parse = function (templateHtml) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} selector\n     * @return {?}\n     */\n    DomAdapter.prototype.querySelector = function (el, selector) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} selector\n     * @return {?}\n     */\n    DomAdapter.prototype.querySelectorAll = function (el, selector) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} evt\n     * @param {?} listener\n     * @return {?}\n     */\n    DomAdapter.prototype.on = function (el, evt, listener) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} evt\n     * @param {?} listener\n     * @return {?}\n     */\n    DomAdapter.prototype.onAndCancel = function (el, evt, listener) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} evt\n     * @return {?}\n     */\n    DomAdapter.prototype.dispatchEvent = function (el, evt) { };\n    /**\n     * @abstract\n     * @param {?} eventType\n     * @return {?}\n     */\n    DomAdapter.prototype.createMouseEvent = function (eventType) { };\n    /**\n     * @abstract\n     * @param {?} eventType\n     * @return {?}\n     */\n    DomAdapter.prototype.createEvent = function (eventType) { };\n    /**\n     * @abstract\n     * @param {?} evt\n     * @return {?}\n     */\n    DomAdapter.prototype.preventDefault = function (evt) { };\n    /**\n     * @abstract\n     * @param {?} evt\n     * @return {?}\n     */\n    DomAdapter.prototype.isPrevented = function (evt) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getInnerHTML = function (el) { };\n    /**\n     * Returns content if el is a <template> element, null otherwise.\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getTemplateContent = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getOuterHTML = function (el) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.nodeName = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.nodeValue = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.type = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.content = function (node) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.firstChild = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.nextSibling = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.parentElement = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.childNodes = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.childNodesAsList = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.clearNodes = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.appendChild = function (el, node) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.removeChild = function (el, node) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} newNode\n     * @param {?} oldNode\n     * @return {?}\n     */\n    DomAdapter.prototype.replaceChild = function (el, newNode, oldNode) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.remove = function (el) { };\n    /**\n     * @abstract\n     * @param {?} parent\n     * @param {?} ref\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.insertBefore = function (parent, ref, node) { };\n    /**\n     * @abstract\n     * @param {?} parent\n     * @param {?} ref\n     * @param {?} nodes\n     * @return {?}\n     */\n    DomAdapter.prototype.insertAllBefore = function (parent, ref, nodes) { };\n    /**\n     * @abstract\n     * @param {?} parent\n     * @param {?} el\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.insertAfter = function (parent, el, node) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setInnerHTML = function (el, value) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getText = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setText = function (el, value) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getValue = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setValue = function (el, value) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getChecked = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setChecked = function (el, value) { };\n    /**\n     * @abstract\n     * @param {?} text\n     * @return {?}\n     */\n    DomAdapter.prototype.createComment = function (text) { };\n    /**\n     * @abstract\n     * @param {?} html\n     * @return {?}\n     */\n    DomAdapter.prototype.createTemplate = function (html) { };\n    /**\n     * @abstract\n     * @param {?} tagName\n     * @param {?=} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.createElement = function (tagName, doc) { };\n    /**\n     * @abstract\n     * @param {?} ns\n     * @param {?} tagName\n     * @param {?=} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.createElementNS = function (ns, tagName, doc) { };\n    /**\n     * @abstract\n     * @param {?} text\n     * @param {?=} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.createTextNode = function (text, doc) { };\n    /**\n     * @abstract\n     * @param {?} attrName\n     * @param {?} attrValue\n     * @param {?=} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.createScriptTag = function (attrName, attrValue, doc) { };\n    /**\n     * @abstract\n     * @param {?} css\n     * @param {?=} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.createStyleElement = function (css, doc) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.createShadowRoot = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getShadowRoot = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getHost = function (el) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getDistributedNodes = function (el) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.clone /*<T extends Node>*/ = function (node) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    DomAdapter.prototype.getElementsByClassName = function (element, name) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    DomAdapter.prototype.getElementsByTagName = function (element, name) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @return {?}\n     */\n    DomAdapter.prototype.classList = function (element) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} className\n     * @return {?}\n     */\n    DomAdapter.prototype.addClass = function (element, className) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} className\n     * @return {?}\n     */\n    DomAdapter.prototype.removeClass = function (element, className) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} className\n     * @return {?}\n     */\n    DomAdapter.prototype.hasClass = function (element, className) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} styleName\n     * @param {?} styleValue\n     * @return {?}\n     */\n    DomAdapter.prototype.setStyle = function (element, styleName, styleValue) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} styleName\n     * @return {?}\n     */\n    DomAdapter.prototype.removeStyle = function (element, styleName) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} styleName\n     * @return {?}\n     */\n    DomAdapter.prototype.getStyle = function (element, styleName) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} styleName\n     * @param {?=} styleValue\n     * @return {?}\n     */\n    DomAdapter.prototype.hasStyle = function (element, styleName, styleValue) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @return {?}\n     */\n    DomAdapter.prototype.tagName = function (element) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @return {?}\n     */\n    DomAdapter.prototype.attributeMap = function (element) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} attribute\n     * @return {?}\n     */\n    DomAdapter.prototype.hasAttribute = function (element, attribute) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} attribute\n     * @return {?}\n     */\n    DomAdapter.prototype.hasAttributeNS = function (element, ns, attribute) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} attribute\n     * @return {?}\n     */\n    DomAdapter.prototype.getAttribute = function (element, attribute) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} attribute\n     * @return {?}\n     */\n    DomAdapter.prototype.getAttributeNS = function (element, ns, attribute) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setAttribute = function (element, name, value) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setAttributeNS = function (element, ns, name, value) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} attribute\n     * @return {?}\n     */\n    DomAdapter.prototype.removeAttribute = function (element, attribute) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} attribute\n     * @return {?}\n     */\n    DomAdapter.prototype.removeAttributeNS = function (element, ns, attribute) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.templateAwareRoot = function (el) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.createHtmlDocument = function () { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.getBoundingClientRect = function (el) { };\n    /**\n     * @abstract\n     * @param {?} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.getTitle = function (doc) { };\n    /**\n     * @abstract\n     * @param {?} doc\n     * @param {?} newTitle\n     * @return {?}\n     */\n    DomAdapter.prototype.setTitle = function (doc, newTitle) { };\n    /**\n     * @abstract\n     * @param {?} n\n     * @param {?} selector\n     * @return {?}\n     */\n    DomAdapter.prototype.elementMatches = function (n, selector) { };\n    /**\n     * @abstract\n     * @param {?} el\n     * @return {?}\n     */\n    DomAdapter.prototype.isTemplateElement = function (el) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.isTextNode = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.isCommentNode = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.isElementNode = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.hasShadowRoot = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.isShadowRoot = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.importIntoDoc /*<T extends Node>*/ = function (node) { };\n    /**\n     * @abstract\n     * @param {?} node\n     * @return {?}\n     */\n    DomAdapter.prototype.adoptNode /*<T extends Node>*/ = function (node) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @return {?}\n     */\n    DomAdapter.prototype.getHref = function (element) { };\n    /**\n     * @abstract\n     * @param {?} event\n     * @return {?}\n     */\n    DomAdapter.prototype.getEventKey = function (event) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} baseUrl\n     * @param {?} href\n     * @return {?}\n     */\n    DomAdapter.prototype.resolveAndSetHref = function (element, baseUrl, href) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.supportsDOMEvents = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.supportsNativeShadowDOM = function () { };\n    /**\n     * @abstract\n     * @param {?} doc\n     * @param {?} target\n     * @return {?}\n     */\n    DomAdapter.prototype.getGlobalEventTarget = function (doc, target) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.getHistory = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.getLocation = function () { };\n    /**\n     * @abstract\n     * @param {?} doc\n     * @return {?}\n     */\n    DomAdapter.prototype.getBaseHref = function (doc) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.resetBaseElement = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.getUserAgent = function () { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setData = function (element, name, value) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @return {?}\n     */\n    DomAdapter.prototype.getComputedStyle = function (element) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    DomAdapter.prototype.getData = function (element, name) { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.supportsWebAnimation = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.performanceNow = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.getAnimationPrefix = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.getTransitionEnd = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.supportsAnimation = function () { };\n    /**\n     * @abstract\n     * @return {?}\n     */\n    DomAdapter.prototype.supportsCookies = function () { };\n    /**\n     * @abstract\n     * @param {?} name\n     * @return {?}\n     */\n    DomAdapter.prototype.getCookie = function (name) { };\n    /**\n     * @abstract\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DomAdapter.prototype.setCookie = function (name, value) { };\n    return DomAdapter;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Provides DOM operations in any browser environment.\n *\n * \\@security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n * @abstract\n */\nvar GenericBrowserDomAdapter = (function (_super) {\n    __extends(GenericBrowserDomAdapter, _super);\n    function GenericBrowserDomAdapter() {\n        var _this = _super.call(this) || this;\n        _this._animationPrefix = null;\n        _this._transitionEnd = null;\n        try {\n            var element_1 = _this.createElement('div', document);\n            if (_this.getStyle(element_1, 'animationName') != null) {\n                _this._animationPrefix = '';\n            }\n            else {\n                var domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];\n                for (var i = 0; i < domPrefixes.length; i++) {\n                    if (_this.getStyle(element_1, domPrefixes[i] + 'AnimationName') != null) {\n                        _this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';\n                        break;\n                    }\n                }\n            }\n            var transEndEventNames_1 = {\n                WebkitTransition: 'webkitTransitionEnd',\n                MozTransition: 'transitionend',\n                OTransition: 'oTransitionEnd otransitionend',\n                transition: 'transitionend'\n            };\n            Object.keys(transEndEventNames_1).forEach(function (key) {\n                if (_this.getStyle(element_1, key) != null) {\n                    _this._transitionEnd = transEndEventNames_1[key];\n                }\n            });\n        }\n        catch (e) {\n            _this._animationPrefix = null;\n            _this._transitionEnd = null;\n        }\n        return _this;\n    }\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.getDistributedNodes = function (el) { return ((el)).getDistributedNodes(); };\n    /**\n     * @param {?} el\n     * @param {?} baseUrl\n     * @param {?} href\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.resolveAndSetHref = function (el, baseUrl, href) {\n        el.href = href == null ? baseUrl : baseUrl + '/../' + href;\n    };\n    /**\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.supportsDOMEvents = function () { return true; };\n    /**\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function () {\n        return typeof ((document.body)).createShadowRoot === 'function';\n    };\n    /**\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.getAnimationPrefix = function () { return this._animationPrefix ? this._animationPrefix : ''; };\n    /**\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.getTransitionEnd = function () { return this._transitionEnd ? this._transitionEnd : ''; };\n    /**\n     * @return {?}\n     */\n    GenericBrowserDomAdapter.prototype.supportsAnimation = function () {\n        return this._animationPrefix != null && this._transitionEnd != null;\n    };\n    return GenericBrowserDomAdapter;\n}(DomAdapter));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar _attrToPropMap = {\n    'class': 'className',\n    'innerHtml': 'innerHTML',\n    'readonly': 'readOnly',\n    'tabindex': 'tabIndex',\n};\nvar DOM_KEY_LOCATION_NUMPAD = 3;\n// Map to convert some key or keyIdentifier values to what will be returned by getEventKey\nvar _keyMap = {\n    // The following values are here for cross-browser compatibility and to match the W3C standard\n    // cf http://www.w3.org/TR/DOM-Level-3-Events-key/\n    '\\b': 'Backspace',\n    '\\t': 'Tab',\n    '\\x7F': 'Delete',\n    '\\x1B': 'Escape',\n    'Del': 'Delete',\n    'Esc': 'Escape',\n    'Left': 'ArrowLeft',\n    'Right': 'ArrowRight',\n    'Up': 'ArrowUp',\n    'Down': 'ArrowDown',\n    'Menu': 'ContextMenu',\n    'Scroll': 'ScrollLock',\n    'Win': 'OS'\n};\n// There is a bug in Chrome for numeric keypad keys:\n// https://code.google.com/p/chromium/issues/detail?id=155654\n// 1, 2, 3 ... are reported as A, B, C ...\nvar _chromeNumKeyPadMap = {\n    'A': '1',\n    'B': '2',\n    'C': '3',\n    'D': '4',\n    'E': '5',\n    'F': '6',\n    'G': '7',\n    'H': '8',\n    'I': '9',\n    'J': '*',\n    'K': '+',\n    'M': '-',\n    'N': '.',\n    'O': '/',\n    '\\x60': '0',\n    '\\x90': 'NumLock'\n};\nvar nodeContains;\nif (_angular_core.ɵglobal['Node']) {\n    nodeContains = _angular_core.ɵglobal['Node'].prototype.contains || function (node) {\n        return !!(this.compareDocumentPosition(node) & 16);\n    };\n}\nvar BrowserDomAdapter = (function (_super) {\n    __extends(BrowserDomAdapter, _super);\n    function BrowserDomAdapter() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @param {?} templateHtml\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.parse = function (templateHtml) { throw new Error('parse not implemented'); };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.makeCurrent = function () { setRootDomAdapter(new BrowserDomAdapter()); };\n    /**\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.hasProperty = function (element, name) { return name in element; };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setProperty = function (el, name, value) { ((el))[name] = value; };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getProperty = function (el, name) { return ((el))[name]; };\n    /**\n     * @param {?} el\n     * @param {?} methodName\n     * @param {?} args\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.invoke = function (el, methodName, args) { ((el))[methodName].apply(((el)), args); };\n    /**\n     * @param {?} error\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.logError = function (error) {\n        if (window.console) {\n            if (console.error) {\n                console.error(error);\n            }\n            else {\n                console.log(error);\n            }\n        }\n    };\n    /**\n     * @param {?} error\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.log = function (error) {\n        if (window.console) {\n            window.console.log && window.console.log(error);\n        }\n    };\n    /**\n     * @param {?} error\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.logGroup = function (error) {\n        if (window.console) {\n            window.console.group && window.console.group(error);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.logGroupEnd = function () {\n        if (window.console) {\n            window.console.groupEnd && window.console.groupEnd();\n        }\n    };\n    Object.defineProperty(BrowserDomAdapter.prototype, \"attrToPropMap\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return _attrToPropMap; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} nodeA\n     * @param {?} nodeB\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.contains = function (nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); };\n    /**\n     * @param {?} el\n     * @param {?} selector\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.querySelector = function (el, selector) { return el.querySelector(selector); };\n    /**\n     * @param {?} el\n     * @param {?} selector\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.querySelectorAll = function (el, selector) { return el.querySelectorAll(selector); };\n    /**\n     * @param {?} el\n     * @param {?} evt\n     * @param {?} listener\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.on = function (el, evt, listener) { el.addEventListener(evt, listener, false); };\n    /**\n     * @param {?} el\n     * @param {?} evt\n     * @param {?} listener\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.onAndCancel = function (el, evt, listener) {\n        el.addEventListener(evt, listener, false);\n        // Needed to follow Dart's subscription semantic, until fix of\n        // https://code.google.com/p/dart/issues/detail?id=17406\n        return function () { el.removeEventListener(evt, listener, false); };\n    };\n    /**\n     * @param {?} el\n     * @param {?} evt\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.dispatchEvent = function (el, evt) { el.dispatchEvent(evt); };\n    /**\n     * @param {?} eventType\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createMouseEvent = function (eventType) {\n        var /** @type {?} */ evt = document.createEvent('MouseEvent');\n        evt.initEvent(eventType, true, true);\n        return evt;\n    };\n    /**\n     * @param {?} eventType\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createEvent = function (eventType) {\n        var /** @type {?} */ evt = document.createEvent('Event');\n        evt.initEvent(eventType, true, true);\n        return evt;\n    };\n    /**\n     * @param {?} evt\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.preventDefault = function (evt) {\n        evt.preventDefault();\n        evt.returnValue = false;\n    };\n    /**\n     * @param {?} evt\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.isPrevented = function (evt) {\n        return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getInnerHTML = function (el) { return el.innerHTML; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getTemplateContent = function (el) {\n        return 'content' in el && el instanceof HTMLTemplateElement ? el.content : null;\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getOuterHTML = function (el) { return el.outerHTML; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.nodeName = function (node) { return node.nodeName; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.nodeValue = function (node) { return node.nodeValue; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.type = function (node) { return node.type; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.content = function (node) {\n        if (this.hasProperty(node, 'content')) {\n            return ((node)).content;\n        }\n        else {\n            return node;\n        }\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.firstChild = function (el) { return el.firstChild; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.nextSibling = function (el) { return el.nextSibling; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.parentElement = function (el) { return el.parentNode; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.childNodes = function (el) { return el.childNodes; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.childNodesAsList = function (el) {\n        var /** @type {?} */ childNodes = el.childNodes;\n        var /** @type {?} */ res = new Array(childNodes.length);\n        for (var /** @type {?} */ i = 0; i < childNodes.length; i++) {\n            res[i] = childNodes[i];\n        }\n        return res;\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.clearNodes = function (el) {\n        while (el.firstChild) {\n            el.removeChild(el.firstChild);\n        }\n    };\n    /**\n     * @param {?} el\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.appendChild = function (el, node) { el.appendChild(node); };\n    /**\n     * @param {?} el\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.removeChild = function (el, node) { el.removeChild(node); };\n    /**\n     * @param {?} el\n     * @param {?} newChild\n     * @param {?} oldChild\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.replaceChild = function (el, newChild, oldChild) { el.replaceChild(newChild, oldChild); };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.remove = function (node) {\n        if (node.parentNode) {\n            node.parentNode.removeChild(node);\n        }\n        return node;\n    };\n    /**\n     * @param {?} parent\n     * @param {?} ref\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.insertBefore = function (parent, ref, node) { parent.insertBefore(node, ref); };\n    /**\n     * @param {?} parent\n     * @param {?} ref\n     * @param {?} nodes\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.insertAllBefore = function (parent, ref, nodes) {\n        nodes.forEach(function (n) { return parent.insertBefore(n, ref); });\n    };\n    /**\n     * @param {?} parent\n     * @param {?} ref\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.insertAfter = function (parent, ref, node) { parent.insertBefore(node, ref.nextSibling); };\n    /**\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setInnerHTML = function (el, value) { el.innerHTML = value; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getText = function (el) { return el.textContent; };\n    /**\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setText = function (el, value) { el.textContent = value; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getValue = function (el) { return el.value; };\n    /**\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setValue = function (el, value) { el.value = value; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getChecked = function (el) { return el.checked; };\n    /**\n     * @param {?} el\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setChecked = function (el, value) { el.checked = value; };\n    /**\n     * @param {?} text\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createComment = function (text) { return document.createComment(text); };\n    /**\n     * @param {?} html\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createTemplate = function (html) {\n        var /** @type {?} */ t = document.createElement('template');\n        t.innerHTML = html;\n        return t;\n    };\n    /**\n     * @param {?} tagName\n     * @param {?=} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createElement = function (tagName, doc) {\n        if (doc === void 0) { doc = document; }\n        return doc.createElement(tagName);\n    };\n    /**\n     * @param {?} ns\n     * @param {?} tagName\n     * @param {?=} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createElementNS = function (ns, tagName, doc) {\n        if (doc === void 0) { doc = document; }\n        return doc.createElementNS(ns, tagName);\n    };\n    /**\n     * @param {?} text\n     * @param {?=} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createTextNode = function (text, doc) {\n        if (doc === void 0) { doc = document; }\n        return doc.createTextNode(text);\n    };\n    /**\n     * @param {?} attrName\n     * @param {?} attrValue\n     * @param {?=} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createScriptTag = function (attrName, attrValue, doc) {\n        if (doc === void 0) { doc = document; }\n        var /** @type {?} */ el = (doc.createElement('SCRIPT'));\n        el.setAttribute(attrName, attrValue);\n        return el;\n    };\n    /**\n     * @param {?} css\n     * @param {?=} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createStyleElement = function (css, doc) {\n        if (doc === void 0) { doc = document; }\n        var /** @type {?} */ style = (doc.createElement('style'));\n        this.appendChild(style, this.createTextNode(css));\n        return style;\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createShadowRoot = function (el) { return ((el)).createShadowRoot(); };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getShadowRoot = function (el) { return ((el)).shadowRoot; };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getHost = function (el) { return ((el)).host; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.clone = function (node) { return node.cloneNode(true); };\n    /**\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getElementsByClassName = function (element, name) {\n        return element.getElementsByClassName(name);\n    };\n    /**\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getElementsByTagName = function (element, name) {\n        return element.getElementsByTagName(name);\n    };\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.classList = function (element) { return Array.prototype.slice.call(element.classList, 0); };\n    /**\n     * @param {?} element\n     * @param {?} className\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.addClass = function (element, className) { element.classList.add(className); };\n    /**\n     * @param {?} element\n     * @param {?} className\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.removeClass = function (element, className) { element.classList.remove(className); };\n    /**\n     * @param {?} element\n     * @param {?} className\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.hasClass = function (element, className) {\n        return element.classList.contains(className);\n    };\n    /**\n     * @param {?} element\n     * @param {?} styleName\n     * @param {?} styleValue\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setStyle = function (element, styleName, styleValue) {\n        element.style[styleName] = styleValue;\n    };\n    /**\n     * @param {?} element\n     * @param {?} stylename\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.removeStyle = function (element, stylename) {\n        // IE requires '' instead of null\n        // see https://github.com/angular/angular/issues/7916\n        element.style[stylename] = '';\n    };\n    /**\n     * @param {?} element\n     * @param {?} stylename\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getStyle = function (element, stylename) { return element.style[stylename]; };\n    /**\n     * @param {?} element\n     * @param {?} styleName\n     * @param {?=} styleValue\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.hasStyle = function (element, styleName, styleValue) {\n        var /** @type {?} */ value = this.getStyle(element, styleName) || '';\n        return styleValue ? value == styleValue : value.length > 0;\n    };\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.tagName = function (element) { return element.tagName; };\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.attributeMap = function (element) {\n        var /** @type {?} */ res = new Map();\n        var /** @type {?} */ elAttrs = element.attributes;\n        for (var /** @type {?} */ i = 0; i < elAttrs.length; i++) {\n            var /** @type {?} */ attrib = elAttrs[i];\n            res.set(attrib.name, attrib.value);\n        }\n        return res;\n    };\n    /**\n     * @param {?} element\n     * @param {?} attribute\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.hasAttribute = function (element, attribute) {\n        return element.hasAttribute(attribute);\n    };\n    /**\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} attribute\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.hasAttributeNS = function (element, ns, attribute) {\n        return element.hasAttributeNS(ns, attribute);\n    };\n    /**\n     * @param {?} element\n     * @param {?} attribute\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getAttribute = function (element, attribute) {\n        return element.getAttribute(attribute);\n    };\n    /**\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getAttributeNS = function (element, ns, name) {\n        return element.getAttributeNS(ns, name);\n    };\n    /**\n     * @param {?} element\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setAttribute = function (element, name, value) { element.setAttribute(name, value); };\n    /**\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setAttributeNS = function (element, ns, name, value) {\n        element.setAttributeNS(ns, name, value);\n    };\n    /**\n     * @param {?} element\n     * @param {?} attribute\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.removeAttribute = function (element, attribute) { element.removeAttribute(attribute); };\n    /**\n     * @param {?} element\n     * @param {?} ns\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.removeAttributeNS = function (element, ns, name) {\n        element.removeAttributeNS(ns, name);\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.templateAwareRoot = function (el) { return this.isTemplateElement(el) ? this.content(el) : el; };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.createHtmlDocument = function () {\n        return document.implementation.createHTMLDocument('fakeTitle');\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getBoundingClientRect = function (el) {\n        try {\n            return el.getBoundingClientRect();\n        }\n        catch (e) {\n            return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };\n        }\n    };\n    /**\n     * @param {?} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getTitle = function (doc) { return document.title; };\n    /**\n     * @param {?} doc\n     * @param {?} newTitle\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setTitle = function (doc, newTitle) { document.title = newTitle || ''; };\n    /**\n     * @param {?} n\n     * @param {?} selector\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.elementMatches = function (n, selector) {\n        if (n instanceof HTMLElement) {\n            return n.matches && n.matches(selector) ||\n                n.msMatchesSelector && n.msMatchesSelector(selector) ||\n                n.webkitMatchesSelector && n.webkitMatchesSelector(selector);\n        }\n        return false;\n    };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.isTemplateElement = function (el) {\n        return el instanceof HTMLElement && el.nodeName == 'TEMPLATE';\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.isTextNode = function (node) { return node.nodeType === Node.TEXT_NODE; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.isCommentNode = function (node) { return node.nodeType === Node.COMMENT_NODE; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.hasShadowRoot = function (node) {\n        return node.shadowRoot != null && node instanceof HTMLElement;\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.isShadowRoot = function (node) { return node instanceof DocumentFragment; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.importIntoDoc = function (node) { return document.importNode(this.templateAwareRoot(node), true); };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.adoptNode = function (node) { return document.adoptNode(node); };\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getHref = function (el) { return ((el)).href; };\n    /**\n     * @param {?} event\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getEventKey = function (event) {\n        var /** @type {?} */ key = event.key;\n        if (key == null) {\n            key = event.keyIdentifier;\n            // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and\n            // Safari cf\n            // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces\n            if (key == null) {\n                return 'Unidentified';\n            }\n            if (key.startsWith('U+')) {\n                key = String.fromCharCode(parseInt(key.substring(2), 16));\n                if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {\n                    // There is a bug in Chrome for numeric keypad keys:\n                    // https://code.google.com/p/chromium/issues/detail?id=155654\n                    // 1, 2, 3 ... are reported as A, B, C ...\n                    key = ((_chromeNumKeyPadMap))[key];\n                }\n            }\n        }\n        return _keyMap[key] || key;\n    };\n    /**\n     * @param {?} doc\n     * @param {?} target\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getGlobalEventTarget = function (doc, target) {\n        if (target === 'window') {\n            return window;\n        }\n        if (target === 'document') {\n            return document;\n        }\n        if (target === 'body') {\n            return document.body;\n        }\n        return null;\n    };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getHistory = function () { return window.history; };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getLocation = function () { return window.location; };\n    /**\n     * @param {?} doc\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getBaseHref = function (doc) {\n        var /** @type {?} */ href = getBaseElementHref();\n        return href == null ? null : relativePath(href);\n    };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.resetBaseElement = function () { baseElement = null; };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getUserAgent = function () { return window.navigator.userAgent; };\n    /**\n     * @param {?} element\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setData = function (element, name, value) {\n        this.setAttribute(element, 'data-' + name, value);\n    };\n    /**\n     * @param {?} element\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getData = function (element, name) {\n        return this.getAttribute(element, 'data-' + name);\n    };\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getComputedStyle = function (element) { return getComputedStyle(element); };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.supportsWebAnimation = function () {\n        return typeof ((Element)).prototype['animate'] === 'function';\n    };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.performanceNow = function () {\n        // performance.now() is not available in all browsers, see\n        // http://caniuse.com/#search=performance.now\n        return window.performance && window.performance.now ? window.performance.now() :\n            new Date().getTime();\n    };\n    /**\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.supportsCookies = function () { return true; };\n    /**\n     * @param {?} name\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.getCookie = function (name) { return parseCookieValue(document.cookie, name); };\n    /**\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    BrowserDomAdapter.prototype.setCookie = function (name, value) {\n        // document.cookie is magical, assigning into it assigns/overrides one cookie value, but does\n        // not clear other cookies.\n        document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);\n    };\n    return BrowserDomAdapter;\n}(GenericBrowserDomAdapter));\nvar baseElement = null;\n/**\n * @return {?}\n */\nfunction getBaseElementHref() {\n    if (!baseElement) {\n        baseElement = ((document.querySelector('base')));\n        if (!baseElement) {\n            return null;\n        }\n    }\n    return baseElement.getAttribute('href');\n}\n// based on urlUtils.js in AngularJS 1\nvar urlParsingNode;\n/**\n * @param {?} url\n * @return {?}\n */\nfunction relativePath(url) {\n    if (!urlParsingNode) {\n        urlParsingNode = document.createElement('a');\n    }\n    urlParsingNode.setAttribute('href', url);\n    return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :\n        '/' + urlParsingNode.pathname;\n}\n/**\n * @param {?} cookieStr\n * @param {?} name\n * @return {?}\n */\nfunction parseCookieValue(cookieStr, name) {\n    name = encodeURIComponent(name);\n    for (var _i = 0, _a = cookieStr.split(';'); _i < _a.length; _i++) {\n        var cookie = _a[_i];\n        var /** @type {?} */ eqIndex = cookie.indexOf('=');\n        var _b = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)], cookieName = _b[0], cookieValue = _b[1];\n        if (cookieName.trim() === name) {\n            return decodeURIComponent(cookieValue);\n        }\n    }\n    return null;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n *\n * Note: Document might not be available in the Application Context when Application and Rendering\n * Contexts are not the same (e.g. when running the application into a Web Worker).\n *\n * \\@stable\n */\nvar DOCUMENT = new _angular_core.InjectionToken('DocumentToken');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n * @return {?}\n */\nfunction supportsState() {\n    return !!window.history.pushState;\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * `PlatformLocation` encapsulates all of the direct calls to platform APIs.\n * This class should not be used directly by an application developer. Instead, use\n * {\\@link Location}.\n */\nvar BrowserPlatformLocation = (function (_super) {\n    __extends(BrowserPlatformLocation, _super);\n    /**\n     * @param {?} _doc\n     */\n    function BrowserPlatformLocation(_doc) {\n        var _this = _super.call(this) || this;\n        _this._doc = _doc;\n        _this._init();\n        return _this;\n    }\n    /**\n     * \\@internal\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype._init = function () {\n        this._location = getDOM().getLocation();\n        this._history = getDOM().getHistory();\n    };\n    Object.defineProperty(BrowserPlatformLocation.prototype, \"location\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._location; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.getBaseHrefFromDOM = function () { return ((getDOM().getBaseHref(this._doc))); };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.onPopState = function (fn) {\n        getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);\n    };\n    /**\n     * @param {?} fn\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.onHashChange = function (fn) {\n        getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);\n    };\n    Object.defineProperty(BrowserPlatformLocation.prototype, \"pathname\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._location.pathname; },\n        /**\n         * @param {?} newPath\n         * @return {?}\n         */\n        set: function (newPath) { this._location.pathname = newPath; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BrowserPlatformLocation.prototype, \"search\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._location.search; },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BrowserPlatformLocation.prototype, \"hash\", {\n        /**\n         * @return {?}\n         */\n        get: function () { return this._location.hash; },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.pushState = function (state, title, url) {\n        if (supportsState()) {\n            this._history.pushState(state, title, url);\n        }\n        else {\n            this._location.hash = url;\n        }\n    };\n    /**\n     * @param {?} state\n     * @param {?} title\n     * @param {?} url\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.replaceState = function (state, title, url) {\n        if (supportsState()) {\n            this._history.replaceState(state, title, url);\n        }\n        else {\n            this._location.hash = url;\n        }\n    };\n    /**\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.forward = function () { this._history.forward(); };\n    /**\n     * @return {?}\n     */\n    BrowserPlatformLocation.prototype.back = function () { this._history.back(); };\n    return BrowserPlatformLocation;\n}(_angular_common.PlatformLocation));\nBrowserPlatformLocation.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nBrowserPlatformLocation.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A service that can be used to get and add meta tags.\n *\n * \\@experimental\n */\nvar Meta = (function () {\n    /**\n     * @param {?} _doc\n     */\n    function Meta(_doc) {\n        this._doc = _doc;\n        this._dom = getDOM();\n    }\n    /**\n     * @param {?} tag\n     * @param {?=} forceCreation\n     * @return {?}\n     */\n    Meta.prototype.addTag = function (tag, forceCreation) {\n        if (forceCreation === void 0) { forceCreation = false; }\n        if (!tag)\n            return null;\n        return this._getOrCreateElement(tag, forceCreation);\n    };\n    /**\n     * @param {?} tags\n     * @param {?=} forceCreation\n     * @return {?}\n     */\n    Meta.prototype.addTags = function (tags, forceCreation) {\n        var _this = this;\n        if (forceCreation === void 0) { forceCreation = false; }\n        if (!tags)\n            return [];\n        return tags.reduce(function (result, tag) {\n            if (tag) {\n                result.push(_this._getOrCreateElement(tag, forceCreation));\n            }\n            return result;\n        }, []);\n    };\n    /**\n     * @param {?} attrSelector\n     * @return {?}\n     */\n    Meta.prototype.getTag = function (attrSelector) {\n        if (!attrSelector)\n            return null;\n        return this._dom.querySelector(this._doc, \"meta[\" + attrSelector + \"]\");\n    };\n    /**\n     * @param {?} attrSelector\n     * @return {?}\n     */\n    Meta.prototype.getTags = function (attrSelector) {\n        if (!attrSelector)\n            return [];\n        var /** @type {?} */ list /*NodeList*/ = this._dom.querySelectorAll(this._doc, \"meta[\" + attrSelector + \"]\");\n        return list ? [].slice.call(list) : [];\n    };\n    /**\n     * @param {?} tag\n     * @param {?=} selector\n     * @return {?}\n     */\n    Meta.prototype.updateTag = function (tag, selector) {\n        if (!tag)\n            return null;\n        selector = selector || this._parseSelector(tag);\n        var /** @type {?} */ meta = ((this.getTag(selector)));\n        if (meta) {\n            return this._setMetaElementAttributes(tag, meta);\n        }\n        return this._getOrCreateElement(tag, true);\n    };\n    /**\n     * @param {?} attrSelector\n     * @return {?}\n     */\n    Meta.prototype.removeTag = function (attrSelector) { this.removeTagElement(/** @type {?} */ ((this.getTag(attrSelector)))); };\n    /**\n     * @param {?} meta\n     * @return {?}\n     */\n    Meta.prototype.removeTagElement = function (meta) {\n        if (meta) {\n            this._dom.remove(meta);\n        }\n    };\n    /**\n     * @param {?} meta\n     * @param {?=} forceCreation\n     * @return {?}\n     */\n    Meta.prototype._getOrCreateElement = function (meta, forceCreation) {\n        if (forceCreation === void 0) { forceCreation = false; }\n        if (!forceCreation) {\n            var /** @type {?} */ selector = this._parseSelector(meta);\n            var /** @type {?} */ elem = ((this.getTag(selector)));\n            // It's allowed to have multiple elements with the same name so it's not enough to\n            // just check that element with the same name already present on the page. We also need to\n            // check if element has tag attributes\n            if (elem && this._containsAttributes(meta, elem))\n                return elem;\n        }\n        var /** @type {?} */ element = (this._dom.createElement('meta'));\n        this._setMetaElementAttributes(meta, element);\n        var /** @type {?} */ head = this._dom.getElementsByTagName(this._doc, 'head')[0];\n        this._dom.appendChild(head, element);\n        return element;\n    };\n    /**\n     * @param {?} tag\n     * @param {?} el\n     * @return {?}\n     */\n    Meta.prototype._setMetaElementAttributes = function (tag, el) {\n        var _this = this;\n        Object.keys(tag).forEach(function (prop) { return _this._dom.setAttribute(el, prop, tag[prop]); });\n        return el;\n    };\n    /**\n     * @param {?} tag\n     * @return {?}\n     */\n    Meta.prototype._parseSelector = function (tag) {\n        var /** @type {?} */ attr = tag.name ? 'name' : 'property';\n        return attr + \"=\\\"\" + tag[attr] + \"\\\"\";\n    };\n    /**\n     * @param {?} tag\n     * @param {?} elem\n     * @return {?}\n     */\n    Meta.prototype._containsAttributes = function (tag, elem) {\n        var _this = this;\n        return Object.keys(tag).every(function (key) { return _this._dom.getAttribute(elem, key) === tag[key]; });\n    };\n    return Meta;\n}());\nMeta.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nMeta.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * An id that identifies a particular application being bootstrapped, that should\n * match across the client/server boundary.\n */\nvar TRANSITION_ID = new _angular_core.InjectionToken('TRANSITION_ID');\n/**\n * @param {?} transitionId\n * @param {?} document\n * @param {?} injector\n * @return {?}\n */\nfunction appInitializerFactory(transitionId, document, injector) {\n    return function () {\n        // Wait for all application initializers to be completed before removing the styles set by\n        // the server.\n        injector.get(_angular_core.ApplicationInitStatus).donePromise.then(function () {\n            var /** @type {?} */ dom = getDOM();\n            var /** @type {?} */ styles = Array.prototype.slice.apply(dom.querySelectorAll(document, \"style[ng-transition]\"));\n            styles.filter(function (el) { return dom.getAttribute(el, 'ng-transition') === transitionId; })\n                .forEach(function (el) { return dom.remove(el); });\n        });\n    };\n}\nvar SERVER_TRANSITION_PROVIDERS = [\n    {\n        provide: _angular_core.APP_INITIALIZER,\n        useFactory: appInitializerFactory,\n        deps: [TRANSITION_ID, DOCUMENT, _angular_core.Injector],\n        multi: true\n    },\n];\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar BrowserGetTestability = (function () {\n    function BrowserGetTestability() {\n    }\n    /**\n     * @return {?}\n     */\n    BrowserGetTestability.init = function () { _angular_core.setTestabilityGetter(new BrowserGetTestability()); };\n    /**\n     * @param {?} registry\n     * @return {?}\n     */\n    BrowserGetTestability.prototype.addToWindow = function (registry) {\n        _angular_core.ɵglobal['getAngularTestability'] = function (elem, findInAncestors) {\n            if (findInAncestors === void 0) { findInAncestors = true; }\n            var /** @type {?} */ testability = registry.findTestabilityInTree(elem, findInAncestors);\n            if (testability == null) {\n                throw new Error('Could not find testability for element.');\n            }\n            return testability;\n        };\n        _angular_core.ɵglobal['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };\n        _angular_core.ɵglobal['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };\n        var /** @type {?} */ whenAllStable = function (callback /** TODO #9100 */) {\n            var /** @type {?} */ testabilities = _angular_core.ɵglobal['getAllAngularTestabilities']();\n            var /** @type {?} */ count = testabilities.length;\n            var /** @type {?} */ didWork = false;\n            var /** @type {?} */ decrement = function (didWork_ /** TODO #9100 */) {\n                didWork = didWork || didWork_;\n                count--;\n                if (count == 0) {\n                    callback(didWork);\n                }\n            };\n            testabilities.forEach(function (testability /** TODO #9100 */) {\n                testability.whenStable(decrement);\n            });\n        };\n        if (!_angular_core.ɵglobal['frameworkStabilizers']) {\n            _angular_core.ɵglobal['frameworkStabilizers'] = [];\n        }\n        _angular_core.ɵglobal['frameworkStabilizers'].push(whenAllStable);\n    };\n    /**\n     * @param {?} registry\n     * @param {?} elem\n     * @param {?} findInAncestors\n     * @return {?}\n     */\n    BrowserGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {\n        if (elem == null) {\n            return null;\n        }\n        var /** @type {?} */ t = registry.getTestability(elem);\n        if (t != null) {\n            return t;\n        }\n        else if (!findInAncestors) {\n            return null;\n        }\n        if (getDOM().isShadowRoot(elem)) {\n            return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);\n        }\n        return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);\n    };\n    return BrowserGetTestability;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A service that can be used to get and set the title of a current HTML document.\n *\n * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)\n * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements\n * (representing the `<title>` tag). Instead, this service can be used to set and get the current\n * title value.\n *\n * \\@experimental\n */\nvar Title = (function () {\n    /**\n     * @param {?} _doc\n     */\n    function Title(_doc) {\n        this._doc = _doc;\n    }\n    /**\n     * Get the title of the current HTML document.\n     * @return {?}\n     */\n    Title.prototype.getTitle = function () { return getDOM().getTitle(this._doc); };\n    /**\n     * Set the title of the current HTML document.\n     * @param {?} newTitle\n     * @return {?}\n     */\n    Title.prototype.setTitle = function (newTitle) { getDOM().setTitle(this._doc, newTitle); };\n    return Title;\n}());\nTitle.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nTitle.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @param {?} input\n * @return {?}\n */\n/**\n * @param {?} input\n * @return {?}\n */\n/**\n * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if\n * `name` is `'probe'`.\n * @param {?} name Name under which it will be exported. Keep in mind this will be a property of the\n * global `ng` object.\n * @param {?} value The value to export.\n * @return {?}\n */\nfunction exportNgVar(name, value) {\n    if (!ng) {\n        _angular_core.ɵglobal['ng'] = ng = ((_angular_core.ɵglobal['ng'])) || {};\n    }\n    ng[name] = value;\n}\nvar ng;\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar CORE_TOKENS = {\n    'ApplicationRef': _angular_core.ApplicationRef,\n    'NgZone': _angular_core.NgZone,\n};\nvar INSPECT_GLOBAL_NAME = 'probe';\nvar CORE_TOKENS_GLOBAL_NAME = 'coreTokens';\n/**\n * Returns a {\\@link DebugElement} for the given native DOM element, or\n * null if the given native element does not have an Angular view associated\n * with it.\n * @param {?} element\n * @return {?}\n */\nfunction inspectNativeElement(element) {\n    return _angular_core.getDebugNode(element);\n}\n/**\n * Deprecated. Use the one from '\\@angular/core'.\n * @deprecated\n */\nvar NgProbeToken$1 = (function () {\n    /**\n     * @param {?} name\n     * @param {?} token\n     */\n    function NgProbeToken$1(name, token) {\n        this.name = name;\n        this.token = token;\n    }\n    return NgProbeToken$1;\n}());\n/**\n * @param {?} extraTokens\n * @param {?} coreTokens\n * @return {?}\n */\nfunction _createNgProbe(extraTokens, coreTokens) {\n    var /** @type {?} */ tokens = (extraTokens || []).concat(coreTokens || []);\n    exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);\n    exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object.assign({}, CORE_TOKENS, _ngProbeTokensToMap(tokens || [])));\n    return function () { return inspectNativeElement; };\n}\n/**\n * @param {?} tokens\n * @return {?}\n */\nfunction _ngProbeTokensToMap(tokens) {\n    return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});\n}\n/**\n * Providers which support debugging Angular applications (e.g. via `ng.probe`).\n */\nvar ELEMENT_PROBE_PROVIDERS = [\n    {\n        provide: _angular_core.APP_INITIALIZER,\n        useFactory: _createNgProbe,\n        deps: [\n            [NgProbeToken$1, new _angular_core.Optional()],\n            [_angular_core.NgProbeToken, new _angular_core.Optional()],\n        ],\n        multi: true,\n    },\n];\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * \\@stable\n */\nvar EVENT_MANAGER_PLUGINS = new _angular_core.InjectionToken('EventManagerPlugins');\n/**\n * \\@stable\n */\nvar EventManager = (function () {\n    /**\n     * @param {?} plugins\n     * @param {?} _zone\n     */\n    function EventManager(plugins, _zone) {\n        var _this = this;\n        this._zone = _zone;\n        this._eventNameToPlugin = new Map();\n        plugins.forEach(function (p) { return p.manager = _this; });\n        this._plugins = plugins.slice().reverse();\n    }\n    /**\n     * @param {?} element\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    EventManager.prototype.addEventListener = function (element, eventName, handler) {\n        var /** @type {?} */ plugin = this._findPluginFor(eventName);\n        return plugin.addEventListener(element, eventName, handler);\n    };\n    /**\n     * @param {?} target\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {\n        var /** @type {?} */ plugin = this._findPluginFor(eventName);\n        return plugin.addGlobalEventListener(target, eventName, handler);\n    };\n    /**\n     * @return {?}\n     */\n    EventManager.prototype.getZone = function () { return this._zone; };\n    /**\n     * \\@internal\n     * @param {?} eventName\n     * @return {?}\n     */\n    EventManager.prototype._findPluginFor = function (eventName) {\n        var /** @type {?} */ plugin = this._eventNameToPlugin.get(eventName);\n        if (plugin) {\n            return plugin;\n        }\n        var /** @type {?} */ plugins = this._plugins;\n        for (var /** @type {?} */ i = 0; i < plugins.length; i++) {\n            var /** @type {?} */ plugin_1 = plugins[i];\n            if (plugin_1.supports(eventName)) {\n                this._eventNameToPlugin.set(eventName, plugin_1);\n                return plugin_1;\n            }\n        }\n        throw new Error(\"No event manager plugin found for event \" + eventName);\n    };\n    return EventManager;\n}());\nEventManager.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nEventManager.ctorParameters = function () { return [\n    { type: Array, decorators: [{ type: _angular_core.Inject, args: [EVENT_MANAGER_PLUGINS,] },] },\n    { type: _angular_core.NgZone, },\n]; };\n/**\n * @abstract\n */\nvar EventManagerPlugin = (function () {\n    /**\n     * @param {?} _doc\n     */\n    function EventManagerPlugin(_doc) {\n        this._doc = _doc;\n    }\n    /**\n     * @abstract\n     * @param {?} eventName\n     * @return {?}\n     */\n    EventManagerPlugin.prototype.supports = function (eventName) { };\n    /**\n     * @abstract\n     * @param {?} element\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    EventManagerPlugin.prototype.addEventListener = function (element, eventName, handler) { };\n    /**\n     * @param {?} element\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) {\n        var /** @type {?} */ target = getDOM().getGlobalEventTarget(this._doc, element);\n        if (!target) {\n            throw new Error(\"Unsupported event target \" + target + \" for event \" + eventName);\n        }\n        return this.addEventListener(target, eventName, handler);\n    };\n    \n    return EventManagerPlugin;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar SharedStylesHost = (function () {\n    function SharedStylesHost() {\n        /**\n         * \\@internal\n         */\n        this._stylesSet = new Set();\n    }\n    /**\n     * @param {?} styles\n     * @return {?}\n     */\n    SharedStylesHost.prototype.addStyles = function (styles) {\n        var _this = this;\n        var /** @type {?} */ additions = new Set();\n        styles.forEach(function (style) {\n            if (!_this._stylesSet.has(style)) {\n                _this._stylesSet.add(style);\n                additions.add(style);\n            }\n        });\n        this.onStylesAdded(additions);\n    };\n    /**\n     * @param {?} additions\n     * @return {?}\n     */\n    SharedStylesHost.prototype.onStylesAdded = function (additions) { };\n    /**\n     * @return {?}\n     */\n    SharedStylesHost.prototype.getAllStyles = function () { return Array.from(this._stylesSet); };\n    return SharedStylesHost;\n}());\nSharedStylesHost.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nSharedStylesHost.ctorParameters = function () { return []; };\nvar DomSharedStylesHost = (function (_super) {\n    __extends(DomSharedStylesHost, _super);\n    /**\n     * @param {?} _doc\n     */\n    function DomSharedStylesHost(_doc) {\n        var _this = _super.call(this) || this;\n        _this._doc = _doc;\n        _this._hostNodes = new Set();\n        _this._styleNodes = new Set();\n        _this._hostNodes.add(_doc.head);\n        return _this;\n    }\n    /**\n     * @param {?} styles\n     * @param {?} host\n     * @return {?}\n     */\n    DomSharedStylesHost.prototype._addStylesToHost = function (styles, host) {\n        var _this = this;\n        styles.forEach(function (style) {\n            var /** @type {?} */ styleEl = _this._doc.createElement('style');\n            styleEl.textContent = style;\n            _this._styleNodes.add(host.appendChild(styleEl));\n        });\n    };\n    /**\n     * @param {?} hostNode\n     * @return {?}\n     */\n    DomSharedStylesHost.prototype.addHost = function (hostNode) {\n        this._addStylesToHost(this._stylesSet, hostNode);\n        this._hostNodes.add(hostNode);\n    };\n    /**\n     * @param {?} hostNode\n     * @return {?}\n     */\n    DomSharedStylesHost.prototype.removeHost = function (hostNode) { this._hostNodes.delete(hostNode); };\n    /**\n     * @param {?} additions\n     * @return {?}\n     */\n    DomSharedStylesHost.prototype.onStylesAdded = function (additions) {\n        var _this = this;\n        this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });\n    };\n    /**\n     * @return {?}\n     */\n    DomSharedStylesHost.prototype.ngOnDestroy = function () { this._styleNodes.forEach(function (styleNode) { return getDOM().remove(styleNode); }); };\n    return DomSharedStylesHost;\n}(SharedStylesHost));\nDomSharedStylesHost.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nDomSharedStylesHost.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar NAMESPACE_URIS = {\n    'svg': 'http://www.w3.org/2000/svg',\n    'xhtml': 'http://www.w3.org/1999/xhtml',\n    'xlink': 'http://www.w3.org/1999/xlink',\n    'xml': 'http://www.w3.org/XML/1998/namespace',\n    'xmlns': 'http://www.w3.org/2000/xmlns/',\n};\nvar COMPONENT_REGEX = /%COMP%/g;\nvar COMPONENT_VARIABLE = '%COMP%';\nvar HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\nvar CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\n/**\n * @param {?} componentShortId\n * @return {?}\n */\nfunction shimContentAttribute(componentShortId) {\n    return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n/**\n * @param {?} componentShortId\n * @return {?}\n */\nfunction shimHostAttribute(componentShortId) {\n    return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n/**\n * @param {?} compId\n * @param {?} styles\n * @param {?} target\n * @return {?}\n */\nfunction flattenStyles(compId, styles, target) {\n    for (var /** @type {?} */ i = 0; i < styles.length; i++) {\n        var /** @type {?} */ style = styles[i];\n        if (Array.isArray(style)) {\n            flattenStyles(compId, style, target);\n        }\n        else {\n            style = style.replace(COMPONENT_REGEX, compId);\n            target.push(style);\n        }\n    }\n    return target;\n}\n/**\n * @param {?} eventHandler\n * @return {?}\n */\nfunction decoratePreventDefault(eventHandler) {\n    return function (event) {\n        var /** @type {?} */ allowDefaultBehavior = eventHandler(event);\n        if (allowDefaultBehavior === false) {\n            // TODO(tbosch): move preventDefault into event plugins...\n            event.preventDefault();\n            event.returnValue = false;\n        }\n    };\n}\nvar DomRendererFactory2 = (function () {\n    /**\n     * @param {?} eventManager\n     * @param {?} sharedStylesHost\n     */\n    function DomRendererFactory2(eventManager, sharedStylesHost) {\n        this.eventManager = eventManager;\n        this.sharedStylesHost = sharedStylesHost;\n        this.rendererByCompId = new Map();\n        this.defaultRenderer = new DefaultDomRenderer2(eventManager);\n    }\n    \n    /**\n     * @param {?} element\n     * @param {?} type\n     * @return {?}\n     */\n    DomRendererFactory2.prototype.createRenderer = function (element, type) {\n        if (!element || !type) {\n            return this.defaultRenderer;\n        }\n        switch (type.encapsulation) {\n            case _angular_core.ViewEncapsulation.Emulated: {\n                var /** @type {?} */ renderer = this.rendererByCompId.get(type.id);\n                if (!renderer) {\n                    renderer =\n                        new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type);\n                    this.rendererByCompId.set(type.id, renderer);\n                }\n                ((renderer)).applyToHost(element);\n                return renderer;\n            }\n            case _angular_core.ViewEncapsulation.Native:\n                return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);\n            default: {\n                if (!this.rendererByCompId.has(type.id)) {\n                    var /** @type {?} */ styles = flattenStyles(type.id, type.styles, []);\n                    this.sharedStylesHost.addStyles(styles);\n                    this.rendererByCompId.set(type.id, this.defaultRenderer);\n                }\n                return this.defaultRenderer;\n            }\n        }\n    };\n    /**\n     * @return {?}\n     */\n    DomRendererFactory2.prototype.begin = function () { };\n    /**\n     * @return {?}\n     */\n    DomRendererFactory2.prototype.end = function () { };\n    return DomRendererFactory2;\n}());\nDomRendererFactory2.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nDomRendererFactory2.ctorParameters = function () { return [\n    { type: EventManager, },\n    { type: DomSharedStylesHost, },\n]; };\nvar DefaultDomRenderer2 = (function () {\n    /**\n     * @param {?} eventManager\n     */\n    function DefaultDomRenderer2(eventManager) {\n        this.eventManager = eventManager;\n        this.data = Object.create(null);\n    }\n    /**\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.destroy = function () { };\n    /**\n     * @param {?} name\n     * @param {?=} namespace\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.createElement = function (name, namespace) {\n        if (namespace) {\n            return document.createElementNS(NAMESPACE_URIS[namespace], name);\n        }\n        return document.createElement(name);\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.createComment = function (value) { return document.createComment(value); };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.createText = function (value) { return document.createTextNode(value); };\n    /**\n     * @param {?} parent\n     * @param {?} newChild\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.appendChild = function (parent, newChild) { parent.appendChild(newChild); };\n    /**\n     * @param {?} parent\n     * @param {?} newChild\n     * @param {?} refChild\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {\n        if (parent) {\n            parent.insertBefore(newChild, refChild);\n        }\n    };\n    /**\n     * @param {?} parent\n     * @param {?} oldChild\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.removeChild = function (parent, oldChild) {\n        if (parent) {\n            parent.removeChild(oldChild);\n        }\n    };\n    /**\n     * @param {?} selectorOrNode\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.selectRootElement = function (selectorOrNode) {\n        var /** @type {?} */ el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :\n            selectorOrNode;\n        if (!el) {\n            throw new Error(\"The selector \\\"\" + selectorOrNode + \"\\\" did not match any elements\");\n        }\n        el.textContent = '';\n        return el;\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.parentNode = function (node) { return node.parentNode; };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.nextSibling = function (node) { return node.nextSibling; };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @param {?=} namespace\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.setAttribute = function (el, name, value, namespace) {\n        if (namespace) {\n            name = namespace + \":\" + name;\n            var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];\n            if (namespaceUri) {\n                el.setAttributeNS(namespaceUri, name, value);\n            }\n            else {\n                el.setAttribute(name, value);\n            }\n        }\n        else {\n            el.setAttribute(name, value);\n        }\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?=} namespace\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.removeAttribute = function (el, name, namespace) {\n        if (namespace) {\n            var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];\n            if (namespaceUri) {\n                el.removeAttributeNS(namespaceUri, name);\n            }\n            else {\n                el.removeAttribute(namespace + \":\" + name);\n            }\n        }\n        else {\n            el.removeAttribute(name);\n        }\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.addClass = function (el, name) { el.classList.add(name); };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.removeClass = function (el, name) { el.classList.remove(name); };\n    /**\n     * @param {?} el\n     * @param {?} style\n     * @param {?} value\n     * @param {?} flags\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.setStyle = function (el, style, value, flags) {\n        if (flags & _angular_core.RendererStyleFlags2.DashCase) {\n            el.style.setProperty(style, value, !!(flags & _angular_core.RendererStyleFlags2.Important) ? 'important' : '');\n        }\n        else {\n            el.style[style] = value;\n        }\n    };\n    /**\n     * @param {?} el\n     * @param {?} style\n     * @param {?} flags\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.removeStyle = function (el, style, flags) {\n        if (flags & _angular_core.RendererStyleFlags2.DashCase) {\n            el.style.removeProperty(style);\n        }\n        else {\n            // IE requires '' instead of null\n            // see https://github.com/angular/angular/issues/7916\n            el.style[style] = '';\n        }\n    };\n    /**\n     * @param {?} el\n     * @param {?} name\n     * @param {?} value\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.setProperty = function (el, name, value) {\n        checkNoSyntheticProp(name, 'property');\n        el[name] = value;\n    };\n    /**\n     * @param {?} node\n     * @param {?} value\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.setValue = function (node, value) { node.nodeValue = value; };\n    /**\n     * @param {?} target\n     * @param {?} event\n     * @param {?} callback\n     * @return {?}\n     */\n    DefaultDomRenderer2.prototype.listen = function (target, event, callback) {\n        checkNoSyntheticProp(event, 'listener');\n        if (typeof target === 'string') {\n            return (this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback)));\n        }\n        return ((this.eventManager.addEventListener(target, event, decoratePreventDefault(callback))));\n    };\n    return DefaultDomRenderer2;\n}());\nvar AT_CHARCODE = '@'.charCodeAt(0);\n/**\n * @param {?} name\n * @param {?} nameKind\n * @return {?}\n */\nfunction checkNoSyntheticProp(name, nameKind) {\n    if (name.charCodeAt(0) === AT_CHARCODE) {\n        throw new Error(\"Found the synthetic \" + nameKind + \" \" + name + \". Please include either \\\"BrowserAnimationsModule\\\" or \\\"NoopAnimationsModule\\\" in your application.\");\n    }\n}\nvar EmulatedEncapsulationDomRenderer2 = (function (_super) {\n    __extends(EmulatedEncapsulationDomRenderer2, _super);\n    /**\n     * @param {?} eventManager\n     * @param {?} sharedStylesHost\n     * @param {?} component\n     */\n    function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component) {\n        var _this = _super.call(this, eventManager) || this;\n        _this.component = component;\n        var styles = flattenStyles(component.id, component.styles, []);\n        sharedStylesHost.addStyles(styles);\n        _this.contentAttr = shimContentAttribute(component.id);\n        _this.hostAttr = shimHostAttribute(component.id);\n        return _this;\n    }\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    EmulatedEncapsulationDomRenderer2.prototype.applyToHost = function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };\n    /**\n     * @param {?} parent\n     * @param {?} name\n     * @return {?}\n     */\n    EmulatedEncapsulationDomRenderer2.prototype.createElement = function (parent, name) {\n        var /** @type {?} */ el = _super.prototype.createElement.call(this, parent, name);\n        _super.prototype.setAttribute.call(this, el, this.contentAttr, '');\n        return el;\n    };\n    return EmulatedEncapsulationDomRenderer2;\n}(DefaultDomRenderer2));\nvar ShadowDomRenderer = (function (_super) {\n    __extends(ShadowDomRenderer, _super);\n    /**\n     * @param {?} eventManager\n     * @param {?} sharedStylesHost\n     * @param {?} hostEl\n     * @param {?} component\n     */\n    function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {\n        var _this = _super.call(this, eventManager) || this;\n        _this.sharedStylesHost = sharedStylesHost;\n        _this.hostEl = hostEl;\n        _this.component = component;\n        _this.shadowRoot = hostEl.createShadowRoot();\n        _this.sharedStylesHost.addHost(_this.shadowRoot);\n        var styles = flattenStyles(component.id, component.styles, []);\n        for (var i = 0; i < styles.length; i++) {\n            var styleEl = document.createElement('style');\n            styleEl.textContent = styles[i];\n            _this.shadowRoot.appendChild(styleEl);\n        }\n        return _this;\n    }\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    ShadowDomRenderer.prototype.nodeOrShadowRoot = function (node) { return node === this.hostEl ? this.shadowRoot : node; };\n    /**\n     * @return {?}\n     */\n    ShadowDomRenderer.prototype.destroy = function () { this.sharedStylesHost.removeHost(this.shadowRoot); };\n    /**\n     * @param {?} parent\n     * @param {?} newChild\n     * @return {?}\n     */\n    ShadowDomRenderer.prototype.appendChild = function (parent, newChild) {\n        return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);\n    };\n    /**\n     * @param {?} parent\n     * @param {?} newChild\n     * @param {?} refChild\n     * @return {?}\n     */\n    ShadowDomRenderer.prototype.insertBefore = function (parent, newChild, refChild) {\n        return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);\n    };\n    /**\n     * @param {?} parent\n     * @param {?} oldChild\n     * @return {?}\n     */\n    ShadowDomRenderer.prototype.removeChild = function (parent, oldChild) {\n        return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);\n    };\n    /**\n     * @param {?} node\n     * @return {?}\n     */\n    ShadowDomRenderer.prototype.parentNode = function (node) {\n        return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));\n    };\n    return ShadowDomRenderer;\n}(DefaultDomRenderer2));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar DomEventsPlugin = (function (_super) {\n    __extends(DomEventsPlugin, _super);\n    /**\n     * @param {?} doc\n     */\n    function DomEventsPlugin(doc) {\n        return _super.call(this, doc) || this;\n    }\n    /**\n     * @param {?} eventName\n     * @return {?}\n     */\n    DomEventsPlugin.prototype.supports = function (eventName) { return true; };\n    /**\n     * @param {?} element\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    DomEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {\n        element.addEventListener(eventName, /** @type {?} */ (handler), false);\n        return function () { return element.removeEventListener(eventName, /** @type {?} */ (handler), false); };\n    };\n    return DomEventsPlugin;\n}(EventManagerPlugin));\nDomEventsPlugin.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nDomEventsPlugin.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar EVENT_NAMES = {\n    // pan\n    'pan': true,\n    'panstart': true,\n    'panmove': true,\n    'panend': true,\n    'pancancel': true,\n    'panleft': true,\n    'panright': true,\n    'panup': true,\n    'pandown': true,\n    // pinch\n    'pinch': true,\n    'pinchstart': true,\n    'pinchmove': true,\n    'pinchend': true,\n    'pinchcancel': true,\n    'pinchin': true,\n    'pinchout': true,\n    // press\n    'press': true,\n    'pressup': true,\n    // rotate\n    'rotate': true,\n    'rotatestart': true,\n    'rotatemove': true,\n    'rotateend': true,\n    'rotatecancel': true,\n    // swipe\n    'swipe': true,\n    'swipeleft': true,\n    'swiperight': true,\n    'swipeup': true,\n    'swipedown': true,\n    // tap\n    'tap': true,\n};\n/**\n * A DI token that you can use to provide{\\@link HammerGestureConfig} to Angular. Use it to configure\n * Hammer gestures.\n *\n * \\@experimental\n */\nvar HAMMER_GESTURE_CONFIG = new _angular_core.InjectionToken('HammerGestureConfig');\n/**\n * \\@experimental\n */\nvar HammerGestureConfig = (function () {\n    function HammerGestureConfig() {\n        this.events = [];\n        this.overrides = {};\n    }\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    HammerGestureConfig.prototype.buildHammer = function (element) {\n        var /** @type {?} */ mc = new Hammer(element);\n        mc.get('pinch').set({ enable: true });\n        mc.get('rotate').set({ enable: true });\n        for (var /** @type {?} */ eventName in this.overrides) {\n            mc.get(eventName).set(this.overrides[eventName]);\n        }\n        return mc;\n    };\n    return HammerGestureConfig;\n}());\nHammerGestureConfig.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nHammerGestureConfig.ctorParameters = function () { return []; };\nvar HammerGesturesPlugin = (function (_super) {\n    __extends(HammerGesturesPlugin, _super);\n    /**\n     * @param {?} doc\n     * @param {?} _config\n     */\n    function HammerGesturesPlugin(doc, _config) {\n        var _this = _super.call(this, doc) || this;\n        _this._config = _config;\n        return _this;\n    }\n    /**\n     * @param {?} eventName\n     * @return {?}\n     */\n    HammerGesturesPlugin.prototype.supports = function (eventName) {\n        if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {\n            return false;\n        }\n        if (!((window)).Hammer) {\n            throw new Error(\"Hammer.js is not loaded, can not bind \" + eventName + \" event\");\n        }\n        return true;\n    };\n    /**\n     * @param {?} element\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    HammerGesturesPlugin.prototype.addEventListener = function (element, eventName, handler) {\n        var _this = this;\n        var /** @type {?} */ zone = this.manager.getZone();\n        eventName = eventName.toLowerCase();\n        return zone.runOutsideAngular(function () {\n            // Creating the manager bind events, must be done outside of angular\n            var /** @type {?} */ mc = _this._config.buildHammer(element);\n            var /** @type {?} */ callback = function (eventObj) {\n                zone.runGuarded(function () { handler(eventObj); });\n            };\n            mc.on(eventName, callback);\n            return function () { return mc.off(eventName, callback); };\n        });\n    };\n    /**\n     * @param {?} eventName\n     * @return {?}\n     */\n    HammerGesturesPlugin.prototype.isCustomEvent = function (eventName) { return this._config.events.indexOf(eventName) > -1; };\n    return HammerGesturesPlugin;\n}(EventManagerPlugin));\nHammerGesturesPlugin.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nHammerGesturesPlugin.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n    { type: HammerGestureConfig, decorators: [{ type: _angular_core.Inject, args: [HAMMER_GESTURE_CONFIG,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];\nvar MODIFIER_KEY_GETTERS = {\n    'alt': function (event) { return event.altKey; },\n    'control': function (event) { return event.ctrlKey; },\n    'meta': function (event) { return event.metaKey; },\n    'shift': function (event) { return event.shiftKey; }\n};\n/**\n * \\@experimental\n */\nvar KeyEventsPlugin = (function (_super) {\n    __extends(KeyEventsPlugin, _super);\n    /**\n     * @param {?} doc\n     */\n    function KeyEventsPlugin(doc) {\n        return _super.call(this, doc) || this;\n    }\n    /**\n     * @param {?} eventName\n     * @return {?}\n     */\n    KeyEventsPlugin.prototype.supports = function (eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; };\n    /**\n     * @param {?} element\n     * @param {?} eventName\n     * @param {?} handler\n     * @return {?}\n     */\n    KeyEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {\n        var /** @type {?} */ parsedEvent = ((KeyEventsPlugin.parseEventName(eventName)));\n        var /** @type {?} */ outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n        return this.manager.getZone().runOutsideAngular(function () {\n            return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n        });\n    };\n    /**\n     * @param {?} eventName\n     * @return {?}\n     */\n    KeyEventsPlugin.parseEventName = function (eventName) {\n        var /** @type {?} */ parts = eventName.toLowerCase().split('.');\n        var /** @type {?} */ domEventName = parts.shift();\n        if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n            return null;\n        }\n        var /** @type {?} */ key = KeyEventsPlugin._normalizeKey(/** @type {?} */ ((parts.pop())));\n        var /** @type {?} */ fullKey = '';\n        MODIFIER_KEYS.forEach(function (modifierName) {\n            var /** @type {?} */ index = parts.indexOf(modifierName);\n            if (index > -1) {\n                parts.splice(index, 1);\n                fullKey += modifierName + '.';\n            }\n        });\n        fullKey += key;\n        if (parts.length != 0 || key.length === 0) {\n            // returning null instead of throwing to let another plugin process the event\n            return null;\n        }\n        var /** @type {?} */ result = {};\n        result['domEventName'] = domEventName;\n        result['fullKey'] = fullKey;\n        return result;\n    };\n    /**\n     * @param {?} event\n     * @return {?}\n     */\n    KeyEventsPlugin.getEventFullKey = function (event) {\n        var /** @type {?} */ fullKey = '';\n        var /** @type {?} */ key = getDOM().getEventKey(event);\n        key = key.toLowerCase();\n        if (key === ' ') {\n            key = 'space'; // for readability\n        }\n        else if (key === '.') {\n            key = 'dot'; // because '.' is used as a separator in event names\n        }\n        MODIFIER_KEYS.forEach(function (modifierName) {\n            if (modifierName != key) {\n                var /** @type {?} */ modifierGetter = MODIFIER_KEY_GETTERS[modifierName];\n                if (modifierGetter(event)) {\n                    fullKey += modifierName + '.';\n                }\n            }\n        });\n        fullKey += key;\n        return fullKey;\n    };\n    /**\n     * @param {?} fullKey\n     * @param {?} handler\n     * @param {?} zone\n     * @return {?}\n     */\n    KeyEventsPlugin.eventCallback = function (fullKey, handler, zone) {\n        return function (event /** TODO #9100 */) {\n            if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n                zone.runGuarded(function () { return handler(event); });\n            }\n        };\n    };\n    /**\n     * \\@internal\n     * @param {?} keyName\n     * @return {?}\n     */\n    KeyEventsPlugin._normalizeKey = function (keyName) {\n        // TODO: switch to a Map if the mapping grows too much\n        switch (keyName) {\n            case 'esc':\n                return 'escape';\n            default:\n                return keyName;\n        }\n    };\n    return KeyEventsPlugin;\n}(EventManagerPlugin));\nKeyEventsPlugin.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nKeyEventsPlugin.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either a protocol in a whitelist (http, https, mailto or ftp).\n * (2) or no protocol.  A protocol must be followed by a colon. The below\n *     allows that by allowing colons only after one of the characters [/?#].\n *     A colon after a hash (#) must be in the fragment.\n *     Otherwise, a colon after a (?) must be in a query.\n *     Otherwise, a colon after a single solidus (/) must be in a path.\n *     Otherwise, a colon after a double solidus (//) must be in the authority\n *     (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo&lt;bar/baz\".  Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript&#58;...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nvar SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n */\nvar DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n/**\n * @param {?} url\n * @return {?}\n */\nfunction sanitizeUrl(url) {\n    url = String(url);\n    if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))\n        return url;\n    if (_angular_core.isDevMode()) {\n        getDOM().log(\"WARNING: sanitizing unsafe URL value \" + url + \" (see http://g.co/ng/security#xss)\");\n    }\n    return 'unsafe:' + url;\n}\n/**\n * @param {?} srcset\n * @return {?}\n */\nfunction sanitizeSrcset(srcset) {\n    srcset = String(srcset);\n    return srcset.split(',').map(function (srcset) { return sanitizeUrl(srcset.trim()); }).join(', ');\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * A <body> element that can be safely used to parse untrusted HTML. Lazily initialized below.\n */\nvar inertElement = null;\n/**\n * Lazily initialized to make sure the DOM adapter gets set before use.\n */\nvar DOM = null;\n/**\n * Returns an HTML element that is guaranteed to not execute code when creating elements in it.\n * @return {?}\n */\nfunction getInertElement() {\n    if (inertElement)\n        return inertElement;\n    DOM = getDOM();\n    // Prefer using <template> element if supported.\n    var /** @type {?} */ templateEl = DOM.createElement('template');\n    if ('content' in templateEl)\n        return templateEl;\n    var /** @type {?} */ doc = DOM.createHtmlDocument();\n    inertElement = DOM.querySelector(doc, 'body');\n    if (inertElement == null) {\n        // usually there should be only one body element in the document, but IE doesn't have any, so we\n        // need to create one.\n        var /** @type {?} */ html = DOM.createElement('html', doc);\n        inertElement = DOM.createElement('body', doc);\n        DOM.appendChild(html, inertElement);\n        DOM.appendChild(doc, html);\n    }\n    return inertElement;\n}\n/**\n * @param {?} tags\n * @return {?}\n */\nfunction tagSet(tags) {\n    var /** @type {?} */ res = {};\n    for (var _i = 0, _a = tags.split(','); _i < _a.length; _i++) {\n        var t = _a[_i];\n        res[t] = true;\n    }\n    return res;\n}\n/**\n * @param {...?} sets\n * @return {?}\n */\nfunction merge() {\n    var sets = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n        sets[_i] = arguments[_i];\n    }\n    var /** @type {?} */ res = {};\n    for (var _a = 0, sets_1 = sets; _a < sets_1.length; _a++) {\n        var s = sets_1[_a];\n        for (var /** @type {?} */ v in s) {\n            if (s.hasOwnProperty(v))\n                res[v] = true;\n        }\n    }\n    return res;\n}\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nvar OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nvar OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nvar BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +\n    'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n    'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nvar INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +\n    'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n    'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nvar VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nvar URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n// Attributes that have special href set hence need to be sanitized\nvar SRCSET_ATTRS = tagSet('srcset');\nvar HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n    'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n    'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n    'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n    'valign,value,vspace,width');\n// NB: This currently conciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nvar VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nvar SanitizingHtmlSerializer = (function () {\n    function SanitizingHtmlSerializer() {\n        this.sanitizedSomething = false;\n        this.buf = [];\n    }\n    /**\n     * @param {?} el\n     * @return {?}\n     */\n    SanitizingHtmlSerializer.prototype.sanitizeChildren = function (el) {\n        // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n        // However this code never accesses properties off of `document` before deleting its contents\n        // again, so it shouldn't be vulnerable to DOM clobbering.\n        var /** @type {?} */ current = ((el.firstChild));\n        while (current) {\n            if (DOM.isElementNode(current)) {\n                this.startElement(/** @type {?} */ (current));\n            }\n            else if (DOM.isTextNode(current)) {\n                this.chars(/** @type {?} */ ((DOM.nodeValue(current))));\n            }\n            else {\n                // Strip non-element, non-text nodes.\n                this.sanitizedSomething = true;\n            }\n            if (DOM.firstChild(current)) {\n                current = ((DOM.firstChild(current)));\n                continue;\n            }\n            while (current) {\n                // Leaving the element. Walk up and to the right, closing tags as we go.\n                if (DOM.isElementNode(current)) {\n                    this.endElement(/** @type {?} */ (current));\n                }\n                var /** @type {?} */ next = checkClobberedElement(current, /** @type {?} */ ((DOM.nextSibling(current))));\n                if (next) {\n                    current = next;\n                    break;\n                }\n                current = checkClobberedElement(current, /** @type {?} */ ((DOM.parentElement(current))));\n            }\n        }\n        return this.buf.join('');\n    };\n    /**\n     * @param {?} element\n     * @return {?}\n     */\n    SanitizingHtmlSerializer.prototype.startElement = function (element) {\n        var _this = this;\n        var /** @type {?} */ tagName = DOM.nodeName(element).toLowerCase();\n        if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n            this.sanitizedSomething = true;\n            return;\n        }\n        this.buf.push('<');\n        this.buf.push(tagName);\n        DOM.attributeMap(element).forEach(function (value, attrName) {\n            var /** @type {?} */ lower = attrName.toLowerCase();\n            if (!VALID_ATTRS.hasOwnProperty(lower)) {\n                _this.sanitizedSomething = true;\n                return;\n            }\n            // TODO(martinprobst): Special case image URIs for data:image/...\n            if (URI_ATTRS[lower])\n                value = sanitizeUrl(value);\n            if (SRCSET_ATTRS[lower])\n                value = sanitizeSrcset(value);\n            _this.buf.push(' ');\n            _this.buf.push(attrName);\n            _this.buf.push('=\"');\n            _this.buf.push(encodeEntities(value));\n            _this.buf.push('\"');\n        });\n        this.buf.push('>');\n    };\n    /**\n     * @param {?} current\n     * @return {?}\n     */\n    SanitizingHtmlSerializer.prototype.endElement = function (current) {\n        var /** @type {?} */ tagName = DOM.nodeName(current).toLowerCase();\n        if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n            this.buf.push('</');\n            this.buf.push(tagName);\n            this.buf.push('>');\n        }\n    };\n    /**\n     * @param {?} chars\n     * @return {?}\n     */\n    SanitizingHtmlSerializer.prototype.chars = function (chars) { this.buf.push(encodeEntities(chars)); };\n    return SanitizingHtmlSerializer;\n}());\n/**\n * @param {?} node\n * @param {?} nextNode\n * @return {?}\n */\nfunction checkClobberedElement(node, nextNode) {\n    if (nextNode && DOM.contains(node, nextNode)) {\n        throw new Error(\"Failed to sanitize html because the element is clobbered: \" + DOM.getOuterHTML(node));\n    }\n    return nextNode;\n}\n// Regular Expressions for parsing tags and attributes\nvar SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nvar NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param {?} value\n * @return {?}\n */\nfunction encodeEntities(value) {\n    return value.replace(/&/g, '&amp;')\n        .replace(SURROGATE_PAIR_REGEXP, function (match) {\n        var /** @type {?} */ hi = match.charCodeAt(0);\n        var /** @type {?} */ low = match.charCodeAt(1);\n        return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n    })\n        .replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })\n        .replace(/</g, '&lt;')\n        .replace(/>/g, '&gt;');\n}\n/**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo').\n *\n * This is undesirable since we don't want to allow any of these custom attributes. This method\n * strips them all.\n * @param {?} el\n * @return {?}\n */\nfunction stripCustomNsAttrs(el) {\n    DOM.attributeMap(el).forEach(function (_, attrName) {\n        if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n            DOM.removeAttribute(el, attrName);\n        }\n    });\n    for (var _i = 0, _a = DOM.childNodesAsList(el); _i < _a.length; _i++) {\n        var n = _a[_i];\n        if (DOM.isElementNode(n))\n            stripCustomNsAttrs(/** @type {?} */ (n));\n    }\n}\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n * @param {?} defaultDoc\n * @param {?} unsafeHtmlInput\n * @return {?}\n */\nfunction sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n    try {\n        var /** @type {?} */ containerEl = getInertElement();\n        // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n        var /** @type {?} */ unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n        // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n        // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n        var /** @type {?} */ mXSSAttempts = 5;\n        var /** @type {?} */ parsedHtml = unsafeHtml;\n        do {\n            if (mXSSAttempts === 0) {\n                throw new Error('Failed to sanitize html because the input is unstable');\n            }\n            mXSSAttempts--;\n            unsafeHtml = parsedHtml;\n            DOM.setInnerHTML(containerEl, unsafeHtml);\n            if (defaultDoc.documentMode) {\n                // strip custom-namespaced attributes on IE<=11\n                stripCustomNsAttrs(containerEl);\n            }\n            parsedHtml = DOM.getInnerHTML(containerEl);\n        } while (unsafeHtml !== parsedHtml);\n        var /** @type {?} */ sanitizer = new SanitizingHtmlSerializer();\n        var /** @type {?} */ safeHtml = sanitizer.sanitizeChildren(DOM.getTemplateContent(containerEl) || containerEl);\n        // Clear out the body element.\n        var /** @type {?} */ parent = DOM.getTemplateContent(containerEl) || containerEl;\n        for (var _i = 0, _a = DOM.childNodesAsList(parent); _i < _a.length; _i++) {\n            var child = _a[_i];\n            DOM.removeChild(parent, child);\n        }\n        if (_angular_core.isDevMode() && sanitizer.sanitizedSomething) {\n            DOM.log('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');\n        }\n        return safeHtml;\n    }\n    catch (e) {\n        // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n        inertElement = null;\n        throw e;\n    }\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Regular expression for safe style values.\n *\n * Quotes (\" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.\n *\n * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or\n * font-family) and hence could allow multiple values to get injected, but that should pose no risk\n * of XSS.\n *\n * The function expression checks only for XSS safety, not for CSS validity.\n *\n * This regular expression was taken from the Closure sanitization library, and augmented for\n * transformation values.\n */\nvar VALUES = '[-,.\"\\'%_!# a-zA-Z0-9]+';\nvar TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';\nvar COLOR_FNS = '(?:rgb|hsl)a?';\nvar GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';\nvar CSS3_FNS = '(?:calc|attr)';\nvar FN_ARGS = '\\\\([-0-9.%, #a-zA-Z]+\\\\)';\nvar SAFE_STYLE_VALUE = new RegExp(\"^(\" + VALUES + \"|\" +\n    (\"(?:\" + TRANSFORMATION_FNS + \"|\" + COLOR_FNS + \"|\" + GRADIENTS + \"|\" + CSS3_FNS + \")\") +\n    (FN_ARGS + \")$\"), 'g');\n/**\n * Matches a `url(...)` value with an arbitrary argument as long as it does\n * not contain parentheses.\n *\n * The URL value still needs to be sanitized separately.\n *\n * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted\n * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.\n * by observing whether scroll bars are displayed, or character ranges used by a font face\n * definition.\n *\n * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that\n * binding a URL value without further cooperation from the page will cause an information leak, and\n * if so, it is just a leak, not a full blown XSS vulnerability.\n *\n * Given the common use case, low likelihood of attack vector, and low impact of an attack, this\n * code is permissive and allows URLs that sanitize otherwise.\n */\nvar URL_RE = /^url\\(([^)]+)\\)$/;\n/**\n * Checks that quotes (\" and ') are properly balanced inside a string. Assumes\n * that neither escape (\\) nor any other character that could result in\n * breaking out of a string parsing context are allowed;\n * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.\n *\n * This code was taken from the Closure sanitization library.\n * @param {?} value\n * @return {?}\n */\nfunction hasBalancedQuotes(value) {\n    var /** @type {?} */ outsideSingle = true;\n    var /** @type {?} */ outsideDouble = true;\n    for (var /** @type {?} */ i = 0; i < value.length; i++) {\n        var /** @type {?} */ c = value.charAt(i);\n        if (c === '\\'' && outsideDouble) {\n            outsideSingle = !outsideSingle;\n        }\n        else if (c === '\"' && outsideSingle) {\n            outsideDouble = !outsideDouble;\n        }\n    }\n    return outsideSingle && outsideDouble;\n}\n/**\n * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single\n * value) and returns a value that is safe to use in a browser environment.\n * @param {?} value\n * @return {?}\n */\nfunction sanitizeStyle(value) {\n    value = String(value).trim(); // Make sure it's actually a string.\n    if (!value)\n        return '';\n    // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n    // reasoning behind this.\n    var /** @type {?} */ urlMatch = value.match(URL_RE);\n    if ((urlMatch && sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n        value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n        return value; // Safe style values.\n    }\n    if (_angular_core.isDevMode()) {\n        getDOM().log(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n    }\n    return 'unsafe';\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing\n * values to be safe to use in the different DOM contexts.\n *\n * For example, when binding a URL in an `<a [href]=\"someValue\">` hyperlink, `someValue` will be\n * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on\n * the website.\n *\n * In specific situations, it might be necessary to disable sanitization, for example if the\n * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.\n * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`\n * methods, and then binding to that value from the template.\n *\n * These situations should be very rare, and extraordinary care must be taken to avoid creating a\n * Cross Site Scripting (XSS) security bug!\n *\n * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as\n * close as possible to the source of the value, to make it easy to verify no security bug is\n * created by its use.\n *\n * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that\n * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous\n * code. The sanitizer leaves safe values intact.\n *\n * \\@security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in\n * sanitization for the value passed in. Carefully check and audit all values and code paths going\n * into this call. Make sure any user data is appropriately escaped for this security context.\n * For more detail, see the [Security Guide](http://g.co/ng/security).\n *\n * \\@stable\n * @abstract\n */\nvar DomSanitizer = (function () {\n    function DomSanitizer() {\n    }\n    /**\n     * Sanitizes a value for use in the given SecurityContext.\n     *\n     * If value is trusted for the context, this method will unwrap the contained safe value and use\n     * it directly. Otherwise, value will be sanitized to be safe in the given context, for example\n     * by replacing URLs that have an unsafe protocol part (such as `javascript:`). The implementation\n     * is responsible to make sure that the value can definitely be safely used in the given context.\n     * @abstract\n     * @param {?} context\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizer.prototype.sanitize = function (context, value) { };\n    /**\n     * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML\n     * is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will\n     * leave safe HTML intact, so in most situations this method should not be used.\n     *\n     * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n     * security risks!\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizer.prototype.bypassSecurityTrustHtml = function (value) { };\n    /**\n     * Bypass security and trust the given value to be safe style value (CSS).\n     *\n     * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n     * security risks!\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizer.prototype.bypassSecurityTrustStyle = function (value) { };\n    /**\n     * Bypass security and trust the given value to be safe JavaScript.\n     *\n     * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n     * security risks!\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizer.prototype.bypassSecurityTrustScript = function (value) { };\n    /**\n     * Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used\n     * in hyperlinks or `<img src>`.\n     *\n     * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n     * security risks!\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizer.prototype.bypassSecurityTrustUrl = function (value) { };\n    /**\n     * Bypass security and trust the given value to be a safe resource URL, i.e. a location that may\n     * be used to load executable code from, like `<script src>`, or `<iframe src>`.\n     *\n     * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n     * security risks!\n     * @abstract\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizer.prototype.bypassSecurityTrustResourceUrl = function (value) { };\n    return DomSanitizer;\n}());\nvar DomSanitizerImpl = (function (_super) {\n    __extends(DomSanitizerImpl, _super);\n    /**\n     * @param {?} _doc\n     */\n    function DomSanitizerImpl(_doc) {\n        var _this = _super.call(this) || this;\n        _this._doc = _doc;\n        return _this;\n    }\n    /**\n     * @param {?} ctx\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.sanitize = function (ctx, value) {\n        if (value == null)\n            return null;\n        switch (ctx) {\n            case _angular_core.SecurityContext.NONE:\n                return (value);\n            case _angular_core.SecurityContext.HTML:\n                if (value instanceof SafeHtmlImpl)\n                    return value.changingThisBreaksApplicationSecurity;\n                this.checkNotSafeValue(value, 'HTML');\n                return sanitizeHtml(this._doc, String(value));\n            case _angular_core.SecurityContext.STYLE:\n                if (value instanceof SafeStyleImpl)\n                    return value.changingThisBreaksApplicationSecurity;\n                this.checkNotSafeValue(value, 'Style');\n                return sanitizeStyle(/** @type {?} */ (value));\n            case _angular_core.SecurityContext.SCRIPT:\n                if (value instanceof SafeScriptImpl)\n                    return value.changingThisBreaksApplicationSecurity;\n                this.checkNotSafeValue(value, 'Script');\n                throw new Error('unsafe value used in a script context');\n            case _angular_core.SecurityContext.URL:\n                if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {\n                    // Allow resource URLs in URL contexts, they are strictly more trusted.\n                    return value.changingThisBreaksApplicationSecurity;\n                }\n                this.checkNotSafeValue(value, 'URL');\n                return sanitizeUrl(String(value));\n            case _angular_core.SecurityContext.RESOURCE_URL:\n                if (value instanceof SafeResourceUrlImpl) {\n                    return value.changingThisBreaksApplicationSecurity;\n                }\n                this.checkNotSafeValue(value, 'ResourceURL');\n                throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');\n            default:\n                throw new Error(\"Unexpected SecurityContext \" + ctx + \" (see http://g.co/ng/security#xss)\");\n        }\n    };\n    /**\n     * @param {?} value\n     * @param {?} expectedType\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.checkNotSafeValue = function (value, expectedType) {\n        if (value instanceof SafeValueImpl) {\n            throw new Error(\"Required a safe \" + expectedType + \", got a \" + value.getTypeName() + \" \" +\n                \"(see http://g.co/ng/security#xss)\");\n        }\n    };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.bypassSecurityTrustHtml = function (value) { return new SafeHtmlImpl(value); };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.bypassSecurityTrustStyle = function (value) { return new SafeStyleImpl(value); };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.bypassSecurityTrustScript = function (value) { return new SafeScriptImpl(value); };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.bypassSecurityTrustUrl = function (value) { return new SafeUrlImpl(value); };\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = function (value) {\n        return new SafeResourceUrlImpl(value);\n    };\n    return DomSanitizerImpl;\n}(DomSanitizer));\nDomSanitizerImpl.decorators = [\n    { type: _angular_core.Injectable },\n];\n/**\n * @nocollapse\n */\nDomSanitizerImpl.ctorParameters = function () { return [\n    { type: undefined, decorators: [{ type: _angular_core.Inject, args: [DOCUMENT,] },] },\n]; };\n/**\n * @abstract\n */\nvar SafeValueImpl = (function () {\n    /**\n     * @param {?} changingThisBreaksApplicationSecurity\n     */\n    function SafeValueImpl(changingThisBreaksApplicationSecurity) {\n        this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n        // empty\n    }\n    /**\n     * @abstract\n     * @return {?}\n     */\n    SafeValueImpl.prototype.getTypeName = function () { };\n    /**\n     * @return {?}\n     */\n    SafeValueImpl.prototype.toString = function () {\n        return \"SafeValue must use [property]=binding: \" + this.changingThisBreaksApplicationSecurity +\n            \" (see http://g.co/ng/security#xss)\";\n    };\n    return SafeValueImpl;\n}());\nvar SafeHtmlImpl = (function (_super) {\n    __extends(SafeHtmlImpl, _super);\n    function SafeHtmlImpl() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @return {?}\n     */\n    SafeHtmlImpl.prototype.getTypeName = function () { return 'HTML'; };\n    return SafeHtmlImpl;\n}(SafeValueImpl));\nvar SafeStyleImpl = (function (_super) {\n    __extends(SafeStyleImpl, _super);\n    function SafeStyleImpl() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @return {?}\n     */\n    SafeStyleImpl.prototype.getTypeName = function () { return 'Style'; };\n    return SafeStyleImpl;\n}(SafeValueImpl));\nvar SafeScriptImpl = (function (_super) {\n    __extends(SafeScriptImpl, _super);\n    function SafeScriptImpl() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @return {?}\n     */\n    SafeScriptImpl.prototype.getTypeName = function () { return 'Script'; };\n    return SafeScriptImpl;\n}(SafeValueImpl));\nvar SafeUrlImpl = (function (_super) {\n    __extends(SafeUrlImpl, _super);\n    function SafeUrlImpl() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @return {?}\n     */\n    SafeUrlImpl.prototype.getTypeName = function () { return 'URL'; };\n    return SafeUrlImpl;\n}(SafeValueImpl));\nvar SafeResourceUrlImpl = (function (_super) {\n    __extends(SafeResourceUrlImpl, _super);\n    function SafeResourceUrlImpl() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * @return {?}\n     */\n    SafeResourceUrlImpl.prototype.getTypeName = function () { return 'ResourceURL'; };\n    return SafeResourceUrlImpl;\n}(SafeValueImpl));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar INTERNAL_BROWSER_PLATFORM_PROVIDERS = [\n    { provide: _angular_core.PLATFORM_ID, useValue: _angular_common.ɵPLATFORM_BROWSER_ID },\n    { provide: _angular_core.PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },\n    { provide: _angular_common.PlatformLocation, useClass: BrowserPlatformLocation },\n    { provide: DOCUMENT, useFactory: _document, deps: [] },\n];\n/**\n * \\@security Replacing built-in sanitization providers exposes the application to XSS risks.\n * Attacker-controlled data introduced by an unsanitized provider could expose your\n * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).\n * \\@experimental\n */\nvar BROWSER_SANITIZATION_PROVIDERS = [\n    { provide: _angular_core.Sanitizer, useExisting: DomSanitizer },\n    { provide: DomSanitizer, useClass: DomSanitizerImpl },\n];\n/**\n * \\@stable\n */\nvar platformBrowser = _angular_core.createPlatformFactory(_angular_core.platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n/**\n * @return {?}\n */\nfunction initDomAdapter() {\n    BrowserDomAdapter.makeCurrent();\n    BrowserGetTestability.init();\n}\n/**\n * @return {?}\n */\nfunction errorHandler() {\n    return new _angular_core.ErrorHandler();\n}\n/**\n * @return {?}\n */\nfunction _document() {\n    return document;\n}\n/**\n * The ng module for the browser.\n *\n * \\@stable\n */\nvar BrowserModule = (function () {\n    /**\n     * @param {?} parentModule\n     */\n    function BrowserModule(parentModule) {\n        if (parentModule) {\n            throw new Error(\"BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.\");\n        }\n    }\n    /**\n     * Configures a browser-based application to transition from a server-rendered app, if\n     * one is present on the page. The specified parameters must include an application id,\n     * which must match between the client and server applications.\n     *\n     * \\@experimental\n     * @param {?} params\n     * @return {?}\n     */\n    BrowserModule.withServerTransition = function (params) {\n        return {\n            ngModule: BrowserModule,\n            providers: [\n                { provide: _angular_core.APP_ID, useValue: params.appId },\n                { provide: TRANSITION_ID, useExisting: _angular_core.APP_ID },\n                SERVER_TRANSITION_PROVIDERS,\n            ],\n        };\n    };\n    return BrowserModule;\n}());\nBrowserModule.decorators = [\n    { type: _angular_core.NgModule, args: [{\n                providers: [\n                    BROWSER_SANITIZATION_PROVIDERS,\n                    { provide: _angular_core.ErrorHandler, useFactory: errorHandler, deps: [] },\n                    { provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true },\n                    { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true },\n                    { provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true },\n                    { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },\n                    DomRendererFactory2,\n                    { provide: _angular_core.RendererFactory2, useExisting: DomRendererFactory2 },\n                    { provide: SharedStylesHost, useExisting: DomSharedStylesHost },\n                    DomSharedStylesHost,\n                    _angular_core.Testability,\n                    EventManager,\n                    ELEMENT_PROBE_PROVIDERS,\n                    Meta,\n                    Title,\n                ],\n                exports: [_angular_common.CommonModule, _angular_core.ApplicationModule]\n            },] },\n];\n/**\n * @nocollapse\n */\nBrowserModule.ctorParameters = function () { return [\n    { type: BrowserModule, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.SkipSelf },] },\n]; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar win = typeof window !== 'undefined' && window || {};\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ChangeDetectionPerfRecord = (function () {\n    /**\n     * @param {?} msPerTick\n     * @param {?} numTicks\n     */\n    function ChangeDetectionPerfRecord(msPerTick, numTicks) {\n        this.msPerTick = msPerTick;\n        this.numTicks = numTicks;\n    }\n    return ChangeDetectionPerfRecord;\n}());\n/**\n * Entry point for all Angular profiling-related debug tools. This object\n * corresponds to the `ng.profiler` in the dev console.\n */\nvar AngularProfiler = (function () {\n    /**\n     * @param {?} ref\n     */\n    function AngularProfiler(ref) {\n        this.appRef = ref.injector.get(_angular_core.ApplicationRef);\n    }\n    /**\n     * Exercises change detection in a loop and then prints the average amount of\n     * time in milliseconds how long a single round of change detection takes for\n     * the current state of the UI. It runs a minimum of 5 rounds for a minimum\n     * of 500 milliseconds.\n     *\n     * Optionally, a user may pass a `config` parameter containing a map of\n     * options. Supported options are:\n     *\n     * `record` (boolean) - causes the profiler to record a CPU profile while\n     * it exercises the change detector. Example:\n     *\n     * ```\n     * ng.profiler.timeChangeDetection({record: true})\n     * ```\n     * @param {?} config\n     * @return {?}\n     */\n    AngularProfiler.prototype.timeChangeDetection = function (config) {\n        var /** @type {?} */ record = config && config['record'];\n        var /** @type {?} */ profileName = 'Change Detection';\n        // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened\n        var /** @type {?} */ isProfilerAvailable = win.console.profile != null;\n        if (record && isProfilerAvailable) {\n            win.console.profile(profileName);\n        }\n        var /** @type {?} */ start = getDOM().performanceNow();\n        var /** @type {?} */ numTicks = 0;\n        while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {\n            this.appRef.tick();\n            numTicks++;\n        }\n        var /** @type {?} */ end = getDOM().performanceNow();\n        if (record && isProfilerAvailable) {\n            // need to cast to <any> because type checker thinks there's no argument\n            // while in fact there is:\n            //\n            // https://developer.mozilla.org/en-US/docs/Web/API/Console/profileEnd\n            ((win.console.profileEnd))(profileName);\n        }\n        var /** @type {?} */ msPerTick = (end - start) / numTicks;\n        win.console.log(\"ran \" + numTicks + \" change detection cycles\");\n        win.console.log(msPerTick.toFixed(2) + \" ms per check\");\n        return new ChangeDetectionPerfRecord(msPerTick, numTicks);\n    };\n    return AngularProfiler;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar PROFILER_GLOBAL_NAME = 'profiler';\n/**\n * Enabled Angular debug tools that are accessible via your browser's\n * developer console.\n *\n * Usage:\n *\n * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)\n * 1. Type `ng.` (usually the console will show auto-complete suggestion)\n * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`\n *    then hit Enter.\n *\n * \\@experimental All debugging apis are currently experimental.\n * @template T\n * @param {?} ref\n * @return {?}\n */\nfunction enableDebugTools(ref) {\n    exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));\n    return ref;\n}\n/**\n * Disables Angular tools.\n *\n * \\@experimental All debugging apis are currently experimental.\n * @return {?}\n */\nfunction disableDebugTools() {\n    exportNgVar(PROFILER_GLOBAL_NAME, null);\n}\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * Predicates for use with {\\@link DebugElement}'s query functions.\n *\n * \\@experimental All debugging apis are currently experimental.\n */\nvar By = (function () {\n    function By() {\n    }\n    /**\n     * Match all elements.\n     *\n     * ## Example\n     *\n     * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}\n     * @return {?}\n     */\n    By.all = function () { return function (debugElement) { return true; }; };\n    /**\n     * Match elements by the given CSS selector.\n     *\n     * ## Example\n     *\n     * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}\n     * @param {?} selector\n     * @return {?}\n     */\n    By.css = function (selector) {\n        return function (debugElement) {\n            return debugElement.nativeElement != null ?\n                getDOM().elementMatches(debugElement.nativeElement, selector) :\n                false;\n        };\n    };\n    /**\n     * Match elements that have the given directive present.\n     *\n     * ## Example\n     *\n     * {\\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}\n     * @param {?} type\n     * @return {?}\n     */\n    By.directive = function (type) {\n        return function (debugElement) { return ((debugElement.providerTokens)).indexOf(type) !== -1; };\n    };\n    return By;\n}());\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n/**\n * \\@stable\n */\nvar VERSION = new _angular_core.Version('4.2.3');\n\nexports.BrowserModule = BrowserModule;\nexports.platformBrowser = platformBrowser;\nexports.Meta = Meta;\nexports.Title = Title;\nexports.disableDebugTools = disableDebugTools;\nexports.enableDebugTools = enableDebugTools;\nexports.By = By;\nexports.NgProbeToken = NgProbeToken$1;\nexports.DOCUMENT = DOCUMENT;\nexports.EVENT_MANAGER_PLUGINS = EVENT_MANAGER_PLUGINS;\nexports.EventManager = EventManager;\nexports.HAMMER_GESTURE_CONFIG = HAMMER_GESTURE_CONFIG;\nexports.HammerGestureConfig = HammerGestureConfig;\nexports.DomSanitizer = DomSanitizer;\nexports.VERSION = VERSION;\nexports.ɵBROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS;\nexports.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS = INTERNAL_BROWSER_PLATFORM_PROVIDERS;\nexports.ɵinitDomAdapter = initDomAdapter;\nexports.ɵBrowserDomAdapter = BrowserDomAdapter;\nexports.ɵBrowserPlatformLocation = BrowserPlatformLocation;\nexports.ɵTRANSITION_ID = TRANSITION_ID;\nexports.ɵBrowserGetTestability = BrowserGetTestability;\nexports.ɵELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS;\nexports.ɵDomAdapter = DomAdapter;\nexports.ɵgetDOM = getDOM;\nexports.ɵsetRootDomAdapter = setRootDomAdapter;\nexports.ɵDomRendererFactory2 = DomRendererFactory2;\nexports.ɵNAMESPACE_URIS = NAMESPACE_URIS;\nexports.ɵflattenStyles = flattenStyles;\nexports.ɵshimContentAttribute = shimContentAttribute;\nexports.ɵshimHostAttribute = shimHostAttribute;\nexports.ɵDomEventsPlugin = DomEventsPlugin;\nexports.ɵHammerGesturesPlugin = HammerGesturesPlugin;\nexports.ɵKeyEventsPlugin = KeyEventsPlugin;\nexports.ɵDomSharedStylesHost = DomSharedStylesHost;\nexports.ɵSharedStylesHost = SharedStylesHost;\nexports.ɵb = _document;\nexports.ɵa = errorHandler;\nexports.ɵh = GenericBrowserDomAdapter;\nexports.ɵg = SERVER_TRANSITION_PROVIDERS;\nexports.ɵf = appInitializerFactory;\nexports.ɵc = _createNgProbe;\nexports.ɵd = EventManagerPlugin;\nexports.ɵe = DomSanitizerImpl;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=platform-browser.umd.js.map\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/compiler'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', '@angular/compiler', '@angular/core', '@angular/common', '@angular/platform-browser'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.platformBrowserDynamic = global.ng.platformBrowserDynamic || {}),global.ng.compiler,global.ng.core,global.ng.common,global.ng.platformBrowser));\n}(this, (function (exports,_angular_compiler,_angular_core,_angular_common,_angular_platformBrowser) { 'use strict';\n\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\n\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.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = Object.setPrototypeOf ||\n    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n    function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n\nfunction __extends(d, b) {\n    extendStatics(d, b);\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\n/**\n * @license Angular v4.2.3\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar ResourceLoaderImpl = (function (_super) {\n    __extends(ResourceLoaderImpl, _super);\n    function ResourceLoaderImpl() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    ResourceLoaderImpl.prototype.get = function (url) {\n        var resolve;\n        var reject;\n        var promise = new Promise(function (res, rej) {\n            resolve = res;\n            reject = rej;\n        });\n        var xhr = new XMLHttpRequest();\n        xhr.open('GET', url, true);\n        xhr.responseType = 'text';\n        xhr.onload = function () {\n            // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n            // response/responseType properties were introduced in ResourceLoader Level2 spec (supported\n            // by IE10)\n            var response = xhr.response || xhr.responseText;\n            // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n            var status = xhr.status === 1223 ? 204 : xhr.status;\n            // fix status code when it is 0 (0 status is undocumented).\n            // Occurs when accessing file resources or on Android 4.1 stock browser\n            // while retrieving files from application cache.\n            if (status === 0) {\n                status = response ? 200 : 0;\n            }\n            if (200 <= status && status <= 300) {\n                resolve(response);\n            }\n            else {\n                reject(\"Failed to load \" + url);\n            }\n        };\n        xhr.onerror = function () { reject(\"Failed to load \" + url); };\n        xhr.send();\n        return promise;\n    };\n    return ResourceLoaderImpl;\n}(_angular_compiler.ResourceLoader));\nResourceLoaderImpl.decorators = [\n    { type: _angular_core.Injectable },\n];\n/** @nocollapse */\nResourceLoaderImpl.ctorParameters = function () { return []; };\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\nvar INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [\n    _angular_platformBrowser.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS,\n    {\n        provide: _angular_core.COMPILER_OPTIONS,\n        useValue: { providers: [{ provide: _angular_compiler.ResourceLoader, useClass: ResourceLoaderImpl }] },\n        multi: true\n    },\n    { provide: _angular_core.PLATFORM_ID, useValue: _angular_common.ɵPLATFORM_BROWSER_ID },\n];\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * An implementation of ResourceLoader that uses a template cache to avoid doing an actual\n * ResourceLoader.\n *\n * The template cache needs to be built and loaded into window.$templateCache\n * via a separate mechanism.\n */\nvar CachedResourceLoader = (function (_super) {\n    __extends(CachedResourceLoader, _super);\n    function CachedResourceLoader() {\n        var _this = _super.call(this) || this;\n        _this._cache = _angular_core.ɵglobal.$templateCache;\n        if (_this._cache == null) {\n            throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');\n        }\n        return _this;\n    }\n    CachedResourceLoader.prototype.get = function (url) {\n        if (this._cache.hasOwnProperty(url)) {\n            return Promise.resolve(this._cache[url]);\n        }\n        else {\n            return Promise.reject('CachedResourceLoader: Did not find cached template for ' + url);\n        }\n    };\n    return CachedResourceLoader;\n}(_angular_compiler.ResourceLoader));\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n/**\n * @stable\n */\nvar VERSION = new _angular_core.Version('4.2.3');\n/**\n * @license\n * Copyright Google Inc. 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://angular.io/license\n */\n/**\n * @experimental\n */\nvar RESOURCE_CACHE_PROVIDER = [{ provide: _angular_compiler.ResourceLoader, useClass: CachedResourceLoader }];\n/**\n * @stable\n */\nvar platformBrowserDynamic = _angular_core.createPlatformFactory(_angular_compiler.platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);\n\nexports.RESOURCE_CACHE_PROVIDER = RESOURCE_CACHE_PROVIDER;\nexports.platformBrowserDynamic = platformBrowserDynamic;\nexports.VERSION = VERSION;\nexports.ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS;\nexports.ɵResourceLoaderImpl = ResourceLoaderImpl;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=platform-browser-dynamic.umd.js.map"
  },
  {
    "path": "test/lib/react-dom_v15.1.0.js",
    "content": "/**\n * ReactDOM v15.1.0\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js\n;(function(f) {\n  // CommonJS\n  if (typeof exports === \"object\" && typeof module !== \"undefined\") {\n    module.exports = f(require('react'));\n\n  // RequireJS\n  } else if (typeof define === \"function\" && define.amd) {\n    define(['react'], f);\n\n  // <script>\n  } else {\n    var g;\n    if (typeof window !== \"undefined\") {\n      g = window;\n    } else if (typeof global !== \"undefined\") {\n      g = global;\n    } else if (typeof self !== \"undefined\") {\n      g = self;\n    } else {\n      // works providing we're not in \"use strict\";\n      // needed for Java 8 Nashorn\n      // see https://github.com/facebook/react/issues/3037\n      g = this;\n    }\n    g.ReactDOM = f(g.React);\n  }\n\n})(function(React) {\n  return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n});\n"
  },
  {
    "path": "test/lib/react-dom_v16.0.0.js",
    "content": "/*\n React v16.0.0\n react-dom.production.min.js\n\n Copyright (c) 2013-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 Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';function Nb(Za){function Ob(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?Sc(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}function Me(a){return a[1].toUpperCase()}function $a(a){var b=a.keyCode;\"charCode\"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;return 32<=a||13===a?a:0}function Pb(){return Ne}function Tc(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return\"input\"===b?!!Oe[a.type]:\"textarea\"===b?!0:!1}function ab(a){if(null==\na)return null;if(1===a.nodeType)return a;var b=fa.get(a);if(b)return\"number\"===typeof b.tag?Uc(b):Vc(b);\"function\"===typeof a.render?m(\"188\"):m(\"213\",Object.keys(a))}function Vc(){m(\"212\")}function Uc(){m(\"211\")}function Qb(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}}function Wc(a){var b=(a?a.ownerDocument||a:document).defaultView||window;return!!(a&&(\"function\"===typeof b.Node?a instanceof\nb.Node:\"object\"===typeof a&&\"number\"===typeof a.nodeType&&\"string\"===typeof a.nodeName))&&3==a.nodeType}function Xc(){!Rb&&z&&(Rb=\"textContent\"in document.documentElement?\"textContent\":\"innerText\");return Rb}function Yc(a,b){var c=Zc(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=Zc(c)}}function $c(){m(\"196\")}function Pe(a){function b(){for(;null!==w&&0===w.current.pendingWorkPriority;){w.isScheduled=\n!1;var a=w.nextScheduledRoot;w.nextScheduledRoot=null;if(w===I)return I=w=null,y=0,null;w=a}a=w;for(var b=null,c=0;null!==a;)0!==a.current.pendingWorkPriority&&(0===c||c>a.current.pendingWorkPriority)&&(c=a.current.pendingWorkPriority,b=a),a=a.nextScheduledRoot;if(null!==b){for(y=c;-1<da;)bb[da]=null,da--;cb=ba;ca.current=ba;S.current=!1;p();D=ad(b.current,c);b!==V&&(U=0,V=b)}else y=0,V=D=null}function c(c){X=!0;q=null;var d=c.stateNode;d.current===c?m(\"177\"):void 0;1!==y&&2!==y||U++;db.current=null;\nif(1<c.effectTag)if(null!==c.lastEffect){c.lastEffect.nextEffect=c;var p=c.firstEffect}else p=c;else p=c.firstEffect;N();for(u=p;null!==u;){var n=!1,e=void 0;try{for(;null!==u;){var f=u.effectTag;f&16&&a.resetTextContent(u.stateNode);if(f&128){var g=u.alternate;null!==g&&t(g)}switch(f&-242){case 2:E(u);u.effectTag&=-3;break;case 6:E(u);u.effectTag&=-3;bd(u.alternate,u);break;case 4:bd(u.alternate,u);break;case 8:Y=!0,Qe(u),Y=!1}u=u.nextEffect}}catch(Sb){n=!0,e=Sb}n&&(null===u?m(\"178\"):void 0,T(u,\ne),null!==u&&(u=u.nextEffect))}O();d.current=c;for(u=p;null!==u;){d=!1;p=void 0;try{for(;null!==u;){var h=u.effectTag;h&36&&Re(u.alternate,u);h&128&&r(u);if(h&64)switch(n=u,e=void 0,null!==P&&(e=P.get(n),P[\"delete\"](n),null==e&&null!==n.alternate&&(n=n.alternate,e=P.get(n),P[\"delete\"](n))),null==e?m(\"184\"):void 0,n.tag){case 2:n.stateNode.componentDidCatch(e.error,{componentStack:e.componentStack});break;case 3:null===M&&(M=e.error);break;default:m(\"157\")}var v=u.nextEffect;u.nextEffect=null;u=v}}catch(Sb){d=\n!0,p=Sb}d&&(null===u?m(\"178\"):void 0,T(u,p),null!==u&&(u=u.nextEffect))}X=!1;\"function\"===typeof cd&&cd(c.stateNode);B&&(B.forEach(Z),B=null);b()}function d(a){for(;;){var b=Se(a.alternate,a,y),c=a[\"return\"],d=a.sibling;var n=a;if(!(0!==n.pendingWorkPriority&&n.pendingWorkPriority>y)){var p=n.updateQueue;p=null===p||2!==n.tag&&3!==n.tag?0:null!==p.first?p.first.priorityLevel:0;for(var e=n.child;null!==e;){var f=e.pendingWorkPriority;p=0!==p&&(0===f||f>p)?p:f;e=e.sibling}n.pendingWorkPriority=p}if(null!==\nb)return b;null!==c&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1<a.effectTag&&(null!==c.lastEffect?c.lastEffect.nextEffect=a:c.firstEffect=a,c.lastEffect=a));if(null!==d)return d;if(null!==c)a=c;else{q=a;break}}return null}function e(a){var b=pa(a.alternate,a,y);null===b&&(b=d(a));db.current=null;return b}function f(a){var b=Ub(a.alternate,a,y);null===b&&(b=d(a));db.current=null;\nreturn b}function g(a){Q(5,a)}function h(){if(null!==P&&0<P.size&&2===y)for(;null!==D;){var a=D;D=null!==P&&(P.has(a)||null!==a.alternate&&P.has(a.alternate))?f(D):e(D);if(null===D&&(null===q?m(\"179\"):void 0,J=2,c(q),J=y,null===P||0===P.size||2!==y))break}}function k(a,d){null!==q?(J=2,c(q),h()):null===D&&b();if(!(0===y||y>a)){J=y;a:do{if(2>=y)for(;null!==D&&!(D=e(D),null===D&&(null===q?m(\"179\"):void 0,J=2,c(q),J=y,h(),0===y||y>a||2<y)););else if(null!==d)for(;null!==D&&!F;)if(1<d.timeRemaining()){if(D=\ne(D),null===D)if(null===q?m(\"179\"):void 0,1<d.timeRemaining()){if(J=2,c(q),J=y,h(),0===y||y>a||3>y)break}else F=!0}else F=!0;switch(y){case 1:case 2:if(y<=a)continue a;break a;case 3:case 4:case 5:if(null===d)break a;if(!F&&y<=a)continue a;break a;case 0:break a;default:m(\"181\")}}while(1)}}function Q(a,b){z?m(\"182\"):void 0;z=!0;var c=J,d=!1,p=null;try{k(a,b)}catch(Tb){d=!0,p=Tb}for(;d;){if(R){M=p;break}var e=D;if(null===e)R=!0;else{var E=T(e,p);null===E?m(\"183\"):void 0;if(!R){try{d=E;p=a;E=b;for(var h=\nd;null!==e;){switch(e.tag){case 2:dd(e);break;case 5:n(e);break;case 3:x(e);break;case 4:x(e)}if(e===h||e.alternate===h)break;e=e[\"return\"]}D=f(d);k(p,E)}catch(Tb){d=!0;p=Tb;continue}break}}}J=c;null!==b&&(L=!1);2<y&&!L&&(A(g),L=!0);a=M;R=F=z=!1;V=C=P=M=null;U=0;if(null!==a)throw a;}function T(a,b){var c=db.current=null,d=!1,p=!1,n=null;if(3===a.tag)c=a,eb(a)&&(R=!0);else for(var e=a[\"return\"];null!==e&&null===c;){2===e.tag?\"function\"===typeof e.stateNode.componentDidCatch&&(d=!0,n=Ba(e),c=e,p=!0):\n3===e.tag&&(c=e);if(eb(e)){if(Y||null!==B&&(B.has(e)||null!==e.alternate&&B.has(e.alternate)))return null;c=null;p=!1}e=e[\"return\"]}if(null!==c){null===C&&(C=new Set);C.add(c);var f=\"\";e=a;do{a:switch(e.tag){case 0:case 1:case 2:case 5:var E=e._debugOwner,g=e._debugSource;var h=Ba(e);var v=null;E&&(v=Ba(E));E=g;h=\"\\n    in \"+(h||\"Unknown\")+(E?\" (at \"+E.fileName.replace(/^.*[\\\\\\/]/,\"\")+\":\"+E.lineNumber+\")\":v?\" (created by \"+v+\")\":\"\");break a;default:h=\"\"}f+=h;e=e[\"return\"]}while(e);e=f;a=Ba(a);null===\nP&&(P=new Map);b={componentName:a,componentStack:e,error:b,errorBoundary:d?c.stateNode:null,errorBoundaryFound:d,errorBoundaryName:n,willRetry:p};P.set(c,b);try{console.error(b.error)}catch(Te){console.error(Te)}X?(null===B&&(B=new Set),B.add(c)):Z(c);return c}null===M&&(M=b);return null}function eb(a){return null!==C&&(C.has(a)||null!==a.alternate&&C.has(a.alternate))}function fb(a,b){return ed(a,b,!1)}function ed(a,b){U>aa&&(R=!0,m(\"185\"));!z&&b<=y&&(D=null);for(var c=!0;null!==a&&c;){c=!1;if(0===\na.pendingWorkPriority||a.pendingWorkPriority>b)c=!0,a.pendingWorkPriority=b;null!==a.alternate&&(0===a.alternate.pendingWorkPriority||a.alternate.pendingWorkPriority>b)&&(c=!0,a.alternate.pendingWorkPriority=b);if(null===a[\"return\"])if(3===a.tag){var d=a.stateNode;0===b||d.isScheduled||(d.isScheduled=!0,I?I.nextScheduledRoot=d:w=d,I=d);if(!z)switch(b){case 1:K?Q(1,null):Q(2,null);break;case 2:W?void 0:m(\"186\");break;default:L||(A(g),L=!0)}}else break;a=a[\"return\"]}}function l(a,b){var c=J;0===c&&\n(c=!G||a.internalContextTag&1||b?4:1);return 1===c&&(z||W)?2:c}function Z(a){ed(a,2,!0)}var H=Ue(a),fd=Ve(a),x=H.popHostContainer,n=H.popHostContext,p=H.resetHostContainer,v=We(a,H,fd,fb,l),pa=v.beginWork,Ub=v.beginFailedWork,Se=Xe(a,H,fd).completeWork;H=Ye(a,T);var E=H.commitPlacement,Qe=H.commitDeletion,bd=H.commitWork,Re=H.commitLifeCycles,r=H.commitAttachRef,t=H.commitDetachRef,A=a.scheduleDeferredCallback,G=a.useSyncScheduling,N=a.prepareForCommit,O=a.resetAfterCommit,J=0,z=!1,F=!1,W=!1,K=!1,\nD=null,y=0,u=null,q=null,w=null,I=null,L=!1,P=null,C=null,B=null,M=null,R=!1,X=!1,Y=!1,aa=1E3,U=0,V=null;return{scheduleUpdate:fb,getPriorityContext:l,batchedUpdates:function(a,b){var c=W;W=!0;try{return a(b)}finally{W=c,z||W||Q(2,null)}},unbatchedUpdates:function(a){var b=K,c=W;K=W;W=!1;try{return a()}finally{W=c,K=b}},flushSync:function(a){var b=W,c=J;W=!0;J=1;try{return a()}finally{W=b,J=c,z?m(\"187\"):void 0,Q(2,null)}},deferredUpdates:function(a){var b=J;J=4;try{return a()}finally{J=b}}}}function cd(a){\"function\"===\ntypeof Vb&&Vb(a)}function Ve(a){function b(a,b){var c=new F(5,null,0);c.type=\"DELETED\";c.stateNode=b;c[\"return\"]=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function c(a,b){switch(a.tag){case 5:return f(b,a.type,a.pendingProps);case 6:return g(b,a.pendingProps);default:return!1}}function d(a){for(a=a[\"return\"];null!==a&&5!==a.tag&&3!==a.tag;)a=a[\"return\"];l=a}var e=a.shouldSetTextContent,f=a.canHydrateInstance,g=a.canHydrateTextInstance,\nh=a.getNextHydratableSibling,k=a.getFirstHydratableChild,Q=a.hydrateInstance,T=a.hydrateTextInstance,eb=a.didNotHydrateInstance,fb=a.didNotFindHydratableInstance;a=a.didNotFindHydratableTextInstance;if(!(f&&g&&h&&k&&Q&&T&&eb&&fb&&a))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){m(\"175\")},prepareToHydrateHostTextInstance:function(){m(\"176\")},popHydrationState:function(){return!1}};\nvar l=null,r=null,Z=!1;return{enterHydrationState:function(a){r=k(a.stateNode.containerInfo);l=a;return Z=!0},resetHydrationState:function(){r=l=null;Z=!1},tryToClaimNextHydratableInstance:function(a){if(Z){var d=r;if(d){if(!c(a,d)){d=h(d);if(!d||!c(a,d)){a.effectTag|=2;Z=!1;l=a;return}b(l,r)}a.stateNode=d;l=a;r=k(d)}else a.effectTag|=2,Z=!1,l=a}},prepareToHydrateHostInstance:function(a,b,c){b=Q(a.stateNode,a.type,a.memoizedProps,b,c,a);a.updateQueue=b;return null!==b?!0:!1},prepareToHydrateHostTextInstance:function(a){return T(a.stateNode,\na.memoizedProps,a)},popHydrationState:function(a){if(a!==l)return!1;if(!Z)return d(a),Z=!0,!1;var c=a.type;if(5!==a.tag||\"head\"!==c&&\"body\"!==c&&!e(c,a.memoizedProps))for(c=r;c;)b(a,c),c=h(c);d(a);r=l?h(a.stateNode):null;return!0}}}function Ue(a){function b(a){a===qa?m(\"174\"):void 0;return a}var c=a.getChildHostContext,d=a.getRootHostContext,e={current:qa},f={current:qa},g={current:qa};return{getHostContext:function(){return b(e.current)},getRootHostContainer:function(){return b(g.current)},popHostContainer:function(a){K(e,\na);K(f,a);K(g,a)},popHostContext:function(a){f.current===a&&(K(e,a),K(f,a))},pushHostContainer:function(a,b){L(g,b,a);b=d(b);L(f,a,a);L(e,b,a)},pushHostContext:function(a){var d=b(g.current),h=b(e.current);d=c(h,a.type,d);h!==d&&(L(f,a,a),L(e,d,a))},resetHostContainer:function(){e.current=qa;g.current=qa}}}function Ye(a,b){function c(a){var c=a.ref;if(null!==c)try{c(null)}catch(p){b(a,p)}}function d(a){return 5===a.tag||3===a.tag||4===a.tag}function e(a){for(var b=a;;)if(g(b),null!==b.child&&4!==\nb.tag)b.child[\"return\"]=b,b=b.child;else{if(b===a)break;for(;null===b.sibling;){if(null===b[\"return\"]||b[\"return\"]===a)return;b=b[\"return\"]}b.sibling[\"return\"]=b[\"return\"];b=b.sibling}}function f(a){for(var b=a,c=!1,d=void 0,f=void 0;;){if(!c){c=b[\"return\"];a:for(;;){null===c?m(\"160\"):void 0;switch(c.tag){case 5:d=c.stateNode;f=!1;break a;case 3:d=c.stateNode.containerInfo;f=!0;break a;case 4:d=c.stateNode.containerInfo;f=!0;break a}c=c[\"return\"]}c=!0}if(5===b.tag||6===b.tag)e(b),f?H(d,b.stateNode):\nZ(d,b.stateNode);else if(4===b.tag?d=b.stateNode.containerInfo:g(b),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;b=b[\"return\"];4===b.tag&&(c=!1)}b.sibling[\"return\"]=b[\"return\"];b=b.sibling}}function g(a){\"function\"===typeof gd&&gd(a);switch(a.tag){case 2:c(a);var d=a.stateNode;if(\"function\"===typeof d.componentWillUnmount)try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount()}catch(p){b(a,\np)}break;case 5:c(a);break;case 7:e(a.stateNode);break;case 4:f(a)}}var h=a.commitMount,k=a.commitUpdate,Q=a.resetTextContent,T=a.commitTextUpdate,l=a.appendChild,r=a.appendChildToContainer,t=a.insertBefore,q=a.insertInContainerBefore,Z=a.removeChild,H=a.removeChildFromContainer,w=a.getPublicInstance;return{commitPlacement:function(a){a:{for(var b=a[\"return\"];null!==b;){if(d(b)){var c=b;break a}b=b[\"return\"]}m(\"160\");c=void 0}var e=b=void 0;switch(c.tag){case 5:b=c.stateNode;e=!1;break;case 3:b=c.stateNode.containerInfo;\ne=!0;break;case 4:b=c.stateNode.containerInfo;e=!0;break;default:m(\"161\")}c.effectTag&16&&(Q(b),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c[\"return\"]||d(c[\"return\"])){c=null;break a}c=c[\"return\"]}c.sibling[\"return\"]=c[\"return\"];for(c=c.sibling;5!==c.tag&&6!==c.tag;){if(c.effectTag&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child[\"return\"]=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var f=a;;){if(5===f.tag||6===f.tag)c?e?q(b,f.stateNode,c):\nt(b,f.stateNode,c):e?r(b,f.stateNode):l(b,f.stateNode);else if(4!==f.tag&&null!==f.child){f.child[\"return\"]=f;f=f.child;continue}if(f===a)break;for(;null===f.sibling;){if(null===f[\"return\"]||f[\"return\"]===a)return;f=f[\"return\"]}f.sibling[\"return\"]=f[\"return\"];f=f.sibling}},commitDeletion:function(a){f(a);a[\"return\"]=null;a.child=null;a.alternate&&(a.alternate.child=null,a.alternate[\"return\"]=null)},commitWork:function(a,b){switch(b.tag){case 2:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;\na=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&k(c,f,e,a,d,b)}break;case 6:null===b.stateNode?m(\"162\"):void 0;c=b.memoizedProps;T(b.stateNode,null!==a?a.memoizedProps:c,c);break;case 3:break;case 4:break;default:m(\"163\")}},commitLifeCycles:function(a,b){switch(b.tag){case 2:var c=b.stateNode;if(b.effectTag&4)if(null===a)c.props=b.memoizedProps,c.state=b.memoizedState,c.componentDidMount();else{var d=a.memoizedProps;a=a.memoizedState;c.props=b.memoizedProps;\nc.state=b.memoizedState;c.componentDidUpdate(d,a)}b.effectTag&32&&null!==b.updateQueue&&hd(b,b.updateQueue,c);break;case 3:a=b.updateQueue;null!==a&&hd(b,a,b.child&&b.child.stateNode);break;case 5:c=b.stateNode;null===a&&b.effectTag&4&&h(c,b.type,b.memoizedProps,b);break;case 6:break;case 4:break;default:m(\"163\")}},commitAttachRef:function(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:b(w(c));break;default:b(c)}}},commitDetachRef:function(a){a=a.ref;null!==a&&a(null)}}}function gd(a){\"function\"===\ntypeof Wb&&Wb(a)}function hd(a,b,c){a=b.callbackList;if(null!==a)for(b.callbackList=null,b=0;b<a.length;b++){var d=a[b];\"function\"!==typeof d?m(\"191\",d):void 0;d.call(c)}}function Xe(a,b,c){var d=a.createInstance,e=a.createTextInstance,f=a.appendInitialChild,g=a.finalizeInitialChildren,h=a.prepareUpdate,k=b.getRootHostContainer,Q=b.popHostContext,T=b.getHostContext,l=b.popHostContainer,r=c.prepareToHydrateHostInstance,t=c.prepareToHydrateHostTextInstance,q=c.popHydrationState;return{completeWork:function(a,\nb,c){var x=b.pendingProps;if(null===x)x=b.memoizedProps;else if(5!==b.pendingWorkPriority||5===c)b.pendingProps=null;switch(b.tag){case 1:return null;case 2:return dd(b),null;case 3:l(b);K(S,b);K(ca,b);x=b.stateNode;x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null);if(null===a||null===a.child)q(b),b.effectTag&=-3;return null;case 5:Q(b);c=k();var n=b.type;if(null!==a&&null!=b.stateNode){var p=a.memoizedProps,v=b.stateNode,pa=T();x=h(v,n,p,x,c,pa);if(b.updateQueue=x)b.effectTag|=\n4;a.ref!==b.ref&&(b.effectTag|=128)}else{if(!x)return null===b.stateNode?m(\"166\"):void 0,null;a=T();if(q(b))r(b,c,a)&&(b.effectTag|=4);else{a=d(n,x,c,a,b);a:for(p=b.child;null!==p;){if(5===p.tag||6===p.tag)f(a,p.stateNode);else if(4!==p.tag&&null!==p.child){p=p.child;continue}if(p===b)break a;for(;null===p.sibling;){if(null===p[\"return\"]||p[\"return\"]===b)break a;p=p[\"return\"]}p=p.sibling}g(a,n,x,c)&&(b.effectTag|=4);b.stateNode=a}null!==b.ref&&(b.effectTag|=128)}return null;case 6:if(a&&null!=b.stateNode)a.memoizedProps!==\nx&&(b.effectTag|=4);else{if(\"string\"!==typeof x)return null===b.stateNode?m(\"166\"):void 0,null;a=k();c=T();q(b)?t(b)&&(b.effectTag|=4):b.stateNode=e(x,a,c,b)}return null;case 7:(x=b.memoizedProps)?void 0:m(\"165\");b.tag=8;c=[];a:for((n=b.stateNode)&&(n[\"return\"]=b);null!==n;){if(5===n.tag||6===n.tag||4===n.tag)m(\"164\");else if(9===n.tag)c.push(n.type);else if(null!==n.child){n.child[\"return\"]=n;n=n.child;continue}for(;null===n.sibling;){if(null===n[\"return\"]||n[\"return\"]===b)break a;n=n[\"return\"]}n.sibling[\"return\"]=\nn[\"return\"];n=n.sibling}n=x.handler;x=n(x.props,c);b.child=Xb(b,null!==a?a.child:null,x,b.pendingWorkPriority);return b.child;case 8:return b.tag=7,null;case 9:return null;case 10:return null;case 4:return b.effectTag|=4,l(b),null;case 0:m(\"167\");default:m(\"156\")}}}}function We(a,b,c,d,e){function f(a,b,c){g(a,b,c,b.pendingWorkPriority)}function g(a,b,c,d){b.child=null===a?Yb(b,b.child,c,d):a.child===b.child?Xb(b,b.child,c,d):Zb(b,b.child,c,d)}function h(a,b){var c=b.ref;null===c||a&&a.ref===c||(b.effectTag|=\n128)}function k(a,b,c,d){h(a,b);if(!c)return d&&id(b,!1),l(a,b);c=b.stateNode;Ze.current=b;var e=c.render();b.effectTag|=1;f(a,b,e);b.memoizedState=c.state;b.memoizedProps=c.props;d&&id(b,!0);return b.child}function Q(a){var b=a.stateNode;b.pendingContext?jd(a,b.pendingContext,b.pendingContext!==b.context):b.context&&jd(a,b.context,!1);H(a,b.containerInfo)}function l(a,b){null!==a&&b.child!==a.child?m(\"153\"):void 0;if(null!==b.child){a=b.child;var c=$b(a,a.pendingWorkPriority);c.pendingProps=a.pendingProps;\nb.child=c;for(c[\"return\"]=b;null!==a.sibling;)a=a.sibling,c=c.sibling=$b(a,a.pendingWorkPriority),c.pendingProps=a.pendingProps,c[\"return\"]=b;c.sibling=null}return b.child}function r(a,b){switch(b.tag){case 3:Q(b);break;case 2:gb(b);break;case 4:H(b,b.stateNode.containerInfo)}return null}var q=a.shouldSetTextContent,t=a.useSyncScheduling,w=a.shouldDeprioritizeSubtree,z=b.pushHostContext,H=b.pushHostContainer,A=c.enterHydrationState,x=c.resetHydrationState,n=c.tryToClaimNextHydratableInstance;a=$e(d,\ne,function(a,b){a.memoizedProps=b},function(a,b){a.memoizedState=b});var p=a.adoptClassInstance,v=a.constructClassInstance,pa=a.mountClassInstance,Ub=a.updateClassInstance;return{beginWork:function(a,b,c){if(0===b.pendingWorkPriority||b.pendingWorkPriority>c)return r(a,b);switch(b.tag){case 0:null!==a?m(\"155\"):void 0;var d=b.type,e=b.pendingProps,g=Ca(b);g=Da(b,g);d=d(e,g);b.effectTag|=1;\"object\"===typeof d&&null!==d&&\"function\"===typeof d.render?(b.tag=2,e=gb(b),p(b,d),pa(b,c),b=k(a,b,!0,e)):(b.tag=\n1,f(a,b,d),b.memoizedProps=e,b=b.child);return b;case 1:a:{e=b.type;c=b.pendingProps;d=b.memoizedProps;if(S.current)null===c&&(c=d);else if(null===c||d===c){b=l(a,b);break a}d=Ca(b);d=Da(b,d);e=e(c,d);b.effectTag|=1;f(a,b,e);b.memoizedProps=c;b=b.child}return b;case 2:return e=gb(b),d=void 0,null===a?b.stateNode?m(\"153\"):(v(b,b.pendingProps),pa(b,c),d=!0):d=Ub(a,b,c),k(a,b,d,e);case 3:return Q(b),d=b.updateQueue,null!==d?(e=b.memoizedState,d=ac(a,b,d,null,e,null,c),e===d?(x(),b=l(a,b)):(e=d.element,\nnull!==a&&null!==a.child||!A(b)?(x(),f(a,b,e)):(b.effectTag|=2,b.child=Yb(b,b.child,e,c)),b.memoizedState=d,b=b.child)):(x(),b=l(a,b)),b;case 5:z(b);null===a&&n(b);e=b.type;var E=b.memoizedProps;d=b.pendingProps;null===d&&(d=E,null===d?m(\"154\"):void 0);g=null!==a?a.memoizedProps:null;S.current||null!==d&&E!==d?(E=d.children,q(e,d)?E=null:g&&q(e,g)&&(b.effectTag|=16),h(a,b),5!==c&&!t&&w(e,d)?(b.pendingWorkPriority=5,b=null):(f(a,b,E),b.memoizedProps=d,b=b.child)):b=l(a,b);return b;case 6:return null===\na&&n(b),a=b.pendingProps,null===a&&(a=b.memoizedProps),b.memoizedProps=a,null;case 8:b.tag=7;case 7:c=b.pendingProps;if(S.current)null===c&&(c=a&&a.memoizedProps,null===c?m(\"154\"):void 0);else if(null===c||b.memoizedProps===c)c=b.memoizedProps;e=c.children;d=b.pendingWorkPriority;b.stateNode=null===a?Yb(b,b.stateNode,e,d):a.child===b.child?Xb(b,b.stateNode,e,d):Zb(b,b.stateNode,e,d);b.memoizedProps=c;return b.stateNode;case 9:return null;case 4:a:{H(b,b.stateNode.containerInfo);c=b.pendingWorkPriority;\ne=b.pendingProps;if(S.current)null===e&&(e=a&&a.memoizedProps,null==e?m(\"154\"):void 0);else if(null===e||b.memoizedProps===e){b=l(a,b);break a}null===a?b.child=Zb(b,b.child,e,c):f(a,b,e);b.memoizedProps=e;b=b.child}return b;case 10:a:{c=b.pendingProps;if(S.current)null===c&&(c=b.memoizedProps);else if(null===c||b.memoizedProps===c){b=l(a,b);break a}f(a,b,c);b.memoizedProps=c;b=b.child}return b;default:m(\"156\")}},beginFailedWork:function(a,b,c){switch(b.tag){case 2:gb(b);break;case 3:Q(b);break;default:m(\"157\")}b.effectTag|=\n64;null===a?b.child=null:b.child!==a.child&&(b.child=a.child);if(0===b.pendingWorkPriority||b.pendingWorkPriority>c)return r(a,b);b.firstEffect=null;b.lastEffect=null;g(a,b,null,c);2===b.tag&&(a=b.stateNode,b.memoizedProps=a.props,b.memoizedState=a.state);return b.child}}}function id(a,b){var c=a.stateNode;c?void 0:m(\"169\");if(b){var d=kd(a,cb,!0);c.__reactInternalMemoizedMergedChildContext=d;K(S,a);K(ca,a);L(ca,d,a)}else K(S,a);L(S,b,a)}function jd(a,b,c){null!=ca.cursor?m(\"168\"):void 0;L(ca,b,a);\nL(S,c,a)}function gb(a){if(!Ea(a))return!1;var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||ba;cb=ca.current;L(ca,b,a);L(S,S.current,a);return!0}function $e(a,b,c,d){function e(a,b){b.updater=f;a.stateNode=b;fa.set(b,a)}var f={isMounted:af,enqueueSetState:function(c,d,e){c=fa.get(c);var f=b(c,!1);hb(c,{priorityLevel:f,partialState:d,callback:void 0===e?null:e,isReplace:!1,isForced:!1,isTopLevelUnmount:!1,next:null});a(c,f)},enqueueReplaceState:function(c,d,e){c=fa.get(c);var f=\nb(c,!1);hb(c,{priorityLevel:f,partialState:d,callback:void 0===e?null:e,isReplace:!0,isForced:!1,isTopLevelUnmount:!1,next:null});a(c,f)},enqueueForceUpdate:function(c,d){c=fa.get(c);var e=b(c,!1);hb(c,{priorityLevel:e,partialState:null,callback:void 0===d?null:d,isReplace:!1,isForced:!0,isTopLevelUnmount:!1,next:null});a(c,e)}};return{adoptClassInstance:e,constructClassInstance:function(a,b){var c=a.type,d=Ca(a),f=2===a.tag&&null!=a.type.contextTypes,g=f?Da(a,d):ba;b=new c(b,g);e(a,b);f&&(a=a.stateNode,\na.__reactInternalMemoizedUnmaskedChildContext=d,a.__reactInternalMemoizedMaskedChildContext=g);return b},mountClassInstance:function(a,b){var c=a.alternate,d=a.stateNode,e=d.state||null,g=a.pendingProps;g?void 0:m(\"158\");var h=Ca(a);d.props=g;d.state=e;d.refs=ba;d.context=Da(a,h);null!=a.type&&null!=a.type.prototype&&!0===a.type.prototype.unstable_isAsyncReactComponent&&(a.internalContextTag|=1);\"function\"===typeof d.componentWillMount&&(h=d.state,d.componentWillMount(),h!==d.state&&f.enqueueReplaceState(d,\nd.state,null),h=a.updateQueue,null!==h&&(d.state=ac(c,a,h,d,e,g,b)));\"function\"===typeof d.componentDidMount&&(a.effectTag|=4)},updateClassInstance:function(a,b,e){var g=b.stateNode;g.props=b.memoizedProps;g.state=b.memoizedState;var h=b.memoizedProps,k=b.pendingProps;k||(k=h,null==k?m(\"159\"):void 0);var l=g.context,r=Ca(b);r=Da(b,r);\"function\"!==typeof g.componentWillReceiveProps||h===k&&l===r||(l=g.state,g.componentWillReceiveProps(k,r),g.state!==l&&f.enqueueReplaceState(g,g.state,null));l=b.memoizedState;\ne=null!==b.updateQueue?ac(a,b,b.updateQueue,g,l,k,e):l;if(!(h!==k||l!==e||S.current||null!==b.updateQueue&&b.updateQueue.hasForceUpdate))return\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&l===a.memoizedState||(b.effectTag|=4),!1;var q=k;if(null===h||null!==b.updateQueue&&b.updateQueue.hasForceUpdate)q=!0;else{var t=b.stateNode,w=b.type;q=\"function\"===typeof t.shouldComponentUpdate?t.shouldComponentUpdate(q,e,r):w.prototype&&w.prototype.isPureReactComponent?!bc(h,q)||!bc(l,e):!0}q?\n(\"function\"===typeof g.componentWillUpdate&&g.componentWillUpdate(k,e,r),\"function\"===typeof g.componentDidUpdate&&(b.effectTag|=4)):(\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&l===a.memoizedState||(b.effectTag|=4),c(b,k),d(b,e));g.props=k;g.state=e;g.context=r;return q}}}function bc(a,b){if(ld(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(!bf.call(b,\nc[d])||!ld(a[c[d]],b[c[d]]))return!1;return!0}function cc(a,b,c){b=new F(4,a.key,b);b.pendingProps=a.children||[];b.pendingWorkPriority=c;b.stateNode={containerInfo:a.containerInfo,implementation:a.implementation};return b}function dc(a,b,c){b=new F(7,a.key,b);b.type=a.handler;b.pendingProps=a;b.pendingWorkPriority=c;return b}function ec(a,b,c){b=new F(6,null,b);b.pendingProps=a;b.pendingWorkPriority=c;return b}function md(a,b,c){b=new F(10,null,b);b.pendingProps=a;b.pendingWorkPriority=c;return b}\nfunction fc(a,b,c){var d=a.type,e=a.key,f=void 0;\"function\"===typeof d?(f=d.prototype&&d.prototype.isReactComponent?new F(2,e,b):new F(0,e,b),f.type=d):\"string\"===typeof d?(f=new F(5,e,b),f.type=d):\"object\"===typeof d&&null!==d&&\"number\"===typeof d.tag?f=d:m(\"130\",null==d?d:typeof d,\"\");b=f;b.pendingProps=a.props;b.pendingWorkPriority=c;return b}function ad(a,b){var c=a.alternate;null===c?(c=new F(a.tag,a.key,a.internalContextTag),c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):\n(c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.pendingWorkPriority=b;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function dd(a){Ea(a)&&(K(S,a),K(ca,a))}function Da(a,b){var c=a.type.contextTypes;if(!c)return ba;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=\nb[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ca(a){return Ea(a)?cb:ca.current}function L(a,b){da++;bb[da]=a.current;a.current=b}function K(a){0>da||(a.current=bb[da],bb[da]=null,da--)}function ac(a,b,c,d,e,f,g){null!==a&&a.updateQueue===c&&(c=b.updateQueue={first:c.first,last:c.last,callbackList:null,hasForceUpdate:!1});a=c.callbackList;for(var h=c.hasForceUpdate,m=!0,l=c.first;null!==l&&0>=gc(l.priorityLevel,\ng);){c.first=l.next;null===c.first&&(c.last=null);var r;if(l.isReplace)e=nd(l,d,e,f),m=!0;else if(r=nd(l,d,e,f))e=m?q({},e,r):q(e,r),m=!1;l.isForced&&(h=!0);null===l.callback||l.isTopLevelUnmount&&null!==l.next||(a=null!==a?a:[],a.push(l.callback),b.effectTag|=32);l=l.next}c.callbackList=a;c.hasForceUpdate=h;null!==c.first||null!==a||h||(b.updateQueue=null);return e}function od(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}function hc(a,\nb){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 ic(a,b){b&&(cf[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?m(\"137\",a,\"\"):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?m(\"60\"):void 0,\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML?\nvoid 0:m(\"61\")),null!=b.style&&\"object\"!==typeof b.style?m(\"62\",\"\"):void 0)}function ib(a){if(jc[a])return jc[a];if(!ra[a])return a;var b=ra[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in pd)return jc[a]=b[c];return\"\"}function Fa(a,b){if(!z||b&&!(\"addEventListener\"in document))return!1;b=\"on\"+a;var c=b in document;c||(c=document.createElement(\"div\"),c.setAttribute(b,\"return;\"),c=\"function\"===typeof c[b]);!c&&qd&&\"wheel\"===a&&(c=document.implementation.hasFeature(\"Events.wheel\",\"3.0\"));return c}function df(a){return rd(a,\n!1)}function ef(a){return rd(a,!0)}function rd(a,b){a&&(Ga.executeDispatchesInOrder(a,b),a.isPersistent()||a.constructor.release(a))}function Ha(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}function sa(a,b){null==b?m(\"30\"):void 0;if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function jb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===\na.nodeType?a.parentNode:a}function sd(a,b){return a(b)}function kc(a,b,c,d,e,f){return a(b,c,d,e,f)}function ff(){if(t._hasRethrowError){var a=t._rethrowError;t._rethrowError=null;t._hasRethrowError=!1;throw a;}}function td(a,b,c,d,e,f,g,h,m){t._hasCaughtError=!1;t._caughtError=null;var k=Array.prototype.slice.call(arguments,3);try{b.apply(c,k)}catch(T){t._caughtError=T,t._hasCaughtError=!0}}function Ba(a){if(\"function\"===typeof a.getName)return a.getName();if(\"number\"===typeof a.tag){a=a.type;if(\"string\"===\ntypeof a)return a;if(\"function\"===typeof a)return a.displayName||a.name}return null}function ka(){}function m(a){for(var b=arguments.length-1,c=\"Minified React error #\"+a+\"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\\x3d\"+a,d=0;d<b;d++)c+=\"\\x26args[]\\x3d\"+encodeURIComponent(arguments[d+1]);b=Error(c+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\");b.name=\"Invariant Violation\";b.framesToPop=1;throw b;}function Sc(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";\ncase \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function ud(){if(kb)for(var a in ta){var b=ta[a],c=kb.indexOf(a);-1<c?void 0:m(\"96\",a);if(!ha.plugins[c]){b.extractEvents?void 0:m(\"97\",a);ha.plugins[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;ha.eventNameDispatchConfigs.hasOwnProperty(h)?m(\"99\",h):void 0;ha.eventNameDispatchConfigs[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&vd(k[e],g,h);e=!0}else f.registrationName?\n(vd(f.registrationName,g,h),e=!0):e=!1;e?void 0:m(\"98\",d,a)}}}}function vd(a,b,c){ha.registrationNameModules[a]?m(\"100\",a):void 0;ha.registrationNameModules[a]=b;ha.registrationNameDependencies[a]=b.eventTypes[c].dependencies}function lb(a){return function(){return a}}function ua(a,b){return(a&b)===b}function wd(a){for(var b;b=a._renderedComponent;)a=b;return a}function xd(a,b){a=wd(a);a._hostNode=b;b[M]=a}function lc(a,b){if(!(a._flags&yd.hasCachedChildNodes)){var c=a._renderedChildren;b=b.firstChild;\nvar d;a:for(d in c)if(c.hasOwnProperty(d)){var e=c[d],f=wd(e)._domID;if(0!==f){for(;null!==b;b=b.nextSibling){var g=b,h=f;if(1===g.nodeType&&g.getAttribute(gf)===\"\"+h||8===g.nodeType&&g.nodeValue===\" react-text: \"+h+\" \"||8===g.nodeType&&g.nodeValue===\" react-empty: \"+h+\" \"){xd(e,b);continue a}}m(\"32\",f)}}a._flags|=yd.hasCachedChildNodes}}function zd(a){if(a[M])return a[M];for(var b=[];!a[M];)if(b.push(a),a.parentNode)a=a.parentNode;else return null;var c=a[M];if(5===c.tag||6===c.tag)return c;for(;a&&\n(c=a[M]);a=b.pop()){var d=c;b.length&&lc(c,a)}return d}function mb(a){var b=a;if(a.alternate)for(;b[\"return\"];)b=b[\"return\"];else{if(0!==(b.effectTag&2))return 1;for(;b[\"return\"];)if(b=b[\"return\"],0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function Ad(a){2!==mb(a)?m(\"188\"):void 0}function mc(a){var b=a.alternate;if(!b)return b=mb(a),3===b?m(\"188\"):void 0,1===b?null:a;for(var c=a,d=b;;){var e=c[\"return\"],f=e?e.alternate:null;if(!e||!f)break;if(e.child===f.child){for(var g=e.child;g;){if(g===\nc)return Ad(e),a;if(g===d)return Ad(e),b;g=g.sibling}m(\"188\")}if(c[\"return\"]!==d[\"return\"])c=e,d=f;else{g=!1;for(var 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===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}g?void 0:m(\"189\")}}c.alternate!==d?m(\"190\"):void 0}3!==c.tag?m(\"188\"):void 0;return c.stateNode.current===c?a:b}function Bd(a,b,c,d){b=a.type||\"unknown-event\";a.currentTarget=nc.getNodeFromInstance(d);Cd.invokeGuardedCallbackAndCatchFirstError(b,\nc,void 0,a);a.currentTarget=null}function Dd(a){if(a=Ga.getInstanceFromNode(a))if(\"number\"===typeof a.tag){nb&&\"function\"===typeof nb.restoreControlledState?void 0:m(\"194\");var b=Ga.getFiberCurrentPropsFromNode(a.stateNode);nb.restoreControlledState(a.stateNode,a.type,b)}else\"function\"!==typeof a.restoreControlledState?m(\"195\"):void 0,a.restoreControlledState()}function Ed(a,b){return sd(a,b)}function hf(a){var b=a.targetInst;do{if(!b){a.ancestors.push(b);break}var c=b;if(\"number\"===typeof c.tag){for(;c[\"return\"];)c=\nc[\"return\"];c=3!==c.tag?null:c.stateNode.containerInfo}else{for(;c._hostParent;)c=c._hostParent;c=N.getNodeFromInstance(c).parentNode}if(!c)break;a.ancestors.push(b);b=N.getClosestInstanceFromNode(c)}while(b);for(c=0;c<a.ancestors.length;c++)b=a.ancestors[c],ia._handleTopLevel(a.topLevelType,b,a.nativeEvent,jb(a.nativeEvent))}function Fd(a,b,c){switch(a){case \"onClick\":case \"onClickCapture\":case \"onDoubleClick\":case \"onDoubleClickCapture\":case \"onMouseDown\":case \"onMouseDownCapture\":case \"onMouseMove\":case \"onMouseMoveCapture\":case \"onMouseUp\":case \"onMouseUpCapture\":return!(!c.disabled||\n\"button\"!==b&&\"input\"!==b&&\"select\"!==b&&\"textarea\"!==b);default:return!1}}function ob(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\"Webkit\"+a]=\"webkit\"+b;c[\"Moz\"+a]=\"moz\"+b;c[\"ms\"+a]=\"MS\"+b;c[\"O\"+a]=\"o\"+b.toLowerCase();return c}function Gd(a){Object.prototype.hasOwnProperty.call(a,pb)||(a[pb]=jf++,Hd[a[pb]]={});return Hd[a[pb]]}function kf(a){if(Id.hasOwnProperty(a))return!0;if(Jd.hasOwnProperty(a))return!1;if(lf.test(a))return Id[a]=!0;Jd[a]=!0;return!1}function Kd(){return null}function mf(a){var b=\n\"\";Za.Children.forEach(a,function(a){null==a||\"string\"!==typeof a&&\"number\"!==typeof a||(b+=a)});return b}function va(a,b,c){a=a.options;if(b){b={};for(var d=0;d<c.length;d++)b[\"$\"+c[d]]=!0;for(c=0;c<a.length;c++)d=b.hasOwnProperty(\"$\"+a[c].value),a[c].selected!==d&&(a[c].selected=d)}else{c=\"\"+c;b=null;for(d=0;d<a.length;d++){if(a[d].value===c){a[d].selected=!0;return}null!==b||a[d].disabled||(b=a[d])}null!==b&&(b.selected=!0)}}function Ld(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&\n(\"checkbox\"===b||\"radio\"===b)}function nf(a){var b=Ld(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"function\"===typeof c.get&&\"function\"===typeof c.set)return Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:!0,get:function(){return c.get.call(this)},set:function(a){d=\"\"+a;c.set.call(this,a)}}),{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=null;delete a[b]}}}\nfunction R(a,b){of(b,9===a.nodeType||11===a.nodeType?a:a.ownerDocument)}function gc(a,b){return 2!==a&&1!==a||2!==b&&1!==b?0===a&&0!==b?-255:0!==a&&0===b?255:a-b:0}function Md(){return{first:null,last:null,hasForceUpdate:!1,callbackList:null}}function oc(a,b,c,d){null!==c?c.next=b:(b.next=a.first,a.first=b);null!==d?b.next=d:a.last=b}function Nd(a,b){b=b.priorityLevel;var c=null;if(null!==a.last&&0>=gc(a.last.priorityLevel,b))c=a.last;else for(a=a.first;null!==a&&0>=gc(a.priorityLevel,b);)c=a,a=a.next;\nreturn c}function hb(a,b){var c=a.alternate,d=a.updateQueue;null===d&&(d=a.updateQueue=Md());null!==c?(a=c.updateQueue,null===a&&(a=c.updateQueue=Md())):a=null;pc=d;qc=a!==d?a:null;var e=pc;c=qc;var f=Nd(e,b),g=null!==f?f.next:e.first;if(null===c)return oc(e,b,f,g),null;d=Nd(c,b);a=null!==d?d.next:c.first;oc(e,b,f,g);if(g===a&&null!==g||f===d&&null!==f)return null===d&&(c.first=b),null===a&&(c.last=null),null;b={priorityLevel:b.priorityLevel,partialState:b.partialState,callback:b.callback,isReplace:b.isReplace,\nisForced:b.isForced,isTopLevelUnmount:b.isTopLevelUnmount,next:null};oc(c,b,d,a);return b}function nd(a,b,c,d){a=a.partialState;return\"function\"===typeof a?a.call(b,c,d):a}function Ea(a){return 2===a.tag&&null!=a.type.childContextTypes}function kd(a,b){var c=a.stateNode,d=a.type.childContextTypes;if(\"function\"!==typeof c.getChildContext)return b;c=c.getChildContext();for(var e in c)e in d?void 0:m(\"108\",Ba(a)||\"Unknown\",e);return q({},b,c)}function F(a,b,c){this.tag=a;this.key=b;this.stateNode=this.type=\nnull;this.sibling=this.child=this[\"return\"]=null;this.index=0;this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null;this.internalContextTag=c;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.pendingWorkPriority=0;this.alternate=null}function Ia(a){if(null===a||\"undefined\"===typeof a)return null;a=Od&&a[Od]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}function Ja(a,b){var c=b.ref;if(null!==c&&\"function\"!==typeof c){if(b._owner){b=b._owner;\nvar d=void 0;b&&(\"number\"===typeof b.tag?(2!==b.tag?m(\"110\"):void 0,d=b.stateNode):d=b.getPublicInstance());d?void 0:m(\"147\",c);var e=\"\"+c;if(null!==a&&null!==a.ref&&a.ref._stringRef===e)return a.ref;a=function(a){var b=d.refs===ba?d.refs={}:d.refs;null===a?delete b[e]:b[e]=a};a._stringRef=e;return a}\"string\"!==typeof c?m(\"148\"):void 0;b._owner?void 0:m(\"149\",c)}return c}function qb(a,b){\"textarea\"!==a.type&&m(\"31\",\"[object Object]\"===Object.prototype.toString.call(b)?\"object with keys {\"+Object.keys(b).join(\", \")+\n\"}\":b,\"\")}function rc(a,b){function c(c,d){if(b){if(!a){if(null===d.alternate)return;d=d.alternate}var e=c.lastEffect;null!==e?(e.nextEffect=d,c.lastEffect=d):c.firstEffect=c.lastEffect=d;d.nextEffect=null;d.effectTag=8}}function d(a,d){if(!b)return null;for(;null!==d;)c(a,d),d=d.sibling;return null}function e(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 f(b,c){if(a)return b=$b(b,c),b.index=0,b.sibling=null,b;b.pendingWorkPriority=c;b.effectTag=\n0;b.index=0;b.sibling=null;return b}function g(a,c,d){a.index=d;if(!b)return c;d=a.alternate;if(null!==d)return d=d.index,d<c?(a.effectTag=2,c):d;a.effectTag=2;return c}function h(a){b&&null===a.alternate&&(a.effectTag=2);return a}function k(a,b,c,d){if(null===b||6!==b.tag)return c=ec(c,a.internalContextTag,d),c[\"return\"]=a,c;b=f(b,d);b.pendingProps=c;b[\"return\"]=a;return b}function l(a,b,c,d){if(null===b||b.type!==c.type)return d=fc(c,a.internalContextTag,d),d.ref=Ja(b,c),d[\"return\"]=a,d;d=f(b,d);\nd.ref=Ja(b,c);d.pendingProps=c.props;d[\"return\"]=a;return d}function r(a,b,c,d){if(null===b||7!==b.tag)return c=dc(c,a.internalContextTag,d),c[\"return\"]=a,c;b=f(b,d);b.pendingProps=c;b[\"return\"]=a;return b}function q(a,b,c,d){if(null===b||9!==b.tag)return b=new F(9,null,a.internalContextTag),b.type=c.value,b[\"return\"]=a,b;b=f(b,d);b.type=c.value;b[\"return\"]=a;return b}function t(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return c=\ncc(c,a.internalContextTag,d),c[\"return\"]=a,c;b=f(b,d);b.pendingProps=c.children||[];b[\"return\"]=a;return b}function w(a,b,c,d){if(null===b||10!==b.tag)return c=md(c,a.internalContextTag,d),c[\"return\"]=a,c;b=f(b,d);b.pendingProps=c;b[\"return\"]=a;return b}function z(a,b,c){if(\"string\"===typeof b||\"number\"===typeof b)return b=ec(\"\"+b,a.internalContextTag,c),b[\"return\"]=a,b;if(\"object\"===typeof b&&null!==b){switch(b.$$typeof){case rb:return c=fc(b,a.internalContextTag,c),c.ref=Ja(null,b),c[\"return\"]=\na,c;case sb:return b=dc(b,a.internalContextTag,c),b[\"return\"]=a,b;case tb:return c=new F(9,null,a.internalContextTag),c.type=b.value,c[\"return\"]=a,c;case ub:return b=cc(b,a.internalContextTag,c),b[\"return\"]=a,b}if(vb(b)||Ia(b))return b=md(b,a.internalContextTag,c),b[\"return\"]=a,b;qb(a,b)}return null}function A(a,b,c,d){var e=null!==b?b.key:null;if(\"string\"===typeof c||\"number\"===typeof c)return null!==e?null:k(a,b,\"\"+c,d);if(\"object\"===typeof c&&null!==c){switch(c.$$typeof){case rb:return c.key===\ne?l(a,b,c,d):null;case sb:return c.key===e?r(a,b,c,d):null;case tb:return null===e?q(a,b,c,d):null;case ub:return c.key===e?t(a,b,c,d):null}if(vb(c)||Ia(c))return null!==e?null:w(a,b,c,d);qb(a,c)}return null}function B(a,b,c,d,e){if(\"string\"===typeof d||\"number\"===typeof d)return a=a.get(c)||null,k(b,a,\"\"+d,e);if(\"object\"===typeof d&&null!==d){switch(d.$$typeof){case rb:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e);case sb:return a=a.get(null===d.key?c:d.key)||null,r(b,a,d,e);case tb:return a=\na.get(c)||null,q(b,a,d,e);case ub:return a=a.get(null===d.key?c:d.key)||null,t(b,a,d,e)}if(vb(d)||Ia(d))return a=a.get(c)||null,w(b,a,d,e);qb(b,d)}return null}function C(a,f,h,m){for(var p=null,n=null,l=f,k=f=0,v=null;null!==l&&k<h.length;k++){l.index>k?(v=l,l=null):v=l.sibling;var r=A(a,l,h[k],m);if(null===r){null===l&&(l=v);break}b&&l&&null===r.alternate&&c(a,l);f=g(r,f,k);null===n?p=r:n.sibling=r;n=r;l=v}if(k===h.length)return d(a,l),p;if(null===l){for(;k<h.length;k++)if(l=z(a,h[k],m))f=g(l,f,\nk),null===n?p=l:n.sibling=l,n=l;return p}for(l=e(a,l);k<h.length;k++)if(v=B(l,a,k,h[k],m)){if(b&&null!==v.alternate)l[\"delete\"](null===v.key?k:v.key);f=g(v,f,k);null===n?p=v:n.sibling=v;n=v}b&&l.forEach(function(b){return c(a,b)});return p}function x(a,f,h,l){var p=Ia(h);\"function\"!==typeof p?m(\"150\"):void 0;h=p.call(h);null==h?m(\"151\"):void 0;for(var n=p=null,k=f,v=f=0,r=null,q=h.next();null!==k&&!q.done;v++,q=h.next()){k.index>v?(r=k,k=null):r=k.sibling;var t=A(a,k,q.value,l);if(null===t){k||(k=\nr);break}b&&k&&null===t.alternate&&c(a,k);f=g(t,f,v);null===n?p=t:n.sibling=t;n=t;k=r}if(q.done)return d(a,k),p;if(null===k){for(;!q.done;v++,q=h.next())q=z(a,q.value,l),null!==q&&(f=g(q,f,v),null===n?p=q:n.sibling=q,n=q);return p}for(k=e(a,k);!q.done;v++,q=h.next())if(q=B(k,a,v,q.value,l),null!==q){if(b&&null!==q.alternate)k[\"delete\"](null===q.key?v:q.key);f=g(q,f,v);null===n?p=q:n.sibling=q;n=q}b&&k.forEach(function(b){return c(a,b)});return p}return function(a,b,e,g){var k=\"object\"===typeof e&&\nnull!==e;if(k)switch(e.$$typeof){case rb:a:{var l=e.key;for(k=b;null!==k;){if(k.key===l)if(k.type===e.type){d(a,k.sibling);b=f(k,g);b.ref=Ja(k,e);b.pendingProps=e.props;b[\"return\"]=a;a=b;break a}else{d(a,k);break}else c(a,k);k=k.sibling}g=fc(e,a.internalContextTag,g);g.ref=Ja(b,e);g[\"return\"]=a;a=g}return h(a);case sb:a:{for(k=e.key;null!==b;){if(b.key===k)if(7===b.tag){d(a,b.sibling);b=f(b,g);b.pendingProps=e;b[\"return\"]=a;a=b;break a}else{d(a,b);break}else c(a,b);b=b.sibling}e=dc(e,a.internalContextTag,\ng);e[\"return\"]=a;a=e}return h(a);case tb:a:{if(null!==b)if(9===b.tag){d(a,b.sibling);b=f(b,g);b.type=e.value;b[\"return\"]=a;a=b;break a}else d(a,b);b=new F(9,null,a.internalContextTag);b.type=e.value;b[\"return\"]=a;a=b}return h(a);case ub:a:{for(k=e.key;null!==b;){if(b.key===k)if(4===b.tag&&b.stateNode.containerInfo===e.containerInfo&&b.stateNode.implementation===e.implementation){d(a,b.sibling);b=f(b,g);b.pendingProps=e.children||[];b[\"return\"]=a;a=b;break a}else{d(a,b);break}else c(a,b);b=b.sibling}e=\ncc(e,a.internalContextTag,g);e[\"return\"]=a;a=e}return h(a)}if(\"string\"===typeof e||\"number\"===typeof e)return e=\"\"+e,null!==b&&6===b.tag?(d(a,b.sibling),b=f(b,g),b.pendingProps=e,b[\"return\"]=a,a=b):(d(a,b),e=ec(e,a.internalContextTag,g),e[\"return\"]=a,a=e),h(a);if(vb(e))return C(a,b,e,g);if(Ia(e))return x(a,b,e,g);k&&qb(a,e);if(\"undefined\"===typeof e)switch(a.tag){case 2:case 1:e=a.type,m(\"152\",e.displayName||e.name||\"Component\")}return d(a,b)}}function ld(a,b){return a===b?0!==a||0!==b||1/a===1/b:\na!==a&&b!==b}function Pd(a){return function(b){try{return a(b)}catch(c){}}}function sc(a){if(!a)return ba;a=fa.get(a);return\"number\"===typeof a.tag?$c(a):a._processChildContext(a._context)}function Zc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Qd(a,b){return a&&b?a===b?!0:Wc(a)?!1:Wc(b)?Qd(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function C(a){if(void 0!==a._hostParent)return a._hostParent;if(\"number\"===typeof a.tag){do a=\na[\"return\"];while(a&&5!==a.tag);if(a)return a}return null}function Rd(a,b){for(var c=0,d=a;d;d=C(d))c++;d=0;for(var e=b;e;e=C(e))d++;for(;0<c-d;)a=C(a),c--;for(;0<d-c;)b=C(b),d--;for(;c--;){if(a===b||a===b.alternate)return a;a=C(a);b=C(b)}return null}function Sd(a,b,c){if(b=Td(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=sa(c._dispatchListeners,b),c._dispatchInstances=sa(c._dispatchInstances,a)}function pf(a){a&&a.dispatchConfig.phasedRegistrationNames&&wb.traverseTwoPhase(a._targetInst,\nSd,a)}function qf(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?wb.getParentInstance(b):null;wb.traverseTwoPhase(b,Sd,a)}}function Ud(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Td(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=sa(c._dispatchListeners,b),c._dispatchInstances=sa(c._dispatchInstances,a))}function rf(a){a&&a.dispatchConfig.registrationName&&Ud(a._targetInst,null,a)}function Ka(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=\nc;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):\"target\"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?w.thatReturnsTrue:w.thatReturnsFalse;this.isPropagationStopped=w.thatReturnsFalse;return this}function sf(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}function tf(a){a instanceof this?void 0:m(\"223\");a.destructor();\n10>this.eventPool.length&&this.eventPool.push(a)}function Vd(a){a.eventPool=[];a.getPooled=sf;a.release=tf}function Wd(a,b,c,d){return O.call(this,a,b,c,d)}function Xd(a,b,c,d){return O.call(this,a,b,c,d)}function uf(){var a=window.opera;return\"object\"===typeof a&&\"function\"===typeof a.version&&12>=parseInt(a.version(),10)}function Yd(a,b){switch(a){case \"topKeyUp\":return-1!==vf.indexOf(b.keyCode);case \"topKeyDown\":return 229!==b.keyCode;case \"topKeyPress\":case \"topMouseDown\":case \"topBlur\":return!0;\ndefault:return!1}}function Zd(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}function wf(a,b){switch(a){case \"topCompositionEnd\":return Zd(b);case \"topKeyPress\":if(32!==b.which)return null;$d=!0;return ae;case \"topTextInput\":return a=b.data,a===ae&&$d?null:a;default:return null}}function xf(a,b){if(wa)return\"topCompositionEnd\"===a||!tc&&Yd(a,b)?(a=xb.getData(),xb.reset(),wa=!1,a):null;switch(a){case \"topPaste\":return null;case \"topKeyPress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&\nb.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case \"topCompositionEnd\":return be?null:b.data;default:return null}}function ce(a,b,c){a=O.getPooled(de.change,a,b,c);a.type=\"change\";yb.enqueueStateRestore(c);la.accumulateTwoPhaseDispatches(a);return a}function yf(a){X.enqueueEvents(a);X.processEventQueue(!1)}function zb(a){var b=N.getNodeFromInstance(a);if(xa.updateValueIfChanged(b))return a}function zf(a,b){if(\"topChange\"===a)return b}\nfunction ee(){La&&(La.detachEvent(\"onpropertychange\",fe),Ma=La=null)}function fe(a){\"value\"===a.propertyName&&zb(Ma)&&(a=ce(Ma,a,jb(a)),Ab.batchedUpdates(yf,a))}function Af(a,b,c){\"topFocus\"===a?(ee(),La=b,Ma=c,La.attachEvent(\"onpropertychange\",fe)):\"topBlur\"===a&&ee()}function Bf(a){if(\"topSelectionChange\"===a||\"topKeyUp\"===a||\"topKeyDown\"===a)return zb(Ma)}function Cf(a,b){if(\"topClick\"===a)return zb(b)}function Df(a,b){if(\"topInput\"===a||\"topChange\"===a)return zb(b)}function ge(a,b,c,d){return O.call(this,\na,b,c,d)}function Ne(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Ef[a])?!!b[a]:!1}function he(a,b,c,d){return Y.call(this,a,b,c,d)}function ie(a,b){if(uc||null==ya||ya!==Qb())return null;var c=ya;\"selectionStart\"in c&&vc.hasSelectionCapabilities(c)?c={start:c.selectionStart,end:c.selectionEnd}:window.getSelection?(c=window.getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}):c=void 0;return Na&&bc(Na,\nc)?null:(Na=c,a=O.getPooled(je.select,wc,a,b),a.type=\"select\",a.target=ya,la.accumulateTwoPhaseDispatches(a),a)}function ke(a,b,c,d){return O.call(this,a,b,c,d)}function le(a,b,c,d){return O.call(this,a,b,c,d)}function me(a,b,c,d){return Y.call(this,a,b,c,d)}function ne(a,b,c,d){return Y.call(this,a,b,c,d)}function oe(a,b,c,d){return ma.call(this,a,b,c,d)}function pe(a,b,c,d){return Y.call(this,a,b,c,d)}function qe(a,b,c,d){return O.call(this,a,b,c,d)}function re(a,b,c,d){return ma.call(this,a,b,\nc,d)}function xc(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||\" react-mount-point-unstable \"!==a.nodeValue))}function Ff(a){a=a?9===a.nodeType?a.documentElement:a.firstChild:null;return!(!a||1!==a.nodeType||!a.hasAttribute(Gf))}function Bb(a,b,c,d,e){xc(c)?void 0:m(\"200\");var f=c._reactRootContainer;if(f)B.updateContainer(b,f,a,e);else{if(!d&&!Ff(c))for(d=void 0;d=c.lastChild;)c.removeChild(d);var g=B.createContainer(c);f=c._reactRootContainer=g;B.unbatchedUpdates(function(){B.updateContainer(b,\ng,a,e)})}return B.getPublicRootInstance(f)}function se(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;xc(b)?void 0:m(\"200\");return te.createPortal(a,b,null,c)}Za?void 0:m(\"227\");var z=!(\"undefined\"===typeof window||!window.document||!window.document.createElement),q=Za.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,kb=null,ta={},ha={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(a){kb?\nm(\"101\"):void 0;kb=Array.prototype.slice.call(a);ud()},injectEventPluginsByName:function(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];ta.hasOwnProperty(c)&&ta[c]===d||(ta[c]?m(\"102\",c):void 0,ta[c]=d,b=!0)}b&&ud()}},na=ha;ka.thatReturns=lb;ka.thatReturnsFalse=lb(!1);ka.thatReturnsTrue=lb(!0);ka.thatReturnsNull=lb(null);ka.thatReturnsThis=function(){return this};ka.thatReturnsArgument=function(a){return a};var w=ka,ue={listen:function(a,b,c){if(a.addEventListener)return a.addEventListener(b,\nc,!1),{remove:function(){a.removeEventListener(b,c,!1)}};if(a.attachEvent)return a.attachEvent(\"on\"+b,c),{remove:function(){a.detachEvent(\"on\"+b,c)}}},capture:function(a,b,c){return a.addEventListener?(a.addEventListener(b,c,!0),{remove:function(){a.removeEventListener(b,c,!0)}}):{remove:w}},registerDefault:function(){}},Hf={children:!0,dangerouslySetInnerHTML:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,style:!0},ve={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,\nHAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,HAS_STRING_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(a){var b=ve,c=a.Properties||{},d=a.DOMAttributeNamespaces||{},e=a.DOMAttributeNames||{};a=a.DOMMutationMethods||{};for(var f in c){aa.properties.hasOwnProperty(f)?m(\"48\",f):void 0;var g=f.toLowerCase(),h=c[f];g={attributeName:g,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseProperty:ua(h,b.MUST_USE_PROPERTY),hasBooleanValue:ua(h,b.HAS_BOOLEAN_VALUE),\nhasNumericValue:ua(h,b.HAS_NUMERIC_VALUE),hasPositiveNumericValue:ua(h,b.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:ua(h,b.HAS_OVERLOADED_BOOLEAN_VALUE),hasStringBooleanValue:ua(h,b.HAS_STRING_BOOLEAN_VALUE)};1>=g.hasBooleanValue+g.hasNumericValue+g.hasOverloadedBooleanValue?void 0:m(\"50\",f);e.hasOwnProperty(f)&&(g.attributeName=e[f]);d.hasOwnProperty(f)&&(g.attributeNamespace=d[f]);a.hasOwnProperty(f)&&(g.mutationMethod=a[f]);aa.properties[f]=g}}},aa={ID_ATTRIBUTE_NAME:\"data-reactid\",\nROOT_ATTRIBUTE_NAME:\"data-reactroot\",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\",ATTRIBUTE_NAME_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\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\",properties:{},shouldSetAttribute:function(a,\nb){if(aa.isReservedProp(a)||!(\"o\"!==a[0]&&\"O\"!==a[0]||\"n\"!==a[1]&&\"N\"!==a[1]))return!1;if(null===b)return!0;switch(typeof b){case \"boolean\":return aa.shouldAttributeAcceptBooleanValue(a);case \"undefined\":case \"number\":case \"string\":case \"object\":return!0;default:return!1}},getPropertyInfo:function(a){return aa.properties.hasOwnProperty(a)?aa.properties[a]:null},shouldAttributeAcceptBooleanValue:function(a){if(aa.isReservedProp(a))return!0;var b=aa.getPropertyInfo(a);if(b)return b.hasBooleanValue||\nb.hasStringBooleanValue||b.hasOverloadedBooleanValue;a=a.toLowerCase().slice(0,5);return\"data-\"===a||\"aria-\"===a},isReservedProp:function(a){return Hf.hasOwnProperty(a)},injection:ve},A=aa,gf=A.ID_ATTRIBUTE_NAME,yd={hasCachedChildNodes:1},we=Math.random().toString(36).slice(2),M=\"__reactInternalInstance$\"+we,xe=\"__reactEventHandlers$\"+we,N={getClosestInstanceFromNode:zd,getInstanceFromNode:function(a){var b=a[M];if(b)return 5===b.tag||6===b.tag?b:b._hostNode===a?b:null;b=zd(a);return null!=b&&b._hostNode===\na?b:null},getNodeFromInstance:function(a){if(5===a.tag||6===a.tag)return a.stateNode;void 0===a._hostNode?m(\"33\"):void 0;if(a._hostNode)return a._hostNode;for(var b=[];!a._hostNode;)b.push(a),a._hostParent?void 0:m(\"34\"),a=a._hostParent;for(;b.length;a=b.pop())lc(a,a._hostNode);return a._hostNode},precacheChildNodes:lc,precacheNode:xd,uncacheNode:function(a){var b=a._hostNode;b&&(delete b[M],a._hostNode=null)},precacheFiberNode:function(a,b){b[M]=a},getFiberCurrentPropsFromNode:function(a){return a[xe]||\nnull},updateFiberProps:function(a,b){a[xe]=b}},fa={remove:function(a){a._reactInternalFiber=void 0},get:function(a){return a._reactInternalFiber},has:function(a){return void 0!==a._reactInternalFiber},set:function(a,b){a._reactInternalFiber=b}},yc={ReactCurrentOwner:Za.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},Oa={isFiberMounted:function(a){return 2===mb(a)},isMounted:function(a){return(a=fa.get(a))?2===mb(a):!1},findCurrentFiberUsingSlowPath:mc,findCurrentHostFiber:function(a){a=\nmc(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},findCurrentHostFiberWithNoPortals:function(a){a=mc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child&&4!==b.tag)b.child[\"return\"]=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b[\"return\"]||b[\"return\"]===\na)return null;b=b[\"return\"]}b.sibling[\"return\"]=b[\"return\"];b=b.sibling}}return null}},t={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(a){\"function\"!==typeof a.invokeGuardedCallback?m(\"197\"):void 0;td=a.invokeGuardedCallback}},invokeGuardedCallback:function(a,b,c,d,e,f,g,h,k){td.apply(t,arguments)},invokeGuardedCallbackAndCatchFirstError:function(a,b,c,d,e,f,g,h,k){t.invokeGuardedCallback.apply(this,arguments);if(t.hasCaughtError()){var l=\nt.clearCaughtError();t._hasRethrowError||(t._hasRethrowError=!0,t._rethrowError=l)}},rethrowCaughtError:function(){return ff.apply(t,arguments)},hasCaughtError:function(){return t._hasCaughtError},clearCaughtError:function(){if(t._hasCaughtError){var a=t._caughtError;t._caughtError=null;t._hasCaughtError=!1;return a}m(\"198\")}},Cd=t,Cb,nc={isEndish:function(a){return\"topMouseUp\"===a||\"topTouchEnd\"===a||\"topTouchCancel\"===a},isMoveish:function(a){return\"topMouseMove\"===a||\"topTouchMove\"===a},isStartish:function(a){return\"topMouseDown\"===\na||\"topTouchStart\"===a},executeDirectDispatch:function(a){var b=a._dispatchListeners,c=a._dispatchInstances;Array.isArray(b)?m(\"103\"):void 0;a.currentTarget=b?nc.getNodeFromInstance(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b},executeDispatchesInOrder:function(a,b){var c=a._dispatchListeners,d=a._dispatchInstances;if(Array.isArray(c))for(var e=0;e<c.length&&!a.isPropagationStopped();e++)Bd(a,b,c[e],d[e]);else c&&Bd(a,b,c,d);a._dispatchListeners=\nnull;a._dispatchInstances=null},executeDispatchesInOrderStopAtTrue:function(a){a:{var b=a._dispatchListeners;var c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++){if(b[d](a,c[d])){b=c[d];break a}}else if(b&&b(a,c)){b=c;break a}b=null}a._dispatchInstances=null;a._dispatchListeners=null;return b},hasDispatches:function(a){return!!a._dispatchListeners},getFiberCurrentPropsFromNode:function(a){return Cb.getFiberCurrentPropsFromNode(a)},getInstanceFromNode:function(a){return Cb.getInstanceFromNode(a)},\ngetNodeFromInstance:function(a){return Cb.getNodeFromInstance(a)},injection:{injectComponentTree:function(a){Cb=a}}},Ga=nc,nb=null,Pa=null,Qa=null,yb={injection:{injectFiberControlledHostComponent:function(a){nb=a}},enqueueStateRestore:function(a){Pa?Qa?Qa.push(a):Qa=[a]:Pa=a},restoreStateIfNeeded:function(){if(Pa){var a=Pa,b=Qa;Qa=Pa=null;Dd(a);if(b)for(a=0;a<b.length;a++)Dd(b[a])}}},zc=!1,Ab={batchedUpdates:function(a,b){if(zc)return kc(Ed,a,b);zc=!0;try{return kc(Ed,a,b)}finally{zc=!1,yb.restoreStateIfNeeded()}},\ninjection:{injectStackBatchedUpdates:function(a){kc=a},injectFiberBatchedUpdates:function(a){sd=a}}},Db=[],ia={_enabled:!0,_handleTopLevel:null,setHandleTopLevel:function(a){ia._handleTopLevel=a},setEnabled:function(a){ia._enabled=!!a},isEnabled:function(){return ia._enabled},trapBubbledEvent:function(a,b,c){return c?ue.listen(c,b,ia.dispatchEvent.bind(null,a)):null},trapCapturedEvent:function(a,b,c){return c?ue.capture(c,b,ia.dispatchEvent.bind(null,a)):null},dispatchEvent:function(a,b){if(ia._enabled){var c=\njb(b);c=N.getClosestInstanceFromNode(c);null===c||\"number\"!==typeof c.tag||Oa.isFiberMounted(c)||(c=null);if(Db.length){var d=Db.pop();d.topLevelType=a;d.nativeEvent=b;d.targetInst=c;a=d}else a={topLevelType:a,nativeEvent:b,targetInst:c,ancestors:[]};try{Ab.batchedUpdates(hf,a)}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,10>Db.length&&Db.push(a)}}}},G=ia,Ra=null,X={injection:{injectEventPluginOrder:na.injectEventPluginOrder,injectEventPluginsByName:na.injectEventPluginsByName},\ngetListener:function(a,b){if(\"number\"===typeof a.tag){var c=a.stateNode;if(!c)return null;var d=Ga.getFiberCurrentPropsFromNode(c);if(!d)return null;c=d[b];if(Fd(b,a.type,d))return null}else{d=a._currentElement;if(\"string\"===typeof d||\"number\"===typeof d||!a._rootNodeID)return null;a=d.props;c=a[b];if(Fd(b,d.type,a))return null}c&&\"function\"!==typeof c?m(\"231\",b,typeof c):void 0;return c},extractEvents:function(a,b,c,d){for(var e,f=na.plugins,g=0;g<f.length;g++){var h=f[g];h&&(h=h.extractEvents(a,\nb,c,d))&&(e=sa(e,h))}return e},enqueueEvents:function(a){a&&(Ra=sa(Ra,a))},processEventQueue:function(a){var b=Ra;Ra=null;a?Ha(b,ef):Ha(b,df);Ra?m(\"95\"):void 0;Cd.rethrowCaughtError()}},qd;z&&(qd=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature(\"\",\"\"));var ra={animationend:ob(\"Animation\",\"AnimationEnd\"),animationiteration:ob(\"Animation\",\"AnimationIteration\"),animationstart:ob(\"Animation\",\"AnimationStart\"),transitionend:ob(\"Transition\",\"TransitionEnd\")},\njc={},pd={};z&&(pd=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete ra.animationend.animation,delete ra.animationiteration.animation,delete ra.animationstart.animation),\"TransitionEvent\"in window||delete ra.transitionend.transition);var ye={topAbort:\"abort\",topAnimationEnd:ib(\"animationend\")||\"animationend\",topAnimationIteration:ib(\"animationiteration\")||\"animationiteration\",topAnimationStart:ib(\"animationstart\")||\"animationstart\",topBlur:\"blur\",topCancel:\"cancel\",topCanPlay:\"canplay\",\ntopCanPlayThrough:\"canplaythrough\",topChange:\"change\",topClick:\"click\",topClose:\"close\",topCompositionEnd:\"compositionend\",topCompositionStart:\"compositionstart\",topCompositionUpdate:\"compositionupdate\",topContextMenu:\"contextmenu\",topCopy:\"copy\",topCut:\"cut\",topDoubleClick:\"dblclick\",topDrag:\"drag\",topDragEnd:\"dragend\",topDragEnter:\"dragenter\",topDragExit:\"dragexit\",topDragLeave:\"dragleave\",topDragOver:\"dragover\",topDragStart:\"dragstart\",topDrop:\"drop\",topDurationChange:\"durationchange\",topEmptied:\"emptied\",\ntopEncrypted:\"encrypted\",topEnded:\"ended\",topError:\"error\",topFocus:\"focus\",topInput:\"input\",topKeyDown:\"keydown\",topKeyPress:\"keypress\",topKeyUp:\"keyup\",topLoadedData:\"loadeddata\",topLoad:\"load\",topLoadedMetadata:\"loadedmetadata\",topLoadStart:\"loadstart\",topMouseDown:\"mousedown\",topMouseMove:\"mousemove\",topMouseOut:\"mouseout\",topMouseOver:\"mouseover\",topMouseUp:\"mouseup\",topPaste:\"paste\",topPause:\"pause\",topPlay:\"play\",topPlaying:\"playing\",topProgress:\"progress\",topRateChange:\"ratechange\",topScroll:\"scroll\",\ntopSeeked:\"seeked\",topSeeking:\"seeking\",topSelectionChange:\"selectionchange\",topStalled:\"stalled\",topSuspend:\"suspend\",topTextInput:\"textInput\",topTimeUpdate:\"timeupdate\",topToggle:\"toggle\",topTouchCancel:\"touchcancel\",topTouchEnd:\"touchend\",topTouchMove:\"touchmove\",topTouchStart:\"touchstart\",topTransitionEnd:ib(\"transitionend\")||\"transitionend\",topVolumeChange:\"volumechange\",topWaiting:\"waiting\",topWheel:\"wheel\"},Hd={},jf=0,pb=\"_reactListenersID\"+(\"\"+Math.random()).slice(2),l=q({},{handleTopLevel:function(a,\nb,c,d){a=X.extractEvents(a,b,c,d);X.enqueueEvents(a);X.processEventQueue(!1)}},{setEnabled:function(a){G&&G.setEnabled(a)},isEnabled:function(){return!(!G||!G.isEnabled())},listenTo:function(a,b){var c=Gd(b);a=na.registrationNameDependencies[a];for(var d=0;d<a.length;d++){var e=a[d];c.hasOwnProperty(e)&&c[e]||(\"topWheel\"===e?Fa(\"wheel\")?G.trapBubbledEvent(\"topWheel\",\"wheel\",b):Fa(\"mousewheel\")?G.trapBubbledEvent(\"topWheel\",\"mousewheel\",b):G.trapBubbledEvent(\"topWheel\",\"DOMMouseScroll\",b):\"topScroll\"===\ne?G.trapCapturedEvent(\"topScroll\",\"scroll\",b):\"topFocus\"===e||\"topBlur\"===e?(G.trapCapturedEvent(\"topFocus\",\"focus\",b),G.trapCapturedEvent(\"topBlur\",\"blur\",b),c.topBlur=!0,c.topFocus=!0):\"topCancel\"===e?(Fa(\"cancel\",!0)&&G.trapCapturedEvent(\"topCancel\",\"cancel\",b),c.topCancel=!0):\"topClose\"===e?(Fa(\"close\",!0)&&G.trapCapturedEvent(\"topClose\",\"close\",b),c.topClose=!0):ye.hasOwnProperty(e)&&G.trapBubbledEvent(e,ye[e],b),c[e]=!0)}},isListeningToAllDependencies:function(a,b){b=Gd(b);a=na.registrationNameDependencies[a];\nfor(var c=0;c<a.length;c++){var d=a[c];if(!b.hasOwnProperty(d)||!b[d])return!1}return!0},trapBubbledEvent:function(a,b,c){return G.trapBubbledEvent(a,b,c)},trapCapturedEvent:function(a,b,c){return G.trapCapturedEvent(a,b,c)}}),Sa={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,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,\ngridRowStart:!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,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},If=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(Sa).forEach(function(a){If.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Sa[b]=Sa[a]})});var Jf={background:{backgroundAttachment:!0,\nbackgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},\nfont:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},ze=!1;if(z){var Kf=document.createElement(\"div\").style;try{Kf.font=\"\"}catch(a){ze=!0}}var Ae={createDangerousStringForStyles:function(){},setValueForStyles:function(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\");var e=c;var f=b[c];e=null==f||\"boolean\"===typeof f||\"\"===f?\"\":d||\"number\"!==typeof f||0===f||Sa.hasOwnProperty(e)&&\nSa[e]?(\"\"+f).trim():f+\"px\";\"float\"===c&&(c=\"cssFloat\");if(d)a.setProperty(c,e);else if(e)a[c]=e;else if(d=ze&&Jf[c])for(var g in d)a[g]=\"\";else a[c]=\"\"}}},lf=new RegExp(\"^[\"+A.ATTRIBUTE_NAME_START_CHAR+\"][\"+A.ATTRIBUTE_NAME_CHAR+\"]*$\"),Jd={},Id={},Ac={setAttributeForID:function(a,b){a.setAttribute(A.ID_ATTRIBUTE_NAME,b)},setAttributeForRoot:function(a){a.setAttribute(A.ROOT_ATTRIBUTE_NAME,\"\")},getValueForProperty:function(){},getValueForAttribute:function(){},setValueForProperty:function(a,b,c){var d=\nA.getPropertyInfo(b);if(d&&A.shouldSetAttribute(b,c)){var e=d.mutationMethod;e?e(a,c):null==c||d.hasBooleanValue&&!c||d.hasNumericValue&&isNaN(c)||d.hasPositiveNumericValue&&1>c||d.hasOverloadedBooleanValue&&!1===c?Ac.deleteValueForProperty(a,b):d.mustUseProperty?a[d.propertyName]=c:(b=d.attributeName,(e=d.attributeNamespace)?a.setAttributeNS(e,b,\"\"+c):d.hasBooleanValue||d.hasOverloadedBooleanValue&&!0===c?a.setAttribute(b,\"\"):a.setAttribute(b,\"\"+c))}else Ac.setValueForAttribute(a,b,A.shouldSetAttribute(b,\nc)?c:null)},setValueForAttribute:function(a,b,c){kf(b)&&(null==c?a.removeAttribute(b):a.setAttribute(b,\"\"+c))},deleteValueForAttribute:function(a,b){a.removeAttribute(b)},deleteValueForProperty:function(a,b){var c=A.getPropertyInfo(b);c?(b=c.mutationMethod)?b(a,void 0):c.mustUseProperty?a[c.propertyName]=c.hasBooleanValue?!1:\"\":a.removeAttribute(c.attributeName):a.removeAttribute(b)}},oa=Ac,Be=yc.ReactDebugCurrentFrame,Ta={current:null,phase:null,resetCurrentFiber:function(){Be.getCurrentStack=null;\nTa.current=null;Ta.phase=null},setCurrentFiber:function(a,b){Be.getCurrentStack=Kd;Ta.current=a;Ta.phase=b},getCurrentFiberOwnerName:function(){return null},getCurrentFiberStackAddendum:Kd},Lf=Ta,Bc={getHostProps:function(a,b){var c=b.value,d=b.checked;return q({type:void 0,step:void 0,min:void 0,max:void 0},b,{defaultChecked:void 0,defaultValue:void 0,value:null!=c?c:a._wrapperState.initialValue,checked:null!=d?d:a._wrapperState.initialChecked})},initWrapperState:function(a,b){var c=b.defaultValue;\na._wrapperState={initialChecked:null!=b.checked?b.checked:b.defaultChecked,initialValue:null!=b.value?b.value:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}},updateWrapper:function(a,b){var c=b.checked;null!=c&&oa.setValueForProperty(a,\"checked\",c||!1);c=b.value;if(null!=c)if(0===c&&\"\"===a.value)a.value=\"0\";else if(\"number\"===b.type){if(b=parseFloat(a.value)||0,c!=b||c==b&&a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else null==b.value&&null!=b.defaultValue&&\na.defaultValue!==\"\"+b.defaultValue&&(a.defaultValue=\"\"+b.defaultValue),null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)},postMountWrapper:function(a,b){switch(b.type){case \"submit\":case \"reset\":break;case \"color\":case \"date\":case \"datetime\":case \"datetime-local\":case \"month\":case \"time\":case \"week\":a.value=\"\";a.value=a.defaultValue;break;default:a.value=a.value}b=a.name;\"\"!==b&&(a.name=\"\");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!a.defaultChecked;\"\"!==b&&\n(a.name=b)},restoreControlledState:function(a,b){Bc.updateWrapper(a,b);var c=b.name;if(\"radio\"===b.type&&null!=c){for(b=a;b.parentNode;)b=b.parentNode;c=b.querySelectorAll(\"input[name\\x3d\"+JSON.stringify(\"\"+c)+'][type\\x3d\"radio\"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=N.getFiberCurrentPropsFromNode(d);e?void 0:m(\"90\");Bc.updateWrapper(d,e)}}}}},U=Bc,za={validateProps:function(){},postMountWrapper:function(a,b){null!=b.value&&a.setAttribute(\"value\",b.value)},getHostProps:function(a,\nb){a=q({children:void 0},b);if(b=mf(b.children))a.children=b;return a}},ja={getHostProps:function(a,b){return q({},b,{value:void 0})},initWrapperState:function(a,b){var c=b.value;a._wrapperState={initialValue:null!=c?c:b.defaultValue,wasMultiple:!!b.multiple}},postMountWrapper:function(a,b){a.multiple=!!b.multiple;var c=b.value;null!=c?va(a,!!b.multiple,c):null!=b.defaultValue&&va(a,!!b.multiple,b.defaultValue)},postUpdateWrapper:function(a,b){a._wrapperState.initialValue=void 0;var c=a._wrapperState.wasMultiple;\na._wrapperState.wasMultiple=!!b.multiple;var d=b.value;null!=d?va(a,!!b.multiple,d):c!==!!b.multiple&&(null!=b.defaultValue?va(a,!!b.multiple,b.defaultValue):va(a,!!b.multiple,b.multiple?[]:\"\"))},restoreControlledState:function(a,b){var c=b.value;null!=c&&va(a,!!b.multiple,c)}},Ce={getHostProps:function(a,b){null!=b.dangerouslySetInnerHTML?m(\"91\"):void 0;return q({},b,{value:void 0,defaultValue:void 0,children:\"\"+a._wrapperState.initialValue})},initWrapperState:function(a,b){var c=b.value,d=c;null==\nc&&(c=b.defaultValue,b=b.children,null!=b&&(null!=c?m(\"92\"):void 0,Array.isArray(b)&&(1>=b.length?void 0:m(\"93\"),b=b[0]),c=\"\"+b),null==c&&(c=\"\"),d=c);a._wrapperState={initialValue:\"\"+d}},updateWrapper:function(a,b){var c=b.value;null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&(a.defaultValue=c));null!=b.defaultValue&&(a.defaultValue=b.defaultValue)},postMountWrapper:function(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)},restoreControlledState:function(a,b){Ce.updateWrapper(a,\nb)}},V=Ce,cf=q({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}),xa={_getTrackerFromNode:function(a){return a._valueTracker},track:function(a){a._valueTracker||(a._valueTracker=nf(a))},updateValueIfChanged:function(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ld(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1},stopTracking:function(a){(a=a._valueTracker)&&\na.stopTracking()}},Eb,Cc=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(\"http://www.w3.org/2000/svg\"!==a.namespaceURI||\"innerHTML\"in a)a.innerHTML=b;else for(Eb=Eb||document.createElement(\"div\"),Eb.innerHTML=\"\\x3csvg\\x3e\"+b+\"\\x3c/svg\\x3e\",b=Eb.firstChild;b.firstChild;)a.appendChild(b.firstChild)}),Mf=/[\"'&<>]/;z&&(\"textContent\"in document.documentElement||(od=function(a,\nb){if(3===a.nodeType)a.nodeValue=b;else{if(\"boolean\"===typeof b||\"number\"===typeof b)b=\"\"+b;else{b=\"\"+b;var c=Mf.exec(b);if(c){var d=\"\",e,f=0;for(e=c.index;e<b.length;e++){switch(b.charCodeAt(e)){case 34:c=\"\\x26quot;\";break;case 38:c=\"\\x26amp;\";break;case 39:c=\"\\x26#x27;\";break;case 60:c=\"\\x26lt;\";break;case 62:c=\"\\x26gt;\";break;default:continue}f!==e&&(d+=b.substring(f,e));f=e+1;d+=c}b=f!==e?d+b.substring(f,e):d}}Cc(a,b)}}));var Dc=od,Ec=Lf.getCurrentFiberOwnerName,of=l.listenTo,Fb=na.registrationNameModules,\nAa={topAbort:\"abort\",topCanPlay:\"canplay\",topCanPlayThrough:\"canplaythrough\",topDurationChange:\"durationchange\",topEmptied:\"emptied\",topEncrypted:\"encrypted\",topEnded:\"ended\",topError:\"error\",topLoadedData:\"loadeddata\",topLoadedMetadata:\"loadedmetadata\",topLoadStart:\"loadstart\",topPause:\"pause\",topPlay:\"play\",topPlaying:\"playing\",topProgress:\"progress\",topRateChange:\"ratechange\",topSeeked:\"seeked\",topSeeking:\"seeking\",topStalled:\"stalled\",topSuspend:\"suspend\",topTimeUpdate:\"timeupdate\",topVolumeChange:\"volumechange\",\ntopWaiting:\"waiting\"},I={createElement:function(a,b,c,d){c=9===c.nodeType?c:c.ownerDocument;\"http://www.w3.org/1999/xhtml\"===d&&(d=Sc(a));\"http://www.w3.org/1999/xhtml\"===d?\"script\"===a?(a=c.createElement(\"div\"),a.innerHTML=\"\\x3cscript\\x3e\\x3c/script\\x3e\",a=a.removeChild(a.firstChild)):a=\"string\"===typeof b.is?c.createElement(a,{is:b.is}):c.createElement(a):a=c.createElementNS(d,a);return a},createTextNode:function(a,b){return(9===b.nodeType?b:b.ownerDocument).createTextNode(a)},setInitialProperties:function(a,\nb,c,d){var e=hc(b,c);switch(b){case \"iframe\":case \"object\":l.trapBubbledEvent(\"topLoad\",\"load\",a);var f=c;break;case \"video\":case \"audio\":for(f in Aa)Aa.hasOwnProperty(f)&&l.trapBubbledEvent(f,Aa[f],a);f=c;break;case \"source\":l.trapBubbledEvent(\"topError\",\"error\",a);f=c;break;case \"img\":case \"image\":l.trapBubbledEvent(\"topError\",\"error\",a);l.trapBubbledEvent(\"topLoad\",\"load\",a);f=c;break;case \"form\":l.trapBubbledEvent(\"topReset\",\"reset\",a);l.trapBubbledEvent(\"topSubmit\",\"submit\",a);f=c;break;case \"details\":l.trapBubbledEvent(\"topToggle\",\n\"toggle\",a);f=c;break;case \"input\":U.initWrapperState(a,c);f=U.getHostProps(a,c);l.trapBubbledEvent(\"topInvalid\",\"invalid\",a);R(d,\"onChange\");break;case \"option\":za.validateProps(a,c);f=za.getHostProps(a,c);break;case \"select\":ja.initWrapperState(a,c);f=ja.getHostProps(a,c);l.trapBubbledEvent(\"topInvalid\",\"invalid\",a);R(d,\"onChange\");break;case \"textarea\":V.initWrapperState(a,c);f=V.getHostProps(a,c);l.trapBubbledEvent(\"topInvalid\",\"invalid\",a);R(d,\"onChange\");break;default:f=c}ic(b,f,Ec);var g=f,\nh;for(h in g)if(g.hasOwnProperty(h)){var k=g[h];\"style\"===h?Ae.setValueForStyles(a,k):\"dangerouslySetInnerHTML\"===h?(k=k?k.__html:void 0,null!=k&&Cc(a,k)):\"children\"===h?\"string\"===typeof k?Dc(a,k):\"number\"===typeof k&&Dc(a,\"\"+k):\"suppressContentEditableWarning\"!==h&&(Fb.hasOwnProperty(h)?null!=k&&R(d,h):e?oa.setValueForAttribute(a,h,k):null!=k&&oa.setValueForProperty(a,h,k))}switch(b){case \"input\":xa.track(a);U.postMountWrapper(a,c);break;case \"textarea\":xa.track(a);V.postMountWrapper(a,c);break;\ncase \"option\":za.postMountWrapper(a,c);break;case \"select\":ja.postMountWrapper(a,c);break;default:\"function\"===typeof f.onClick&&(a.onclick=w)}},diffProperties:function(a,b,c,d,e){var f=null;switch(b){case \"input\":c=U.getHostProps(a,c);d=U.getHostProps(a,d);f=[];break;case \"option\":c=za.getHostProps(a,c);d=za.getHostProps(a,d);f=[];break;case \"select\":c=ja.getHostProps(a,c);d=ja.getHostProps(a,d);f=[];break;case \"textarea\":c=V.getHostProps(a,c);d=V.getHostProps(a,d);f=[];break;default:\"function\"!==\ntypeof c.onClick&&\"function\"===typeof d.onClick&&(a.onclick=w)}ic(b,d,Ec);var g,h;a=null;for(g in c)if(!d.hasOwnProperty(g)&&c.hasOwnProperty(g)&&null!=c[g])if(\"style\"===g)for(h in b=c[g],b)b.hasOwnProperty(h)&&(a||(a={}),a[h]=\"\");else\"dangerouslySetInnerHTML\"!==g&&\"children\"!==g&&\"suppressContentEditableWarning\"!==g&&(Fb.hasOwnProperty(g)?f||(f=[]):(f=f||[]).push(g,null));for(g in d){var k=d[g];b=null!=c?c[g]:void 0;if(d.hasOwnProperty(g)&&k!==b&&(null!=k||null!=b))if(\"style\"===g)if(b){for(h in b)!b.hasOwnProperty(h)||\nk&&k.hasOwnProperty(h)||(a||(a={}),a[h]=\"\");for(h in k)k.hasOwnProperty(h)&&b[h]!==k[h]&&(a||(a={}),a[h]=k[h])}else a||(f||(f=[]),f.push(g,a)),a=k;else\"dangerouslySetInnerHTML\"===g?(k=k?k.__html:void 0,b=b?b.__html:void 0,null!=k&&b!==k&&(f=f||[]).push(g,\"\"+k)):\"children\"===g?b===k||\"string\"!==typeof k&&\"number\"!==typeof k||(f=f||[]).push(g,\"\"+k):\"suppressContentEditableWarning\"!==g&&(Fb.hasOwnProperty(g)?(null!=k&&R(e,g),f||b===k||(f=[])):(f=f||[]).push(g,k))}a&&(f=f||[]).push(\"style\",a);return f},\nupdateProperties:function(a,b,c,d,e){hc(c,d);d=hc(c,e);for(var f=0;f<b.length;f+=2){var g=b[f],h=b[f+1];\"style\"===g?Ae.setValueForStyles(a,h):\"dangerouslySetInnerHTML\"===g?Cc(a,h):\"children\"===g?Dc(a,h):d?null!=h?oa.setValueForAttribute(a,g,h):oa.deleteValueForAttribute(a,g):null!=h?oa.setValueForProperty(a,g,h):oa.deleteValueForProperty(a,g)}switch(c){case \"input\":U.updateWrapper(a,e);xa.updateValueIfChanged(a);break;case \"textarea\":V.updateWrapper(a,e);break;case \"select\":ja.postUpdateWrapper(a,\ne)}},diffHydratedProperties:function(a,b,c,d,e){switch(b){case \"iframe\":case \"object\":l.trapBubbledEvent(\"topLoad\",\"load\",a);break;case \"video\":case \"audio\":for(var f in Aa)Aa.hasOwnProperty(f)&&l.trapBubbledEvent(f,Aa[f],a);break;case \"source\":l.trapBubbledEvent(\"topError\",\"error\",a);break;case \"img\":case \"image\":l.trapBubbledEvent(\"topError\",\"error\",a);l.trapBubbledEvent(\"topLoad\",\"load\",a);break;case \"form\":l.trapBubbledEvent(\"topReset\",\"reset\",a);l.trapBubbledEvent(\"topSubmit\",\"submit\",a);break;\ncase \"details\":l.trapBubbledEvent(\"topToggle\",\"toggle\",a);break;case \"input\":U.initWrapperState(a,c);l.trapBubbledEvent(\"topInvalid\",\"invalid\",a);R(e,\"onChange\");break;case \"option\":za.validateProps(a,c);break;case \"select\":ja.initWrapperState(a,c);l.trapBubbledEvent(\"topInvalid\",\"invalid\",a);R(e,\"onChange\");break;case \"textarea\":V.initWrapperState(a,c),l.trapBubbledEvent(\"topInvalid\",\"invalid\",a),R(e,\"onChange\")}ic(b,c,Ec);d=null;for(var g in c)c.hasOwnProperty(g)&&(f=c[g],\"children\"===g?\"string\"===\ntypeof f?a.textContent!==f&&(d=[\"children\",f]):\"number\"===typeof f&&a.textContent!==\"\"+f&&(d=[\"children\",\"\"+f]):Fb.hasOwnProperty(g)&&null!=f&&R(e,g));switch(b){case \"input\":xa.track(a);U.postMountWrapper(a,c);break;case \"textarea\":xa.track(a);V.postMountWrapper(a,c);break;case \"select\":case \"option\":break;default:\"function\"===typeof c.onClick&&(a.onclick=w)}return d},diffHydratedText:function(a,b){return a.nodeValue!==b},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},\nwarnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(a,b,c){switch(b){case \"input\":U.restoreControlledState(a,c);break;case \"textarea\":V.restoreControlledState(a,c);break;case \"select\":ja.restoreControlledState(a,c)}}},Gb=void 0;if(z)if(\"function\"!==typeof requestIdleCallback){var De=null,Fc=null,Gc=!1,Hc=!1,Hb=0,Ib=33,Ua=33,Nf={timeRemaining:\"object\"===typeof performance&&\"function\"===typeof performance.now?function(){return Hb-performance.now()}:\nfunction(){return Hb-Date.now()}},Ee=\"__reactIdleCallback$\"+Math.random().toString(36).slice(2);window.addEventListener(\"message\",function(a){a.source===window&&a.data===Ee&&(Gc=!1,a=Fc,Fc=null,null!==a&&a(Nf))},!1);var Of=function(a){Hc=!1;var b=a-Hb+Ua;b<Ua&&Ib<Ua?(8>b&&(b=8),Ua=b<Ib?Ib:b):Ib=b;Hb=a+Ua;Gc||(Gc=!0,window.postMessage(Ee,\"*\"));b=De;De=null;null!==b&&b(a)};Gb=function(a){Fc=a;Hc||(Hc=!0,requestAnimationFrame(Of));return 0}}else Gb=requestIdleCallback;else Gb=function(a){setTimeout(function(){a({timeRemaining:function(){return Infinity}})});\nreturn 0};var Pf=Gb,pc=void 0,qc=void 0,ba={},bb=[],da=-1,Qf=Oa.isFiberMounted,ca={current:ba},S={current:!1},cb=ba;if(\"function\"===typeof Symbol&&Symbol[\"for\"]){var Fe=Symbol[\"for\"](\"react.coroutine\");var Ge=Symbol[\"for\"](\"react.yield\")}else Fe=60104,Ge=60105;var Rf=Ge,Sf=Fe,Ic=\"function\"===typeof Symbol&&Symbol[\"for\"]&&Symbol[\"for\"](\"react.portal\")||60106,te={createPortal:function(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ic,key:null==d?null:\"\"+d,children:a,\ncontainerInfo:b,implementation:c}},isPortal:function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===Ic},REACT_PORTAL_TYPE:Ic},sb=Sf,tb=Rf,ub=te.REACT_PORTAL_TYPE,$b=ad,vb=Array.isArray,Od=\"function\"===typeof Symbol&&Symbol.iterator,rb=\"function\"===typeof Symbol&&Symbol[\"for\"]&&Symbol[\"for\"](\"react.element\")||60103,Xb=rc(!0,!0),Zb=rc(!1,!0),Yb=rc(!1,!1),bf=Object.prototype.hasOwnProperty,af=Oa.isMounted,Ze=yc.ReactCurrentOwner,Vb=null,Wb=null,qa={},db=yc.ReactCurrentOwner;sc._injectFiber=function(a){$c=\na};var Tf=Oa.findCurrentHostFiber,Uf=Oa.findCurrentHostFiberWithNoPortals;sc._injectFiber(function(a){var b;a:{Qf(a)&&2===a.tag?void 0:m(\"170\");for(b=a;3!==b.tag;){if(Ea(b)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}(b=b[\"return\"])?void 0:m(\"171\")}b=b.stateNode.context}return Ea(a)?kd(a,b,!1):b});var Rb=null,He={getOffsets:function(a){var b=window.getSelection&&window.getSelection();if(!b||0===b.rangeCount)return null;var c=b.anchorNode,d=b.anchorOffset,e=b.focusNode,f=b.focusOffset,\ng=b.getRangeAt(0);try{g.startContainer.nodeType,g.endContainer.nodeType}catch(k){return null}b=b.anchorNode===b.focusNode&&b.anchorOffset===b.focusOffset?0:g.toString().length;var h=g.cloneRange();h.selectNodeContents(a);h.setEnd(g.startContainer,g.startOffset);a=h.startContainer===h.endContainer&&h.startOffset===h.endOffset?0:h.toString().length;g=a+b;b=document.createRange();b.setStart(c,d);b.setEnd(e,f);c=b.collapsed;return{start:c?g:a,end:c?a:g}},setOffsets:function(a,b){if(window.getSelection){var c=\nwindow.getSelection(),d=a[Xc()].length,e=Math.min(b.start,d);b=void 0===b.end?e:Math.min(b.end,d);!c.extend&&e>b&&(d=b,b=e,e=d);d=Yc(a,e);a=Yc(a,b);if(d&&a){var f=document.createRange();f.setStart(d.node,d.offset);c.removeAllRanges();e>b?(c.addRange(f),c.extend(a.node,a.offset)):(f.setEnd(a.node,a.offset),c.addRange(f))}}}},Va={hasSelectionCapabilities:function(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&\"text\"===a.type||\"textarea\"===b||\"true\"===a.contentEditable)},getSelectionInformation:function(){var a=\nQb();return{focusedElem:a,selectionRange:Va.hasSelectionCapabilities(a)?Va.getSelection(a):null}},restoreSelection:function(a){var b=Qb(),c=a.focusedElem;a=a.selectionRange;if(b!==c&&Qd(document.documentElement,c)){Va.hasSelectionCapabilities(c)&&Va.setSelection(c,a);b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});try{c.focus()}catch(d){}for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}},getSelection:function(a){return(\"selectionStart\"in\na?{start:a.selectionStart,end:a.selectionEnd}:He.getOffsets(a))||{start:0,end:0}},setSelection:function(a,b){var c=b.start,d=b.end;void 0===d&&(d=c);\"selectionStart\"in a?(a.selectionStart=c,a.selectionEnd=Math.min(d,a.value.length)):He.setOffsets(a,b)}},vc=Va;ab._injectFiber=function(a){Uc=a};ab._injectStack=function(a){Vc=a};var wb={isAncestor:function(a,b){for(;b;){if(a===b||a===b.alternate)return!0;b=C(b)}return!1},getLowestCommonAncestor:Rd,getParentInstance:function(a){return C(a)},traverseTwoPhase:function(a,\nb,c){for(var d=[];a;)d.push(a),a=C(a);for(a=d.length;0<a--;)b(d[a],\"captured\",c);for(a=0;a<d.length;a++)b(d[a],\"bubbled\",c)},traverseEnterLeave:function(a,b,c,d,e){for(var f=a&&b?Rd(a,b):null,g=[];a&&a!==f;)g.push(a),a=C(a);for(a=[];b&&b!==f;)a.push(b),b=C(b);for(b=0;b<g.length;b++)c(g[b],\"bubbled\",d);for(b=a.length;0<b--;)c(a[b],\"captured\",e)}},Td=X.getListener,la={accumulateTwoPhaseDispatches:function(a){Ha(a,pf)},accumulateTwoPhaseDispatchesSkipTarget:function(a){Ha(a,qf)},accumulateDirectDispatches:function(a){Ha(a,\nrf)},accumulateEnterLeaveDispatches:function(a,b,c,d){wb.traverseEnterLeave(c,d,Ud,a,b)}},Wa=null,Jc=null,Jb=null,Kc={initialize:function(a){Wa=a;Jc=Kc.getText();return!0},reset:function(){Jb=Jc=Wa=null},getData:function(){if(Jb)return Jb;var a,b=Jc,c=b.length,d,e=Kc.getText(),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 Jb=e.slice(a,1<d?1-d:void 0)},getText:function(){return\"value\"in Wa?Wa.value:Wa[Xc()]}},xb=Kc,Ie=\"dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances\".split(\" \"),\nVf={type:null,target:null,currentTarget:w.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};q(Ka.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():\"unknown\"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=w.thatReturnsTrue)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():\n\"unknown\"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=w.thatReturnsTrue)},persist:function(){this.isPersistent=w.thatReturnsTrue},isPersistent:w.thatReturnsFalse,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;for(a=0;a<Ie.length;a++)this[Ie[a]]=null}});Ka.Interface=Vf;Ka.augmentClass=function(a,b){function c(){}c.prototype=this.prototype;var d=new c;q(d,a.prototype);a.prototype=d;a.prototype.constructor=a;a.Interface=q({},this.Interface,\nb);a.augmentClass=this.augmentClass;Vd(a)};Vd(Ka);var O=Ka;O.augmentClass(Wd,{data:null});O.augmentClass(Xd,{data:null});var vf=[9,13,27,32],tc=z&&\"CompositionEvent\"in window,Xa=null;z&&\"documentMode\"in document&&(Xa=document.documentMode);var Wf=z&&\"TextEvent\"in window&&!Xa&&!uf(),be=z&&(!tc||Xa&&8<Xa&&11>=Xa),ae=String.fromCharCode(32),ea={beforeInput:{phasedRegistrationNames:{bubbled:\"onBeforeInput\",captured:\"onBeforeInputCapture\"},dependencies:[\"topCompositionEnd\",\"topKeyPress\",\"topTextInput\",\n\"topPaste\"]},compositionEnd:{phasedRegistrationNames:{bubbled:\"onCompositionEnd\",captured:\"onCompositionEndCapture\"},dependencies:\"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown\".split(\" \")},compositionStart:{phasedRegistrationNames:{bubbled:\"onCompositionStart\",captured:\"onCompositionStartCapture\"},dependencies:\"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown\".split(\" \")},compositionUpdate:{phasedRegistrationNames:{bubbled:\"onCompositionUpdate\",captured:\"onCompositionUpdateCapture\"},\ndependencies:\"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown\".split(\" \")}},$d=!1,wa=!1,Xf={eventTypes:ea,extractEvents:function(a,b,c,d){var e;if(tc)b:{switch(a){case \"topCompositionStart\":var f=ea.compositionStart;break b;case \"topCompositionEnd\":f=ea.compositionEnd;break b;case \"topCompositionUpdate\":f=ea.compositionUpdate;break b}f=void 0}else wa?Yd(a,c)&&(f=ea.compositionEnd):\"topKeyDown\"===a&&229===c.keyCode&&(f=ea.compositionStart);f?(be&&(wa||f!==ea.compositionStart?\nf===ea.compositionEnd&&wa&&(e=xb.getData()):wa=xb.initialize(d)),f=Wd.getPooled(f,b,c,d),e?f.data=e:(e=Zd(c),null!==e&&(f.data=e)),la.accumulateTwoPhaseDispatches(f),e=f):e=null;(a=Wf?wf(a,c):xf(a,c))?(b=Xd.getPooled(ea.beforeInput,b,c,d),b.data=a,la.accumulateTwoPhaseDispatches(b)):b=null;return[e,b]}},Oe={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},de={change:{phasedRegistrationNames:{bubbled:\"onChange\",\ncaptured:\"onChangeCapture\"},dependencies:\"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange\".split(\" \")}},La=null,Ma=null,Lc=!1;z&&(Lc=Fa(\"input\")&&(!document.documentMode||9<document.documentMode));var Yf={eventTypes:de,_isInputEventSupported:Lc,extractEvents:function(a,b,c,d){var e=b?N.getNodeFromInstance(b):window,f=e.nodeName&&e.nodeName.toLowerCase();if(\"select\"===f||\"input\"===f&&\"file\"===e.type)var g=zf;else if(Tc(e))if(Lc)g=Df;else{g=Bf;var h=Af}else f=e.nodeName,\n!f||\"input\"!==f.toLowerCase()||\"checkbox\"!==e.type&&\"radio\"!==e.type||(g=Cf);if(g&&(g=g(a,b)))return ce(g,c,d);h&&h(a,e,b);\"topBlur\"===a&&null!=b&&(a=b._wrapperState||e._wrapperState)&&a.controlled&&\"number\"===e.type&&(a=\"\"+e.value,e.getAttribute(\"value\")!==a&&e.setAttribute(\"value\",a))}};O.augmentClass(ge,{view:function(a){if(a.view)return a.view;a=jb(a);return a.window===a?a:(a=a.ownerDocument)?a.defaultView||a.parentWindow:window},detail:function(a){return a.detail||0}});var Y=ge,Ef={Alt:\"altKey\",\nControl:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};Y.augmentClass(he,{screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Pb,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)}});var ma=he,Mc={mouseEnter:{registrationName:\"onMouseEnter\",dependencies:[\"topMouseOut\",\"topMouseOver\"]},mouseLeave:{registrationName:\"onMouseLeave\",dependencies:[\"topMouseOut\",\n\"topMouseOver\"]}},Zf={eventTypes:Mc,extractEvents:function(a,b,c,d){if(\"topMouseOver\"===a&&(c.relatedTarget||c.fromElement)||\"topMouseOut\"!==a&&\"topMouseOver\"!==a)return null;var e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window;\"topMouseOut\"===a?(a=b,b=(b=c.relatedTarget||c.toElement)?N.getClosestInstanceFromNode(b):null):a=null;if(a===b)return null;var f=null==a?e:N.getNodeFromInstance(a);e=null==b?e:N.getNodeFromInstance(b);var g=ma.getPooled(Mc.mouseLeave,a,c,d);g.type=\n\"mouseleave\";g.target=f;g.relatedTarget=e;c=ma.getPooled(Mc.mouseEnter,b,c,d);c.type=\"mouseenter\";c.target=e;c.relatedTarget=f;la.accumulateEnterLeaveDispatches(g,c,a,b);return[g,c]}},$f=z&&\"documentMode\"in document&&11>=document.documentMode,je={select:{phasedRegistrationNames:{bubbled:\"onSelect\",captured:\"onSelectCapture\"},dependencies:\"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange\".split(\" \")}},ya=null,wc=null,Na=null,uc=!1,ag=l.isListeningToAllDependencies,\nbg={eventTypes:je,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument;if(!e||!ag(\"onSelect\",e))return null;e=b?N.getNodeFromInstance(b):window;switch(a){case \"topFocus\":if(Tc(e)||\"true\"===e.contentEditable)ya=e,wc=b,Na=null;break;case \"topBlur\":Na=wc=ya=null;break;case \"topMouseDown\":uc=!0;break;case \"topContextMenu\":case \"topMouseUp\":return uc=!1,ie(c,d);case \"topSelectionChange\":if($f)break;case \"topKeyDown\":case \"topKeyUp\":return ie(c,d)}return null}};\nO.augmentClass(ke,{animationName:null,elapsedTime:null,pseudoElement:null});O.augmentClass(le,{clipboardData:function(a){return\"clipboardData\"in a?a.clipboardData:window.clipboardData}});Y.augmentClass(me,{relatedTarget:null});var cg={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},dg={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",\n18:\"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\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"};Y.augmentClass(ne,{key:function(a){if(a.key){var b=cg[a.key]||a.key;if(\"Unidentified\"!==b)return b}return\"keypress\"===a.type?(a=$a(a),13===a?\"Enter\":String.fromCharCode(a)):\n\"keydown\"===a.type||\"keyup\"===a.type?dg[a.keyCode]||\"Unidentified\":\"\"},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Pb,charCode:function(a){return\"keypress\"===a.type?$a(a):0},keyCode:function(a){return\"keydown\"===a.type||\"keyup\"===a.type?a.keyCode:0},which:function(a){return\"keypress\"===a.type?$a(a):\"keydown\"===a.type||\"keyup\"===a.type?a.keyCode:0}});ma.augmentClass(oe,{dataTransfer:null});Y.augmentClass(pe,{touches:null,targetTouches:null,\nchangedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Pb});O.augmentClass(qe,{propertyName:null,elapsedTime:null,pseudoElement:null});ma.augmentClass(re,{deltaX:function(a){return\"deltaX\"in a?a.deltaX:\"wheelDeltaX\"in a?-a.wheelDeltaX:0},deltaY:function(a){return\"deltaY\"in a?a.deltaY:\"wheelDeltaY\"in a?-a.wheelDeltaY:\"wheelDelta\"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null});var Je={},Ke={};\"abort animationEnd animationIteration animationStart blur cancel canPlay canPlayThrough click close contextMenu copy cut doubleClick drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error focus input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing progress rateChange reset scroll seeked seeking stalled submit suspend timeUpdate toggle touchCancel touchEnd touchMove touchStart transitionEnd volumeChange waiting wheel\".split(\" \").forEach(function(a){var b=\na[0].toUpperCase()+a.slice(1),c=\"on\"+b;b=\"top\"+b;c={phasedRegistrationNames:{bubbled:c,captured:c+\"Capture\"},dependencies:[b]};Je[a]=c;Ke[b]=c});var eg={eventTypes:Je,extractEvents:function(a,b,c,d){var e=Ke[a];if(!e)return null;switch(a){case \"topAbort\":case \"topCancel\":case \"topCanPlay\":case \"topCanPlayThrough\":case \"topClose\":case \"topDurationChange\":case \"topEmptied\":case \"topEncrypted\":case \"topEnded\":case \"topError\":case \"topInput\":case \"topInvalid\":case \"topLoad\":case \"topLoadedData\":case \"topLoadedMetadata\":case \"topLoadStart\":case \"topPause\":case \"topPlay\":case \"topPlaying\":case \"topProgress\":case \"topRateChange\":case \"topReset\":case \"topSeeked\":case \"topSeeking\":case \"topStalled\":case \"topSubmit\":case \"topSuspend\":case \"topTimeUpdate\":case \"topToggle\":case \"topVolumeChange\":case \"topWaiting\":var f=\nO;break;case \"topKeyPress\":if(0===$a(c))return null;case \"topKeyDown\":case \"topKeyUp\":f=ne;break;case \"topBlur\":case \"topFocus\":f=me;break;case \"topClick\":if(2===c.button)return null;case \"topDoubleClick\":case \"topMouseDown\":case \"topMouseMove\":case \"topMouseUp\":case \"topMouseOut\":case \"topMouseOver\":case \"topContextMenu\":f=ma;break;case \"topDrag\":case \"topDragEnd\":case \"topDragEnter\":case \"topDragExit\":case \"topDragLeave\":case \"topDragOver\":case \"topDragStart\":case \"topDrop\":f=oe;break;case \"topTouchCancel\":case \"topTouchEnd\":case \"topTouchMove\":case \"topTouchStart\":f=\npe;break;case \"topAnimationEnd\":case \"topAnimationIteration\":case \"topAnimationStart\":f=ke;break;case \"topTransitionEnd\":f=qe;break;case \"topScroll\":f=Y;break;case \"topWheel\":f=re;break;case \"topCopy\":case \"topCut\":case \"topPaste\":f=le}f?void 0:m(\"86\",a);a=f.getPooled(e,b,c,d);la.accumulateTwoPhaseDispatches(a);return a}};G.setHandleTopLevel(l.handleTopLevel);X.injection.injectEventPluginOrder(\"ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin\".split(\" \"));\nGa.injection.injectComponentTree(N);X.injection.injectEventPluginsByName({SimpleEventPlugin:eg,EnterLeaveEventPlugin:Zf,ChangeEventPlugin:Yf,SelectEventPlugin:bg,BeforeInputEventPlugin:Xf});var Kb=A.injection.MUST_USE_PROPERTY,r=A.injection.HAS_BOOLEAN_VALUE,Le=A.injection.HAS_NUMERIC_VALUE,Lb=A.injection.HAS_POSITIVE_NUMERIC_VALUE,Ya=A.injection.HAS_STRING_BOOLEAN_VALUE,fg={Properties:{allowFullScreen:r,allowTransparency:Ya,async:r,autoPlay:r,capture:r,checked:Kb|r,cols:Lb,contentEditable:Ya,controls:r,\n\"default\":r,defer:r,disabled:r,download:A.injection.HAS_OVERLOADED_BOOLEAN_VALUE,draggable:Ya,formNoValidate:r,hidden:r,loop:r,multiple:Kb|r,muted:Kb|r,noValidate:r,open:r,playsInline:r,readOnly:r,required:r,reversed:r,rows:Lb,rowSpan:Le,scoped:r,seamless:r,selected:Kb|r,size:Lb,start:Le,span:Lb,spellCheck:Ya,style:0,itemScope:r,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:Ya},DOMAttributeNames:{acceptCharset:\"accept-charset\",className:\"class\",htmlFor:\"for\",httpEquiv:\"http-equiv\"},DOMMutationMethods:{value:function(a,\nb){if(null==b)return a.removeAttribute(\"value\");\"number\"!==a.type||!1===a.hasAttribute(\"value\")?a.setAttribute(\"value\",\"\"+b):a.validity&&!a.validity.badInput&&a.ownerDocument.activeElement!==a&&a.setAttribute(\"value\",\"\"+b)}}},Nc=A.injection.HAS_STRING_BOOLEAN_VALUE,Oc={Properties:{autoReverse:Nc,externalResourcesRequired:Nc,preserveAlpha:Nc},DOMAttributeNames:{autoReverse:\"autoReverse\",externalResourcesRequired:\"externalResourcesRequired\",preserveAlpha:\"preserveAlpha\"},DOMAttributeNamespaces:{xlinkActuate:\"http://www.w3.org/1999/xlink\",\nxlinkArcrole:\"http://www.w3.org/1999/xlink\",xlinkHref:\"http://www.w3.org/1999/xlink\",xlinkRole:\"http://www.w3.org/1999/xlink\",xlinkShow:\"http://www.w3.org/1999/xlink\",xlinkTitle:\"http://www.w3.org/1999/xlink\",xlinkType:\"http://www.w3.org/1999/xlink\",xmlBase:\"http://www.w3.org/XML/1998/namespace\",xmlLang:\"http://www.w3.org/XML/1998/namespace\",xmlSpace:\"http://www.w3.org/XML/1998/namespace\"}},gg=/[\\-\\:]([a-z])/g;\"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 x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space\".split(\" \").forEach(function(a){var b=\na.replace(gg,Me);Oc.Properties[b]=0;Oc.DOMAttributeNames[b]=a});A.injection.injectDOMPropertyConfig(fg);A.injection.injectDOMPropertyConfig(Oc);var Gf=A.ROOT_ATTRIBUTE_NAME,hg=I.createElement,ig=I.createTextNode,jg=I.setInitialProperties,kg=I.diffProperties,lg=I.updateProperties,mg=I.diffHydratedProperties,ng=I.diffHydratedText,og=I.warnForDeletedHydratableElement,pg=I.warnForDeletedHydratableText,qg=I.warnForInsertedHydratedElement,rg=I.warnForInsertedHydratedText,Mb=N.precacheFiberNode,Pc=N.updateFiberProps;\nyb.injection.injectFiberControlledHostComponent(I);ab._injectFiber(function(a){return B.findHostInstance(a)});var Qc=null,Rc=null,B=function(a){var b=a.getPublicInstance;a=Pe(a);var c=a.scheduleUpdate,d=a.getPriorityContext;return{createContainer:function(a){var b=new F(3,null,0);a={current:b,containerInfo:a,isScheduled:!1,nextScheduledRoot:null,context:null,pendingContext:null};return b.stateNode=a},updateContainer:function(a,b,g,h){var e=b.current;g=sc(g);null===b.context?b.context=g:b.pendingContext=\ng;b=d(e,null!=a&&null!=a.type&&null!=a.type.prototype&&!0===a.type.prototype.unstable_isAsyncReactComponent);g={element:a};a=null===g.element;h={priorityLevel:b,partialState:g,callback:void 0===h?null:h,isReplace:!1,isForced:!1,isTopLevelUnmount:a,next:null};g=hb(e,h);if(a){a=pc;var f=qc;null!==a&&null!==h.next&&(h.next=null,a.last=h);null!==f&&null!==g&&null!==g.next&&(g.next=null,f.last=h)}c(e,b)},batchedUpdates:a.batchedUpdates,unbatchedUpdates:a.unbatchedUpdates,deferredUpdates:a.deferredUpdates,\nflushSync:a.flushSync,getPublicRootInstance:function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return b(a.child.stateNode);default:return a.child.stateNode}},findHostInstance:function(a){a=Tf(a);return null===a?null:a.stateNode},findHostInstanceWithNoPortals:function(a){a=Uf(a);return null===a?null:a.stateNode}}}({getRootHostContext:function(a){if(9===a.nodeType)a=(a=a.documentElement)?a.namespaceURI:Ob(null,\"\");else{var b=8===a.nodeType?a.parentNode:a;a=b.namespaceURI||null;\nb=b.tagName;a=Ob(a,b)}return a},getChildHostContext:function(a,b){return Ob(a,b)},getPublicInstance:function(a){return a},prepareForCommit:function(){Qc=l.isEnabled();Rc=vc.getSelectionInformation();l.setEnabled(!1)},resetAfterCommit:function(){vc.restoreSelection(Rc);Rc=null;l.setEnabled(Qc);Qc=null},createInstance:function(a,b,c,d,e){a=hg(a,b,c,d);Mb(e,a);Pc(a,b);return a},appendInitialChild:function(a,b){a.appendChild(b)},finalizeInitialChildren:function(a,b,c,d){jg(a,b,c,d);a:{switch(b){case \"button\":case \"input\":case \"select\":case \"textarea\":a=\n!!c.autoFocus;break a}a=!1}return a},prepareUpdate:function(a,b,c,d,e){return kg(a,b,c,d,e)},commitMount:function(a){a.focus()},commitUpdate:function(a,b,c,d,e){Pc(a,e);lg(a,b,c,d,e)},shouldSetTextContent:function(a,b){return\"textarea\"===a||\"string\"===typeof b.children||\"number\"===typeof b.children||\"object\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&\"string\"===typeof b.dangerouslySetInnerHTML.__html},resetTextContent:function(a){a.textContent=\"\"},shouldDeprioritizeSubtree:function(a,\nb){return!!b.hidden},createTextInstance:function(a,b,c,d){a=ig(a,b);Mb(d,a);return a},commitTextUpdate:function(a,b,c){a.nodeValue=c},appendChild:function(a,b){a.appendChild(b)},appendChildToContainer:function(a,b){8===a.nodeType?a.parentNode.insertBefore(b,a):a.appendChild(b)},insertBefore:function(a,b,c){a.insertBefore(b,c)},insertInContainerBefore:function(a,b,c){8===a.nodeType?a.parentNode.insertBefore(b,c):a.insertBefore(b,c)},removeChild:function(a,b){a.removeChild(b)},removeChildFromContainer:function(a,\nb){8===a.nodeType?a.parentNode.removeChild(b):a.removeChild(b)},canHydrateInstance:function(a,b){return 1===a.nodeType&&b===a.nodeName.toLowerCase()},canHydrateTextInstance:function(a,b){return\"\"===b?!1:3===a.nodeType},getNextHydratableSibling:function(a){for(a=a.nextSibling;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a},getFirstHydratableChild:function(a){for(a=a.firstChild;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a},hydrateInstance:function(a,b,c,d,e,f){Mb(f,a);Pc(a,\nc);return mg(a,b,c,e,d)},hydrateTextInstance:function(a,b,c){Mb(c,a);return ng(a,b)},didNotHydrateInstance:function(a,b){1===b.nodeType?og(a,b):pg(a,b)},didNotFindHydratableInstance:function(a,b,c){qg(a,b,c)},didNotFindHydratableTextInstance:function(a,b){rg(a,b)},scheduleDeferredCallback:Pf,useSyncScheduling:!0});Ab.injection.injectFiberBatchedUpdates(B.batchedUpdates);var sg={createPortal:se,hydrate:function(a,b,c){return Bb(null,a,b,!0,c)},render:function(a,b,c){return Bb(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,\nb,c,d){null!=a&&fa.has(a)?void 0:m(\"38\");return Bb(a,b,c,!1,d)},unmountComponentAtNode:function(a){xc(a)?void 0:m(\"40\");return a._reactRootContainer?(B.unbatchedUpdates(function(){Bb(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},findDOMNode:ab,unstable_createPortal:se,unstable_batchedUpdates:Ab.batchedUpdates,unstable_deferredUpdates:B.deferredUpdates,flushSync:B.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:X,EventPluginRegistry:na,EventPropagators:la,\nReactControlledComponent:yb,ReactDOMComponentTree:N,ReactDOMEventListener:G}};(function(a){if(\"undefined\"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!b.supportsFiber)return!0;try{var c=b.inject(a);Vb=Pd(function(a){return b.onCommitFiberRoot(c,a)});Wb=Pd(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0})({findFiberByHostInstance:N.getClosestInstanceFromNode,findHostInstanceByFiber:B.findHostInstance,bundleType:0,version:\"16.0.0\",rendererPackageName:\"react-dom\"});\nreturn sg}\"object\"===typeof exports&&\"undefined\"!==typeof module?module.exports=Nb(require(\"react\")):\"function\"===typeof define&&define.amd?define([\"react\"],Nb):this.ReactDOM=Nb(this.React);\n"
  },
  {
    "path": "test/lib/react_v15.1.0.js",
    "content": " /**\n  * React v15.1.0\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.React = 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(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AutoFocusUtils\n */\n\n'use strict';\n\nvar ReactDOMComponentTree = _dereq_(41);\n\nvar focusNode = _dereq_(151);\n\nvar AutoFocusUtils = {\n  focusDOMComponent: function () {\n    focusNode(ReactDOMComponentTree.getNodeFromInstance(this));\n  }\n};\n\nmodule.exports = AutoFocusUtils;\n},{\"151\":151,\"41\":41}],2:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BeforeInputEventPlugin\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar EventPropagators = _dereq_(20);\nvar ExecutionEnvironment = _dereq_(143);\nvar FallbackCompositionState = _dereq_(21);\nvar SyntheticCompositionEvent = _dereq_(100);\nvar SyntheticInputEvent = _dereq_(104);\n\nvar keyOf = _dereq_(161);\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\n\nvar canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;\n\nvar documentMode = null;\nif (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {\n  documentMode = document.documentMode;\n}\n\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 = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();\n\n// 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 = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\n\n/**\n * Opera <= 12 includes TextEvent in window, but does not fire\n * text input events. Rely on keypress instead.\n */\nfunction isPresto() {\n  var opera = window.opera;\n  return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;\n}\n\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\n// Events and their corresponding property names.\nvar eventTypes = {\n  beforeInput: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onBeforeInput: null }),\n      captured: keyOf({ onBeforeInputCapture: null })\n    },\n    dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]\n  },\n  compositionEnd: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCompositionEnd: null }),\n      captured: keyOf({ onCompositionEndCapture: null })\n    },\n    dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]\n  },\n  compositionStart: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCompositionStart: null }),\n      captured: keyOf({ onCompositionStartCapture: null })\n    },\n    dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]\n  },\n  compositionUpdate: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCompositionUpdate: null }),\n      captured: keyOf({ onCompositionUpdateCapture: null })\n    },\n    dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]\n  }\n};\n\n// Track whether we've ever handled a keypress on the space key.\nvar hasSpaceKeypress = false;\n\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) &&\n  // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n  !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\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 topLevelTypes.topCompositionStart:\n      return eventTypes.compositionStart;\n    case topLevelTypes.topCompositionEnd:\n      return eventTypes.compositionEnd;\n    case topLevelTypes.topCompositionUpdate:\n      return eventTypes.compositionUpdate;\n  }\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 === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;\n}\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 topLevelTypes.topKeyUp:\n      // Command keys insert or clear IME input.\n      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n    case topLevelTypes.topKeyDown:\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 topLevelTypes.topKeyPress:\n    case topLevelTypes.topMouseDown:\n    case topLevelTypes.topBlur:\n      // Events are not possible without cancelling IME.\n      return true;\n    default:\n      return false;\n  }\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// Track the current IME composition fallback object, if any.\nvar currentComposition = null;\n\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var eventType;\n  var fallbackData;\n\n  if (canUseCompositionEvent) {\n    eventType = getCompositionEventType(topLevelType);\n  } else if (!currentComposition) {\n    if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n      eventType = eventTypes.compositionStart;\n    }\n  } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n    eventType = eventTypes.compositionEnd;\n  }\n\n  if (!eventType) {\n    return null;\n  }\n\n  if (useFallbackCompositionData) {\n    // The current composition is stored statically and must not be\n    // overwritten while composition continues.\n    if (!currentComposition && eventType === eventTypes.compositionStart) {\n      currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);\n    } else if (eventType === eventTypes.compositionEnd) {\n      if (currentComposition) {\n        fallbackData = currentComposition.getData();\n      }\n    }\n  }\n\n  var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\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  EventPropagators.accumulateTwoPhaseDispatches(event);\n  return event;\n}\n\n/**\n * @param {string} topLevelType Record from `EventConstants`.\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 topLevelTypes.topCompositionEnd:\n      return getDataFromCustomEvent(nativeEvent);\n    case topLevelTypes.topKeyPress:\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\n      hasSpaceKeypress = true;\n      return SPACEBAR_CHAR;\n\n    case topLevelTypes.topTextInput:\n      // Record the characters to be added to the DOM.\n      var chars = nativeEvent.data;\n\n      // 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 blacklist it.\n      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n        return null;\n      }\n\n      return chars;\n\n    default:\n      // For other native event types, do nothing.\n      return null;\n  }\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 {string} topLevelType Record from `EventConstants`.\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 (currentComposition) {\n    if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n      var chars = currentComposition.getData();\n      FallbackCompositionState.release(currentComposition);\n      currentComposition = null;\n      return chars;\n    }\n    return null;\n  }\n\n  switch (topLevelType) {\n    case topLevelTypes.topPaste:\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 topLevelTypes.topKeyPress:\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 (nativeEvent.which && !isKeypressCommand(nativeEvent)) {\n        return String.fromCharCode(nativeEvent.which);\n      }\n      return null;\n    case topLevelTypes.topCompositionEnd:\n      return useFallbackCompositionData ? null : nativeEvent.data;\n    default:\n      return null;\n  }\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\n  if (canUseTextInputEvent) {\n    chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n  } else {\n    chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n  }\n\n  // If no characters are being inserted, no BeforeInput event should\n  // be fired.\n  if (!chars) {\n    return null;\n  }\n\n  var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\n\n  event.data = chars;\n  EventPropagators.accumulateTwoPhaseDispatches(event);\n  return event;\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 */\nvar BeforeInputEventPlugin = {\n\n  eventTypes: eventTypes,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];\n  }\n};\n\nmodule.exports = BeforeInputEventPlugin;\n},{\"100\":100,\"104\":104,\"143\":143,\"16\":16,\"161\":161,\"20\":20,\"21\":21}],3:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CSSProperty\n */\n\n'use strict';\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\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  flex: true,\n  flexGrow: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  flexOrder: true,\n  gridRow: true,\n  gridColumn: 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\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/**\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/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O'];\n\n// 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/**\n * Most style properties can be unset by doing .style[prop] = '' but IE8\n * doesn't like doing that with shorthand properties so for the properties that\n * IE8 breaks on, which are listed here, we instead unset each of the\n * individual properties. See http://bugs.jquery.com/ticket/12385.\n * The 4-value 'clock' properties like margin, padding, border-width seem to\n * behave without any problems. Curiously, list-style works too without any\n * special prodding.\n */\nvar shorthandPropertyExpansions = {\n  background: {\n    backgroundAttachment: true,\n    backgroundColor: true,\n    backgroundImage: true,\n    backgroundPositionX: true,\n    backgroundPositionY: true,\n    backgroundRepeat: true\n  },\n  backgroundPosition: {\n    backgroundPositionX: true,\n    backgroundPositionY: true\n  },\n  border: {\n    borderWidth: true,\n    borderStyle: true,\n    borderColor: true\n  },\n  borderBottom: {\n    borderBottomWidth: true,\n    borderBottomStyle: true,\n    borderBottomColor: true\n  },\n  borderLeft: {\n    borderLeftWidth: true,\n    borderLeftStyle: true,\n    borderLeftColor: true\n  },\n  borderRight: {\n    borderRightWidth: true,\n    borderRightStyle: true,\n    borderRightColor: true\n  },\n  borderTop: {\n    borderTopWidth: true,\n    borderTopStyle: true,\n    borderTopColor: true\n  },\n  font: {\n    fontStyle: true,\n    fontVariant: true,\n    fontWeight: true,\n    fontSize: true,\n    lineHeight: true,\n    fontFamily: true\n  },\n  outline: {\n    outlineWidth: true,\n    outlineStyle: true,\n    outlineColor: true\n  }\n};\n\nvar CSSProperty = {\n  isUnitlessNumber: isUnitlessNumber,\n  shorthandPropertyExpansions: shorthandPropertyExpansions\n};\n\nmodule.exports = CSSProperty;\n},{}],4:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CSSPropertyOperations\n */\n\n'use strict';\n\nvar CSSProperty = _dereq_(3);\nvar ExecutionEnvironment = _dereq_(143);\nvar ReactInstrumentation = _dereq_(71);\n\nvar camelizeStyleName = _dereq_(145);\nvar dangerousStyleValue = _dereq_(117);\nvar hyphenateStyleName = _dereq_(156);\nvar memoizeStringOnly = _dereq_(163);\nvar warning = _dereq_(167);\n\nvar processStyleName = memoizeStringOnly(function (styleName) {\n  return hyphenateStyleName(styleName);\n});\n\nvar hasShorthandPropertyBug = false;\nvar styleFloatAccessor = 'cssFloat';\nif (ExecutionEnvironment.canUseDOM) {\n  var tempStyle = document.createElement('div').style;\n  try {\n    // IE8 throws \"Invalid argument.\" if resetting shorthand style properties.\n    tempStyle.font = '';\n  } catch (e) {\n    hasShorthandPropertyBug = true;\n  }\n  // IE8 only supports accessing cssFloat (standard) as styleFloat\n  if (document.documentElement.style.cssFloat === undefined) {\n    styleFloatAccessor = 'styleFloat';\n  }\n}\n\nif (\"development\" !== 'production') {\n  // 'msTransform' is correct, but the other prefixes should be capitalized\n  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n\n  // style values shouldn't contain a semicolon\n  var badStyleValueWithSemicolonPattern = /;\\s*$/;\n\n  var warnedStyleNames = {};\n  var warnedStyleValues = {};\n  var warnedForNaNValue = false;\n\n  var warnHyphenatedStyleName = function (name, owner) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n\n    warnedStyleNames[name] = true;\n    \"development\" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;\n  };\n\n  var warnBadVendoredStyleName = function (name, owner) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n\n    warnedStyleNames[name] = true;\n    \"development\" !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;\n  };\n\n  var warnStyleValueWithSemicolon = function (name, value, owner) {\n    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n      return;\n    }\n\n    warnedStyleValues[value] = true;\n    \"development\" !== 'production' ? warning(false, 'Style property values shouldn\\'t contain a semicolon.%s ' + 'Try \"%s: %s\" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;\n  };\n\n  var warnStyleValueIsNaN = function (name, value, owner) {\n    if (warnedForNaNValue) {\n      return;\n    }\n\n    warnedForNaNValue = true;\n    \"development\" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;\n  };\n\n  var checkRenderMessage = function (owner) {\n    if (owner) {\n      var name = owner.getName();\n      if (name) {\n        return ' Check the render method of `' + name + '`.';\n      }\n    }\n    return '';\n  };\n\n  /**\n   * @param {string} name\n   * @param {*} value\n   * @param {ReactDOMComponent} component\n   */\n  var warnValidStyle = function (name, value, component) {\n    var owner;\n    if (component) {\n      owner = component._currentElement._owner;\n    }\n    if (name.indexOf('-') > -1) {\n      warnHyphenatedStyleName(name, owner);\n    } else if (badVendoredStyleNamePattern.test(name)) {\n      warnBadVendoredStyleName(name, owner);\n    } else if (badStyleValueWithSemicolonPattern.test(value)) {\n      warnStyleValueWithSemicolon(name, value, owner);\n    }\n\n    if (typeof value === 'number' && isNaN(value)) {\n      warnStyleValueIsNaN(name, value, owner);\n    }\n  };\n}\n\n/**\n * Operations for dealing with CSS properties.\n */\nvar CSSPropertyOperations = {\n\n  /**\n   * Serializes a mapping of style properties for use as inline styles:\n   *\n   *   > createMarkupForStyles({width: '200px', height: 0})\n   *   \"width:200px;height:0;\"\n   *\n   * Undefined values are ignored so that declarative programming is easier.\n   * The result should be HTML-escaped before insertion into the DOM.\n   *\n   * @param {object} styles\n   * @param {ReactDOMComponent} component\n   * @return {?string}\n   */\n  createMarkupForStyles: function (styles, component) {\n    var serialized = '';\n    for (var styleName in styles) {\n      if (!styles.hasOwnProperty(styleName)) {\n        continue;\n      }\n      var styleValue = styles[styleName];\n      if (\"development\" !== 'production') {\n        warnValidStyle(styleName, styleValue, component);\n      }\n      if (styleValue != null) {\n        serialized += processStyleName(styleName) + ':';\n        serialized += dangerousStyleValue(styleName, styleValue, component) + ';';\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   * @param {ReactDOMComponent} component\n   */\n  setValueForStyles: function (node, styles, component) {\n    if (\"development\" !== 'production') {\n      ReactInstrumentation.debugTool.onNativeOperation(component._debugID, 'update styles', styles);\n    }\n\n    var style = node.style;\n    for (var styleName in styles) {\n      if (!styles.hasOwnProperty(styleName)) {\n        continue;\n      }\n      if (\"development\" !== 'production') {\n        warnValidStyle(styleName, styles[styleName], component);\n      }\n      var styleValue = dangerousStyleValue(styleName, styles[styleName], component);\n      if (styleName === 'float' || styleName === 'cssFloat') {\n        styleName = styleFloatAccessor;\n      }\n      if (styleValue) {\n        style[styleName] = styleValue;\n      } else {\n        var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];\n        if (expansion) {\n          // Shorthand property that IE8 won't like unsetting, so unset each\n          // component to placate it\n          for (var individualStyleName in expansion) {\n            style[individualStyleName] = '';\n          }\n        } else {\n          style[styleName] = '';\n        }\n      }\n    }\n  }\n\n};\n\nmodule.exports = CSSPropertyOperations;\n},{\"117\":117,\"143\":143,\"145\":145,\"156\":156,\"163\":163,\"167\":167,\"3\":3,\"71\":71}],5:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CallbackQueue\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar PooledClass = _dereq_(25);\n\nvar invariant = _dereq_(157);\n\n/**\n * A specialized pseudo-event module to help keep track of components waiting to\n * be notified when their DOM representations are available for use.\n *\n * This implements `PooledClass`, so you should never need to instantiate this.\n * Instead, use `CallbackQueue.getPooled()`.\n *\n * @class ReactMountReady\n * @implements PooledClass\n * @internal\n */\nfunction CallbackQueue() {\n  this._callbacks = null;\n  this._contexts = null;\n}\n\n_assign(CallbackQueue.prototype, {\n\n  /**\n   * Enqueues a callback to be invoked when `notifyAll` is invoked.\n   *\n   * @param {function} callback Invoked when `notifyAll` is invoked.\n   * @param {?object} context Context to call `callback` with.\n   * @internal\n   */\n  enqueue: function (callback, context) {\n    this._callbacks = this._callbacks || [];\n    this._contexts = this._contexts || [];\n    this._callbacks.push(callback);\n    this._contexts.push(context);\n  },\n\n  /**\n   * Invokes all enqueued callbacks and clears the queue. This is invoked after\n   * the DOM representation of a component has been created or updated.\n   *\n   * @internal\n   */\n  notifyAll: function () {\n    var callbacks = this._callbacks;\n    var contexts = this._contexts;\n    if (callbacks) {\n      !(callbacks.length === contexts.length) ? \"development\" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : void 0;\n      this._callbacks = null;\n      this._contexts = null;\n      for (var i = 0; i < callbacks.length; i++) {\n        callbacks[i].call(contexts[i]);\n      }\n      callbacks.length = 0;\n      contexts.length = 0;\n    }\n  },\n\n  checkpoint: function () {\n    return this._callbacks ? this._callbacks.length : 0;\n  },\n\n  rollback: function (len) {\n    if (this._callbacks) {\n      this._callbacks.length = len;\n      this._contexts.length = len;\n    }\n  },\n\n  /**\n   * Resets the internal queue.\n   *\n   * @internal\n   */\n  reset: function () {\n    this._callbacks = null;\n    this._contexts = null;\n  },\n\n  /**\n   * `PooledClass` looks for this.\n   */\n  destructor: function () {\n    this.reset();\n  }\n\n});\n\nPooledClass.addPoolingTo(CallbackQueue);\n\nmodule.exports = CallbackQueue;\n},{\"157\":157,\"168\":168,\"25\":25}],6:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ChangeEventPlugin\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar EventPluginHub = _dereq_(17);\nvar EventPropagators = _dereq_(20);\nvar ExecutionEnvironment = _dereq_(143);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactUpdates = _dereq_(93);\nvar SyntheticEvent = _dereq_(102);\n\nvar getEventTarget = _dereq_(125);\nvar isEventSupported = _dereq_(132);\nvar isTextInputElement = _dereq_(133);\nvar keyOf = _dereq_(161);\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar eventTypes = {\n  change: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onChange: null }),\n      captured: keyOf({ onChangeCapture: null })\n    },\n    dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]\n  }\n};\n\n/**\n * For IE shims\n */\nvar activeElement = null;\nvar activeElementInst = null;\nvar activeElementValue = null;\nvar activeElementValueProp = null;\n\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}\n\nvar doesChangeEventBubble = false;\nif (ExecutionEnvironment.canUseDOM) {\n  // See `handleChange` comment below\n  doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n  var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));\n  EventPropagators.accumulateTwoPhaseDispatches(event);\n\n  // 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  ReactUpdates.batchedUpdates(runEventInBatch, event);\n}\n\nfunction runEventInBatch(event) {\n  EventPluginHub.enqueueEvents(event);\n  EventPluginHub.processEventQueue(false);\n}\n\nfunction startWatchingForChangeEventIE8(target, targetInst) {\n  activeElement = target;\n  activeElementInst = targetInst;\n  activeElement.attachEvent('onchange', manualDispatchChangeEvent);\n}\n\nfunction stopWatchingForChangeEventIE8() {\n  if (!activeElement) {\n    return;\n  }\n  activeElement.detachEvent('onchange', manualDispatchChangeEvent);\n  activeElement = null;\n  activeElementInst = null;\n}\n\nfunction getTargetInstForChangeEvent(topLevelType, targetInst) {\n  if (topLevelType === topLevelTypes.topChange) {\n    return targetInst;\n  }\n}\nfunction handleEventsForChangeEventIE8(topLevelType, target, targetInst) {\n  if (topLevelType === topLevelTypes.topFocus) {\n    // stopWatching() should be a noop here but we call it just in case we\n    // missed a blur event somehow.\n    stopWatchingForChangeEventIE8();\n    startWatchingForChangeEventIE8(target, targetInst);\n  } else if (topLevelType === topLevelTypes.topBlur) {\n    stopWatchingForChangeEventIE8();\n  }\n}\n\n/**\n * SECTION: handle `input` event\n */\nvar isInputEventSupported = false;\nif (ExecutionEnvironment.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  // IE10+ fire input events to often, such when a placeholder\n  // changes or when an input with a placeholder is focused.\n  isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);\n}\n\n/**\n * (For IE <=11) Replacement getter/setter for the `value` property that gets\n * set on the active element.\n */\nvar newValueProp = {\n  get: function () {\n    return activeElementValueProp.get.call(this);\n  },\n  set: function (val) {\n    // Cast to a string so we can do equality checks.\n    activeElementValue = '' + val;\n    activeElementValueProp.set.call(this, val);\n  }\n};\n\n/**\n * (For IE <=11) 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  activeElementValue = target.value;\n  activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');\n\n  // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n  // on DOM elements\n  Object.defineProperty(activeElement, 'value', newValueProp);\n  if (activeElement.attachEvent) {\n    activeElement.attachEvent('onpropertychange', handlePropertyChange);\n  } else {\n    activeElement.addEventListener('propertychange', handlePropertyChange, false);\n  }\n}\n\n/**\n * (For IE <=11) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\nfunction stopWatchingForValueChange() {\n  if (!activeElement) {\n    return;\n  }\n\n  // delete restores the original property definition\n  delete activeElement.value;\n\n  if (activeElement.detachEvent) {\n    activeElement.detachEvent('onpropertychange', handlePropertyChange);\n  } else {\n    activeElement.removeEventListener('propertychange', handlePropertyChange, false);\n  }\n\n  activeElement = null;\n  activeElementInst = null;\n  activeElementValue = null;\n  activeElementValueProp = null;\n}\n\n/**\n * (For IE <=11) 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  var value = nativeEvent.srcElement.value;\n  if (value === activeElementValue) {\n    return;\n  }\n  activeElementValue = value;\n\n  manualDispatchChangeEvent(nativeEvent);\n}\n\n/**\n * If a `change` event should be fired, returns the target's ID.\n */\nfunction getTargetInstForInputEvent(topLevelType, targetInst) {\n  if (topLevelType === topLevelTypes.topInput) {\n    // In modern browsers (i.e., not IE8 or IE9), the input event is exactly\n    // what we want so fall through here and trigger an abstract event\n    return targetInst;\n  }\n}\n\nfunction handleEventsForInputEventIE(topLevelType, target, targetInst) {\n  if (topLevelType === topLevelTypes.topFocus) {\n    // In IE8, we can capture almost all .value changes by adding a\n    // propertychange handler and looking for events with propertyName\n    // equal to 'value'\n    // In IE9-11, 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 === topLevelTypes.topBlur) {\n    stopWatchingForValueChange();\n  }\n}\n\n// For IE8 and IE9.\nfunction getTargetInstForInputEventIE(topLevelType, targetInst) {\n  if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {\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    if (activeElement && activeElement.value !== activeElementValue) {\n      activeElementValue = activeElement.value;\n      return activeElementInst;\n    }\n  }\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  return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\n\nfunction getTargetInstForClickEvent(topLevelType, targetInst) {\n  if (topLevelType === topLevelTypes.topClick) {\n    return targetInst;\n  }\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\n  eventTypes: eventTypes,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;\n\n    var getTargetInstFunc, handleEventFunc;\n    if (shouldUseChangeEvent(targetNode)) {\n      if (doesChangeEventBubble) {\n        getTargetInstFunc = getTargetInstForChangeEvent;\n      } else {\n        handleEventFunc = handleEventsForChangeEventIE8;\n      }\n    } else if (isTextInputElement(targetNode)) {\n      if (isInputEventSupported) {\n        getTargetInstFunc = getTargetInstForInputEvent;\n      } else {\n        getTargetInstFunc = getTargetInstForInputEventIE;\n        handleEventFunc = handleEventsForInputEventIE;\n      }\n    } else if (shouldUseClickEvent(targetNode)) {\n      getTargetInstFunc = getTargetInstForClickEvent;\n    }\n\n    if (getTargetInstFunc) {\n      var inst = getTargetInstFunc(topLevelType, targetInst);\n      if (inst) {\n        var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);\n        event.type = 'change';\n        EventPropagators.accumulateTwoPhaseDispatches(event);\n        return event;\n      }\n    }\n\n    if (handleEventFunc) {\n      handleEventFunc(topLevelType, targetNode, targetInst);\n    }\n  }\n\n};\n\nmodule.exports = ChangeEventPlugin;\n},{\"102\":102,\"125\":125,\"132\":132,\"133\":133,\"143\":143,\"16\":16,\"161\":161,\"17\":17,\"20\":20,\"41\":41,\"93\":93}],7:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DOMChildrenOperations\n */\n\n'use strict';\n\nvar DOMLazyTree = _dereq_(8);\nvar Danger = _dereq_(12);\nvar ReactMultiChildUpdateTypes = _dereq_(76);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactInstrumentation = _dereq_(71);\n\nvar createMicrosoftUnsafeLocalFunction = _dereq_(116);\nvar setInnerHTML = _dereq_(137);\nvar setTextContent = _dereq_(138);\n\nfunction getNodeAfter(parentNode, node) {\n  // Special case for text components, which return [open, close] comments\n  // from getNativeNode.\n  if (Array.isArray(node)) {\n    node = node[1];\n  }\n  return node ? node.nextSibling : parentNode.firstChild;\n}\n\n/**\n * Inserts `childNode` as a child of `parentNode` at the `index`.\n *\n * @param {DOMElement} parentNode Parent node in which to insert.\n * @param {DOMElement} childNode Child node to insert.\n * @param {number} index Index at which to insert the child.\n * @internal\n */\nvar insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {\n  // We rely exclusively on `insertBefore(node, null)` instead of also using\n  // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so\n  // we are careful to use `null`.)\n  parentNode.insertBefore(childNode, referenceNode);\n});\n\nfunction insertLazyTreeChildAt(parentNode, childTree, referenceNode) {\n  DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);\n}\n\nfunction moveChild(parentNode, childNode, referenceNode) {\n  if (Array.isArray(childNode)) {\n    moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);\n  } else {\n    insertChildAt(parentNode, childNode, referenceNode);\n  }\n}\n\nfunction removeChild(parentNode, childNode) {\n  if (Array.isArray(childNode)) {\n    var closingComment = childNode[1];\n    childNode = childNode[0];\n    removeDelimitedText(parentNode, childNode, closingComment);\n    parentNode.removeChild(closingComment);\n  }\n  parentNode.removeChild(childNode);\n}\n\nfunction moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {\n  var node = openingComment;\n  while (true) {\n    var nextNode = node.nextSibling;\n    insertChildAt(parentNode, node, referenceNode);\n    if (node === closingComment) {\n      break;\n    }\n    node = nextNode;\n  }\n}\n\nfunction removeDelimitedText(parentNode, startNode, closingComment) {\n  while (true) {\n    var node = startNode.nextSibling;\n    if (node === closingComment) {\n      // The closing comment is removed by ReactMultiChild.\n      break;\n    } else {\n      parentNode.removeChild(node);\n    }\n  }\n}\n\nfunction replaceDelimitedText(openingComment, closingComment, stringText) {\n  var parentNode = openingComment.parentNode;\n  var nodeAfterComment = openingComment.nextSibling;\n  if (nodeAfterComment === closingComment) {\n    // There are no text nodes between the opening and closing comments; insert\n    // a new one if stringText isn't empty.\n    if (stringText) {\n      insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);\n    }\n  } else {\n    if (stringText) {\n      // Set the text content of the first node after the opening comment, and\n      // remove all following nodes up until the closing comment.\n      setTextContent(nodeAfterComment, stringText);\n      removeDelimitedText(parentNode, nodeAfterComment, closingComment);\n    } else {\n      removeDelimitedText(parentNode, openingComment, closingComment);\n    }\n  }\n\n  if (\"development\" !== 'production') {\n    ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);\n  }\n}\n\nvar dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;\nif (\"development\" !== 'production') {\n  dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {\n    Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);\n    if (prevInstance._debugID !== 0) {\n      ReactInstrumentation.debugTool.onNativeOperation(prevInstance._debugID, 'replace with', markup.toString());\n    } else {\n      var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);\n      if (nextInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onNativeOperation(nextInstance._debugID, 'mount', markup.toString());\n      }\n    }\n  };\n}\n\n/**\n * Operations for updating with DOM children.\n */\nvar DOMChildrenOperations = {\n\n  dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,\n\n  replaceDelimitedText: replaceDelimitedText,\n\n  /**\n   * Updates a component's children by processing a series of updates. The\n   * update configurations are each expected to have a `parentNode` property.\n   *\n   * @param {array<object>} updates List of update configurations.\n   * @internal\n   */\n  processUpdates: function (parentNode, updates) {\n    if (\"development\" !== 'production') {\n      var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;\n    }\n\n    for (var k = 0; k < updates.length; k++) {\n      var update = updates[k];\n      switch (update.type) {\n        case ReactMultiChildUpdateTypes.INSERT_MARKUP:\n          insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));\n          if (\"development\" !== 'production') {\n            ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });\n          }\n          break;\n        case ReactMultiChildUpdateTypes.MOVE_EXISTING:\n          moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));\n          if (\"development\" !== 'production') {\n            ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });\n          }\n          break;\n        case ReactMultiChildUpdateTypes.SET_MARKUP:\n          setInnerHTML(parentNode, update.content);\n          if (\"development\" !== 'production') {\n            ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace children', update.content.toString());\n          }\n          break;\n        case ReactMultiChildUpdateTypes.TEXT_CONTENT:\n          setTextContent(parentNode, update.content);\n          if (\"development\" !== 'production') {\n            ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace text', update.content.toString());\n          }\n          break;\n        case ReactMultiChildUpdateTypes.REMOVE_NODE:\n          removeChild(parentNode, update.fromNode);\n          if (\"development\" !== 'production') {\n            ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });\n          }\n          break;\n      }\n    }\n  }\n\n};\n\nmodule.exports = DOMChildrenOperations;\n},{\"116\":116,\"12\":12,\"137\":137,\"138\":138,\"41\":41,\"71\":71,\"76\":76,\"8\":8}],8:[function(_dereq_,module,exports){\n/**\n * Copyright 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DOMLazyTree\n */\n\n'use strict';\n\nvar DOMNamespaces = _dereq_(9);\n\nvar createMicrosoftUnsafeLocalFunction = _dereq_(116);\nvar setTextContent = _dereq_(138);\n\nvar ELEMENT_NODE_TYPE = 1;\nvar DOCUMENT_FRAGMENT_NODE_TYPE = 11;\n\n/**\n * In IE (8-11) and Edge, appending nodes with no children is dramatically\n * faster than appending a full subtree, so we essentially queue up the\n * .appendChild calls here and apply them so each node is added to its parent\n * before any children are added.\n *\n * In other browsers, doing so is slower or neutral compared to the other order\n * (in Firefox, twice as slow) so we only do this inversion in IE.\n *\n * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.\n */\nvar enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\\bEdge\\/\\d/.test(navigator.userAgent);\n\nfunction insertTreeChildren(tree) {\n  if (!enableLazy) {\n    return;\n  }\n  var node = tree.node;\n  var children = tree.children;\n  if (children.length) {\n    for (var i = 0; i < children.length; i++) {\n      insertTreeBefore(node, children[i], null);\n    }\n  } else if (tree.html != null) {\n    node.innerHTML = tree.html;\n  } else if (tree.text != null) {\n    setTextContent(node, tree.text);\n  }\n}\n\nvar insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {\n  // DocumentFragments aren't actually part of the DOM after insertion so\n  // appending children won't update the DOM. We need to ensure the fragment\n  // is properly populated first, breaking out of our lazy approach for just\n  // this level. Also, some <object> plugins (like Flash Player) will read\n  // <param> nodes immediately upon insertion into the DOM, so <object>\n  // must also be populated prior to insertion into the DOM.\n  if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {\n    insertTreeChildren(tree);\n    parentNode.insertBefore(tree.node, referenceNode);\n  } else {\n    parentNode.insertBefore(tree.node, referenceNode);\n    insertTreeChildren(tree);\n  }\n});\n\nfunction replaceChildWithTree(oldNode, newTree) {\n  oldNode.parentNode.replaceChild(newTree.node, oldNode);\n  insertTreeChildren(newTree);\n}\n\nfunction queueChild(parentTree, childTree) {\n  if (enableLazy) {\n    parentTree.children.push(childTree);\n  } else {\n    parentTree.node.appendChild(childTree.node);\n  }\n}\n\nfunction queueHTML(tree, html) {\n  if (enableLazy) {\n    tree.html = html;\n  } else {\n    tree.node.innerHTML = html;\n  }\n}\n\nfunction queueText(tree, text) {\n  if (enableLazy) {\n    tree.text = text;\n  } else {\n    setTextContent(tree.node, text);\n  }\n}\n\nfunction toString() {\n  return this.node.nodeName;\n}\n\nfunction DOMLazyTree(node) {\n  return {\n    node: node,\n    children: [],\n    html: null,\n    text: null,\n    toString: toString\n  };\n}\n\nDOMLazyTree.insertTreeBefore = insertTreeBefore;\nDOMLazyTree.replaceChildWithTree = replaceChildWithTree;\nDOMLazyTree.queueChild = queueChild;\nDOMLazyTree.queueHTML = queueHTML;\nDOMLazyTree.queueText = queueText;\n\nmodule.exports = DOMLazyTree;\n},{\"116\":116,\"138\":138,\"9\":9}],9:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DOMNamespaces\n */\n\n'use strict';\n\nvar DOMNamespaces = {\n  html: 'http://www.w3.org/1999/xhtml',\n  mathml: 'http://www.w3.org/1998/Math/MathML',\n  svg: 'http://www.w3.org/2000/svg'\n};\n\nmodule.exports = DOMNamespaces;\n},{}],10:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DOMProperty\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\nfunction checkMask(value, bitmask) {\n  return (value & bitmask) === bitmask;\n}\n\nvar DOMPropertyInjection = {\n  /**\n   * Mapping from normalized, camelcased property names to a configuration that\n   * specifies how the associated DOM property should be accessed or rendered.\n   */\n  MUST_USE_PROPERTY: 0x1,\n  HAS_SIDE_EFFECTS: 0x2,\n  HAS_BOOLEAN_VALUE: 0x4,\n  HAS_NUMERIC_VALUE: 0x8,\n  HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,\n  HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,\n\n  /**\n   * Inject some specialized knowledge about the DOM. This takes a config object\n   * with the following properties:\n   *\n   * isCustomAttribute: function that given an attribute name will return true\n   * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*\n   * attributes where it's impossible to enumerate all of the possible\n   * attribute names,\n   *\n   * Properties: object mapping DOM property name to one of the\n   * DOMPropertyInjection constants or null. If your attribute isn't in here,\n   * it won't get written to the DOM.\n   *\n   * DOMAttributeNames: object mapping React attribute name to the DOM\n   * attribute name. Attribute names not specified use the **lowercase**\n   * normalized name.\n   *\n   * DOMAttributeNamespaces: object mapping React attribute name to the DOM\n   * attribute namespace URL. (Attribute names not specified use no namespace.)\n   *\n   * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.\n   * Property names not specified use the normalized name.\n   *\n   * DOMMutationMethods: Properties that require special mutation methods. If\n   * `value` is undefined, the mutation method should unset the property.\n   *\n   * @param {object} domPropertyConfig the config as described above.\n   */\n  injectDOMPropertyConfig: function (domPropertyConfig) {\n    var Injection = DOMPropertyInjection;\n    var Properties = domPropertyConfig.Properties || {};\n    var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};\n    var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};\n    var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};\n    var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};\n\n    if (domPropertyConfig.isCustomAttribute) {\n      DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);\n    }\n\n    for (var propName in Properties) {\n      !!DOMProperty.properties.hasOwnProperty(propName) ? \"development\" !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\\'re trying to inject DOM property ' + '\\'%s\\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : void 0;\n\n      var lowerCased = propName.toLowerCase();\n      var propConfig = Properties[propName];\n\n      var propertyInfo = {\n        attributeName: lowerCased,\n        attributeNamespace: null,\n        propertyName: propName,\n        mutationMethod: null,\n\n        mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),\n        hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),\n        hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),\n        hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),\n        hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),\n        hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)\n      };\n\n      !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? \"development\" !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : void 0;\n      !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? \"development\" !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : void 0;\n\n      if (\"development\" !== 'production') {\n        DOMProperty.getPossibleStandardName[lowerCased] = propName;\n      }\n\n      if (DOMAttributeNames.hasOwnProperty(propName)) {\n        var attributeName = DOMAttributeNames[propName];\n        propertyInfo.attributeName = attributeName;\n        if (\"development\" !== 'production') {\n          DOMProperty.getPossibleStandardName[attributeName] = propName;\n        }\n      }\n\n      if (DOMAttributeNamespaces.hasOwnProperty(propName)) {\n        propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];\n      }\n\n      if (DOMPropertyNames.hasOwnProperty(propName)) {\n        propertyInfo.propertyName = DOMPropertyNames[propName];\n      }\n\n      if (DOMMutationMethods.hasOwnProperty(propName)) {\n        propertyInfo.mutationMethod = DOMMutationMethods[propName];\n      }\n\n      DOMProperty.properties[propName] = propertyInfo;\n    }\n  }\n};\n\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 */\n\n/**\n * DOMProperty exports lookup objects that can be used like functions:\n *\n *   > DOMProperty.isValid['id']\n *   true\n *   > DOMProperty.isValid['foobar']\n *   undefined\n *\n * Although this may be confusing, it performs better in general.\n *\n * @see http://jsperf.com/key-exists\n * @see http://jsperf.com/key-missing\n */\nvar DOMProperty = {\n\n  ID_ATTRIBUTE_NAME: 'data-reactid',\n  ROOT_ATTRIBUTE_NAME: 'data-reactroot',\n\n  ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,\n  ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\\\-.0-9\\\\uB7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040',\n\n  /**\n   * Map from property \"standard name\" to an object with info about how to set\n   * the property in the DOM. Each object contains:\n   *\n   * attributeName:\n   *   Used when rendering markup or with `*Attribute()`.\n   * attributeNamespace\n   * propertyName:\n   *   Used on DOM node instances. (This includes properties that mutate due to\n   *   external factors.)\n   * mutationMethod:\n   *   If non-null, used instead of the property or `setAttribute()` after\n   *   initial render.\n   * mustUseProperty:\n   *   Whether the property must be accessed and mutated as an object property.\n   * hasSideEffects:\n   *   Whether or not setting a value causes side effects such as triggering\n   *   resources to be loaded or text selection changes. If true, we read from\n   *   the DOM before updating to ensure that the value is only set if it has\n   *   changed.\n   * hasBooleanValue:\n   *   Whether the property should be removed when set to a falsey value.\n   * hasNumericValue:\n   *   Whether the property must be numeric or parse as a numeric and should be\n   *   removed when set to a falsey value.\n   * hasPositiveNumericValue:\n   *   Whether the property must be positive numeric or parse as a positive\n   *   numeric and should be removed when set to a falsey value.\n   * hasOverloadedBooleanValue:\n   *   Whether the property can be used as a flag as well as with a value.\n   *   Removed when strictly equal to false; present without a value when\n   *   strictly equal to true; present with a value otherwise.\n   */\n  properties: {},\n\n  /**\n   * Mapping from lowercase property names to the properly cased version, used\n   * to warn in the case of missing properties. Available only in __DEV__.\n   * @type {Object}\n   */\n  getPossibleStandardName: \"development\" !== 'production' ? {} : null,\n\n  /**\n   * All of the isCustomAttribute() functions that have been injected.\n   */\n  _isCustomAttributeFunctions: [],\n\n  /**\n   * Checks whether a property name is a custom attribute.\n   * @method\n   */\n  isCustomAttribute: function (attributeName) {\n    for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {\n      var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];\n      if (isCustomAttributeFn(attributeName)) {\n        return true;\n      }\n    }\n    return false;\n  },\n\n  injection: DOMPropertyInjection\n};\n\nmodule.exports = DOMProperty;\n},{\"157\":157}],11:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DOMPropertyOperations\n */\n\n'use strict';\n\nvar DOMProperty = _dereq_(10);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactDOMInstrumentation = _dereq_(49);\nvar ReactInstrumentation = _dereq_(71);\n\nvar quoteAttributeValueForBrowser = _dereq_(135);\nvar warning = _dereq_(167);\n\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\n\nfunction isAttributeNameSafe(attributeName) {\n  if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {\n    return true;\n  }\n  if (illegalAttributeNameCache.hasOwnProperty(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  \"development\" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;\n  return false;\n}\n\nfunction shouldIgnoreValue(propertyInfo, value) {\n  return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;\n}\n\n/**\n * Operations for dealing with DOM properties.\n */\nvar DOMPropertyOperations = {\n\n  /**\n   * Creates markup for the ID property.\n   *\n   * @param {string} id Unescaped ID.\n   * @return {string} Markup string.\n   */\n  createMarkupForID: function (id) {\n    return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);\n  },\n\n  setAttributeForID: function (node, id) {\n    node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);\n  },\n\n  createMarkupForRoot: function () {\n    return DOMProperty.ROOT_ATTRIBUTE_NAME + '=\"\"';\n  },\n\n  setAttributeForRoot: function (node) {\n    node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');\n  },\n\n  /**\n   * Creates markup for a property.\n   *\n   * @param {string} name\n   * @param {*} value\n   * @return {?string} Markup string, or null if the property was invalid.\n   */\n  createMarkupForProperty: function (name, value) {\n    if (\"development\" !== 'production') {\n      ReactDOMInstrumentation.debugTool.onCreateMarkupForProperty(name, value);\n    }\n    var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;\n    if (propertyInfo) {\n      if (shouldIgnoreValue(propertyInfo, value)) {\n        return '';\n      }\n      var attributeName = propertyInfo.attributeName;\n      if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {\n        return attributeName + '=\"\"';\n      }\n      return attributeName + '=' + quoteAttributeValueForBrowser(value);\n    } else if (DOMProperty.isCustomAttribute(name)) {\n      if (value == null) {\n        return '';\n      }\n      return name + '=' + quoteAttributeValueForBrowser(value);\n    }\n    return null;\n  },\n\n  /**\n   * Creates markup for a custom property.\n   *\n   * @param {string} name\n   * @param {*} value\n   * @return {string} Markup string, or empty string if the property was invalid.\n   */\n  createMarkupForCustomAttribute: function (name, value) {\n    if (!isAttributeNameSafe(name) || value == null) {\n      return '';\n    }\n    return name + '=' + quoteAttributeValueForBrowser(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   */\n  setValueForProperty: function (node, name, value) {\n    var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;\n    if (propertyInfo) {\n      var mutationMethod = propertyInfo.mutationMethod;\n      if (mutationMethod) {\n        mutationMethod(node, value);\n      } else if (shouldIgnoreValue(propertyInfo, value)) {\n        this.deleteValueForProperty(node, name);\n        return;\n      } else if (propertyInfo.mustUseProperty) {\n        var propName = propertyInfo.propertyName;\n        // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the\n        // property type before comparing; only `value` does and is string.\n        if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {\n          // Contrary to `setAttribute`, object properties are properly\n          // `toString`ed by IE8/9.\n          node[propName] = value;\n        }\n      } else {\n        var attributeName = propertyInfo.attributeName;\n        var namespace = propertyInfo.attributeNamespace;\n        // `setAttribute` with objects becomes only `[object]` in IE8/9,\n        // ('' + value) makes it output the correct toString()-value.\n        if (namespace) {\n          node.setAttributeNS(namespace, attributeName, '' + value);\n        } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {\n          node.setAttribute(attributeName, '');\n        } else {\n          node.setAttribute(attributeName, '' + value);\n        }\n      }\n    } else if (DOMProperty.isCustomAttribute(name)) {\n      DOMPropertyOperations.setValueForAttribute(node, name, value);\n      return;\n    }\n\n    if (\"development\" !== 'production') {\n      ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);\n      var payload = {};\n      payload[name] = value;\n      ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);\n    }\n  },\n\n  setValueForAttribute: function (node, name, value) {\n    if (!isAttributeNameSafe(name)) {\n      return;\n    }\n    if (value == null) {\n      node.removeAttribute(name);\n    } else {\n      node.setAttribute(name, '' + value);\n    }\n\n    if (\"development\" !== 'production') {\n      var payload = {};\n      payload[name] = value;\n      ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);\n    }\n  },\n\n  /**\n   * Deletes the value for a property on a node.\n   *\n   * @param {DOMElement} node\n   * @param {string} name\n   */\n  deleteValueForProperty: function (node, name) {\n    var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;\n    if (propertyInfo) {\n      var mutationMethod = propertyInfo.mutationMethod;\n      if (mutationMethod) {\n        mutationMethod(node, undefined);\n      } else if (propertyInfo.mustUseProperty) {\n        var propName = propertyInfo.propertyName;\n        if (propertyInfo.hasBooleanValue) {\n          // No HAS_SIDE_EFFECTS logic here, only `value` has it and is string.\n          node[propName] = false;\n        } else {\n          if (!propertyInfo.hasSideEffects || '' + node[propName] !== '') {\n            node[propName] = '';\n          }\n        }\n      } else {\n        node.removeAttribute(propertyInfo.attributeName);\n      }\n    } else if (DOMProperty.isCustomAttribute(name)) {\n      node.removeAttribute(name);\n    }\n\n    if (\"development\" !== 'production') {\n      ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);\n      ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);\n    }\n  }\n\n};\n\nmodule.exports = DOMPropertyOperations;\n},{\"10\":10,\"135\":135,\"167\":167,\"41\":41,\"49\":49,\"71\":71}],12:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Danger\n */\n\n'use strict';\n\nvar DOMLazyTree = _dereq_(8);\nvar ExecutionEnvironment = _dereq_(143);\n\nvar createNodesFromMarkup = _dereq_(148);\nvar emptyFunction = _dereq_(149);\nvar getMarkupWrap = _dereq_(153);\nvar invariant = _dereq_(157);\n\nvar OPEN_TAG_NAME_EXP = /^(<[^ \\/>]+)/;\nvar RESULT_INDEX_ATTR = 'data-danger-index';\n\n/**\n * Extracts the `nodeName` from a string of markup.\n *\n * NOTE: Extracting the `nodeName` does not require a regular expression match\n * because we make assumptions about React-generated markup (i.e. there are no\n * spaces surrounding the opening tag and there is at least one attribute).\n *\n * @param {string} markup String of markup.\n * @return {string} Node name of the supplied markup.\n * @see http://jsperf.com/extract-nodename\n */\nfunction getNodeName(markup) {\n  return markup.substring(1, markup.indexOf(' '));\n}\n\nvar Danger = {\n\n  /**\n   * Renders markup into an array of nodes. The markup is expected to render\n   * into a list of root nodes. Also, the length of `resultList` and\n   * `markupList` should be the same.\n   *\n   * @param {array<string>} markupList List of markup strings to render.\n   * @return {array<DOMElement>} List of rendered nodes.\n   * @internal\n   */\n  dangerouslyRenderMarkup: function (markupList) {\n    !ExecutionEnvironment.canUseDOM ? \"development\" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : void 0;\n    var nodeName;\n    var markupByNodeName = {};\n    // Group markup by `nodeName` if a wrap is necessary, else by '*'.\n    for (var i = 0; i < markupList.length; i++) {\n      !markupList[i] ? \"development\" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : void 0;\n      nodeName = getNodeName(markupList[i]);\n      nodeName = getMarkupWrap(nodeName) ? nodeName : '*';\n      markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];\n      markupByNodeName[nodeName][i] = markupList[i];\n    }\n    var resultList = [];\n    var resultListAssignmentCount = 0;\n    for (nodeName in markupByNodeName) {\n      if (!markupByNodeName.hasOwnProperty(nodeName)) {\n        continue;\n      }\n      var markupListByNodeName = markupByNodeName[nodeName];\n\n      // This for-in loop skips the holes of the sparse array. The order of\n      // iteration should follow the order of assignment, which happens to match\n      // numerical index order, but we don't rely on that.\n      var resultIndex;\n      for (resultIndex in markupListByNodeName) {\n        if (markupListByNodeName.hasOwnProperty(resultIndex)) {\n          var markup = markupListByNodeName[resultIndex];\n\n          // Push the requested markup with an additional RESULT_INDEX_ATTR\n          // attribute.  If the markup does not start with a < character, it\n          // will be discarded below (with an appropriate console.error).\n          markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,\n          // This index will be parsed back out below.\n          '$1 ' + RESULT_INDEX_ATTR + '=\"' + resultIndex + '\" ');\n        }\n      }\n\n      // Render each group of markup with similar wrapping `nodeName`.\n      var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.\n      );\n\n      for (var j = 0; j < renderNodes.length; ++j) {\n        var renderNode = renderNodes[j];\n        if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {\n\n          resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);\n          renderNode.removeAttribute(RESULT_INDEX_ATTR);\n\n          !!resultList.hasOwnProperty(resultIndex) ? \"development\" !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : void 0;\n\n          resultList[resultIndex] = renderNode;\n\n          // This should match resultList.length and markupList.length when\n          // we're done.\n          resultListAssignmentCount += 1;\n        } else if (\"development\" !== 'production') {\n          console.error('Danger: Discarding unexpected node:', renderNode);\n        }\n      }\n    }\n\n    // Although resultList was populated out of order, it should now be a dense\n    // array.\n    !(resultListAssignmentCount === resultList.length) ? \"development\" !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : void 0;\n\n    !(resultList.length === markupList.length) ? \"development\" !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : void 0;\n\n    return resultList;\n  },\n\n  /**\n   * Replaces a node with a string of markup at its current position within its\n   * parent. The markup must render into a single root node.\n   *\n   * @param {DOMElement} oldChild Child node to replace.\n   * @param {string} markup Markup to render in place of the child node.\n   * @internal\n   */\n  dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {\n    !ExecutionEnvironment.canUseDOM ? \"development\" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;\n    !markup ? \"development\" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : void 0;\n    !(oldChild.nodeName !== 'HTML') ? \"development\" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : void 0;\n\n    if (typeof markup === 'string') {\n      var newChild = createNodesFromMarkup(markup, emptyFunction)[0];\n      oldChild.parentNode.replaceChild(newChild, oldChild);\n    } else {\n      DOMLazyTree.replaceChildWithTree(oldChild, markup);\n    }\n  }\n\n};\n\nmodule.exports = Danger;\n},{\"143\":143,\"148\":148,\"149\":149,\"153\":153,\"157\":157,\"8\":8}],13:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DefaultEventPluginOrder\n */\n\n'use strict';\n\nvar keyOf = _dereq_(161);\n\n/**\n * Module that is injectable into `EventPluginHub`, that specifies a\n * deterministic ordering of `EventPlugin`s. A convenient way to reason about\n * plugins, without having to package every one of them. This is better than\n * having plugins be ordered in the same order that they are injected because\n * 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 DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];\n\nmodule.exports = DefaultEventPluginOrder;\n},{\"161\":161}],14:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DisabledInputUtils\n */\n\n'use strict';\n\nvar disableableMouseListenerNames = {\n  onClick: true,\n  onDoubleClick: true,\n  onMouseDown: true,\n  onMouseMove: true,\n  onMouseUp: true,\n\n  onClickCapture: true,\n  onDoubleClickCapture: true,\n  onMouseDownCapture: true,\n  onMouseMoveCapture: true,\n  onMouseUpCapture: true\n};\n\n/**\n * Implements a native component that does not receive mouse events\n * when `disabled` is set.\n */\nvar DisabledInputUtils = {\n  getNativeProps: function (inst, props) {\n    if (!props.disabled) {\n      return props;\n    }\n\n    // Copy the props, except the mouse listeners\n    var nativeProps = {};\n    for (var key in props) {\n      if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {\n        nativeProps[key] = props[key];\n      }\n    }\n\n    return nativeProps;\n  }\n};\n\nmodule.exports = DisabledInputUtils;\n},{}],15:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EnterLeaveEventPlugin\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar EventPropagators = _dereq_(20);\nvar ReactDOMComponentTree = _dereq_(41);\nvar SyntheticMouseEvent = _dereq_(106);\n\nvar keyOf = _dereq_(161);\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar eventTypes = {\n  mouseEnter: {\n    registrationName: keyOf({ onMouseEnter: null }),\n    dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]\n  },\n  mouseLeave: {\n    registrationName: keyOf({ onMouseLeave: null }),\n    dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]\n  }\n};\n\nvar EnterLeaveEventPlugin = {\n\n  eventTypes: eventTypes,\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   */\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {\n      return null;\n    }\n    if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {\n      // Must not be a mouse in or mouse out - ignoring.\n      return null;\n    }\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\n    var from;\n    var to;\n    if (topLevelType === topLevelTypes.topMouseOut) {\n      from = targetInst;\n      var related = nativeEvent.relatedTarget || nativeEvent.toElement;\n      to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;\n    } else {\n      // Moving to a node from outside the window.\n      from = null;\n      to = targetInst;\n    }\n\n    if (from === to) {\n      // Nothing pertains to our managed components.\n      return null;\n    }\n\n    var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);\n    var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);\n\n    var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);\n    leave.type = 'mouseleave';\n    leave.target = fromNode;\n    leave.relatedTarget = toNode;\n\n    var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);\n    enter.type = 'mouseenter';\n    enter.target = toNode;\n    enter.relatedTarget = fromNode;\n\n    EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);\n\n    return [leave, enter];\n  }\n\n};\n\nmodule.exports = EnterLeaveEventPlugin;\n},{\"106\":106,\"16\":16,\"161\":161,\"20\":20,\"41\":41}],16:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventConstants\n */\n\n'use strict';\n\nvar keyMirror = _dereq_(160);\n\nvar PropagationPhases = keyMirror({ bubbled: null, captured: null });\n\n/**\n * Types of raw signals from the browser caught at the top level.\n */\nvar topLevelTypes = keyMirror({\n  topAbort: null,\n  topAnimationEnd: null,\n  topAnimationIteration: null,\n  topAnimationStart: null,\n  topBlur: null,\n  topCanPlay: null,\n  topCanPlayThrough: null,\n  topChange: null,\n  topClick: null,\n  topCompositionEnd: null,\n  topCompositionStart: null,\n  topCompositionUpdate: null,\n  topContextMenu: null,\n  topCopy: null,\n  topCut: null,\n  topDoubleClick: null,\n  topDrag: null,\n  topDragEnd: null,\n  topDragEnter: null,\n  topDragExit: null,\n  topDragLeave: null,\n  topDragOver: null,\n  topDragStart: null,\n  topDrop: null,\n  topDurationChange: null,\n  topEmptied: null,\n  topEncrypted: null,\n  topEnded: null,\n  topError: null,\n  topFocus: null,\n  topInput: null,\n  topInvalid: null,\n  topKeyDown: null,\n  topKeyPress: null,\n  topKeyUp: null,\n  topLoad: null,\n  topLoadedData: null,\n  topLoadedMetadata: null,\n  topLoadStart: null,\n  topMouseDown: null,\n  topMouseMove: null,\n  topMouseOut: null,\n  topMouseOver: null,\n  topMouseUp: null,\n  topPaste: null,\n  topPause: null,\n  topPlay: null,\n  topPlaying: null,\n  topProgress: null,\n  topRateChange: null,\n  topReset: null,\n  topScroll: null,\n  topSeeked: null,\n  topSeeking: null,\n  topSelectionChange: null,\n  topStalled: null,\n  topSubmit: null,\n  topSuspend: null,\n  topTextInput: null,\n  topTimeUpdate: null,\n  topTouchCancel: null,\n  topTouchEnd: null,\n  topTouchMove: null,\n  topTouchStart: null,\n  topTransitionEnd: null,\n  topVolumeChange: null,\n  topWaiting: null,\n  topWheel: null\n});\n\nvar EventConstants = {\n  topLevelTypes: topLevelTypes,\n  PropagationPhases: PropagationPhases\n};\n\nmodule.exports = EventConstants;\n},{\"160\":160}],17:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventPluginHub\n */\n\n'use strict';\n\nvar EventPluginRegistry = _dereq_(18);\nvar EventPluginUtils = _dereq_(19);\nvar ReactErrorUtils = _dereq_(64);\n\nvar accumulateInto = _dereq_(113);\nvar forEachAccumulated = _dereq_(121);\nvar invariant = _dereq_(157);\n\n/**\n * Internal store for event listeners\n */\nvar listenerBank = {};\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/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @private\n */\nvar executeDispatchesAndRelease = function (event, simulated) {\n  if (event) {\n    EventPluginUtils.executeDispatchesInOrder(event, simulated);\n\n    if (!event.isPersistent()) {\n      event.constructor.release(event);\n    }\n  }\n};\nvar executeDispatchesAndReleaseSimulated = function (e) {\n  return executeDispatchesAndRelease(e, true);\n};\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n  return executeDispatchesAndRelease(e, false);\n};\n\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n *   `extractEvents` {function(string, DOMEventTarget, string, object): *}\n *     Required. When a top-level event is fired, this method is expected to\n *     extract synthetic events that will in turn be queued and dispatched.\n *\n *   `eventTypes` {object}\n *     Optional, plugins that fire events must publish a mapping of registration\n *     names that are used to register listeners. Values of this mapping must\n *     be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n *   `executeDispatch` {function(object, function, string)}\n *     Optional, allows plugins to override how an event gets dispatched. By\n *     default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\nvar EventPluginHub = {\n\n  /**\n   * Methods for injecting dependencies.\n   */\n  injection: {\n\n    /**\n     * @param {array} InjectedEventPluginOrder\n     * @public\n     */\n    injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,\n\n    /**\n     * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n     */\n    injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName\n\n  },\n\n  /**\n   * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.\n   *\n   * @param {object} inst The instance, which is the source of events.\n   * @param {string} registrationName Name of listener (e.g. `onClick`).\n   * @param {function} listener The callback to store.\n   */\n  putListener: function (inst, registrationName, listener) {\n    !(typeof listener === 'function') ? \"development\" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : void 0;\n\n    var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});\n    bankForRegistrationName[inst._rootNodeID] = listener;\n\n    var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];\n    if (PluginModule && PluginModule.didPutListener) {\n      PluginModule.didPutListener(inst, registrationName, listener);\n    }\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   */\n  getListener: function (inst, registrationName) {\n    var bankForRegistrationName = listenerBank[registrationName];\n    return bankForRegistrationName && bankForRegistrationName[inst._rootNodeID];\n  },\n\n  /**\n   * Deletes a listener from the registration bank.\n   *\n   * @param {object} inst The instance, which is the source of events.\n   * @param {string} registrationName Name of listener (e.g. `onClick`).\n   */\n  deleteListener: function (inst, registrationName) {\n    var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];\n    if (PluginModule && PluginModule.willDeleteListener) {\n      PluginModule.willDeleteListener(inst, registrationName);\n    }\n\n    var bankForRegistrationName = listenerBank[registrationName];\n    // TODO: This should never be null -- when is it?\n    if (bankForRegistrationName) {\n      delete bankForRegistrationName[inst._rootNodeID];\n    }\n  },\n\n  /**\n   * Deletes all listeners for the DOM element with the supplied ID.\n   *\n   * @param {object} inst The instance, which is the source of events.\n   */\n  deleteAllListeners: function (inst) {\n    for (var registrationName in listenerBank) {\n      if (!listenerBank[registrationName][inst._rootNodeID]) {\n        continue;\n      }\n\n      var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];\n      if (PluginModule && PluginModule.willDeleteListener) {\n        PluginModule.willDeleteListener(inst, registrationName);\n      }\n\n      delete listenerBank[registrationName][inst._rootNodeID];\n    }\n  },\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   */\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var events;\n    var plugins = EventPluginRegistry.plugins;\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);\n        if (extractedEvents) {\n          events = accumulateInto(events, extractedEvents);\n        }\n      }\n    }\n    return events;\n  },\n\n  /**\n   * Enqueues a synthetic event that should be dispatched when\n   * `processEventQueue` is invoked.\n   *\n   * @param {*} events An accumulation of synthetic events.\n   * @internal\n   */\n  enqueueEvents: function (events) {\n    if (events) {\n      eventQueue = accumulateInto(eventQueue, events);\n    }\n  },\n\n  /**\n   * Dispatches all synthetic events on the event queue.\n   *\n   * @internal\n   */\n  processEventQueue: function (simulated) {\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 (simulated) {\n      forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);\n    } else {\n      forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n    }\n    !!eventQueue ? \"development\" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : void 0;\n    // This would be a good time to rethrow if any of the event handlers threw.\n    ReactErrorUtils.rethrowCaughtError();\n  },\n\n  /**\n   * These are needed for tests only. Do not use!\n   */\n  __purge: function () {\n    listenerBank = {};\n  },\n\n  __getListenerBank: function () {\n    return listenerBank;\n  }\n\n};\n\nmodule.exports = EventPluginHub;\n},{\"113\":113,\"121\":121,\"157\":157,\"18\":18,\"19\":19,\"64\":64}],18:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventPluginRegistry\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\n/**\n * Injectable ordering of event plugins.\n */\nvar EventPluginOrder = null;\n\n/**\n * Injectable mapping from names to event plugin modules.\n */\nvar namesToPlugins = {};\n\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    !(pluginIndex > -1) ? \"development\" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : void 0;\n    if (EventPluginRegistry.plugins[pluginIndex]) {\n      continue;\n    }\n    !PluginModule.extractEvents ? \"development\" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : void 0;\n    EventPluginRegistry.plugins[pluginIndex] = PluginModule;\n    var publishedEvents = PluginModule.eventTypes;\n    for (var eventName in publishedEvents) {\n      !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? \"development\" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : void 0;\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  !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? \"development\" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : void 0;\n  EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;\n\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/**\n * Publishes a registration name that is used to identify dispatched events and\n * can be used with `EventPluginHub.putListener` to register listeners.\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  !!EventPluginRegistry.registrationNameModules[registrationName] ? \"development\" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : void 0;\n  EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;\n  EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;\n\n  if (\"development\" !== 'production') {\n    var lowerCasedName = registrationName.toLowerCase();\n    EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;\n  }\n}\n\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\nvar EventPluginRegistry = {\n\n  /**\n   * Ordered list of injected plugins.\n   */\n  plugins: [],\n\n  /**\n   * Mapping from event name to dispatch config\n   */\n  eventNameDispatchConfigs: {},\n\n  /**\n   * Mapping from registration name to plugin module\n   */\n  registrationNameModules: {},\n\n  /**\n   * Mapping from registration name to event name\n   */\n  registrationNameDependencies: {},\n\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 __DEV__.\n   * @type {Object}\n   */\n  possibleRegistrationNames: \"development\" !== 'production' ? {} : null,\n\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   * @see {EventPluginHub.injection.injectEventPluginOrder}\n   */\n  injectEventPluginOrder: function (InjectedEventPluginOrder) {\n    !!EventPluginOrder ? \"development\" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : void 0;\n    // Clone the ordering so it cannot be dynamically mutated.\n    EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);\n    recomputePluginOrdering();\n  },\n\n  /**\n   * Injects plugins to be used by `EventPluginHub`. 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   * @see {EventPluginHub.injection.injectEventPluginsByName}\n   */\n  injectEventPluginsByName: function (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        !!namesToPlugins[pluginName] ? \"development\" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : void 0;\n        namesToPlugins[pluginName] = PluginModule;\n        isOrderingDirty = true;\n      }\n    }\n    if (isOrderingDirty) {\n      recomputePluginOrdering();\n    }\n  },\n\n  /**\n   * Looks up the plugin for the supplied event.\n   *\n   * @param {object} event A synthetic event.\n   * @return {?object} The plugin that created the supplied event.\n   * @internal\n   */\n  getPluginModuleForEvent: function (event) {\n    var dispatchConfig = event.dispatchConfig;\n    if (dispatchConfig.registrationName) {\n      return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;\n    }\n    for (var phase in dispatchConfig.phasedRegistrationNames) {\n      if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {\n        continue;\n      }\n      var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];\n      if (PluginModule) {\n        return PluginModule;\n      }\n    }\n    return null;\n  },\n\n  /**\n   * Exposed for unit testing.\n   * @private\n   */\n  _resetEventPlugins: function () {\n    EventPluginOrder = null;\n    for (var pluginName in namesToPlugins) {\n      if (namesToPlugins.hasOwnProperty(pluginName)) {\n        delete namesToPlugins[pluginName];\n      }\n    }\n    EventPluginRegistry.plugins.length = 0;\n\n    var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;\n    for (var eventName in eventNameDispatchConfigs) {\n      if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {\n        delete eventNameDispatchConfigs[eventName];\n      }\n    }\n\n    var registrationNameModules = EventPluginRegistry.registrationNameModules;\n    for (var registrationName in registrationNameModules) {\n      if (registrationNameModules.hasOwnProperty(registrationName)) {\n        delete registrationNameModules[registrationName];\n      }\n    }\n\n    if (\"development\" !== 'production') {\n      var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;\n      for (var lowerCasedName in possibleRegistrationNames) {\n        if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {\n          delete possibleRegistrationNames[lowerCasedName];\n        }\n      }\n    }\n  }\n\n};\n\nmodule.exports = EventPluginRegistry;\n},{\"157\":157}],19:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventPluginUtils\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar ReactErrorUtils = _dereq_(64);\n\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\n/**\n * Injected dependencies:\n */\n\n/**\n * - `ComponentTree`: [required] Module that can convert between React instances\n *   and actual node references.\n */\nvar ComponentTree;\nvar TreeTraversal;\nvar injection = {\n  injectComponentTree: function (Injected) {\n    ComponentTree = Injected;\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;\n    }\n  },\n  injectTreeTraversal: function (Injected) {\n    TreeTraversal = Injected;\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;\n    }\n  }\n};\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nfunction isEndish(topLevelType) {\n  return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;\n}\n\nfunction isMoveish(topLevelType) {\n  return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;\n}\nfunction isStartish(topLevelType) {\n  return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;\n}\n\nvar validateEventDispatches;\nif (\"development\" !== 'production') {\n  validateEventDispatches = function (event) {\n    var dispatchListeners = event._dispatchListeners;\n    var dispatchInstances = event._dispatchInstances;\n\n    var listenersIsArr = Array.isArray(dispatchListeners);\n    var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n\n    var instancesIsArr = Array.isArray(dispatchInstances);\n    var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n\n    \"development\" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;\n  };\n}\n\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\nfunction executeDispatch(event, simulated, listener, inst) {\n  var type = event.type || 'unknown-event';\n  event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);\n  if (simulated) {\n    ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);\n  } else {\n    ReactErrorUtils.invokeGuardedCallback(type, listener, event);\n  }\n  event.currentTarget = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\nfunction executeDispatchesInOrder(event, simulated) {\n  var dispatchListeners = event._dispatchListeners;\n  var dispatchInstances = event._dispatchInstances;\n  if (\"development\" !== 'production') {\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      }\n      // Listeners and Instances are two parallel arrays that are always in sync.\n      executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);\n    }\n  } else if (dispatchListeners) {\n    executeDispatch(event, simulated, dispatchListeners, dispatchInstances);\n  }\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches, but stops\n * at the first dispatch execution returning true, and returns that id.\n *\n * @return {?string} id of the first dispatch execution who's listener returns\n * true, or null if no listener returned true.\n */\nfunction executeDispatchesInOrderStopAtTrueImpl(event) {\n  var dispatchListeners = event._dispatchListeners;\n  var dispatchInstances = event._dispatchInstances;\n  if (\"development\" !== 'production') {\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      }\n      // Listeners and Instances are two parallel arrays that are always in sync.\n      if (dispatchListeners[i](event, dispatchInstances[i])) {\n        return dispatchInstances[i];\n      }\n    }\n  } else if (dispatchListeners) {\n    if (dispatchListeners(event, dispatchInstances)) {\n      return dispatchInstances;\n    }\n  }\n  return null;\n}\n\n/**\n * @see executeDispatchesInOrderStopAtTrueImpl\n */\nfunction executeDispatchesInOrderStopAtTrue(event) {\n  var ret = executeDispatchesInOrderStopAtTrueImpl(event);\n  event._dispatchInstances = null;\n  event._dispatchListeners = null;\n  return ret;\n}\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return {*} The return value of executing the single dispatch.\n */\nfunction executeDirectDispatch(event) {\n  if (\"development\" !== 'production') {\n    validateEventDispatches(event);\n  }\n  var dispatchListener = event._dispatchListeners;\n  var dispatchInstance = event._dispatchInstances;\n  !!Array.isArray(dispatchListener) ? \"development\" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0;\n  event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;\n  var res = dispatchListener ? dispatchListener(event) : null;\n  event.currentTarget = null;\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n  return res;\n}\n\n/**\n * @param {SyntheticEvent} event\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\n */\nfunction hasDispatches(event) {\n  return !!event._dispatchListeners;\n}\n\n/**\n * General utilities that are useful in creating custom Event Plugins.\n */\nvar EventPluginUtils = {\n  isEndish: isEndish,\n  isMoveish: isMoveish,\n  isStartish: isStartish,\n\n  executeDirectDispatch: executeDirectDispatch,\n  executeDispatchesInOrder: executeDispatchesInOrder,\n  executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,\n  hasDispatches: hasDispatches,\n\n  getInstanceFromNode: function (node) {\n    return ComponentTree.getInstanceFromNode(node);\n  },\n  getNodeFromInstance: function (node) {\n    return ComponentTree.getNodeFromInstance(node);\n  },\n  isAncestor: function (a, b) {\n    return TreeTraversal.isAncestor(a, b);\n  },\n  getLowestCommonAncestor: function (a, b) {\n    return TreeTraversal.getLowestCommonAncestor(a, b);\n  },\n  getParentInstance: function (inst) {\n    return TreeTraversal.getParentInstance(inst);\n  },\n  traverseTwoPhase: function (target, fn, arg) {\n    return TreeTraversal.traverseTwoPhase(target, fn, arg);\n  },\n  traverseEnterLeave: function (from, to, fn, argFrom, argTo) {\n    return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);\n  },\n\n  injection: injection\n};\n\nmodule.exports = EventPluginUtils;\n},{\"157\":157,\"16\":16,\"167\":167,\"64\":64}],20:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EventPropagators\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar EventPluginHub = _dereq_(17);\nvar EventPluginUtils = _dereq_(19);\n\nvar accumulateInto = _dereq_(113);\nvar forEachAccumulated = _dereq_(121);\nvar warning = _dereq_(167);\n\nvar PropagationPhases = EventConstants.PropagationPhases;\nvar getListener = EventPluginHub.getListener;\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/**\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, upwards, event) {\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;\n  }\n  var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;\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/**\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    EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n  }\n}\n\n/**\n * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.\n */\nfunction accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    var targetInst = event._targetInst;\n    var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n    EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n  }\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 (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/**\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}\n\nfunction accumulateTwoPhaseDispatches(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\n\nfunction accumulateTwoPhaseDispatchesSkipTarget(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);\n}\n\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n  EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\n\nfunction accumulateDirectDispatches(events) {\n  forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\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 event a\n * single one.\n *\n * @constructor EventPropagators\n */\nvar EventPropagators = {\n  accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,\n  accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,\n  accumulateDirectDispatches: accumulateDirectDispatches,\n  accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches\n};\n\nmodule.exports = EventPropagators;\n},{\"113\":113,\"121\":121,\"16\":16,\"167\":167,\"17\":17,\"19\":19}],21:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule FallbackCompositionState\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar PooledClass = _dereq_(25);\n\nvar getTextContentAccessor = _dereq_(129);\n\n/**\n * This helper class stores 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 * @param {DOMEventTarget} root\n */\nfunction FallbackCompositionState(root) {\n  this._root = root;\n  this._startText = this.getText();\n  this._fallbackText = null;\n}\n\n_assign(FallbackCompositionState.prototype, {\n  destructor: function () {\n    this._root = null;\n    this._startText = null;\n    this._fallbackText = null;\n  },\n\n  /**\n   * Get current text of input.\n   *\n   * @return {string}\n   */\n  getText: function () {\n    if ('value' in this._root) {\n      return this._root.value;\n    }\n    return this._root[getTextContentAccessor()];\n  },\n\n  /**\n   * Determine the differing substring between the initially stored\n   * text content and the current content.\n   *\n   * @return {string}\n   */\n  getData: function () {\n    if (this._fallbackText) {\n      return this._fallbackText;\n    }\n\n    var start;\n    var startValue = this._startText;\n    var startLength = startValue.length;\n    var end;\n    var endValue = this.getText();\n    var endLength = endValue.length;\n\n    for (start = 0; start < startLength; start++) {\n      if (startValue[start] !== endValue[start]) {\n        break;\n      }\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\n    var sliceTail = end > 1 ? 1 - end : undefined;\n    this._fallbackText = endValue.slice(start, sliceTail);\n    return this._fallbackText;\n  }\n});\n\nPooledClass.addPoolingTo(FallbackCompositionState);\n\nmodule.exports = FallbackCompositionState;\n},{\"129\":129,\"168\":168,\"25\":25}],22:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule HTMLDOMPropertyConfig\n */\n\n'use strict';\n\nvar DOMProperty = _dereq_(10);\n\nvar MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;\nvar HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;\nvar HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;\nvar HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;\nvar HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;\nvar HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;\n\nvar HTMLDOMPropertyConfig = {\n  isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),\n  Properties: {\n    /**\n     * Standard Properties\n     */\n    accept: 0,\n    acceptCharset: 0,\n    accessKey: 0,\n    action: 0,\n    allowFullScreen: HAS_BOOLEAN_VALUE,\n    allowTransparency: 0,\n    alt: 0,\n    async: HAS_BOOLEAN_VALUE,\n    autoComplete: 0,\n    // autoFocus is polyfilled/normalized by AutoFocusUtils\n    // autoFocus: HAS_BOOLEAN_VALUE,\n    autoPlay: HAS_BOOLEAN_VALUE,\n    capture: HAS_BOOLEAN_VALUE,\n    cellPadding: 0,\n    cellSpacing: 0,\n    charSet: 0,\n    challenge: 0,\n    checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    cite: 0,\n    classID: 0,\n    className: 0,\n    cols: HAS_POSITIVE_NUMERIC_VALUE,\n    colSpan: 0,\n    content: 0,\n    contentEditable: 0,\n    contextMenu: 0,\n    controls: HAS_BOOLEAN_VALUE,\n    coords: 0,\n    crossOrigin: 0,\n    data: 0, // For `<object />` acts as `src`.\n    dateTime: 0,\n    'default': HAS_BOOLEAN_VALUE,\n    defer: HAS_BOOLEAN_VALUE,\n    dir: 0,\n    disabled: HAS_BOOLEAN_VALUE,\n    download: HAS_OVERLOADED_BOOLEAN_VALUE,\n    draggable: 0,\n    encType: 0,\n    form: 0,\n    formAction: 0,\n    formEncType: 0,\n    formMethod: 0,\n    formNoValidate: HAS_BOOLEAN_VALUE,\n    formTarget: 0,\n    frameBorder: 0,\n    headers: 0,\n    height: 0,\n    hidden: HAS_BOOLEAN_VALUE,\n    high: 0,\n    href: 0,\n    hrefLang: 0,\n    htmlFor: 0,\n    httpEquiv: 0,\n    icon: 0,\n    id: 0,\n    inputMode: 0,\n    integrity: 0,\n    is: 0,\n    keyParams: 0,\n    keyType: 0,\n    kind: 0,\n    label: 0,\n    lang: 0,\n    list: 0,\n    loop: HAS_BOOLEAN_VALUE,\n    low: 0,\n    manifest: 0,\n    marginHeight: 0,\n    marginWidth: 0,\n    max: 0,\n    maxLength: 0,\n    media: 0,\n    mediaGroup: 0,\n    method: 0,\n    min: 0,\n    minLength: 0,\n    // Caution; `option.selected` is not updated if `select.multiple` is\n    // disabled with `removeAttribute`.\n    multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    name: 0,\n    nonce: 0,\n    noValidate: HAS_BOOLEAN_VALUE,\n    open: HAS_BOOLEAN_VALUE,\n    optimum: 0,\n    pattern: 0,\n    placeholder: 0,\n    poster: 0,\n    preload: 0,\n    profile: 0,\n    radioGroup: 0,\n    readOnly: HAS_BOOLEAN_VALUE,\n    rel: 0,\n    required: HAS_BOOLEAN_VALUE,\n    reversed: HAS_BOOLEAN_VALUE,\n    role: 0,\n    rows: HAS_POSITIVE_NUMERIC_VALUE,\n    rowSpan: HAS_NUMERIC_VALUE,\n    sandbox: 0,\n    scope: 0,\n    scoped: HAS_BOOLEAN_VALUE,\n    scrolling: 0,\n    seamless: HAS_BOOLEAN_VALUE,\n    selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    shape: 0,\n    size: HAS_POSITIVE_NUMERIC_VALUE,\n    sizes: 0,\n    span: HAS_POSITIVE_NUMERIC_VALUE,\n    spellCheck: 0,\n    src: 0,\n    srcDoc: 0,\n    srcLang: 0,\n    srcSet: 0,\n    start: HAS_NUMERIC_VALUE,\n    step: 0,\n    style: 0,\n    summary: 0,\n    tabIndex: 0,\n    target: 0,\n    title: 0,\n    // Setting .type throws on non-<input> tags\n    type: 0,\n    useMap: 0,\n    value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,\n    width: 0,\n    wmode: 0,\n    wrap: 0,\n\n    /**\n     * RDFa Properties\n     */\n    about: 0,\n    datatype: 0,\n    inlist: 0,\n    prefix: 0,\n    // property is also supported for OpenGraph in meta tags.\n    property: 0,\n    resource: 0,\n    'typeof': 0,\n    vocab: 0,\n\n    /**\n     * Non-standard Properties\n     */\n    // autoCapitalize and autoCorrect are supported in Mobile Safari for\n    // keyboard hints.\n    autoCapitalize: 0,\n    autoCorrect: 0,\n    // autoSave allows WebKit/Blink to persist values of input fields on page reloads\n    autoSave: 0,\n    // color is for Safari mask-icon link\n    color: 0,\n    // itemProp, itemScope, itemType are for\n    // Microdata support. See http://schema.org/docs/gs.html\n    itemProp: 0,\n    itemScope: HAS_BOOLEAN_VALUE,\n    itemType: 0,\n    // itemID and itemRef are for Microdata support as well but\n    // only specified in the WHATWG spec document. See\n    // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api\n    itemID: 0,\n    itemRef: 0,\n    // results show looking glass icon and recent searches on input\n    // search fields in WebKit/Blink\n    results: 0,\n    // IE-only attribute that specifies security restrictions on an iframe\n    // as an alternative to the sandbox attribute on IE<10\n    security: 0,\n    // IE-only attribute that controls focus behavior\n    unselectable: 0\n  },\n  DOMAttributeNames: {\n    acceptCharset: 'accept-charset',\n    className: 'class',\n    htmlFor: 'for',\n    httpEquiv: 'http-equiv'\n  },\n  DOMPropertyNames: {}\n};\n\nmodule.exports = HTMLDOMPropertyConfig;\n},{\"10\":10}],23:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule KeyEscapeUtils\n */\n\n'use strict';\n\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {*} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n  var escapeRegex = /[=:]/g;\n  var escaperLookup = {\n    '=': '=0',\n    ':': '=2'\n  };\n  var escapedString = ('' + key).replace(escapeRegex, function (match) {\n    return escaperLookup[match];\n  });\n\n  return '$' + escapedString;\n}\n\n/**\n * Unescape and unwrap key for human-readable display\n *\n * @param {string} key to unescape.\n * @return {string} the unescaped key.\n */\nfunction unescape(key) {\n  var unescapeRegex = /(=0|=2)/g;\n  var unescaperLookup = {\n    '=0': '=',\n    '=2': ':'\n  };\n  var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);\n\n  return ('' + keySubstring).replace(unescapeRegex, function (match) {\n    return unescaperLookup[match];\n  });\n}\n\nvar KeyEscapeUtils = {\n  escape: escape,\n  unescape: unescape\n};\n\nmodule.exports = KeyEscapeUtils;\n},{}],24:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule LinkedValueUtils\n */\n\n'use strict';\n\nvar ReactPropTypes = _dereq_(84);\nvar ReactPropTypeLocations = _dereq_(83);\n\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\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};\n\nfunction _assertSingleLink(inputProps) {\n  !(inputProps.checkedLink == null || inputProps.valueLink == null) ? \"development\" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\\'t want to use valueLink and vice versa.') : invariant(false) : void 0;\n}\nfunction _assertValueLink(inputProps) {\n  _assertSingleLink(inputProps);\n  !(inputProps.value == null && inputProps.onChange == null) ? \"development\" !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\\'t want to use valueLink.') : invariant(false) : void 0;\n}\n\nfunction _assertCheckedLink(inputProps) {\n  _assertSingleLink(inputProps);\n  !(inputProps.checked == null && inputProps.onChange == null) ? \"development\" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\\'t want to ' + 'use checkedLink') : invariant(false) : void 0;\n}\n\nvar propTypes = {\n  value: function (props, propName, componentName) {\n    if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {\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[propName] || props.onChange || props.readOnly || props.disabled) {\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  onChange: ReactPropTypes.func\n};\n\nvar loggedTypeFailures = {};\nfunction getDeclarationErrorAddendum(owner) {\n  if (owner) {\n    var name = owner.getName();\n    if (name) {\n      return ' Check the render method of `' + name + '`.';\n    }\n  }\n  return '';\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 */\nvar LinkedValueUtils = {\n  checkPropTypes: function (tagName, props, owner) {\n    for (var propName in propTypes) {\n      if (propTypes.hasOwnProperty(propName)) {\n        var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);\n      }\n      if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n        // Only monitor this failure once because there tends to be a lot of the\n        // same error.\n        loggedTypeFailures[error.message] = true;\n\n        var addendum = getDeclarationErrorAddendum(owner);\n        \"development\" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;\n      }\n    }\n  },\n\n  /**\n   * @param {object} inputProps Props for form component\n   * @return {*} current value of the input either from value prop or link.\n   */\n  getValue: function (inputProps) {\n    if (inputProps.valueLink) {\n      _assertValueLink(inputProps);\n      return inputProps.valueLink.value;\n    }\n    return inputProps.value;\n  },\n\n  /**\n   * @param {object} inputProps Props for form component\n   * @return {*} current checked status of the input either from checked prop\n   *             or link.\n   */\n  getChecked: function (inputProps) {\n    if (inputProps.checkedLink) {\n      _assertCheckedLink(inputProps);\n      return inputProps.checkedLink.value;\n    }\n    return inputProps.checked;\n  },\n\n  /**\n   * @param {object} inputProps Props for form component\n   * @param {SyntheticEvent} event change event to handle\n   */\n  executeOnChange: function (inputProps, event) {\n    if (inputProps.valueLink) {\n      _assertValueLink(inputProps);\n      return inputProps.valueLink.requestChange(event.target.value);\n    } else if (inputProps.checkedLink) {\n      _assertCheckedLink(inputProps);\n      return inputProps.checkedLink.requestChange(event.target.checked);\n    } else if (inputProps.onChange) {\n      return inputProps.onChange.call(undefined, event);\n    }\n  }\n};\n\nmodule.exports = LinkedValueUtils;\n},{\"157\":157,\"167\":167,\"83\":83,\"84\":84}],25:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule PooledClass\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\n/**\n * Static poolers. Several custom versions for each potential number of\n * arguments. A completely generic pooler is easy to implement, but would\n * require accessing the `arguments` object. In each of these, `this` refers to\n * the Class itself, not an instance. If any others are needed, simply add them\n * here, or in their own files.\n */\nvar oneArgumentPooler = function (copyFieldsFrom) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, copyFieldsFrom);\n    return instance;\n  } else {\n    return new Klass(copyFieldsFrom);\n  }\n};\n\nvar twoArgumentPooler = function (a1, a2) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2);\n    return instance;\n  } else {\n    return new Klass(a1, a2);\n  }\n};\n\nvar threeArgumentPooler = function (a1, a2, a3) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2, a3);\n    return instance;\n  } else {\n    return new Klass(a1, a2, a3);\n  }\n};\n\nvar fourArgumentPooler = function (a1, a2, a3, a4) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2, a3, a4);\n    return instance;\n  } else {\n    return new Klass(a1, a2, a3, a4);\n  }\n};\n\nvar fiveArgumentPooler = function (a1, a2, a3, a4, a5) {\n  var Klass = this;\n  if (Klass.instancePool.length) {\n    var instance = Klass.instancePool.pop();\n    Klass.call(instance, a1, a2, a3, a4, a5);\n    return instance;\n  } else {\n    return new Klass(a1, a2, a3, a4, a5);\n  }\n};\n\nvar standardReleaser = function (instance) {\n  var Klass = this;\n  !(instance instanceof Klass) ? \"development\" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;\n  instance.destructor();\n  if (Klass.instancePool.length < Klass.poolSize) {\n    Klass.instancePool.push(instance);\n  }\n};\n\nvar DEFAULT_POOL_SIZE = 10;\nvar DEFAULT_POOLER = oneArgumentPooler;\n\n/**\n * Augments `CopyConstructor` to be a poolable class, augmenting only the class\n * itself (statically) not adding any prototypical fields. Any CopyConstructor\n * you give this may have a `poolSize` property, and will look for a\n * prototypical `destructor` on instances (optional).\n *\n * @param {Function} CopyConstructor Constructor that can be used to reset.\n * @param {Function} pooler Customizable pooler.\n */\nvar addPoolingTo = function (CopyConstructor, pooler) {\n  var NewKlass = CopyConstructor;\n  NewKlass.instancePool = [];\n  NewKlass.getPooled = pooler || DEFAULT_POOLER;\n  if (!NewKlass.poolSize) {\n    NewKlass.poolSize = DEFAULT_POOL_SIZE;\n  }\n  NewKlass.release = standardReleaser;\n  return NewKlass;\n};\n\nvar PooledClass = {\n  addPoolingTo: addPoolingTo,\n  oneArgumentPooler: oneArgumentPooler,\n  twoArgumentPooler: twoArgumentPooler,\n  threeArgumentPooler: threeArgumentPooler,\n  fourArgumentPooler: fourArgumentPooler,\n  fiveArgumentPooler: fiveArgumentPooler\n};\n\nmodule.exports = PooledClass;\n},{\"157\":157}],26:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule React\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactChildren = _dereq_(29);\nvar ReactComponent = _dereq_(31);\nvar ReactClass = _dereq_(30);\nvar ReactDOMFactories = _dereq_(45);\nvar ReactElement = _dereq_(61);\nvar ReactElementValidator = _dereq_(62);\nvar ReactPropTypes = _dereq_(84);\nvar ReactVersion = _dereq_(94);\n\nvar onlyChild = _dereq_(134);\nvar warning = _dereq_(167);\n\nvar createElement = ReactElement.createElement;\nvar createFactory = ReactElement.createFactory;\nvar cloneElement = ReactElement.cloneElement;\n\nif (\"development\" !== 'production') {\n  createElement = ReactElementValidator.createElement;\n  createFactory = ReactElementValidator.createFactory;\n  cloneElement = ReactElementValidator.cloneElement;\n}\n\nvar __spread = _assign;\n\nif (\"development\" !== 'production') {\n  var warned = false;\n  __spread = function () {\n    \"development\" !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;\n    warned = true;\n    return _assign.apply(null, arguments);\n  };\n}\n\nvar React = {\n\n  // Modern\n\n  Children: {\n    map: ReactChildren.map,\n    forEach: ReactChildren.forEach,\n    count: ReactChildren.count,\n    toArray: ReactChildren.toArray,\n    only: onlyChild\n  },\n\n  Component: ReactComponent,\n\n  createElement: createElement,\n  cloneElement: cloneElement,\n  isValidElement: ReactElement.isValidElement,\n\n  // Classic\n\n  PropTypes: ReactPropTypes,\n  createClass: ReactClass.createClass,\n  createFactory: createFactory,\n  createMixin: function (mixin) {\n    // Currently a noop. Will be used to validate and trace mixins.\n    return mixin;\n  },\n\n  // This looks DOM specific but these are actually isomorphic helpers\n  // since they are just generating DOM strings.\n  DOM: ReactDOMFactories,\n\n  version: ReactVersion,\n\n  // Deprecated hook for JSX spread, don't use this for anything.\n  __spread: __spread\n};\n\nmodule.exports = React;\n},{\"134\":134,\"167\":167,\"168\":168,\"29\":29,\"30\":30,\"31\":31,\"45\":45,\"61\":61,\"62\":62,\"84\":84,\"94\":94}],27:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactBrowserEventEmitter\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar EventConstants = _dereq_(16);\nvar EventPluginRegistry = _dereq_(18);\nvar ReactEventEmitterMixin = _dereq_(65);\nvar ViewportMetrics = _dereq_(112);\n\nvar getVendorPrefixedEventName = _dereq_(130);\nvar isEventSupported = _dereq_(132);\n\n/**\n * Summary of `ReactBrowserEventEmitter` 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 *    ReactEventListener, which is injected and can therefore support pluggable\n *    event sources. This is the only work that occurs in the main 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 `EventPluginHub`, which in turn will ask plugins if they want\n *    to extract any synthetic events.\n *\n *  - The `EventPluginHub` 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 `EventPluginHub` 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 * |     +-----------.--->|EventPluginHub|                    |    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 */\n\nvar hasEventPageXY;\nvar alreadyListeningTo = {};\nvar isMonitoringScrollValue = false;\nvar reactTopListenersCounter = 0;\n\n// For events like 'submit' which don't consistently bubble (which we trap at a\n// lower node than `document`), binding at `document` would cause duplicate\n// events so we don't include them here\nvar topEventMapping = {\n  topAbort: 'abort',\n  topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',\n  topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',\n  topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',\n  topBlur: 'blur',\n  topCanPlay: 'canplay',\n  topCanPlayThrough: 'canplaythrough',\n  topChange: 'change',\n  topClick: 'click',\n  topCompositionEnd: 'compositionend',\n  topCompositionStart: 'compositionstart',\n  topCompositionUpdate: 'compositionupdate',\n  topContextMenu: 'contextmenu',\n  topCopy: 'copy',\n  topCut: 'cut',\n  topDoubleClick: 'dblclick',\n  topDrag: 'drag',\n  topDragEnd: 'dragend',\n  topDragEnter: 'dragenter',\n  topDragExit: 'dragexit',\n  topDragLeave: 'dragleave',\n  topDragOver: 'dragover',\n  topDragStart: 'dragstart',\n  topDrop: 'drop',\n  topDurationChange: 'durationchange',\n  topEmptied: 'emptied',\n  topEncrypted: 'encrypted',\n  topEnded: 'ended',\n  topError: 'error',\n  topFocus: 'focus',\n  topInput: 'input',\n  topKeyDown: 'keydown',\n  topKeyPress: 'keypress',\n  topKeyUp: 'keyup',\n  topLoadedData: 'loadeddata',\n  topLoadedMetadata: 'loadedmetadata',\n  topLoadStart: 'loadstart',\n  topMouseDown: 'mousedown',\n  topMouseMove: 'mousemove',\n  topMouseOut: 'mouseout',\n  topMouseOver: 'mouseover',\n  topMouseUp: 'mouseup',\n  topPaste: 'paste',\n  topPause: 'pause',\n  topPlay: 'play',\n  topPlaying: 'playing',\n  topProgress: 'progress',\n  topRateChange: 'ratechange',\n  topScroll: 'scroll',\n  topSeeked: 'seeked',\n  topSeeking: 'seeking',\n  topSelectionChange: 'selectionchange',\n  topStalled: 'stalled',\n  topSuspend: 'suspend',\n  topTextInput: 'textInput',\n  topTimeUpdate: 'timeupdate',\n  topTouchCancel: 'touchcancel',\n  topTouchEnd: 'touchend',\n  topTouchMove: 'touchmove',\n  topTouchStart: 'touchstart',\n  topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',\n  topVolumeChange: 'volumechange',\n  topWaiting: 'waiting',\n  topWheel: 'wheel'\n};\n\n/**\n * To ensure no conflicts with other potential React instances on the page\n */\nvar topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);\n\nfunction getListeningForDocument(mountAt) {\n  // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`\n  // directly.\n  if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {\n    mountAt[topListenersIDKey] = reactTopListenersCounter++;\n    alreadyListeningTo[mountAt[topListenersIDKey]] = {};\n  }\n  return alreadyListeningTo[mountAt[topListenersIDKey]];\n}\n\n/**\n * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For\n * example:\n *\n *   EventPluginHub.putListener('myID', 'onClick', myFunction);\n *\n * This would allocate a \"registration\" of `('onClick', myFunction)` on 'myID'.\n *\n * @internal\n */\nvar ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {\n\n  /**\n   * Injectable event backend\n   */\n  ReactEventListener: null,\n\n  injection: {\n    /**\n     * @param {object} ReactEventListener\n     */\n    injectReactEventListener: function (ReactEventListener) {\n      ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);\n      ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;\n    }\n  },\n\n  /**\n   * Sets whether or not any created callbacks should be enabled.\n   *\n   * @param {boolean} enabled True if callbacks should be enabled.\n   */\n  setEnabled: function (enabled) {\n    if (ReactBrowserEventEmitter.ReactEventListener) {\n      ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);\n    }\n  },\n\n  /**\n   * @return {boolean} True if callbacks are enabled.\n   */\n  isEnabled: function () {\n    return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());\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} contentDocumentHandle Document which owns the container\n   */\n  listenTo: function (registrationName, contentDocumentHandle) {\n    var mountAt = contentDocumentHandle;\n    var isListening = getListeningForDocument(mountAt);\n    var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];\n\n    var topLevelTypes = EventConstants.topLevelTypes;\n    for (var i = 0; i < dependencies.length; i++) {\n      var dependency = dependencies[i];\n      if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {\n        if (dependency === topLevelTypes.topWheel) {\n          if (isEventSupported('wheel')) {\n            ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);\n          } else if (isEventSupported('mousewheel')) {\n            ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);\n          } else {\n            // Firefox needs to capture a different mouse scroll event.\n            // @see http://www.quirksmode.org/dom/events/tests/scroll.html\n            ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);\n          }\n        } else if (dependency === topLevelTypes.topScroll) {\n\n          if (isEventSupported('scroll', true)) {\n            ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);\n          } else {\n            ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);\n          }\n        } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {\n\n          if (isEventSupported('focus', true)) {\n            ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);\n            ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);\n          } else if (isEventSupported('focusin')) {\n            // IE has `focusin` and `focusout` events which bubble.\n            // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html\n            ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);\n            ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);\n          }\n\n          // to make sure blur and focus event listeners are only attached once\n          isListening[topLevelTypes.topBlur] = true;\n          isListening[topLevelTypes.topFocus] = true;\n        } else if (topEventMapping.hasOwnProperty(dependency)) {\n          ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);\n        }\n\n        isListening[dependency] = true;\n      }\n    }\n  },\n\n  trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {\n    return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);\n  },\n\n  trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {\n    return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);\n  },\n\n  /**\n   * Listens to window scroll and resize events. We cache scroll values so that\n   * application code can access them without triggering reflows.\n   *\n   * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when\n   * pageX/pageY isn't supported (legacy browsers).\n   *\n   * NOTE: Scroll events do not bubble.\n   *\n   * @see http://www.quirksmode.org/dom/events/scroll.html\n   */\n  ensureScrollValueMonitoring: function () {\n    if (hasEventPageXY === undefined) {\n      hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');\n    }\n    if (!hasEventPageXY && !isMonitoringScrollValue) {\n      var refresh = ViewportMetrics.refreshScrollValues;\n      ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);\n      isMonitoringScrollValue = true;\n    }\n  }\n\n});\n\nmodule.exports = ReactBrowserEventEmitter;\n},{\"112\":112,\"130\":130,\"132\":132,\"16\":16,\"168\":168,\"18\":18,\"65\":65}],28:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactChildReconciler\n */\n\n'use strict';\n\nvar ReactReconciler = _dereq_(86);\n\nvar instantiateReactComponent = _dereq_(131);\nvar KeyEscapeUtils = _dereq_(23);\nvar shouldUpdateReactComponent = _dereq_(139);\nvar traverseAllChildren = _dereq_(140);\nvar warning = _dereq_(167);\n\nfunction instantiateChild(childInstances, child, name) {\n  // We found a component instance.\n  var keyUnique = childInstances[name] === undefined;\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;\n  }\n  if (child != null && keyUnique) {\n    childInstances[name] = instantiateReactComponent(child);\n  }\n}\n\n/**\n * ReactChildReconciler provides helpers for initializing or updating a set of\n * children. Its output is suitable for passing it onto ReactMultiChild which\n * does diffed reordering and insertion.\n */\nvar ReactChildReconciler = {\n  /**\n   * Generates a \"mount image\" for each of the supplied children. In the case\n   * of `ReactDOMComponent`, a mount image is a string of markup.\n   *\n   * @param {?object} nestedChildNodes Nested child maps.\n   * @return {?object} A set of child instances.\n   * @internal\n   */\n  instantiateChildren: function (nestedChildNodes, transaction, context) {\n    if (nestedChildNodes == null) {\n      return null;\n    }\n    var childInstances = {};\n    traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);\n    return childInstances;\n  },\n\n  /**\n   * Updates the rendered children and returns a new set of children.\n   *\n   * @param {?object} prevChildren Previously initialized set of children.\n   * @param {?object} nextChildren Flat child element maps.\n   * @param {ReactReconcileTransaction} transaction\n   * @param {object} context\n   * @return {?object} A new set of child instances.\n   * @internal\n   */\n  updateChildren: function (prevChildren, nextChildren, removedNodes, transaction, context) {\n    // We currently don't have a way to track moves here but if we use iterators\n    // instead of for..in we can zip the iterators and check if an item has\n    // moved.\n    // TODO: If nothing has changed, return the prevChildren object so that we\n    // can quickly bailout if nothing has changed.\n    if (!nextChildren && !prevChildren) {\n      return;\n    }\n    var name;\n    var prevChild;\n    for (name in nextChildren) {\n      if (!nextChildren.hasOwnProperty(name)) {\n        continue;\n      }\n      prevChild = prevChildren && prevChildren[name];\n      var prevElement = prevChild && prevChild._currentElement;\n      var nextElement = nextChildren[name];\n      if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {\n        ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);\n        nextChildren[name] = prevChild;\n      } else {\n        if (prevChild) {\n          removedNodes[name] = ReactReconciler.getNativeNode(prevChild);\n          ReactReconciler.unmountComponent(prevChild, false);\n        }\n        // The child must be instantiated before it's mounted.\n        var nextChildInstance = instantiateReactComponent(nextElement);\n        nextChildren[name] = nextChildInstance;\n      }\n    }\n    // Unmount children that are no longer present.\n    for (name in prevChildren) {\n      if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {\n        prevChild = prevChildren[name];\n        removedNodes[name] = ReactReconciler.getNativeNode(prevChild);\n        ReactReconciler.unmountComponent(prevChild, false);\n      }\n    }\n  },\n\n  /**\n   * Unmounts all rendered children. This should be used to clean up children\n   * when this component is unmounted.\n   *\n   * @param {?object} renderedChildren Previously initialized set of children.\n   * @internal\n   */\n  unmountChildren: function (renderedChildren, safely) {\n    for (var name in renderedChildren) {\n      if (renderedChildren.hasOwnProperty(name)) {\n        var renderedChild = renderedChildren[name];\n        ReactReconciler.unmountComponent(renderedChild, safely);\n      }\n    }\n  }\n\n};\n\nmodule.exports = ReactChildReconciler;\n},{\"131\":131,\"139\":139,\"140\":140,\"167\":167,\"23\":23,\"86\":86}],29:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactChildren\n */\n\n'use strict';\n\nvar PooledClass = _dereq_(25);\nvar ReactElement = _dereq_(61);\n\nvar emptyFunction = _dereq_(149);\nvar traverseAllChildren = _dereq_(140);\n\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\nvar fourArgumentPooler = PooledClass.fourArgumentPooler;\n\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction escapeUserProvidedKey(text) {\n  return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');\n}\n\n/**\n * PooledClass representing the bookkeeping associated with performing a child\n * traversal. Allows avoiding binding callbacks.\n *\n * @constructor ForEachBookKeeping\n * @param {!function} forEachFunction Function to perform traversal with.\n * @param {?*} forEachContext Context to perform context with.\n */\nfunction ForEachBookKeeping(forEachFunction, forEachContext) {\n  this.func = forEachFunction;\n  this.context = forEachContext;\n  this.count = 0;\n}\nForEachBookKeeping.prototype.destructor = function () {\n  this.func = null;\n  this.context = null;\n  this.count = 0;\n};\nPooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);\n\nfunction forEachSingleChild(bookKeeping, child, name) {\n  var func = bookKeeping.func;\n  var context = bookKeeping.context;\n\n  func.call(context, child, bookKeeping.count++);\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n  if (children == null) {\n    return children;\n  }\n  var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);\n  traverseAllChildren(children, forEachSingleChild, traverseContext);\n  ForEachBookKeeping.release(traverseContext);\n}\n\n/**\n * PooledClass representing the bookkeeping associated with performing a child\n * mapping. Allows avoiding binding callbacks.\n *\n * @constructor MapBookKeeping\n * @param {!*} mapResult Object containing the ordered map of results.\n * @param {!function} mapFunction Function to perform mapping with.\n * @param {?*} mapContext Context to perform mapping with.\n */\nfunction MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {\n  this.result = mapResult;\n  this.keyPrefix = keyPrefix;\n  this.func = mapFunction;\n  this.context = mapContext;\n  this.count = 0;\n}\nMapBookKeeping.prototype.destructor = function () {\n  this.result = null;\n  this.keyPrefix = null;\n  this.func = null;\n  this.context = null;\n  this.count = 0;\n};\nPooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);\n\nfunction mapSingleChildIntoContext(bookKeeping, child, childKey) {\n  var result = bookKeeping.result;\n  var keyPrefix = bookKeeping.keyPrefix;\n  var func = bookKeeping.func;\n  var context = bookKeeping.context;\n\n\n  var mappedChild = func.call(context, child, bookKeeping.count++);\n  if (Array.isArray(mappedChild)) {\n    mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);\n  } else if (mappedChild != null) {\n    if (ReactElement.isValidElement(mappedChild)) {\n      mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,\n      // Keep both the (mapped) and old keys if they differ, just as\n      // traverseAllChildren used to do for objects as children\n      keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);\n    }\n    result.push(mappedChild);\n  }\n}\n\nfunction mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {\n  var escapedPrefix = '';\n  if (prefix != null) {\n    escapedPrefix = escapeUserProvidedKey(prefix) + '/';\n  }\n  var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);\n  traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n  MapBookKeeping.release(traverseContext);\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map\n *\n * The provided mapFunction(child, key, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n  if (children == null) {\n    return children;\n  }\n  var result = [];\n  mapIntoWithKeyPrefixInternal(children, result, null, func, context);\n  return result;\n}\n\nfunction forEachSingleChildDummy(traverseContext, child, name) {\n  return null;\n}\n\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\nfunction countChildren(children, context) {\n  return traverseAllChildren(children, forEachSingleChildDummy, null);\n}\n\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray\n */\nfunction toArray(children) {\n  var result = [];\n  mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n  return result;\n}\n\nvar ReactChildren = {\n  forEach: forEachChildren,\n  map: mapChildren,\n  mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,\n  count: countChildren,\n  toArray: toArray\n};\n\nmodule.exports = ReactChildren;\n},{\"140\":140,\"149\":149,\"25\":25,\"61\":61}],30:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactClass\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactComponent = _dereq_(31);\nvar ReactElement = _dereq_(61);\nvar ReactPropTypeLocations = _dereq_(83);\nvar ReactPropTypeLocationNames = _dereq_(82);\nvar ReactNoopUpdateQueue = _dereq_(80);\n\nvar emptyObject = _dereq_(150);\nvar invariant = _dereq_(157);\nvar keyMirror = _dereq_(160);\nvar keyOf = _dereq_(161);\nvar warning = _dereq_(167);\n\nvar MIXINS_KEY = keyOf({ mixins: null });\n\n/**\n * Policies that describe methods in `ReactClassInterface`.\n */\nvar SpecPolicy = keyMirror({\n  /**\n   * These methods may be defined only once by the class specification or mixin.\n   */\n  DEFINE_ONCE: null,\n  /**\n   * These methods may be defined by both the class specification and mixins.\n   * Subsequent definitions will be chained. These methods must return void.\n   */\n  DEFINE_MANY: null,\n  /**\n   * These methods are overriding the base class.\n   */\n  OVERRIDE_BASE: null,\n  /**\n   * These methods are similar to DEFINE_MANY, except we assume they return\n   * objects. We try to merge the keys of the return values of all the mixed in\n   * functions. If there is a key conflict we throw.\n   */\n  DEFINE_MANY_MERGED: null\n});\n\nvar injectedMixins = [];\n\n/**\n * Composite components are higher-level components that compose other composite\n * or native components.\n *\n * To create a new type of `ReactClass`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n *   var MyComponent = React.createClass({\n *     render: function() {\n *       return <div>Hello World</div>;\n *     }\n *   });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactClassInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will be available on the prototype.\n *\n * @interface ReactClassInterface\n * @internal\n */\nvar ReactClassInterface = {\n\n  /**\n   * An array of Mixin objects to include when defining your component.\n   *\n   * @type {array}\n   * @optional\n   */\n  mixins: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * An object containing properties and methods that should be defined on\n   * the component's constructor instead of its prototype (static methods).\n   *\n   * @type {object}\n   * @optional\n   */\n  statics: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Definition of prop types for this component.\n   *\n   * @type {object}\n   * @optional\n   */\n  propTypes: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Definition of context types for this component.\n   *\n   * @type {object}\n   * @optional\n   */\n  contextTypes: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Definition of context types this component sets for its children.\n   *\n   * @type {object}\n   * @optional\n   */\n  childContextTypes: SpecPolicy.DEFINE_MANY,\n\n  // ==== Definition methods ====\n\n  /**\n   * Invoked when the component is mounted. Values in the mapping will be set on\n   * `this.props` if that prop is not specified (i.e. using an `in` check).\n   *\n   * This method is invoked before `getInitialState` and therefore cannot rely\n   * on `this.state` or use `this.setState`.\n   *\n   * @return {object}\n   * @optional\n   */\n  getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,\n\n  /**\n   * Invoked once before the component is mounted. The return value will be used\n   * as the initial value of `this.state`.\n   *\n   *   getInitialState: function() {\n   *     return {\n   *       isOn: false,\n   *       fooBaz: new BazFoo()\n   *     }\n   *   }\n   *\n   * @return {object}\n   * @optional\n   */\n  getInitialState: SpecPolicy.DEFINE_MANY_MERGED,\n\n  /**\n   * @return {object}\n   * @optional\n   */\n  getChildContext: SpecPolicy.DEFINE_MANY_MERGED,\n\n  /**\n   * Uses props from `this.props` and state from `this.state` to render the\n   * structure of the component.\n   *\n   * No guarantees are made about when or how often this method is invoked, so\n   * it must not have side effects.\n   *\n   *   render: function() {\n   *     var name = this.props.name;\n   *     return <div>Hello, {name}!</div>;\n   *   }\n   *\n   * @return {ReactComponent}\n   * @nosideeffects\n   * @required\n   */\n  render: SpecPolicy.DEFINE_ONCE,\n\n  // ==== Delegate methods ====\n\n  /**\n   * Invoked when the component is initially created and about to be mounted.\n   * This may have side effects, but any external subscriptions or data created\n   * by this method must be cleaned up in `componentWillUnmount`.\n   *\n   * @optional\n   */\n  componentWillMount: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Invoked when the component has been mounted and has a DOM representation.\n   * However, there is no guarantee that the DOM node is in the document.\n   *\n   * Use this as an opportunity to operate on the DOM when the component has\n   * been mounted (initialized and rendered) for the first time.\n   *\n   * @param {DOMElement} rootNode DOM element representing the component.\n   * @optional\n   */\n  componentDidMount: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Invoked before the component receives new props.\n   *\n   * Use this as an opportunity to react to a prop transition by updating the\n   * state using `this.setState`. Current props are accessed via `this.props`.\n   *\n   *   componentWillReceiveProps: function(nextProps, nextContext) {\n   *     this.setState({\n   *       likesIncreasing: nextProps.likeCount > this.props.likeCount\n   *     });\n   *   }\n   *\n   * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop\n   * transition may cause a state change, but the opposite is not true. If you\n   * need it, you are probably looking for `componentWillUpdate`.\n   *\n   * @param {object} nextProps\n   * @optional\n   */\n  componentWillReceiveProps: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Invoked while deciding if the component should be updated as a result of\n   * receiving new props, state and/or context.\n   *\n   * Use this as an opportunity to `return false` when you're certain that the\n   * transition to the new props/state/context will not require a component\n   * update.\n   *\n   *   shouldComponentUpdate: function(nextProps, nextState, nextContext) {\n   *     return !equal(nextProps, this.props) ||\n   *       !equal(nextState, this.state) ||\n   *       !equal(nextContext, this.context);\n   *   }\n   *\n   * @param {object} nextProps\n   * @param {?object} nextState\n   * @param {?object} nextContext\n   * @return {boolean} True if the component should update.\n   * @optional\n   */\n  shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,\n\n  /**\n   * Invoked when the component is about to update due to a transition from\n   * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`\n   * and `nextContext`.\n   *\n   * Use this as an opportunity to perform preparation before an update occurs.\n   *\n   * NOTE: You **cannot** use `this.setState()` in this method.\n   *\n   * @param {object} nextProps\n   * @param {?object} nextState\n   * @param {?object} nextContext\n   * @param {ReactReconcileTransaction} transaction\n   * @optional\n   */\n  componentWillUpdate: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Invoked when the component's DOM representation has been updated.\n   *\n   * Use this as an opportunity to operate on the DOM when the component has\n   * been updated.\n   *\n   * @param {object} prevProps\n   * @param {?object} prevState\n   * @param {?object} prevContext\n   * @param {DOMElement} rootNode DOM element representing the component.\n   * @optional\n   */\n  componentDidUpdate: SpecPolicy.DEFINE_MANY,\n\n  /**\n   * Invoked when the component is about to be removed from its parent and have\n   * its DOM representation destroyed.\n   *\n   * Use this as an opportunity to deallocate any external resources.\n   *\n   * NOTE: There is no `componentDidUnmount` since your component will have been\n   * destroyed by that point.\n   *\n   * @optional\n   */\n  componentWillUnmount: SpecPolicy.DEFINE_MANY,\n\n  // ==== Advanced methods ====\n\n  /**\n   * Updates the component's currently mounted DOM representation.\n   *\n   * By default, this implements React's rendering and reconciliation algorithm.\n   * Sophisticated clients may wish to override this.\n   *\n   * @param {ReactReconcileTransaction} transaction\n   * @internal\n   * @overridable\n   */\n  updateComponent: SpecPolicy.OVERRIDE_BASE\n\n};\n\n/**\n * Mapping from class specification keys to special processing functions.\n *\n * Although these are declared like instance properties in the specification\n * when defining classes using `React.createClass`, they are actually static\n * and are accessible on the constructor instead of the prototype. Despite\n * being static, they must be defined outside of the \"statics\" key under\n * which all other static methods are defined.\n */\nvar RESERVED_SPEC_KEYS = {\n  displayName: function (Constructor, displayName) {\n    Constructor.displayName = displayName;\n  },\n  mixins: function (Constructor, mixins) {\n    if (mixins) {\n      for (var i = 0; i < mixins.length; i++) {\n        mixSpecIntoComponent(Constructor, mixins[i]);\n      }\n    }\n  },\n  childContextTypes: function (Constructor, childContextTypes) {\n    if (\"development\" !== 'production') {\n      validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);\n    }\n    Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);\n  },\n  contextTypes: function (Constructor, contextTypes) {\n    if (\"development\" !== 'production') {\n      validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);\n    }\n    Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);\n  },\n  /**\n   * Special case getDefaultProps which should move into statics but requires\n   * automatic merging.\n   */\n  getDefaultProps: function (Constructor, getDefaultProps) {\n    if (Constructor.getDefaultProps) {\n      Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);\n    } else {\n      Constructor.getDefaultProps = getDefaultProps;\n    }\n  },\n  propTypes: function (Constructor, propTypes) {\n    if (\"development\" !== 'production') {\n      validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);\n    }\n    Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);\n  },\n  statics: function (Constructor, statics) {\n    mixStaticSpecIntoComponent(Constructor, statics);\n  },\n  autobind: function () {} };\n\n// noop\nfunction validateTypeDef(Constructor, typeDef, location) {\n  for (var propName in typeDef) {\n    if (typeDef.hasOwnProperty(propName)) {\n      // use a warning instead of an invariant so components\n      // don't show up in prod but only in __DEV__\n      \"development\" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;\n    }\n  }\n}\n\nfunction validateMethodOverride(isAlreadyDefined, name) {\n  var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;\n\n  // Disallow overriding of base class methods unless explicitly allowed.\n  if (ReactClassMixin.hasOwnProperty(name)) {\n    !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? \"development\" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : void 0;\n  }\n\n  // Disallow defining methods more than once unless explicitly allowed.\n  if (isAlreadyDefined) {\n    !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? \"development\" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : void 0;\n  }\n}\n\n/**\n * Mixin helper which handles policy validation and reserved\n * specification keys when building React classes.\n */\nfunction mixSpecIntoComponent(Constructor, spec) {\n  if (!spec) {\n    return;\n  }\n\n  !(typeof spec !== 'function') ? \"development\" !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.') : invariant(false) : void 0;\n  !!ReactElement.isValidElement(spec) ? \"development\" !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : void 0;\n\n  var proto = Constructor.prototype;\n  var autoBindPairs = proto.__reactAutoBindPairs;\n\n  // By handling mixins before any other properties, we ensure the same\n  // chaining order is applied to methods with DEFINE_MANY policy, whether\n  // mixins are listed before or after these methods in the spec.\n  if (spec.hasOwnProperty(MIXINS_KEY)) {\n    RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n  }\n\n  for (var name in spec) {\n    if (!spec.hasOwnProperty(name)) {\n      continue;\n    }\n\n    if (name === MIXINS_KEY) {\n      // We have already handled mixins in a special case above.\n      continue;\n    }\n\n    var property = spec[name];\n    var isAlreadyDefined = proto.hasOwnProperty(name);\n    validateMethodOverride(isAlreadyDefined, name);\n\n    if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n      RESERVED_SPEC_KEYS[name](Constructor, property);\n    } else {\n      // Setup methods on prototype:\n      // The following member methods should not be automatically bound:\n      // 1. Expected ReactClass methods (in the \"interface\").\n      // 2. Overridden methods (that were mixed in).\n      var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n      var isFunction = typeof property === 'function';\n      var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n\n      if (shouldAutoBind) {\n        autoBindPairs.push(name, property);\n        proto[name] = property;\n      } else {\n        if (isAlreadyDefined) {\n          var specPolicy = ReactClassInterface[name];\n\n          // These cases should already be caught by validateMethodOverride.\n          !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? \"development\" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : void 0;\n\n          // For methods which are defined more than once, call the existing\n          // methods before calling the new property, merging if appropriate.\n          if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {\n            proto[name] = createMergedResultFunction(proto[name], property);\n          } else if (specPolicy === SpecPolicy.DEFINE_MANY) {\n            proto[name] = createChainedFunction(proto[name], property);\n          }\n        } else {\n          proto[name] = property;\n          if (\"development\" !== 'production') {\n            // Add verbose displayName to the function, which helps when looking\n            // at profiling tools.\n            if (typeof property === 'function' && spec.displayName) {\n              proto[name].displayName = spec.displayName + '_' + name;\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nfunction mixStaticSpecIntoComponent(Constructor, statics) {\n  if (!statics) {\n    return;\n  }\n  for (var name in statics) {\n    var property = statics[name];\n    if (!statics.hasOwnProperty(name)) {\n      continue;\n    }\n\n    var isReserved = name in RESERVED_SPEC_KEYS;\n    !!isReserved ? \"development\" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\\'t be on the \"statics\" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : void 0;\n\n    var isInherited = name in Constructor;\n    !!isInherited ? \"development\" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : void 0;\n    Constructor[name] = property;\n  }\n}\n\n/**\n * Merge two objects, but throw if both contain the same key.\n *\n * @param {object} one The first object, which is mutated.\n * @param {object} two The second object\n * @return {object} one after it has been mutated to contain everything in two.\n */\nfunction mergeIntoWithNoDuplicateKeys(one, two) {\n  !(one && two && typeof one === 'object' && typeof two === 'object') ? \"development\" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : void 0;\n\n  for (var key in two) {\n    if (two.hasOwnProperty(key)) {\n      !(one[key] === undefined) ? \"development\" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : void 0;\n      one[key] = two[key];\n    }\n  }\n  return one;\n}\n\n/**\n * Creates a function that invokes two functions and merges their return values.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\nfunction createMergedResultFunction(one, two) {\n  return function mergedResult() {\n    var a = one.apply(this, arguments);\n    var b = two.apply(this, arguments);\n    if (a == null) {\n      return b;\n    } else if (b == null) {\n      return a;\n    }\n    var c = {};\n    mergeIntoWithNoDuplicateKeys(c, a);\n    mergeIntoWithNoDuplicateKeys(c, b);\n    return c;\n  };\n}\n\n/**\n * Creates a function that invokes two functions and ignores their return vales.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\nfunction createChainedFunction(one, two) {\n  return function chainedFunction() {\n    one.apply(this, arguments);\n    two.apply(this, arguments);\n  };\n}\n\n/**\n * Binds a method to the component.\n *\n * @param {object} component Component whose method is going to be bound.\n * @param {function} method Method to be bound.\n * @return {function} The bound method.\n */\nfunction bindAutoBindMethod(component, method) {\n  var boundMethod = method.bind(component);\n  if (\"development\" !== 'production') {\n    boundMethod.__reactBoundContext = component;\n    boundMethod.__reactBoundMethod = method;\n    boundMethod.__reactBoundArguments = null;\n    var componentName = component.constructor.displayName;\n    var _bind = boundMethod.bind;\n    boundMethod.bind = function (newThis) {\n      for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n\n      // User is trying to bind() an autobound method; we effectively will\n      // ignore the value of \"this\" that the user is trying to use, so\n      // let's warn.\n      if (newThis !== component && newThis !== null) {\n        \"development\" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;\n      } else if (!args.length) {\n        \"development\" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;\n        return boundMethod;\n      }\n      var reboundMethod = _bind.apply(boundMethod, arguments);\n      reboundMethod.__reactBoundContext = component;\n      reboundMethod.__reactBoundMethod = method;\n      reboundMethod.__reactBoundArguments = args;\n      return reboundMethod;\n    };\n  }\n  return boundMethod;\n}\n\n/**\n * Binds all auto-bound methods in a component.\n *\n * @param {object} component Component whose method is going to be bound.\n */\nfunction bindAutoBindMethods(component) {\n  var pairs = component.__reactAutoBindPairs;\n  for (var i = 0; i < pairs.length; i += 2) {\n    var autoBindKey = pairs[i];\n    var method = pairs[i + 1];\n    component[autoBindKey] = bindAutoBindMethod(component, method);\n  }\n}\n\n/**\n * Add more to the ReactClass base class. These are all legacy features and\n * therefore not already part of the modern ReactComponent.\n */\nvar ReactClassMixin = {\n\n  /**\n   * TODO: This will be deprecated because state should always keep a consistent\n   * type signature and the only use case for this, is to avoid that.\n   */\n  replaceState: function (newState, callback) {\n    this.updater.enqueueReplaceState(this, newState);\n    if (callback) {\n      this.updater.enqueueCallback(this, callback, 'replaceState');\n    }\n  },\n\n  /**\n   * Checks whether or not this composite component is mounted.\n   * @return {boolean} True if mounted, false otherwise.\n   * @protected\n   * @final\n   */\n  isMounted: function () {\n    return this.updater.isMounted(this);\n  }\n};\n\nvar ReactClassComponent = function () {};\n_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);\n\n/**\n * Module for creating composite components.\n *\n * @class ReactClass\n */\nvar ReactClass = {\n\n  /**\n   * Creates a composite component class given a class specification.\n   * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass\n   *\n   * @param {object} spec Class specification (which must define `render`).\n   * @return {function} Component constructor function.\n   * @public\n   */\n  createClass: function (spec) {\n    var Constructor = function (props, context, updater) {\n      // This constructor gets overridden by mocks. The argument is used\n      // by mocks to assert on what gets mounted.\n\n      if (\"development\" !== 'production') {\n        \"development\" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;\n      }\n\n      // Wire up auto-binding\n      if (this.__reactAutoBindPairs.length) {\n        bindAutoBindMethods(this);\n      }\n\n      this.props = props;\n      this.context = context;\n      this.refs = emptyObject;\n      this.updater = updater || ReactNoopUpdateQueue;\n\n      this.state = null;\n\n      // ReactClasses doesn't have constructors. Instead, they use the\n      // getInitialState and componentWillMount methods for initialization.\n\n      var initialState = this.getInitialState ? this.getInitialState() : null;\n      if (\"development\" !== 'production') {\n        // We allow auto-mocks to proceed as if they're returning null.\n        if (initialState === undefined && this.getInitialState._isMockFunction) {\n          // This is probably bad practice. Consider warning here and\n          // deprecating this convenience.\n          initialState = null;\n        }\n      }\n      !(typeof initialState === 'object' && !Array.isArray(initialState)) ? \"development\" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : void 0;\n\n      this.state = initialState;\n    };\n    Constructor.prototype = new ReactClassComponent();\n    Constructor.prototype.constructor = Constructor;\n    Constructor.prototype.__reactAutoBindPairs = [];\n\n    injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));\n\n    mixSpecIntoComponent(Constructor, spec);\n\n    // Initialize the defaultProps property after all mixins have been merged.\n    if (Constructor.getDefaultProps) {\n      Constructor.defaultProps = Constructor.getDefaultProps();\n    }\n\n    if (\"development\" !== 'production') {\n      // This is a tag to indicate that the use of these method names is ok,\n      // since it's used with createClass. If it's not, then it's likely a\n      // mistake so we'll warn you to use the static property, property\n      // initializer or constructor respectively.\n      if (Constructor.getDefaultProps) {\n        Constructor.getDefaultProps.isReactClassApproved = {};\n      }\n      if (Constructor.prototype.getInitialState) {\n        Constructor.prototype.getInitialState.isReactClassApproved = {};\n      }\n    }\n\n    !Constructor.prototype.render ? \"development\" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : void 0;\n\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%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.', spec.displayName || 'A component') : void 0;\n      \"development\" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;\n    }\n\n    // Reduce time spent doing lookups by setting these on the prototype.\n    for (var methodName in ReactClassInterface) {\n      if (!Constructor.prototype[methodName]) {\n        Constructor.prototype[methodName] = null;\n      }\n    }\n\n    return Constructor;\n  },\n\n  injection: {\n    injectMixin: function (mixin) {\n      injectedMixins.push(mixin);\n    }\n  }\n\n};\n\nmodule.exports = ReactClass;\n},{\"150\":150,\"157\":157,\"160\":160,\"161\":161,\"167\":167,\"168\":168,\"31\":31,\"61\":61,\"80\":80,\"82\":82,\"83\":83}],31:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactComponent\n */\n\n'use strict';\n\nvar ReactNoopUpdateQueue = _dereq_(80);\nvar ReactInstrumentation = _dereq_(71);\n\nvar canDefineProperty = _dereq_(115);\nvar emptyObject = _dereq_(150);\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\n/**\n * Base class helpers for the updating state of a component.\n */\nfunction ReactComponent(props, context, updater) {\n  this.props = props;\n  this.context = context;\n  this.refs = emptyObject;\n  // We initialize the default updater but the real one gets injected by the\n  // renderer.\n  this.updater = updater || ReactNoopUpdateQueue;\n}\n\nReactComponent.prototype.isReactComponent = {};\n\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together.  You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n *        produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\nReactComponent.prototype.setState = function (partialState, callback) {\n  !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? \"development\" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : void 0;\n  if (\"development\" !== 'production') {\n    ReactInstrumentation.debugTool.onSetState();\n    \"development\" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;\n  }\n  this.updater.enqueueSetState(this, partialState);\n  if (callback) {\n    this.updater.enqueueCallback(this, callback, 'setState');\n  }\n};\n\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\nReactComponent.prototype.forceUpdate = function (callback) {\n  this.updater.enqueueForceUpdate(this);\n  if (callback) {\n    this.updater.enqueueCallback(this, callback, 'forceUpdate');\n  }\n};\n\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\nif (\"development\" !== 'production') {\n  var deprecatedAPIs = {\n    isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n    replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n  };\n  var defineDeprecationWarning = function (methodName, info) {\n    if (canDefineProperty) {\n      Object.defineProperty(ReactComponent.prototype, methodName, {\n        get: function () {\n          \"development\" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;\n          return undefined;\n        }\n      });\n    }\n  };\n  for (var fnName in deprecatedAPIs) {\n    if (deprecatedAPIs.hasOwnProperty(fnName)) {\n      defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n    }\n  }\n}\n\nmodule.exports = ReactComponent;\n},{\"115\":115,\"150\":150,\"157\":157,\"167\":167,\"71\":71,\"80\":80}],32:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactComponentBrowserEnvironment\n */\n\n'use strict';\n\nvar DOMChildrenOperations = _dereq_(7);\nvar ReactDOMIDOperations = _dereq_(47);\n\n/**\n * Abstracts away all functionality of the reconciler that requires knowledge of\n * the browser context. TODO: These callers should be refactored to avoid the\n * need for this injection.\n */\nvar ReactComponentBrowserEnvironment = {\n\n  processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,\n\n  replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup,\n\n  /**\n   * If a particular environment requires that some resources be cleaned up,\n   * specify this in the injected Mixin. In the DOM, we would likely want to\n   * purge any cached node ID lookups.\n   *\n   * @private\n   */\n  unmountIDFromEnvironment: function (rootNodeID) {}\n\n};\n\nmodule.exports = ReactComponentBrowserEnvironment;\n},{\"47\":47,\"7\":7}],33:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactComponentEnvironment\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\nvar injected = false;\n\nvar ReactComponentEnvironment = {\n\n  /**\n   * Optionally injectable environment dependent cleanup hook. (server vs.\n   * browser etc). Example: A browser system caches DOM nodes based on component\n   * ID and must remove that cache entry when this instance is unmounted.\n   */\n  unmountIDFromEnvironment: null,\n\n  /**\n   * Optionally injectable hook for swapping out mount images in the middle of\n   * the tree.\n   */\n  replaceNodeWithMarkup: null,\n\n  /**\n   * Optionally injectable hook for processing a queue of child updates. Will\n   * later move into MultiChildComponents.\n   */\n  processChildrenUpdates: null,\n\n  injection: {\n    injectEnvironment: function (environment) {\n      !!injected ? \"development\" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : void 0;\n      ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;\n      ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;\n      ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;\n      injected = true;\n    }\n  }\n\n};\n\nmodule.exports = ReactComponentEnvironment;\n},{\"157\":157}],34:[function(_dereq_,module,exports){\n/**\n * Copyright 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactComponentTreeDevtool\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\nvar tree = {};\nvar rootIDs = [];\n\nfunction updateTree(id, update) {\n  if (!tree[id]) {\n    tree[id] = {\n      parentID: null,\n      ownerID: null,\n      text: null,\n      childIDs: [],\n      displayName: 'Unknown',\n      isMounted: false,\n      updateCount: 0\n    };\n  }\n  update(tree[id]);\n}\n\nfunction purgeDeep(id) {\n  var item = tree[id];\n  if (item) {\n    var childIDs = item.childIDs;\n\n    delete tree[id];\n    childIDs.forEach(purgeDeep);\n  }\n}\n\nvar ReactComponentTreeDevtool = {\n  onSetDisplayName: function (id, displayName) {\n    updateTree(id, function (item) {\n      return item.displayName = displayName;\n    });\n  },\n  onSetChildren: function (id, nextChildIDs) {\n    updateTree(id, function (item) {\n      var prevChildIDs = item.childIDs;\n      item.childIDs = nextChildIDs;\n\n      nextChildIDs.forEach(function (nextChildID) {\n        var nextChild = tree[nextChildID];\n        !nextChild ? \"development\" !== 'production' ? invariant(false, 'Expected devtool events to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;\n        !(nextChild.displayName != null) ? \"development\" !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;\n        !(nextChild.childIDs != null || nextChild.text != null) ? \"development\" !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;\n        !nextChild.isMounted ? \"development\" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;\n\n        if (prevChildIDs.indexOf(nextChildID) === -1) {\n          nextChild.parentID = id;\n        }\n      });\n    });\n  },\n  onSetOwner: function (id, ownerID) {\n    updateTree(id, function (item) {\n      return item.ownerID = ownerID;\n    });\n  },\n  onSetText: function (id, text) {\n    updateTree(id, function (item) {\n      return item.text = text;\n    });\n  },\n  onMountComponent: function (id) {\n    updateTree(id, function (item) {\n      return item.isMounted = true;\n    });\n  },\n  onMountRootComponent: function (id) {\n    rootIDs.push(id);\n  },\n  onUpdateComponent: function (id) {\n    updateTree(id, function (item) {\n      return item.updateCount++;\n    });\n  },\n  onUnmountComponent: function (id) {\n    updateTree(id, function (item) {\n      return item.isMounted = false;\n    });\n    rootIDs = rootIDs.filter(function (rootID) {\n      return rootID !== id;\n    });\n  },\n  purgeUnmountedComponents: function () {\n    if (ReactComponentTreeDevtool._preventPurging) {\n      // Should only be used for testing.\n      return;\n    }\n\n    Object.keys(tree).filter(function (id) {\n      return !tree[id].isMounted;\n    }).forEach(purgeDeep);\n  },\n  isMounted: function (id) {\n    var item = tree[id];\n    return item ? item.isMounted : false;\n  },\n  getChildIDs: function (id) {\n    var item = tree[id];\n    return item ? item.childIDs : [];\n  },\n  getDisplayName: function (id) {\n    var item = tree[id];\n    return item ? item.displayName : 'Unknown';\n  },\n  getOwnerID: function (id) {\n    var item = tree[id];\n    return item ? item.ownerID : null;\n  },\n  getParentID: function (id) {\n    var item = tree[id];\n    return item ? item.parentID : null;\n  },\n  getText: function (id) {\n    var item = tree[id];\n    return item ? item.text : null;\n  },\n  getUpdateCount: function (id) {\n    var item = tree[id];\n    return item ? item.updateCount : 0;\n  },\n  getRootIDs: function () {\n    return rootIDs;\n  },\n  getRegisteredIDs: function () {\n    return Object.keys(tree);\n  }\n};\n\nmodule.exports = ReactComponentTreeDevtool;\n},{\"157\":157}],35:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactCompositeComponent\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactComponentEnvironment = _dereq_(33);\nvar ReactCurrentOwner = _dereq_(36);\nvar ReactElement = _dereq_(61);\nvar ReactErrorUtils = _dereq_(64);\nvar ReactInstanceMap = _dereq_(70);\nvar ReactInstrumentation = _dereq_(71);\nvar ReactNodeTypes = _dereq_(79);\nvar ReactPropTypeLocations = _dereq_(83);\nvar ReactPropTypeLocationNames = _dereq_(82);\nvar ReactReconciler = _dereq_(86);\nvar ReactUpdateQueue = _dereq_(92);\n\nvar emptyObject = _dereq_(150);\nvar invariant = _dereq_(157);\nvar shouldUpdateReactComponent = _dereq_(139);\nvar warning = _dereq_(167);\n\nfunction getDeclarationErrorAddendum(component) {\n  var owner = component._currentElement._owner || null;\n  if (owner) {\n    var name = owner.getName();\n    if (name) {\n      return ' Check the render method of `' + name + '`.';\n    }\n  }\n  return '';\n}\n\nfunction StatelessComponent(Component) {}\nStatelessComponent.prototype.render = function () {\n  var Component = ReactInstanceMap.get(this)._currentElement.type;\n  var element = Component(this.props, this.context, this.updater);\n  warnIfInvalidElement(Component, element);\n  return element;\n};\n\nfunction warnIfInvalidElement(Component, element) {\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;\n  }\n}\n\nfunction invokeComponentDidMountWithTimer() {\n  var publicInstance = this._instance;\n  if (this._debugID !== 0) {\n    ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');\n  }\n  publicInstance.componentDidMount();\n  if (this._debugID !== 0) {\n    ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');\n  }\n}\n\nfunction invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {\n  var publicInstance = this._instance;\n  if (this._debugID !== 0) {\n    ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');\n  }\n  publicInstance.componentDidUpdate(prevProps, prevState, prevContext);\n  if (this._debugID !== 0) {\n    ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');\n  }\n}\n\nfunction shouldConstruct(Component) {\n  return Component.prototype && Component.prototype.isReactComponent;\n}\n\n/**\n * ------------------ The Life-Cycle of a Composite Component ------------------\n *\n * - constructor: Initialization of state. The instance is now retained.\n *   - componentWillMount\n *   - render\n *   - [children's constructors]\n *     - [children's componentWillMount and render]\n *     - [children's componentDidMount]\n *     - componentDidMount\n *\n *       Update Phases:\n *       - componentWillReceiveProps (only called if parent updated)\n *       - shouldComponentUpdate\n *         - componentWillUpdate\n *           - render\n *           - [children's constructors or receive props phases]\n *         - componentDidUpdate\n *\n *     - componentWillUnmount\n *     - [children's componentWillUnmount]\n *   - [children destroyed]\n * - (destroyed): The instance is now blank, released by React and ready for GC.\n *\n * -----------------------------------------------------------------------------\n */\n\n/**\n * An incrementing ID assigned to each component when it is mounted. This is\n * used to enforce the order in which `ReactUpdates` updates dirty components.\n *\n * @private\n */\nvar nextMountID = 1;\n\n/**\n * @lends {ReactCompositeComponent.prototype}\n */\nvar ReactCompositeComponentMixin = {\n\n  /**\n   * Base constructor for all composite component.\n   *\n   * @param {ReactElement} element\n   * @final\n   * @internal\n   */\n  construct: function (element) {\n    this._currentElement = element;\n    this._rootNodeID = null;\n    this._instance = null;\n    this._nativeParent = null;\n    this._nativeContainerInfo = null;\n\n    // See ReactUpdateQueue\n    this._updateBatchNumber = null;\n    this._pendingElement = null;\n    this._pendingStateQueue = null;\n    this._pendingReplaceState = false;\n    this._pendingForceUpdate = false;\n\n    this._renderedNodeType = null;\n    this._renderedComponent = null;\n    this._context = null;\n    this._mountOrder = 0;\n    this._topLevelWrapper = null;\n\n    // See ReactUpdates and ReactUpdateQueue.\n    this._pendingCallbacks = null;\n\n    // ComponentWillUnmount shall only be called once\n    this._calledComponentWillUnmount = false;\n  },\n\n  /**\n   * Initializes the component, renders markup, and registers event listeners.\n   *\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @param {?object} nativeParent\n   * @param {?object} nativeContainerInfo\n   * @param {?object} context\n   * @return {?string} Rendered markup to be inserted into the DOM.\n   * @final\n   * @internal\n   */\n  mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {\n    this._context = context;\n    this._mountOrder = nextMountID++;\n    this._nativeParent = nativeParent;\n    this._nativeContainerInfo = nativeContainerInfo;\n\n    var publicProps = this._processProps(this._currentElement.props);\n    var publicContext = this._processContext(context);\n\n    var Component = this._currentElement.type;\n\n    // Initialize the public class\n    var inst = this._constructComponent(publicProps, publicContext);\n    var renderedElement;\n\n    // Support functional components\n    if (!shouldConstruct(Component) && (inst == null || inst.render == null)) {\n      renderedElement = inst;\n      warnIfInvalidElement(Component, renderedElement);\n      !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? \"development\" !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : invariant(false) : void 0;\n      inst = new StatelessComponent(Component);\n    }\n\n    if (\"development\" !== 'production') {\n      // This will throw later in _renderValidatedComponent, but add an early\n      // warning now to help debugging\n      if (inst.render == null) {\n        \"development\" !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;\n      }\n\n      var propsMutated = inst.props !== publicProps;\n      var componentName = Component.displayName || Component.name || 'Component';\n\n      \"development\" !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\\'s constructor was passed.', componentName, componentName) : void 0;\n    }\n\n    // These should be set up in the constructor, but as a convenience for\n    // simpler class abstractions, we set them up after the fact.\n    inst.props = publicProps;\n    inst.context = publicContext;\n    inst.refs = emptyObject;\n    inst.updater = ReactUpdateQueue;\n\n    this._instance = inst;\n\n    // Store a reference from the instance back to the internal representation\n    ReactInstanceMap.set(inst, this);\n\n    if (\"development\" !== 'production') {\n      // Since plain JS classes are defined without any special initialization\n      // logic, we can not catch common errors early. Therefore, we have to\n      // catch them here, at initialization time, instead.\n      \"development\" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, '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?', this.getName() || 'a component') : void 0;\n      \"development\" !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, '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.', this.getName() || 'a component') : void 0;\n      \"development\" !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;\n      \"development\" !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;\n      \"development\" !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%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.', this.getName() || 'A component') : void 0;\n      \"development\" !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;\n      \"development\" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;\n    }\n\n    var initialState = inst.state;\n    if (initialState === undefined) {\n      inst.state = initialState = null;\n    }\n    !(typeof initialState === 'object' && !Array.isArray(initialState)) ? \"development\" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;\n\n    this._pendingStateQueue = null;\n    this._pendingReplaceState = false;\n    this._pendingForceUpdate = false;\n\n    var markup;\n    if (inst.unstable_handleError) {\n      markup = this.performInitialMountWithErrorHandling(renderedElement, nativeParent, nativeContainerInfo, transaction, context);\n    } else {\n      markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);\n    }\n\n    if (inst.componentDidMount) {\n      if (\"development\" !== 'production') {\n        transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);\n      } else {\n        transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);\n      }\n    }\n\n    return markup;\n  },\n\n  _constructComponent: function (publicProps, publicContext) {\n    if (\"development\" !== 'production') {\n      ReactCurrentOwner.current = this;\n      try {\n        return this._constructComponentWithoutOwner(publicProps, publicContext);\n      } finally {\n        ReactCurrentOwner.current = null;\n      }\n    } else {\n      return this._constructComponentWithoutOwner(publicProps, publicContext);\n    }\n  },\n\n  _constructComponentWithoutOwner: function (publicProps, publicContext) {\n    var Component = this._currentElement.type;\n    var instanceOrElement;\n    if (shouldConstruct(Component)) {\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');\n        }\n      }\n      instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue);\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');\n        }\n      }\n    } else {\n      // This can still be an instance in case of factory components\n      // but we'll count this as time spent rendering as the more common case.\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');\n        }\n      }\n      instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue);\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');\n        }\n      }\n    }\n    return instanceOrElement;\n  },\n\n  performInitialMountWithErrorHandling: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {\n    var markup;\n    var checkpoint = transaction.checkpoint();\n    try {\n      markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);\n    } catch (e) {\n      // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint\n      transaction.rollback(checkpoint);\n      this._instance.unstable_handleError(e);\n      if (this._pendingStateQueue) {\n        this._instance.state = this._processPendingState(this._instance.props, this._instance.context);\n      }\n      checkpoint = transaction.checkpoint();\n\n      this._renderedComponent.unmountComponent(true);\n      transaction.rollback(checkpoint);\n\n      // Try again - we've informed the component about the error, so they can render an error message this time.\n      // If this throws again, the error will bubble up (and can be caught by a higher error boundary).\n      markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);\n    }\n    return markup;\n  },\n\n  performInitialMount: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {\n    var inst = this._instance;\n    if (inst.componentWillMount) {\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');\n        }\n      }\n      inst.componentWillMount();\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');\n        }\n      }\n      // When mounting, calls to `setState` by `componentWillMount` will set\n      // `this._pendingStateQueue` without triggering a re-render.\n      if (this._pendingStateQueue) {\n        inst.state = this._processPendingState(inst.props, inst.context);\n      }\n    }\n\n    // If not a stateless component, we now render\n    if (renderedElement === undefined) {\n      renderedElement = this._renderValidatedComponent();\n    }\n\n    this._renderedNodeType = ReactNodeTypes.getType(renderedElement);\n    this._renderedComponent = this._instantiateReactComponent(renderedElement);\n\n    var markup = ReactReconciler.mountComponent(this._renderedComponent, transaction, nativeParent, nativeContainerInfo, this._processChildContext(context));\n\n    if (\"development\" !== 'production') {\n      if (this._debugID !== 0) {\n        ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);\n      }\n    }\n\n    return markup;\n  },\n\n  getNativeNode: function () {\n    return ReactReconciler.getNativeNode(this._renderedComponent);\n  },\n\n  /**\n   * Releases any resources allocated by `mountComponent`.\n   *\n   * @final\n   * @internal\n   */\n  unmountComponent: function (safely) {\n    if (!this._renderedComponent) {\n      return;\n    }\n    var inst = this._instance;\n\n    if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {\n      inst._calledComponentWillUnmount = true;\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');\n        }\n      }\n      if (safely) {\n        var name = this.getName() + '.componentWillUnmount()';\n        ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));\n      } else {\n        inst.componentWillUnmount();\n      }\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');\n        }\n      }\n    }\n\n    if (this._renderedComponent) {\n      ReactReconciler.unmountComponent(this._renderedComponent, safely);\n      this._renderedNodeType = null;\n      this._renderedComponent = null;\n      this._instance = null;\n    }\n\n    // Reset pending fields\n    // Even if this component is scheduled for another update in ReactUpdates,\n    // it would still be ignored because these fields are reset.\n    this._pendingStateQueue = null;\n    this._pendingReplaceState = false;\n    this._pendingForceUpdate = false;\n    this._pendingCallbacks = null;\n    this._pendingElement = null;\n\n    // These fields do not really need to be reset since this object is no\n    // longer accessible.\n    this._context = null;\n    this._rootNodeID = null;\n    this._topLevelWrapper = null;\n\n    // Delete the reference from the instance to this internal representation\n    // which allow the internals to be properly cleaned up even if the user\n    // leaks a reference to the public instance.\n    ReactInstanceMap.remove(inst);\n\n    // Some existing components rely on inst.props even after they've been\n    // destroyed (in event handlers).\n    // TODO: inst.props = null;\n    // TODO: inst.state = null;\n    // TODO: inst.context = null;\n  },\n\n  /**\n   * Filters the context object to only contain keys specified in\n   * `contextTypes`\n   *\n   * @param {object} context\n   * @return {?object}\n   * @private\n   */\n  _maskContext: function (context) {\n    var Component = this._currentElement.type;\n    var contextTypes = Component.contextTypes;\n    if (!contextTypes) {\n      return emptyObject;\n    }\n    var maskedContext = {};\n    for (var contextName in contextTypes) {\n      maskedContext[contextName] = context[contextName];\n    }\n    return maskedContext;\n  },\n\n  /**\n   * Filters the context object to only contain keys specified in\n   * `contextTypes`, and asserts that they are valid.\n   *\n   * @param {object} context\n   * @return {?object}\n   * @private\n   */\n  _processContext: function (context) {\n    var maskedContext = this._maskContext(context);\n    if (\"development\" !== 'production') {\n      var Component = this._currentElement.type;\n      if (Component.contextTypes) {\n        this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);\n      }\n    }\n    return maskedContext;\n  },\n\n  /**\n   * @param {object} currentContext\n   * @return {object}\n   * @private\n   */\n  _processChildContext: function (currentContext) {\n    var Component = this._currentElement.type;\n    var inst = this._instance;\n    if (\"development\" !== 'production') {\n      ReactInstrumentation.debugTool.onBeginProcessingChildContext();\n    }\n    var childContext = inst.getChildContext && inst.getChildContext();\n    if (\"development\" !== 'production') {\n      ReactInstrumentation.debugTool.onEndProcessingChildContext();\n    }\n    if (childContext) {\n      !(typeof Component.childContextTypes === 'object') ? \"development\" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;\n      if (\"development\" !== 'production') {\n        this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);\n      }\n      for (var name in childContext) {\n        !(name in Component.childContextTypes) ? \"development\" !== 'production' ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : void 0;\n      }\n      return _assign({}, currentContext, childContext);\n    }\n    return currentContext;\n  },\n\n  /**\n   * Processes props by setting default values for unspecified props and\n   * asserting that the props are valid. Does not mutate its argument; returns\n   * a new props object with defaults merged in.\n   *\n   * @param {object} newProps\n   * @return {object}\n   * @private\n   */\n  _processProps: function (newProps) {\n    if (\"development\" !== 'production') {\n      var Component = this._currentElement.type;\n      if (Component.propTypes) {\n        this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);\n      }\n    }\n    return newProps;\n  },\n\n  /**\n   * Assert that the props are valid\n   *\n   * @param {object} propTypes Map of prop name to a ReactPropType\n   * @param {object} props\n   * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n   * @private\n   */\n  _checkPropTypes: function (propTypes, props, location) {\n    // TODO: Stop validating prop types here and only use the element\n    // validation.\n    var componentName = this.getName();\n    for (var propName in propTypes) {\n      if (propTypes.hasOwnProperty(propName)) {\n        var error;\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          !(typeof propTypes[propName] === 'function') ? \"development\" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;\n          error = propTypes[propName](props, propName, componentName, location);\n        } catch (ex) {\n          error = ex;\n        }\n        if (error instanceof Error) {\n          // We may want to extend this logic for similar errors in\n          // top-level render calls, so I'm abstracting it away into\n          // a function to minimize refactoring in the future\n          var addendum = getDeclarationErrorAddendum(this);\n\n          if (location === ReactPropTypeLocations.prop) {\n            // Preface gives us something to blacklist in warning module\n            \"development\" !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : void 0;\n          } else {\n            \"development\" !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : void 0;\n          }\n        }\n      }\n    }\n  },\n\n  receiveComponent: function (nextElement, transaction, nextContext) {\n    var prevElement = this._currentElement;\n    var prevContext = this._context;\n\n    this._pendingElement = null;\n\n    this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);\n  },\n\n  /**\n   * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`\n   * is set, update the component.\n   *\n   * @param {ReactReconcileTransaction} transaction\n   * @internal\n   */\n  performUpdateIfNecessary: function (transaction) {\n    if (this._pendingElement != null) {\n      ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);\n    } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {\n      this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);\n    } else {\n      this._updateBatchNumber = null;\n    }\n  },\n\n  /**\n   * Perform an update to a mounted component. The componentWillReceiveProps and\n   * shouldComponentUpdate methods are called, then (assuming the update isn't\n   * skipped) the remaining update lifecycle methods are called and the DOM\n   * representation is updated.\n   *\n   * By default, this implements React's rendering and reconciliation algorithm.\n   * Sophisticated clients may wish to override this.\n   *\n   * @param {ReactReconcileTransaction} transaction\n   * @param {ReactElement} prevParentElement\n   * @param {ReactElement} nextParentElement\n   * @internal\n   * @overridable\n   */\n  updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {\n    var inst = this._instance;\n    var willReceive = false;\n    var nextContext;\n    var nextProps;\n\n    // Determine if the context has changed or not\n    if (this._context === nextUnmaskedContext) {\n      nextContext = inst.context;\n    } else {\n      nextContext = this._processContext(nextUnmaskedContext);\n      willReceive = true;\n    }\n\n    // Distinguish between a props update versus a simple state update\n    if (prevParentElement === nextParentElement) {\n      // Skip checking prop types again -- we don't read inst.props to avoid\n      // warning for DOM component props in this upgrade\n      nextProps = nextParentElement.props;\n    } else {\n      nextProps = this._processProps(nextParentElement.props);\n      willReceive = true;\n    }\n\n    // An update here will schedule an update but immediately set\n    // _pendingStateQueue which will ensure that any state updates gets\n    // immediately reconciled instead of waiting for the next batch.\n    if (willReceive && inst.componentWillReceiveProps) {\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');\n        }\n      }\n      inst.componentWillReceiveProps(nextProps, nextContext);\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');\n        }\n      }\n    }\n\n    var nextState = this._processPendingState(nextProps, nextContext);\n    var shouldUpdate = true;\n\n    if (!this._pendingForceUpdate && inst.shouldComponentUpdate) {\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');\n        }\n      }\n      shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');\n        }\n      }\n    }\n\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;\n    }\n\n    this._updateBatchNumber = null;\n    if (shouldUpdate) {\n      this._pendingForceUpdate = false;\n      // Will set `this.props`, `this.state` and `this.context`.\n      this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);\n    } else {\n      // If it's determined that a component should not update, we still want\n      // to set props and state but we shortcut the rest of the update.\n      this._currentElement = nextParentElement;\n      this._context = nextUnmaskedContext;\n      inst.props = nextProps;\n      inst.state = nextState;\n      inst.context = nextContext;\n    }\n  },\n\n  _processPendingState: function (props, context) {\n    var inst = this._instance;\n    var queue = this._pendingStateQueue;\n    var replace = this._pendingReplaceState;\n    this._pendingReplaceState = false;\n    this._pendingStateQueue = null;\n\n    if (!queue) {\n      return inst.state;\n    }\n\n    if (replace && queue.length === 1) {\n      return queue[0];\n    }\n\n    var nextState = _assign({}, replace ? queue[0] : inst.state);\n    for (var i = replace ? 1 : 0; i < queue.length; i++) {\n      var partial = queue[i];\n      _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);\n    }\n\n    return nextState;\n  },\n\n  /**\n   * Merges new props and state, notifies delegate methods of update and\n   * performs update.\n   *\n   * @param {ReactElement} nextElement Next element\n   * @param {object} nextProps Next public object to set as properties.\n   * @param {?object} nextState Next object to set as state.\n   * @param {?object} nextContext Next public object to set as context.\n   * @param {ReactReconcileTransaction} transaction\n   * @param {?object} unmaskedContext\n   * @private\n   */\n  _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {\n    var inst = this._instance;\n\n    var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);\n    var prevProps;\n    var prevState;\n    var prevContext;\n    if (hasComponentDidUpdate) {\n      prevProps = inst.props;\n      prevState = inst.state;\n      prevContext = inst.context;\n    }\n\n    if (inst.componentWillUpdate) {\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');\n        }\n      }\n      inst.componentWillUpdate(nextProps, nextState, nextContext);\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');\n        }\n      }\n    }\n\n    this._currentElement = nextElement;\n    this._context = unmaskedContext;\n    inst.props = nextProps;\n    inst.state = nextState;\n    inst.context = nextContext;\n\n    this._updateRenderedComponent(transaction, unmaskedContext);\n\n    if (hasComponentDidUpdate) {\n      if (\"development\" !== 'production') {\n        transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);\n      } else {\n        transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);\n      }\n    }\n  },\n\n  /**\n   * Call the component's `render` method and update the DOM accordingly.\n   *\n   * @param {ReactReconcileTransaction} transaction\n   * @internal\n   */\n  _updateRenderedComponent: function (transaction, context) {\n    var prevComponentInstance = this._renderedComponent;\n    var prevRenderedElement = prevComponentInstance._currentElement;\n    var nextRenderedElement = this._renderValidatedComponent();\n    if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {\n      ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));\n    } else {\n      var oldNativeNode = ReactReconciler.getNativeNode(prevComponentInstance);\n      ReactReconciler.unmountComponent(prevComponentInstance, false);\n\n      this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement);\n      this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);\n\n      var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context));\n\n      if (\"development\" !== 'production') {\n        if (this._debugID !== 0) {\n          ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);\n        }\n      }\n\n      this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance);\n    }\n  },\n\n  /**\n   * Overridden in shallow rendering.\n   *\n   * @protected\n   */\n  _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) {\n    ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance);\n  },\n\n  /**\n   * @protected\n   */\n  _renderValidatedComponentWithoutOwnerOrContext: function () {\n    var inst = this._instance;\n\n    if (\"development\" !== 'production') {\n      if (this._debugID !== 0) {\n        ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');\n      }\n    }\n    var renderedComponent = inst.render();\n    if (\"development\" !== 'production') {\n      if (this._debugID !== 0) {\n        ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');\n      }\n    }\n\n    if (\"development\" !== 'production') {\n      // We allow auto-mocks to proceed as if they're returning null.\n      if (renderedComponent === undefined && inst.render._isMockFunction) {\n        // This is probably bad practice. Consider warning here and\n        // deprecating this convenience.\n        renderedComponent = null;\n      }\n    }\n\n    return renderedComponent;\n  },\n\n  /**\n   * @private\n   */\n  _renderValidatedComponent: function () {\n    var renderedComponent;\n    ReactCurrentOwner.current = this;\n    try {\n      renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();\n    } finally {\n      ReactCurrentOwner.current = null;\n    }\n    !(\n    // TODO: An `isValidNode` function would probably be more appropriate\n    renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? \"development\" !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;\n\n    return renderedComponent;\n  },\n\n  /**\n   * Lazily allocates the refs object and stores `component` as `ref`.\n   *\n   * @param {string} ref Reference name.\n   * @param {component} component Component to store as `ref`.\n   * @final\n   * @private\n   */\n  attachRef: function (ref, component) {\n    var inst = this.getPublicInstance();\n    !(inst != null) ? \"development\" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : void 0;\n    var publicComponentInstance = component.getPublicInstance();\n    if (\"development\" !== 'production') {\n      var componentName = component && component.getName ? component.getName() : 'a component';\n      \"development\" !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref \"%s\" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;\n    }\n    var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;\n    refs[ref] = publicComponentInstance;\n  },\n\n  /**\n   * Detaches a reference name.\n   *\n   * @param {string} ref Name to dereference.\n   * @final\n   * @private\n   */\n  detachRef: function (ref) {\n    var refs = this.getPublicInstance().refs;\n    delete refs[ref];\n  },\n\n  /**\n   * Get a text description of the component that can be used to identify it\n   * in error messages.\n   * @return {string} The name or null.\n   * @internal\n   */\n  getName: function () {\n    var type = this._currentElement.type;\n    var constructor = this._instance && this._instance.constructor;\n    return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;\n  },\n\n  /**\n   * Get the publicly accessible representation of this component - i.e. what\n   * is exposed by refs and returned by render. Can be null for stateless\n   * components.\n   *\n   * @return {ReactComponent} the public component instance.\n   * @internal\n   */\n  getPublicInstance: function () {\n    var inst = this._instance;\n    if (inst instanceof StatelessComponent) {\n      return null;\n    }\n    return inst;\n  },\n\n  // Stub\n  _instantiateReactComponent: null\n\n};\n\nvar ReactCompositeComponent = {\n\n  Mixin: ReactCompositeComponentMixin\n\n};\n\nmodule.exports = ReactCompositeComponent;\n},{\"139\":139,\"150\":150,\"157\":157,\"167\":167,\"168\":168,\"33\":33,\"36\":36,\"61\":61,\"64\":64,\"70\":70,\"71\":71,\"79\":79,\"82\":82,\"83\":83,\"86\":86,\"92\":92}],36:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactCurrentOwner\n */\n\n'use strict';\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\n\nvar ReactCurrentOwner = {\n\n  /**\n   * @internal\n   * @type {ReactComponent}\n   */\n  current: null\n\n};\n\nmodule.exports = ReactCurrentOwner;\n},{}],37:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOM\n */\n\n/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/\n\n'use strict';\n\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactDefaultInjection = _dereq_(60);\nvar ReactMount = _dereq_(74);\nvar ReactReconciler = _dereq_(86);\nvar ReactUpdates = _dereq_(93);\nvar ReactVersion = _dereq_(94);\n\nvar findDOMNode = _dereq_(119);\nvar getNativeComponentFromComposite = _dereq_(127);\nvar renderSubtreeIntoContainer = _dereq_(136);\nvar warning = _dereq_(167);\n\nReactDefaultInjection.inject();\n\nvar React = {\n  findDOMNode: findDOMNode,\n  render: ReactMount.render,\n  unmountComponentAtNode: ReactMount.unmountComponentAtNode,\n  version: ReactVersion,\n\n  /* eslint-disable camelcase */\n  unstable_batchedUpdates: ReactUpdates.batchedUpdates,\n  unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer\n};\n\n// Inject the runtime into a devtools global hook regardless of browser.\n// Allows for debugging when the hook is injected on the page.\n/* eslint-enable camelcase */\nif (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {\n  __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({\n    ComponentTree: {\n      getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,\n      getNodeFromInstance: function (inst) {\n        // inst is an internal instance (but could be a composite)\n        if (inst._renderedComponent) {\n          inst = getNativeComponentFromComposite(inst);\n        }\n        if (inst) {\n          return ReactDOMComponentTree.getNodeFromInstance(inst);\n        } else {\n          return null;\n        }\n      }\n    },\n    Mount: ReactMount,\n    Reconciler: ReactReconciler\n  });\n}\n\nif (\"development\" !== 'production') {\n  var ExecutionEnvironment = _dereq_(143);\n  if (ExecutionEnvironment.canUseDOM && window.top === window.self) {\n\n    // First check if devtools is not installed\n    if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\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        // Firefox does not have the issue with devtools loaded over file://\n        var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;\n        console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');\n      }\n    }\n\n    var testFunc = function testFn() {};\n    \"development\" !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;\n\n    // If we're in IE8, check to see if we are in compatibility mode and provide\n    // information on preventing compatibility mode\n    var ieCompatibilityMode = document.documentMode && document.documentMode < 8;\n\n    \"development\" !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />') : void 0;\n\n    var expectedFeatures = [\n    // shims\n    Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];\n\n    for (var i = 0; i < expectedFeatures.length; i++) {\n      if (!expectedFeatures[i]) {\n        \"development\" !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;\n        break;\n      }\n    }\n  }\n}\n\nmodule.exports = React;\n},{\"119\":119,\"127\":127,\"136\":136,\"143\":143,\"167\":167,\"41\":41,\"60\":60,\"74\":74,\"86\":86,\"93\":93,\"94\":94}],38:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMButton\n */\n\n'use strict';\n\nvar DisabledInputUtils = _dereq_(14);\n\n/**\n * Implements a <button> native component that does not receive mouse events\n * when `disabled` is set.\n */\nvar ReactDOMButton = {\n  getNativeProps: DisabledInputUtils.getNativeProps\n};\n\nmodule.exports = ReactDOMButton;\n},{\"14\":14}],39:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMComponent\n */\n\n/* global hasOwnProperty:true */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar AutoFocusUtils = _dereq_(1);\nvar CSSPropertyOperations = _dereq_(4);\nvar DOMLazyTree = _dereq_(8);\nvar DOMNamespaces = _dereq_(9);\nvar DOMProperty = _dereq_(10);\nvar DOMPropertyOperations = _dereq_(11);\nvar EventConstants = _dereq_(16);\nvar EventPluginHub = _dereq_(17);\nvar EventPluginRegistry = _dereq_(18);\nvar ReactBrowserEventEmitter = _dereq_(27);\nvar ReactComponentBrowserEnvironment = _dereq_(32);\nvar ReactDOMButton = _dereq_(38);\nvar ReactDOMComponentFlags = _dereq_(40);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactDOMInput = _dereq_(48);\nvar ReactDOMOption = _dereq_(50);\nvar ReactDOMSelect = _dereq_(51);\nvar ReactDOMTextarea = _dereq_(55);\nvar ReactInstrumentation = _dereq_(71);\nvar ReactMultiChild = _dereq_(75);\nvar ReactServerRenderingTransaction = _dereq_(90);\n\nvar emptyFunction = _dereq_(149);\nvar escapeTextContentForBrowser = _dereq_(118);\nvar invariant = _dereq_(157);\nvar isEventSupported = _dereq_(132);\nvar keyOf = _dereq_(161);\nvar shallowEqual = _dereq_(166);\nvar validateDOMNesting = _dereq_(141);\nvar warning = _dereq_(167);\n\nvar Flags = ReactDOMComponentFlags;\nvar deleteListener = EventPluginHub.deleteListener;\nvar getNode = ReactDOMComponentTree.getNodeFromInstance;\nvar listenTo = ReactBrowserEventEmitter.listenTo;\nvar registrationNameModules = EventPluginRegistry.registrationNameModules;\n\n// For quickly matching children type, to test if can be treated as content.\nvar CONTENT_TYPES = { 'string': true, 'number': true };\n\nvar STYLE = keyOf({ style: null });\nvar HTML = keyOf({ __html: null });\nvar RESERVED_PROPS = {\n  children: null,\n  dangerouslySetInnerHTML: null,\n  suppressContentEditableWarning: null\n};\n\n// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).\nvar DOC_FRAGMENT_TYPE = 11;\n\nfunction getDeclarationErrorAddendum(internalInstance) {\n  if (internalInstance) {\n    var owner = internalInstance._currentElement._owner || null;\n    if (owner) {\n      var name = owner.getName();\n      if (name) {\n        return ' This DOM node was rendered by `' + name + '`.';\n      }\n    }\n  }\n  return '';\n}\n\nfunction friendlyStringify(obj) {\n  if (typeof obj === 'object') {\n    if (Array.isArray(obj)) {\n      return '[' + obj.map(friendlyStringify).join(', ') + ']';\n    } else {\n      var pairs = [];\n      for (var key in obj) {\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\n          var keyEscaped = /^[a-z$_][\\w$_]*$/i.test(key) ? key : JSON.stringify(key);\n          pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));\n        }\n      }\n      return '{' + pairs.join(', ') + '}';\n    }\n  } else if (typeof obj === 'string') {\n    return JSON.stringify(obj);\n  } else if (typeof obj === 'function') {\n    return '[function object]';\n  }\n  // Differs from JSON.stringify in that undefined because undefined and that\n  // inf and nan don't become null\n  return String(obj);\n}\n\nvar styleMutationWarning = {};\n\nfunction checkAndWarnForMutatedStyle(style1, style2, component) {\n  if (style1 == null || style2 == null) {\n    return;\n  }\n  if (shallowEqual(style1, style2)) {\n    return;\n  }\n\n  var componentName = component._tag;\n  var owner = component._currentElement._owner;\n  var ownerName;\n  if (owner) {\n    ownerName = owner.getName();\n  }\n\n  var hash = ownerName + '|' + componentName;\n\n  if (styleMutationWarning.hasOwnProperty(hash)) {\n    return;\n  }\n\n  styleMutationWarning[hash] = true;\n\n  \"development\" !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;\n}\n\n/**\n * @param {object} component\n * @param {?object} props\n */\nfunction assertValidProps(component, props) {\n  if (!props) {\n    return;\n  }\n  // Note the use of `==` which checks for null or undefined.\n  if (voidElementTags[component._tag]) {\n    !(props.children == null && props.dangerouslySetInnerHTML == null) ? \"development\" !== 'production' ? invariant(false, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : invariant(false) : void 0;\n  }\n  if (props.dangerouslySetInnerHTML != null) {\n    !(props.children == null) ? \"development\" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : void 0;\n    !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? \"development\" !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : void 0;\n  }\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;\n    \"development\" !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, '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.') : void 0;\n    \"development\" !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, '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.') : void 0;\n  }\n  !(props.style == null || typeof props.style === 'object') ? \"development\" !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \\'em\\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : void 0;\n}\n\nfunction enqueuePutListener(inst, registrationName, listener, transaction) {\n  if (transaction instanceof ReactServerRenderingTransaction) {\n    return;\n  }\n  if (\"development\" !== 'production') {\n    // IE8 has no API for event capturing and the `onScroll` event doesn't\n    // bubble.\n    \"development\" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\\'t support the `onScroll` event') : void 0;\n  }\n  var containerInfo = inst._nativeContainerInfo;\n  var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;\n  var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;\n  listenTo(registrationName, doc);\n  transaction.getReactMountReady().enqueue(putListener, {\n    inst: inst,\n    registrationName: registrationName,\n    listener: listener\n  });\n}\n\nfunction putListener() {\n  var listenerToPut = this;\n  EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);\n}\n\nfunction optionPostMount() {\n  var inst = this;\n  ReactDOMOption.postMountWrapper(inst);\n}\n\nvar setContentChildForInstrumentation = emptyFunction;\nif (\"development\" !== 'production') {\n  setContentChildForInstrumentation = function (contentToUse) {\n    var debugID = this._debugID;\n    var contentDebugID = debugID + '#text';\n    this._contentDebugID = contentDebugID;\n    ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');\n    ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse);\n    ReactInstrumentation.debugTool.onMountComponent(contentDebugID);\n    ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);\n  };\n}\n\n// There are so many media events, it makes sense to just\n// maintain a list rather than create a `trapBubbledEvent` for each\nvar mediaEvents = {\n  topAbort: 'abort',\n  topCanPlay: 'canplay',\n  topCanPlayThrough: 'canplaythrough',\n  topDurationChange: 'durationchange',\n  topEmptied: 'emptied',\n  topEncrypted: 'encrypted',\n  topEnded: 'ended',\n  topError: 'error',\n  topLoadedData: 'loadeddata',\n  topLoadedMetadata: 'loadedmetadata',\n  topLoadStart: 'loadstart',\n  topPause: 'pause',\n  topPlay: 'play',\n  topPlaying: 'playing',\n  topProgress: 'progress',\n  topRateChange: 'ratechange',\n  topSeeked: 'seeked',\n  topSeeking: 'seeking',\n  topStalled: 'stalled',\n  topSuspend: 'suspend',\n  topTimeUpdate: 'timeupdate',\n  topVolumeChange: 'volumechange',\n  topWaiting: 'waiting'\n};\n\nfunction trapBubbledEventsLocal() {\n  var inst = this;\n  // If a component renders to null or if another component fatals and causes\n  // the state of the tree to be corrupted, `node` here can be null.\n  !inst._rootNodeID ? \"development\" !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : void 0;\n  var node = getNode(inst);\n  !node ? \"development\" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : void 0;\n\n  switch (inst._tag) {\n    case 'iframe':\n    case 'object':\n      inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];\n      break;\n    case 'video':\n    case 'audio':\n\n      inst._wrapperState.listeners = [];\n      // Create listener for each media event\n      for (var event in mediaEvents) {\n        if (mediaEvents.hasOwnProperty(event)) {\n          inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));\n        }\n      }\n\n      break;\n    case 'img':\n      inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];\n      break;\n    case 'form':\n      inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];\n      break;\n    case 'input':\n    case 'select':\n    case 'textarea':\n      inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];\n      break;\n  }\n}\n\nfunction postUpdateSelectWrapper() {\n  ReactDOMSelect.postUpdateWrapper(this);\n}\n\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\n\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\n};\n\n// NOTE: menuitem's close tag should be omitted, but that causes problems.\nvar newlineEatingTags = {\n  'listing': true,\n  'pre': true,\n  'textarea': true\n};\n\n// For HTML, certain tags cannot have children. This has the same purpose as\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = _assign({\n  'menuitem': true\n}, omittedCloseTags);\n\n// We accept any tag to be rendered but since this gets injected into arbitrary\n// HTML, we want to make sure that it's a safe tag.\n// http://www.w3.org/TR/REC-xml/#NT-Name\n\nvar VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\\.\\-\\d]*$/; // Simplified subset\nvar validatedTagCache = {};\nvar hasOwnProperty = {}.hasOwnProperty;\n\nfunction validateDangerousTag(tag) {\n  if (!hasOwnProperty.call(validatedTagCache, tag)) {\n    !VALID_TAG_REGEX.test(tag) ? \"development\" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : void 0;\n    validatedTagCache[tag] = true;\n  }\n}\n\nfunction isCustomComponent(tagName, props) {\n  return tagName.indexOf('-') >= 0 || props.is != null;\n}\n\nvar globalIdCounter = 1;\n\n/**\n * Creates a new React class that is idempotent and capable of containing other\n * React components. It accepts event listeners and DOM properties that are\n * valid according to `DOMProperty`.\n *\n *  - Event listeners: `onClick`, `onMouseDown`, etc.\n *  - DOM properties: `className`, `name`, `title`, etc.\n *\n * The `style` property functions differently from the DOM API. It accepts an\n * object mapping of style properties to values.\n *\n * @constructor ReactDOMComponent\n * @extends ReactMultiChild\n */\nfunction ReactDOMComponent(element) {\n  var tag = element.type;\n  validateDangerousTag(tag);\n  this._currentElement = element;\n  this._tag = tag.toLowerCase();\n  this._namespaceURI = null;\n  this._renderedChildren = null;\n  this._previousStyle = null;\n  this._previousStyleCopy = null;\n  this._nativeNode = null;\n  this._nativeParent = null;\n  this._rootNodeID = null;\n  this._domID = null;\n  this._nativeContainerInfo = null;\n  this._wrapperState = null;\n  this._topLevelWrapper = null;\n  this._flags = 0;\n  if (\"development\" !== 'production') {\n    this._ancestorInfo = null;\n    this._contentDebugID = null;\n  }\n}\n\nReactDOMComponent.displayName = 'ReactDOMComponent';\n\nReactDOMComponent.Mixin = {\n\n  /**\n   * Generates root tag markup then recurses. This method has side effects and\n   * is not idempotent.\n   *\n   * @internal\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @param {?ReactDOMComponent} the containing DOM component instance\n   * @param {?object} info about the native container\n   * @param {object} context\n   * @return {string} The computed markup.\n   */\n  mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {\n    this._rootNodeID = globalIdCounter++;\n    this._domID = nativeContainerInfo._idCounter++;\n    this._nativeParent = nativeParent;\n    this._nativeContainerInfo = nativeContainerInfo;\n\n    var props = this._currentElement.props;\n\n    switch (this._tag) {\n      case 'iframe':\n      case 'object':\n      case 'img':\n      case 'form':\n      case 'video':\n      case 'audio':\n        this._wrapperState = {\n          listeners: null\n        };\n        transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);\n        break;\n      case 'button':\n        props = ReactDOMButton.getNativeProps(this, props, nativeParent);\n        break;\n      case 'input':\n        ReactDOMInput.mountWrapper(this, props, nativeParent);\n        props = ReactDOMInput.getNativeProps(this, props);\n        transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);\n        break;\n      case 'option':\n        ReactDOMOption.mountWrapper(this, props, nativeParent);\n        props = ReactDOMOption.getNativeProps(this, props);\n        break;\n      case 'select':\n        ReactDOMSelect.mountWrapper(this, props, nativeParent);\n        props = ReactDOMSelect.getNativeProps(this, props);\n        transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);\n        break;\n      case 'textarea':\n        ReactDOMTextarea.mountWrapper(this, props, nativeParent);\n        props = ReactDOMTextarea.getNativeProps(this, props);\n        transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);\n        break;\n    }\n\n    assertValidProps(this, props);\n\n    // We create tags in the namespace of their parent container, except HTML\n    // tags get no namespace.\n    var namespaceURI;\n    var parentTag;\n    if (nativeParent != null) {\n      namespaceURI = nativeParent._namespaceURI;\n      parentTag = nativeParent._tag;\n    } else if (nativeContainerInfo._tag) {\n      namespaceURI = nativeContainerInfo._namespaceURI;\n      parentTag = nativeContainerInfo._tag;\n    }\n    if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {\n      namespaceURI = DOMNamespaces.html;\n    }\n    if (namespaceURI === DOMNamespaces.html) {\n      if (this._tag === 'svg') {\n        namespaceURI = DOMNamespaces.svg;\n      } else if (this._tag === 'math') {\n        namespaceURI = DOMNamespaces.mathml;\n      }\n    }\n    this._namespaceURI = namespaceURI;\n\n    if (\"development\" !== 'production') {\n      var parentInfo;\n      if (nativeParent != null) {\n        parentInfo = nativeParent._ancestorInfo;\n      } else if (nativeContainerInfo._tag) {\n        parentInfo = nativeContainerInfo._ancestorInfo;\n      }\n      if (parentInfo) {\n        // parentInfo should always be present except for the top-level\n        // component when server rendering\n        validateDOMNesting(this._tag, this, parentInfo);\n      }\n      this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);\n    }\n\n    var mountImage;\n    if (transaction.useCreateElement) {\n      var ownerDocument = nativeContainerInfo._ownerDocument;\n      var el;\n      if (namespaceURI === DOMNamespaces.html) {\n        if (this._tag === '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          var type = this._currentElement.type;\n          div.innerHTML = '<' + type + '></' + type + '>';\n          el = div.removeChild(div.firstChild);\n        } else {\n          el = ownerDocument.createElement(this._currentElement.type, props.is || null);\n        }\n      } else {\n        el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);\n      }\n      ReactDOMComponentTree.precacheNode(this, el);\n      this._flags |= Flags.hasCachedChildNodes;\n      if (!this._nativeParent) {\n        DOMPropertyOperations.setAttributeForRoot(el);\n      }\n      this._updateDOMProperties(null, props, transaction);\n      var lazyTree = DOMLazyTree(el);\n      this._createInitialChildren(transaction, props, context, lazyTree);\n      mountImage = lazyTree;\n    } else {\n      var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);\n      var tagContent = this._createContentMarkup(transaction, props, context);\n      if (!tagContent && omittedCloseTags[this._tag]) {\n        mountImage = tagOpen + '/>';\n      } else {\n        mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';\n      }\n    }\n\n    switch (this._tag) {\n      case 'button':\n      case 'input':\n      case 'select':\n      case 'textarea':\n        if (props.autoFocus) {\n          transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);\n        }\n        break;\n      case 'option':\n        transaction.getReactMountReady().enqueue(optionPostMount, this);\n    }\n\n    return mountImage;\n  },\n\n  /**\n   * Creates markup for the open tag and all attributes.\n   *\n   * This method has side effects because events get registered.\n   *\n   * Iterating over object properties is faster than iterating over arrays.\n   * @see http://jsperf.com/obj-vs-arr-iteration\n   *\n   * @private\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @param {object} props\n   * @return {string} Markup of opening tag.\n   */\n  _createOpenTagMarkupAndPutListeners: function (transaction, props) {\n    var ret = '<' + this._currentElement.type;\n\n    for (var propKey in props) {\n      if (!props.hasOwnProperty(propKey)) {\n        continue;\n      }\n      var propValue = props[propKey];\n      if (propValue == null) {\n        continue;\n      }\n      if (registrationNameModules.hasOwnProperty(propKey)) {\n        if (propValue) {\n          enqueuePutListener(this, propKey, propValue, transaction);\n        }\n      } else {\n        if (propKey === STYLE) {\n          if (propValue) {\n            if (\"development\" !== 'production') {\n              // See `_updateDOMProperties`. style block\n              this._previousStyle = propValue;\n            }\n            propValue = this._previousStyleCopy = _assign({}, props.style);\n          }\n          propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);\n        }\n        var markup = null;\n        if (this._tag != null && isCustomComponent(this._tag, props)) {\n          if (!RESERVED_PROPS.hasOwnProperty(propKey)) {\n            markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);\n          }\n        } else {\n          markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);\n        }\n        if (markup) {\n          ret += ' ' + markup;\n        }\n      }\n    }\n\n    // For static pages, no need to put React ID and checksum. Saves lots of\n    // bytes.\n    if (transaction.renderToStaticMarkup) {\n      return ret;\n    }\n\n    if (!this._nativeParent) {\n      ret += ' ' + DOMPropertyOperations.createMarkupForRoot();\n    }\n    ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);\n    return ret;\n  },\n\n  /**\n   * Creates markup for the content between the tags.\n   *\n   * @private\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @param {object} props\n   * @param {object} context\n   * @return {string} Content markup.\n   */\n  _createContentMarkup: function (transaction, props, context) {\n    var ret = '';\n\n    // Intentional use of != to avoid catching zero/false.\n    var innerHTML = props.dangerouslySetInnerHTML;\n    if (innerHTML != null) {\n      if (innerHTML.__html != null) {\n        ret = innerHTML.__html;\n      }\n    } else {\n      var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;\n      var childrenToUse = contentToUse != null ? null : props.children;\n      if (contentToUse != null) {\n        // TODO: Validate that text is allowed as a child of this node\n        ret = escapeTextContentForBrowser(contentToUse);\n        if (\"development\" !== 'production') {\n          setContentChildForInstrumentation.call(this, contentToUse);\n        }\n      } else if (childrenToUse != null) {\n        var mountImages = this.mountChildren(childrenToUse, transaction, context);\n        ret = mountImages.join('');\n      }\n    }\n    if (newlineEatingTags[this._tag] && ret.charAt(0) === '\\n') {\n      // text/html ignores the first character in these tags if it's a newline\n      // Prefer to break application/xml over text/html (for now) by adding\n      // a newline specifically to get eaten by the parser. (Alternately for\n      // textareas, replacing \"^\\n\" with \"\\r\\n\" doesn't get eaten, and the first\n      // \\r is normalized out by HTMLTextAreaElement#value.)\n      // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>\n      // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>\n      // See: <http://www.w3.org/TR/html5/syntax.html#newlines>\n      // See: Parsing of \"textarea\" \"listing\" and \"pre\" elements\n      //  from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>\n      return '\\n' + ret;\n    } else {\n      return ret;\n    }\n  },\n\n  _createInitialChildren: function (transaction, props, context, lazyTree) {\n    // Intentional use of != to avoid catching zero/false.\n    var innerHTML = props.dangerouslySetInnerHTML;\n    if (innerHTML != null) {\n      if (innerHTML.__html != null) {\n        DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);\n      }\n    } else {\n      var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;\n      var childrenToUse = contentToUse != null ? null : props.children;\n      if (contentToUse != null) {\n        // TODO: Validate that text is allowed as a child of this node\n        if (\"development\" !== 'production') {\n          setContentChildForInstrumentation.call(this, contentToUse);\n        }\n        DOMLazyTree.queueText(lazyTree, contentToUse);\n      } else if (childrenToUse != null) {\n        var mountImages = this.mountChildren(childrenToUse, transaction, context);\n        for (var i = 0; i < mountImages.length; i++) {\n          DOMLazyTree.queueChild(lazyTree, mountImages[i]);\n        }\n      }\n    }\n  },\n\n  /**\n   * Receives a next element and updates the component.\n   *\n   * @internal\n   * @param {ReactElement} nextElement\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @param {object} context\n   */\n  receiveComponent: function (nextElement, transaction, context) {\n    var prevElement = this._currentElement;\n    this._currentElement = nextElement;\n    this.updateComponent(transaction, prevElement, nextElement, context);\n  },\n\n  /**\n   * Updates a native DOM component after it has already been allocated and\n   * attached to the DOM. Reconciles the root DOM node, then recurses.\n   *\n   * @param {ReactReconcileTransaction} transaction\n   * @param {ReactElement} prevElement\n   * @param {ReactElement} nextElement\n   * @internal\n   * @overridable\n   */\n  updateComponent: function (transaction, prevElement, nextElement, context) {\n    var lastProps = prevElement.props;\n    var nextProps = this._currentElement.props;\n\n    switch (this._tag) {\n      case 'button':\n        lastProps = ReactDOMButton.getNativeProps(this, lastProps);\n        nextProps = ReactDOMButton.getNativeProps(this, nextProps);\n        break;\n      case 'input':\n        ReactDOMInput.updateWrapper(this);\n        lastProps = ReactDOMInput.getNativeProps(this, lastProps);\n        nextProps = ReactDOMInput.getNativeProps(this, nextProps);\n        break;\n      case 'option':\n        lastProps = ReactDOMOption.getNativeProps(this, lastProps);\n        nextProps = ReactDOMOption.getNativeProps(this, nextProps);\n        break;\n      case 'select':\n        lastProps = ReactDOMSelect.getNativeProps(this, lastProps);\n        nextProps = ReactDOMSelect.getNativeProps(this, nextProps);\n        break;\n      case 'textarea':\n        ReactDOMTextarea.updateWrapper(this);\n        lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);\n        nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);\n        break;\n    }\n\n    assertValidProps(this, nextProps);\n    this._updateDOMProperties(lastProps, nextProps, transaction);\n    this._updateDOMChildren(lastProps, nextProps, transaction, context);\n\n    if (this._tag === 'select') {\n      // <select> value update needs to occur after <option> children\n      // reconciliation\n      transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);\n    }\n  },\n\n  /**\n   * Reconciles the properties by detecting differences in property values and\n   * updating the DOM as necessary. This function is probably the single most\n   * critical path for performance optimization.\n   *\n   * TODO: Benchmark whether checking for changed values in memory actually\n   *       improves performance (especially statically positioned elements).\n   * TODO: Benchmark the effects of putting this at the top since 99% of props\n   *       do not change for a given reconciliation.\n   * TODO: Benchmark areas that can be improved with caching.\n   *\n   * @private\n   * @param {object} lastProps\n   * @param {object} nextProps\n   * @param {?DOMElement} node\n   */\n  _updateDOMProperties: function (lastProps, nextProps, transaction) {\n    var propKey;\n    var styleName;\n    var styleUpdates;\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 = this._previousStyleCopy;\n        for (styleName in lastStyle) {\n          if (lastStyle.hasOwnProperty(styleName)) {\n            styleUpdates = styleUpdates || {};\n            styleUpdates[styleName] = '';\n          }\n        }\n        this._previousStyleCopy = null;\n      } else if (registrationNameModules.hasOwnProperty(propKey)) {\n        if (lastProps[propKey]) {\n          // Only call deleteListener if there was a listener previously or\n          // else willDeleteListener gets called when there wasn't actually a\n          // listener (e.g., onClick={null})\n          deleteListener(this, propKey);\n        }\n      } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {\n        DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);\n      }\n    }\n    for (propKey in nextProps) {\n      var nextProp = nextProps[propKey];\n      var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;\n      if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n        continue;\n      }\n      if (propKey === STYLE) {\n        if (nextProp) {\n          if (\"development\" !== 'production') {\n            checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);\n            this._previousStyle = nextProp;\n          }\n          nextProp = this._previousStyleCopy = _assign({}, nextProp);\n        } else {\n          this._previousStyleCopy = null;\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              styleUpdates = styleUpdates || {};\n              styleUpdates[styleName] = '';\n            }\n          }\n          // Update styles that changed since `lastProp`.\n          for (styleName in nextProp) {\n            if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n              styleUpdates = styleUpdates || {};\n              styleUpdates[styleName] = nextProp[styleName];\n            }\n          }\n        } else {\n          // Relies on `updateStylesByID` not mutating `styleUpdates`.\n          styleUpdates = nextProp;\n        }\n      } else if (registrationNameModules.hasOwnProperty(propKey)) {\n        if (nextProp) {\n          enqueuePutListener(this, propKey, nextProp, transaction);\n        } else if (lastProp) {\n          deleteListener(this, propKey);\n        }\n      } else if (isCustomComponent(this._tag, nextProps)) {\n        if (!RESERVED_PROPS.hasOwnProperty(propKey)) {\n          DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);\n        }\n      } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {\n        var node = getNode(this);\n        // If we're updating to null or undefined, we should remove the property\n        // from the DOM node instead of inadvertently setting to a string. This\n        // brings us in line with the same behavior we have on initial render.\n        if (nextProp != null) {\n          DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);\n        } else {\n          DOMPropertyOperations.deleteValueForProperty(node, propKey);\n        }\n      }\n    }\n    if (styleUpdates) {\n      CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);\n    }\n  },\n\n  /**\n   * Reconciles the children with the various properties that affect the\n   * children content.\n   *\n   * @param {object} lastProps\n   * @param {object} nextProps\n   * @param {ReactReconcileTransaction} transaction\n   * @param {object} context\n   */\n  _updateDOMChildren: function (lastProps, nextProps, transaction, context) {\n    var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;\n    var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;\n\n    var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;\n    var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;\n\n    // Note the use of `!=` which checks for null or undefined.\n    var lastChildren = lastContent != null ? null : lastProps.children;\n    var nextChildren = nextContent != null ? null : nextProps.children;\n\n    // If we're switching from children to content/html or vice versa, remove\n    // the old content\n    var lastHasContentOrHtml = lastContent != null || lastHtml != null;\n    var nextHasContentOrHtml = nextContent != null || nextHtml != null;\n    if (lastChildren != null && nextChildren == null) {\n      this.updateChildren(null, transaction, context);\n    } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {\n      this.updateTextContent('');\n      if (\"development\" !== 'production') {\n        ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);\n      }\n    }\n\n    if (nextContent != null) {\n      if (lastContent !== nextContent) {\n        this.updateTextContent('' + nextContent);\n        if (\"development\" !== 'production') {\n          this._contentDebugID = this._debugID + '#text';\n          setContentChildForInstrumentation.call(this, nextContent);\n        }\n      }\n    } else if (nextHtml != null) {\n      if (lastHtml !== nextHtml) {\n        this.updateMarkup('' + nextHtml);\n      }\n      if (\"development\" !== 'production') {\n        ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);\n      }\n    } else if (nextChildren != null) {\n      if (\"development\" !== 'production') {\n        if (this._contentDebugID) {\n          ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);\n          this._contentDebugID = null;\n        }\n      }\n\n      this.updateChildren(nextChildren, transaction, context);\n    }\n  },\n\n  getNativeNode: function () {\n    return getNode(this);\n  },\n\n  /**\n   * Destroys all event registrations for this instance. Does not remove from\n   * the DOM. That must be done by the parent.\n   *\n   * @internal\n   */\n  unmountComponent: function (safely) {\n    switch (this._tag) {\n      case 'iframe':\n      case 'object':\n      case 'img':\n      case 'form':\n      case 'video':\n      case 'audio':\n        var listeners = this._wrapperState.listeners;\n        if (listeners) {\n          for (var i = 0; i < listeners.length; i++) {\n            listeners[i].remove();\n          }\n        }\n        break;\n      case 'html':\n      case 'head':\n      case 'body':\n        /**\n         * Components like <html> <head> and <body> can't be removed or added\n         * easily in a cross-browser way, however it's valuable to be able to\n         * take advantage of React's reconciliation for styling and <title>\n         * management. So we just document it and throw in dangerous cases.\n         */\n        !false ? \"development\" !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : void 0;\n        break;\n    }\n\n    this.unmountChildren(safely);\n    ReactDOMComponentTree.uncacheNode(this);\n    EventPluginHub.deleteAllListeners(this);\n    ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);\n    this._rootNodeID = null;\n    this._domID = null;\n    this._wrapperState = null;\n\n    if (\"development\" !== 'production') {\n      if (this._contentDebugID) {\n        ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);\n        this._contentDebugID = null;\n      }\n    }\n  },\n\n  getPublicInstance: function () {\n    return getNode(this);\n  }\n\n};\n\n_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);\n\nmodule.exports = ReactDOMComponent;\n},{\"1\":1,\"10\":10,\"11\":11,\"118\":118,\"132\":132,\"141\":141,\"149\":149,\"157\":157,\"16\":16,\"161\":161,\"166\":166,\"167\":167,\"168\":168,\"17\":17,\"18\":18,\"27\":27,\"32\":32,\"38\":38,\"4\":4,\"40\":40,\"41\":41,\"48\":48,\"50\":50,\"51\":51,\"55\":55,\"71\":71,\"75\":75,\"8\":8,\"9\":9,\"90\":90}],40:[function(_dereq_,module,exports){\n/**\n * Copyright 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMComponentFlags\n */\n\n'use strict';\n\nvar ReactDOMComponentFlags = {\n  hasCachedChildNodes: 1 << 0\n};\n\nmodule.exports = ReactDOMComponentFlags;\n},{}],41:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMComponentTree\n */\n\n'use strict';\n\nvar DOMProperty = _dereq_(10);\nvar ReactDOMComponentFlags = _dereq_(40);\n\nvar invariant = _dereq_(157);\n\nvar ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;\nvar Flags = ReactDOMComponentFlags;\n\nvar internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);\n\n/**\n * Drill down (through composites and empty components) until we get a native or\n * native text component.\n *\n * This is pretty polymorphic but unavoidable with the current structure we have\n * for `_renderedChildren`.\n */\nfunction getRenderedNativeOrTextFromComponent(component) {\n  var rendered;\n  while (rendered = component._renderedComponent) {\n    component = rendered;\n  }\n  return component;\n}\n\n/**\n * Populate `_nativeNode` on the rendered native/text component with the given\n * DOM node. The passed `inst` can be a composite.\n */\nfunction precacheNode(inst, node) {\n  var nativeInst = getRenderedNativeOrTextFromComponent(inst);\n  nativeInst._nativeNode = node;\n  node[internalInstanceKey] = nativeInst;\n}\n\nfunction uncacheNode(inst) {\n  var node = inst._nativeNode;\n  if (node) {\n    delete node[internalInstanceKey];\n    inst._nativeNode = null;\n  }\n}\n\n/**\n * Populate `_nativeNode` on each child of `inst`, assuming that the children\n * match up with the DOM (element) children of `node`.\n *\n * We cache entire levels at once to avoid an n^2 problem where we access the\n * children of a node sequentially and have to walk from the start to our target\n * node every time.\n *\n * Since we update `_renderedChildren` and the actual DOM at (slightly)\n * different times, we could race here and see a newer `_renderedChildren` than\n * the DOM nodes we see. To avoid this, ReactMultiChild calls\n * `prepareToManageChildren` before we change `_renderedChildren`, at which\n * time the container's child nodes are always cached (until it unmounts).\n */\nfunction precacheChildNodes(inst, node) {\n  if (inst._flags & Flags.hasCachedChildNodes) {\n    return;\n  }\n  var children = inst._renderedChildren;\n  var childNode = node.firstChild;\n  outer: for (var name in children) {\n    if (!children.hasOwnProperty(name)) {\n      continue;\n    }\n    var childInst = children[name];\n    var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;\n    if (childID == null) {\n      // We're currently unmounting this child in ReactMultiChild; skip it.\n      continue;\n    }\n    // We assume the child nodes are in the same order as the child instances.\n    for (; childNode !== null; childNode = childNode.nextSibling) {\n      if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n        precacheNode(childInst, childNode);\n        continue outer;\n      }\n    }\n    // We reached the end of the DOM children without finding an ID match.\n    !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;\n  }\n  inst._flags |= Flags.hasCachedChildNodes;\n}\n\n/**\n * Given a DOM node, return the closest ReactDOMComponent or\n * ReactDOMTextComponent instance ancestor.\n */\nfunction getClosestInstanceFromNode(node) {\n  if (node[internalInstanceKey]) {\n    return node[internalInstanceKey];\n  }\n\n  // Walk up the tree until we find an ancestor whose instance we have cached.\n  var parents = [];\n  while (!node[internalInstanceKey]) {\n    parents.push(node);\n    if (node.parentNode) {\n      node = node.parentNode;\n    } else {\n      // Top of the tree. This node must not be part of a React tree (or is\n      // unmounted, potentially).\n      return null;\n    }\n  }\n\n  var closest;\n  var inst;\n  for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {\n    closest = inst;\n    if (parents.length) {\n      precacheChildNodes(inst, node);\n    }\n  }\n\n  return closest;\n}\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 = getClosestInstanceFromNode(node);\n  if (inst != null && inst._nativeNode === node) {\n    return inst;\n  } else {\n    return null;\n  }\n}\n\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\nfunction getNodeFromInstance(inst) {\n  // Without this first invariant, passing a non-DOM-component triggers the next\n  // invariant for a missing parent, which is super confusing.\n  !(inst._nativeNode !== undefined) ? \"development\" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;\n\n  if (inst._nativeNode) {\n    return inst._nativeNode;\n  }\n\n  // Walk up the tree until we find an ancestor whose DOM node we have cached.\n  var parents = [];\n  while (!inst._nativeNode) {\n    parents.push(inst);\n    !inst._nativeParent ? \"development\" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : invariant(false) : void 0;\n    inst = inst._nativeParent;\n  }\n\n  // Now parents contains each ancestor that does *not* have a cached native\n  // node, and `inst` is the deepest ancestor that does.\n  for (; parents.length; inst = parents.pop()) {\n    precacheChildNodes(inst, inst._nativeNode);\n  }\n\n  return inst._nativeNode;\n}\n\nvar ReactDOMComponentTree = {\n  getClosestInstanceFromNode: getClosestInstanceFromNode,\n  getInstanceFromNode: getInstanceFromNode,\n  getNodeFromInstance: getNodeFromInstance,\n  precacheChildNodes: precacheChildNodes,\n  precacheNode: precacheNode,\n  uncacheNode: uncacheNode\n};\n\nmodule.exports = ReactDOMComponentTree;\n},{\"10\":10,\"157\":157,\"40\":40}],42:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMContainerInfo\n */\n\n'use strict';\n\nvar validateDOMNesting = _dereq_(141);\n\nvar DOC_NODE_TYPE = 9;\n\nfunction ReactDOMContainerInfo(topLevelWrapper, node) {\n  var info = {\n    _topLevelWrapper: topLevelWrapper,\n    _idCounter: 1,\n    _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,\n    _node: node,\n    _tag: node ? node.nodeName.toLowerCase() : null,\n    _namespaceURI: node ? node.namespaceURI : null\n  };\n  if (\"development\" !== 'production') {\n    info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;\n  }\n  return info;\n}\n\nmodule.exports = ReactDOMContainerInfo;\n},{\"141\":141}],43:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMDebugTool\n */\n\n'use strict';\n\nvar ReactDOMUnknownPropertyDevtool = _dereq_(57);\n\nvar warning = _dereq_(167);\n\nvar eventHandlers = [];\nvar handlerDoesThrowForEvent = {};\n\nfunction emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {\n  if (\"development\" !== 'production') {\n    eventHandlers.forEach(function (handler) {\n      try {\n        if (handler[handlerFunctionName]) {\n          handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);\n        }\n      } catch (e) {\n        \"development\" !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;\n        handlerDoesThrowForEvent[handlerFunctionName] = true;\n      }\n    });\n  }\n}\n\nvar ReactDOMDebugTool = {\n  addDevtool: function (devtool) {\n    eventHandlers.push(devtool);\n  },\n  removeDevtool: function (devtool) {\n    for (var i = 0; i < eventHandlers.length; i++) {\n      if (eventHandlers[i] === devtool) {\n        eventHandlers.splice(i, 1);\n        i--;\n      }\n    }\n  },\n  onCreateMarkupForProperty: function (name, value) {\n    emitEvent('onCreateMarkupForProperty', name, value);\n  },\n  onSetValueForProperty: function (node, name, value) {\n    emitEvent('onSetValueForProperty', node, name, value);\n  },\n  onDeleteValueForProperty: function (node, name) {\n    emitEvent('onDeleteValueForProperty', node, name);\n  }\n};\n\nReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);\n\nmodule.exports = ReactDOMDebugTool;\n},{\"167\":167,\"57\":57}],44:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMEmptyComponent\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar DOMLazyTree = _dereq_(8);\nvar ReactDOMComponentTree = _dereq_(41);\n\nvar ReactDOMEmptyComponent = function (instantiate) {\n  // ReactCompositeComponent uses this:\n  this._currentElement = null;\n  // ReactDOMComponentTree uses these:\n  this._nativeNode = null;\n  this._nativeParent = null;\n  this._nativeContainerInfo = null;\n  this._domID = null;\n};\n_assign(ReactDOMEmptyComponent.prototype, {\n  mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {\n    var domID = nativeContainerInfo._idCounter++;\n    this._domID = domID;\n    this._nativeParent = nativeParent;\n    this._nativeContainerInfo = nativeContainerInfo;\n\n    var nodeValue = ' react-empty: ' + this._domID + ' ';\n    if (transaction.useCreateElement) {\n      var ownerDocument = nativeContainerInfo._ownerDocument;\n      var node = ownerDocument.createComment(nodeValue);\n      ReactDOMComponentTree.precacheNode(this, node);\n      return DOMLazyTree(node);\n    } else {\n      if (transaction.renderToStaticMarkup) {\n        // Normally we'd insert a comment node, but since this is a situation\n        // where React won't take over (static pages), we can simply return\n        // nothing.\n        return '';\n      }\n      return '<!--' + nodeValue + '-->';\n    }\n  },\n  receiveComponent: function () {},\n  getNativeNode: function () {\n    return ReactDOMComponentTree.getNodeFromInstance(this);\n  },\n  unmountComponent: function () {\n    ReactDOMComponentTree.uncacheNode(this);\n  }\n});\n\nmodule.exports = ReactDOMEmptyComponent;\n},{\"168\":168,\"41\":41,\"8\":8}],45:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMFactories\n */\n\n'use strict';\n\nvar ReactElement = _dereq_(61);\nvar ReactElementValidator = _dereq_(62);\n\nvar mapObject = _dereq_(162);\n\n/**\n * Create a factory that creates HTML tag elements.\n *\n * @param {string} tag Tag name (e.g. `div`).\n * @private\n */\nfunction createDOMFactory(tag) {\n  if (\"development\" !== 'production') {\n    return ReactElementValidator.createFactory(tag);\n  }\n  return ReactElement.createFactory(tag);\n}\n\n/**\n * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.\n * This is also accessible via `React.DOM`.\n *\n * @public\n */\nvar ReactDOMFactories = mapObject({\n  a: 'a',\n  abbr: 'abbr',\n  address: 'address',\n  area: 'area',\n  article: 'article',\n  aside: 'aside',\n  audio: 'audio',\n  b: 'b',\n  base: 'base',\n  bdi: 'bdi',\n  bdo: 'bdo',\n  big: 'big',\n  blockquote: 'blockquote',\n  body: 'body',\n  br: 'br',\n  button: 'button',\n  canvas: 'canvas',\n  caption: 'caption',\n  cite: 'cite',\n  code: 'code',\n  col: 'col',\n  colgroup: 'colgroup',\n  data: 'data',\n  datalist: 'datalist',\n  dd: 'dd',\n  del: 'del',\n  details: 'details',\n  dfn: 'dfn',\n  dialog: 'dialog',\n  div: 'div',\n  dl: 'dl',\n  dt: 'dt',\n  em: 'em',\n  embed: 'embed',\n  fieldset: 'fieldset',\n  figcaption: 'figcaption',\n  figure: 'figure',\n  footer: 'footer',\n  form: 'form',\n  h1: 'h1',\n  h2: 'h2',\n  h3: 'h3',\n  h4: 'h4',\n  h5: 'h5',\n  h6: 'h6',\n  head: 'head',\n  header: 'header',\n  hgroup: 'hgroup',\n  hr: 'hr',\n  html: 'html',\n  i: 'i',\n  iframe: 'iframe',\n  img: 'img',\n  input: 'input',\n  ins: 'ins',\n  kbd: 'kbd',\n  keygen: 'keygen',\n  label: 'label',\n  legend: 'legend',\n  li: 'li',\n  link: 'link',\n  main: 'main',\n  map: 'map',\n  mark: 'mark',\n  menu: 'menu',\n  menuitem: 'menuitem',\n  meta: 'meta',\n  meter: 'meter',\n  nav: 'nav',\n  noscript: 'noscript',\n  object: 'object',\n  ol: 'ol',\n  optgroup: 'optgroup',\n  option: 'option',\n  output: 'output',\n  p: 'p',\n  param: 'param',\n  picture: 'picture',\n  pre: 'pre',\n  progress: 'progress',\n  q: 'q',\n  rp: 'rp',\n  rt: 'rt',\n  ruby: 'ruby',\n  s: 's',\n  samp: 'samp',\n  script: 'script',\n  section: 'section',\n  select: 'select',\n  small: 'small',\n  source: 'source',\n  span: 'span',\n  strong: 'strong',\n  style: 'style',\n  sub: 'sub',\n  summary: 'summary',\n  sup: 'sup',\n  table: 'table',\n  tbody: 'tbody',\n  td: 'td',\n  textarea: 'textarea',\n  tfoot: 'tfoot',\n  th: 'th',\n  thead: 'thead',\n  time: 'time',\n  title: 'title',\n  tr: 'tr',\n  track: 'track',\n  u: 'u',\n  ul: 'ul',\n  'var': 'var',\n  video: 'video',\n  wbr: 'wbr',\n\n  // SVG\n  circle: 'circle',\n  clipPath: 'clipPath',\n  defs: 'defs',\n  ellipse: 'ellipse',\n  g: 'g',\n  image: 'image',\n  line: 'line',\n  linearGradient: 'linearGradient',\n  mask: 'mask',\n  path: 'path',\n  pattern: 'pattern',\n  polygon: 'polygon',\n  polyline: 'polyline',\n  radialGradient: 'radialGradient',\n  rect: 'rect',\n  stop: 'stop',\n  svg: 'svg',\n  text: 'text',\n  tspan: 'tspan'\n\n}, createDOMFactory);\n\nmodule.exports = ReactDOMFactories;\n},{\"162\":162,\"61\":61,\"62\":62}],46:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMFeatureFlags\n */\n\n'use strict';\n\nvar ReactDOMFeatureFlags = {\n  useCreateElement: true\n};\n\nmodule.exports = ReactDOMFeatureFlags;\n},{}],47:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMIDOperations\n */\n\n'use strict';\n\nvar DOMChildrenOperations = _dereq_(7);\nvar ReactDOMComponentTree = _dereq_(41);\n\n/**\n * Operations used to process updates to DOM nodes.\n */\nvar ReactDOMIDOperations = {\n\n  /**\n   * Updates a component's children by processing a series of updates.\n   *\n   * @param {array<object>} updates List of update configurations.\n   * @internal\n   */\n  dangerouslyProcessChildrenUpdates: function (parentInst, updates) {\n    var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);\n    DOMChildrenOperations.processUpdates(node, updates);\n  }\n};\n\nmodule.exports = ReactDOMIDOperations;\n},{\"41\":41,\"7\":7}],48:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMInput\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar DisabledInputUtils = _dereq_(14);\nvar DOMPropertyOperations = _dereq_(11);\nvar LinkedValueUtils = _dereq_(24);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactUpdates = _dereq_(93);\n\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\nvar didWarnValueLink = false;\nvar didWarnCheckedLink = false;\nvar didWarnValueNull = false;\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction forceUpdateIfMounted() {\n  if (this._rootNodeID) {\n    // DOM component is still mounted; update\n    ReactDOMInput.updateWrapper(this);\n  }\n}\n\nfunction warnIfValueIsNull(props) {\n  if (props != null && props.value === null && !didWarnValueNull) {\n    \"development\" !== 'production' ? warning(false, '`value` prop on `input` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;\n\n    didWarnValueNull = true;\n  }\n}\n\n/**\n * Implements an <input> native 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 */\nvar ReactDOMInput = {\n  getNativeProps: function (inst, props) {\n    var value = LinkedValueUtils.getValue(props);\n    var checked = LinkedValueUtils.getChecked(props);\n\n    var nativeProps = _assign({\n      // Make sure we set .type before any other properties (setting .value\n      // before .type means .value is lost in IE11 and below)\n      type: undefined\n    }, DisabledInputUtils.getNativeProps(inst, props), {\n      defaultChecked: undefined,\n      defaultValue: undefined,\n      value: value != null ? value : inst._wrapperState.initialValue,\n      checked: checked != null ? checked : inst._wrapperState.initialChecked,\n      onChange: inst._wrapperState.onChange\n    });\n\n    return nativeProps;\n  },\n\n  mountWrapper: function (inst, props) {\n    if (\"development\" !== 'production') {\n      LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);\n\n      var owner = inst._currentElement._owner;\n\n      if (props.valueLink !== undefined && !didWarnValueLink) {\n        \"development\" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;\n        didWarnValueLink = true;\n      }\n      if (props.checkedLink !== undefined && !didWarnCheckedLink) {\n        \"development\" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;\n        didWarnCheckedLink = true;\n      }\n      if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n        \"development\" !== 'production' ? warning(false, '%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', owner && owner.getName() || 'A component', props.type) : void 0;\n        didWarnCheckedDefaultChecked = true;\n      }\n      if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n        \"development\" !== 'production' ? warning(false, '%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', owner && owner.getName() || 'A component', props.type) : void 0;\n        didWarnValueDefaultValue = true;\n      }\n      warnIfValueIsNull(props);\n    }\n\n    var defaultValue = props.defaultValue;\n    inst._wrapperState = {\n      initialChecked: props.defaultChecked || false,\n      initialValue: defaultValue != null ? defaultValue : null,\n      listeners: null,\n      onChange: _handleChange.bind(inst)\n    };\n\n    if (\"development\" !== 'production') {\n      inst._wrapperState.controlled = props.checked !== undefined || props.value !== undefined;\n    }\n  },\n\n  updateWrapper: function (inst) {\n    var props = inst._currentElement.props;\n\n    if (\"development\" !== 'production') {\n      warnIfValueIsNull(props);\n\n      var initialValue = inst._wrapperState.initialChecked || inst._wrapperState.initialValue;\n      var defaultValue = props.defaultChecked || props.defaultValue;\n      var controlled = props.checked !== undefined || props.value !== undefined;\n      var owner = inst._currentElement._owner;\n\n      if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {\n        \"development\" !== 'production' ? warning(false, '%s 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', owner && owner.getName() || 'A component', props.type) : void 0;\n        didWarnUncontrolledToControlled = true;\n      }\n      if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {\n        \"development\" !== 'production' ? warning(false, '%s 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', owner && owner.getName() || 'A component', props.type) : void 0;\n        didWarnControlledToUncontrolled = true;\n      }\n    }\n\n    // TODO: Shouldn't this be getChecked(props)?\n    var checked = props.checked;\n    if (checked != null) {\n      DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);\n    }\n\n    var value = LinkedValueUtils.getValue(props);\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      DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);\n    }\n  }\n};\n\nfunction _handleChange(event) {\n  var props = this._currentElement.props;\n\n  var returnValue = LinkedValueUtils.executeOnChange(props, event);\n\n  // Here we use asap to wait until all updates have propagated, which\n  // is important when using controlled components within layers:\n  // https://github.com/facebook/react/issues/1698\n  ReactUpdates.asap(forceUpdateIfMounted, this);\n\n  var name = props.name;\n  if (props.type === 'radio' && name != null) {\n    var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);\n    var queryRoot = rootNode;\n\n    while (queryRoot.parentNode) {\n      queryRoot = queryRoot.parentNode;\n    }\n\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, let's just use the global\n    // `querySelectorAll` to ensure we don't miss anything.\n    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\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      }\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 otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);\n      !otherInstance ? \"development\" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : void 0;\n      // 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      ReactUpdates.asap(forceUpdateIfMounted, otherInstance);\n    }\n  }\n\n  return returnValue;\n}\n\nmodule.exports = ReactDOMInput;\n},{\"11\":11,\"14\":14,\"157\":157,\"167\":167,\"168\":168,\"24\":24,\"41\":41,\"93\":93}],49:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMInstrumentation\n */\n\n'use strict';\n\nvar ReactDOMDebugTool = _dereq_(43);\n\nmodule.exports = { debugTool: ReactDOMDebugTool };\n},{\"43\":43}],50:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMOption\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactChildren = _dereq_(29);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactDOMSelect = _dereq_(51);\n\nvar warning = _dereq_(167);\n\n/**\n * Implements an <option> native component that warns when `selected` is set.\n */\nvar ReactDOMOption = {\n  mountWrapper: function (inst, props, nativeParent) {\n    // TODO (yungsters): Remove support for `selected` in <option>.\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;\n    }\n\n    // Look up whether this option is 'selected'\n    var selectValue = null;\n    if (nativeParent != null) {\n      var selectParent = nativeParent;\n\n      if (selectParent._tag === 'optgroup') {\n        selectParent = selectParent._nativeParent;\n      }\n\n      if (selectParent != null && selectParent._tag === 'select') {\n        selectValue = ReactDOMSelect.getSelectValueContext(selectParent);\n      }\n    }\n\n    // If the value is null (e.g., no specified value or after initial mount)\n    // or missing (e.g., for <datalist>), we don't change props.selected\n    var selected = null;\n    if (selectValue != null) {\n      selected = false;\n      if (Array.isArray(selectValue)) {\n        // multiple\n        for (var i = 0; i < selectValue.length; i++) {\n          if ('' + selectValue[i] === '' + props.value) {\n            selected = true;\n            break;\n          }\n        }\n      } else {\n        selected = '' + selectValue === '' + props.value;\n      }\n    }\n\n    inst._wrapperState = { selected: selected };\n  },\n\n  postMountWrapper: function (inst) {\n    // value=\"\" should make a value attribute (#6219)\n    var props = inst._currentElement.props;\n    if (props.value != null) {\n      var node = ReactDOMComponentTree.getNodeFromInstance(inst);\n      node.setAttribute('value', props.value);\n    }\n  },\n\n  getNativeProps: function (inst, props) {\n    var nativeProps = _assign({ selected: undefined, children: undefined }, props);\n\n    // Read state only from initial mount because <select> updates value\n    // manually; we need the initial state only for server rendering\n    if (inst._wrapperState.selected != null) {\n      nativeProps.selected = inst._wrapperState.selected;\n    }\n\n    var content = '';\n\n    // Flatten children and warn if they aren't strings or numbers;\n    // invalid types are ignored.\n    ReactChildren.forEach(props.children, function (child) {\n      if (child == null) {\n        return;\n      }\n      if (typeof child === 'string' || typeof child === 'number') {\n        content += child;\n      } else {\n        \"development\" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;\n      }\n    });\n\n    if (content) {\n      nativeProps.children = content;\n    }\n\n    return nativeProps;\n  }\n\n};\n\nmodule.exports = ReactDOMOption;\n},{\"167\":167,\"168\":168,\"29\":29,\"41\":41,\"51\":51}],51:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMSelect\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar DisabledInputUtils = _dereq_(14);\nvar LinkedValueUtils = _dereq_(24);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactUpdates = _dereq_(93);\n\nvar warning = _dereq_(167);\n\nvar didWarnValueLink = false;\nvar didWarnValueNull = false;\nvar didWarnValueDefaultValue = false;\n\nfunction updateOptionsIfPendingUpdateAndMounted() {\n  if (this._rootNodeID && this._wrapperState.pendingUpdate) {\n    this._wrapperState.pendingUpdate = false;\n\n    var props = this._currentElement.props;\n    var value = LinkedValueUtils.getValue(props);\n\n    if (value != null) {\n      updateOptions(this, Boolean(props.multiple), value);\n    }\n  }\n}\n\nfunction getDeclarationErrorAddendum(owner) {\n  if (owner) {\n    var name = owner.getName();\n    if (name) {\n      return ' Check the render method of `' + name + '`.';\n    }\n  }\n  return '';\n}\n\nfunction warnIfValueIsNull(props) {\n  if (props != null && props.value === null && !didWarnValueNull) {\n    \"development\" !== 'production' ? warning(false, '`value` prop on `select` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;\n\n    didWarnValueNull = true;\n  }\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n\n/**\n * Validation function for `value` and `defaultValue`.\n * @private\n */\nfunction checkSelectPropTypes(inst, props) {\n  var owner = inst._currentElement._owner;\n  LinkedValueUtils.checkPropTypes('select', props, owner);\n\n  if (props.valueLink !== undefined && !didWarnValueLink) {\n    \"development\" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n    didWarnValueLink = true;\n  }\n\n  for (var i = 0; i < valuePropNames.length; i++) {\n    var propName = valuePropNames[i];\n    if (props[propName] == null) {\n      continue;\n    }\n    if (props.multiple) {\n      \"development\" !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n    } else {\n      \"development\" !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n    }\n  }\n}\n\n/**\n * @param {ReactDOMComponent} inst\n * @param {boolean} multiple\n * @param {*} propValue A stringable (with `multiple`, a list of stringables).\n * @private\n */\nfunction updateOptions(inst, multiple, propValue) {\n  var selectedValue, i;\n  var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;\n\n  if (multiple) {\n    selectedValue = {};\n    for (i = 0; i < propValue.length; i++) {\n      selectedValue['' + propValue[i]] = true;\n    }\n    for (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    }\n  } else {\n    // Do not set `select.value` as exact behavior isn't consistent across all\n    // browsers for all cases.\n    selectedValue = '' + propValue;\n    for (i = 0; i < options.length; i++) {\n      if (options[i].value === selectedValue) {\n        options[i].selected = true;\n        return;\n      }\n    }\n    if (options.length) {\n      options[0].selected = true;\n    }\n  }\n}\n\n/**\n * Implements a <select> native 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 */\nvar ReactDOMSelect = {\n  getNativeProps: function (inst, props) {\n    return _assign({}, DisabledInputUtils.getNativeProps(inst, props), {\n      onChange: inst._wrapperState.onChange,\n      value: undefined\n    });\n  },\n\n  mountWrapper: function (inst, props) {\n    if (\"development\" !== 'production') {\n      checkSelectPropTypes(inst, props);\n      warnIfValueIsNull(props);\n    }\n\n    var value = LinkedValueUtils.getValue(props);\n    inst._wrapperState = {\n      pendingUpdate: false,\n      initialValue: value != null ? value : props.defaultValue,\n      listeners: null,\n      onChange: _handleChange.bind(inst),\n      wasMultiple: Boolean(props.multiple)\n    };\n\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n      \"development\" !== 'production' ? warning(false, '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') : void 0;\n      didWarnValueDefaultValue = true;\n    }\n  },\n\n  getSelectValueContext: function (inst) {\n    // ReactDOMOption looks at this initial value so the initial generated\n    // markup has correct `selected` attributes\n    return inst._wrapperState.initialValue;\n  },\n\n  postUpdateWrapper: function (inst) {\n    var props = inst._currentElement.props;\n    if (\"development\" !== 'production') {\n      warnIfValueIsNull(props);\n    }\n\n    // After the initial mount, we control selected-ness manually so don't pass\n    // this value down\n    inst._wrapperState.initialValue = undefined;\n\n    var wasMultiple = inst._wrapperState.wasMultiple;\n    inst._wrapperState.wasMultiple = Boolean(props.multiple);\n\n    var value = LinkedValueUtils.getValue(props);\n    if (value != null) {\n      inst._wrapperState.pendingUpdate = false;\n      updateOptions(inst, Boolean(props.multiple), value);\n    } else if (wasMultiple !== Boolean(props.multiple)) {\n      // For simplicity, reapply `defaultValue` if `multiple` is toggled.\n      if (props.defaultValue != null) {\n        updateOptions(inst, Boolean(props.multiple), props.defaultValue);\n      } else {\n        // Revert the select back to its default unselected state.\n        updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');\n      }\n    }\n  }\n};\n\nfunction _handleChange(event) {\n  var props = this._currentElement.props;\n  var returnValue = LinkedValueUtils.executeOnChange(props, event);\n\n  if (this._rootNodeID) {\n    this._wrapperState.pendingUpdate = true;\n  }\n  ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);\n  return returnValue;\n}\n\nmodule.exports = ReactDOMSelect;\n},{\"14\":14,\"167\":167,\"168\":168,\"24\":24,\"41\":41,\"93\":93}],52:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMSelection\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar getNodeForCharacterOffset = _dereq_(128);\nvar getTextContentAccessor = _dereq_(129);\n\n/**\n * While `isCollapsed` is available on the Selection object and `collapsed`\n * is available on the Range object, IE11 sometimes gets them wrong.\n * If the anchor/focus nodes and offsets are the same, the range is collapsed.\n */\nfunction isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n  return anchorNode === focusNode && anchorOffset === focusOffset;\n}\n\n/**\n * Get the appropriate anchor and focus node/offset pairs for IE.\n *\n * The catch here is that IE's selection API doesn't provide information\n * about whether the selection is forward or backward, so we have to\n * behave as though it's always forward.\n *\n * IE text differs from modern selection in that it behaves as though\n * block elements end with a new line. This means character offsets will\n * differ between the two APIs.\n *\n * @param {DOMElement} node\n * @return {object}\n */\nfunction getIEOffsets(node) {\n  var selection = document.selection;\n  var selectedRange = selection.createRange();\n  var selectedLength = selectedRange.text.length;\n\n  // Duplicate selection so we can move range without breaking user selection.\n  var fromStart = selectedRange.duplicate();\n  fromStart.moveToElementText(node);\n  fromStart.setEndPoint('EndToStart', selectedRange);\n\n  var startOffset = fromStart.text.length;\n  var endOffset = startOffset + selectedLength;\n\n  return {\n    start: startOffset,\n    end: endOffset\n  };\n}\n\n/**\n * @param {DOMElement} node\n * @return {?object}\n */\nfunction getModernOffsets(node) {\n  var selection = window.getSelection && window.getSelection();\n\n  if (!selection || selection.rangeCount === 0) {\n    return null;\n  }\n\n  var anchorNode = selection.anchorNode;\n  var anchorOffset = selection.anchorOffset;\n  var focusNode = selection.focusNode;\n  var focusOffset = selection.focusOffset;\n\n  var currentRange = selection.getRangeAt(0);\n\n  // In Firefox, range.startContainer and range.endContainer can be \"anonymous\n  // divs\", e.g. the up/down buttons on an <input type=\"number\">. Anonymous\n  // divs do not seem to expose properties, triggering a \"Permission denied\n  // error\" if any of its properties are accessed. The only seemingly possible\n  // way to avoid erroring is to access a property that typically works for\n  // non-anonymous divs and 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    currentRange.startContainer.nodeType;\n    currentRange.endContainer.nodeType;\n    /* eslint-enable no-unused-expressions */\n  } catch (e) {\n    return null;\n  }\n\n  // If the node and offset values are the same, the selection is collapsed.\n  // `Selection.isCollapsed` is available natively, but IE sometimes gets\n  // this value wrong.\n  var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n\n  var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;\n\n  var tempRange = currentRange.cloneRange();\n  tempRange.selectNodeContents(node);\n  tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);\n\n  var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);\n\n  var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;\n  var end = start + rangeLength;\n\n  // Detect whether the selection is backward.\n  var detectionRange = document.createRange();\n  detectionRange.setStart(anchorNode, anchorOffset);\n  detectionRange.setEnd(focusNode, focusOffset);\n  var isBackward = detectionRange.collapsed;\n\n  return {\n    start: isBackward ? end : start,\n    end: isBackward ? start : end\n  };\n}\n\n/**\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\nfunction setIEOffsets(node, offsets) {\n  var range = document.selection.createRange().duplicate();\n  var start, end;\n\n  if (offsets.end === undefined) {\n    start = offsets.start;\n    end = start;\n  } else if (offsets.start > offsets.end) {\n    start = offsets.end;\n    end = offsets.start;\n  } else {\n    start = offsets.start;\n    end = offsets.end;\n  }\n\n  range.moveToElementText(node);\n  range.moveStart('character', start);\n  range.setEndPoint('EndToStart', range);\n  range.moveEnd('character', end - start);\n  range.select();\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 setModernOffsets(node, offsets) {\n  if (!window.getSelection) {\n    return;\n  }\n\n  var selection = window.getSelection();\n  var length = node[getTextContentAccessor()].length;\n  var start = Math.min(offsets.start, length);\n  var end = offsets.end === undefined ? start : Math.min(offsets.end, length);\n\n  // 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\n  var startMarker = getNodeForCharacterOffset(node, start);\n  var endMarker = getNodeForCharacterOffset(node, end);\n\n  if (startMarker && endMarker) {\n    var range = document.createRange();\n    range.setStart(startMarker.node, startMarker.offset);\n    selection.removeAllRanges();\n\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}\n\nvar useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);\n\nvar ReactDOMSelection = {\n  /**\n   * @param {DOMElement} node\n   */\n  getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,\n\n  /**\n   * @param {DOMElement|DOMTextNode} node\n   * @param {object} offsets\n   */\n  setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets\n};\n\nmodule.exports = ReactDOMSelection;\n},{\"128\":128,\"129\":129,\"143\":143}],53:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMServer\n */\n\n'use strict';\n\nvar ReactDefaultInjection = _dereq_(60);\nvar ReactServerRendering = _dereq_(89);\nvar ReactVersion = _dereq_(94);\n\nReactDefaultInjection.inject();\n\nvar ReactDOMServer = {\n  renderToString: ReactServerRendering.renderToString,\n  renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,\n  version: ReactVersion\n};\n\nmodule.exports = ReactDOMServer;\n},{\"60\":60,\"89\":89,\"94\":94}],54:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMTextComponent\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar DOMChildrenOperations = _dereq_(7);\nvar DOMLazyTree = _dereq_(8);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactInstrumentation = _dereq_(71);\n\nvar escapeTextContentForBrowser = _dereq_(118);\nvar invariant = _dereq_(157);\nvar validateDOMNesting = _dereq_(141);\n\n/**\n * Text nodes violate a couple assumptions that React makes about components:\n *\n *  - When mounting text into the DOM, adjacent text nodes are merged.\n *  - Text nodes cannot be assigned a React root ID.\n *\n * This component is used to wrap strings between comment nodes so that they\n * can undergo the same reconciliation that is applied to elements.\n *\n * TODO: Investigate representing React components in the DOM with text nodes.\n *\n * @class ReactDOMTextComponent\n * @extends ReactComponent\n * @internal\n */\nvar ReactDOMTextComponent = function (text) {\n  // TODO: This is really a ReactText (ReactNode), not a ReactElement\n  this._currentElement = text;\n  this._stringText = '' + text;\n  // ReactDOMComponentTree uses these:\n  this._nativeNode = null;\n  this._nativeParent = null;\n\n  // Properties\n  this._domID = null;\n  this._mountIndex = 0;\n  this._closingComment = null;\n  this._commentNodes = null;\n};\n\n_assign(ReactDOMTextComponent.prototype, {\n\n  /**\n   * Creates the markup for this text node. This node is not intended to have\n   * any features besides containing text content.\n   *\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @return {string} Markup for this text node.\n   * @internal\n   */\n  mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {\n    if (\"development\" !== 'production') {\n      ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);\n\n      var parentInfo;\n      if (nativeParent != null) {\n        parentInfo = nativeParent._ancestorInfo;\n      } else if (nativeContainerInfo != null) {\n        parentInfo = nativeContainerInfo._ancestorInfo;\n      }\n      if (parentInfo) {\n        // parentInfo should always be present except for the top-level\n        // component when server rendering\n        validateDOMNesting('#text', this, parentInfo);\n      }\n    }\n\n    var domID = nativeContainerInfo._idCounter++;\n    var openingValue = ' react-text: ' + domID + ' ';\n    var closingValue = ' /react-text ';\n    this._domID = domID;\n    this._nativeParent = nativeParent;\n    if (transaction.useCreateElement) {\n      var ownerDocument = nativeContainerInfo._ownerDocument;\n      var openingComment = ownerDocument.createComment(openingValue);\n      var closingComment = ownerDocument.createComment(closingValue);\n      var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());\n      DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));\n      if (this._stringText) {\n        DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));\n      }\n      DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));\n      ReactDOMComponentTree.precacheNode(this, openingComment);\n      this._closingComment = closingComment;\n      return lazyTree;\n    } else {\n      var escapedText = escapeTextContentForBrowser(this._stringText);\n\n      if (transaction.renderToStaticMarkup) {\n        // Normally we'd wrap this between comment nodes for the reasons stated\n        // above, but since this is a situation where React won't take over\n        // (static pages), we can simply return the text as it is.\n        return escapedText;\n      }\n\n      return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';\n    }\n  },\n\n  /**\n   * Updates this component by updating the text content.\n   *\n   * @param {ReactText} nextText The next text content\n   * @param {ReactReconcileTransaction} transaction\n   * @internal\n   */\n  receiveComponent: function (nextText, transaction) {\n    if (nextText !== this._currentElement) {\n      this._currentElement = nextText;\n      var nextStringText = '' + nextText;\n      if (nextStringText !== this._stringText) {\n        // TODO: Save this as pending props and use performUpdateIfNecessary\n        // and/or updateComponent to do the actual update for consistency with\n        // other component types?\n        this._stringText = nextStringText;\n        var commentNodes = this.getNativeNode();\n        DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);\n\n        if (\"development\" !== 'production') {\n          ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);\n        }\n      }\n    }\n  },\n\n  getNativeNode: function () {\n    var nativeNode = this._commentNodes;\n    if (nativeNode) {\n      return nativeNode;\n    }\n    if (!this._closingComment) {\n      var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);\n      var node = openingComment.nextSibling;\n      while (true) {\n        !(node != null) ? \"development\" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : invariant(false) : void 0;\n        if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {\n          this._closingComment = node;\n          break;\n        }\n        node = node.nextSibling;\n      }\n    }\n    nativeNode = [this._nativeNode, this._closingComment];\n    this._commentNodes = nativeNode;\n    return nativeNode;\n  },\n\n  unmountComponent: function () {\n    this._closingComment = null;\n    this._commentNodes = null;\n    ReactDOMComponentTree.uncacheNode(this);\n  }\n\n});\n\nmodule.exports = ReactDOMTextComponent;\n},{\"118\":118,\"141\":141,\"157\":157,\"168\":168,\"41\":41,\"7\":7,\"71\":71,\"8\":8}],55:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMTextarea\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar DisabledInputUtils = _dereq_(14);\nvar DOMPropertyOperations = _dereq_(11);\nvar LinkedValueUtils = _dereq_(24);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactUpdates = _dereq_(93);\n\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\nvar didWarnValueLink = false;\nvar didWarnValueNull = false;\nvar didWarnValDefaultVal = false;\n\nfunction forceUpdateIfMounted() {\n  if (this._rootNodeID) {\n    // DOM component is still mounted; update\n    ReactDOMTextarea.updateWrapper(this);\n  }\n}\n\nfunction warnIfValueIsNull(props) {\n  if (props != null && props.value === null && !didWarnValueNull) {\n    \"development\" !== 'production' ? warning(false, '`value` prop on `textarea` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;\n\n    didWarnValueNull = true;\n  }\n}\n\n/**\n * Implements a <textarea> native 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 */\nvar ReactDOMTextarea = {\n  getNativeProps: function (inst, props) {\n    !(props.dangerouslySetInnerHTML == null) ? \"development\" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : void 0;\n\n    // Always set children to the same thing. In IE9, the selection range will\n    // get reset if `textContent` is mutated.\n    var nativeProps = _assign({}, DisabledInputUtils.getNativeProps(inst, props), {\n      defaultValue: undefined,\n      value: undefined,\n      children: inst._wrapperState.initialValue,\n      onChange: inst._wrapperState.onChange\n    });\n\n    return nativeProps;\n  },\n\n  mountWrapper: function (inst, props) {\n    if (\"development\" !== 'production') {\n      LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);\n      if (props.valueLink !== undefined && !didWarnValueLink) {\n        \"development\" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;\n        didWarnValueLink = true;\n      }\n      if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n        \"development\" !== 'production' ? warning(false, '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') : void 0;\n        didWarnValDefaultVal = true;\n      }\n      warnIfValueIsNull(props);\n    }\n\n    var defaultValue = props.defaultValue;\n    // TODO (yungsters): Remove support for children content in <textarea>.\n    var children = props.children;\n    if (children != null) {\n      if (\"development\" !== 'production') {\n        \"development\" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;\n      }\n      !(defaultValue == null) ? \"development\" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : void 0;\n      if (Array.isArray(children)) {\n        !(children.length <= 1) ? \"development\" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : void 0;\n        children = children[0];\n      }\n\n      defaultValue = '' + children;\n    }\n    if (defaultValue == null) {\n      defaultValue = '';\n    }\n    var value = LinkedValueUtils.getValue(props);\n    inst._wrapperState = {\n      // We save the initial value so that `ReactDOMComponent` doesn't update\n      // `textContent` (unnecessary since we update value).\n      // The initial value can be a boolean or object so that's why it's\n      // forced to be a string.\n      initialValue: '' + (value != null ? value : defaultValue),\n      listeners: null,\n      onChange: _handleChange.bind(inst)\n    };\n  },\n\n  updateWrapper: function (inst) {\n    var props = inst._currentElement.props;\n\n    if (\"development\" !== 'production') {\n      warnIfValueIsNull(props);\n    }\n\n    var value = LinkedValueUtils.getValue(props);\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      DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);\n    }\n  }\n};\n\nfunction _handleChange(event) {\n  var props = this._currentElement.props;\n  var returnValue = LinkedValueUtils.executeOnChange(props, event);\n  ReactUpdates.asap(forceUpdateIfMounted, this);\n  return returnValue;\n}\n\nmodule.exports = ReactDOMTextarea;\n},{\"11\":11,\"14\":14,\"157\":157,\"167\":167,\"168\":168,\"24\":24,\"41\":41,\"93\":93}],56:[function(_dereq_,module,exports){\n/**\n * Copyright 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMTreeTraversal\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\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  !('_nativeNode' in instA) ? \"development\" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;\n  !('_nativeNode' in instB) ? \"development\" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;\n\n  var depthA = 0;\n  for (var tempA = instA; tempA; tempA = tempA._nativeParent) {\n    depthA++;\n  }\n  var depthB = 0;\n  for (var tempB = instB; tempB; tempB = tempB._nativeParent) {\n    depthB++;\n  }\n\n  // If A is deeper, crawl up.\n  while (depthA - depthB > 0) {\n    instA = instA._nativeParent;\n    depthA--;\n  }\n\n  // If B is deeper, crawl up.\n  while (depthB - depthA > 0) {\n    instB = instB._nativeParent;\n    depthB--;\n  }\n\n  // Walk in lockstep until we find a match.\n  var depth = depthA;\n  while (depth--) {\n    if (instA === instB) {\n      return instA;\n    }\n    instA = instA._nativeParent;\n    instB = instB._nativeParent;\n  }\n  return null;\n}\n\n/**\n * Return if A is an ancestor of B.\n */\nfunction isAncestor(instA, instB) {\n  !('_nativeNode' in instA) ? \"development\" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n  !('_nativeNode' in instB) ? \"development\" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\n  while (instB) {\n    if (instB === instA) {\n      return true;\n    }\n    instB = instB._nativeParent;\n  }\n  return false;\n}\n\n/**\n * Return the parent instance of the passed-in instance.\n */\nfunction getParentInstance(inst) {\n  !('_nativeNode' in inst) ? \"development\" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;\n\n  return inst._nativeParent;\n}\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 = inst._nativeParent;\n  }\n  var i;\n  for (i = path.length; i-- > 0;) {\n    fn(path[i], false, arg);\n  }\n  for (i = 0; i < path.length; i++) {\n    fn(path[i], true, arg);\n  }\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 (from && from !== common) {\n    pathFrom.push(from);\n    from = from._nativeParent;\n  }\n  var pathTo = [];\n  while (to && to !== common) {\n    pathTo.push(to);\n    to = to._nativeParent;\n  }\n  var i;\n  for (i = 0; i < pathFrom.length; i++) {\n    fn(pathFrom[i], true, argFrom);\n  }\n  for (i = pathTo.length; i-- > 0;) {\n    fn(pathTo[i], false, argTo);\n  }\n}\n\nmodule.exports = {\n  isAncestor: isAncestor,\n  getLowestCommonAncestor: getLowestCommonAncestor,\n  getParentInstance: getParentInstance,\n  traverseTwoPhase: traverseTwoPhase,\n  traverseEnterLeave: traverseEnterLeave\n};\n},{\"157\":157}],57:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDOMUnknownPropertyDevtool\n */\n\n'use strict';\n\nvar DOMProperty = _dereq_(10);\nvar EventPluginRegistry = _dereq_(18);\n\nvar warning = _dereq_(167);\n\nif (\"development\" !== 'production') {\n  var reactProps = {\n    children: true,\n    dangerouslySetInnerHTML: true,\n    key: true,\n    ref: true\n  };\n  var warnedProperties = {};\n\n  var warnUnknownProperty = function (name) {\n    if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {\n      return;\n    }\n    if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {\n      return;\n    }\n\n    warnedProperties[name] = true;\n    var lowerCasedName = name.toLowerCase();\n\n    // data-* attributes should be lowercase; suggest the lowercase version\n    var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;\n\n    // For now, only warn when we have a suggested correction. This prevents\n    // logging too much when using transferPropsTo.\n    \"development\" !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : void 0;\n\n    var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;\n\n    \"development\" !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?', name, registrationName) : void 0;\n  };\n}\n\nvar ReactDOMUnknownPropertyDevtool = {\n  onCreateMarkupForProperty: function (name, value) {\n    warnUnknownProperty(name);\n  },\n  onSetValueForProperty: function (node, name, value) {\n    warnUnknownProperty(name);\n  },\n  onDeleteValueForProperty: function (node, name) {\n    warnUnknownProperty(name);\n  }\n};\n\nmodule.exports = ReactDOMUnknownPropertyDevtool;\n},{\"10\":10,\"167\":167,\"18\":18}],58:[function(_dereq_,module,exports){\n/**\n * Copyright 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDebugTool\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar performanceNow = _dereq_(165);\nvar warning = _dereq_(167);\n\nvar eventHandlers = [];\nvar handlerDoesThrowForEvent = {};\n\nfunction emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {\n  if (\"development\" !== 'production') {\n    eventHandlers.forEach(function (handler) {\n      try {\n        if (handler[handlerFunctionName]) {\n          handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);\n        }\n      } catch (e) {\n        \"development\" !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;\n        handlerDoesThrowForEvent[handlerFunctionName] = true;\n      }\n    });\n  }\n}\n\nvar isProfiling = false;\nvar flushHistory = [];\nvar currentFlushNesting = 0;\nvar currentFlushMeasurements = null;\nvar currentFlushStartTime = null;\nvar currentTimerDebugID = null;\nvar currentTimerStartTime = null;\nvar currentTimerType = null;\n\nfunction clearHistory() {\n  ReactComponentTreeDevtool.purgeUnmountedComponents();\n  ReactNativeOperationHistoryDevtool.clearHistory();\n}\n\nfunction getTreeSnapshot(registeredIDs) {\n  return registeredIDs.reduce(function (tree, id) {\n    var ownerID = ReactComponentTreeDevtool.getOwnerID(id);\n    var parentID = ReactComponentTreeDevtool.getParentID(id);\n    tree[id] = {\n      displayName: ReactComponentTreeDevtool.getDisplayName(id),\n      text: ReactComponentTreeDevtool.getText(id),\n      updateCount: ReactComponentTreeDevtool.getUpdateCount(id),\n      childIDs: ReactComponentTreeDevtool.getChildIDs(id),\n      // Text nodes don't have owners but this is close enough.\n      ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),\n      parentID: parentID\n    };\n    return tree;\n  }, {});\n}\n\nfunction resetMeasurements() {\n  if (\"development\" !== 'production') {\n    var previousStartTime = currentFlushStartTime;\n    var previousMeasurements = currentFlushMeasurements || [];\n    var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();\n\n    if (!isProfiling || currentFlushNesting === 0) {\n      currentFlushStartTime = null;\n      currentFlushMeasurements = null;\n      clearHistory();\n      return;\n    }\n\n    if (previousMeasurements.length || previousOperations.length) {\n      var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();\n      flushHistory.push({\n        duration: performanceNow() - previousStartTime,\n        measurements: previousMeasurements || [],\n        operations: previousOperations || [],\n        treeSnapshot: getTreeSnapshot(registeredIDs)\n      });\n    }\n\n    clearHistory();\n    currentFlushStartTime = performanceNow();\n    currentFlushMeasurements = [];\n  }\n}\n\nfunction checkDebugID(debugID) {\n  \"development\" !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;\n}\n\nvar ReactDebugTool = {\n  addDevtool: function (devtool) {\n    eventHandlers.push(devtool);\n  },\n  removeDevtool: function (devtool) {\n    for (var i = 0; i < eventHandlers.length; i++) {\n      if (eventHandlers[i] === devtool) {\n        eventHandlers.splice(i, 1);\n        i--;\n      }\n    }\n  },\n  beginProfiling: function () {\n    if (\"development\" !== 'production') {\n      if (isProfiling) {\n        return;\n      }\n\n      isProfiling = true;\n      flushHistory.length = 0;\n      resetMeasurements();\n    }\n  },\n  endProfiling: function () {\n    if (\"development\" !== 'production') {\n      if (!isProfiling) {\n        return;\n      }\n\n      isProfiling = false;\n      resetMeasurements();\n    }\n  },\n  getFlushHistory: function () {\n    if (\"development\" !== 'production') {\n      return flushHistory;\n    }\n  },\n  onBeginFlush: function () {\n    if (\"development\" !== 'production') {\n      currentFlushNesting++;\n      resetMeasurements();\n    }\n    emitEvent('onBeginFlush');\n  },\n  onEndFlush: function () {\n    if (\"development\" !== 'production') {\n      resetMeasurements();\n      currentFlushNesting--;\n    }\n    emitEvent('onEndFlush');\n  },\n  onBeginLifeCycleTimer: function (debugID, timerType) {\n    checkDebugID(debugID);\n    emitEvent('onBeginLifeCycleTimer', debugID, timerType);\n    if (\"development\" !== 'production') {\n      if (isProfiling && currentFlushNesting > 0) {\n        \"development\" !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;\n        currentTimerStartTime = performanceNow();\n        currentTimerDebugID = debugID;\n        currentTimerType = timerType;\n      }\n    }\n  },\n  onEndLifeCycleTimer: function (debugID, timerType) {\n    checkDebugID(debugID);\n    if (\"development\" !== 'production') {\n      if (isProfiling && currentFlushNesting > 0) {\n        \"development\" !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;\n        currentFlushMeasurements.push({\n          timerType: timerType,\n          instanceID: debugID,\n          duration: performanceNow() - currentTimerStartTime\n        });\n        currentTimerStartTime = null;\n        currentTimerDebugID = null;\n        currentTimerType = null;\n      }\n    }\n    emitEvent('onEndLifeCycleTimer', debugID, timerType);\n  },\n  onBeginReconcilerTimer: function (debugID, timerType) {\n    checkDebugID(debugID);\n    emitEvent('onBeginReconcilerTimer', debugID, timerType);\n  },\n  onEndReconcilerTimer: function (debugID, timerType) {\n    checkDebugID(debugID);\n    emitEvent('onEndReconcilerTimer', debugID, timerType);\n  },\n  onBeginProcessingChildContext: function () {\n    emitEvent('onBeginProcessingChildContext');\n  },\n  onEndProcessingChildContext: function () {\n    emitEvent('onEndProcessingChildContext');\n  },\n  onNativeOperation: function (debugID, type, payload) {\n    checkDebugID(debugID);\n    emitEvent('onNativeOperation', debugID, type, payload);\n  },\n  onSetState: function () {\n    emitEvent('onSetState');\n  },\n  onSetDisplayName: function (debugID, displayName) {\n    checkDebugID(debugID);\n    emitEvent('onSetDisplayName', debugID, displayName);\n  },\n  onSetChildren: function (debugID, childDebugIDs) {\n    checkDebugID(debugID);\n    emitEvent('onSetChildren', debugID, childDebugIDs);\n  },\n  onSetOwner: function (debugID, ownerDebugID) {\n    checkDebugID(debugID);\n    emitEvent('onSetOwner', debugID, ownerDebugID);\n  },\n  onSetText: function (debugID, text) {\n    checkDebugID(debugID);\n    emitEvent('onSetText', debugID, text);\n  },\n  onMountRootComponent: function (debugID) {\n    checkDebugID(debugID);\n    emitEvent('onMountRootComponent', debugID);\n  },\n  onMountComponent: function (debugID) {\n    checkDebugID(debugID);\n    emitEvent('onMountComponent', debugID);\n  },\n  onUpdateComponent: function (debugID) {\n    checkDebugID(debugID);\n    emitEvent('onUpdateComponent', debugID);\n  },\n  onUnmountComponent: function (debugID) {\n    checkDebugID(debugID);\n    emitEvent('onUnmountComponent', debugID);\n  }\n};\n\nif (\"development\" !== 'production') {\n  var ReactInvalidSetStateWarningDevTool = _dereq_(72);\n  var ReactNativeOperationHistoryDevtool = _dereq_(78);\n  var ReactComponentTreeDevtool = _dereq_(34);\n  ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);\n  ReactDebugTool.addDevtool(ReactComponentTreeDevtool);\n  ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);\n  var url = ExecutionEnvironment.canUseDOM && window.location.href || '';\n  if (/[?&]react_perf\\b/.test(url)) {\n    ReactDebugTool.beginProfiling();\n  }\n}\n\nmodule.exports = ReactDebugTool;\n},{\"143\":143,\"165\":165,\"167\":167,\"34\":34,\"72\":72,\"78\":78}],59:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDefaultBatchingStrategy\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactUpdates = _dereq_(93);\nvar Transaction = _dereq_(111);\n\nvar emptyFunction = _dereq_(149);\n\nvar RESET_BATCHED_UPDATES = {\n  initialize: emptyFunction,\n  close: function () {\n    ReactDefaultBatchingStrategy.isBatchingUpdates = false;\n  }\n};\n\nvar FLUSH_BATCHED_UPDATES = {\n  initialize: emptyFunction,\n  close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)\n};\n\nvar TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];\n\nfunction ReactDefaultBatchingStrategyTransaction() {\n  this.reinitializeTransaction();\n}\n\n_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {\n  getTransactionWrappers: function () {\n    return TRANSACTION_WRAPPERS;\n  }\n});\n\nvar transaction = new ReactDefaultBatchingStrategyTransaction();\n\nvar ReactDefaultBatchingStrategy = {\n  isBatchingUpdates: false,\n\n  /**\n   * Call the provided function in a context within which calls to `setState`\n   * and friends are batched such that components aren't updated unnecessarily.\n   */\n  batchedUpdates: function (callback, a, b, c, d, e) {\n    var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;\n\n    ReactDefaultBatchingStrategy.isBatchingUpdates = true;\n\n    // The code is written this way to avoid extra allocations\n    if (alreadyBatchingUpdates) {\n      callback(a, b, c, d, e);\n    } else {\n      transaction.perform(callback, null, a, b, c, d, e);\n    }\n  }\n};\n\nmodule.exports = ReactDefaultBatchingStrategy;\n},{\"111\":111,\"149\":149,\"168\":168,\"93\":93}],60:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactDefaultInjection\n */\n\n'use strict';\n\nvar BeforeInputEventPlugin = _dereq_(2);\nvar ChangeEventPlugin = _dereq_(6);\nvar DefaultEventPluginOrder = _dereq_(13);\nvar EnterLeaveEventPlugin = _dereq_(15);\nvar HTMLDOMPropertyConfig = _dereq_(22);\nvar ReactComponentBrowserEnvironment = _dereq_(32);\nvar ReactDOMComponent = _dereq_(39);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactDOMEmptyComponent = _dereq_(44);\nvar ReactDOMTreeTraversal = _dereq_(56);\nvar ReactDOMTextComponent = _dereq_(54);\nvar ReactDefaultBatchingStrategy = _dereq_(59);\nvar ReactEventListener = _dereq_(66);\nvar ReactInjection = _dereq_(68);\nvar ReactReconcileTransaction = _dereq_(85);\nvar SVGDOMPropertyConfig = _dereq_(95);\nvar SelectEventPlugin = _dereq_(96);\nvar SimpleEventPlugin = _dereq_(97);\n\nvar alreadyInjected = false;\n\nfunction inject() {\n  if (alreadyInjected) {\n    // TODO: This is currently true because these injections are shared between\n    // the client and the server package. They should be built independently\n    // and not share any injection state. Then this problem will be solved.\n    return;\n  }\n  alreadyInjected = true;\n\n  ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);\n\n  /**\n   * Inject modules for resolving DOM hierarchy and plugin ordering.\n   */\n  ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);\n  ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);\n  ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);\n\n  /**\n   * Some important event plugins included by default (without having to require\n   * them).\n   */\n  ReactInjection.EventPluginHub.injectEventPluginsByName({\n    SimpleEventPlugin: SimpleEventPlugin,\n    EnterLeaveEventPlugin: EnterLeaveEventPlugin,\n    ChangeEventPlugin: ChangeEventPlugin,\n    SelectEventPlugin: SelectEventPlugin,\n    BeforeInputEventPlugin: BeforeInputEventPlugin\n  });\n\n  ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);\n\n  ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);\n\n  ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);\n  ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);\n\n  ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {\n    return new ReactDOMEmptyComponent(instantiate);\n  });\n\n  ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);\n  ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);\n\n  ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);\n}\n\nmodule.exports = {\n  inject: inject\n};\n},{\"13\":13,\"15\":15,\"2\":2,\"22\":22,\"32\":32,\"39\":39,\"41\":41,\"44\":44,\"54\":54,\"56\":56,\"59\":59,\"6\":6,\"66\":66,\"68\":68,\"85\":85,\"95\":95,\"96\":96,\"97\":97}],61:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactElement\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactCurrentOwner = _dereq_(36);\n\nvar warning = _dereq_(167);\nvar canDefineProperty = _dereq_(115);\n\n// The Symbol used to tag the ReactElement type. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;\n\nvar RESERVED_PROPS = {\n  key: true,\n  ref: true,\n  __self: true,\n  __source: true\n};\n\nvar specialPropKeyWarningShown, specialPropRefWarningShown;\n\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, no instanceof check\n * will work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} key\n * @param {string|object} ref\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @param {*} owner\n * @param {*} props\n * @internal\n */\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n  var element = {\n    // This tag allow us to uniquely identify this as a React Element\n    $$typeof: REACT_ELEMENT_TYPE,\n\n    // Built-in properties that belong on the element\n    type: type,\n    key: key,\n    ref: ref,\n    props: props,\n\n    // Record the component responsible for creating this element.\n    _owner: owner\n  };\n\n  if (\"development\" !== 'production') {\n    // The validation flag is currently mutative. We put it on\n    // an external backing store so that we can freeze the whole object.\n    // This can be replaced with a WeakMap once they are implemented in\n    // commonly used development environments.\n    element._store = {};\n\n    // To make comparing ReactElements easier for testing purposes, we make\n    // the validation flag non-enumerable (where possible, which should\n    // include every environment we run tests in), so the test framework\n    // ignores it.\n    if (canDefineProperty) {\n      Object.defineProperty(element._store, 'validated', {\n        configurable: false,\n        enumerable: false,\n        writable: true,\n        value: false\n      });\n      // self and source are DEV only properties.\n      Object.defineProperty(element, '_self', {\n        configurable: false,\n        enumerable: false,\n        writable: false,\n        value: self\n      });\n      // Two elements created in two different places should be considered\n      // equal for testing purposes and therefore we hide it from enumeration.\n      Object.defineProperty(element, '_source', {\n        configurable: false,\n        enumerable: false,\n        writable: false,\n        value: source\n      });\n    } else {\n      element._store.validated = false;\n      element._self = self;\n      element._source = source;\n    }\n    if (Object.freeze) {\n      Object.freeze(element.props);\n      Object.freeze(element);\n    }\n  }\n\n  return element;\n};\n\n/**\n * Create and return a new ReactElement of the given type.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement\n */\nReactElement.createElement = function (type, config, children) {\n  var propName;\n\n  // Reserved names are extracted\n  var props = {};\n\n  var key = null;\n  var ref = null;\n  var self = null;\n  var source = null;\n\n  if (config != null) {\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(\n      /* eslint-disable no-proto */\n      config.__proto__ == null || config.__proto__ === Object.prototype,\n      /* eslint-enable no-proto */\n      'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;\n      ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;\n      key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;\n    } else {\n      ref = config.ref === undefined ? null : config.ref;\n      key = config.key === undefined ? null : '' + config.key;\n    }\n    self = config.__self === undefined ? null : config.__self;\n    source = config.__source === undefined ? null : config.__source;\n    // Remaining properties are added to a new props object\n    for (propName in config) {\n      if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n        props[propName] = config[propName];\n      }\n    }\n  }\n\n  // Children can be more than one argument, and those are transferred onto\n  // the newly allocated props object.\n  var childrenLength = arguments.length - 2;\n  if (childrenLength === 1) {\n    props.children = children;\n  } else if (childrenLength > 1) {\n    var childArray = Array(childrenLength);\n    for (var i = 0; i < childrenLength; i++) {\n      childArray[i] = arguments[i + 2];\n    }\n    props.children = childArray;\n  }\n\n  // Resolve default props\n  if (type && type.defaultProps) {\n    var defaultProps = type.defaultProps;\n    for (propName in defaultProps) {\n      if (props[propName] === undefined) {\n        props[propName] = defaultProps[propName];\n      }\n    }\n  }\n  if (\"development\" !== 'production') {\n    // Create dummy `key` and `ref` property to `props` to warn users\n    // against its use\n    if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n      if (!props.hasOwnProperty('key')) {\n        Object.defineProperty(props, 'key', {\n          get: function () {\n            if (!specialPropKeyWarningShown) {\n              specialPropKeyWarningShown = true;\n              \"development\" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;\n            }\n            return undefined;\n          },\n          configurable: true\n        });\n      }\n      if (!props.hasOwnProperty('ref')) {\n        Object.defineProperty(props, 'ref', {\n          get: function () {\n            if (!specialPropRefWarningShown) {\n              specialPropRefWarningShown = true;\n              \"development\" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;\n            }\n            return undefined;\n          },\n          configurable: true\n        });\n      }\n    }\n  }\n  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n};\n\n/**\n * Return a function that produces ReactElements of a given type.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory\n */\nReactElement.createFactory = function (type) {\n  var factory = ReactElement.createElement.bind(null, type);\n  // Expose the type on the factory and the prototype so that it can be\n  // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n  // This should not be named `constructor` since this may not be the function\n  // that created the element, and it may not even be a constructor.\n  // Legacy hook TODO: Warn if this is accessed\n  factory.type = type;\n  return factory;\n};\n\nReactElement.cloneAndReplaceKey = function (oldElement, newKey) {\n  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n\n  return newElement;\n};\n\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement\n */\nReactElement.cloneElement = function (element, config, children) {\n  var propName;\n\n  // Original props are copied\n  var props = _assign({}, element.props);\n\n  // Reserved names are extracted\n  var key = element.key;\n  var ref = element.ref;\n  // Self is preserved since the owner is preserved.\n  var self = element._self;\n  // Source is preserved since cloneElement is unlikely to be targeted by a\n  // transpiler, and the original source is probably a better indicator of the\n  // true owner.\n  var source = element._source;\n\n  // Owner will be preserved, unless ref is overridden\n  var owner = element._owner;\n\n  if (config != null) {\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(\n      /* eslint-disable no-proto */\n      config.__proto__ == null || config.__proto__ === Object.prototype,\n      /* eslint-enable no-proto */\n      'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;\n    }\n    if (config.ref !== undefined) {\n      // Silently steal the ref from the parent.\n      ref = config.ref;\n      owner = ReactCurrentOwner.current;\n    }\n    if (config.key !== undefined) {\n      key = '' + config.key;\n    }\n    // Remaining properties override existing props\n    var defaultProps;\n    if (element.type && element.type.defaultProps) {\n      defaultProps = element.type.defaultProps;\n    }\n    for (propName in config) {\n      if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n        if (config[propName] === undefined && defaultProps !== undefined) {\n          // Resolve default props\n          props[propName] = defaultProps[propName];\n        } else {\n          props[propName] = config[propName];\n        }\n      }\n    }\n  }\n\n  // Children can be more than one argument, and those are transferred onto\n  // the newly allocated props object.\n  var childrenLength = arguments.length - 2;\n  if (childrenLength === 1) {\n    props.children = children;\n  } else if (childrenLength > 1) {\n    var childArray = Array(childrenLength);\n    for (var i = 0; i < childrenLength; i++) {\n      childArray[i] = arguments[i + 2];\n    }\n    props.children = childArray;\n  }\n\n  return ReactElement(element.type, key, ref, self, source, owner, props);\n};\n\n/**\n * Verifies the object is a ReactElement.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a valid component.\n * @final\n */\nReactElement.isValidElement = function (object) {\n  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n};\n\nmodule.exports = ReactElement;\n},{\"115\":115,\"167\":167,\"168\":168,\"36\":36}],62:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactElementValidator\n */\n\n/**\n * ReactElementValidator provides a wrapper around a element factory\n * which validates the props passed to the element. This is intended to be\n * used only in DEV and could be replaced by a static type checker for languages\n * that support it.\n */\n\n'use strict';\n\nvar ReactElement = _dereq_(61);\nvar ReactPropTypeLocations = _dereq_(83);\nvar ReactPropTypeLocationNames = _dereq_(82);\nvar ReactCurrentOwner = _dereq_(36);\n\nvar canDefineProperty = _dereq_(115);\nvar getIteratorFn = _dereq_(126);\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\nfunction getDeclarationErrorAddendum() {\n  if (ReactCurrentOwner.current) {\n    var name = ReactCurrentOwner.current.getName();\n    if (name) {\n      return ' Check the render method of `' + name + '`.';\n    }\n  }\n  return '';\n}\n\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 */\nvar ownerHasKeyUseWarning = {};\n\nvar loggedTypeFailures = {};\n\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\nfunction validateExplicitKey(element, parentType) {\n  if (!element._store || element._store.validated || element.key != null) {\n    return;\n  }\n  element._store.validated = true;\n\n  var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);\n  if (addenda === null) {\n    // we already showed the warning\n    return;\n  }\n  \"development\" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique \"key\" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : void 0;\n}\n\n/**\n * Shared warning and monitoring code for the key warnings.\n *\n * @internal\n * @param {string} messageType A key used for de-duping warnings.\n * @param {ReactElement} element Component that requires a key.\n * @param {*} parentType element's parent's type.\n * @returns {?object} A set of addenda to use in the warning message, or null\n * if the warning has already been shown before (and shouldn't be shown again).\n */\nfunction getAddendaForKeyUse(messageType, element, parentType) {\n  var addendum = getDeclarationErrorAddendum();\n  if (!addendum) {\n    var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n    if (parentName) {\n      addendum = ' Check the top-level render call using <' + parentName + '>.';\n    }\n  }\n\n  var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});\n  if (memoizer[addendum]) {\n    return null;\n  }\n  memoizer[addendum] = true;\n\n  var addenda = {\n    parentOrOwner: addendum,\n    url: ' See https://fb.me/react-warning-keys for more information.',\n    childOwner: null\n  };\n\n  // Usually the current owner is the offender, but if it accepts children as a\n  // property, it may be the creator of the child that's responsible for\n  // assigning it a key.\n  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n    // Give the component that originally created this child.\n    addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';\n  }\n\n  return addenda;\n}\n\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\nfunction validateChildKeys(node, parentType) {\n  if (typeof node !== 'object') {\n    return;\n  }\n  if (Array.isArray(node)) {\n    for (var i = 0; i < node.length; i++) {\n      var child = node[i];\n      if (ReactElement.isValidElement(child)) {\n        validateExplicitKey(child, parentType);\n      }\n    }\n  } else if (ReactElement.isValidElement(node)) {\n    // This element was passed in a valid location.\n    if (node._store) {\n      node._store.validated = true;\n    }\n  } else if (node) {\n    var iteratorFn = getIteratorFn(node);\n    // Entry iterators provide implicit keys.\n    if (iteratorFn) {\n      if (iteratorFn !== node.entries) {\n        var iterator = iteratorFn.call(node);\n        var step;\n        while (!(step = iterator.next()).done) {\n          if (ReactElement.isValidElement(step.value)) {\n            validateExplicitKey(step.value, parentType);\n          }\n        }\n      }\n    }\n  }\n}\n\n/**\n * Assert that the props are valid\n *\n * @param {string} componentName Name of the component for error messages.\n * @param {object} propTypes Map of prop name to a ReactPropType\n * @param {object} props\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @private\n */\nfunction checkPropTypes(componentName, propTypes, props, location) {\n  for (var propName in propTypes) {\n    if (propTypes.hasOwnProperty(propName)) {\n      var error;\n      // 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        !(typeof propTypes[propName] === 'function') ? \"development\" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;\n        error = propTypes[propName](props, propName, componentName, location);\n      } catch (ex) {\n        error = ex;\n      }\n      \"development\" !== 'production' ? warning(!error || error instanceof 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', ReactPropTypeLocationNames[location], propName, typeof error) : void 0;\n      if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n        // Only monitor this failure once because there tends to be a lot of the\n        // same error.\n        loggedTypeFailures[error.message] = true;\n\n        var addendum = getDeclarationErrorAddendum();\n        \"development\" !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : void 0;\n      }\n    }\n  }\n}\n\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\nfunction validatePropTypes(element) {\n  var componentClass = element.type;\n  if (typeof componentClass !== 'function') {\n    return;\n  }\n  var name = componentClass.displayName || componentClass.name;\n  if (componentClass.propTypes) {\n    checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);\n  }\n  if (typeof componentClass.getDefaultProps === 'function') {\n    \"development\" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;\n  }\n}\n\nvar ReactElementValidator = {\n\n  createElement: function (type, props, children) {\n    var validType = typeof type === 'string' || typeof type === 'function';\n    // We warn in this case but don't throw. We expect the element creation to\n    // succeed and there will likely be errors in render.\n    \"development\" !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;\n\n    var element = ReactElement.createElement.apply(this, arguments);\n\n    // The result can be nullish if a mock or a custom function is used.\n    // TODO: Drop this when these are no longer allowed as the type argument.\n    if (element == null) {\n      return element;\n    }\n\n    // Skip key warning if the type isn't valid since our key validation logic\n    // doesn't expect a non-string/function type and can throw confusing errors.\n    // We don't want exception behavior to differ between dev and prod.\n    // (Rendering will throw with a helpful message and as soon as the type is\n    // fixed, the key warnings will appear.)\n    if (validType) {\n      for (var i = 2; i < arguments.length; i++) {\n        validateChildKeys(arguments[i], type);\n      }\n    }\n\n    validatePropTypes(element);\n\n    return element;\n  },\n\n  createFactory: function (type) {\n    var validatedFactory = ReactElementValidator.createElement.bind(null, type);\n    // Legacy hook TODO: Warn if this is accessed\n    validatedFactory.type = type;\n\n    if (\"development\" !== 'production') {\n      if (canDefineProperty) {\n        Object.defineProperty(validatedFactory, 'type', {\n          enumerable: false,\n          get: function () {\n            \"development\" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;\n            Object.defineProperty(this, 'type', {\n              value: type\n            });\n            return type;\n          }\n        });\n      }\n    }\n\n    return validatedFactory;\n  },\n\n  cloneElement: function (element, props, children) {\n    var newElement = ReactElement.cloneElement.apply(this, arguments);\n    for (var i = 2; i < arguments.length; i++) {\n      validateChildKeys(arguments[i], newElement.type);\n    }\n    validatePropTypes(newElement);\n    return newElement;\n  }\n\n};\n\nmodule.exports = ReactElementValidator;\n},{\"115\":115,\"126\":126,\"157\":157,\"167\":167,\"36\":36,\"61\":61,\"82\":82,\"83\":83}],63:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactEmptyComponent\n */\n\n'use strict';\n\nvar emptyComponentFactory;\n\nvar ReactEmptyComponentInjection = {\n  injectEmptyComponentFactory: function (factory) {\n    emptyComponentFactory = factory;\n  }\n};\n\nvar ReactEmptyComponent = {\n  create: function (instantiate) {\n    return emptyComponentFactory(instantiate);\n  }\n};\n\nReactEmptyComponent.injection = ReactEmptyComponentInjection;\n\nmodule.exports = ReactEmptyComponent;\n},{}],64:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactErrorUtils\n */\n\n'use strict';\n\nvar caughtError = null;\n\n/**\n * Call a function while guarding against errors that happens within it.\n *\n * @param {?String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} a First argument\n * @param {*} b Second argument\n */\nfunction invokeGuardedCallback(name, func, a, b) {\n  try {\n    return func(a, b);\n  } catch (x) {\n    if (caughtError === null) {\n      caughtError = x;\n    }\n    return undefined;\n  }\n}\n\nvar ReactErrorUtils = {\n  invokeGuardedCallback: invokeGuardedCallback,\n\n  /**\n   * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event\n   * handler are sure to be rethrown by rethrowCaughtError.\n   */\n  invokeGuardedCallbackWithCatch: invokeGuardedCallback,\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   */\n  rethrowCaughtError: function () {\n    if (caughtError) {\n      var error = caughtError;\n      caughtError = null;\n      throw error;\n    }\n  }\n};\n\nif (\"development\" !== 'production') {\n  /**\n   * To help development we can get better devtools integration by simulating a\n   * real browser event.\n   */\n  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n    var fakeNode = document.createElement('react');\n    ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {\n      var boundFunc = func.bind(null, a, b);\n      var evtType = 'react-' + name;\n      fakeNode.addEventListener(evtType, boundFunc, false);\n      var evt = document.createEvent('Event');\n      evt.initEvent(evtType, false, false);\n      fakeNode.dispatchEvent(evt);\n      fakeNode.removeEventListener(evtType, boundFunc, false);\n    };\n  }\n}\n\nmodule.exports = ReactErrorUtils;\n},{}],65:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactEventEmitterMixin\n */\n\n'use strict';\n\nvar EventPluginHub = _dereq_(17);\n\nfunction runEventQueueInBatch(events) {\n  EventPluginHub.enqueueEvents(events);\n  EventPluginHub.processEventQueue(false);\n}\n\nvar ReactEventEmitterMixin = {\n\n  /**\n   * Streams a fired top-level event to `EventPluginHub` where plugins have the\n   * opportunity to create `ReactEvent`s to be dispatched.\n   */\n  handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n    runEventQueueInBatch(events);\n  }\n};\n\nmodule.exports = ReactEventEmitterMixin;\n},{\"17\":17}],66:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactEventListener\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar EventListener = _dereq_(142);\nvar ExecutionEnvironment = _dereq_(143);\nvar PooledClass = _dereq_(25);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactUpdates = _dereq_(93);\n\nvar getEventTarget = _dereq_(125);\nvar getUnboundedScrollPosition = _dereq_(154);\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 findParent(inst) {\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._nativeParent) {\n    inst = inst._nativeParent;\n  }\n  var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);\n  var container = rootNode.parentNode;\n  return ReactDOMComponentTree.getClosestInstanceFromNode(container);\n}\n\n// Used to store ancestor hierarchy in top level callback\nfunction TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {\n  this.topLevelType = topLevelType;\n  this.nativeEvent = nativeEvent;\n  this.ancestors = [];\n}\n_assign(TopLevelCallbackBookKeeping.prototype, {\n  destructor: function () {\n    this.topLevelType = null;\n    this.nativeEvent = null;\n    this.ancestors.length = 0;\n  }\n});\nPooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);\n\nfunction handleTopLevelImpl(bookKeeping) {\n  var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);\n  var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);\n\n  // 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    bookKeeping.ancestors.push(ancestor);\n    ancestor = ancestor && findParent(ancestor);\n  } while (ancestor);\n\n  for (var i = 0; i < bookKeeping.ancestors.length; i++) {\n    targetInst = bookKeeping.ancestors[i];\n    ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));\n  }\n}\n\nfunction scrollValueMonitor(cb) {\n  var scrollPosition = getUnboundedScrollPosition(window);\n  cb(scrollPosition);\n}\n\nvar ReactEventListener = {\n  _enabled: true,\n  _handleTopLevel: null,\n\n  WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,\n\n  setHandleTopLevel: function (handleTopLevel) {\n    ReactEventListener._handleTopLevel = handleTopLevel;\n  },\n\n  setEnabled: function (enabled) {\n    ReactEventListener._enabled = !!enabled;\n  },\n\n  isEnabled: function () {\n    return ReactEventListener._enabled;\n  },\n\n  /**\n   * Traps top-level events by using event bubbling.\n   *\n   * @param {string} topLevelType Record from `EventConstants`.\n   * @param {string} handlerBaseName Event name (e.g. \"click\").\n   * @param {object} handle Element on which to attach listener.\n   * @return {?object} An object with a remove function which will forcefully\n   *                  remove the listener.\n   * @internal\n   */\n  trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {\n    var element = handle;\n    if (!element) {\n      return null;\n    }\n    return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));\n  },\n\n  /**\n   * Traps a top-level event by using event capturing.\n   *\n   * @param {string} topLevelType Record from `EventConstants`.\n   * @param {string} handlerBaseName Event name (e.g. \"click\").\n   * @param {object} handle Element on which to attach listener.\n   * @return {?object} An object with a remove function which will forcefully\n   *                  remove the listener.\n   * @internal\n   */\n  trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {\n    var element = handle;\n    if (!element) {\n      return null;\n    }\n    return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));\n  },\n\n  monitorScrollValue: function (refresh) {\n    var callback = scrollValueMonitor.bind(null, refresh);\n    EventListener.listen(window, 'scroll', callback);\n  },\n\n  dispatchEvent: function (topLevelType, nativeEvent) {\n    if (!ReactEventListener._enabled) {\n      return;\n    }\n\n    var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);\n    try {\n      // Event queue being processed in the same cycle allows\n      // `preventDefault`.\n      ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);\n    } finally {\n      TopLevelCallbackBookKeeping.release(bookKeeping);\n    }\n  }\n};\n\nmodule.exports = ReactEventListener;\n},{\"125\":125,\"142\":142,\"143\":143,\"154\":154,\"168\":168,\"25\":25,\"41\":41,\"93\":93}],67:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactFeatureFlags\n */\n\n'use strict';\n\nvar ReactFeatureFlags = {\n  // When true, call console.time() before and .timeEnd() after each top-level\n  // render (both initial renders and updates). Useful when looking at prod-mode\n  // timeline profiles in Chrome, for example.\n  logTopLevelRenders: false\n};\n\nmodule.exports = ReactFeatureFlags;\n},{}],68:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactInjection\n */\n\n'use strict';\n\nvar DOMProperty = _dereq_(10);\nvar EventPluginHub = _dereq_(17);\nvar EventPluginUtils = _dereq_(19);\nvar ReactComponentEnvironment = _dereq_(33);\nvar ReactClass = _dereq_(30);\nvar ReactEmptyComponent = _dereq_(63);\nvar ReactBrowserEventEmitter = _dereq_(27);\nvar ReactNativeComponent = _dereq_(77);\nvar ReactUpdates = _dereq_(93);\n\nvar ReactInjection = {\n  Component: ReactComponentEnvironment.injection,\n  Class: ReactClass.injection,\n  DOMProperty: DOMProperty.injection,\n  EmptyComponent: ReactEmptyComponent.injection,\n  EventPluginHub: EventPluginHub.injection,\n  EventPluginUtils: EventPluginUtils.injection,\n  EventEmitter: ReactBrowserEventEmitter.injection,\n  NativeComponent: ReactNativeComponent.injection,\n  Updates: ReactUpdates.injection\n};\n\nmodule.exports = ReactInjection;\n},{\"10\":10,\"17\":17,\"19\":19,\"27\":27,\"30\":30,\"33\":33,\"63\":63,\"77\":77,\"93\":93}],69:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactInputSelection\n */\n\n'use strict';\n\nvar ReactDOMSelection = _dereq_(52);\n\nvar containsNode = _dereq_(146);\nvar focusNode = _dereq_(151);\nvar getActiveElement = _dereq_(152);\n\nfunction isInDocument(node) {\n  return containsNode(document.documentElement, node);\n}\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 */\nvar ReactInputSelection = {\n\n  hasSelectionCapabilities: function (elem) {\n    var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n    return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');\n  },\n\n  getSelectionInformation: function () {\n    var focusedElem = getActiveElement();\n    return {\n      focusedElem: focusedElem,\n      selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null\n    };\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   */\n  restoreSelection: function (priorSelectionInformation) {\n    var curFocusedElem = getActiveElement();\n    var priorFocusedElem = priorSelectionInformation.focusedElem;\n    var priorSelectionRange = priorSelectionInformation.selectionRange;\n    if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n      if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {\n        ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);\n      }\n      focusNode(priorFocusedElem);\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   */\n  getSelection: function (input) {\n    var selection;\n\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 if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {\n      // IE8 input.\n      var range = document.selection.createRange();\n      // There can only be one selection per document in IE, so it must\n      // be in our element.\n      if (range.parentElement() === input) {\n        selection = {\n          start: -range.moveStart('character', -input.value.length),\n          end: -range.moveEnd('character', -input.value.length)\n        };\n      }\n    } else {\n      // Content editable or old IE textarea.\n      selection = ReactDOMSelection.getOffsets(input);\n    }\n\n    return selection || { start: 0, 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   */\n  setSelection: function (input, offsets) {\n    var start = offsets.start;\n    var end = offsets.end;\n    if (end === undefined) {\n      end = start;\n    }\n\n    if ('selectionStart' in input) {\n      input.selectionStart = start;\n      input.selectionEnd = Math.min(end, input.value.length);\n    } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {\n      var range = input.createTextRange();\n      range.collapse(true);\n      range.moveStart('character', start);\n      range.moveEnd('character', end - start);\n      range.select();\n    } else {\n      ReactDOMSelection.setOffsets(input, offsets);\n    }\n  }\n};\n\nmodule.exports = ReactInputSelection;\n},{\"146\":146,\"151\":151,\"152\":152,\"52\":52}],70:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactInstanceMap\n */\n\n'use strict';\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\n// TODO: Replace this with ES6: var ReactInstanceMap = new Map();\n\nvar ReactInstanceMap = {\n\n  /**\n   * This API should be called `delete` but we'd have to make sure to always\n   * transform these to strings for IE support. When this transform is fully\n   * supported we can rename it.\n   */\n  remove: function (key) {\n    key._reactInternalInstance = undefined;\n  },\n\n  get: function (key) {\n    return key._reactInternalInstance;\n  },\n\n  has: function (key) {\n    return key._reactInternalInstance !== undefined;\n  },\n\n  set: function (key, value) {\n    key._reactInternalInstance = value;\n  }\n\n};\n\nmodule.exports = ReactInstanceMap;\n},{}],71:[function(_dereq_,module,exports){\n/**\n * Copyright 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactInstrumentation\n */\n\n'use strict';\n\nvar ReactDebugTool = _dereq_(58);\n\nmodule.exports = { debugTool: ReactDebugTool };\n},{\"58\":58}],72:[function(_dereq_,module,exports){\n/**\n * Copyright 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactInvalidSetStateWarningDevTool\n */\n\n'use strict';\n\nvar warning = _dereq_(167);\n\nif (\"development\" !== 'production') {\n  var processingChildContext = false;\n\n  var warnInvalidSetState = function () {\n    \"development\" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;\n  };\n}\n\nvar ReactInvalidSetStateWarningDevTool = {\n  onBeginProcessingChildContext: function () {\n    processingChildContext = true;\n  },\n  onEndProcessingChildContext: function () {\n    processingChildContext = false;\n  },\n  onSetState: function () {\n    warnInvalidSetState();\n  }\n};\n\nmodule.exports = ReactInvalidSetStateWarningDevTool;\n},{\"167\":167}],73:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactMarkupChecksum\n */\n\n'use strict';\n\nvar adler32 = _dereq_(114);\n\nvar TAG_END = /\\/?>/;\nvar COMMENT_START = /^<\\!\\-\\-/;\n\nvar ReactMarkupChecksum = {\n  CHECKSUM_ATTR_NAME: 'data-react-checksum',\n\n  /**\n   * @param {string} markup Markup string\n   * @return {string} Markup string with checksum attribute attached\n   */\n  addChecksumToMarkup: function (markup) {\n    var checksum = adler32(markup);\n\n    // Add checksum (handle both parent tags, comments and self-closing tags)\n    if (COMMENT_START.test(markup)) {\n      return markup;\n    } else {\n      return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '=\"' + checksum + '\"$&');\n    }\n  },\n\n  /**\n   * @param {string} markup to use\n   * @param {DOMElement} element root React element\n   * @returns {boolean} whether or not the markup is the same\n   */\n  canReuseMarkup: function (markup, element) {\n    var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);\n    existingChecksum = existingChecksum && parseInt(existingChecksum, 10);\n    var markupChecksum = adler32(markup);\n    return markupChecksum === existingChecksum;\n  }\n};\n\nmodule.exports = ReactMarkupChecksum;\n},{\"114\":114}],74:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactMount\n */\n\n'use strict';\n\nvar DOMLazyTree = _dereq_(8);\nvar DOMProperty = _dereq_(10);\nvar ReactBrowserEventEmitter = _dereq_(27);\nvar ReactCurrentOwner = _dereq_(36);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactDOMContainerInfo = _dereq_(42);\nvar ReactDOMFeatureFlags = _dereq_(46);\nvar ReactElement = _dereq_(61);\nvar ReactFeatureFlags = _dereq_(67);\nvar ReactInstrumentation = _dereq_(71);\nvar ReactMarkupChecksum = _dereq_(73);\nvar ReactReconciler = _dereq_(86);\nvar ReactUpdateQueue = _dereq_(92);\nvar ReactUpdates = _dereq_(93);\n\nvar emptyObject = _dereq_(150);\nvar instantiateReactComponent = _dereq_(131);\nvar invariant = _dereq_(157);\nvar setInnerHTML = _dereq_(137);\nvar shouldUpdateReactComponent = _dereq_(139);\nvar warning = _dereq_(167);\n\nvar ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;\nvar ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;\n\nvar ELEMENT_NODE_TYPE = 1;\nvar DOC_NODE_TYPE = 9;\nvar DOCUMENT_FRAGMENT_NODE_TYPE = 11;\n\nvar instancesByReactRootID = {};\n\n/**\n * Finds the index of the first character\n * that's not common between the two given strings.\n *\n * @return {number} the index of the character where the strings diverge\n */\nfunction firstDifferenceIndex(string1, string2) {\n  var minLen = Math.min(string1.length, string2.length);\n  for (var i = 0; i < minLen; i++) {\n    if (string1.charAt(i) !== string2.charAt(i)) {\n      return i;\n    }\n  }\n  return string1.length === string2.length ? -1 : minLen;\n}\n\n/**\n * @param {DOMElement|DOMDocument} container DOM element that may contain\n * a React component\n * @return {?*} DOM element that may have the reactRoot ID, or null.\n */\nfunction getReactRootElementInContainer(container) {\n  if (!container) {\n    return null;\n  }\n\n  if (container.nodeType === DOC_NODE_TYPE) {\n    return container.documentElement;\n  } else {\n    return container.firstChild;\n  }\n}\n\nfunction internalGetID(node) {\n  // If node is something like a window, document, or text node, none of\n  // which support attributes or a .getAttribute method, gracefully return\n  // the empty string, as if the attribute were missing.\n  return node.getAttribute && node.getAttribute(ATTR_NAME) || '';\n}\n\n/**\n * Mounts this component and inserts it into the DOM.\n *\n * @param {ReactComponent} componentInstance The instance to mount.\n * @param {DOMElement} container DOM element to mount into.\n * @param {ReactReconcileTransaction} transaction\n * @param {boolean} shouldReuseMarkup If true, do not insert markup\n */\nfunction mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {\n  var markerName;\n  if (ReactFeatureFlags.logTopLevelRenders) {\n    var wrappedElement = wrapperInstance._currentElement.props;\n    var type = wrappedElement.type;\n    markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);\n    console.time(markerName);\n  }\n\n  var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context);\n\n  if (markerName) {\n    console.timeEnd(markerName);\n  }\n\n  wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;\n  ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);\n}\n\n/**\n * Batched mount.\n *\n * @param {ReactComponent} componentInstance The instance to mount.\n * @param {DOMElement} container DOM element to mount into.\n * @param {boolean} shouldReuseMarkup If true, do not insert markup\n */\nfunction batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {\n  var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(\n  /* useCreateElement */\n  !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);\n  transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);\n  ReactUpdates.ReactReconcileTransaction.release(transaction);\n}\n\n/**\n * Unmounts a component and removes it from the DOM.\n *\n * @param {ReactComponent} instance React component instance.\n * @param {DOMElement} container DOM element to unmount from.\n * @final\n * @internal\n * @see {ReactMount.unmountComponentAtNode}\n */\nfunction unmountComponentFromNode(instance, container, safely) {\n  ReactReconciler.unmountComponent(instance, safely);\n\n  if (container.nodeType === DOC_NODE_TYPE) {\n    container = container.documentElement;\n  }\n\n  // http://jsperf.com/emptying-a-node\n  while (container.lastChild) {\n    container.removeChild(container.lastChild);\n  }\n}\n\n/**\n * True if the supplied DOM node has a direct React-rendered child that is\n * not a React root element. Useful for warning in `render`,\n * `unmountComponentAtNode`, etc.\n *\n * @param {?DOMElement} node The candidate DOM node.\n * @return {boolean} True if the DOM element contains a direct child that was\n * rendered by React but is not a root element.\n * @internal\n */\nfunction hasNonRootReactChild(container) {\n  var rootEl = getReactRootElementInContainer(container);\n  if (rootEl) {\n    var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);\n    return !!(inst && inst._nativeParent);\n  }\n}\n\nfunction getNativeRootInstanceInContainer(container) {\n  var rootEl = getReactRootElementInContainer(container);\n  var prevNativeInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);\n  return prevNativeInstance && !prevNativeInstance._nativeParent ? prevNativeInstance : null;\n}\n\nfunction getTopLevelWrapperInContainer(container) {\n  var root = getNativeRootInstanceInContainer(container);\n  return root ? root._nativeContainerInfo._topLevelWrapper : null;\n}\n\n/**\n * Temporary (?) hack so that we can store all top-level pending updates on\n * composites instead of having to worry about different types of components\n * here.\n */\nvar topLevelRootCounter = 1;\nvar TopLevelWrapper = function () {\n  this.rootID = topLevelRootCounter++;\n};\nTopLevelWrapper.prototype.isReactComponent = {};\nif (\"development\" !== 'production') {\n  TopLevelWrapper.displayName = 'TopLevelWrapper';\n}\nTopLevelWrapper.prototype.render = function () {\n  // this.props is actually a ReactElement\n  return this.props;\n};\n\n/**\n * Mounting is the process of initializing a React component by creating its\n * representative DOM elements and inserting them into a supplied `container`.\n * Any prior content inside `container` is destroyed in the process.\n *\n *   ReactMount.render(\n *     component,\n *     document.getElementById('container')\n *   );\n *\n *   <div id=\"container\">                   <-- Supplied `container`.\n *     <div data-reactid=\".3\">              <-- Rendered reactRoot of React\n *       // ...                                 component.\n *     </div>\n *   </div>\n *\n * Inside of `container`, the first element rendered is the \"reactRoot\".\n */\nvar ReactMount = {\n\n  TopLevelWrapper: TopLevelWrapper,\n\n  /**\n   * Used by devtools. The keys are not important.\n   */\n  _instancesByReactRootID: instancesByReactRootID,\n\n  /**\n   * This is a hook provided to support rendering React components while\n   * ensuring that the apparent scroll position of its `container` does not\n   * change.\n   *\n   * @param {DOMElement} container The `container` being rendered into.\n   * @param {function} renderCallback This must be called once to do the render.\n   */\n  scrollMonitor: function (container, renderCallback) {\n    renderCallback();\n  },\n\n  /**\n   * Take a component that's already mounted into the DOM and replace its props\n   * @param {ReactComponent} prevComponent component instance already in the DOM\n   * @param {ReactElement} nextElement component instance to render\n   * @param {DOMElement} container container to render into\n   * @param {?function} callback function triggered on completion\n   */\n  _updateRootComponent: function (prevComponent, nextElement, container, callback) {\n    ReactMount.scrollMonitor(container, function () {\n      ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);\n      if (callback) {\n        ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);\n      }\n    });\n\n    return prevComponent;\n  },\n\n  /**\n   * Render a new component into the DOM. Hooked by devtools!\n   *\n   * @param {ReactElement} nextElement element to render\n   * @param {DOMElement} container container to render into\n   * @param {boolean} shouldReuseMarkup if we should skip the markup insertion\n   * @return {ReactComponent} nextComponent\n   */\n  _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {\n    if (\"development\" !== 'production') {\n      ReactInstrumentation.debugTool.onBeginFlush();\n    }\n\n    // Various parts of our code (such as ReactCompositeComponent's\n    // _renderValidatedComponent) assume that calls to render aren't nested;\n    // verify that that's the case.\n    \"development\" !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): 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.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;\n\n    !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? \"development\" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : void 0;\n\n    ReactBrowserEventEmitter.ensureScrollValueMonitoring();\n    var componentInstance = instantiateReactComponent(nextElement);\n\n    if (\"development\" !== 'production') {\n      // Mute future events from the top level wrapper.\n      // It is an implementation detail that devtools should not know about.\n      componentInstance._debugID = 0;\n    }\n\n    // The initial render is synchronous but any updates that happen during\n    // rendering, in componentWillMount or componentDidMount, will be batched\n    // according to the current batching strategy.\n\n    ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);\n\n    var wrapperID = componentInstance._instance.rootID;\n    instancesByReactRootID[wrapperID] = componentInstance;\n\n    if (\"development\" !== 'production') {\n      // The instance here is TopLevelWrapper so we report mount for its child.\n      ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);\n      ReactInstrumentation.debugTool.onEndFlush();\n    }\n\n    return componentInstance;\n  },\n\n  /**\n   * Renders a React component into the DOM in the supplied `container`.\n   *\n   * If the React component was previously rendered into `container`, this will\n   * perform an update on it and only mutate the DOM as necessary to reflect the\n   * latest React component.\n   *\n   * @param {ReactComponent} parentComponent The conceptual parent of this render tree.\n   * @param {ReactElement} nextElement Component element to render.\n   * @param {DOMElement} container DOM element to render into.\n   * @param {?function} callback function triggered on completion\n   * @return {ReactComponent} Component instance rendered in `container`.\n   */\n  renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {\n    !(parentComponent != null && parentComponent._reactInternalInstance != null) ? \"development\" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : void 0;\n    return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);\n  },\n\n  _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {\n    ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');\n    !ReactElement.isValidElement(nextElement) ? \"development\" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \\'div\\', pass ' + 'React.createElement(\\'div\\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :\n    // Check if it quacks like an element\n    nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : void 0;\n\n    \"development\" !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', '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.') : void 0;\n\n    var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);\n\n    var prevComponent = getTopLevelWrapperInContainer(container);\n\n    if (prevComponent) {\n      var prevWrappedElement = prevComponent._currentElement;\n      var prevElement = prevWrappedElement.props;\n      if (shouldUpdateReactComponent(prevElement, nextElement)) {\n        var publicInst = prevComponent._renderedComponent.getPublicInstance();\n        var updatedCallback = callback && function () {\n          callback.call(publicInst);\n        };\n        ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);\n        return publicInst;\n      } else {\n        ReactMount.unmountComponentAtNode(container);\n      }\n    }\n\n    var reactRootElement = getReactRootElementInContainer(container);\n    var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);\n    var containerHasNonRootReactChild = hasNonRootReactChild(container);\n\n    if (\"development\" !== 'production') {\n      \"development\" !== 'production' ? warning(!containerHasNonRootReactChild, '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.') : void 0;\n\n      if (!containerHasReactMarkup || reactRootElement.nextSibling) {\n        var rootElementSibling = reactRootElement;\n        while (rootElementSibling) {\n          if (internalGetID(rootElementSibling)) {\n            \"development\" !== 'production' ? warning(false, '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.') : void 0;\n            break;\n          }\n          rootElementSibling = rootElementSibling.nextSibling;\n        }\n      }\n    }\n\n    var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;\n    var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();\n    if (callback) {\n      callback.call(component);\n    }\n    return component;\n  },\n\n  /**\n   * Renders a React component into the DOM in the supplied `container`.\n   * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render\n   *\n   * If the React component was previously rendered into `container`, this will\n   * perform an update on it and only mutate the DOM as necessary to reflect the\n   * latest React component.\n   *\n   * @param {ReactElement} nextElement Component element to render.\n   * @param {DOMElement} container DOM element to render into.\n   * @param {?function} callback function triggered on completion\n   * @return {ReactComponent} Component instance rendered in `container`.\n   */\n  render: function (nextElement, container, callback) {\n    return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);\n  },\n\n  /**\n   * Unmounts and destroys the React component rendered in the `container`.\n   * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode\n   *\n   * @param {DOMElement} container DOM element containing a React component.\n   * @return {boolean} True if a component was found in and unmounted from\n   *                   `container`\n   */\n  unmountComponentAtNode: function (container) {\n    // Various parts of our code (such as ReactCompositeComponent's\n    // _renderValidatedComponent) assume that calls to render aren't nested;\n    // verify that that's the case. (Strictly speaking, unmounting won't cause a\n    // render but we still don't expect to be in a render call here.)\n    \"development\" !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): 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.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;\n\n    !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? \"development\" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : void 0;\n\n    var prevComponent = getTopLevelWrapperInContainer(container);\n    if (!prevComponent) {\n      // Check if the node being unmounted was rendered by React, but isn't a\n      // root node.\n      var containerHasNonRootReactChild = hasNonRootReactChild(container);\n\n      // Check if the container itself is a React root node.\n      var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);\n\n      if (\"development\" !== 'production') {\n        \"development\" !== 'production' ? warning(!containerHasNonRootReactChild, '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.') : void 0;\n      }\n\n      return false;\n    }\n    delete instancesByReactRootID[prevComponent._instance.rootID];\n    ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);\n    return true;\n  },\n\n  _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {\n    !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? \"development\" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : void 0;\n\n    if (shouldReuseMarkup) {\n      var rootElement = getReactRootElementInContainer(container);\n      if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {\n        ReactDOMComponentTree.precacheNode(instance, rootElement);\n        return;\n      } else {\n        var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);\n        rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);\n\n        var rootMarkup = rootElement.outerHTML;\n        rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);\n\n        var normalizedMarkup = markup;\n        if (\"development\" !== 'production') {\n          // because rootMarkup is retrieved from the DOM, various normalizations\n          // will have occurred which will not be present in `markup`. Here,\n          // insert markup into a <div> or <iframe> depending on the container\n          // type to perform the same normalizations before comparing.\n          var normalizer;\n          if (container.nodeType === ELEMENT_NODE_TYPE) {\n            normalizer = document.createElement('div');\n            normalizer.innerHTML = markup;\n            normalizedMarkup = normalizer.innerHTML;\n          } else {\n            normalizer = document.createElement('iframe');\n            document.body.appendChild(normalizer);\n            normalizer.contentDocument.write(markup);\n            normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;\n            document.body.removeChild(normalizer);\n          }\n        }\n\n        var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);\n        var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);\n\n        !(container.nodeType !== DOC_NODE_TYPE) ? \"development\" !== 'production' ? invariant(false, 'You\\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\\n%s', difference) : invariant(false) : void 0;\n\n        if (\"development\" !== 'production') {\n          \"development\" !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\\n%s', difference) : void 0;\n        }\n      }\n    }\n\n    !(container.nodeType !== DOC_NODE_TYPE) ? \"development\" !== 'production' ? invariant(false, 'You\\'re trying to render a component to the document but ' + 'you didn\\'t use server rendering. We can\\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;\n\n    if (transaction.useCreateElement) {\n      while (container.lastChild) {\n        container.removeChild(container.lastChild);\n      }\n      DOMLazyTree.insertTreeBefore(container, markup, null);\n    } else {\n      setInnerHTML(container, markup);\n      ReactDOMComponentTree.precacheNode(instance, container.firstChild);\n    }\n\n    if (\"development\" !== 'production') {\n      var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);\n      if (nativeNode._debugID !== 0) {\n        ReactInstrumentation.debugTool.onNativeOperation(nativeNode._debugID, 'mount', markup.toString());\n      }\n    }\n  }\n};\n\nmodule.exports = ReactMount;\n},{\"10\":10,\"131\":131,\"137\":137,\"139\":139,\"150\":150,\"157\":157,\"167\":167,\"27\":27,\"36\":36,\"41\":41,\"42\":42,\"46\":46,\"61\":61,\"67\":67,\"71\":71,\"73\":73,\"8\":8,\"86\":86,\"92\":92,\"93\":93}],75:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactMultiChild\n */\n\n'use strict';\n\nvar ReactComponentEnvironment = _dereq_(33);\nvar ReactInstrumentation = _dereq_(71);\nvar ReactMultiChildUpdateTypes = _dereq_(76);\n\nvar ReactCurrentOwner = _dereq_(36);\nvar ReactReconciler = _dereq_(86);\nvar ReactChildReconciler = _dereq_(28);\n\nvar emptyFunction = _dereq_(149);\nvar flattenChildren = _dereq_(120);\nvar invariant = _dereq_(157);\n\n/**\n * Make an update for markup to be rendered and inserted at a supplied index.\n *\n * @param {string} markup Markup that renders into an element.\n * @param {number} toIndex Destination index.\n * @private\n */\nfunction makeInsertMarkup(markup, afterNode, toIndex) {\n  // NOTE: Null values reduce hidden classes.\n  return {\n    type: ReactMultiChildUpdateTypes.INSERT_MARKUP,\n    content: markup,\n    fromIndex: null,\n    fromNode: null,\n    toIndex: toIndex,\n    afterNode: afterNode\n  };\n}\n\n/**\n * Make an update for moving an existing element to another index.\n *\n * @param {number} fromIndex Source index of the existing element.\n * @param {number} toIndex Destination index of the element.\n * @private\n */\nfunction makeMove(child, afterNode, toIndex) {\n  // NOTE: Null values reduce hidden classes.\n  return {\n    type: ReactMultiChildUpdateTypes.MOVE_EXISTING,\n    content: null,\n    fromIndex: child._mountIndex,\n    fromNode: ReactReconciler.getNativeNode(child),\n    toIndex: toIndex,\n    afterNode: afterNode\n  };\n}\n\n/**\n * Make an update for removing an element at an index.\n *\n * @param {number} fromIndex Index of the element to remove.\n * @private\n */\nfunction makeRemove(child, node) {\n  // NOTE: Null values reduce hidden classes.\n  return {\n    type: ReactMultiChildUpdateTypes.REMOVE_NODE,\n    content: null,\n    fromIndex: child._mountIndex,\n    fromNode: node,\n    toIndex: null,\n    afterNode: null\n  };\n}\n\n/**\n * Make an update for setting the markup of a node.\n *\n * @param {string} markup Markup that renders into an element.\n * @private\n */\nfunction makeSetMarkup(markup) {\n  // NOTE: Null values reduce hidden classes.\n  return {\n    type: ReactMultiChildUpdateTypes.SET_MARKUP,\n    content: markup,\n    fromIndex: null,\n    fromNode: null,\n    toIndex: null,\n    afterNode: null\n  };\n}\n\n/**\n * Make an update for setting the text content.\n *\n * @param {string} textContent Text content to set.\n * @private\n */\nfunction makeTextContent(textContent) {\n  // NOTE: Null values reduce hidden classes.\n  return {\n    type: ReactMultiChildUpdateTypes.TEXT_CONTENT,\n    content: textContent,\n    fromIndex: null,\n    fromNode: null,\n    toIndex: null,\n    afterNode: null\n  };\n}\n\n/**\n * Push an update, if any, onto the queue. Creates a new queue if none is\n * passed and always returns the queue. Mutative.\n */\nfunction enqueue(queue, update) {\n  if (update) {\n    queue = queue || [];\n    queue.push(update);\n  }\n  return queue;\n}\n\n/**\n * Processes any enqueued updates.\n *\n * @private\n */\nfunction processQueue(inst, updateQueue) {\n  ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n}\n\nvar setChildrenForInstrumentation = emptyFunction;\nif (\"development\" !== 'production') {\n  setChildrenForInstrumentation = function (children) {\n    ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) {\n      return children[key]._debugID;\n    }) : []);\n  };\n}\n\n/**\n * ReactMultiChild are capable of reconciling multiple children.\n *\n * @class ReactMultiChild\n * @internal\n */\nvar ReactMultiChild = {\n\n  /**\n   * Provides common functionality for components that must reconcile multiple\n   * children. This is used by `ReactDOMComponent` to mount, update, and\n   * unmount child components.\n   *\n   * @lends {ReactMultiChild.prototype}\n   */\n  Mixin: {\n\n    _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {\n      if (\"development\" !== 'production') {\n        if (this._currentElement) {\n          try {\n            ReactCurrentOwner.current = this._currentElement._owner;\n            return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);\n          } finally {\n            ReactCurrentOwner.current = null;\n          }\n        }\n      }\n      return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);\n    },\n\n    _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, removedNodes, transaction, context) {\n      var nextChildren;\n      if (\"development\" !== 'production') {\n        if (this._currentElement) {\n          try {\n            ReactCurrentOwner.current = this._currentElement._owner;\n            nextChildren = flattenChildren(nextNestedChildrenElements);\n          } finally {\n            ReactCurrentOwner.current = null;\n          }\n          ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);\n          return nextChildren;\n        }\n      }\n      nextChildren = flattenChildren(nextNestedChildrenElements);\n      ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);\n      return nextChildren;\n    },\n\n    /**\n     * Generates a \"mount image\" for each of the supplied children. In the case\n     * of `ReactDOMComponent`, a mount image is a string of markup.\n     *\n     * @param {?object} nestedChildren Nested child maps.\n     * @return {array} An array of mounted representations.\n     * @internal\n     */\n    mountChildren: function (nestedChildren, transaction, context) {\n      var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);\n      this._renderedChildren = children;\n\n      var mountImages = [];\n      var index = 0;\n      for (var name in children) {\n        if (children.hasOwnProperty(name)) {\n          var child = children[name];\n          var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);\n          child._mountIndex = index++;\n          mountImages.push(mountImage);\n        }\n      }\n\n      if (\"development\" !== 'production') {\n        setChildrenForInstrumentation.call(this, children);\n      }\n\n      return mountImages;\n    },\n\n    /**\n     * Replaces any rendered children with a text content string.\n     *\n     * @param {string} nextContent String of content.\n     * @internal\n     */\n    updateTextContent: function (nextContent) {\n      var prevChildren = this._renderedChildren;\n      // Remove any rendered children.\n      ReactChildReconciler.unmountChildren(prevChildren, false);\n      for (var name in prevChildren) {\n        if (prevChildren.hasOwnProperty(name)) {\n          !false ? \"development\" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;\n        }\n      }\n      // Set new text content.\n      var updates = [makeTextContent(nextContent)];\n      processQueue(this, updates);\n    },\n\n    /**\n     * Replaces any rendered children with a markup string.\n     *\n     * @param {string} nextMarkup String of markup.\n     * @internal\n     */\n    updateMarkup: function (nextMarkup) {\n      var prevChildren = this._renderedChildren;\n      // Remove any rendered children.\n      ReactChildReconciler.unmountChildren(prevChildren, false);\n      for (var name in prevChildren) {\n        if (prevChildren.hasOwnProperty(name)) {\n          !false ? \"development\" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;\n        }\n      }\n      var updates = [makeSetMarkup(nextMarkup)];\n      processQueue(this, updates);\n    },\n\n    /**\n     * Updates the rendered children with new children.\n     *\n     * @param {?object} nextNestedChildrenElements Nested child element maps.\n     * @param {ReactReconcileTransaction} transaction\n     * @internal\n     */\n    updateChildren: function (nextNestedChildrenElements, transaction, context) {\n      // Hook used by React ART\n      this._updateChildren(nextNestedChildrenElements, transaction, context);\n    },\n\n    /**\n     * @param {?object} nextNestedChildrenElements Nested child element maps.\n     * @param {ReactReconcileTransaction} transaction\n     * @final\n     * @protected\n     */\n    _updateChildren: function (nextNestedChildrenElements, transaction, context) {\n      var prevChildren = this._renderedChildren;\n      var removedNodes = {};\n      var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, removedNodes, transaction, context);\n      if (!nextChildren && !prevChildren) {\n        return;\n      }\n      var updates = null;\n      var name;\n      // `nextIndex` will increment for each child in `nextChildren`, but\n      // `lastIndex` will be the last index visited in `prevChildren`.\n      var lastIndex = 0;\n      var nextIndex = 0;\n      var lastPlacedNode = null;\n      for (name in nextChildren) {\n        if (!nextChildren.hasOwnProperty(name)) {\n          continue;\n        }\n        var prevChild = prevChildren && prevChildren[name];\n        var nextChild = nextChildren[name];\n        if (prevChild === nextChild) {\n          updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));\n          lastIndex = Math.max(prevChild._mountIndex, lastIndex);\n          prevChild._mountIndex = nextIndex;\n        } else {\n          if (prevChild) {\n            // Update `lastIndex` before `_mountIndex` gets unset by unmounting.\n            lastIndex = Math.max(prevChild._mountIndex, lastIndex);\n            // The `removedNodes` loop below will actually remove the child.\n          }\n          // The child must be instantiated before it's mounted.\n          updates = enqueue(updates, this._mountChildAtIndex(nextChild, lastPlacedNode, nextIndex, transaction, context));\n        }\n        nextIndex++;\n        lastPlacedNode = ReactReconciler.getNativeNode(nextChild);\n      }\n      // Remove children that are no longer present.\n      for (name in removedNodes) {\n        if (removedNodes.hasOwnProperty(name)) {\n          updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));\n        }\n      }\n      if (updates) {\n        processQueue(this, updates);\n      }\n      this._renderedChildren = nextChildren;\n\n      if (\"development\" !== 'production') {\n        setChildrenForInstrumentation.call(this, nextChildren);\n      }\n    },\n\n    /**\n     * Unmounts all rendered children. This should be used to clean up children\n     * when this component is unmounted. It does not actually perform any\n     * backend operations.\n     *\n     * @internal\n     */\n    unmountChildren: function (safely) {\n      var renderedChildren = this._renderedChildren;\n      ReactChildReconciler.unmountChildren(renderedChildren, safely);\n      this._renderedChildren = null;\n    },\n\n    /**\n     * Moves a child component to the supplied index.\n     *\n     * @param {ReactComponent} child Component to move.\n     * @param {number} toIndex Destination index of the element.\n     * @param {number} lastIndex Last index visited of the siblings of `child`.\n     * @protected\n     */\n    moveChild: function (child, afterNode, toIndex, lastIndex) {\n      // If the index of `child` is less than `lastIndex`, then it needs to\n      // be moved. Otherwise, we do not need to move it because a child will be\n      // inserted or moved before `child`.\n      if (child._mountIndex < lastIndex) {\n        return makeMove(child, afterNode, toIndex);\n      }\n    },\n\n    /**\n     * Creates a child component.\n     *\n     * @param {ReactComponent} child Component to create.\n     * @param {string} mountImage Markup to insert.\n     * @protected\n     */\n    createChild: function (child, afterNode, mountImage) {\n      return makeInsertMarkup(mountImage, afterNode, child._mountIndex);\n    },\n\n    /**\n     * Removes a child component.\n     *\n     * @param {ReactComponent} child Child to remove.\n     * @protected\n     */\n    removeChild: function (child, node) {\n      return makeRemove(child, node);\n    },\n\n    /**\n     * Mounts a child with the supplied name.\n     *\n     * NOTE: This is part of `updateChildren` and is here for readability.\n     *\n     * @param {ReactComponent} child Component to mount.\n     * @param {string} name Name of the child.\n     * @param {number} index Index at which to insert the child.\n     * @param {ReactReconcileTransaction} transaction\n     * @private\n     */\n    _mountChildAtIndex: function (child, afterNode, index, transaction, context) {\n      var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);\n      child._mountIndex = index;\n      return this.createChild(child, afterNode, mountImage);\n    },\n\n    /**\n     * Unmounts a rendered child.\n     *\n     * NOTE: This is part of `updateChildren` and is here for readability.\n     *\n     * @param {ReactComponent} child Component to unmount.\n     * @private\n     */\n    _unmountChild: function (child, node) {\n      var update = this.removeChild(child, node);\n      child._mountIndex = null;\n      return update;\n    }\n\n  }\n\n};\n\nmodule.exports = ReactMultiChild;\n},{\"120\":120,\"149\":149,\"157\":157,\"28\":28,\"33\":33,\"36\":36,\"71\":71,\"76\":76,\"86\":86}],76:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactMultiChildUpdateTypes\n */\n\n'use strict';\n\nvar keyMirror = _dereq_(160);\n\n/**\n * When a component's children are updated, a series of update configuration\n * objects are created in order to batch and serialize the required changes.\n *\n * Enumerates all the possible types of update configurations.\n *\n * @internal\n */\nvar ReactMultiChildUpdateTypes = keyMirror({\n  INSERT_MARKUP: null,\n  MOVE_EXISTING: null,\n  REMOVE_NODE: null,\n  SET_MARKUP: null,\n  TEXT_CONTENT: null\n});\n\nmodule.exports = ReactMultiChildUpdateTypes;\n},{\"160\":160}],77:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeComponent\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar invariant = _dereq_(157);\n\nvar autoGenerateWrapperClass = null;\nvar genericComponentClass = null;\n// This registry keeps track of wrapper classes around native tags.\nvar tagToComponentClass = {};\nvar textComponentClass = null;\n\nvar ReactNativeComponentInjection = {\n  // This accepts a class that receives the tag string. This is a catch all\n  // that can render any kind of tag.\n  injectGenericComponentClass: function (componentClass) {\n    genericComponentClass = componentClass;\n  },\n  // This accepts a text component class that takes the text string to be\n  // rendered as props.\n  injectTextComponentClass: function (componentClass) {\n    textComponentClass = componentClass;\n  },\n  // This accepts a keyed object with classes as values. Each key represents a\n  // tag. That particular tag will use this class instead of the generic one.\n  injectComponentClasses: function (componentClasses) {\n    _assign(tagToComponentClass, componentClasses);\n  }\n};\n\n/**\n * Get a composite component wrapper class for a specific tag.\n *\n * @param {ReactElement} element The tag for which to get the class.\n * @return {function} The React class constructor function.\n */\nfunction getComponentClassForElement(element) {\n  if (typeof element.type === 'function') {\n    return element.type;\n  }\n  var tag = element.type;\n  var componentClass = tagToComponentClass[tag];\n  if (componentClass == null) {\n    tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);\n  }\n  return componentClass;\n}\n\n/**\n * Get a native internal component class for a specific tag.\n *\n * @param {ReactElement} element The element to create.\n * @return {function} The internal class constructor function.\n */\nfunction createInternalComponent(element) {\n  !genericComponentClass ? \"development\" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : void 0;\n  return new genericComponentClass(element);\n}\n\n/**\n * @param {ReactText} text\n * @return {ReactComponent}\n */\nfunction createInstanceForText(text) {\n  return new textComponentClass(text);\n}\n\n/**\n * @param {ReactComponent} component\n * @return {boolean}\n */\nfunction isTextComponent(component) {\n  return component instanceof textComponentClass;\n}\n\nvar ReactNativeComponent = {\n  getComponentClassForElement: getComponentClassForElement,\n  createInternalComponent: createInternalComponent,\n  createInstanceForText: createInstanceForText,\n  isTextComponent: isTextComponent,\n  injection: ReactNativeComponentInjection\n};\n\nmodule.exports = ReactNativeComponent;\n},{\"157\":157,\"168\":168}],78:[function(_dereq_,module,exports){\n/**\n * Copyright 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNativeOperationHistoryDevtool\n */\n\n'use strict';\n\nvar history = [];\n\nvar ReactNativeOperationHistoryDevtool = {\n  onNativeOperation: function (debugID, type, payload) {\n    history.push({\n      instanceID: debugID,\n      type: type,\n      payload: payload\n    });\n  },\n  clearHistory: function () {\n    if (ReactNativeOperationHistoryDevtool._preventClearing) {\n      // Should only be used for tests.\n      return;\n    }\n\n    history = [];\n  },\n  getHistory: function () {\n    return history;\n  }\n};\n\nmodule.exports = ReactNativeOperationHistoryDevtool;\n},{}],79:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNodeTypes\n */\n\n'use strict';\n\nvar ReactElement = _dereq_(61);\n\nvar invariant = _dereq_(157);\n\nvar ReactNodeTypes = {\n  NATIVE: 0,\n  COMPOSITE: 1,\n  EMPTY: 2,\n\n  getType: function (node) {\n    if (node === null || node === false) {\n      return ReactNodeTypes.EMPTY;\n    } else if (ReactElement.isValidElement(node)) {\n      if (typeof node.type === 'function') {\n        return ReactNodeTypes.COMPOSITE;\n      } else {\n        return ReactNodeTypes.NATIVE;\n      }\n    }\n    !false ? \"development\" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : invariant(false) : void 0;\n  }\n};\n\nmodule.exports = ReactNodeTypes;\n},{\"157\":157,\"61\":61}],80:[function(_dereq_,module,exports){\n/**\n * Copyright 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactNoopUpdateQueue\n */\n\n'use strict';\n\nvar warning = _dereq_(167);\n\nfunction warnTDZ(publicInstance, callerName) {\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : void 0;\n  }\n}\n\n/**\n * This is the abstract API for an update queue.\n */\nvar ReactNoopUpdateQueue = {\n\n  /**\n   * Checks whether or not this composite component is mounted.\n   * @param {ReactClass} publicInstance The instance we want to test.\n   * @return {boolean} True if mounted, false otherwise.\n   * @protected\n   * @final\n   */\n  isMounted: function (publicInstance) {\n    return false;\n  },\n\n  /**\n   * Enqueue a callback that will be executed after all the pending updates\n   * have processed.\n   *\n   * @param {ReactClass} publicInstance The instance to use as `this` context.\n   * @param {?function} callback Called after state is updated.\n   * @internal\n   */\n  enqueueCallback: function (publicInstance, callback) {},\n\n  /**\n   * Forces an update. This should only be invoked when it is known with\n   * certainty that we are **not** in a DOM transaction.\n   *\n   * You may want to call this when you know that some deeper aspect of the\n   * component's state has changed but `setState` was not called.\n   *\n   * This will not invoke `shouldComponentUpdate`, but it will invoke\n   * `componentWillUpdate` and `componentDidUpdate`.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @internal\n   */\n  enqueueForceUpdate: function (publicInstance) {\n    warnTDZ(publicInstance, 'forceUpdate');\n  },\n\n  /**\n   * Replaces all of the state. Always use this or `setState` to mutate state.\n   * You should treat `this.state` as immutable.\n   *\n   * There is no guarantee that `this.state` will be immediately updated, so\n   * accessing `this.state` after calling this method may return the old value.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {object} completeState Next state.\n   * @internal\n   */\n  enqueueReplaceState: function (publicInstance, completeState) {\n    warnTDZ(publicInstance, 'replaceState');\n  },\n\n  /**\n   * Sets a subset of the state. This only exists because _pendingState is\n   * internal. This provides a merging strategy that is not available to deep\n   * properties which is confusing. TODO: Expose pendingState or don't use it\n   * during the merge.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {object} partialState Next partial state to be merged with state.\n   * @internal\n   */\n  enqueueSetState: function (publicInstance, partialState) {\n    warnTDZ(publicInstance, 'setState');\n  }\n};\n\nmodule.exports = ReactNoopUpdateQueue;\n},{\"167\":167}],81:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactOwner\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\n/**\n * ReactOwners are capable of storing references to owned components.\n *\n * All components are capable of //being// referenced by owner components, but\n * only ReactOwner components are capable of //referencing// owned components.\n * The named reference is known as a \"ref\".\n *\n * Refs are available when mounted and updated during reconciliation.\n *\n *   var MyComponent = React.createClass({\n *     render: function() {\n *       return (\n *         <div onClick={this.handleClick}>\n *           <CustomComponent ref=\"custom\" />\n *         </div>\n *       );\n *     },\n *     handleClick: function() {\n *       this.refs.custom.handleClick();\n *     },\n *     componentDidMount: function() {\n *       this.refs.custom.initialize();\n *     }\n *   });\n *\n * Refs should rarely be used. When refs are used, they should only be done to\n * control data that is not handled by React's data flow.\n *\n * @class ReactOwner\n */\nvar ReactOwner = {\n\n  /**\n   * @param {?object} object\n   * @return {boolean} True if `object` is a valid owner.\n   * @final\n   */\n  isValidOwner: function (object) {\n    return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');\n  },\n\n  /**\n   * Adds a component by ref to an owner component.\n   *\n   * @param {ReactComponent} component Component to reference.\n   * @param {string} ref Name by which to refer to the component.\n   * @param {ReactOwner} owner Component on which to record the ref.\n   * @final\n   * @internal\n   */\n  addComponentAsRefTo: function (component, ref, owner) {\n    !ReactOwner.isValidOwner(owner) ? \"development\" !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;\n    owner.attachRef(ref, component);\n  },\n\n  /**\n   * Removes a component by ref from an owner component.\n   *\n   * @param {ReactComponent} component Component to dereference.\n   * @param {string} ref Name of the ref to remove.\n   * @param {ReactOwner} owner Component on which the ref is recorded.\n   * @final\n   * @internal\n   */\n  removeComponentAsRefFrom: function (component, ref, owner) {\n    !ReactOwner.isValidOwner(owner) ? \"development\" !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;\n    var ownerPublicInstance = owner.getPublicInstance();\n    // Check that `component`'s owner is still alive and that `component` is still the current ref\n    // because we do not want to detach the ref if another component stole it.\n    if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {\n      owner.detachRef(ref);\n    }\n  }\n\n};\n\nmodule.exports = ReactOwner;\n},{\"157\":157}],82:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactPropTypeLocationNames\n */\n\n'use strict';\n\nvar ReactPropTypeLocationNames = {};\n\nif (\"development\" !== 'production') {\n  ReactPropTypeLocationNames = {\n    prop: 'prop',\n    context: 'context',\n    childContext: 'child context'\n  };\n}\n\nmodule.exports = ReactPropTypeLocationNames;\n},{}],83:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactPropTypeLocations\n */\n\n'use strict';\n\nvar keyMirror = _dereq_(160);\n\nvar ReactPropTypeLocations = keyMirror({\n  prop: null,\n  context: null,\n  childContext: null\n});\n\nmodule.exports = ReactPropTypeLocations;\n},{\"160\":160}],84:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactPropTypes\n */\n\n'use strict';\n\nvar ReactElement = _dereq_(61);\nvar ReactPropTypeLocationNames = _dereq_(82);\n\nvar emptyFunction = _dereq_(149);\nvar getIteratorFn = _dereq_(126);\n\n/**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n *   var Props = require('ReactPropTypes');\n *   var MyArticle = React.createClass({\n *     propTypes: {\n *       // An optional string prop named \"description\".\n *       description: Props.string,\n *\n *       // A required enum prop named \"category\".\n *       category: Props.oneOf(['News','Photos']).isRequired,\n *\n *       // A prop named \"dialog\" that requires an instance of Dialog.\n *       dialog: Props.instanceOf(Dialog).isRequired\n *     },\n *     render: function() { ... }\n *   });\n *\n * A more formal specification of how these methods are used:\n *\n *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n *   decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n *  var MyLink = React.createClass({\n *    propTypes: {\n *      // An optional string or URI prop named \"href\".\n *      href: function(props, propName, componentName) {\n *        var propValue = props[propName];\n *        if (propValue != null && typeof propValue !== 'string' &&\n *            !(propValue instanceof URI)) {\n *          return new Error(\n *            'Expected a string or an URI for ' + propName + ' in ' +\n *            componentName\n *          );\n *        }\n *      }\n *    },\n *    render: function() {...}\n *  });\n *\n * @internal\n */\n\nvar ANONYMOUS = '<<anonymous>>';\n\nvar ReactPropTypes = {\n  array: createPrimitiveTypeChecker('array'),\n  bool: createPrimitiveTypeChecker('boolean'),\n  func: createPrimitiveTypeChecker('function'),\n  number: createPrimitiveTypeChecker('number'),\n  object: createPrimitiveTypeChecker('object'),\n  string: createPrimitiveTypeChecker('string'),\n\n  any: createAnyTypeChecker(),\n  arrayOf: createArrayOfTypeChecker,\n  element: createElementTypeChecker(),\n  instanceOf: createInstanceTypeChecker,\n  node: createNodeChecker(),\n  objectOf: createObjectOfTypeChecker,\n  oneOf: createEnumTypeChecker,\n  oneOfType: createUnionTypeChecker,\n  shape: createShapeTypeChecker\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 */\n/*eslint-disable no-self-compare*/\nfunction is(x, y) {\n  // SameValue algorithm\n  if (x === y) {\n    // Steps 1-5, 7-10\n    // Steps 6.b-6.e: +0 != -0\n    return x !== 0 || 1 / x === 1 / y;\n  } else {\n    // Step 6.a: NaN == NaN\n    return x !== x && y !== y;\n  }\n}\n/*eslint-enable no-self-compare*/\n\nfunction createChainableTypeChecker(validate) {\n  function checkType(isRequired, props, propName, componentName, location, propFullName) {\n    componentName = componentName || ANONYMOUS;\n    propFullName = propFullName || propName;\n    if (props[propName] == null) {\n      var locationName = ReactPropTypeLocationNames[location];\n      if (isRequired) {\n        return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));\n      }\n      return null;\n    } else {\n      return validate(props, propName, componentName, location, propFullName);\n    }\n  }\n\n  var chainedCheckType = checkType.bind(null, false);\n  chainedCheckType.isRequired = checkType.bind(null, true);\n\n  return chainedCheckType;\n}\n\nfunction createPrimitiveTypeChecker(expectedType) {\n  function validate(props, propName, componentName, location, propFullName) {\n    var propValue = props[propName];\n    var propType = getPropType(propValue);\n    if (propType !== expectedType) {\n      var locationName = ReactPropTypeLocationNames[location];\n      // `propValue` being instance of, say, date/regexp, pass the 'object'\n      // check, but we can offer a more precise error message here rather than\n      // 'of type `object`'.\n      var preciseType = getPreciseType(propValue);\n\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createAnyTypeChecker() {\n  return createChainableTypeChecker(emptyFunction.thatReturns(null));\n}\n\nfunction createArrayOfTypeChecker(typeChecker) {\n  function validate(props, propName, componentName, location, propFullName) {\n    if (typeof typeChecker !== 'function') {\n      return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n    }\n    var propValue = props[propName];\n    if (!Array.isArray(propValue)) {\n      var locationName = ReactPropTypeLocationNames[location];\n      var propType = getPropType(propValue);\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n    }\n    for (var i = 0; i < propValue.length; i++) {\n      var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');\n      if (error instanceof Error) {\n        return error;\n      }\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createElementTypeChecker() {\n  function validate(props, propName, componentName, location, propFullName) {\n    if (!ReactElement.isValidElement(props[propName])) {\n      var locationName = ReactPropTypeLocationNames[location];\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createInstanceTypeChecker(expectedClass) {\n  function validate(props, propName, componentName, location, propFullName) {\n    if (!(props[propName] instanceof expectedClass)) {\n      var locationName = ReactPropTypeLocationNames[location];\n      var expectedClassName = expectedClass.name || ANONYMOUS;\n      var actualClassName = getClassName(props[propName]);\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createEnumTypeChecker(expectedValues) {\n  if (!Array.isArray(expectedValues)) {\n    return createChainableTypeChecker(function () {\n      return new Error('Invalid argument supplied to oneOf, expected an instance of array.');\n    });\n  }\n\n  function validate(props, propName, componentName, location, propFullName) {\n    var propValue = props[propName];\n    for (var i = 0; i < expectedValues.length; i++) {\n      if (is(propValue, expectedValues[i])) {\n        return null;\n      }\n    }\n\n    var locationName = ReactPropTypeLocationNames[location];\n    var valuesString = JSON.stringify(expectedValues);\n    return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createObjectOfTypeChecker(typeChecker) {\n  function validate(props, propName, componentName, location, propFullName) {\n    if (typeof typeChecker !== 'function') {\n      return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n    }\n    var propValue = props[propName];\n    var propType = getPropType(propValue);\n    if (propType !== 'object') {\n      var locationName = ReactPropTypeLocationNames[location];\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n    }\n    for (var key in propValue) {\n      if (propValue.hasOwnProperty(key)) {\n        var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);\n        if (error instanceof Error) {\n          return error;\n        }\n      }\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createUnionTypeChecker(arrayOfTypeCheckers) {\n  if (!Array.isArray(arrayOfTypeCheckers)) {\n    return createChainableTypeChecker(function () {\n      return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');\n    });\n  }\n\n  function validate(props, propName, componentName, location, propFullName) {\n    for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n      var checker = arrayOfTypeCheckers[i];\n      if (checker(props, propName, componentName, location, propFullName) == null) {\n        return null;\n      }\n    }\n\n    var locationName = ReactPropTypeLocationNames[location];\n    return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createNodeChecker() {\n  function validate(props, propName, componentName, location, propFullName) {\n    if (!isNode(props[propName])) {\n      var locationName = ReactPropTypeLocationNames[location];\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction createShapeTypeChecker(shapeTypes) {\n  function validate(props, propName, componentName, location, propFullName) {\n    var propValue = props[propName];\n    var propType = getPropType(propValue);\n    if (propType !== 'object') {\n      var locationName = ReactPropTypeLocationNames[location];\n      return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n    }\n    for (var key in shapeTypes) {\n      var checker = shapeTypes[key];\n      if (!checker) {\n        continue;\n      }\n      var error = checker(propValue, key, componentName, location, propFullName + '.' + key);\n      if (error) {\n        return error;\n      }\n    }\n    return null;\n  }\n  return createChainableTypeChecker(validate);\n}\n\nfunction isNode(propValue) {\n  switch (typeof propValue) {\n    case 'number':\n    case 'string':\n    case 'undefined':\n      return true;\n    case 'boolean':\n      return !propValue;\n    case 'object':\n      if (Array.isArray(propValue)) {\n        return propValue.every(isNode);\n      }\n      if (propValue === null || ReactElement.isValidElement(propValue)) {\n        return true;\n      }\n\n      var iteratorFn = getIteratorFn(propValue);\n      if (iteratorFn) {\n        var iterator = iteratorFn.call(propValue);\n        var step;\n        if (iteratorFn !== propValue.entries) {\n          while (!(step = iterator.next()).done) {\n            if (!isNode(step.value)) {\n              return false;\n            }\n          }\n        } else {\n          // Iterator will provide entry [k,v] tuples rather than values.\n          while (!(step = iterator.next()).done) {\n            var entry = step.value;\n            if (entry) {\n              if (!isNode(entry[1])) {\n                return false;\n              }\n            }\n          }\n        }\n      } else {\n        return false;\n      }\n\n      return true;\n    default:\n      return false;\n  }\n}\n\n// Equivalent of `typeof` but with special handling for array and regexp.\nfunction getPropType(propValue) {\n  var propType = typeof propValue;\n  if (Array.isArray(propValue)) {\n    return 'array';\n  }\n  if (propValue instanceof RegExp) {\n    // Old webkits (at least until Android 4.0) return 'function' rather than\n    // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n    // passes PropTypes.object.\n    return 'object';\n  }\n  return propType;\n}\n\n// This handles more types than `getPropType`. Only used for error messages.\n// See `createPrimitiveTypeChecker`.\nfunction getPreciseType(propValue) {\n  var propType = getPropType(propValue);\n  if (propType === 'object') {\n    if (propValue instanceof Date) {\n      return 'date';\n    } else if (propValue instanceof RegExp) {\n      return 'regexp';\n    }\n  }\n  return propType;\n}\n\n// Returns class name of the object, if any.\nfunction getClassName(propValue) {\n  if (!propValue.constructor || !propValue.constructor.name) {\n    return ANONYMOUS;\n  }\n  return propValue.constructor.name;\n}\n\nmodule.exports = ReactPropTypes;\n},{\"126\":126,\"149\":149,\"61\":61,\"82\":82}],85:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactReconcileTransaction\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar CallbackQueue = _dereq_(5);\nvar PooledClass = _dereq_(25);\nvar ReactBrowserEventEmitter = _dereq_(27);\nvar ReactInputSelection = _dereq_(69);\nvar Transaction = _dereq_(111);\n\n/**\n * Ensures that, when possible, the selection range (currently selected text\n * input) is not disturbed by performing the transaction.\n */\nvar SELECTION_RESTORATION = {\n  /**\n   * @return {Selection} Selection information.\n   */\n  initialize: ReactInputSelection.getSelectionInformation,\n  /**\n   * @param {Selection} sel Selection information returned from `initialize`.\n   */\n  close: ReactInputSelection.restoreSelection\n};\n\n/**\n * Suppresses events (blur/focus) that could be inadvertently dispatched due to\n * high level DOM manipulations (like temporarily removing a text input from the\n * DOM).\n */\nvar EVENT_SUPPRESSION = {\n  /**\n   * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before\n   * the reconciliation.\n   */\n  initialize: function () {\n    var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();\n    ReactBrowserEventEmitter.setEnabled(false);\n    return currentlyEnabled;\n  },\n\n  /**\n   * @param {boolean} previouslyEnabled Enabled status of\n   *   `ReactBrowserEventEmitter` before the reconciliation occurred. `close`\n   *   restores the previous value.\n   */\n  close: function (previouslyEnabled) {\n    ReactBrowserEventEmitter.setEnabled(previouslyEnabled);\n  }\n};\n\n/**\n * Provides a queue for collecting `componentDidMount` and\n * `componentDidUpdate` callbacks during the transaction.\n */\nvar ON_DOM_READY_QUEUEING = {\n  /**\n   * Initializes the internal `onDOMReady` queue.\n   */\n  initialize: function () {\n    this.reactMountReady.reset();\n  },\n\n  /**\n   * After DOM is flushed, invoke all registered `onDOMReady` callbacks.\n   */\n  close: function () {\n    this.reactMountReady.notifyAll();\n  }\n};\n\n/**\n * Executed within the scope of the `Transaction` instance. Consider these as\n * being member methods, but with an implied ordering while being isolated from\n * each other.\n */\nvar TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];\n\n/**\n * Currently:\n * - The order that these are listed in the transaction is critical:\n * - Suppresses events.\n * - Restores selection range.\n *\n * Future:\n * - Restore document/overflow scroll positions that were unintentionally\n *   modified via DOM insertions above the top viewport boundary.\n * - Implement/integrate with customized constraint based layout system and keep\n *   track of which dimensions must be remeasured.\n *\n * @class ReactReconcileTransaction\n */\nfunction ReactReconcileTransaction(useCreateElement) {\n  this.reinitializeTransaction();\n  // Only server-side rendering really needs this option (see\n  // `ReactServerRendering`), but server-side uses\n  // `ReactServerRenderingTransaction` instead. This option is here so that it's\n  // accessible and defaults to false when `ReactDOMComponent` and\n  // `ReactTextComponent` checks it in `mountComponent`.`\n  this.renderToStaticMarkup = false;\n  this.reactMountReady = CallbackQueue.getPooled(null);\n  this.useCreateElement = useCreateElement;\n}\n\nvar Mixin = {\n  /**\n   * @see Transaction\n   * @abstract\n   * @final\n   * @return {array<object>} List of operation wrap procedures.\n   *   TODO: convert to array<TransactionWrapper>\n   */\n  getTransactionWrappers: function () {\n    return TRANSACTION_WRAPPERS;\n  },\n\n  /**\n   * @return {object} The queue to collect `onDOMReady` callbacks with.\n   */\n  getReactMountReady: function () {\n    return this.reactMountReady;\n  },\n\n  /**\n   * Save current transaction state -- if the return value from this method is\n   * passed to `rollback`, the transaction will be reset to that state.\n   */\n  checkpoint: function () {\n    // reactMountReady is the our only stateful wrapper\n    return this.reactMountReady.checkpoint();\n  },\n\n  rollback: function (checkpoint) {\n    this.reactMountReady.rollback(checkpoint);\n  },\n\n  /**\n   * `PooledClass` looks for this, and will invoke this before allowing this\n   * instance to be reused.\n   */\n  destructor: function () {\n    CallbackQueue.release(this.reactMountReady);\n    this.reactMountReady = null;\n  }\n};\n\n_assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);\n\nPooledClass.addPoolingTo(ReactReconcileTransaction);\n\nmodule.exports = ReactReconcileTransaction;\n},{\"111\":111,\"168\":168,\"25\":25,\"27\":27,\"5\":5,\"69\":69}],86:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactReconciler\n */\n\n'use strict';\n\nvar ReactRef = _dereq_(87);\nvar ReactInstrumentation = _dereq_(71);\n\nvar invariant = _dereq_(157);\n\n/**\n * Helper to call ReactRef.attachRefs with this composite component, split out\n * to avoid allocations in the transaction mount-ready queue.\n */\nfunction attachRefs() {\n  ReactRef.attachRefs(this, this._currentElement);\n}\n\nvar ReactReconciler = {\n\n  /**\n   * Initializes the component, renders markup, and registers event listeners.\n   *\n   * @param {ReactComponent} internalInstance\n   * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n   * @param {?object} the containing native component instance\n   * @param {?object} info about the native container\n   * @return {?string} Rendered markup to be inserted into the DOM.\n   * @final\n   * @internal\n   */\n  mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) {\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent');\n      }\n    }\n    var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context);\n    if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {\n      transaction.getReactMountReady().enqueue(attachRefs, internalInstance);\n    }\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent');\n        ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);\n      }\n    }\n    return markup;\n  },\n\n  /**\n   * Returns a value that can be passed to\n   * ReactComponentEnvironment.replaceNodeWithMarkup.\n   */\n  getNativeNode: function (internalInstance) {\n    return internalInstance.getNativeNode();\n  },\n\n  /**\n   * Releases any resources allocated by `mountComponent`.\n   *\n   * @final\n   * @internal\n   */\n  unmountComponent: function (internalInstance, safely) {\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent');\n      }\n    }\n    ReactRef.detachRefs(internalInstance, internalInstance._currentElement);\n    internalInstance.unmountComponent(safely);\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent');\n        ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);\n      }\n    }\n  },\n\n  /**\n   * Update a component using a new element.\n   *\n   * @param {ReactComponent} internalInstance\n   * @param {ReactElement} nextElement\n   * @param {ReactReconcileTransaction} transaction\n   * @param {object} context\n   * @internal\n   */\n  receiveComponent: function (internalInstance, nextElement, transaction, context) {\n    var prevElement = internalInstance._currentElement;\n\n    if (nextElement === prevElement && context === internalInstance._context) {\n      // Since elements are immutable after the owner is rendered,\n      // we can do a cheap identity compare here to determine if this is a\n      // superfluous reconcile. It's possible for state to be mutable but such\n      // change should trigger an update of the owner which would recreate\n      // the element. We explicitly check for the existence of an owner since\n      // it's possible for an element created outside a composite to be\n      // deeply mutated and reused.\n\n      // TODO: Bailing out early is just a perf optimization right?\n      // TODO: Removing the return statement should affect correctness?\n      return;\n    }\n\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent');\n      }\n    }\n\n    var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);\n\n    if (refsChanged) {\n      ReactRef.detachRefs(internalInstance, prevElement);\n    }\n\n    internalInstance.receiveComponent(nextElement, transaction, context);\n\n    if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {\n      transaction.getReactMountReady().enqueue(attachRefs, internalInstance);\n    }\n\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent');\n        ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);\n      }\n    }\n  },\n\n  /**\n   * Flush any dirty changes in a component.\n   *\n   * @param {ReactComponent} internalInstance\n   * @param {ReactReconcileTransaction} transaction\n   * @internal\n   */\n  performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {\n    if (internalInstance._updateBatchNumber !== updateBatchNumber) {\n      // The component's enqueued batch number should always be the current\n      // batch or the following one.\n      !(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? \"development\" !== 'production' ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0;\n      return;\n    }\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');\n      }\n    }\n    internalInstance.performUpdateIfNecessary(transaction);\n    if (\"development\" !== 'production') {\n      if (internalInstance._debugID !== 0) {\n        ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');\n        ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);\n      }\n    }\n  }\n\n};\n\nmodule.exports = ReactReconciler;\n},{\"157\":157,\"71\":71,\"87\":87}],87:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactRef\n */\n\n'use strict';\n\nvar ReactOwner = _dereq_(81);\n\nvar ReactRef = {};\n\nfunction attachRef(ref, component, owner) {\n  if (typeof ref === 'function') {\n    ref(component.getPublicInstance());\n  } else {\n    // Legacy ref\n    ReactOwner.addComponentAsRefTo(component, ref, owner);\n  }\n}\n\nfunction detachRef(ref, component, owner) {\n  if (typeof ref === 'function') {\n    ref(null);\n  } else {\n    // Legacy ref\n    ReactOwner.removeComponentAsRefFrom(component, ref, owner);\n  }\n}\n\nReactRef.attachRefs = function (instance, element) {\n  if (element === null || element === false) {\n    return;\n  }\n  var ref = element.ref;\n  if (ref != null) {\n    attachRef(ref, instance, element._owner);\n  }\n};\n\nReactRef.shouldUpdateRefs = function (prevElement, nextElement) {\n  // If either the owner or a `ref` has changed, make sure the newest owner\n  // has stored a reference to `this`, and the previous owner (if different)\n  // has forgotten the reference to `this`. We use the element instead\n  // of the public this.props because the post processing cannot determine\n  // a ref. The ref conceptually lives on the element.\n\n  // TODO: Should this even be possible? The owner cannot change because\n  // it's forbidden by shouldUpdateReactComponent. The ref can change\n  // if you swap the keys of but not the refs. Reconsider where this check\n  // is made. It probably belongs where the key checking and\n  // instantiateReactComponent is done.\n\n  var prevEmpty = prevElement === null || prevElement === false;\n  var nextEmpty = nextElement === null || nextElement === false;\n\n  return(\n    // This has a few false positives w/r/t empty components.\n    prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref\n  );\n};\n\nReactRef.detachRefs = function (instance, element) {\n  if (element === null || element === false) {\n    return;\n  }\n  var ref = element.ref;\n  if (ref != null) {\n    detachRef(ref, instance, element._owner);\n  }\n};\n\nmodule.exports = ReactRef;\n},{\"81\":81}],88:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactServerBatchingStrategy\n */\n\n'use strict';\n\nvar ReactServerBatchingStrategy = {\n  isBatchingUpdates: false,\n  batchedUpdates: function (callback) {\n    // Don't do anything here. During the server rendering we don't want to\n    // schedule any updates. We will simply ignore them.\n  }\n};\n\nmodule.exports = ReactServerBatchingStrategy;\n},{}],89:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactServerRendering\n */\n'use strict';\n\nvar ReactDOMContainerInfo = _dereq_(42);\nvar ReactDefaultBatchingStrategy = _dereq_(59);\nvar ReactElement = _dereq_(61);\nvar ReactInstrumentation = _dereq_(71);\nvar ReactMarkupChecksum = _dereq_(73);\nvar ReactReconciler = _dereq_(86);\nvar ReactServerBatchingStrategy = _dereq_(88);\nvar ReactServerRenderingTransaction = _dereq_(90);\nvar ReactUpdates = _dereq_(93);\n\nvar emptyObject = _dereq_(150);\nvar instantiateReactComponent = _dereq_(131);\nvar invariant = _dereq_(157);\n\n/**\n * @param {ReactElement} element\n * @return {string} the HTML markup\n */\nfunction renderToStringImpl(element, makeStaticMarkup) {\n  var transaction;\n  try {\n    ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);\n\n    transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);\n\n    return transaction.perform(function () {\n      if (\"development\" !== 'production') {\n        ReactInstrumentation.debugTool.onBeginFlush();\n      }\n      var componentInstance = instantiateReactComponent(element);\n      var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject);\n      if (\"development\" !== 'production') {\n        ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);\n        ReactInstrumentation.debugTool.onEndFlush();\n      }\n      if (!makeStaticMarkup) {\n        markup = ReactMarkupChecksum.addChecksumToMarkup(markup);\n      }\n      return markup;\n    }, null);\n  } finally {\n    ReactServerRenderingTransaction.release(transaction);\n    // Revert to the DOM batching strategy since these two renderers\n    // currently share these stateful modules.\n    ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);\n  }\n}\n\n/**\n * Render a ReactElement to its initial HTML. This should only be used on the\n * server.\n * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring\n */\nfunction renderToString(element) {\n  !ReactElement.isValidElement(element) ? \"development\" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : void 0;\n  return renderToStringImpl(element, false);\n}\n\n/**\n * Similar to renderToString, except this doesn't create extra DOM attributes\n * such as data-react-id that React uses internally.\n * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup\n */\nfunction renderToStaticMarkup(element) {\n  !ReactElement.isValidElement(element) ? \"development\" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : void 0;\n  return renderToStringImpl(element, true);\n}\n\nmodule.exports = {\n  renderToString: renderToString,\n  renderToStaticMarkup: renderToStaticMarkup\n};\n},{\"131\":131,\"150\":150,\"157\":157,\"42\":42,\"59\":59,\"61\":61,\"71\":71,\"73\":73,\"86\":86,\"88\":88,\"90\":90,\"93\":93}],90:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactServerRenderingTransaction\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar PooledClass = _dereq_(25);\nvar Transaction = _dereq_(111);\n\n/**\n * Executed within the scope of the `Transaction` instance. Consider these as\n * being member methods, but with an implied ordering while being isolated from\n * each other.\n */\nvar TRANSACTION_WRAPPERS = [];\n\nvar noopCallbackQueue = {\n  enqueue: function () {}\n};\n\n/**\n * @class ReactServerRenderingTransaction\n * @param {boolean} renderToStaticMarkup\n */\nfunction ReactServerRenderingTransaction(renderToStaticMarkup) {\n  this.reinitializeTransaction();\n  this.renderToStaticMarkup = renderToStaticMarkup;\n  this.useCreateElement = false;\n}\n\nvar Mixin = {\n  /**\n   * @see Transaction\n   * @abstract\n   * @final\n   * @return {array} Empty list of operation wrap procedures.\n   */\n  getTransactionWrappers: function () {\n    return TRANSACTION_WRAPPERS;\n  },\n\n  /**\n   * @return {object} The queue to collect `onDOMReady` callbacks with.\n   */\n  getReactMountReady: function () {\n    return noopCallbackQueue;\n  },\n\n  /**\n   * `PooledClass` looks for this, and will invoke this before allowing this\n   * instance to be reused.\n   */\n  destructor: function () {},\n\n  checkpoint: function () {},\n\n  rollback: function () {}\n};\n\n_assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);\n\nPooledClass.addPoolingTo(ReactServerRenderingTransaction);\n\nmodule.exports = ReactServerRenderingTransaction;\n},{\"111\":111,\"168\":168,\"25\":25}],91:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactUMDEntry\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactDOM = _dereq_(37);\nvar ReactDOMServer = _dereq_(53);\nvar React = _dereq_(26);\n\n// `version` will be added here by ReactIsomorphic.\nvar ReactUMDEntry = _assign({\n  __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,\n  __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer\n}, React);\n\nmodule.exports = ReactUMDEntry;\n},{\"168\":168,\"26\":26,\"37\":37,\"53\":53}],92:[function(_dereq_,module,exports){\n/**\n * Copyright 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactUpdateQueue\n */\n\n'use strict';\n\nvar ReactCurrentOwner = _dereq_(36);\nvar ReactInstanceMap = _dereq_(70);\nvar ReactUpdates = _dereq_(93);\n\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\nfunction enqueueUpdate(internalInstance) {\n  ReactUpdates.enqueueUpdate(internalInstance);\n}\n\nfunction formatUnexpectedArgument(arg) {\n  var type = typeof arg;\n  if (type !== 'object') {\n    return type;\n  }\n  var displayName = arg.constructor && arg.constructor.name || type;\n  var keys = Object.keys(arg);\n  if (keys.length > 0 && keys.length < 20) {\n    return displayName + ' (keys: ' + keys.join(', ') + ')';\n  }\n  return displayName;\n}\n\nfunction getInternalInstanceReadyForUpdate(publicInstance, callerName) {\n  var internalInstance = ReactInstanceMap.get(publicInstance);\n  if (!internalInstance) {\n    if (\"development\" !== 'production') {\n      // Only warn when we have a callerName. Otherwise we should be silent.\n      // We're probably calling from enqueueCallback. We don't want to warn\n      // there because we already warned for the corresponding lifecycle method.\n      \"development\" !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : void 0;\n    }\n    return null;\n  }\n\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;\n  }\n\n  return internalInstance;\n}\n\n/**\n * ReactUpdateQueue allows for state updates to be scheduled into a later\n * reconciliation step.\n */\nvar ReactUpdateQueue = {\n\n  /**\n   * Checks whether or not this composite component is mounted.\n   * @param {ReactClass} publicInstance The instance we want to test.\n   * @return {boolean} True if mounted, false otherwise.\n   * @protected\n   * @final\n   */\n  isMounted: function (publicInstance) {\n    if (\"development\" !== 'production') {\n      var owner = ReactCurrentOwner.current;\n      if (owner !== null) {\n        \"development\" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%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.', owner.getName() || 'A component') : void 0;\n        owner._warnedAboutRefsInRender = true;\n      }\n    }\n    var internalInstance = ReactInstanceMap.get(publicInstance);\n    if (internalInstance) {\n      // During componentWillMount and render this will still be null but after\n      // that will always render to something. At least for now. So we can use\n      // this hack.\n      return !!internalInstance._renderedComponent;\n    } else {\n      return false;\n    }\n  },\n\n  /**\n   * Enqueue a callback that will be executed after all the pending updates\n   * have processed.\n   *\n   * @param {ReactClass} publicInstance The instance to use as `this` context.\n   * @param {?function} callback Called after state is updated.\n   * @param {string} callerName Name of the calling function in the public API.\n   * @internal\n   */\n  enqueueCallback: function (publicInstance, callback, callerName) {\n    ReactUpdateQueue.validateCallback(callback, callerName);\n    var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);\n\n    // Previously we would throw an error if we didn't have an internal\n    // instance. Since we want to make it a no-op instead, we mirror the same\n    // behavior we have in other enqueue* methods.\n    // We also need to ignore callbacks in componentWillMount. See\n    // enqueueUpdates.\n    if (!internalInstance) {\n      return null;\n    }\n\n    if (internalInstance._pendingCallbacks) {\n      internalInstance._pendingCallbacks.push(callback);\n    } else {\n      internalInstance._pendingCallbacks = [callback];\n    }\n    // TODO: The callback here is ignored when setState is called from\n    // componentWillMount. Either fix it or disallow doing so completely in\n    // favor of getInitialState. Alternatively, we can disallow\n    // componentWillMount during server-side rendering.\n    enqueueUpdate(internalInstance);\n  },\n\n  enqueueCallbackInternal: function (internalInstance, callback) {\n    if (internalInstance._pendingCallbacks) {\n      internalInstance._pendingCallbacks.push(callback);\n    } else {\n      internalInstance._pendingCallbacks = [callback];\n    }\n    enqueueUpdate(internalInstance);\n  },\n\n  /**\n   * Forces an update. This should only be invoked when it is known with\n   * certainty that we are **not** in a DOM transaction.\n   *\n   * You may want to call this when you know that some deeper aspect of the\n   * component's state has changed but `setState` was not called.\n   *\n   * This will not invoke `shouldComponentUpdate`, but it will invoke\n   * `componentWillUpdate` and `componentDidUpdate`.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @internal\n   */\n  enqueueForceUpdate: function (publicInstance) {\n    var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');\n\n    if (!internalInstance) {\n      return;\n    }\n\n    internalInstance._pendingForceUpdate = true;\n\n    enqueueUpdate(internalInstance);\n  },\n\n  /**\n   * Replaces all of the state. Always use this or `setState` to mutate state.\n   * You should treat `this.state` as immutable.\n   *\n   * There is no guarantee that `this.state` will be immediately updated, so\n   * accessing `this.state` after calling this method may return the old value.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {object} completeState Next state.\n   * @internal\n   */\n  enqueueReplaceState: function (publicInstance, completeState) {\n    var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');\n\n    if (!internalInstance) {\n      return;\n    }\n\n    internalInstance._pendingStateQueue = [completeState];\n    internalInstance._pendingReplaceState = true;\n\n    enqueueUpdate(internalInstance);\n  },\n\n  /**\n   * Sets a subset of the state. This only exists because _pendingState is\n   * internal. This provides a merging strategy that is not available to deep\n   * properties which is confusing. TODO: Expose pendingState or don't use it\n   * during the merge.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {object} partialState Next partial state to be merged with state.\n   * @internal\n   */\n  enqueueSetState: function (publicInstance, partialState) {\n    var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');\n\n    if (!internalInstance) {\n      return;\n    }\n\n    var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);\n    queue.push(partialState);\n\n    enqueueUpdate(internalInstance);\n  },\n\n  enqueueElementInternal: function (internalInstance, newElement) {\n    internalInstance._pendingElement = newElement;\n    enqueueUpdate(internalInstance);\n  },\n\n  validateCallback: function (callback, callerName) {\n    !(!callback || typeof callback === 'function') ? \"development\" !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;\n  }\n\n};\n\nmodule.exports = ReactUpdateQueue;\n},{\"157\":157,\"167\":167,\"36\":36,\"70\":70,\"93\":93}],93:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactUpdates\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar CallbackQueue = _dereq_(5);\nvar PooledClass = _dereq_(25);\nvar ReactFeatureFlags = _dereq_(67);\nvar ReactInstrumentation = _dereq_(71);\nvar ReactReconciler = _dereq_(86);\nvar Transaction = _dereq_(111);\n\nvar invariant = _dereq_(157);\n\nvar dirtyComponents = [];\nvar updateBatchNumber = 0;\nvar asapCallbackQueue = CallbackQueue.getPooled();\nvar asapEnqueued = false;\n\nvar batchingStrategy = null;\n\nfunction ensureInjected() {\n  !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;\n}\n\nvar NESTED_UPDATES = {\n  initialize: function () {\n    this.dirtyComponentsLength = dirtyComponents.length;\n  },\n  close: function () {\n    if (this.dirtyComponentsLength !== dirtyComponents.length) {\n      // Additional updates were enqueued by componentDidUpdate handlers or\n      // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run\n      // these new updates so that if A's componentDidUpdate calls setState on\n      // B, B will update before the callback A's updater provided when calling\n      // setState.\n      dirtyComponents.splice(0, this.dirtyComponentsLength);\n      flushBatchedUpdates();\n    } else {\n      dirtyComponents.length = 0;\n    }\n  }\n};\n\nvar UPDATE_QUEUEING = {\n  initialize: function () {\n    this.callbackQueue.reset();\n  },\n  close: function () {\n    this.callbackQueue.notifyAll();\n  }\n};\n\nvar TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];\n\nfunction ReactUpdatesFlushTransaction() {\n  this.reinitializeTransaction();\n  this.dirtyComponentsLength = null;\n  this.callbackQueue = CallbackQueue.getPooled();\n  this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(\n  /* useCreateElement */true);\n}\n\n_assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {\n  getTransactionWrappers: function () {\n    return TRANSACTION_WRAPPERS;\n  },\n\n  destructor: function () {\n    this.dirtyComponentsLength = null;\n    CallbackQueue.release(this.callbackQueue);\n    this.callbackQueue = null;\n    ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);\n    this.reconcileTransaction = null;\n  },\n\n  perform: function (method, scope, a) {\n    // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`\n    // with this transaction's wrappers around it.\n    return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);\n  }\n});\n\nPooledClass.addPoolingTo(ReactUpdatesFlushTransaction);\n\nfunction batchedUpdates(callback, a, b, c, d, e) {\n  ensureInjected();\n  batchingStrategy.batchedUpdates(callback, a, b, c, d, e);\n}\n\n/**\n * Array comparator for ReactComponents by mount ordering.\n *\n * @param {ReactComponent} c1 first component you're comparing\n * @param {ReactComponent} c2 second component you're comparing\n * @return {number} Return value usable by Array.prototype.sort().\n */\nfunction mountOrderComparator(c1, c2) {\n  return c1._mountOrder - c2._mountOrder;\n}\n\nfunction runBatchedUpdates(transaction) {\n  var len = transaction.dirtyComponentsLength;\n  !(len === dirtyComponents.length) ? \"development\" !== 'production' ? invariant(false, 'Expected flush transaction\\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;\n\n  // Since reconciling a component higher in the owner hierarchy usually (not\n  // always -- see shouldComponentUpdate()) will reconcile children, reconcile\n  // them before their children by sorting the array.\n  dirtyComponents.sort(mountOrderComparator);\n\n  // Any updates enqueued while reconciling must be performed after this entire\n  // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and\n  // C, B could update twice in a single batch if C's render enqueues an update\n  // to B (since B would have already updated, we should skip it, and the only\n  // way we can know to do so is by checking the batch counter).\n  updateBatchNumber++;\n\n  for (var i = 0; i < len; i++) {\n    // If a component is unmounted before pending changes apply, it will still\n    // be here, but we assume that it has cleared its _pendingCallbacks and\n    // that performUpdateIfNecessary is a noop.\n    var component = dirtyComponents[i];\n\n    // If performUpdateIfNecessary happens to enqueue any new updates, we\n    // shouldn't execute the callbacks until the next render happens, so\n    // stash the callbacks first\n    var callbacks = component._pendingCallbacks;\n    component._pendingCallbacks = null;\n\n    var markerName;\n    if (ReactFeatureFlags.logTopLevelRenders) {\n      var namedComponent = component;\n      // Duck type TopLevelWrapper. This is probably always true.\n      if (component._currentElement.props === component._renderedComponent._currentElement) {\n        namedComponent = component._renderedComponent;\n      }\n      markerName = 'React update: ' + namedComponent.getName();\n      console.time(markerName);\n    }\n\n    ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);\n\n    if (markerName) {\n      console.timeEnd(markerName);\n    }\n\n    if (callbacks) {\n      for (var j = 0; j < callbacks.length; j++) {\n        transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());\n      }\n    }\n  }\n}\n\nvar flushBatchedUpdates = function () {\n  if (\"development\" !== 'production') {\n    ReactInstrumentation.debugTool.onBeginFlush();\n  }\n\n  // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents\n  // array and perform any updates enqueued by mount-ready handlers (i.e.,\n  // componentDidUpdate) but we need to check here too in order to catch\n  // updates enqueued by setState callbacks and asap calls.\n  while (dirtyComponents.length || asapEnqueued) {\n    if (dirtyComponents.length) {\n      var transaction = ReactUpdatesFlushTransaction.getPooled();\n      transaction.perform(runBatchedUpdates, null, transaction);\n      ReactUpdatesFlushTransaction.release(transaction);\n    }\n\n    if (asapEnqueued) {\n      asapEnqueued = false;\n      var queue = asapCallbackQueue;\n      asapCallbackQueue = CallbackQueue.getPooled();\n      queue.notifyAll();\n      CallbackQueue.release(queue);\n    }\n  }\n\n  if (\"development\" !== 'production') {\n    ReactInstrumentation.debugTool.onEndFlush();\n  }\n};\n\n/**\n * Mark a component as needing a rerender, adding an optional callback to a\n * list of functions which will be executed once the rerender occurs.\n */\nfunction enqueueUpdate(component) {\n  ensureInjected();\n\n  // Various parts of our code (such as ReactCompositeComponent's\n  // _renderValidatedComponent) assume that calls to render aren't nested;\n  // verify that that's the case. (This is called by each top-level update\n  // function, like setProps, setState, forceUpdate, etc.; creation and\n  // destruction of top-level components is guarded in ReactMount.)\n\n  if (!batchingStrategy.isBatchingUpdates) {\n    batchingStrategy.batchedUpdates(enqueueUpdate, component);\n    return;\n  }\n\n  dirtyComponents.push(component);\n  if (component._updateBatchNumber == null) {\n    component._updateBatchNumber = updateBatchNumber + 1;\n  }\n}\n\n/**\n * Enqueue a callback to be run at the end of the current batching cycle. Throws\n * if no updates are currently being performed.\n */\nfunction asap(callback, context) {\n  !batchingStrategy.isBatchingUpdates ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n  asapCallbackQueue.enqueue(callback, context);\n  asapEnqueued = true;\n}\n\nvar ReactUpdatesInjection = {\n  injectReconcileTransaction: function (ReconcileTransaction) {\n    !ReconcileTransaction ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;\n    ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;\n  },\n\n  injectBatchingStrategy: function (_batchingStrategy) {\n    !_batchingStrategy ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;\n    !(typeof _batchingStrategy.batchedUpdates === 'function') ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;\n    !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;\n    batchingStrategy = _batchingStrategy;\n  }\n};\n\nvar ReactUpdates = {\n  /**\n   * React references `ReactReconcileTransaction` using this property in order\n   * to allow dependency injection.\n   *\n   * @internal\n   */\n  ReactReconcileTransaction: null,\n\n  batchedUpdates: batchedUpdates,\n  enqueueUpdate: enqueueUpdate,\n  flushBatchedUpdates: flushBatchedUpdates,\n  injection: ReactUpdatesInjection,\n  asap: asap\n};\n\nmodule.exports = ReactUpdates;\n},{\"111\":111,\"157\":157,\"168\":168,\"25\":25,\"5\":5,\"67\":67,\"71\":71,\"86\":86}],94:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactVersion\n */\n\n'use strict';\n\nmodule.exports = '15.1.0';\n},{}],95:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SVGDOMPropertyConfig\n */\n\n'use strict';\n\nvar NS = {\n  xlink: 'http://www.w3.org/1999/xlink',\n  xml: 'http://www.w3.org/XML/1998/namespace'\n};\n\n// We use attributes for everything SVG so let's avoid some duplication and run\n// code instead.\n// The following are all specified in the HTML config already so we exclude here.\n// - class (as className)\n// - color\n// - height\n// - id\n// - lang\n// - max\n// - media\n// - method\n// - min\n// - name\n// - style\n// - target\n// - type\n// - width\nvar ATTRS = {\n  accentHeight: 'accent-height',\n  accumulate: 0,\n  additive: 0,\n  alignmentBaseline: 'alignment-baseline',\n  allowReorder: 'allowReorder',\n  alphabetic: 0,\n  amplitude: 0,\n  arabicForm: 'arabic-form',\n  ascent: 0,\n  attributeName: 'attributeName',\n  attributeType: 'attributeType',\n  autoReverse: 'autoReverse',\n  azimuth: 0,\n  baseFrequency: 'baseFrequency',\n  baseProfile: 'baseProfile',\n  baselineShift: 'baseline-shift',\n  bbox: 0,\n  begin: 0,\n  bias: 0,\n  by: 0,\n  calcMode: 'calcMode',\n  capHeight: 'cap-height',\n  clip: 0,\n  clipPath: 'clip-path',\n  clipRule: 'clip-rule',\n  clipPathUnits: 'clipPathUnits',\n  colorInterpolation: 'color-interpolation',\n  colorInterpolationFilters: 'color-interpolation-filters',\n  colorProfile: 'color-profile',\n  colorRendering: 'color-rendering',\n  contentScriptType: 'contentScriptType',\n  contentStyleType: 'contentStyleType',\n  cursor: 0,\n  cx: 0,\n  cy: 0,\n  d: 0,\n  decelerate: 0,\n  descent: 0,\n  diffuseConstant: 'diffuseConstant',\n  direction: 0,\n  display: 0,\n  divisor: 0,\n  dominantBaseline: 'dominant-baseline',\n  dur: 0,\n  dx: 0,\n  dy: 0,\n  edgeMode: 'edgeMode',\n  elevation: 0,\n  enableBackground: 'enable-background',\n  end: 0,\n  exponent: 0,\n  externalResourcesRequired: 'externalResourcesRequired',\n  fill: 0,\n  fillOpacity: 'fill-opacity',\n  fillRule: 'fill-rule',\n  filter: 0,\n  filterRes: 'filterRes',\n  filterUnits: 'filterUnits',\n  floodColor: 'flood-color',\n  floodOpacity: 'flood-opacity',\n  focusable: 0,\n  fontFamily: 'font-family',\n  fontSize: 'font-size',\n  fontSizeAdjust: 'font-size-adjust',\n  fontStretch: 'font-stretch',\n  fontStyle: 'font-style',\n  fontVariant: 'font-variant',\n  fontWeight: 'font-weight',\n  format: 0,\n  from: 0,\n  fx: 0,\n  fy: 0,\n  g1: 0,\n  g2: 0,\n  glyphName: 'glyph-name',\n  glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n  glyphOrientationVertical: 'glyph-orientation-vertical',\n  glyphRef: 'glyphRef',\n  gradientTransform: 'gradientTransform',\n  gradientUnits: 'gradientUnits',\n  hanging: 0,\n  horizAdvX: 'horiz-adv-x',\n  horizOriginX: 'horiz-origin-x',\n  ideographic: 0,\n  imageRendering: 'image-rendering',\n  'in': 0,\n  in2: 0,\n  intercept: 0,\n  k: 0,\n  k1: 0,\n  k2: 0,\n  k3: 0,\n  k4: 0,\n  kernelMatrix: 'kernelMatrix',\n  kernelUnitLength: 'kernelUnitLength',\n  kerning: 0,\n  keyPoints: 'keyPoints',\n  keySplines: 'keySplines',\n  keyTimes: 'keyTimes',\n  lengthAdjust: 'lengthAdjust',\n  letterSpacing: 'letter-spacing',\n  lightingColor: 'lighting-color',\n  limitingConeAngle: 'limitingConeAngle',\n  local: 0,\n  markerEnd: 'marker-end',\n  markerMid: 'marker-mid',\n  markerStart: 'marker-start',\n  markerHeight: 'markerHeight',\n  markerUnits: 'markerUnits',\n  markerWidth: 'markerWidth',\n  mask: 0,\n  maskContentUnits: 'maskContentUnits',\n  maskUnits: 'maskUnits',\n  mathematical: 0,\n  mode: 0,\n  numOctaves: 'numOctaves',\n  offset: 0,\n  opacity: 0,\n  operator: 0,\n  order: 0,\n  orient: 0,\n  orientation: 0,\n  origin: 0,\n  overflow: 0,\n  overlinePosition: 'overline-position',\n  overlineThickness: 'overline-thickness',\n  paintOrder: 'paint-order',\n  panose1: 'panose-1',\n  pathLength: 'pathLength',\n  patternContentUnits: 'patternContentUnits',\n  patternTransform: 'patternTransform',\n  patternUnits: 'patternUnits',\n  pointerEvents: 'pointer-events',\n  points: 0,\n  pointsAtX: 'pointsAtX',\n  pointsAtY: 'pointsAtY',\n  pointsAtZ: 'pointsAtZ',\n  preserveAlpha: 'preserveAlpha',\n  preserveAspectRatio: 'preserveAspectRatio',\n  primitiveUnits: 'primitiveUnits',\n  r: 0,\n  radius: 0,\n  refX: 'refX',\n  refY: 'refY',\n  renderingIntent: 'rendering-intent',\n  repeatCount: 'repeatCount',\n  repeatDur: 'repeatDur',\n  requiredExtensions: 'requiredExtensions',\n  requiredFeatures: 'requiredFeatures',\n  restart: 0,\n  result: 0,\n  rotate: 0,\n  rx: 0,\n  ry: 0,\n  scale: 0,\n  seed: 0,\n  shapeRendering: 'shape-rendering',\n  slope: 0,\n  spacing: 0,\n  specularConstant: 'specularConstant',\n  specularExponent: 'specularExponent',\n  speed: 0,\n  spreadMethod: 'spreadMethod',\n  startOffset: 'startOffset',\n  stdDeviation: 'stdDeviation',\n  stemh: 0,\n  stemv: 0,\n  stitchTiles: 'stitchTiles',\n  stopColor: 'stop-color',\n  stopOpacity: 'stop-opacity',\n  strikethroughPosition: 'strikethrough-position',\n  strikethroughThickness: 'strikethrough-thickness',\n  string: 0,\n  stroke: 0,\n  strokeDasharray: 'stroke-dasharray',\n  strokeDashoffset: 'stroke-dashoffset',\n  strokeLinecap: 'stroke-linecap',\n  strokeLinejoin: 'stroke-linejoin',\n  strokeMiterlimit: 'stroke-miterlimit',\n  strokeOpacity: 'stroke-opacity',\n  strokeWidth: 'stroke-width',\n  surfaceScale: 'surfaceScale',\n  systemLanguage: 'systemLanguage',\n  tableValues: 'tableValues',\n  targetX: 'targetX',\n  targetY: 'targetY',\n  textAnchor: 'text-anchor',\n  textDecoration: 'text-decoration',\n  textRendering: 'text-rendering',\n  textLength: 'textLength',\n  to: 0,\n  transform: 0,\n  u1: 0,\n  u2: 0,\n  underlinePosition: 'underline-position',\n  underlineThickness: 'underline-thickness',\n  unicode: 0,\n  unicodeBidi: 'unicode-bidi',\n  unicodeRange: 'unicode-range',\n  unitsPerEm: 'units-per-em',\n  vAlphabetic: 'v-alphabetic',\n  vHanging: 'v-hanging',\n  vIdeographic: 'v-ideographic',\n  vMathematical: 'v-mathematical',\n  values: 0,\n  vectorEffect: 'vector-effect',\n  version: 0,\n  vertAdvY: 'vert-adv-y',\n  vertOriginX: 'vert-origin-x',\n  vertOriginY: 'vert-origin-y',\n  viewBox: 'viewBox',\n  viewTarget: 'viewTarget',\n  visibility: 0,\n  widths: 0,\n  wordSpacing: 'word-spacing',\n  writingMode: 'writing-mode',\n  x: 0,\n  xHeight: 'x-height',\n  x1: 0,\n  x2: 0,\n  xChannelSelector: 'xChannelSelector',\n  xlinkActuate: 'xlink:actuate',\n  xlinkArcrole: 'xlink:arcrole',\n  xlinkHref: 'xlink:href',\n  xlinkRole: 'xlink:role',\n  xlinkShow: 'xlink:show',\n  xlinkTitle: 'xlink:title',\n  xlinkType: 'xlink:type',\n  xmlBase: 'xml:base',\n  xmlLang: 'xml:lang',\n  xmlSpace: 'xml:space',\n  y: 0,\n  y1: 0,\n  y2: 0,\n  yChannelSelector: 'yChannelSelector',\n  z: 0,\n  zoomAndPan: 'zoomAndPan'\n};\n\nvar SVGDOMPropertyConfig = {\n  Properties: {},\n  DOMAttributeNamespaces: {\n    xlinkActuate: NS.xlink,\n    xlinkArcrole: NS.xlink,\n    xlinkHref: NS.xlink,\n    xlinkRole: NS.xlink,\n    xlinkShow: NS.xlink,\n    xlinkTitle: NS.xlink,\n    xlinkType: NS.xlink,\n    xmlBase: NS.xml,\n    xmlLang: NS.xml,\n    xmlSpace: NS.xml\n  },\n  DOMAttributeNames: {}\n};\n\nObject.keys(ATTRS).forEach(function (key) {\n  SVGDOMPropertyConfig.Properties[key] = 0;\n  if (ATTRS[key]) {\n    SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];\n  }\n});\n\nmodule.exports = SVGDOMPropertyConfig;\n},{}],96:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SelectEventPlugin\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar EventPropagators = _dereq_(20);\nvar ExecutionEnvironment = _dereq_(143);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactInputSelection = _dereq_(69);\nvar SyntheticEvent = _dereq_(102);\n\nvar getActiveElement = _dereq_(152);\nvar isTextInputElement = _dereq_(133);\nvar keyOf = _dereq_(161);\nvar shallowEqual = _dereq_(166);\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;\n\nvar eventTypes = {\n  select: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onSelect: null }),\n      captured: keyOf({ onSelectCapture: null })\n    },\n    dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]\n  }\n};\n\nvar activeElement = null;\nvar activeElementInst = null;\nvar lastSelection = null;\nvar mouseDown = false;\n\n// Track whether a listener exists for this plugin. If none exist, we do\n// not extract events. See #3639.\nvar hasListener = false;\nvar ON_SELECT_KEY = keyOf({ onSelect: null });\n\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(node) {\n  if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {\n    return {\n      start: node.selectionStart,\n      end: node.selectionEnd\n    };\n  } else if (window.getSelection) {\n    var selection = window.getSelection();\n    return {\n      anchorNode: selection.anchorNode,\n      anchorOffset: selection.anchorOffset,\n      focusNode: selection.focusNode,\n      focusOffset: selection.focusOffset\n    };\n  } else if (document.selection) {\n    var range = document.selection.createRange();\n    return {\n      parentElement: range.parentElement(),\n      text: range.text,\n      top: range.boundingTop,\n      left: range.boundingLeft\n    };\n  }\n}\n\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\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  if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {\n    return null;\n  }\n\n  // Only fire when selection has actually changed.\n  var currentSelection = getSelection(activeElement);\n  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n    lastSelection = currentSelection;\n\n    var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);\n\n    syntheticEvent.type = 'select';\n    syntheticEvent.target = activeElement;\n\n    EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);\n\n    return syntheticEvent;\n  }\n\n  return null;\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 */\nvar SelectEventPlugin = {\n\n  eventTypes: eventTypes,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    if (!hasListener) {\n      return null;\n    }\n\n    var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;\n\n    switch (topLevelType) {\n      // Track the input node that has focus.\n      case topLevelTypes.topFocus:\n        if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n          activeElement = targetNode;\n          activeElementInst = targetInst;\n          lastSelection = null;\n        }\n        break;\n      case topLevelTypes.topBlur:\n        activeElement = null;\n        activeElementInst = null;\n        lastSelection = null;\n        break;\n\n      // Don't fire the event while the user is dragging. This matches the\n      // semantics of the native select event.\n      case topLevelTypes.topMouseDown:\n        mouseDown = true;\n        break;\n      case topLevelTypes.topContextMenu:\n      case topLevelTypes.topMouseUp:\n        mouseDown = false;\n        return constructSelectEvent(nativeEvent, nativeEventTarget);\n\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 topLevelTypes.topSelectionChange:\n        if (skipSelectionChangeEvent) {\n          break;\n        }\n      // falls through\n      case topLevelTypes.topKeyDown:\n      case topLevelTypes.topKeyUp:\n        return constructSelectEvent(nativeEvent, nativeEventTarget);\n    }\n\n    return null;\n  },\n\n  didPutListener: function (inst, registrationName, listener) {\n    if (registrationName === ON_SELECT_KEY) {\n      hasListener = true;\n    }\n  }\n};\n\nmodule.exports = SelectEventPlugin;\n},{\"102\":102,\"133\":133,\"143\":143,\"152\":152,\"16\":16,\"161\":161,\"166\":166,\"20\":20,\"41\":41,\"69\":69}],97:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SimpleEventPlugin\n */\n\n'use strict';\n\nvar EventConstants = _dereq_(16);\nvar EventListener = _dereq_(142);\nvar EventPropagators = _dereq_(20);\nvar ReactDOMComponentTree = _dereq_(41);\nvar SyntheticAnimationEvent = _dereq_(98);\nvar SyntheticClipboardEvent = _dereq_(99);\nvar SyntheticEvent = _dereq_(102);\nvar SyntheticFocusEvent = _dereq_(103);\nvar SyntheticKeyboardEvent = _dereq_(105);\nvar SyntheticMouseEvent = _dereq_(106);\nvar SyntheticDragEvent = _dereq_(101);\nvar SyntheticTouchEvent = _dereq_(107);\nvar SyntheticTransitionEvent = _dereq_(108);\nvar SyntheticUIEvent = _dereq_(109);\nvar SyntheticWheelEvent = _dereq_(110);\n\nvar emptyFunction = _dereq_(149);\nvar getEventCharCode = _dereq_(122);\nvar invariant = _dereq_(157);\nvar keyOf = _dereq_(161);\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar eventTypes = {\n  abort: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onAbort: true }),\n      captured: keyOf({ onAbortCapture: true })\n    }\n  },\n  animationEnd: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onAnimationEnd: true }),\n      captured: keyOf({ onAnimationEndCapture: true })\n    }\n  },\n  animationIteration: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onAnimationIteration: true }),\n      captured: keyOf({ onAnimationIterationCapture: true })\n    }\n  },\n  animationStart: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onAnimationStart: true }),\n      captured: keyOf({ onAnimationStartCapture: true })\n    }\n  },\n  blur: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onBlur: true }),\n      captured: keyOf({ onBlurCapture: true })\n    }\n  },\n  canPlay: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCanPlay: true }),\n      captured: keyOf({ onCanPlayCapture: true })\n    }\n  },\n  canPlayThrough: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCanPlayThrough: true }),\n      captured: keyOf({ onCanPlayThroughCapture: true })\n    }\n  },\n  click: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onClick: true }),\n      captured: keyOf({ onClickCapture: true })\n    }\n  },\n  contextMenu: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onContextMenu: true }),\n      captured: keyOf({ onContextMenuCapture: true })\n    }\n  },\n  copy: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCopy: true }),\n      captured: keyOf({ onCopyCapture: true })\n    }\n  },\n  cut: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onCut: true }),\n      captured: keyOf({ onCutCapture: true })\n    }\n  },\n  doubleClick: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDoubleClick: true }),\n      captured: keyOf({ onDoubleClickCapture: true })\n    }\n  },\n  drag: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDrag: true }),\n      captured: keyOf({ onDragCapture: true })\n    }\n  },\n  dragEnd: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDragEnd: true }),\n      captured: keyOf({ onDragEndCapture: true })\n    }\n  },\n  dragEnter: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDragEnter: true }),\n      captured: keyOf({ onDragEnterCapture: true })\n    }\n  },\n  dragExit: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDragExit: true }),\n      captured: keyOf({ onDragExitCapture: true })\n    }\n  },\n  dragLeave: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDragLeave: true }),\n      captured: keyOf({ onDragLeaveCapture: true })\n    }\n  },\n  dragOver: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDragOver: true }),\n      captured: keyOf({ onDragOverCapture: true })\n    }\n  },\n  dragStart: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDragStart: true }),\n      captured: keyOf({ onDragStartCapture: true })\n    }\n  },\n  drop: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDrop: true }),\n      captured: keyOf({ onDropCapture: true })\n    }\n  },\n  durationChange: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onDurationChange: true }),\n      captured: keyOf({ onDurationChangeCapture: true })\n    }\n  },\n  emptied: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onEmptied: true }),\n      captured: keyOf({ onEmptiedCapture: true })\n    }\n  },\n  encrypted: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onEncrypted: true }),\n      captured: keyOf({ onEncryptedCapture: true })\n    }\n  },\n  ended: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onEnded: true }),\n      captured: keyOf({ onEndedCapture: true })\n    }\n  },\n  error: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onError: true }),\n      captured: keyOf({ onErrorCapture: true })\n    }\n  },\n  focus: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onFocus: true }),\n      captured: keyOf({ onFocusCapture: true })\n    }\n  },\n  input: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onInput: true }),\n      captured: keyOf({ onInputCapture: true })\n    }\n  },\n  invalid: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onInvalid: true }),\n      captured: keyOf({ onInvalidCapture: true })\n    }\n  },\n  keyDown: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onKeyDown: true }),\n      captured: keyOf({ onKeyDownCapture: true })\n    }\n  },\n  keyPress: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onKeyPress: true }),\n      captured: keyOf({ onKeyPressCapture: true })\n    }\n  },\n  keyUp: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onKeyUp: true }),\n      captured: keyOf({ onKeyUpCapture: true })\n    }\n  },\n  load: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onLoad: true }),\n      captured: keyOf({ onLoadCapture: true })\n    }\n  },\n  loadedData: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onLoadedData: true }),\n      captured: keyOf({ onLoadedDataCapture: true })\n    }\n  },\n  loadedMetadata: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onLoadedMetadata: true }),\n      captured: keyOf({ onLoadedMetadataCapture: true })\n    }\n  },\n  loadStart: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onLoadStart: true }),\n      captured: keyOf({ onLoadStartCapture: true })\n    }\n  },\n  // Note: We do not allow listening to mouseOver events. Instead, use the\n  // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.\n  mouseDown: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onMouseDown: true }),\n      captured: keyOf({ onMouseDownCapture: true })\n    }\n  },\n  mouseMove: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onMouseMove: true }),\n      captured: keyOf({ onMouseMoveCapture: true })\n    }\n  },\n  mouseOut: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onMouseOut: true }),\n      captured: keyOf({ onMouseOutCapture: true })\n    }\n  },\n  mouseOver: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onMouseOver: true }),\n      captured: keyOf({ onMouseOverCapture: true })\n    }\n  },\n  mouseUp: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onMouseUp: true }),\n      captured: keyOf({ onMouseUpCapture: true })\n    }\n  },\n  paste: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onPaste: true }),\n      captured: keyOf({ onPasteCapture: true })\n    }\n  },\n  pause: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onPause: true }),\n      captured: keyOf({ onPauseCapture: true })\n    }\n  },\n  play: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onPlay: true }),\n      captured: keyOf({ onPlayCapture: true })\n    }\n  },\n  playing: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onPlaying: true }),\n      captured: keyOf({ onPlayingCapture: true })\n    }\n  },\n  progress: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onProgress: true }),\n      captured: keyOf({ onProgressCapture: true })\n    }\n  },\n  rateChange: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onRateChange: true }),\n      captured: keyOf({ onRateChangeCapture: true })\n    }\n  },\n  reset: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onReset: true }),\n      captured: keyOf({ onResetCapture: true })\n    }\n  },\n  scroll: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onScroll: true }),\n      captured: keyOf({ onScrollCapture: true })\n    }\n  },\n  seeked: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onSeeked: true }),\n      captured: keyOf({ onSeekedCapture: true })\n    }\n  },\n  seeking: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onSeeking: true }),\n      captured: keyOf({ onSeekingCapture: true })\n    }\n  },\n  stalled: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onStalled: true }),\n      captured: keyOf({ onStalledCapture: true })\n    }\n  },\n  submit: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onSubmit: true }),\n      captured: keyOf({ onSubmitCapture: true })\n    }\n  },\n  suspend: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onSuspend: true }),\n      captured: keyOf({ onSuspendCapture: true })\n    }\n  },\n  timeUpdate: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onTimeUpdate: true }),\n      captured: keyOf({ onTimeUpdateCapture: true })\n    }\n  },\n  touchCancel: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onTouchCancel: true }),\n      captured: keyOf({ onTouchCancelCapture: true })\n    }\n  },\n  touchEnd: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onTouchEnd: true }),\n      captured: keyOf({ onTouchEndCapture: true })\n    }\n  },\n  touchMove: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onTouchMove: true }),\n      captured: keyOf({ onTouchMoveCapture: true })\n    }\n  },\n  touchStart: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onTouchStart: true }),\n      captured: keyOf({ onTouchStartCapture: true })\n    }\n  },\n  transitionEnd: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onTransitionEnd: true }),\n      captured: keyOf({ onTransitionEndCapture: true })\n    }\n  },\n  volumeChange: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onVolumeChange: true }),\n      captured: keyOf({ onVolumeChangeCapture: true })\n    }\n  },\n  waiting: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onWaiting: true }),\n      captured: keyOf({ onWaitingCapture: true })\n    }\n  },\n  wheel: {\n    phasedRegistrationNames: {\n      bubbled: keyOf({ onWheel: true }),\n      captured: keyOf({ onWheelCapture: true })\n    }\n  }\n};\n\nvar topLevelEventsToDispatchConfig = {\n  topAbort: eventTypes.abort,\n  topAnimationEnd: eventTypes.animationEnd,\n  topAnimationIteration: eventTypes.animationIteration,\n  topAnimationStart: eventTypes.animationStart,\n  topBlur: eventTypes.blur,\n  topCanPlay: eventTypes.canPlay,\n  topCanPlayThrough: eventTypes.canPlayThrough,\n  topClick: eventTypes.click,\n  topContextMenu: eventTypes.contextMenu,\n  topCopy: eventTypes.copy,\n  topCut: eventTypes.cut,\n  topDoubleClick: eventTypes.doubleClick,\n  topDrag: eventTypes.drag,\n  topDragEnd: eventTypes.dragEnd,\n  topDragEnter: eventTypes.dragEnter,\n  topDragExit: eventTypes.dragExit,\n  topDragLeave: eventTypes.dragLeave,\n  topDragOver: eventTypes.dragOver,\n  topDragStart: eventTypes.dragStart,\n  topDrop: eventTypes.drop,\n  topDurationChange: eventTypes.durationChange,\n  topEmptied: eventTypes.emptied,\n  topEncrypted: eventTypes.encrypted,\n  topEnded: eventTypes.ended,\n  topError: eventTypes.error,\n  topFocus: eventTypes.focus,\n  topInput: eventTypes.input,\n  topInvalid: eventTypes.invalid,\n  topKeyDown: eventTypes.keyDown,\n  topKeyPress: eventTypes.keyPress,\n  topKeyUp: eventTypes.keyUp,\n  topLoad: eventTypes.load,\n  topLoadedData: eventTypes.loadedData,\n  topLoadedMetadata: eventTypes.loadedMetadata,\n  topLoadStart: eventTypes.loadStart,\n  topMouseDown: eventTypes.mouseDown,\n  topMouseMove: eventTypes.mouseMove,\n  topMouseOut: eventTypes.mouseOut,\n  topMouseOver: eventTypes.mouseOver,\n  topMouseUp: eventTypes.mouseUp,\n  topPaste: eventTypes.paste,\n  topPause: eventTypes.pause,\n  topPlay: eventTypes.play,\n  topPlaying: eventTypes.playing,\n  topProgress: eventTypes.progress,\n  topRateChange: eventTypes.rateChange,\n  topReset: eventTypes.reset,\n  topScroll: eventTypes.scroll,\n  topSeeked: eventTypes.seeked,\n  topSeeking: eventTypes.seeking,\n  topStalled: eventTypes.stalled,\n  topSubmit: eventTypes.submit,\n  topSuspend: eventTypes.suspend,\n  topTimeUpdate: eventTypes.timeUpdate,\n  topTouchCancel: eventTypes.touchCancel,\n  topTouchEnd: eventTypes.touchEnd,\n  topTouchMove: eventTypes.touchMove,\n  topTouchStart: eventTypes.touchStart,\n  topTransitionEnd: eventTypes.transitionEnd,\n  topVolumeChange: eventTypes.volumeChange,\n  topWaiting: eventTypes.waiting,\n  topWheel: eventTypes.wheel\n};\n\nfor (var type in topLevelEventsToDispatchConfig) {\n  topLevelEventsToDispatchConfig[type].dependencies = [type];\n}\n\nvar ON_CLICK_KEY = keyOf({ onClick: null });\nvar onClickListeners = {};\n\nvar SimpleEventPlugin = {\n\n  eventTypes: eventTypes,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];\n    if (!dispatchConfig) {\n      return null;\n    }\n    var EventConstructor;\n    switch (topLevelType) {\n      case topLevelTypes.topAbort:\n      case topLevelTypes.topCanPlay:\n      case topLevelTypes.topCanPlayThrough:\n      case topLevelTypes.topDurationChange:\n      case topLevelTypes.topEmptied:\n      case topLevelTypes.topEncrypted:\n      case topLevelTypes.topEnded:\n      case topLevelTypes.topError:\n      case topLevelTypes.topInput:\n      case topLevelTypes.topInvalid:\n      case topLevelTypes.topLoad:\n      case topLevelTypes.topLoadedData:\n      case topLevelTypes.topLoadedMetadata:\n      case topLevelTypes.topLoadStart:\n      case topLevelTypes.topPause:\n      case topLevelTypes.topPlay:\n      case topLevelTypes.topPlaying:\n      case topLevelTypes.topProgress:\n      case topLevelTypes.topRateChange:\n      case topLevelTypes.topReset:\n      case topLevelTypes.topSeeked:\n      case topLevelTypes.topSeeking:\n      case topLevelTypes.topStalled:\n      case topLevelTypes.topSubmit:\n      case topLevelTypes.topSuspend:\n      case topLevelTypes.topTimeUpdate:\n      case topLevelTypes.topVolumeChange:\n      case topLevelTypes.topWaiting:\n        // HTML Events\n        // @see http://www.w3.org/TR/html5/index.html#events-0\n        EventConstructor = SyntheticEvent;\n        break;\n      case topLevelTypes.topKeyPress:\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 topLevelTypes.topKeyDown:\n      case topLevelTypes.topKeyUp:\n        EventConstructor = SyntheticKeyboardEvent;\n        break;\n      case topLevelTypes.topBlur:\n      case topLevelTypes.topFocus:\n        EventConstructor = SyntheticFocusEvent;\n        break;\n      case topLevelTypes.topClick:\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 topLevelTypes.topContextMenu:\n      case topLevelTypes.topDoubleClick:\n      case topLevelTypes.topMouseDown:\n      case topLevelTypes.topMouseMove:\n      case topLevelTypes.topMouseOut:\n      case topLevelTypes.topMouseOver:\n      case topLevelTypes.topMouseUp:\n        EventConstructor = SyntheticMouseEvent;\n        break;\n      case topLevelTypes.topDrag:\n      case topLevelTypes.topDragEnd:\n      case topLevelTypes.topDragEnter:\n      case topLevelTypes.topDragExit:\n      case topLevelTypes.topDragLeave:\n      case topLevelTypes.topDragOver:\n      case topLevelTypes.topDragStart:\n      case topLevelTypes.topDrop:\n        EventConstructor = SyntheticDragEvent;\n        break;\n      case topLevelTypes.topTouchCancel:\n      case topLevelTypes.topTouchEnd:\n      case topLevelTypes.topTouchMove:\n      case topLevelTypes.topTouchStart:\n        EventConstructor = SyntheticTouchEvent;\n        break;\n      case topLevelTypes.topAnimationEnd:\n      case topLevelTypes.topAnimationIteration:\n      case topLevelTypes.topAnimationStart:\n        EventConstructor = SyntheticAnimationEvent;\n        break;\n      case topLevelTypes.topTransitionEnd:\n        EventConstructor = SyntheticTransitionEvent;\n        break;\n      case topLevelTypes.topScroll:\n        EventConstructor = SyntheticUIEvent;\n        break;\n      case topLevelTypes.topWheel:\n        EventConstructor = SyntheticWheelEvent;\n        break;\n      case topLevelTypes.topCopy:\n      case topLevelTypes.topCut:\n      case topLevelTypes.topPaste:\n        EventConstructor = SyntheticClipboardEvent;\n        break;\n    }\n    !EventConstructor ? \"development\" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : void 0;\n    var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);\n    EventPropagators.accumulateTwoPhaseDispatches(event);\n    return event;\n  },\n\n  didPutListener: function (inst, registrationName, listener) {\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    if (registrationName === ON_CLICK_KEY) {\n      var id = inst._rootNodeID;\n      var node = ReactDOMComponentTree.getNodeFromInstance(inst);\n      if (!onClickListeners[id]) {\n        onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);\n      }\n    }\n  },\n\n  willDeleteListener: function (inst, registrationName) {\n    if (registrationName === ON_CLICK_KEY) {\n      var id = inst._rootNodeID;\n      onClickListeners[id].remove();\n      delete onClickListeners[id];\n    }\n  }\n\n};\n\nmodule.exports = SimpleEventPlugin;\n},{\"101\":101,\"102\":102,\"103\":103,\"105\":105,\"106\":106,\"107\":107,\"108\":108,\"109\":109,\"110\":110,\"122\":122,\"142\":142,\"149\":149,\"157\":157,\"16\":16,\"161\":161,\"20\":20,\"41\":41,\"98\":98,\"99\":99}],98:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticAnimationEvent\n */\n\n'use strict';\n\nvar SyntheticEvent = _dereq_(102);\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 AnimationEventInterface = {\n  animationName: null,\n  elapsedTime: null,\n  pseudoElement: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);\n\nmodule.exports = SyntheticAnimationEvent;\n},{\"102\":102}],99:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticClipboardEvent\n */\n\n'use strict';\n\nvar SyntheticEvent = _dereq_(102);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\nvar ClipboardEventInterface = {\n  clipboardData: function (event) {\n    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);\n\nmodule.exports = SyntheticClipboardEvent;\n},{\"102\":102}],100:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticCompositionEvent\n */\n\n'use strict';\n\nvar SyntheticEvent = _dereq_(102);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\nvar CompositionEventInterface = {\n  data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);\n\nmodule.exports = SyntheticCompositionEvent;\n},{\"102\":102}],101:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticDragEvent\n */\n\n'use strict';\n\nvar SyntheticMouseEvent = _dereq_(106);\n\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar DragEventInterface = {\n  dataTransfer: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);\n\nmodule.exports = SyntheticDragEvent;\n},{\"106\":106}],102:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticEvent\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar PooledClass = _dereq_(25);\n\nvar emptyFunction = _dereq_(149);\nvar warning = _dereq_(167);\n\nvar didWarnForAddedNewProperty = false;\nvar isProxySupported = typeof Proxy === 'function';\n\nvar shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];\n\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: emptyFunction.thatReturnsNull,\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};\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  if (\"development\" !== 'production') {\n    // these have a getter/setter for warnings\n    delete this.nativeEvent;\n    delete this.preventDefault;\n    delete this.stopPropagation;\n  }\n\n  this.dispatchConfig = dispatchConfig;\n  this._targetInst = targetInst;\n  this.nativeEvent = nativeEvent;\n\n  var Interface = this.constructor.Interface;\n  for (var propName in Interface) {\n    if (!Interface.hasOwnProperty(propName)) {\n      continue;\n    }\n    if (\"development\" !== 'production') {\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\n  var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n  if (defaultPrevented) {\n    this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n  } else {\n    this.isDefaultPrevented = emptyFunction.thatReturnsFalse;\n  }\n  this.isPropagationStopped = emptyFunction.thatReturnsFalse;\n  return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n\n  preventDefault: function () {\n    this.defaultPrevented = true;\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n\n    if (event.preventDefault) {\n      event.preventDefault();\n    } else {\n      event.returnValue = false;\n    }\n    this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n  },\n\n  stopPropagation: function () {\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n\n    if (event.stopPropagation) {\n      event.stopPropagation();\n    } else {\n      event.cancelBubble = true;\n    }\n    this.isPropagationStopped = emptyFunction.thatReturnsTrue;\n  },\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 = emptyFunction.thatReturnsTrue;\n  },\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: emptyFunction.thatReturnsFalse,\n\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      if (\"development\" !== 'production') {\n        Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n      } else {\n        this[propName] = null;\n      }\n    }\n    for (var i = 0; i < shouldBeReleasedProperties.length; i++) {\n      this[shouldBeReleasedProperties[i]] = null;\n    }\n    if (\"development\" !== 'production') {\n      var noop = _dereq_(149);\n      Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n      Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', noop));\n      Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', noop));\n    }\n  }\n\n});\n\nSyntheticEvent.Interface = EventInterface;\n\nif (\"development\" !== 'production') {\n  if (isProxySupported) {\n    /*eslint-disable no-func-assign */\n    SyntheticEvent = new Proxy(SyntheticEvent, {\n      construct: function (target, args) {\n        return this.apply(target, Object.create(target.prototype), args);\n      },\n      apply: function (constructor, that, args) {\n        return new Proxy(constructor.apply(that, args), {\n          set: function (target, prop, value) {\n            if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {\n              \"development\" !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\\'re ' + 'seeing this, you\\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;\n              didWarnForAddedNewProperty = true;\n            }\n            target[prop] = value;\n            return true;\n          }\n        });\n      }\n    });\n    /*eslint-enable no-func-assign */\n  }\n}\n/**\n * Helper to reduce boilerplate when creating subclasses.\n *\n * @param {function} Class\n * @param {?object} Interface\n */\nSyntheticEvent.augmentClass = function (Class, Interface) {\n  var Super = this;\n\n  var E = function () {};\n  E.prototype = Super.prototype;\n  var prototype = new E();\n\n  _assign(prototype, Class.prototype);\n  Class.prototype = prototype;\n  Class.prototype.constructor = Class;\n\n  Class.Interface = _assign({}, Super.Interface, Interface);\n  Class.augmentClass = Super.augmentClass;\n\n  PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);\n};\n\nPooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);\n\nmodule.exports = SyntheticEvent;\n\n/**\n  * Helper to nullify syntheticEvent instance properties when destructing\n  *\n  * @param {object} SyntheticEvent\n  * @param {String} propName\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\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\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\n  function warn(action, result) {\n    var warningCondition = false;\n    \"development\" !== 'production' ? warning(warningCondition, '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) : void 0;\n  }\n}\n},{\"149\":149,\"167\":167,\"168\":168,\"25\":25}],103:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticFocusEvent\n */\n\n'use strict';\n\nvar SyntheticUIEvent = _dereq_(109);\n\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar FocusEventInterface = {\n  relatedTarget: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);\n\nmodule.exports = SyntheticFocusEvent;\n},{\"109\":109}],104:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticInputEvent\n */\n\n'use strict';\n\nvar SyntheticEvent = _dereq_(102);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n *      /#events-inputevents\n */\nvar InputEventInterface = {\n  data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);\n\nmodule.exports = SyntheticInputEvent;\n},{\"102\":102}],105:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticKeyboardEvent\n */\n\n'use strict';\n\nvar SyntheticUIEvent = _dereq_(109);\n\nvar getEventCharCode = _dereq_(122);\nvar getEventKey = _dereq_(123);\nvar getEventModifierState = _dereq_(124);\n\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar KeyboardEventInterface = {\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\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\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/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);\n\nmodule.exports = SyntheticKeyboardEvent;\n},{\"109\":109,\"122\":122,\"123\":123,\"124\":124}],106:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticMouseEvent\n */\n\n'use strict';\n\nvar SyntheticUIEvent = _dereq_(109);\nvar ViewportMetrics = _dereq_(112);\n\nvar getEventModifierState = _dereq_(124);\n\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar MouseEventInterface = {\n  screenX: null,\n  screenY: null,\n  clientX: null,\n  clientY: null,\n  ctrlKey: null,\n  shiftKey: null,\n  altKey: null,\n  metaKey: null,\n  getModifierState: getEventModifierState,\n  button: function (event) {\n    // Webkit, Firefox, IE9+\n    // which:  1 2 3\n    // button: 0 1 2 (standard)\n    var button = event.button;\n    if ('which' in event) {\n      return button;\n    }\n    // IE<9\n    // which:  undefined\n    // button: 0 0 0\n    // button: 1 4 2 (onmouseup)\n    return button === 2 ? 2 : button === 4 ? 1 : 0;\n  },\n  buttons: null,\n  relatedTarget: function (event) {\n    return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);\n  },\n  // \"Proprietary\" Interface.\n  pageX: function (event) {\n    return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;\n  },\n  pageY: function (event) {\n    return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);\n\nmodule.exports = SyntheticMouseEvent;\n},{\"109\":109,\"112\":112,\"124\":124}],107:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticTouchEvent\n */\n\n'use strict';\n\nvar SyntheticUIEvent = _dereq_(109);\n\nvar getEventModifierState = _dereq_(124);\n\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\nvar TouchEventInterface = {\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/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);\n\nmodule.exports = SyntheticTouchEvent;\n},{\"109\":109,\"124\":124}],108:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticTransitionEvent\n */\n\n'use strict';\n\nvar SyntheticEvent = _dereq_(102);\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 TransitionEventInterface = {\n  propertyName: null,\n  elapsedTime: null,\n  pseudoElement: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);\n\nmodule.exports = SyntheticTransitionEvent;\n},{\"102\":102}],109:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticUIEvent\n */\n\n'use strict';\n\nvar SyntheticEvent = _dereq_(102);\n\nvar getEventTarget = _dereq_(125);\n\n/**\n * @interface UIEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar UIEventInterface = {\n  view: function (event) {\n    if (event.view) {\n      return event.view;\n    }\n\n    var target = getEventTarget(event);\n    if (target != null && target.window === target) {\n      // target is a window object\n      return target;\n    }\n\n    var doc = target.ownerDocument;\n    // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\n    if (doc) {\n      return doc.defaultView || doc.parentWindow;\n    } else {\n      return window;\n    }\n  },\n  detail: function (event) {\n    return event.detail || 0;\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);\n\nmodule.exports = SyntheticUIEvent;\n},{\"102\":102,\"125\":125}],110:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SyntheticWheelEvent\n */\n\n'use strict';\n\nvar SyntheticMouseEvent = _dereq_(106);\n\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar WheelEventInterface = {\n  deltaX: function (event) {\n    return 'deltaX' in event ? event.deltaX :\n    // 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 :\n    // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n    'wheelDeltaY' in event ? -event.wheelDeltaY :\n    // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).\n    'wheelDelta' in event ? -event.wheelDelta : 0;\n  },\n  deltaZ: null,\n\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};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticMouseEvent}\n */\nfunction SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);\n\nmodule.exports = SyntheticWheelEvent;\n},{\"106\":106}],111:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Transaction\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\n/**\n * `Transaction` creates a black box that is able to wrap any method such that\n * certain invariants are maintained before and after the method is invoked\n * (Even if an exception is thrown while invoking the wrapped method). Whoever\n * instantiates a transaction can provide enforcers of the invariants at\n * creation time. The `Transaction` class itself will supply one additional\n * automatic invariant for you - the invariant that any transaction instance\n * should not be run while it is already being run. You would typically create a\n * single instance of a `Transaction` for reuse multiple times, that potentially\n * is used to wrap several different methods. Wrappers are extremely simple -\n * they only require implementing two methods.\n *\n * <pre>\n *                       wrappers (injected at creation time)\n *                                      +        +\n *                                      |        |\n *                    +-----------------|--------|--------------+\n *                    |                 v        |              |\n *                    |      +---------------+   |              |\n *                    |   +--|    wrapper1   |---|----+         |\n *                    |   |  +---------------+   v    |         |\n *                    |   |          +-------------+  |         |\n *                    |   |     +----|   wrapper2  |--------+   |\n *                    |   |     |    +-------------+  |     |   |\n *                    |   |     |                     |     |   |\n *                    |   v     v                     v     v   | wrapper\n *                    | +---+ +---+   +---------+   +---+ +---+ | invariants\n * perform(anyMethod) | |   | |   |   |         |   |   | |   | | maintained\n * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->\n *                    | |   | |   |   |         |   |   | |   | |\n *                    | |   | |   |   |         |   |   | |   | |\n *                    | |   | |   |   |         |   |   | |   | |\n *                    | +---+ +---+   +---------+   +---+ +---+ |\n *                    |  initialize                    close    |\n *                    +-----------------------------------------+\n * </pre>\n *\n * Use cases:\n * - Preserving the input selection ranges before/after reconciliation.\n *   Restoring selection even in the event of an unexpected error.\n * - Deactivating events while rearranging the DOM, preventing blurs/focuses,\n *   while guaranteeing that afterwards, the event system is reactivated.\n * - Flushing a queue of collected DOM mutations to the main UI thread after a\n *   reconciliation takes place in a worker thread.\n * - Invoking any collected `componentDidUpdate` callbacks after rendering new\n *   content.\n * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue\n *   to preserve the `scrollTop` (an automatic scroll aware DOM).\n * - (Future use case): Layout calculations before and after DOM updates.\n *\n * Transactional plugin API:\n * - A module that has an `initialize` method that returns any precomputation.\n * - and a `close` method that accepts the precomputation. `close` is invoked\n *   when the wrapped process is completed, or has failed.\n *\n * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules\n * that implement `initialize` and `close`.\n * @return {Transaction} Single transaction for reuse in thread.\n *\n * @class Transaction\n */\nvar Mixin = {\n  /**\n   * Sets up this instance so that it is prepared for collecting metrics. Does\n   * so such that this setup method may be used on an instance that is already\n   * initialized, in a way that does not consume additional memory upon reuse.\n   * That can be useful if you decide to make your subclass of this mixin a\n   * \"PooledClass\".\n   */\n  reinitializeTransaction: function () {\n    this.transactionWrappers = this.getTransactionWrappers();\n    if (this.wrapperInitData) {\n      this.wrapperInitData.length = 0;\n    } else {\n      this.wrapperInitData = [];\n    }\n    this._isInTransaction = false;\n  },\n\n  _isInTransaction: false,\n\n  /**\n   * @abstract\n   * @return {Array<TransactionWrapper>} Array of transaction wrappers.\n   */\n  getTransactionWrappers: null,\n\n  isInTransaction: function () {\n    return !!this._isInTransaction;\n  },\n\n  /**\n   * Executes the function within a safety window. Use this for the top level\n   * methods that result in large amounts of computation/mutations that would\n   * need to be safety checked. The optional arguments helps prevent the need\n   * to bind in many cases.\n   *\n   * @param {function} method Member of scope to call.\n   * @param {Object} scope Scope to invoke from.\n   * @param {Object?=} a Argument to pass to the method.\n   * @param {Object?=} b Argument to pass to the method.\n   * @param {Object?=} c Argument to pass to the method.\n   * @param {Object?=} d Argument to pass to the method.\n   * @param {Object?=} e Argument to pass to the method.\n   * @param {Object?=} f Argument to pass to the method.\n   *\n   * @return {*} Return value from `method`.\n   */\n  perform: function (method, scope, a, b, c, d, e, f) {\n    !!this.isInTransaction() ? \"development\" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;\n    var errorThrown;\n    var ret;\n    try {\n      this._isInTransaction = true;\n      // Catching errors makes debugging more difficult, so we start with\n      // errorThrown set to true before setting it to false after calling\n      // close -- if it's still set to true in the finally block, it means\n      // one of these calls threw.\n      errorThrown = true;\n      this.initializeAll(0);\n      ret = method.call(scope, a, b, c, d, e, f);\n      errorThrown = false;\n    } finally {\n      try {\n        if (errorThrown) {\n          // If `method` throws, prefer to show that stack trace over any thrown\n          // by invoking `closeAll`.\n          try {\n            this.closeAll(0);\n          } catch (err) {}\n        } else {\n          // Since `method` didn't throw, we don't want to silence the exception\n          // here.\n          this.closeAll(0);\n        }\n      } finally {\n        this._isInTransaction = false;\n      }\n    }\n    return ret;\n  },\n\n  initializeAll: function (startIndex) {\n    var transactionWrappers = this.transactionWrappers;\n    for (var i = startIndex; i < transactionWrappers.length; i++) {\n      var wrapper = transactionWrappers[i];\n      try {\n        // Catching errors makes debugging more difficult, so we start with the\n        // OBSERVED_ERROR state before overwriting it with the real return value\n        // of initialize -- if it's still set to OBSERVED_ERROR in the finally\n        // block, it means wrapper.initialize threw.\n        this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;\n        this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;\n      } finally {\n        if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {\n          // The initializer for wrapper i threw an error; initialize the\n          // remaining wrappers but silence any exceptions from them to ensure\n          // that the first error is the one to bubble up.\n          try {\n            this.initializeAll(i + 1);\n          } catch (err) {}\n        }\n      }\n    }\n  },\n\n  /**\n   * Invokes each of `this.transactionWrappers.close[i]` functions, passing into\n   * them the respective return values of `this.transactionWrappers.init[i]`\n   * (`close`rs that correspond to initializers that failed will not be\n   * invoked).\n   */\n  closeAll: function (startIndex) {\n    !this.isInTransaction() ? \"development\" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;\n    var transactionWrappers = this.transactionWrappers;\n    for (var i = startIndex; i < transactionWrappers.length; i++) {\n      var wrapper = transactionWrappers[i];\n      var initData = this.wrapperInitData[i];\n      var errorThrown;\n      try {\n        // Catching errors makes debugging more difficult, so we start with\n        // errorThrown set to true before setting it to false after calling\n        // close -- if it's still set to true in the finally block, it means\n        // wrapper.close threw.\n        errorThrown = true;\n        if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {\n          wrapper.close.call(this, initData);\n        }\n        errorThrown = false;\n      } finally {\n        if (errorThrown) {\n          // The closer for wrapper i threw an error; close the remaining\n          // wrappers but silence any exceptions from them to ensure that the\n          // first error is the one to bubble up.\n          try {\n            this.closeAll(i + 1);\n          } catch (e) {}\n        }\n      }\n    }\n    this.wrapperInitData.length = 0;\n  }\n};\n\nvar Transaction = {\n\n  Mixin: Mixin,\n\n  /**\n   * Token to look for to determine if an error occurred.\n   */\n  OBSERVED_ERROR: {}\n\n};\n\nmodule.exports = Transaction;\n},{\"157\":157}],112:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ViewportMetrics\n */\n\n'use strict';\n\nvar ViewportMetrics = {\n\n  currentScrollLeft: 0,\n\n  currentScrollTop: 0,\n\n  refreshScrollValues: function (scrollPosition) {\n    ViewportMetrics.currentScrollLeft = scrollPosition.x;\n    ViewportMetrics.currentScrollTop = scrollPosition.y;\n  }\n\n};\n\nmodule.exports = ViewportMetrics;\n},{}],113:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule accumulateInto\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\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 */\n\nfunction accumulateInto(current, next) {\n  !(next != null) ? \"development\" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;\n  if (current == null) {\n    return next;\n  }\n\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  var currentIsArray = Array.isArray(current);\n  var nextIsArray = Array.isArray(next);\n\n  if (currentIsArray && nextIsArray) {\n    current.push.apply(current, next);\n    return current;\n  }\n\n  if (currentIsArray) {\n    current.push(next);\n    return current;\n  }\n\n  if (nextIsArray) {\n    // A bit too dangerous to mutate `next`.\n    return [current].concat(next);\n  }\n\n  return [current, next];\n}\n\nmodule.exports = accumulateInto;\n},{\"157\":157}],114:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule adler32\n */\n\n'use strict';\n\nvar MOD = 65521;\n\n// adler32 is not cryptographically strong, and is only used to sanity check that\n// markup generated on the server matches the markup generated on the client.\n// This implementation (a modified version of the SheetJS version) has been optimized\n// for our use case, at the expense of conforming to the adler32 specification\n// for non-ascii inputs.\nfunction adler32(data) {\n  var a = 1;\n  var b = 0;\n  var i = 0;\n  var l = data.length;\n  var m = l & ~0x3;\n  while (i < m) {\n    var n = Math.min(i + 4096, m);\n    for (; i < n; i += 4) {\n      b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n    }\n    a %= MOD;\n    b %= MOD;\n  }\n  for (; i < l; i++) {\n    b += a += data.charCodeAt(i);\n  }\n  a %= MOD;\n  b %= MOD;\n  return a | b << 16;\n}\n\nmodule.exports = adler32;\n},{}],115:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule canDefineProperty\n */\n\n'use strict';\n\nvar canDefineProperty = false;\nif (\"development\" !== 'production') {\n  try {\n    Object.defineProperty({}, 'x', { get: function () {} });\n    canDefineProperty = true;\n  } catch (x) {\n    // IE will fail on defineProperty\n  }\n}\n\nmodule.exports = canDefineProperty;\n},{}],116:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule createMicrosoftUnsafeLocalFunction\n */\n\n/* globals MSApp */\n\n'use strict';\n\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\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};\n\nmodule.exports = createMicrosoftUnsafeLocalFunction;\n},{}],117:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule dangerousStyleValue\n */\n\n'use strict';\n\nvar CSSProperty = _dereq_(3);\nvar warning = _dereq_(167);\n\nvar isUnitlessNumber = CSSProperty.isUnitlessNumber;\nvar styleWarnings = {};\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 * @param {ReactDOMComponent} component\n * @return {string} Normalized style value with dimensions applied.\n */\nfunction dangerousStyleValue(name, value, component) {\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\n  var isEmpty = value == null || typeof value === 'boolean' || value === '';\n  if (isEmpty) {\n    return '';\n  }\n\n  var isNonNumeric = isNaN(value);\n  if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {\n    return '' + value; // cast to string\n  }\n\n  if (typeof value === 'string') {\n    if (\"development\" !== 'production') {\n      if (component) {\n        var owner = component._currentElement._owner;\n        var ownerName = owner ? owner.getName() : null;\n        if (ownerName && !styleWarnings[ownerName]) {\n          styleWarnings[ownerName] = {};\n        }\n        var warned = false;\n        if (ownerName) {\n          var warnings = styleWarnings[ownerName];\n          warned = warnings[name];\n          if (!warned) {\n            warnings[name] = true;\n          }\n        }\n        if (!warned) {\n          \"development\" !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;\n        }\n      }\n    }\n    value = value.trim();\n  }\n  return value + 'px';\n}\n\nmodule.exports = dangerousStyleValue;\n},{\"167\":167,\"3\":3}],118:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule escapeTextContentForBrowser\n */\n\n'use strict';\n\nvar ESCAPE_LOOKUP = {\n  '&': '&amp;',\n  '>': '&gt;',\n  '<': '&lt;',\n  '\"': '&quot;',\n  '\\'': '&#x27;'\n};\n\nvar ESCAPE_REGEX = /[&><\"']/g;\n\nfunction escaper(match) {\n  return ESCAPE_LOOKUP[match];\n}\n\n/**\n * Escapes text to prevent scripting attacks.\n *\n * @param {*} text Text value to escape.\n * @return {string} An escaped string.\n */\nfunction escapeTextContentForBrowser(text) {\n  return ('' + text).replace(ESCAPE_REGEX, escaper);\n}\n\nmodule.exports = escapeTextContentForBrowser;\n},{}],119:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule findDOMNode\n */\n\n'use strict';\n\nvar ReactCurrentOwner = _dereq_(36);\nvar ReactDOMComponentTree = _dereq_(41);\nvar ReactInstanceMap = _dereq_(70);\n\nvar getNativeComponentFromComposite = _dereq_(127);\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\n/**\n * Returns the DOM node rendered by this element.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode\n *\n * @param {ReactComponent|DOMElement} componentOrElement\n * @return {?DOMElement} The root node of this element.\n */\nfunction findDOMNode(componentOrElement) {\n  if (\"development\" !== 'production') {\n    var owner = ReactCurrentOwner.current;\n    if (owner !== null) {\n      \"development\" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%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.', owner.getName() || 'A component') : void 0;\n      owner._warnedAboutRefsInRender = true;\n    }\n  }\n  if (componentOrElement == null) {\n    return null;\n  }\n  if (componentOrElement.nodeType === 1) {\n    return componentOrElement;\n  }\n\n  var inst = ReactInstanceMap.get(componentOrElement);\n  if (inst) {\n    inst = getNativeComponentFromComposite(inst);\n    return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;\n  }\n\n  if (typeof componentOrElement.render === 'function') {\n    !false ? \"development\" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;\n  } else {\n    !false ? \"development\" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;\n  }\n}\n\nmodule.exports = findDOMNode;\n},{\"127\":127,\"157\":157,\"167\":167,\"36\":36,\"41\":41,\"70\":70}],120:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule flattenChildren\n */\n\n'use strict';\n\nvar KeyEscapeUtils = _dereq_(23);\nvar traverseAllChildren = _dereq_(140);\nvar warning = _dereq_(167);\n\n/**\n * @param {function} traverseContext Context passed through traversal.\n * @param {?ReactComponent} child React child component.\n * @param {!string} name String name of key path to child.\n */\nfunction flattenSingleChildIntoContext(traverseContext, child, name) {\n  // We found a component instance.\n  var result = traverseContext;\n  var keyUnique = result[name] === undefined;\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;\n  }\n  if (keyUnique && child != null) {\n    result[name] = child;\n  }\n}\n\n/**\n * Flattens children that are typically specified as `props.children`. Any null\n * children will not be included in the resulting object.\n * @return {!object} flattened children keyed by name.\n */\nfunction flattenChildren(children) {\n  if (children == null) {\n    return children;\n  }\n  var result = {};\n  traverseAllChildren(children, flattenSingleChildIntoContext, result);\n  return result;\n}\n\nmodule.exports = flattenChildren;\n},{\"140\":140,\"167\":167,\"23\":23}],121:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule forEachAccumulated\n */\n\n'use strict';\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 */\n\nvar forEachAccumulated = function (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\nmodule.exports = forEachAccumulated;\n},{}],122:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getEventCharCode\n */\n\n'use strict';\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 */\n\nfunction getEventCharCode(nativeEvent) {\n  var charCode;\n  var keyCode = nativeEvent.keyCode;\n\n  if ('charCode' in nativeEvent) {\n    charCode = nativeEvent.charCode;\n\n    // 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  }\n\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\n  return 0;\n}\n\nmodule.exports = getEventCharCode;\n},{}],123:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getEventKey\n */\n\n'use strict';\n\nvar getEventCharCode = _dereq_(122);\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/**\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', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',\n  118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',\n  144: 'NumLock',\n  145: 'ScrollLock',\n  224: 'Meta'\n};\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\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  }\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);\n\n    // 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\nmodule.exports = getEventKey;\n},{\"122\":122}],124:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getEventModifierState\n */\n\n'use strict';\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 */\n\nvar modifierKeyToProp = {\n  'Alt': 'altKey',\n  'Control': 'ctrlKey',\n  'Meta': 'metaKey',\n  'Shift': 'shiftKey'\n};\n\n// IE8 does not implement getModifierState so we simply map it to the only\n// modifier keys exposed by the event itself, does not support Lock-keys.\n// Currently, all major browsers except Chrome seems to support Lock-keys.\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}\n\nfunction getEventModifierState(nativeEvent) {\n  return modifierStateGetter;\n}\n\nmodule.exports = getEventModifierState;\n},{}],125:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getEventTarget\n */\n\n'use strict';\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 */\n\nfunction getEventTarget(nativeEvent) {\n  var target = nativeEvent.target || nativeEvent.srcElement || window;\n\n  // Normalize SVG <use> element events #4963\n  if (target.correspondingUseElement) {\n    target = target.correspondingUseElement;\n  }\n\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 === 3 ? target.parentNode : target;\n}\n\nmodule.exports = getEventTarget;\n},{}],126:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getIteratorFn\n */\n\n'use strict';\n\n/* global Symbol */\n\nvar ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n/**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n *     var iteratorFn = getIteratorFn(myIterable);\n *     if (iteratorFn) {\n *       var iterator = iteratorFn.call(myIterable);\n *       ...\n *     }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\nfunction getIteratorFn(maybeIterable) {\n  var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n  if (typeof iteratorFn === 'function') {\n    return iteratorFn;\n  }\n}\n\nmodule.exports = getIteratorFn;\n},{}],127:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getNativeComponentFromComposite\n */\n\n'use strict';\n\nvar ReactNodeTypes = _dereq_(79);\n\nfunction getNativeComponentFromComposite(inst) {\n  var type;\n\n  while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {\n    inst = inst._renderedComponent;\n  }\n\n  if (type === ReactNodeTypes.NATIVE) {\n    return inst._renderedComponent;\n  } else if (type === ReactNodeTypes.EMPTY) {\n    return null;\n  }\n}\n\nmodule.exports = getNativeComponentFromComposite;\n},{\"79\":79}],128:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getNodeForCharacterOffset\n */\n\n'use strict';\n\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\n\nfunction getLeafNode(node) {\n  while (node && node.firstChild) {\n    node = node.firstChild;\n  }\n  return node;\n}\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/**\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\n  while (node) {\n    if (node.nodeType === 3) {\n      nodeEnd = nodeStart + node.textContent.length;\n\n      if (nodeStart <= offset && nodeEnd >= offset) {\n        return {\n          node: node,\n          offset: offset - nodeStart\n        };\n      }\n\n      nodeStart = nodeEnd;\n    }\n\n    node = getLeafNode(getSiblingNode(node));\n  }\n}\n\nmodule.exports = getNodeForCharacterOffset;\n},{}],129:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getTextContentAccessor\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar contentKey = null;\n\n/**\n * Gets the key used to access text content on a DOM node.\n *\n * @return {?string} Key used to access text content.\n * @internal\n */\nfunction getTextContentAccessor() {\n  if (!contentKey && ExecutionEnvironment.canUseDOM) {\n    // Prefer textContent to innerText because many browsers support both but\n    // SVG <text> elements don't support innerText even when <div> does.\n    contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';\n  }\n  return contentKey;\n}\n\nmodule.exports = getTextContentAccessor;\n},{\"143\":143}],130:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getVendorPrefixedEventName\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\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\n  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n  prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n  prefixes['Moz' + styleProp] = 'moz' + eventName;\n  prefixes['ms' + styleProp] = 'MS' + eventName;\n  prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();\n\n  return prefixes;\n}\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/**\n * Event names that have already been detected and prefixed (if applicable).\n */\nvar prefixedEventNames = {};\n\n/**\n * Element to check for prefixes on.\n */\nvar style = {};\n\n/**\n * Bootstrap if a DOM exists.\n */\nif (ExecutionEnvironment.canUseDOM) {\n  style = document.createElement('div').style;\n\n  // 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  }\n\n  // Same as above\n  if (!('TransitionEvent' in window)) {\n    delete vendorPrefixes.transitionend.transition;\n  }\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\n  var prefixMap = vendorPrefixes[eventName];\n\n  for (var styleProp in prefixMap) {\n    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n      return prefixedEventNames[eventName] = prefixMap[styleProp];\n    }\n  }\n\n  return '';\n}\n\nmodule.exports = getVendorPrefixedEventName;\n},{\"143\":143}],131:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule instantiateReactComponent\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar ReactCompositeComponent = _dereq_(35);\nvar ReactEmptyComponent = _dereq_(63);\nvar ReactNativeComponent = _dereq_(77);\nvar ReactInstrumentation = _dereq_(71);\n\nvar invariant = _dereq_(157);\nvar warning = _dereq_(167);\n\n// To avoid a cyclic dependency, we create the final class in this module\nvar ReactCompositeComponentWrapper = function (element) {\n  this.construct(element);\n};\n_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {\n  _instantiateReactComponent: instantiateReactComponent\n});\n\nfunction getDeclarationErrorAddendum(owner) {\n  if (owner) {\n    var name = owner.getName();\n    if (name) {\n      return ' Check the render method of `' + name + '`.';\n    }\n  }\n  return '';\n}\n\nfunction getDisplayName(instance) {\n  var element = instance._currentElement;\n  if (element == null) {\n    return '#empty';\n  } else if (typeof element === 'string' || typeof element === 'number') {\n    return '#text';\n  } else if (typeof element.type === 'string') {\n    return element.type;\n  } else if (instance.getName) {\n    return instance.getName() || 'Unknown';\n  } else {\n    return element.type.displayName || element.type.name || 'Unknown';\n  }\n}\n\n/**\n * Check if the type reference is a known internal type. I.e. not a user\n * provided composite type.\n *\n * @param {function} type\n * @return {boolean} Returns true if this is a valid internal type.\n */\nfunction isInternalComponentType(type) {\n  return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';\n}\n\nvar nextDebugID = 1;\n\n/**\n * Given a ReactNode, create an instance that will actually be mounted.\n *\n * @param {ReactNode} node\n * @return {object} A new instance of the element's constructor.\n * @protected\n */\nfunction instantiateReactComponent(node) {\n  var instance;\n\n  var isEmpty = node === null || node === false;\n  if (isEmpty) {\n    instance = ReactEmptyComponent.create(instantiateReactComponent);\n  } else if (typeof node === 'object') {\n    var element = node;\n    !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? \"development\" !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : void 0;\n\n    // Special case string values\n    if (typeof element.type === 'string') {\n      instance = ReactNativeComponent.createInternalComponent(element);\n    } else if (isInternalComponentType(element.type)) {\n      // This is temporarily available for custom components that are not string\n      // representations. I.e. ART. Once those are updated to use the string\n      // representation, we can drop this code path.\n      instance = new element.type(element);\n    } else {\n      instance = new ReactCompositeComponentWrapper(element);\n    }\n  } else if (typeof node === 'string' || typeof node === 'number') {\n    instance = ReactNativeComponent.createInstanceForText(node);\n  } else {\n    !false ? \"development\" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : void 0;\n  }\n\n  if (\"development\" !== 'production') {\n    \"development\" !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;\n  }\n\n  // These two fields are used by the DOM and ART diffing algorithms\n  // respectively. Instead of using expandos on components, we should be\n  // storing the state needed by the diffing algorithms elsewhere.\n  instance._mountIndex = 0;\n  instance._mountImage = null;\n\n  if (\"development\" !== 'production') {\n    instance._isOwnerNecessary = false;\n    instance._warnedAboutRefsInRender = false;\n  }\n\n  if (\"development\" !== 'production') {\n    var debugID = isEmpty ? 0 : nextDebugID++;\n    instance._debugID = debugID;\n\n    if (debugID !== 0) {\n      var displayName = getDisplayName(instance);\n      ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);\n      var owner = node && node._owner;\n      if (owner) {\n        ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);\n      }\n    }\n  }\n\n  // Internal instances should fully constructed at this point, so they should\n  // not get any new fields added to them at this point.\n  if (\"development\" !== 'production') {\n    if (Object.preventExtensions) {\n      Object.preventExtensions(instance);\n    }\n  }\n\n  return instance;\n}\n\nmodule.exports = instantiateReactComponent;\n},{\"157\":157,\"167\":167,\"168\":168,\"35\":35,\"63\":63,\"71\":71,\"77\":77}],132:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule isEventSupported\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar useHasFeature;\nif (ExecutionEnvironment.canUseDOM) {\n  useHasFeature = document.implementation && document.implementation.hasFeature &&\n  // always returns true in newer browsers as per the standard.\n  // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature\n  document.implementation.hasFeature('', '') !== true;\n}\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 * @param {?boolean} capture Check if the capture phase is supported.\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nfunction isEventSupported(eventNameSuffix, capture) {\n  if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {\n    return false;\n  }\n\n  var eventName = 'on' + eventNameSuffix;\n  var isSupported = eventName in document;\n\n  if (!isSupported) {\n    var element = document.createElement('div');\n    element.setAttribute(eventName, 'return;');\n    isSupported = typeof element[eventName] === 'function';\n  }\n\n  if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {\n    // This is the only way to test support for the `wheel` event in IE9+.\n    isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n  }\n\n  return isSupported;\n}\n\nmodule.exports = isEventSupported;\n},{\"143\":143}],133:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule isTextInputElement\n */\n\n'use strict';\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\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};\n\nfunction isTextInputElement(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');\n}\n\nmodule.exports = isTextInputElement;\n},{}],134:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule onlyChild\n */\n'use strict';\n\nvar ReactElement = _dereq_(61);\n\nvar invariant = _dereq_(157);\n\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\nfunction onlyChild(children) {\n  !ReactElement.isValidElement(children) ? \"development\" !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0;\n  return children;\n}\n\nmodule.exports = onlyChild;\n},{\"157\":157,\"61\":61}],135:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule quoteAttributeValueForBrowser\n */\n\n'use strict';\n\nvar escapeTextContentForBrowser = _dereq_(118);\n\n/**\n * Escapes attribute value to prevent scripting attacks.\n *\n * @param {*} value Value to escape.\n * @return {string} An escaped string.\n */\nfunction quoteAttributeValueForBrowser(value) {\n  return '\"' + escapeTextContentForBrowser(value) + '\"';\n}\n\nmodule.exports = quoteAttributeValueForBrowser;\n},{\"118\":118}],136:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n* @providesModule renderSubtreeIntoContainer\n*/\n\n'use strict';\n\nvar ReactMount = _dereq_(74);\n\nmodule.exports = ReactMount.renderSubtreeIntoContainer;\n},{\"74\":74}],137:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule setInnerHTML\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar WHITESPACE_TEST = /^[ \\r\\n\\t\\f]/;\nvar NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \\r\\n\\t\\f\\/>]/;\n\nvar createMicrosoftUnsafeLocalFunction = _dereq_(116);\n\n/**\n * Set the innerHTML property of a node, ensuring that whitespace is preserved\n * even in IE8.\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n  node.innerHTML = html;\n});\n\nif (ExecutionEnvironment.canUseDOM) {\n  // IE8: When updating a just created node with innerHTML only leading\n  // whitespace is removed. When updating an existing node with innerHTML\n  // whitespace in root TextNodes is also collapsed.\n  // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html\n\n  // Feature detection; only IE8 is known to behave improperly like this.\n  var testElement = document.createElement('div');\n  testElement.innerHTML = ' ';\n  if (testElement.innerHTML === '') {\n    setInnerHTML = function (node, html) {\n      // Magic theory: IE8 supposedly differentiates between added and updated\n      // nodes when processing innerHTML, innerHTML on updated nodes suffers\n      // from worse whitespace behavior. Re-adding a node like this triggers\n      // the initial and more favorable whitespace behavior.\n      // TODO: What to do on a detached node?\n      if (node.parentNode) {\n        node.parentNode.replaceChild(node, node);\n      }\n\n      // We also implement a workaround for non-visible tags disappearing into\n      // thin air on IE8, this only happens if there is no visible text\n      // in-front of the non-visible tags. Piggyback on the whitespace fix\n      // and simply check if any non-visible tags appear in the source.\n      if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {\n        // Recover leading whitespace by temporarily prepending any character.\n        // \\uFEFF has the potential advantage of being zero-width/invisible.\n        // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode\n        // in hopes that this is preserved even if \"\\uFEFF\" is transformed to\n        // the actual Unicode character (by Babel, for example).\n        // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216\n        node.innerHTML = String.fromCharCode(0xFEFF) + html;\n\n        // deleteData leaves an empty `TextNode` which offsets the index of all\n        // children. Definitely want to avoid this.\n        var textNode = node.firstChild;\n        if (textNode.data.length === 1) {\n          node.removeChild(textNode);\n        } else {\n          textNode.deleteData(0, 1);\n        }\n      } else {\n        node.innerHTML = html;\n      }\n    };\n  }\n  testElement = null;\n}\n\nmodule.exports = setInnerHTML;\n},{\"116\":116,\"143\":143}],138:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule setTextContent\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\nvar escapeTextContentForBrowser = _dereq_(118);\nvar setInnerHTML = _dereq_(137);\n\n/**\n * Set the textContent property of a node, ensuring that whitespace is preserved\n * even in IE8. innerText is a poor substitute for textContent and, among many\n * issues, inserts <br> instead of the literal newline chars. innerHTML behaves\n * as it should.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\nvar setTextContent = function (node, text) {\n  node.textContent = text;\n};\n\nif (ExecutionEnvironment.canUseDOM) {\n  if (!('textContent' in document.documentElement)) {\n    setTextContent = function (node, text) {\n      setInnerHTML(node, escapeTextContentForBrowser(text));\n    };\n  }\n}\n\nmodule.exports = setTextContent;\n},{\"118\":118,\"137\":137,\"143\":143}],139:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule shouldUpdateReactComponent\n */\n\n'use strict';\n\n/**\n * Given a `prevElement` and `nextElement`, determines if the existing\n * instance should be updated as opposed to being destroyed or replaced by a new\n * instance. Both arguments are elements. This ensures that this logic can\n * operate on stateless trees without any backing instance.\n *\n * @param {?object} prevElement\n * @param {?object} nextElement\n * @return {boolean} True if the existing instance should be updated.\n * @protected\n */\n\nfunction shouldUpdateReactComponent(prevElement, nextElement) {\n  var prevEmpty = prevElement === null || prevElement === false;\n  var nextEmpty = nextElement === null || nextElement === false;\n  if (prevEmpty || nextEmpty) {\n    return prevEmpty === nextEmpty;\n  }\n\n  var prevType = typeof prevElement;\n  var nextType = typeof nextElement;\n  if (prevType === 'string' || prevType === 'number') {\n    return nextType === 'string' || nextType === 'number';\n  } else {\n    return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;\n  }\n}\n\nmodule.exports = shouldUpdateReactComponent;\n},{}],140:[function(_dereq_,module,exports){\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule traverseAllChildren\n */\n\n'use strict';\n\nvar ReactCurrentOwner = _dereq_(36);\nvar ReactElement = _dereq_(61);\n\nvar getIteratorFn = _dereq_(126);\nvar invariant = _dereq_(157);\nvar KeyEscapeUtils = _dereq_(23);\nvar warning = _dereq_(167);\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\nvar didWarnAboutMaps = false;\n\n/**\n * Generate a key string that identifies a component within a set.\n *\n * @param {*} component A component that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\nfunction getComponentKey(component, index) {\n  // Do some typechecking here since we call this blindly. We want to ensure\n  // that we don't block potential future ES APIs.\n  if (component && typeof component === 'object' && component.key != null) {\n    // Explicit key\n    return KeyEscapeUtils.escape(component.key);\n  }\n  // Implicit key determined by the index in the set\n  return index.toString(36);\n}\n\n/**\n * @param {?*} children Children tree container.\n * @param {!string} nameSoFar Name of the key path so far.\n * @param {!function} callback Callback to invoke with each child found.\n * @param {?*} traverseContext Used to pass information throughout the traversal\n * process.\n * @return {!number} The number of children in this subtree.\n */\nfunction traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {\n  var type = typeof children;\n\n  if (type === 'undefined' || type === 'boolean') {\n    // All of the above are perceived as null.\n    children = null;\n  }\n\n  if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {\n    callback(traverseContext, children,\n    // If it's the only child, treat the name as if it was wrapped in an array\n    // so that it's consistent if the number of children grows.\n    nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);\n    return 1;\n  }\n\n  var child;\n  var nextName;\n  var subtreeCount = 0; // Count of children found in the current subtree.\n  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n  if (Array.isArray(children)) {\n    for (var i = 0; i < children.length; i++) {\n      child = children[i];\n      nextName = nextNamePrefix + getComponentKey(child, i);\n      subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n    }\n  } else {\n    var iteratorFn = getIteratorFn(children);\n    if (iteratorFn) {\n      var iterator = iteratorFn.call(children);\n      var step;\n      if (iteratorFn !== children.entries) {\n        var ii = 0;\n        while (!(step = iterator.next()).done) {\n          child = step.value;\n          nextName = nextNamePrefix + getComponentKey(child, ii++);\n          subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n        }\n      } else {\n        if (\"development\" !== 'production') {\n          \"development\" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : void 0;\n          didWarnAboutMaps = true;\n        }\n        // Iterator will provide entry [k,v] tuples rather than values.\n        while (!(step = iterator.next()).done) {\n          var entry = step.value;\n          if (entry) {\n            child = entry[1];\n            nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);\n            subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n          }\n        }\n      }\n    } else if (type === 'object') {\n      var addendum = '';\n      if (\"development\" !== 'production') {\n        addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';\n        if (children._isReactElement) {\n          addendum = ' It looks like you\\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';\n        }\n        if (ReactCurrentOwner.current) {\n          var name = ReactCurrentOwner.current.getName();\n          if (name) {\n            addendum += ' Check the render method of `' + name + '`.';\n          }\n        }\n      }\n      var childrenString = String(children);\n      !false ? \"development\" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : void 0;\n    }\n  }\n\n  return subtreeCount;\n}\n\n/**\n * Traverses children that are typically specified as `props.children`, but\n * might also be specified through attributes:\n *\n * - `traverseAllChildren(this.props.children, ...)`\n * - `traverseAllChildren(this.props.leftPanelChildren, ...)`\n *\n * The `traverseContext` is an optional argument that is passed through the\n * entire traversal. It can be used to store accumulations or anything else that\n * the callback might find relevant.\n *\n * @param {?*} children Children tree object.\n * @param {!function} callback To invoke upon traversing each child.\n * @param {?*} traverseContext Context for traversal.\n * @return {!number} The number of children in this subtree.\n */\nfunction traverseAllChildren(children, callback, traverseContext) {\n  if (children == null) {\n    return 0;\n  }\n\n  return traverseAllChildrenImpl(children, '', callback, traverseContext);\n}\n\nmodule.exports = traverseAllChildren;\n},{\"126\":126,\"157\":157,\"167\":167,\"23\":23,\"36\":36,\"61\":61}],141:[function(_dereq_,module,exports){\n/**\n * Copyright 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule validateDOMNesting\n */\n\n'use strict';\n\nvar _assign = _dereq_(168);\n\nvar emptyFunction = _dereq_(149);\nvar warning = _dereq_(167);\n\nvar validateDOMNesting = emptyFunction;\n\nif (\"development\" !== 'production') {\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\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'];\n\n  // 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',\n\n  // 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'];\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n  var buttonScopeTags = inScopeTags.concat(['button']);\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n\n  var emptyAncestorInfo = {\n    current: null,\n\n    formTag: null,\n    aTagInScope: null,\n    buttonTagInScope: null,\n    nobrTagInScope: null,\n    pTagInButtonScope: null,\n\n    listItemTagAutoclosing: null,\n    dlItemTagAutoclosing: null\n  };\n\n  var updatedAncestorInfo = function (oldInfo, tag, instance) {\n    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n    var info = { tag: tag, instance: instance };\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    }\n\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\n    ancestorInfo.current = info;\n\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\n    return ancestorInfo;\n  };\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\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\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\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\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n      case 'colgroup':\n        return tag === 'col' || tag === 'template';\n\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\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\n      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n      case 'html':\n        return tag === 'head' || tag === 'body';\n      case '#document':\n        return tag === 'html';\n    }\n\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\n      case 'rp':\n      case 'rt':\n        return impliedEndTags.indexOf(parentTag) === -1;\n\n      case 'body':\n      case 'caption':\n      case 'col':\n      case 'colgroup':\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\n    return true;\n  };\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\n      case 'pre':\n      case 'listing':\n\n      case 'table':\n\n      case 'hr':\n\n      case 'xmp':\n\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return ancestorInfo.pTagInButtonScope;\n\n      case 'form':\n        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n\n      case 'li':\n        return ancestorInfo.listItemTagAutoclosing;\n\n      case 'dd':\n      case 'dt':\n        return ancestorInfo.dlItemTagAutoclosing;\n\n      case 'button':\n        return ancestorInfo.buttonTagInScope;\n\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\n      case 'nobr':\n        return ancestorInfo.nobrTagInScope;\n    }\n\n    return null;\n  };\n\n  /**\n   * Given a ReactCompositeComponent instance, return a list of its recursive\n   * owners, starting at the root and ending with the instance itself.\n   */\n  var findOwnerStack = function (instance) {\n    if (!instance) {\n      return [];\n    }\n\n    var stack = [];\n    do {\n      stack.push(instance);\n    } while (instance = instance._currentElement._owner);\n    stack.reverse();\n    return stack;\n  };\n\n  var didWarn = {};\n\n  validateDOMNesting = function (childTag, childInstance, ancestorInfo) {\n    ancestorInfo = ancestorInfo || emptyAncestorInfo;\n    var parentInfo = ancestorInfo.current;\n    var parentTag = parentInfo && parentInfo.tag;\n\n    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n    var problematic = invalidParent || invalidAncestor;\n\n    if (problematic) {\n      var ancestorTag = problematic.tag;\n      var ancestorInstance = problematic.instance;\n\n      var childOwner = childInstance && childInstance._currentElement._owner;\n      var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;\n\n      var childOwners = findOwnerStack(childOwner);\n      var ancestorOwners = findOwnerStack(ancestorOwner);\n\n      var minStackLen = Math.min(childOwners.length, ancestorOwners.length);\n      var i;\n\n      var deepestCommon = -1;\n      for (i = 0; i < minStackLen; i++) {\n        if (childOwners[i] === ancestorOwners[i]) {\n          deepestCommon = i;\n        } else {\n          break;\n        }\n      }\n\n      var UNKNOWN = '(unknown)';\n      var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {\n        return inst.getName() || UNKNOWN;\n      });\n      var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {\n        return inst.getName() || UNKNOWN;\n      });\n      var ownerInfo = [].concat(\n      // If the parent and child instances have a common owner ancestor, start\n      // with that -- otherwise we just start with the parent's owners.\n      deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,\n      // If we're warning about an invalid (non-parent) ancestry, add '...'\n      invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');\n\n      var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;\n      if (didWarn[warnKey]) {\n        return;\n      }\n      didWarn[warnKey] = true;\n\n      var tagDisplayName = childTag;\n      if (childTag !== '#text') {\n        tagDisplayName = '<' + childTag + '>';\n      }\n\n      if (invalidParent) {\n        var info = '';\n        if (ancestorTag === 'table' && childTag === 'tr') {\n          info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';\n        }\n        \"development\" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>. ' + 'See %s.%s', tagDisplayName, ancestorTag, ownerInfo, info) : void 0;\n      } else {\n        \"development\" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;\n      }\n    }\n  };\n\n  validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;\n\n  // For testing\n  validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {\n    ancestorInfo = ancestorInfo || emptyAncestorInfo;\n    var parentInfo = ancestorInfo.current;\n    var parentTag = parentInfo && parentInfo.tag;\n    return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);\n  };\n}\n\nmodule.exports = validateDOMNesting;\n},{\"149\":149,\"167\":167,\"168\":168}],142:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @typechecks\n */\n\nvar emptyFunction = _dereq_(149);\n\n/**\n * Upstream version of event listener. Does not take into account specific\n * nature of platform.\n */\nvar EventListener = {\n  /**\n   * Listen to DOM events during the bubble phase.\n   *\n   * @param {DOMEventTarget} target DOM element to register listener on.\n   * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.\n   * @param {function} callback Callback function.\n   * @return {object} Object with a `remove` method.\n   */\n  listen: function (target, eventType, callback) {\n    if (target.addEventListener) {\n      target.addEventListener(eventType, callback, false);\n      return {\n        remove: function () {\n          target.removeEventListener(eventType, callback, false);\n        }\n      };\n    } else if (target.attachEvent) {\n      target.attachEvent('on' + eventType, callback);\n      return {\n        remove: function () {\n          target.detachEvent('on' + eventType, callback);\n        }\n      };\n    }\n  },\n\n  /**\n   * Listen to DOM events during the capture phase.\n   *\n   * @param {DOMEventTarget} target DOM element to register listener on.\n   * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.\n   * @param {function} callback Callback function.\n   * @return {object} Object with a `remove` method.\n   */\n  capture: function (target, eventType, callback) {\n    if (target.addEventListener) {\n      target.addEventListener(eventType, callback, true);\n      return {\n        remove: function () {\n          target.removeEventListener(eventType, callback, true);\n        }\n      };\n    } else {\n      if (\"development\" !== 'production') {\n        console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');\n      }\n      return {\n        remove: emptyFunction\n      };\n    }\n  },\n\n  registerDefault: function () {}\n};\n\nmodule.exports = EventListener;\n},{\"149\":149}],143:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\nvar ExecutionEnvironment = {\n\n  canUseDOM: canUseDOM,\n\n  canUseWorkers: typeof Worker !== 'undefined',\n\n  canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),\n\n  canUseViewport: canUseDOM && !!window.screen,\n\n  isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\n\nmodule.exports = ExecutionEnvironment;\n},{}],144:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar _hyphenPattern = /-(.)/g;\n\n/**\n * Camelcases a hyphenated string, for example:\n *\n *   > camelize('background-color')\n *   < \"backgroundColor\"\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelize(string) {\n  return string.replace(_hyphenPattern, function (_, character) {\n    return character.toUpperCase();\n  });\n}\n\nmodule.exports = camelize;\n},{}],145:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar camelize = _dereq_(144);\n\nvar msPattern = /^-ms-/;\n\n/**\n * Camelcases a hyphenated CSS property name, for example:\n *\n *   > camelizeStyleName('background-color')\n *   < \"backgroundColor\"\n *   > camelizeStyleName('-moz-transition')\n *   < \"MozTransition\"\n *   > camelizeStyleName('-ms-transition')\n *   < \"msTransition\"\n *\n * As Andi Smith suggests\n * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n * is converted to lowercase `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelizeStyleName(string) {\n  return camelize(string.replace(msPattern, 'ms-'));\n}\n\nmodule.exports = camelizeStyleName;\n},{\"144\":144}],146:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar isTextNode = _dereq_(159);\n\n/*eslint-disable no-bitwise */\n\n/**\n * Checks if a given DOM node contains or is another DOM node.\n *\n * @param {?DOMNode} outerNode Outer DOM node.\n * @param {?DOMNode} innerNode Inner DOM node.\n * @return {boolean} True if `outerNode` contains or is `innerNode`.\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 (outerNode.contains) {\n    return outerNode.contains(innerNode);\n  } else if (outerNode.compareDocumentPosition) {\n    return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n  } else {\n    return false;\n  }\n}\n\nmodule.exports = containsNode;\n},{\"159\":159}],147:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar invariant = _dereq_(157);\n\n/**\n * Convert array-like objects to arrays.\n *\n * This API assumes the caller knows the contents of the data type. For less\n * well defined inputs use createArrayFromMixed.\n *\n * @param {object|function|filelist} obj\n * @return {array}\n */\nfunction toArray(obj) {\n  var length = obj.length;\n\n  // Some browsers builtin objects can report typeof 'function' (e.g. NodeList\n  // in old versions of Safari).\n  !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? \"development\" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;\n\n  !(typeof length === 'number') ? \"development\" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;\n\n  !(length === 0 || length - 1 in obj) ? \"development\" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;\n\n  !(typeof obj.callee !== 'function') ? \"development\" !== 'production' ? invariant(false, 'toArray: Object can\\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;\n\n  // Old IE doesn't give collections access to hasOwnProperty. Assume inputs\n  // without method will throw during the slice call and skip straight to the\n  // fallback.\n  if (obj.hasOwnProperty) {\n    try {\n      return Array.prototype.slice.call(obj);\n    } catch (e) {\n      // IE < 9 does not support Array#slice on collections objects\n    }\n  }\n\n  // Fall back to copying key by key. This assumes all keys have a value,\n  // so will not preserve sparsely populated inputs.\n  var ret = Array(length);\n  for (var ii = 0; ii < length; ii++) {\n    ret[ii] = obj[ii];\n  }\n  return ret;\n}\n\n/**\n * Perform a heuristic test to determine if an object is \"array-like\".\n *\n *   A monk asked Joshu, a Zen master, \"Has a dog Buddha nature?\"\n *   Joshu replied: \"Mu.\"\n *\n * This function determines if its argument has \"array nature\": it returns\n * true if the argument is an actual array, an `arguments' object, or an\n * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).\n *\n * It will return false for other array-like objects like Filelist.\n *\n * @param {*} obj\n * @return {boolean}\n */\nfunction hasArrayNature(obj) {\n  return(\n    // not null/false\n    !!obj && (\n    // arrays are objects, NodeLists are functions in Safari\n    typeof obj == 'object' || typeof obj == 'function') &&\n    // quacks like an array\n    'length' in obj &&\n    // not window\n    !('setInterval' in obj) &&\n    // no DOM node should be considered an array-like\n    // a 'select' element has 'length' and 'item' properties on IE8\n    typeof obj.nodeType != 'number' && (\n    // a real array\n    Array.isArray(obj) ||\n    // arguments\n    'callee' in obj ||\n    // HTMLCollection/NodeList\n    'item' in obj)\n  );\n}\n\n/**\n * Ensure that the argument is an array by wrapping it in an array if it is not.\n * Creates a copy of the argument if it is already an array.\n *\n * This is mostly useful idiomatically:\n *\n *   var createArrayFromMixed = require('createArrayFromMixed');\n *\n *   function takesOneOrMoreThings(things) {\n *     things = createArrayFromMixed(things);\n *     ...\n *   }\n *\n * This allows you to treat `things' as an array, but accept scalars in the API.\n *\n * If you need to convert an array-like object, like `arguments`, into an array\n * use toArray instead.\n *\n * @param {*} obj\n * @return {array}\n */\nfunction createArrayFromMixed(obj) {\n  if (!hasArrayNature(obj)) {\n    return [obj];\n  } else if (Array.isArray(obj)) {\n    return obj.slice();\n  } else {\n    return toArray(obj);\n  }\n}\n\nmodule.exports = createArrayFromMixed;\n},{\"157\":157}],148:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n/*eslint-disable fb-www/unsafe-html*/\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar createArrayFromMixed = _dereq_(147);\nvar getMarkupWrap = _dereq_(153);\nvar invariant = _dereq_(157);\n\n/**\n * Dummy container used to render all markup.\n */\nvar dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;\n\n/**\n * Pattern used by `getNodeName`.\n */\nvar nodeNamePattern = /^\\s*<(\\w+)/;\n\n/**\n * Extracts the `nodeName` of the first element in a string of markup.\n *\n * @param {string} markup String of markup.\n * @return {?string} Node name of the supplied markup.\n */\nfunction getNodeName(markup) {\n  var nodeNameMatch = markup.match(nodeNamePattern);\n  return nodeNameMatch && nodeNameMatch[1].toLowerCase();\n}\n\n/**\n * Creates an array containing the nodes rendered from the supplied markup. The\n * optionally supplied `handleScript` function will be invoked once for each\n * <script> element that is rendered. If no `handleScript` function is supplied,\n * an exception is thrown if any <script> elements are rendered.\n *\n * @param {string} markup A string of valid HTML markup.\n * @param {?function} handleScript Invoked once for each rendered <script>.\n * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.\n */\nfunction createNodesFromMarkup(markup, handleScript) {\n  var node = dummyNode;\n  !!!dummyNode ? \"development\" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;\n  var nodeName = getNodeName(markup);\n\n  var wrap = nodeName && getMarkupWrap(nodeName);\n  if (wrap) {\n    node.innerHTML = wrap[1] + markup + wrap[2];\n\n    var wrapDepth = wrap[0];\n    while (wrapDepth--) {\n      node = node.lastChild;\n    }\n  } else {\n    node.innerHTML = markup;\n  }\n\n  var scripts = node.getElementsByTagName('script');\n  if (scripts.length) {\n    !handleScript ? \"development\" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;\n    createArrayFromMixed(scripts).forEach(handleScript);\n  }\n\n  var nodes = Array.from(node.childNodes);\n  while (node.lastChild) {\n    node.removeChild(node.lastChild);\n  }\n  return nodes;\n}\n\nmodule.exports = createNodesFromMarkup;\n},{\"143\":143,\"147\":147,\"153\":153,\"157\":157}],149:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nfunction makeEmptyFunction(arg) {\n  return function () {\n    return arg;\n  };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nfunction emptyFunction() {}\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n  return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n  return arg;\n};\n\nmodule.exports = emptyFunction;\n},{}],150:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyObject = {};\n\nif (\"development\" !== 'production') {\n  Object.freeze(emptyObject);\n}\n\nmodule.exports = emptyObject;\n},{}],151:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * @param {DOMElement} node input/textarea to focus\n */\n\nfunction focusNode(node) {\n  // IE8 can throw \"Can't move focus to the control because it is invisible,\n  // not enabled, or of a type that does not accept the focus.\" for all kinds of\n  // reasons that are too expensive and fragile to test.\n  try {\n    node.focus();\n  } catch (e) {}\n}\n\nmodule.exports = focusNode;\n},{}],152:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n/* eslint-disable fb-www/typeof-undefined */\n\n/**\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\n * not safe to call document.activeElement if there is nothing focused.\n *\n * The activeElement will be null only if the document or document body is not\n * yet defined.\n */\nfunction getActiveElement() /*?DOMElement*/{\n  if (typeof document === 'undefined') {\n    return null;\n  }\n  try {\n    return document.activeElement || document.body;\n  } catch (e) {\n    return document.body;\n  }\n}\n\nmodule.exports = getActiveElement;\n},{}],153:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n/*eslint-disable fb-www/unsafe-html */\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar invariant = _dereq_(157);\n\n/**\n * Dummy container used to detect which wraps are necessary.\n */\nvar dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;\n\n/**\n * Some browsers cannot use `innerHTML` to render certain elements standalone,\n * so we wrap them, render the wrapped nodes, then extract the desired node.\n *\n * In IE8, certain elements cannot render alone, so wrap all elements ('*').\n */\n\nvar shouldWrap = {};\n\nvar selectWrap = [1, '<select multiple=\"true\">', '</select>'];\nvar tableWrap = [1, '<table>', '</table>'];\nvar trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];\n\nvar svgWrap = [1, '<svg xmlns=\"http://www.w3.org/2000/svg\">', '</svg>'];\n\nvar markupWrap = {\n  '*': [1, '?<div>', '</div>'],\n\n  'area': [1, '<map>', '</map>'],\n  'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],\n  'legend': [1, '<fieldset>', '</fieldset>'],\n  'param': [1, '<object>', '</object>'],\n  'tr': [2, '<table><tbody>', '</tbody></table>'],\n\n  'optgroup': selectWrap,\n  'option': selectWrap,\n\n  'caption': tableWrap,\n  'colgroup': tableWrap,\n  'tbody': tableWrap,\n  'tfoot': tableWrap,\n  'thead': tableWrap,\n\n  'td': trWrap,\n  'th': trWrap\n};\n\n// Initialize the SVG elements since we know they'll always need to be wrapped\n// consistently. If they are created inside a <div> they will be initialized in\n// the wrong namespace (and will not display).\nvar svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];\nsvgElements.forEach(function (nodeName) {\n  markupWrap[nodeName] = svgWrap;\n  shouldWrap[nodeName] = true;\n});\n\n/**\n * Gets the markup wrap configuration for the supplied `nodeName`.\n *\n * NOTE: This lazily detects which wraps are necessary for the current browser.\n *\n * @param {string} nodeName Lowercase `nodeName`.\n * @return {?array} Markup wrap configuration, if applicable.\n */\nfunction getMarkupWrap(nodeName) {\n  !!!dummyNode ? \"development\" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;\n  if (!markupWrap.hasOwnProperty(nodeName)) {\n    nodeName = '*';\n  }\n  if (!shouldWrap.hasOwnProperty(nodeName)) {\n    if (nodeName === '*') {\n      dummyNode.innerHTML = '<link />';\n    } else {\n      dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';\n    }\n    shouldWrap[nodeName] = !dummyNode.firstChild;\n  }\n  return shouldWrap[nodeName] ? markupWrap[nodeName] : null;\n}\n\nmodule.exports = getMarkupWrap;\n},{\"143\":143,\"157\":157}],154:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n'use strict';\n\n/**\n * Gets the scroll position of the supplied element or window.\n *\n * The return values are unbounded, unlike `getScrollPosition`. This means they\n * may be negative or exceed the element boundaries (which is possible using\n * inertial scrolling).\n *\n * @param {DOMWindow|DOMElement} scrollable\n * @return {object} Map with `x` and `y` keys.\n */\n\nfunction getUnboundedScrollPosition(scrollable) {\n  if (scrollable === window) {\n    return {\n      x: window.pageXOffset || document.documentElement.scrollLeft,\n      y: window.pageYOffset || document.documentElement.scrollTop\n    };\n  }\n  return {\n    x: scrollable.scrollLeft,\n    y: scrollable.scrollTop\n  };\n}\n\nmodule.exports = getUnboundedScrollPosition;\n},{}],155:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar _uppercasePattern = /([A-Z])/g;\n\n/**\n * Hyphenates a camelcased string, for example:\n *\n *   > hyphenate('backgroundColor')\n *   < \"background-color\"\n *\n * For CSS style names, use `hyphenateStyleName` instead which works properly\n * with all vendor prefixes, including `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenate(string) {\n  return string.replace(_uppercasePattern, '-$1').toLowerCase();\n}\n\nmodule.exports = hyphenate;\n},{}],156:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar hyphenate = _dereq_(155);\n\nvar msPattern = /^ms-/;\n\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 *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenateStyleName(string) {\n  return hyphenate(string).replace(msPattern, '-ms-');\n}\n\nmodule.exports = hyphenateStyleName;\n},{\"155\":155}],157:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n  if (\"development\" !== 'production') {\n    if (format === undefined) {\n      throw new Error('invariant requires an error message argument');\n    }\n  }\n\n  if (!condition) {\n    var error;\n    if (format === undefined) {\n      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n    } else {\n      var args = [a, b, c, d, e, f];\n      var argIndex = 0;\n      error = new Error(format.replace(/%s/g, function () {\n        return args[argIndex++];\n      }));\n      error.name = 'Invariant Violation';\n    }\n\n    error.framesToPop = 1; // we don't care about invariant's own frame\n    throw error;\n  }\n}\n\nmodule.exports = invariant;\n},{}],158:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM node.\n */\nfunction isNode(object) {\n  return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nmodule.exports = isNode;\n},{}],159:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar isNode = _dereq_(158);\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM text node.\n */\nfunction isTextNode(object) {\n  return isNode(object) && object.nodeType == 3;\n}\n\nmodule.exports = isTextNode;\n},{\"158\":158}],160:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks static-only\n */\n\n'use strict';\n\nvar invariant = _dereq_(157);\n\n/**\n * Constructs an enumeration with keys equal to their value.\n *\n * For example:\n *\n *   var COLORS = keyMirror({blue: null, red: null});\n *   var myColor = COLORS.blue;\n *   var isColorValid = !!COLORS[myColor];\n *\n * The last line could not be performed if the values of the generated enum were\n * not equal to their keys.\n *\n *   Input:  {key1: val1, key2: val2}\n *   Output: {key1: key1, key2: key2}\n *\n * @param {object} obj\n * @return {object}\n */\nvar keyMirror = function (obj) {\n  var ret = {};\n  var key;\n  !(obj instanceof Object && !Array.isArray(obj)) ? \"development\" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;\n  for (key in obj) {\n    if (!obj.hasOwnProperty(key)) {\n      continue;\n    }\n    ret[key] = key;\n  }\n  return ret;\n};\n\nmodule.exports = keyMirror;\n},{\"157\":157}],161:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n/**\n * Allows extraction of a minified key. Let's the build system minify keys\n * without losing the ability to dynamically use key strings as values\n * themselves. Pass in an object with a single key/val pair and it will return\n * you the string key of that single record. Suppose you want to grab the\n * value for a key 'className' inside of an object. Key/val minification may\n * have aliased that key to be 'xa12'. keyOf({className: null}) will return\n * 'xa12' in that case. Resolve keys you want to use once at startup time, then\n * reuse those resolutions.\n */\nvar keyOf = function (oneKeyObj) {\n  var key;\n  for (key in oneKeyObj) {\n    if (!oneKeyObj.hasOwnProperty(key)) {\n      continue;\n    }\n    return key;\n  }\n  return null;\n};\n\nmodule.exports = keyOf;\n},{}],162:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Executes the provided `callback` once for each enumerable own property in the\n * object and constructs a new object from the results. The `callback` is\n * invoked with three arguments:\n *\n *  - the property value\n *  - the property name\n *  - the object being traversed\n *\n * Properties that are added after the call to `mapObject` will not be visited\n * by `callback`. If the values of existing properties are changed, the value\n * passed to `callback` will be the value at the time `mapObject` visits them.\n * Properties that are deleted before being visited are not visited.\n *\n * @grep function objectMap()\n * @grep function objMap()\n *\n * @param {?object} object\n * @param {function} callback\n * @param {*} context\n * @return {?object}\n */\nfunction mapObject(object, callback, context) {\n  if (!object) {\n    return null;\n  }\n  var result = {};\n  for (var name in object) {\n    if (hasOwnProperty.call(object, name)) {\n      result[name] = callback.call(context, object[name], name, object);\n    }\n  }\n  return result;\n}\n\nmodule.exports = mapObject;\n},{}],163:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks static-only\n */\n\n'use strict';\n\n/**\n * Memoizes the return value of a function that accepts one string argument.\n *\n * @param {function} callback\n * @return {function}\n */\n\nfunction memoizeStringOnly(callback) {\n  var cache = {};\n  return function (string) {\n    if (!cache.hasOwnProperty(string)) {\n      cache[string] = callback.call(this, string);\n    }\n    return cache[string];\n  };\n}\n\nmodule.exports = memoizeStringOnly;\n},{}],164:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar ExecutionEnvironment = _dereq_(143);\n\nvar performance;\n\nif (ExecutionEnvironment.canUseDOM) {\n  performance = window.performance || window.msPerformance || window.webkitPerformance;\n}\n\nmodule.exports = performance || {};\n},{\"143\":143}],165:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n */\n\nvar performance = _dereq_(164);\n\nvar performanceNow;\n\n/**\n * Detect if we can use `window.performance.now()` and gracefully fallback to\n * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now\n * because of Facebook's testing infrastructure.\n */\nif (performance.now) {\n  performanceNow = function () {\n    return performance.now();\n  };\n} else {\n  performanceNow = function () {\n    return Date.now();\n  };\n}\n\nmodule.exports = performanceNow;\n},{\"164\":164}],166:[function(_dereq_,module,exports){\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @typechecks\n * \n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\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  // SameValue algorithm\n  if (x === y) {\n    // Steps 1-5, 7-10\n    // Steps 6.b-6.e: +0 != -0\n    return x !== 0 || 1 / x === 1 / y;\n  } else {\n    // Step 6.a: NaN == NaN\n    return x !== x && y !== y;\n  }\n}\n\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 (is(objA, objB)) {\n    return true;\n  }\n\n  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n    return false;\n  }\n\n  var keysA = Object.keys(objA);\n  var keysB = Object.keys(objB);\n\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n\n  // Test for A's keys different from B.\n  for (var i = 0; i < keysA.length; i++) {\n    if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nmodule.exports = shallowEqual;\n},{}],167:[function(_dereq_,module,exports){\n/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyFunction = _dereq_(149);\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (\"development\" !== 'production') {\n  warning = function (condition, format) {\n    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n      args[_key - 2] = arguments[_key];\n    }\n\n    if (format === undefined) {\n      throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n    }\n\n    if (format.indexOf('Failed Composite propType: ') === 0) {\n      return; // Ignore CompositeComponent proptype check.\n    }\n\n    if (!condition) {\n      var argIndex = 0;\n      var message = 'Warning: ' + format.replace(/%s/g, function () {\n        return args[argIndex++];\n      });\n      if (typeof console !== 'undefined') {\n        console.error(message);\n      }\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        throw new Error(message);\n      } catch (x) {}\n    }\n  };\n}\n\nmodule.exports = warning;\n},{\"149\":149}],168:[function(_dereq_,module,exports){\n'use strict';\n/* eslint-disable no-unused-vars */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\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\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc');  // eslint-disable-line\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\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\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\n\t\treturn true;\n\t} catch (e) {\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}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\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\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tsymbols = Object.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\n\treturn to;\n};\n\n},{}]},{},[91])(91)\n});"
  },
  {
    "path": "test/lib/react_v16.0.0.js",
    "content": "/*\n React v16.0.0\n react.production.min.js\n\n Copyright (c) 2013-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';function y(){function q(){}function n(a,b,c,d,e,f,g){return{$$typeof:J,type:a,key:b,ref:c,props:g,_owner:f}}function z(a){for(var b=arguments.length-1,c=\"Minified React error #\"+a+\"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\\x3d\"+a,d=0;d<b;d++)c+=\"\\x26args[]\\x3d\"+encodeURIComponent(arguments[d+1]);b=Error(c+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\");b.name=\"Invariant Violation\";b.framesToPop=\n1;throw b;}function r(a,b,c){this.props=a;this.context=b;this.refs=A;this.updater=c||B}function C(a,b,c){this.props=a;this.context=b;this.refs=A;this.updater=c||B}function D(){}function E(a,b,c){this.props=a;this.context=b;this.refs=A;this.updater=c||B}function v(a){return function(){return a}}function R(a){var b={\"\\x3d\":\"\\x3d0\",\":\":\"\\x3d2\"};return\"$\"+(\"\"+a).replace(/[=:]/g,function(a){return b[a]})}function K(a,b,c,d){if(w.length){var e=w.pop();e.result=a;e.keyPrefix=b;e.func=c;e.context=d;e.count=\n0;return e}return{result:a,keyPrefix:b,func:c,context:d,count:0}}function L(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>w.length&&w.push(a)}function u(a,b,c,d){var e=typeof a;if(\"undefined\"===e||\"boolean\"===e)a=null;if(null===a||\"string\"===e||\"number\"===e||\"object\"===e&&a.$$typeof===S)return c(d,a,\"\"===b?\".\"+F(a,0):b),1;var f=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var g=0;g<a.length;g++){e=a[g];var h=b+F(e,g);f+=u(e,h,c,d)}else if(h=M&&a[M]||a[\"@@iterator\"],\"function\"===\ntypeof h)for(a=h.call(a),g=0;!(e=a.next()).done;)e=e.value,h=b+F(e,g++),f+=u(e,h,c,d);else\"object\"===e&&(c=\"\"+a,z(\"31\",\"[object Object]\"===c?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":c,\"\"));return f}function F(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?R(a.key):b.toString(36)}function T(a,b){a.func.call(a.context,b,a.count++)}function U(a,b,c){var d=a.result,e=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?G(a,d,c,H.thatReturnsArgument):null!=a&&(t.isValidElement(a)&&\n(a=t.cloneAndReplaceKey(a,e+(!a.key||b&&b.key===a.key?\"\":(\"\"+a.key).replace(N,\"$\\x26/\")+\"/\")+c)),d.push(a))}function G(a,b,c,d,e){var f=\"\";null!=c&&(f=(\"\"+c).replace(N,\"$\\x26/\")+\"/\");b=K(b,f,d,e);null==a||u(a,\"\",U,b);L(b)}var O=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,x=function(){try{if(!Object.assign)return!1;var a=new String(\"abc\");a[5]=\"de\";if(\"5\"===Object.getOwnPropertyNames(a)[0])return!1;var b={};for(a=0;10>a;a++)b[\"_\"+String.fromCharCode(a)]=\na;if(\"0123456789\"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(\"\"))return!1;var c={};\"abcdefghijklmnopqrst\".split(\"\").forEach(function(a){c[a]=a});return\"abcdefghijklmnopqrst\"!==Object.keys(Object.assign({},c)).join(\"\")?!1:!0}catch(d){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError(\"Object.assign cannot be called with null or undefined\");var c=Object(a);for(var d,e=1;e<arguments.length;e++){var f=Object(arguments[e]);for(var g in f)V.call(f,\ng)&&(c[g]=f[g]);if(O){d=O(f);for(var h=0;h<d.length;h++)W.call(f,d[h])&&(c[d[h]]=f[d[h]])}}return c},B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A={};r.prototype.isReactComponent={};r.prototype.setState=function(a,b){\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a?z(\"85\"):void 0;this.updater.enqueueSetState(this,a,b,\"setState\")};r.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};\nD.prototype=r.prototype;var k=C.prototype=new D;k.constructor=C;x(k,r.prototype);k.isPureReactComponent=!0;k=E.prototype=new D;k.constructor=E;x(k,r.prototype);k.unstable_isAsyncReactComponent=!0;k.render=function(){return this.props.children};var I={current:null},P=Object.prototype.hasOwnProperty,J=\"function\"===typeof Symbol&&Symbol[\"for\"]&&Symbol[\"for\"](\"react.element\")||60103,Q={key:!0,ref:!0,__self:!0,__source:!0};n.createElement=function(a,b,c){var d,e={},f=null,g=null,h=null,k=null;if(null!=\nb)for(d in void 0!==b.ref&&(g=b.ref),void 0!==b.key&&(f=\"\"+b.key),h=void 0===b.__self?null:b.__self,k=void 0===b.__source?null:b.__source,b)P.call(b,d)&&!Q.hasOwnProperty(d)&&(e[d]=b[d]);var m=arguments.length-2;if(1===m)e.children=c;else if(1<m){for(var l=Array(m),p=0;p<m;p++)l[p]=arguments[p+2];e.children=l}if(a&&a.defaultProps)for(d in m=a.defaultProps,m)void 0===e[d]&&(e[d]=m[d]);return n(a,f,g,h,k,I.current,e)};n.createFactory=function(a){var b=n.createElement.bind(null,a);b.type=a;return b};\nn.cloneAndReplaceKey=function(a,b){return n(a.type,b,a.ref,a._self,a._source,a._owner,a.props)};n.cloneElement=function(a,b,c){var d=x({},a.props),e=a.key,f=a.ref,g=a._self,h=a._source,k=a._owner;if(null!=b){void 0!==b.ref&&(f=b.ref,k=I.current);void 0!==b.key&&(e=\"\"+b.key);if(a.type&&a.type.defaultProps)var m=a.type.defaultProps;for(l in b)P.call(b,l)&&!Q.hasOwnProperty(l)&&(d[l]=void 0===b[l]&&void 0!==m?m[l]:b[l])}var l=arguments.length-2;if(1===l)d.children=c;else if(1<l){m=Array(l);for(var p=\n0;p<l;p++)m[p]=arguments[p+2];d.children=m}return n(a.type,e,f,g,h,k,d)};n.isValidElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===J};var t=n;q.thatReturns=v;q.thatReturnsFalse=v(!1);q.thatReturnsTrue=v(!0);q.thatReturnsNull=v(null);q.thatReturnsThis=function(){return this};q.thatReturnsArgument=function(a){return a};var H=q,M=\"function\"===typeof Symbol&&Symbol.iterator,S=\"function\"===typeof Symbol&&Symbol[\"for\"]&&Symbol[\"for\"](\"react.element\")||60103,N=/\\/+/g,w=[];return{Children:{map:function(a,\nb,c){if(null==a)return a;var d=[];G(a,d,null,b,c);return d},forEach:function(a,b,c){if(null==a)return a;b=K(null,null,b,c);null==a||u(a,\"\",T,b);L(b)},count:function(a){return null==a?0:u(a,\"\",H.thatReturnsNull,null)},toArray:function(a){var b=[];G(a,b,null,H.thatReturnsArgument);return b},only:function(a){t.isValidElement(a)?void 0:z(\"143\");return a}},Component:r,PureComponent:C,unstable_AsyncComponent:E,createElement:t.createElement,cloneElement:t.cloneElement,isValidElement:t.isValidElement,createFactory:t.createFactory,\nversion:\"16.0.0\",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:I,assign:x}}}\"object\"===typeof exports&&\"undefined\"!==typeof module?module.exports=y():\"function\"===typeof define&&define.amd?define(y):this.React=y();\n"
  },
  {
    "path": "test/lib/vue_v3.2.1.js",
    "content": "var Vue = (function (exports) {\n  'use strict';\n\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   */\n  function 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  }\n\n  /**\n   * dev only flag -> name mapping\n   */\n  const PatchFlagNames = {\n      [1 /* TEXT */]: `TEXT`,\n      [2 /* CLASS */]: `CLASS`,\n      [4 /* STYLE */]: `STYLE`,\n      [8 /* PROPS */]: `PROPS`,\n      [16 /* FULL_PROPS */]: `FULL_PROPS`,\n      [32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,\n      [64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,\n      [128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,\n      [256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,\n      [512 /* NEED_PATCH */]: `NEED_PATCH`,\n      [1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,\n      [2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,\n      [-1 /* HOISTED */]: `HOISTED`,\n      [-2 /* BAIL */]: `BAIL`\n  };\n\n  /**\n   * Dev only\n   */\n  const slotFlagsText = {\n      [1 /* STABLE */]: 'STABLE',\n      [2 /* DYNAMIC */]: 'DYNAMIC',\n      [3 /* FORWARDED */]: 'FORWARDED'\n  };\n\n  const 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';\n  const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);\n\n  const range = 2;\n  function generateCodeFrame(source, start = 0, end = source.length) {\n      // Split the content into individual lines but capture the newline sequence\n      // that separated each line. This is important because the actual sequence is\n      // needed to properly take into account the full line length for offset\n      // comparison\n      let lines = source.split(/(\\r?\\n)/);\n      // Separate the lines and newline sequences into separate arrays for easier referencing\n      const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n      lines = lines.filter((_, idx) => idx % 2 === 0);\n      let count = 0;\n      const res = [];\n      for (let i = 0; i < lines.length; i++) {\n          count +=\n              lines[i].length +\n                  ((newlineSequences[i] && newlineSequences[i].length) || 0);\n          if (count >= start) {\n              for (let j = i - range; j <= i + range || end > count; j++) {\n                  if (j < 0 || j >= lines.length)\n                      continue;\n                  const line = j + 1;\n                  res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}|  ${lines[j]}`);\n                  const lineLength = lines[j].length;\n                  const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;\n                  if (j === i) {\n                      // push underline\n                      const pad = start - (count - (lineLength + newLineSeqLength));\n                      const length = Math.max(1, end > count ? lineLength - pad : end - start);\n                      res.push(`   |  ` + ' '.repeat(pad) + '^'.repeat(length));\n                  }\n                  else if (j > i) {\n                      if (end > count) {\n                          const length = Math.max(Math.min(end - count, lineLength), 1);\n                          res.push(`   |  ` + '^'.repeat(length));\n                      }\n                      count += lineLength + newLineSeqLength;\n                  }\n              }\n              break;\n          }\n      }\n      return res.join('\\n');\n  }\n\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   */\n  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\n  const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);\n\n  function 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 = isString(item)\n                  ? parseStringStyle(item)\n                  : normalizeStyle(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 (isString(value)) {\n          return value;\n      }\n      else if (isObject(value)) {\n          return value;\n      }\n  }\n  const listDelimiterRE = /;(?![^(]*\\))/g;\n  const propertyDelimiterRE = /:(.+)/;\n  function 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  }\n  function 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  function normalizeProps(props) {\n      if (!props)\n          return null;\n      let { class: klass, style } = props;\n      if (klass && !isString(klass)) {\n          props.class = normalizeClass(klass);\n      }\n      if (style) {\n          props.style = normalizeStyle(style);\n      }\n      return props;\n  }\n\n  // These tag configs are shared between compiler-dom and runtime-dom, so they\n  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element\n  const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +\n      'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +\n      'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +\n      'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +\n      'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +\n      'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +\n      'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +\n      'option,output,progress,select,textarea,details,dialog,menu,' +\n      'summary,template,blockquote,iframe,tfoot';\n  // https://developer.mozilla.org/en-US/docs/Web/SVG/Element\n  const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +\n      'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +\n      'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +\n      'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +\n      'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +\n      'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +\n      'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +\n      'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +\n      'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +\n      'text,textPath,title,tspan,unknown,use,view';\n  const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\n  const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);\n  const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);\n  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);\n\n  function looseCompareArrays(a, b) {\n      if (a.length !== b.length)\n          return false;\n      let equal = true;\n      for (let i = 0; equal && i < a.length; i++) {\n          equal = looseEqual(a[i], b[i]);\n      }\n      return equal;\n  }\n  function looseEqual(a, b) {\n      if (a === b)\n          return true;\n      let aValidType = isDate(a);\n      let bValidType = isDate(b);\n      if (aValidType || bValidType) {\n          return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n      }\n      aValidType = isArray(a);\n      bValidType = isArray(b);\n      if (aValidType || bValidType) {\n          return aValidType && bValidType ? looseCompareArrays(a, b) : false;\n      }\n      aValidType = isObject(a);\n      bValidType = isObject(b);\n      if (aValidType || bValidType) {\n          /* istanbul ignore if: this if will probably never be called */\n          if (!aValidType || !bValidType) {\n              return false;\n          }\n          const aKeysCount = Object.keys(a).length;\n          const bKeysCount = Object.keys(b).length;\n          if (aKeysCount !== bKeysCount) {\n              return false;\n          }\n          for (const key in a) {\n              const aHasKey = a.hasOwnProperty(key);\n              const bHasKey = b.hasOwnProperty(key);\n              if ((aHasKey && !bHasKey) ||\n                  (!aHasKey && bHasKey) ||\n                  !looseEqual(a[key], b[key])) {\n                  return false;\n              }\n          }\n      }\n      return String(a) === String(b);\n  }\n  function looseIndexOf(arr, val) {\n      return arr.findIndex(item => looseEqual(item, val));\n  }\n\n  /**\n   * For converting {{ interpolation }} values to displayed strings.\n   * @private\n   */\n  const toDisplayString = (val) => {\n      return val == null\n          ? ''\n          : isArray(val) || (isObject(val) && val.toString === objectToString)\n              ? JSON.stringify(val, replacer, 2)\n              : String(val);\n  };\n  const replacer = (_key, val) => {\n      // can't use isRef here since @vue/shared has no deps\n      if (val && val.__v_isRef) {\n          return replacer(_key, val.value);\n      }\n      else 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  };\n\n  const EMPTY_OBJ = Object.freeze({})\n      ;\n  const EMPTY_ARR = Object.freeze([]) ;\n  const NOOP = () => { };\n  /**\n   * Always return false.\n   */\n  const NO = () => false;\n  const onRE = /^on[^a-z]/;\n  const isOn = (key) => onRE.test(key);\n  const isModelListener = (key) => key.startsWith('onUpdate:');\n  const extend = Object.assign;\n  const remove = (arr, el) => {\n      const i = arr.indexOf(el);\n      if (i > -1) {\n          arr.splice(i, 1);\n      }\n  };\n  const hasOwnProperty = Object.prototype.hasOwnProperty;\n  const hasOwn = (val, key) => hasOwnProperty.call(val, key);\n  const isArray = Array.isArray;\n  const isMap = (val) => toTypeString(val) === '[object Map]';\n  const isSet = (val) => toTypeString(val) === '[object Set]';\n  const isDate = (val) => val instanceof Date;\n  const isFunction = (val) => typeof val === 'function';\n  const isString = (val) => typeof val === 'string';\n  const isSymbol = (val) => typeof val === 'symbol';\n  const isObject = (val) => val !== null && typeof val === 'object';\n  const isPromise = (val) => {\n      return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n  };\n  const objectToString = Object.prototype.toString;\n  const toTypeString = (value) => objectToString.call(value);\n  const toRawType = (value) => {\n      // extract \"RawType\" from strings like \"[object RawType]\"\n      return toTypeString(value).slice(8, -1);\n  };\n  const isPlainObject = (val) => toTypeString(val) === '[object Object]';\n  const isIntegerKey = (key) => isString(key) &&\n      key !== 'NaN' &&\n      key[0] !== '-' &&\n      '' + parseInt(key, 10) === key;\n  const 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');\n  const 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  };\n  const camelizeRE = /-(\\w)/g;\n  /**\n   * @private\n   */\n  const camelize = cacheStringFunction((str) => {\n      return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\n  });\n  const hyphenateRE = /\\B([A-Z])/g;\n  /**\n   * @private\n   */\n  const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());\n  /**\n   * @private\n   */\n  const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\n  /**\n   * @private\n   */\n  const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);\n  // compare whether a value has changed, accounting for NaN.\n  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);\n  const invokeArrayFns = (fns, arg) => {\n      for (let i = 0; i < fns.length; i++) {\n          fns[i](arg);\n      }\n  };\n  const def = (obj, key, value) => {\n      Object.defineProperty(obj, key, {\n          configurable: true,\n          enumerable: false,\n          value\n      });\n  };\n  const toNumber = (val) => {\n      const n = parseFloat(val);\n      return isNaN(n) ? val : n;\n  };\n  let _globalThis;\n  const getGlobalThis = () => {\n      return (_globalThis ||\n          (_globalThis =\n              typeof globalThis !== 'undefined'\n                  ? globalThis\n                  : typeof self !== 'undefined'\n                      ? self\n                      : typeof window !== 'undefined'\n                          ? window\n                          : typeof global !== 'undefined'\n                              ? global\n                              : {}));\n  };\n\n  function warn(msg, ...args) {\n      console.warn(`[Vue warn] ${msg}`, ...args);\n  }\n\n  let activeEffectScope;\n  const effectScopeStack = [];\n  class EffectScope {\n      constructor(detached = false) {\n          this.active = true;\n          this.effects = [];\n          this.cleanups = [];\n          if (!detached && activeEffectScope) {\n              this.parent = activeEffectScope;\n              this.index =\n                  (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;\n          }\n      }\n      run(fn) {\n          if (this.active) {\n              try {\n                  this.on();\n                  return fn();\n              }\n              finally {\n                  this.off();\n              }\n          }\n          else {\n              warn(`cannot run an inactive effect scope.`);\n          }\n      }\n      on() {\n          if (this.active) {\n              effectScopeStack.push(this);\n              activeEffectScope = this;\n          }\n      }\n      off() {\n          if (this.active) {\n              effectScopeStack.pop();\n              activeEffectScope = effectScopeStack[effectScopeStack.length - 1];\n          }\n      }\n      stop(fromParent) {\n          if (this.active) {\n              this.effects.forEach(e => e.stop());\n              this.cleanups.forEach(cleanup => cleanup());\n              if (this.scopes) {\n                  this.scopes.forEach(e => e.stop(true));\n              }\n              // nested scope, dereference from parent to avoid memory leaks\n              if (this.parent && !fromParent) {\n                  // optimized O(1) removal\n                  const last = this.parent.scopes.pop();\n                  if (last && last !== this) {\n                      this.parent.scopes[this.index] = last;\n                      last.index = this.index;\n                  }\n              }\n              this.active = false;\n          }\n      }\n  }\n  function effectScope(detached) {\n      return new EffectScope(detached);\n  }\n  function recordEffectScope(effect, scope) {\n      scope = scope || activeEffectScope;\n      if (scope && scope.active) {\n          scope.effects.push(effect);\n      }\n  }\n  function getCurrentScope() {\n      return activeEffectScope;\n  }\n  function onScopeDispose(fn) {\n      if (activeEffectScope) {\n          activeEffectScope.cleanups.push(fn);\n      }\n      else {\n          warn(`onDispose() is called when there is no active effect scope ` +\n              ` to be associated with.`);\n      }\n  }\n\n  const createDep = (effects) => {\n      const dep = new Set(effects);\n      dep.w = 0;\n      dep.n = 0;\n      return dep;\n  };\n  const wasTracked = (dep) => (dep.w & trackOpBit) > 0;\n  const newTracked = (dep) => (dep.n & trackOpBit) > 0;\n  const initDepMarkers = ({ deps }) => {\n      if (deps.length) {\n          for (let i = 0; i < deps.length; i++) {\n              deps[i].w |= trackOpBit; // set was tracked\n          }\n      }\n  };\n  const finalizeDepMarkers = (effect) => {\n      const { deps } = effect;\n      if (deps.length) {\n          let ptr = 0;\n          for (let i = 0; i < deps.length; i++) {\n              const dep = deps[i];\n              if (wasTracked(dep) && !newTracked(dep)) {\n                  dep.delete(effect);\n              }\n              else {\n                  deps[ptr++] = dep;\n              }\n              // clear bits\n              dep.w &= ~trackOpBit;\n              dep.n &= ~trackOpBit;\n          }\n          deps.length = ptr;\n      }\n  };\n\n  const targetMap = new WeakMap();\n  // The number of effects currently being tracked recursively.\n  let effectTrackDepth = 0;\n  let trackOpBit = 1;\n  /**\n   * The bitwise track markers support at most 30 levels op recursion.\n   * This value is chosen to enable modern JS engines to use a SMI on all platforms.\n   * When recursion depth is greater, fall back to using a full cleanup.\n   */\n  const maxMarkerBits = 30;\n  const effectStack = [];\n  let activeEffect;\n  const ITERATE_KEY = Symbol('iterate' );\n  const MAP_KEY_ITERATE_KEY = Symbol('Map key iterate' );\n  class ReactiveEffect {\n      constructor(fn, scheduler = null, scope) {\n          this.fn = fn;\n          this.scheduler = scheduler;\n          this.active = true;\n          this.deps = [];\n          recordEffectScope(this, scope);\n      }\n      run() {\n          if (!this.active) {\n              return this.fn();\n          }\n          if (!effectStack.includes(this)) {\n              try {\n                  effectStack.push((activeEffect = this));\n                  enableTracking();\n                  trackOpBit = 1 << ++effectTrackDepth;\n                  if (effectTrackDepth <= maxMarkerBits) {\n                      initDepMarkers(this);\n                  }\n                  else {\n                      cleanupEffect(this);\n                  }\n                  return this.fn();\n              }\n              finally {\n                  if (effectTrackDepth <= maxMarkerBits) {\n                      finalizeDepMarkers(this);\n                  }\n                  trackOpBit = 1 << --effectTrackDepth;\n                  resetTracking();\n                  effectStack.pop();\n                  const n = effectStack.length;\n                  activeEffect = n > 0 ? effectStack[n - 1] : undefined;\n              }\n          }\n      }\n      stop() {\n          if (this.active) {\n              cleanupEffect(this);\n              if (this.onStop) {\n                  this.onStop();\n              }\n              this.active = false;\n          }\n      }\n  }\n  function cleanupEffect(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  }\n  function effect(fn, options) {\n      if (fn.effect) {\n          fn = fn.effect.fn;\n      }\n      const _effect = new ReactiveEffect(fn);\n      if (options) {\n          extend(_effect, options);\n          if (options.scope)\n              recordEffectScope(_effect, options.scope);\n      }\n      if (!options || !options.lazy) {\n          _effect.run();\n      }\n      const runner = _effect.run.bind(_effect);\n      runner.effect = _effect;\n      return runner;\n  }\n  function stop(runner) {\n      runner.effect.stop();\n  }\n  let shouldTrack = true;\n  const trackStack = [];\n  function pauseTracking() {\n      trackStack.push(shouldTrack);\n      shouldTrack = false;\n  }\n  function enableTracking() {\n      trackStack.push(shouldTrack);\n      shouldTrack = true;\n  }\n  function resetTracking() {\n      const last = trackStack.pop();\n      shouldTrack = last === undefined ? true : last;\n  }\n  function track(target, type, key) {\n      if (!isTracking()) {\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 = createDep()));\n      }\n      const eventInfo = { effect: activeEffect, target, type, key }\n          ;\n      trackEffects(dep, eventInfo);\n  }\n  function isTracking() {\n      return shouldTrack && activeEffect !== undefined;\n  }\n  function trackEffects(dep, debuggerEventExtraInfo) {\n      let shouldTrack = false;\n      if (effectTrackDepth <= maxMarkerBits) {\n          if (!newTracked(dep)) {\n              dep.n |= trackOpBit; // set newly tracked\n              shouldTrack = !wasTracked(dep);\n          }\n      }\n      else {\n          // Full cleanup mode.\n          shouldTrack = !dep.has(activeEffect);\n      }\n      if (shouldTrack) {\n          dep.add(activeEffect);\n          activeEffect.deps.push(dep);\n          if (activeEffect.onTrack) {\n              activeEffect.onTrack(Object.assign({\n                  effect: activeEffect\n              }, debuggerEventExtraInfo));\n          }\n      }\n  }\n  function trigger(target, type, key, newValue, oldValue, oldTarget) {\n      const depsMap = targetMap.get(target);\n      if (!depsMap) {\n          // never been tracked\n          return;\n      }\n      let deps = [];\n      if (type === \"clear\" /* CLEAR */) {\n          // collection being cleared\n          // trigger all effects for target\n          deps = [...depsMap.values()];\n      }\n      else if (key === 'length' && isArray(target)) {\n          depsMap.forEach((dep, key) => {\n              if (key === 'length' || key >= newValue) {\n                  deps.push(dep);\n              }\n          });\n      }\n      else {\n          // schedule runs for SET | ADD | DELETE\n          if (key !== void 0) {\n              deps.push(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                      deps.push(depsMap.get(ITERATE_KEY));\n                      if (isMap(target)) {\n                          deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));\n                      }\n                  }\n                  else if (isIntegerKey(key)) {\n                      // new index added to array -> length changes\n                      deps.push(depsMap.get('length'));\n                  }\n                  break;\n              case \"delete\" /* DELETE */:\n                  if (!isArray(target)) {\n                      deps.push(depsMap.get(ITERATE_KEY));\n                      if (isMap(target)) {\n                          deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));\n                      }\n                  }\n                  break;\n              case \"set\" /* SET */:\n                  if (isMap(target)) {\n                      deps.push(depsMap.get(ITERATE_KEY));\n                  }\n                  break;\n          }\n      }\n      const eventInfo = { target, type, key, newValue, oldValue, oldTarget }\n          ;\n      if (deps.length === 1) {\n          if (deps[0]) {\n              {\n                  triggerEffects(deps[0], eventInfo);\n              }\n          }\n      }\n      else {\n          const effects = [];\n          for (const dep of deps) {\n              if (dep) {\n                  effects.push(...dep);\n              }\n          }\n          {\n              triggerEffects(createDep(effects), eventInfo);\n          }\n      }\n  }\n  function triggerEffects(dep, debuggerEventExtraInfo) {\n      // spread into array for stabilization\n      for (const effect of isArray(dep) ? dep : [...dep]) {\n          if (effect !== activeEffect || effect.allowRecurse) {\n              if (effect.onTrigger) {\n                  effect.onTrigger(extend({ effect }, debuggerEventExtraInfo));\n              }\n              if (effect.scheduler) {\n                  effect.scheduler();\n              }\n              else {\n                  effect.run();\n              }\n          }\n      }\n  }\n\n  const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);\n  const builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)\n      .map(key => Symbol[key])\n      .filter(isSymbol));\n  const get = /*#__PURE__*/ createGetter();\n  const shallowGet = /*#__PURE__*/ createGetter(false, true);\n  const readonlyGet = /*#__PURE__*/ createGetter(true);\n  const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);\n  const arrayInstrumentations = /*#__PURE__*/ createArrayInstrumentations();\n  function createArrayInstrumentations() {\n      const instrumentations = {};\n      ['includes', 'indexOf', 'lastIndexOf'].forEach(key => {\n          instrumentations[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 = arr[key](...args);\n              if (res === -1 || res === false) {\n                  // if that didn't work, run it again using raw values.\n                  return arr[key](...args.map(toRaw));\n              }\n              else {\n                  return res;\n              }\n          };\n      });\n      ['push', 'pop', 'shift', 'unshift', 'splice'].forEach(key => {\n          instrumentations[key] = function (...args) {\n              pauseTracking();\n              const res = toRaw(this)[key].apply(this, args);\n              resetTracking();\n              return res;\n          };\n      });\n      return instrumentations;\n  }\n  function 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) ? builtInSymbols.has(key) : 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  }\n  const set = /*#__PURE__*/ createSetter();\n  const shallowSet = /*#__PURE__*/ createSetter(true);\n  function 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, oldValue);\n              }\n          }\n          return result;\n      };\n  }\n  function 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, oldValue);\n      }\n      return result;\n  }\n  function 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  }\n  function ownKeys(target) {\n      track(target, \"iterate\" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);\n      return Reflect.ownKeys(target);\n  }\n  const mutableHandlers = {\n      get,\n      set,\n      deleteProperty,\n      has,\n      ownKeys\n  };\n  const readonlyHandlers = {\n      get: readonlyGet,\n      set(target, key) {\n          {\n              console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\n          }\n          return true;\n      },\n      deleteProperty(target, key) {\n          {\n              console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\n          }\n          return true;\n      }\n  };\n  const shallowReactiveHandlers = /*#__PURE__*/ 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.\n  const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {\n      get: shallowReadonlyGet\n  });\n\n  const toReactive = (value) => isObject(value) ? reactive(value) : value;\n  const toReadonly = (value) => isObject(value) ? readonly(value) : value;\n  const toShallow = (value) => value;\n  const getProto = (v) => Reflect.getPrototypeOf(v);\n  function 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      else if (target !== rawTarget) {\n          // #3602 readonly(reactive(Map))\n          // ensure that the nested reactive `Map` can do tracking for itself\n          target.get(key);\n      }\n  }\n  function 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  }\n  function 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  }\n  function 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  }\n  function 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      else {\n          checkIdentityKeys(target, has, 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, oldValue);\n      }\n      return this;\n  }\n  function 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      else {\n          checkIdentityKeys(target, has, 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, oldValue);\n      }\n      return result;\n  }\n  function clear() {\n      const target = toRaw(this);\n      const hadItems = target.size !== 0;\n      const oldTarget = isMap(target)\n              ? new Map(target)\n              : new Set(target)\n          ;\n      // forward the operation before queueing reactions\n      const result = target.clear();\n      if (hadItems) {\n          trigger(target, \"clear\" /* CLEAR */, undefined, undefined, oldTarget);\n      }\n      return result;\n  }\n  function 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  }\n  function 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  }\n  function createReadonlyMethod(type) {\n      return function (...args) {\n          {\n              const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n              console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));\n          }\n          return type === \"delete\" /* DELETE */ ? false : this;\n      };\n  }\n  function createInstrumentations() {\n      const 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      };\n      const 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      };\n      const 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      };\n      const 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      };\n      const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];\n      iteratorMethods.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      });\n      return [\n          mutableInstrumentations,\n          readonlyInstrumentations,\n          shallowInstrumentations,\n          shallowReadonlyInstrumentations\n      ];\n  }\n  const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* #__PURE__*/ createInstrumentations();\n  function 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  }\n  const mutableCollectionHandlers = {\n      get: /*#__PURE__*/ createInstrumentationGetter(false, false)\n  };\n  const shallowCollectionHandlers = {\n      get: /*#__PURE__*/ createInstrumentationGetter(false, true)\n  };\n  const readonlyCollectionHandlers = {\n      get: /*#__PURE__*/ createInstrumentationGetter(true, false)\n  };\n  const shallowReadonlyCollectionHandlers = {\n      get: /*#__PURE__*/ createInstrumentationGetter(true, true)\n  };\n  function checkIdentityKeys(target, has, key) {\n      const rawKey = toRaw(key);\n      if (rawKey !== key && has.call(target, rawKey)) {\n          const type = toRawType(target);\n          console.warn(`Reactive ${type} contains both the raw and reactive ` +\n              `versions of the same object${type === `Map` ? ` as keys` : ``}, ` +\n              `which can lead to inconsistencies. ` +\n              `Avoid differentiating between the raw and reactive versions ` +\n              `of an object and only use the reactive version if possible.`);\n      }\n  }\n\n  const reactiveMap = new WeakMap();\n  const shallowReactiveMap = new WeakMap();\n  const readonlyMap = new WeakMap();\n  const shallowReadonlyMap = new WeakMap();\n  function 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  }\n  function getTargetType(value) {\n      return value[\"__v_skip\" /* SKIP */] || !Object.isExtensible(value)\n          ? 0 /* INVALID */\n          : targetTypeMap(toRawType(value));\n  }\n  function 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   */\n  function 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   */\n  function readonly(target) {\n      return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n  }\n  /**\n   * Returns a reactive-copy of the original object, where only the root level\n   * properties are readonly, and does NOT unwrap refs nor recursively convert\n   * returned properties.\n   * This is used for creating the props proxy object for stateful components.\n   */\n  function shallowReadonly(target) {\n      return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n  }\n  function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\n      if (!isObject(target)) {\n          {\n              console.warn(`value cannot be made reactive: ${String(target)}`);\n          }\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  }\n  function isReactive(value) {\n      if (isReadonly(value)) {\n          return isReactive(value[\"__v_raw\" /* RAW */]);\n      }\n      return !!(value && value[\"__v_isReactive\" /* IS_REACTIVE */]);\n  }\n  function isReadonly(value) {\n      return !!(value && value[\"__v_isReadonly\" /* IS_READONLY */]);\n  }\n  function isProxy(value) {\n      return isReactive(value) || isReadonly(value);\n  }\n  function toRaw(observed) {\n      const raw = observed && observed[\"__v_raw\" /* RAW */];\n      return raw ? toRaw(raw) : observed;\n  }\n  function markRaw(value) {\n      def(value, \"__v_skip\" /* SKIP */, true);\n      return value;\n  }\n\n  function trackRefValue(ref) {\n      if (isTracking()) {\n          ref = toRaw(ref);\n          if (!ref.dep) {\n              ref.dep = createDep();\n          }\n          {\n              trackEffects(ref.dep, {\n                  target: ref,\n                  type: \"get\" /* GET */,\n                  key: 'value'\n              });\n          }\n      }\n  }\n  function triggerRefValue(ref, newVal) {\n      ref = toRaw(ref);\n      if (ref.dep) {\n          {\n              triggerEffects(ref.dep, {\n                  target: ref,\n                  type: \"set\" /* SET */,\n                  key: 'value',\n                  newValue: newVal\n              });\n          }\n      }\n  }\n  const convert = (val) => isObject(val) ? reactive(val) : val;\n  function isRef(r) {\n      return Boolean(r && r.__v_isRef === true);\n  }\n  function ref(value) {\n      return createRef(value);\n  }\n  function shallowRef(value) {\n      return createRef(value, true);\n  }\n  class RefImpl {\n      constructor(value, _shallow = false) {\n          this._shallow = _shallow;\n          this.dep = undefined;\n          this.__v_isRef = true;\n          this._rawValue = _shallow ? value : toRaw(value);\n          this._value = _shallow ? value : convert(value);\n      }\n      get value() {\n          trackRefValue(this);\n          return this._value;\n      }\n      set value(newVal) {\n          newVal = this._shallow ? newVal : toRaw(newVal);\n          if (hasChanged(newVal, this._rawValue)) {\n              this._rawValue = newVal;\n              this._value = this._shallow ? newVal : convert(newVal);\n              triggerRefValue(this, newVal);\n          }\n      }\n  }\n  function createRef(rawValue, shallow = false) {\n      if (isRef(rawValue)) {\n          return rawValue;\n      }\n      return new RefImpl(rawValue, shallow);\n  }\n  function triggerRef(ref) {\n      triggerRefValue(ref, ref.value );\n  }\n  function unref(ref) {\n      return isRef(ref) ? ref.value : ref;\n  }\n  const 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  };\n  function proxyRefs(objectWithRefs) {\n      return isReactive(objectWithRefs)\n          ? objectWithRefs\n          : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n  }\n  class CustomRefImpl {\n      constructor(factory) {\n          this.dep = undefined;\n          this.__v_isRef = true;\n          const { get, set } = factory(() => trackRefValue(this), () => triggerRefValue(this));\n          this._get = get;\n          this._set = set;\n      }\n      get value() {\n          return this._get();\n      }\n      set value(newVal) {\n          this._set(newVal);\n      }\n  }\n  function customRef(factory) {\n      return new CustomRefImpl(factory);\n  }\n  function toRefs(object) {\n      if (!isProxy(object)) {\n          console.warn(`toRefs() expects a reactive object but received a plain one.`);\n      }\n      const ret = isArray(object) ? new Array(object.length) : {};\n      for (const key in object) {\n          ret[key] = toRef(object, key);\n      }\n      return ret;\n  }\n  class 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  }\n  function toRef(object, key) {\n      return isRef(object[key])\n          ? object[key]\n          : new ObjectRefImpl(object, key);\n  }\n\n  class ComputedRefImpl {\n      constructor(getter, _setter, isReadonly) {\n          this._setter = _setter;\n          this.dep = undefined;\n          this._dirty = true;\n          this.__v_isRef = true;\n          this.effect = new ReactiveEffect(getter, () => {\n              if (!this._dirty) {\n                  this._dirty = true;\n                  triggerRefValue(this);\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          trackRefValue(self);\n          if (self._dirty) {\n              self._dirty = false;\n              self._value = self.effect.run();\n          }\n          return self._value;\n      }\n      set value(newValue) {\n          this._setter(newValue);\n      }\n  }\n  function computed(getterOrOptions, debugOptions) {\n      let getter;\n      let setter;\n      if (isFunction(getterOrOptions)) {\n          getter = getterOrOptions;\n          setter = () => {\n                  console.warn('Write operation failed: computed value is readonly');\n              }\n              ;\n      }\n      else {\n          getter = getterOrOptions.get;\n          setter = getterOrOptions.set;\n      }\n      const cRef = new ComputedRefImpl(getter, setter, isFunction(getterOrOptions) || !getterOrOptions.set);\n      if (debugOptions) {\n          cRef.effect.onTrack = debugOptions.onTrack;\n          cRef.effect.onTrigger = debugOptions.onTrigger;\n      }\n      return cRef;\n  }\n\n  /* eslint-disable no-restricted-globals */\n  let isHmrUpdating = false;\n  const hmrDirtyComponents = new Set();\n  // Expose the HMR runtime on the global object\n  // This makes it entirely tree-shakable without polluting the exports and makes\n  // it easier to be used in toolings like vue-loader\n  // Note: for a component to be eligible for HMR it also needs the __hmrId option\n  // to be set so that its instances can be registered / removed.\n  {\n      const globalObject = typeof global !== 'undefined'\n          ? global\n          : typeof self !== 'undefined'\n              ? self\n              : typeof window !== 'undefined'\n                  ? window\n                  : {};\n      globalObject.__VUE_HMR_RUNTIME__ = {\n          createRecord: tryWrap(createRecord),\n          rerender: tryWrap(rerender),\n          reload: tryWrap(reload)\n      };\n  }\n  const map = new Map();\n  function registerHMR(instance) {\n      const id = instance.type.__hmrId;\n      let record = map.get(id);\n      if (!record) {\n          createRecord(id, instance.type);\n          record = map.get(id);\n      }\n      record.instances.add(instance);\n  }\n  function unregisterHMR(instance) {\n      map.get(instance.type.__hmrId).instances.delete(instance);\n  }\n  function createRecord(id, component) {\n      if (!component) {\n          warn$1(`HMR API usage is out of date.\\n` +\n              `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +\n              `dependency that handles Vue SFC compilation.`);\n          component = {};\n      }\n      if (map.has(id)) {\n          return false;\n      }\n      map.set(id, {\n          component: isClassComponent(component) ? component.__vccOpts : component,\n          instances: new Set()\n      });\n      return true;\n  }\n  function rerender(id, newRender) {\n      const record = map.get(id);\n      if (!record)\n          return;\n      if (newRender)\n          record.component.render = newRender;\n      // Array.from creates a snapshot which avoids the set being mutated during\n      // updates\n      Array.from(record.instances).forEach(instance => {\n          if (newRender) {\n              instance.render = newRender;\n          }\n          instance.renderCache = [];\n          // this flag forces child components with slot content to update\n          isHmrUpdating = true;\n          instance.update();\n          isHmrUpdating = false;\n      });\n  }\n  function reload(id, newComp) {\n      const record = map.get(id);\n      if (!record)\n          return;\n      // Array.from creates a snapshot which avoids the set being mutated during\n      // updates\n      const { component, instances } = record;\n      if (!hmrDirtyComponents.has(component)) {\n          // 1. Update existing comp definition to match new one\n          newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;\n          extend(component, newComp);\n          for (const key in component) {\n              if (key !== '__file' && !(key in newComp)) {\n                  delete component[key];\n              }\n          }\n          // 2. Mark component dirty. This forces the renderer to replace the component\n          // on patch.\n          hmrDirtyComponents.add(component);\n          // 3. Make sure to unmark the component after the reload.\n          queuePostFlushCb(() => {\n              hmrDirtyComponents.delete(component);\n          });\n      }\n      Array.from(instances).forEach(instance => {\n          // invalidate options resolution cache\n          instance.appContext.optionsCache.delete(instance.type);\n          if (instance.ceReload) {\n              // custom element\n              hmrDirtyComponents.add(component);\n              instance.ceReload(newComp.styles);\n              hmrDirtyComponents.delete(component);\n          }\n          else if (instance.parent) {\n              // 4. Force the parent instance to re-render. This will cause all updated\n              // components to be unmounted and re-mounted. Queue the update so that we\n              // don't end up forcing the same parent to re-render multiple times.\n              queueJob(instance.parent.update);\n              // instance is the inner component of an async custom element\n              // invoke to reset styles\n              if (instance.parent.type.__asyncLoader &&\n                  instance.parent.ceReload) {\n                  instance.parent.ceReload(newComp.styles);\n              }\n          }\n          else if (instance.appContext.reload) {\n              // root instance mounted via createApp() has a reload method\n              instance.appContext.reload();\n          }\n          else if (typeof window !== 'undefined') {\n              // root instance inside tree created via raw render(). Force reload.\n              window.location.reload();\n          }\n          else {\n              console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');\n          }\n      });\n  }\n  function tryWrap(fn) {\n      return (id, arg) => {\n          try {\n              return fn(id, arg);\n          }\n          catch (e) {\n              console.error(e);\n              console.warn(`[HMR] Something went wrong during Vue component hot-reload. ` +\n                  `Full reload required.`);\n          }\n      };\n  }\n\n  function setDevtoolsHook(hook) {\n      exports.devtools = hook;\n  }\n  function devtoolsInitApp(app, version) {\n      // TODO queue if devtools is undefined\n      if (!exports.devtools)\n          return;\n      exports.devtools.emit(\"app:init\" /* APP_INIT */, app, version, {\n          Fragment,\n          Text,\n          Comment: Comment$1,\n          Static\n      });\n  }\n  function devtoolsUnmountApp(app) {\n      if (!exports.devtools)\n          return;\n      exports.devtools.emit(\"app:unmount\" /* APP_UNMOUNT */, app);\n  }\n  const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook(\"component:added\" /* COMPONENT_ADDED */);\n  const devtoolsComponentUpdated = \n  /*#__PURE__*/ createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */);\n  const devtoolsComponentRemoved = \n  /*#__PURE__*/ createDevtoolsComponentHook(\"component:removed\" /* COMPONENT_REMOVED */);\n  function createDevtoolsComponentHook(hook) {\n      return (component) => {\n          if (!exports.devtools)\n              return;\n          exports.devtools.emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);\n      };\n  }\n  const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook(\"perf:start\" /* PERFORMANCE_START */);\n  const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook(\"perf:end\" /* PERFORMANCE_END */);\n  function createDevtoolsPerformanceHook(hook) {\n      return (component, type, time) => {\n          if (!exports.devtools)\n              return;\n          exports.devtools.emit(hook, component.appContext.app, component.uid, component, type, time);\n      };\n  }\n  function devtoolsComponentEmit(component, event, params) {\n      if (!exports.devtools)\n          return;\n      exports.devtools.emit(\"component:emit\" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);\n  }\n\n  const deprecationData = {\n      [\"GLOBAL_MOUNT\" /* GLOBAL_MOUNT */]: {\n          message: `The global app bootstrapping API has changed: vm.$mount() and the \"el\" ` +\n              `option have been removed. Use createApp(RootComponent).mount() instead.`,\n          link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`\n      },\n      [\"GLOBAL_MOUNT_CONTAINER\" /* GLOBAL_MOUNT_CONTAINER */]: {\n          message: `Vue detected directives on the mount container. ` +\n              `In Vue 3, the container is no longer considered part of the template ` +\n              `and will not be processed/replaced.`,\n          link: `https://v3.vuejs.org/guide/migration/mount-changes.html`\n      },\n      [\"GLOBAL_EXTEND\" /* GLOBAL_EXTEND */]: {\n          message: `Vue.extend() has been removed in Vue 3. ` +\n              `Use defineComponent() instead.`,\n          link: `https://v3.vuejs.org/api/global-api.html#definecomponent`\n      },\n      [\"GLOBAL_PROTOTYPE\" /* GLOBAL_PROTOTYPE */]: {\n          message: `Vue.prototype is no longer available in Vue 3. ` +\n              `Use app.config.globalProperties instead.`,\n          link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`\n      },\n      [\"GLOBAL_SET\" /* GLOBAL_SET */]: {\n          message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +\n              `Simply use native JavaScript mutations.`\n      },\n      [\"GLOBAL_DELETE\" /* GLOBAL_DELETE */]: {\n          message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +\n              `Simply use native JavaScript mutations.`\n      },\n      [\"GLOBAL_OBSERVABLE\" /* GLOBAL_OBSERVABLE */]: {\n          message: `Vue.observable() has been removed. ` +\n              `Use \\`import { reactive } from \"vue\"\\` from Composition API instead.`,\n          link: `https://v3.vuejs.org/api/basic-reactivity.html`\n      },\n      [\"GLOBAL_PRIVATE_UTIL\" /* GLOBAL_PRIVATE_UTIL */]: {\n          message: `Vue.util has been removed. Please refactor to avoid its usage ` +\n              `since it was an internal API even in Vue 2.`\n      },\n      [\"CONFIG_SILENT\" /* CONFIG_SILENT */]: {\n          message: `config.silent has been removed because it is not good practice to ` +\n              `intentionally suppress warnings. You can use your browser console's ` +\n              `filter features to focus on relevant messages.`\n      },\n      [\"CONFIG_DEVTOOLS\" /* CONFIG_DEVTOOLS */]: {\n          message: `config.devtools has been removed. To enable devtools for ` +\n              `production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,\n          link: `https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags`\n      },\n      [\"CONFIG_KEY_CODES\" /* CONFIG_KEY_CODES */]: {\n          message: `config.keyCodes has been removed. ` +\n              `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,\n          link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`\n      },\n      [\"CONFIG_PRODUCTION_TIP\" /* CONFIG_PRODUCTION_TIP */]: {\n          message: `config.productionTip has been removed.`,\n          link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`\n      },\n      [\"CONFIG_IGNORED_ELEMENTS\" /* CONFIG_IGNORED_ELEMENTS */]: {\n          message: () => {\n              let msg = `config.ignoredElements has been removed.`;\n              if (isRuntimeOnly()) {\n                  msg += ` Pass the \"isCustomElement\" option to @vue/compiler-dom instead.`;\n              }\n              else {\n                  msg += ` Use config.isCustomElement instead.`;\n              }\n              return msg;\n          },\n          link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`\n      },\n      [\"CONFIG_WHITESPACE\" /* CONFIG_WHITESPACE */]: {\n          // this warning is only relevant in the full build when using runtime\n          // compilation, so it's put in the runtime compatConfig list.\n          message: `Vue 3 compiler's whitespace option will default to \"condense\" instead of ` +\n              `\"preserve\". To suppress this warning, provide an explicit value for ` +\n              `\\`config.compilerOptions.whitespace\\`.`\n      },\n      [\"CONFIG_OPTION_MERGE_STRATS\" /* CONFIG_OPTION_MERGE_STRATS */]: {\n          message: `config.optionMergeStrategies no longer exposes internal strategies. ` +\n              `Use custom merge functions instead.`\n      },\n      [\"INSTANCE_SET\" /* INSTANCE_SET */]: {\n          message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +\n              `Simply use native JavaScript mutations.`\n      },\n      [\"INSTANCE_DELETE\" /* INSTANCE_DELETE */]: {\n          message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +\n              `Simply use native JavaScript mutations.`\n      },\n      [\"INSTANCE_DESTROY\" /* INSTANCE_DESTROY */]: {\n          message: `vm.$destroy() has been removed. Use app.unmount() instead.`,\n          link: `https://v3.vuejs.org/api/application-api.html#unmount`\n      },\n      [\"INSTANCE_EVENT_EMITTER\" /* INSTANCE_EVENT_EMITTER */]: {\n          message: `vm.$on/$once/$off() have been removed. ` +\n              `Use an external event emitter library instead.`,\n          link: `https://v3.vuejs.org/guide/migration/events-api.html`\n      },\n      [\"INSTANCE_EVENT_HOOKS\" /* INSTANCE_EVENT_HOOKS */]: {\n          message: event => `\"${event}\" lifecycle events are no longer supported. From templates, ` +\n              `use the \"vnode\" prefix instead of \"hook:\". For example, @${event} ` +\n              `should be changed to @vnode-${event.slice(5)}. ` +\n              `From JavaScript, use Composition API to dynamically register lifecycle ` +\n              `hooks.`,\n          link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`\n      },\n      [\"INSTANCE_CHILDREN\" /* INSTANCE_CHILDREN */]: {\n          message: `vm.$children has been removed. Consider refactoring your logic ` +\n              `to avoid relying on direct access to child components.`,\n          link: `https://v3.vuejs.org/guide/migration/children.html`\n      },\n      [\"INSTANCE_LISTENERS\" /* INSTANCE_LISTENERS */]: {\n          message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +\n              `included in vm.$attrs and it is no longer necessary to separately use ` +\n              `v-on=\"$listeners\" if you are already using v-bind=\"$attrs\". ` +\n              `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,\n          link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`\n      },\n      [\"INSTANCE_SCOPED_SLOTS\" /* INSTANCE_SCOPED_SLOTS */]: {\n          message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,\n          link: `https://v3.vuejs.org/guide/migration/slots-unification.html`\n      },\n      [\"INSTANCE_ATTRS_CLASS_STYLE\" /* INSTANCE_ATTRS_CLASS_STYLE */]: {\n          message: componentName => `Component <${componentName || 'Anonymous'}> has \\`inheritAttrs: false\\` but is ` +\n              `relying on class/style fallthrough from parent. In Vue 3, class/style ` +\n              `are now included in $attrs and will no longer fallthrough when ` +\n              `inheritAttrs is false. If you are already using v-bind=\"$attrs\" on ` +\n              `component root it should render the same end result. ` +\n              `If you are binding $attrs to a non-root element and expecting ` +\n              `class/style to fallthrough on root, you will need to now manually bind ` +\n              `them on root via :class=\"$attrs.class\".`,\n          link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`\n      },\n      [\"OPTIONS_DATA_FN\" /* OPTIONS_DATA_FN */]: {\n          message: `The \"data\" option can no longer be a plain object. ` +\n              `Always use a function.`,\n          link: `https://v3.vuejs.org/guide/migration/data-option.html`\n      },\n      [\"OPTIONS_DATA_MERGE\" /* OPTIONS_DATA_MERGE */]: {\n          message: (key) => `Detected conflicting key \"${key}\" when merging data option values. ` +\n              `In Vue 3, data keys are merged shallowly and will override one another.`,\n          link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`\n      },\n      [\"OPTIONS_BEFORE_DESTROY\" /* OPTIONS_BEFORE_DESTROY */]: {\n          message: `\\`beforeDestroy\\` has been renamed to \\`beforeUnmount\\`.`\n      },\n      [\"OPTIONS_DESTROYED\" /* OPTIONS_DESTROYED */]: {\n          message: `\\`destroyed\\` has been renamed to \\`unmounted\\`.`\n      },\n      [\"WATCH_ARRAY\" /* WATCH_ARRAY */]: {\n          message: `\"watch\" option or vm.$watch on an array value will no longer ` +\n              `trigger on array mutation unless the \"deep\" option is specified. ` +\n              `If current usage is intended, you can disable the compat behavior and ` +\n              `suppress this warning with:` +\n              `\\n\\n  configureCompat({ ${\"WATCH_ARRAY\" /* WATCH_ARRAY */}: false })\\n`,\n          link: `https://v3.vuejs.org/guide/migration/watch.html`\n      },\n      [\"PROPS_DEFAULT_THIS\" /* PROPS_DEFAULT_THIS */]: {\n          message: (key) => `props default value function no longer has access to \"this\". The compat ` +\n              `build only offers access to this.$options.` +\n              `(found in prop \"${key}\")`,\n          link: `https://v3.vuejs.org/guide/migration/props-default-this.html`\n      },\n      [\"CUSTOM_DIR\" /* CUSTOM_DIR */]: {\n          message: (legacyHook, newHook) => `Custom directive hook \"${legacyHook}\" has been removed. ` +\n              `Use \"${newHook}\" instead.`,\n          link: `https://v3.vuejs.org/guide/migration/custom-directives.html`\n      },\n      [\"V_FOR_REF\" /* V_FOR_REF */]: {\n          message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +\n              `Consider using function refs or refactor to avoid ref usage altogether.`,\n          link: `https://v3.vuejs.org/guide/migration/array-refs.html`\n      },\n      [\"V_ON_KEYCODE_MODIFIER\" /* V_ON_KEYCODE_MODIFIER */]: {\n          message: `Using keyCode as v-on modifier is no longer supported. ` +\n              `Use kebab-case key name modifiers instead.`,\n          link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`\n      },\n      [\"ATTR_FALSE_VALUE\" /* ATTR_FALSE_VALUE */]: {\n          message: (name) => `Attribute \"${name}\" with v-bind value \\`false\\` will render ` +\n              `${name}=\"false\" instead of removing it in Vue 3. To remove the attribute, ` +\n              `use \\`null\\` or \\`undefined\\` instead. If the usage is intended, ` +\n              `you can disable the compat behavior and suppress this warning with:` +\n              `\\n\\n  configureCompat({ ${\"ATTR_FALSE_VALUE\" /* ATTR_FALSE_VALUE */}: false })\\n`,\n          link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`\n      },\n      [\"ATTR_ENUMERATED_COERCION\" /* ATTR_ENUMERATED_COERCION */]: {\n          message: (name, value, coerced) => `Enumerated attribute \"${name}\" with v-bind value \\`${value}\\` will ` +\n              `${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to \"${coerced}\" in Vue 3. ` +\n              `Always use explicit \"true\" or \"false\" values for enumerated attributes. ` +\n              `If the usage is intended, ` +\n              `you can disable the compat behavior and suppress this warning with:` +\n              `\\n\\n  configureCompat({ ${\"ATTR_ENUMERATED_COERCION\" /* ATTR_ENUMERATED_COERCION */}: false })\\n`,\n          link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`\n      },\n      [\"TRANSITION_CLASSES\" /* TRANSITION_CLASSES */]: {\n          message: `` // this feature cannot be runtime-detected\n      },\n      [\"TRANSITION_GROUP_ROOT\" /* TRANSITION_GROUP_ROOT */]: {\n          message: `<TransitionGroup> no longer renders a root <span> element by ` +\n              `default if no \"tag\" prop is specified. If you do not rely on the span ` +\n              `for styling, you can disable the compat behavior and suppress this ` +\n              `warning with:` +\n              `\\n\\n  configureCompat({ ${\"TRANSITION_GROUP_ROOT\" /* TRANSITION_GROUP_ROOT */}: false })\\n`,\n          link: `https://v3.vuejs.org/guide/migration/transition-group.html`\n      },\n      [\"COMPONENT_ASYNC\" /* COMPONENT_ASYNC */]: {\n          message: (comp) => {\n              const name = getComponentName(comp);\n              return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \\`defineAsyncComponent()\\` ` +\n                  `in Vue 3. Plain functions will be treated as functional components in ` +\n                  `non-compat build. If you have already migrated all async component ` +\n                  `usage and intend to use plain functions for functional components, ` +\n                  `you can disable the compat behavior and suppress this ` +\n                  `warning with:` +\n                  `\\n\\n  configureCompat({ ${\"COMPONENT_ASYNC\" /* COMPONENT_ASYNC */}: false })\\n`);\n          },\n          link: `https://v3.vuejs.org/guide/migration/async-components.html`\n      },\n      [\"COMPONENT_FUNCTIONAL\" /* COMPONENT_FUNCTIONAL */]: {\n          message: (comp) => {\n              const name = getComponentName(comp);\n              return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The \"functional\" ` +\n                  `option has been removed. NOTE: Before migrating to use plain ` +\n                  `functions for functional components, first make sure that all async ` +\n                  `components usage have been migrated and its compat behavior has ` +\n                  `been disabled.`);\n          },\n          link: `https://v3.vuejs.org/guide/migration/functional-components.html`\n      },\n      [\"COMPONENT_V_MODEL\" /* COMPONENT_V_MODEL */]: {\n          message: (comp) => {\n              const configMsg = `opt-in to ` +\n                  `Vue 3 behavior on a per-component basis with \\`compatConfig: { ${\"COMPONENT_V_MODEL\" /* COMPONENT_V_MODEL */}: false }\\`.`;\n              if (comp.props &&\n                  (isArray(comp.props)\n                      ? comp.props.includes('modelValue')\n                      : hasOwn(comp.props, 'modelValue'))) {\n                  return (`Component delcares \"modelValue\" prop, which is Vue 3 usage, but ` +\n                      `is running under Vue 2 compat v-model behavior. You can ${configMsg}`);\n              }\n              return (`v-model usage on component has changed in Vue 3. Component that expects ` +\n                  `to work with v-model should now use the \"modelValue\" prop and emit the ` +\n                  `\"update:modelValue\" event. You can update the usage and then ${configMsg}`);\n          },\n          link: `https://v3.vuejs.org/guide/migration/v-model.html`\n      },\n      [\"RENDER_FUNCTION\" /* RENDER_FUNCTION */]: {\n          message: `Vue 3's render function API has changed. ` +\n              `You can opt-in to the new API with:` +\n              `\\n\\n  configureCompat({ ${\"RENDER_FUNCTION\" /* RENDER_FUNCTION */}: false })\\n` +\n              `\\n  (This can also be done per-component via the \"compatConfig\" option.)`,\n          link: `https://v3.vuejs.org/guide/migration/render-function-api.html`\n      },\n      [\"FILTERS\" /* FILTERS */]: {\n          message: `filters have been removed in Vue 3. ` +\n              `The \"|\" symbol will be treated as native JavaScript bitwise OR operator. ` +\n              `Use method calls or computed properties instead.`,\n          link: `https://v3.vuejs.org/guide/migration/filters.html`\n      },\n      [\"PRIVATE_APIS\" /* PRIVATE_APIS */]: {\n          message: name => `\"${name}\" is a Vue 2 private API that no longer exists in Vue 3. ` +\n              `If you are seeing this warning only due to a dependency, you can ` +\n              `suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`\n      }\n  };\n  const instanceWarned = Object.create(null);\n  const warnCount = Object.create(null);\n  function warnDeprecation(key, instance, ...args) {\n      instance = instance || getCurrentInstance();\n      // check user config\n      const config = getCompatConfigForKey(key, instance);\n      if (config === 'suppress-warning') {\n          return;\n      }\n      const dupKey = key + args.join('');\n      let compId = instance && formatComponentName(instance, instance.type);\n      if (compId === 'Anonymous' && instance) {\n          compId = instance.uid;\n      }\n      // skip if the same warning is emitted for the same component type\n      const componentDupKey = dupKey + compId;\n      if (componentDupKey in instanceWarned) {\n          return;\n      }\n      instanceWarned[componentDupKey] = true;\n      // same warning, but different component. skip the long message and just\n      // log the key and count.\n      if (dupKey in warnCount) {\n          warn$1(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);\n          return;\n      }\n      warnCount[dupKey] = 0;\n      const { message, link } = deprecationData[key];\n      warn$1(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\\n  Details: ${link}` : ``}`);\n      if (!isCompatEnabled(key, instance, true)) {\n          console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +\n              `lead to runtime errors.`);\n      }\n  }\n  const globalCompatConfig = {\n      MODE: 2\n  };\n  function getCompatConfigForKey(key, instance) {\n      const instanceConfig = instance && instance.type.compatConfig;\n      if (instanceConfig && key in instanceConfig) {\n          return instanceConfig[key];\n      }\n      return globalCompatConfig[key];\n  }\n  function isCompatEnabled(key, instance, enableForBuiltIn = false) {\n      // skip compat for built-in components\n      if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {\n          return false;\n      }\n      const rawMode = getCompatConfigForKey('MODE', instance) || 2;\n      const val = getCompatConfigForKey(key, instance);\n      const mode = isFunction(rawMode)\n          ? rawMode(instance && instance.type)\n          : rawMode;\n      if (mode === 2) {\n          return val !== false;\n      }\n      else {\n          return val === true || val === 'suppress-warning';\n      }\n  }\n\n  function emit(instance, event, ...rawArgs) {\n      const props = instance.vnode.props || EMPTY_OBJ;\n      {\n          const { emitsOptions, propsOptions: [propsOptions] } = instance;\n          if (emitsOptions) {\n              if (!(event in emitsOptions) &&\n                  !(false )) {\n                  if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {\n                      warn$1(`Component emitted event \"${event}\" but it is neither declared in ` +\n                          `the emits option nor as an \"${toHandlerKey(event)}\" prop.`);\n                  }\n              }\n              else {\n                  const validator = emitsOptions[event];\n                  if (isFunction(validator)) {\n                      const isValid = validator(...rawArgs);\n                      if (!isValid) {\n                          warn$1(`Invalid event arguments: event validation failed for event \"${event}\".`);\n                      }\n                  }\n              }\n          }\n      }\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      {\n          devtoolsComponentEmit(instance, event, args);\n      }\n      {\n          const lowerCaseEvent = event.toLowerCase();\n          if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {\n              warn$1(`Event \"${lowerCaseEvent}\" is emitted in component ` +\n                  `${formatComponentName(instance, instance.type)} but the handler is registered for \"${event}\". ` +\n                  `Note that HTML attributes are case-insensitive and you cannot use ` +\n                  `v-on to listen to camelCase events when using in-DOM templates. ` +\n                  `You should probably use \"${hyphenate(event)}\" instead of \"${event}\".`);\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 = {};\n          }\n          else if (instance.emitted[handlerName]) {\n              return;\n          }\n          instance.emitted[handlerName] = true;\n          callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\n      }\n  }\n  function normalizeEmitsOptions(comp, appContext, asMixin = false) {\n      const cache = appContext.emitsCache;\n      const cached = cache.get(comp);\n      if (cached !== undefined) {\n          return cached;\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          cache.set(comp, null);\n          return null;\n      }\n      if (isArray(raw)) {\n          raw.forEach(key => (normalized[key] = null));\n      }\n      else {\n          extend(normalized, raw);\n      }\n      cache.set(comp, normalized);\n      return 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.\n  function 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  }\n\n  /**\n   * mark the current rendering instance for asset resolution (e.g.\n   * resolveComponent, resolveDirective) during render\n   */\n  let currentRenderingInstance = null;\n  let 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   */\n  function setCurrentRenderingInstance(instance) {\n      const prev = currentRenderingInstance;\n      currentRenderingInstance = instance;\n      currentScopeId = (instance && instance.type.__scopeId) || null;\n      return prev;\n  }\n  /**\n   * Set scope id when creating hoisted vnodes.\n   * @private compiler helper\n   */\n  function pushScopeId(id) {\n      currentScopeId = id;\n  }\n  /**\n   * Technically we no longer need this after 3.0.8 but we need to keep the same\n   * API for backwards compat w/ code generated by compilers.\n   * @private\n   */\n  function popScopeId() {\n      currentScopeId = null;\n  }\n  /**\n   * Only for backwards compat\n   * @private\n   */\n  const withScopeId = (_id) => withCtx;\n  /**\n   * Wrap a slot function to memoize current rendering instance\n   * @private compiler helper\n   */\n  function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot // false only\n  ) {\n      if (!ctx)\n          return fn;\n      // already normalized\n      if (fn._n) {\n          return fn;\n      }\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 disable block tracking and\n          // force bail out when invoking a compiled slot (indicated by the ._d flag).\n          // This isn't necessary if rendering a compiled `<slot>`, so we flip the\n          // ._d flag off when invoking the wrapped fn inside `renderSlot`.\n          if (renderFnWithContext._d) {\n              setBlockTracking(-1);\n          }\n          const prevInstance = setCurrentRenderingInstance(ctx);\n          const res = fn(...args);\n          setCurrentRenderingInstance(prevInstance);\n          if (renderFnWithContext._d) {\n              setBlockTracking(1);\n          }\n          {\n              devtoolsComponentUpdated(ctx);\n          }\n          return res;\n      };\n      // mark normalized to avoid duplicated wrapping\n      renderFnWithContext._n = true;\n      // mark this as compiled by default\n      // this is used in vnode.ts -> normalizeChildren() to set the slot\n      // rendering flag.\n      renderFnWithContext._c = true;\n      // disable block tracking by default\n      renderFnWithContext._d = true;\n      return renderFnWithContext;\n  }\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   */\n  let accessedAttrs = false;\n  function markAttrsAccessed() {\n      accessedAttrs = true;\n  }\n  function renderComponentRoot(instance) {\n      const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;\n      let result;\n      const prev = setCurrentRenderingInstance(instance);\n      {\n          accessedAttrs = false;\n      }\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 (true && attrs === props) {\n                  markAttrsAccessed();\n              }\n              result = normalizeVNode(render.length > 1\n                  ? render(props, true\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 (true &&\n              result.patchFlag > 0 &&\n              result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {\n              ;\n              [root, setRoot] = getChildRoot(result);\n          }\n          if (fallthroughAttrs && inheritAttrs !== false) {\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 (true && !accessedAttrs && root.type !== Comment$1) {\n                      const allAttrs = Object.keys(attrs);\n                      const eventAttrs = [];\n                      const extraAttrs = [];\n                      for (let i = 0, l = allAttrs.length; i < l; i++) {\n                          const key = allAttrs[i];\n                          if (isOn(key)) {\n                              // ignore v-model handlers when they fail to fallthrough\n                              if (!isModelListener(key)) {\n                                  // remove `on`, lowercase first letter to reflect event casing\n                                  // accurately\n                                  eventAttrs.push(key[2].toLowerCase() + key.slice(3));\n                              }\n                          }\n                          else {\n                              extraAttrs.push(key);\n                          }\n                      }\n                      if (extraAttrs.length) {\n                          warn$1(`Extraneous non-props attributes (` +\n                              `${extraAttrs.join(', ')}) ` +\n                              `were passed to component but could not be automatically inherited ` +\n                              `because component renders fragment or text root nodes.`);\n                      }\n                      if (eventAttrs.length) {\n                          warn$1(`Extraneous non-emits event listeners (` +\n                              `${eventAttrs.join(', ')}) ` +\n                              `were passed to component but could not be automatically inherited ` +\n                              `because component renders fragment or text root nodes. ` +\n                              `If the listener is intended to be a component custom event listener only, ` +\n                              `declare it using the \"emits\" option.`);\n                      }\n                  }\n              }\n          }\n          if (false &&\n              isCompatEnabled(\"INSTANCE_ATTRS_CLASS_STYLE\" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&\n              vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&\n              (root.shapeFlag & 1 /* ELEMENT */ ||\n                  root.shapeFlag & 6 /* COMPONENT */)) ;\n          // inherit directives\n          if (vnode.dirs) {\n              if (true && !isElementRoot(root)) {\n                  warn$1(`Runtime directive used on component with non-element root node. ` +\n                      `The directives will not function as intended.`);\n              }\n              root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\n          }\n          // inherit transition data\n          if (vnode.transition) {\n              if (true && !isElementRoot(root)) {\n                  warn$1(`Component inside <Transition> renders non-element root node ` +\n                      `that cannot be animated.`);\n              }\n              root.transition = vnode.transition;\n          }\n          if (true && setRoot) {\n              setRoot(root);\n          }\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$1);\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   */\n  const 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  };\n  function 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$1 || 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  }\n  const 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  };\n  const 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  };\n  const isElementRoot = (vnode) => {\n      return (vnode.shapeFlag & 6 /* COMPONENT */ ||\n          vnode.shapeFlag & 1 /* ELEMENT */ ||\n          vnode.type === Comment$1 // potential v-if branch switch\n      );\n  };\n  function 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      // Parent component's render function was hot-updated. Since this may have\n      // caused the child component's slots content to have changed, we need to\n      // force the child to update as well.\n      if ((prevChildren || nextChildren) && isHmrUpdating) {\n          return true;\n      }\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  }\n  function 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  }\n  function updateHOCHostEl({ vnode, parent }, el // HostNode\n  ) {\n      while (parent && parent.subTree === vnode) {\n          (vnode = parent.vnode).el = el;\n          parent = parent.parent;\n      }\n  }\n\n  const isSuspense = (type) => type.__isSuspense;\n  // Suspense exposes a component-like API, and is treated like a component\n  // in the compiler, but internally it's a special built-in type that hooks\n  // directly into the renderer.\n  const SuspenseImpl = {\n      name: 'Suspense',\n      // In order to make Suspense tree-shakable, we need to avoid importing it\n      // directly in the renderer. The renderer checks for the __isSuspense flag\n      // on a vnode's type and calls the `process` method, passing in renderer\n      // internals.\n      __isSuspense: true,\n      process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, \n      // platform-specific impl passed from renderer\n      rendererInternals) {\n          if (n1 == null) {\n              mountSuspense(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals);\n          }\n          else {\n              patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, rendererInternals);\n          }\n      },\n      hydrate: hydrateSuspense,\n      create: createSuspenseBoundary,\n      normalize: normalizeSuspenseChildren\n  };\n  // Force-casted public typing for h and TSX props inference\n  const Suspense = (SuspenseImpl );\n  function triggerEvent(vnode, name) {\n      const eventListener = vnode.props && vnode.props[name];\n      if (isFunction(eventListener)) {\n          eventListener();\n      }\n  }\n  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {\n      const { p: patch, o: { createElement } } = rendererInternals;\n      const hiddenContainer = createElement('div');\n      const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals));\n      // start mounting the content subtree in an off-dom container\n      patch(null, (suspense.pendingBranch = vnode.ssContent), hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds);\n      // now check if we have encountered any async deps\n      if (suspense.deps > 0) {\n          // has async\n          // invoke @fallback event\n          triggerEvent(vnode, 'onPending');\n          triggerEvent(vnode, 'onFallback');\n          // mount the fallback tree\n          patch(null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\n          isSVG, slotScopeIds);\n          setActiveBranch(suspense, vnode.ssFallback);\n      }\n      else {\n          // Suspense has no async deps. Just resolve.\n          suspense.resolve();\n      }\n  }\n  function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {\n      const suspense = (n2.suspense = n1.suspense);\n      suspense.vnode = n2;\n      n2.el = n1.el;\n      const newBranch = n2.ssContent;\n      const newFallback = n2.ssFallback;\n      const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;\n      if (pendingBranch) {\n          suspense.pendingBranch = newBranch;\n          if (isSameVNodeType(newBranch, pendingBranch)) {\n              // same root type but content may have changed.\n              patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\n              if (suspense.deps <= 0) {\n                  suspense.resolve();\n              }\n              else if (isInFallback) {\n                  patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\n                  isSVG, slotScopeIds, optimized);\n                  setActiveBranch(suspense, newFallback);\n              }\n          }\n          else {\n              // toggled before pending tree is resolved\n              suspense.pendingId++;\n              if (isHydrating) {\n                  // if toggled before hydration is finished, the current DOM tree is\n                  // no longer valid. set it as the active branch so it will be unmounted\n                  // when resolved\n                  suspense.isHydrating = false;\n                  suspense.activeBranch = pendingBranch;\n              }\n              else {\n                  unmount(pendingBranch, parentComponent, suspense);\n              }\n              // increment pending ID. this is used to invalidate async callbacks\n              // reset suspense state\n              suspense.deps = 0;\n              // discard effects from pending branch\n              suspense.effects.length = 0;\n              // discard previous container\n              suspense.hiddenContainer = createElement('div');\n              if (isInFallback) {\n                  // already in fallback state\n                  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\n                  if (suspense.deps <= 0) {\n                      suspense.resolve();\n                  }\n                  else {\n                      patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\n                      isSVG, slotScopeIds, optimized);\n                      setActiveBranch(suspense, newFallback);\n                  }\n              }\n              else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\n                  // toggled \"back\" to current active branch\n                  patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized);\n                  // force resolve\n                  suspense.resolve(true);\n              }\n              else {\n                  // switched to a 3rd branch\n                  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\n                  if (suspense.deps <= 0) {\n                      suspense.resolve();\n                  }\n              }\n          }\n      }\n      else {\n          if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\n              // root did not change, just normal patch\n              patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized);\n              setActiveBranch(suspense, newBranch);\n          }\n          else {\n              // root node toggled\n              // invoke @pending event\n              triggerEvent(n2, 'onPending');\n              // mount pending branch in off-dom container\n              suspense.pendingBranch = newBranch;\n              suspense.pendingId++;\n              patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\n              if (suspense.deps <= 0) {\n                  // incoming branch has no async deps, resolve now.\n                  suspense.resolve();\n              }\n              else {\n                  const { timeout, pendingId } = suspense;\n                  if (timeout > 0) {\n                      setTimeout(() => {\n                          if (suspense.pendingId === pendingId) {\n                              suspense.fallback(newFallback);\n                          }\n                      }, timeout);\n                  }\n                  else if (timeout === 0) {\n                      suspense.fallback(newFallback);\n                  }\n              }\n          }\n      }\n  }\n  let hasWarned = false;\n  function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {\n      /* istanbul ignore if */\n      if (!hasWarned) {\n          hasWarned = true;\n          // @ts-ignore `console.info` cannot be null error\n          console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);\n      }\n      const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;\n      const timeout = toNumber(vnode.props && vnode.props.timeout);\n      const suspense = {\n          vnode,\n          parent,\n          parentComponent,\n          isSVG,\n          container,\n          hiddenContainer,\n          anchor,\n          deps: 0,\n          pendingId: 0,\n          timeout: typeof timeout === 'number' ? timeout : -1,\n          activeBranch: null,\n          pendingBranch: null,\n          isInFallback: true,\n          isHydrating,\n          isUnmounted: false,\n          effects: [],\n          resolve(resume = false) {\n              {\n                  if (!resume && !suspense.pendingBranch) {\n                      throw new Error(`suspense.resolve() is called without a pending branch.`);\n                  }\n                  if (suspense.isUnmounted) {\n                      throw new Error(`suspense.resolve() is called on an already unmounted suspense boundary.`);\n                  }\n              }\n              const { vnode, activeBranch, pendingBranch, pendingId, effects, parentComponent, container } = suspense;\n              if (suspense.isHydrating) {\n                  suspense.isHydrating = false;\n              }\n              else if (!resume) {\n                  const delayEnter = activeBranch &&\n                      pendingBranch.transition &&\n                      pendingBranch.transition.mode === 'out-in';\n                  if (delayEnter) {\n                      activeBranch.transition.afterLeave = () => {\n                          if (pendingId === suspense.pendingId) {\n                              move(pendingBranch, container, anchor, 0 /* ENTER */);\n                          }\n                      };\n                  }\n                  // this is initial anchor on mount\n                  let { anchor } = suspense;\n                  // unmount current active tree\n                  if (activeBranch) {\n                      // if the fallback tree was mounted, it may have been moved\n                      // as part of a parent suspense. get the latest anchor for insertion\n                      anchor = next(activeBranch);\n                      unmount(activeBranch, parentComponent, suspense, true);\n                  }\n                  if (!delayEnter) {\n                      // move content from off-dom container to actual container\n                      move(pendingBranch, container, anchor, 0 /* ENTER */);\n                  }\n              }\n              setActiveBranch(suspense, pendingBranch);\n              suspense.pendingBranch = null;\n              suspense.isInFallback = false;\n              // flush buffered effects\n              // check if there is a pending parent suspense\n              let parent = suspense.parent;\n              let hasUnresolvedAncestor = false;\n              while (parent) {\n                  if (parent.pendingBranch) {\n                      // found a pending parent suspense, merge buffered post jobs\n                      // into that parent\n                      parent.effects.push(...effects);\n                      hasUnresolvedAncestor = true;\n                      break;\n                  }\n                  parent = parent.parent;\n              }\n              // no pending parent suspense, flush all jobs\n              if (!hasUnresolvedAncestor) {\n                  queuePostFlushCb(effects);\n              }\n              suspense.effects = [];\n              // invoke @resolve event\n              triggerEvent(vnode, 'onResolve');\n          },\n          fallback(fallbackVNode) {\n              if (!suspense.pendingBranch) {\n                  return;\n              }\n              const { vnode, activeBranch, parentComponent, container, isSVG } = suspense;\n              // invoke @fallback event\n              triggerEvent(vnode, 'onFallback');\n              const anchor = next(activeBranch);\n              const mountFallback = () => {\n                  if (!suspense.isInFallback) {\n                      return;\n                  }\n                  // mount the fallback tree\n                  patch(null, fallbackVNode, container, anchor, parentComponent, null, // fallback tree will not have suspense context\n                  isSVG, slotScopeIds, optimized);\n                  setActiveBranch(suspense, fallbackVNode);\n              };\n              const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === 'out-in';\n              if (delayEnter) {\n                  activeBranch.transition.afterLeave = mountFallback;\n              }\n              suspense.isInFallback = true;\n              // unmount current active branch\n              unmount(activeBranch, parentComponent, null, // no suspense so unmount hooks fire now\n              true // shouldRemove\n              );\n              if (!delayEnter) {\n                  mountFallback();\n              }\n          },\n          move(container, anchor, type) {\n              suspense.activeBranch &&\n                  move(suspense.activeBranch, container, anchor, type);\n              suspense.container = container;\n          },\n          next() {\n              return suspense.activeBranch && next(suspense.activeBranch);\n          },\n          registerDep(instance, setupRenderEffect) {\n              const isInPendingSuspense = !!suspense.pendingBranch;\n              if (isInPendingSuspense) {\n                  suspense.deps++;\n              }\n              const hydratedEl = instance.vnode.el;\n              instance\n                  .asyncDep.catch(err => {\n                  handleError(err, instance, 0 /* SETUP_FUNCTION */);\n              })\n                  .then(asyncSetupResult => {\n                  // retry when the setup() promise resolves.\n                  // component may have been unmounted before resolve.\n                  if (instance.isUnmounted ||\n                      suspense.isUnmounted ||\n                      suspense.pendingId !== instance.suspenseId) {\n                      return;\n                  }\n                  // retry from this component\n                  instance.asyncResolved = true;\n                  const { vnode } = instance;\n                  {\n                      pushWarningContext(vnode);\n                  }\n                  handleSetupResult(instance, asyncSetupResult, false);\n                  if (hydratedEl) {\n                      // vnode may have been replaced if an update happened before the\n                      // async dep is resolved.\n                      vnode.el = hydratedEl;\n                  }\n                  const placeholder = !hydratedEl && instance.subTree.el;\n                  setupRenderEffect(instance, vnode, \n                  // component may have been moved before resolve.\n                  // if this is not a hydration, instance.subTree will be the comment\n                  // placeholder.\n                  parentNode(hydratedEl || instance.subTree.el), \n                  // anchor will not be used if this is hydration, so only need to\n                  // consider the comment placeholder case.\n                  hydratedEl ? null : next(instance.subTree), suspense, isSVG, optimized);\n                  if (placeholder) {\n                      remove(placeholder);\n                  }\n                  updateHOCHostEl(instance, vnode.el);\n                  {\n                      popWarningContext();\n                  }\n                  // only decrease deps count if suspense is not already resolved\n                  if (isInPendingSuspense && --suspense.deps === 0) {\n                      suspense.resolve();\n                  }\n              });\n          },\n          unmount(parentSuspense, doRemove) {\n              suspense.isUnmounted = true;\n              if (suspense.activeBranch) {\n                  unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);\n              }\n              if (suspense.pendingBranch) {\n                  unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);\n              }\n          }\n      };\n      return suspense;\n  }\n  function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {\n      /* eslint-disable no-restricted-globals */\n      const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement('div'), null, isSVG, slotScopeIds, optimized, rendererInternals, true /* hydrating */));\n      // there are two possible scenarios for server-rendered suspense:\n      // - success: ssr content should be fully resolved\n      // - failure: ssr content should be the fallback branch.\n      // however, on the client we don't really know if it has failed or not\n      // attempt to hydrate the DOM assuming it has succeeded, but we still\n      // need to construct a suspense boundary first\n      const result = hydrateNode(node, (suspense.pendingBranch = vnode.ssContent), parentComponent, suspense, slotScopeIds, optimized);\n      if (suspense.deps === 0) {\n          suspense.resolve();\n      }\n      return result;\n      /* eslint-enable no-restricted-globals */\n  }\n  function normalizeSuspenseChildren(vnode) {\n      const { shapeFlag, children } = vnode;\n      const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;\n      vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);\n      vnode.ssFallback = isSlotChildren\n          ? normalizeSuspenseSlot(children.fallback)\n          : createVNode(Comment);\n  }\n  function normalizeSuspenseSlot(s) {\n      let block;\n      if (isFunction(s)) {\n          const isCompiledSlot = s._c;\n          if (isCompiledSlot) {\n              // disableTracking: false\n              // allow block tracking for compiled slots\n              // (see ./componentRenderContext.ts)\n              s._d = false;\n              openBlock();\n          }\n          s = s();\n          if (isCompiledSlot) {\n              s._d = true;\n              block = currentBlock;\n              closeBlock();\n          }\n      }\n      if (isArray(s)) {\n          const singleChild = filterSingleRoot(s);\n          if (!singleChild) {\n              warn$1(`<Suspense> slots expect a single root node.`);\n          }\n          s = singleChild;\n      }\n      s = normalizeVNode(s);\n      if (block && !s.dynamicChildren) {\n          s.dynamicChildren = block.filter(c => c !== s);\n      }\n      return s;\n  }\n  function 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  }\n  function setActiveBranch(suspense, branch) {\n      suspense.activeBranch = branch;\n      const { vnode, parentComponent } = suspense;\n      const el = (vnode.el = branch.el);\n      // in case suspense is the root node of a component,\n      // recursively update the HOC el\n      if (parentComponent && parentComponent.subTree === vnode) {\n          parentComponent.vnode.el = el;\n          updateHOCHostEl(parentComponent, el);\n      }\n  }\n\n  function provide(key, value) {\n      if (!currentInstance) {\n          {\n              warn$1(`provide() can only be used inside setup().`);\n          }\n      }\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  }\n  function 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.call(instance.proxy)\n                  : defaultValue;\n          }\n          else {\n              warn$1(`injection \"${String(key)}\" not found.`);\n          }\n      }\n      else {\n          warn$1(`inject() can only be used inside setup() or functional components.`);\n      }\n  }\n\n  function useTransitionState() {\n      const state = {\n          isMounted: false,\n          isLeaving: false,\n          isUnmounting: false,\n          leavingVNodes: new Map()\n      };\n      onMounted(() => {\n          state.isMounted = true;\n      });\n      onBeforeUnmount(() => {\n          state.isUnmounting = true;\n      });\n      return state;\n  }\n  const TransitionHookValidator = [Function, Array];\n  const BaseTransitionImpl = {\n      name: `BaseTransition`,\n      props: {\n          mode: String,\n          appear: Boolean,\n          persisted: Boolean,\n          // enter\n          onBeforeEnter: TransitionHookValidator,\n          onEnter: TransitionHookValidator,\n          onAfterEnter: TransitionHookValidator,\n          onEnterCancelled: TransitionHookValidator,\n          // leave\n          onBeforeLeave: TransitionHookValidator,\n          onLeave: TransitionHookValidator,\n          onAfterLeave: TransitionHookValidator,\n          onLeaveCancelled: TransitionHookValidator,\n          // appear\n          onBeforeAppear: TransitionHookValidator,\n          onAppear: TransitionHookValidator,\n          onAfterAppear: TransitionHookValidator,\n          onAppearCancelled: TransitionHookValidator\n      },\n      setup(props, { slots }) {\n          const instance = getCurrentInstance();\n          const state = useTransitionState();\n          let prevTransitionKey;\n          return () => {\n              const children = slots.default && getTransitionRawChildren(slots.default(), true);\n              if (!children || !children.length) {\n                  return;\n              }\n              // warn multiple elements\n              if (children.length > 1) {\n                  warn$1('<transition> can only be used on a single element or component. Use ' +\n                      '<transition-group> for lists.');\n              }\n              // there's no need to track reactivity for these props so use the raw\n              // props for a bit better perf\n              const rawProps = toRaw(props);\n              const { mode } = rawProps;\n              // check mode\n              if (mode && !['in-out', 'out-in', 'default'].includes(mode)) {\n                  warn$1(`invalid <transition> mode: ${mode}`);\n              }\n              // at this point children has a guaranteed length of 1.\n              const child = children[0];\n              if (state.isLeaving) {\n                  return emptyPlaceholder(child);\n              }\n              // in the case of <transition><keep-alive/></transition>, we need to\n              // compare the type of the kept-alive children.\n              const innerChild = getKeepAliveChild(child);\n              if (!innerChild) {\n                  return emptyPlaceholder(child);\n              }\n              const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance);\n              setTransitionHooks(innerChild, enterHooks);\n              const oldChild = instance.subTree;\n              const oldInnerChild = oldChild && getKeepAliveChild(oldChild);\n              let transitionKeyChanged = false;\n              const { getTransitionKey } = innerChild.type;\n              if (getTransitionKey) {\n                  const key = getTransitionKey();\n                  if (prevTransitionKey === undefined) {\n                      prevTransitionKey = key;\n                  }\n                  else if (key !== prevTransitionKey) {\n                      prevTransitionKey = key;\n                      transitionKeyChanged = true;\n                  }\n              }\n              // handle mode\n              if (oldInnerChild &&\n                  oldInnerChild.type !== Comment$1 &&\n                  (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {\n                  const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);\n                  // update old tree's hooks in case of dynamic transition\n                  setTransitionHooks(oldInnerChild, leavingHooks);\n                  // switching between different views\n                  if (mode === 'out-in') {\n                      state.isLeaving = true;\n                      // return placeholder node and queue update when leave finishes\n                      leavingHooks.afterLeave = () => {\n                          state.isLeaving = false;\n                          instance.update();\n                      };\n                      return emptyPlaceholder(child);\n                  }\n                  else if (mode === 'in-out' && innerChild.type !== Comment$1) {\n                      leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\n                          const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);\n                          leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\n                          // early removal callback\n                          el._leaveCb = () => {\n                              earlyRemove();\n                              el._leaveCb = undefined;\n                              delete enterHooks.delayedLeave;\n                          };\n                          enterHooks.delayedLeave = delayedLeave;\n                      };\n                  }\n              }\n              return child;\n          };\n      }\n  };\n  // export the public type for h/tsx inference\n  // also to avoid inline import() in generated d.ts files\n  const BaseTransition = BaseTransitionImpl;\n  function getLeavingNodesForType(state, vnode) {\n      const { leavingVNodes } = state;\n      let leavingVNodesCache = leavingVNodes.get(vnode.type);\n      if (!leavingVNodesCache) {\n          leavingVNodesCache = Object.create(null);\n          leavingVNodes.set(vnode.type, leavingVNodesCache);\n      }\n      return leavingVNodesCache;\n  }\n  // The transition hooks are attached to the vnode as vnode.transition\n  // and will be called at appropriate timing in the renderer.\n  function resolveTransitionHooks(vnode, props, state, instance) {\n      const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;\n      const key = String(vnode.key);\n      const leavingVNodesCache = getLeavingNodesForType(state, vnode);\n      const callHook = (hook, args) => {\n          hook &&\n              callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);\n      };\n      const hooks = {\n          mode,\n          persisted,\n          beforeEnter(el) {\n              let hook = onBeforeEnter;\n              if (!state.isMounted) {\n                  if (appear) {\n                      hook = onBeforeAppear || onBeforeEnter;\n                  }\n                  else {\n                      return;\n                  }\n              }\n              // for same element (v-show)\n              if (el._leaveCb) {\n                  el._leaveCb(true /* cancelled */);\n              }\n              // for toggled element with same key (v-if)\n              const leavingVNode = leavingVNodesCache[key];\n              if (leavingVNode &&\n                  isSameVNodeType(vnode, leavingVNode) &&\n                  leavingVNode.el._leaveCb) {\n                  // force early removal (not cancelled)\n                  leavingVNode.el._leaveCb();\n              }\n              callHook(hook, [el]);\n          },\n          enter(el) {\n              let hook = onEnter;\n              let afterHook = onAfterEnter;\n              let cancelHook = onEnterCancelled;\n              if (!state.isMounted) {\n                  if (appear) {\n                      hook = onAppear || onEnter;\n                      afterHook = onAfterAppear || onAfterEnter;\n                      cancelHook = onAppearCancelled || onEnterCancelled;\n                  }\n                  else {\n                      return;\n                  }\n              }\n              let called = false;\n              const done = (el._enterCb = (cancelled) => {\n                  if (called)\n                      return;\n                  called = true;\n                  if (cancelled) {\n                      callHook(cancelHook, [el]);\n                  }\n                  else {\n                      callHook(afterHook, [el]);\n                  }\n                  if (hooks.delayedLeave) {\n                      hooks.delayedLeave();\n                  }\n                  el._enterCb = undefined;\n              });\n              if (hook) {\n                  hook(el, done);\n                  if (hook.length <= 1) {\n                      done();\n                  }\n              }\n              else {\n                  done();\n              }\n          },\n          leave(el, remove) {\n              const key = String(vnode.key);\n              if (el._enterCb) {\n                  el._enterCb(true /* cancelled */);\n              }\n              if (state.isUnmounting) {\n                  return remove();\n              }\n              callHook(onBeforeLeave, [el]);\n              let called = false;\n              const done = (el._leaveCb = (cancelled) => {\n                  if (called)\n                      return;\n                  called = true;\n                  remove();\n                  if (cancelled) {\n                      callHook(onLeaveCancelled, [el]);\n                  }\n                  else {\n                      callHook(onAfterLeave, [el]);\n                  }\n                  el._leaveCb = undefined;\n                  if (leavingVNodesCache[key] === vnode) {\n                      delete leavingVNodesCache[key];\n                  }\n              });\n              leavingVNodesCache[key] = vnode;\n              if (onLeave) {\n                  onLeave(el, done);\n                  if (onLeave.length <= 1) {\n                      done();\n                  }\n              }\n              else {\n                  done();\n              }\n          },\n          clone(vnode) {\n              return resolveTransitionHooks(vnode, props, state, instance);\n          }\n      };\n      return hooks;\n  }\n  // the placeholder really only handles one special case: KeepAlive\n  // in the case of a KeepAlive in a leave phase we need to return a KeepAlive\n  // placeholder with empty content to avoid the KeepAlive instance from being\n  // unmounted.\n  function emptyPlaceholder(vnode) {\n      if (isKeepAlive(vnode)) {\n          vnode = cloneVNode(vnode);\n          vnode.children = null;\n          return vnode;\n      }\n  }\n  function getKeepAliveChild(vnode) {\n      return isKeepAlive(vnode)\n          ? vnode.children\n              ? vnode.children[0]\n              : undefined\n          : vnode;\n  }\n  function setTransitionHooks(vnode, hooks) {\n      if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {\n          setTransitionHooks(vnode.component.subTree, hooks);\n      }\n      else if (vnode.shapeFlag & 128 /* SUSPENSE */) {\n          vnode.ssContent.transition = hooks.clone(vnode.ssContent);\n          vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\n      }\n      else {\n          vnode.transition = hooks;\n      }\n  }\n  function getTransitionRawChildren(children, keepComment = false) {\n      let ret = [];\n      let keyedFragmentCount = 0;\n      for (let i = 0; i < children.length; i++) {\n          const child = children[i];\n          // handle fragment children case, e.g. v-for\n          if (child.type === Fragment) {\n              if (child.patchFlag & 128 /* KEYED_FRAGMENT */)\n                  keyedFragmentCount++;\n              ret = ret.concat(getTransitionRawChildren(child.children, keepComment));\n          }\n          // comment placeholders should be skipped, e.g. v-if\n          else if (keepComment || child.type !== Comment$1) {\n              ret.push(child);\n          }\n      }\n      // #1126 if a transition children list contains multiple sub fragments, these\n      // fragments will be merged into a flat children array. Since each v-for\n      // fragment may contain different static bindings inside, we need to de-op\n      // these children to force full diffs to ensure correct behavior.\n      if (keyedFragmentCount > 1) {\n          for (let i = 0; i < ret.length; i++) {\n              ret[i].patchFlag = -2 /* BAIL */;\n          }\n      }\n      return ret;\n  }\n\n  // implementation, close to no-op\n  function defineComponent(options) {\n      return isFunction(options) ? { setup: options, name: options.name } : options;\n  }\n\n  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;\n  function defineAsyncComponent(source) {\n      if (isFunction(source)) {\n          source = { loader: source };\n      }\n      const { loader, loadingComponent, errorComponent, delay = 200, timeout, // undefined = never times out\n      suspensible = true, onError: userOnError } = source;\n      let pendingRequest = null;\n      let resolvedComp;\n      let retries = 0;\n      const retry = () => {\n          retries++;\n          pendingRequest = null;\n          return load();\n      };\n      const load = () => {\n          let thisRequest;\n          return (pendingRequest ||\n              (thisRequest = pendingRequest =\n                  loader()\n                      .catch(err => {\n                      err = err instanceof Error ? err : new Error(String(err));\n                      if (userOnError) {\n                          return new Promise((resolve, reject) => {\n                              const userRetry = () => resolve(retry());\n                              const userFail = () => reject(err);\n                              userOnError(err, userRetry, userFail, retries + 1);\n                          });\n                      }\n                      else {\n                          throw err;\n                      }\n                  })\n                      .then((comp) => {\n                      if (thisRequest !== pendingRequest && pendingRequest) {\n                          return pendingRequest;\n                      }\n                      if (!comp) {\n                          warn$1(`Async component loader resolved to undefined. ` +\n                              `If you are using retry(), make sure to return its return value.`);\n                      }\n                      // interop module default\n                      if (comp &&\n                          (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {\n                          comp = comp.default;\n                      }\n                      if (comp && !isObject(comp) && !isFunction(comp)) {\n                          throw new Error(`Invalid async component load result: ${comp}`);\n                      }\n                      resolvedComp = comp;\n                      return comp;\n                  })));\n      };\n      return defineComponent({\n          name: 'AsyncComponentWrapper',\n          __asyncLoader: load,\n          get __asyncResolved() {\n              return resolvedComp;\n          },\n          setup() {\n              const instance = currentInstance;\n              // already resolved\n              if (resolvedComp) {\n                  return () => createInnerComp(resolvedComp, instance);\n              }\n              const onError = (err) => {\n                  pendingRequest = null;\n                  handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);\n              };\n              // suspense-controlled or SSR.\n              if ((suspensible && instance.suspense) ||\n                  (false )) {\n                  return load()\n                      .then(comp => {\n                      return () => createInnerComp(comp, instance);\n                  })\n                      .catch(err => {\n                      onError(err);\n                      return () => errorComponent\n                          ? createVNode(errorComponent, {\n                              error: err\n                          })\n                          : null;\n                  });\n              }\n              const loaded = ref(false);\n              const error = ref();\n              const delayed = ref(!!delay);\n              if (delay) {\n                  setTimeout(() => {\n                      delayed.value = false;\n                  }, delay);\n              }\n              if (timeout != null) {\n                  setTimeout(() => {\n                      if (!loaded.value && !error.value) {\n                          const err = new Error(`Async component timed out after ${timeout}ms.`);\n                          onError(err);\n                          error.value = err;\n                      }\n                  }, timeout);\n              }\n              load()\n                  .then(() => {\n                  loaded.value = true;\n                  if (instance.parent && isKeepAlive(instance.parent.vnode)) {\n                      // parent is keep-alive, force update so the loaded component's\n                      // name is taken into account\n                      queueJob(instance.parent.update);\n                  }\n              })\n                  .catch(err => {\n                  onError(err);\n                  error.value = err;\n              });\n              return () => {\n                  if (loaded.value && resolvedComp) {\n                      return createInnerComp(resolvedComp, instance);\n                  }\n                  else if (error.value && errorComponent) {\n                      return createVNode(errorComponent, {\n                          error: error.value\n                      });\n                  }\n                  else if (loadingComponent && !delayed.value) {\n                      return createVNode(loadingComponent);\n                  }\n              };\n          }\n      });\n  }\n  function createInnerComp(comp, { vnode: { ref, props, children } }) {\n      const vnode = createVNode(comp, props, children);\n      // ensure inner component inherits the async wrapper's ref owner\n      vnode.ref = ref;\n      return vnode;\n  }\n\n  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\n  const KeepAliveImpl = {\n      name: `KeepAlive`,\n      // Marker for special handling inside the renderer. We are not using a ===\n      // check directly on KeepAlive in the renderer, because importing it directly\n      // would prevent it from being tree-shaken.\n      __isKeepAlive: true,\n      props: {\n          include: [String, RegExp, Array],\n          exclude: [String, RegExp, Array],\n          max: [String, Number]\n      },\n      setup(props, { slots }) {\n          const instance = getCurrentInstance();\n          // KeepAlive communicates with the instantiated renderer via the\n          // ctx where the renderer passes in its internals,\n          // and the KeepAlive instance exposes activate/deactivate implementations.\n          // The whole point of this is to avoid importing KeepAlive directly in the\n          // renderer to facilitate tree-shaking.\n          const sharedContext = instance.ctx;\n          // if the internal renderer is not registered, it indicates that this is server-side rendering,\n          // for KeepAlive, we just need to render its children\n          if (!sharedContext.renderer) {\n              return slots.default;\n          }\n          const cache = new Map();\n          const keys = new Set();\n          let current = null;\n          {\n              instance.__v_cache = cache;\n          }\n          const parentSuspense = instance.suspense;\n          const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext;\n          const storageContainer = createElement('div');\n          sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {\n              const instance = vnode.component;\n              move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);\n              // in case props have changed\n              patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);\n              queuePostRenderEffect(() => {\n                  instance.isDeactivated = false;\n                  if (instance.a) {\n                      invokeArrayFns(instance.a);\n                  }\n                  const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\n                  if (vnodeHook) {\n                      invokeVNodeHook(vnodeHook, instance.parent, vnode);\n                  }\n              }, parentSuspense);\n              {\n                  // Update components tree\n                  devtoolsComponentAdded(instance);\n              }\n          };\n          sharedContext.deactivate = (vnode) => {\n              const instance = vnode.component;\n              move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);\n              queuePostRenderEffect(() => {\n                  if (instance.da) {\n                      invokeArrayFns(instance.da);\n                  }\n                  const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\n                  if (vnodeHook) {\n                      invokeVNodeHook(vnodeHook, instance.parent, vnode);\n                  }\n                  instance.isDeactivated = true;\n              }, parentSuspense);\n              {\n                  // Update components tree\n                  devtoolsComponentAdded(instance);\n              }\n          };\n          function unmount(vnode) {\n              // reset the shapeFlag so it can be properly unmounted\n              resetShapeFlag(vnode);\n              _unmount(vnode, instance, parentSuspense);\n          }\n          function pruneCache(filter) {\n              cache.forEach((vnode, key) => {\n                  const name = getComponentName(vnode.type);\n                  if (name && (!filter || !filter(name))) {\n                      pruneCacheEntry(key);\n                  }\n              });\n          }\n          function pruneCacheEntry(key) {\n              const cached = cache.get(key);\n              if (!current || cached.type !== current.type) {\n                  unmount(cached);\n              }\n              else if (current) {\n                  // current active instance should no longer be kept-alive.\n                  // we can't unmount it now but it might be later, so reset its flag now.\n                  resetShapeFlag(current);\n              }\n              cache.delete(key);\n              keys.delete(key);\n          }\n          // prune cache on include/exclude prop change\n          watch(() => [props.include, props.exclude], ([include, exclude]) => {\n              include && pruneCache(name => matches(include, name));\n              exclude && pruneCache(name => !matches(exclude, name));\n          }, \n          // prune post-render after `current` has been updated\n          { flush: 'post', deep: true });\n          // cache sub tree after render\n          let pendingCacheKey = null;\n          const cacheSubtree = () => {\n              // fix #1621, the pendingCacheKey could be 0\n              if (pendingCacheKey != null) {\n                  cache.set(pendingCacheKey, getInnerChild(instance.subTree));\n              }\n          };\n          onMounted(cacheSubtree);\n          onUpdated(cacheSubtree);\n          onBeforeUnmount(() => {\n              cache.forEach(cached => {\n                  const { subTree, suspense } = instance;\n                  const vnode = getInnerChild(subTree);\n                  if (cached.type === vnode.type) {\n                      // current instance will be unmounted as part of keep-alive's unmount\n                      resetShapeFlag(vnode);\n                      // but invoke its deactivated hook here\n                      const da = vnode.component.da;\n                      da && queuePostRenderEffect(da, suspense);\n                      return;\n                  }\n                  unmount(cached);\n              });\n          });\n          return () => {\n              pendingCacheKey = null;\n              if (!slots.default) {\n                  return null;\n              }\n              const children = slots.default();\n              const rawVNode = children[0];\n              if (children.length > 1) {\n                  {\n                      warn$1(`KeepAlive should contain exactly one component child.`);\n                  }\n                  current = null;\n                  return children;\n              }\n              else if (!isVNode(rawVNode) ||\n                  (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&\n                      !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {\n                  current = null;\n                  return rawVNode;\n              }\n              let vnode = getInnerChild(rawVNode);\n              const comp = vnode.type;\n              // for async components, name check should be based in its loaded\n              // inner component if available\n              const name = getComponentName(isAsyncWrapper(vnode)\n                  ? vnode.type.__asyncResolved || {}\n                  : comp);\n              const { include, exclude, max } = props;\n              if ((include && (!name || !matches(include, name))) ||\n                  (exclude && name && matches(exclude, name))) {\n                  current = vnode;\n                  return rawVNode;\n              }\n              const key = vnode.key == null ? comp : vnode.key;\n              const cachedVNode = cache.get(key);\n              // clone vnode if it's reused because we are going to mutate it\n              if (vnode.el) {\n                  vnode = cloneVNode(vnode);\n                  if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {\n                      rawVNode.ssContent = vnode;\n                  }\n              }\n              // #1513 it's possible for the returned vnode to be cloned due to attr\n              // fallthrough or scopeId, so the vnode here may not be the final vnode\n              // that is mounted. Instead of caching it directly, we store the pending\n              // key and cache `instance.subTree` (the normalized vnode) in\n              // beforeMount/beforeUpdate hooks.\n              pendingCacheKey = key;\n              if (cachedVNode) {\n                  // copy over mounted state\n                  vnode.el = cachedVNode.el;\n                  vnode.component = cachedVNode.component;\n                  if (vnode.transition) {\n                      // recursively update transition hooks on subTree\n                      setTransitionHooks(vnode, vnode.transition);\n                  }\n                  // avoid vnode being mounted as fresh\n                  vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;\n                  // make this key the freshest\n                  keys.delete(key);\n                  keys.add(key);\n              }\n              else {\n                  keys.add(key);\n                  // prune oldest entry\n                  if (max && keys.size > parseInt(max, 10)) {\n                      pruneCacheEntry(keys.values().next().value);\n                  }\n              }\n              // avoid vnode being unmounted\n              vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\n              current = vnode;\n              return rawVNode;\n          };\n      }\n  };\n  // export the public type for h/tsx inference\n  // also to avoid inline import() in generated d.ts files\n  const KeepAlive = KeepAliveImpl;\n  function matches(pattern, name) {\n      if (isArray(pattern)) {\n          return pattern.some((p) => matches(p, name));\n      }\n      else if (isString(pattern)) {\n          return pattern.split(',').indexOf(name) > -1;\n      }\n      else if (pattern.test) {\n          return pattern.test(name);\n      }\n      /* istanbul ignore next */\n      return false;\n  }\n  function onActivated(hook, target) {\n      registerKeepAliveHook(hook, \"a\" /* ACTIVATED */, target);\n  }\n  function onDeactivated(hook, target) {\n      registerKeepAliveHook(hook, \"da\" /* DEACTIVATED */, target);\n  }\n  function 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  }\n  function 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  }\n  function resetShapeFlag(vnode) {\n      let shapeFlag = vnode.shapeFlag;\n      if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\n          shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\n      }\n      if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\n          shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;\n      }\n      vnode.shapeFlag = shapeFlag;\n  }\n  function getInnerChild(vnode) {\n      return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;\n  }\n\n  function 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                  unsetCurrentInstance();\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      else {\n          const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));\n          warn$1(`${apiName} is called when there is no active component instance to be ` +\n              `associated with. ` +\n              `Lifecycle injection APIs can only be used during execution of setup().` +\n              (` If you are using async setup(), make sure to register lifecycle ` +\n                      `hooks before the first await statement.`\n                  ));\n      }\n  }\n  const createHook = (lifecycle) => (hook, target = currentInstance) => \n  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)\n  (!isInSSRComponentSetup || lifecycle === \"sp\" /* SERVER_PREFETCH */) &&\n      injectHook(lifecycle, hook, target);\n  const onBeforeMount = createHook(\"bm\" /* BEFORE_MOUNT */);\n  const onMounted = createHook(\"m\" /* MOUNTED */);\n  const onBeforeUpdate = createHook(\"bu\" /* BEFORE_UPDATE */);\n  const onUpdated = createHook(\"u\" /* UPDATED */);\n  const onBeforeUnmount = createHook(\"bum\" /* BEFORE_UNMOUNT */);\n  const onUnmounted = createHook(\"um\" /* UNMOUNTED */);\n  const onServerPrefetch = createHook(\"sp\" /* SERVER_PREFETCH */);\n  const onRenderTriggered = createHook(\"rtg\" /* RENDER_TRIGGERED */);\n  const onRenderTracked = createHook(\"rtc\" /* RENDER_TRACKED */);\n  function onErrorCaptured(hook, target = currentInstance) {\n      injectHook(\"ec\" /* ERROR_CAPTURED */, hook, target);\n  }\n\n  function createDuplicateChecker() {\n      const cache = Object.create(null);\n      return (type, key) => {\n          if (cache[key]) {\n              warn$1(`${type} property \"${key}\" is already defined in ${cache[key]}.`);\n          }\n          else {\n              cache[key] = type;\n          }\n      };\n  }\n  let shouldCacheAccess = true;\n  function applyOptions(instance) {\n      const options = resolveMergedOptions(instance);\n      const publicThis = instance.proxy;\n      const ctx = instance.ctx;\n      // do not cache property access on public proxy during state initialization\n      shouldCacheAccess = false;\n      // call beforeCreate first before accessing other options since\n      // the hook may mutate resolved options (#2791)\n      if (options.beforeCreate) {\n          callHook(options.beforeCreate, instance, \"bc\" /* BEFORE_CREATE */);\n      }\n      const { \n      // state\n      data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, \n      // lifecycle\n      created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured, serverPrefetch, \n      // public API\n      expose, inheritAttrs, \n      // assets\n      components, directives, filters } = options;\n      const checkDuplicateProperties = createDuplicateChecker() ;\n      {\n          const [propsOptions] = instance.propsOptions;\n          if (propsOptions) {\n              for (const key in propsOptions) {\n                  checkDuplicateProperties(\"Props\" /* PROPS */, key);\n              }\n          }\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          resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);\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\n                  // methods to the proxy target, and those are read-only but\n                  // reconfigurable, so it needs to be redefined here\n                  {\n                      Object.defineProperty(ctx, key, {\n                          value: methodHandler.bind(publicThis),\n                          configurable: true,\n                          enumerable: true,\n                          writable: true\n                      });\n                  }\n                  {\n                      checkDuplicateProperties(\"Methods\" /* METHODS */, key);\n                  }\n              }\n              else {\n                  warn$1(`Method \"${key}\" has type \"${typeof methodHandler}\" in the component definition. ` +\n                      `Did you reference the function correctly?`);\n              }\n          }\n      }\n      if (dataOptions) {\n          if (!isFunction(dataOptions)) {\n              warn$1(`The data option must be a function. ` +\n                  `Plain object usage is no longer supported.`);\n          }\n          const data = dataOptions.call(publicThis, publicThis);\n          if (isPromise(data)) {\n              warn$1(`data() returned a Promise - note data() cannot be async; If you ` +\n                  `intend to perform data fetching before component renders, use ` +\n                  `async setup() + <Suspense>.`);\n          }\n          if (!isObject(data)) {\n              warn$1(`data() should return an object.`);\n          }\n          else {\n              instance.data = reactive(data);\n              {\n                  for (const key in data) {\n                      checkDuplicateProperties(\"Data\" /* DATA */, key);\n                      // expose data on ctx during dev\n                      if (key[0] !== '$' && key[0] !== '_') {\n                          Object.defineProperty(ctx, key, {\n                              configurable: true,\n                              enumerable: true,\n                              get: () => data[key],\n                              set: NOOP\n                          });\n                      }\n                  }\n              }\n          }\n      }\n      // state initialization complete at this point - start caching access\n      shouldCacheAccess = true;\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              if (get === NOOP) {\n                  warn$1(`Computed property \"${key}\" has no getter.`);\n              }\n              const set = !isFunction(opt) && isFunction(opt.set)\n                  ? opt.set.bind(publicThis)\n                  : () => {\n                          warn$1(`Write operation failed: computed property \"${key}\" is readonly.`);\n                      }\n                      ;\n              const c = computed({\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                  checkDuplicateProperties(\"Computed\" /* COMPUTED */, key);\n              }\n          }\n      }\n      if (watchOptions) {\n          for (const key in watchOptions) {\n              createWatcher(watchOptions[key], ctx, publicThis, key);\n          }\n      }\n      if (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      if (created) {\n          callHook(created, instance, \"c\" /* CREATED */);\n      }\n      function registerLifecycleHook(register, hook) {\n          if (isArray(hook)) {\n              hook.forEach(_hook => register(_hook.bind(publicThis)));\n          }\n          else if (hook) {\n              register(hook.bind(publicThis));\n          }\n      }\n      registerLifecycleHook(onBeforeMount, beforeMount);\n      registerLifecycleHook(onMounted, mounted);\n      registerLifecycleHook(onBeforeUpdate, beforeUpdate);\n      registerLifecycleHook(onUpdated, updated);\n      registerLifecycleHook(onActivated, activated);\n      registerLifecycleHook(onDeactivated, deactivated);\n      registerLifecycleHook(onErrorCaptured, errorCaptured);\n      registerLifecycleHook(onRenderTracked, renderTracked);\n      registerLifecycleHook(onRenderTriggered, renderTriggered);\n      registerLifecycleHook(onBeforeUnmount, beforeUnmount);\n      registerLifecycleHook(onUnmounted, unmounted);\n      registerLifecycleHook(onServerPrefetch, serverPrefetch);\n      if (isArray(expose)) {\n          if (expose.length) {\n              const exposed = instance.exposed || (instance.exposed = {});\n              expose.forEach(key => {\n                  Object.defineProperty(exposed, key, {\n                      get: () => publicThis[key],\n                      set: val => (publicThis[key] = val)\n                  });\n              });\n          }\n          else if (!instance.exposed) {\n              instance.exposed = {};\n          }\n      }\n      // options that are handled when creating the instance but also need to be\n      // applied from mixins\n      if (render && instance.render === NOOP) {\n          instance.render = render;\n      }\n      if (inheritAttrs != null) {\n          instance.inheritAttrs = inheritAttrs;\n      }\n      // asset options.\n      if (components)\n          instance.components = components;\n      if (directives)\n          instance.directives = directives;\n  }\n  function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {\n      if (isArray(injectOptions)) {\n          injectOptions = normalizeInject(injectOptions);\n      }\n      for (const key in injectOptions) {\n          const opt = injectOptions[key];\n          let injected;\n          if (isObject(opt)) {\n              if ('default' in opt) {\n                  injected = inject(opt.from || key, opt.default, true /* treat default function as factory */);\n              }\n              else {\n                  injected = inject(opt.from || key);\n              }\n          }\n          else {\n              injected = inject(opt);\n          }\n          if (isRef(injected)) {\n              // TODO remove the check in 3.3\n              if (unwrapRef) {\n                  Object.defineProperty(ctx, key, {\n                      enumerable: true,\n                      configurable: true,\n                      get: () => injected.value,\n                      set: v => (injected.value = v)\n                  });\n              }\n              else {\n                  {\n                      warn$1(`injected property \"${key}\" is a ref and will be auto-unwrapped ` +\n                          `and no longer needs \\`.value\\` in the next minor release. ` +\n                          `To opt-in to the new behavior now, ` +\n                          `set \\`app.config.unwrapInjectedRef = true\\` (this config is ` +\n                          `temporary and will not be needed in the future.)`);\n                  }\n                  ctx[key] = injected;\n              }\n          }\n          else {\n              ctx[key] = injected;\n          }\n          {\n              checkDuplicateProperties(\"Inject\" /* INJECT */, key);\n          }\n      }\n  }\n  function callHook(hook, instance, type) {\n      callWithAsyncErrorHandling(isArray(hook)\n          ? hook.map(h => h.bind(instance.proxy))\n          : hook.bind(instance.proxy), instance, type);\n  }\n  function 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          else {\n              warn$1(`Invalid watch handler specified by key \"${raw}\"`, 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              else {\n                  warn$1(`Invalid watch handler specified by key \"${raw.handler}\"`, handler);\n              }\n          }\n      }\n      else {\n          warn$1(`Invalid watch option: \"${key}\"`, raw);\n      }\n  }\n  /**\n   * Resolve merged options and cache it on the component.\n   * This is done only once per-component since the merging does not involve\n   * instances.\n   */\n  function resolveMergedOptions(instance) {\n      const base = instance.type;\n      const { mixins, extends: extendsOptions } = base;\n      const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;\n      const cached = cache.get(base);\n      let resolved;\n      if (cached) {\n          resolved = cached;\n      }\n      else if (!globalMixins.length && !mixins && !extendsOptions) {\n          {\n              resolved = base;\n          }\n      }\n      else {\n          resolved = {};\n          if (globalMixins.length) {\n              globalMixins.forEach(m => mergeOptions(resolved, m, optionMergeStrategies, true));\n          }\n          mergeOptions(resolved, base, optionMergeStrategies);\n      }\n      cache.set(base, resolved);\n      return resolved;\n  }\n  function mergeOptions(to, from, strats, asMixin = false) {\n      const { mixins, extends: extendsOptions } = from;\n      if (extendsOptions) {\n          mergeOptions(to, extendsOptions, strats, true);\n      }\n      if (mixins) {\n          mixins.forEach((m) => mergeOptions(to, m, strats, true));\n      }\n      for (const key in from) {\n          if (asMixin && key === 'expose') {\n              warn$1(`\"expose\" option is ignored when declared in mixins or extends. ` +\n                      `It should only be declared in the base component itself.`);\n          }\n          else {\n              const strat = internalOptionMergeStrats[key] || (strats && strats[key]);\n              to[key] = strat ? strat(to[key], from[key]) : from[key];\n          }\n      }\n      return to;\n  }\n  const internalOptionMergeStrats = {\n      data: mergeDataFn,\n      props: mergeObjectOptions,\n      emits: mergeObjectOptions,\n      // objects\n      methods: mergeObjectOptions,\n      computed: mergeObjectOptions,\n      // lifecycle\n      beforeCreate: mergeAsArray,\n      created: mergeAsArray,\n      beforeMount: mergeAsArray,\n      mounted: mergeAsArray,\n      beforeUpdate: mergeAsArray,\n      updated: mergeAsArray,\n      beforeDestroy: mergeAsArray,\n      destroyed: mergeAsArray,\n      activated: mergeAsArray,\n      deactivated: mergeAsArray,\n      errorCaptured: mergeAsArray,\n      serverPrefetch: mergeAsArray,\n      // assets\n      components: mergeObjectOptions,\n      directives: mergeObjectOptions,\n      // watch\n      watch: mergeWatchOptions,\n      // provide / inject\n      provide: mergeDataFn,\n      inject: mergeInject\n  };\n  function mergeDataFn(to, from) {\n      if (!from) {\n          return to;\n      }\n      if (!to) {\n          return from;\n      }\n      return function mergedDataFn() {\n          return (extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);\n      };\n  }\n  function mergeInject(to, from) {\n      return mergeObjectOptions(normalizeInject(to), normalizeInject(from));\n  }\n  function normalizeInject(raw) {\n      if (isArray(raw)) {\n          const res = {};\n          for (let i = 0; i < raw.length; i++) {\n              res[raw[i]] = raw[i];\n          }\n          return res;\n      }\n      return raw;\n  }\n  function mergeAsArray(to, from) {\n      return to ? [...new Set([].concat(to, from))] : from;\n  }\n  function mergeObjectOptions(to, from) {\n      return to ? extend(extend(Object.create(null), to), from) : from;\n  }\n  function mergeWatchOptions(to, from) {\n      if (!to)\n          return from;\n      if (!from)\n          return to;\n      const merged = extend(Object.create(null), to);\n      for (const key in from) {\n          merged[key] = mergeAsArray(to[key], from[key]);\n      }\n      return merged;\n  }\n\n  function initProps(instance, rawProps, isStateful, // result of bitwise flag comparison\n  isSSR = 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      // ensure all declared prop keys are present\n      for (const key in instance.propsOptions[0]) {\n          if (!(key in props)) {\n              props[key] = undefined;\n          }\n      }\n      // validation\n      {\n          validateProps(rawProps || {}, props, instance);\n      }\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  }\n  function updateProps(instance, rawProps, rawPrevProps, optimized) {\n      const { props, attrs, vnode: { patchFlag } } = instance;\n      const rawCurrentProps = toRaw(props);\n      const [options] = instance.propsOptions;\n      let hasAttrsChanged = false;\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      !((instance.type.__hmrId ||\n              (instance.parent && instance.parent.type.__hmrId))) &&\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                  let 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                          if (value !== attrs[key]) {\n                              attrs[key] = value;\n                              hasAttrsChanged = true;\n                          }\n                      }\n                      else {\n                          const camelizedKey = camelize(key);\n                          props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false /* isAbsent */);\n                      }\n                  }\n                  else {\n                      if (value !== attrs[key]) {\n                          attrs[key] = value;\n                          hasAttrsChanged = true;\n                      }\n                  }\n              }\n          }\n      }\n      else {\n          // full props update.\n          if (setFullProps(instance, rawProps, props, attrs)) {\n              hasAttrsChanged = true;\n          }\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, rawCurrentProps, key, undefined, instance, true /* isAbsent */);\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                      hasAttrsChanged = true;\n                  }\n              }\n          }\n      }\n      // trigger updates for $attrs in case it's used in component slots\n      if (hasAttrsChanged) {\n          trigger(instance, \"set\" /* SET */, '$attrs');\n      }\n      {\n          validateProps(rawProps || {}, props, instance);\n      }\n  }\n  function setFullProps(instance, rawProps, props, attrs) {\n      const [options, needCastKeys] = instance.propsOptions;\n      let hasAttrsChanged = false;\n      let rawCastValues;\n      if (rawProps) {\n          for (let key in rawProps) {\n              // key, ref are reserved and never passed down\n              if (isReservedProp(key)) {\n                  continue;\n              }\n              const value = rawProps[key];\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                  if (!needCastKeys || !needCastKeys.includes(camelKey)) {\n                      props[camelKey] = value;\n                  }\n                  else {\n                      (rawCastValues || (rawCastValues = {}))[camelKey] = value;\n                  }\n              }\n              else if (!isEmitListener(instance.emitsOptions, key)) {\n                  if (value !== attrs[key]) {\n                      attrs[key] = value;\n                      hasAttrsChanged = true;\n                  }\n              }\n          }\n      }\n      if (needCastKeys) {\n          const rawCurrentProps = toRaw(props);\n          const castValues = rawCastValues || EMPTY_OBJ;\n          for (let i = 0; i < needCastKeys.length; i++) {\n              const key = needCastKeys[i];\n              props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));\n          }\n      }\n      return hasAttrsChanged;\n  }\n  function resolvePropValue(options, props, key, value, instance, isAbsent) {\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.call(null, props);\n                      unsetCurrentInstance();\n                  }\n              }\n              else {\n                  value = defaultValue;\n              }\n          }\n          // boolean casting\n          if (opt[0 /* shouldCast */]) {\n              if (isAbsent && !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  }\n  function normalizePropsOptions(comp, appContext, asMixin = false) {\n      const cache = appContext.propsCache;\n      const cached = cache.get(comp);\n      if (cached) {\n          return cached;\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          cache.set(comp, EMPTY_ARR);\n          return EMPTY_ARR;\n      }\n      if (isArray(raw)) {\n          for (let i = 0; i < raw.length; i++) {\n              if (!isString(raw[i])) {\n                  warn$1(`props must be strings when using array syntax.`, raw[i]);\n              }\n              const normalizedKey = camelize(raw[i]);\n              if (validatePropName(normalizedKey)) {\n                  normalized[normalizedKey] = EMPTY_OBJ;\n              }\n          }\n      }\n      else if (raw) {\n          if (!isObject(raw)) {\n              warn$1(`invalid props options`, raw);\n          }\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      const res = [normalized, needCastKeys];\n      cache.set(comp, res);\n      return res;\n  }\n  function validatePropName(key) {\n      if (key[0] !== '$') {\n          return true;\n      }\n      else {\n          warn$1(`Invalid prop name: \"${key}\" is a reserved property.`);\n      }\n      return false;\n  }\n  // use function string name to check type constructors\n  // so that it works across vms / iframes.\n  function getType(ctor) {\n      const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n      return match ? match[1] : ctor === null ? 'null' : '';\n  }\n  function isSameType(a, b) {\n      return getType(a) === getType(b);\n  }\n  function 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  }\n  /**\n   * dev only\n   */\n  function validateProps(rawProps, props, instance) {\n      const resolvedValues = toRaw(props);\n      const options = instance.propsOptions[0];\n      for (const key in options) {\n          let opt = options[key];\n          if (opt == null)\n              continue;\n          validateProp(key, resolvedValues[key], opt, !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)));\n      }\n  }\n  /**\n   * dev only\n   */\n  function validateProp(name, value, prop, isAbsent) {\n      const { type, required, validator } = prop;\n      // required!\n      if (required && isAbsent) {\n          warn$1('Missing required prop: \"' + name + '\"');\n          return;\n      }\n      // missing but optional\n      if (value == null && !prop.required) {\n          return;\n      }\n      // type check\n      if (type != null && type !== true) {\n          let isValid = false;\n          const types = isArray(type) ? type : [type];\n          const expectedTypes = [];\n          // value is valid as long as one of the specified types match\n          for (let i = 0; i < types.length && !isValid; i++) {\n              const { valid, expectedType } = assertType(value, types[i]);\n              expectedTypes.push(expectedType || '');\n              isValid = valid;\n          }\n          if (!isValid) {\n              warn$1(getInvalidTypeMessage(name, value, expectedTypes));\n              return;\n          }\n      }\n      // custom validator\n      if (validator && !validator(value)) {\n          warn$1('Invalid prop: custom validator check failed for prop \"' + name + '\".');\n      }\n  }\n  const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');\n  /**\n   * dev only\n   */\n  function assertType(value, type) {\n      let valid;\n      const expectedType = getType(type);\n      if (isSimpleType(expectedType)) {\n          const t = typeof value;\n          valid = t === expectedType.toLowerCase();\n          // for primitive wrapper objects\n          if (!valid && t === 'object') {\n              valid = value instanceof type;\n          }\n      }\n      else if (expectedType === 'Object') {\n          valid = isObject(value);\n      }\n      else if (expectedType === 'Array') {\n          valid = isArray(value);\n      }\n      else if (expectedType === 'null') {\n          valid = value === null;\n      }\n      else {\n          valid = value instanceof type;\n      }\n      return {\n          valid,\n          expectedType\n      };\n  }\n  /**\n   * dev only\n   */\n  function getInvalidTypeMessage(name, value, expectedTypes) {\n      let message = `Invalid prop: type check failed for prop \"${name}\".` +\n          ` Expected ${expectedTypes.map(capitalize).join(' | ')}`;\n      const expectedType = expectedTypes[0];\n      const receivedType = toRawType(value);\n      const expectedValue = styleValue(value, expectedType);\n      const receivedValue = styleValue(value, receivedType);\n      // check if we need to specify expected value\n      if (expectedTypes.length === 1 &&\n          isExplicable(expectedType) &&\n          !isBoolean(expectedType, receivedType)) {\n          message += ` with value ${expectedValue}`;\n      }\n      message += `, got ${receivedType} `;\n      // check if we need to specify received value\n      if (isExplicable(receivedType)) {\n          message += `with value ${receivedValue}.`;\n      }\n      return message;\n  }\n  /**\n   * dev only\n   */\n  function styleValue(value, type) {\n      if (type === 'String') {\n          return `\"${value}\"`;\n      }\n      else if (type === 'Number') {\n          return `${Number(value)}`;\n      }\n      else {\n          return `${value}`;\n      }\n  }\n  /**\n   * dev only\n   */\n  function isExplicable(type) {\n      const explicitTypes = ['string', 'number', 'boolean'];\n      return explicitTypes.some(elem => type.toLowerCase() === elem);\n  }\n  /**\n   * dev only\n   */\n  function isBoolean(...args) {\n      return args.some(elem => elem.toLowerCase() === 'boolean');\n  }\n\n  const isInternalKey = (key) => key[0] === '_' || key === '$stable';\n  const normalizeSlotValue = (value) => isArray(value)\n      ? value.map(normalizeVNode)\n      : [normalizeVNode(value)];\n  const normalizeSlot = (key, rawSlot, ctx) => {\n      const normalized = withCtx((props) => {\n          if (currentInstance) {\n              warn$1(`Slot \"${key}\" invoked outside of the render function: ` +\n                  `this will not track dependencies used in the slot. ` +\n                  `Invoke the slot function inside the render function instead.`);\n          }\n          return normalizeSlotValue(rawSlot(props));\n      }, ctx);\n      normalized._c = false;\n      return normalized;\n  };\n  const normalizeObjectSlots = (rawSlots, slots, instance) => {\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              {\n                  warn$1(`Non-function value encountered for slot \"${key}\". ` +\n                      `Prefer function slots for better performance.`);\n              }\n              const normalized = normalizeSlotValue(value);\n              slots[key] = () => normalized;\n          }\n      }\n  };\n  const normalizeVNodeSlots = (instance, children) => {\n      if (!isKeepAlive(instance.vnode) &&\n          !(false )) {\n          warn$1(`Non-function value encountered for default slot. ` +\n              `Prefer function slots for better performance.`);\n      }\n      const normalized = normalizeSlotValue(children);\n      instance.slots.default = () => normalized;\n  };\n  const initSlots = (instance, children) => {\n      if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\n          const type = children._;\n          if (type) {\n              // users can get the shallow readonly version of the slots object through `this.$slots`,\n              // we should avoid the proxy object polluting the slots of the internal instance\n              instance.slots = toRaw(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  };\n  const 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 (isHmrUpdating) {\n                  // Parent was HMR updated so slot content may have changed.\n                  // force update slots and mark instance for hmr as well\n                  extend(slots, children);\n              }\n              else 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  };\n\n  /**\n  Runtime helper for applying directives to a vnode. Example usage:\n\n  const comp = resolveComponent('comp')\n  const foo = resolveDirective('foo')\n  const bar = resolveDirective('bar')\n\n  return withDirectives(h(comp), [\n    [foo, this.x],\n    [bar, this.y]\n  ])\n  */\n  const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');\n  function validateDirectiveName(name) {\n      if (isBuiltInDirective(name)) {\n          warn$1('Do not use built-in directive ids as custom directive id: ' + name);\n      }\n  }\n  /**\n   * Adds directives to a VNode.\n   */\n  function withDirectives(vnode, directives) {\n      const internalInstance = currentRenderingInstance;\n      if (internalInstance === null) {\n          warn$1(`withDirectives can only be used inside render functions.`);\n          return vnode;\n      }\n      const instance = internalInstance.proxy;\n      const bindings = vnode.dirs || (vnode.dirs = []);\n      for (let i = 0; i < directives.length; i++) {\n          let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\n          if (isFunction(dir)) {\n              dir = {\n                  mounted: dir,\n                  updated: dir\n              };\n          }\n          if (dir.deep) {\n              traverse(value);\n          }\n          bindings.push({\n              dir,\n              instance,\n              value,\n              oldValue: void 0,\n              arg,\n              modifiers\n          });\n      }\n      return vnode;\n  }\n  function 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          let hook = binding.dir[name];\n          if (hook) {\n              // disable tracking inside all lifecycle hooks\n              // since they can potentially be called inside effects.\n              pauseTracking();\n              callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [\n                  vnode.el,\n                  binding,\n                  vnode,\n                  prevVNode\n              ]);\n              resetTracking();\n          }\n      }\n  }\n\n  function createAppContext() {\n      return {\n          app: null,\n          config: {\n              isNativeTag: NO,\n              performance: false,\n              globalProperties: {},\n              optionMergeStrategies: {},\n              errorHandler: undefined,\n              warnHandler: undefined,\n              compilerOptions: {}\n          },\n          mixins: [],\n          components: {},\n          directives: {},\n          provides: Object.create(null),\n          optionsCache: new WeakMap(),\n          propsCache: new WeakMap(),\n          emitsCache: new WeakMap()\n      };\n  }\n  let uid = 0;\n  function createAppAPI(render, hydrate) {\n      return function createApp(rootComponent, rootProps = null) {\n          if (rootProps != null && !isObject(rootProps)) {\n              warn$1(`root props passed to app.mount() must be an object.`);\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++,\n              _component: rootComponent,\n              _props: rootProps,\n              _container: null,\n              _context: context,\n              _instance: null,\n              version,\n              get config() {\n                  return context.config;\n              },\n              set config(v) {\n                  {\n                      warn$1(`app.config cannot be replaced. Modify individual options instead.`);\n                  }\n              },\n              use(plugin, ...options) {\n                  if (installedPlugins.has(plugin)) {\n                      warn$1(`Plugin has already been applied to target app.`);\n                  }\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                      warn$1(`A plugin must either be a function or an object with an \"install\" ` +\n                          `function.`);\n                  }\n                  return app;\n              },\n              mixin(mixin) {\n                  {\n                      if (!context.mixins.includes(mixin)) {\n                          context.mixins.push(mixin);\n                      }\n                      else {\n                          warn$1('Mixin has already been applied to target app' +\n                              (mixin.name ? `: ${mixin.name}` : ''));\n                      }\n                  }\n                  return app;\n              },\n              component(name, component) {\n                  {\n                      validateComponentName(name, context.config);\n                  }\n                  if (!component) {\n                      return context.components[name];\n                  }\n                  if (context.components[name]) {\n                      warn$1(`Component \"${name}\" has already been registered in target app.`);\n                  }\n                  context.components[name] = component;\n                  return app;\n              },\n              directive(name, directive) {\n                  {\n                      validateDirectiveName(name);\n                  }\n                  if (!directive) {\n                      return context.directives[name];\n                  }\n                  if (context.directives[name]) {\n                      warn$1(`Directive \"${name}\" has already been registered in target app.`);\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                      // HMR root reload\n                      {\n                          context.reload = () => {\n                              render(cloneVNode(vnode), rootContainer, isSVG);\n                          };\n                      }\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                      {\n                          app._instance = vnode.component;\n                          devtoolsInitApp(app, version);\n                      }\n                      return vnode.component.proxy;\n                  }\n                  else {\n                      warn$1(`App has already been mounted.\\n` +\n                          `If you want to remount the same app, move your app creation logic ` +\n                          `into a factory function and create fresh app instances for each ` +\n                          `mount - e.g. \\`const createMyApp = () => createApp(App)\\``);\n                  }\n              },\n              unmount() {\n                  if (isMounted) {\n                      render(null, app._container);\n                      {\n                          app._instance = null;\n                          devtoolsUnmountApp(app);\n                      }\n                      delete app._container.__vue_app__;\n                  }\n                  else {\n                      warn$1(`Cannot unmount an app that is not mounted.`);\n                  }\n              },\n              provide(key, value) {\n                  if (key in context.provides) {\n                      warn$1(`App already provides property with key \"${String(key)}\". ` +\n                          `It will be overwritten with the new value.`);\n                  }\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\n  let hasMismatch = false;\n  const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';\n  const isComment = (node) => node.nodeType === 8 /* COMMENT */;\n  // Note: hydration is DOM-specific\n  // But we have to place it in core due to tight coupling with core - splitting\n  // it out creates a ton of unnecessary complexity.\n  // Hydration also depends on some renderer internal logic which needs to be\n  // passed in via arguments.\n  function createHydrationFunctions(rendererInternals) {\n      const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;\n      const hydrate = (vnode, container) => {\n          if (!container.hasChildNodes()) {\n              warn$1(`Attempting to hydrate existing markup but container is empty. ` +\n                      `Performing full mount instead.`);\n              patch(null, vnode, container);\n              flushPostFlushCbs();\n              return;\n          }\n          hasMismatch = false;\n          hydrateNode(container.firstChild, vnode, null, null, null);\n          flushPostFlushCbs();\n          if (hasMismatch && !false) {\n              // this error should show up in production\n              console.error(`Hydration completed but contains mismatches.`);\n          }\n      };\n      const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {\n          const isFragmentStart = isComment(node) && node.data === '[';\n          const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);\n          const { type, ref, shapeFlag } = vnode;\n          const domType = node.nodeType;\n          vnode.el = node;\n          let nextNode = null;\n          switch (type) {\n              case Text:\n                  if (domType !== 3 /* TEXT */) {\n                      nextNode = onMismatch();\n                  }\n                  else {\n                      if (node.data !== vnode.children) {\n                          hasMismatch = true;\n                          warn$1(`Hydration text mismatch:` +\n                                  `\\n- Client: ${JSON.stringify(node.data)}` +\n                                  `\\n- Server: ${JSON.stringify(vnode.children)}`);\n                          node.data = vnode.children;\n                      }\n                      nextNode = nextSibling(node);\n                  }\n                  break;\n              case Comment$1:\n                  if (domType !== 8 /* COMMENT */ || isFragmentStart) {\n                      nextNode = onMismatch();\n                  }\n                  else {\n                      nextNode = nextSibling(node);\n                  }\n                  break;\n              case Static:\n                  if (domType !== 1 /* ELEMENT */) {\n                      nextNode = onMismatch();\n                  }\n                  else {\n                      // determine anchor, adopt content\n                      nextNode = node;\n                      // if the static vnode has its content stripped during build,\n                      // adopt it from the server-rendered HTML.\n                      const needToAdoptContent = !vnode.children.length;\n                      for (let i = 0; i < vnode.staticCount; i++) {\n                          if (needToAdoptContent)\n                              vnode.children += nextNode.outerHTML;\n                          if (i === vnode.staticCount - 1) {\n                              vnode.anchor = nextNode;\n                          }\n                          nextNode = nextSibling(nextNode);\n                      }\n                      return nextNode;\n                  }\n                  break;\n              case Fragment:\n                  if (!isFragmentStart) {\n                      nextNode = onMismatch();\n                  }\n                  else {\n                      nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\n                  }\n                  break;\n              default:\n                  if (shapeFlag & 1 /* ELEMENT */) {\n                      if (domType !== 1 /* ELEMENT */ ||\n                          vnode.type.toLowerCase() !==\n                              node.tagName.toLowerCase()) {\n                          nextNode = onMismatch();\n                      }\n                      else {\n                          nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\n                      }\n                  }\n                  else if (shapeFlag & 6 /* COMPONENT */) {\n                      // when setting up the render effect, if the initial vnode already\n                      // has .el set, the component will perform hydration instead of mount\n                      // on its sub-tree.\n                      vnode.slotScopeIds = slotScopeIds;\n                      const container = parentNode(node);\n                      mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized);\n                      // component may be async, so in the case of fragments we cannot rely\n                      // on component's rendered output to determine the end of the fragment\n                      // instead, we do a lookahead to find the end anchor node.\n                      nextNode = isFragmentStart\n                          ? locateClosingAsyncAnchor(node)\n                          : nextSibling(node);\n                      // #3787\n                      // if component is async, it may get moved / unmounted before its\n                      // inner component is loaded, so we need to give it a placeholder\n                      // vnode that matches its adopted DOM.\n                      if (isAsyncWrapper(vnode)) {\n                          let subTree;\n                          if (isFragmentStart) {\n                              subTree = createVNode(Fragment);\n                              subTree.anchor = nextNode\n                                  ? nextNode.previousSibling\n                                  : container.lastChild;\n                          }\n                          else {\n                              subTree =\n                                  node.nodeType === 3 ? createTextVNode('') : createVNode('div');\n                          }\n                          subTree.el = node;\n                          vnode.component.subTree = subTree;\n                      }\n                  }\n                  else if (shapeFlag & 64 /* TELEPORT */) {\n                      if (domType !== 8 /* COMMENT */) {\n                          nextNode = onMismatch();\n                      }\n                      else {\n                          nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);\n                      }\n                  }\n                  else if (shapeFlag & 128 /* SUSPENSE */) {\n                      nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);\n                  }\n                  else {\n                      warn$1('Invalid HostVNode type:', type, `(${typeof type})`);\n                  }\n          }\n          if (ref != null) {\n              setRef(ref, null, parentSuspense, vnode);\n          }\n          return nextNode;\n      };\n      const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n          optimized = optimized || !!vnode.dynamicChildren;\n          const { type, props, patchFlag, shapeFlag, dirs } = vnode;\n          // #4006 for form elements with non-string v-model value bindings\n          // e.g. <option :value=\"obj\">, <input type=\"checkbox\" :true-value=\"1\">\n          const forcePatchValue = (type === 'input' && dirs) || type === 'option';\n          // skip props & children if this is hoisted static nodes\n          if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {\n              if (dirs) {\n                  invokeDirectiveHook(vnode, null, parentComponent, 'created');\n              }\n              // props\n              if (props) {\n                  if (forcePatchValue ||\n                      !optimized ||\n                      patchFlag & 16 /* FULL_PROPS */ ||\n                      patchFlag & 32 /* HYDRATE_EVENTS */) {\n                      for (const key in props) {\n                          if ((forcePatchValue && key.endsWith('value')) ||\n                              (isOn(key) && !isReservedProp(key))) {\n                              patchProp(el, key, null, props[key]);\n                          }\n                      }\n                  }\n                  else if (props.onClick) {\n                      // Fast path for click listeners (which is most often) to avoid\n                      // iterating through props.\n                      patchProp(el, 'onClick', null, props.onClick);\n                  }\n              }\n              // vnode / directive hooks\n              let vnodeHooks;\n              if ((vnodeHooks = props && props.onVnodeBeforeMount)) {\n                  invokeVNodeHook(vnodeHooks, parentComponent, vnode);\n              }\n              if (dirs) {\n                  invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\n              }\n              if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {\n                  queueEffectWithSuspense(() => {\n                      vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\n                      dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\n                  }, parentSuspense);\n              }\n              // children\n              if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&\n                  // skip if element has innerHTML / textContent\n                  !(props && (props.innerHTML || props.textContent))) {\n                  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);\n                  let hasWarned = false;\n                  while (next) {\n                      hasMismatch = true;\n                      if (!hasWarned) {\n                          warn$1(`Hydration children mismatch in <${vnode.type}>: ` +\n                              `server rendered element contains more child nodes than client vdom.`);\n                          hasWarned = true;\n                      }\n                      // The SSRed DOM contains more nodes than it should. Remove them.\n                      const cur = next;\n                      next = next.nextSibling;\n                      remove(cur);\n                  }\n              }\n              else if (shapeFlag & 8 /* TEXT_CHILDREN */) {\n                  if (el.textContent !== vnode.children) {\n                      hasMismatch = true;\n                      warn$1(`Hydration text content mismatch in <${vnode.type}>:\\n` +\n                              `- Client: ${el.textContent}\\n` +\n                              `- Server: ${vnode.children}`);\n                      el.textContent = vnode.children;\n                  }\n              }\n          }\n          return el.nextSibling;\n      };\n      const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n          optimized = optimized || !!parentVNode.dynamicChildren;\n          const children = parentVNode.children;\n          const l = children.length;\n          let hasWarned = false;\n          for (let i = 0; i < l; i++) {\n              const vnode = optimized\n                  ? children[i]\n                  : (children[i] = normalizeVNode(children[i]));\n              if (node) {\n                  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\n              }\n              else if (vnode.type === Text && !vnode.children) {\n                  continue;\n              }\n              else {\n                  hasMismatch = true;\n                  if (!hasWarned) {\n                      warn$1(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +\n                          `server rendered element contains fewer child nodes than client vdom.`);\n                      hasWarned = true;\n                  }\n                  // the SSRed DOM didn't contain enough nodes. Mount the missing ones.\n                  patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\n              }\n          }\n          return node;\n      };\n      const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n          const { slotScopeIds: fragmentSlotScopeIds } = vnode;\n          if (fragmentSlotScopeIds) {\n              slotScopeIds = slotScopeIds\n                  ? slotScopeIds.concat(fragmentSlotScopeIds)\n                  : fragmentSlotScopeIds;\n          }\n          const container = parentNode(node);\n          const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);\n          if (next && isComment(next) && next.data === ']') {\n              return nextSibling((vnode.anchor = next));\n          }\n          else {\n              // fragment didn't hydrate successfully, since we didn't get a end anchor\n              // back. This should have led to node/children mismatch warnings.\n              hasMismatch = true;\n              // since the anchor is missing, we need to create one and insert it\n              insert((vnode.anchor = createComment(`]`)), container, next);\n              return next;\n          }\n      };\n      const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {\n          hasMismatch = true;\n          warn$1(`Hydration node mismatch:\\n- Client vnode:`, vnode.type, `\\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */\n                  ? `(text)`\n                  : isComment(node) && node.data === '['\n                      ? `(start of fragment)`\n                      : ``);\n          vnode.el = null;\n          if (isFragment) {\n              // remove excessive fragment nodes\n              const end = locateClosingAsyncAnchor(node);\n              while (true) {\n                  const next = nextSibling(node);\n                  if (next && next !== end) {\n                      remove(next);\n                  }\n                  else {\n                      break;\n                  }\n              }\n          }\n          const next = nextSibling(node);\n          const container = parentNode(node);\n          remove(node);\n          patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\n          return next;\n      };\n      const locateClosingAsyncAnchor = (node) => {\n          let match = 0;\n          while (node) {\n              node = nextSibling(node);\n              if (node && isComment(node)) {\n                  if (node.data === '[')\n                      match++;\n                  if (node.data === ']') {\n                      if (match === 0) {\n                          return nextSibling(node);\n                      }\n                      else {\n                          match--;\n                      }\n                  }\n              }\n          }\n          return node;\n      };\n      return [hydrate, hydrateNode];\n  }\n\n  let supported;\n  let perf;\n  function startMeasure(instance, type) {\n      if (instance.appContext.config.performance && isSupported()) {\n          perf.mark(`vue-${type}-${instance.uid}`);\n      }\n      {\n          devtoolsPerfStart(instance, type, supported ? perf.now() : Date.now());\n      }\n  }\n  function endMeasure(instance, type) {\n      if (instance.appContext.config.performance && isSupported()) {\n          const startTag = `vue-${type}-${instance.uid}`;\n          const endTag = startTag + `:end`;\n          perf.mark(endTag);\n          perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);\n          perf.clearMarks(startTag);\n          perf.clearMarks(endTag);\n      }\n      {\n          devtoolsPerfEnd(instance, type, supported ? perf.now() : Date.now());\n      }\n  }\n  function isSupported() {\n      if (supported !== undefined) {\n          return supported;\n      }\n      /* eslint-disable no-restricted-globals */\n      if (typeof window !== 'undefined' && window.performance) {\n          supported = true;\n          perf = window.performance;\n      }\n      else {\n          supported = false;\n      }\n      /* eslint-enable no-restricted-globals */\n      return supported;\n  }\n\n  const queuePostRenderEffect = queueEffectWithSuspense\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   */\n  function createRenderer(options) {\n      return baseCreateRenderer(options);\n  }\n  // Separate API for creating hydration-enabled renderer.\n  // Hydration logic is only used when calling this function, making it\n  // tree-shakable.\n  function createHydrationRenderer(options) {\n      return baseCreateRenderer(options, createHydrationFunctions);\n  }\n  // implementation\n  function baseCreateRenderer(options, createHydrationFns) {\n      {\n          const target = getGlobalThis();\n          target.__VUE__ = true;\n          setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);\n      }\n      const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, 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 = isHmrUpdating ? false : !!n2.dynamicChildren) => {\n          if (n1 === n2) {\n              return;\n          }\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$1:\n                  processCommentNode(n1, n2, container, anchor);\n                  break;\n              case Static:\n                  if (n1 == null) {\n                      mountStaticNode(n2, container, anchor, isSVG);\n                  }\n                  else {\n                      patchStaticNode(n1, n2, container, 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                      warn$1('Invalid VNode type:', type, `(${typeof type})`);\n                  }\n          }\n          // set ref\n          if (ref != null && parentComponent) {\n              setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !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      /**\n       * Dev / HMR only\n       */\n      const patchStaticNode = (n1, n2, container, isSVG) => {\n          // static nodes are only patched during dev for HMR\n          if (n2.children !== n1.children) {\n              const anchor = hostNextSibling(n1.anchor);\n              // remove existing\n              removeStaticNode(n1);\n              [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\n          }\n          else {\n              n2.el = n1.el;\n              n2.anchor = n1.anchor;\n          }\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          {\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);\n              }\n              if (dirs) {\n                  invokeDirectiveHook(vnode, null, parentComponent, 'created');\n              }\n              // props\n              if (props) {\n                  for (const key in props) {\n                      if (key !== 'value' && !isReservedProp(key)) {\n                          hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                      }\n                  }\n                  /**\n                   * Special case for setting value on DOM elements:\n                   * - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)\n                   * - it needs to be forced (#1471)\n                   * #2353 proposes adding another renderer option to configure this, but\n                   * the properties affects are so finite it is worth special casing it\n                   * here to reduce the complexity. (Special casing it also should not\n                   * affect non-DOM renderers)\n                   */\n                  if ('value' in props) {\n                      hostPatchProp(el, 'value', null, props.value);\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          {\n              Object.defineProperty(el, '__vnode', {\n                  value: vnode,\n                  enumerable: false\n              });\n              Object.defineProperty(el, '__vueParentComponent', {\n                  value: parentComponent,\n                  enumerable: false\n              });\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 (subTree.patchFlag > 0 &&\n                  subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {\n                  subTree =\n                      filterSingleRoot(subTree.children) || subTree;\n              }\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, slotScopeIds, optimized, 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, slotScopeIds, optimized);\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 (isHmrUpdating) {\n              // HMR updated, force full diff\n              patchFlag = 0;\n              optimized = false;\n              dynamicChildren = null;\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                          // #1471 force patch value\n                          if (next !== prev || key === 'value') {\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              if (parentComponent && parentComponent.type.__hmrId) {\n                  traverseStaticChildren(n1, n2);\n              }\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              // oldVNode may be an errored async setup() component inside Suspense\n              // which will not have a mounted element\n              oldVNode.el &&\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                  // defer patching value\n                  if (next !== prev && key !== 'value') {\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              if ('value' in newProps) {\n                  hostPatchProp(el, 'value', oldProps.value, newProps.value);\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 (isHmrUpdating) {\n              // HMR updated, force full diff\n              patchFlag = 0;\n              optimized = false;\n              dynamicChildren = null;\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 (parentComponent && parentComponent.type.__hmrId) {\n                      traverseStaticChildren(n1, n2);\n                  }\n                  else 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          if (instance.type.__hmrId) {\n              registerHMR(instance);\n          }\n          {\n              pushWarningContext(initialVNode);\n              startMeasure(instance, `mount`);\n          }\n          // inject renderer internals for keepAlive\n          if (isKeepAlive(initialVNode)) {\n              instance.ctx.renderer = internals;\n          }\n          // resolve props and slots for setup context\n          {\n              {\n                  startMeasure(instance, `init`);\n              }\n              setupComponent(instance);\n              {\n                  endMeasure(instance, `init`);\n              }\n          }\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$1));\n                  processCommentNode(null, placeholder, container, anchor);\n              }\n              return;\n          }\n          setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);\n          {\n              popWarningContext();\n              endMeasure(instance, `mount`);\n          }\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                  // async & still pending - just update props and slots\n                  // since the component's reactive effect for render isn't set-up yet\n                  {\n                      pushWarningContext(n2);\n                  }\n                  updateComponentPreRender(instance, n2, optimized);\n                  {\n                      popWarningContext();\n                  }\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.\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          const componentUpdateFn = () => {\n              if (!instance.isMounted) {\n                  let vnodeHook;\n                  const { el, props } = initialVNode;\n                  const { bm, m, parent } = instance;\n                  effect.allowRecurse = false;\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                  effect.allowRecurse = true;\n                  if (el && hydrateNode) {\n                      // vnode has adopted host node - perform hydration instead of mount.\n                      const hydrateSubTree = () => {\n                          {\n                              startMeasure(instance, `render`);\n                          }\n                          instance.subTree = renderComponentRoot(instance);\n                          {\n                              endMeasure(instance, `render`);\n                          }\n                          {\n                              startMeasure(instance, `hydrate`);\n                          }\n                          hydrateNode(el, instance.subTree, instance, parentSuspense, null);\n                          {\n                              endMeasure(instance, `hydrate`);\n                          }\n                      };\n                      if (isAsyncWrapper(initialVNode)) {\n                          initialVNode.type.__asyncLoader().then(\n                          // note: we are moving the render call into an async callback,\n                          // which means it won't track dependencies - but it's ok because\n                          // a server-rendered async wrapper is already in resolved state\n                          // and it will never need to change.\n                          () => !instance.isUnmounted && hydrateSubTree());\n                      }\n                      else {\n                          hydrateSubTree();\n                      }\n                  }\n                  else {\n                      {\n                          startMeasure(instance, `render`);\n                      }\n                      const subTree = (instance.subTree = renderComponentRoot(instance));\n                      {\n                          endMeasure(instance, `render`);\n                      }\n                      {\n                          startMeasure(instance, `patch`);\n                      }\n                      patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);\n                      {\n                          endMeasure(instance, `patch`);\n                      }\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(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), 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                  if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\n                      instance.a && queuePostRenderEffect(instance.a, parentSuspense);\n                  }\n                  instance.isMounted = true;\n                  {\n                      devtoolsComponentAdded(instance);\n                  }\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                  {\n                      pushWarningContext(next || instance.vnode);\n                  }\n                  if (next) {\n                      next.el = vnode.el;\n                      updateComponentPreRender(instance, next, optimized);\n                  }\n                  else {\n                      next = vnode;\n                  }\n                  // Disallow component effect recursion during pre-lifecycle hooks.\n                  effect.allowRecurse = false;\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                  effect.allowRecurse = true;\n                  // render\n                  {\n                      startMeasure(instance, `render`);\n                  }\n                  const nextTree = renderComponentRoot(instance);\n                  {\n                      endMeasure(instance, `render`);\n                  }\n                  const prevTree = instance.subTree;\n                  instance.subTree = nextTree;\n                  {\n                      startMeasure(instance, `patch`);\n                  }\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                  {\n                      endMeasure(instance, `patch`);\n                  }\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(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);\n                  }\n                  {\n                      devtoolsComponentUpdated(instance);\n                  }\n                  {\n                      popWarningContext();\n                  }\n              }\n          };\n          // create reactive effect for rendering\n          const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope\n          );\n          const update = (instance.update = effect.run.bind(effect));\n          update.id = instance.uid;\n          // allowRecurse\n          // #1801, #2043 component render effects should allow recursive updates\n          effect.allowRecurse = update.allowRecurse = true;\n          {\n              effect.onTrack = instance.rtc\n                  ? e => invokeArrayFns(instance.rtc, e)\n                  : void 0;\n              effect.onTrigger = instance.rtg\n                  ? e => invokeArrayFns(instance.rtg, e)\n                  : void 0;\n              // @ts-ignore (for scheduler)\n              update.ownerInstance = instance;\n          }\n          update();\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                      if (keyToNewIndexMap.has(nextChild.key)) {\n                          warn$1(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);\n                      }\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, vnode, true);\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          if (instance.type.__hmrId) {\n              unregisterHMR(instance);\n          }\n          const { bum, scope, update, subTree, um } = instance;\n          // beforeUnmount hook\n          if (bum) {\n              invokeArrayFns(bum);\n          }\n          // stop effects in component scope\n          scope.stop();\n          // update may be null if a component is unmounted before its async\n          // setup has resolved.\n          if (update) {\n              // so that scheduler will no longer invoke it\n              update.active = false;\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              devtoolsComponentRemoved(instance);\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  }\n  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {\n      if (isArray(rawRef)) {\n          rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));\n          return;\n      }\n      if (isAsyncWrapper(vnode) && !isUnmount) {\n          // when mounting async components, nothing needs to be done,\n          // because the template ref is forwarded to inner component\n          return;\n      }\n      const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */\n          ? getExposeProxy(vnode.component) || vnode.component.proxy\n          : vnode.el;\n      const value = isUnmount ? null : refValue;\n      const { i: owner, r: ref } = rawRef;\n      if (!owner) {\n          warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +\n              `A vnode with ref must be created inside the render function.`);\n          return;\n      }\n      const oldRef = oldRawRef && oldRawRef.r;\n      const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\n      const setupState = owner.setupState;\n      // dynamic ref changed. 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              {\n                  refs[ref] = value;\n              }\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          warn$1('Invalid template ref type:', value, `(${typeof value})`);\n      }\n  }\n  function 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   */\n  function 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              // also inherit for comment nodes, but not placeholders (e.g. v-if which\n              // would have received .el during block patch)\n              if (c2.type === Comment$1 && !c2.el) {\n                  c2.el = c1.el;\n              }\n          }\n      }\n  }\n  // https://en.wikipedia.org/wiki/Longest_increasing_subsequence\n  function 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) >> 1;\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  }\n\n  const isTeleport = (type) => type.__isTeleport;\n  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === '');\n  const isTargetSVG = (target) => typeof SVGElement !== 'undefined' && target instanceof SVGElement;\n  const resolveTarget = (props, select) => {\n      const targetSelector = props && props.to;\n      if (isString(targetSelector)) {\n          if (!select) {\n              warn$1(`Current renderer does not support string target for Teleports. ` +\n                      `(missing querySelector renderer option)`);\n              return null;\n          }\n          else {\n              const target = select(targetSelector);\n              if (!target) {\n                  warn$1(`Failed to locate Teleport target with selector \"${targetSelector}\". ` +\n                          `Note the target element must exist before the component is mounted - ` +\n                          `i.e. the target cannot be rendered by the component itself, and ` +\n                          `ideally should be outside of the entire Vue component tree.`);\n              }\n              return target;\n          }\n      }\n      else {\n          if (!targetSelector && !isTeleportDisabled(props)) {\n              warn$1(`Invalid Teleport target: ${targetSelector}`);\n          }\n          return targetSelector;\n      }\n  };\n  const TeleportImpl = {\n      __isTeleport: true,\n      process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {\n          const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;\n          const disabled = isTeleportDisabled(n2.props);\n          let { shapeFlag, children, dynamicChildren } = n2;\n          // #3302\n          // HMR updated, force full diff\n          if (isHmrUpdating) {\n              optimized = false;\n              dynamicChildren = null;\n          }\n          if (n1 == null) {\n              // insert anchors in the main view\n              const placeholder = (n2.el = createComment('teleport start')\n                  );\n              const mainAnchor = (n2.anchor = createComment('teleport end')\n                  );\n              insert(placeholder, container, anchor);\n              insert(mainAnchor, container, anchor);\n              const target = (n2.target = resolveTarget(n2.props, querySelector));\n              const targetAnchor = (n2.targetAnchor = createText(''));\n              if (target) {\n                  insert(targetAnchor, target);\n                  // #2652 we could be teleporting from a non-SVG tree into an SVG tree\n                  isSVG = isSVG || isTargetSVG(target);\n              }\n              else if (!disabled) {\n                  warn$1('Invalid Teleport target on mount:', target, `(${typeof target})`);\n              }\n              const mount = (container, anchor) => {\n                  // Teleport *always* has Array children. This is enforced in both the\n                  // compiler and vnode children normalization.\n                  if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                      mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                  }\n              };\n              if (disabled) {\n                  mount(container, mainAnchor);\n              }\n              else if (target) {\n                  mount(target, targetAnchor);\n              }\n          }\n          else {\n              // update content\n              n2.el = n1.el;\n              const mainAnchor = (n2.anchor = n1.anchor);\n              const target = (n2.target = n1.target);\n              const targetAnchor = (n2.targetAnchor = n1.targetAnchor);\n              const wasDisabled = isTeleportDisabled(n1.props);\n              const currentContainer = wasDisabled ? container : target;\n              const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;\n              isSVG = isSVG || isTargetSVG(target);\n              if (dynamicChildren) {\n                  // fast path when the teleport happens to be a block root\n                  patchBlockChildren(n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, isSVG, slotScopeIds);\n                  // even in block tree mode we need to make sure all root-level nodes\n                  // in the teleport inherit previous DOM references so that they can\n                  // be moved in future patches.\n                  traverseStaticChildren(n1, n2, true);\n              }\n              else if (!optimized) {\n                  patchChildren(n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, false);\n              }\n              if (disabled) {\n                  if (!wasDisabled) {\n                      // enabled -> disabled\n                      // move into main container\n                      moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);\n                  }\n              }\n              else {\n                  // target changed\n                  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {\n                      const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));\n                      if (nextTarget) {\n                          moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);\n                      }\n                      else {\n                          warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);\n                      }\n                  }\n                  else if (wasDisabled) {\n                      // disabled -> enabled\n                      // move into teleport target\n                      moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);\n                  }\n              }\n          }\n      },\n      remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {\n          const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;\n          if (target) {\n              hostRemove(targetAnchor);\n          }\n          // an unmounted teleport should always remove its children if not disabled\n          if (doRemove || !isTeleportDisabled(props)) {\n              hostRemove(anchor);\n              if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                  for (let i = 0; i < children.length; i++) {\n                      const child = children[i];\n                      unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);\n                  }\n              }\n          }\n      },\n      move: moveTeleport,\n      hydrate: hydrateTeleport\n  };\n  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {\n      // move target anchor if this is a target change.\n      if (moveType === 0 /* TARGET_CHANGE */) {\n          insert(vnode.targetAnchor, container, parentAnchor);\n      }\n      const { el, anchor, shapeFlag, children, props } = vnode;\n      const isReorder = moveType === 2 /* REORDER */;\n      // move main view anchor if this is a re-order.\n      if (isReorder) {\n          insert(el, container, parentAnchor);\n      }\n      // if this is a re-order and teleport is enabled (content is in target)\n      // do not move children. So the opposite is: only move children if this\n      // is not a reorder, or the teleport is disabled\n      if (!isReorder || isTeleportDisabled(props)) {\n          // Teleport has either Array children or no children.\n          if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n              for (let i = 0; i < children.length; i++) {\n                  move(children[i], container, parentAnchor, 2 /* REORDER */);\n              }\n          }\n      }\n      // move main view anchor if this is a re-order.\n      if (isReorder) {\n          insert(anchor, container, parentAnchor);\n      }\n  }\n  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector } }, hydrateChildren) {\n      const target = (vnode.target = resolveTarget(vnode.props, querySelector));\n      if (target) {\n          // if multiple teleports rendered to the same target element, we need to\n          // pick up from where the last teleport finished instead of the first node\n          const targetNode = target._lpa || target.firstChild;\n          if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {\n              if (isTeleportDisabled(vnode.props)) {\n                  vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);\n                  vnode.targetAnchor = targetNode;\n              }\n              else {\n                  vnode.anchor = nextSibling(node);\n                  vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);\n              }\n              target._lpa =\n                  vnode.targetAnchor && nextSibling(vnode.targetAnchor);\n          }\n      }\n      return vnode.anchor && nextSibling(vnode.anchor);\n  }\n  // Force-casted public typing for h and TSX props inference\n  const Teleport = TeleportImpl;\n\n  const COMPONENTS = 'components';\n  const DIRECTIVES = 'directives';\n  /**\n   * @private\n   */\n  function resolveComponent(name, maybeSelfReference) {\n      return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\n  }\n  const NULL_DYNAMIC_COMPONENT = Symbol();\n  /**\n   * @private\n   */\n  function resolveDynamicComponent(component) {\n      if (isString(component)) {\n          return resolveAsset(COMPONENTS, component, false) || component;\n      }\n      else {\n          // invalid types will fallthrough to createVNode and raise warning\n          return (component || NULL_DYNAMIC_COMPONENT);\n      }\n  }\n  /**\n   * @private\n   */\n  function resolveDirective(name) {\n      return resolveAsset(DIRECTIVES, name);\n  }\n  // implementation\n  function 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 which is resolved for options API\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          if (warnMissing && !res) {\n              warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);\n          }\n          return res;\n      }\n      else {\n          warn$1(`resolve${capitalize(type.slice(0, -1))} ` +\n              `can only be used in render() or setup().`);\n      }\n  }\n  function resolve(registry, name) {\n      return (registry &&\n          (registry[name] ||\n              registry[camelize(name)] ||\n              registry[capitalize(camelize(name))]));\n  }\n\n  const Fragment = Symbol('Fragment' );\n  const Text = Symbol('Text' );\n  const Comment$1 = Symbol('Comment' );\n  const Static = Symbol('Static' );\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).\n  const blockStack = [];\n  let 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   */\n  function openBlock(disableTracking = false) {\n      blockStack.push((currentBlock = disableTracking ? null : []));\n  }\n  function closeBlock() {\n      blockStack.pop();\n      currentBlock = blockStack[blockStack.length - 1] || null;\n  }\n  // Whether we should be tracking dynamic child nodes inside a block.\n  // Only tracks when this value is > 0\n  // We are not using a simple boolean because this value may need to be\n  // incremented/decremented by nested usage of v-once (see below)\n  let isBlockTreeEnabled = 1;\n  /**\n   * Block tracking sometimes needs to be disabled, for example during the\n   * creation of a tree that needs to be cached by v-once. The compiler generates\n   * code like this:\n   *\n   * ``` js\n   * _cache[1] || (\n   *   setBlockTracking(-1),\n   *   _cache[1] = createVNode(...),\n   *   setBlockTracking(1),\n   *   _cache[1]\n   * )\n   * ```\n   *\n   * @private\n   */\n  function setBlockTracking(value) {\n      isBlockTreeEnabled += value;\n  }\n  function setupBlock(vnode) {\n      // save current block children on the block vnode\n      vnode.dynamicChildren =\n          isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;\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 (isBlockTreeEnabled > 0 && currentBlock) {\n          currentBlock.push(vnode);\n      }\n      return vnode;\n  }\n  /**\n   * @private\n   */\n  function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {\n      return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true /* isBlock */));\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   */\n  function createBlock(type, props, children, patchFlag, dynamicProps) {\n      return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */));\n  }\n  function isVNode(value) {\n      return value ? value.__v_isVNode === true : false;\n  }\n  function isSameVNodeType(n1, n2) {\n      if (n2.shapeFlag & 6 /* COMPONENT */ &&\n          hmrDirtyComponents.has(n2.type)) {\n          // HMR only: if the component has been hot-updated, force a reload.\n          return false;\n      }\n      return n1.type === n2.type && n1.key === n2.key;\n  }\n  let vnodeArgsTransformer;\n  /**\n   * Internal API for registering an arguments transform for createVNode\n   * used for creating stubs in the test-utils\n   * It is *internal* but needs to be exposed for test-utils to pick up proper\n   * typings\n   */\n  function transformVNodeArgs(transformer) {\n      vnodeArgsTransformer = transformer;\n  }\n  const createVNodeWithArgsTransform = (...args) => {\n      return _createVNode(...(vnodeArgsTransformer\n          ? vnodeArgsTransformer(args, currentRenderingInstance)\n          : args));\n  };\n  const InternalObjectKey = `__vInternal`;\n  const normalizeKey = ({ key }) => key != null ? key : null;\n  const normalizeRef = ({ ref }) => {\n      return (ref != null\n          ? isString(ref) || isRef(ref) || isFunction(ref)\n              ? { i: currentRenderingInstance, r: ref }\n              : ref\n          : null);\n  };\n  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {\n      const vnode = {\n          __v_isVNode: true,\n          __v_skip: true,\n          type,\n          props,\n          key: props && normalizeKey(props),\n          ref: props && normalizeRef(props),\n          scopeId: currentScopeId,\n          slotScopeIds: null,\n          children,\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      if (needFullChildrenNormalization) {\n          normalizeChildren(vnode, children);\n          // normalize suspense children\n          if (shapeFlag & 128 /* SUSPENSE */) {\n              type.normalize(vnode);\n          }\n      }\n      else if (children) {\n          // compiled element vnode - if children is passed, only possible types are\n          // string or Array.\n          vnode.shapeFlag |= isString(children)\n              ? 8 /* TEXT_CHILDREN */\n              : 16 /* ARRAY_CHILDREN */;\n      }\n      // validate key\n      if (vnode.key !== vnode.key) {\n          warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);\n      }\n      // track vnode for block tree\n      if (isBlockTreeEnabled > 0 &&\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          (vnode.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          vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {\n          currentBlock.push(vnode);\n      }\n      return vnode;\n  }\n  const createVNode = (createVNodeWithArgsTransform );\n  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\n      if (!type || type === NULL_DYNAMIC_COMPONENT) {\n          if (!type) {\n              warn$1(`Invalid vnode type when creating vnode: ${type}.`);\n          }\n          type = Comment$1;\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          props = guardReactiveProps(props);\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      if (shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {\n          type = toRaw(type);\n          warn$1(`Vue received a Component which was made a reactive object. This can ` +\n              `lead to unnecessary performance overhead, and should be avoided by ` +\n              `marking the component with \\`markRaw\\` or using \\`shallowRef\\` ` +\n              `instead of \\`ref\\`.`, `\\nComponent that was made reactive: `, type);\n      }\n      return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);\n  }\n  function guardReactiveProps(props) {\n      if (!props)\n          return null;\n      return isProxy(props) || InternalObjectKey in props\n          ? extend({}, props)\n          : props;\n  }\n  function 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      const cloned = {\n          __v_isVNode: true,\n          __v_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: patchFlag === -1 /* HOISTED */ && isArray(children)\n              ? children.map(deepCloneVNode)\n              : 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      return cloned;\n  }\n  /**\n   * Dev only, for HMR of hoisted vnodes reused in v-for\n   * https://github.com/vitejs/vite/issues/2022\n   */\n  function deepCloneVNode(vnode) {\n      const cloned = cloneVNode(vnode);\n      if (isArray(vnode.children)) {\n          cloned.children = vnode.children.map(deepCloneVNode);\n      }\n      return cloned;\n  }\n  /**\n   * @private\n   */\n  function createTextVNode(text = ' ', flag = 0) {\n      return createVNode(Text, null, text, flag);\n  }\n  /**\n   * @private\n   */\n  function createStaticVNode(content, numberOfNodes) {\n      // A static vnode can contain multiple stringified elements, and the number\n      // of elements is necessary for hydration.\n      const vnode = createVNode(Static, null, content);\n      vnode.staticCount = numberOfNodes;\n      return vnode;\n  }\n  /**\n   * @private\n   */\n  function createCommentVNode(text = '', \n  // when used as the v-else branch, the comment node must be created as a\n  // block to ensure correct updates.\n  asBlock = false) {\n      return asBlock\n          ? (openBlock(), createBlock(Comment$1, null, text))\n          : createVNode(Comment$1, null, text);\n  }\n  function normalizeVNode(child) {\n      if (child == null || typeof child === 'boolean') {\n          // empty placeholder\n          return createVNode(Comment$1);\n      }\n      else if (isArray(child)) {\n          // fragment\n          return createVNode(Fragment, null, \n          // #3666, avoid reference pollution when reusing vnode\n          child.slice());\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 cloneIfMounted(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\n  function cloneIfMounted(child) {\n      return child.el === null || child.memo ? child : cloneVNode(child);\n  }\n  function 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 && (slot._d = false);\n                  normalizeChildren(vnode, slot());\n                  slot._c && (slot._d = true);\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.slots._ === 1 /* STABLE */) {\n                      children._ = 1 /* STABLE */;\n                  }\n                  else {\n                      children._ = 2 /* DYNAMIC */;\n                      vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;\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  }\n  function mergeProps(...args) {\n      const ret = {};\n      for (let i = 0; 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, incoming)\n                          : incoming;\n                  }\n              }\n              else if (key !== '') {\n                  ret[key] = toMerge[key];\n              }\n          }\n      }\n      return ret;\n  }\n\n  /**\n   * Actual implementation\n   */\n  function renderList(source, renderItem, cache, index) {\n      let ret;\n      const cached = (cache && cache[index]);\n      if (isArray(source) || isString(source)) {\n          ret = new Array(source.length);\n          for (let i = 0, l = source.length; i < l; i++) {\n              ret[i] = renderItem(source[i], i, undefined, cached && cached[i]);\n          }\n      }\n      else if (typeof source === 'number') {\n          if (!Number.isInteger(source)) {\n              warn$1(`The v-for range expect an integer value but got ${source}.`);\n              return [];\n          }\n          ret = new Array(source);\n          for (let i = 0; i < source; i++) {\n              ret[i] = renderItem(i + 1, i, undefined, cached && cached[i]);\n          }\n      }\n      else if (isObject(source)) {\n          if (source[Symbol.iterator]) {\n              ret = Array.from(source, (item, i) => renderItem(item, i, undefined, cached && cached[i]));\n          }\n          else {\n              const keys = Object.keys(source);\n              ret = new Array(keys.length);\n              for (let i = 0, l = keys.length; i < l; i++) {\n                  const key = keys[i];\n                  ret[i] = renderItem(source[key], key, i, cached && cached[i]);\n              }\n          }\n      }\n      else {\n          ret = [];\n      }\n      if (cache) {\n          cache[index] = ret;\n      }\n      return ret;\n  }\n\n  /**\n   * Compiler runtime helper for creating dynamic slots object\n   * @private\n   */\n  function createSlots(slots, dynamicSlots) {\n      for (let i = 0; i < dynamicSlots.length; i++) {\n          const slot = dynamicSlots[i];\n          // array of dynamic slot generated by <template v-for=\"...\" #[...]>\n          if (isArray(slot)) {\n              for (let j = 0; j < slot.length; j++) {\n                  slots[slot[j].name] = slot[j].fn;\n              }\n          }\n          else if (slot) {\n              // conditional single slot generated by <template v-if=\"...\" #foo>\n              slots[slot.name] = slot.fn;\n          }\n      }\n      return slots;\n  }\n\n  /**\n   * Compiler runtime helper for rendering `<slot/>`\n   * @private\n   */\n  function renderSlot(slots, name, props = {}, \n  // this is not a user-facing function, so the fallback is always generated by\n  // the compiler and guaranteed to be a function returning an array\n  fallback, noSlotted) {\n      if (currentRenderingInstance.isCE) {\n          return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());\n      }\n      let slot = slots[name];\n      if (slot && slot.length > 1) {\n          warn$1(`SSR-optimized slot function detected in a non-SSR-optimized render ` +\n              `function. You need to mark this component with $dynamic-slots in the ` +\n              `parent template.`);\n          slot = () => [];\n      }\n      // a compiled slot disables block tracking by default to avoid manual\n      // invocation interfering with template-based block tracking, but in\n      // `renderSlot` we can be sure that it's template-based so we can force\n      // enable it.\n      if (slot && slot._c) {\n          slot._d = false;\n      }\n      openBlock();\n      const validSlotContent = slot && ensureValidVNode(slot(props));\n      const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */\n          ? 64 /* STABLE_FRAGMENT */\n          : -2 /* BAIL */);\n      if (!noSlotted && rendered.scopeId) {\n          rendered.slotScopeIds = [rendered.scopeId + '-s'];\n      }\n      if (slot && slot._c) {\n          slot._d = true;\n      }\n      return rendered;\n  }\n  function ensureValidVNode(vnodes) {\n      return vnodes.some(child => {\n          if (!isVNode(child))\n              return true;\n          if (child.type === Comment$1)\n              return false;\n          if (child.type === Fragment &&\n              !ensureValidVNode(child.children))\n              return false;\n          return true;\n      })\n          ? vnodes\n          : null;\n  }\n\n  /**\n   * For prefixing keys in v-on=\"obj\" with \"on\"\n   * @private\n   */\n  function toHandlers(obj) {\n      const ret = {};\n      if (!isObject(obj)) {\n          warn$1(`v-on with no argument expects an object value.`);\n          return ret;\n      }\n      for (const key in obj) {\n          ret[toHandlerKey(key)] = obj[key];\n      }\n      return ret;\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   */\n  const getPublicInstance = (i) => {\n      if (!i)\n          return null;\n      if (isStatefulComponent(i))\n          return getExposeProxy(i) || i.proxy;\n      return getPublicInstance(i.parent);\n  };\n  const publicPropertiesMap = extend(Object.create(null), {\n      $: i => i,\n      $el: i => i.vnode.el,\n      $data: i => i.data,\n      $props: i => (shallowReadonly(i.props) ),\n      $attrs: i => (shallowReadonly(i.attrs) ),\n      $slots: i => (shallowReadonly(i.slots) ),\n      $refs: i => (shallowReadonly(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  });\n  const PublicInstanceProxyHandlers = {\n      get({ _: instance }, key) {\n          const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\n          // for internal formatters to know that this is a Vue instance\n          if (key === '__isVue') {\n              return true;\n          }\n          // prioritize <script setup> bindings during dev.\n          // this allows even properties that start with _ or $ to be used - so that\n          // it aligns with the production behavior where the render fn is inlined and\n          // indeed has access to all declared variables.\n          if (setupState !== EMPTY_OBJ &&\n              setupState.__isScriptSetup &&\n              hasOwn(setupState, key)) {\n              return setupState[key];\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                  markAttrsAccessed();\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              {\n                  return globalProperties[key];\n              }\n          }\n          else if (currentRenderingInstance &&\n              (!isString(key) ||\n                  // #1091 avoid internal isRef/isVNode checks on component instance leading\n                  // to infinite warning loop\n                  key.indexOf('__v') !== 0)) {\n              if (data !== EMPTY_OBJ &&\n                  (key[0] === '$' || key[0] === '_') &&\n                  hasOwn(data, key)) {\n                  warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +\n                      `character (\"$\" or \"_\") and is not proxied on the render context.`);\n              }\n              else if (instance === currentRenderingInstance) {\n                  warn$1(`Property ${JSON.stringify(key)} was accessed during render ` +\n                      `but is not defined on instance.`);\n              }\n          }\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              warn$1(`Attempting to mutate prop \"${key}\". Props are readonly.`, instance);\n              return false;\n          }\n          if (key[0] === '$' && key.slice(1) in instance) {\n              warn$1(`Attempting to mutate public property \"${key}\". ` +\n                      `Properties starting with $ are reserved and readonly.`, instance);\n              return false;\n          }\n          else {\n              if (key in instance.appContext.config.globalProperties) {\n                  Object.defineProperty(ctx, key, {\n                      enumerable: true,\n                      configurable: true,\n                      value\n                  });\n              }\n              else {\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  };\n  {\n      PublicInstanceProxyHandlers.ownKeys = (target) => {\n          warn$1(`Avoid app logic that relies on enumerating keys on a component instance. ` +\n              `The keys will be empty in production mode to avoid performance overhead.`);\n          return Reflect.ownKeys(target);\n      };\n  }\n  const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ 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          if (!has && PublicInstanceProxyHandlers.has(_, key)) {\n              warn$1(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);\n          }\n          return has;\n      }\n  });\n  // dev only\n  // In dev mode, the proxy target exposes the same properties as seen on `this`\n  // for easier console inspection. In prod mode it will be an empty object so\n  // these properties definitions can be skipped.\n  function createDevRenderContext(instance) {\n      const target = {};\n      // expose internal instance for proxy handlers\n      Object.defineProperty(target, `_`, {\n          configurable: true,\n          enumerable: false,\n          get: () => instance\n      });\n      // expose public properties\n      Object.keys(publicPropertiesMap).forEach(key => {\n          Object.defineProperty(target, key, {\n              configurable: true,\n              enumerable: false,\n              get: () => publicPropertiesMap[key](instance),\n              // intercepted by the proxy so no need for implementation,\n              // but needed to prevent set errors\n              set: NOOP\n          });\n      });\n      return target;\n  }\n  // dev only\n  function exposePropsOnRenderContext(instance) {\n      const { ctx, propsOptions: [propsOptions] } = instance;\n      if (propsOptions) {\n          Object.keys(propsOptions).forEach(key => {\n              Object.defineProperty(ctx, key, {\n                  enumerable: true,\n                  configurable: true,\n                  get: () => instance.props[key],\n                  set: NOOP\n              });\n          });\n      }\n  }\n  // dev only\n  function exposeSetupStateOnRenderContext(instance) {\n      const { ctx, setupState } = instance;\n      Object.keys(toRaw(setupState)).forEach(key => {\n          if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {\n              warn$1(`setup() return property ${JSON.stringify(key)} should not start with \"$\" or \"_\" ` +\n                  `which are reserved prefixes for Vue internals.`);\n              return;\n          }\n          Object.defineProperty(ctx, key, {\n              enumerable: true,\n              configurable: true,\n              get: () => setupState[key],\n              set: NOOP\n          });\n      });\n  }\n\n  const emptyAppContext = createAppContext();\n  let uid$1 = 0;\n  function 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++,\n          vnode,\n          type,\n          parent,\n          appContext,\n          root: null,\n          next: null,\n          subTree: null,\n          update: null,\n          scope: new EffectScope(true /* detached */),\n          render: null,\n          proxy: null,\n          exposed: null,\n          exposeProxy: null,\n          withProxy: 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          // inheritAttrs\n          inheritAttrs: type.inheritAttrs,\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          sp: null\n      };\n      {\n          instance.ctx = createDevRenderContext(instance);\n      }\n      instance.root = parent ? parent.root : instance;\n      instance.emit = emit.bind(null, instance);\n      // apply custom element special handling\n      if (vnode.ce) {\n          vnode.ce(instance);\n      }\n      return instance;\n  }\n  let currentInstance = null;\n  const getCurrentInstance = () => currentInstance || currentRenderingInstance;\n  const setCurrentInstance = (instance) => {\n      currentInstance = instance;\n      instance.scope.on();\n  };\n  const unsetCurrentInstance = () => {\n      currentInstance && currentInstance.scope.off();\n      currentInstance = null;\n  };\n  const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');\n  function validateComponentName(name, config) {\n      const appIsNativeTag = config.isNativeTag || NO;\n      if (isBuiltInTag(name) || appIsNativeTag(name)) {\n          warn$1('Do not use built-in or reserved HTML elements as component id: ' + name);\n      }\n  }\n  function isStatefulComponent(instance) {\n      return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;\n  }\n  let isInSSRComponentSetup = false;\n  function 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  }\n  function setupStatefulComponent(instance, isSSR) {\n      const Component = instance.type;\n      {\n          if (Component.name) {\n              validateComponentName(Component.name, instance.appContext.config);\n          }\n          if (Component.components) {\n              const names = Object.keys(Component.components);\n              for (let i = 0; i < names.length; i++) {\n                  validateComponentName(names[i], instance.appContext.config);\n              }\n          }\n          if (Component.directives) {\n              const names = Object.keys(Component.directives);\n              for (let i = 0; i < names.length; i++) {\n                  validateDirectiveName(names[i]);\n              }\n          }\n          if (Component.compilerOptions && isRuntimeOnly()) {\n              warn$1(`\"compilerOptions\" is only supported when using a build of Vue that ` +\n                  `includes the runtime compiler. Since you are using a runtime-only ` +\n                  `build, the options should be passed via your build tool config instead.`);\n          }\n      }\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 = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));\n      {\n          exposePropsOnRenderContext(instance);\n      }\n      // 2. call setup()\n      const { setup } = Component;\n      if (setup) {\n          const setupContext = (instance.setupContext =\n              setup.length > 1 ? createSetupContext(instance) : null);\n          setCurrentInstance(instance);\n          pauseTracking();\n          const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);\n          resetTracking();\n          unsetCurrentInstance();\n          if (isPromise(setupResult)) {\n              setupResult.then(unsetCurrentInstance, unsetCurrentInstance);\n              if (isSSR) {\n                  // return the promise so server-renderer can wait on it\n                  return setupResult\n                      .then((resolvedResult) => {\n                      handleSetupResult(instance, resolvedResult, isSSR);\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, isSSR);\n          }\n      }\n      else {\n          finishComponentSetup(instance, isSSR);\n      }\n  }\n  function 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          if (isVNode(setupResult)) {\n              warn$1(`setup() should not return VNodes directly - ` +\n                  `return a render function instead.`);\n          }\n          // setup returned bindings.\n          // assuming a render function compiled from template is present.\n          {\n              instance.devtoolsRawSetupState = setupResult;\n          }\n          instance.setupState = proxyRefs(setupResult);\n          {\n              exposeSetupStateOnRenderContext(instance);\n          }\n      }\n      else if (setupResult !== undefined) {\n          warn$1(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);\n      }\n      finishComponentSetup(instance, isSSR);\n  }\n  let compile;\n  let installWithProxy;\n  /**\n   * For runtime-dom to register the compiler.\n   * Note the exported method uses any to avoid d.ts relying on the compiler types.\n   */\n  function registerRuntimeCompiler(_compile) {\n      compile = _compile;\n      installWithProxy = i => {\n          if (i.render._rc) {\n              i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\n          }\n      };\n  }\n  // dev only\n  const isRuntimeOnly = () => !compile;\n  function finishComponentSetup(instance, isSSR, skipOptions) {\n      const Component = instance.type;\n      // template / render function normalization\n      if (!instance.render) {\n          // could be set from setup()\n          if (compile && !Component.render) {\n              const template = Component.template;\n              if (template) {\n                  {\n                      startMeasure(instance, `compile`);\n                  }\n                  const { isCustomElement, compilerOptions } = instance.appContext.config;\n                  const { delimiters, compilerOptions: componentCompilerOptions } = Component;\n                  const finalCompilerOptions = extend(extend({\n                      isCustomElement,\n                      delimiters\n                  }, compilerOptions), componentCompilerOptions);\n                  Component.render = compile(template, finalCompilerOptions);\n                  {\n                      endMeasure(instance, `compile`);\n                  }\n              }\n          }\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 (installWithProxy) {\n              installWithProxy(instance);\n          }\n      }\n      // support for 2.x options\n      {\n          setCurrentInstance(instance);\n          pauseTracking();\n          applyOptions(instance);\n          resetTracking();\n          unsetCurrentInstance();\n      }\n      // warn missing template/render\n      // the runtime compilation of template in SSR is done by server-render\n      if (!Component.render && instance.render === NOOP && !isSSR) {\n          /* istanbul ignore if */\n          if (!compile && Component.template) {\n              warn$1(`Component provided template option but ` +\n                  `runtime compilation is not supported in this build of Vue.` +\n                  (` Use \"vue.global.js\" instead.`\n                              ) /* should not happen */);\n          }\n          else {\n              warn$1(`Component is missing template or render function.`);\n          }\n      }\n  }\n  function createAttrsProxy(instance) {\n      return new Proxy(instance.attrs, {\n              get(target, key) {\n                  markAttrsAccessed();\n                  track(instance, \"get\" /* GET */, '$attrs');\n                  return target[key];\n              },\n              set() {\n                  warn$1(`setupContext.attrs is readonly.`);\n                  return false;\n              },\n              deleteProperty() {\n                  warn$1(`setupContext.attrs is readonly.`);\n                  return false;\n              }\n          }\n          );\n  }\n  function createSetupContext(instance) {\n      const expose = exposed => {\n          if (instance.exposed) {\n              warn$1(`expose() should be called only once per setup().`);\n          }\n          instance.exposed = exposed || {};\n      };\n      let attrs;\n      {\n          // We use getters in dev in case libs like test-utils overwrite instance\n          // properties (overwrites should not be done in prod)\n          return Object.freeze({\n              get attrs() {\n                  return attrs || (attrs = createAttrsProxy(instance));\n              },\n              get slots() {\n                  return shallowReadonly(instance.slots);\n              },\n              get emit() {\n                  return (event, ...args) => instance.emit(event, ...args);\n              },\n              expose\n          });\n      }\n  }\n  function getExposeProxy(instance) {\n      if (instance.exposed) {\n          return (instance.exposeProxy ||\n              (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {\n                  get(target, key) {\n                      if (key in target) {\n                          return target[key];\n                      }\n                      else if (key in publicPropertiesMap) {\n                          return publicPropertiesMap[key](instance);\n                      }\n                  }\n              })));\n      }\n  }\n  const classifyRE = /(?:^|[-_])(\\w)/g;\n  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');\n  function getComponentName(Component) {\n      return isFunction(Component)\n          ? Component.displayName || Component.name\n          : Component.name;\n  }\n  /* istanbul ignore next */\n  function 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  }\n  function isClassComponent(value) {\n      return isFunction(value) && '__vccOpts' in value;\n  }\n\n  const stack = [];\n  function pushWarningContext(vnode) {\n      stack.push(vnode);\n  }\n  function popWarningContext() {\n      stack.pop();\n  }\n  function warn$1(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'),\n              trace\n          ]);\n      }\n      else {\n          const warnArgs = [`[Vue warn]: ${msg}`, ...args];\n          /* istanbul ignore if */\n          if (trace.length &&\n              // avoid spamming console during tests\n              !false) {\n              warnArgs.push(`\\n`, ...formatTrace(trace));\n          }\n          console.warn(...warnArgs);\n      }\n      resetTracking();\n  }\n  function 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  }\n  /* istanbul ignore next */\n  function formatTrace(trace) {\n      const logs = [];\n      trace.forEach((entry, i) => {\n          logs.push(...(i === 0 ? [] : [`\\n`]), ...formatTraceEntry(entry));\n      });\n      return logs;\n  }\n  function 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  }\n  /* istanbul ignore next */\n  function 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  }\n  /* istanbul ignore next */\n  function 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  }\n\n  const ErrorTypeStrings = {\n      [\"sp\" /* SERVER_PREFETCH */]: 'serverPrefetch hook',\n      [\"bc\" /* BEFORE_CREATE */]: 'beforeCreate hook',\n      [\"c\" /* CREATED */]: 'created hook',\n      [\"bm\" /* BEFORE_MOUNT */]: 'beforeMount hook',\n      [\"m\" /* MOUNTED */]: 'mounted hook',\n      [\"bu\" /* BEFORE_UPDATE */]: 'beforeUpdate hook',\n      [\"u\" /* UPDATED */]: 'updated',\n      [\"bum\" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',\n      [\"um\" /* UNMOUNTED */]: 'unmounted hook',\n      [\"a\" /* ACTIVATED */]: 'activated hook',\n      [\"da\" /* DEACTIVATED */]: 'deactivated hook',\n      [\"ec\" /* ERROR_CAPTURED */]: 'errorCaptured hook',\n      [\"rtc\" /* RENDER_TRACKED */]: 'renderTracked hook',\n      [\"rtg\" /* RENDER_TRIGGERED */]: 'renderTriggered hook',\n      [0 /* SETUP_FUNCTION */]: 'setup function',\n      [1 /* RENDER_FUNCTION */]: 'render function',\n      [2 /* WATCH_GETTER */]: 'watcher getter',\n      [3 /* WATCH_CALLBACK */]: 'watcher callback',\n      [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',\n      [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',\n      [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',\n      [7 /* VNODE_HOOK */]: 'vnode hook',\n      [8 /* DIRECTIVE_HOOK */]: 'directive hook',\n      [9 /* TRANSITION_HOOK */]: 'transition hook',\n      [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',\n      [11 /* APP_WARN_HANDLER */]: 'app warnHandler',\n      [12 /* FUNCTION_REF */]: 'ref function',\n      [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',\n      [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +\n          'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'\n  };\n  function 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  }\n  function 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  }\n  function 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 = ErrorTypeStrings[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  }\n  function logError(err, type, contextVNode, throwInDev = true) {\n      {\n          const info = ErrorTypeStrings[type];\n          if (contextVNode) {\n              pushWarningContext(contextVNode);\n          }\n          warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);\n          if (contextVNode) {\n              popWarningContext();\n          }\n          // crash in dev by default so it's more noticeable\n          if (throwInDev) {\n              throw err;\n          }\n          else {\n              console.error(err);\n          }\n      }\n  }\n\n  let isFlushing = false;\n  let isFlushPending = false;\n  const queue = [];\n  let flushIndex = 0;\n  const pendingPreFlushCbs = [];\n  let activePreFlushCbs = null;\n  let preFlushIndex = 0;\n  const pendingPostFlushCbs = [];\n  let activePostFlushCbs = null;\n  let postFlushIndex = 0;\n  const resolvedPromise = Promise.resolve();\n  let currentFlushPromise = null;\n  let currentPreFlushParentJob = null;\n  const RECURSION_LIMIT = 100;\n  function 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.\n  function findInsertionIndex(id) {\n      // the start index should be `flushIndex + 1`\n      let start = flushIndex + 1;\n      let end = queue.length;\n      while (start < end) {\n          const middle = (start + end) >>> 1;\n          const middleJobId = getId(queue[middle]);\n          middleJobId < id ? (start = middle + 1) : (end = middle);\n      }\n      return start;\n  }\n  function 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          if (job.id == null) {\n              queue.push(job);\n          }\n          else {\n              queue.splice(findInsertionIndex(job.id), 0, job);\n          }\n          queueFlush();\n      }\n  }\n  function queueFlush() {\n      if (!isFlushing && !isFlushPending) {\n          isFlushPending = true;\n          currentFlushPromise = resolvedPromise.then(flushJobs);\n      }\n  }\n  function invalidateJob(job) {\n      const i = queue.indexOf(job);\n      if (i > flushIndex) {\n          queue.splice(i, 1);\n      }\n  }\n  function 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  }\n  function queuePreFlushCb(cb) {\n      queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);\n  }\n  function queuePostFlushCb(cb) {\n      queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);\n  }\n  function flushPreFlushCbs(seen, parentJob = null) {\n      if (pendingPreFlushCbs.length) {\n          currentPreFlushParentJob = parentJob;\n          activePreFlushCbs = [...new Set(pendingPreFlushCbs)];\n          pendingPreFlushCbs.length = 0;\n          {\n              seen = seen || new Map();\n          }\n          for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {\n              if (checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {\n                  continue;\n              }\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  }\n  function 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          {\n              seen = seen || new Map();\n          }\n          activePostFlushCbs.sort((a, b) => getId(a) - getId(b));\n          for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\n              if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {\n                  continue;\n              }\n              activePostFlushCbs[postFlushIndex]();\n          }\n          activePostFlushCbs = null;\n          postFlushIndex = 0;\n      }\n  }\n  const getId = (job) => job.id == null ? Infinity : job.id;\n  function flushJobs(seen) {\n      isFlushPending = false;\n      isFlushing = true;\n      {\n          seen = seen || new Map();\n      }\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 && job.active !== false) {\n                  if (true && checkRecursiveUpdates(seen, job)) {\n                      continue;\n                  }\n                  // console.log(`running:`, job.id)\n                  callWithErrorHandling(job, null, 14 /* SCHEDULER */);\n              }\n          }\n      }\n      finally {\n          flushIndex = 0;\n          queue.length = 0;\n          flushPostFlushCbs(seen);\n          isFlushing = false;\n          currentFlushPromise = null;\n          // some postFlushCb queued jobs!\n          // keep flushing until it drains.\n          if (queue.length ||\n              pendingPreFlushCbs.length ||\n              pendingPostFlushCbs.length) {\n              flushJobs(seen);\n          }\n      }\n  }\n  function 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              const instance = fn.ownerInstance;\n              const componentName = instance && getComponentName(instance.type);\n              warn$1(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +\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              return true;\n          }\n          else {\n              seen.set(fn, count + 1);\n          }\n      }\n  }\n\n  // Simple effect.\n  function watchEffect(effect, options) {\n      return doWatch(effect, null, options);\n  }\n  function watchPostEffect(effect, options) {\n      return doWatch(effect, null, (Object.assign(options || {}, { flush: 'post' })\n          ));\n  }\n  function watchSyncEffect(effect, options) {\n      return doWatch(effect, null, (Object.assign(options || {}, { flush: 'sync' })\n          ));\n  }\n  // initial value for watchers to trigger on undefined initial values\n  const INITIAL_WATCHER_VALUE = {};\n  // implementation\n  function watch(source, cb, options) {\n      if (!isFunction(cb)) {\n          warn$1(`\\`watch(fn, options?)\\` signature has been moved to a separate API. ` +\n              `Use \\`watchEffect(fn, options?)\\` instead. \\`watch\\` now only ` +\n              `supports \\`watch(source, cb, options?) signature.`);\n      }\n      return doWatch(source, cb, options);\n  }\n  function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {\n      if (!cb) {\n          if (immediate !== undefined) {\n              warn$1(`watch() \"immediate\" option is only respected when using the ` +\n                  `watch(source, callback, options?) signature.`);\n          }\n          if (deep !== undefined) {\n              warn$1(`watch() \"deep\" option is only respected when using the ` +\n                  `watch(source, callback, options?) signature.`);\n          }\n      }\n      const warnInvalidSource = (s) => {\n          warn$1(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +\n              `a reactive object, or an array of these types.`);\n      };\n      const instance = currentInstance;\n      let getter;\n      let forceTrigger = false;\n      let isMultiSource = 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          isMultiSource = true;\n          forceTrigger = source.some(isReactive);\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              }\n              else {\n                  warnInvalidSource(s);\n              }\n          });\n      }\n      else if (isFunction(source)) {\n          if (cb) {\n              // getter with cb\n              getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);\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          warnInvalidSource(source);\n      }\n      if (cb && deep) {\n          const baseGetter = getter;\n          getter = () => traverse(baseGetter());\n      }\n      let cleanup;\n      let onInvalidate = (fn) => {\n          cleanup = effect.onStop = () => {\n              callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);\n          };\n      };\n      let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;\n      const job = () => {\n          if (!effect.active) {\n              return;\n          }\n          if (cb) {\n              // watch(source, cb)\n              const newValue = effect.run();\n              if (deep ||\n                  forceTrigger ||\n                  (isMultiSource\n                      ? newValue.some((v, i) => hasChanged(v, oldValue[i]))\n                      : hasChanged(newValue, oldValue)) ||\n                  (false  )) {\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              effect.run();\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; // the scheduler function gets called directly\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 effect = new ReactiveEffect(getter, scheduler);\n      {\n          effect.onTrack = onTrack;\n          effect.onTrigger = onTrigger;\n      }\n      // initial run\n      if (cb) {\n          if (immediate) {\n              job();\n          }\n          else {\n              oldValue = effect.run();\n          }\n      }\n      else if (flush === 'post') {\n          queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);\n      }\n      else {\n          effect.run();\n      }\n      return () => {\n          effect.stop();\n          if (instance && instance.scope) {\n              remove(instance.scope.effects, effect);\n          }\n      };\n  }\n  // this.$watch\n  function instanceWatch(source, value, options) {\n      const publicThis = this.proxy;\n      const getter = isString(source)\n          ? source.includes('.')\n              ? createPathGetter(publicThis, source)\n              : () => publicThis[source]\n          : source.bind(publicThis, publicThis);\n      let cb;\n      if (isFunction(value)) {\n          cb = value;\n      }\n      else {\n          cb = value.handler;\n          options = value;\n      }\n      const cur = currentInstance;\n      setCurrentInstance(this);\n      const res = doWatch(getter, cb.bind(publicThis), options);\n      if (cur) {\n          setCurrentInstance(cur);\n      }\n      else {\n          unsetCurrentInstance();\n      }\n      return res;\n  }\n  function 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  }\n  function traverse(value, seen = new Set()) {\n      if (!isObject(value) || value[\"__v_skip\" /* SKIP */]) {\n          return value;\n      }\n      seen = seen || new Set();\n      if (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 if (isPlainObject(value)) {\n          for (const key in value) {\n              traverse(value[key], seen);\n          }\n      }\n      return value;\n  }\n\n  // dev only\n  const warnRuntimeUsage = (method) => warn$1(`${method}() is a compiler-hint helper that is only usable inside ` +\n      `<script setup> of a single file component. Its arguments should be ` +\n      `compiled away and passing it at runtime has no effect.`);\n  // implementation\n  function defineProps() {\n      {\n          warnRuntimeUsage(`defineProps`);\n      }\n      return null;\n  }\n  // implementation\n  function defineEmits() {\n      {\n          warnRuntimeUsage(`defineEmits`);\n      }\n      return null;\n  }\n  /**\n   * Vue `<script setup>` compiler macro for declaring a component's exposed\n   * instance properties when it is accessed by a parent component via template\n   * refs.\n   *\n   * `<script setup>` components are closed by default - i.e. varaibles inside\n   * the `<script setup>` scope is not exposed to parent unless explicitly exposed\n   * via `defineExpose`.\n   *\n   * This is only usable inside `<script setup>`, is compiled away in the\n   * output and should **not** be actually called at runtime.\n   */\n  function defineExpose(exposed) {\n      {\n          warnRuntimeUsage(`defineExpose`);\n      }\n  }\n  /**\n   * Vue `<script setup>` compiler macro for providing props default values when\n   * using type-based `defineProps` decalration.\n   *\n   * Example usage:\n   * ```ts\n   * withDefaults(defineProps<{\n   *   size?: number\n   *   labels?: string[]\n   * }>(), {\n   *   size: 3,\n   *   labels: () => ['default label']\n   * })\n   * ```\n   *\n   * This is only usable inside `<script setup>`, is compiled away in the output\n   * and should **not** be actually called at runtime.\n   */\n  function withDefaults(props, defaults) {\n      {\n          warnRuntimeUsage(`withDefaults`);\n      }\n      return null;\n  }\n  function useSlots() {\n      return getContext().slots;\n  }\n  function useAttrs() {\n      return getContext().attrs;\n  }\n  function getContext() {\n      const i = getCurrentInstance();\n      if (!i) {\n          warn$1(`useContext() called without active instance.`);\n      }\n      return i.setupContext || (i.setupContext = createSetupContext(i));\n  }\n  /**\n   * Runtime helper for merging default declarations. Imported by compiled code\n   * only.\n   * @internal\n   */\n  function mergeDefaults(\n  // the base props is compiler-generated and guaranteed to be in this shape.\n  props, defaults) {\n      for (const key in defaults) {\n          const val = props[key];\n          if (val) {\n              val.default = defaults[key];\n          }\n          else if (val === null) {\n              props[key] = { default: defaults[key] };\n          }\n          else {\n              warn$1(`props default key \"${key}\" has no corresponding declaration.`);\n          }\n      }\n      return props;\n  }\n  /**\n   * `<script setup>` helper for persisting the current instance context over\n   * async/await flows.\n   *\n   * `@vue/compiler-sfc` converts the following:\n   *\n   * ```ts\n   * const x = await foo()\n   * ```\n   *\n   * into:\n   *\n   * ```ts\n   * let __temp, __restore\n   * const x = (([__temp, __restore] = withAsyncContext(() => foo())),__temp=await __temp,__restore(),__temp)\n   * ```\n   * @internal\n   */\n  function withAsyncContext(getAwaitable) {\n      const ctx = getCurrentInstance();\n      if (!ctx) {\n          warn$1(`withAsyncContext called without active current instance. ` +\n              `This is likely a bug.`);\n      }\n      let awaitable = getAwaitable();\n      unsetCurrentInstance();\n      if (isPromise(awaitable)) {\n          awaitable = awaitable.catch(e => {\n              setCurrentInstance(ctx);\n              throw e;\n          });\n      }\n      return [awaitable, () => setCurrentInstance(ctx)];\n  }\n\n  // Actual implementation\n  function h(type, propsOrChildren, children) {\n      const l = arguments.length;\n      if (l === 2) {\n          if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {\n              // single vnode without props\n              if (isVNode(propsOrChildren)) {\n                  return createVNode(type, null, [propsOrChildren]);\n              }\n              // props without children\n              return createVNode(type, propsOrChildren);\n          }\n          else {\n              // omit props\n              return createVNode(type, null, propsOrChildren);\n          }\n      }\n      else {\n          if (l > 3) {\n              children = Array.prototype.slice.call(arguments, 2);\n          }\n          else if (l === 3 && isVNode(children)) {\n              children = [children];\n          }\n          return createVNode(type, propsOrChildren, children);\n      }\n  }\n\n  const ssrContextKey = Symbol(`ssrContext` );\n  const useSSRContext = () => {\n      {\n          warn$1(`useSSRContext() is not supported in the global build.`);\n      }\n  };\n\n  function initCustomFormatter() {\n      /* eslint-disable no-restricted-globals */\n      if (typeof window === 'undefined') {\n          return;\n      }\n      const vueStyle = { style: 'color:#3ba776' };\n      const numberStyle = { style: 'color:#0b1bc9' };\n      const stringStyle = { style: 'color:#b62e24' };\n      const keywordStyle = { style: 'color:#9d288c' };\n      // custom formatter for Chrome\n      // https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\n      const formatter = {\n          header(obj) {\n              // TODO also format ComponentPublicInstance & ctx.slots/attrs in setup\n              if (!isObject(obj)) {\n                  return null;\n              }\n              if (obj.__isVue) {\n                  return ['div', vueStyle, `VueInstance`];\n              }\n              else if (isRef(obj)) {\n                  return [\n                      'div',\n                      {},\n                      ['span', vueStyle, genRefFlag(obj)],\n                      '<',\n                      formatValue(obj.value),\n                      `>`\n                  ];\n              }\n              else if (isReactive(obj)) {\n                  return [\n                      'div',\n                      {},\n                      ['span', vueStyle, 'Reactive'],\n                      '<',\n                      formatValue(obj),\n                      `>${isReadonly(obj) ? ` (readonly)` : ``}`\n                  ];\n              }\n              else if (isReadonly(obj)) {\n                  return [\n                      'div',\n                      {},\n                      ['span', vueStyle, 'Readonly'],\n                      '<',\n                      formatValue(obj),\n                      '>'\n                  ];\n              }\n              return null;\n          },\n          hasBody(obj) {\n              return obj && obj.__isVue;\n          },\n          body(obj) {\n              if (obj && obj.__isVue) {\n                  return [\n                      'div',\n                      {},\n                      ...formatInstance(obj.$)\n                  ];\n              }\n          }\n      };\n      function formatInstance(instance) {\n          const blocks = [];\n          if (instance.type.props && instance.props) {\n              blocks.push(createInstanceBlock('props', toRaw(instance.props)));\n          }\n          if (instance.setupState !== EMPTY_OBJ) {\n              blocks.push(createInstanceBlock('setup', instance.setupState));\n          }\n          if (instance.data !== EMPTY_OBJ) {\n              blocks.push(createInstanceBlock('data', toRaw(instance.data)));\n          }\n          const computed = extractKeys(instance, 'computed');\n          if (computed) {\n              blocks.push(createInstanceBlock('computed', computed));\n          }\n          const injected = extractKeys(instance, 'inject');\n          if (injected) {\n              blocks.push(createInstanceBlock('injected', injected));\n          }\n          blocks.push([\n              'div',\n              {},\n              [\n                  'span',\n                  {\n                      style: keywordStyle.style + ';opacity:0.66'\n                  },\n                  '$ (internal): '\n              ],\n              ['object', { object: instance }]\n          ]);\n          return blocks;\n      }\n      function createInstanceBlock(type, target) {\n          target = extend({}, target);\n          if (!Object.keys(target).length) {\n              return ['span', {}];\n          }\n          return [\n              'div',\n              { style: 'line-height:1.25em;margin-bottom:0.6em' },\n              [\n                  'div',\n                  {\n                      style: 'color:#476582'\n                  },\n                  type\n              ],\n              [\n                  'div',\n                  {\n                      style: 'padding-left:1.25em'\n                  },\n                  ...Object.keys(target).map(key => {\n                      return [\n                          'div',\n                          {},\n                          ['span', keywordStyle, key + ': '],\n                          formatValue(target[key], false)\n                      ];\n                  })\n              ]\n          ];\n      }\n      function formatValue(v, asRaw = true) {\n          if (typeof v === 'number') {\n              return ['span', numberStyle, v];\n          }\n          else if (typeof v === 'string') {\n              return ['span', stringStyle, JSON.stringify(v)];\n          }\n          else if (typeof v === 'boolean') {\n              return ['span', keywordStyle, v];\n          }\n          else if (isObject(v)) {\n              return ['object', { object: asRaw ? toRaw(v) : v }];\n          }\n          else {\n              return ['span', stringStyle, String(v)];\n          }\n      }\n      function extractKeys(instance, type) {\n          const Comp = instance.type;\n          if (isFunction(Comp)) {\n              return;\n          }\n          const extracted = {};\n          for (const key in instance.ctx) {\n              if (isKeyOfType(Comp, key, type)) {\n                  extracted[key] = instance.ctx[key];\n              }\n          }\n          return extracted;\n      }\n      function isKeyOfType(Comp, key, type) {\n          const opts = Comp[type];\n          if ((isArray(opts) && opts.includes(key)) ||\n              (isObject(opts) && key in opts)) {\n              return true;\n          }\n          if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {\n              return true;\n          }\n          if (Comp.mixins && Comp.mixins.some(m => isKeyOfType(m, key, type))) {\n              return true;\n          }\n      }\n      function genRefFlag(v) {\n          if (v._shallow) {\n              return `ShallowRef`;\n          }\n          if (v.effect) {\n              return `ComputedRef`;\n          }\n          return `Ref`;\n      }\n      if (window.devtoolsFormatters) {\n          window.devtoolsFormatters.push(formatter);\n      }\n      else {\n          window.devtoolsFormatters = [formatter];\n      }\n  }\n\n  function withMemo(memo, render, cache, index) {\n      const cached = cache[index];\n      if (cached && isMemoSame(cached, memo)) {\n          return cached;\n      }\n      const ret = render();\n      // shallow clone\n      ret.memo = memo.slice();\n      return (cache[index] = ret);\n  }\n  function isMemoSame(cached, memo) {\n      const prev = cached.memo;\n      if (prev.length != memo.length) {\n          return false;\n      }\n      for (let i = 0; i < prev.length; i++) {\n          if (prev[i] !== memo[i]) {\n              return false;\n          }\n      }\n      // make sure to let parent block track it when returning cached\n      if (isBlockTreeEnabled > 0 && currentBlock) {\n          currentBlock.push(cached);\n      }\n      return true;\n  }\n\n  function $ref() { }\n  function $computed() { }\n  function $fromRefs() {\n      return null;\n  }\n  function $raw() {\n      return null;\n  }\n\n  // Core API ------------------------------------------------------------------\n  const version = \"3.2.1\";\n  /**\n   * SSR utils for \\@vue/server-renderer. Only exposed in cjs builds.\n   * @internal\n   */\n  const ssrUtils = (null);\n  /**\n   * @internal only exposed in compat builds\n   */\n  const resolveFilter = null;\n  /**\n   * @internal only exposed in compat builds.\n   */\n  const compatUtils = (null);\n\n  const svgNS = 'http://www.w3.org/2000/svg';\n  const doc = (typeof document !== 'undefined' ? document : null);\n  const staticTemplateCache = new Map();\n  const 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          // <parent> before | first ... last | anchor </parent>\n          const before = anchor ? anchor.previousSibling : parent.lastChild;\n          let template = staticTemplateCache.get(content);\n          if (!template) {\n              const t = doc.createElement('template');\n              t.innerHTML = isSVG ? `<svg>${content}</svg>` : content;\n              template = t.content;\n              if (isSVG) {\n                  // remove outer svg wrapper\n                  const wrapper = template.firstChild;\n                  while (wrapper.firstChild) {\n                      template.appendChild(wrapper.firstChild);\n                  }\n                  template.removeChild(wrapper);\n              }\n              staticTemplateCache.set(content, template);\n          }\n          parent.insertBefore(template.cloneNode(true), anchor);\n          return [\n              // first\n              before ? before.nextSibling : parent.firstChild,\n              // last\n              anchor ? anchor.previousSibling : parent.lastChild\n          ];\n      }\n  };\n\n  // compiler should normalize class + :class bindings on the same element\n  // into a single binding ['staticClass', dynamic]\n  function patchClass(el, value, isSVG) {\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 ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\n      }\n      if (value == null) {\n          el.removeAttribute('class');\n      }\n      else if (isSVG) {\n          el.setAttribute('class', value);\n      }\n      else {\n          el.className = value;\n      }\n  }\n\n  function 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  }\n  const importantRE = /\\s*!important$/;\n  function 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  }\n  const prefixes = ['Webkit', 'Moz', 'ms'];\n  const prefixCache = {};\n  function 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  }\n\n  const xlinkNS = 'http://www.w3.org/1999/xlink';\n  function patchAttr(el, key, value, isSVG, instance) {\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\n  // __UNSAFE__\n  // functions. The user is responsible for using them with only trusted content.\n  function 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.\n  prevChildren, 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          if (value == null) {\n              el.removeAttribute(key);\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              // the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error\n              try {\n                  el[key] = 0;\n              }\n              catch (_a) { }\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              warn$1(`Failed setting prop \"${key}\" on <${el.tagName.toLowerCase()}>: ` +\n                  `value ${value} is invalid.`, e);\n          }\n      }\n  }\n\n  // Async edge case fix requires storing an event listener's attach timestamp.\n  let _getNow = Date.now;\n  let skipTimestampCheck = false;\n  if (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.\n  let cachedNow = 0;\n  const p = Promise.resolve();\n  const reset = () => {\n      cachedNow = 0;\n  };\n  const getNow = () => cachedNow || (p.then(reset), (cachedNow = _getNow()));\n  function addEventListener(el, event, handler, options) {\n      el.addEventListener(event, handler, options);\n  }\n  function removeEventListener(el, event, handler, options) {\n      el.removeEventListener(event, handler, options);\n  }\n  function 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  }\n  const optionsModifierRE = /(?:Once|Passive|Capture)$/;\n  function 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  }\n  function 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  }\n  function 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  }\n\n  const nativeOnRE = /^on[a-z]/;\n  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {\n      if (key === 'class') {\n          patchClass(el, nextValue, isSVG);\n      }\n      else if (key === 'style') {\n          patchStyle(el, prevValue, nextValue);\n      }\n      else if (isOn(key)) {\n          // ignore v-model listeners\n          if (!isModelListener(key)) {\n              patchEvent(el, key, prevValue, nextValue, parentComponent);\n          }\n      }\n      else if (key[0] === '.'\n          ? ((key = key.slice(1)), true)\n          : key[0] === '^'\n              ? ((key = key.slice(1)), false)\n              : 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  };\n  function 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  }\n\n  function defineCustomElement(options, hydate) {\n      const Comp = defineComponent(options);\n      class VueCustomElement extends VueElement {\n          constructor(initialProps) {\n              super(Comp, initialProps, hydate);\n          }\n      }\n      VueCustomElement.def = Comp;\n      return VueCustomElement;\n  }\n  const defineSSRCustomElement = ((options) => {\n      // @ts-ignore\n      return defineCustomElement(options, hydrate);\n  });\n  const BaseClass = (typeof HTMLElement !== 'undefined' ? HTMLElement : class {\n  });\n  class VueElement extends BaseClass {\n      constructor(_def, _props = {}, hydrate) {\n          super();\n          this._def = _def;\n          this._props = _props;\n          /**\n           * @internal\n           */\n          this._instance = null;\n          this._connected = false;\n          this._resolved = false;\n          if (this.shadowRoot && hydrate) {\n              hydrate(this._createVNode(), this.shadowRoot);\n          }\n          else {\n              if (this.shadowRoot) {\n                  warn$1(`Custom element has pre-rendered declarative shadow root but is not ` +\n                      `defined as hydratable. Use \\`defineSSRCustomElement\\`.`);\n              }\n              this.attachShadow({ mode: 'open' });\n          }\n          // set initial attrs\n          for (let i = 0; i < this.attributes.length; i++) {\n              this._setAttr(this.attributes[i].name);\n          }\n          // watch future attr changes\n          const observer = new MutationObserver(mutations => {\n              for (const m of mutations) {\n                  this._setAttr(m.attributeName);\n              }\n          });\n          observer.observe(this, { attributes: true });\n      }\n      connectedCallback() {\n          this._connected = true;\n          if (!this._instance) {\n              this._resolveDef();\n              render(this._createVNode(), this.shadowRoot);\n          }\n      }\n      disconnectedCallback() {\n          this._connected = false;\n          nextTick(() => {\n              if (!this._connected) {\n                  render(null, this.shadowRoot);\n                  this._instance = null;\n              }\n          });\n      }\n      /**\n       * resolve inner component definition (handle possible async component)\n       */\n      _resolveDef() {\n          if (this._resolved) {\n              return;\n          }\n          const resolve = (def) => {\n              this._resolved = true;\n              // check if there are props set pre-upgrade or connect\n              for (const key of Object.keys(this)) {\n                  if (key[0] !== '_') {\n                      this._setProp(key, this[key]);\n                  }\n              }\n              const { props, styles } = def;\n              // defining getter/setters on prototype\n              const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];\n              for (const key of rawKeys.map(camelize)) {\n                  Object.defineProperty(this, key, {\n                      get() {\n                          return this._getProp(key);\n                      },\n                      set(val) {\n                          this._setProp(key, val);\n                      }\n                  });\n              }\n              this._applyStyles(styles);\n          };\n          const asyncDef = this._def.__asyncLoader;\n          if (asyncDef) {\n              asyncDef().then(resolve);\n          }\n          else {\n              resolve(this._def);\n          }\n      }\n      _setAttr(key) {\n          this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);\n      }\n      /**\n       * @internal\n       */\n      _getProp(key) {\n          return this._props[key];\n      }\n      /**\n       * @internal\n       */\n      _setProp(key, val, shouldReflect = true) {\n          if (val !== this._props[key]) {\n              this._props[key] = val;\n              if (this._instance) {\n                  render(this._createVNode(), this.shadowRoot);\n              }\n              // reflect\n              if (shouldReflect) {\n                  if (val === true) {\n                      this.setAttribute(hyphenate(key), '');\n                  }\n                  else if (typeof val === 'string' || typeof val === 'number') {\n                      this.setAttribute(hyphenate(key), val + '');\n                  }\n                  else if (!val) {\n                      this.removeAttribute(hyphenate(key));\n                  }\n              }\n          }\n      }\n      _createVNode() {\n          const vnode = createVNode(this._def, extend({}, this._props));\n          if (!this._instance) {\n              vnode.ce = instance => {\n                  this._instance = instance;\n                  instance.isCE = true;\n                  // HMR\n                  {\n                      instance.ceReload = newStyles => {\n                          // alawys reset styles\n                          if (this._styles) {\n                              this._styles.forEach(s => this.shadowRoot.removeChild(s));\n                              this._styles.length = 0;\n                          }\n                          this._applyStyles(newStyles);\n                          // if this is an async component, ceReload is called from the inner\n                          // component so no need to reload the async wrapper\n                          if (!this._def.__asyncLoader) {\n                              // reload\n                              this._instance = null;\n                              render(this._createVNode(), this.shadowRoot);\n                          }\n                      };\n                  }\n                  // intercept emit\n                  instance.emit = (event, ...args) => {\n                      this.dispatchEvent(new CustomEvent(event, {\n                          detail: args\n                      }));\n                  };\n                  // locate nearest Vue custom element parent for provide/inject\n                  let parent = this;\n                  while ((parent =\n                      parent && (parent.parentNode || parent.host))) {\n                      if (parent instanceof VueElement) {\n                          instance.parent = parent._instance;\n                          break;\n                      }\n                  }\n              };\n          }\n          return vnode;\n      }\n      _applyStyles(styles) {\n          if (styles) {\n              styles.forEach(css => {\n                  const s = document.createElement('style');\n                  s.textContent = css;\n                  this.shadowRoot.appendChild(s);\n                  // record for HMR\n                  {\n                      (this._styles || (this._styles = [])).push(s);\n                  }\n              });\n          }\n      }\n  }\n\n  function useCssModule(name = '$style') {\n      /* istanbul ignore else */\n      {\n          {\n              warn$1(`useCssModule() is not supported in the global build.`);\n          }\n          return EMPTY_OBJ;\n      }\n  }\n\n  /**\n   * Runtime helper for SFC's CSS variable injection feature.\n   * @private\n   */\n  function useCssVars(getter) {\n      const instance = getCurrentInstance();\n      /* istanbul ignore next */\n      if (!instance) {\n          warn$1(`useCssVars is called without current active component instance.`);\n          return;\n      }\n      const setVars = () => setVarsOnVNode(instance.subTree, getter(instance.proxy));\n      watchPostEffect(setVars);\n      onMounted(() => {\n          const ob = new MutationObserver(setVars);\n          ob.observe(instance.subTree.el.parentNode, { childList: true });\n          onUnmounted(() => ob.disconnect());\n      });\n  }\n  function setVarsOnVNode(vnode, vars) {\n      if (vnode.shapeFlag & 128 /* SUSPENSE */) {\n          const suspense = vnode.suspense;\n          vnode = suspense.activeBranch;\n          if (suspense.pendingBranch && !suspense.isHydrating) {\n              suspense.effects.push(() => {\n                  setVarsOnVNode(suspense.activeBranch, vars);\n              });\n          }\n      }\n      // drill down HOCs until it's a non-component vnode\n      while (vnode.component) {\n          vnode = vnode.component.subTree;\n      }\n      if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {\n          setVarsOnNode(vnode.el, vars);\n      }\n      else if (vnode.type === Fragment) {\n          vnode.children.forEach(c => setVarsOnVNode(c, vars));\n      }\n      else if (vnode.type === Static) {\n          let { el, anchor } = vnode;\n          while (el) {\n              setVarsOnNode(el, vars);\n              if (el === anchor)\n                  break;\n              el = el.nextSibling;\n          }\n      }\n  }\n  function setVarsOnNode(el, vars) {\n      if (el.nodeType === 1) {\n          const style = el.style;\n          for (const key in vars) {\n              style.setProperty(`--${key}`, vars[key]);\n          }\n      }\n  }\n\n  const TRANSITION = 'transition';\n  const ANIMATION = 'animation';\n  // DOM Transition is a higher-order-component based on the platform-agnostic\n  // base Transition component, with DOM-specific logic.\n  const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);\n  Transition.displayName = 'Transition';\n  const DOMTransitionPropsValidators = {\n      name: String,\n      type: String,\n      css: {\n          type: Boolean,\n          default: true\n      },\n      duration: [String, Number, Object],\n      enterFromClass: String,\n      enterActiveClass: String,\n      enterToClass: String,\n      appearFromClass: String,\n      appearActiveClass: String,\n      appearToClass: String,\n      leaveFromClass: String,\n      leaveActiveClass: String,\n      leaveToClass: String\n  };\n  const TransitionPropsValidators = (Transition.props =\n      /*#__PURE__*/ extend({}, BaseTransition.props, DOMTransitionPropsValidators));\n  /**\n   * #3227 Incoming hooks may be merged into arrays when wrapping Transition\n   * with custom HOCs.\n   */\n  const callHook$1 = (hook, args = []) => {\n      if (isArray(hook)) {\n          hook.forEach(h => h(...args));\n      }\n      else if (hook) {\n          hook(...args);\n      }\n  };\n  /**\n   * Check if a hook expects a callback (2nd arg), which means the user\n   * intends to explicitly control the end of the transition.\n   */\n  const hasExplicitCallback = (hook) => {\n      return hook\n          ? isArray(hook)\n              ? hook.some(h => h.length > 1)\n              : hook.length > 1\n          : false;\n  };\n  function resolveTransitionProps(rawProps) {\n      const baseProps = {};\n      for (const key in rawProps) {\n          if (!(key in DOMTransitionPropsValidators)) {\n              baseProps[key] = rawProps[key];\n          }\n      }\n      if (rawProps.css === false) {\n          return baseProps;\n      }\n      const { name = 'v', type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;\n      const durations = normalizeDuration(duration);\n      const enterDuration = durations && durations[0];\n      const leaveDuration = durations && durations[1];\n      const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;\n      const finishEnter = (el, isAppear, done) => {\n          removeTransitionClass(el, isAppear ? appearToClass : enterToClass);\n          removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);\n          done && done();\n      };\n      const finishLeave = (el, done) => {\n          removeTransitionClass(el, leaveToClass);\n          removeTransitionClass(el, leaveActiveClass);\n          done && done();\n      };\n      const makeEnterHook = (isAppear) => {\n          return (el, done) => {\n              const hook = isAppear ? onAppear : onEnter;\n              const resolve = () => finishEnter(el, isAppear, done);\n              callHook$1(hook, [el, resolve]);\n              nextFrame(() => {\n                  removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);\n                  addTransitionClass(el, isAppear ? appearToClass : enterToClass);\n                  if (!hasExplicitCallback(hook)) {\n                      whenTransitionEnds(el, type, enterDuration, resolve);\n                  }\n              });\n          };\n      };\n      return extend(baseProps, {\n          onBeforeEnter(el) {\n              callHook$1(onBeforeEnter, [el]);\n              addTransitionClass(el, enterFromClass);\n              addTransitionClass(el, enterActiveClass);\n          },\n          onBeforeAppear(el) {\n              callHook$1(onBeforeAppear, [el]);\n              addTransitionClass(el, appearFromClass);\n              addTransitionClass(el, appearActiveClass);\n          },\n          onEnter: makeEnterHook(false),\n          onAppear: makeEnterHook(true),\n          onLeave(el, done) {\n              const resolve = () => finishLeave(el, done);\n              addTransitionClass(el, leaveFromClass);\n              // force reflow so *-leave-from classes immediately take effect (#2593)\n              forceReflow();\n              addTransitionClass(el, leaveActiveClass);\n              nextFrame(() => {\n                  removeTransitionClass(el, leaveFromClass);\n                  addTransitionClass(el, leaveToClass);\n                  if (!hasExplicitCallback(onLeave)) {\n                      whenTransitionEnds(el, type, leaveDuration, resolve);\n                  }\n              });\n              callHook$1(onLeave, [el, resolve]);\n          },\n          onEnterCancelled(el) {\n              finishEnter(el, false);\n              callHook$1(onEnterCancelled, [el]);\n          },\n          onAppearCancelled(el) {\n              finishEnter(el, true);\n              callHook$1(onAppearCancelled, [el]);\n          },\n          onLeaveCancelled(el) {\n              finishLeave(el);\n              callHook$1(onLeaveCancelled, [el]);\n          }\n      });\n  }\n  function normalizeDuration(duration) {\n      if (duration == null) {\n          return null;\n      }\n      else if (isObject(duration)) {\n          return [NumberOf(duration.enter), NumberOf(duration.leave)];\n      }\n      else {\n          const n = NumberOf(duration);\n          return [n, n];\n      }\n  }\n  function NumberOf(val) {\n      const res = toNumber(val);\n      validateDuration(res);\n      return res;\n  }\n  function validateDuration(val) {\n      if (typeof val !== 'number') {\n          warn$1(`<transition> explicit duration is not a valid number - ` +\n              `got ${JSON.stringify(val)}.`);\n      }\n      else if (isNaN(val)) {\n          warn$1(`<transition> explicit duration is NaN - ` +\n              'the duration expression might be incorrect.');\n      }\n  }\n  function addTransitionClass(el, cls) {\n      cls.split(/\\s+/).forEach(c => c && el.classList.add(c));\n      (el._vtc ||\n          (el._vtc = new Set())).add(cls);\n  }\n  function removeTransitionClass(el, cls) {\n      cls.split(/\\s+/).forEach(c => c && el.classList.remove(c));\n      const { _vtc } = el;\n      if (_vtc) {\n          _vtc.delete(cls);\n          if (!_vtc.size) {\n              el._vtc = undefined;\n          }\n      }\n  }\n  function nextFrame(cb) {\n      requestAnimationFrame(() => {\n          requestAnimationFrame(cb);\n      });\n  }\n  let endId = 0;\n  function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {\n      const id = (el._endId = ++endId);\n      const resolveIfNotStale = () => {\n          if (id === el._endId) {\n              resolve();\n          }\n      };\n      if (explicitTimeout) {\n          return setTimeout(resolveIfNotStale, explicitTimeout);\n      }\n      const { type, timeout, propCount } = getTransitionInfo(el, expectedType);\n      if (!type) {\n          return resolve();\n      }\n      const endEvent = type + 'end';\n      let ended = 0;\n      const end = () => {\n          el.removeEventListener(endEvent, onEnd);\n          resolveIfNotStale();\n      };\n      const onEnd = (e) => {\n          if (e.target === el && ++ended >= propCount) {\n              end();\n          }\n      };\n      setTimeout(() => {\n          if (ended < propCount) {\n              end();\n          }\n      }, timeout + 1);\n      el.addEventListener(endEvent, onEnd);\n  }\n  function getTransitionInfo(el, expectedType) {\n      const styles = window.getComputedStyle(el);\n      // JSDOM may return undefined for transition properties\n      const getStyleProperties = (key) => (styles[key] || '').split(', ');\n      const transitionDelays = getStyleProperties(TRANSITION + 'Delay');\n      const transitionDurations = getStyleProperties(TRANSITION + 'Duration');\n      const transitionTimeout = getTimeout(transitionDelays, transitionDurations);\n      const animationDelays = getStyleProperties(ANIMATION + 'Delay');\n      const animationDurations = getStyleProperties(ANIMATION + 'Duration');\n      const animationTimeout = getTimeout(animationDelays, animationDurations);\n      let type = null;\n      let timeout = 0;\n      let propCount = 0;\n      /* istanbul ignore if */\n      if (expectedType === TRANSITION) {\n          if (transitionTimeout > 0) {\n              type = TRANSITION;\n              timeout = transitionTimeout;\n              propCount = transitionDurations.length;\n          }\n      }\n      else if (expectedType === ANIMATION) {\n          if (animationTimeout > 0) {\n              type = ANIMATION;\n              timeout = animationTimeout;\n              propCount = animationDurations.length;\n          }\n      }\n      else {\n          timeout = Math.max(transitionTimeout, animationTimeout);\n          type =\n              timeout > 0\n                  ? transitionTimeout > animationTimeout\n                      ? TRANSITION\n                      : ANIMATION\n                  : null;\n          propCount = type\n              ? type === TRANSITION\n                  ? transitionDurations.length\n                  : animationDurations.length\n              : 0;\n      }\n      const hasTransform = type === TRANSITION &&\n          /\\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);\n      return {\n          type,\n          timeout,\n          propCount,\n          hasTransform\n      };\n  }\n  function getTimeout(delays, durations) {\n      while (delays.length < durations.length) {\n          delays = delays.concat(delays);\n      }\n      return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));\n  }\n  // Old versions of Chromium (below 61.0.3163.100) formats floating pointer\n  // numbers in a locale-dependent way, using a comma instead of a dot.\n  // If comma is not replaced with a dot, the input will be rounded down\n  // (i.e. acting as a floor function) causing unexpected behaviors\n  function toMs(s) {\n      return Number(s.slice(0, -1).replace(',', '.')) * 1000;\n  }\n  // synchronously force layout to put elements into a certain state\n  function forceReflow() {\n      return document.body.offsetHeight;\n  }\n\n  const positionMap = new WeakMap();\n  const newPositionMap = new WeakMap();\n  const TransitionGroupImpl = {\n      name: 'TransitionGroup',\n      props: /*#__PURE__*/ extend({}, TransitionPropsValidators, {\n          tag: String,\n          moveClass: String\n      }),\n      setup(props, { slots }) {\n          const instance = getCurrentInstance();\n          const state = useTransitionState();\n          let prevChildren;\n          let children;\n          onUpdated(() => {\n              // children is guaranteed to exist after initial render\n              if (!prevChildren.length) {\n                  return;\n              }\n              const moveClass = props.moveClass || `${props.name || 'v'}-move`;\n              if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {\n                  return;\n              }\n              // we divide the work into three loops to avoid mixing DOM reads and writes\n              // in each iteration - which helps prevent layout thrashing.\n              prevChildren.forEach(callPendingCbs);\n              prevChildren.forEach(recordPosition);\n              const movedChildren = prevChildren.filter(applyTranslation);\n              // force reflow to put everything in position\n              forceReflow();\n              movedChildren.forEach(c => {\n                  const el = c.el;\n                  const style = el.style;\n                  addTransitionClass(el, moveClass);\n                  style.transform = style.webkitTransform = style.transitionDuration = '';\n                  const cb = (el._moveCb = (e) => {\n                      if (e && e.target !== el) {\n                          return;\n                      }\n                      if (!e || /transform$/.test(e.propertyName)) {\n                          el.removeEventListener('transitionend', cb);\n                          el._moveCb = null;\n                          removeTransitionClass(el, moveClass);\n                      }\n                  });\n                  el.addEventListener('transitionend', cb);\n              });\n          });\n          return () => {\n              const rawProps = toRaw(props);\n              const cssTransitionProps = resolveTransitionProps(rawProps);\n              let tag = rawProps.tag || Fragment;\n              prevChildren = children;\n              children = slots.default ? getTransitionRawChildren(slots.default()) : [];\n              for (let i = 0; i < children.length; i++) {\n                  const child = children[i];\n                  if (child.key != null) {\n                      setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\n                  }\n                  else {\n                      warn$1(`<TransitionGroup> children must be keyed.`);\n                  }\n              }\n              if (prevChildren) {\n                  for (let i = 0; i < prevChildren.length; i++) {\n                      const child = prevChildren[i];\n                      setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\n                      positionMap.set(child, child.el.getBoundingClientRect());\n                  }\n              }\n              return createVNode(tag, null, children);\n          };\n      }\n  };\n  const TransitionGroup = TransitionGroupImpl;\n  function callPendingCbs(c) {\n      const el = c.el;\n      if (el._moveCb) {\n          el._moveCb();\n      }\n      if (el._enterCb) {\n          el._enterCb();\n      }\n  }\n  function recordPosition(c) {\n      newPositionMap.set(c, c.el.getBoundingClientRect());\n  }\n  function applyTranslation(c) {\n      const oldPos = positionMap.get(c);\n      const newPos = newPositionMap.get(c);\n      const dx = oldPos.left - newPos.left;\n      const dy = oldPos.top - newPos.top;\n      if (dx || dy) {\n          const s = c.el.style;\n          s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;\n          s.transitionDuration = '0s';\n          return c;\n      }\n  }\n  function hasCSSTransform(el, root, moveClass) {\n      // Detect whether an element with the move class applied has\n      // CSS transitions. Since the element may be inside an entering\n      // transition at this very moment, we make a clone of it and remove\n      // all other transition classes applied to ensure only the move class\n      // is applied.\n      const clone = el.cloneNode();\n      if (el._vtc) {\n          el._vtc.forEach(cls => {\n              cls.split(/\\s+/).forEach(c => c && clone.classList.remove(c));\n          });\n      }\n      moveClass.split(/\\s+/).forEach(c => c && clone.classList.add(c));\n      clone.style.display = 'none';\n      const container = (root.nodeType === 1 ? root : root.parentNode);\n      container.appendChild(clone);\n      const { hasTransform } = getTransitionInfo(clone);\n      container.removeChild(clone);\n      return hasTransform;\n  }\n\n  const getModelAssigner = (vnode) => {\n      const fn = vnode.props['onUpdate:modelValue'];\n      return isArray(fn) ? value => invokeArrayFns(fn, value) : fn;\n  };\n  function onCompositionStart(e) {\n      e.target.composing = true;\n  }\n  function onCompositionEnd(e) {\n      const target = e.target;\n      if (target.composing) {\n          target.composing = false;\n          trigger$1(target, 'input');\n      }\n  }\n  function trigger$1(el, type) {\n      const e = document.createEvent('HTMLEvents');\n      e.initEvent(type, true, true);\n      el.dispatchEvent(e);\n  }\n  // We are exporting the v-model runtime directly as vnode hooks so that it can\n  // be tree-shaken in case v-model is never used.\n  const vModelText = {\n      created(el, { modifiers: { lazy, trim, number } }, vnode) {\n          el._assign = getModelAssigner(vnode);\n          const castToNumber = number || (vnode.props && vnode.props.type === 'number');\n          addEventListener(el, lazy ? 'change' : 'input', e => {\n              if (e.target.composing)\n                  return;\n              let domValue = el.value;\n              if (trim) {\n                  domValue = domValue.trim();\n              }\n              else if (castToNumber) {\n                  domValue = toNumber(domValue);\n              }\n              el._assign(domValue);\n          });\n          if (trim) {\n              addEventListener(el, 'change', () => {\n                  el.value = el.value.trim();\n              });\n          }\n          if (!lazy) {\n              addEventListener(el, 'compositionstart', onCompositionStart);\n              addEventListener(el, 'compositionend', onCompositionEnd);\n              // Safari < 10.2 & UIWebView doesn't fire compositionend when\n              // switching focus before confirming composition choice\n              // this also fixes the issue where some browsers e.g. iOS Chrome\n              // fires \"change\" instead of \"input\" on autocomplete.\n              addEventListener(el, 'change', onCompositionEnd);\n          }\n      },\n      // set value on mounted so it's after min/max for type=\"range\"\n      mounted(el, { value }) {\n          el.value = value == null ? '' : value;\n      },\n      beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {\n          el._assign = getModelAssigner(vnode);\n          // avoid clearing unresolved text. #2302\n          if (el.composing)\n              return;\n          if (document.activeElement === el) {\n              if (lazy) {\n                  return;\n              }\n              if (trim && el.value.trim() === value) {\n                  return;\n              }\n              if ((number || el.type === 'number') && toNumber(el.value) === value) {\n                  return;\n              }\n          }\n          const newValue = value == null ? '' : value;\n          if (el.value !== newValue) {\n              el.value = newValue;\n          }\n      }\n  };\n  const vModelCheckbox = {\n      // #4096 array checkboxes need to be deep traversed\n      deep: true,\n      created(el, _, vnode) {\n          el._assign = getModelAssigner(vnode);\n          addEventListener(el, 'change', () => {\n              const modelValue = el._modelValue;\n              const elementValue = getValue(el);\n              const checked = el.checked;\n              const assign = el._assign;\n              if (isArray(modelValue)) {\n                  const index = looseIndexOf(modelValue, elementValue);\n                  const found = index !== -1;\n                  if (checked && !found) {\n                      assign(modelValue.concat(elementValue));\n                  }\n                  else if (!checked && found) {\n                      const filtered = [...modelValue];\n                      filtered.splice(index, 1);\n                      assign(filtered);\n                  }\n              }\n              else if (isSet(modelValue)) {\n                  const cloned = new Set(modelValue);\n                  if (checked) {\n                      cloned.add(elementValue);\n                  }\n                  else {\n                      cloned.delete(elementValue);\n                  }\n                  assign(cloned);\n              }\n              else {\n                  assign(getCheckboxValue(el, checked));\n              }\n          });\n      },\n      // set initial checked on mount to wait for true-value/false-value\n      mounted: setChecked,\n      beforeUpdate(el, binding, vnode) {\n          el._assign = getModelAssigner(vnode);\n          setChecked(el, binding, vnode);\n      }\n  };\n  function setChecked(el, { value, oldValue }, vnode) {\n      el._modelValue = value;\n      if (isArray(value)) {\n          el.checked = looseIndexOf(value, vnode.props.value) > -1;\n      }\n      else if (isSet(value)) {\n          el.checked = value.has(vnode.props.value);\n      }\n      else if (value !== oldValue) {\n          el.checked = looseEqual(value, getCheckboxValue(el, true));\n      }\n  }\n  const vModelRadio = {\n      created(el, { value }, vnode) {\n          el.checked = looseEqual(value, vnode.props.value);\n          el._assign = getModelAssigner(vnode);\n          addEventListener(el, 'change', () => {\n              el._assign(getValue(el));\n          });\n      },\n      beforeUpdate(el, { value, oldValue }, vnode) {\n          el._assign = getModelAssigner(vnode);\n          if (value !== oldValue) {\n              el.checked = looseEqual(value, vnode.props.value);\n          }\n      }\n  };\n  const vModelSelect = {\n      // <select multiple> value need to be deep traversed\n      deep: true,\n      created(el, { value, modifiers: { number } }, vnode) {\n          const isSetModel = isSet(value);\n          addEventListener(el, 'change', () => {\n              const selectedVal = Array.prototype.filter\n                  .call(el.options, (o) => o.selected)\n                  .map((o) => number ? toNumber(getValue(o)) : getValue(o));\n              el._assign(el.multiple\n                  ? isSetModel\n                      ? new Set(selectedVal)\n                      : selectedVal\n                  : selectedVal[0]);\n          });\n          el._assign = getModelAssigner(vnode);\n      },\n      // set value in mounted & updated because <select> relies on its children\n      // <option>s.\n      mounted(el, { value }) {\n          setSelected(el, value);\n      },\n      beforeUpdate(el, _binding, vnode) {\n          el._assign = getModelAssigner(vnode);\n      },\n      updated(el, { value }) {\n          setSelected(el, value);\n      }\n  };\n  function setSelected(el, value) {\n      const isMultiple = el.multiple;\n      if (isMultiple && !isArray(value) && !isSet(value)) {\n          warn$1(`<select multiple v-model> expects an Array or Set value for its binding, ` +\n                  `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);\n          return;\n      }\n      for (let i = 0, l = el.options.length; i < l; i++) {\n          const option = el.options[i];\n          const optionValue = getValue(option);\n          if (isMultiple) {\n              if (isArray(value)) {\n                  option.selected = looseIndexOf(value, optionValue) > -1;\n              }\n              else {\n                  option.selected = value.has(optionValue);\n              }\n          }\n          else {\n              if (looseEqual(getValue(option), value)) {\n                  if (el.selectedIndex !== i)\n                      el.selectedIndex = i;\n                  return;\n              }\n          }\n      }\n      if (!isMultiple && el.selectedIndex !== -1) {\n          el.selectedIndex = -1;\n      }\n  }\n  // retrieve raw value set via :value bindings\n  function getValue(el) {\n      return '_value' in el ? el._value : el.value;\n  }\n  // retrieve raw value for true-value and false-value set via :true-value or :false-value bindings\n  function getCheckboxValue(el, checked) {\n      const key = checked ? '_trueValue' : '_falseValue';\n      return key in el ? el[key] : checked;\n  }\n  const vModelDynamic = {\n      created(el, binding, vnode) {\n          callModelHook(el, binding, vnode, null, 'created');\n      },\n      mounted(el, binding, vnode) {\n          callModelHook(el, binding, vnode, null, 'mounted');\n      },\n      beforeUpdate(el, binding, vnode, prevVNode) {\n          callModelHook(el, binding, vnode, prevVNode, 'beforeUpdate');\n      },\n      updated(el, binding, vnode, prevVNode) {\n          callModelHook(el, binding, vnode, prevVNode, 'updated');\n      }\n  };\n  function callModelHook(el, binding, vnode, prevVNode, hook) {\n      let modelToUse;\n      switch (el.tagName) {\n          case 'SELECT':\n              modelToUse = vModelSelect;\n              break;\n          case 'TEXTAREA':\n              modelToUse = vModelText;\n              break;\n          default:\n              switch (vnode.props && vnode.props.type) {\n                  case 'checkbox':\n                      modelToUse = vModelCheckbox;\n                      break;\n                  case 'radio':\n                      modelToUse = vModelRadio;\n                      break;\n                  default:\n                      modelToUse = vModelText;\n              }\n      }\n      const fn = modelToUse[hook];\n      fn && fn(el, binding, vnode, prevVNode);\n  }\n\n  const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];\n  const modifierGuards = {\n      stop: e => e.stopPropagation(),\n      prevent: e => e.preventDefault(),\n      self: e => e.target !== e.currentTarget,\n      ctrl: e => !e.ctrlKey,\n      shift: e => !e.shiftKey,\n      alt: e => !e.altKey,\n      meta: e => !e.metaKey,\n      left: e => 'button' in e && e.button !== 0,\n      middle: e => 'button' in e && e.button !== 1,\n      right: e => 'button' in e && e.button !== 2,\n      exact: (e, modifiers) => systemModifiers.some(m => e[`${m}Key`] && !modifiers.includes(m))\n  };\n  /**\n   * @private\n   */\n  const withModifiers = (fn, modifiers) => {\n      return (event, ...args) => {\n          for (let i = 0; i < modifiers.length; i++) {\n              const guard = modifierGuards[modifiers[i]];\n              if (guard && guard(event, modifiers))\n                  return;\n          }\n          return fn(event, ...args);\n      };\n  };\n  // Kept for 2.x compat.\n  // Note: IE11 compat for `spacebar` and `del` is removed for now.\n  const keyNames = {\n      esc: 'escape',\n      space: ' ',\n      up: 'arrow-up',\n      left: 'arrow-left',\n      right: 'arrow-right',\n      down: 'arrow-down',\n      delete: 'backspace'\n  };\n  /**\n   * @private\n   */\n  const withKeys = (fn, modifiers) => {\n      return (event) => {\n          if (!('key' in event)) {\n              return;\n          }\n          const eventKey = hyphenate(event.key);\n          if (modifiers.some(k => k === eventKey || keyNames[k] === eventKey)) {\n              return fn(event);\n          }\n      };\n  };\n\n  const vShow = {\n      beforeMount(el, { value }, { transition }) {\n          el._vod = el.style.display === 'none' ? '' : el.style.display;\n          if (transition && value) {\n              transition.beforeEnter(el);\n          }\n          else {\n              setDisplay(el, value);\n          }\n      },\n      mounted(el, { value }, { transition }) {\n          if (transition && value) {\n              transition.enter(el);\n          }\n      },\n      updated(el, { value, oldValue }, { transition }) {\n          if (!value === !oldValue)\n              return;\n          if (transition) {\n              if (value) {\n                  transition.beforeEnter(el);\n                  setDisplay(el, true);\n                  transition.enter(el);\n              }\n              else {\n                  transition.leave(el, () => {\n                      setDisplay(el, false);\n                  });\n              }\n          }\n          else {\n              setDisplay(el, value);\n          }\n      },\n      beforeUnmount(el, { value }) {\n          setDisplay(el, value);\n      }\n  };\n  function setDisplay(el, value) {\n      el.style.display = value ? el._vod : 'none';\n  }\n\n  const rendererOptions = extend({ patchProp }, nodeOps);\n  // lazy create the renderer - this makes core renderer logic tree-shakable\n  // in case the user only imports reactivity utilities from Vue.\n  let renderer;\n  let enabledHydration = false;\n  function ensureRenderer() {\n      return (renderer ||\n          (renderer = createRenderer(rendererOptions)));\n  }\n  function ensureHydrationRenderer() {\n      renderer = enabledHydration\n          ? renderer\n          : createHydrationRenderer(rendererOptions);\n      enabledHydration = true;\n      return renderer;\n  }\n  // use explicit type casts here to avoid import() calls in rolled-up d.ts\n  const render = ((...args) => {\n      ensureRenderer().render(...args);\n  });\n  const hydrate = ((...args) => {\n      ensureHydrationRenderer().hydrate(...args);\n  });\n  const createApp = ((...args) => {\n      const app = ensureRenderer().createApp(...args);\n      {\n          injectNativeTagCheck(app);\n          injectCompilerOptionsCheck(app);\n      }\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              // __UNSAFE__\n              // Reason: potential execution of JS expressions in in-DOM template.\n              // The user must make sure the in-DOM template is trusted. If it's\n              // rendered by the server, the template should not contain any user data.\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  });\n  const createSSRApp = ((...args) => {\n      const app = ensureHydrationRenderer().createApp(...args);\n      {\n          injectNativeTagCheck(app);\n          injectCompilerOptionsCheck(app);\n      }\n      const { mount } = app;\n      app.mount = (containerOrSelector) => {\n          const container = normalizeContainer(containerOrSelector);\n          if (container) {\n              return mount(container, true, container instanceof SVGElement);\n          }\n      };\n      return app;\n  });\n  function injectNativeTagCheck(app) {\n      // Inject `isNativeTag`\n      // this is used for component name validation (dev only)\n      Object.defineProperty(app.config, 'isNativeTag', {\n          value: (tag) => isHTMLTag(tag) || isSVGTag(tag),\n          writable: false\n      });\n  }\n  // dev only\n  function injectCompilerOptionsCheck(app) {\n      if (isRuntimeOnly()) {\n          const isCustomElement = app.config.isCustomElement;\n          Object.defineProperty(app.config, 'isCustomElement', {\n              get() {\n                  return isCustomElement;\n              },\n              set() {\n                  warn$1(`The \\`isCustomElement\\` config option is deprecated. Use ` +\n                      `\\`compilerOptions.isCustomElement\\` instead.`);\n              }\n          });\n          const compilerOptions = app.config.compilerOptions;\n          const msg = `The \\`compilerOptions\\` config option is only respected when using ` +\n              `a build of Vue.js that includes the runtime compiler (aka \"full build\"). ` +\n              `Since you are using the runtime-only build, \\`compilerOptions\\` ` +\n              `must be passed to \\`@vue/compiler-dom\\` in the build setup instead.\\n` +\n              `- For vue-loader: pass it via vue-loader's \\`compilerOptions\\` loader option.\\n` +\n              `- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\\n` +\n              `- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;\n          Object.defineProperty(app.config, 'compilerOptions', {\n              get() {\n                  warn$1(msg);\n                  return compilerOptions;\n              },\n              set() {\n                  warn$1(msg);\n              }\n          });\n      }\n  }\n  function normalizeContainer(container) {\n      if (isString(container)) {\n          const res = document.querySelector(container);\n          if (!res) {\n              warn$1(`Failed to mount app: mount target selector \"${container}\" returned null.`);\n          }\n          return res;\n      }\n      if (window.ShadowRoot &&\n          container instanceof window.ShadowRoot &&\n          container.mode === 'closed') {\n          warn$1(`mounting on a ShadowRoot with \\`{mode: \"closed\"}\\` may lead to unpredictable bugs`);\n      }\n      return container;\n  }\n\n  function initDev() {\n      {\n          {\n              console.info(`You are running a development build of Vue.\\n` +\n                  `Make sure to use the production build (*.prod.js) when deploying for production.`);\n          }\n          initCustomFormatter();\n      }\n  }\n\n  function defaultOnError(error) {\n      throw error;\n  }\n  function defaultOnWarn(msg) {\n      console.warn(`[Vue warn] ${msg.message}`);\n  }\n  function createCompilerError(code, loc, messages, additionalMessage) {\n      const msg = (messages || errorMessages)[code] + (additionalMessage || ``)\n          ;\n      const error = new SyntaxError(String(msg));\n      error.code = code;\n      error.loc = loc;\n      return error;\n  }\n  const errorMessages = {\n      // parse errors\n      [0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */]: 'Illegal comment.',\n      [1 /* CDATA_IN_HTML_CONTENT */]: 'CDATA section is allowed only in XML context.',\n      [2 /* DUPLICATE_ATTRIBUTE */]: 'Duplicate attribute.',\n      [3 /* END_TAG_WITH_ATTRIBUTES */]: 'End tag cannot have attributes.',\n      [4 /* END_TAG_WITH_TRAILING_SOLIDUS */]: \"Illegal '/' in tags.\",\n      [5 /* EOF_BEFORE_TAG_NAME */]: 'Unexpected EOF in tag.',\n      [6 /* EOF_IN_CDATA */]: 'Unexpected EOF in CDATA section.',\n      [7 /* EOF_IN_COMMENT */]: 'Unexpected EOF in comment.',\n      [8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */]: 'Unexpected EOF in script.',\n      [9 /* EOF_IN_TAG */]: 'Unexpected EOF in tag.',\n      [10 /* INCORRECTLY_CLOSED_COMMENT */]: 'Incorrectly closed comment.',\n      [11 /* INCORRECTLY_OPENED_COMMENT */]: 'Incorrectly opened comment.',\n      [12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */]: \"Illegal tag name. Use '&lt;' to print '<'.\",\n      [13 /* MISSING_ATTRIBUTE_VALUE */]: 'Attribute value was expected.',\n      [14 /* MISSING_END_TAG_NAME */]: 'End tag name was expected.',\n      [15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */]: 'Whitespace was expected.',\n      [16 /* NESTED_COMMENT */]: \"Unexpected '<!--' in comment.\",\n      [17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */]: 'Attribute name cannot contain U+0022 (\"), U+0027 (\\'), and U+003C (<).',\n      [18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */]: 'Unquoted attribute value cannot contain U+0022 (\"), U+0027 (\\'), U+003C (<), U+003D (=), and U+0060 (`).',\n      [19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */]: \"Attribute name cannot start with '='.\",\n      [21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */]: \"'<?' is allowed only in XML context.\",\n      [20 /* UNEXPECTED_NULL_CHARACTER */]: `Unexpected null cahracter.`,\n      [22 /* UNEXPECTED_SOLIDUS_IN_TAG */]: \"Illegal '/' in tags.\",\n      // Vue-specific parse errors\n      [23 /* X_INVALID_END_TAG */]: 'Invalid end tag.',\n      [24 /* X_MISSING_END_TAG */]: 'Element is missing end tag.',\n      [25 /* X_MISSING_INTERPOLATION_END */]: 'Interpolation end sign was not found.',\n      [26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */]: 'End bracket for dynamic directive argument was not found. ' +\n          'Note that dynamic directive argument cannot contain spaces.',\n      // transform errors\n      [27 /* X_V_IF_NO_EXPRESSION */]: `v-if/v-else-if is missing expression.`,\n      [28 /* X_V_IF_SAME_KEY */]: `v-if/else branches must use unique keys.`,\n      [29 /* X_V_ELSE_NO_ADJACENT_IF */]: `v-else/v-else-if has no adjacent v-if.`,\n      [30 /* X_V_FOR_NO_EXPRESSION */]: `v-for is missing expression.`,\n      [31 /* X_V_FOR_MALFORMED_EXPRESSION */]: `v-for has invalid expression.`,\n      [32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */]: `<template v-for> key should be placed on the <template> tag.`,\n      [33 /* X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,\n      [34 /* X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,\n      [35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,\n      [36 /* X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>.` +\n          `When there are multiple named slots, all slots should use <template> ` +\n          `syntax to avoid scope ambiguity.`,\n      [37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,\n      [38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */]: `Extraneous children found when component already has explicitly named ` +\n          `default slot. These children will be ignored.`,\n      [39 /* X_V_SLOT_MISPLACED */]: `v-slot can only be used on components or <template> tags.`,\n      [40 /* X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,\n      [41 /* X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,\n      [42 /* X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,\n      [43 /* X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,\n      [44 /* X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,\n      // generic errors\n      [45 /* X_PREFIX_ID_NOT_SUPPORTED */]: `\"prefixIdentifiers\" option is not supported in this build of compiler.`,\n      [46 /* X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,\n      [47 /* X_CACHE_HANDLER_NOT_SUPPORTED */]: `\"cacheHandlers\" option is only supported when the \"prefixIdentifiers\" option is enabled.`,\n      [48 /* X_SCOPE_ID_NOT_SUPPORTED */]: `\"scopeId\" option is only supported in module mode.`,\n      // just to fullfill types\n      [49 /* __EXTEND_POINT__ */]: ``\n  };\n\n  const FRAGMENT = Symbol(`Fragment` );\n  const TELEPORT = Symbol(`Teleport` );\n  const SUSPENSE = Symbol(`Suspense` );\n  const KEEP_ALIVE = Symbol(`KeepAlive` );\n  const BASE_TRANSITION = Symbol(`BaseTransition` );\n  const OPEN_BLOCK = Symbol(`openBlock` );\n  const CREATE_BLOCK = Symbol(`createBlock` );\n  const CREATE_ELEMENT_BLOCK = Symbol(`createElementBlock` );\n  const CREATE_VNODE = Symbol(`createVNode` );\n  const CREATE_ELEMENT_VNODE = Symbol(`createElementVNode` );\n  const CREATE_COMMENT = Symbol(`createCommentVNode` );\n  const CREATE_TEXT = Symbol(`createTextVNode` );\n  const CREATE_STATIC = Symbol(`createStaticVNode` );\n  const RESOLVE_COMPONENT = Symbol(`resolveComponent` );\n  const RESOLVE_DYNAMIC_COMPONENT = Symbol(`resolveDynamicComponent` );\n  const RESOLVE_DIRECTIVE = Symbol(`resolveDirective` );\n  const RESOLVE_FILTER = Symbol(`resolveFilter` );\n  const WITH_DIRECTIVES = Symbol(`withDirectives` );\n  const RENDER_LIST = Symbol(`renderList` );\n  const RENDER_SLOT = Symbol(`renderSlot` );\n  const CREATE_SLOTS = Symbol(`createSlots` );\n  const TO_DISPLAY_STRING = Symbol(`toDisplayString` );\n  const MERGE_PROPS = Symbol(`mergeProps` );\n  const NORMALIZE_CLASS = Symbol(`normalizeClass` );\n  const NORMALIZE_STYLE = Symbol(`normalizeStyle` );\n  const NORMALIZE_PROPS = Symbol(`normalizeProps` );\n  const GUARD_REACTIVE_PROPS = Symbol(`guardReactiveProps` );\n  const TO_HANDLERS = Symbol(`toHandlers` );\n  const CAMELIZE = Symbol(`camelize` );\n  const CAPITALIZE = Symbol(`capitalize` );\n  const TO_HANDLER_KEY = Symbol(`toHandlerKey` );\n  const SET_BLOCK_TRACKING = Symbol(`setBlockTracking` );\n  const PUSH_SCOPE_ID = Symbol(`pushScopeId` );\n  const POP_SCOPE_ID = Symbol(`popScopeId` );\n  const WITH_SCOPE_ID = Symbol(`withScopeId` );\n  const WITH_CTX = Symbol(`withCtx` );\n  const UNREF = Symbol(`unref` );\n  const IS_REF = Symbol(`isRef` );\n  const WITH_MEMO = Symbol(`withMemo` );\n  const IS_MEMO_SAME = Symbol(`isMemoSame` );\n  // Name mapping for runtime helpers that need to be imported from 'vue' in\n  // generated code. Make sure these are correctly exported in the runtime!\n  // Using `any` here because TS doesn't allow symbols as index type.\n  const helperNameMap = {\n      [FRAGMENT]: `Fragment`,\n      [TELEPORT]: `Teleport`,\n      [SUSPENSE]: `Suspense`,\n      [KEEP_ALIVE]: `KeepAlive`,\n      [BASE_TRANSITION]: `BaseTransition`,\n      [OPEN_BLOCK]: `openBlock`,\n      [CREATE_BLOCK]: `createBlock`,\n      [CREATE_ELEMENT_BLOCK]: `createElementBlock`,\n      [CREATE_VNODE]: `createVNode`,\n      [CREATE_ELEMENT_VNODE]: `createElementVNode`,\n      [CREATE_COMMENT]: `createCommentVNode`,\n      [CREATE_TEXT]: `createTextVNode`,\n      [CREATE_STATIC]: `createStaticVNode`,\n      [RESOLVE_COMPONENT]: `resolveComponent`,\n      [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,\n      [RESOLVE_DIRECTIVE]: `resolveDirective`,\n      [RESOLVE_FILTER]: `resolveFilter`,\n      [WITH_DIRECTIVES]: `withDirectives`,\n      [RENDER_LIST]: `renderList`,\n      [RENDER_SLOT]: `renderSlot`,\n      [CREATE_SLOTS]: `createSlots`,\n      [TO_DISPLAY_STRING]: `toDisplayString`,\n      [MERGE_PROPS]: `mergeProps`,\n      [NORMALIZE_CLASS]: `normalizeClass`,\n      [NORMALIZE_STYLE]: `normalizeStyle`,\n      [NORMALIZE_PROPS]: `normalizeProps`,\n      [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,\n      [TO_HANDLERS]: `toHandlers`,\n      [CAMELIZE]: `camelize`,\n      [CAPITALIZE]: `capitalize`,\n      [TO_HANDLER_KEY]: `toHandlerKey`,\n      [SET_BLOCK_TRACKING]: `setBlockTracking`,\n      [PUSH_SCOPE_ID]: `pushScopeId`,\n      [POP_SCOPE_ID]: `popScopeId`,\n      [WITH_SCOPE_ID]: `withScopeId`,\n      [WITH_CTX]: `withCtx`,\n      [UNREF]: `unref`,\n      [IS_REF]: `isRef`,\n      [WITH_MEMO]: `withMemo`,\n      [IS_MEMO_SAME]: `isMemoSame`\n  };\n  function registerRuntimeHelpers(helpers) {\n      Object.getOwnPropertySymbols(helpers).forEach(s => {\n          helperNameMap[s] = helpers[s];\n      });\n  }\n\n  // AST Utilities ---------------------------------------------------------------\n  // Some expressions, e.g. sequence and conditional expressions, are never\n  // associated with template nodes, so their source locations are just a stub.\n  // Container types like CompoundExpression also don't need a real location.\n  const locStub = {\n      source: '',\n      start: { line: 1, column: 1, offset: 0 },\n      end: { line: 1, column: 1, offset: 0 }\n  };\n  function createRoot(children, loc = locStub) {\n      return {\n          type: 0 /* ROOT */,\n          children,\n          helpers: [],\n          components: [],\n          directives: [],\n          hoists: [],\n          imports: [],\n          cached: 0,\n          temps: 0,\n          codegenNode: undefined,\n          loc\n      };\n  }\n  function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {\n      if (context) {\n          if (isBlock) {\n              context.helper(OPEN_BLOCK);\n              context.helper(getVNodeBlockHelper(context.inSSR, isComponent));\n          }\n          else {\n              context.helper(getVNodeHelper(context.inSSR, isComponent));\n          }\n          if (directives) {\n              context.helper(WITH_DIRECTIVES);\n          }\n      }\n      return {\n          type: 13 /* VNODE_CALL */,\n          tag,\n          props,\n          children,\n          patchFlag,\n          dynamicProps,\n          directives,\n          isBlock,\n          disableTracking,\n          isComponent,\n          loc\n      };\n  }\n  function createArrayExpression(elements, loc = locStub) {\n      return {\n          type: 17 /* JS_ARRAY_EXPRESSION */,\n          loc,\n          elements\n      };\n  }\n  function createObjectExpression(properties, loc = locStub) {\n      return {\n          type: 15 /* JS_OBJECT_EXPRESSION */,\n          loc,\n          properties\n      };\n  }\n  function createObjectProperty(key, value) {\n      return {\n          type: 16 /* JS_PROPERTY */,\n          loc: locStub,\n          key: isString(key) ? createSimpleExpression(key, true) : key,\n          value\n      };\n  }\n  function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0 /* NOT_CONSTANT */) {\n      return {\n          type: 4 /* SIMPLE_EXPRESSION */,\n          loc,\n          content,\n          isStatic,\n          constType: isStatic ? 3 /* CAN_STRINGIFY */ : constType\n      };\n  }\n  function createCompoundExpression(children, loc = locStub) {\n      return {\n          type: 8 /* COMPOUND_EXPRESSION */,\n          loc,\n          children\n      };\n  }\n  function createCallExpression(callee, args = [], loc = locStub) {\n      return {\n          type: 14 /* JS_CALL_EXPRESSION */,\n          loc,\n          callee,\n          arguments: args\n      };\n  }\n  function createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {\n      return {\n          type: 18 /* JS_FUNCTION_EXPRESSION */,\n          params,\n          returns,\n          newline,\n          isSlot,\n          loc\n      };\n  }\n  function createConditionalExpression(test, consequent, alternate, newline = true) {\n      return {\n          type: 19 /* JS_CONDITIONAL_EXPRESSION */,\n          test,\n          consequent,\n          alternate,\n          newline,\n          loc: locStub\n      };\n  }\n  function createCacheExpression(index, value, isVNode = false) {\n      return {\n          type: 20 /* JS_CACHE_EXPRESSION */,\n          index,\n          value,\n          isVNode,\n          loc: locStub\n      };\n  }\n  function createBlockStatement(body) {\n      return {\n          type: 21 /* JS_BLOCK_STATEMENT */,\n          body,\n          loc: locStub\n      };\n  }\n\n  const isStaticExp = (p) => p.type === 4 /* SIMPLE_EXPRESSION */ && p.isStatic;\n  const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);\n  function isCoreComponent(tag) {\n      if (isBuiltInType(tag, 'Teleport')) {\n          return TELEPORT;\n      }\n      else if (isBuiltInType(tag, 'Suspense')) {\n          return SUSPENSE;\n      }\n      else if (isBuiltInType(tag, 'KeepAlive')) {\n          return KEEP_ALIVE;\n      }\n      else if (isBuiltInType(tag, 'BaseTransition')) {\n          return BASE_TRANSITION;\n      }\n  }\n  const nonIdentifierRE = /^\\d|[^\\$\\w]/;\n  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);\n  const validFirstIdentCharRE = /[A-Za-z_$\\xA0-\\uFFFF]/;\n  const validIdentCharRE = /[\\.\\?\\w$\\xA0-\\uFFFF]/;\n  const whitespaceRE = /\\s+[.[]\\s*|\\s*[.[]\\s+/g;\n  /**\n   * Simple lexer to check if an expression is a member expression. This is\n   * lax and only checks validity at the root level (i.e. does not validate exps\n   * inside square brackets), but it's ok since these are only used on template\n   * expressions and false positives are invalid expressions in the first place.\n   */\n  const isMemberExpression = (path) => {\n      // remove whitespaces around . or [ first\n      path = path.trim().replace(whitespaceRE, s => s.trim());\n      let state = 0 /* inMemberExp */;\n      let stateStack = [];\n      let currentOpenBracketCount = 0;\n      let currentOpenParensCount = 0;\n      let currentStringType = null;\n      for (let i = 0; i < path.length; i++) {\n          const char = path.charAt(i);\n          switch (state) {\n              case 0 /* inMemberExp */:\n                  if (char === '[') {\n                      stateStack.push(state);\n                      state = 1 /* inBrackets */;\n                      currentOpenBracketCount++;\n                  }\n                  else if (char === '(') {\n                      stateStack.push(state);\n                      state = 2 /* inParens */;\n                      currentOpenParensCount++;\n                  }\n                  else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {\n                      return false;\n                  }\n                  break;\n              case 1 /* inBrackets */:\n                  if (char === `'` || char === `\"` || char === '`') {\n                      stateStack.push(state);\n                      state = 3 /* inString */;\n                      currentStringType = char;\n                  }\n                  else if (char === `[`) {\n                      currentOpenBracketCount++;\n                  }\n                  else if (char === `]`) {\n                      if (!--currentOpenBracketCount) {\n                          state = stateStack.pop();\n                      }\n                  }\n                  break;\n              case 2 /* inParens */:\n                  if (char === `'` || char === `\"` || char === '`') {\n                      stateStack.push(state);\n                      state = 3 /* inString */;\n                      currentStringType = char;\n                  }\n                  else if (char === `(`) {\n                      currentOpenParensCount++;\n                  }\n                  else if (char === `)`) {\n                      // if the exp ends as a call then it should not be considered valid\n                      if (i === path.length - 1) {\n                          return false;\n                      }\n                      if (!--currentOpenParensCount) {\n                          state = stateStack.pop();\n                      }\n                  }\n                  break;\n              case 3 /* inString */:\n                  if (char === currentStringType) {\n                      state = stateStack.pop();\n                      currentStringType = null;\n                  }\n                  break;\n          }\n      }\n      return !currentOpenBracketCount && !currentOpenParensCount;\n  };\n  function getInnerRange(loc, offset, length) {\n      const source = loc.source.substr(offset, length);\n      const newLoc = {\n          source,\n          start: advancePositionWithClone(loc.start, loc.source, offset),\n          end: loc.end\n      };\n      if (length != null) {\n          newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);\n      }\n      return newLoc;\n  }\n  function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {\n      return advancePositionWithMutation(extend({}, pos), source, numberOfCharacters);\n  }\n  // advance by mutation without cloning (for performance reasons), since this\n  // gets called a lot in the parser\n  function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n      let linesCount = 0;\n      let lastNewLinePos = -1;\n      for (let i = 0; i < numberOfCharacters; i++) {\n          if (source.charCodeAt(i) === 10 /* newline char code */) {\n              linesCount++;\n              lastNewLinePos = i;\n          }\n      }\n      pos.offset += numberOfCharacters;\n      pos.line += linesCount;\n      pos.column =\n          lastNewLinePos === -1\n              ? pos.column + numberOfCharacters\n              : numberOfCharacters - lastNewLinePos;\n      return pos;\n  }\n  function assert(condition, msg) {\n      /* istanbul ignore if */\n      if (!condition) {\n          throw new Error(msg || `unexpected compiler condition`);\n      }\n  }\n  function findDir(node, name, allowEmpty = false) {\n      for (let i = 0; i < node.props.length; i++) {\n          const p = node.props[i];\n          if (p.type === 7 /* DIRECTIVE */ &&\n              (allowEmpty || p.exp) &&\n              (isString(name) ? p.name === name : name.test(p.name))) {\n              return p;\n          }\n      }\n  }\n  function findProp(node, name, dynamicOnly = false, allowEmpty = false) {\n      for (let i = 0; i < node.props.length; i++) {\n          const p = node.props[i];\n          if (p.type === 6 /* ATTRIBUTE */) {\n              if (dynamicOnly)\n                  continue;\n              if (p.name === name && (p.value || allowEmpty)) {\n                  return p;\n              }\n          }\n          else if (p.name === 'bind' &&\n              (p.exp || allowEmpty) &&\n              isBindKey(p.arg, name)) {\n              return p;\n          }\n      }\n  }\n  function isBindKey(arg, name) {\n      return !!(arg && isStaticExp(arg) && arg.content === name);\n  }\n  function hasDynamicKeyVBind(node) {\n      return node.props.some(p => p.type === 7 /* DIRECTIVE */ &&\n          p.name === 'bind' &&\n          (!p.arg || // v-bind=\"obj\"\n              p.arg.type !== 4 /* SIMPLE_EXPRESSION */ || // v-bind:[_ctx.foo]\n              !p.arg.isStatic) // v-bind:[foo]\n      );\n  }\n  function isText(node) {\n      return node.type === 5 /* INTERPOLATION */ || node.type === 2 /* TEXT */;\n  }\n  function isVSlot(p) {\n      return p.type === 7 /* DIRECTIVE */ && p.name === 'slot';\n  }\n  function isTemplateNode(node) {\n      return (node.type === 1 /* ELEMENT */ && node.tagType === 3 /* TEMPLATE */);\n  }\n  function isSlotOutlet(node) {\n      return node.type === 1 /* ELEMENT */ && node.tagType === 2 /* SLOT */;\n  }\n  function getVNodeHelper(ssr, isComponent) {\n      return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;\n  }\n  function getVNodeBlockHelper(ssr, isComponent) {\n      return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;\n  }\n  const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);\n  function getUnnormalizedProps(props, callPath = []) {\n      if (props &&\n          !isString(props) &&\n          props.type === 14 /* JS_CALL_EXPRESSION */) {\n          const callee = props.callee;\n          if (!isString(callee) && propsHelperSet.has(callee)) {\n              return getUnnormalizedProps(props.arguments[0], callPath.concat(props));\n          }\n      }\n      return [props, callPath];\n  }\n  function injectProp(node, prop, context) {\n      let propsWithInjection;\n      const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];\n      /**\n       * 1. mergeProps(...)\n       * 2. toHandlers(...)\n       * 3. normalizeProps(...)\n       * 4. normalizeProps(guardReactiveProps(...))\n       *\n       * we need to get the real props before normalization\n       */\n      let props = originalProps;\n      let callPath = [];\n      let parentCall;\n      if (props &&\n          !isString(props) &&\n          props.type === 14 /* JS_CALL_EXPRESSION */) {\n          const ret = getUnnormalizedProps(props);\n          props = ret[0];\n          callPath = ret[1];\n          parentCall = callPath[callPath.length - 1];\n      }\n      if (props == null || isString(props)) {\n          propsWithInjection = createObjectExpression([prop]);\n      }\n      else if (props.type === 14 /* JS_CALL_EXPRESSION */) {\n          // merged props... add ours\n          // only inject key to object literal if it's the first argument so that\n          // if doesn't override user provided keys\n          const first = props.arguments[0];\n          if (!isString(first) && first.type === 15 /* JS_OBJECT_EXPRESSION */) {\n              first.properties.unshift(prop);\n          }\n          else {\n              if (props.callee === TO_HANDLERS) {\n                  // #2366\n                  propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\n                      createObjectExpression([prop]),\n                      props\n                  ]);\n              }\n              else {\n                  props.arguments.unshift(createObjectExpression([prop]));\n              }\n          }\n          !propsWithInjection && (propsWithInjection = props);\n      }\n      else if (props.type === 15 /* JS_OBJECT_EXPRESSION */) {\n          let alreadyExists = false;\n          // check existing key to avoid overriding user provided keys\n          if (prop.key.type === 4 /* SIMPLE_EXPRESSION */) {\n              const propKeyName = prop.key.content;\n              alreadyExists = props.properties.some(p => p.key.type === 4 /* SIMPLE_EXPRESSION */ &&\n                  p.key.content === propKeyName);\n          }\n          if (!alreadyExists) {\n              props.properties.unshift(prop);\n          }\n          propsWithInjection = props;\n      }\n      else {\n          // single v-bind with expression, return a merged replacement\n          propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\n              createObjectExpression([prop]),\n              props\n          ]);\n          // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(props))`,\n          // it will be rewritten as `normalizeProps(mergeProps({ key: 0 }, props))`,\n          // the `guardReactiveProps` will no longer be needed\n          if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {\n              parentCall = callPath[callPath.length - 2];\n          }\n      }\n      if (node.type === 13 /* VNODE_CALL */) {\n          if (parentCall) {\n              parentCall.arguments[0] = propsWithInjection;\n          }\n          else {\n              node.props = propsWithInjection;\n          }\n      }\n      else {\n          if (parentCall) {\n              parentCall.arguments[0] = propsWithInjection;\n          }\n          else {\n              node.arguments[2] = propsWithInjection;\n          }\n      }\n  }\n  function toValidAssetId(name, type) {\n      return `_${type}_${name.replace(/[^\\w]/g, '_')}`;\n  }\n  function getMemoedVNodeCall(node) {\n      if (node.type === 14 /* JS_CALL_EXPRESSION */ && node.callee === WITH_MEMO) {\n          return node.arguments[1].returns;\n      }\n      else {\n          return node;\n      }\n  }\n  function makeBlock(node, { helper, removeHelper, inSSR }) {\n      if (!node.isBlock) {\n          node.isBlock = true;\n          removeHelper(getVNodeHelper(inSSR, node.isComponent));\n          helper(OPEN_BLOCK);\n          helper(getVNodeBlockHelper(inSSR, node.isComponent));\n      }\n  }\n\n  const deprecationData$1 = {\n      [\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */]: {\n          message: `Platform-native elements with \"is\" prop will no longer be ` +\n              `treated as components in Vue 3 unless the \"is\" value is explicitly ` +\n              `prefixed with \"vue:\".`,\n          link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`\n      },\n      [\"COMPILER_V_BIND_SYNC\" /* COMPILER_V_BIND_SYNC */]: {\n          message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +\n              `argument instead. \\`v-bind:${key}.sync\\` should be changed to ` +\n              `\\`v-model:${key}\\`.`,\n          link: `https://v3.vuejs.org/guide/migration/v-model.html`\n      },\n      [\"COMPILER_V_BIND_PROP\" /* COMPILER_V_BIND_PROP */]: {\n          message: `.prop modifier for v-bind has been removed and no longer necessary. ` +\n              `Vue 3 will automatically set a binding as DOM property when appropriate.`\n      },\n      [\"COMPILER_V_BIND_OBJECT_ORDER\" /* COMPILER_V_BIND_OBJECT_ORDER */]: {\n          message: `v-bind=\"obj\" usage is now order sensitive and behaves like JavaScript ` +\n              `object spread: it will now overwrite an existing non-mergeable attribute ` +\n              `that appears before v-bind in the case of conflict. ` +\n              `To retain 2.x behavior, move v-bind to make it the first attribute. ` +\n              `You can also suppress this warning if the usage is intended.`,\n          link: `https://v3.vuejs.org/guide/migration/v-bind.html`\n      },\n      [\"COMPILER_V_ON_NATIVE\" /* COMPILER_V_ON_NATIVE */]: {\n          message: `.native modifier for v-on has been removed as is no longer necessary.`,\n          link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`\n      },\n      [\"COMPILER_V_IF_V_FOR_PRECEDENCE\" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {\n          message: `v-if / v-for precedence when used on the same element has changed ` +\n              `in Vue 3: v-if now takes higher precedence and will no longer have ` +\n              `access to v-for scope variables. It is best to avoid the ambiguity ` +\n              `with <template> tags or use a computed property that filters v-for ` +\n              `data source.`,\n          link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`\n      },\n      [\"COMPILER_V_FOR_REF\" /* COMPILER_V_FOR_REF */]: {\n          message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +\n              `Consider using function refs or refactor to avoid ref usage altogether.`,\n          link: `https://v3.vuejs.org/guide/migration/array-refs.html`\n      },\n      [\"COMPILER_NATIVE_TEMPLATE\" /* COMPILER_NATIVE_TEMPLATE */]: {\n          message: `<template> with no special directives will render as a native template ` +\n              `element instead of its inner content in Vue 3.`\n      },\n      [\"COMPILER_INLINE_TEMPLATE\" /* COMPILER_INLINE_TEMPLATE */]: {\n          message: `\"inline-template\" has been removed in Vue 3.`,\n          link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`\n      },\n      [\"COMPILER_FILTER\" /* COMPILER_FILTERS */]: {\n          message: `filters have been removed in Vue 3. ` +\n              `The \"|\" symbol will be treated as native JavaScript bitwise OR operator. ` +\n              `Use method calls or computed properties instead.`,\n          link: `https://v3.vuejs.org/guide/migration/filters.html`\n      }\n  };\n  function getCompatValue(key, context) {\n      const config = context.options\n          ? context.options.compatConfig\n          : context.compatConfig;\n      const value = config && config[key];\n      if (key === 'MODE') {\n          return value || 3; // compiler defaults to v3 behavior\n      }\n      else {\n          return value;\n      }\n  }\n  function isCompatEnabled$1(key, context) {\n      const mode = getCompatValue('MODE', context);\n      const value = getCompatValue(key, context);\n      // in v3 mode, only enable if explicitly set to true\n      // otherwise enable for any non-false value\n      return mode === 3 ? value === true : value !== false;\n  }\n  function checkCompatEnabled(key, context, loc, ...args) {\n      const enabled = isCompatEnabled$1(key, context);\n      if (enabled) {\n          warnDeprecation$1(key, context, loc, ...args);\n      }\n      return enabled;\n  }\n  function warnDeprecation$1(key, context, loc, ...args) {\n      const val = getCompatValue(key, context);\n      if (val === 'suppress-warning') {\n          return;\n      }\n      const { message, link } = deprecationData$1[key];\n      const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\\n  Details: ${link}` : ``}`;\n      const err = new SyntaxError(msg);\n      err.code = key;\n      if (loc)\n          err.loc = loc;\n      context.onWarn(err);\n  }\n\n  // The default decoder only provides escapes for characters reserved as part of\n  // the template syntax, and is only used if the custom renderer did not provide\n  // a platform-specific decoder.\n  const decodeRE = /&(gt|lt|amp|apos|quot);/g;\n  const decodeMap = {\n      gt: '>',\n      lt: '<',\n      amp: '&',\n      apos: \"'\",\n      quot: '\"'\n  };\n  const defaultParserOptions = {\n      delimiters: [`{{`, `}}`],\n      getNamespace: () => 0 /* HTML */,\n      getTextMode: () => 0 /* DATA */,\n      isVoidTag: NO,\n      isPreTag: NO,\n      isCustomElement: NO,\n      decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),\n      onError: defaultOnError,\n      onWarn: defaultOnWarn,\n      comments: true\n  };\n  function baseParse(content, options = {}) {\n      const context = createParserContext(content, options);\n      const start = getCursor(context);\n      return createRoot(parseChildren(context, 0 /* DATA */, []), getSelection(context, start));\n  }\n  function createParserContext(content, rawOptions) {\n      const options = extend({}, defaultParserOptions);\n      let key;\n      for (key in rawOptions) {\n          // @ts-ignore\n          options[key] =\n              rawOptions[key] === undefined\n                  ? defaultParserOptions[key]\n                  : rawOptions[key];\n      }\n      return {\n          options,\n          column: 1,\n          line: 1,\n          offset: 0,\n          originalSource: content,\n          source: content,\n          inPre: false,\n          inVPre: false,\n          onWarn: options.onWarn\n      };\n  }\n  function parseChildren(context, mode, ancestors) {\n      const parent = last(ancestors);\n      const ns = parent ? parent.ns : 0 /* HTML */;\n      const nodes = [];\n      while (!isEnd(context, mode, ancestors)) {\n          const s = context.source;\n          let node = undefined;\n          if (mode === 0 /* DATA */ || mode === 1 /* RCDATA */) {\n              if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {\n                  // '{{'\n                  node = parseInterpolation(context, mode);\n              }\n              else if (mode === 0 /* DATA */ && s[0] === '<') {\n                  // https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state\n                  if (s.length === 1) {\n                      emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 1);\n                  }\n                  else if (s[1] === '!') {\n                      // https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state\n                      if (startsWith(s, '<!--')) {\n                          node = parseComment(context);\n                      }\n                      else if (startsWith(s, '<!DOCTYPE')) {\n                          // Ignore DOCTYPE by a limitation.\n                          node = parseBogusComment(context);\n                      }\n                      else if (startsWith(s, '<![CDATA[')) {\n                          if (ns !== 0 /* HTML */) {\n                              node = parseCDATA(context, ancestors);\n                          }\n                          else {\n                              emitError(context, 1 /* CDATA_IN_HTML_CONTENT */);\n                              node = parseBogusComment(context);\n                          }\n                      }\n                      else {\n                          emitError(context, 11 /* INCORRECTLY_OPENED_COMMENT */);\n                          node = parseBogusComment(context);\n                      }\n                  }\n                  else if (s[1] === '/') {\n                      // https://html.spec.whatwg.org/multipage/parsing.html#end-tag-open-state\n                      if (s.length === 2) {\n                          emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 2);\n                      }\n                      else if (s[2] === '>') {\n                          emitError(context, 14 /* MISSING_END_TAG_NAME */, 2);\n                          advanceBy(context, 3);\n                          continue;\n                      }\n                      else if (/[a-z]/i.test(s[2])) {\n                          emitError(context, 23 /* X_INVALID_END_TAG */);\n                          parseTag(context, 1 /* End */, parent);\n                          continue;\n                      }\n                      else {\n                          emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 2);\n                          node = parseBogusComment(context);\n                      }\n                  }\n                  else if (/[a-z]/i.test(s[1])) {\n                      node = parseElement(context, ancestors);\n                  }\n                  else if (s[1] === '?') {\n                      emitError(context, 21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */, 1);\n                      node = parseBogusComment(context);\n                  }\n                  else {\n                      emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 1);\n                  }\n              }\n          }\n          if (!node) {\n              node = parseText(context, mode);\n          }\n          if (isArray(node)) {\n              for (let i = 0; i < node.length; i++) {\n                  pushNode(nodes, node[i]);\n              }\n          }\n          else {\n              pushNode(nodes, node);\n          }\n      }\n      // Whitespace handling strategy like v2\n      let removedWhitespace = false;\n      if (mode !== 2 /* RAWTEXT */ && mode !== 1 /* RCDATA */) {\n          const shouldCondense = context.options.whitespace !== 'preserve';\n          for (let i = 0; i < nodes.length; i++) {\n              const node = nodes[i];\n              if (!context.inPre && node.type === 2 /* TEXT */) {\n                  if (!/[^\\t\\r\\n\\f ]/.test(node.content)) {\n                      const prev = nodes[i - 1];\n                      const next = nodes[i + 1];\n                      // Remove if:\n                      // - the whitespace is the first or last node, or:\n                      // - (condense mode) the whitespace is adjacent to a comment, or:\n                      // - (condense mode) the whitespace is between two elements AND contains newline\n                      if (!prev ||\n                          !next ||\n                          (shouldCondense &&\n                              (prev.type === 3 /* COMMENT */ ||\n                                  next.type === 3 /* COMMENT */ ||\n                                  (prev.type === 1 /* ELEMENT */ &&\n                                      next.type === 1 /* ELEMENT */ &&\n                                      /[\\r\\n]/.test(node.content))))) {\n                          removedWhitespace = true;\n                          nodes[i] = null;\n                      }\n                      else {\n                          // Otherwise, the whitespace is condensed into a single space\n                          node.content = ' ';\n                      }\n                  }\n                  else if (shouldCondense) {\n                      // in condense mode, consecutive whitespaces in text are condensed\n                      // down to a single space.\n                      node.content = node.content.replace(/[\\t\\r\\n\\f ]+/g, ' ');\n                  }\n              }\n              // Remove comment nodes if desired by configuration.\n              else if (node.type === 3 /* COMMENT */ && !context.options.comments) {\n                  removedWhitespace = true;\n                  nodes[i] = null;\n              }\n          }\n          if (context.inPre && parent && context.options.isPreTag(parent.tag)) {\n              // remove leading newline per html spec\n              // https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element\n              const first = nodes[0];\n              if (first && first.type === 2 /* TEXT */) {\n                  first.content = first.content.replace(/^\\r?\\n/, '');\n              }\n          }\n      }\n      return removedWhitespace ? nodes.filter(Boolean) : nodes;\n  }\n  function pushNode(nodes, node) {\n      if (node.type === 2 /* TEXT */) {\n          const prev = last(nodes);\n          // Merge if both this and the previous node are text and those are\n          // consecutive. This happens for cases like \"a < b\".\n          if (prev &&\n              prev.type === 2 /* TEXT */ &&\n              prev.loc.end.offset === node.loc.start.offset) {\n              prev.content += node.content;\n              prev.loc.end = node.loc.end;\n              prev.loc.source += node.loc.source;\n              return;\n          }\n      }\n      nodes.push(node);\n  }\n  function parseCDATA(context, ancestors) {\n      advanceBy(context, 9);\n      const nodes = parseChildren(context, 3 /* CDATA */, ancestors);\n      if (context.source.length === 0) {\n          emitError(context, 6 /* EOF_IN_CDATA */);\n      }\n      else {\n          advanceBy(context, 3);\n      }\n      return nodes;\n  }\n  function parseComment(context) {\n      const start = getCursor(context);\n      let content;\n      // Regular comment.\n      const match = /--(\\!)?>/.exec(context.source);\n      if (!match) {\n          content = context.source.slice(4);\n          advanceBy(context, context.source.length);\n          emitError(context, 7 /* EOF_IN_COMMENT */);\n      }\n      else {\n          if (match.index <= 3) {\n              emitError(context, 0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */);\n          }\n          if (match[1]) {\n              emitError(context, 10 /* INCORRECTLY_CLOSED_COMMENT */);\n          }\n          content = context.source.slice(4, match.index);\n          // Advancing with reporting nested comments.\n          const s = context.source.slice(0, match.index);\n          let prevIndex = 1, nestedIndex = 0;\n          while ((nestedIndex = s.indexOf('<!--', prevIndex)) !== -1) {\n              advanceBy(context, nestedIndex - prevIndex + 1);\n              if (nestedIndex + 4 < s.length) {\n                  emitError(context, 16 /* NESTED_COMMENT */);\n              }\n              prevIndex = nestedIndex + 1;\n          }\n          advanceBy(context, match.index + match[0].length - prevIndex + 1);\n      }\n      return {\n          type: 3 /* COMMENT */,\n          content,\n          loc: getSelection(context, start)\n      };\n  }\n  function parseBogusComment(context) {\n      const start = getCursor(context);\n      const contentStart = context.source[1] === '?' ? 1 : 2;\n      let content;\n      const closeIndex = context.source.indexOf('>');\n      if (closeIndex === -1) {\n          content = context.source.slice(contentStart);\n          advanceBy(context, context.source.length);\n      }\n      else {\n          content = context.source.slice(contentStart, closeIndex);\n          advanceBy(context, closeIndex + 1);\n      }\n      return {\n          type: 3 /* COMMENT */,\n          content,\n          loc: getSelection(context, start)\n      };\n  }\n  function parseElement(context, ancestors) {\n      // Start tag.\n      const wasInPre = context.inPre;\n      const wasInVPre = context.inVPre;\n      const parent = last(ancestors);\n      const element = parseTag(context, 0 /* Start */, parent);\n      const isPreBoundary = context.inPre && !wasInPre;\n      const isVPreBoundary = context.inVPre && !wasInVPre;\n      if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {\n          // #4030 self-closing <pre> tag\n          if (isPreBoundary) {\n              context.inPre = false;\n          }\n          if (isVPreBoundary) {\n              context.inVPre = false;\n          }\n          return element;\n      }\n      // Children.\n      ancestors.push(element);\n      const mode = context.options.getTextMode(element, parent);\n      const children = parseChildren(context, mode, ancestors);\n      ancestors.pop();\n      element.children = children;\n      // End tag.\n      if (startsWithEndTagOpen(context.source, element.tag)) {\n          parseTag(context, 1 /* End */, parent);\n      }\n      else {\n          emitError(context, 24 /* X_MISSING_END_TAG */, 0, element.loc.start);\n          if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {\n              const first = children[0];\n              if (first && startsWith(first.loc.source, '<!--')) {\n                  emitError(context, 8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */);\n              }\n          }\n      }\n      element.loc = getSelection(context, element.loc.start);\n      if (isPreBoundary) {\n          context.inPre = false;\n      }\n      if (isVPreBoundary) {\n          context.inVPre = false;\n      }\n      return element;\n  }\n  const isSpecialTemplateDirective = /*#__PURE__*/ makeMap(`if,else,else-if,for,slot`);\n  function parseTag(context, type, parent) {\n      // Tag open.\n      const start = getCursor(context);\n      const match = /^<\\/?([a-z][^\\t\\r\\n\\f />]*)/i.exec(context.source);\n      const tag = match[1];\n      const ns = context.options.getNamespace(tag, parent);\n      advanceBy(context, match[0].length);\n      advanceSpaces(context);\n      // save current state in case we need to re-parse attributes with v-pre\n      const cursor = getCursor(context);\n      const currentSource = context.source;\n      // check <pre> tag\n      if (context.options.isPreTag(tag)) {\n          context.inPre = true;\n      }\n      // Attributes.\n      let props = parseAttributes(context, type);\n      // check v-pre\n      if (type === 0 /* Start */ &&\n          !context.inVPre &&\n          props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'pre')) {\n          context.inVPre = true;\n          // reset context\n          extend(context, cursor);\n          context.source = currentSource;\n          // re-parse attrs and filter out v-pre itself\n          props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');\n      }\n      // Tag close.\n      let isSelfClosing = false;\n      if (context.source.length === 0) {\n          emitError(context, 9 /* EOF_IN_TAG */);\n      }\n      else {\n          isSelfClosing = startsWith(context.source, '/>');\n          if (type === 1 /* End */ && isSelfClosing) {\n              emitError(context, 4 /* END_TAG_WITH_TRAILING_SOLIDUS */);\n          }\n          advanceBy(context, isSelfClosing ? 2 : 1);\n      }\n      if (type === 1 /* End */) {\n          return;\n      }\n      let tagType = 0 /* ELEMENT */;\n      if (!context.inVPre) {\n          if (tag === 'slot') {\n              tagType = 2 /* SLOT */;\n          }\n          else if (tag === 'template') {\n              if (props.some(p => p.type === 7 /* DIRECTIVE */ && isSpecialTemplateDirective(p.name))) {\n                  tagType = 3 /* TEMPLATE */;\n              }\n          }\n          else if (isComponent(tag, props, context)) {\n              tagType = 1 /* COMPONENT */;\n          }\n      }\n      return {\n          type: 1 /* ELEMENT */,\n          ns,\n          tag,\n          tagType,\n          props,\n          isSelfClosing,\n          children: [],\n          loc: getSelection(context, start),\n          codegenNode: undefined // to be created during transform phase\n      };\n  }\n  function isComponent(tag, props, context) {\n      const options = context.options;\n      if (options.isCustomElement(tag)) {\n          return false;\n      }\n      if (tag === 'component' ||\n          /^[A-Z]/.test(tag) ||\n          isCoreComponent(tag) ||\n          (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||\n          (options.isNativeTag && !options.isNativeTag(tag))) {\n          return true;\n      }\n      // at this point the tag should be a native tag, but check for potential \"is\"\n      // casting\n      for (let i = 0; i < props.length; i++) {\n          const p = props[i];\n          if (p.type === 6 /* ATTRIBUTE */) {\n              if (p.name === 'is' && p.value) {\n                  if (p.value.content.startsWith('vue:')) {\n                      return true;\n                  }\n              }\n          }\n          else {\n              // directive\n              // v-is (TODO Deprecate)\n              if (p.name === 'is') {\n                  return true;\n              }\n              else if (\n              // :is on plain element - only treat as component in compat mode\n              p.name === 'bind' &&\n                  isBindKey(p.arg, 'is') &&\n                  false &&\n                  checkCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {\n                  return true;\n              }\n          }\n      }\n  }\n  function parseAttributes(context, type) {\n      const props = [];\n      const attributeNames = new Set();\n      while (context.source.length > 0 &&\n          !startsWith(context.source, '>') &&\n          !startsWith(context.source, '/>')) {\n          if (startsWith(context.source, '/')) {\n              emitError(context, 22 /* UNEXPECTED_SOLIDUS_IN_TAG */);\n              advanceBy(context, 1);\n              advanceSpaces(context);\n              continue;\n          }\n          if (type === 1 /* End */) {\n              emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);\n          }\n          const attr = parseAttribute(context, attributeNames);\n          if (type === 0 /* Start */) {\n              props.push(attr);\n          }\n          if (/^[^\\t\\r\\n\\f />]/.test(context.source)) {\n              emitError(context, 15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */);\n          }\n          advanceSpaces(context);\n      }\n      return props;\n  }\n  function parseAttribute(context, nameSet) {\n      // Name.\n      const start = getCursor(context);\n      const match = /^[^\\t\\r\\n\\f />][^\\t\\r\\n\\f />=]*/.exec(context.source);\n      const name = match[0];\n      if (nameSet.has(name)) {\n          emitError(context, 2 /* DUPLICATE_ATTRIBUTE */);\n      }\n      nameSet.add(name);\n      if (name[0] === '=') {\n          emitError(context, 19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */);\n      }\n      {\n          const pattern = /[\"'<]/g;\n          let m;\n          while ((m = pattern.exec(name))) {\n              emitError(context, 17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */, m.index);\n          }\n      }\n      advanceBy(context, name.length);\n      // Value\n      let value = undefined;\n      if (/^[\\t\\r\\n\\f ]*=/.test(context.source)) {\n          advanceSpaces(context);\n          advanceBy(context, 1);\n          advanceSpaces(context);\n          value = parseAttributeValue(context);\n          if (!value) {\n              emitError(context, 13 /* MISSING_ATTRIBUTE_VALUE */);\n          }\n      }\n      const loc = getSelection(context, start);\n      if (!context.inVPre && /^(v-|:|\\.|@|#)/.test(name)) {\n          const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^\\.|^@|^#)(\\[[^\\]]+\\]|[^\\.]+))?(.+)?$/i.exec(name);\n          let isPropShorthand = startsWith(name, '.');\n          let dirName = match[1] ||\n              (isPropShorthand || startsWith(name, ':')\n                  ? 'bind'\n                  : startsWith(name, '@')\n                      ? 'on'\n                      : 'slot');\n          let arg;\n          if (match[2]) {\n              const isSlot = dirName === 'slot';\n              const startOffset = name.lastIndexOf(match[2]);\n              const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));\n              let content = match[2];\n              let isStatic = true;\n              if (content.startsWith('[')) {\n                  isStatic = false;\n                  if (!content.endsWith(']')) {\n                      emitError(context, 26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);\n                  }\n                  content = content.substr(1, content.length - 2);\n              }\n              else if (isSlot) {\n                  // #1241 special case for v-slot: vuetify relies extensively on slot\n                  // names containing dots. v-slot doesn't have any modifiers and Vue 2.x\n                  // supports such usage so we are keeping it consistent with 2.x.\n                  content += match[3] || '';\n              }\n              arg = {\n                  type: 4 /* SIMPLE_EXPRESSION */,\n                  content,\n                  isStatic,\n                  constType: isStatic\n                      ? 3 /* CAN_STRINGIFY */\n                      : 0 /* NOT_CONSTANT */,\n                  loc\n              };\n          }\n          if (value && value.isQuoted) {\n              const valueLoc = value.loc;\n              valueLoc.start.offset++;\n              valueLoc.start.column++;\n              valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);\n              valueLoc.source = valueLoc.source.slice(1, -1);\n          }\n          const modifiers = match[3] ? match[3].substr(1).split('.') : [];\n          if (isPropShorthand)\n              modifiers.push('prop');\n          return {\n              type: 7 /* DIRECTIVE */,\n              name: dirName,\n              exp: value && {\n                  type: 4 /* SIMPLE_EXPRESSION */,\n                  content: value.content,\n                  isStatic: false,\n                  // Treat as non-constant by default. This can be potentially set to\n                  // other values by `transformExpression` to make it eligible for hoisting.\n                  constType: 0 /* NOT_CONSTANT */,\n                  loc: value.loc\n              },\n              arg,\n              modifiers,\n              loc\n          };\n      }\n      return {\n          type: 6 /* ATTRIBUTE */,\n          name,\n          value: value && {\n              type: 2 /* TEXT */,\n              content: value.content,\n              loc: value.loc\n          },\n          loc\n      };\n  }\n  function parseAttributeValue(context) {\n      const start = getCursor(context);\n      let content;\n      const quote = context.source[0];\n      const isQuoted = quote === `\"` || quote === `'`;\n      if (isQuoted) {\n          // Quoted value.\n          advanceBy(context, 1);\n          const endIndex = context.source.indexOf(quote);\n          if (endIndex === -1) {\n              content = parseTextData(context, context.source.length, 4 /* ATTRIBUTE_VALUE */);\n          }\n          else {\n              content = parseTextData(context, endIndex, 4 /* ATTRIBUTE_VALUE */);\n              advanceBy(context, 1);\n          }\n      }\n      else {\n          // Unquoted\n          const match = /^[^\\t\\r\\n\\f >]+/.exec(context.source);\n          if (!match) {\n              return undefined;\n          }\n          const unexpectedChars = /[\"'<=`]/g;\n          let m;\n          while ((m = unexpectedChars.exec(match[0]))) {\n              emitError(context, 18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */, m.index);\n          }\n          content = parseTextData(context, match[0].length, 4 /* ATTRIBUTE_VALUE */);\n      }\n      return { content, isQuoted, loc: getSelection(context, start) };\n  }\n  function parseInterpolation(context, mode) {\n      const [open, close] = context.options.delimiters;\n      const closeIndex = context.source.indexOf(close, open.length);\n      if (closeIndex === -1) {\n          emitError(context, 25 /* X_MISSING_INTERPOLATION_END */);\n          return undefined;\n      }\n      const start = getCursor(context);\n      advanceBy(context, open.length);\n      const innerStart = getCursor(context);\n      const innerEnd = getCursor(context);\n      const rawContentLength = closeIndex - open.length;\n      const rawContent = context.source.slice(0, rawContentLength);\n      const preTrimContent = parseTextData(context, rawContentLength, mode);\n      const content = preTrimContent.trim();\n      const startOffset = preTrimContent.indexOf(content);\n      if (startOffset > 0) {\n          advancePositionWithMutation(innerStart, rawContent, startOffset);\n      }\n      const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);\n      advancePositionWithMutation(innerEnd, rawContent, endOffset);\n      advanceBy(context, close.length);\n      return {\n          type: 5 /* INTERPOLATION */,\n          content: {\n              type: 4 /* SIMPLE_EXPRESSION */,\n              isStatic: false,\n              // Set `isConstant` to false by default and will decide in transformExpression\n              constType: 0 /* NOT_CONSTANT */,\n              content,\n              loc: getSelection(context, innerStart, innerEnd)\n          },\n          loc: getSelection(context, start)\n      };\n  }\n  function parseText(context, mode) {\n      const endTokens = ['<', context.options.delimiters[0]];\n      if (mode === 3 /* CDATA */) {\n          endTokens.push(']]>');\n      }\n      let endIndex = context.source.length;\n      for (let i = 0; i < endTokens.length; i++) {\n          const index = context.source.indexOf(endTokens[i], 1);\n          if (index !== -1 && endIndex > index) {\n              endIndex = index;\n          }\n      }\n      const start = getCursor(context);\n      const content = parseTextData(context, endIndex, mode);\n      return {\n          type: 2 /* TEXT */,\n          content,\n          loc: getSelection(context, start)\n      };\n  }\n  /**\n   * Get text data with a given length from the current location.\n   * This translates HTML entities in the text data.\n   */\n  function parseTextData(context, length, mode) {\n      const rawText = context.source.slice(0, length);\n      advanceBy(context, length);\n      if (mode === 2 /* RAWTEXT */ ||\n          mode === 3 /* CDATA */ ||\n          rawText.indexOf('&') === -1) {\n          return rawText;\n      }\n      else {\n          // DATA or RCDATA containing \"&\"\". Entity decoding required.\n          return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n      }\n  }\n  function getCursor(context) {\n      const { column, line, offset } = context;\n      return { column, line, offset };\n  }\n  function getSelection(context, start, end) {\n      end = end || getCursor(context);\n      return {\n          start,\n          end,\n          source: context.originalSource.slice(start.offset, end.offset)\n      };\n  }\n  function last(xs) {\n      return xs[xs.length - 1];\n  }\n  function startsWith(source, searchString) {\n      return source.startsWith(searchString);\n  }\n  function advanceBy(context, numberOfCharacters) {\n      const { source } = context;\n      advancePositionWithMutation(context, source, numberOfCharacters);\n      context.source = source.slice(numberOfCharacters);\n  }\n  function advanceSpaces(context) {\n      const match = /^[\\t\\r\\n\\f ]+/.exec(context.source);\n      if (match) {\n          advanceBy(context, match[0].length);\n      }\n  }\n  function getNewPosition(context, start, numberOfCharacters) {\n      return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);\n  }\n  function emitError(context, code, offset, loc = getCursor(context)) {\n      if (offset) {\n          loc.offset += offset;\n          loc.column += offset;\n      }\n      context.options.onError(createCompilerError(code, {\n          start: loc,\n          end: loc,\n          source: ''\n      }));\n  }\n  function isEnd(context, mode, ancestors) {\n      const s = context.source;\n      switch (mode) {\n          case 0 /* DATA */:\n              if (startsWith(s, '</')) {\n                  // TODO: probably bad performance\n                  for (let i = ancestors.length - 1; i >= 0; --i) {\n                      if (startsWithEndTagOpen(s, ancestors[i].tag)) {\n                          return true;\n                      }\n                  }\n              }\n              break;\n          case 1 /* RCDATA */:\n          case 2 /* RAWTEXT */: {\n              const parent = last(ancestors);\n              if (parent && startsWithEndTagOpen(s, parent.tag)) {\n                  return true;\n              }\n              break;\n          }\n          case 3 /* CDATA */:\n              if (startsWith(s, ']]>')) {\n                  return true;\n              }\n              break;\n      }\n      return !s;\n  }\n  function startsWithEndTagOpen(source, tag) {\n      return (startsWith(source, '</') &&\n          source.substr(2, tag.length).toLowerCase() === tag.toLowerCase() &&\n          /[\\t\\r\\n\\f />]/.test(source[2 + tag.length] || '>'));\n  }\n\n  function hoistStatic(root, context) {\n      walk(root, context, \n      // Root node is unfortunately non-hoistable due to potential parent\n      // fallthrough attributes.\n      isSingleElementRoot(root, root.children[0]));\n  }\n  function isSingleElementRoot(root, child) {\n      const { children } = root;\n      return (children.length === 1 &&\n          child.type === 1 /* ELEMENT */ &&\n          !isSlotOutlet(child));\n  }\n  function walk(node, context, doNotHoistNode = false) {\n      // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces\n      // static bindings with expressions. These expressions are guaranteed to be\n      // constant so they are still eligible for hoisting, but they are only\n      // available at runtime and therefore cannot be evaluated ahead of time.\n      // This is only a concern for pre-stringification (via transformHoist by\n      // @vue/compiler-dom), but doing it here allows us to perform only one full\n      // walk of the AST and allow `stringifyStatic` to stop walking as soon as its\n      // stringficiation threshold is met.\n      let canStringify = true;\n      const { children } = node;\n      const originalCount = children.length;\n      let hoistedCount = 0;\n      for (let i = 0; i < children.length; i++) {\n          const child = children[i];\n          // only plain elements & text calls are eligible for hoisting.\n          if (child.type === 1 /* ELEMENT */ &&\n              child.tagType === 0 /* ELEMENT */) {\n              const constantType = doNotHoistNode\n                  ? 0 /* NOT_CONSTANT */\n                  : getConstantType(child, context);\n              if (constantType > 0 /* NOT_CONSTANT */) {\n                  if (constantType < 3 /* CAN_STRINGIFY */) {\n                      canStringify = false;\n                  }\n                  if (constantType >= 2 /* CAN_HOIST */) {\n                      child.codegenNode.patchFlag =\n                          -1 /* HOISTED */ + (` /* HOISTED */` );\n                      child.codegenNode = context.hoist(child.codegenNode);\n                      hoistedCount++;\n                      continue;\n                  }\n              }\n              else {\n                  // node may contain dynamic children, but its props may be eligible for\n                  // hoisting.\n                  const codegenNode = child.codegenNode;\n                  if (codegenNode.type === 13 /* VNODE_CALL */) {\n                      const flag = getPatchFlag(codegenNode);\n                      if ((!flag ||\n                          flag === 512 /* NEED_PATCH */ ||\n                          flag === 1 /* TEXT */) &&\n                          getGeneratedPropsConstantType(child, context) >=\n                              2 /* CAN_HOIST */) {\n                          const props = getNodeProps(child);\n                          if (props) {\n                              codegenNode.props = context.hoist(props);\n                          }\n                      }\n                      if (codegenNode.dynamicProps) {\n                          codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);\n                      }\n                  }\n              }\n          }\n          else if (child.type === 12 /* TEXT_CALL */) {\n              const contentType = getConstantType(child.content, context);\n              if (contentType > 0) {\n                  if (contentType < 3 /* CAN_STRINGIFY */) {\n                      canStringify = false;\n                  }\n                  if (contentType >= 2 /* CAN_HOIST */) {\n                      child.codegenNode = context.hoist(child.codegenNode);\n                      hoistedCount++;\n                  }\n              }\n          }\n          // walk further\n          if (child.type === 1 /* ELEMENT */) {\n              const isComponent = child.tagType === 1 /* COMPONENT */;\n              if (isComponent) {\n                  context.scopes.vSlot++;\n              }\n              walk(child, context);\n              if (isComponent) {\n                  context.scopes.vSlot--;\n              }\n          }\n          else if (child.type === 11 /* FOR */) {\n              // Do not hoist v-for single child because it has to be a block\n              walk(child, context, child.children.length === 1);\n          }\n          else if (child.type === 9 /* IF */) {\n              for (let i = 0; i < child.branches.length; i++) {\n                  // Do not hoist v-if single child because it has to be a block\n                  walk(child.branches[i], context, child.branches[i].children.length === 1);\n              }\n          }\n      }\n      if (canStringify && hoistedCount && context.transformHoist) {\n          context.transformHoist(children, context, node);\n      }\n      // all children were hoisted - the entire children array is hoistable.\n      if (hoistedCount &&\n          hoistedCount === originalCount &&\n          node.type === 1 /* ELEMENT */ &&\n          node.tagType === 0 /* ELEMENT */ &&\n          node.codegenNode &&\n          node.codegenNode.type === 13 /* VNODE_CALL */ &&\n          isArray(node.codegenNode.children)) {\n          node.codegenNode.children = context.hoist(createArrayExpression(node.codegenNode.children));\n      }\n  }\n  function getConstantType(node, context) {\n      const { constantCache } = context;\n      switch (node.type) {\n          case 1 /* ELEMENT */:\n              if (node.tagType !== 0 /* ELEMENT */) {\n                  return 0 /* NOT_CONSTANT */;\n              }\n              const cached = constantCache.get(node);\n              if (cached !== undefined) {\n                  return cached;\n              }\n              const codegenNode = node.codegenNode;\n              if (codegenNode.type !== 13 /* VNODE_CALL */) {\n                  return 0 /* NOT_CONSTANT */;\n              }\n              const flag = getPatchFlag(codegenNode);\n              if (!flag) {\n                  let returnType = 3 /* CAN_STRINGIFY */;\n                  // Element itself has no patch flag. However we still need to check:\n                  // 1. Even for a node with no patch flag, it is possible for it to contain\n                  // non-hoistable expressions that refers to scope variables, e.g. compiler\n                  // injected keys or cached event handlers. Therefore we need to always\n                  // check the codegenNode's props to be sure.\n                  const generatedPropsType = getGeneratedPropsConstantType(node, context);\n                  if (generatedPropsType === 0 /* NOT_CONSTANT */) {\n                      constantCache.set(node, 0 /* NOT_CONSTANT */);\n                      return 0 /* NOT_CONSTANT */;\n                  }\n                  if (generatedPropsType < returnType) {\n                      returnType = generatedPropsType;\n                  }\n                  // 2. its children.\n                  for (let i = 0; i < node.children.length; i++) {\n                      const childType = getConstantType(node.children[i], context);\n                      if (childType === 0 /* NOT_CONSTANT */) {\n                          constantCache.set(node, 0 /* NOT_CONSTANT */);\n                          return 0 /* NOT_CONSTANT */;\n                      }\n                      if (childType < returnType) {\n                          returnType = childType;\n                      }\n                  }\n                  // 3. if the type is not already CAN_SKIP_PATCH which is the lowest non-0\n                  // type, check if any of the props can cause the type to be lowered\n                  // we can skip can_patch because it's guaranteed by the absence of a\n                  // patchFlag.\n                  if (returnType > 1 /* CAN_SKIP_PATCH */) {\n                      for (let i = 0; i < node.props.length; i++) {\n                          const p = node.props[i];\n                          if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind' && p.exp) {\n                              const expType = getConstantType(p.exp, context);\n                              if (expType === 0 /* NOT_CONSTANT */) {\n                                  constantCache.set(node, 0 /* NOT_CONSTANT */);\n                                  return 0 /* NOT_CONSTANT */;\n                              }\n                              if (expType < returnType) {\n                                  returnType = expType;\n                              }\n                          }\n                      }\n                  }\n                  // only svg/foreignObject could be block here, however if they are\n                  // static then they don't need to be blocks since there will be no\n                  // nested updates.\n                  if (codegenNode.isBlock) {\n                      context.removeHelper(OPEN_BLOCK);\n                      context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));\n                      codegenNode.isBlock = false;\n                      context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));\n                  }\n                  constantCache.set(node, returnType);\n                  return returnType;\n              }\n              else {\n                  constantCache.set(node, 0 /* NOT_CONSTANT */);\n                  return 0 /* NOT_CONSTANT */;\n              }\n          case 2 /* TEXT */:\n          case 3 /* COMMENT */:\n              return 3 /* CAN_STRINGIFY */;\n          case 9 /* IF */:\n          case 11 /* FOR */:\n          case 10 /* IF_BRANCH */:\n              return 0 /* NOT_CONSTANT */;\n          case 5 /* INTERPOLATION */:\n          case 12 /* TEXT_CALL */:\n              return getConstantType(node.content, context);\n          case 4 /* SIMPLE_EXPRESSION */:\n              return node.constType;\n          case 8 /* COMPOUND_EXPRESSION */:\n              let returnType = 3 /* CAN_STRINGIFY */;\n              for (let i = 0; i < node.children.length; i++) {\n                  const child = node.children[i];\n                  if (isString(child) || isSymbol(child)) {\n                      continue;\n                  }\n                  const childType = getConstantType(child, context);\n                  if (childType === 0 /* NOT_CONSTANT */) {\n                      return 0 /* NOT_CONSTANT */;\n                  }\n                  else if (childType < returnType) {\n                      returnType = childType;\n                  }\n              }\n              return returnType;\n          default:\n              return 0 /* NOT_CONSTANT */;\n      }\n  }\n  const allowHoistedHelperSet = new Set([\n      NORMALIZE_CLASS,\n      NORMALIZE_STYLE,\n      NORMALIZE_PROPS,\n      GUARD_REACTIVE_PROPS\n  ]);\n  function getConstantTypeOfHelperCall(value, context) {\n      if (value.type === 14 /* JS_CALL_EXPRESSION */ &&\n          !isString(value.callee) &&\n          allowHoistedHelperSet.has(value.callee)) {\n          const arg = value.arguments[0];\n          if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\n              return getConstantType(arg, context);\n          }\n          else if (arg.type === 14 /* JS_CALL_EXPRESSION */) {\n              // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(exp))`\n              return getConstantTypeOfHelperCall(arg, context);\n          }\n      }\n      return 0 /* NOT_CONSTANT */;\n  }\n  function getGeneratedPropsConstantType(node, context) {\n      let returnType = 3 /* CAN_STRINGIFY */;\n      const props = getNodeProps(node);\n      if (props && props.type === 15 /* JS_OBJECT_EXPRESSION */) {\n          const { properties } = props;\n          for (let i = 0; i < properties.length; i++) {\n              const { key, value } = properties[i];\n              const keyType = getConstantType(key, context);\n              if (keyType === 0 /* NOT_CONSTANT */) {\n                  return keyType;\n              }\n              if (keyType < returnType) {\n                  returnType = keyType;\n              }\n              if (value.type !== 4 /* SIMPLE_EXPRESSION */) {\n                  // some helper calls can be hoisted,\n                  // such as the `normalizeProps` generated by the compiler for pre-normalize class,\n                  // in this case we need to respect the ConstanType of the helper's argments\n                  if (value.type === 14 /* JS_CALL_EXPRESSION */) {\n                      return getConstantTypeOfHelperCall(value, context);\n                  }\n                  return 0 /* NOT_CONSTANT */;\n              }\n              const valueType = getConstantType(value, context);\n              if (valueType === 0 /* NOT_CONSTANT */) {\n                  return valueType;\n              }\n              if (valueType < returnType) {\n                  returnType = valueType;\n              }\n          }\n      }\n      return returnType;\n  }\n  function getNodeProps(node) {\n      const codegenNode = node.codegenNode;\n      if (codegenNode.type === 13 /* VNODE_CALL */) {\n          return codegenNode.props;\n      }\n  }\n  function getPatchFlag(node) {\n      const flag = node.patchFlag;\n      return flag ? parseInt(flag, 10) : undefined;\n  }\n\n  function createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {\n      const nameMatch = filename.replace(/\\?.*$/, '').match(/([^/\\\\]+)\\.\\w+$/);\n      const context = {\n          // options\n          selfName: nameMatch && capitalize(camelize(nameMatch[1])),\n          prefixIdentifiers,\n          hoistStatic,\n          cacheHandlers,\n          nodeTransforms,\n          directiveTransforms,\n          transformHoist,\n          isBuiltInComponent,\n          isCustomElement,\n          expressionPlugins,\n          scopeId,\n          slotted,\n          ssr,\n          inSSR,\n          ssrCssVars,\n          bindingMetadata,\n          inline,\n          isTS,\n          onError,\n          onWarn,\n          compatConfig,\n          // state\n          root,\n          helpers: new Map(),\n          components: new Set(),\n          directives: new Set(),\n          hoists: [],\n          imports: [],\n          constantCache: new Map(),\n          temps: 0,\n          cached: 0,\n          identifiers: Object.create(null),\n          scopes: {\n              vFor: 0,\n              vSlot: 0,\n              vPre: 0,\n              vOnce: 0\n          },\n          parent: null,\n          currentNode: root,\n          childIndex: 0,\n          inVOnce: false,\n          // methods\n          helper(name) {\n              const count = context.helpers.get(name) || 0;\n              context.helpers.set(name, count + 1);\n              return name;\n          },\n          removeHelper(name) {\n              const count = context.helpers.get(name);\n              if (count) {\n                  const currentCount = count - 1;\n                  if (!currentCount) {\n                      context.helpers.delete(name);\n                  }\n                  else {\n                      context.helpers.set(name, currentCount);\n                  }\n              }\n          },\n          helperString(name) {\n              return `_${helperNameMap[context.helper(name)]}`;\n          },\n          replaceNode(node) {\n              /* istanbul ignore if */\n              {\n                  if (!context.currentNode) {\n                      throw new Error(`Node being replaced is already removed.`);\n                  }\n                  if (!context.parent) {\n                      throw new Error(`Cannot replace root node.`);\n                  }\n              }\n              context.parent.children[context.childIndex] = context.currentNode = node;\n          },\n          removeNode(node) {\n              if (!context.parent) {\n                  throw new Error(`Cannot remove root node.`);\n              }\n              const list = context.parent.children;\n              const removalIndex = node\n                  ? list.indexOf(node)\n                  : context.currentNode\n                      ? context.childIndex\n                      : -1;\n              /* istanbul ignore if */\n              if (removalIndex < 0) {\n                  throw new Error(`node being removed is not a child of current parent`);\n              }\n              if (!node || node === context.currentNode) {\n                  // current node removed\n                  context.currentNode = null;\n                  context.onNodeRemoved();\n              }\n              else {\n                  // sibling node removed\n                  if (context.childIndex > removalIndex) {\n                      context.childIndex--;\n                      context.onNodeRemoved();\n                  }\n              }\n              context.parent.children.splice(removalIndex, 1);\n          },\n          onNodeRemoved: () => { },\n          addIdentifiers(exp) {\n          },\n          removeIdentifiers(exp) {\n          },\n          hoist(exp) {\n              if (isString(exp))\n                  exp = createSimpleExpression(exp);\n              context.hoists.push(exp);\n              const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 /* CAN_HOIST */);\n              identifier.hoisted = exp;\n              return identifier;\n          },\n          cache(exp, isVNode = false) {\n              return createCacheExpression(context.cached++, exp, isVNode);\n          }\n      };\n      return context;\n  }\n  function transform(root, options) {\n      const context = createTransformContext(root, options);\n      traverseNode(root, context);\n      if (options.hoistStatic) {\n          hoistStatic(root, context);\n      }\n      if (!options.ssr) {\n          createRootCodegen(root, context);\n      }\n      // finalize meta information\n      root.helpers = [...context.helpers.keys()];\n      root.components = [...context.components];\n      root.directives = [...context.directives];\n      root.imports = context.imports;\n      root.hoists = context.hoists;\n      root.temps = context.temps;\n      root.cached = context.cached;\n  }\n  function createRootCodegen(root, context) {\n      const { helper } = context;\n      const { children } = root;\n      if (children.length === 1) {\n          const child = children[0];\n          // if the single child is an element, turn it into a block.\n          if (isSingleElementRoot(root, child) && child.codegenNode) {\n              // single element root is never hoisted so codegenNode will never be\n              // SimpleExpressionNode\n              const codegenNode = child.codegenNode;\n              if (codegenNode.type === 13 /* VNODE_CALL */) {\n                  makeBlock(codegenNode, context);\n              }\n              root.codegenNode = codegenNode;\n          }\n          else {\n              // - single <slot/>, IfNode, ForNode: already blocks.\n              // - single text node: always patched.\n              // root codegen falls through via genNode()\n              root.codegenNode = child;\n          }\n      }\n      else if (children.length > 1) {\n          // root has multiple nodes - return a fragment block.\n          let patchFlag = 64 /* STABLE_FRAGMENT */;\n          let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];\n          // check if the fragment actually contains a single valid child with\n          // the rest being comments\n          if (children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {\n              patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;\n              patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;\n          }\n          root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + (` /* ${patchFlagText} */` ), undefined, undefined, true, undefined, false /* isComponent */);\n      }\n      else ;\n  }\n  function traverseChildren(parent, context) {\n      let i = 0;\n      const nodeRemoved = () => {\n          i--;\n      };\n      for (; i < parent.children.length; i++) {\n          const child = parent.children[i];\n          if (isString(child))\n              continue;\n          context.parent = parent;\n          context.childIndex = i;\n          context.onNodeRemoved = nodeRemoved;\n          traverseNode(child, context);\n      }\n  }\n  function traverseNode(node, context) {\n      context.currentNode = node;\n      // apply transform plugins\n      const { nodeTransforms } = context;\n      const exitFns = [];\n      for (let i = 0; i < nodeTransforms.length; i++) {\n          const onExit = nodeTransforms[i](node, context);\n          if (onExit) {\n              if (isArray(onExit)) {\n                  exitFns.push(...onExit);\n              }\n              else {\n                  exitFns.push(onExit);\n              }\n          }\n          if (!context.currentNode) {\n              // node was removed\n              return;\n          }\n          else {\n              // node may have been replaced\n              node = context.currentNode;\n          }\n      }\n      switch (node.type) {\n          case 3 /* COMMENT */:\n              if (!context.ssr) {\n                  // inject import for the Comment symbol, which is needed for creating\n                  // comment nodes with `createVNode`\n                  context.helper(CREATE_COMMENT);\n              }\n              break;\n          case 5 /* INTERPOLATION */:\n              // no need to traverse, but we need to inject toString helper\n              if (!context.ssr) {\n                  context.helper(TO_DISPLAY_STRING);\n              }\n              break;\n          // for container types, further traverse downwards\n          case 9 /* IF */:\n              for (let i = 0; i < node.branches.length; i++) {\n                  traverseNode(node.branches[i], context);\n              }\n              break;\n          case 10 /* IF_BRANCH */:\n          case 11 /* FOR */:\n          case 1 /* ELEMENT */:\n          case 0 /* ROOT */:\n              traverseChildren(node, context);\n              break;\n      }\n      // exit transforms\n      context.currentNode = node;\n      let i = exitFns.length;\n      while (i--) {\n          exitFns[i]();\n      }\n  }\n  function createStructuralDirectiveTransform(name, fn) {\n      const matches = isString(name)\n          ? (n) => n === name\n          : (n) => name.test(n);\n      return (node, context) => {\n          if (node.type === 1 /* ELEMENT */) {\n              const { props } = node;\n              // structural directive transforms are not concerned with slots\n              // as they are handled separately in vSlot.ts\n              if (node.tagType === 3 /* TEMPLATE */ && props.some(isVSlot)) {\n                  return;\n              }\n              const exitFns = [];\n              for (let i = 0; i < props.length; i++) {\n                  const prop = props[i];\n                  if (prop.type === 7 /* DIRECTIVE */ && matches(prop.name)) {\n                      // structural directives are removed to avoid infinite recursion\n                      // also we remove them *before* applying so that it can further\n                      // traverse itself in case it moves the node around\n                      props.splice(i, 1);\n                      i--;\n                      const onExit = fn(node, prop, context);\n                      if (onExit)\n                          exitFns.push(onExit);\n                  }\n              }\n              return exitFns;\n          }\n      };\n  }\n\n  const PURE_ANNOTATION = `/*#__PURE__*/`;\n  function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false, inSSR = false }) {\n      const context = {\n          mode,\n          prefixIdentifiers,\n          sourceMap,\n          filename,\n          scopeId,\n          optimizeImports,\n          runtimeGlobalName,\n          runtimeModuleName,\n          ssr,\n          isTS,\n          inSSR,\n          source: ast.loc.source,\n          code: ``,\n          column: 1,\n          line: 1,\n          offset: 0,\n          indentLevel: 0,\n          pure: false,\n          map: undefined,\n          helper(key) {\n              return `_${helperNameMap[key]}`;\n          },\n          push(code, node) {\n              context.code += code;\n          },\n          indent() {\n              newline(++context.indentLevel);\n          },\n          deindent(withoutNewLine = false) {\n              if (withoutNewLine) {\n                  --context.indentLevel;\n              }\n              else {\n                  newline(--context.indentLevel);\n              }\n          },\n          newline() {\n              newline(context.indentLevel);\n          }\n      };\n      function newline(n) {\n          context.push('\\n' + `  `.repeat(n));\n      }\n      return context;\n  }\n  function generate(ast, options = {}) {\n      const context = createCodegenContext(ast, options);\n      if (options.onContextCreated)\n          options.onContextCreated(context);\n      const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;\n      const hasHelpers = ast.helpers.length > 0;\n      const useWithBlock = !prefixIdentifiers && mode !== 'module';\n      // preambles\n      // in setup() inline mode, the preamble is generated in a sub context\n      // and returned separately.\n      const preambleContext = context;\n      {\n          genFunctionPreamble(ast, preambleContext);\n      }\n      // enter render function\n      const functionName = ssr ? `ssrRender` : `render`;\n      const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];\n      const signature = args.join(', ');\n      {\n          push(`function ${functionName}(${signature}) {`);\n      }\n      indent();\n      if (useWithBlock) {\n          push(`with (_ctx) {`);\n          indent();\n          // function mode const declarations should be inside with block\n          // also they should be renamed to avoid collision with user properties\n          if (hasHelpers) {\n              push(`const { ${ast.helpers\n                .map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)\n                .join(', ')} } = _Vue`);\n              push(`\\n`);\n              newline();\n          }\n      }\n      // generate asset resolution statements\n      if (ast.components.length) {\n          genAssets(ast.components, 'component', context);\n          if (ast.directives.length || ast.temps > 0) {\n              newline();\n          }\n      }\n      if (ast.directives.length) {\n          genAssets(ast.directives, 'directive', context);\n          if (ast.temps > 0) {\n              newline();\n          }\n      }\n      if (ast.temps > 0) {\n          push(`let `);\n          for (let i = 0; i < ast.temps; i++) {\n              push(`${i > 0 ? `, ` : ``}_temp${i}`);\n          }\n      }\n      if (ast.components.length || ast.directives.length || ast.temps) {\n          push(`\\n`);\n          newline();\n      }\n      // generate the VNode tree expression\n      if (!ssr) {\n          push(`return `);\n      }\n      if (ast.codegenNode) {\n          genNode(ast.codegenNode, context);\n      }\n      else {\n          push(`null`);\n      }\n      if (useWithBlock) {\n          deindent();\n          push(`}`);\n      }\n      deindent();\n      push(`}`);\n      return {\n          ast,\n          code: context.code,\n          preamble: ``,\n          // SourceMapGenerator does have toJSON() method but it's not in the types\n          map: context.map ? context.map.toJSON() : undefined\n      };\n  }\n  function genFunctionPreamble(ast, context) {\n      const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;\n      const VueBinding = runtimeGlobalName;\n      const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;\n      // Generate const declaration for helpers\n      // In prefix mode, we place the const declaration at top so it's done\n      // only once; But if we not prefixing, we place the declaration inside the\n      // with block so it doesn't incur the `in` check cost for every helper access.\n      if (ast.helpers.length > 0) {\n          {\n              // \"with\" mode.\n              // save Vue in a separate variable to avoid collision\n              push(`const _Vue = ${VueBinding}\\n`);\n              // in \"with\" mode, helpers are declared inside the with block to avoid\n              // has check cost, but hoists are lifted out of the function - we need\n              // to provide the helper here.\n              if (ast.hoists.length) {\n                  const staticHelpers = [\n                      CREATE_VNODE,\n                      CREATE_ELEMENT_VNODE,\n                      CREATE_COMMENT,\n                      CREATE_TEXT,\n                      CREATE_STATIC\n                  ]\n                      .filter(helper => ast.helpers.includes(helper))\n                      .map(aliasHelper)\n                      .join(', ');\n                  push(`const { ${staticHelpers} } = _Vue\\n`);\n              }\n          }\n      }\n      genHoists(ast.hoists, context);\n      newline();\n      push(`return `);\n  }\n  function genAssets(assets, type, { helper, push, newline, isTS }) {\n      const resolver = helper(type === 'component'\n              ? RESOLVE_COMPONENT\n              : RESOLVE_DIRECTIVE);\n      for (let i = 0; i < assets.length; i++) {\n          let id = assets[i];\n          // potential component implicit self-reference inferred from SFC filename\n          const maybeSelfReference = id.endsWith('__self');\n          if (maybeSelfReference) {\n              id = id.slice(0, -6);\n          }\n          push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);\n          if (i < assets.length - 1) {\n              newline();\n          }\n      }\n  }\n  function genHoists(hoists, context) {\n      if (!hoists.length) {\n          return;\n      }\n      context.pure = true;\n      const { push, newline, helper, scopeId, mode } = context;\n      newline();\n      hoists.forEach((exp, i) => {\n          if (exp) {\n              push(`const _hoisted_${i + 1} = `);\n              genNode(exp, context);\n              newline();\n          }\n      });\n      context.pure = false;\n  }\n  function isText$1(n) {\n      return (isString(n) ||\n          n.type === 4 /* SIMPLE_EXPRESSION */ ||\n          n.type === 2 /* TEXT */ ||\n          n.type === 5 /* INTERPOLATION */ ||\n          n.type === 8 /* COMPOUND_EXPRESSION */);\n  }\n  function genNodeListAsArray(nodes, context) {\n      const multilines = nodes.length > 3 ||\n          (nodes.some(n => isArray(n) || !isText$1(n)));\n      context.push(`[`);\n      multilines && context.indent();\n      genNodeList(nodes, context, multilines);\n      multilines && context.deindent();\n      context.push(`]`);\n  }\n  function genNodeList(nodes, context, multilines = false, comma = true) {\n      const { push, newline } = context;\n      for (let i = 0; i < nodes.length; i++) {\n          const node = nodes[i];\n          if (isString(node)) {\n              push(node);\n          }\n          else if (isArray(node)) {\n              genNodeListAsArray(node, context);\n          }\n          else {\n              genNode(node, context);\n          }\n          if (i < nodes.length - 1) {\n              if (multilines) {\n                  comma && push(',');\n                  newline();\n              }\n              else {\n                  comma && push(', ');\n              }\n          }\n      }\n  }\n  function genNode(node, context) {\n      if (isString(node)) {\n          context.push(node);\n          return;\n      }\n      if (isSymbol(node)) {\n          context.push(context.helper(node));\n          return;\n      }\n      switch (node.type) {\n          case 1 /* ELEMENT */:\n          case 9 /* IF */:\n          case 11 /* FOR */:\n              assert(node.codegenNode != null, `Codegen node is missing for element/if/for node. ` +\n                      `Apply appropriate transforms first.`);\n              genNode(node.codegenNode, context);\n              break;\n          case 2 /* TEXT */:\n              genText(node, context);\n              break;\n          case 4 /* SIMPLE_EXPRESSION */:\n              genExpression(node, context);\n              break;\n          case 5 /* INTERPOLATION */:\n              genInterpolation(node, context);\n              break;\n          case 12 /* TEXT_CALL */:\n              genNode(node.codegenNode, context);\n              break;\n          case 8 /* COMPOUND_EXPRESSION */:\n              genCompoundExpression(node, context);\n              break;\n          case 3 /* COMMENT */:\n              genComment(node, context);\n              break;\n          case 13 /* VNODE_CALL */:\n              genVNodeCall(node, context);\n              break;\n          case 14 /* JS_CALL_EXPRESSION */:\n              genCallExpression(node, context);\n              break;\n          case 15 /* JS_OBJECT_EXPRESSION */:\n              genObjectExpression(node, context);\n              break;\n          case 17 /* JS_ARRAY_EXPRESSION */:\n              genArrayExpression(node, context);\n              break;\n          case 18 /* JS_FUNCTION_EXPRESSION */:\n              genFunctionExpression(node, context);\n              break;\n          case 19 /* JS_CONDITIONAL_EXPRESSION */:\n              genConditionalExpression(node, context);\n              break;\n          case 20 /* JS_CACHE_EXPRESSION */:\n              genCacheExpression(node, context);\n              break;\n          case 21 /* JS_BLOCK_STATEMENT */:\n              genNodeList(node.body, context, true, false);\n              break;\n          // SSR only types\n          case 22 /* JS_TEMPLATE_LITERAL */:\n              break;\n          case 23 /* JS_IF_STATEMENT */:\n              break;\n          case 24 /* JS_ASSIGNMENT_EXPRESSION */:\n              break;\n          case 25 /* JS_SEQUENCE_EXPRESSION */:\n              break;\n          case 26 /* JS_RETURN_STATEMENT */:\n              break;\n          /* istanbul ignore next */\n          case 10 /* IF_BRANCH */:\n              // noop\n              break;\n          default:\n              {\n                  assert(false, `unhandled codegen node type: ${node.type}`);\n                  // make sure we exhaust all possible types\n                  const exhaustiveCheck = node;\n                  return exhaustiveCheck;\n              }\n      }\n  }\n  function genText(node, context) {\n      context.push(JSON.stringify(node.content), node);\n  }\n  function genExpression(node, context) {\n      const { content, isStatic } = node;\n      context.push(isStatic ? JSON.stringify(content) : content, node);\n  }\n  function genInterpolation(node, context) {\n      const { push, helper, pure } = context;\n      if (pure)\n          push(PURE_ANNOTATION);\n      push(`${helper(TO_DISPLAY_STRING)}(`);\n      genNode(node.content, context);\n      push(`)`);\n  }\n  function genCompoundExpression(node, context) {\n      for (let i = 0; i < node.children.length; i++) {\n          const child = node.children[i];\n          if (isString(child)) {\n              context.push(child);\n          }\n          else {\n              genNode(child, context);\n          }\n      }\n  }\n  function genExpressionAsPropertyKey(node, context) {\n      const { push } = context;\n      if (node.type === 8 /* COMPOUND_EXPRESSION */) {\n          push(`[`);\n          genCompoundExpression(node, context);\n          push(`]`);\n      }\n      else if (node.isStatic) {\n          // only quote keys if necessary\n          const text = isSimpleIdentifier(node.content)\n              ? node.content\n              : JSON.stringify(node.content);\n          push(text, node);\n      }\n      else {\n          push(`[${node.content}]`, node);\n      }\n  }\n  function genComment(node, context) {\n      const { push, helper, pure } = context;\n      if (pure) {\n          push(PURE_ANNOTATION);\n      }\n      push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);\n  }\n  function genVNodeCall(node, context) {\n      const { push, helper, pure } = context;\n      const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;\n      if (directives) {\n          push(helper(WITH_DIRECTIVES) + `(`);\n      }\n      if (isBlock) {\n          push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);\n      }\n      if (pure) {\n          push(PURE_ANNOTATION);\n      }\n      const callHelper = isBlock\n          ? getVNodeBlockHelper(context.inSSR, isComponent)\n          : getVNodeHelper(context.inSSR, isComponent);\n      push(helper(callHelper) + `(`, node);\n      genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);\n      push(`)`);\n      if (isBlock) {\n          push(`)`);\n      }\n      if (directives) {\n          push(`, `);\n          genNode(directives, context);\n          push(`)`);\n      }\n  }\n  function genNullableArgs(args) {\n      let i = args.length;\n      while (i--) {\n          if (args[i] != null)\n              break;\n      }\n      return args.slice(0, i + 1).map(arg => arg || `null`);\n  }\n  // JavaScript\n  function genCallExpression(node, context) {\n      const { push, helper, pure } = context;\n      const callee = isString(node.callee) ? node.callee : helper(node.callee);\n      if (pure) {\n          push(PURE_ANNOTATION);\n      }\n      push(callee + `(`, node);\n      genNodeList(node.arguments, context);\n      push(`)`);\n  }\n  function genObjectExpression(node, context) {\n      const { push, indent, deindent, newline } = context;\n      const { properties } = node;\n      if (!properties.length) {\n          push(`{}`, node);\n          return;\n      }\n      const multilines = properties.length > 1 ||\n          (properties.some(p => p.value.type !== 4 /* SIMPLE_EXPRESSION */));\n      push(multilines ? `{` : `{ `);\n      multilines && indent();\n      for (let i = 0; i < properties.length; i++) {\n          const { key, value } = properties[i];\n          // key\n          genExpressionAsPropertyKey(key, context);\n          push(`: `);\n          // value\n          genNode(value, context);\n          if (i < properties.length - 1) {\n              // will only reach this if it's multilines\n              push(`,`);\n              newline();\n          }\n      }\n      multilines && deindent();\n      push(multilines ? `}` : ` }`);\n  }\n  function genArrayExpression(node, context) {\n      genNodeListAsArray(node.elements, context);\n  }\n  function genFunctionExpression(node, context) {\n      const { push, indent, deindent } = context;\n      const { params, returns, body, newline, isSlot } = node;\n      if (isSlot) {\n          // wrap slot functions with owner context\n          push(`_${helperNameMap[WITH_CTX]}(`);\n      }\n      push(`(`, node);\n      if (isArray(params)) {\n          genNodeList(params, context);\n      }\n      else if (params) {\n          genNode(params, context);\n      }\n      push(`) => `);\n      if (newline || body) {\n          push(`{`);\n          indent();\n      }\n      if (returns) {\n          if (newline) {\n              push(`return `);\n          }\n          if (isArray(returns)) {\n              genNodeListAsArray(returns, context);\n          }\n          else {\n              genNode(returns, context);\n          }\n      }\n      else if (body) {\n          genNode(body, context);\n      }\n      if (newline || body) {\n          deindent();\n          push(`}`);\n      }\n      if (isSlot) {\n          push(`)`);\n      }\n  }\n  function genConditionalExpression(node, context) {\n      const { test, consequent, alternate, newline: needNewline } = node;\n      const { push, indent, deindent, newline } = context;\n      if (test.type === 4 /* SIMPLE_EXPRESSION */) {\n          const needsParens = !isSimpleIdentifier(test.content);\n          needsParens && push(`(`);\n          genExpression(test, context);\n          needsParens && push(`)`);\n      }\n      else {\n          push(`(`);\n          genNode(test, context);\n          push(`)`);\n      }\n      needNewline && indent();\n      context.indentLevel++;\n      needNewline || push(` `);\n      push(`? `);\n      genNode(consequent, context);\n      context.indentLevel--;\n      needNewline && newline();\n      needNewline || push(` `);\n      push(`: `);\n      const isNested = alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */;\n      if (!isNested) {\n          context.indentLevel++;\n      }\n      genNode(alternate, context);\n      if (!isNested) {\n          context.indentLevel--;\n      }\n      needNewline && deindent(true /* without newline */);\n  }\n  function genCacheExpression(node, context) {\n      const { push, helper, indent, deindent, newline } = context;\n      push(`_cache[${node.index}] || (`);\n      if (node.isVNode) {\n          indent();\n          push(`${helper(SET_BLOCK_TRACKING)}(-1),`);\n          newline();\n      }\n      push(`_cache[${node.index}] = `);\n      genNode(node.value, context);\n      if (node.isVNode) {\n          push(`,`);\n          newline();\n          push(`${helper(SET_BLOCK_TRACKING)}(1),`);\n          newline();\n          push(`_cache[${node.index}]`);\n          deindent();\n      }\n      push(`)`);\n  }\n\n  // these keywords should not appear inside expressions, but operators like\n  // typeof, instanceof and in are allowed\n  const prohibitedKeywordRE = new RegExp('\\\\b' +\n      ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n          'super,throw,while,yield,delete,export,import,return,switch,default,' +\n          'extends,finally,continue,debugger,function,arguments,typeof,void')\n          .split(',')\n          .join('\\\\b|\\\\b') +\n      '\\\\b');\n  // strip strings in expressions\n  const stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n  /**\n   * Validate a non-prefixed expression.\n   * This is only called when using the in-browser runtime compiler since it\n   * doesn't prefix expressions.\n   */\n  function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {\n      const exp = node.content;\n      // empty expressions are validated per-directive since some directives\n      // do allow empty expressions.\n      if (!exp.trim()) {\n          return;\n      }\n      try {\n          new Function(asRawStatements\n              ? ` ${exp} `\n              : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`);\n      }\n      catch (e) {\n          let message = e.message;\n          const keywordMatch = exp\n              .replace(stripStringRE, '')\n              .match(prohibitedKeywordRE);\n          if (keywordMatch) {\n              message = `avoid using JavaScript keyword as property name: \"${keywordMatch[0]}\"`;\n          }\n          context.onError(createCompilerError(43 /* X_INVALID_EXPRESSION */, node.loc, undefined, message));\n      }\n  }\n\n  const transformExpression = (node, context) => {\n      if (node.type === 5 /* INTERPOLATION */) {\n          node.content = processExpression(node.content, context);\n      }\n      else if (node.type === 1 /* ELEMENT */) {\n          // handle directives on element\n          for (let i = 0; i < node.props.length; i++) {\n              const dir = node.props[i];\n              // do not process for v-on & v-for since they are special handled\n              if (dir.type === 7 /* DIRECTIVE */ && dir.name !== 'for') {\n                  const exp = dir.exp;\n                  const arg = dir.arg;\n                  // do not process exp if this is v-on:arg - we need special handling\n                  // for wrapping inline statements.\n                  if (exp &&\n                      exp.type === 4 /* SIMPLE_EXPRESSION */ &&\n                      !(dir.name === 'on' && arg)) {\n                      dir.exp = processExpression(exp, context, \n                      // slot args must be processed as function params\n                      dir.name === 'slot');\n                  }\n                  if (arg && arg.type === 4 /* SIMPLE_EXPRESSION */ && !arg.isStatic) {\n                      dir.arg = processExpression(arg, context);\n                  }\n              }\n          }\n      }\n  };\n  // Important: since this function uses Node.js only dependencies, it should\n  // always be used with a leading !true check so that it can be\n  // tree-shaken from the browser build.\n  function processExpression(node, context, \n  // some expressions like v-slot props & v-for aliases should be parsed as\n  // function params\n  asParams = false, \n  // v-on handler values may contain multiple statements\n  asRawStatements = false) {\n      {\n          {\n              // simple in-browser validation (same logic in 2.x)\n              validateBrowserExpression(node, context, asParams, asRawStatements);\n          }\n          return node;\n      }\n  }\n\n  const transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {\n      return processIf(node, dir, context, (ifNode, branch, isRoot) => {\n          // #1587: We need to dynamically increment the key based on the current\n          // node's sibling nodes, since chained v-if/else branches are\n          // rendered at the same depth\n          const siblings = context.parent.children;\n          let i = siblings.indexOf(ifNode);\n          let key = 0;\n          while (i-- >= 0) {\n              const sibling = siblings[i];\n              if (sibling && sibling.type === 9 /* IF */) {\n                  key += sibling.branches.length;\n              }\n          }\n          // Exit callback. Complete the codegenNode when all children have been\n          // transformed.\n          return () => {\n              if (isRoot) {\n                  ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);\n              }\n              else {\n                  // attach this branch's codegen node to the v-if root.\n                  const parentCondition = getParentCondition(ifNode.codegenNode);\n                  parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);\n              }\n          };\n      });\n  });\n  // target-agnostic transform used for both Client and SSR\n  function processIf(node, dir, context, processCodegen) {\n      if (dir.name !== 'else' &&\n          (!dir.exp || !dir.exp.content.trim())) {\n          const loc = dir.exp ? dir.exp.loc : node.loc;\n          context.onError(createCompilerError(27 /* X_V_IF_NO_EXPRESSION */, dir.loc));\n          dir.exp = createSimpleExpression(`true`, false, loc);\n      }\n      if (dir.exp) {\n          validateBrowserExpression(dir.exp, context);\n      }\n      if (dir.name === 'if') {\n          const branch = createIfBranch(node, dir);\n          const ifNode = {\n              type: 9 /* IF */,\n              loc: node.loc,\n              branches: [branch]\n          };\n          context.replaceNode(ifNode);\n          if (processCodegen) {\n              return processCodegen(ifNode, branch, true);\n          }\n      }\n      else {\n          // locate the adjacent v-if\n          const siblings = context.parent.children;\n          const comments = [];\n          let i = siblings.indexOf(node);\n          while (i-- >= -1) {\n              const sibling = siblings[i];\n              if (sibling && sibling.type === 3 /* COMMENT */) {\n                  context.removeNode(sibling);\n                  comments.unshift(sibling);\n                  continue;\n              }\n              if (sibling &&\n                  sibling.type === 2 /* TEXT */ &&\n                  !sibling.content.trim().length) {\n                  context.removeNode(sibling);\n                  continue;\n              }\n              if (sibling && sibling.type === 9 /* IF */) {\n                  // move the node to the if node's branches\n                  context.removeNode();\n                  const branch = createIfBranch(node, dir);\n                  if (comments.length &&\n                      // #3619 ignore comments if the v-if is direct child of <transition>\n                      !(context.parent &&\n                          context.parent.type === 1 /* ELEMENT */ &&\n                          isBuiltInType(context.parent.tag, 'transition'))) {\n                      branch.children = [...comments, ...branch.children];\n                  }\n                  // check if user is forcing same key on different branches\n                  {\n                      const key = branch.userKey;\n                      if (key) {\n                          sibling.branches.forEach(({ userKey }) => {\n                              if (isSameKey(userKey, key)) {\n                                  context.onError(createCompilerError(28 /* X_V_IF_SAME_KEY */, branch.userKey.loc));\n                              }\n                          });\n                      }\n                  }\n                  sibling.branches.push(branch);\n                  const onExit = processCodegen && processCodegen(sibling, branch, false);\n                  // since the branch was removed, it will not be traversed.\n                  // make sure to traverse here.\n                  traverseNode(branch, context);\n                  // call on exit\n                  if (onExit)\n                      onExit();\n                  // make sure to reset currentNode after traversal to indicate this\n                  // node has been removed.\n                  context.currentNode = null;\n              }\n              else {\n                  context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));\n              }\n              break;\n          }\n      }\n  }\n  function createIfBranch(node, dir) {\n      return {\n          type: 10 /* IF_BRANCH */,\n          loc: node.loc,\n          condition: dir.name === 'else' ? undefined : dir.exp,\n          children: node.tagType === 3 /* TEMPLATE */ && !findDir(node, 'for')\n              ? node.children\n              : [node],\n          userKey: findProp(node, `key`)\n      };\n  }\n  function createCodegenNodeForBranch(branch, keyIndex, context) {\n      if (branch.condition) {\n          return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context), \n          // make sure to pass in asBlock: true so that the comment node call\n          // closes the current block.\n          createCallExpression(context.helper(CREATE_COMMENT), [\n              '\"v-if\"' ,\n              'true'\n          ]));\n      }\n      else {\n          return createChildrenCodegenNode(branch, keyIndex, context);\n      }\n  }\n  function createChildrenCodegenNode(branch, keyIndex, context) {\n      const { helper } = context;\n      const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 /* CAN_HOIST */));\n      const { children } = branch;\n      const firstChild = children[0];\n      const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 /* ELEMENT */;\n      if (needFragmentWrapper) {\n          if (children.length === 1 && firstChild.type === 11 /* FOR */) {\n              // optimize away nested fragments when child is a ForNode\n              const vnodeCall = firstChild.codegenNode;\n              injectProp(vnodeCall, keyProperty, context);\n              return vnodeCall;\n          }\n          else {\n              let patchFlag = 64 /* STABLE_FRAGMENT */;\n              let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];\n              // check if the fragment actually contains a single valid child with\n              // the rest being comments\n              if (children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {\n                  patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;\n                  patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;\n              }\n              return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + (` /* ${patchFlagText} */` ), undefined, undefined, true, false, false /* isComponent */, branch.loc);\n          }\n      }\n      else {\n          const ret = firstChild.codegenNode;\n          const vnodeCall = getMemoedVNodeCall(ret);\n          // Change createVNode to createBlock.\n          if (vnodeCall.type === 13 /* VNODE_CALL */) {\n              makeBlock(vnodeCall, context);\n          }\n          // inject branch key\n          injectProp(vnodeCall, keyProperty, context);\n          return ret;\n      }\n  }\n  function isSameKey(a, b) {\n      if (!a || a.type !== b.type) {\n          return false;\n      }\n      if (a.type === 6 /* ATTRIBUTE */) {\n          if (a.value.content !== b.value.content) {\n              return false;\n          }\n      }\n      else {\n          // directive\n          const exp = a.exp;\n          const branchExp = b.exp;\n          if (exp.type !== branchExp.type) {\n              return false;\n          }\n          if (exp.type !== 4 /* SIMPLE_EXPRESSION */ ||\n              exp.isStatic !== branchExp.isStatic ||\n              exp.content !== branchExp.content) {\n              return false;\n          }\n      }\n      return true;\n  }\n  function getParentCondition(node) {\n      while (true) {\n          if (node.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {\n              if (node.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {\n                  node = node.alternate;\n              }\n              else {\n                  return node;\n              }\n          }\n          else if (node.type === 20 /* JS_CACHE_EXPRESSION */) {\n              node = node.value;\n          }\n      }\n  }\n\n  const transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {\n      const { helper, removeHelper } = context;\n      return processFor(node, dir, context, forNode => {\n          // create the loop render function expression now, and add the\n          // iterator on exit after all children have been traversed\n          const renderExp = createCallExpression(helper(RENDER_LIST), [\n              forNode.source\n          ]);\n          const memo = findDir(node, 'memo');\n          const keyProp = findProp(node, `key`);\n          const keyExp = keyProp &&\n              (keyProp.type === 6 /* ATTRIBUTE */\n                  ? createSimpleExpression(keyProp.value.content, true)\n                  : keyProp.exp);\n          const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;\n          const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&\n              forNode.source.constType > 0 /* NOT_CONSTANT */;\n          const fragmentFlag = isStableFragment\n              ? 64 /* STABLE_FRAGMENT */\n              : keyProp\n                  ? 128 /* KEYED_FRAGMENT */\n                  : 256 /* UNKEYED_FRAGMENT */;\n          forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +\n              (` /* ${PatchFlagNames[fragmentFlag]} */` ), undefined, undefined, true /* isBlock */, !isStableFragment /* disableTracking */, false /* isComponent */, node.loc);\n          return () => {\n              // finish the codegen now that all children have been traversed\n              let childBlock;\n              const isTemplate = isTemplateNode(node);\n              const { children } = forNode;\n              // check <template v-for> key placement\n              if (isTemplate) {\n                  node.children.some(c => {\n                      if (c.type === 1 /* ELEMENT */) {\n                          const key = findProp(c, 'key');\n                          if (key) {\n                              context.onError(createCompilerError(32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */, key.loc));\n                              return true;\n                          }\n                      }\n                  });\n              }\n              const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 /* ELEMENT */;\n              const slotOutlet = isSlotOutlet(node)\n                  ? node\n                  : isTemplate &&\n                      node.children.length === 1 &&\n                      isSlotOutlet(node.children[0])\n                      ? node.children[0] // api-extractor somehow fails to infer this\n                      : null;\n              if (slotOutlet) {\n                  // <slot v-for=\"...\"> or <template v-for=\"...\"><slot/></template>\n                  childBlock = slotOutlet.codegenNode;\n                  if (isTemplate && keyProperty) {\n                      // <template v-for=\"...\" :key=\"...\"><slot/></template>\n                      // we need to inject the key to the renderSlot() call.\n                      // the props for renderSlot is passed as the 3rd argument.\n                      injectProp(childBlock, keyProperty, context);\n                  }\n              }\n              else if (needFragmentWrapper) {\n                  // <template v-for=\"...\"> with text or multi-elements\n                  // should generate a fragment block for each loop\n                  childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 /* STABLE_FRAGMENT */ +\n                      (` /* ${PatchFlagNames[64 /* STABLE_FRAGMENT */]} */`\n                          ), undefined, undefined, true, undefined, false /* isComponent */);\n              }\n              else {\n                  // Normal element v-for. Directly use the child's codegenNode\n                  // but mark it as a block.\n                  childBlock = children[0]\n                      .codegenNode;\n                  if (isTemplate && keyProperty) {\n                      injectProp(childBlock, keyProperty, context);\n                  }\n                  if (childBlock.isBlock !== !isStableFragment) {\n                      if (childBlock.isBlock) {\n                          // switch from block to vnode\n                          removeHelper(OPEN_BLOCK);\n                          removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\n                      }\n                      else {\n                          // switch from vnode to block\n                          removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));\n                      }\n                  }\n                  childBlock.isBlock = !isStableFragment;\n                  if (childBlock.isBlock) {\n                      helper(OPEN_BLOCK);\n                      helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\n                  }\n                  else {\n                      helper(getVNodeHelper(context.inSSR, childBlock.isComponent));\n                  }\n              }\n              if (memo) {\n                  const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [\n                      createSimpleExpression(`_cached`)\n                  ]));\n                  loop.body = createBlockStatement([\n                      createCompoundExpression([`const _memo = (`, memo.exp, `)`]),\n                      createCompoundExpression([\n                          `if (_cached`,\n                          ...(keyExp ? [` && _cached.key === `, keyExp] : []),\n                          ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`\n                      ]),\n                      createCompoundExpression([`const _item = `, childBlock]),\n                      createSimpleExpression(`_item.memo = _memo`),\n                      createSimpleExpression(`return _item`)\n                  ]);\n                  renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));\n              }\n              else {\n                  renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true /* force newline */));\n              }\n          };\n      });\n  });\n  // target-agnostic transform used for both Client and SSR\n  function processFor(node, dir, context, processCodegen) {\n      if (!dir.exp) {\n          context.onError(createCompilerError(30 /* X_V_FOR_NO_EXPRESSION */, dir.loc));\n          return;\n      }\n      const parseResult = parseForExpression(\n      // can only be simple expression because vFor transform is applied\n      // before expression transform.\n      dir.exp, context);\n      if (!parseResult) {\n          context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, dir.loc));\n          return;\n      }\n      const { addIdentifiers, removeIdentifiers, scopes } = context;\n      const { source, value, key, index } = parseResult;\n      const forNode = {\n          type: 11 /* FOR */,\n          loc: dir.loc,\n          source,\n          valueAlias: value,\n          keyAlias: key,\n          objectIndexAlias: index,\n          parseResult,\n          children: isTemplateNode(node) ? node.children : [node]\n      };\n      context.replaceNode(forNode);\n      // bookkeeping\n      scopes.vFor++;\n      const onExit = processCodegen && processCodegen(forNode);\n      return () => {\n          scopes.vFor--;\n          if (onExit)\n              onExit();\n      };\n  }\n  const forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\n  // This regex doesn't cover the case if key or index aliases have destructuring,\n  // but those do not make sense in the first place, so this works in practice.\n  const forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\n  const stripParensRE = /^\\(|\\)$/g;\n  function parseForExpression(input, context) {\n      const loc = input.loc;\n      const exp = input.content;\n      const inMatch = exp.match(forAliasRE);\n      if (!inMatch)\n          return;\n      const [, LHS, RHS] = inMatch;\n      const result = {\n          source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),\n          value: undefined,\n          key: undefined,\n          index: undefined\n      };\n      {\n          validateBrowserExpression(result.source, context);\n      }\n      let valueContent = LHS.trim().replace(stripParensRE, '').trim();\n      const trimmedOffset = LHS.indexOf(valueContent);\n      const iteratorMatch = valueContent.match(forIteratorRE);\n      if (iteratorMatch) {\n          valueContent = valueContent.replace(forIteratorRE, '').trim();\n          const keyContent = iteratorMatch[1].trim();\n          let keyOffset;\n          if (keyContent) {\n              keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);\n              result.key = createAliasExpression(loc, keyContent, keyOffset);\n              {\n                  validateBrowserExpression(result.key, context, true);\n              }\n          }\n          if (iteratorMatch[2]) {\n              const indexContent = iteratorMatch[2].trim();\n              if (indexContent) {\n                  result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key\n                      ? keyOffset + keyContent.length\n                      : trimmedOffset + valueContent.length));\n                  {\n                      validateBrowserExpression(result.index, context, true);\n                  }\n              }\n          }\n      }\n      if (valueContent) {\n          result.value = createAliasExpression(loc, valueContent, trimmedOffset);\n          {\n              validateBrowserExpression(result.value, context, true);\n          }\n      }\n      return result;\n  }\n  function createAliasExpression(range, content, offset) {\n      return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));\n  }\n  function createForLoopParams({ value, key, index }, memoArgs = []) {\n      return createParamsList([value, key, index, ...memoArgs]);\n  }\n  function createParamsList(args) {\n      let i = args.length;\n      while (i--) {\n          if (args[i])\n              break;\n      }\n      return args\n          .slice(0, i + 1)\n          .map((arg, i) => arg || createSimpleExpression(`_`.repeat(i + 1), false));\n  }\n\n  const defaultFallback = createSimpleExpression(`undefined`, false);\n  // A NodeTransform that:\n  // 1. Tracks scope identifiers for scoped slots so that they don't get prefixed\n  //    by transformExpression. This is only applied in non-browser builds with\n  //    { prefixIdentifiers: true }.\n  // 2. Track v-slot depths so that we know a slot is inside another slot.\n  //    Note the exit callback is executed before buildSlots() on the same node,\n  //    so only nested slots see positive numbers.\n  const trackSlotScopes = (node, context) => {\n      if (node.type === 1 /* ELEMENT */ &&\n          (node.tagType === 1 /* COMPONENT */ ||\n              node.tagType === 3 /* TEMPLATE */)) {\n          // We are only checking non-empty v-slot here\n          // since we only care about slots that introduce scope variables.\n          const vSlot = findDir(node, 'slot');\n          if (vSlot) {\n              vSlot.exp;\n              context.scopes.vSlot++;\n              return () => {\n                  context.scopes.vSlot--;\n              };\n          }\n      }\n  };\n  const buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false /* newline */, true /* isSlot */, children.length ? children[0].loc : loc);\n  // Instead of being a DirectiveTransform, v-slot processing is called during\n  // transformElement to build the slots object for a component.\n  function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {\n      context.helper(WITH_CTX);\n      const { children, loc } = node;\n      const slotsProperties = [];\n      const dynamicSlots = [];\n      // If the slot is inside a v-for or another v-slot, force it to be dynamic\n      // since it likely uses a scope variable.\n      let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;\n      // 1. Check for slot with slotProps on component itself.\n      //    <Comp v-slot=\"{ prop }\"/>\n      const onComponentSlot = findDir(node, 'slot', true);\n      if (onComponentSlot) {\n          const { arg, exp } = onComponentSlot;\n          if (arg && !isStaticExp(arg)) {\n              hasDynamicSlots = true;\n          }\n          slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));\n      }\n      // 2. Iterate through children and check for template slots\n      //    <template v-slot:foo=\"{ prop }\">\n      let hasTemplateSlots = false;\n      let hasNamedDefaultSlot = false;\n      const implicitDefaultChildren = [];\n      const seenSlotNames = new Set();\n      for (let i = 0; i < children.length; i++) {\n          const slotElement = children[i];\n          let slotDir;\n          if (!isTemplateNode(slotElement) ||\n              !(slotDir = findDir(slotElement, 'slot', true))) {\n              // not a <template v-slot>, skip.\n              if (slotElement.type !== 3 /* COMMENT */) {\n                  implicitDefaultChildren.push(slotElement);\n              }\n              continue;\n          }\n          if (onComponentSlot) {\n              // already has on-component slot - this is incorrect usage.\n              context.onError(createCompilerError(36 /* X_V_SLOT_MIXED_SLOT_USAGE */, slotDir.loc));\n              break;\n          }\n          hasTemplateSlots = true;\n          const { children: slotChildren, loc: slotLoc } = slotElement;\n          const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;\n          // check if name is dynamic.\n          let staticSlotName;\n          if (isStaticExp(slotName)) {\n              staticSlotName = slotName ? slotName.content : `default`;\n          }\n          else {\n              hasDynamicSlots = true;\n          }\n          const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);\n          // check if this slot is conditional (v-if/v-for)\n          let vIf;\n          let vElse;\n          let vFor;\n          if ((vIf = findDir(slotElement, 'if'))) {\n              hasDynamicSlots = true;\n              dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));\n          }\n          else if ((vElse = findDir(slotElement, /^else(-if)?$/, true /* allowEmpty */))) {\n              // find adjacent v-if\n              let j = i;\n              let prev;\n              while (j--) {\n                  prev = children[j];\n                  if (prev.type !== 3 /* COMMENT */) {\n                      break;\n                  }\n              }\n              if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {\n                  // remove node\n                  children.splice(i, 1);\n                  i--;\n                  // attach this slot to previous conditional\n                  let conditional = dynamicSlots[dynamicSlots.length - 1];\n                  while (conditional.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {\n                      conditional = conditional.alternate;\n                  }\n                  conditional.alternate = vElse.exp\n                      ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)\n                      : buildDynamicSlot(slotName, slotFunction);\n              }\n              else {\n                  context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, vElse.loc));\n              }\n          }\n          else if ((vFor = findDir(slotElement, 'for'))) {\n              hasDynamicSlots = true;\n              const parseResult = vFor.parseResult ||\n                  parseForExpression(vFor.exp, context);\n              if (parseResult) {\n                  // Render the dynamic slots as an array and add it to the createSlot()\n                  // args. The runtime knows how to handle it appropriately.\n                  dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [\n                      parseResult.source,\n                      createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true /* force newline */)\n                  ]));\n              }\n              else {\n                  context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, vFor.loc));\n              }\n          }\n          else {\n              // check duplicate static names\n              if (staticSlotName) {\n                  if (seenSlotNames.has(staticSlotName)) {\n                      context.onError(createCompilerError(37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */, dirLoc));\n                      continue;\n                  }\n                  seenSlotNames.add(staticSlotName);\n                  if (staticSlotName === 'default') {\n                      hasNamedDefaultSlot = true;\n                  }\n              }\n              slotsProperties.push(createObjectProperty(slotName, slotFunction));\n          }\n      }\n      if (!onComponentSlot) {\n          const buildDefaultSlotProperty = (props, children) => {\n              const fn = buildSlotFn(props, children, loc);\n              return createObjectProperty(`default`, fn);\n          };\n          if (!hasTemplateSlots) {\n              // implicit default slot (on component)\n              slotsProperties.push(buildDefaultSlotProperty(undefined, children));\n          }\n          else if (implicitDefaultChildren.length &&\n              // #3766\n              // with whitespace: 'preserve', whitespaces between slots will end up in\n              // implicitDefaultChildren. Ignore if all implicit children are whitespaces.\n              implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {\n              // implicit default slot (mixed with named slots)\n              if (hasNamedDefaultSlot) {\n                  context.onError(createCompilerError(38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */, implicitDefaultChildren[0].loc));\n              }\n              else {\n                  slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));\n              }\n          }\n      }\n      const slotFlag = hasDynamicSlots\n          ? 2 /* DYNAMIC */\n          : hasForwardedSlots(node.children)\n              ? 3 /* FORWARDED */\n              : 1 /* STABLE */;\n      let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, \n      // 2 = compiled but dynamic = can skip normalization, but must run diff\n      // 1 = compiled and static = can skip normalization AND diff as optimized\n      createSimpleExpression(slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ), false))), loc);\n      if (dynamicSlots.length) {\n          slots = createCallExpression(context.helper(CREATE_SLOTS), [\n              slots,\n              createArrayExpression(dynamicSlots)\n          ]);\n      }\n      return {\n          slots,\n          hasDynamicSlots\n      };\n  }\n  function buildDynamicSlot(name, fn) {\n      return createObjectExpression([\n          createObjectProperty(`name`, name),\n          createObjectProperty(`fn`, fn)\n      ]);\n  }\n  function hasForwardedSlots(children) {\n      for (let i = 0; i < children.length; i++) {\n          const child = children[i];\n          switch (child.type) {\n              case 1 /* ELEMENT */:\n                  if (child.tagType === 2 /* SLOT */ ||\n                      hasForwardedSlots(child.children)) {\n                      return true;\n                  }\n                  break;\n              case 9 /* IF */:\n                  if (hasForwardedSlots(child.branches))\n                      return true;\n                  break;\n              case 10 /* IF_BRANCH */:\n              case 11 /* FOR */:\n                  if (hasForwardedSlots(child.children))\n                      return true;\n                  break;\n          }\n      }\n      return false;\n  }\n  function isNonWhitespaceContent(node) {\n      if (node.type !== 2 /* TEXT */ && node.type !== 12 /* TEXT_CALL */)\n          return true;\n      return node.type === 2 /* TEXT */\n          ? !!node.content.trim()\n          : isNonWhitespaceContent(node.content);\n  }\n\n  // some directive transforms (e.g. v-model) may return a symbol for runtime\n  // import, which should be used instead of a resolveDirective call.\n  const directiveImportMap = new WeakMap();\n  // generate a JavaScript AST for this element's codegen\n  const transformElement = (node, context) => {\n      // perform the work on exit, after all child expressions have been\n      // processed and merged.\n      return function postTransformElement() {\n          node = context.currentNode;\n          if (!(node.type === 1 /* ELEMENT */ &&\n              (node.tagType === 0 /* ELEMENT */ ||\n                  node.tagType === 1 /* COMPONENT */))) {\n              return;\n          }\n          const { tag, props } = node;\n          const isComponent = node.tagType === 1 /* COMPONENT */;\n          // The goal of the transform is to create a codegenNode implementing the\n          // VNodeCall interface.\n          let vnodeTag = isComponent\n              ? resolveComponentType(node, context)\n              : `\"${tag}\"`;\n          const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;\n          let vnodeProps;\n          let vnodeChildren;\n          let vnodePatchFlag;\n          let patchFlag = 0;\n          let vnodeDynamicProps;\n          let dynamicPropNames;\n          let vnodeDirectives;\n          let shouldUseBlock = \n          // dynamic component may resolve to plain elements\n          isDynamicComponent ||\n              vnodeTag === TELEPORT ||\n              vnodeTag === SUSPENSE ||\n              (!isComponent &&\n                  // <svg> and <foreignObject> must be forced into blocks so that block\n                  // updates inside get proper isSVG flag at runtime. (#639, #643)\n                  // This is technically web-specific, but splitting the logic out of core\n                  // leads to too much unnecessary complexity.\n                  (tag === 'svg' ||\n                      tag === 'foreignObject' ||\n                      // #938: elements with dynamic keys should be forced into blocks\n                      findProp(node, 'key', true)));\n          // props\n          if (props.length > 0) {\n              const propsBuildResult = buildProps(node, context);\n              vnodeProps = propsBuildResult.props;\n              patchFlag = propsBuildResult.patchFlag;\n              dynamicPropNames = propsBuildResult.dynamicPropNames;\n              const directives = propsBuildResult.directives;\n              vnodeDirectives =\n                  directives && directives.length\n                      ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))\n                      : undefined;\n          }\n          // children\n          if (node.children.length > 0) {\n              if (vnodeTag === KEEP_ALIVE) {\n                  // Although a built-in component, we compile KeepAlive with raw children\n                  // instead of slot functions so that it can be used inside Transition\n                  // or other Transition-wrapping HOCs.\n                  // To ensure correct updates with block optimizations, we need to:\n                  // 1. Force keep-alive into a block. This avoids its children being\n                  //    collected by a parent block.\n                  shouldUseBlock = true;\n                  // 2. Force keep-alive to always be updated, since it uses raw children.\n                  patchFlag |= 1024 /* DYNAMIC_SLOTS */;\n                  if (node.children.length > 1) {\n                      context.onError(createCompilerError(44 /* X_KEEP_ALIVE_INVALID_CHILDREN */, {\n                          start: node.children[0].loc.start,\n                          end: node.children[node.children.length - 1].loc.end,\n                          source: ''\n                      }));\n                  }\n              }\n              const shouldBuildAsSlots = isComponent &&\n                  // Teleport is not a real component and has dedicated runtime handling\n                  vnodeTag !== TELEPORT &&\n                  // explained above.\n                  vnodeTag !== KEEP_ALIVE;\n              if (shouldBuildAsSlots) {\n                  const { slots, hasDynamicSlots } = buildSlots(node, context);\n                  vnodeChildren = slots;\n                  if (hasDynamicSlots) {\n                      patchFlag |= 1024 /* DYNAMIC_SLOTS */;\n                  }\n              }\n              else if (node.children.length === 1 && vnodeTag !== TELEPORT) {\n                  const child = node.children[0];\n                  const type = child.type;\n                  // check for dynamic text children\n                  const hasDynamicTextChild = type === 5 /* INTERPOLATION */ ||\n                      type === 8 /* COMPOUND_EXPRESSION */;\n                  if (hasDynamicTextChild &&\n                      getConstantType(child, context) === 0 /* NOT_CONSTANT */) {\n                      patchFlag |= 1 /* TEXT */;\n                  }\n                  // pass directly if the only child is a text node\n                  // (plain / interpolation / expression)\n                  if (hasDynamicTextChild || type === 2 /* TEXT */) {\n                      vnodeChildren = child;\n                  }\n                  else {\n                      vnodeChildren = node.children;\n                  }\n              }\n              else {\n                  vnodeChildren = node.children;\n              }\n          }\n          // patchFlag & dynamicPropNames\n          if (patchFlag !== 0) {\n              {\n                  if (patchFlag < 0) {\n                      // special flags (negative and mutually exclusive)\n                      vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;\n                  }\n                  else {\n                      // bitwise flags\n                      const flagNames = Object.keys(PatchFlagNames)\n                          .map(Number)\n                          .filter(n => n > 0 && patchFlag & n)\n                          .map(n => PatchFlagNames[n])\n                          .join(`, `);\n                      vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;\n                  }\n              }\n              if (dynamicPropNames && dynamicPropNames.length) {\n                  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);\n              }\n          }\n          node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false /* disableTracking */, isComponent, node.loc);\n      };\n  };\n  function resolveComponentType(node, context, ssr = false) {\n      let { tag } = node;\n      // 1. dynamic component\n      const isExplicitDynamic = isComponentTag(tag);\n      const isProp = findProp(node, 'is');\n      if (isProp) {\n          if (isExplicitDynamic ||\n              (false )) {\n              const exp = isProp.type === 6 /* ATTRIBUTE */\n                  ? isProp.value && createSimpleExpression(isProp.value.content, true)\n                  : isProp.exp;\n              if (exp) {\n                  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\n                      exp\n                  ]);\n              }\n          }\n          else if (isProp.type === 6 /* ATTRIBUTE */ &&\n              isProp.value.content.startsWith('vue:')) {\n              // <button is=\"vue:xxx\">\n              // if not <component>, only is value that starts with \"vue:\" will be\n              // treated as component by the parse phase and reach here, unless it's\n              // compat mode where all is values are considered components\n              tag = isProp.value.content.slice(4);\n          }\n      }\n      // 1.5 v-is (TODO: Deprecate)\n      const isDir = !isExplicitDynamic && findDir(node, 'is');\n      if (isDir && isDir.exp) {\n          return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\n              isDir.exp\n          ]);\n      }\n      // 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)\n      const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);\n      if (builtIn) {\n          // built-ins are simply fallthroughs / have special handling during ssr\n          // so we don't need to import their runtime equivalents\n          if (!ssr)\n              context.helper(builtIn);\n          return builtIn;\n      }\n      // 5. user component (resolve)\n      context.helper(RESOLVE_COMPONENT);\n      context.components.add(tag);\n      return toValidAssetId(tag, `component`);\n  }\n  function buildProps(node, context, props = node.props, ssr = false) {\n      const { tag, loc: elementLoc } = node;\n      const isComponent = node.tagType === 1 /* COMPONENT */;\n      let properties = [];\n      const mergeArgs = [];\n      const runtimeDirectives = [];\n      // patchFlag analysis\n      let patchFlag = 0;\n      let hasRef = false;\n      let hasClassBinding = false;\n      let hasStyleBinding = false;\n      let hasHydrationEventBinding = false;\n      let hasDynamicKeys = false;\n      let hasVnodeHook = false;\n      const dynamicPropNames = [];\n      const analyzePatchFlag = ({ key, value }) => {\n          if (isStaticExp(key)) {\n              const name = key.content;\n              const isEventHandler = isOn(name);\n              if (!isComponent &&\n                  isEventHandler &&\n                  // omit the flag for click handlers because hydration gives click\n                  // dedicated fast path.\n                  name.toLowerCase() !== 'onclick' &&\n                  // omit v-model handlers\n                  name !== 'onUpdate:modelValue' &&\n                  // omit onVnodeXXX hooks\n                  !isReservedProp(name)) {\n                  hasHydrationEventBinding = true;\n              }\n              if (isEventHandler && isReservedProp(name)) {\n                  hasVnodeHook = true;\n              }\n              if (value.type === 20 /* JS_CACHE_EXPRESSION */ ||\n                  ((value.type === 4 /* SIMPLE_EXPRESSION */ ||\n                      value.type === 8 /* COMPOUND_EXPRESSION */) &&\n                      getConstantType(value, context) > 0)) {\n                  // skip if the prop is a cached handler or has constant value\n                  return;\n              }\n              if (name === 'ref') {\n                  hasRef = true;\n              }\n              else if (name === 'class') {\n                  hasClassBinding = true;\n              }\n              else if (name === 'style') {\n                  hasStyleBinding = true;\n              }\n              else if (name !== 'key' && !dynamicPropNames.includes(name)) {\n                  dynamicPropNames.push(name);\n              }\n              // treat the dynamic class and style binding of the component as dynamic props\n              if (isComponent &&\n                  (name === 'class' || name === 'style') &&\n                  !dynamicPropNames.includes(name)) {\n                  dynamicPropNames.push(name);\n              }\n          }\n          else {\n              hasDynamicKeys = true;\n          }\n      };\n      for (let i = 0; i < props.length; i++) {\n          // static attribute\n          const prop = props[i];\n          if (prop.type === 6 /* ATTRIBUTE */) {\n              const { loc, name, value } = prop;\n              let isStatic = true;\n              if (name === 'ref') {\n                  hasRef = true;\n              }\n              // skip is on <component>, or is=\"vue:xxx\"\n              if (name === 'is' &&\n                  (isComponentTag(tag) ||\n                      (value && value.content.startsWith('vue:')) ||\n                      (false ))) {\n                  continue;\n              }\n              properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));\n          }\n          else {\n              // directives\n              const { name, arg, exp, loc } = prop;\n              const isVBind = name === 'bind';\n              const isVOn = name === 'on';\n              // skip v-slot - it is handled by its dedicated transform.\n              if (name === 'slot') {\n                  if (!isComponent) {\n                      context.onError(createCompilerError(39 /* X_V_SLOT_MISPLACED */, loc));\n                  }\n                  continue;\n              }\n              // skip v-once/v-memo - they are handled by dedicated transforms.\n              if (name === 'once' || name === 'memo') {\n                  continue;\n              }\n              // skip v-is and :is on <component>\n              if (name === 'is' ||\n                  (isVBind &&\n                      isBindKey(arg, 'is') &&\n                      (isComponentTag(tag) ||\n                          (false )))) {\n                  continue;\n              }\n              // skip v-on in SSR compilation\n              if (isVOn && ssr) {\n                  continue;\n              }\n              // special case for v-bind and v-on with no argument\n              if (!arg && (isVBind || isVOn)) {\n                  hasDynamicKeys = true;\n                  if (exp) {\n                      if (properties.length) {\n                          mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));\n                          properties = [];\n                      }\n                      if (isVBind) {\n                          mergeArgs.push(exp);\n                      }\n                      else {\n                          // v-on=\"obj\" -> toHandlers(obj)\n                          mergeArgs.push({\n                              type: 14 /* JS_CALL_EXPRESSION */,\n                              loc,\n                              callee: context.helper(TO_HANDLERS),\n                              arguments: [exp]\n                          });\n                      }\n                  }\n                  else {\n                      context.onError(createCompilerError(isVBind\n                          ? 33 /* X_V_BIND_NO_EXPRESSION */\n                          : 34 /* X_V_ON_NO_EXPRESSION */, loc));\n                  }\n                  continue;\n              }\n              const directiveTransform = context.directiveTransforms[name];\n              if (directiveTransform) {\n                  // has built-in directive transform.\n                  const { props, needRuntime } = directiveTransform(prop, node, context);\n                  !ssr && props.forEach(analyzePatchFlag);\n                  properties.push(...props);\n                  if (needRuntime) {\n                      runtimeDirectives.push(prop);\n                      if (isSymbol(needRuntime)) {\n                          directiveImportMap.set(prop, needRuntime);\n                      }\n                  }\n              }\n              else {\n                  // no built-in transform, this is a user custom directive.\n                  runtimeDirectives.push(prop);\n              }\n          }\n      }\n      let propsExpression = undefined;\n      // has v-bind=\"object\" or v-on=\"object\", wrap with mergeProps\n      if (mergeArgs.length) {\n          if (properties.length) {\n              mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));\n          }\n          if (mergeArgs.length > 1) {\n              propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);\n          }\n          else {\n              // single v-bind with nothing else - no need for a mergeProps call\n              propsExpression = mergeArgs[0];\n          }\n      }\n      else if (properties.length) {\n          propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);\n      }\n      // patchFlag analysis\n      if (hasDynamicKeys) {\n          patchFlag |= 16 /* FULL_PROPS */;\n      }\n      else {\n          if (hasClassBinding && !isComponent) {\n              patchFlag |= 2 /* CLASS */;\n          }\n          if (hasStyleBinding && !isComponent) {\n              patchFlag |= 4 /* STYLE */;\n          }\n          if (dynamicPropNames.length) {\n              patchFlag |= 8 /* PROPS */;\n          }\n          if (hasHydrationEventBinding) {\n              patchFlag |= 32 /* HYDRATE_EVENTS */;\n          }\n      }\n      if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&\n          (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {\n          patchFlag |= 512 /* NEED_PATCH */;\n      }\n      // pre-normalize props, SSR is skipped for now\n      if (!context.inSSR && propsExpression) {\n          switch (propsExpression.type) {\n              case 15 /* JS_OBJECT_EXPRESSION */:\n                  // means that there is no v-bind,\n                  // but still need to deal with dynamic key binding\n                  let classKeyIndex = -1;\n                  let styleKeyIndex = -1;\n                  let hasDynamicKey = false;\n                  for (let i = 0; i < propsExpression.properties.length; i++) {\n                      const key = propsExpression.properties[i].key;\n                      if (isStaticExp(key)) {\n                          if (key.content === 'class') {\n                              classKeyIndex = i;\n                          }\n                          else if (key.content === 'style') {\n                              styleKeyIndex = i;\n                          }\n                      }\n                      else if (!key.isHandlerKey) {\n                          hasDynamicKey = true;\n                      }\n                  }\n                  const classProp = propsExpression.properties[classKeyIndex];\n                  const styleProp = propsExpression.properties[styleKeyIndex];\n                  // no dynamic key\n                  if (!hasDynamicKey) {\n                      if (classProp && !isStaticExp(classProp.value)) {\n                          classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);\n                      }\n                      if (styleProp &&\n                          !isStaticExp(styleProp.value) &&\n                          // the static style is compiled into an object,\n                          // so use `hasStyleBinding` to ensure that it is a dynamic style binding\n                          hasStyleBinding) {\n                          styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);\n                      }\n                  }\n                  else {\n                      // dynamic key binding, wrap with `normalizeProps`\n                      propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);\n                  }\n                  break;\n              case 14 /* JS_CALL_EXPRESSION */:\n                  // mergeProps call, do nothing\n                  break;\n              default:\n                  // single v-bind\n                  propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [\n                      createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [\n                          propsExpression\n                      ])\n                  ]);\n                  break;\n          }\n      }\n      return {\n          props: propsExpression,\n          directives: runtimeDirectives,\n          patchFlag,\n          dynamicPropNames\n      };\n  }\n  // Dedupe props in an object literal.\n  // Literal duplicated attributes would have been warned during the parse phase,\n  // however, it's possible to encounter duplicated `onXXX` handlers with different\n  // modifiers. We also need to merge static and dynamic class / style attributes.\n  // - onXXX handlers / style: merge into array\n  // - class: merge into single expression with concatenation\n  function dedupeProperties(properties) {\n      const knownProps = new Map();\n      const deduped = [];\n      for (let i = 0; i < properties.length; i++) {\n          const prop = properties[i];\n          // dynamic keys are always allowed\n          if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n              deduped.push(prop);\n              continue;\n          }\n          const name = prop.key.content;\n          const existing = knownProps.get(name);\n          if (existing) {\n              if (name === 'style' || name === 'class' || name.startsWith('on')) {\n                  mergeAsArray$1(existing, prop);\n              }\n              // unexpected duplicate, should have emitted error during parse\n          }\n          else {\n              knownProps.set(name, prop);\n              deduped.push(prop);\n          }\n      }\n      return deduped;\n  }\n  function mergeAsArray$1(existing, incoming) {\n      if (existing.value.type === 17 /* JS_ARRAY_EXPRESSION */) {\n          existing.value.elements.push(incoming.value);\n      }\n      else {\n          existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);\n      }\n  }\n  function buildDirectiveArgs(dir, context) {\n      const dirArgs = [];\n      const runtime = directiveImportMap.get(dir);\n      if (runtime) {\n          // built-in directive with runtime\n          dirArgs.push(context.helperString(runtime));\n      }\n      else {\n          {\n              // inject statement for resolving directive\n              context.helper(RESOLVE_DIRECTIVE);\n              context.directives.add(dir.name);\n              dirArgs.push(toValidAssetId(dir.name, `directive`));\n          }\n      }\n      const { loc } = dir;\n      if (dir.exp)\n          dirArgs.push(dir.exp);\n      if (dir.arg) {\n          if (!dir.exp) {\n              dirArgs.push(`void 0`);\n          }\n          dirArgs.push(dir.arg);\n      }\n      if (Object.keys(dir.modifiers).length) {\n          if (!dir.arg) {\n              if (!dir.exp) {\n                  dirArgs.push(`void 0`);\n              }\n              dirArgs.push(`void 0`);\n          }\n          const trueExpression = createSimpleExpression(`true`, false, loc);\n          dirArgs.push(createObjectExpression(dir.modifiers.map(modifier => createObjectProperty(modifier, trueExpression)), loc));\n      }\n      return createArrayExpression(dirArgs, dir.loc);\n  }\n  function stringifyDynamicPropNames(props) {\n      let propsNamesString = `[`;\n      for (let i = 0, l = props.length; i < l; i++) {\n          propsNamesString += JSON.stringify(props[i]);\n          if (i < l - 1)\n              propsNamesString += ', ';\n      }\n      return propsNamesString + `]`;\n  }\n  function isComponentTag(tag) {\n      return tag[0].toLowerCase() + tag.slice(1) === 'component';\n  }\n\n  const transformSlotOutlet = (node, context) => {\n      if (isSlotOutlet(node)) {\n          const { children, loc } = node;\n          const { slotName, slotProps } = processSlotOutlet(node, context);\n          const slotArgs = [\n              context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,\n              slotName\n          ];\n          if (slotProps) {\n              slotArgs.push(slotProps);\n          }\n          if (children.length) {\n              if (!slotProps) {\n                  slotArgs.push(`{}`);\n              }\n              slotArgs.push(createFunctionExpression([], children, false, false, loc));\n          }\n          if (context.scopeId && !context.slotted) {\n              if (!slotProps) {\n                  slotArgs.push(`{}`);\n              }\n              if (!children.length) {\n                  slotArgs.push(`undefined`);\n              }\n              slotArgs.push(`true`);\n          }\n          node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);\n      }\n  };\n  function processSlotOutlet(node, context) {\n      let slotName = `\"default\"`;\n      let slotProps = undefined;\n      const nonNameProps = [];\n      for (let i = 0; i < node.props.length; i++) {\n          const p = node.props[i];\n          if (p.type === 6 /* ATTRIBUTE */) {\n              if (p.value) {\n                  if (p.name === 'name') {\n                      slotName = JSON.stringify(p.value.content);\n                  }\n                  else {\n                      p.name = camelize(p.name);\n                      nonNameProps.push(p);\n                  }\n              }\n          }\n          else {\n              if (p.name === 'bind' && isBindKey(p.arg, 'name')) {\n                  if (p.exp)\n                      slotName = p.exp;\n              }\n              else {\n                  if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {\n                      p.arg.content = camelize(p.arg.content);\n                  }\n                  nonNameProps.push(p);\n              }\n          }\n      }\n      if (nonNameProps.length > 0) {\n          const { props, directives } = buildProps(node, context, nonNameProps);\n          slotProps = props;\n          if (directives.length) {\n              context.onError(createCompilerError(35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));\n          }\n      }\n      return {\n          slotName,\n          slotProps\n      };\n  }\n\n  const fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^\\s*function(?:\\s+[\\w$]+)?\\s*\\(/;\n  const transformOn = (dir, node, context, augmentor) => {\n      const { loc, modifiers, arg } = dir;\n      if (!dir.exp && !modifiers.length) {\n          context.onError(createCompilerError(34 /* X_V_ON_NO_EXPRESSION */, loc));\n      }\n      let eventName;\n      if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\n          if (arg.isStatic) {\n              const rawName = arg.content;\n              // for all event listeners, auto convert it to camelCase. See issue #2249\n              eventName = createSimpleExpression(toHandlerKey(camelize(rawName)), true, arg.loc);\n          }\n          else {\n              // #2388\n              eventName = createCompoundExpression([\n                  `${context.helperString(TO_HANDLER_KEY)}(`,\n                  arg,\n                  `)`\n              ]);\n          }\n      }\n      else {\n          // already a compound expression.\n          eventName = arg;\n          eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);\n          eventName.children.push(`)`);\n      }\n      // handler processing\n      let exp = dir.exp;\n      if (exp && !exp.content.trim()) {\n          exp = undefined;\n      }\n      let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;\n      if (exp) {\n          const isMemberExp = isMemberExpression(exp.content);\n          const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));\n          const hasMultipleStatements = exp.content.includes(`;`);\n          {\n              validateBrowserExpression(exp, context, false, hasMultipleStatements);\n          }\n          if (isInlineStatement || (shouldCache && isMemberExp)) {\n              // wrap inline statement in a function expression\n              exp = createCompoundExpression([\n                  `${isInlineStatement\n                    ? `$event`\n                    : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,\n                  exp,\n                  hasMultipleStatements ? `}` : `)`\n              ]);\n          }\n      }\n      let ret = {\n          props: [\n              createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))\n          ]\n      };\n      // apply extended compiler augmentor\n      if (augmentor) {\n          ret = augmentor(ret);\n      }\n      if (shouldCache) {\n          // cache handlers so that it's always the same handler being passed down.\n          // this avoids unnecessary re-renders when users use inline handlers on\n          // components.\n          ret.props[0].value = context.cache(ret.props[0].value);\n      }\n      // mark the key as handler for props normalization check\n      ret.props.forEach(p => (p.key.isHandlerKey = true));\n      return ret;\n  };\n\n  // v-bind without arg is handled directly in ./transformElements.ts due to it affecting\n  // codegen for the entire props object. This transform here is only for v-bind\n  // *with* args.\n  const transformBind = (dir, _node, context) => {\n      const { exp, modifiers, loc } = dir;\n      const arg = dir.arg;\n      if (arg.type !== 4 /* SIMPLE_EXPRESSION */) {\n          arg.children.unshift(`(`);\n          arg.children.push(`) || \"\"`);\n      }\n      else if (!arg.isStatic) {\n          arg.content = `${arg.content} || \"\"`;\n      }\n      // .sync is replaced by v-model:arg\n      if (modifiers.includes('camel')) {\n          if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\n              if (arg.isStatic) {\n                  arg.content = camelize(arg.content);\n              }\n              else {\n                  arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;\n              }\n          }\n          else {\n              arg.children.unshift(`${context.helperString(CAMELIZE)}(`);\n              arg.children.push(`)`);\n          }\n      }\n      if (!context.inSSR) {\n          if (modifiers.includes('prop')) {\n              injectPrefix(arg, '.');\n          }\n          if (modifiers.includes('attr')) {\n              injectPrefix(arg, '^');\n          }\n      }\n      if (!exp ||\n          (exp.type === 4 /* SIMPLE_EXPRESSION */ && !exp.content.trim())) {\n          context.onError(createCompilerError(33 /* X_V_BIND_NO_EXPRESSION */, loc));\n          return {\n              props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]\n          };\n      }\n      return {\n          props: [createObjectProperty(arg, exp)]\n      };\n  };\n  const injectPrefix = (arg, prefix) => {\n      if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\n          if (arg.isStatic) {\n              arg.content = prefix + arg.content;\n          }\n          else {\n              arg.content = `\\`${prefix}\\${${arg.content}}\\``;\n          }\n      }\n      else {\n          arg.children.unshift(`'${prefix}' + (`);\n          arg.children.push(`)`);\n      }\n  };\n\n  // Merge adjacent text nodes and expressions into a single expression\n  // e.g. <div>abc {{ d }} {{ e }}</div> should have a single expression node as child.\n  const transformText = (node, context) => {\n      if (node.type === 0 /* ROOT */ ||\n          node.type === 1 /* ELEMENT */ ||\n          node.type === 11 /* FOR */ ||\n          node.type === 10 /* IF_BRANCH */) {\n          // perform the transform on node exit so that all expressions have already\n          // been processed.\n          return () => {\n              const children = node.children;\n              let currentContainer = undefined;\n              let hasText = false;\n              for (let i = 0; i < children.length; i++) {\n                  const child = children[i];\n                  if (isText(child)) {\n                      hasText = true;\n                      for (let j = i + 1; j < children.length; j++) {\n                          const next = children[j];\n                          if (isText(next)) {\n                              if (!currentContainer) {\n                                  currentContainer = children[i] = {\n                                      type: 8 /* COMPOUND_EXPRESSION */,\n                                      loc: child.loc,\n                                      children: [child]\n                                  };\n                              }\n                              // merge adjacent text node into current\n                              currentContainer.children.push(` + `, next);\n                              children.splice(j, 1);\n                              j--;\n                          }\n                          else {\n                              currentContainer = undefined;\n                              break;\n                          }\n                      }\n                  }\n              }\n              if (!hasText ||\n                  // if this is a plain element with a single text child, leave it\n                  // as-is since the runtime has dedicated fast path for this by directly\n                  // setting textContent of the element.\n                  // for component root it's always normalized anyway.\n                  (children.length === 1 &&\n                      (node.type === 0 /* ROOT */ ||\n                          (node.type === 1 /* ELEMENT */ &&\n                              node.tagType === 0 /* ELEMENT */ &&\n                              // #3756\n                              // custom directives can potentially add DOM elements arbitrarily,\n                              // we need to avoid setting textContent of the element at runtime\n                              // to avoid accidentally overwriting the DOM elements added\n                              // by the user through custom directives.\n                              !node.props.find(p => p.type === 7 /* DIRECTIVE */ &&\n                                  !context.directiveTransforms[p.name]) &&\n                              // in compat mode, <template> tags with no special directives\n                              // will be rendered as a fragment so its children must be\n                              // converted into vnodes.\n                              !(false ))))) {\n                  return;\n              }\n              // pre-convert text nodes into createTextVNode(text) calls to avoid\n              // runtime normalization.\n              for (let i = 0; i < children.length; i++) {\n                  const child = children[i];\n                  if (isText(child) || child.type === 8 /* COMPOUND_EXPRESSION */) {\n                      const callArgs = [];\n                      // createTextVNode defaults to single whitespace, so if it is a\n                      // single space the code could be an empty call to save bytes.\n                      if (child.type !== 2 /* TEXT */ || child.content !== ' ') {\n                          callArgs.push(child);\n                      }\n                      // mark dynamic text with flag so it gets patched inside a block\n                      if (!context.ssr &&\n                          getConstantType(child, context) === 0 /* NOT_CONSTANT */) {\n                          callArgs.push(1 /* TEXT */ +\n                              (` /* ${PatchFlagNames[1 /* TEXT */]} */` ));\n                      }\n                      children[i] = {\n                          type: 12 /* TEXT_CALL */,\n                          content: child,\n                          loc: child.loc,\n                          codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)\n                      };\n                  }\n              }\n          };\n      }\n  };\n\n  const seen = new WeakSet();\n  const transformOnce = (node, context) => {\n      if (node.type === 1 /* ELEMENT */ && findDir(node, 'once', true)) {\n          if (seen.has(node) || context.inVOnce) {\n              return;\n          }\n          seen.add(node);\n          context.inVOnce = true;\n          context.helper(SET_BLOCK_TRACKING);\n          return () => {\n              context.inVOnce = false;\n              const cur = context.currentNode;\n              if (cur.codegenNode) {\n                  cur.codegenNode = context.cache(cur.codegenNode, true /* isVNode */);\n              }\n          };\n      }\n  };\n\n  const transformModel = (dir, node, context) => {\n      const { exp, arg } = dir;\n      if (!exp) {\n          context.onError(createCompilerError(40 /* X_V_MODEL_NO_EXPRESSION */, dir.loc));\n          return createTransformProps();\n      }\n      const rawExp = exp.loc.source;\n      const expString = exp.type === 4 /* SIMPLE_EXPRESSION */ ? exp.content : rawExp;\n      // im SFC <script setup> inline mode, the exp may have been transformed into\n      // _unref(exp)\n      context.bindingMetadata[rawExp];\n      const maybeRef = !true    /* SETUP_CONST */;\n      if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {\n          context.onError(createCompilerError(41 /* X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));\n          return createTransformProps();\n      }\n      const propName = arg ? arg : createSimpleExpression('modelValue', true);\n      const eventName = arg\n          ? isStaticExp(arg)\n              ? `onUpdate:${arg.content}`\n              : createCompoundExpression(['\"onUpdate:\" + ', arg])\n          : `onUpdate:modelValue`;\n      let assignmentExp;\n      const eventArg = context.isTS ? `($event: any)` : `$event`;\n      {\n          assignmentExp = createCompoundExpression([\n              `${eventArg} => (`,\n              exp,\n              ` = $event)`\n          ]);\n      }\n      const props = [\n          // modelValue: foo\n          createObjectProperty(propName, dir.exp),\n          // \"onUpdate:modelValue\": $event => (foo = $event)\n          createObjectProperty(eventName, assignmentExp)\n      ];\n      // modelModifiers: { foo: true, \"bar-baz\": true }\n      if (dir.modifiers.length && node.tagType === 1 /* COMPONENT */) {\n          const modifiers = dir.modifiers\n              .map(m => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)\n              .join(`, `);\n          const modifiersKey = arg\n              ? isStaticExp(arg)\n                  ? `${arg.content}Modifiers`\n                  : createCompoundExpression([arg, ' + \"Modifiers\"'])\n              : `modelModifiers`;\n          props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 /* CAN_HOIST */)));\n      }\n      return createTransformProps(props);\n  };\n  function createTransformProps(props = []) {\n      return { props };\n  }\n\n  const seen$1 = new WeakSet();\n  const transformMemo = (node, context) => {\n      if (node.type === 1 /* ELEMENT */) {\n          const dir = findDir(node, 'memo');\n          if (!dir || seen$1.has(node)) {\n              return;\n          }\n          seen$1.add(node);\n          return () => {\n              const codegenNode = node.codegenNode ||\n                  context.currentNode.codegenNode;\n              if (codegenNode && codegenNode.type === 13 /* VNODE_CALL */) {\n                  // non-component sub tree should be turned into a block\n                  if (node.tagType !== 1 /* COMPONENT */) {\n                      makeBlock(codegenNode, context);\n                  }\n                  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [\n                      dir.exp,\n                      createFunctionExpression(undefined, codegenNode),\n                      `_cache`,\n                      String(context.cached++)\n                  ]);\n              }\n          };\n      }\n  };\n\n  function getBaseTransformPreset(prefixIdentifiers) {\n      return [\n          [\n              transformOnce,\n              transformIf,\n              transformMemo,\n              transformFor,\n              ...([]),\n              ...([transformExpression]\n                      ),\n              transformSlotOutlet,\n              transformElement,\n              trackSlotScopes,\n              transformText\n          ],\n          {\n              on: transformOn,\n              bind: transformBind,\n              model: transformModel\n          }\n      ];\n  }\n  // we name it `baseCompile` so that higher order compilers like\n  // @vue/compiler-dom can export `compile` while re-exporting everything else.\n  function baseCompile(template, options = {}) {\n      const onError = options.onError || defaultOnError;\n      const isModuleMode = options.mode === 'module';\n      /* istanbul ignore if */\n      {\n          if (options.prefixIdentifiers === true) {\n              onError(createCompilerError(45 /* X_PREFIX_ID_NOT_SUPPORTED */));\n          }\n          else if (isModuleMode) {\n              onError(createCompilerError(46 /* X_MODULE_MODE_NOT_SUPPORTED */));\n          }\n      }\n      const prefixIdentifiers = !true ;\n      if (options.cacheHandlers) {\n          onError(createCompilerError(47 /* X_CACHE_HANDLER_NOT_SUPPORTED */));\n      }\n      if (options.scopeId && !isModuleMode) {\n          onError(createCompilerError(48 /* X_SCOPE_ID_NOT_SUPPORTED */));\n      }\n      const ast = isString(template) ? baseParse(template, options) : template;\n      const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();\n      transform(ast, extend({}, options, {\n          prefixIdentifiers,\n          nodeTransforms: [\n              ...nodeTransforms,\n              ...(options.nodeTransforms || []) // user transforms\n          ],\n          directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {} // user transforms\n          )\n      }));\n      return generate(ast, extend({}, options, {\n          prefixIdentifiers\n      }));\n  }\n\n  const noopDirectiveTransform = () => ({ props: [] });\n\n  const V_MODEL_RADIO = Symbol(`vModelRadio` );\n  const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );\n  const V_MODEL_TEXT = Symbol(`vModelText` );\n  const V_MODEL_SELECT = Symbol(`vModelSelect` );\n  const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );\n  const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );\n  const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );\n  const V_SHOW = Symbol(`vShow` );\n  const TRANSITION$1 = Symbol(`Transition` );\n  const TRANSITION_GROUP = Symbol(`TransitionGroup` );\n  registerRuntimeHelpers({\n      [V_MODEL_RADIO]: `vModelRadio`,\n      [V_MODEL_CHECKBOX]: `vModelCheckbox`,\n      [V_MODEL_TEXT]: `vModelText`,\n      [V_MODEL_SELECT]: `vModelSelect`,\n      [V_MODEL_DYNAMIC]: `vModelDynamic`,\n      [V_ON_WITH_MODIFIERS]: `withModifiers`,\n      [V_ON_WITH_KEYS]: `withKeys`,\n      [V_SHOW]: `vShow`,\n      [TRANSITION$1]: `Transition`,\n      [TRANSITION_GROUP]: `TransitionGroup`\n  });\n\n  /* eslint-disable no-restricted-globals */\n  let decoder;\n  function decodeHtmlBrowser(raw, asAttr = false) {\n      if (!decoder) {\n          decoder = document.createElement('div');\n      }\n      if (asAttr) {\n          decoder.innerHTML = `<div foo=\"${raw.replace(/\"/g, '&quot;')}\">`;\n          return decoder.children[0].getAttribute('foo');\n      }\n      else {\n          decoder.innerHTML = raw;\n          return decoder.textContent;\n      }\n  }\n\n  const isRawTextContainer = /*#__PURE__*/ makeMap('style,iframe,script,noscript', true);\n  const parserOptions = {\n      isVoidTag,\n      isNativeTag: tag => isHTMLTag(tag) || isSVGTag(tag),\n      isPreTag: tag => tag === 'pre',\n      decodeEntities: decodeHtmlBrowser ,\n      isBuiltInComponent: (tag) => {\n          if (isBuiltInType(tag, `Transition`)) {\n              return TRANSITION$1;\n          }\n          else if (isBuiltInType(tag, `TransitionGroup`)) {\n              return TRANSITION_GROUP;\n          }\n      },\n      // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher\n      getNamespace(tag, parent) {\n          let ns = parent ? parent.ns : 0 /* HTML */;\n          if (parent && ns === 2 /* MATH_ML */) {\n              if (parent.tag === 'annotation-xml') {\n                  if (tag === 'svg') {\n                      return 1 /* SVG */;\n                  }\n                  if (parent.props.some(a => a.type === 6 /* ATTRIBUTE */ &&\n                      a.name === 'encoding' &&\n                      a.value != null &&\n                      (a.value.content === 'text/html' ||\n                          a.value.content === 'application/xhtml+xml'))) {\n                      ns = 0 /* HTML */;\n                  }\n              }\n              else if (/^m(?:[ions]|text)$/.test(parent.tag) &&\n                  tag !== 'mglyph' &&\n                  tag !== 'malignmark') {\n                  ns = 0 /* HTML */;\n              }\n          }\n          else if (parent && ns === 1 /* SVG */) {\n              if (parent.tag === 'foreignObject' ||\n                  parent.tag === 'desc' ||\n                  parent.tag === 'title') {\n                  ns = 0 /* HTML */;\n              }\n          }\n          if (ns === 0 /* HTML */) {\n              if (tag === 'svg') {\n                  return 1 /* SVG */;\n              }\n              if (tag === 'math') {\n                  return 2 /* MATH_ML */;\n              }\n          }\n          return ns;\n      },\n      // https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments\n      getTextMode({ tag, ns }) {\n          if (ns === 0 /* HTML */) {\n              if (tag === 'textarea' || tag === 'title') {\n                  return 1 /* RCDATA */;\n              }\n              if (isRawTextContainer(tag)) {\n                  return 2 /* RAWTEXT */;\n              }\n          }\n          return 0 /* DATA */;\n      }\n  };\n\n  // Parse inline CSS strings for static style attributes into an object.\n  // This is a NodeTransform since it works on the static `style` attribute and\n  // converts it into a dynamic equivalent:\n  // style=\"color: red\" -> :style='{ \"color\": \"red\" }'\n  // It is then processed by `transformElement` and included in the generated\n  // props.\n  const transformStyle = node => {\n      if (node.type === 1 /* ELEMENT */) {\n          node.props.forEach((p, i) => {\n              if (p.type === 6 /* ATTRIBUTE */ && p.name === 'style' && p.value) {\n                  // replace p with an expression node\n                  node.props[i] = {\n                      type: 7 /* DIRECTIVE */,\n                      name: `bind`,\n                      arg: createSimpleExpression(`style`, true, p.loc),\n                      exp: parseInlineCSS(p.value.content, p.loc),\n                      modifiers: [],\n                      loc: p.loc\n                  };\n              }\n          });\n      }\n  };\n  const parseInlineCSS = (cssText, loc) => {\n      const normalized = parseStringStyle(cssText);\n      return createSimpleExpression(JSON.stringify(normalized), false, loc, 3 /* CAN_STRINGIFY */);\n  };\n\n  function createDOMCompilerError(code, loc) {\n      return createCompilerError(code, loc, DOMErrorMessages );\n  }\n  const DOMErrorMessages = {\n      [49 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,\n      [50 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,\n      [51 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,\n      [52 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,\n      [53 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,\n      [54 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,\n      [55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,\n      [56 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,\n      [57 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,\n      [58 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,\n      [59 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`\n  };\n\n  const transformVHtml = (dir, node, context) => {\n      const { exp, loc } = dir;\n      if (!exp) {\n          context.onError(createDOMCompilerError(49 /* X_V_HTML_NO_EXPRESSION */, loc));\n      }\n      if (node.children.length) {\n          context.onError(createDOMCompilerError(50 /* X_V_HTML_WITH_CHILDREN */, loc));\n          node.children.length = 0;\n      }\n      return {\n          props: [\n              createObjectProperty(createSimpleExpression(`innerHTML`, true, loc), exp || createSimpleExpression('', true))\n          ]\n      };\n  };\n\n  const transformVText = (dir, node, context) => {\n      const { exp, loc } = dir;\n      if (!exp) {\n          context.onError(createDOMCompilerError(51 /* X_V_TEXT_NO_EXPRESSION */, loc));\n      }\n      if (node.children.length) {\n          context.onError(createDOMCompilerError(52 /* X_V_TEXT_WITH_CHILDREN */, loc));\n          node.children.length = 0;\n      }\n      return {\n          props: [\n              createObjectProperty(createSimpleExpression(`textContent`, true), exp\n                  ? createCallExpression(context.helperString(TO_DISPLAY_STRING), [exp], loc)\n                  : createSimpleExpression('', true))\n          ]\n      };\n  };\n\n  const transformModel$1 = (dir, node, context) => {\n      const baseResult = transformModel(dir, node, context);\n      // base transform has errors OR component v-model (only need props)\n      if (!baseResult.props.length || node.tagType === 1 /* COMPONENT */) {\n          return baseResult;\n      }\n      if (dir.arg) {\n          context.onError(createDOMCompilerError(54 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));\n      }\n      function checkDuplicatedValue() {\n          const value = findProp(node, 'value');\n          if (value) {\n              context.onError(createDOMCompilerError(56 /* X_V_MODEL_UNNECESSARY_VALUE */, value.loc));\n          }\n      }\n      const { tag } = node;\n      const isCustomElement = context.isCustomElement(tag);\n      if (tag === 'input' ||\n          tag === 'textarea' ||\n          tag === 'select' ||\n          isCustomElement) {\n          let directiveToUse = V_MODEL_TEXT;\n          let isInvalidType = false;\n          if (tag === 'input' || isCustomElement) {\n              const type = findProp(node, `type`);\n              if (type) {\n                  if (type.type === 7 /* DIRECTIVE */) {\n                      // :type=\"foo\"\n                      directiveToUse = V_MODEL_DYNAMIC;\n                  }\n                  else if (type.value) {\n                      switch (type.value.content) {\n                          case 'radio':\n                              directiveToUse = V_MODEL_RADIO;\n                              break;\n                          case 'checkbox':\n                              directiveToUse = V_MODEL_CHECKBOX;\n                              break;\n                          case 'file':\n                              isInvalidType = true;\n                              context.onError(createDOMCompilerError(55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));\n                              break;\n                          default:\n                              // text type\n                              checkDuplicatedValue();\n                              break;\n                      }\n                  }\n              }\n              else if (hasDynamicKeyVBind(node)) {\n                  // element has bindings with dynamic keys, which can possibly contain\n                  // \"type\".\n                  directiveToUse = V_MODEL_DYNAMIC;\n              }\n              else {\n                  // text type\n                  checkDuplicatedValue();\n              }\n          }\n          else if (tag === 'select') {\n              directiveToUse = V_MODEL_SELECT;\n          }\n          else {\n              // textarea\n              checkDuplicatedValue();\n          }\n          // inject runtime directive\n          // by returning the helper symbol via needRuntime\n          // the import will replaced a resolveDirective call.\n          if (!isInvalidType) {\n              baseResult.needRuntime = context.helper(directiveToUse);\n          }\n      }\n      else {\n          context.onError(createDOMCompilerError(53 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));\n      }\n      // native vmodel doesn't need the `modelValue` props since they are also\n      // passed to the runtime as `binding.value`. removing it reduces code size.\n      baseResult.props = baseResult.props.filter(p => !(p.key.type === 4 /* SIMPLE_EXPRESSION */ &&\n          p.key.content === 'modelValue'));\n      return baseResult;\n  };\n\n  const isEventOptionModifier = /*#__PURE__*/ makeMap(`passive,once,capture`);\n  const isNonKeyModifier = /*#__PURE__*/ makeMap(\n  // event propagation management\n`stop,prevent,self,`   +\n      // system modifiers + exact\n      `ctrl,shift,alt,meta,exact,` +\n      // mouse\n      `middle`);\n  // left & right could be mouse or key modifiers based on event type\n  const maybeKeyModifier = /*#__PURE__*/ makeMap('left,right');\n  const isKeyboardEvent = /*#__PURE__*/ makeMap(`onkeyup,onkeydown,onkeypress`, true);\n  const resolveModifiers = (key, modifiers, context, loc) => {\n      const keyModifiers = [];\n      const nonKeyModifiers = [];\n      const eventOptionModifiers = [];\n      for (let i = 0; i < modifiers.length; i++) {\n          const modifier = modifiers[i];\n          if (isEventOptionModifier(modifier)) {\n              // eventOptionModifiers: modifiers for addEventListener() options,\n              // e.g. .passive & .capture\n              eventOptionModifiers.push(modifier);\n          }\n          else {\n              // runtimeModifiers: modifiers that needs runtime guards\n              if (maybeKeyModifier(modifier)) {\n                  if (isStaticExp(key)) {\n                      if (isKeyboardEvent(key.content)) {\n                          keyModifiers.push(modifier);\n                      }\n                      else {\n                          nonKeyModifiers.push(modifier);\n                      }\n                  }\n                  else {\n                      keyModifiers.push(modifier);\n                      nonKeyModifiers.push(modifier);\n                  }\n              }\n              else {\n                  if (isNonKeyModifier(modifier)) {\n                      nonKeyModifiers.push(modifier);\n                  }\n                  else {\n                      keyModifiers.push(modifier);\n                  }\n              }\n          }\n      }\n      return {\n          keyModifiers,\n          nonKeyModifiers,\n          eventOptionModifiers\n      };\n  };\n  const transformClick = (key, event) => {\n      const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === 'onclick';\n      return isStaticClick\n          ? createSimpleExpression(event, true)\n          : key.type !== 4 /* SIMPLE_EXPRESSION */\n              ? createCompoundExpression([\n                  `(`,\n                  key,\n                  `) === \"onClick\" ? \"${event}\" : (`,\n                  key,\n                  `)`\n              ])\n              : key;\n  };\n  const transformOn$1 = (dir, node, context) => {\n      return transformOn(dir, node, context, baseResult => {\n          const { modifiers } = dir;\n          if (!modifiers.length)\n              return baseResult;\n          let { key, value: handlerExp } = baseResult.props[0];\n          const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);\n          // normalize click.right and click.middle since they don't actually fire\n          if (nonKeyModifiers.includes('right')) {\n              key = transformClick(key, `onContextmenu`);\n          }\n          if (nonKeyModifiers.includes('middle')) {\n              key = transformClick(key, `onMouseup`);\n          }\n          if (nonKeyModifiers.length) {\n              handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [\n                  handlerExp,\n                  JSON.stringify(nonKeyModifiers)\n              ]);\n          }\n          if (keyModifiers.length &&\n              // if event name is dynamic, always wrap with keys guard\n              (!isStaticExp(key) || isKeyboardEvent(key.content))) {\n              handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [\n                  handlerExp,\n                  JSON.stringify(keyModifiers)\n              ]);\n          }\n          if (eventOptionModifiers.length) {\n              const modifierPostfix = eventOptionModifiers.map(capitalize).join('');\n              key = isStaticExp(key)\n                  ? createSimpleExpression(`${key.content}${modifierPostfix}`, true)\n                  : createCompoundExpression([`(`, key, `) + \"${modifierPostfix}\"`]);\n          }\n          return {\n              props: [createObjectProperty(key, handlerExp)]\n          };\n      });\n  };\n\n  const transformShow = (dir, node, context) => {\n      const { exp, loc } = dir;\n      if (!exp) {\n          context.onError(createDOMCompilerError(57 /* X_V_SHOW_NO_EXPRESSION */, loc));\n      }\n      return {\n          props: [],\n          needRuntime: context.helper(V_SHOW)\n      };\n  };\n\n  const warnTransitionChildren = (node, context) => {\n      if (node.type === 1 /* ELEMENT */ &&\n          node.tagType === 1 /* COMPONENT */) {\n          const component = context.isBuiltInComponent(node.tag);\n          if (component === TRANSITION$1) {\n              return () => {\n                  if (node.children.length && hasMultipleChildren(node)) {\n                      context.onError(createDOMCompilerError(58 /* X_TRANSITION_INVALID_CHILDREN */, {\n                          start: node.children[0].loc.start,\n                          end: node.children[node.children.length - 1].loc.end,\n                          source: ''\n                      }));\n                  }\n              };\n          }\n      }\n  };\n  function hasMultipleChildren(node) {\n      // #1352 filter out potential comment nodes.\n      const children = (node.children = node.children.filter(c => c.type !== 3 /* COMMENT */));\n      const child = children[0];\n      return (children.length !== 1 ||\n          child.type === 11 /* FOR */ ||\n          (child.type === 9 /* IF */ && child.branches.some(hasMultipleChildren)));\n  }\n\n  const ignoreSideEffectTags = (node, context) => {\n      if (node.type === 1 /* ELEMENT */ &&\n          node.tagType === 0 /* ELEMENT */ &&\n          (node.tag === 'script' || node.tag === 'style')) {\n          context.onError(createDOMCompilerError(59 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));\n          context.removeNode();\n      }\n  };\n\n  const DOMNodeTransforms = [\n      transformStyle,\n      ...([warnTransitionChildren] )\n  ];\n  const DOMDirectiveTransforms = {\n      cloak: noopDirectiveTransform,\n      html: transformVHtml,\n      text: transformVText,\n      model: transformModel$1,\n      on: transformOn$1,\n      show: transformShow\n  };\n  function compile$1(template, options = {}) {\n      return baseCompile(template, extend({}, parserOptions, options, {\n          nodeTransforms: [\n              // ignore <script> and <tag>\n              // this is not put inside DOMNodeTransforms because that list is used\n              // by compiler-ssr to generate vnode fallback branches\n              ignoreSideEffectTags,\n              ...DOMNodeTransforms,\n              ...(options.nodeTransforms || [])\n          ],\n          directiveTransforms: extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),\n          transformHoist: null \n      }));\n  }\n\n  // This entry is the \"full-build\" that includes both the runtime\n  {\n      initDev();\n  }\n  const compileCache = Object.create(null);\n  function compileToFunction(template, options) {\n      if (!isString(template)) {\n          if (template.nodeType) {\n              template = template.innerHTML;\n          }\n          else {\n              warn$1(`invalid template option: `, template);\n              return NOOP;\n          }\n      }\n      const key = template;\n      const cached = compileCache[key];\n      if (cached) {\n          return cached;\n      }\n      if (template[0] === '#') {\n          const el = document.querySelector(template);\n          if (!el) {\n              warn$1(`Template element not found or is empty: ${template}`);\n          }\n          // __UNSAFE__\n          // Reason: potential execution of JS expressions in in-DOM template.\n          // The user must make sure the in-DOM template is trusted. If it's rendered\n          // by the server, the template should not contain any user data.\n          template = el ? el.innerHTML : ``;\n      }\n      const { code } = compile$1(template, extend({\n          hoistStatic: true,\n          onError: onError ,\n          onWarn: e => onError(e, true) \n      }, options));\n      function onError(err, asWarning = false) {\n          const message = asWarning\n              ? err.message\n              : `Template compilation error: ${err.message}`;\n          const codeFrame = err.loc &&\n              generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);\n          warn$1(codeFrame ? `${message}\\n${codeFrame}` : message);\n      }\n      // The wildcard import results in a huge object with every export\n      // with keys that cannot be mangled, and can be quite heavy size-wise.\n      // In the global build we know `Vue` is available globally so we can avoid\n      // the wildcard object.\n      const render = (new Function(code)() );\n      render._rc = true;\n      return (compileCache[key] = render);\n  }\n  registerRuntimeCompiler(compileToFunction);\n\n  exports.$computed = $computed;\n  exports.$fromRefs = $fromRefs;\n  exports.$raw = $raw;\n  exports.$ref = $ref;\n  exports.BaseTransition = BaseTransition;\n  exports.Comment = Comment$1;\n  exports.EffectScope = EffectScope;\n  exports.Fragment = Fragment;\n  exports.KeepAlive = KeepAlive;\n  exports.ReactiveEffect = ReactiveEffect;\n  exports.Static = Static;\n  exports.Suspense = Suspense;\n  exports.Teleport = Teleport;\n  exports.Text = Text;\n  exports.Transition = Transition;\n  exports.TransitionGroup = TransitionGroup;\n  exports.VueElement = VueElement;\n  exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;\n  exports.callWithErrorHandling = callWithErrorHandling;\n  exports.camelize = camelize;\n  exports.capitalize = capitalize;\n  exports.cloneVNode = cloneVNode;\n  exports.compatUtils = compatUtils;\n  exports.compile = compileToFunction;\n  exports.computed = computed;\n  exports.createApp = createApp;\n  exports.createBlock = createBlock;\n  exports.createCommentVNode = createCommentVNode;\n  exports.createElementBlock = createElementBlock;\n  exports.createElementVNode = createBaseVNode;\n  exports.createHydrationRenderer = createHydrationRenderer;\n  exports.createRenderer = createRenderer;\n  exports.createSSRApp = createSSRApp;\n  exports.createSlots = createSlots;\n  exports.createStaticVNode = createStaticVNode;\n  exports.createTextVNode = createTextVNode;\n  exports.createVNode = createVNode;\n  exports.customRef = customRef;\n  exports.defineAsyncComponent = defineAsyncComponent;\n  exports.defineComponent = defineComponent;\n  exports.defineCustomElement = defineCustomElement;\n  exports.defineEmits = defineEmits;\n  exports.defineExpose = defineExpose;\n  exports.defineProps = defineProps;\n  exports.defineSSRCustomElement = defineSSRCustomElement;\n  exports.effect = effect;\n  exports.effectScope = effectScope;\n  exports.getCurrentInstance = getCurrentInstance;\n  exports.getCurrentScope = getCurrentScope;\n  exports.getTransitionRawChildren = getTransitionRawChildren;\n  exports.guardReactiveProps = guardReactiveProps;\n  exports.h = h;\n  exports.handleError = handleError;\n  exports.hydrate = hydrate;\n  exports.initCustomFormatter = initCustomFormatter;\n  exports.inject = inject;\n  exports.isMemoSame = isMemoSame;\n  exports.isProxy = isProxy;\n  exports.isReactive = isReactive;\n  exports.isReadonly = isReadonly;\n  exports.isRef = isRef;\n  exports.isRuntimeOnly = isRuntimeOnly;\n  exports.isVNode = isVNode;\n  exports.markRaw = markRaw;\n  exports.mergeDefaults = mergeDefaults;\n  exports.mergeProps = mergeProps;\n  exports.nextTick = nextTick;\n  exports.normalizeClass = normalizeClass;\n  exports.normalizeProps = normalizeProps;\n  exports.normalizeStyle = normalizeStyle;\n  exports.onActivated = onActivated;\n  exports.onBeforeMount = onBeforeMount;\n  exports.onBeforeUnmount = onBeforeUnmount;\n  exports.onBeforeUpdate = onBeforeUpdate;\n  exports.onDeactivated = onDeactivated;\n  exports.onErrorCaptured = onErrorCaptured;\n  exports.onMounted = onMounted;\n  exports.onRenderTracked = onRenderTracked;\n  exports.onRenderTriggered = onRenderTriggered;\n  exports.onScopeDispose = onScopeDispose;\n  exports.onServerPrefetch = onServerPrefetch;\n  exports.onUnmounted = onUnmounted;\n  exports.onUpdated = onUpdated;\n  exports.openBlock = openBlock;\n  exports.popScopeId = popScopeId;\n  exports.provide = provide;\n  exports.proxyRefs = proxyRefs;\n  exports.pushScopeId = pushScopeId;\n  exports.queuePostFlushCb = queuePostFlushCb;\n  exports.reactive = reactive;\n  exports.readonly = readonly;\n  exports.ref = ref;\n  exports.registerRuntimeCompiler = registerRuntimeCompiler;\n  exports.render = render;\n  exports.renderList = renderList;\n  exports.renderSlot = renderSlot;\n  exports.resolveComponent = resolveComponent;\n  exports.resolveDirective = resolveDirective;\n  exports.resolveDynamicComponent = resolveDynamicComponent;\n  exports.resolveFilter = resolveFilter;\n  exports.resolveTransitionHooks = resolveTransitionHooks;\n  exports.setBlockTracking = setBlockTracking;\n  exports.setDevtoolsHook = setDevtoolsHook;\n  exports.setTransitionHooks = setTransitionHooks;\n  exports.shallowReactive = shallowReactive;\n  exports.shallowReadonly = shallowReadonly;\n  exports.shallowRef = shallowRef;\n  exports.ssrContextKey = ssrContextKey;\n  exports.ssrUtils = ssrUtils;\n  exports.stop = stop;\n  exports.toDisplayString = toDisplayString;\n  exports.toHandlerKey = toHandlerKey;\n  exports.toHandlers = toHandlers;\n  exports.toRaw = toRaw;\n  exports.toRef = toRef;\n  exports.toRefs = toRefs;\n  exports.transformVNodeArgs = transformVNodeArgs;\n  exports.triggerRef = triggerRef;\n  exports.unref = unref;\n  exports.useAttrs = useAttrs;\n  exports.useCssModule = useCssModule;\n  exports.useCssVars = useCssVars;\n  exports.useSSRContext = useSSRContext;\n  exports.useSlots = useSlots;\n  exports.useTransitionState = useTransitionState;\n  exports.vModelCheckbox = vModelCheckbox;\n  exports.vModelDynamic = vModelDynamic;\n  exports.vModelRadio = vModelRadio;\n  exports.vModelSelect = vModelSelect;\n  exports.vModelText = vModelText;\n  exports.vShow = vShow;\n  exports.version = version;\n  exports.warn = warn$1;\n  exports.watch = watch;\n  exports.watchEffect = watchEffect;\n  exports.watchPostEffect = watchPostEffect;\n  exports.watchSyncEffect = watchSyncEffect;\n  exports.withAsyncContext = withAsyncContext;\n  exports.withCtx = withCtx;\n  exports.withDefaults = withDefaults;\n  exports.withDirectives = withDirectives;\n  exports.withKeys = withKeys;\n  exports.withMemo = withMemo;\n  exports.withModifiers = withModifiers;\n  exports.withScopeId = withScopeId;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n  return exports;\n\n}({}));"
  },
  {
    "path": "test/test.js",
    "content": "/* @flow */\n\nimport \"./tests\";\nimport { noop } from \"@krakenjs/belter/src\";\n\nimport { zoid } from \"./zoid\";\n\nwindow.mockDomain = \"mock://www.parent.com\";\n\nwindow.console.karma = (...args) => {\n  const karma =\n    window.karma ||\n    (window.top && window.top.karma) ||\n    (window.parent && window.parent.karma) ||\n    (window.opener && window.opener.karma);\n  if (karma) {\n    karma.log(\"debug\", args);\n  }\n  // eslint-disable-next-line no-console\n  console.log(...args);\n};\n\nbeforeEach(() => {\n  // eslint-disable-next-line unicorn/prefer-add-event-listener\n  window.onerror = noop;\n\n  if (window !== window.top) {\n    throw new Error(`Expected to be top window`);\n  }\n});\n\nwindow.name = \"__zoid_test_parent_window__\";\n\nconst body = document.body;\n\nif (!body) {\n  throw new Error(`Expected document.body to be present`);\n}\n\nbody.style.width = \"1000px\";\nbody.style.height = \"1000px\";\n\nafterEach((done) => {\n  window.name = \"\";\n  delete window.__component__;\n  delete window.navigator.mockUserAgent;\n  return zoid.destroyAll().then(done);\n});\n"
  },
  {
    "path": "test/tests/actions.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { onCloseWindow } from \"@krakenjs/cross-domain-utils/src\";\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { node, dom } from \"@krakenjs/jsx-pragmatic/src\";\n\nimport { zoid } from \"../zoid\";\nimport { onWindowOpen, runOnClick, getBody } from \"../common\";\n\ndescribe(\"zoid actions\", () => {\n  it(\"should close a zoid iframe\", () => {\n    return wrapPromise(({ expect }) => {\n      let win;\n      let closeComponent;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-container-close-iframe\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          containerTemplate: ({ doc, close, frame, prerenderFrame }) => {\n            closeComponent = close;\n\n            return (\n              <div>\n                <node el={frame} />\n                <node el={prerenderFrame} />\n              </div>\n            ).render(dom({ doc }));\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n          win = openedWindow;\n        })\n      );\n\n      const component = window.__component__();\n      return component()\n        .render(getBody(), zoid.CONTEXT.IFRAME)\n        .then(() => {\n          onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n          return closeComponent();\n        });\n    });\n  });\n\n  it(\"should close a zoid popup\", () => {\n    return wrapPromise(({ expect }) => {\n      let win;\n      let closeComponent;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-container-close-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          containerTemplate: ({ doc, close }) => {\n            closeComponent = close;\n\n            return (<div />).render(dom({ doc }));\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n          win = openedWindow;\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component();\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      }).then(() => {\n        onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n        return closeComponent();\n      });\n    });\n  });\n\n  it(\"should close a zoid popup even when win.close does not work\", () => {\n    return wrapPromise(({ expect }) => {\n      let win;\n      let closeComponent;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-container-close-popup-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          containerTemplate: ({ doc, close }) => {\n            closeComponent = close;\n\n            return (<div />).render(dom({ doc }));\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n          win = openedWindow;\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component();\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      }).then(() => {\n        onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n        const winClose = win.close;\n        win.close = expect(\"close\", () => {\n          win.close = winClose;\n        });\n        return closeComponent();\n      });\n    });\n  });\n\n  it(\"should focus a zoid popup\", () => {\n    return wrapPromise(({ expect }) => {\n      let win;\n      let focusComponent;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-container-focus-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          containerTemplate: ({ doc, focus }) => {\n            focusComponent = focus;\n\n            return (<div />).render(dom({ doc }));\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n          win = openedWindow;\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component();\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      }).then(() => {\n        win.focus = expect(\"windowFocus\");\n        return focusComponent();\n      });\n    });\n  });\n\n  it(\"should close a zoid iframe using the helper\", () => {\n    return wrapPromise(({ expect }) => {\n      let win;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-container-helper-close-iframe\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n          win = openedWindow;\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component();\n      return instance.render(getBody(), zoid.CONTEXT.IFRAME).then(() => {\n        onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n        return instance.close();\n      });\n    });\n  });\n\n  it(\"should focus a zoid popup using the helper\", () => {\n    return wrapPromise(({ expect }) => {\n      let win;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-container-helper-focus-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n          win = openedWindow;\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component();\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      }).then(() => {\n        win.focus = expect(\"windowFocus\");\n        return instance.focus();\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/attributes.js",
    "content": "/* @flow */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { zoid } from \"../zoid\";\nimport { onWindowOpen, getBody } from \"../common\";\n\ndescribe(\"zoid attributes cases\", () => {\n  it(\"should render a component to an iframe with specified static attributes\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedScrolling = \"no\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-static-attributes\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      })\n        .render(getBody())\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          const scrolling =\n            componentWindow.frameElement.getAttribute(\"scrolling\");\n\n          if (scrolling !== expectedScrolling) {\n            throw new Error(\n              `Expected scrolling attribute to be ${expectedScrolling}, got ${scrolling}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component to an iframe with specified dynamic attributes\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedScrolling = \"no\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-dynamic-attributes\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          attributes: ({ props }) => ({\n            iframe: {\n              scrolling: props.scrolling,\n            },\n          }),\n          props: {\n            scrolling: {\n              type: \"string\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        scrolling: \"no\",\n        onRendered: expect(\"onRendered\"),\n      })\n        .render(getBody())\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          const scrolling =\n            componentWindow.frameElement.getAttribute(\"scrolling\");\n\n          if (scrolling !== expectedScrolling) {\n            throw new Error(\n              `Expected scrolling attribute to be ${expectedScrolling}, got ${scrolling}`\n            );\n          }\n        });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/bridge.js",
    "content": "/* @flow */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { zoid } from \"../zoid\";\nimport { runOnClick, getBody } from \"../common\";\n\ndescribe(\"zoid bridge cases\", () => {\n  it(\"should render a component with popup context with ie user-agent\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-render-popup-post-bridge\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            bridgeUrl:\n              \"mock://www.child.com/base/test/windows/bridge/index.htm\",\n          });\n        };\n\n        window.navigator.mockUserAgent =\n          \"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\";\n\n        const component = window.__component__();\n        const instance = component({\n          functionProp: expect(\"functionProp\"),\n\n          run: expect(\"run\", () => {\n            return `\n                        window.xprops.functionProp();\n                    `;\n          }),\n        });\n\n        return runOnClick(() => {\n          return instance.render(getBody(), zoid.CONTEXT.POPUP);\n        });\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should render a component with popup context with ie user-agent, and error when no bridge url set\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-post-bridge-no-url\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      window.navigator.mockUserAgent =\n        \"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\";\n\n      const component = window.__component__();\n      const instance = component();\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      }).catch(expect(\"catch\"));\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/child.js",
    "content": "/* @flow */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { onCloseWindow } from \"@krakenjs/cross-domain-utils/src\";\n\nimport { zoid } from \"../zoid\";\nimport { onWindowOpen, runOnClick, getBody } from \"../common\";\n\ndescribe(\"zoid child cases\", () => {\n  it(\"should render a popup component to an iframe and focus from the child\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-focus-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        didFocus: expect(\"didFocus\", (focused) => {\n          if (!focused) {\n            throw new Error(`Expected window to have been focused`);\n          }\n        }),\n\n        run: () => {\n          return `\n                        let focused = false;\n                        window.focus = () => {\n                            focused = true;\n                        };\n\n                        window.xprops.focus().then(() => {\n                            return window.xprops.didFocus(focused);\n                        });\n                    `;\n        },\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render a popup component to an iframe and close from the child\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-render-iframe-close-from-child\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            return onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          onClose: expect(\"onClose\"),\n\n          run: () => {\n            return `\n                        window.xprops.close();\n                    `;\n          },\n        });\n\n        return runOnClick(() => {\n          return instance.render(getBody(), zoid.CONTEXT.POPUP);\n        });\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should render a popup component to an iframe and close from the child manually\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-render-iframe-close-manually-from-child\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            return onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          onClose: expect(\"onClose\"),\n\n          run: () => {\n            return `\n                        window.close();\n                    `;\n          },\n        });\n\n        return runOnClick(() => {\n          return instance.render(getBody(), zoid.CONTEXT.POPUP);\n        });\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should pass an error up from the child\", () => {\n    return wrapPromise(({ expect }) => {\n      const message = \"Something went wrong\";\n      const code = \"OH_NO\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-error-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        onError: expect(\"onError\", (err) => {\n          if (!(err instanceof Error)) {\n            throw new TypeError(`Expected an error to be passed up`);\n          }\n\n          if (err.message !== message) {\n            throw new Error(\n              `Expected error message to be ${JSON.stringify(\n                message\n              )}, got ${JSON.stringify(err.message)}`\n            );\n          }\n\n          // $FlowFixMe\n          const errCode = err.code;\n\n          if (errCode !== code) {\n            throw new Error(\n              `Expected error code to be ${JSON.stringify(\n                code\n              )}, got ${JSON.stringify(errCode)}`\n            );\n          }\n        }),\n\n        run: () => {\n          return `\n                        const err = new Error(${JSON.stringify(message)});\n                        err.code = ${JSON.stringify(code)};\n                        window.xprops.onError(err);\n                    `;\n        },\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/children.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { getParent } from \"@krakenjs/cross-domain-utils/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\n\nimport { onWindowOpen, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid children cases\", () => {\n  it(\"should render a set of of child components which inherit parent props\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        const CardNumberField = zoid.create({\n          tag: \"test-multiple-children-card-field-number\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        const CardCVVField = zoid.create({\n          tag: \"test-multiple-children-card-field-cvv\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        const CardExpiryField = zoid.create({\n          tag: \"test-multiple-children-card-field-expiry\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: CardNumberField,\n              CVVField: CardCVVField,\n              ExpiryField: CardExpiryField,\n            };\n          },\n        });\n\n        return CardFields;\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const CardFields = window.__component__();\n      const cardFields = CardFields({\n        style: {\n          color: \"red\",\n        },\n        onRendered: avoid(\"onRenderedCardFields\"),\n        callProp: avoid(\"callPropCardFields\"),\n        run: () => `\n                    window.xprops.callProp(window.xprops.style);\n                `,\n      });\n\n      const cardNumberInstance = cardFields.NumberField({\n        onRendered: expect(\"onRenderedNumberField\"),\n        callProp: expect(\"callPropNumberField\", (style) => {\n          if (!style || style.color !== \"red\") {\n            throw new Error(`Expected number field to inherit style`);\n          }\n        }),\n        run: () => `\n                    window.xprops.callProp(window.xprops.parent.props.style);\n                `,\n      });\n\n      const cardCVVInstance = cardFields.CVVField({\n        onRendered: expect(\"onRenderedCVVField\"),\n        callProp: expect(\"callPropCVVField\", (style) => {\n          if (!style || style.color !== \"red\") {\n            throw new Error(`Expected cvv field to inherit style`);\n          }\n        }),\n        run: () => `\n                    window.xprops.callProp(window.xprops.parent.props.style);\n                `,\n      });\n\n      const cardExpiryInstance = cardFields.ExpiryField({\n        onRendered: expect(\"onRenderedExpiryField\"),\n        callProp: expect(\"callPropExpiryField\", (style) => {\n          if (!style || style.color !== \"red\") {\n            throw new Error(`Expected expiry field to inherit style`);\n          }\n        }),\n        run: () => `\n                    window.xprops.callProp(window.xprops.parent.props.style);\n                `,\n      });\n\n      return ZalgoPromise.all([\n        cardNumberInstance.render(getBody()),\n        cardCVVInstance.render(getBody()),\n        cardExpiryInstance.render(getBody()),\n      ]);\n    });\n  });\n\n  it(\"should render a component in isolation with props, with multiple children which are never called\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-isolation\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: () => {\n                throw new Error(`Should not call NumberField`);\n              },\n              CVVField: () => {\n                throw new Error(`Should not call CVVField`);\n              },\n              ExpiryField: () => {\n                throw new Error(`Should not call ExpiryField`);\n              },\n            };\n          },\n        });\n\n        return CardFields;\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const CardFields = window.__component__();\n      const cardFields = CardFields({\n        style: {\n          color: \"red\",\n        },\n        onRendered: expect(\"onRenderedCardFields\"),\n        callProp: expect(\"callPropCardFields\", (style) => {\n          if (!style || style.color !== \"red\") {\n            throw new Error(`Expected expiry field to inherit style`);\n          }\n        }),\n        run: () => `\n                    window.xprops.callProp(window.xprops.style);\n                `,\n      });\n\n      return cardFields.render(getBody());\n    });\n  });\n\n  it(\"should render a set of of child components which export to the parent\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        const CardNumberField = zoid.create({\n          tag: \"test-multiple-children-card-field-number-export\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        const CardCVVField = zoid.create({\n          tag: \"test-multiple-children-card-field-cvv-export\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        const CardExpiryField = zoid.create({\n          tag: \"test-multiple-children-card-field-expiry-export\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-export\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: CardNumberField,\n              CVVField: CardCVVField,\n              ExpiryField: CardExpiryField,\n            };\n          },\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        return CardFields;\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const CardFields = window.__component__();\n      const cardFields = CardFields();\n\n      let onSubmitCalledTimes = 0;\n      const onSubmit = expect(\"onSubmit\", () => {\n        onSubmitCalledTimes += 1;\n      });\n\n      const cardNumberInstance = cardFields.NumberField({\n        onSubmit,\n        run: () => `\n                    window.xprops.parent.export({\n                        submit: () => {\n                            window.xprops.onSubmit();\n                        }\n                    });\n                `,\n      });\n\n      const cardCVVInstance = cardFields.CVVField({\n        onSubmit,\n        run: () => `\n                    window.xprops.parent.export({\n                        submit: () => {\n                            window.xprops.onSubmit();\n                        }\n                    });\n                `,\n      });\n\n      const cardExpiryInstance = cardFields.ExpiryField({\n        onSubmit,\n        run: () => `\n                    window.xprops.parent.export({\n                        submit: () => {\n                            window.xprops.onSubmit();\n                        }\n                    });\n                `,\n      });\n\n      return ZalgoPromise.all([\n        cardNumberInstance.render(getBody()),\n        cardCVVInstance.render(getBody()),\n        cardExpiryInstance.render(getBody()),\n      ])\n        .then(() => {\n          return cardFields\n            .submit()\n            .timeout(500, new Error(`cardFields.submit() timed out`));\n        })\n        .then(() => {\n          if (onSubmitCalledTimes !== 1) {\n            throw new Error(`Expected onSubmit to be called a single time`);\n          }\n        });\n    });\n  });\n\n  it(\"should render a child component which directly inherits a prop from the parent\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        const Button = zoid.create({\n          tag: \"test-multiple-children-card-button-inherit-prop\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            fundingSource: {\n              type: \"string\",\n              required: false,\n              default: ({ props }) => props.parent.props.fundingSource,\n            },\n          },\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-inherit-prop\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            fundingSource: {\n              type: \"string\",\n              value: () => \"card\",\n            },\n          },\n          children: () => {\n            return {\n              Button,\n            };\n          },\n        });\n\n        return CardFields;\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const CardFields = window.__component__();\n      const cardFields = CardFields({\n        onRendered: expect(\"onRenderedCardFields\"),\n        callProp: expect(\"callPropCardFields\", ({ fundingSource }) => {\n          if (fundingSource !== \"card\") {\n            throw new Error(\n              `Expected fundingSource to be card, got ${fundingSource}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.callProp({ fundingSource: window.xprops.fundingSource });\n                `,\n      });\n\n      const cardButtonInstance = cardFields.Button({\n        onRendered: expect(\"onRenderedButton\"),\n        callProp: expect(\"callPropbutton\", ({ fundingSource }) => {\n          if (fundingSource !== \"card\") {\n            throw new Error(\n              `Expected fundingSource to be card, got ${fundingSource}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.callProp({ fundingSource: window.xprops.fundingSource });\n                `,\n      });\n\n      return ZalgoPromise.all([\n        cardFields.render(getBody()),\n        cardButtonInstance.render(getBody()),\n      ]);\n    });\n  });\n\n  it(\"should render a set of of child components and get all siblings\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        const CardNumberField = zoid.create({\n          tag: \"test-multiple-children-card-field-number-getsiblings\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardCVVField = zoid.create({\n          tag: \"test-multiple-children-card-field-cvv-getsiblings\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardExpiryField = zoid.create({\n          tag: \"test-multiple-children-card-field-expiry-getsiblings\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-getsiblings\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: CardNumberField,\n              CVVField: CardCVVField,\n              ExpiryField: CardExpiryField,\n            };\n          },\n        });\n\n        const OtherComponent = zoid.create({\n          tag: \"test-multiple-children-other-component-getsiblings\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        return {\n          CardFields,\n          OtherComponent,\n        };\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { CardFields, OtherComponent } = window.__component__();\n\n      const cardFields = CardFields({\n        onRendered: avoid(\"onRenderedCardFields\"),\n      });\n\n      const onSiblings = (siblings, xprops) => {\n        const EXPECTED_SIBLINGS = [\n          \"test-multiple-children-card-field-number-getsiblings\",\n          \"test-multiple-children-card-field-cvv-getsiblings\",\n          \"test-multiple-children-card-field-expiry-getsiblings\",\n          \"test-multiple-children-other-component-getsiblings\",\n        ];\n\n        for (const sibling of siblings) {\n          if (!sibling.props) {\n            throw new Error(`Sibling missing xprops`);\n          }\n\n          if (EXPECTED_SIBLINGS.indexOf(sibling.props.tag) === -1) {\n            throw new Error(`Unexpected sibling: ${sibling.props.tag}`);\n          }\n\n          if (!sibling.exports) {\n            throw new Error(`Sibling ${sibling.props.tag} missing exports`);\n          }\n\n          if (sibling.props.uid === xprops.uid) {\n            xprops.export({\n              submit: expect(\"submit\"),\n            });\n          } else {\n            sibling.props.doXProp().then(() => {\n              sibling.exports.submit();\n            });\n          }\n        }\n\n        for (const tag of EXPECTED_SIBLINGS) {\n          if (!siblings.find((sibling) => sibling.props.tag === tag)) {\n            throw new Error(`Missing sibling: ${tag}`);\n          }\n        }\n\n        if (siblings.length !== EXPECTED_SIBLINGS.length) {\n          throw new Error(\n            `Expected ${EXPECTED_SIBLINGS.length} siblings, found ${siblings.length}`\n          );\n        }\n      };\n\n      const renderAll = new ZalgoPromise();\n\n      const passSiblings = () =>\n        renderAll.then(\n          () => `\n                const siblings = window.xprops.getSiblings({ anyParent: true });\n                window.xprops.onSiblings(siblings, window.xprops);\n            `\n        );\n\n      const onError = (err) => {\n        throw err;\n      };\n\n      const cardNumberInstance = cardFields.NumberField({\n        onRendered: expect(\"onRenderedNumberField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardCVVInstance = cardFields.CVVField({\n        onRendered: expect(\"onRenderedCVVField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardExpiryInstance = cardFields.ExpiryField({\n        onRendered: expect(\"onRenderedExpiryField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const otherComponentInstance = OtherComponent({\n        onRendered: expect(\"onRenderedOtherComponent\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      return ZalgoPromise.all([\n        cardNumberInstance.render(getBody()),\n        cardCVVInstance.render(getBody()),\n        cardExpiryInstance.render(getBody()),\n        otherComponentInstance.render(getBody()),\n      ]).then(() => renderAll.resolve());\n    });\n  });\n\n  it(\"should render a set of of child components and get all siblings with the same parent\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        const CardNumberField = zoid.create({\n          tag: \"test-multiple-children-card-field-number-getsiblings-sameparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardCVVField = zoid.create({\n          tag: \"test-multiple-children-card-field-cvv-getsiblings-sameparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardExpiryField = zoid.create({\n          tag: \"test-multiple-children-card-field-expiry-getsiblings-sameparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-getsiblings-sameparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: CardNumberField,\n              CVVField: CardCVVField,\n              ExpiryField: CardExpiryField,\n            };\n          },\n        });\n\n        const OtherComponent = zoid.create({\n          tag: \"test-multiple-children-other-component-getsiblings-sameparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        return {\n          CardFields,\n          OtherComponent,\n        };\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { CardFields, OtherComponent } = window.__component__();\n\n      const cardFields = CardFields({\n        onRendered: avoid(\"onRenderedCardFields\"),\n      });\n\n      const onSiblings = (siblings, xprops) => {\n        const EXPECTED_SIBLINGS = [\n          \"test-multiple-children-card-field-number-getsiblings-sameparent\",\n          \"test-multiple-children-card-field-cvv-getsiblings-sameparent\",\n          \"test-multiple-children-card-field-expiry-getsiblings-sameparent\",\n        ];\n\n        for (const sibling of siblings) {\n          if (!sibling.props) {\n            throw new Error(`Sibling missing xprops`);\n          }\n\n          if (EXPECTED_SIBLINGS.indexOf(sibling.props.tag) === -1) {\n            throw new Error(`Unexpected sibling: ${sibling.props.tag}`);\n          }\n\n          if (!sibling.exports) {\n            throw new Error(`Sibling ${sibling.props.tag} missing exports`);\n          }\n\n          if (sibling.props.uid === xprops.uid) {\n            xprops.export({\n              submit: expect(\"submit\"),\n            });\n          } else {\n            sibling.props.doXProp().then(() => {\n              sibling.exports.submit();\n            });\n          }\n        }\n\n        for (const tag of EXPECTED_SIBLINGS) {\n          if (!siblings.find((sibling) => sibling.props.tag === tag)) {\n            throw new Error(`Missing sibling: ${tag}`);\n          }\n        }\n\n        if (siblings.length !== EXPECTED_SIBLINGS.length) {\n          throw new Error(\n            `Expected ${EXPECTED_SIBLINGS.length} siblings, found ${siblings.length}`\n          );\n        }\n      };\n\n      const renderAll = new ZalgoPromise();\n\n      const passSiblings = () =>\n        renderAll.then(\n          () => `\n                const siblings = window.xprops.getSiblings();\n                window.xprops.onSiblings(siblings, window.xprops);\n            `\n        );\n\n      const onError = (err) => {\n        throw err;\n      };\n\n      const cardNumberInstance = cardFields.NumberField({\n        onRendered: expect(\"onRenderedNumberField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardCVVInstance = cardFields.CVVField({\n        onRendered: expect(\"onRenderedCVVField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardExpiryInstance = cardFields.ExpiryField({\n        onRendered: expect(\"onRenderedExpiryField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const otherComponentInstance = OtherComponent({\n        onRendered: expect(\"onRenderedOtherComponent\"),\n        onError: avoid(\"onError\", onError),\n      });\n\n      return ZalgoPromise.all([\n        cardNumberInstance.render(getBody()),\n        cardCVVInstance.render(getBody()),\n        cardExpiryInstance.render(getBody()),\n        otherComponentInstance.render(getBody()),\n      ]).then(() => renderAll.resolve());\n    });\n  });\n\n  it(\"should render a set of of child components and get all siblings with the same parent, when a different parent exists\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        const CardNumberField = zoid.create({\n          tag: \"test-multiple-children-card-field-number-getsiblings-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardCVVField = zoid.create({\n          tag: \"test-multiple-children-card-field-cvv-getsiblings-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardExpiryField = zoid.create({\n          tag: \"test-multiple-children-card-field-expiry-getsiblings-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-getsiblings-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: CardNumberField,\n              CVVField: CardCVVField,\n              ExpiryField: CardExpiryField,\n            };\n          },\n        });\n\n        const OtherComponent = zoid.create({\n          tag: \"test-multiple-children-other-component-getsiblings-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const OtherComponentParent = zoid.create({\n          tag: \"test-multiple-children-other-component-parent-getsiblings-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              OtherComponent,\n            };\n          },\n        });\n\n        return {\n          CardFields,\n          OtherComponentParent,\n        };\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { CardFields, OtherComponentParent } = window.__component__();\n\n      const cardFields = CardFields({\n        onRendered: avoid(\"onRenderedCardFields\"),\n      });\n\n      const onSiblings = (siblings, xprops) => {\n        const EXPECTED_SIBLINGS = [\n          \"test-multiple-children-card-field-number-getsiblings-sameparent-diffparent\",\n          \"test-multiple-children-card-field-cvv-getsiblings-sameparent-diffparent\",\n          \"test-multiple-children-card-field-expiry-getsiblings-sameparent-diffparent\",\n        ];\n\n        for (const sibling of siblings) {\n          if (!sibling.props) {\n            throw new Error(`Sibling missing xprops`);\n          }\n\n          if (EXPECTED_SIBLINGS.indexOf(sibling.props.tag) === -1) {\n            throw new Error(`Unexpected sibling: ${sibling.props.tag}`);\n          }\n\n          if (!sibling.exports) {\n            throw new Error(`Sibling ${sibling.props.tag} missing exports`);\n          }\n\n          if (sibling.props.uid === xprops.uid) {\n            xprops.export({\n              submit: expect(\"submit\"),\n            });\n          } else {\n            sibling.props.doXProp().then(() => {\n              sibling.exports.submit();\n            });\n          }\n        }\n\n        for (const tag of EXPECTED_SIBLINGS) {\n          if (!siblings.find((sibling) => sibling.props.tag === tag)) {\n            throw new Error(`Missing sibling: ${tag}`);\n          }\n        }\n\n        if (siblings.length !== EXPECTED_SIBLINGS.length) {\n          throw new Error(\n            `Expected ${EXPECTED_SIBLINGS.length} siblings, found ${siblings.length}`\n          );\n        }\n      };\n\n      const renderAll = new ZalgoPromise();\n\n      const passSiblings = () =>\n        renderAll.then(\n          () => `\n                const siblings = window.xprops.getSiblings();\n                window.xprops.onSiblings(siblings, window.xprops);\n            `\n        );\n\n      const onError = (err) => {\n        throw err;\n      };\n\n      const cardNumberInstance = cardFields.NumberField({\n        onRendered: expect(\"onRenderedNumberField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardCVVInstance = cardFields.CVVField({\n        onRendered: expect(\"onRenderedCVVField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardExpiryInstance = cardFields.ExpiryField({\n        onRendered: expect(\"onRenderedExpiryField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const otherComponentInstance = OtherComponentParent().OtherComponent({\n        onRendered: expect(\"onRenderedOtherComponent\"),\n        onError: avoid(\"onError\", onError),\n      });\n\n      return ZalgoPromise.all([\n        cardNumberInstance.render(getBody()),\n        cardCVVInstance.render(getBody()),\n        cardExpiryInstance.render(getBody()),\n        otherComponentInstance.render(getBody()),\n      ]).then(() => renderAll.resolve());\n    });\n  });\n\n  it(\"should render a set of of child components and get all siblings, when a different parent exists\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        const CardNumberField = zoid.create({\n          tag: \"test-multiple-children-card-field-number-getsiblings-anyparent-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardCVVField = zoid.create({\n          tag: \"test-multiple-children-card-field-cvv-getsiblings-anyparent-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardExpiryField = zoid.create({\n          tag: \"test-multiple-children-card-field-expiry-getsiblings-anyparent-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const CardFields = zoid.create({\n          tag: \"test-multiple-children-card-fields-getsiblings-anyparent-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              NumberField: CardNumberField,\n              CVVField: CardCVVField,\n              ExpiryField: CardExpiryField,\n            };\n          },\n        });\n\n        const OtherComponent = zoid.create({\n          tag: \"test-multiple-children-other-component-getsiblings-anyparent-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            submit: {\n              type: \"function\",\n            },\n          },\n        });\n\n        const OtherComponentParent = zoid.create({\n          tag: \"test-multiple-children-other-component-parent-getsiblings-anyparent-sameparent-diffparent\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          children: () => {\n            return {\n              OtherComponent,\n            };\n          },\n        });\n\n        return {\n          CardFields,\n          OtherComponentParent,\n        };\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { CardFields, OtherComponentParent } = window.__component__();\n\n      const cardFields = CardFields({\n        onRendered: avoid(\"onRenderedCardFields\"),\n      });\n\n      const onSiblings = (siblings, xprops) => {\n        const EXPECTED_SIBLINGS = [\n          \"test-multiple-children-card-field-number-getsiblings-anyparent-sameparent-diffparent\",\n          \"test-multiple-children-card-field-cvv-getsiblings-anyparent-sameparent-diffparent\",\n          \"test-multiple-children-card-field-expiry-getsiblings-anyparent-sameparent-diffparent\",\n          \"test-multiple-children-other-component-getsiblings-anyparent-sameparent-diffparent\",\n        ];\n\n        for (const sibling of siblings) {\n          if (!sibling.props) {\n            throw new Error(`Sibling missing xprops`);\n          }\n\n          if (EXPECTED_SIBLINGS.indexOf(sibling.props.tag) === -1) {\n            throw new Error(`Unexpected sibling: ${sibling.props.tag}`);\n          }\n\n          if (!sibling.exports) {\n            throw new Error(`Sibling ${sibling.props.tag} missing exports`);\n          }\n\n          if (sibling.props.uid === xprops.uid) {\n            xprops.export({\n              submit: expect(\"submit\"),\n            });\n          } else {\n            sibling.props.doXProp().then(() => {\n              sibling.exports.submit();\n            });\n          }\n        }\n\n        for (const tag of EXPECTED_SIBLINGS) {\n          if (!siblings.find((sibling) => sibling.props.tag === tag)) {\n            throw new Error(`Missing sibling: ${tag}`);\n          }\n        }\n\n        if (siblings.length !== EXPECTED_SIBLINGS.length) {\n          throw new Error(\n            `Expected ${EXPECTED_SIBLINGS.length} siblings, found ${siblings.length}`\n          );\n        }\n      };\n\n      const renderAll = new ZalgoPromise();\n\n      const passSiblings = () =>\n        renderAll.then(\n          () => `\n                const siblings = window.xprops.getSiblings({ anyParent: true });\n                window.xprops.onSiblings(siblings, window.xprops);\n            `\n        );\n\n      const onError = (err) => {\n        throw err;\n      };\n\n      const cardNumberInstance = cardFields.NumberField({\n        onRendered: expect(\"onRenderedNumberField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardCVVInstance = cardFields.CVVField({\n        onRendered: expect(\"onRenderedCVVField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const cardExpiryInstance = cardFields.ExpiryField({\n        onRendered: expect(\"onRenderedExpiryField\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      const otherComponentInstance = OtherComponentParent().OtherComponent({\n        onRendered: expect(\"onRenderedOtherComponent\"),\n        onSiblings: expect(\"onSiblings\", onSiblings),\n        doXProp: expect(\"doXProp\"),\n        onError: avoid(\"onError\", onError),\n        run: passSiblings,\n      });\n\n      return ZalgoPromise.all([\n        cardNumberInstance.render(getBody()),\n        cardCVVInstance.render(getBody()),\n        cardExpiryInstance.render(getBody()),\n        otherComponentInstance.render(getBody()),\n      ]).then(() => renderAll.resolve());\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/clone.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { getParent } from \"@krakenjs/cross-domain-utils/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\n\nimport { zoid } from \"../zoid\";\nimport { onWindowOpen, getBody } from \"../common\";\n\ndescribe(\"zoid clone cases\", () => {\n  it(\"should initialize a component, and clone it\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-clone\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      })\n        .clone()\n        .render(getBody());\n    });\n  });\n\n  it(\"should initialize a component, and clone it with different props\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-clone-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: avoid(\"onRenderedOriginal\"),\n      })\n        .clone({\n          decorate: () => {\n            return {\n              onRendered: expect(\"onRendered\"),\n            };\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should initialize a component, and clone it from instances\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-clone-instances\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      if (component.instances.length !== 1) {\n        throw new Error(\n          `Expected 1 instance, got ${component.instances.length}`\n        );\n      }\n\n      const clone = component.instances[0].clone();\n\n      if (component.instances.length !== 2) {\n        throw new Error(\n          `Expected 2 instances, got ${component.instances.length}`\n        );\n      }\n\n      return clone\n        .render(getBody())\n        .then(() => {\n          return ZalgoPromise.all([\n            component.instances[0].close(),\n            clone.close(),\n          ]);\n        })\n        .then(() => {\n          if (component.instances.length !== 0) {\n            throw new Error(\n              `Expected 0 instances, got ${component.instances.length}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should initialize a component, and clone it from instances with different props\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-clone-instances-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      component({\n        onRendered: avoid(\"onRenderedOriginal\"),\n      });\n\n      if (component.instances.length !== 1) {\n        throw new Error(\n          `Expected 1 instance, got ${component.instances.length}`\n        );\n      }\n\n      const clone = component.instances[0].clone({\n        decorate: () => {\n          return {\n            onRendered: expect(\"onRendered\"),\n          };\n        },\n      });\n\n      if (component.instances.length !== 2) {\n        throw new Error(\n          `Expected 2 instances, got ${component.instances.length}`\n        );\n      }\n\n      return clone\n        .render(getBody())\n        .then(() => {\n          return ZalgoPromise.all([\n            component.instances[0].close(),\n            clone.close(),\n          ]);\n        })\n        .then(() => {\n          if (component.instances.length !== 0) {\n            throw new Error(\n              `Expected 0 instances, got ${component.instances.length}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should initialize an ineligible component, clone it, and make sure both instances are destroyed\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-clone-ineligible\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: () => ({ eligible: false }),\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .clone({\n          decorate: () => {\n            return {\n              onDestroy: expect(\"onDestroy2\"),\n            };\n          },\n        })\n        .render(getBody())\n        .catch(expect(\"catch\"))\n        .then(() => {\n          if (component.instances.length !== 0) {\n            throw new Error(\n              `Expected 0 instances, got ${component.instances.length}`\n            );\n          }\n        });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/dimensions.jsx",
    "content": "/* @flow */\n/** @jsx node */\n/* eslint max-lines: off */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { node, dom } from \"@krakenjs/jsx-pragmatic/src\";\n\nimport { zoid } from \"../zoid\";\nimport { onWindowOpen, runOnClick, getBody } from \"../common\";\n\ndescribe(\"zoid dimensions cases\", () => {\n  it(\"should render a component to an iframe with specific px dimensions\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 178;\n      const height = 253;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-dimensions\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          dimensions: {\n            width: \"178px\",\n            height: \"253px\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      })\n        .render(getBody())\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          if (componentWindow.innerWidth !== expectedWidth) {\n            throw new Error(\n              `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n            );\n          }\n\n          if (componentWindow.innerHeight !== expectedHeight) {\n            throw new Error(\n              `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n            );\n          }\n        });\n    });\n  });\n\n  it.skip(\"should render a component to a popup with specific px dimensions\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 178;\n      const height = 253;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-dimensions\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          dimensions: {\n            width: \"178px\",\n            height: \"253px\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      })\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          if (componentWindow.innerWidth !== expectedWidth) {\n            throw new Error(\n              `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n            );\n          }\n\n          if (componentWindow.innerHeight !== expectedHeight) {\n            throw new Error(\n              `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component to an iframe and resize with specific px dimensions\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-resize\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n      return instance\n        .render(getBody())\n        .then(() => {\n          return instance.resize({ width, height });\n        })\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          if (componentWindow.innerWidth !== expectedWidth) {\n            throw new Error(\n              `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n            );\n          }\n\n          if (componentWindow.innerHeight !== expectedHeight) {\n            throw new Error(\n              `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component to an popup with specific px dimensions function\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 1282;\n      const height = 720;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-dimensions-func\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          dimensions: ({ props }) => ({\n            width: props.dimensions.width,\n            height: props.dimensions.height,\n          }),\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n        dimensions: {\n          width: \"1282px\",\n          height: \"720px\",\n        },\n      })\n        .render(getBody())\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          if (componentWindow.innerWidth !== expectedWidth) {\n            throw new Error(\n              `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n            );\n          }\n\n          if (componentWindow.innerHeight !== expectedHeight) {\n            throw new Error(\n              `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component to an iframe and resize from the child with specific px dimensions\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-resize-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n\n        run: () => {\n          return `\n                        window.xprops.resize({ width: ${JSON.stringify(\n                          width\n                        )}, height: ${JSON.stringify(height)} })\n                            .then(() => window.xprops.onResized());\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize from the child\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: true,\n            width: true,\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResize: expect(\"onResize\"),\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n\n        run: () => {\n          return `\n                        document.body.style.height = '${height}px';\n                        document.body.style.width = '${width}px';\n                        setTimeout(window.xprops.onResized, 100);\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize width from the child\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 100;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-width-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: false,\n            width: true,\n          },\n          dimensions: {\n            width: \"100px\",\n            height: \"100px\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n\n        run: () => {\n          return `\n                        document.body.style.height = '${height}px';\n                        document.body.style.width = '${width}px';\n                        setTimeout(window.xprops.onResized, 100);\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize height from the child\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 105;\n\n      const expectedWidth = 100;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-height-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: true,\n            width: false,\n          },\n          dimensions: {\n            height: \"100px\",\n            width: \"100px\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n\n        run: () => {\n          return `\n                        document.body.style.height = '${height}px';\n                        document.body.style.width = '${width}px';\n                        setTimeout(window.xprops.onResized, 100);\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize from the child with a custom element\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-custom-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: true,\n            width: true,\n            element: \"#container\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n\n        run: () => {\n          return `\n                        let container = document.querySelector('#container');\n                        container.style.height = '${height}px';\n                        container.style.width = '${width}px';\n                        setTimeout(window.xprops.onResized, 100);\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize from the prerender template\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-from-prerender\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: true,\n            width: true,\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n          prerenderTemplate: ({ props, doc }) => {\n            const { onResized } = props;\n            window.__onResized__ = onResized;\n            return (\n              <html>\n                <body>\n                  <script>\n                    {`\n                                            document.body.style.height = '${height}px';\n                                            document.body.style.width = '${width}px';\n                                            setTimeout(window.parent.__onResized__, 1);\n                                        `}\n                  </script>\n                </body>\n              </html>\n            ).render(dom({ doc }));\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize the width from the prerender template\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = 100;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-width-from-prerender\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: false,\n            width: true,\n          },\n          dimensions: {\n            height: \"100px\",\n            width: \"100px\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n          prerenderTemplate: ({ props, doc }) => {\n            const { onResized } = props;\n            window.__onResized__ = onResized;\n            return (\n              <html>\n                <body>\n                  <script>\n                    {`\n                                            document.body.style.height = '${height}px';\n                                            document.body.style.width = '${width}px';\n                                            setTimeout(window.parent.__onResized__, 1);\n                                        `}\n                  </script>\n                </body>\n              </html>\n            ).render(dom({ doc }));\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize the height from the prerender template\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = 100;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-height-from-prerender\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: true,\n            width: false,\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n          dimensions: {\n            height: \"100px\",\n            width: \"100px\",\n          },\n          prerenderTemplate: ({ props, doc }) => {\n            const { onResized } = props;\n            window.__onResized__ = onResized;\n            return (\n              <html>\n                <body>\n                  <script>\n                    {`\n                                            document.body.style.height = '${height}px';\n                                            document.body.style.width = '${width}px';\n                                            setTimeout(window.parent.__onResized__, 1);\n                                        `}\n                  </script>\n                </body>\n              </html>\n            ).render(dom({ doc }));\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe and autoresize using a custom element from the prerender template\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 293;\n      const height = 101;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-autoresize-custom-from-prerender\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          autoResize: {\n            height: true,\n            width: true,\n            element: \"#container\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n          prerenderTemplate: ({ props, doc }) => {\n            const { onResized } = props;\n            window.__onResized__ = onResized;\n            return (\n              <html>\n                <body>\n                  <div id=\"container\" />\n                  <script>\n                    {`\n                                            let container = document.querySelector('#container');\n                                            container.style.height = '${height}px';\n                                            container.style.width = '${width}px';\n                                            setTimeout(window.parent.__onResized__, 1);\n                                        `}\n                  </script>\n                </body>\n              </html>\n            ).render(dom({ doc }));\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onResized: expect(\"onResized\", () => {\n          return componentWindowPromise.then((componentWindow) => {\n            if (componentWindow.innerWidth !== expectedWidth) {\n              throw new Error(\n                `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n              );\n            }\n\n            if (componentWindow.innerHeight !== expectedHeight) {\n              throw new Error(\n                `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n              );\n            }\n          });\n        }),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component to an iframe with 100% percentage dimensions\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 178;\n      const height = 253;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      const el = document.createElement(\"div\");\n      el.style.width = `${width}px`;\n      el.style.height = `${height}px`;\n\n      if (!getBody()) {\n        throw new Error(`Could not find getBody()`);\n      }\n\n      getBody().appendChild(el);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-100-percent-dimensions\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          dimensions: {\n            width: \"100%\",\n            height: \"100%\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      })\n        .render(el)\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          if (componentWindow.innerWidth !== expectedWidth) {\n            throw new Error(\n              `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n            );\n          }\n\n          if (componentWindow.innerHeight !== expectedHeight) {\n            throw new Error(\n              `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component to an iframe with 50% percentage dimensions\", () => {\n    return wrapPromise(({ expect }) => {\n      const width = 161;\n      const height = 257;\n\n      const expectedWidth = width;\n      const expectedHeight = height;\n\n      const el = document.createElement(\"div\");\n      el.style.width = `${width * 2}px`;\n      el.style.height = `${height * 2}px`;\n\n      if (!getBody()) {\n        throw new Error(`Could not find getBody()`);\n      }\n\n      getBody().appendChild(el);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-50-percent-dimensions\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          dimensions: {\n            width: \"50%\",\n            height: \"50%\",\n          },\n          attributes: {\n            iframe: {\n              scrolling: \"no\",\n            },\n          },\n        });\n      };\n\n      const componentWindowPromise = onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => win)\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      })\n        .render(el)\n        .then(() => {\n          return componentWindowPromise;\n        })\n        .then((componentWindow) => {\n          if (componentWindow.innerWidth !== expectedWidth) {\n            throw new Error(\n              `Expected width to be ${expectedWidth}, got ${componentWindow.innerWidth}`\n            );\n          }\n\n          if (componentWindow.innerHeight !== expectedHeight) {\n            throw new Error(\n              `Expected height to be ${expectedHeight}, got ${componentWindow.innerHeight}`\n            );\n          }\n        });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/domain.js",
    "content": "/* @flow */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { getDomain } from \"@krakenjs/cross-domain-utils/src\";\n\nimport { zoid } from \"../zoid\";\nimport { getBody } from \"../common\";\n\ndescribe(\"parent domain check\", () => {\n  describe(\"should not throw error when: \", () => {\n    it(\"allowedParentDomains is a wildcard\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-parent-domain-wildcard\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          allowedParentDomains: \"*\",\n        });\n      };\n\n      const component = window.__component__();\n      return component().render(getBody());\n    });\n\n    it(\"allowedParentDomains is specified as string\", () => {\n      it(\"allowedParentDomains is a wildcard\", () => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-parent-domain-string\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            allowedParentDomains: getDomain(),\n          });\n        };\n\n        const component = window.__component__();\n        return component().render(getBody());\n      });\n    });\n\n    it(\"allowedParentDomains is specified as array of strings and parent domian match\", () => {\n      it(\"allowedParentDomains is a wildcard\", () => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-parent-domain-array\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            allowedParentDomains: [getDomain(), \"https://www.foo.com\"],\n          });\n        };\n\n        const component = window.__component__();\n        return component().render(getBody());\n      });\n    });\n\n    it(\"allowedParentDomains is specified as array of strings with a wildcard\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-parent-domain-array-wildcard\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          allowedParentDomains: [\"*\", \"https://www.foo.com\"],\n        });\n      };\n\n      const component = window.__component__();\n      return component().render(getBody());\n    });\n\n    it(\"allowedParentDomains is specified as a regex and parent domain match\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-parent-domain-regex\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          allowedParentDomains: /.+/,\n        });\n      };\n\n      const component = window.__component__();\n      return component().render(getBody());\n    });\n  });\n\n  describe(\"should throw error when: \", () => {\n    it(\"allowedParentDomains is specified as string and parent domain does not match\", () => {\n      return wrapPromise(({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-parent-domain-string-nomatch\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            allowedParentDomains: \"https://www.foo.com\",\n          });\n        };\n\n        const component = window.__component__();\n        return component().render(getBody()).catch(expect(\"onError\"));\n      });\n    });\n\n    it(\"allowedParentDomains is specified as array of strings and parent domain does not match\", () => {\n      return wrapPromise(({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-parent-domain-array-nomatch\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            allowedParentDomains: [\n              \"https://www.foo.com\",\n              \"https://www.bar.com\",\n            ],\n          });\n        };\n\n        const component = window.__component__();\n        return component().render(getBody()).catch(expect(\"onError\"));\n      });\n    });\n\n    it(\"allowedParentDomains is specified as array of regex expressions and parent domain does not match\", () => {\n      return wrapPromise(({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-parent-domain-regex-nomatch\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            allowedParentDomains: /^https:\\/\\/www\\.foo\\.com$/,\n          });\n        };\n\n        const component = window.__component__();\n        return component().render(getBody()).catch(expect(\"onError\"));\n      });\n    });\n\n    it(\"xprops.getParentDomain should pass the correct domain\", () => {\n      return wrapPromise(({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-get-parent-domain\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        const component = window.__component__();\n        return component({\n          passParentDomain: expect(\"passParentDomain\", (parentDomain) => {\n            if (!parentDomain || parentDomain !== getDomain()) {\n              throw new Error(\n                `Expected parent domain to be ${getDomain()}, got ${parentDomain}`\n              );\n            }\n          }),\n          run: () => {\n            return `\n                            window.xprops.passParentDomain(window.xprops.getParentDomain());\n                        `;\n          },\n        }).render(getBody());\n      });\n    });\n\n    it(\"xprops.getParent should pass the correct domain\", () => {\n      return wrapPromise(({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-get-parent\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        const component = window.__component__();\n        return component({\n          isParentCorrect: expect(\"isParentCorrect\", (result) => {\n            if (!result) {\n              throw new Error(`Expected parent window to be correct`);\n            }\n          }),\n          run: () => {\n            return `\n                            window.xprops.isParentCorrect(window.xprops.getParent() === window.parent);\n                        `;\n          },\n        }).render(getBody());\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/drivers.js",
    "content": "/* @flow */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { zoid } from \"../zoid\";\nimport { getBody, loadScript } from \"../common\";\n\ndescribe(\"zoid drivers\", () => {\n  before(() => {\n    window.__angular_component__ = () => {\n      return zoid.create({\n        tag: \"test-render-angular\",\n        url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        domain: \"mock://www.child.com\",\n      });\n    };\n\n    window.angular.module(\"app\", [\n      window.__angular_component__().driver(\"angular\", window.angular).name,\n    ]);\n    window.angular.bootstrap(getBody(), [\"app\"]);\n  });\n\n  it(\"should enter a component rendered with react and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-react-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const ReactZoidComponent = window\n        .__component__()\n        .driver(\"react\", { React: window.React, ReactDOM: window.ReactDOM });\n\n      const Main = class extends window.React.Component {\n        render(): Object {\n          return window.React.createElement(\n            \"div\",\n            null,\n            window.React.createElement(ReactZoidComponent, {\n              foo: expect(\"foo\", (bar) => {\n                if (bar !== \"bar\") {\n                  throw new Error(`Expected bar to be 'bar', got ${bar}`);\n                }\n              }),\n\n              run: () => `\n                                window.xprops.foo('bar');\n                            `,\n            })\n          );\n        }\n      };\n\n      const container = document.createElement(\"div\");\n\n      if (!getBody()) {\n        throw new Error(`Expected getBody() to be present`);\n      }\n\n      getBody().appendChild(container);\n      window.ReactDOM.render(window.React.createElement(Main, null), container);\n    });\n  });\n\n  it(\"should enter a component rendered with react and update a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-react-update-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const ReactZoidComponent = window\n        .__component__()\n        .driver(\"react\", { React: window.React, ReactDOM: window.ReactDOM });\n\n      const Main = class extends window.React.Component {\n        constructor() {\n          super();\n          this.state = {\n            onLoad: expect(\"onLoad\", () => {\n              this.setState({\n                foo: expect(\"foo\", (bar) => {\n                  if (bar !== \"bar\") {\n                    throw new Error(`Expected bar to be 'bar', got ${bar}`);\n                  }\n                }),\n              });\n            }),\n          };\n        }\n\n        render(): Object {\n          return window.React.createElement(\n            \"div\",\n            null,\n            window.React.createElement(ReactZoidComponent, {\n              foo: this.state.foo,\n              onLoad: this.state.onLoad,\n\n              run: () => `\n                                window.xprops.onLoad().then(() => {\n                                    window.xprops.foo('bar');\n                                });\n                            `,\n            })\n          );\n        }\n      };\n\n      const container = document.createElement(\"div\");\n\n      if (!getBody()) {\n        throw new Error(`Expected getBody() to be present`);\n      }\n\n      getBody().appendChild(container);\n      window.ReactDOM.render(window.React.createElement(Main, null), container);\n    });\n  });\n\n  it(\"should enter a component rendered with angular and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = window.__angular_component__;\n\n      const injector = window.angular.element(getBody()).injector();\n      const $compile = injector.get(\"$compile\");\n      const $rootScope = injector.get(\"$rootScope\");\n      const $scope = $rootScope.$new();\n\n      $scope.testProps = {\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== \"bar\") {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo('bar');\n                `,\n      };\n\n      $compile(`\n                <test-render-angular props=\"testProps\"></test-render-angular>\n            `)(\n        $scope,\n        expect(\n          \"compile\",\n          expect(\"angularCompile\", (element) => {\n            if (!getBody()) {\n              throw new Error(`Expected getBody() to be present`);\n            }\n            getBody().appendChild(element[0]);\n          })\n        )\n      );\n    });\n  });\n\n  it(\"should enter a component rendered with angular and update a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = window.__angular_component__;\n\n      const injector = window.angular.element(getBody()).injector();\n      const $compile = injector.get(\"$compile\");\n      const $rootScope = injector.get(\"$rootScope\");\n      const $scope = $rootScope.$new();\n\n      $scope.testProps = {\n        onLoad: expect(\"onLoad\", () => {\n          $scope.testProps.foo = expect(\"foo\", (bar) => {\n            if (bar !== \"bar\") {\n              throw new Error(`Expected bar to be 'bar', got ${bar}`);\n            }\n          });\n        }),\n\n        run: () => `\n                    window.xprops.onLoad().then(() => {\n                        window.xprops.foo('bar');\n                    });\n                `,\n      };\n\n      $compile(`\n                <test-render-angular props=\"testProps\"></test-render-angular>\n            `)(\n        $scope,\n        expect(\n          \"compile\",\n          expect(\"angularCompile\", (element) => {\n            if (!getBody()) {\n              throw new Error(`Expected getBody() to be present`);\n            }\n            getBody().appendChild(element[0]);\n          })\n        )\n      );\n    });\n  });\n\n  it(\"should enter a component rendered with vue and call a prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/vue_v2.5.16.runtime.min.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-vue\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      if (!getBody()) {\n        throw new Error(\"Can not find getBody()\");\n      }\n\n      const app = document.createElement(\"div\");\n      const vueComponent = window.__component__().driver(\"vue\", window.Vue);\n\n      if (!getBody()) {\n        throw new Error(`Expected getBody() to be present`);\n      }\n\n      getBody().appendChild(app);\n\n      new window.Vue({\n        render: expect(\"render\", (createElement) => {\n          return createElement(vueComponent, {\n            attrs: {\n              foo: expect(\"foo\", (bar) => {\n                if (bar !== \"bar\") {\n                  throw new Error(`Expected bar to be 'bar', got ${bar}`);\n                }\n              }),\n              run: () => `window.xprops.foo('bar');`,\n            },\n          });\n        }),\n      }).$mount(app);\n    });\n  });\n\n  it(\"should enter a component rendered with vue and update/call props with camel-case and kebab-case\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/vue_v2.5.16.runtime.min.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-vue-update-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      if (!getBody()) {\n        throw new Error(\"Can not find getBody()\");\n      }\n\n      const app = document.createElement(\"div\");\n      const vueComponent = window.__component__().driver(\"vue\", window.Vue);\n\n      if (!getBody()) {\n        throw new Error(`Expected getBody() to be present`);\n      }\n\n      getBody().appendChild(app);\n\n      new window.Vue({\n        render: expect(\"render\", function render(createElement): Object {\n          return createElement(vueComponent, {\n            attrs: {\n              foo: this.state.foo,\n              onLoad: this.state.onLoad,\n              baz: this.state.baz,\n              \"on-test\": this.state.onTest,\n              run: this.state.run,\n            },\n          });\n        }),\n        data(): Object {\n          return {\n            state: {\n              onLoad: expect(\"onLoad\", () => {\n                window.Vue.set(\n                  // $FlowFixMe[object-this-reference]\n                  this.state,\n                  \"foo\",\n                  expect(\"foo\", (bar) => {\n                    if (bar !== \"bar\") {\n                      throw new Error(`Expected foo to be 'bar', got ${bar}`);\n                    }\n                  })\n                );\n              }),\n              onTest: expect(\"onTest\", () => {\n                window.Vue.set(\n                  // $FlowFixMe[object-this-reference]\n                  this.state,\n                  \"baz\",\n                  expect(\"baz\", (bar) => {\n                    if (bar !== \"bar\") {\n                      throw new Error(`Expected baz to be 'bar', got ${bar}`);\n                    }\n                  })\n                );\n              }),\n              run: expect(\"run\", () => {\n                return `\n                                    return window.xprops.onLoad().then(() => {\n                                        return window.xprops.onTest().then(() => {\n                                            window.xprops.onProps(() => {\n                                                window.xprops.foo('bar');\n                                            });\n                                            window.xprops.onProps(() => {\n                                                window.xprops.baz('bar');\n                                            });\n                                        });\n                                    });\n                                `;\n              }),\n            },\n          };\n        },\n      }).$mount(app);\n    });\n  });\n\n  it(\"should enter a component rendered with vue and accept prop styleObject and convert it to a style prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/vue_v2.5.16.runtime.min.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-vue-style-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      if (!getBody()) {\n        throw new Error(\"Can not find getBody()\");\n      }\n\n      const app = document.createElement(\"div\");\n      const vueComponent = window.__component__().driver(\"vue\", window.Vue);\n\n      if (!getBody()) {\n        throw new Error(`Expected getBody() to be present`);\n      }\n\n      getBody().appendChild(app);\n\n      new window.Vue({\n        render: expect(\"render\", function render(createElement): Object {\n          return createElement(vueComponent, {\n            attrs: {\n              styleObject: () => ({ color: \"red\" }),\n              onLoad: this.state.onLoad,\n              color: this.state.color,\n              run: this.state.run,\n            },\n          });\n        }),\n        data(): Object {\n          return {\n            state: {\n              onLoad: expect(\"onLoad\", () => {\n                window.Vue.set(\n                  // $FlowFixMe[object-this-reference]\n                  this.state,\n                  \"color\",\n                  expect(\"color\", (color) => {\n                    if (color !== \"red\") {\n                      throw new Error(\n                        `Expected color to be 'red', got ${color}`\n                      );\n                    }\n                  })\n                );\n              }),\n              run: expect(\"run\", () => {\n                return `\n                                    return window.xprops.onLoad().then(() => {\n                                        return window.xprops.style().then((style) => {\n                                            window.xprops.color(style.color);\n                                        });\n                                    });\n                                `;\n              }),\n            },\n          };\n        },\n      }).$mount(app);\n    });\n  });\n\n  it(\"should enter a component rendered with vue3 and call a prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/vue_v3.2.1.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-vue3\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const zoidComponent = window.__component__().driver(\"vue3\");\n\n      const container = document.createElement(\"div\");\n      container.setAttribute(\"id\", \"container\");\n\n      getBody().appendChild(container);\n\n      const vueAppp = window.Vue.createApp({\n        render: expect(\"render\", () => {\n          const createElement = window.Vue.h;\n          return createElement(zoidComponent, {\n            foo: expect(\"foo\", (bar) => {\n              if (bar !== \"bar\") {\n                throw new Error(`Expected bar to be 'bar', got ${bar}`);\n              }\n            }),\n            run: () => `window.xprops.foo('bar');`,\n          });\n        }),\n      });\n\n      vueAppp.mount(\"#container\");\n    });\n  });\n\n  it(\"should enter a component rendered with vue3 and update/call props with camel-case and kebab-case\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/vue_v3.2.1.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-vue3-update-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const zoidComponent = window.__component__().driver(\"vue3\");\n\n      const container = document.createElement(\"div\");\n      container.setAttribute(\"id\", \"container\");\n\n      getBody().appendChild(container);\n\n      const vueAppp = window.Vue.createApp({\n        render: expect(\"render\", () => {\n          const createElement = window.Vue.h;\n          return createElement(zoidComponent, {\n            \"bar-value\": \"bar\",\n            \"test-bar\": expect(\"foo\", (bar) => {\n              if (bar !== \"bar\") {\n                throw new Error(`Expected bar to be 'bar', got ${bar}`);\n              }\n            }),\n            run: () => \"window.xprops.testBar(window.xprops.barValue);\",\n          });\n        }),\n      });\n      vueAppp.mount(\"#container\");\n    });\n  });\n\n  it(\"should enter a component rendered with vue3 and accept prop styleObject and convert it to a style prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/vue_v3.2.1.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-vue3-style-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const zoidComponent = window.__component__().driver(\"vue3\");\n\n      const container = document.createElement(\"div\");\n      container.setAttribute(\"id\", \"container\");\n\n      getBody().appendChild(container);\n\n      const vueAppp = window.Vue.createApp({\n        render: expect(\"render\", () => {\n          const createElement = window.Vue.h;\n          return createElement(zoidComponent, {\n            styleObject: { color: \"red\" },\n            \"test-bar\": expect(\"foo\", (style) => {\n              if (style.color !== \"red\") {\n                throw new Error(\n                  `Expected color to be 'red', got ${style.color}`\n                );\n              }\n            }),\n            run: () => \"window.xprops.testBar(window.xprops.style);\",\n          });\n        }),\n      });\n      vueAppp.mount(\"#container\");\n    });\n  });\n\n  it(\"should enter a component rendered with angular 2 and call a prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/angular-4.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-angular2\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n\n      const props = {\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== \"bar\") {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo('bar');\n                `,\n      };\n\n      const Angular2Component = component.driver(\"angular2\", window.ng.core);\n\n      const appComponent = window.ng.core\n        .Component({\n          selector: \"body\",\n          template: `\n                    <test-render-angular2 [props]=\"testProps\"></test-render-angular2>\n                `,\n        })\n        .Class({\n          constructor() {\n            // $FlowFixMe[object-this-reference]\n            this.testProps = props;\n          },\n        });\n\n      const appModule = window.ng.core\n        .NgModule({\n          imports: [window.ng.platformBrowser.BrowserModule, Angular2Component],\n          declarations: [appComponent],\n          bootstrap: [appComponent],\n        })\n        .Class({\n          constructor() {\n            // pass\n          },\n        });\n\n      window.ng.platformBrowserDynamic\n        .platformBrowserDynamic()\n        .bootstrapModule(appModule);\n    });\n  });\n\n  it(\"should enter a component rendered with angular 2 and update a prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      await loadScript(\"base/test/lib/angular-4.js\");\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-angular2-update-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n\n      const Angular2Component = component.driver(\"angular2\", window.ng.core);\n\n      const appComponent = window.ng.core\n        .Component({\n          selector: \"body\",\n          template: `\n                    <test-render-angular2-update-prop [props]=\"testProps\"></test-render-angular2-update-prop>\n                `,\n        })\n        .Class({\n          constructor: expect(\"constructor\", function constructor() {\n            this.testProps = {\n              onLoad: expect(\"onLoad\", () => {\n                this.testProps.foo = expect(\"foo\", (bar) => {\n                  if (bar !== \"bar\") {\n                    throw new Error(`Expected bar to be 'bar', got ${bar}`);\n                  }\n                });\n              }),\n\n              run: () => `\n                            window.xprops.onLoad().then(() => {\n                                window.xprops.foo('bar');\n                            });\n                        `,\n            };\n          }),\n        });\n\n      const appModule = window.ng.core\n        .NgModule({\n          imports: [window.ng.platformBrowser.BrowserModule, Angular2Component],\n          declarations: [appComponent],\n          bootstrap: [appComponent],\n        })\n        .Class({\n          constructor() {\n            // pass\n          },\n        });\n\n      window.ng.platformBrowserDynamic\n        .platformBrowserDynamic()\n        .bootstrapModule(appModule);\n    });\n  });\n\n  it(\"should enter a component rendered with angular2 driver (with Angular 12 lib) and call a prop\", () => {\n    return wrapPromise(async ({ expect }) => {\n      // Dynamically load Angular 12 libs\n      await loadScript(\"base/test/lib/angular-12/zone_v0.8.12.js\");\n      await loadScript(\"base/test/lib/angular-12/rxjs_v6.2.0.js\");\n      await loadScript(\"base/test/lib/angular-12/angular-12-core.js\");\n      await loadScript(\"base/test/lib/angular-12/angular-12-common.js\");\n      await loadScript(\"base/test/lib/angular-12/angular-12-compiler.js\");\n      await loadScript(\n        \"base/test/lib/angular-12/angular-12-platform-browser.js\"\n      );\n      await loadScript(\n        \"base/test/lib/angular-12/angular-12-platform-browser-dynamic.js\"\n      );\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-angular2-with-angular12-lib\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n\n      const props = {\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== \"bar\") {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo('bar');\n                `,\n      };\n\n      const Angular2Component = component.driver(\"angular2\", window.ng.core);\n\n      class AppComponent {\n        testProps: Object;\n        static annotations: $ReadOnlyArray<*>;\n\n        constructor() {\n          // $FlowFixMe[object-this-reference]\n          this.testProps = props;\n        }\n      }\n\n      AppComponent.annotations = [\n        new window.ng.core.Component({\n          selector: \"body\",\n          template: `\n                        <test-render-angular2-with-angular12-lib [props]=\"testProps\"></test-render-angular2-with-angular12-lib>\n                    `,\n        }),\n      ];\n\n      class AppModule {\n        static annotations: $ReadOnlyArray<*>;\n      }\n\n      AppModule.annotations = [\n        new window.ng.core.NgModule({\n          imports: [window.ng.platformBrowser.BrowserModule, Angular2Component],\n          declarations: [AppComponent],\n          bootstrap: [AppComponent],\n        }),\n      ];\n\n      window.ng.platformBrowserDynamic\n        .platformBrowserDynamic()\n        .bootstrapModule(AppModule);\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/eligible.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { zoid } from \"../zoid\";\nimport { getBody } from \"../common\";\n\ndescribe(\"zoid eligible cases\", () => {\n  it(\"should initialize a component, with no eligibility and check it is eligible\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-eligible-undefined\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      if (!instance.isEligible()) {\n        throw new Error(`Expected component to be eligible`);\n      }\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should initialize a component, with true eligibility and check it is eligible\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-eligible-true\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: () => ({ eligible: true }),\n        });\n      };\n\n      const component = window.__component__();\n\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      if (!instance.isEligible()) {\n        throw new Error(`Expected component to be eligible`);\n      }\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should initialize a component, with true eligibility based on a prop and check it is eligible\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-eligible-true-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: ({ props }) => ({ eligible: props.foo === \"bar\" }),\n        });\n      };\n\n      const component = window.__component__();\n\n      const instance = component({\n        foo: \"bar\",\n        onRendered: expect(\"onRendered\"),\n      });\n\n      if (!instance.isEligible()) {\n        throw new Error(`Expected component to be eligible`);\n      }\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should initialize a component, with false eligibility and check it is eligible\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-eligible-false\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: () => ({ eligible: false }),\n        });\n      };\n\n      const component = window.__component__();\n\n      const instance = component({\n        onRendered: avoid(\"onRendered\"),\n      });\n\n      if (instance.isEligible()) {\n        throw new Error(`Expected component to be eligible`);\n      }\n\n      return instance.render(getBody()).catch(expect(\"renderError\"));\n    });\n  });\n\n  it(\"should initialize a component, with true eligibility based on a prop and check it is eligible\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-eligible-false-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: ({ props }) => ({ eligible: props.foo === \"bar\" }),\n        });\n      };\n\n      const component = window.__component__();\n\n      const instance = component({\n        foo: \"baz\",\n        onRendered: avoid(\"onRendered\"),\n      });\n\n      if (instance.isEligible()) {\n        throw new Error(`Expected component to be eligible`);\n      }\n\n      return instance.render(getBody()).catch(expect(\"renderError\"));\n    });\n  });\n\n  it(\"should initialize a component, with false eligibility and do not validate props\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-eligible-false-validate\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: () => ({ eligible: false }),\n          props: {\n            foo: {\n              type: \"string\",\n              validate: () => {\n                throw new Error(`Value is not valid`);\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      const instance = component({\n        foo: \"blerp\",\n        onRendered: avoid(\"onRendered\"),\n      });\n\n      if (instance.isEligible()) {\n        throw new Error(`Expected component to be eligible`);\n      }\n\n      return instance.render(getBody()).catch(expect(\"renderError\"));\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/error.js",
    "content": "/* @flow */\n/* eslint max-lines: off */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { wrapPromise, noop, destroyElement } from \"@krakenjs/belter/src\";\n\nimport { onWindowOpen, runOnClick, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid error cases\", () => {\n  it(\"should error out when window.open returns a closed window\", () => {\n    return wrapPromise(({ expect, error }) => {\n      const windowOpen = window.open;\n      window.open = () => {\n        return {\n          closed: true,\n          close: error(\"close\"),\n        };\n      };\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-popup-closed\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render(\"body\", zoid.CONTEXT.POPUP)\n        .catch(\n          expect(\"catch\", (err) => {\n            if (!(err instanceof zoid.PopupOpenError)) {\n              throw err;\n            }\n\n            window.open = windowOpen;\n          })\n        );\n    });\n  });\n\n  it(\"should enter a component, throw an integration error, and return the error to the parent with the original stack\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-from-child\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: avoid(\"onDestroy\"),\n\n        onError: expect(\"onError\", (err) => {\n          // $FlowFixMe\n          const message = err.message ? err.message.toString() : \"\";\n\n          if (!err || message.indexOf(\"xxxxx\") === -1) {\n            throw new Error(\n              `Expected error to contain original error from child window`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.onError(new Error('xxxxx'));\n                `,\n      })\n        .render(getBody(), zoid.CONTEXT.IFRAME)\n        .catch(noop);\n    });\n  });\n\n  it(\"should enter a component and timeout, then call onError\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-from-child-onerror\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        timeout: 1,\n        onError: expect(\"onError\"),\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render(getBody(), zoid.CONTEXT.IFRAME)\n        .catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should run validate function on props, and pass up error when thrown\", () => {\n    return wrapPromise(({ expect, expectError }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-prop-validate\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            validateProp: {\n              type: \"string\",\n              validate: expectError(\"validate\", () => {\n                throw new Error(`Invalid prop`);\n              }),\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.try(() => {\n        component({\n          validateProp: \"foo\",\n        });\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should run validate function on props, and not call onError when error is thrown\", () => {\n    return wrapPromise(({ expect, avoid, expectError }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-prop-validate-onerror\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            validateProp: {\n              type: \"string\",\n              validate: expectError(\"validate\", () => {\n                throw new Error(`Invalid prop`);\n              }),\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.try(() => {\n        component({\n          validateProp: \"foo\",\n          onError: avoid(\"onError\"),\n        });\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should run validate function on component, and pass up error when thrown\", () => {\n    return wrapPromise(({ expect, expectError }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-validate\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          validate: expectError(\"validate\", () => {\n            throw new Error(`Invalid component`);\n          }),\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.try(() => {\n        component();\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should run validate function on component, and not call onError when error is thrown\", () => {\n    return wrapPromise(({ expect, avoid, expectError }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-validate-onerror\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          validate: expectError(\"validate\", () => {\n            throw new Error(`Invalid component`);\n          }),\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.try(() => {\n        component({\n          onError: avoid(\"onError\"),\n        });\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should call onError when a popup is opened without a click event\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-popup-no-onclick\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        const component = window.__component__();\n        const instance = component({\n          onClose: avoid(\"onClose\"),\n          onError: expect(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        });\n\n        return instance\n          .render(\"body\", zoid.CONTEXT.POPUP)\n          .catch(expect(\"catch\"));\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should call onclose when a popup is closed by someone other than zoid\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-popup-closed\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        let openedWindow;\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            openedWindow = win;\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        });\n\n        return runOnClick(() => {\n          return instance.render(\"body\", zoid.CONTEXT.POPUP);\n        }).then(() => {\n          if (!openedWindow) {\n            throw new Error(`Expected window to have been opened`);\n          }\n          openedWindow.close();\n        });\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should call onclose when a popup is closed by someone other than zoid during render\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-popup-closed-during-render\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n            setTimeout(() => openedWindow.close(), 1);\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        });\n\n        return runOnClick(() => {\n          return instance.render(\"body\", zoid.CONTEXT.POPUP);\n        }).catch(expect(\"catch\"));\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should call onclose when an iframe is closed by someone other than zoid\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-iframe-closed\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n            setTimeout(() => {\n              destroyElement(openedWindow.frameElement);\n            }, 200);\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        });\n\n        return runOnClick(() => {\n          return instance.render(\"body\");\n        }).catch(noop);\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should error out when iframe is closed by someone other than zoid during render\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-iframe-closed-during-render\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win: openedWindow }) => {\n            destroyElement(openedWindow.frameElement);\n          })\n        );\n\n        const component = window.__component__();\n        return component({\n          onError: expect(\"onError\"),\n        })\n          .render(\"body\", zoid.CONTEXT.IFRAME)\n          .catch(expect(\"catch\"));\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should error out when a prerender template is created with the incorrect document\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prerender-incorrect-document\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n\n          prerenderTemplate: () => {\n            const body = document.createElement(\"body\");\n            const html = document.createElement(\"html\");\n            html.appendChild(body);\n            return html;\n          },\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n        onPrerender: expect(\"onPrerender\"),\n        onPrerendered: avoid(\"onPrerendered\"),\n      })\n        .render(getBody())\n        .catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should call onclose when an iframe is closed immediately after changing location\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-iframe-redirected-during-render\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        let openedWindow;\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            openedWindow = win;\n          })\n        );\n\n        const component = window.__component__();\n        return component({\n          run: () => {\n            return `\n                        window.xprops.onLoad();\n                    `;\n          },\n          onLoad: expect(\"onLoad\", () => {\n            openedWindow.location.reload();\n            destroyElement(openedWindow.frameElement);\n          }),\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        }).render(\"body\", zoid.CONTEXT.IFRAME);\n      },\n      { timeout: 9000 }\n    );\n  });\n\n  it(\"should call onclose when an iframe is closed after changing location after a small delay\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-iframe-immediately-redirected-during-render\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        let openedWindow;\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            openedWindow = win;\n          })\n        );\n\n        const component = window.__component__();\n        return component({\n          run: () => {\n            return `\n                        window.xprops.onLoad();\n                    `;\n          },\n          onLoad: expect(\"onLoad\", () => {\n            openedWindow.location.reload();\n            setTimeout(() => {\n              destroyElement(openedWindow.frameElement);\n            }, 50);\n          }),\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        }).render(\"body\", zoid.CONTEXT.IFRAME);\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should call onclose when an popup is closed immediately after changing location\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-popup-redirected-during-render\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        let openedWindow;\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            openedWindow = win;\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          run: () => {\n            return `\n                        window.xprops.onLoad();\n                    `;\n          },\n          onLoad: expect(\"onLoad\", () => {\n            openedWindow.location.reload();\n            openedWindow.close();\n          }),\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        });\n\n        return runOnClick(() => {\n          return instance.render(\"body\", zoid.CONTEXT.POPUP);\n        });\n      },\n      { timeout: 9000 }\n    );\n  });\n\n  it(\"should call onclose when an popup is closed after changing location after a small delay\", () => {\n    return wrapPromise(\n      ({ expect, avoid }) => {\n        window.__component__ = () => {\n          return zoid.create({\n            tag: \"test-onclose-popup-immediately-redirected-during-render\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        };\n\n        let openedWindow;\n\n        onWindowOpen().then(\n          expect(\"onWindowOpen\", ({ win }) => {\n            openedWindow = win;\n          })\n        );\n\n        const component = window.__component__();\n        const instance = component({\n          run: () => {\n            return `\n                        window.xprops.onLoad();\n                    `;\n          },\n          onLoad: expect(\"onLoad\", () => {\n            openedWindow.location.reload();\n            setTimeout(() => {\n              openedWindow.close();\n            }, 50);\n          }),\n          onClose: expect(\"onClose\"),\n          onError: avoid(\"onError\"),\n          onDestroy: expect(\"onDestroy\"),\n        });\n\n        return runOnClick(() => {\n          return instance.render(\"body\", zoid.CONTEXT.POPUP);\n        });\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should error out when a component is created with a duplicate tag\", () => {\n    return wrapPromise(({ expect }) => {\n      zoid.create({\n        tag: \"test-error-duplicate-tag\",\n        url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        domain: \"mock://www.child.com\",\n      });\n\n      return ZalgoPromise.try(() => {\n        zoid.create({\n          tag: \"test-error-duplicate-tag\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should error out when an unknown driver is requested\", () => {\n    return wrapPromise(({ expect }) => {\n      const component = zoid.create({\n        tag: \"test-error-unknown-driver\",\n        url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        domain: \"mock://www.child.com\",\n      });\n\n      return ZalgoPromise.try(() => {\n        component.driver(\"meep\", {});\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should error out where an invalid element is passed\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-invalid-element\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render({})\n        .catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should error out where an invalid window is passed\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-invalid-window\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .renderTo({}, \"body\")\n        .catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should error out where no element is passed\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-no-element\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render()\n        .catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should error out where an invalid context is passed\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-invalid-context\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render(\"body\", \"meep\")\n        .catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should error out when trying to register a child when one is already active\", () => {\n    return wrapPromise(({ expect }) => {\n      const component = zoid.create({\n        tag: \"test-xprops-present\",\n        url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        domain: \"mock://www.child.com\",\n      });\n\n      window.__component__ = () => {\n        window.xprops = {};\n        let error;\n\n        try {\n          zoid.create({\n            tag: \"test-xprops-present\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          });\n        } catch (err) {\n          error = err;\n        }\n\n        delete window.xprops;\n        zoid.create({\n          tag: \"test-xprops-present\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n\n        window.xprops.onLoad(error);\n      };\n\n      return component({\n        onLoad: expect(\"onLoad\", (err) => {\n          if (!err) {\n            throw new Error(`Expected error to be thrown in child`);\n          }\n        }),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should not set xprops when window name does not contain zoid\", () => {\n    window.name = `__transformer__test_create_window_name_no_zoid__abc123__`;\n\n    zoid.create({\n      tag: \"test-create-window-name-no-zoid\",\n      url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n      domain: \"mock://www.child.com\",\n    });\n\n    if (window.xprops) {\n      throw new Error(`Expected xprops to not be set`);\n    }\n  });\n\n  it(\"should not set xprops when window name does contain component name\", () => {\n    window.name = `__zoid__`;\n\n    zoid.create({\n      tag: \"test-create-window-name-no-component-name-passed\",\n      url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n      domain: \"mock://www.child.com\",\n    });\n\n    if (window.xprops) {\n      throw new Error(`Expected xprops to not be set`);\n    }\n  });\n\n  it(\"should not set xprops when window name does not match component name\", () => {\n    window.name = `__zoid__some_other_component__abc123__`;\n\n    zoid.create({\n      tag: \"test-create-window-name-non-matching-component\",\n      url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n      domain: \"mock://www.child.com\",\n    });\n\n    if (window.xprops) {\n      throw new Error(`Expected xprops to not be set`);\n    }\n  });\n\n  it(\"should not set xprops when payload is not sent\", () => {\n    window.name = `__zoid__test_create_window_name_no_payload__`;\n\n    zoid.create({\n      tag: \"test-create-window-name-no-payload\",\n      url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n      domain: \"mock://www.child.com\",\n    });\n\n    if (window.xprops) {\n      throw new Error(`Expected xprops to not be set`);\n    }\n  });\n\n  it(\"should not set xprops when payload is not correctly formatted\", () => {\n    window.name = `__zoid__test_create_window_name_bad_payload__abc123__`;\n\n    let error;\n\n    try {\n      zoid.create({\n        tag: \"test-create-window-name-bad-payload\",\n        url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        domain: \"mock://www.child.com\",\n      });\n    } catch (err) {\n      error = err;\n    }\n\n    if (!error) {\n      throw new Error(`Expected error to be thrown`);\n    }\n  });\n\n  it(\"should not call onError when the window navigates away\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-unload\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onError: avoid(\"onError\"),\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render(getBody(), zoid.CONTEXT.IFRAME)\n        .then(() => {\n          window.dispatchEvent(new Event(\"pagehide\"));\n        });\n    });\n  });\n\n  it(\"should call onDestroy even if component is not eligible\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-error-ondestroy-ineligible\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          eligible: () => ({ eligible: false }),\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        onError: avoid(\"onError\"),\n        onDestroy: expect(\"onDestroy\"),\n      })\n        .render(getBody(), zoid.CONTEXT.IFRAME)\n        .catch(expect(\"error\"));\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/exports.js",
    "content": "/* @flow */\n/** @jsx node */\n\nimport type { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { zoid } from \"../zoid\";\nimport { getBody } from \"../common\";\n\ndescribe(\"zoid export cases\", () => {\n  it(\"should render a component with an exported function and call that function directly on the instance\", () => {\n    return wrapPromise(() => {\n      const expectedResult = \"hello world\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-export-function-instance\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: ({ getExports }) => {\n            return {\n              doSomething: (...args) => {\n                return getExports().then((exports) => {\n                  return exports.doSomething(...args);\n                });\n              },\n            };\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.export({\n                        doSomething: () => {\n                            return ${JSON.stringify(expectedResult)};\n                        }\n                    });\n                `,\n      });\n\n      const resultPromise = instance.doSomething();\n\n      return instance\n        .render(getBody())\n        .then(() => {\n          return resultPromise;\n        })\n        .then((result) => {\n          if (result !== expectedResult) {\n            throw new Error(\n              `Expected component.doSomething to return ${JSON.stringify(\n                expectedResult\n              )}, got ${JSON.stringify(result)}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component with an exported value and get that value directly on the instance\", () => {\n    return wrapPromise(() => {\n      const expectedResult = \"hello world\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-export-value-instance\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: ({ getExports }) => {\n            return {\n              get value(): ZalgoPromise<string> {\n                return getExports().then((exports) => {\n                  return exports.value;\n                });\n              },\n            };\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.export({\n                        value: ${JSON.stringify(expectedResult)}\n                    });\n                `,\n      });\n\n      const valuePromise = instance.value;\n\n      return instance\n        .render(getBody())\n        .then(() => {\n          return valuePromise;\n        })\n        .then((result) => {\n          if (result !== expectedResult) {\n            throw new Error(\n              `Expected component.value to be a promise for ${JSON.stringify(\n                expectedResult\n              )}, got ${JSON.stringify(result)}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component with defined exports and an exported function and call that function directly on the instance\", () => {\n    return wrapPromise(() => {\n      const expectedResult = \"hello world\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-export-function-instance-defined\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            doSomething: {\n              type: \"function\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.export({\n                        doSomething: () => {\n                            return ${JSON.stringify(expectedResult)};\n                        }\n                    });\n                `,\n      });\n\n      const resultPromise = instance.doSomething();\n\n      return instance\n        .render(getBody())\n        .then(() => {\n          return resultPromise;\n        })\n        .then((result) => {\n          if (result !== expectedResult) {\n            throw new Error(\n              `Expected component.doSomething to return ${JSON.stringify(\n                expectedResult\n              )}, got ${JSON.stringify(result)}`\n            );\n          }\n        });\n    });\n  });\n\n  it(\"should render a component with defined exports and an exported value and get that value directly on the instance\", () => {\n    return wrapPromise(() => {\n      const expectedResult = \"hello world\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-export-value-instance-defined\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: {\n            value: {\n              type: \"string\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.export({\n                        value: ${JSON.stringify(expectedResult)}\n                    });\n                `,\n      });\n\n      const valuePromise = instance.value;\n\n      return instance\n        .render(getBody())\n        .then(() => {\n          return valuePromise;\n        })\n        .then((result) => {\n          if (result !== expectedResult) {\n            throw new Error(\n              `Expected component.value to be a promise for ${JSON.stringify(\n                expectedResult\n              )}, got ${JSON.stringify(result)}`\n            );\n          }\n        });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/extensions.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { getParent } from \"@krakenjs/cross-domain-utils/src\";\n\nimport { onWindowOpen, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid getExtensions cases\", () => {\n  it(\"should render a component with additional properties to the component\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-with-extended-properties\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          getExtensions: () => {\n            return {\n              testAttribute: \"123\",\n              testMethod: () => \"result_of_test_method\",\n            };\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      if (instance.testAttribute !== \"123\") {\n        throw new Error(\n          `Expected test attribute to be \"123\", but got ${instance.testAttribute}`\n        );\n      }\n      if (instance.testMethod() !== \"result_of_test_method\") {\n        throw new Error(\n          `Expected test attribute to be \"result_of_test_method\", but got ${instance.testMethod()}`\n        );\n      }\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should not be able to ovverride default properties of component using getExtensions\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-extended-properties-cannot-override-defaults\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          getExtensions: () => {\n            return {\n              render: () => {\n                throw new Error(\"The render method should have been ovveriden\");\n              },\n            };\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should be able to interact with method supplied to the component during instantiation\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-with-extended-method-invokes-callbacks\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          getExtensions: (parent) => {\n            return {\n              invokeCalculatePrice: () => {\n                return parent.getProps().calculatePrice();\n              },\n            };\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n        calculatePrice: () => 1034.56,\n      });\n\n      if (instance.invokeCalculatePrice() !== 1034.56) {\n        throw new Error(\n          `Expected test attribute to be \"1034.56\", but got ${instance.invokeCalculatePrice()}`\n        );\n      }\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should be able to interact with updated methods supplied to the component during instantiation\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-with-updated-extended-method-invokes-callbacks\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          getExtensions: (parent) => {\n            return {\n              invokeCalculatePrice: () => {\n                return parent.getProps().calculatePrice();\n              },\n            };\n          },\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n        calculatePrice: () => 1034.56,\n      });\n\n      instance.updateProps({\n        calculatePrice: () => 50.56,\n      });\n\n      if (instance.invokeCalculatePrice() !== 50.56) {\n        throw new Error(\n          `Expected test attribute to be \"50.56\", but got ${instance.invokeCalculatePrice()}`\n        );\n      }\n\n      return instance.render(getBody());\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/happy.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { getParent, getOpener } from \"@krakenjs/cross-domain-utils/src\";\nimport { node, dom } from \"@krakenjs/jsx-pragmatic/src\";\n\nimport { onWindowOpen, runOnClick, getContainer, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid happy cases\", () => {\n  it(\"should render a component where the url is a function\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-url-function\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component with default context\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-default\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a component with iframe context\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      }).render(getBody(), zoid.CONTEXT.IFRAME);\n    });\n  });\n\n  it(\"should render a component with popup context\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getOpener(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render a component with popup context and no element\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-no-element\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          defaultContext: \"popup\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getOpener(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      return runOnClick(() => {\n        return instance.render();\n      });\n    });\n  });\n\n  it(\"should render a component to a string element selector\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-string-selector\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      }).render(\"body\");\n    });\n  });\n\n  it(\"should enter a component rendered as an iframe and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedValue = \"bar\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-with-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== expectedValue) {\n            throw new Error(\n              `Expected bar to be ${JSON.stringify(\n                expectedValue\n              )}, got ${JSON.stringify(bar)}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(expectedValue)});\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component rendered as a popup and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedValue = \"bar\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-with-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== expectedValue) {\n            throw new Error(\n              `Expected bar to be ${JSON.stringify(\n                expectedValue\n              )}, got ${JSON.stringify(bar)}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(expectedValue)});\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render a component where the domain is a regex\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-domain-regex\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: /^mock:\\/\\/www\\.child\\.com$/,\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should correctly identify the component as being the child\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-ischild\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        isChildResult: expect(\"isChildResult\", (result) => {\n          if (result !== true) {\n            throw new Error(`Expected result to be true`);\n          }\n        }),\n        run: () => {\n          return `\n                        window.xprops.isChildResult(window.__component__().isChild());\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should correctly identify the component as not being the child\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-ischild-negative\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        isChildResult: expect(\"isChildResult\", (result) => {\n          if (result !== false) {\n            throw new Error(`Expected result to be false`);\n          }\n        }),\n        run: () => {\n          return `\n                        const component = zoid.create({\n                            tag:    'test-render-ischild-negative-second',\n                            url:    () => 'mock://www.child.com/base/test/windows/child/index.htm',\n                            domain: 'mock://www.child.com'\n                        });\n\n                        window.xprops.isChildResult(component.isChild());\n                    `;\n        },\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component rendered as an iframe inside another iframe and call a prop\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      const expectedValue = \"bar\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-in-iframe-with-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          containerTemplate: ({ doc, frame, prerenderFrame }) => {\n            return (\n              <div>\n                <iframe>\n                  <html>\n                    <body>\n                      <node el={frame} />\n                      <node el={prerenderFrame} />\n                    </body>\n                  </html>\n                </iframe>\n              </div>\n            ).render(dom({ doc }));\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      return component({\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== expectedValue) {\n            throw new Error(\n              `Expected bar to be ${JSON.stringify(\n                expectedValue\n              )}, got ${JSON.stringify(bar)}`\n            );\n          }\n        }),\n\n        onClose: avoid(\"onClose\"),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(expectedValue)});\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should prerender to an iframe\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-prerender-iframe\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          prerenderTemplate: ({ doc }) => {\n            const html = doc.createElement(\"html\");\n            const body = doc.createElement(\"body\");\n            const script = doc.createElement(\"script\");\n            script.text = `\n                            window.parent.prerenderScriptLoaded();\n                        `;\n            html.appendChild(body);\n            body.appendChild(script);\n            return html;\n          },\n        });\n      };\n\n      window.prerenderScriptLoaded = expect(\"prerenderScriptLoaded\");\n\n      const component = window.__component__();\n      return component({\n        onPrerender: expect(\"onPrerender\"),\n        onPrerendered: expect(\"onPrerendered\"),\n      }).render(getBody());\n    });\n  });\n\n  it(\"should prerender to a popup\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-prerender-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          prerenderTemplate: ({ doc }) => {\n            const html = doc.createElement(\"html\");\n            const body = doc.createElement(\"body\");\n            const script = doc.createElement(\"script\");\n            script.text = `\n                            window.opener.prerenderScriptLoaded();\n                        `;\n            html.appendChild(body);\n            body.appendChild(script);\n            return html;\n          },\n        });\n      };\n\n      window.prerenderScriptLoaded = expect(\"prerenderScriptLoaded\");\n\n      const component = window.__component__();\n      const instance = component({\n        onPrerender: expect(\"onPrerender\"),\n        onPrerendered: expect(\"onPrerendered\"),\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render a component into the shadow dom\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-shadow-dom\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { container, destroy } = getContainer({ shadow: true });\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\", () => {\n          destroy();\n        }),\n      }).render(container);\n    });\n  });\n\n  it(\"should render a component into a nested shadow dom\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-nested-shadow-dom\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { container, destroy } = getContainer({\n        shadow: true,\n        nested: true,\n      });\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\", () => {\n          destroy();\n        }),\n      }).render(container);\n    });\n  });\n\n  it(\"should render a component into the shadow dom with slots\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-shadow-dom-slots\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const { container, destroy } = getContainer({\n        shadow: true,\n        slots: true,\n      });\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\", () => {\n          destroy();\n        }),\n      }).render(container);\n    });\n  });\n\n  it(\"should render a component with iframe context\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-window-name\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win, iframe }) => {\n          if (!iframe) {\n            throw new Error(`Expected iframe to be opened`);\n          }\n\n          const { element } = iframe;\n          const name = element.getAttribute(\"name\");\n\n          if (\n            !name ||\n            name === \"about:blank\" ||\n            name.indexOf(\"__zoid__\") !== 0\n          ) {\n            throw new Error(\n              `Expected window name to be set when calling window.open`\n            );\n          }\n\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n      }).render(getBody(), zoid.CONTEXT.IFRAME);\n    });\n  });\n\n  it(\"should render a component with popup context\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-window-name\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win, popup }) => {\n          if (!popup) {\n            throw new Error(`Expected popup to be rendered`);\n          }\n\n          const { args } = popup;\n          const [, name] = args;\n\n          if (\n            !name ||\n            name === \"about:blank\" ||\n            name.indexOf(\"__zoid__\") !== 0\n          ) {\n            throw new Error(\n              `Expected window name to be set when calling window.open`\n            );\n          }\n\n          if (getOpener(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should enter a component rendered as an iframe and call a promise prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedValue = \"bar\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-with-promise-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        foo: ZalgoPromise.resolve(\n          expect(\"foo\", (bar) => {\n            if (bar !== expectedValue) {\n              throw new Error(\n                `Expected bar to be ${JSON.stringify(\n                  expectedValue\n                )}, got ${JSON.stringify(bar)}`\n              );\n            }\n          })\n        ),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(expectedValue)});\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component rendered as a popup and call a promise prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedValue = \"bar\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-with-promise-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: ZalgoPromise.resolve(\n          expect(\"foo\", (bar) => {\n            if (bar !== expectedValue) {\n              throw new Error(\n                `Expected bar to be ${JSON.stringify(\n                  expectedValue\n                )}, got ${JSON.stringify(bar)}`\n              );\n            }\n          })\n        ),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(expectedValue)});\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render an iframe component on the same domain and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-samedomain\",\n          url: \"mock://www.parent.com/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&firstLoad\",\n          domain: \"mock://www.parent.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        callProp: expect(\"callProp\", (mockDomain) => {\n          if (mockDomain !== \"mock://www.parent.com\") {\n            throw new Error(\n              `Expected domain to be 'mock://www.parent.com', got '${mockDomain}'`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.callProp(window.mockDomain);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a popup component on the same domain and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-samedomain\",\n          url: \"mock://www.parent.com/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&firstLoad\",\n          domain: \"mock://www.parent.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        callProp: expect(\"callProp\", (mockDomain) => {\n          if (mockDomain !== \"mock://www.parent.com\") {\n            throw new Error(\n              `Expected domain to be 'mock://www.parent.com', got '${mockDomain}'`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.callProp(window.mockDomain);\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render an iframe component, change url, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-url-change\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm?firstLoad\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a popup component, change url, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-url-change\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm?firstLoad\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render an iframe component on the same domain, change url, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-samedomain-url-change\",\n          url: \"mock://www.parent.com/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&firstLoad\",\n          domain: \"mock://www.parent.com\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a popup component on the same domain, change url, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-samedomain-url-change\",\n          url: \"mock://www.parent.com/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&firstLoad\",\n          domain: \"mock://www.parent.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render an iframe component, change url to a different domain, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-url-change-diffdomain\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm?firstLoad\",\n          domain: [\"mock://www.child.com\", \"mock://www.child-redirect.com\"],\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.child-redirect.com&secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a popup component, change url to a different domain, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-url-change-diffdomain\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm?firstLoad\",\n          domain: [\"mock://www.child.com\", \"mock://www.child-redirect.com\"],\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.child-redirect.com&secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n\n  it(\"should render an iframe component on the same domain, change url to a different domain, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-iframe-samedomain-url-change-diffdomain\",\n          url: \"mock://www.parent.com/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&firstLoad\",\n          domain: [\"mock://www.parent.com\", \"mock://www.child-redirect.com\"],\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.child-redirect.com&secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should render a popup component on the same domain, change url to a different domain, and complete\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-popup-samedomain-url-change-diffdomain\",\n          url: \"mock://www.parent.com/base/test/windows/child/index.htm?mockDomain=mock://www.parent.com&firstLoad\",\n          domain: [\"mock://www.parent.com\", \"mock://www.child-redirect.com\"],\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        firstLoad: expect(\"firstLoad\"),\n        secondLoad: expect(\"secondLoad\"),\n\n        run: () => `\n                    if (location.href.indexOf('firstLoad') !== -1) {\n                        window.xprops.firstLoad().then(() => {\n                            window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.child-redirect.com&secondLoad';\n                        });\n                    }\n\n                    if (location.href.indexOf('secondLoad') !== -1) {\n                        window.xprops.secondLoad();\n                    }\n                `,\n      });\n\n      return runOnClick(() => {\n        return instance.render(getBody(), zoid.CONTEXT.POPUP);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/index.js",
    "content": "/* @flow */\n\nimport \"./happy\";\nimport \"./props\";\nimport \"./actions\";\nimport \"./exports\";\nimport \"./drivers\";\nimport \"./error\";\nimport \"./renderto\";\nimport \"./validation\";\nimport \"./domain\";\nimport \"./window\";\nimport \"./dimensions\";\nimport \"./attributes\";\nimport \"./child\";\nimport \"./bridge\";\nimport \"./clone\";\nimport \"./eligible\";\nimport \"./remove\";\nimport \"./rerender\";\nimport \"./method\";\nimport \"./children\";\nimport \"./extensions\";\n"
  },
  {
    "path": "test/tests/method.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid url method cases\", () => {\n  it(\"should send props via get and post to an iframe component\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-post-props\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n\n          props: {\n            foo: {\n              type: \"string\",\n              queryParam: true,\n            },\n            bar: {\n              type: \"string\",\n              bodyParam: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        foo: \"123\",\n        bar: \"456\",\n        onRendered: expect(\"onRendered\"),\n        run: () => `\n                    window.xprops.checkUrl(window.location.href);\n                `,\n        checkUrl: expect(\"checkUrl\", (url) => {\n          if (url.indexOf(\"foo=123\") === -1) {\n            throw new Error(`Expected to find foo=123 in the url`);\n          }\n\n          if (url.indexOf(\"bar=456\") !== -1) {\n            throw new Error(`Expected not to find bar=456 in the url`);\n          }\n        }),\n      }).render(getBody());\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/props.js",
    "content": "/* @flow */\n/* eslint max-lines: off */\n\nimport {\n  wrapPromise,\n  noop,\n  parseQuery,\n  destroyElement,\n  getElement,\n} from \"@krakenjs/belter/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\n\nimport { onWindowOpen, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid props cases\", () => {\n  it(\"should render a component with a prop with a pre-defined value\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              value: () => \"bar\",\n            },\n            passFoo: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passFoo({ foo: xprops.foo });\n                `,\n        passFoo: expect(\"passFoo\", ({ foo }) => {\n          if (foo !== \"bar\") {\n            throw new Error(\n              `Expected prop to have the correct value; got ${foo}`\n            );\n          }\n        }),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should render a component with a prop with a pre-defined value using container\", () => {\n    return wrapPromise(({ expect }) => {\n      const bodyWidth = getBody().offsetWidth;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-container\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"number\",\n              required: false,\n              value: ({ container }) => {\n                return container?.offsetWidth;\n              },\n            },\n            passFoo: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passFoo({ foo: xprops.foo });\n                `,\n        passFoo: expect(\"passFoo\", ({ foo }) => {\n          if (foo !== bodyWidth) {\n            throw new Error(\n              `Expected prop to have the correct value; got ${foo}`\n            );\n          }\n        }),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should render a component with a prop with a pre-defined value using container, and pass the value in the url\", () => {\n    return wrapPromise(({ expect }) => {\n      const bodyWidth = getBody().offsetWidth;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-container-url-param\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"number\",\n              required: false,\n              value: ({ container }) => {\n                return container ? getElement(container)?.offsetWidth : null;\n              },\n              queryParam: true,\n            },\n            passFoo: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passFoo({ query: location.search });\n                `,\n        passFoo: expect(\"passFoo\", ({ query }) => {\n          if (query.indexOf(`foo=${bodyWidth}`) === -1) {\n            throw new Error(`Expected foo=${bodyWidth} in the url`);\n          }\n        }),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should render a component with a prop with a pre-defined value using container, and pass the value in the url, with a lazy element\", () => {\n    return wrapPromise(({ expect }) => {\n      const bodyWidth = getBody().offsetWidth;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-container-url-param-element-not-ready\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"number\",\n              required: false,\n              value: ({ container }) => {\n                return container ? getElement(container)?.offsetWidth : null;\n              },\n              queryParam: true,\n            },\n            passFoo: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passFoo({ query: location.search });\n                `,\n        passFoo: expect(\"passFoo\", ({ query }) => {\n          if (query.indexOf(`foo=${bodyWidth}`) === -1) {\n            throw new Error(`Expected foo=${bodyWidth} in the url`);\n          }\n        }),\n      });\n\n      Object.defineProperty(document, \"readyState\", {\n        value: \"loading\",\n        configurable: true,\n      });\n\n      const renderPromise = instance.render(\"#container-element\");\n\n      const container = document.createElement(\"div\");\n      container.setAttribute(\"id\", \"container-element\");\n      getBody().appendChild(container);\n\n      Object.defineProperty(document, \"readyState\", {\n        value: \"ready\",\n        configurable: true,\n      });\n\n      return renderPromise;\n    });\n  });\n\n  it(\"should enter a component, update a prop, and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.onProps(function() {\n                        console.warn('bleh');\n                        window.xprops.foo('bar');\n                    });\n                `,\n        postRun: () => {\n          return instance.updateProps({\n            foo: expect(\"foo\", (bar) => {\n              if (bar !== \"bar\") {\n                throw new Error(`Expected bar to be 'bar', got ${bar}`);\n              }\n            }),\n          });\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should enter a component, update a prop, and call a different prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-different-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== \"bar\") {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.onProps(function() {\n                        window.xprops.foo('bar');\n                    });\n                `,\n\n        postRun: () => {\n          return instance.updateProps({\n            bar: \"helloworld\",\n          });\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should enter a component, decorate a prop, update a prop, and call a different prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-decorated-different-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"function\",\n              required: false,\n              decorate: ({ props }) => {\n                return () => {\n                  if (!props.foo) {\n                    throw new Error(`Expected props.foo to be defined`);\n                  }\n\n                  return props.foo(\"bar\");\n                };\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== \"bar\") {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.onProps(function() {\n                        window.xprops.baz('bar');\n                    });\n                `,\n\n        postRun: () => {\n          return instance.updateProps({\n            baz: noop,\n          });\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass the inputProp as a parameter in the value function\", () => {\n    const expectedAccount = \"123\";\n\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-input-value-passing\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            account: {\n              type: \"string\",\n              required: true,\n              value: ({ props }) => {\n                return props.account;\n              },\n            },\n            passFoo: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passFoo({ account: window.xprops.account });\n                `,\n        account: expectedAccount,\n        passFoo: expect(\"passFoo\", ({ account }) => {\n          if (account !== expectedAccount) {\n            throw new Error(\n              `Expected account=${expectedAccount}, but got account=${account}`\n            );\n          }\n        }),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should allow decorated functions to change their signature from the original value callback prop\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"changing-decorated-function-signature\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            onSuccess: {\n              type: \"function\",\n              decorate: ({ value, onError }) => {\n                return (err, result) => {\n                  if (err || !result) {\n                    return onError(err);\n                  }\n\n                  return value(true);\n                };\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.onSuccess(null, {success: true});\n                `,\n        onSuccess: expect(\"onSuccess\", (result) => {\n          if (result !== true) {\n            throw new Error(\n              `Expected onSuccess to have been called with true, but was called with ${result}`\n            );\n          }\n        }),\n        onError: avoid(\"onError\"),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should enter a component, update a prop with a default, then call the prop\", () => {\n    return wrapPromise(({ expect, error }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-default-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            meep: {\n              type: \"function\",\n              default: () => {\n                return error(\"meepv1\");\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.onProps(function() {\n                        window.xprops.meep();\n                    });\n                `,\n\n        postRun: () => {\n          return instance.updateProps({\n            meep: expect(\"meepv2\"),\n          });\n        },\n      });\n    });\n  });\n\n  it(\"should enter a component, update a prop with a value, then call the prop\", () => {\n    return wrapPromise(({ expect, error }) => {\n      let doExpect = false;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-value-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            meep: {\n              type: \"function\",\n              value: () => {\n                return doExpect ? expect(\"meepv1\") : noop;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.onProps(function() {\n                        window.xprops.meep();\n                    });\n                `,\n\n        postRun: () => {\n          doExpect = true;\n\n          return instance.updateProps({\n            meep: error(\"meepv2\"),\n          });\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should enter a component and call back with a string prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedResult = \"bar\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-string-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        customProp: expectedResult,\n\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== expectedResult) {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(window.xprops.customProp);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component and call back with a number prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedResult = 123;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-number-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        customProp: expectedResult,\n\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== expectedResult) {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(window.xprops.customProp);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component and call back with a boolean prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedResult = true;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-boolean-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        customProp: expectedResult,\n\n        foo: expect(\"foo\", (bar) => {\n          if (bar !== expectedResult) {\n            throw new Error(`Expected bar to be 'bar', got ${bar}`);\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(window.xprops.customProp);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component and call back with an array prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedResult = [\n        \"bar\",\n        12345,\n        {\n          bar: \"baz\",\n        },\n        expect(\"fn\"),\n      ];\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-array-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        objectProp: expectedResult,\n\n        foo: expect(\"foo\", (result) => {\n          if (result[0] !== expectedResult[0]) {\n            throw new Error(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          if (result[1] !== expectedResult[1]) {\n            throw new Error(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          if (result[2].bar !== expectedResult[2].bar) {\n            throw new Error(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          if (typeof result[3] !== \"function\") {\n            throw new TypeError(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          result[3]();\n        }),\n\n        run: () => `\n                    window.xprops.foo(window.xprops.objectProp);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component and call back with an object prop\", () => {\n    return wrapPromise(({ expect }) => {\n      const expectedResult = {\n        foo: \"bar\",\n        x: 12345,\n        fn: expect(\"fn\"),\n        obj: {\n          bar: \"baz\",\n        },\n      };\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-object-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        objectProp: expectedResult,\n\n        foo: expect(\"foo\", (result) => {\n          if (result.foo !== expectedResult.foo) {\n            throw new Error(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          if (result.obj.bar !== expectedResult.obj.bar) {\n            throw new Error(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          if (result.x !== expectedResult.x) {\n            throw new Error(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          if (typeof result.fn !== \"function\") {\n            throw new TypeError(\n              `Object ${JSON.stringify(\n                result\n              )} does not match expected ${JSON.stringify(expectedResult)}`\n            );\n          }\n\n          result.fn();\n        }),\n\n        run: () => `\n                    window.xprops.foo(window.xprops.objectProp);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should enter a component and call back with a function prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-function-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        functionProp: expect(\"functionProp\"),\n\n        foo: expect(\"foo\", (fn) => {\n          if (typeof fn !== \"function\") {\n            throw new TypeError(`Expected a function prop, got ${typeof fn}`);\n          }\n          fn();\n        }),\n\n        run: () => `\n                    window.xprops.foo(window.xprops.functionProp);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should error out if not passed a required prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-required-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.try(() => {\n        component();\n      }).catch(expect(\"catch\"));\n    });\n  });\n\n  it(\"should not pass a sameDomain prop to the child\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-samedomain-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              sameDomain: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: \"bar\",\n        passProp: expect(\"passProp\", (val) => {\n          if (val) {\n            throw new Error(`Expected val to not be passed`);\n          }\n        }),\n        run: () => `\n                    window.xprops.passProp(window.xprops.foo);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass a sameDomain prop and not have it populate on the child\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = (sameDomain = true) => {\n        return zoid.create({\n          tag: \"test-samedomain-prop-passed\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              sameDomain,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__(false);\n      const instance = component({\n        foo: \"bar\",\n        passProp: expect(\"passProp\", (val) => {\n          if (val) {\n            throw new Error(`Expected val to not be passed`);\n          }\n        }),\n        run: () => `\n                    window.xprops.passProp(window.xprops.foo);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass a trustedDomain prop and have it populate on the child with string and regex\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-trusteddomain-prop-passed\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              trustedDomains: [\n                // eslint-disable-next-line security/detect-unsafe-regex\n                /\\.other\\.(com|cn)(:\\d+)?$/,\n                \"mock://www.child.com\",\n              ],\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: \"bar\",\n        passProp: expect(\"passProp\", (val) => {\n          if (!val) {\n            throw new Error(`Expected val to be passed`);\n          }\n        }),\n        run: () => `\n                    window.xprops.passProp(window.xprops.foo);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass a trustedDomain prop and have it not populate on the child if no match\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-trusteddomain-prop-not-passed\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              // eslint-disable-next-line security/detect-unsafe-regex\n              trustedDomains: [/\\.other\\.(com|cn)(:\\d+)?$/],\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: \"bar\",\n        passProp: expect(\"passProp\", (val) => {\n          if (val) {\n            throw new Error(`Expected val to not be passed`);\n          }\n        }),\n        run: () => `\n                    window.xprops.passProp(window.xprops.foo);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass a trustedDomain and sameDomain=true prop and have it populate on the child\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-samedomain-trusteddomain-prop-passed\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              sameDomain: true,\n              // eslint-disable-next-line security/detect-unsafe-regex\n              trustedDomains: [/\\.child\\.(com|cn)(:\\d+)?$/],\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: \"bar\",\n        passProp: expect(\"passProp\", (val) => {\n          if (!val) {\n            throw new Error(`Expected val to be passed`);\n          }\n        }),\n        run: () => `\n                    window.xprops.passProp(window.xprops.foo);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should alias a prop and have it copy correctly\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-alias-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"function\",\n              alias: \"bar\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\"),\n        run: () => `\n                    window.xprops.bar();\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should alias a prop and have it copy correctly in reverse\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-alias-reverse-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"function\",\n              alias: \"bar\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        bar: expect(\"bar\"),\n        run: () => `\n                    window.xprops.foo();\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass props in the url correctly\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-props-query-param\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            fooProp: {\n              type: \"string\",\n              queryParam: true,\n            },\n\n            barProp: {\n              type: \"boolean\",\n              queryParam: \"myBooleanProp\",\n            },\n\n            bazProp: {\n              type: \"object\",\n              queryParam: () => \"myBazProp\",\n              queryValue: (val) => {\n                // $FlowFixMe\n                return {\n                  ...val,\n                  meep: \"beep\",\n                };\n              },\n            },\n\n            bingProp: {\n              type: \"number\",\n              queryParam: true,\n            },\n\n            zomgProp: {\n              type: \"object\",\n              queryParam: true,\n              serialization: \"json\",\n            },\n\n            lolProp: {\n              type: \"object\",\n              queryParam: true,\n              serialization: \"base64\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        fooProp: \"hello world\",\n        barProp: true,\n        bazProp: {\n          woot: \"boot\",\n          foobar: [1, \"wat\", { woop: \"doop\" }],\n        },\n        bingProp: 54321,\n        zomgProp: {\n          flerp: \"blerp\",\n        },\n        lolProp: {\n          bleep: [1, 2, 3],\n        },\n        bloopProp: \"floop\",\n\n        getQuery: expect(\"getQuery\", (rawQuery) => {\n          const query = JSON.stringify(parseQuery(rawQuery), null, 4);\n\n          const expected = JSON.stringify(\n            {\n              fooProp: \"hello world\",\n              myBooleanProp: \"true\",\n              \"bazProp.value.woot\": \"boot\",\n              \"bazProp.value.foobar.0\": \"1\",\n              \"bazProp.value.foobar.1\": \"wat\",\n              \"bazProp.value.foobar.2.woop\": \"doop\",\n              \"bazProp.meep\": \"beep\",\n              bingProp: \"54321\",\n              zomgProp: '{\"flerp\":\"blerp\"}',\n              lolProp: btoa('{\"bleep\":[1,2,3]}').replace(/[=]/g, \"\"),\n            },\n            null,\n            4\n          );\n\n          if (query !== expected) {\n            throw new Error(\n              `Expected query string to be:\\n\\n${expected}\\n\\nbut got:\\n\\n${query}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.getQuery(window.location.search.slice(1));\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass boolean props in the url correctly\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-props-boolean-query-param\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            trueProp: {\n              type: \"boolean\",\n              queryParam: true,\n            },\n\n            falseProp: {\n              type: \"boolean\",\n              queryParam: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        trueProp: true,\n        falseProp: false,\n\n        getQuery: expect(\"getQuery\", (rawQuery) => {\n          const query = JSON.stringify(parseQuery(rawQuery), null, 4);\n\n          const expected = JSON.stringify(\n            {\n              trueProp: \"true\",\n              falseProp: \"false\",\n            },\n            null,\n            4\n          );\n\n          if (query !== expected) {\n            throw new Error(\n              `Expected query string to be:\\n\\n${expected}\\n\\nbut got:\\n\\n${query}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.getQuery(window.location.search.slice(1));\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass promise props in the url correctly\", () => {\n    return wrapPromise(({ expect }) => {\n      const promiseValue = \"helloworld\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-promise-props-query-param\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            promiseProp: {\n              type: \"function\",\n              queryParam: true,\n              queryValue: <T>({\n                value,\n              }: {|\n                value: () => T,\n              |}): ZalgoPromise<T> => {\n                return ZalgoPromise.delay(50).then(() => value());\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        promiseProp: expect(\"promiseProp\", () => promiseValue),\n        getQuery: expect(\"getQuery\", (rawQuery) => {\n          const query = JSON.stringify(parseQuery(rawQuery), null, 4);\n\n          const expected = JSON.stringify(\n            {\n              promiseProp: promiseValue,\n            },\n            null,\n            4\n          );\n\n          if (query !== expected) {\n            throw new Error(\n              `Expected query string to be:\\n\\n${expected}\\n\\nbut got:\\n\\n${query}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.getQuery(window.location.search.slice(1));\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass an empty string as a query param\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-promise-props-query-param-empty-string\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            fooBar: {\n              type: \"string\",\n              required: false,\n              queryParam: \"foo_bar\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        fooBar: \"\",\n        getQuery: expect(\"getQuery\", (rawQuery) => {\n          if (rawQuery.indexOf(\"foo_bar=\") === -1) {\n            throw new Error(\n              `Expected foo_bar to be in query string, got ${rawQuery}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.getQuery(window.location.search.slice(1));\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should not pass an empty default string as a query param when decorated to null\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-promise-props-query-param-empty-string-null-decorator\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            fooBar: {\n              type: \"string\",\n              required: false,\n              queryParam: \"foo_bar\",\n              default: () => \"\",\n              decorate: ({ props }) => {\n                // $FlowFixMe\n                return props.fooBar ? props.fooBar : null;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        fooBar: \"\",\n        getQuery: expect(\"getQuery\", (rawQuery) => {\n          const query = parseQuery(rawQuery);\n\n          if (\"foo_bar\" in query || rawQuery.indexOf(\"foo_bar=\") !== -1) {\n            throw new Error(\n              `Expected foo_bar to not be in query string, got ${rawQuery}`\n            );\n          }\n        }),\n        run: () => `\n                    window.xprops.getQuery(window.location.search.slice(1));\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should enter a component, update a prop, destroy the component, and not error out\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-prop-destroy-component\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component();\n\n      instance.render(getBody()).then(\n        expect(\"postRender\", () => {\n          const updatePromise = instance.updateProps({\n            foo: \"bar\",\n          });\n\n          instance.close();\n\n          return updatePromise;\n        })\n      );\n    });\n  });\n\n  it(\"should enter a component, update a prop, close the window, and not error out\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-prop-close-window\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component();\n\n      let openedWindow;\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          openedWindow = win;\n        })\n      );\n\n      instance.render(getBody()).then(\n        expect(\"postRender\", () => {\n          const updatePromise = instance.updateProps({\n            foo: \"bar\",\n          });\n\n          destroyElement(openedWindow.frameElement);\n\n          return updatePromise;\n        })\n      );\n    });\n  });\n\n  it(\"should enter a component, and update a prop after a delay\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-prop-delay\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        onFoo: expect(\"onFoo\"),\n\n        run: () => {\n          setTimeout(() => {\n            instance.updateProps({ foo: \"bar\" });\n          }, 200);\n\n          return `\n                        window.xprops.onProps(function(props) {\n                            if (props.foo === 'bar') {\n                                props.onFoo();\n                            }\n                        });\n                    `;\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass all input props through to value\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-derived-from-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n            },\n            bar: {\n              type: \"string\",\n              value: ({ props }) => props.foo,\n            },\n            passBar: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passBar({ bar: xprops.bar });\n                `,\n        foo: \"foo\",\n        passBar: expect(\"passBar\", ({ bar }) => {\n          if (bar !== \"foo\") {\n            throw new Error(\n              `Expected prop to have the correct value; got ${bar}`\n            );\n          }\n        }),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should pass all input props through to value, even for the same prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-derived-from-props-with-same-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            bar: {\n              type: \"string\",\n              value: ({ props }) => props.bar,\n            },\n            passBar: {\n              type: \"function\",\n              required: true,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        run: () => `\n                    window.xprops.passBar({ bar: xprops.bar });\n                `,\n        bar: \"foo\",\n        passBar: expect(\"passBar\", ({ bar }) => {\n          if (bar !== \"foo\") {\n            throw new Error(\n              `Expected prop to have the correct value; got ${bar}`\n            );\n          }\n        }),\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should error out if a required prop has an value function which returns undefined\", () => {\n    return wrapPromise(() => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-undefined-error\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              value: () => undefined,\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      let error;\n\n      try {\n        component();\n      } catch (err) {\n        error = err;\n      }\n\n      if (!error) {\n        throw new Error(`Expected error to be thrown`);\n      }\n    });\n  });\n\n  it(\"should error out if a required prop has both required:true and a default value\", () => {\n    return wrapPromise(() => {\n      let error;\n\n      try {\n        zoid.create({\n          tag: \"test-prop-value-required-default\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          props: {\n            foo: {\n              type: \"string\",\n              required: true,\n              default: () => \"foo\",\n            },\n          },\n        });\n      } catch (err) {\n        error = err;\n      }\n\n      if (!error) {\n        throw new Error(`Expected error to be thrown`);\n      }\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, update the prop, and get the latest decorated value\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-decorated-multiple-times\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ value }) => {\n                return value * 2;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        baz: 2,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== 4) {\n            throw new Error(\n              `Expected prop to have the correct value; got ${baz}`\n            );\n          }\n\n          return instance.updateProps({\n            baz: 3,\n          });\n        }),\n\n        passBazAgain: expect(\"passBazAgain\", (baz) => {\n          if (baz !== 6) {\n            throw new Error(\n              `Expected prop to have the correct value; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                    const propListener = window.xprops.onProps(function() {\n                        window.xprops.passBazAgain(window.xprops.baz);\n                    });\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, update the prop multiple times, and get the latest decorated value\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-decorated-multiple-times-updated-multiple-times\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ value }) => {\n                return value * 2;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        baz: 2,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== 4) {\n            throw new Error(\n              `Expected prop to have the correct value; got ${baz}`\n            );\n          }\n\n          return instance.updateProps({\n            baz: 3,\n          });\n        }),\n\n        passBazAgain: expect(\"passBazAgain\", (baz) => {\n          if (baz !== 6) {\n            throw new Error(\n              `Expected prop to have the correct value; got ${baz}`\n            );\n          }\n\n          return instance.updateProps({\n            baz: 8,\n          });\n        }),\n\n        passBazAgainAgain: expect(\"passBazAgainAgain\", (baz) => {\n          if (baz !== 16) {\n            throw new Error(\n              `Expected prop to have the correct value; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                    const propListener = window.xprops.onProps(function() {\n                        window.xprops.passBazAgain(window.xprops.baz);\n\n                        propListener.cancel();\n                        const propListener2 = window.xprops.onProps(function() {\n                            window.xprops.passBazAgainAgain(window.xprops.baz);\n                            propListener2.cancel();\n                        });\n                    });\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, update the prop, and get the latest decorated value\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-decorated-multiple-times-multiple-instances\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ value }) => {\n                return value * 2;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.all(\n        new Array(3).fill(0).map(() => {\n          const startingNumber = Math.floor(Math.random() * 10);\n          const startingNumber2 = Math.floor(Math.random() * 10);\n\n          const instance = component({\n            baz: startingNumber,\n\n            passBaz: expect(\"passBaz\", (baz) => {\n              if (baz !== startingNumber * 2) {\n                throw new Error(\n                  `Expected prop to have the correct value; got ${baz}`\n                );\n              }\n\n              return instance.updateProps({\n                baz: startingNumber2,\n              });\n            }),\n\n            passBazAgain: expect(\"passBazAgain\", (baz) => {\n              if (baz !== startingNumber2 * 2) {\n                throw new Error(\n                  `Expected prop to have the correct value; got ${baz}`\n                );\n              }\n            }),\n\n            run: () => `\n                        window.xprops.passBaz(window.xprops.baz);\n                        const propListener = window.xprops.onProps(function() {\n                            window.xprops.passBazAgain(window.xprops.baz);\n                        });\n                    `,\n          });\n\n          return instance.render(getBody());\n        })\n      );\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, update the prop, and get the latest decorated value\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-update-decorated-multiple-times-multiple-instances-updated-multiple-times\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ value }) => {\n                return value * 2;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.all(\n        new Array(3).fill(0).map(() => {\n          const startingNumber = Math.floor(Math.random() * 10);\n          const startingNumber2 = Math.floor(Math.random() * 10);\n          const startingNumber3 = Math.floor(Math.random() * 10);\n\n          const instance = component({\n            baz: startingNumber,\n\n            passBaz: expect(\"passBaz\", (baz) => {\n              if (baz !== startingNumber * 2) {\n                throw new Error(\n                  `Expected prop to have the correct value; got ${baz}`\n                );\n              }\n\n              return instance.updateProps({\n                baz: startingNumber2,\n              });\n            }),\n\n            passBazAgain: expect(\"passBazAgain\", (baz) => {\n              if (baz !== startingNumber2 * 2) {\n                throw new Error(\n                  `Expected prop to have the correct value; got ${baz}`\n                );\n              }\n\n              return instance.updateProps({\n                baz: startingNumber3,\n              });\n            }),\n\n            passBazAgainAgain: expect(\"passBazAgainAgain\", (baz) => {\n              if (baz !== startingNumber3 * 2) {\n                throw new Error(\n                  `Expected prop to have the correct value; got ${baz}`\n                );\n              }\n            }),\n\n            run: () => `\n                        window.xprops.passBaz(window.xprops.baz);\n                        const propListener = window.xprops.onProps(function() {\n                            window.xprops.passBazAgain(window.xprops.baz);\n\n                            propListener.cancel();\n                            const propListener2 = window.xprops.onProps(function() {\n                                window.xprops.passBazAgainAgain(window.xprops.baz);\n                                propListener2.cancel();\n                            });\n                        });\n                    `,\n          });\n\n          return instance.render(getBody());\n        })\n      );\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a passed value in the value function\", () => {\n    return wrapPromise(({ expect }) => {\n      const fooValue = Math.floor(Math.random() * 100);\n      const bazValue = Math.floor(Math.random() * 100);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-value-passed-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              // $FlowFixMe\n              value: ({ props, value }) => {\n                if (typeof value !== \"undefined\") {\n                  throw new TypeError(\n                    `Expected value to be undefined in value function`\n                  );\n                }\n\n                return props.foo;\n              },\n            },\n          },\n        });\n      };\n\n      const expectedValue = fooValue;\n\n      const component = window.__component__();\n      const instance = component({\n        foo: fooValue,\n        baz: bazValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a passed value in the default function\", () => {\n    return wrapPromise(({ expect }) => {\n      const fooValue = Math.floor(Math.random() * 100);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-default-passed-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              // $FlowFixMe\n              default: ({ props, value }) => {\n                if (typeof value !== \"undefined\") {\n                  throw new TypeError(\n                    `Expected value to be undefined in default function`\n                  );\n                }\n\n                return props.foo;\n              },\n            },\n          },\n        });\n      };\n\n      const expectedValue = fooValue;\n\n      const component = window.__component__();\n      const instance = component({\n        foo: fooValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a passed value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      const fooValue = Math.floor(Math.random() * 100);\n      const bazValue = Math.floor(Math.random() * 100);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-passed-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ props, value }) => {\n                return props.foo * value;\n              },\n            },\n          },\n        });\n      };\n\n      const expectedValue = fooValue * bazValue;\n\n      const component = window.__component__();\n      const instance = component({\n        foo: fooValue,\n        baz: bazValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get an aliased value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-alias-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n              alias: \"bar\",\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ props, value }) => {\n                return props.foo * value;\n              },\n            },\n          },\n        });\n      };\n\n      const fooValue = Math.floor(Math.random() * 100);\n      const bazValue = Math.floor(Math.random() * 100);\n\n      const expectedValue = fooValue * bazValue;\n\n      const component = window.__component__();\n      const instance = component({\n        bar: fooValue,\n        baz: bazValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it.skip(\"should instantiate a component, decorate a prop, and get a reverse-aliased value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-reverse-alias-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n              alias: \"bar\",\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ props, value }) => {\n                return props.bar * value;\n              },\n            },\n          },\n        });\n      };\n\n      const fooValue = Math.floor(Math.random() * 100);\n      const bazValue = Math.floor(Math.random() * 100);\n\n      const expectedValue = fooValue * bazValue;\n\n      const component = window.__component__();\n      const instance = component({\n        foo: fooValue,\n        baz: bazValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a calculated value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      const fooValue = Math.floor(Math.random() * 100);\n      const bazValue = Math.floor(Math.random() * 100);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-value-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n              value: () => fooValue,\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ props, value }) => {\n                return props.foo * value;\n              },\n            },\n          },\n        });\n      };\n\n      const expectedValue = fooValue * bazValue;\n\n      const component = window.__component__();\n      const instance = component({\n        baz: bazValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a self-calculated value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      const bazValue = \"baz\";\n      const expectedValue = \"baz_baz_decorated\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-self-value-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"string\",\n              value: () => bazValue,\n              decorate: ({ props, value }) => {\n                return `${props.baz}_${value}_decorated`;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a default value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      const fooValue = Math.floor(Math.random() * 100);\n      const bazValue = Math.floor(Math.random() * 100);\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-default-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"number\",\n              default: () => fooValue,\n            },\n            baz: {\n              type: \"number\",\n              required: false,\n              decorate: ({ props, value }) => {\n                return props.foo * value;\n              },\n            },\n          },\n        });\n      };\n\n      const expectedValue = fooValue * bazValue;\n\n      const component = window.__component__();\n      const instance = component({\n        baz: bazValue,\n\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a prop, and get a self-default value in the decorator\", () => {\n    return wrapPromise(({ expect }) => {\n      const bazValue = \"baz\";\n      const expectedValue = \"baz_baz_decorated\";\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorated-self-default-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            baz: {\n              type: \"string\",\n              default: () => bazValue,\n              decorate: ({ props, value }) => {\n                return `${props.baz}_${value}_decorated`;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        passBaz: expect(\"passBaz\", (baz) => {\n          if (baz !== expectedValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${expectedValue}; got ${baz}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.passBaz(window.xprops.baz);\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a value for a function prop, and call the function with a different signature using the props.propName\", () => {\n    return wrapPromise(({ expect }) => {\n      const originalValue = \"hello\";\n      const newValue = 12345;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorate-diff-signature-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"function\",\n              decorate: ({ props }) => {\n                const { foo } = props;\n\n                return (originalPropValue) => {\n                  if (originalPropValue !== originalValue) {\n                    throw new Error(\n                      `Expected prop to have the correct value of ${originalValue}; got ${originalPropValue}`\n                    );\n                  }\n\n                  return foo(newValue);\n                };\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\", (newPropValue) => {\n          if (newPropValue !== newValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${newValue}; got ${newPropValue}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(originalValue)});\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, decorate a value for a function prop, and call the function with a different signature using the value\", () => {\n    return wrapPromise(({ expect }) => {\n      const originalValue = \"hello\";\n      const newValue = 12345;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-decorate-diff-signature-value\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"function\",\n              decorate: ({ value }) => {\n                return (originalPropValue) => {\n                  if (originalPropValue !== originalValue) {\n                    throw new Error(\n                      `Expected prop to have the correct value of ${originalValue}; got ${originalPropValue}`\n                    );\n                  }\n\n                  return value(newValue);\n                };\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\", (newPropValue) => {\n          if (newPropValue !== newValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${newValue}; got ${newPropValue}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(originalValue)});\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should instantiate a component, derive a value for a function prop, and call the function with a different signature using the props.propName\", () => {\n    return wrapPromise(({ expect }) => {\n      const originalValue = \"hello\";\n      const newValue = 12345;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-value-diff-signature-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            foo: {\n              type: \"function\",\n              value: ({ props }) => {\n                const { foo } = props;\n\n                return (originalPropValue) => {\n                  if (originalPropValue !== originalValue) {\n                    throw new Error(\n                      `Expected prop to have the correct value of ${originalValue}; got ${originalPropValue}`\n                    );\n                  }\n\n                  return foo(newValue);\n                };\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        foo: expect(\"foo\", (newPropValue) => {\n          if (newPropValue !== newValue) {\n            throw new Error(\n              `Expected prop to have the correct value of ${newValue}; got ${newPropValue}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.foo(${JSON.stringify(originalValue)});\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should get the correct value for all other props in value function\", () => {\n    return wrapPromise(({ expect }) => {\n      const fooValue = \"abc123\";\n      const barValue = 12345;\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-prop-value-get-other-props\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n\n          props: {\n            superpropfunc: {\n              type: \"function\",\n              value: ({ props }) => {\n                return () => {\n                  props.passProps(props);\n                };\n              },\n            },\n            superprop: {\n              type: \"object\",\n              value: ({ props }) => {\n                return {\n                  foo: props.foo,\n                  bar: props.bar,\n                };\n              },\n            },\n            foo: {\n              type: \"string\",\n              value: () => {\n                return fooValue;\n              },\n            },\n            bar: {\n              type: \"number\",\n              value: () => {\n                return barValue;\n              },\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      const instance = component({\n        passProps: expect(\"passProps\", (props) => {\n          if (props.foo !== fooValue) {\n            throw new Error(\n              `Expected props.foo to have the correct value of ${fooValue}; got ${props.foo}`\n            );\n          }\n\n          if (props.bar !== barValue) {\n            throw new Error(\n              `Expected props.bar to have the correct value of ${barValue}; got ${props.bar}`\n            );\n          }\n\n          if (props.superprop.foo !== fooValue) {\n            throw new Error(\n              `Expected props.superprop.foo to have the correct value of ${fooValue}; got ${props.superprop.foo}`\n            );\n          }\n\n          if (props.superprop.bar !== barValue) {\n            throw new Error(\n              `Expected props.superprop.bar to have the correct value of ${barValue}; got ${props.superprop.bar}`\n            );\n          }\n\n          if (typeof props.superpropfunc !== \"function\") {\n            throw new TypeError(\n              `Expected props.superpropfunc to have the correct type of 'function'; got ${typeof props.superpropfunc}`\n            );\n          }\n        }),\n\n        run: () => `\n                    window.xprops.superpropfunc();\n                `,\n      });\n\n      return instance.render(getBody());\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/remove.jsx",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { wrapPromise } from \"@krakenjs/belter/src\";\nimport { getParent } from \"@krakenjs/cross-domain-utils/src\";\n\nimport { onWindowOpen, getContainer } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid remove cases\", () => {\n  it(\"should render a component, remove it from the dom, and immediately destroy the component\", () => {\n    return wrapPromise(({ expect }) => {\n      let closed = false;\n\n      const { container, destroy } = getContainer();\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-remove-destroy\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n        onClose: expect(\"onClose\", () => {\n          closed = true;\n        }),\n      })\n        .render(container)\n        .then(() => {\n          if (closed) {\n            throw new Error(`Expected element to not be closed`);\n          }\n\n          destroy();\n\n          return ZalgoPromise.delay(5);\n        })\n        .then(() => {\n          if (!closed) {\n            throw new Error(`Expected element to be closed`);\n          }\n        });\n    });\n  });\n\n  it(\"should render a component into the shadow dom, remove it from the dom, and immediately destroy the component\", () => {\n    return wrapPromise(({ expect }) => {\n      let closed = false;\n\n      const { container, destroy } = getContainer({ shadow: true });\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-remove-destroy-shadow\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      onWindowOpen().then(\n        expect(\"onWindowOpen\", ({ win }) => {\n          if (getParent(win) !== window) {\n            throw new Error(`Expected window parent to be current window`);\n          }\n        })\n      );\n\n      const component = window.__component__();\n      return component({\n        onRendered: expect(\"onRendered\"),\n        onClose: expect(\"onClose\", () => {\n          closed = true;\n        }),\n      })\n        .render(container)\n        .then(() => {\n          if (closed) {\n            throw new Error(`Expected element to not be closed`);\n          }\n\n          destroy();\n\n          return ZalgoPromise.delay(5);\n        })\n        .then(() => {\n          if (!closed) {\n            throw new Error(`Expected element to be closed`);\n          }\n        });\n    });\n  });\n\n  it(\"should not throw an error when parent container is removed before render completes\", () => {\n    return wrapPromise(() => {\n      const { container } = getContainer();\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-remove-before-render-complete\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const onRenderedPromise = new ZalgoPromise();\n      const onClosePromise = new ZalgoPromise();\n\n      const renderPromise = component({\n        onRendered: () => onRenderedPromise.resolve(),\n        onClose: () => onClosePromise.resolve(),\n      }).render(container);\n\n      // manually remove before render completes\n      container.remove();\n\n      return renderPromise.then(() => {\n        ZalgoPromise.delay(5);\n      });\n    });\n  });\n\n  it(\"should not throw an error when window navigates away before render completes\", () => {\n    return wrapPromise(() => {\n      const { container } = getContainer();\n\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-navigation-before-render-complete\",\n          url: () => \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n      const onRenderedPromise = new ZalgoPromise();\n      const onClosePromise = new ZalgoPromise();\n\n      const renderPromise = component({\n        onRendered: () => onRenderedPromise.resolve(),\n        onClose: () => onClosePromise.resolve(),\n      }).render(container);\n\n      // manually reload window before render completes\n      window.dispatchEvent(new Event(\"unload\"));\n      return renderPromise.then(() => {\n        ZalgoPromise.delay(5);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/renderto.jsx",
    "content": "/* @flow */\n/* eslint max-lines: off */\n/** @jsx node */\n\nimport {\n  onCloseWindow,\n  getParent,\n  getOpener,\n  isWindowClosed,\n} from \"@krakenjs/cross-domain-utils/src\";\nimport {\n  wrapPromise,\n  destroyElement,\n  base64decode,\n} from \"@krakenjs/belter/src\";\nimport { node, dom } from \"@krakenjs/jsx-pragmatic/src\";\n\nimport { onWindowOpen, getContainer, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid renderto cases\", () => {\n  it(\"should render a component to the parent as an iframe and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\"),\n\n          run: () => {\n            onWindowOpen({\n              namePattern: /^__zoid__test_renderto_iframe_remote/,\n            }).then(\n              expect(\"onWindowOpen\", ({ win, name }) => {\n                if (getParent(win) !== window) {\n                  throw new Error(\n                    `Expected window parent to be current window`\n                  );\n                }\n\n                if (!name) {\n                  throw new Error(`Expected window name`);\n                }\n\n                // eslint-disable-next-line unicorn/no-unreadable-array-destructuring\n                const [, , , serializedPayload] = name.split(\"__\");\n                const payload = base64decode(serializedPayload);\n\n                if (payload.indexOf(\"secret12345\") !== -1) {\n                  throw new Error(\n                    `Expected payload to not contain secret value`\n                  );\n                }\n              })\n            );\n\n            return `\n                        window.__component__().remote({\n                            secret: 'secret12345',\n                            foo: window.xprops.foo,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as a popup and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-popup-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-popup-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\"),\n\n          runOnClick: true,\n\n          run(): string {\n            onWindowOpen({\n              // $FlowFixMe[object-this-reference]\n              win: this.source,\n              namePattern: /^__zoid__test_renderto_popup_remote/,\n            }).then(\n              expect(\"onWindowOpen\", ({ win, name }) => {\n                // $FlowFixMe[object-this-reference]\n                if (getOpener(win) !== this.source) {\n                  throw new Error(`Expected window opener to be child frame`);\n                }\n\n                if (!name) {\n                  throw new Error(`Expected window name`);\n                }\n\n                // eslint-disable-next-line unicorn/no-unreadable-array-destructuring\n                const [, , , serializedPayload] = name.split(\"__\");\n                const payload = base64decode(serializedPayload);\n\n                if (payload.indexOf(\"secret12345\") !== -1) {\n                  throw new Error(\n                    `Expected payload to not contain secret value`\n                  );\n                }\n              })\n            );\n\n            return `\n                        const instance = window.__component__().remote({\n                            secret: 'secret12345',\n                            foo: window.xprops.foo,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        });\n                        \n                        return instance.renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should prerender to a remotely rendered popup\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-prerender-popup-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-prerender-popup-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n              prerenderTemplate: ({ doc }) => {\n                const html = doc.createElement(\"html\");\n                const body = doc.createElement(\"body\");\n                const script = doc.createElement(\"script\");\n                script.text = `\n                                window.opener.prerenderScriptLoaded();\n                            `;\n                html.appendChild(body);\n                body.appendChild(script);\n                return html;\n              },\n            }),\n          };\n        };\n\n        return window\n          .__component__()\n          .simple({\n            prerenderScriptLoaded: expect(\"prerenderScriptLoaded\"),\n\n            runOnClick: true,\n\n            done: expect(\"done\"),\n\n            run: expect(\"run\", () => {\n              return `\n                        window.prerenderScriptLoaded = window.xprops.prerenderScriptLoaded;\n                        window.__component__().remote({\n                            done: window.xprops.done,\n                            run: () => \\`\n                                window.xprops.done();\n                            \\`\n                        }).renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n            }),\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should prerender to a remotely rendered iframe\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-prerender-iframe-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-prerender-iframe-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n              prerenderTemplate: ({ doc }) => {\n                const html = doc.createElement(\"html\");\n                const body = doc.createElement(\"body\");\n                const script = doc.createElement(\"script\");\n                script.text = `\n                                window.parent.prerenderScriptLoaded();\n                            `;\n                html.appendChild(body);\n                body.appendChild(script);\n                return html;\n              },\n            }),\n          };\n        };\n\n        window.prerenderScriptLoaded = expect(\"prerenderScriptLoaded\");\n\n        return window\n          .__component__()\n          .simple({\n            done: expect(\"done\"),\n            run: expect(\"run\", () => {\n              return `\n                        window.__component__().remote({\n                            done: window.xprops.done,\n                            run: () => \\`\n                                window.xprops.done();\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n            }),\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should render a component to the parent as an iframe and close after a delay\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-close-iframe-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-close-iframe-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n          };\n        };\n\n        let componentWindow;\n\n        return window\n          .__component__()\n          .simple({\n            onClose: expect(\"onClose\", () => {\n              if (!isWindowClosed(componentWindow)) {\n                throw new Error(`Expected component window to be closed`);\n              }\n            }),\n\n            run: () => {\n              onWindowOpen().then(\n                expect(\"onWindowOpen\", ({ win }) => {\n                  componentWindow = win;\n                })\n              );\n\n              return `\n                        window.__component__().remote({\n                            onClose: function() {\n                                setTimeout(() => {\n                                    window.frameElement.parentNode.removeChild(window.frameElement)\n                                }, 100);\n                            },\n\n                            run: () => \\`\n                                setTimeout(() => {\n                                    window.frameElement.parentNode.removeChild(window.frameElement)\n                                }, 100);\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n            },\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should render a component to the parent as a popup and close after a delay\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-close-popup-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-close-popup-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n          };\n        };\n\n        let componentWindow;\n\n        return window\n          .__component__()\n          .simple({\n            onClose: expect(\"onClose\", () => {\n              if (!isWindowClosed(componentWindow)) {\n                throw new Error(`Expected component window to be closed`);\n              }\n            }),\n\n            runOnClick: true,\n\n            run(): string {\n              // $FlowFixMe[object-this-reference]\n              onWindowOpen({ win: this.source }).then(\n                expect(\"onWindowOpen\", ({ win }) => {\n                  componentWindow = win;\n                })\n              );\n\n              return `\n                        window.__component__().remote({\n                            onClose: function() {\n                                setTimeout(() => {\n                                    window.frameElement.parentNode.removeChild(window.frameElement);\n                                }, 100);\n                            },\n\n                            run: () => \\`\n                                setTimeout(() => {\n                                    window.close();\n                                }, 100);\n                            \\`\n                        }).renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n            },\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should close a zoid renderToParent iframe on call of close from prerender template\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-prerender-close-iframe-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-prerender-close-iframe-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n              prerenderTemplate: ({ close, doc }) => {\n                const html = doc.createElement(\"html\");\n                const body = doc.createElement(\"body\");\n                html.appendChild(body);\n                setTimeout(close, 300);\n                return html;\n              },\n            }),\n          };\n        };\n\n        return window\n          .__component__()\n          .simple({\n            run: () => {\n              onWindowOpen().then(\n                expect(\"onWindowOpen\", ({ win }) => {\n                  onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n                })\n              );\n\n              return `\n                        window.__component__().remote().renderTo(window.parent, 'body');\n                    `;\n            },\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should close a zoid renderToParent popup on call of close from prerender template\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-prerender-close-popup-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-prerender-close-popup-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n              prerenderTemplate: ({ close, doc }) => {\n                const html = doc.createElement(\"html\");\n                const body = doc.createElement(\"body\");\n                html.appendChild(body);\n                setTimeout(close, 300);\n                return html;\n              },\n            }),\n          };\n        };\n\n        return window\n          .__component__()\n          .simple({\n            runOnClick: true,\n\n            run: () => {\n              onWindowOpen().then(\n                expect(\"onWindowOpen\", ({ win }) => {\n                  onCloseWindow(win, expect(\"onCloseWindow\"), 50);\n                })\n              );\n\n              return `\n                        window.__component__().remote().renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n            },\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should focus a zoid renderToParent popup on call of focus from container template\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        let doFocus;\n\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-container-focus-popup-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-container-focus-popup-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n              containerTemplate: ({ doc, focus }) => {\n                doFocus = focus;\n\n                return (<div />).render(dom({ doc }));\n              },\n            }),\n          };\n        };\n\n        return window\n          .__component__()\n          .simple({\n            doFocus: expect(\"doFocus\", () => doFocus()),\n            onFocused: expect(\"onFocused\"),\n\n            runOnClick: true,\n\n            run: expect(\"run\", () => {\n              return `\n                        let win;\n\n                        let winOpen = window.open;\n                        window.open = function windowOpen() {\n                            win = winOpen.apply(this, arguments);\n                            return win;\n                        }\n\n                        window.__component__().remote().renderTo(window.parent, 'body', zoid.CONTEXT.POPUP).then(() => {\n                            win.focus = window.xprops.onFocused;\n                            return window.xprops.doFocus();\n                        });\n                    `;\n            }),\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should focus a zoid renderToParent popup on call of focus from prerender template\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-prerender-focus-popup-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-prerender-focus-popup-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n              prerenderTemplate: ({ doc, focus }) => {\n                const html = doc.createElement(\"html\");\n                const body = doc.createElement(\"body\");\n                html.appendChild(body);\n                window.doFocus = focus;\n                return html;\n              },\n            }),\n          };\n        };\n\n        return window\n          .__component__()\n          .simple({\n            onFocused: expect(\"onFocused\"),\n\n            runOnClick: true,\n\n            run: expect(\"run\", () => {\n              return `\n                        let win;\n\n                        let winOpen = window.open;\n                        window.open = function windowOpen() {\n                            win = winOpen.apply(this, arguments);\n                            return win;\n                        }\n\n                        window.__component__().remote().renderTo(window.parent, 'body', zoid.CONTEXT.POPUP).then(() => {\n                            win.focus = window.xprops.onFocused;\n                            window.doFocus();\n                        });\n                    `;\n            }),\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should error out when trying to renderTo with an element reference\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-element-reference-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-element-reference-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          childRenderError: expect(\"childRenderError\"),\n\n          run: () => {\n            return `\n                        window.__component__().remote().renderTo(window.parent, document.body)\n                            .catch(window.xprops.childRenderError);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should error out when trying to renderTo to a different popup\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-different-popup-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-different-popup-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.foobar.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          childRenderError: expect(\"childRenderError\"),\n\n          run: () => {\n            return `\n                        const win = window.open('', '', 'width=500,height=500');\n\n                        window.__component__().remote().renderTo(win, 'body')\n                            .catch(err => {\n                                win.close();\n                                return window.xprops.childRenderError(err);\n                            });\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should error out when using renderto with a different domain to the current domain\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-different-domain-error-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-different-domain-error-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.foobar.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          childRenderError: expect(\"childRenderError\"),\n\n          run: () => {\n            return `\n                        window.__component__().remote().renderTo(window.parent, 'body')\n                            .catch(window.xprops.childRenderError);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should error out when using renderto with an iframe without the component loaded\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-bad-window-error-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          childRenderError: expect(\"childRenderError\"),\n\n          run: () => {\n            return `\n                        const remoteComponent = zoid.create({\n                            tag:    'test-renderto-iframe-bad-window-error-remote',\n                            url:    'mock://www.child.com/base/test/windows/child/index.htm',\n                            domain: 'mock://www.child.com'\n                        });\n\n                        remoteComponent().renderTo(window.parent, 'body')\n                            .catch(window.xprops.childRenderError);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe and close when the original window closes\", () => {\n    return wrapPromise(\n      ({ expect }) => {\n        window.__component__ = () => {\n          return {\n            simple: zoid.create({\n              tag: \"test-renderto-close-on-parent-close-iframe-simple\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n\n            remote: zoid.create({\n              tag: \"test-renderto-close-on-parent-close-iframe-remote\",\n              url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n              domain: \"mock://www.child.com\",\n            }),\n          };\n        };\n\n        let simpleWindow;\n        let remoteWindow;\n\n        onWindowOpen().then(\n          expect(\"onSimpleWindowOpen\", ({ win }) => {\n            simpleWindow = win;\n          })\n        );\n\n        return window\n          .__component__()\n          .simple({\n            onLoad: expect(\"onLoad\", () => {\n              onWindowOpen().then(\n                expect(\"onRemoteWindowOpen\", ({ win }) => {\n                  remoteWindow = win;\n                })\n              );\n            }),\n\n            onRemoteLoad: expect(\"onRemoteLoad\", () => {\n              if (!remoteWindow) {\n                throw new Error(`Expected remote window to be populated`);\n              }\n\n              destroyElement(simpleWindow.frameElement);\n              return onCloseWindow(remoteWindow, expect(\"onCloseWindow\"));\n            }),\n\n            run: () => {\n              return `\n                        return window.xprops.onLoad().then(() => {\n                            return window.__component__().remote().renderTo(window.parent, 'body');\n                        }).then(() => {\n                            return window.xprops.onRemoteLoad();\n                        });\n                    `;\n            },\n          })\n          .render(getBody());\n      },\n      { timeout: 5000 }\n    );\n  });\n\n  it(\"should get a successful result from canrenderto\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-canrenderto-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-canrenderto-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          canRenderToResult: expect(\"canRenderTo\", (result) => {\n            if (result !== true) {\n              throw new Error(`Expected positive result for canRenderTo`);\n            }\n          }),\n\n          run: () => {\n            return `\n                        window.__component__().remote.canRenderTo(window.parent)\n                            .then(window.xprops.canRenderToResult)\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should get a negative result from canrenderto\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-canrenderto-negative-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          canRenderToResult: expect(\"canRenderTo\", (result) => {\n            if (result !== false) {\n              throw new Error(`Expected negative result for canRenderTo`);\n            }\n          }),\n\n          run: () => {\n            return `\n                        const component = zoid.create({\n                            tag:    'test-renderto-canrenderto-negative-remote',\n                            url:    'mock://www.child.com/base/test/windows/child/index.htm',\n                            domain: 'mock://www.child.com'\n                        });\n\n                        component.canRenderTo(window.parent)\n                            .then(window.xprops.canRenderToResult)\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe inside an iframe and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-in-iframe-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-in-iframe-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            containerTemplate: ({ doc, frame, prerenderFrame }) => {\n              return (\n                <div>\n                  <iframe>\n                    <html>\n                      <body>\n                        <node el={frame} />\n                        <node el={prerenderFrame} />\n                      </body>\n                    </html>\n                  </iframe>\n                </div>\n              ).render(dom({ doc }));\n            },\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\"),\n\n          run: () => {\n            return `\n                        window.__component__().remote({\n                            foo: window.xprops.foo,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent with a required prop without allowDelegate\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-required-prop-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-required-prop-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            props: {\n              foo: {\n                type: \"function\",\n                required: true,\n              },\n            },\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\"),\n\n          run: () => {\n            onWindowOpen().then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                if (getParent(win) !== window) {\n                  throw new Error(\n                    `Expected window parent to be current window`\n                  );\n                }\n              })\n            );\n\n            return `\n                        window.__component__().remote({\n                            foo: window.xprops.foo,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as a popup from the shadow-dom and call a prop\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-popup-shadow-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-popup-shadow-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const { container, destroy } = getContainer({ shadow: true });\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\", () => {\n            destroy();\n          }),\n\n          onError: avoid(\"onError\", (err) => {\n            throw err;\n          }),\n\n          runOnClick: true,\n\n          run(): string {\n            // $FlowFixMe[object-this-reference]\n            onWindowOpen({ win: this.source }).then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                // $FlowFixMe[object-this-reference]\n                if (getOpener(win) !== this.source) {\n                  throw new Error(`Expected window opener to be child frame`);\n                }\n              })\n            );\n\n            return `\n                        const instance = window.__component__().remote({\n                            foo:     window.xprops.foo,\n                            onError: window.xprops.onError,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        });\n                        \n                        return instance.renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n          },\n        })\n        .render(container);\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe from the shadow-dom and call a prop\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-shadow-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-shadow-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const { container, destroy } = getContainer({ shadow: true });\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\", () => {\n            destroy();\n          }),\n\n          onError: avoid(\"onError\", (err) => {\n            throw err;\n          }),\n\n          runOnClick: true,\n\n          run(): string {\n            onWindowOpen().then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                if (getParent(win) !== window) {\n                  throw new Error(\n                    `Expected window parent to be current window`\n                  );\n                }\n              })\n            );\n\n            return `\n                        const instance = window.__component__().remote({\n                            foo: window.xprops.foo,\n                            onError: window.xprops.onError,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        });\n                        \n                        return instance.renderTo(window.parent, 'body', zoid.CONTEXT.IFRAME);\n                    `;\n          },\n        })\n        .render(container);\n    });\n  });\n\n  it(\"should render a component to the parent as a popup from the shadow-dom using slots and call a prop\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-popup-shadow-slots-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-popup-shadow-slots-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const { container, destroy } = getContainer({\n        shadow: true,\n        slots: true,\n      });\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\", () => {\n            destroy();\n          }),\n\n          onError: avoid(\"onError\", (err) => {\n            throw err;\n          }),\n\n          runOnClick: true,\n\n          run(): string {\n            // $FlowFixMe[object-this-reference]\n            onWindowOpen({ win: this.source }).then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                // $FlowFixMe[object-this-reference]\n                if (getOpener(win) !== this.source) {\n                  throw new Error(`Expected window opener to be child frame`);\n                }\n              })\n            );\n\n            return `\n                        const instance = window.__component__().remote({\n                            foo: window.xprops.foo,\n                            onError: window.xprops.onError,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        });\n                        \n                        return instance.renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n          },\n        })\n        .render(container);\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe from the shadow-dom using slots and call a prop\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-shadow-slots-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-shadow-slots-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const { container, destroy } = getContainer({\n        shadow: true,\n        slots: true,\n      });\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\", () => {\n            destroy();\n          }),\n\n          onError: avoid(\"onError\", (err) => {\n            throw err;\n          }),\n\n          runOnClick: true,\n\n          run(): string {\n            onWindowOpen().then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                if (getParent(win) !== window) {\n                  throw new Error(\n                    `Expected window parent to be current window`\n                  );\n                }\n              })\n            );\n\n            return `\n                        const instance = window.__component__().remote({\n                            foo: window.xprops.foo,\n                            onError: window.xprops.onError,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        });\n                        \n                        return instance.renderTo(window.parent, 'body', zoid.CONTEXT.IFRAME);\n                    `;\n          },\n        })\n        .render(container);\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe and hide and show\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-showhide-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-showhide-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const instance = window.__component__().simple({\n        foo: expect(\"foo\", ({ show, hide, createElementWithDimensions }) => {\n          return hide()\n            .then(() => {\n              return createElementWithDimensions().then(({ width, height }) => {\n                if (width !== 0) {\n                  throw new Error(`Expected width to be 0, got ${width}`);\n                }\n\n                if (height !== 0) {\n                  throw new Error(`Expected height to be 0, got ${height}`);\n                }\n              });\n            })\n            .then(() => {\n              return show();\n            })\n            .then(() => {\n              return createElementWithDimensions().then(({ width, height }) => {\n                if (width !== 50) {\n                  throw new Error(`Expected width to be 50, got ${width}`);\n                }\n\n                if (height !== 50) {\n                  throw new Error(`Expected height to be 50, got ${height}`);\n                }\n              });\n            });\n        }),\n\n        run: () => {\n          onWindowOpen().then(\n            expect(\"onWindowOpen\", ({ win }) => {\n              if (getParent(win) !== window) {\n                throw new Error(`Expected window parent to be current window`);\n              }\n            })\n          );\n\n          return `\n                        const instance = window.__component__().remote({\n                            foo: ({ createElementWithDimensions }) => {\n                                return window.xprops.foo({\n                                    createElementWithDimensions,\n                                    show: instance.show,\n                                    hide: instance.hide\n                                });\n                            },\n\n                            run: () => \\`\n                                window.xprops.foo({\n                                    createElementWithDimensions: () => {\n                                        const el = document.createElement('div');\n                                        el.style.height = '50px';\n                                        el.style.width = '50px';\n                                        document.body.appendChild(el);\n\n                                        return {\n                                            height: el.offsetWidth,\n                                            width: el.offsetWidth\n                                        };\n                                    }\n                                });\n                            \\`\n                        });\n                        \n                        instance.renderTo(window.parent, 'body');\n                    `;\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe and hide before render completes\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-hide-before-render-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-hide-before-render-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const instance = window.__component__().simple({\n        foo: expect(\"foo\", ({ createElementWithDimensions }) => {\n          return createElementWithDimensions().then(({ width, height }) => {\n            if (width !== 0) {\n              throw new Error(`Expected width to be 0, got ${width}`);\n            }\n\n            if (height !== 0) {\n              throw new Error(`Expected height to be 0, got ${height}`);\n            }\n          });\n        }),\n\n        run: () => {\n          onWindowOpen().then(\n            expect(\"onWindowOpen\", ({ win }) => {\n              if (getParent(win) !== window) {\n                throw new Error(`Expected window parent to be current window`);\n              }\n            })\n          );\n\n          return `\n                        const instance = window.__component__().remote({\n                            foo: ({ createElementWithDimensions }) => {\n                                return window.xprops.foo({\n                                    createElementWithDimensions\n                                });\n                            },\n\n                            run: () => \\`\n                                window.xprops.foo({\n                                    createElementWithDimensions: () => {\n                                        const el = document.createElement('div');\n                                        el.style.height = '50px';\n                                        el.style.width = '50px';\n                                        document.body.appendChild(el);\n\n                                        return {\n                                            height: el.offsetWidth,\n                                            width: el.offsetWidth\n                                        };\n                                    }\n                                });\n                            \\`\n                        });\n                        \n                        instance.hide();\n                        instance.renderTo(window.parent, 'body');\n                    `;\n        },\n      });\n\n      return instance.render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as a popup without a container element and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-popup-no-container-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-popup-no-container-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            defaultContext: \"popup\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          foo: expect(\"foo\"),\n\n          runOnClick: true,\n\n          run(): string {\n            // $FlowFixMe[object-this-reference]\n            onWindowOpen({ win: this.source }).then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                // $FlowFixMe[object-this-reference]\n                if (getOpener(win) !== this.source) {\n                  throw new Error(`Expected window opener to be child frame`);\n                }\n              })\n            );\n\n            return `\n                        const instance = window.__component__().remote({\n                            foo: window.xprops.foo,\n\n                            run: () => \\`\n                                window.xprops.foo();\n                            \\`\n                        });\n                        \n                        return instance.renderTo(window.parent);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe, change url, and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-change-url-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-change-url-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm?firstLoad\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          firstLoad: expect(\"firstLoad\"),\n          secondLoad: expect(\"secondLoad\"),\n\n          run: () => {\n            onWindowOpen().then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                if (getParent(win) !== window) {\n                  throw new Error(\n                    `Expected window parent to be current window`\n                  );\n                }\n              })\n            );\n\n            return `\n                        window.__component__().remote({\n                            firstLoad: window.xprops.firstLoad,\n                            secondLoad: window.xprops.secondLoad,\n\n                            run: () => \\`\n                                if (location.href.indexOf('firstLoad') !== -1) {\n                                    window.xprops.firstLoad().then(() => {\n                                        window.location = '/base/test/windows/child/index.htm?secondLoad';\n                                    });\n                                }\n\n                                if (location.href.indexOf('secondLoad') !== -1) {\n                                    window.xprops.secondLoad();\n                                }\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as a popup, change url, and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-popup-change-url-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-popup-change-url-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm?firstLoad\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          firstLoad: expect(\"firstLoad\"),\n          secondLoad: expect(\"secondLoad\"),\n\n          runOnClick: true,\n\n          run(): string {\n            // $FlowFixMe[object-this-reference]\n            onWindowOpen({ win: this.source }).then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                // $FlowFixMe[object-this-reference]\n                if (getOpener(win) !== this.source) {\n                  throw new Error(`Expected window opener to be child frame`);\n                }\n              })\n            );\n\n            return `\n                        window.__component__().remote({\n                            firstLoad: window.xprops.firstLoad,\n                            secondLoad: window.xprops.secondLoad,\n\n                            run: () => \\`\n                                if (location.href.indexOf('firstLoad') !== -1) {\n                                    window.xprops.firstLoad().then(() => {\n                                        window.location = '/base/test/windows/child/index.htm?secondLoad';\n                                    });\n                                }\n\n                                if (location.href.indexOf('secondLoad') !== -1) {\n                                    window.xprops.secondLoad();\n                                }\n                            \\`\n                        }).renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe, change domain, and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-iframe-change-domain-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-iframe-change-domain-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: [\"mock://www.child.com\", \"mock://www.child-redirect.com\"],\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          firstLoad: expect(\"firstLoad\"),\n          secondLoad: expect(\"secondLoad\"),\n\n          run: () => {\n            onWindowOpen().then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                if (getParent(win) !== window) {\n                  throw new Error(\n                    `Expected window parent to be current window`\n                  );\n                }\n              })\n            );\n\n            return `\n                        window.__component__().remote({\n                            firstLoad: window.xprops.firstLoad,\n                            secondLoad: window.xprops.secondLoad,\n\n                            run: () => \\`\n                                if (window.mockDomain === 'mock://www.child.com') {\n                                    window.xprops.firstLoad().then(() => {\n                                        window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.child-redirect.com';\n                                    });\n                                }\n\n                                if (window.mockDomain === 'mock://www.child-redirect.com') {\n                                    window.xprops.secondLoad();\n                                }\n                            \\`\n                        }).renderTo(window.parent, 'body');\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as a popup, change domain, and call a prop\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-popup-change-domain-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-popup-change-domain-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: [\"mock://www.child.com\", \"mock://www.child-redirect.com\"],\n          }),\n        };\n      };\n\n      return window\n        .__component__()\n        .simple({\n          firstLoad: expect(\"firstLoad\"),\n          secondLoad: expect(\"secondLoad\"),\n\n          runOnClick: true,\n\n          run(): string {\n            // $FlowFixMe[object-this-reference]\n            onWindowOpen({ win: this.source }).then(\n              expect(\"onWindowOpen\", ({ win }) => {\n                // $FlowFixMe[object-this-reference]\n                if (getOpener(win) !== this.source) {\n                  throw new Error(`Expected window opener to be child frame`);\n                }\n              })\n            );\n\n            return `\n                        window.__component__().remote({\n                            firstLoad: window.xprops.firstLoad,\n                            secondLoad: window.xprops.secondLoad,\n\n                            run: () => \\`\n                                if (window.mockDomain === 'mock://www.child.com') {\n                                    window.xprops.firstLoad().then(() => {\n                                        window.location = '/base/test/windows/child/index.htm?mockDomain=mock://www.child-redirect.com';\n                                    });\n                                }\n\n                                if (window.mockDomain === 'mock://www.child-redirect.com') {\n                                    window.xprops.secondLoad();\n                                }\n                            \\`\n                        }).renderTo(window.parent, 'body', zoid.CONTEXT.POPUP);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/rerender.js",
    "content": "/* @flow */\n/** @jsx node */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\nimport { wrapPromise } from \"@krakenjs/belter/src\";\n\nimport { getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid rerender cases\", () => {\n  it(\"should re-render a component when the container is removed and immediately re-added to the dom\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-rerender\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: ({ getExports }) => {\n            return {\n              exec: (...args) => {\n                return getExports().then((exports) => {\n                  return exports.exec(...args);\n                });\n              },\n            };\n          },\n        });\n      };\n\n      const container = document.createElement(\"div\");\n      getBody().appendChild(container);\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n        onClose: avoid(\"onClose\"),\n        onDestroy: avoid(\"onDestroy\"),\n        onError: avoid(\"onError\"),\n        foo: expect(\"foo\"),\n        run: () => `\n                    window.xprops.export({\n                        exec: (code) => eval(code)\n                    });\n                `,\n      });\n\n      return instance\n        .render(container)\n        .then(() => {\n          return ZalgoPromise.delay(50);\n        })\n        .then(() => {\n          getBody().removeChild(container);\n          getBody().appendChild(container);\n        })\n        .then(() => {\n          return ZalgoPromise.delay(50);\n        })\n        .then(() => {\n          instance.exec(`\n                    window.xprops.foo();\n                `);\n        });\n    });\n  });\n\n  it(\"should re-render a component when the container is removed and immediately re-added to the dom during render\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-rerender-during-render\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          exports: ({ getExports }) => {\n            return {\n              exec: (...args) => {\n                return getExports().then((exports) => {\n                  return exports.exec(...args);\n                });\n              },\n            };\n          },\n        });\n      };\n\n      const container = document.createElement(\"div\");\n      getBody().appendChild(container);\n\n      const component = window.__component__();\n      const instance = component({\n        onRendered: expect(\"onRendered\"),\n        onClose: avoid(\"onClose\"),\n        onDestroy: avoid(\"onDestroy\"),\n        onError: avoid(\"onError\"),\n        foo: expect(\"foo\"),\n        run: () => `\n                    window.xprops.export({\n                        exec: (code) => eval(code)\n                    });\n                `,\n      });\n\n      const renderPromise = instance.render(container);\n      getBody().removeChild(container);\n      getBody().appendChild(container);\n\n      return renderPromise\n        .then(() => {\n          return ZalgoPromise.delay(50);\n        })\n        .then(() => {\n          instance.exec(`\n                    window.xprops.foo();\n                `);\n        });\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe and re-render when the container is removed and immediately re-added to the dom\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-rerender-renderto-iframe-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-rerender-renderto-iframe-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            exports: ({ getExports }) => {\n              return {\n                exec: (...args) => {\n                  return getExports().then((exports) => {\n                    return exports.exec(...args);\n                  });\n                },\n              };\n            },\n          }),\n        };\n      };\n\n      const container = document.createElement(\"div\");\n      container.id = \"remote-element-id\";\n      getBody().appendChild(container);\n\n      return window\n        .__component__()\n        .simple({\n          onRendered: expect(\"onRendered\"),\n          onClose: avoid(\"onClose\"),\n          onDestroy: avoid(\"onDestroy\"),\n          onError: avoid(\"onError\"),\n          foo: expect(\"foo\"),\n          delay: ZalgoPromise.delay,\n          rerender: () => {\n            getBody().removeChild(container);\n            getBody().appendChild(container);\n          },\n\n          run: () => {\n            return `\n                        const instance = window.__component__().remote({\n                            foo: window.xprops.foo,\n                            run: () => \\`\n                                window.xprops.export({\n                                    exec: (code) => eval(code)\n                                });\n                            \\`\n                        });\n                        \n                        instance.renderTo(window.parent, '#remote-element-id').then(() => {\n                            return window.xprops.delay(50);\n                        }).then(() => {\n                            return window.xprops.rerender();\n                        }).then(() => {\n                            return window.xprops.delay(50);\n                        }).then(() => {\n                            return instance.exec(\\`\n                                window.xprops.foo();\n                            \\`);\n                        }).catch(window.xprops.onError);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should render a component to the parent as an iframe and re-render when the container is removed and immediately re-added to the dom during render\", () => {\n    return wrapPromise(({ expect, avoid }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-rerender-during-render-renderto-iframe-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-rerender-during-render-renderto-iframe-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n            exports: ({ getExports }) => {\n              return {\n                exec: (...args) => {\n                  return getExports().then((exports) => {\n                    return exports.exec(...args);\n                  });\n                },\n              };\n            },\n          }),\n        };\n      };\n\n      const container = document.createElement(\"div\");\n      container.id = \"remote-element-id\";\n      getBody().appendChild(container);\n\n      return window\n        .__component__()\n        .simple({\n          onRendered: expect(\"onRendered\"),\n          onClose: avoid(\"onClose\"),\n          onDestroy: avoid(\"onDestroy\"),\n          onError: avoid(\"onError\"),\n          foo: expect(\"foo\"),\n          delay: ZalgoPromise.delay,\n          rerender: () => {\n            getBody().removeChild(container);\n            getBody().appendChild(container);\n          },\n\n          run: () => {\n            return `\n                        const instance = window.__component__().remote({\n                            foo: window.xprops.foo,\n                            run: () => \\`\n                                window.xprops.export({\n                                    exec: (code) => eval(code)\n                                });\n                            \\`\n                        });\n\n                        const renderPromise = instance.renderTo(window.parent, '#remote-element-id');\n\n                        return window.xprops.rerender().then(() => {\n                            return renderPromise;\n                        }).then(() => {\n                            return window.xprops.delay(500);\n                        }).then(() => {\n                            return instance.exec(\\`\n                                window.xprops.foo();\n                            \\`);\n                        }).catch(window.xprops.onError);\n                    `;\n          },\n        })\n        .render(getBody());\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/validation.js",
    "content": "/* @flow */\n\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\n\nimport { zoid } from \"../zoid\";\nimport { getBody } from \"../common\";\n\ndescribe(\"zoid validation errors\", () => {\n  function expectError(description, method): ZalgoPromise<void> {\n    let error;\n\n    return ZalgoPromise.try(method)\n      .catch((err) => {\n        error = err;\n      })\n      .then(() => {\n        if (!(error instanceof Error)) {\n          throw new TypeError(`Expected Error for use case: ${description}`);\n        }\n      });\n  }\n\n  it(\"should throw validation errors when a component is created with no options\", () => {\n    return expectError(\"Empty options\", () => {\n      // $FlowFixMe\n      zoid.create();\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Empty options\", () => {\n    return expectError(\"Empty options\", () => {\n      // $FlowFixMe\n      zoid.create({});\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with no tag\", () => {\n    return expectError(\"Empty options\", () => {\n      // $FlowFixMe\n      zoid.create({\n        url: \"http://foo.com/bar\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with no url\", () => {\n    return expectError(\"Empty options\", () => {\n      // $FlowFixMe\n      zoid.create({\n        tag: \"my-component-no-url\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with trailing dash in tag name\", () => {\n    return expectError(\"Malformed tag name\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with leading dash in tag name\", () => {\n    return expectError(\"Malformed tag name\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"-my-component\",\n      });\n    });\n  });\n\n  it(\"should NOT throw validation errors when a component is created NO dash in tag name\", () => {\n    return zoid.create({\n      url: \"http://foo.com/bar\",\n      tag: \"component\",\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Special chars in tag name\", () => {\n    return expectError(\"Special chars in tag name\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"special$%&-chars\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with String passed for dimensions\", () => {\n    return expectError(\"String passed for dimensions\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-string-dimensions\",\n        // $FlowFixMe\n        dimensions: \"moo\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Empty options passed for dimensions\", () => {\n    return expectError(\"Empty options passed for dimensions\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-empty-dimensions\",\n        // $FlowFixMe\n        dimensions: {},\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Strings passed for dimensions\", () => {\n    return expectError(\"Strings passed for dimensions\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-string-dimensions-object\",\n        dimensions: {\n          height: \"foo\",\n          width: \"bar\",\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with String passed for height\", () => {\n    return expectError(\"String passed for height\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-string-height\",\n        dimensions: {\n          height: \"foo\",\n          width: \"50px\",\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with String passed for width\", () => {\n    return expectError(\"String passed for height\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-string-width\",\n        dimensions: {\n          height: \"50px\",\n          width: \"foo\",\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Props passed as string\", () => {\n    return expectError(\"Props passed as string\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-props-string\",\n        // $FlowFixMe\n        props: \"foo\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Prop passed as string\", () => {\n    return expectError(\"Prop passed as string\", () => {\n      zoid.create({\n        tag: \"my-component-prop-string\",\n        url: \"http://zombo.com\",\n        props: {\n          // $FlowFixMe\n          moo: \"wat\",\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Invalid prop type passed\", () => {\n    return expectError(\"Invalid prop type passed\", () => {\n      zoid.create({\n        tag: \"my-component-invalid-prop-type\",\n        url: \"http://zombo.com\",\n        props: {\n          // $FlowFixMe\n          moo: {\n            type: \"invalid\",\n          },\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Empty prop definition\", () => {\n    return expectError(\"Empty prop definition\", () => {\n      zoid.create({\n        tag: \"my-component-no-prop-type\",\n        url: \"http://zombo.com\",\n        props: {\n          // $FlowFixMe\n          onSomething: {},\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Required and default passed\", () => {\n    return expectError(\"Required and default passed\", () => {\n      zoid.create({\n        tag: \"my-component-required-and-default\",\n        url: \"http://zombo.com\",\n        props: {\n          onSomething: {\n            type: \"function\",\n            required: true,\n            default: () => {\n              return () => {\n                // pass\n              };\n            },\n          },\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with non-function passed for prerenderTemplate\", () => {\n    return expectError(\"String passed for height\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-prerender-non-function\",\n        // $FlowFixMe\n        prerenderTemplate: \"foo\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with non-function passed for containerTemplate\", () => {\n    return expectError(\"String passed for height\", () => {\n      zoid.create({\n        url: \"http://foo.com/bar\",\n        tag: \"my-component-container-non-function\",\n        // $FlowFixMe\n        containerTemplate: \"foo\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Invalid default context\", () => {\n    return expectError(\"Invalid default context\", () => {\n      zoid.create({\n        tag: \"my-component-invalid-default-context\",\n        url: \"http://zombo.com\",\n        // $FlowFixMe\n        defaultContext: \"moo\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with Invalid url passed\", () => {\n    return expectError(\"Invalid url passed\", () => {\n      zoid.create({\n        tag: \"my-component-invalid-url\",\n        // $FlowFixMe\n        url: 12345,\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is rendered with String passed for function prop\", () => {\n    return expectError(\"String passed for function prop\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-string-passed-as-function-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            functionProp: {\n              type: \"function\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        functionProp: \"foobar\",\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is rendered with Object passed for string prop\", () => {\n    return expectError(\"Object passed for string prop\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-object-passed-as-string-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            stringProp: {\n              type: \"string\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        stringProp() {\n          /* pass */\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is rendered with Object passed as number prop\", () => {\n    return expectError(\"Object passed as number prop\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-object-passed-as-number-prop\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            numberProp: {\n              type: \"number\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        numberProp() {\n          /* pass */\n        },\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is rendered with Unserializable object passed for object prop\", () => {\n    return expectError(\"Unserializable object passed for object prop\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-unserializable-object\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            objectProp: {\n              type: \"object\",\n            },\n          },\n        });\n      };\n\n      const obj = {};\n      obj.obj = obj;\n\n      const component = window.__component__();\n      return component({\n        objectProp: obj,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should throw validation errors when a component is rendered with object passed for array prop\", () => {\n    return expectError(\"Object passed for array\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-object-passed-for-array\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            arrayProp: {\n              type: \"array\",\n            },\n          },\n        });\n      };\n\n      const component = window.__component__();\n      return component({\n        arrayProp: {},\n      });\n    });\n  });\n\n  it(\"should throw validation errors when a component is rendered with no props passed\", () => {\n    return expectError(\"No props passed\", () => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-no-props-passed-when-required\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n          props: {\n            functionProp: {\n              type: \"function\",\n            },\n          },\n        });\n      };\n\n      return window.__component__()().render(getBody());\n    });\n  });\n\n  it(\"should throw validation errors when a component is created with a function prop with queryParam true\", () => {\n    return expectError(\"Function queryParam true\", () => {\n      return zoid.create({\n        tag: \"test-render-function-queryparam-true\",\n        url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n        domain: \"mock://www.child.com\",\n        props: {\n          functionProp: {\n            type: \"function\",\n            queryParam: true,\n          },\n        },\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/tests/window.js",
    "content": "/* @flow */\n/* eslint max-nested-callbacks: off */\n\nimport { send, once } from \"@krakenjs/post-robot/src\";\nimport { uniqueID, wrapPromise } from \"@krakenjs/belter/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\n\nimport { runOnClick, getBody } from \"../common\";\nimport { zoid } from \"../zoid\";\n\ndescribe(\"zoid window prop cases\", () => {\n  it(\"should pass a custom iframe to a component\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-iframe\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const body = getBody();\n      if (!body) {\n        throw new Error(`Can not find body`);\n      }\n\n      const frame = document.createElement(\"iframe\");\n      body.appendChild(frame);\n      const win = frame.contentWindow;\n      const uid = uniqueID();\n\n      const component = window.__component__();\n      return component({\n        window: win,\n\n        passUIDGetter: expect(`passUIDGetter`, (getUID) => {\n          return send(win, \"eval\", {\n            code: `\n                            window.uid = ${JSON.stringify(uid)};\n                        `,\n          })\n            .then(() => {\n              return getUID();\n            })\n            .then((childUID) => {\n              if (childUID !== uid) {\n                throw new Error(`Expected uid to match`);\n              }\n            });\n        }),\n\n        run: () => `\n                    window.xprops.passUIDGetter(() => window.uid);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should pass a custom iframe to a component, and close the zoid component\", () => {\n    return wrapPromise(() => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-iframe-close\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const body = getBody();\n      if (!body) {\n        throw new Error(`Can not find body`);\n      }\n\n      const frame = document.createElement(\"iframe\");\n      body.appendChild(frame);\n      const win = frame.contentWindow;\n\n      const component = window.__component__();\n      const instance = component({\n        window: win,\n      });\n\n      return instance\n        .render(getBody())\n        .then(() => {\n          return instance.close();\n        })\n        .then(() => {\n          if (!win.closed) {\n            throw new Error(`Expected iframe to be closed`);\n          }\n\n          if (body.contains(frame)) {\n            throw new Error(`Expected iframe to be removed from dom`);\n          }\n        });\n    });\n  });\n\n  it(\"should pass a custom popup to a component\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const win = runOnClick(() => {\n        return window.open(\"\", \"\");\n      });\n      const uid = uniqueID();\n\n      const component = window.__component__();\n      return component({\n        window: win,\n\n        passUIDGetter: expect(`passUIDGetter`, (getUID) => {\n          return send(win, \"eval\", {\n            code: `\n                            window.uid = ${JSON.stringify(uid)};\n                        `,\n          })\n            .then(() => {\n              return getUID();\n            })\n            .then((childUID) => {\n              if (childUID !== uid) {\n                throw new Error(`Expected uid to match`);\n              }\n            });\n        }),\n\n        run: () => `\n                    window.xprops.passUIDGetter(() => window.uid);\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should pass a custom popup to a component, and close the zoid component\", () => {\n    return wrapPromise(() => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-popup-close\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const win = runOnClick(() => {\n        return window.open(\"\", \"\");\n      });\n\n      const component = window.__component__();\n      const instance = component({\n        window: win,\n      });\n\n      return instance\n        .render(getBody())\n        .then(() => {\n          return instance.close();\n        })\n        .then(() => {\n          if (!win.closed) {\n            throw new Error(`Expected popup to be closed`);\n          }\n        });\n    });\n  });\n\n  it(\"should pass a custom popup to a component and close it\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-close-popup\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const win = runOnClick(() => {\n        return window.open(\"\", \"\");\n      });\n\n      const component = window.__component__();\n      return component({\n        window: win,\n\n        onClose: expect(\"onClose\"),\n\n        doClose: expect(\"doClose\", () => {\n          win.close();\n        }),\n\n        run: () => `\n                    window.xprops.doClose();\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should pass a custom iframe to a component and close it\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-close-iframe\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const body = getBody();\n      if (!body) {\n        throw new Error(`Can not find body`);\n      }\n\n      const frame = document.createElement(\"iframe\");\n      body.appendChild(frame);\n      const win = frame.contentWindow;\n\n      const component = window.__component__();\n      return component({\n        window: win,\n\n        onClose: expect(\"onClose\"),\n\n        doClose: expect(\"doClose\", () => {\n          body.removeChild(frame);\n        }),\n\n        run: () => `\n                    window.xprops.doClose();\n                `,\n      }).render(getBody());\n    });\n  });\n\n  it(\"should renderTo with a custom iframe passed through an iframe\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-custom-iframe-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-custom-iframe-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const body = getBody();\n      if (!body) {\n        throw new Error(`Can not find body`);\n      }\n\n      const frame = document.createElement(\"iframe\");\n      body.appendChild(frame);\n      const win = frame.contentWindow;\n      const uid = uniqueID();\n\n      return window\n        .__component__()\n        .simple({\n          myCustomWindow: win,\n\n          passUIDGetter: expect(`passUIDGetter`, (getUID) => {\n            return send(win, \"eval\", {\n              code: `\n                            window.uid = ${JSON.stringify(uid)};\n                        `,\n            })\n              .then(() => {\n                return getUID();\n              })\n              .then((childUID) => {\n                if (childUID !== uid) {\n                  throw new Error(`Expected uid to match`);\n                }\n              });\n          }),\n\n          run: () => `\n                    window.__component__().remote({\n                        window: window.xprops.myCustomWindow,\n\n                        passUIDGetter: window.xprops.passUIDGetter,\n                        \n                        run: () => \\`\n                            window.xprops.passUIDGetter(() => window.uid);\n                        \\`\n                    }).renderTo(window.parent, 'body');\n                `,\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should renderTo with a custom popup passed through an iframe\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-custom-popup-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-custom-popup-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const win = runOnClick(() => {\n        return window.open(\"\", \"\");\n      });\n      const uid = uniqueID();\n\n      return window\n        .__component__()\n        .simple({\n          myCustomWindow: win,\n\n          passUIDGetter: expect(`passUIDGetter`, (getUID) => {\n            return send(win, \"eval\", {\n              code: `\n                            window.uid = ${JSON.stringify(uid)};\n                        `,\n            })\n              .then(() => {\n                return getUID();\n              })\n              .then((childUID) => {\n                if (childUID !== uid) {\n                  throw new Error(`Expected uid to match`);\n                }\n              });\n          }),\n\n          run: () => `\n                    window.__component__().remote({\n                        window: window.xprops.myCustomWindow,\n\n                        passUIDGetter: window.xprops.passUIDGetter,\n                        \n                        run: () => \\`\n                            window.xprops.passUIDGetter(() => window.uid);\n                        \\`\n                    }).renderTo(window.parent, 'body');\n                `,\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should pass a custom popup to a component with a loaded url\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-custom-popup-loaded-url\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const win = runOnClick(() => {\n        return window.open(\n          \"/base/test/windows/basicchild/index.htm\",\n          \"__custom_popup_test__\"\n        );\n      });\n\n      return once(\n        \"initBasicChild\",\n        expect(\"initBasicChild\", () => {\n          const uid = uniqueID();\n\n          const component = window.__component__();\n          return component({\n            window: win,\n\n            passUIDGetter: expect(`passUIDGetter`, (getUID) => {\n              return send(win, \"eval\", {\n                code: `\n                                window.uid = ${JSON.stringify(uid)};\n                            `,\n              })\n                .then(() => {\n                  return getUID();\n                })\n                .then((childUID) => {\n                  if (childUID !== uid) {\n                    throw new Error(`Expected uid to match`);\n                  }\n                });\n            }),\n\n            run: () => `\n                        window.xprops.passUIDGetter(() => window.uid);\n                    `,\n          }).render(getBody());\n        })\n      );\n    });\n  });\n\n  it(\"should renderTo with a custom popup passed through an iframe, and close the popup\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return {\n          simple: zoid.create({\n            tag: \"test-renderto-custom-popup-close-simple\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n\n          remote: zoid.create({\n            tag: \"test-renderto-custom-popup-close-remote\",\n            url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n            domain: \"mock://www.child.com\",\n          }),\n        };\n      };\n\n      const win = runOnClick(() => {\n        return window.open(\"\", \"\");\n      });\n\n      return window\n        .__component__()\n        .simple({\n          myCustomWindow: win,\n\n          customWindowClosed: expect(\"customWindowClosed\"),\n\n          closeCustomWindow: expect(\"closeCustomWindow\", () => {\n            win.close();\n          }),\n\n          run: () => `\n                    window.__component__().remote({\n                        window: window.xprops.myCustomWindow,\n                        onClose: window.xprops.customWindowClosed,\n                        closeCustomWindow: window.xprops.closeCustomWindow,\n                        \n                        run: () => \\`\n                            window.xprops.closeCustomWindow();\n                        \\`\n                    }).renderTo(window.parent, 'body');\n                `,\n        })\n        .render(getBody());\n    });\n  });\n\n  it(\"should error when a non-window is passed\", () => {\n    return wrapPromise(({ expect }) => {\n      window.__component__ = () => {\n        return zoid.create({\n          tag: \"test-render-bogus-window\",\n          url: \"mock://www.child.com/base/test/windows/child/index.htm\",\n          domain: \"mock://www.child.com\",\n        });\n      };\n\n      const component = window.__component__();\n\n      return ZalgoPromise.try(() => {\n        // $FlowFixMe\n        component({\n          window: {\n            location: \"meep\",\n          },\n        });\n      }).catch(expect(\"catch\"));\n    });\n  });\n});\n"
  },
  {
    "path": "test/windows/basicchild/index.htm",
    "content": "<body>\n  <div id=\"container\"></div>\n\n  <script>\n    function getAncestor(win) {\n      if (win.opener) {\n        return win.opener;\n      }\n\n      if (win.parent !== win) {\n        return win.parent;\n      }\n    }\n\n    window.mockDomain = getAncestor(window).mockDomain;\n\n    var parentWindow = window;\n    while (true) {\n      const ancestor = getAncestor(parentWindow);\n\n      if (!ancestor) {\n        break;\n      }\n\n      if (ancestor.zoid || getAncestor(ancestor)) {\n        parentWindow = ancestor;\n      } else {\n        break;\n      }\n    }\n\n    window.console.karma = parentWindow.console.karma;\n    window.navigator.mockUserAgent = parentWindow.navigator.mockUserAgent;\n\n    window.__coverage__ = parentWindow.__coverage__;\n  </script>\n\n  <script src=\"/base/test/zoid.global.js\"></script>\n  <script>\n    window.zoid = __zoid__;\n  </script>\n\n  <script src=\"/base/test/windows/basicchild/index.js\"></script>\n</body>\n"
  },
  {
    "path": "test/windows/basicchild/index.js",
    "content": "/* @flow */\n/* eslint no-eval: off, security/detect-eval-with-expression: off */\n\nimport { setup, send, on, once } from \"@krakenjs/post-robot/src\";\n\nsetup();\n\non(\"sendMessageToParent\", ({ data }) => {\n  return send(window.opener || window.parent, data.messageName, data.data).then(\n    (event) => event.data\n  );\n});\n\non(\"setupListener\", ({ data }) => {\n  once(data.messageName, () => {\n    return data.handler ? data.handler() : data.data;\n  });\n});\n\nsend(window.opener || window.parent, \"initBasicChild\", { win: window });\n"
  },
  {
    "path": "test/windows/bridge/index.htm",
    "content": "<body>\n  <script>\n    function getAncestor(win) {\n      if (win.opener) {\n        return win.opener;\n      }\n\n      if (win.parent !== win) {\n        return win.parent;\n      }\n    }\n\n    var parentWindow = window;\n    while (true) {\n      const ancestor = getAncestor(parentWindow);\n\n      if (!ancestor) {\n        break;\n      }\n\n      if (ancestor.zoid || getAncestor(ancestor)) {\n        parentWindow = ancestor;\n      } else {\n        break;\n      }\n    }\n\n    window.__coverage__ = parentWindow.__coverage__;\n\n    window.mockDomain = \"mock://www.child.com\";\n    window.console.karma = parentWindow.console.karma;\n    window.navigator.mockUserAgent = parentWindow.navigator.mockUserAgent;\n  </script>\n\n  <script src=\"/base/test/windows/bridge/index.js\"></script>\n</body>\n"
  },
  {
    "path": "test/windows/bridge/index.js",
    "content": "/* @flow */\n\nimport { setup } from \"@krakenjs/post-robot/src\";\n\nsetup();\n"
  },
  {
    "path": "test/windows/child/index.htm",
    "content": "<body>\n  <div id=\"container\"></div>\n\n  <script>\n    function getAncestor(win) {\n      if (win.opener) {\n        return win.opener;\n      }\n\n      if (win.parent !== win) {\n        return win.parent;\n      }\n    }\n\n    var parentWindow = window;\n    while (true) {\n      const ancestor = getAncestor(parentWindow);\n\n      if (!ancestor) {\n        break;\n      }\n\n      if (ancestor.zoid || getAncestor(ancestor)) {\n        parentWindow = ancestor;\n      } else {\n        break;\n      }\n    }\n\n    window.__coverage__ = parentWindow.__coverage__;\n  </script>\n\n  <script src=\"/base/test/zoid.global.js\"></script>\n\n  <script>\n    const query = Object.fromEntries(\n      location.search\n        .replace(/^\\?/, \"\")\n        .split(\"&\")\n        .filter(Boolean)\n        .map((entry) => entry.split(\"=\"))\n    );\n\n    window.zoid = __zoid__;\n    window.mockDomain = query.mockDomain || \"mock://www.child.com\";\n\n    window.console.karma = parentWindow.console.karma;\n    window.navigator.mockUserAgent = parentWindow.navigator.mockUserAgent;\n\n    if (parentWindow.__component__) {\n      const parentComponent = parentWindow.__component__\n        .toString()\n        .replace(/zoid\\.zoid/g, \"window.zoid\");\n      window.__component__ = eval(`(${parentComponent})`);\n    }\n  </script>\n\n  <script src=\"/base/test/windows/child/index.js\"></script>\n</body>\n"
  },
  {
    "path": "test/windows/child/index.js",
    "content": "/* @flow */\n/* eslint no-eval: off, security/detect-eval-with-expression: off */\n\nimport { on } from \"@krakenjs/post-robot/src\";\nimport { memoize, destroyElement } from \"@krakenjs/belter/src\";\nimport { ZalgoPromise } from \"@krakenjs/zalgo-promise/src\";\n\nimport { runOnClick } from \"../../common\";\n\nif (window.__component__) {\n  window.__component__ = memoize(window.__component__);\n  window.__component__();\n}\n\nif (!window.xprops) {\n  setTimeout(() => {\n    window.close();\n    if (window.frameElement) {\n      destroyElement(window.frameElement);\n    }\n  }, 1);\n  throw new Error(`No xprops found`);\n}\n\nconst xEval = (code) => {\n  return ZalgoPromise.try(() => {\n    return eval(\n      `(function() { ${code.replace(/zoid\\.zoid/g, \"window.zoid\")} })()`\n    );\n  }).catch((err) => {\n    window.xprops.onError(err);\n  });\n};\n\non(\"eval\", ({ data: { code } }) => {\n  return xEval(code);\n});\n\nif (window.xprops.run) {\n  window.xprops\n    .run()\n    .then((code) => {\n      const wrappedCode = `(function() { ${code} }).call(this);`;\n\n      if (window.xprops.runOnClick) {\n        runOnClick(() => {\n          xEval(wrappedCode);\n        });\n      } else {\n        xEval(wrappedCode);\n      }\n    })\n    .then(() => {\n      if (window.xprops.postRun) {\n        return window.xprops.postRun();\n      }\n    });\n}\n"
  },
  {
    "path": "test/zoid.global.js",
    "content": "/* @flow */\n\n// eslint-disable-next-line import/no-namespace\nimport * as _zoid from \"../src/index\";\n\nwindow.__zoid__ = _zoid;\n"
  },
  {
    "path": "test/zoid.js",
    "content": "/* @flow */\n\nimport type { Zoid } from \"../src/index\";\n\nexport const zoid: Zoid = window.__zoid__;\n"
  },
  {
    "path": "webpack.config.js",
    "content": "/* @flow */\n/* eslint import/no-nodejs-modules: off, import/no-default-export: off */\n\nimport type { WebpackConfig } from \"@krakenjs/webpack-config-grumbler/index.flow\";\nimport {\n  getWebpackConfig,\n  getNextVersion,\n} from \"@krakenjs/webpack-config-grumbler\";\nimport { argv } from \"yargs\";\n\nimport pkg from \"./package.json\";\nimport globals from \"./globals\";\n\nconst __NEXT_VERSION__ = getNextVersion(pkg, argv.level);\n\nconst zoidGlobals = {\n  ...globals,\n\n  __ZOID__: {\n    ...globals.__ZOID__,\n    __VERSION__: __NEXT_VERSION__,\n    __GLOBAL_KEY__: `__zoid_${__NEXT_VERSION__}__`,\n  },\n};\n\nexport const FILE_NAME = \"zoid\";\nexport const MODULE_NAME = \"zoid\";\n\nexport const WEBPACK_CONFIG: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.js`,\n  modulename: MODULE_NAME,\n  vars: zoidGlobals,\n  minify: false,\n});\n\nexport const WEBPACK_CONFIG_MIN: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.min.js`,\n  modulename: MODULE_NAME,\n  minify: true,\n  vars: zoidGlobals,\n});\n\nexport const WEBPACK_CONFIG_FRAME: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.frame.js`,\n  modulename: MODULE_NAME,\n  minify: false,\n  vars: {\n    ...zoidGlobals,\n\n    __POST_ROBOT__: {\n      ...zoidGlobals.__POST_ROBOT__,\n      __IE_POPUP_SUPPORT__: false,\n    },\n\n    __ZOID__: {\n      ...zoidGlobals.__ZOID__,\n      __DEFAULT_PRERENDER__: false,\n      __POPUP_SUPPORT__: false,\n    },\n  },\n});\n\nexport const WEBPACK_CONFIG_FRAME_MIN: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.frame.min.js`,\n  modulename: MODULE_NAME,\n  minify: true,\n  vars: {\n    ...zoidGlobals,\n\n    __POST_ROBOT__: {\n      ...zoidGlobals.__POST_ROBOT__,\n      __IE_POPUP_SUPPORT__: false,\n    },\n\n    __ZOID__: {\n      ...zoidGlobals.__ZOID__,\n      __DEFAULT_PRERENDER__: false,\n      __POPUP_SUPPORT__: false,\n    },\n  },\n});\n\nexport const WEBPACK_CONFIG_FRAMEWORK: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.frameworks.js`,\n  modulename: MODULE_NAME,\n  minify: false,\n  vars: {\n    ...zoidGlobals,\n\n    __POST_ROBOT__: {\n      ...zoidGlobals.__POST_ROBOT__,\n      __IE_POPUP_SUPPORT__: true,\n    },\n\n    __ZOID__: {\n      ...zoidGlobals.__ZOID__,\n      __POPUP_SUPPORT__: true,\n      __FRAMEWORK_SUPPORT__: true,\n    },\n  },\n});\n\nexport const WEBPACK_CONFIG_FRAMEWORK_MIN: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.frameworks.min.js`,\n  modulename: MODULE_NAME,\n  minify: true,\n  vars: {\n    ...zoidGlobals,\n\n    __POST_ROBOT__: {\n      ...zoidGlobals.__POST_ROBOT__,\n      __IE_POPUP_SUPPORT__: true,\n    },\n\n    __ZOID__: {\n      ...zoidGlobals.__ZOID__,\n      __POPUP_SUPPORT__: true,\n      __FRAMEWORK_SUPPORT__: true,\n    },\n  },\n});\n\nexport const WEBPACK_CONFIG_FRAMEWORK_FRAME: WebpackConfig = getWebpackConfig({\n  filename: `${FILE_NAME}.frameworks.frame.js`,\n  modulename: MODULE_NAME,\n  minify: false,\n  vars: {\n    ...zoidGlobals,\n\n    __POST_ROBOT__: {\n      ...zoidGlobals.__POST_ROBOT__,\n      __IE_POPUP_SUPPORT__: false,\n    },\n\n    __ZOID__: {\n      ...zoidGlobals.__ZOID__,\n      __POPUP_SUPPORT__: false,\n      __FRAMEWORK_SUPPORT__: true,\n    },\n  },\n});\n\nexport const WEBPACK_CONFIG_FRAMEWORK_FRAME_MIN: WebpackConfig =\n  getWebpackConfig({\n    filename: `${FILE_NAME}.frameworks.frame.min.js`,\n    modulename: MODULE_NAME,\n    minify: true,\n    vars: {\n      ...zoidGlobals,\n\n      __POST_ROBOT__: {\n        ...zoidGlobals.__POST_ROBOT__,\n        __IE_POPUP_SUPPORT__: false,\n      },\n\n      __ZOID__: {\n        ...zoidGlobals.__ZOID__,\n        __POPUP_SUPPORT__: false,\n        __FRAMEWORK_SUPPORT__: true,\n      },\n    },\n  });\n\nexport const WEBPACK_CONFIG_TEST: WebpackConfig = getWebpackConfig({\n  test: true,\n  entry: \"./test/zoid.js\",\n  libraryTarget: undefined,\n  vars: {\n    ...zoidGlobals,\n\n    __ZOID__: {\n      ...zoidGlobals.__ZOID__,\n      __POPUP_SUPPORT__: true,\n      __FRAMEWORK_SUPPORT__: true,\n    },\n  },\n});\n\nexport default [\n  WEBPACK_CONFIG,\n  WEBPACK_CONFIG_MIN,\n  WEBPACK_CONFIG_FRAME,\n  WEBPACK_CONFIG_FRAME_MIN,\n  WEBPACK_CONFIG_FRAMEWORK,\n  WEBPACK_CONFIG_FRAMEWORK_MIN,\n  WEBPACK_CONFIG_FRAMEWORK_FRAME,\n  WEBPACK_CONFIG_FRAMEWORK_FRAME_MIN,\n];\n"
  }
]